Saia-Burgess Controls AG
Manual for PCD2.W745 and PCD3.W745
│
Document 26-796 E
NG06 │ 2018-10-12
Appendix
A
A-5
Programming examples for PCD Classic systems
Use of FB Exec in COB 0: (with 100 ms timer example)
(Located in cob0.src)
$INCLUDE D2W745_b.equ ;makes the FB’s available in the file
cob0.src
COB 0
0
; ... ;Other code in COB 0
; ...
;------------------ Example to implement a 100ms timer
STL T 0 ;if time elapsed, ACC:=1
JR L go_on ;ACC=0 -> No access to the W745
LD T 0 ;Set timer 0 to 100ms
T#100MS
;------------------ W745 access
CFB W745.Status ;Check W745 Status
K 1 ;[K] Module Number
F 20 ;[F] MeasRunning
F 21 ;[F] DiagRunning
F 22 ;[F] ComRunning
CFB W745.Exec ;Read Measurement values and diag from
W745
K 1 ;[K] Module Number
R 0 ;[R] Temperature CH0
F 0 ;[F] Overrange CH0
F 1 ;[F] Underrange CH0
F 2 ;[F] SensorFail CH0
R 1 ;[R] Temperature CH1
F 3 ;[F] Overrange CH1
F 4 ;[F] Underrange CH1
F 5 ;[F] SensorFail CH1
R 2 ;[R] Temperature CH2
F 6 ;[F] Overrange CH2
F 7 ;[F] Underrange CH2
F 8 ;[F] SensorFail CH2
R 3 ;[R] Temperature CH3
F 9 ;[F] Overrange CH3
F 10 ;[F] Underrange CH3
F 11 ;[F] SensorFail CH3
F 12 ;[F] ModuleNoResponse
;------------------
go_on:
; ... ;Other code in COB 0
; ...
ECOB