5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-76
API
Applicable model
20PM
66
ALT
P
P
Alternating between ON and OFF
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
D
* * *
Note: All devices can not be modified by V devices and Z devices.
Please refer to specifications for more information about device
ranges.
16-bit instruction (9 steps)
ALT
Continuity
instruction
ALT P
Pulse
instruction
32-bit instruction (17 steps)
- - - -
Flag: None
Explanation
When the instruction AL
T is executed, the state of D alternates between ON
and OFF.
D: Destination device
Generally, the pulse instruction ALTP is used.
Example 1
When X0 is turned from OFF to ON for the first time, Y0 is ON. When X0 is
turned from OFF to ON for the second time, Y0 is OFF.
X0
ALTP Y0
X0
Y0
Example 2
In the beginning, M0 is OFF, and therefore Y0 is ON, and Y1 is OFF. When
X10 is turned from OFF to ON for the first time, M0 is ON. Therefore, Y1 is ON,
and Y0 is OFF. When X10 is switched from OFF to ON for the second time, M0
is OFF. Therefore, Y0 is ON, and Y1 is OFF.
X10
LT M0
M0
Y0
M0
Y1
Example 3
When X20 is ON, T0 generates a pulse every two seconds. The output Y0
alternates between ON and OFF according to the pulses generated by T0.
X20
TMR T0
ALTP Y0
K20
T0
T0