363
5
5 High-speed Input 5.4.3 HSCR Comparison Reset
The difference between Y outputs of common instructions and Y outputs of the DHSCR instruction is as
follows: (Example 1)
●
When the present value of C252 changes from 99 to 100, C252 contact is immediately connected. When the
instruction is executed at OUT Y10, Y10 will still be affected by the scan cycle and the value will be output after the
program execution and I/O refresh are nished.
●
When the present value of C252 changes from 99 to 100 or from 101 to 100, the DHSCR instruction at Y10 is
immediately output to the external output in interrupt mode, which is independent of the PLC scan cycle but still
affected by output delays of the output module relay (10 ms) or transistor (10 us).
2
)
Instruction for use:
●
Before the HSCR instruction is executed, the counter used must have been enabled (see Example 1); otherwise,
the value of the counter remains unchanged.
●
The counter responds to input signals in interrupt mode and timely compares values. If the compared values are
matched, the comparison output is immediately reset. In Example 1, when the present value of C252 changes
from 99 to 100 or from 101 to 100, Y10 is reset immediately and remains in that state. Even if values of C252 and
K100 are not equal by comparison, Y10 remains OFF, unless there is an additional set operation.
●
The comparison output of the instruction only depends on the comparison result at the pulse input. Without the
pulse input, even if the DMOV or DADD instruction is executed to rewrite the content of C252–C254 high-speed
counters, the comparison output remains unchanged. Flows driven by instructions cannot simply change the
comparison result.
3
)
Note:
●
Like common instructions, DHSCS, DHSCR, and DHSZ can be executed repeatedly, but there should be less than
eight simultaneously active instructions. Only one DHSZ instruction in special mode (high-speed table comparison
mode or frequency control mode) can be active.
●
Comparison objects of DHSCS, DHSCR, DHSZ, DHSOS, and DHSOR instructions (see the description of
comparison objects below) include high-speed counters, position values of high-speed outputs, and position
values of electronic cams. Comparison objects of high-speed interrupt comparison instructions driven by one axis
must be consistent; otherwise, errors will be reported. The following describes comparison objects:
Interrupt Comparison Object
1
Interrupt Comparison
Object 2
Interrupt Comparison
Object 3
Remarks
C252
(DHSCS, DHSCR, and DHSZ
instructions are driven)
K0
(DHSOS and DHSOR
instructions are driven)
K11
(DHSOS and DHSOR
instructions are driven)
The instructions cannot be driven
simultaneously but at different time.
C253
(DHSCS, DHSCR, and DHSZ
instructions are driven)
K1
(DHSOS and DHSOR
instructions are driven)
K12
(DHSOS and DHSOR
instructions are driven)
The instructions cannot be driven
simultaneously but at different time.
C254
(DHSCS, DHSCR, and DHSZ
instructions are driven)
K2
(DHSOS and DHSOR
instructions are driven)
K13
(DHSOS and DHSOR
instructions are driven)
The instructions cannot be driven
simultaneously but at different time.
For example, if the DHSOS instruction is used by X axis to compare the output value of X axis (K0), the comparison
object of the other simultaneously active instruction must be the output value of X axis (K0) and can be neither the
position value of the electronic cam (K11) nor the high-speed counter comparison instruction (for C252).