Example 3: Push Button Input Control Output; Example 4: Send Email - CAI Networks WebControl PLC User Manual

Programmable logic controller
Table of Contents

Advertisement

6.4.3 Example 3: Push Button Input Control Output

When a push button connected to TTL input 1 being pushed, set the TTL output 3
ON.
START
TSTEQ IP1 1 OP3
TSTEQ OP3 1
SET OP3 0
END
Although this example works, it has flaw. Because all the pushbutton switches from
market will not have clean instant ON or OFF, they actually produce a bunch of ON
and OFF signals when pushed. If you use a scope to watch IP1 input line or OP3
output line, you will see they are many ON and OFF pulses during pushing or
releasing the button. The better way to handle the case is like Example 10 later in
this manual. However, if TTL OIP1 connected to a clean signal source, this example
does work well.

6.4.4 Example 4: Send EMAIL

To send email 1 when T3 – T2 >= 20 degrees you would use:
START
SUB T3 T2 RAM1
TSTGE RAM1 200
EMAIL EM1
END
The above rule is a bit too simple because an email will constantly be generated
while RAM1 is greater than or equal to 200. (20 degrees in this case) To guard
against that the following logic should be considered. This implementation will only
send one email when the temperature comparison beyond the range. If you turn on
heater or cooler instead of sending email, similar consideration also should be
excised:
START
SET RAM2 0
LOOP:
SUB T3 T2 RAM1
TSTGE RAM1 200 RAM1
GOTO SEND
SET RAM2 0
GOTO LOOP
END
SEND:
Copyright(c) 2008,-2013 CAI Networks, Inc.
TM
WebControl
PLC User Guide Version 3.02.17f
32

Advertisement

Table of Contents
loading

Table of Contents