Let's watch what happens in this program scan by scan.
Initially the tank is empty. Therefore, input 0000 is TRUE and input 0001 is also TRUE.
Scan 1 | Scan 2-100 |
After 100 scans the oil level rises above the low level sensor and it becomes open. (i.e. FALSE)
Scan 101-1000
After 1000 scans the oil level rises above the high level sensor at it also becomes open (i.e. false)
Scan 1001 | Scan 1002 |
Since there is no more true logic path, output 500 is no longer energized (true) and therefore the motor turns off.
After 1050 scans the oil level falls below the high level sensor and it will become true again.
Scan 1050
After 2000 scans the oil level falls below the low level sensor and it will also become true again. At this point the logic will appear the same as SCAN 1 above and the logic will repeat as illustrated above.
0 comments:
Post a Comment