Download opennet controller - Steven Engineering
Transcript
10: DATA COMPARISON INSTRUCTIONS Valid Operands Operand Function I Q M R T C D L Constant Repeat S1 (Source 1) Data to compare X X X X X X X X X 1-99 S2 (Source 2) Data to compare X X X X X X X X X 1-99 D1 (Destination 1) Comparison output — X ▲ — — — — — — 1-99 For the valid operand number range, see page 6-2. ▲ Internal relays M0 through M2557 can be designated as D1. Special internal relays cannot be designated as D1. When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value is read out. Valid Data Types W (word) I (integer) D (double word) L (long) X X X X When a bit operand such as I (input), Q (output), M (internal relay), or R (shift register) is designated as the source, 16 points (word or integer data type) or 32 points (double-word or long data type) are used. When repeat is designated for a bit operand, the quantity of operand bits increases in 16- or 32-point increments. When a word operand such as T (timer), C (counter), D (data register), or L (link register) is designated as the source, 1 point (word or integer data type) or 2 points (double-word or long data type) are used. When repeat is designated for a word operand, the quantity of operand words increases in 1- or 2-point increments. When an output or internal relay is designated as the destination, only 1 point is used regardless of the selected data type. When repeat is designated for the destination, outputs or internal relays as many as the repeat cycles are used. Examples: CMP>= The comparison output is usually maintained while the input to the data comparison instruction is off. If the comparison output is on, the on status is maintained when the input is turned off as demonstrated by this program. CMP>=(W) I0 S1 – D10 S2 – C1 D1 – Q0 REP Input I0 Comparison Result ON OFF D10 ≥ C1 D10 < C1 Comparison Output Q0 ON OFF Input I0 ON OFF This program turns the output off when the input is off. CMP>=(W) I0 M0 10-2 S1 – D10 S2 – C1 D1 – M0 REP Comparison Result Q0 D10 ≥ C1 D10 < C1 Output Q0 ON OFF OPENNET CONTROLLER USER’S MANUAL