Examples for Instruction Lists (IL)
552
Unrestricted
SICAM A8000 / CP-8000 • CP-8021 • CP-8022 Manual
DC8-037-2.02, Edition 10.2017
B.7
Speed Comparison
PLC_RESET:
LD 100
ST PLC_CYCLETIME
(*cycle time in ms*)
PLC_INIT:
LD 1000
(*drop off delay in ms*)
ST TOF_FLAENDSTEIG0.PT
ST TOF_FLAENDFALL0.PT
PLC_START:
(*Check speed value on change*)
LD I_034_016_000_000.S
(*load spontaneous bit speed value*)
JMPN NO_CHANGE
(*jump if no change of value*)
(*Change of speed value present*)
LD
I_034_016_000_000.VALUE
(*load speed value*)
ST M_REAL_WERTNEU
(*current speed value to flag*)
ST SUB.IN0
LD M_REAL_WERTALT
(*load old speed value*)
ST SUB.IN1
CAL SUB
(*form difference value*)
ST M_REAL_WERTDIF
(*difference value to flag*)
(*Take over change of value*)
LD M_REAL_WERTNEU
(*load current value*)
ST M_REAL_WERTALT
(*save current value for next *)
(*change of value*)
(*Value comparison speed ascending*)
LD M_REAL_WERTDIF
(*load diff. value*)
ST GT.IN0
LD 0
ST GT.IN1
CAL GT
(*diff. value > 0: speed ascending*)
ST
M_BOOL_DZST
(*set flag speed ascending*)
(*Value comparison speed descending*)
LD M_REAL_WERTDIF
(*load diff. value*)
ST LT.IN0
LD 0
ST LT.IN1
CAL LT
(*diff. value < 0: speed descending*)
ST M_BOOL_DZFA
(*set flag speed descending*)
NO_CHANGE:
(*jump mark if no change of value*)
(*Drop-off delay speed ascending*)
LD M_BOOL_DZST
(*load flag speed ascending*)
ST TOF_FLAENDSTEIG0.IN
CAL TOF_FLAENDSTEIG0
(*drop-off delay*)
LD TOF_FLAENDSTEIG0.Q
ST
O_030_048_000_000.VALUE
(*reset output*)
(*Drop-off delay speed descending*)
LD M_BOOL_DZFA
(*load flag speed descending*)
ST TOF_FLAENDFALL0.IN
CAL TOF_FLAENDFALL0
(*drop-off delay*)
LD TOF_FLAENDFALL0.Q
ST
O_030_049_000_000.VALUE
(*set binary output*)
(*Reset flags for speed ascending, descending*)
LD 0
ST M_BOOL_DZST
(*reset flag speed ascending*)
ST M_BOOL_DZFA
(*reset flag speed descending*)
Summary of Contents for CP-8000
Page 604: ......