MOVITRAC
®
31.. PROFIBUS Fieldbus Interface
59
Program Example
6
Function blocks:
FB101
FB 102
Network 1
Name :DP-READ
E/A/D/B/T/Z: E
BI/BY/W/D: BI
Des
:READ
Des
:BUSY
Network 1
Name :DP-WRITE
E/A/D/B/T/Z: E
BI/BY/W/D: BI
Des
:WRIT
Des
:BUSY
:UN
=READ
:BEB
:
:L
PW 184
:T
MW 184
:
:U
=BUSY
:SPB =CHEK
:
:
:L
KH
3100
:T
MW 194
:
:L
KF
+1025
:T
PW 186
:
:UN
M
184.6
:S
M
194.6
:U
M
184.6
:R
M
194.6
:
SEND :L
MW 194
:T
PW 184
:
:S
=BUSY
:
CHEK :U
M
184.6
:UN
M
194.6
:0)
:UN
M
184.6
01
:U
M
194.6
01
:)
01
:BEB
:
:
:
:L
PW 186
:T
MW 186
:
:
:
:L
PW 188
:T
MW 188
:L
PW 190
:T
MW 190
:RB
=BUSY
:RB
=READ
:
:BE
IF (do not execute FB)
THEN end of block
ELSE
Store received administration
byte temporarily
IF (service execution active)
THEN = continue with
evaluation
ELSE
Execute new read service
Index 1025 =
P120 T11 ramp UP
IF (received handshake bit = 0)
THEN send-handshake bit = 1
ELSE send-handshake bit = 0
Send administration byte
Wait for service confirmation
IF ((received handshake bit = 1
AND sent handshake bit = 0)
OR
(received handshake bit = 0
AND sent handshake bit = 1))
THEN end of block
ELSE
Service confirmation received
Save recommended parameter
index
in case of fault (M184.7 = 1)
the fault code is displayed
otherwise the data read
Data high or
Error class, error code
Data low or
Additional code high, low
Enable service execution and
repeated execution of the FB
:UN
=WRITE
:BEB
:
:L
PW 184
:T
MW 184
:
:U
=BUSY
:SPB =CHEK
:
:
:L
KH
3200
:T
MW 194
:
:L
KF
+1025
:T
PW 186
:
:
:L
KH
0000
:T
PW 188
:L
KH
0950
:T
PW 188
:
:
:UN
M
184.6
:S
M
194.6
:U
M
184.6
:R
M
194.6
:
SEND :L
MW 194
:T
PW 184
:
:S
=BUSY
:
CHEK :U
M
184.6
:UN
M
194.6
:0)
:UN
M
184.6
01
:U
M
194.6
01
:)
01
:BEB
:
:
:
:L
PW 186
:T
MW 186
:
:
:
:L
PW 188
:T
MW 188
:L
PW 190
:T
MW 190
:RB
=BUSY
:RB
=READ
:
:BE
IF (do not execute FB)
THEN end of block
ELSE
store received administration
byte temporarily
IF (service execution active)
THEN = continue with
evaluation
ELSE
Execute new WRITE service
Index 1025 =
Write
P120 T11 ramp UP
Write BCD data 00 00 09 50
for 9.50 s
IF (received handshake bit = 0)
THEN send-handshake bit =1
ELSE send-handshake bit =0
Send administration byte
Wait for service confirmation
IF ((received handshake bit = 1
AND sent handshake bit = 0)
OR
(received handshake bit = 0
AND sent handshake bit = 1))
THEN end of block
ELSE
Service confirmation received
Save recommended parameter
index in case of fault
(M184.7 = 1)
the fault code is displayed
Error class, error code
Additional code high, low
Enable service execution and
repeated execution of the FB
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]