| ld | sv-101 | // get valve status | |
| and | pmp-101on | // and pump motor signal | |
| // both must be on to simulate flow | |||
| jmpc | Flow100 | // set for 100 hz signal | |
| ld | 0 | // no flow so shut off signal generator | |
| jmp | UpFlow | // update signal generator | |
| Flow100: | ld | 1 | // set for 100 hz signal |
| UpFlow: | sig | flow-100 | // set output |
| ld | 5 | // set for 5 seconds open and close | |
| st | T#LS102Ton.pt | // set timer program time - Ton | |
| st | T#LS102Tof.pt | // set timer program time - Tof | |
| ld | sv-102 | // get solenoid status of valve | |
| st | T#LS102Tof.in | // gate for timer -- if solenoid on | |
| ton | T#LS102Ton | // Do Timer timer on logic | |
| st | T#LS102Tof.in | // gate for timer -- if solenoid off | |
| tof | T#LS102Tof | // Do Timer timer off logic | |
| jmpc | SlowOpen | // jmp if solenoid valve active | |
| ld | T#LS102Tof.ot | // get status of TOF timer | |
| jmp | UpdateLS102 | // Update valve status | |
| SlowOpen: | ld | T#LS102Ton.ot | // get status of timer |
| UpdateLS102: | stn | ls-av102 | // update status of limit switch |
| ld | sv-101 | // get valve status | |
| and | pmp-101on | // and pump motor signal | |
| // both must be on to simulate filling | |||
| jmpcn | NotFill | // jump if not filling | |
| ld | Lv-101 | get current tank level | |
| add | 1 | // increase level (update d/a - 4 - 20ma) | |
| st | Lv-101 | // update level | |
| NotFill: | // simulate material draining from tank if discharge | ||
| ld | sv-101a | // valve open | |
| jmpcn | NotDis | // jump if valve not open | |
| ld | Lv-101 | // get current level | |
| sub | 1 | // decrease d/a count by one | |
| st | Lv-101 | // update level | |
| NotDis: |
| ld | pmp-101on | // motor control run signal | |
| st | pmp-101run | // update motor running contact |
| Start: | ld | sv-101 | // Current condition of Fill valve |
| stn | ls-av-101 | // simulate status of valve to controller | |
| ld | sv-101a | // Current condition of discharge valve | |
| stn | ls-av101a | // simulate status of valve to controller |
|
IL Operators
| Function |
|
ld
| Load the operand value into the IL register |
|
ldn
| Load the negation of operand value into the IL register |
|
st
| Store the IL register into the operand |
|
stn
| Store the negation of the IL register into the operand |
|
s
| Sets the operand to 1 if IL register equals True |
|
r
| Sets the operand to 0 if IL register equals True |
|
and
| And's the operand with IL register - result stored in IL register |
|
or
| Or's the operand with IL register - result stored in IL register |
|
xor
| Xor's the operand with IL register - result stored in IL register |
|
add
| Adds the operand with the IL register - result stored in IL register |
|
sub
| Subtracts the operand with the IL register - result stored in IL register |
|
mul
| Multiples the operand with the IL register - result stored in IL register |
|
div
| Divides IL register by the operand - result stored in IL register |
|
gt
| If IL register is > operand - IL reg set to True otherwise set to False |
|
ge
| If IL register is >= operand - IL reg set to True otherwise set to False |
|
eq
| If IL register is = operand - IL reg set to True otherwise set to False |
|
ne
| If IL register is <> operand - IL reg set to True otherwise set toFalse |
|
le
| If IL register is <= operand - IL reg set to True otherwise set to False |
|
lt
| If IL register is < operand - IL reg set to True otherwise set to False |
|
jmp
| Program jumps to label specified in operand |
|
jmpc
| Program jumps to label specified in operand if IL reg. = True |
|
jmpcn
| Program jumps to label specified in operand if IL reg. = False |
|
Extended Instr.
| |
|
ton
| Timer on logic for timer specified in operand |
|
toff
| Timer off logic for timer specified in operand |
|
tp
| Pulse logic for timer specified in operand |
|
sig
| Sets operand to signal generator with divider specifiied in IL reg |
| Label | Operator | Operand | Comments |
| Start: | ld | PMP101 | // Motor On Signal from Controller |
| st | PmpRun101 | // Set Status of motor to controller |