Example 6, Sequential I/O - CAI Networks WebControl PLC User Manual

Programmable logic controller
Table of Contents

Advertisement

RET
checkOP3:
ADD AIP1 AIP2 RAM1
TSTGT RAM1 1024
BNZ l1
TSTEQ IP4 1
BNZ l2
RET
l1:
SET O3 1
RET
l2:
SET O3 0
RET
checkOP4:
TSTEQ OP1 1 OP4
RET
Please note in this example, we assume the TTL input, analog input and temperature
reading are all perfect, no bouncing up and down. In reality, you have to add
consideration to it.

6.4.6 Example 6, Sequential I/O

The following simple program shows how to set-up sequential I/O.
OP1 is set when IP1 rises from 0 to 1
OP4 is cleared when IP1 rises from 0 to 1
OP1 is cleared when O4 == 1
OP2 is set when T3 > 25 AND OP1 == 1
OP2 is cleared when OP1 == 0
EMAIL1 is sent when OP2 is set
O4 is set when OP2 == 1 for more than 1 second
The assembly language written for the above scenario would be as follows:
START
BNZ IP1 start
l1:
TSTEQ IP1 1
BZ l1
SET OP1 1
SET OP4 0
l2:
TSTGT T3 250 RAM1
Copyright(c) 2008,-2013 CAI Networks, Inc.
TM
WebControl
PLC User Guide Version 3.02.17f
34

Advertisement

Table of Contents
loading

Table of Contents