349
5
5 High-speed Input 5.2.3 HSZ Range Comparison
[S1] only corresponds to variables of register D and indicates the head address of the comparison table. V
can be used. After the instruction is enabled, [S1] will no longer be affected by V.
[S2] can use the constant K or H only to indicate the number of rows of the table. 1 ≤ (K or H) ≤ 128. V can
be used. After the instruction is enabled, [S1] will no longer be affected by V or Z.
[S] variables must be high-speed counters C235–C255.
[D] is set to M8132 and indicates frequency control mode.
The instruction can be used in the user program for only once. Registers in the table should be preset.
●
Example: The following describes instruction programming.
Execute when the DPLSY instruction lags behind
the DHSZ instruction by one scan cycle
The program controls the operation mode of Y0 output frequency based on the present counting value of
C251. The following is the equivalent comparison and output frequency table.
The initial variable
of [S1] table is D0
Comparison Value (32 Bits)
Y0 Output Frequency Table Counter D8131
(High-order, Low-order)
Number of rows
of [S2] table
indicated by K5
(D1, D0) (D3, D2) 0
(D5, D4) (D7, D6) 1
(D9, D8) (D11, D10) 2
(D13, D12) (D15, D14) 3
(D17, D16) (D19, D18) 4
Parameter
example
K1000 K2000
When the instruction is
executed,
the counter follows the
cycle from 0 to 1 to 2 to
3 to 4 to 0.
K1500 K3000
K2000 K5000
K3000 K9000
K0 K0
Description
After receiving pulses, immediately
carry out comparison. When they
are matched (for example, C251
equal to 1000), Y0 output frequency
will change.
The output frequency of Y0 output
is changed to the set value in the
corresponding column of the table.
The program is running