Example 2: Flash Ttl Output - CAI Networks WebControl PLC User Manual

Programmable logic controller
Table of Contents

Advertisement

END
However, this does not work, when temperature reached above 37 degree C, the
OP1 turned off, instead of reaching to 39 degree C. The problem is the OP1 can be
set to ON or OFF by the "TSLE T3 370 OP1" line alone. To reduce heater relay
constantly turning ON and OFF, it is better to have two subroutines to handle the
OP1 state.
START
TSTLE T3 370
CALLSUB HEAT_ON
TSTGT T3 389
CALLSUB HEAT_OFF
END
HEAT_ON:
SET OP1 1
RET
HEAT_OFF:
SET OP1 0
RET
What if the heater relay stuck, or the heater elements burn out? You can add
additional function in this PLC program to send you email notice or sound an alarm
for such a situation.

6.4.2 Example 2: Flash TTL output

Flashes output 2 at a rate of 1Hz. (Please note OP2[500] has no space in between
which delays 500ms). Please note the delay function used in this example, which is
non-blocking, that means the PLC logic will immediately execute next TSTEQ
instruction until the delay is over.
START
TSTEQ OP2[500] 0
SET OP2 1
TSTEQ OP2[500] 1
SET OP2 0
END
Another way to implement this is:
START
XOR OP2 1 OP2
DELAY 500
END
Copyright(c) 2008,-2013 CAI Networks, Inc.
TM
WebControl
PLC User Guide Version 3.02.17f
31

Advertisement

Table of Contents
loading

Table of Contents