API Mnemonic Operands Function
Controllers
158 D DRVI Drive to Increment ES/EX/SS SA/SX/SC EH/SV
Type Bit Devices Word Devices Program Steps
OP X Y M S K H KnX KnY KnM KnS T C D E F DRVI: 9 steps
S1 * * * * * * * * * * * DDRVI: 17 steps
S2 * * * * * * * * * * *
D1 *
D2 * * *
PULSE 16-bit 32-bit
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
Operands:
S1: Number of output pulses (relative designation) S2: Pulse output frequency D1: Pulse output device (please
use transistor output module) D2: Output device for the signal of rotation direction
Explanations:
1. See remarks for the setting range of S1, S2, D1 and D2.
2. S1 and S2 of SC series MPU only support device K, H and D.
3. Flag: see remarks for more details.
4. S1 is the number of output pulses (relative designation). For EH/EH2/SV series MPU, the 16-bit instruction
can designate the range -32,768 ~ +32,767. The range designated by 32-bit instruction is -2,147,483,648 ~
+2,147,483,647. For SC series MPU, the 32-bit instruction can designate the range -2,147,483,648 ~
+2,147,483,647. “+/-” signs indicate forward/backward directions.
5. S2 is the designated pulse output frequency. For EH/EH2/SV series MPU, the 16-bit instruction can
designate its range 10 ~ 32,767Hz. The range designated by 32-bit instruction is 10 ~ 200,000Hz. For SC series
MPU, the 32-bit instruction can designate the range 100 ~ 100,000Hz.
6. EH series MPU has two groups of A/B phase pulse output, CH0 (Y0, Y1) and CH1 (Y2, Y3). EH2/SV series
MPU has four groups of A/B phase pulse output, CH0 (Y0, Y1), CH1 (Y2, Y3), CH2 (Y4, Y5) and CH3 (Y6, Y7).
See remarks for the setup methods.
7. Pulse output device D1 in different models
Model SC MPU EH MPU EH2/SV MPU
Pulse output end Y10, Y11 Y0, Y2 Y0, Y2, Y4, Y6
8. The operation of D2 corresponds to the “+” or “-“ of S1. When S1 is “+”, D2 will be On; when S1 is “-“, D2 will
be Off. D2 will not be Off immediately after the pulse output is over; it will be Off only when the drive contact of the
instruction turns Off.
9. For EH/EH2/SV series MPU, S1 is
- The 32-bit data stored in the present value registers D1337 (high word) and D1336 (low word) of CH0 (Y0,
Y1).
- The 32-bit data stored in the present value registers D1339 (high word) and D1338 (low word) of CH1 (Y2,
Y3).
- The 32-bit data stored in the present value registers D1376 (high word) and D1375 (low word) of CH2 (Y4,
Y5).
- The 32-bit data stored in the present value registers D1378 (high word) and D1377 (low word) of CH3 (Y5,
Y6).
- When in backward direction, the content in the present value register will decrease.
10. For SC series MPU, S1 is the 32-bit data stored in the present value registers D1348 (low word) and
D1349 (high word) of CH0 (Y10) or the 32-bit data stored in the present value registers D1350 (low word) and
D1351 (high word) of CH1 (Y11). When in backward direction, the content in the present value register will
decrease. When the program goes from STOP to RUN or from RUN to STOP, the content in the present value
register will remain unchanged.
11. When DRVI instruction is executing pulse output, you cannot change the content of all operands. The
changes will be valid next time when DRVI instruction is enabled.
12. For EH/EH2/SV series MPU, when the drive contact of DRVI instruction is Off, even the indication flag
M1336 sent by CH0 pulses, M1337 sent by CH1 pulses, M1522 sent by CH2 pulses and M1523 sent by CH3
pulses are “On”, DRVI instruction will not be driven again.
13. When the absolute value of the input frequency of DDRVI insturction in EH/EH2/SV series MPU is larger
than 200KHz, the output will be operated at 200KHz. When the absolute value of the input frequency is smaller
than 10Hz, the output will be operated at 10Hz.
14. D1343 (D1353) is for setting up the time of the first acceleartion segment and last deceleration segment of
CH0 (CH1). The acceleration and deceleration time of EH/EH2/SV series MPU shall not be shorter than 10ms. The
output will be operated for 10ms if the time is shorter than 10ms or longer than 10,000ms (default setting =
100ms). The time range for SC series MPU is 50 ~ 20,000ms. The output will be operated for 20,000ms or 50ms if
the time set is longer than 20,000ms or shorter than 50ms.
15. D1340 (D1352) is for setting up the start/end frequency of Y10 (Y11). If S2 is less than or equals start/end
frequency, the pulse output frequency will be executed by the start/end frequency.
16. For EH/EH2/SV series MPU, M1305 (M1306) is the direction signal of CH0 (CH1). When S1 is a positive
number, the output will be operated in a forward direction and M1305 (M1306) will be Off. When S1 is a negative
number, the output will be operated in a backward direction and M1305 (M1306) will be On.
Program Example:
When M10= On, Y0 will output 20,000 pulses (relative designation) at 2KHz. Y5 = On indicates the pulses are
executed in forward direction.
M10
DRVI K20000 K2000 Y0 Y5
Remarks:
1. Explanations on EH/EH2/SV series MPU:
a) Relative position control: Designating the traveling distance starting from the current position by “+/ -“ signs;
also known as a relative driving method.
+3,000
F0 the first acceleration The last deceleration
segment segm ent
0 (D1340) Min: 10Hz
Current
position
-3,000
b) Settings of relative positioning and the acceleration/deceleration speed:
1. Explanations on SC series MPU:
a) Relative position control: Designating the traveling distance starting from the current position by “+/ -“ signs;
also known as a relative driving method.
b) Settings of relative positioning and the acceleration/deceleration speed: D1343 (D1353) is for settings of the
time of the first acceleration segment and last deceleration segment of Y10 (Y11). D1340 (D1352) is for
settings of start/end frequency of Y10 (Y11).
Acceleration
sampling time output pulse frequency
Acceleration
slope
The first acceleration The last deceleration
segment segment
Y10 (D1340) Y10 (D1340)
Y11 (D1352) Y11 (D1352)
Min: 100Hz Min: 100Hz
accel/decel time accel/decel time
Current Default: 200ms Default: 200ms
Y10 (D1343) Y10 (D1343) Output pulse
position numbers
Y11 (D1353) Y11 (D1353)
c) Many DRVI instructions can be compiled synchronously in the program, but only one instruction can be
activated whenever the PLC executes the program. For example, if Y10 output has already been activated
by an instruction, other instructions that are also used to activate Y10 output will not be excecuted.
Therefore, the principle of the instruction activation sequence is “first activated, first executed”.
d) When Y10 is activated by DDRVI instruction, the output function of Y10 will be disabled until DDRVI is OFF.
The same rule applies to Y11.
e) Once the instruction is activated, all other parameters cannot be modified until the instruction is disabled.
f) When the instruction is disabled but the output has not yet completed:
M1334 = On indicates that Y10 will stop output immediately.
M1334 = Off indicates that Y10 will decelerate according to the deceleration time till it reaches end
frequency and stop the pulse output.
M1335 corresponds to Y11 output and applies the same rule.
1. Flags for SC series MPU:
M1102: M1102 = On after Y10 pulse output is completed.
M1103: M1103 = On after Y11 pulse outout is completed.
M1334 Y10 pulse output stops immediately without deceleration when the pulse output instruction
: is disabled.
M1335 Y11 pulse output stops immediately without deceleration when the pulse output instruction
: is disabled.
2. Special registers for SC series MPU:
D1348: Low word of the current number of Y10 output pulses.
D1349: High word of the current number of Y10 output pulses.
D1350: Low word of the current number of Y11 output pulses.
D1351: High word of the current number of Y11 output pulses..
D1340: Settings of the first start frequency and the last end frequency of Y10 output pulses.
D1352: Settings of the first start frequency and the last end frequency of Y11 output pulses.
D1343: Settings of the acceleration/deceleration time of Y10 output pulses.
D1353: Settings of the acceleration/deceleration time of Y11 output pulses.
3. Flags for EH/EH2/SV series MPU:
M1010: For EH/EH2/SV, when M1010 = On, CH0, CH1, CH2 and CH3 will output pulses when END
instruction is being executed. M1010 will be Off automatically when the output starts.
M1029: For EH/EH2/SV, M1029 = On after CH0 pulse output is completed.
M1030: For EH/EH2/SV, M1030 = On after CH1 pulse output is completed.
M1036: For EH2/SV, M1036 = On after CH2 pulse output is completed.
M1037: For EH2/SV, M1037 = On after CH3 pulse output is completed.
M1305: For EH/EH2/SV, direction signal of CH0.
M1306: For EH/EH2/SV, direction signal of CH1.
M1334: For EH, CH0 pulse output pauses.
For EH2/SV, CH0 pulse output stops.
M1335: For EH, CH1 pulse output pauses.
For EH2/SV, CH1 pulse output stops.
M1336: For EH/EH2/SV, “CH0 sends out pulses” indication.
M1337: For EH/EH2/SV, “CH1 sends out pulses” indication.
M1520: For EH2/SV, CH2 pulse output stops.
M1521: For EH2/SV, CH3 pulse output stops.
M1522: For EH2/SV, “CH2 sends out pulses” indication.
M1523: For EH2/SV, “CH3 sends out pulses” indication.
M1534: For EH2/SV, designated deceleration time of CH0 (should be used with D1348).
M1535: For EH2/SV, designated deceleration time of CH1 (should be used with D1349).
M1536: For EH2/SV, designated deceleration time of CH2 (should be used with D1350).
M1537: For EH2/SV, designated deceleration time of CH3 (should be used with D1351).
M1532: For EH2/SV, direction signal of CH2.
M1533: For EH2/SV, direction signal of CH3.
4. Special registers for EH/EH2/SV series MPU:
For EH/EH2/SV, phase setting of CH0 (Y0, Y1): D1220 determines the phase by the last two
D1220:
bits; other bits are invalid.
1. K0: Y0 output
2. K1: Y0, Y1 AB-phase output; A ahead of B.
3. K2: Y0, Y1 AB-phase output; B ahead of A.
4. K3: Y1 output
For EH/EH2/SV, phase setting of CH1 (Y2, Y3): D1221 determines the phase by the last two
D1221:
bits; other bits are invalid.
1. K0: Y2 output
2. K1: Y2, Y3 AB-phase output; A ahead of B.
3. K2: Y2, Y3 AB-phase output; B ahead of A.
4. K3: Y3 output
For EH/EH2/SV, the time difference between the direction signal and pulse output sent by
D1222:
CH0.
For EH/EH2/SV, the time difference between the direction signal and pulse output sent by
D1223:
CH1.
For EH2/SV, phase setting of CH2 (Y4, Y5): D1229 determines the phase by the last two bits;
D1229:
other bits are invalid.
1. K0: Y4 output
2. K1: Y4, Y5 AB-phase output; A ahead of B.
3. K2: Y4, Y5 AB-phase output; B ahead of A.
4. K3: Y5 output
For EH2/SV, phase setting of CH3 (Y6, Y7): D1230 determines the phase by the last two bits;
D1230:
other bits are invalid.
1. K0: Y6 output
2. K1: Y6, Y7 AB-phase output; A ahead of B.
3. K2: Y6, Y7 AB-phase output; B ahead of A.
4. K3: Y7 output
For EH/EH2/SV, low word of the current number of output pulses from CH0.
D1336:
For EH/EH2/SV, high word of the current number of output pulses from CH0.
D1337:
For EH/EH2/SV, low word of the current number of output pulses from CH1.
D1338:
For EH/EH2/SV, high word of the current number of output pulses from CH1.
D1339:
For EH/EH2/SV, settings of the first start frequency and the last end frequency of CH0.
D1340:
D1343: For EH/EH2/SV, settings of acceleration/deceleration time for CH0 pulse output.
D1352: For EH/EH2/SV, settings of the first start frequency and the last end frequency of CH1.
D1353: For EH/EH2/SV, settings of acceleration/deceleration time for CH1 pulse output.
D1375: For EH2/SV, low word of the current number of output pulses from CH2.
D1376: For EH2/SV, high word of the current number of output pulses from CH2.
D1377: For EH2/SV, low word of the current number of output pulses from CH3.
D1378: For EH2/SV, high word of the current number of output pulses from CH3.
D1379: For EH2/SV, settings of the first start frequency and the last end frequency of CH2.
D1380: For EH2/SV, settings of the first start frequency and the last end frequency of CH3.
D1348: For EH2/SV, deceleration time for CH0 pulse output when M1534 = On.
D1349: For EH2/SV, deceleration time for CH1 pulse output when M1535 = On.
D1350: For EH2/SV, deceleration time for CH2 pulse output when M1536 = On.
D1351: For EH2/SV, deceleration time for CH3 pulse output when M1537 = On.
D1381: For EH2/SV, settings of acceleration/deceleration time for CH2 pulse output.
D1382: For EH2/SV, settings of acceleration/deceleration time for CH3 pulse output.
D1383: For EH2/SV, the time difference between the direction signal and pulse output sent by CH2.
D1384: For EH2/SV, the time difference between the direction signal and pulse output sent by CH3.