3. Instruction Set
API
Mnemonic Operands Function
315
XCMP
S
1
, S
2,
S
3,
S
4,
D
Setting up to compare the
inputs of multiple work
stations
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D E F
XCMP: 11 steps
ES2/EX2
SS2
SE
ES2/EX2 SS2
SE
ES2/EX2
SS2
SE
Operands:
S
1
:
Trigger input point
S
2
:
High-speed counter number
S
3
:
Setting for the numbers for work station and objects
S
4
:
Reference value for comparison and the observational error
D
:
First corresponding device for the comparison result in the stack area
Explanation
1. Use S
1
for setting the trigger input points; for ES2 series, use built-in inputs X4 and X6 for
immediate trigger input points and other inputs from X0 to X17 for general trigger input points.
Executing the instruction enables the external interrupts for the inputs. Therefore it is
suggested that you not use the inputs with interrupt tasks; otherwise, when the instruction is
executed, the interrupts are disabled and resumed only after the instruction completes. The
general type inputs are affected by the scan time though they are suitable for the environments
where the inputs are not as stable.
2. S
2
works with 32-bit counters (C200–C255) and is limited to accumulated count. When the
inputs are the high-speed trigger input type, it is suggested that you implement the hardware
high-speed counter such as C251 or C253 and use the DCNT instruction to enable the counter.
When you need high-speed output, you can use the DMOV instruction to copy the output
current position; for example copying the current output position D1030 to C200.
3. S
3
occupies seven consecutive 16-bit devices. S
3
+0 is n (the work station number) and S
3
+1 is
m (the maximum object number). S
3
+2 is the result of the object being filtered. S
3
+3 (Low word)
and S
3
+4 (High word) are the result of rising-edge triggered number (32-bit). S
3
+5 (Low word)