Professional Documents
Culture Documents
DVP-PLC Application Manual Programming】: Chapter 1 Working Principles of PLC Ladder Diagram
DVP-PLC Application Manual Programming】: Chapter 1 Working Principles of PLC Ladder Diagram
Programming
Table of Contents
Chapter 1 Working Principles of PLC Ladder Diagram
Preface-The Background and Functions of PLC ...................................................... 1-1
1.1 The Working Principles of Ladder Diagram........................................................ 1-1
1.2 The Difference between Traditional Ladder Diagram and PLC Ladder Diagram ... 1-2
1.3 Edition Explanation of Ladder Diagram ............................................................. 1-4
1.4 The Edition of PLC Ladder Diagram .................................................................. 1-8
1.5 The Conversion of PLC Command and Each Diagram Structure ......................... 1-11
1.6 The Simplification of Ladder Diagram ............................................................... 1-14
1.7 The Example for Designing Basic Program........................................................ 1-16
Combination Logics:
The following example is the combination logics that show in traditional diagram and PLC ladder diagram
separately.
Traditional Ladder Diagram
X0
Y0
X0
X1
Y1
X1
Y2
X2
X2
X4
X3
Y0
Y1
X4
Y2
X3
1-1
Sequential logics:
The sequential logics are a type of circuit that possesses the Draw-Back structure, which is to draw back the
circuits output result and has it serve as the input condition. Thus, under the same input condition, different
output results will be generated in accordance with previous conditions and motions with different orders.
The following example is the sequential logics that show in traditional diagram and PLC ladder diagram
separately.
Traditional Ladder Diagram
X5
X6
X5
Y3
X6
Y3
Y3
Y3
When the above circuit is just supplied with power, although the X6 switch is ON, the X5 switch is still OFF, thus,
the output relay Y3 will be in OFF condition; output of the relay will only be ON after X5 is ON. Once the output relay
Y3 is in ON condition, there will be a feedback signal containing the ON condition from Y3 to connect in parallel with
the A contact of X5; this circuit is thus also known as the self-latched circuit. The circuit motion is showed in the
following chart:
Device status
X5
X6
Y3
OFF
ON
ON
OFF
OFF
Step
1.2 The Difference between Traditional Ladder Diagram and PLC Ladder Diagram
1-2
increment of the program. With this scan time, it will incur repeated input detections, and thus, result in delay in the
output responses; and the longer the delay time, the greater the error towards the control, and whats worse, is that
the condition might be unqualified for the control requests. By then, PLC (with faster Scan Time) would be chosen to
do the job; the scan speed is thus an essential specification to PLC. Thanks to the advanced technique of ASIC (IC
with specific functions) within the microcomputer, PLC of the present has made greater progress in the scan speed,
and what follows is the scanning chart of the PLC Ladder Diagram Program.
X0
X1
Start
Y0
Y0
M100 X3
X10
Y1
Execute in cycles
:
:
X100 M505
Y126
End
In addition to the difference of scan time, PLC ladder diagram and traditional ladder diagram also has difference
in reverse current. In the following chart of traditional ladder diagram, if X0, X1, X4 and X6 are in ON condition and
the others are in OFF condition, output point Y0 will be in ON condition as shown as dotted line in the following
diagram. But in the PLC ladder diagram will have error in the peripheral equipmentWPLSoft due to scan method of
MCU is from up to down and from left to right.
1-3
X1
X0
X2
Y0
X1
X0
X2
Y0
Y0
X4
X3 a
X5
X6
X4
X3 a
X5
X6
point (it is the terminal that used to connect to external input switch and receive external input
signal). Input signal from external will decide it to display 0 or 1. You couldnt change the state of
input relay by program design or forced ON/OFF via HPP. The contacts (contact a, b) can be
used unlimitedly. If there is no input signal, the corresponding input relay could be empty and
cant be used with other functions.
Equipment indication method: X0, X1,X7, X10, X11,. The symbol of equipment is X
and the number uses octal. There are numeric indications of input point on MPU and
expansion unit.
1-4
point (it is used to connect to external load). It can be driven by input relay contact, the contact of
other internal equipment and itself contact. It uses a normally open contact to connect to external
load and other contacts can be used unlimitedly as input contacts. It doesnt have the
corresponding output relay, if need, it can be used as internal relay.
Equipment indication: Y0, Y1,Y7, Y10, Y11,. . The symbol of equipment is Y and the
number uses octal. There are numeric indications of output point on MPU and expansion
unit.
Internal relay
The internal relay doesnt connect directly to outside. It is an auxiliary relay in PLC. Its
function is the same as the auxiliary relay in electric control circuit. Each auxiliary relay has the
corresponding basic unit. It can be driven by the contact of input relay, output relay or other
internal equipment. Its contacts can be used unlimitedly. Internal auxiliary relay cant output
directly, it should output with output point.
Equipment indication: M0, M1,, M4, M5. The symbol of equipment is M and the number
uses decimal number system.
STEP
DVP PLC provides input method for controlling program of step actions. It is very easy to
write control program by using the conversion of control step S of command STL. If there is no
step program in the program, step point S could be used as internal relay M or alarm point.
Equipment indication: S0, S1,S1023. The symbol of equipment is S and the number
uses decimal.
Timer
Timer is used to control time. There are coil, contact and timer storage. When coil is ON, its
contact will act (contact a is close, contact b is open) when attaining desired time. The time value
of timer is set by settings and each timer has its regular period. User sets the timer value and
each timer has its timing period. Once the coil is OFF, the contact wont act (contact a is open
and contact b is close) and the timer will be set to zero.
Equipment indication: T0, T1,,T255. The symbol of equipment is T and the number uses
decimal system. The different number range corresponds with the different timing period.
Counter
Counter is used to count. It needs to set counter before using counter (i.e. the pulse of
counter). There are coil, contacts and storage unit of counter in counter. When coil is form OFF
to ON, that means input a pulse in counter and the counter should add 1. There are 16-bit, 32-bit
and high-speed counter for user to use.
Equipment indication: C0, C1,,C255. The symbol of equipment is C and the number
uses decimal.
1-5
PLC needs to handle data and operation when controlling each order, timer value and
counter value. The data register is used to store data or parameters. It stores 16-bit binary
number, i.e. a word, in each register. It uses two continuous number of data register to store
double words.
Equipment indication: D0, D1,,D9,999. The symbol of equipment is D and the number
uses decimal.
File register
The file register can be used to store data or parameter when the register that PLC needs is
not enough during handling data and parameter. It can store 16-bit binary number, i.e. a word, in
each file register. It uses two continuous number of file register to handle double word. There are
1600 file registers for EP series and 10000 file registers for EH series. There is not the real
equipment number for file register, thus it needs to execute READ/WRITE of file register via
commands API147 MEMR, API148 MEMW or the peripheral equipment HPP and WPLSoft.
Equipment indication: K0~K9,999. There is no equipment symbol and uses decimal
number for number.
Index register
Index register E and F are 16-bit data register just the same as general data register. It can
be wrote and read freely and has the function of index indication to use for character device, bit
device and constants.
Equipment indication: E0~E7, F0~F7. The symbols of equipment are E, F and the number
uses decimal.
Explanation
Command
LD
X, Y, M, S, T, C
LDI
X, Y, M, S, T, C
AND
X, Y, M, S, T, C
OR
X, Y, M, S, T, C
ORI
X, Y, M, S, T, C
LDP
X, Y, M, S, T, C
LDF
X, Y, M, S, T, C
ANDP
X, Y, M, S, T, C
ANDF
X, Y, M, S, T, C
Falling-edge trigger
switch
Rising-edge trigger in
serial
Falling-edge trigger in
serial
1-6
Equipment
Explanation
Command
Equipment
Rising-edge trigger in
parallel
ORP
X, Y, M, S, T, C
Falling-edge trigger in
parallel
ORF
X, Y, M, S, T, C
Block in serial
ANB
none
Block in parallel
ORB
none
Multiple output
MPS
MRD
MPP
none
OUT
Y, M, S
Step ladder
STL
Application
command
INV
none
Basic command,
Application command
Inverse logic
Block: The block is the ladder diagram that made up of the serial or parallel calculation of two or above equipments. It
will get the result of parallel block or serial block according to operation character.
Serial block
Parallel block
Divergent line and combinative line: the vertical line is usually a separation for devices. This line is combination line
for the left device (it means that there are at least two columns or above circuit at
the left connect to this vertical line) this line is the divergent line for the right
device (it means that there are at least two rows or above circuit connect to this
line.
1-7
Network1
Network2
Incomplete network:
X0
X1
X2
X4
X3
X5
X6
X7
X10
C0
C1
00000
X11
X12
X13
Y1
00000
The operation of ladder diagram is to scan from left upper corner to right lower corner. The output handling,
including the operation frame of coil and application command, at the most right side in ladder diagram.
Take the following diagram for example; we analyze the process step by step. The number at the right corner is
the explanation order.
8
X0
X1
6
5
4
5
Y1
X4
T0
M3
Y1
M0
TMR
X3
1-8
T0
K10
M1
LD
OR
AND
LD
AND
ORB
LD
AND
LD
AND
ORB
ANB
OUT
TMR
5
6
7
8
X0
M0
X1
X3
M1
Y1
X4
T0
M3
Y1
T0
K10
LD command
LD command
AND Block
OR Block
The structures of command LDP and LDF are similar to the command LD. The difference is that command LDP
and LDF will act in the rising-edge or falling-edge when contact is ON as shown in the following.
Rising-edge
Falling-edge
X0
X0
Time
OFF
2.
ON
Time
OFF
OFF
ON
OFF
AND
command
AND
command
The structures of ANDP and ANDF are the same but the action is in rising-edge or falling-edge.
3.
OR
command
OR
command
OR
command
1-9
ANB command
5.
ORB
command
If there are several blocks when operate ANB or ORB, they should be combined to blocks or network from up to
down or from left to right.
6.
MPS, MRD, MPP commands: Divergent memory of multi-output. It can produce many various outputs.
The command MPS is the start of divergent point. The divergent point means the connection place between
horizontal line and vertical line. We should determine to have contact memory command or not according to the
contacts status in the same vertical line. Basically, each contact could have memory command but in some places of
ladder diagram conversion will be omitted due to the PLC operation convenience and capacity limit. MPS command
can be used for 8 continuous times and you can recognize this command by the symbol .
MRD command is used to read memory of divergent point. Because the logical status is the same in the same
horizontal line, it needs to read the status of original contact to keep on analyzing other ladder diagram. You can
recognize the command MRD by the symbol .
MPP command is used to read the start status of the top level and pop it out from stack. Because it is the last
item of the horizontal line, it means the status of this horizontal line is ending.
1-10
MPS
MRD
MPP
7.
MPP
STL command: this command is used in the syntax design for the Sequential Function Chart (SFC). This
command helps the programmer to have clearer ideas on the program procedure, and thus the procedure will
be more readable. As shown in the following diagrams, we can get clear procedure, and original step point will
have the action of power loss after each step point S transfer to the next step point. In this way, we could
transfer to our procedure diagram from the left diagram to the PLC structure diagram below.
M1002
S0
M1002
initial
pulse
S21
SET
S0
S0
S
SET
S21
S21
S
SET
S22
S22
e
S
S0
S22
8.
RET
RET command: you should add RET command after finishing step ladder program and RET command should
add after STL command as shown in the following.
S20
e
S
RET
S20
e
S
RET
1-11
X0
X2
X1
Y0
X1
M0
C0
SET
S0
M1
M2
S0
S
Y0
X10
Y10
SET
S10
S
S11
S
X11
Y11
SET
S11
SET
S12
SET
S13
X12
Y12
SET
S20
S
S10
S12
S
S13
S
S20
X13
S0
RET
X0
CNT
C0
C0
X1
M0
X1
M1
M2
M2
RST
END
C0
K10
LD
OR
LD
OR
ORI
ANB
LD
AND
ORB
ANI
OUT
AND
SET
STL
LD
OUT
SET
STL
LD
OUT
SET
SET
SET
STL
LD
OUT
SET
STL
STL
STL
LD
OUT
RET
LD
CNT
LD
MPS
AND
OUT
MRD
ANI
OUT
MPP
ANI
OUT
END
X0
X1
X2
M0
M1
M2
Y0
X1
Y0
C0
S0
S0
X10
Y10
S10
S10
X11
Y11
S11
S12
S13
S11
X12
Y12
S20
S20
S12
S13
X13
S0
OR
1 block
2 OR
block
Serial
block
AND
3 block
Serial block
4 ANI
Multiple
outputs
Step ladder Start
11
14
Simultaneous
15 divergence
End of step ladder
State working item
and step point transfer
Return
S0
17
C0K10
C0
18 Read C0
X1
M0
X1
M1
Multiple
outputs
M2
M2
Program End
1-12
X2
X4
X1
X3
X5
Good method
LD
OR
LD
OR
ANB
LD
OR
ANB
X0
X1
X2
X3
X4
X5
Bad method
LD
OR
LD
OR
LD
OR
ANB
ANB
X0
X1
X2
X3
X4
X5
The results for the above two programs to convert to ladder diagram are the same. Why one is better than the
other? That is due to operation of MPU. The operation of the program in the left side is one block merges to another
one. Although the length of the program at the right side is the same as the left one, the operation of the program in
the right side is merged at the last. (command ANB is used to merge, it cant use more than 8 continuous times). In
this program, it just needs to use continuous two times of command ANB and MPU allows that. But when the program
needs to use more than continuous 8 times of command ANB, MPU wont allow. So the best method is to merge once
the block is established and in this way the logic of programmer will be in order.
Example 2: there are two methods to use command to show the following ladder diagram but the result is the same.
X0
X1
X2
X3
Good method
LD
OR
OR
OR
X0
X1
X2
X3
Bad method
LD
LD
LD
LD
ORB
ORB
ORB
X0
X1
X2
X3
The difference is very clear in these two programs. In the bad method, the more program code it needs and the
operation memory of MPU also needs to increase. So that is better to decode in the order of the definition.
The error figures of ladder diagram
When editing ladder diagram, you can use all ladder symbols to make up all kinds of figures. When drawing
ladder diagram, you should start from left power line and end with the right power line (the right power line will be
omitted when using DPLSoft ladder diagram) due to the principle for PLC to handle figure program is from up to down
and from left to right (it is drew from left to right and draw the next new row after finishing drawing a row). They are the
common error figure in the following.
It cant do OR operation upward.
1-13
.
The position of Label P should be in the first row of
the complete network.
1-14
X1
Command
X2
LD
X0
LD
X1
OR
X2
ANB
X1
Command
X0
X2
LD
X1
OR
X2
AND
X0
To put the block in the front of ladder diagram can omit command ORB when single equipment and block are
connected in parallel.
Command
T0
X1
X2
LD
T0
LD
X1
AND
X2
ORB
X1
X2
Command
T0
LD
X1
AND
X2
OR
T0
In figure a of ladder diagram, it does not illegal due to the reverse power flow. In figure a, the upper block is
shorter than lower block, you could make it legal by switching them.
command
X0
X1
X3
X2
X4
Fig. a
LD
X0
OR
X1
AND
X2
LD
X3
AND
X4
ORB
X3
X4
X1
X2
command
X0
Fig. b
LD
X3
AND
X4
LD
X1
OR
X0
AND
X2
ORB
1-15
X0
command
Y1
MPS
AND
OUT
MPP
OUT
Y0
X0
Y1
Y0
command
Y0
OUT
AND
OUT
X0
Y1
Y0
X0
Y1
X0
X1
X2
X3
X4
X5
X6
X7
X10
X0
X1
X2
X3
X4
X5
X10
LOOP1
X6
X7
X5
X10
LOOP1
Example 2:
X0
X1
X2
X3
X4
X5
X6
X7
X10
X0
X1
X2
X3
X4
X5
X7
X10
LOOP1
X6
X3
X6
X0
X1
X2
X3
X4
X5
X6
X7
X10
LOOP1
X0
X1
X4
X7
X10
LOOP 2
1-16
Y1
X2
Y1
X1
stop.
Example 2: the latching circuit for priority of start
When start normally open contact X1=On, stop normally
X1
X2
Y1
Y1
Y1
RST
Y1
RST
Y1
SET
Y1
X2
SET
Example 4: latched
Auxiliary relay M512 is latched at the right side. (refer to
X1
PLC user manual) the circuit at the right side will be latched
when power is on and it will be also latched once the power
loss and power on again. Therefore the latched is continuous.
SET
M512
RST
M512
X2
M512
Y1
1-17
X1
X3
Y1
X1
X3
Y1
X2
X2
X4
Y1
Y2
X4
Y1
Y2
Y2
X1 and X3 can start/stop Y1 separately, X2 and X4 can start/stop Y2 separately and they are all self latched
circuit. Y1 is an element for Y2 to do AND function due to the normally open contact connects to Y2 in series.
Therefore, Y1 is the input of Y2 and Y2 is also the input of Y1.
Example 6: Interlock control
X1
X3
Y2
X1
Y1
Y1
X3
X2
X4
X2
X4
Y1
Y1
Y2
Y2
Y2
The figure above is the circuit of interlock control. Y1 and Y2 will act according to the start contact X1 and X2.
Y1 and Y2 will act not at the same time, once one of them acts and the other wont act. (This is called interlock.)
Even if X1 and X2 are valid at the same time, Y1 and Y2 wont act at the same time due to up-to-down scan of
ladder diagram. For this ladder diagram, Y1 has higher priority than Y2.
Example 7: Sequential Control
X1
X3
Y2
Y1
Y1
X2
X4
Y1
Y2
Y2
1-18
Y1
Y1
The figure above is a very simple ladder step diagram. When starting to scan Y1 normally close contact, Y1
normally close contact is close due to the coil Y1 is OFF. Then it will scan Y1 and the coil Y1 will be ON and output 1.
In the next scan period to scan normally close contact Y1, Y1 normally close contact will be open due to Y1 is ON.
Finally, coil Y1 will be OFF and output 0. Scan repeatedly, the period of oscillating circuit is nT+T.
X0
Y1
TMR
T0
X0
Kn
T0
Y1
Y1
nT
The figure above uses timer T0 to control coil Y1 to be ON. After Y1 is ON, timer T0 will be closed at the next
scan period and output Y1. The oscillating circuit will be shown as above. (n is the setting of timer and it is decimal
number. T is the base of timer. (clock period))
Example 9: Blinking Circuit
X0
T2
TMR
T1
Kn1
X0
n2 T
T1
TMR
X0
T2
Kn2
Y1
T1
Y1
n1 T
The figure above is common used oscillating circuit for indication light blinks or buzzer alarms. It uses two
timers to control On/OFF time of Y1 coil. If figure, n1 and n2 are timer setting of T1 and T2. T is the base of timer
(clock period)
Example 10: Triggered Circuit
X0
M0
M0
Y1
Y1
M0
X0
Y1
M0
Y1
1-19
X0
TMR
T10
K1000
X0
T10
Y1
Y1
100 seconds
TB = 0.1 sec
When input X0 is ON, output coil Y1 will be ON at the same time due to the corresponding normally close
contact OFF makes timer T10 to be OFF. Output coil Y1 will be OFF after delay 100 seconds once input X0 is OFF
and T10 is ON. Please refer to timing chart above.
Example 12: Output delay circuit, in the following example, the circuit is made up of two timers. No matter input X0 is
ON or OFF, output Y4 will be delay.
X0
TMR
T5
T5
K50
X0
T6
5
seconds
T5
Y4
Y4
Y0
Y4
X0
TMR
T6
K30
T6
3
seconds
X0
TMR
T11
Kn1
TMR
T12
Kn2
T11
T12
Y1
1-20
C5
Kn1
CNT
C6
Kn2
RST
C5
RST
C6
C5
X14
C6
Y1
Example 15: Traffic light control (by using step ladder command)
Traffic light control
Vertical
Light
Vertical
light
Horizontal
light
Light Time
Horizontal
Light
Red light
Yellow
light
Green
light
Green
blink light
Y0
Y1
Y2
Y2
Y10
Y11
Y12
Y12
35 Sec
5 Sec
25 Sec
5 Sec
Timing chart:
Vertical
Light
Red Y0
Yellow Y1
Green Y2
25 Sec
5 Sec
Horizontal
Light
5 Sec
Red Y10
Yellow Y11
Green Y12
25 Sec
5 Sec
5 Sec
1-21
Ladder Diagram:
M1002
M1002
S0
S20
TMR
T0
S21
T1
S22
S23
T0
K350
Y2
T10
S31
TMR
T1
K250
TMR
T2
K50
M1013
T2
S30
Y0
Y2
Y1
TMR
T10
K250
TMR
T11
K50
M1013
T11
S32
T12
S0
S
Y12
Y12
S20
S
S33
T12
TMR
T13
K350
SET
S0
SET
S20
SET
S30
S127
TMR
T0
SET
S21
K350
T0
K50
Y10
S0
Y0
Y11
TMR
ZRST
S21
S
Y2
T13
TMR
T1
SET
S22
TMR
T2
K250
T1
S0
S22
S
K50
M1013
Y2
T2
SET
S23
S
S30
S
S23
Y1
Y12
TMR
T10
SET
S31
TMR
T11
K250
T10
S31
S
K50
M1013
Y12
T11
SET
S32
S
S32
Y11
TMR
T12
SET
S33
K50
T12
S33
S
Y10
TMR
S23 S33
S
S
T13
T13
K350
S0
RET
END
1-22
M1002
LAD-0
ZRST
S0
SET
S0
S127
S0
Transferred condition 1
0
T0
TRANS*
S20
S30
S21
S31
S22
S32
S23
S33
S22
TMR
T2
K50
M1013
Y2
Transferred condition 4
T13
TRANS*
4
S0
Transferred condition 7
T12
TRANS*
1-23
2 DVP-PLC Function
2.1 Summary of DVP-PLC Device Number
ES, EX, SS Models:
Type
Item
Device
100ms timer
T
Timer
10ms counter
1ms timer
16-bit count up for general
16-bit count up for latched *
Counter
Step
point
32-bit count
1-phase input
up/down
high-speed 1-phase 2 inputs
counter for
2-phase 2 inputs
latched*
Initial step point latched *
Zero point return latched *
latched *
T
Data
register
For special
Constant
Pointer
Usage Range
X0~X177, 128 points, octal
Total is
number system
256
Y0~Y177, 128 points, octal
points
number system
M0~M511,
M768~M999,
744 points
Total is
1280
M512~M767, 256 points
points
M1000~M1279, 280 points
N0~N7, 8 points
P0~P63, 64 points
Interrupt
Decimal
Hexadecimal
External interrupt
Communication interrupt
Time interrupt
Function
Correspond to
external input point
Correspond to
external output point
Control point of
master control nested
loop
Location pointer of
CJ, CALL
2-1
2 DVP-PLC Function
EP/SA models:
Type
Item
Device
Range
Function
Correspond to
Total
system
external input point
is
Y0~Y177, 128 points, octal number 256 Correspond to
points
system
external output point
M0~M511, 512 points (*1)
Contacts can be
are latched)
latched)
TMR command
Total
indicates attains the
is
T200~T239, 40 points (*1)
256 setting, the T contact
T240~T245, 6 points (accumulative points
with the same
type) (*4)
number will be On.
T246~T249, 4 points (accumulative
type) (*4)
Timer
10ms
1ms
16-bit count up
type) (*4)
C0~C95, 96 points (*1)
C96~C199, 104 points (*3)
C200~C215, 16 points (*1)
32-bit high-speed
CNT(DCNT)
Total
command indicates
C235~C244, 1-phase 1 input, 9 is
250 attains, the contact C
points (*3)
points
with the same
C246, C247, C249, 1-phase 2
counter
Counter
2-2
Step
point
For general
For latched *
For alarm
command) (*1)
Total
Usage device of step
is
1024 ladder diagram
points
2 DVP-PLC Function
Type
Item
Device
Range
Function
When timer attains,
For general
Data
For latched*
register
For special
N0~N7, 8 points
Pointer
External interrupt
For
interrupt
Time interrupt
High-speed counter
reaches interrupt
Constant
2-3
2 DVP-PLC Function
Latched setting for each EP/SA model:
M
Auxiliary relay
For general
For latched
Latched
M0~M511
M512~M999
Factory setting is
latched
M1000~M1999
M2000~M4095
It is fixed to be
non-latched
T
Timer
Start: D1200(K512)
End: D1201(K999)
100 ms
10 ms
10ms
1 ms
100 ms
T0 ~T199
T200~T239
T240~T245
T246~T249
T250~T255
It is fixed to be
non-latched
It is fixed to be
non-latched
16 bits count up
C0~C95
C96~C199
It is fixed to be
latched
Start: D1208
It is fixed to be
K96
non-latched
End: D1209
K199
For
Special
Latched
general
register
S0~S9 S10~S19 S20~S511
C
Counter
Accumulative type
It is fixed to be latched
C216~C234
It is fixed to be
latched
Start: D1210
K216
End: D1211
K234
Latched
For general
S512~S895
S896~S1023
Factory setting is latched
It is fixed to be non-latched
It is fixed to be latched
Start: D1214K512
End: D1215K895
For general
Latched
Special register
Latched
D0~D199
D200~D999
D1000~D1999
D2000~D9999
Factory setting is
Factory setting is latched
latched
It is fixed to be
Some are latched and
non-latched
cant be changed
Start: D1216 (K200)
Start: D1218 (K2000)
End: D1217 (K999)
End: D1219 (K4999)
S
Step relay
D
Register
K0~K1599
Data Register
It is fixed to be latched
EH model:
Type
Item
Device
For general
M
Timer
10ms
1ms
2-4
Range
Function
Total
is
512
points
Corresponds to
external input point
Corresponds to
external output point
Total
is
4096
points
Contacts can be
switched between
On/Off in the program
(some is latched)
Total
is
256
points
2 DVP-PLC Function
Type
Item
Device
16-bit count up
C
32-bit count
Counter up/down
High-speed
counter
Step
points
Function
Initial step
point
For zero point
return
For general
For latched
For alarm
For general
D
Data
register
For latched
For special
For index
Interrupt
Pointer
Constant
Range
N0~N7, 8 points
External interrupt
Time interrupt
High-speed counter
attained interrupt
Pulse interrupt
Communication
interrrupt
Decimal system
Hexadecimal system
2-5
2 DVP-PLC Function
*1: the area of non-latched is fixed, it cant be changed.
*2: the area of non-latched, it can be changed to latched area by parameter setting.
*3: latched area can be changed to non-latched area by parameter setting.
*4: latched area is fixed, it cant be modified. (the area marked withcant be changed)
For general
For latched
Latched
M0~M499
M500~M999
M1000~M1999
M2000~M4095
Start: D1202(K2000)
End: D1203(K4095)
Start: D1200(K500)
End: D1201(K999)
100 ms
T
Timer
C
Counter
S
Step relay
10 ms
10ms
1 ms
T0 ~T199
T200~T239
T240~T245
T246~T249
T250~T255
Factory setting is
Factory setting is
non-latched
non-latched
Accumulative type
Fixed latched
Start: D1204 (HFFFF)*1 Start: D1206 (HFFFF)*1
End: D1205 (HFFFF)*1 End: D1207 (HFFFF)*1
16-bit count up
32-bit count up/down
32-bit high-speed count up/down
C0~C99
C100~C199
C200~C219
C220~C234
C235~C245
C246~C255
Non-latched
Latched
Non-latched
Latched (default)
Latched (default)
(default)
(default)
(default)
Start: D1208 (K100)
Start: D1210 (K220)
Start: D1212 (K235)
End: D1209 (K199)
End: D1211 (K234)
End: D1213 (K255)
Zero point
For general
Latched
Step point for alarm
Initial
return
S0~S9 S10~S19 S20~S499
S500~S899
S900~S1023
Non-latched (default)
Latched (default)
Always is latched
D
Register
100 ms
For general
Latched
Special register
Latched
D0~D199
D200~D999
D1000~D1999
D2000~D9999
Non-latched (default)
Latched (default)
Latched (default)
Some is latched, it cant
be changed
Power
Off=>On
Non-latched
Clear
Latched
Special M,
Special D,
index register
2-6
STOP=>RUN
RUN=>STOP
Initial
Unchanged
Factory
setting
Clear
Unchanged
Unchanged
Clear
Unchanged
Unchanged
Initial
setting
2 DVP-PLC Function
The memory type of EP/SA/EH models will be as following:
Memory type
Power
Off=>On
Non-latched
Clear
STOP=>RUN
RUN=>STOP
Unchanged
Initial
Unchanged
Unchanged
Clear
Unchanged
File Register
Factory
setting
Clear
Latched
Special M,
Special D,
index register
Initial
setting
Unchanged
Unchanged
Decimal
Hexadecimal
Constant
There are five value types for DVP-PLC to use by the different control destination. The following is the
explanation of value types.
1.
following.
Bit
Nibble
Byte
Word
Double Word
The relations among bit, nibble, byte, word, and double word of binary number are shown as follows.
DW
Double Word
W1
W0
BY3
NB7
BY2
NB6
NB5
Word
BY1
NB4
NB3
BY0
NB2
NB1
Byte
NB0
Nibble
Bit
2.
The numbers of external input and output terminal of DVP-PLC use octal number.
Example:
External input: X0~X7, X10~X17(device number)
DVP-PLC Application Manual
2-7
2 DVP-PLC Function
External output: Y0~Y7, Y10~Y17(device number)
3.
5.
Octal
(OCT)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Decimal
(DEC)
BCD
(Binary Code Decimal)
Hexadecimal
(HEX)
Constant K,
For DIP Switch and 7-segment
Equipment
Constant H
equipment M, S, T, C,
display
X, Y number
D, E, F, P, I number
0
0
0 0 0 0
0 0 0 0
0
1
1
0 0 0 0
0 0 0 1
1
2
2
0 0 0 0
0 0 1 0
2
3
3
0 0 0 0
0 0 1 1
3
4
4
0 0 0 0
0 1 0 0
4
5
5
0 0 0 0
0 1 0 1
5
6
6
0 0 0 0
0 1 1 0
6
7
7
0 0 0 0
0 1 1 1
7
10
8
0 0 0 0
1 0 0 0
8
11
9
0 0 0 0
1 0 0 1
9
12
10
0 0 0 1
0 0 0 0
A
13
11
0 0 0 1
0 0 0 1
B
14
12
0 0 0 1
0 0 1 0
C
15
13
0 0 0 1
0 0 1 1
D
DVP-PLC Application Manual
2 DVP-PLC Function
Binary
(BIN)
Octal
(OCT)
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
0
1
0
1
:
:
:
0 1 1 0
0 0 1 1
Decimal
(DEC)
BCD
(Binary Code Decimal)
Hexadecimal
(HEX)
Constant K,
For DIP Switch and 7-segment
Equipment
Constant H
equipment M, S, T, C,
display
X, Y number
D, E, F, P, I number
16
14
0 0 0 1
0 1 0 0
E
17
15
0 0 0 1
0 1 0 1
F
20
16
0 0 0 1
0 1 1 0
10
21
17
0 0 0 1
0 1 1 1
11
:
:
:
:
:
:
:
:
:
:
:
:
143
99
1 0 0 1
1 0 0 1
63
2.3 The Numbering and Function of External Input/Output Contact [X] / [Y]
Input/output contact number:(octal number)
For MPU, the number of input and output contact will be counted from X0 and Y0. The number will be changed
with points of MPU. For I/O expansion unit, the number of input / output terminal is counted with the connection
sequence of MPU.
For ES, EX, SS Models:
Model no DVP-14ES DVP-14SS DVP-20EX
DVP-24ES
DVP-32ES
DVP-60ES
Expansion I/O
Input X
X0~X7
(8 Points)
X0~X7
(8 Points)
X0~X7
(8 Points)
X0~X17
(16 Points)
X0~X17
(16 Points)
X0~X43
(36 Points)
X20(X50)~X177
(Note)
Output Y
Y0~Y5
(6 Points)
Y0~Y5
(6 Points)
Y0~Y5
(6 Points)
Y0~Y7
(8 Points)
Y0~Y17
(16 Points)
Y0~Y27
(24 Points)
Y20(Y30)~Y177
(Note)
Note: Besides DVP-60ES, the started input number of expansion unit is from X20 and the started output
number of expansion unit from Y20. The started input number of DVP-60ES is X50 and the started
output number of DVP-60ES is Y30. The number of expansion I/O is increased by 8 times and if it is
less than 8 points, it will count with 8 points.
EP/SA model:
Model no
DVP-12SA (Note1)
DVP-14EP
DVP-32EP
Expansion I/O
Input X
X0~X7 (8 points)
X0~X7 (8 points)
X20~X177 (note 2)
Output Y
Y0~Y3 (4 points)
Y0~Y7 (8 points)
Y20~Y177 (note 2)
Note 1: All SA functions are the same as EP except function expansion card. All SA expansion units share
with SS series.
Note 2: The started input number of expansion unit is from X20 and the started output number of
expansion unit from Y20. The number of expansion I/O is increased by 8 times and if it is less than
8 points, it will count with 8 points.
2-9
2 DVP-PLC Function
EH model:
Model no DVP-16EH
DVP-20EH
DVP-32EH
DVP-48EH
DVP-64EH
DVP-80EH
Expansion I/O
Input X
X0~X7
(8 points)
X0~X13(12
points)
X0~X17
(16 points)
X0~X27
(24 points)
X0~X37
(32 points)
X0~X47
(40 points)
X20~X377
(note)
Output Y
Y0~Y7
(8 points)
Y0~Y7(8
points)
Y0~Y17
(16 points)
Y0~Y27
(24 points)
Y0~Y37
(32 points)
Y0~Y47
(40 points)
Y20~Y377
(note)
Note: Besides DVP-16EH and DVP-20EH, the started input/output number of expansion unit starts with
the last number of MPU. The started input number of DVP-60EH is X20 and the started output
number of DVP-60EH is Y20. The numbers of expansion I/O are sequential numbers. The input
number can be up to X377 and output number can be up to Y377.
Input relay: X0~X377
The number of input relay (or called input terminal) uses octal number. The points of EH model can be up
to 256 points, the range as follows: X0~X7, X10~X17, , X370~X377.
Output relay: Y0~Y377
The number of output relay (or called output terminal) uses octal number. The points of EH model can be
up to 256 points, the range as follows: Y0~Y7, Y10~Y17, , Y370~Y377.
Input/output contact Function:
The function of input contact X: input contact X reads input signal and enter PLC by connecting with input
equipment. It is unlimited usage times for A contact or B contact of each input contact X in program. The
On/Off of input contact X can be changed with the On/Off of input equipment but cant be changed by using
peripheral equipment (HPP or WPLSoft).
( There is a special relay M1304 in EH model to force input contact X On/Off by peripheral equipment
HPP or WPLSoft, but PLC wont receive any external input signal at this time.)
Output contact Y Function:
The mission of output contact Y is to drive the load that connects to output contact Y by sending On/Off
signal. There are two kinds of output contact: one is relay and the other is transistor. It is unlimited usage
times for A or B contact of each output contact Y in program. But there is number for output coil Y and it is
recommended to use one time in program. Otherwise, the output result will be decided by the circuit of last
output Y with PLC program scan method.
2-10
2 DVP-PLC Function
X0
2 , i.e.
The output of Y0 will be decided by circuit
Y0
Y0 is repeated
X10
2
Y0
Input signal
Input signal:
input X
1.
input terminal
program.
read in memory
2.
Y0
read Y0 state from memory
Y0
M0
Device Memory
X0
Program
Program:
PLC executes each command in program from
output
Output
output terminal
Y output
memory.
Output:
1.
2.
Total is
1280
points
2-11
2 DVP-PLC Function
EP/SA models:
For general
Auxiliary relay
For latched
M
For special
For general
EH models:
Auxiliary relay
M
For latched
For special
Total is
M500~M999, M2000~M4095, 2596 points. It can be changed to 4096
points
non-latched area by setting parameters.
M1000~M1999, 1000 points. Some are latched.
Step relay S
Initial latched
Zero point
return latched
Latched
For initial
return
non-latched area.
For general
EP/SA Models:
Step relay S
For latched
For alarm
2-12
Total is
1024
points
by parameters.
S896~S1023, 128 points. It is fixed to be latched area.
2 DVP-PLC Function
EH Models:
Step relay S
For initial
return
For general
For latched
For alarm
Total is
S20~S499, 480 points. It can be latched area by setting parameters. 1024
S500~S899, 400 points. It can be non-latched area by setting points
parameters.
S900~S1023, 124 points. It can be latched area by setting
parameters.
: S10~S19, 10 points.
S10 S19 are for zero point return when using API 60 IST in program. If it cant
use IST command, they will be used as general step relay.
3.
4.
5.
Total is
128
points
2-13
2 DVP-PLC Function
EP/SA model:
Timer T
Total is
256
points
EH model:
100ms for general
Timer T
100ms for
accumulative
10ms for general
10ms for
accumulative
1ms for
accumulative
Total is
256
points
Timer function:
The unit of timer is 1ms, 10ms and 100ms. The count method is count up. The output coil will be ON when the
present value of timer equals to the settings. The setting is K in decimal number. Data register D can be also used as
settings.
The real setting time of timer = unit of timer * settings
There are three types divided by these characteristics as follows.
1.
General timer:
ES/EP/SA Series
Models
EH Series Models
General timer will count once when executing command END. Output coil will be On if
timer attains when executing command TMR.
General timer will count once when executing command TMR. Output coil will be On if
timer attains when executing command TMR.
X0
TMR
T0
K100
T0
Y0
10 sec
When X0=Off or power off, timer T0 will be
X0
present
T0 value
K100
Y0
2.
2-14
Accumulative timer:
2 DVP-PLC Function
ES/EP Series Models :
General timer will count once when executing command END. Output coil will be On if
timer attains when executing command TMR.
EH Series Models
General timer will count once when executing command TMR. Output coil will be On if
timer attains when executing command TMR.
X0
T250
TMR
K100
T250
Y0
T1
T2
T1+T2=10sec
X0
K100
present
T250 value
Y0
3.
General timer will count once when executing command END. Output coil will be On if
timer attains when executing command TMR.
General timer will count once when executing command TMR. Output coil will be On if
timer attains when executing command TMR.
If general timer is used in subroutine or interrupt to insert in subroutine and the subroutine wont be executed,
timer cant count correctly.
Designate method of settings: actual setting time of timer = unit * settings.
1.
2.
input reflash
X0
TMR
T0
K100
contact T0 is On
T0 counts to
10sec now,
but contact
isnOn.
T0
contact Y0=On
Y0
1st scan
2nd scan
Nth scan
(N+1)th scan
From action above, the action since the coil is started to be ON in detail are in the following:
T
+T0
-
:
1ms timer is 0.001 second, 10ms timer is 0.01 second, 100ms timer is 0.1 second
T0
2-15
2 DVP-PLC Function
If contact is wrote prior to TMR command in program, it needs to add 2*T0 (two times scan time) in the worst
situation.
If timer setting is 0, output contact will be ON when TMR command is executed in the next time.
EP/SA models:
Counter C
EH models:
16-bit count up for
general
16-bit count up for
latched
Counter C
32-bit count up/down
for general
32-bit count up/down
for latched
Software 1-phase 1
input
Hardware 1-phase 1
32 bits count up/down input
High-speed counters C Hardware 1-phase 2
inputs
Hardware 1-phase 2
inputs
Features:
2-16
2 DVP-PLC Function
Item
16 bits counters
Type
Count
direction
Settings
Designate for
constant
Present
value change
Output
contact
Reset action
Present
register
Contact
action
General
32 bits counters
General
High speed
Count up
0~32,767
Constant K or data register D
Count up/down
-2,147,483,648~+2,147,483,647
Constant K or data register D (2 for designated)
Counter will stop when attaining Counter will keep on counting when attaining settings
settings
When count attains settings, When count up attains settings, contact will be ON and latched.
contact will be ON and latched. When count down attains settings, contact will reset to OFF.
The present value will reset to 0 when RST command is executed and contact will reset to OFF.
16 bits
After scanning, act together.
32 bits
After scanning, act
together.
Functions:
When pulse input signal of counter is from OFF to ON, the present value of counter equals to settings and output
coil is ON. Settings are decimal system and data register D can also be used as settings.
16-bit counters C0~C199:
1.
Setting range of 16-bit counter is K0~K32,767. (K0 is the same as K1. output contact will be ON
immediately at the first count.
2.
General counter will be clear when PLC is power loss. If counter is latched, it will remember the value
before power loss and keep on counting when power on after power loss.
3.
If using MOV command, WPLSoft or HPP to send a value, which is large than setting to C0, register, at
the next time that X1 is from Off to On, C0 counter contact will be On and present value will be set to the
same as settings.
4.
The setting of counter can use constant K or register D (not includes special data register D1000~D1999)
to be indirect setting.
5.
If using constant K to be setting, it can only be positive number but if setting is data register D, it can be
positive/negative number. The next number that counter counts up from 32,767 is -32,768.
Example:
LD
X0
RST
C0
LD
X1
CNT
C0 K5
LD
C0
OUT
Y0
X0
RST
C0
CNT
C0
X1
K5
C0
Y0
2-17
2 DVP-PLC Function
1. When X0=On, RST command is executed,
C0 reset to 0 and output contact reset to
OFF.
X0
X1
5
4
C0
present
value
settings
2
1
0
Contacts Y0, C0
32-bit general addition/subtraction counters C200~C234:
1. The setting range of general 32-bit counter is K-2,147,483,648~K2,147,483,647. (not for DVP ES, EX and SS
MPU)
2. Special auxiliary relay used to switch count up/down of general 32-bit addition/subtraction counters decided by
M1200~M123. For example: When M1200=Off, C200 is for addition. When M1200=On, C200 is for
subtraction.
3. Settings can be constant K or data register D (special data register D1000~D1999 is not included) and also can
be positive/negative number. If using data register D, it will occupy two continuous data register.
4. General counter will be clear when PLC is power loss. If it is latched counter, counter will save the present
value and the contacts state and keep on counting when power is on after power loss.
5. The next number will be -2,147,483,648 for counter to count up after 2,147,483,647. By the same way, once
counter counts down to -2,147,483,648 the next value will be 2,147,483,647.
Example:
2-18
LD
X10
OUT
M1200
LD
X11
RST
C200
LD
X12
CNT
C200 K-5
LD
C200
OUT
Y0
X10
M1200
X11
RST
C200
DCNT
C200
X12
K-5
C200
Y0
2 DVP-PLC Function
1. X10 drives M1200 to decide C200 is
addition or subtraction.
2. When X11 is from Off to ON and RST
X10
gradual
increase
gradual
increase
gradual decrease
X11
C200
When X12 is from Off to On, counter present
value
down).
4. When counter C200 is from K-6 to K-5,
output contact
is On before.
-1
0
-2
-3
-4
-5
-6
-7
-7
-6
-5
-4
-3
-8
2.
The operation of 32-bit high-speed addition/subtraction counter C235~C244 is decided by the On/Off of
special auxiliary relay M1235~M1244. For example: if M1235=Off, C235 is addition and if M1235=On,
C235 is subtraction.
3.
The operation of 32-bit high-speed addition/subtraction counter C246~C254 is decided by the On/Off of
special auxiliary relay M1246~M1254. For example: if M1246=Off, C246 is addition and if M1246=On,
C246 is subtraction.
4.
The settings can be positive / negative numbers by using constant K or data register D (special data
register D1000~D1999 is not included). If using data register D, the setting will occupy two continuous data
register.
5.
If using DMOV command, WPLSoft or HPP to send a value which is large than setting to any high-speed
counter, at the next time that input point X of counter is from Off to On, this contact doesnt have any
change and it will do addition and subtraction with present value.
6.
The next number will be -2,147,483,648 for counter to count up after 2,147,483,647. By the same way,
once counter counts down to -2,147,483,648, the next value will be 2,147,483,647.
2-19
2 DVP-PLC Function
High-speed counter for ES / EX / SS series, 1-phase high-speed counter: 5KHz, total frequency: 40KHz.
Type
Input
C235
X0
U/D
X1
X2
X3
C236
U/D
1-phase input
C237 C238 C241
U/D
R
U/D
U/D
C242
C244
U/D
R
U/D
R
1-phase 2 inputs
C246 C247 C249
U
U
U
D
D
D
R
R
S
U:
Increasing
A:
A phase input
S:
Start input
D:
Decreasing
B:
B phase input
R:
Clear input
2-phase inputs
C251 C252 C254
A
A
A
B
B
B
R
R
S
Input points X0 and X1 can be used as high-speed counter and 1-phase can be up to 40KHz.
High-speed counter for EP/SA series, 1-phase high-speed counter: 10KHz, total frequency: 40KHz.
Type
1-phase input
1-phase 2 inputs
2-phase inputs
Input
C235 C236 C237 C238 C239 C240 C241 C242 C244 C246 C247 C249 C251 C252 C254
X0
U/D
U/D
U/D
U
U
U
A
A
A
X1
U/D
R
R
D
D
D
B
B
B
X2
U/D
U/D
R
R
R
R
X3
U/D
R
S
S
S
X4
U/D
X5
U/D
U:
Increasing
A:
A phase input
S:
Start input
D:
Decreasing
B:
B phase input
R:
Clear input
1.
Input point X0, X1 can be used as high-speed counter and 1-phase can be up to 20KHz
2.
C235~C240 are high-speed counters for EH series and they are program interrupted 1-phase high-speed
counter (10KHz) and total frequency is 20KHz. C241~ C254 are Hardware High Speed Counter, is called HHSC.
pulse input frequency of HHSC0 and HHSC 1 can up to 100 KHz; HHSC2 and HHSC3 can up to 30KHz (both of
single phase and AB phase).
C241, C246, C251 share HHSC0
C242, C247, C252 share HHSC1
C243, C248, C253 share HHSC2
C244, C249, C254 share HHSC3
1. Each HHSC can be used for a number one time and it uses command DCNT to designate.
2. There are three modes for each HHSC:
2-20
A.
B.
C.
2 DVP-PLC Function
Type
Type
Input
X0
X1
X2
X3
X4
X5
X6
X7
X10
X11
X12
X13
X14
X15
X16
X17
Program-interrupted 1-phase
High-speed Counter
1-phase input
1-phase 2 inputs
2-phase inputs
C235 C236 C237 C238 C239 C240 C241 C242 C243 C244 C246 C247 C248 C249 C251 C252 C253 C254
U/D
U/D
U
D
R
S
U/D
U/D
R
S
U/D
U/D
U/D
A
B
R
S
U
D
R
S
U/D
R
S
A
B
R
S
U/D
U
D
R
S
R
S
U/D
A
B
R
S
U
D
R
S
R
S
U:
Increasing
A:
A phase input
S:
Start input
D:
Decreasing
B:
B phase input
R:
Clear input
A
B
R
S
There are Reset signal and Start signal of external inputs in HHSC0~3. It also can be Reset signal
by setting special M, M1272 (HHSC0), M1274 (HHSC1), M1276 (HHSC2) and M1278 (HHSC3).
And it can be Start signal by setting special M, M1273 (HHSC0), M1275 (HHSC1), M1277
(HHSC2) and M1279 (HHSC3).
B.
If input external control signals of R and S arent used when using high-speed counter, the
function of input signal can be closed by setting M1264/ M1266/ M1268/ M1270 and M1265 /
M1267/ M1269/ M1271 to True. The corresponding external input can be used as general inputs.
Please refer following for using.
C.
When using special M to be high-speed counter, control input with START and TRSET and the
action will be affected with scan time.
2-21
2 DVP-PLC Function
HHSC0 HHSC1 HHSC2 HHSC3
X0
X4
Counting pulse
X14
X10
Current value
of counter
U/D
U
A
HHSC0
HHSC1
X5
X11
Comparator
HHSC2
Counting pulse
X15
Comparison value
reached setting
B
HHSC3
D1226
D1227
HHSC0 M1246
M1251
C241
M1241
HHSC1 M1247
M1252
HHSC2 M1248
M1253
C242
M1242
C243
M1243
Counting
up/down flag
Counting mode
selection
D1228
C244
M1244
HHSC3 M1249
High speed
comparison
command
M1254
DHSCS
SET/RESET
DHSCR
DHSCZ
X2
X6
X12
X16
M1264
M1266
M1268
M1270
M1272
M1274
M1276
M1278
I 010 M1289
I 020 M1290
I 030 M1291
I 040 M1292
I 050 M1293
I 060 M1294
AND
OR
Comparison value
reached operation
Reset signal R
X3
X7
X13
X17
M1265
M1267
M1269
M1271
M1273
M1275
M1277
M1279
AND
OR
Start signal S
Functions
Double frequency setting of counter counting method
D1022=K1
D1022=K2
D1022=K4
2-22
(normal frequency)
2-phase
inputs
A-phase
B-phase
counting up
counting down
2 DVP-PLC Function
Counting
mode
A-phase
(double
frequency)
B-phase
counting up
counting down
A-phase
4 (four times
frequency)
B-phase
counting up
counting down
There are 1 to 4 times frequency for EH hardware high-speed counter (HHSC0~3) and set by Special D1225~D1228.
Facotry setting is double frequency.
Type
Special
D(settings)
1(normal
frequency)
1-phase input
2(double
frequency)
U/D
U/D FLAG
U/D
U/D FLAG
1(normal
frequency)
2(double
frequency)
1(normal
frequency)
2(double
frequency)
3(three times
frequency)
4(four times
frequency)
1-phase 2
inputs
2-phase 2
inputs
Count up (+1)
Functions
M1150
M1151
M1152
2-23
2 DVP-PLC Function
Device number
Functions
M1153
M1264
M1265
M1266
M1267
M1268
M1269
M1270
M1271
M1272
M1273
M1274
M1275
M1276
M1277
M1278
M1279
M1289
M1290
M1291
M1292
M1293
M1294
M1312
M1313
M1314
M1315
M1316
M1317
M1320
M1321
M1322
M1323
M1324
M1325
M1326
M1327
M1328
M1329
M1330
M1331
M1235 ~ M1244
M1246 ~ M1249
M1251 ~ M1254
2-24
2 DVP-PLC Function
Device number
Functions
M1332
M1333
D1022
D1150
D1151
D1152
D1153
D1225
D1226
D1227
D1228
D1225 ~ D1228
X10
RST
C241
LD
X11
OUT
M1241
LD
X12
DCNT
C241 K5
LD
C241
OUT
Y0
1.
X10
RST
C241
X11
M1241
X12
DCNT
C241
K5
C241
Y0
counting down
X11,M1241 contact
counting up
X10
X12
X0
C241
present
value
7
5
4
3
4
0
1
0
Y0, C241 contact
2-25
2 DVP-PLC Function
5.
C241 for ES, EX, SS, EP series has external input Reset X1 signal.
6.
C241 for EH series has external input Reset signal (X2), Start signal (X3).
7.
EH series external input contact of clear signal of C241 (HHSC0) is disabled by M1264. External input contact
of start signal is disabled by M1265.
8.
EH series internal input contact of clear signal of C241 (HHSC0) is disabled by M1272. Internal input contact of
start signal is disabled by M1273.
9.
Counting mode (normal frequency or double frequency) of C246 (HHSC0) of EH series can be set by D1225.
Factory setting is double frequency.
1.
LD
X10
RST
C246
LD
X11
DCNT
C246 K5
LD
C246
OUT
Y0
2.
X10
RST
C246
DCNT
C246
X11
K5
C246
Y0
X10
X11
X0
count up
X1
count down
C246
present
value
7
5
3.
3
2
4
0
1
0
Y0, C246 contact
4.
C246 for EH series has external input Reset signal X2 or Start signal X3.
5.
C246 (HHSC0) of EH series can be normal frequency or double frequency by setting D1225. Factory setting
is double frequency.
6.
EH series external input contact of clear signal ( R ) of C246 (HHSC0) is disabled by M1264. External input
contact of start signal ( S ) is disabled by M1265.
7.
EH series internal input contact of clear signal ( R ) of C246 (HHSC0) is disabled by M1272. Internal input
contact of start signal ( S ) is disabled by M1273.
2-26
2 DVP-PLC Function
2-phase AB input high-speed counter:
Example:
LD
X10
X10
RST
C251
LD
X11
DCNT
C251 K5
LD
C251
OUT
Y0
RST
C251
DCNT
C251
X11
K5
C251
Y0
1.
When X11=On, RST command is executed and reset C251 to 0, output contact is reset to off.
2.
C251 receives A phase counting signal of X0 input terminal and B phase counting signal of X1 input
terminal to execute add 1 (count up) or subtract 1 (count down) when X12=on. EH series can set different
frequency for counting mode.
3.
When counter C251 attains settings K5, C251 contact will be ON. After C251 is On, if there is counter
pulse input, C251 will keep on counting.
4.
For ES/EP/SA series, it can be set to normal frequency, double frequency or four times frequency by
D1022 (counting mode setting). Factory setting is double frequency.
5.
EH series C251 has external input reset signal X2 and start signal X3.
6.
The counting mode (normal frequency, double frequency, third times frequency, four times frequency) of
EH series C251 (HHSC0) can be set by D1225. Factory setting is double frequency.
7.
EH series external input contact of clear signal of C246 (HHSC0) is disabled by M1264. External input
contact of start signal is disabled by M1265.
8.
EH series internal input contact of clear signal of C246 (HHSC0) is disabled by M1272. Internal input
contact of start signal is disabled by M1273.
X10
X11
A-phase X0
B-phase X1
C251 present value
3
1
0
Counting up
Counting down
1
0
2-27
2 DVP-PLC Function
EH series:(double frequency)
X10
X11
A-phase
X0
B-phase
X1
C251
present
value
2
1
0
counting up
counting down
1
0
Data register D
For general
For latched *
Special
Index register E, F
For general
Total is
744
points
EP/SA model:
Data register D
File register
2-28
For latched
Special
Index register E, F
Total is
5000
points
2 DVP-PLC Function
EH model:
For general
D2000~D9999,
8800points.
It
can
For special
Index register E, F
be Total is
10000
points
File register
There are five types of register which sorts by characters in the following:
1.
General register
: The data in register will be cleared to 0 when PLC switches from RUN to STOP or
power is off. If M1033=On when PLC switches from Run to STOP, data wont be
cleared but the data will be cleared to 0 when power is off.
2.
Latched register
: The data is the latched register wont be cleared when PLC is power off. If you want
to clear the data in this register, you should use RST or ZRST command.
3.
Special register
: Each special register has the special definition and purpose. It is used to save system
status, error messages, monitor state. Please refer to chapter 2.11 for detail.
4. Index register [E], [F] : Index registers are 16-bit registers. There are 2 points, E and F, for ES/EX/SS
models. There are 8 points, E0~E3 and F0~F3, for EP models. There are 16 points,
E0~E7 and F0~F7, for EH models. If you want to use index register to be 32-bit
register, you should indicate E and at this moment F cant be used.
5.
File register
: There are 1600 file registers (K0~K1599) for EP/SA MPU and 10000 file registers
(K0~K9,999) for EH MPU. There is no real device number for file register, you should
execute read/write of file register by command API 147 MEMR, API 148 MEMW,
peripheral device HPP or WPLSoft.
16-bit
16-bit
E0
F0
32-bit
E0
upper 16-bit
F0
lower 16-bit
2-29
2 DVP-PLC Function
When X0=On and E0=8, F0=14, D5E0=D(5+8)=D13, D10F0
X0
MOV
K8
E0
MOV
K14
F0
MOV
D5E0
D10F0
The function of Index register is the same as general operand. It can be used to move or compare and used to
be index for byte device (KnX, KnY, KnM, KnS, T, C, D) and bit device (X, Y, M, S). For ES/EP/SA series, it cant be
used for constant (K, H). But for EH series, it can be used for constant (K, H).
ES/EX/SS models: E0, F0 2 points
EP model: E0~E3, F0~F3, total is 8 points
EH model: E0~E7, F0~F7, total is 16 points
some commands dont support index function, please refer to chapter 5.4 for using index register E and F.
When using command mode of WPLSoft to use constant (K,H) to be index register, it needs to use symbol @:
Example: MOV K10@E0 D0F0
2.8.3 File Register Function and Characteristics
EP/SA/EH series will check following when PLC is power on or change from STOPRUN.
1. M1101 (if it starts file register function)
2. D1101 (the start number of file register of EP/SA series (K0~K1599), for EH series is K0~K9999)
3. D1102 (item number for reading, EP/SA series is K0~K1600 and EH series is K0~K10000)
4. D1103 (the address to save the reading data, the start address of designated file register D
(K2000~K9999). It is used to decide if transferring file to designated register automatically.
Note:
The action which read from file register to data register D wont be executed when D1101 for EP/SA model
is greater than 1600, D1101 for EH model is greater than 8,000 or the value of D1103 is less than 2,000 or
greater than 9,999.
When starting executing the action to read data from file register to data register, PLC will stop reading
once the address of file register or data register D exceeds usage range.
There are 1600 file registers for EP/SA models and 10000 file registers for EH models. There is no actual
number for file register, therefore it should use command API 147 MEMR, API 148 MEMW or peripheral
HPP02 and WPLSoft to execute the read/write of file register. If the address of file register for reading
exceeds useful range, the data for reading will be 0.
2-30
2 DVP-PLC Function
ES, EX, SS models:
N
N0~N7, 8 points
P0~P63, 64 points
Pointer
EP/SA models:
N
N0~N7, 8 points
Insert external
interrupt
Pointer
I
EH models:
Master control nested
control point
The location pointer of
CJ, CALL
N0~N7, 8 points
Pointer
Nest Level Pointer N: used with command MC and MCR. MC is master start command. When MC command is
executed, the commands between MC and MCR will be executed normally. MC-MCR master
command supports nested program structure and the maximum is 8 levels, which is
numbered from N0 to N7. Refer to chapter3.7 for detail information.
2-31
2 DVP-PLC Function
Pointer P: use with application commands API 00 CJ, API 01 CALL, API 02 SRET. Refer to chapter 5.5 commands CJ,
CALL, SRET usage method for more information.
CJ condition jump:
P**
X0
0
CJ
P1
X1
Y1
N.
X2
P1 N
Y2
P**
X0
20
CALL
P2
X1
24
to P2 to execute the
designated subroutine as
Y1
executing CALL
command. When
FEND
executing SRET
P2
(subroutine
P2)
Y0
command, return to
subroutine
Y0
SRET
address 24 to go on
executing.
subroutine return
Interrupt pointer I:
It is used with application command API 04 EI, API 05DI, API 03 IRET. Refer to chapter 5.5 for more information.
There are five functions below. Interrupt insert should be used with EI, interrupt insert enable, interrupt insert disable
and IRET interrupt insert return, etc.
1. External interrupt insert
It is special hardware circuit design in PLC MPU. It will stop present program
and jump to the designated interrupt insert subroutine to execute
automatically every a period time (can be set to 10ms~99ms).
2-32
2 DVP-PLC Function
4. Pulse interrupt insert
Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
On
Off
NO
Off
Off
On
NO
On
On
Off
NO
Off
Off
On
NO
On
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
-
R
-
NO
-
Off
-
Off
Off
R/W
NO
Off
Off
Off
R
R
R
R
R/W
NO
NO
NO
NO
NO
Off
Off
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
R/W
R/W
NO
NO
NO
Off
Off
Off
Factory
setting
Off
Off
Off
Off
Off
2-33
2 DVP-PLC Function
Special
M
Function
M1020
M1021
M1022
Zero flag
Borrow flag
Carry flag
PLSY Y1 mode selection, it is continuous
M1023
output when it is ON.
M1024 System used flag
If PLC receive illegal communication request
M1025 when HPP, PC or HMI connects to PLC, M1025
will be set and save the error code in D1025.
M1026 EP/EH: Startup flag of RAMP module
M1027 PR output flag
10ms/100ms time switch flag. The base setting
flag of T64~T126 is 100ms, when timer is OFF
M1028
and the base setting flag is 10ms when it is
ON.
ES/EX/SS and EP/SA: Pulse output Y0 of
PLSY and PLSR command execution
completed or other relative command execution
M1029* completed
EH: The first group pulse CH0 (Y0, Y1) output
complete executing or other relative command
execution completed
ES/EX/SS and EP/SA: Pulse output Y1 of
PLSY and PLSR command execution
M1030* completed
EH: The second group pulse CH1 (Y2, Y3)
output complete executing
ES
EX
SS
EP
EH
SA
On RUN STOP
Off Off
Off
Off Off
Off
Off Off
Off
R
R
R
NO
NO
NO
Off
Off
Off
Off
Off
R/W
NO
Off
Off
NO
Off
Off
Off
Off
Off
Off
Off
R/W
R/W
NO
NO
Off
Off
Off
R/W
NO
Off
Off
Off
Off
NO
Off
Off
Off
Off
NO
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
R/W
NO
NO
Off
Off
R/W
NO
Off
R/W
YES
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R
R/W
R
R/W
R/W
R/W
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Factory
setting
M1052
I201 masked
Off
Off
Off
R/W
NO
Off
M1053
M1054
M1055
M1056
M1057
I301 masked
I401 masked
I501 masked
I6 masked
I7 masked
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
R/W
R/W
R/W
R/W
R/W
NO
NO
NO
NO
NO
Off
Off
Off
Off
Off
2-34
2 DVP-PLC Function
Special
M
M1059
M1060
M1061
M1062
M1063
M1064
M1065
M1066
Function
I010~I060 masked
System error message 1
System error message 2
System error message 3
System error message 4
Operator error
Syntax error
Program error
ES
EX
SS
EP
EH
SA
Factory
setting
R/W
R
R
R
R
R
R
R
NO
NO
NO
NO
NO
NO
NO
NO
Off
Off
Off
Off
Off
Off
Off
Off
Off
Off
NO
Off
Off
Off
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
M1073
System used
M1074
System used
NO
Off
- Off
Off
NO
Off
M1077
Off
NO
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
- Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
NO
Off
Off
Off
NO
Off
Off
Off
NO
Off
NO
Off
R/W
NO
Off
R/W
NO
Off
M1078
M1079
M1080
M1081
M1095
M1096
M1097
M1098
M1099
M1083
M1088
M1089
M1090
M1091
M1092
M1093
M1094
Off
Off
Off
Off
Off
Off
Off
Off
Off
NO
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
2-35
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off Off
Off
R/W
NO
R/W
Yes
Off Off
R
NO
Off
R
Off
NO
Off
R
Off
NO
R
Off Off
NO
Off
Off
Off
NO
Off
Off
NO
Off
Off
Off
Off
NO
Off
NO
Off
Off
Off
Off
Off
Special
M
M1100
Function
A sampling flag of SPD command
M1121
Transmission ready
M1122
Sending request
M1123
Receiving completed
M1124
Receiving wait
M1125
Communication reset
M1126
M1128
M1129
M1127
M1142
M1143
M1144*
M1145*
M1146*
M1147*
2-36
Off
Off
Off
Off
Off
NO
Off
Off
NO
Off
Off
Off
R/W
NO
Off
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
NO
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
MODRD/MODWR/MODRW data received error Off
Off
MODRD/MODWR/MODRW command error
Off
Off
R/W
NO
Off
Off
Off
NO
Off
Off
Off
NO
Off
Off
Off
Off
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
NO
Off
Off
Off
NO
Off
Off
Off
NO
Off
STX/ETX selection
MODRD/RDST/MODRW, M1131=On when
M1131
data convert to HEX
Special high-speed pulse (50KHz) output
M1133*
switch (On is start)
Special high-speed pulse (50KHz) output. On
M1134*
is continuous output switch
M1135* Output pulse numbers attained flag
M1141
Off
Off
Off
M1130
M1140
Off
Factory
setting
2 DVP-PLC Function
Special
M
Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Factory
setting
Off
Off
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
NO
Off
Off
R/W
NO
Off
Off
Off
Off
NO
Off
Off
R/W
NO
Off
M1161
Off
Off
Off
R/W
NO
Off
M1167
Off
Off
Off
R/W
NO
Off
M1168
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
M1196
System used
M1197
System used
M1198
System used
M1199
System used
M1200
Off
R/W
NO
Off
M1201
Off
R/W
NO
Off
M1202
Off
R/W
NO
Off
M1203
Off
R/W
NO
Off
M1204
Off
R/W
NO
Off
M1205
Off
R/W
NO
Off
M1206
Off
R/W
NO
Off
M1207
Off
R/W
NO
Off
M1208
Off
R/W
NO
Off
M1209
Off
R/W
NO
Off
M1210
Off
R/W
NO
Off
M1211
Off
R/W
NO
Off
M1212
Off
R/W
NO
Off
M1213
Off
R/W
NO
Off
2-37
2 DVP-PLC Function
M1214
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off
R/W
NO
M1215
Off
R/W
NO
Off
M1216
Off
R/W
NO
Off
M1217
Off
R/W
NO
Off
M1218
Off
R/W
NO
Off
M1219
Off
R/W
NO
Off
M1220
Off
R/W
NO
Off
M1221
Off
R/W
NO
Off
M1222
Off
R/W
NO
Off
M1223
Off
R/W
NO
Off
M1224
Off
R/W
NO
Off
M1225
Off
R/W
NO
Off
M1226
Off
R/W
NO
Off
M1227
Off
R/W
NO
Off
M1228
Off
R/W
NO
Off
M1229
Off
R/W
NO
Off
M1230
Off
R/W
NO
Off
M1231
Off
R/W
NO
Off
M1232
Off
R/W
NO
Off
M1233
Off
R/W
NO
Off
M1234
Off
R/W
NO
Off
M1235
Off
R/W
NO
Off
M1236
Off
R/W
NO
Off
M1237
Off
R/W
NO
Off
M1238
Off
R/W
NO
Off
M1239
Off
R/W
NO
Off
M1240
Off
R/W
NO
Off
M1241
Off
R/W
NO
Off
M1242
Off
R/W
NO
Off
M1243
Off
R/W
NO
Off
M1244
Off
R/W
NO
Off
M1246
Off
NO
Off
M1247
Off
NO
Off
M1248
Off
NO
Off
M1249
Off
NO
Off
M1251
Off
NO
Off
M1252
Off
NO
Off
M1253
Off
NO
Off
Special
M
2-38
Function
Factory
setting
Off
2 DVP-PLC Function
Special
M
Function
M1254
M1256
System used
M1258
M1259
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off
R
NO
-
Factory
setting
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
R/W
NO
Off
Off
Off
R/W
NO
Off
M1264
Off
Off
R/W
NO
Off
M1265
Off
Off
Off
R/W
NO
Off
M1266
Off
Off
Off
R/W
NO
Off
M1267
Off
Off
Off
R/W
NO
Off
M1268
Off
Off
Off
R/W
NO
Off
M1269
Off
Off
Off
R/W
NO
Off
M1270
Off
Off
Off
R/W
NO
Off
M1271
Off
Off
Off
R/W
NO
Off
M1272
Off
Off
Off
R/W
NO
Off
M1273
Off
Off
Off
R/W
NO
Off
M1274
Off
Off
Off
R/W
NO
Off
M1275
Off
Off
Off
R/W
NO
Off
M1276
Off
Off
Off
R/W
NO
Off
M1277
Off
Off
Off
R/W
NO
Off
M1278
Off
Off
Off
R/W
NO
Off
M1279
Off
Off
Off
R/W
NO
Off
M1280
Off
Off
Off
R/W
NO
Off
M1281
Off
Off
Off
R/W
NO
Off
M1282
Off
Off
Off
R/W
NO
Off
M1283
Off
Off
Off
R/W
NO
Off
M1284
Off
Off
Off
R/W
NO
Off
M1285
Off
Off
Off
R/W
NO
Off
M1286
I6 flag disable
Off
Off
Off
R/W
NO
Off
M1287
I7 flag disable
Off
Off
Off
R/W
NO
Off
M1288
I8 flag disable
Off
Off
Off
R/W
NO
Off
M1289
Off
Off
Off
R/W
NO
Off
M1290
Off
Off
Off
R/W
NO
Off
M1291
Off
Off
Off
R/W
NO
Off
M1292
Off
Off
Off
R/W
NO
Off
M1293
Off
Off
Off
R/W
NO
Off
M1294
Off
Off
Off
R/W
NO
Off
M1260
M1261
2-39
2 DVP-PLC Function
Special
M
M1303
Function
Swap high and low byte
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off Off
Off
R/W
NO
Factory
setting
Off
Off
Off
Off
R/W
NO
Off
M1305
Factory setting
Off
Off
Off
R/W
NO
Off
M1312
Off
Off
Off
R/W
NO
Off
M1313
Off
Off
Off
R/W
NO
Off
M1314
Off
Off
Off
R/W
NO
Off
M1315
Off
Off
Off
R/W
NO
Off
M1316
Off
Off
Off
R/W
NO
Off
M1317
Off
Off
Off
R/W
NO
Off
M1320
Off
Off
Off
R/W
NO
Off
M1321
Off
Off
Off
R/W
NO
Off
M1322
Off
Off
Off
R/W
NO
Off
M1323
Off
Off
Off
R/W
NO
Off
M1324
Off
Off
Off
R/W
NO
Off
M1325
Off
Off
Off
R/W
NO
Off
M1328
Off
Off
Off
R/W
NO
Off
M1329
Off
Off
Off
R/W
NO
Off
M1330
Off
Off
Off
R/W
NO
Off
M1331
Off
Off
Off
R/W
NO
Off
M1332
Off
Off
Off
R/W
NO
Off
M1333
Off
Off
Off
R/W
NO
Off
M1334
Off
Off
Off
R/W
NO
Off
M1335
Off
Off
Off
R/W
NO
Off
M1336
Off
Off
Off
NO
Off
M1337
Off
Off
Off
NO
Off
M1338
Off
Off
Off
R/W
NO
Off
M1339
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
Off
Off
Off
R/W
NO
Off
M1340
M1341
M1342
M1343
M1344
Off
Off
Off
R/W
NO
Off
M1345
Off
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
R/W
NO
Off
Off
NO
Off
Off
NO
Off
2-40
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off
R
NO
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Special
M
Function
Factory
setting
Off
2-41
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off
R
NO
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Off
NO
Off
Special
M
2-42
Function
Factory
setting
Off
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute Latched
EX
SA
On RUN STOP
SS
Off
R
NO
Off
Special
M
Function
Special
D
Function
ES
Off STOP RUN
EP
EX
EH
Attribute
SA
On RUN STOP
SS
200
R/W
Factory
setting
Off
NO
Off
Latched
Factory
setting
NO
200
NO
NO
NO
NO
NO
NO
NO
NO
R/W
NO
R/W
NO
H0FDB
R/W
NO
H4049`
D1015*
D1022
10
R/W
NO
10
10
R/W
NO
10
R/W
NO
NO
R/W
NO
R/W
NO
NO
NO
NO
NO
R/W
NO
R/W
YES
500
R/W
NO
D1038*
2-43
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
0
R/W
NO
NO
NO
NO
NO
NO
NO
NO
NO
D1050
PLC will automatically convert the ASCII data
saved in D1070~D1085 to HEX.
D1055
NO
NO
NO
NO
NO
Special
D
Function
Latched
Factory
setting
NO
NO
NO
NO
NO
NO
R/W
Yes
1600
R/W
Yes
1600
2000
R/W
Yes
2000
D1069
D1070
D1085
D1089
D1099
D1101*
R/W
NO
NO
NO
2 DVP-PLC Function
Special
D
D1112*
D1113*
D1116*
D1117*
D1118*
Function
Average of EX series analog input channel 2 (CH
2)
Average of EX series analog input channel 3 (CH
3)
EX series analog output channel 0 (CH 0) and
EP/EH series DA card channel 0 (CH0)
EX series analog output channel 1 (CH 1) and
EP/EH series DA card channel 0 (CH0)
For EX model only. It is the filter wave time setting
between the A/D conversions, and with the default
setting as 0 and the unit as 1ms, all will be
regarded as 5ms if D1118<=5.
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Latched
Factory
setting
NO
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
H86
H86
R/W
Yes
NO
NO
H3A
R/W
NO
H3A
H0D
R/W
NO
H0D
H0A
R/W
NO
H0A
R/W
NO
NO
R/W
NO
NO
NO
NO
D1121
NO
NO
R/W
NO
NO
NO
NO
NO
D1146*
NO
NO
NO
2-45
2 DVP-PLC Function
Special
D
Function
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
(K0~K9)
D1165
0
D1170* PC value when executing single step
D1172* 2-phase pulse output frequency (12Hz~20KHz)
Latched
Factory
setting
R/W
NO
200
R/W
NO
-1000
R/W
NO
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
NO
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
Target number
16-bit)
Target number
D1175*
16-bit)
Present output
D1176*
16-bit)
Present output
D1177*
16-bit)
D1174*
R/W
Yes
R/W
Yes
999
R/W
Yes
2000
2-46
2 DVP-PLC Function
Special
D
D1203*
Function
End address of M2000~M4095 auxiliary relay
latched
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Latched
Factory
setting
R/W
Yes
4095
R/W
Yes
HFFFF
R/W
Yes
HFFFF
R/W
Yes
HFFFF
R/W
Yes
HFFFF
R/W
Yes
R/W
Yes
199
R/W
Yes
R/W
Yes
234
R/W
Yes
235
R/W
Yes
255
R/W
Yes
R/W
Yes
R/W
Yes
200
R/W
Yes
999
R/W
Yes
2000
R/W
Yes
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
NO
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
D1220
D1221
D1225
D1226
D1227
D1228
D1256
D1295
D1296
D1311
2-47
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
0
R/W
R/W
NO
R/W
NO
NO
NO
NO
NO
NO
NO
NO
NO
R/W
NO
R/W
NO
R/W
NO
R/W
NO
NO
NO
NO
NO
NO
NO
NO
NO
200
R/W
Yes
200
Yes
H04D0
Yes
R/W
Yes
100
Special
D
D1341
Function
H04D0
Latched
Factory
setting
NO
D1344
R/W
NO
D1345
R/W
NO
R/W
NO
R/W
NO
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
2-48
2 DVP-PLC Function
Special
D
Function
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Latched
Factory
setting
ID 3
D1358*
Communication
ID 4
Communication
ID 5
Communication
ID 6
Communication
ID 7
Communication
ID 8
Communication
ID 9
Communication
ID 10
Communication
ID 11
Communication
ID 12
Communication
ID 13
Communication
ID 14
Communication
ID 15
Communication
ID 16
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
H1064
R/W
NO
H1064
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
HFFFF
R/W
NO
HFFFF
R/W
NO
R/W
NO
HFFFF
R/W
NO
HFFFF
R/W
NO
R/W
NO
HFFFF
R/W
NO
HFFFF
R/W
NO
R/W
NO
D1359*
D1360*
D1361*
D1362*
D1363*
D1364*
D1365*
D1366*
D1367*
D1368*
D1369*
D1370*
2-49
2 DVP-PLC Function
Special
D
D1415*
Function
Communication
ID 1
Communication
ID 2
Communication
ID 3
Communication
ID 4
Communication
ID 5
Communication
ID 6
Communication
ID 7
Communication
ID 8
Communication
ID 9
Communication
ID 10
Communication
ID 11
Communication
ID 12
Communication
ID 13
Communication
ID 14
Communication
ID 15
Communication
ID 16
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Latched
Factory
setting
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
H10C8
R/W
NO
H10C8
R/W
NO
R/W
NO
R/W
NO
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
D1416*
D1417*
D1418*
D1419*
D1420*
D1421*
D1422*
D1423*
D1424*
D1425*
D1426*
D1427*
D1428*
D1429*
D1430*
2-50
2 DVP-PLC Function
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
16
R/W
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
16
R/W
NO
16
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
Special
D
D1480*
D1495*
D1496*
D1511*
D1512*
D1527*
D1528*
D1543*
Function
D1575*
D1576*
D1591*
D1592*
D1607*
D1608*
D1623*
Latched
Factory
setting
NO
16
2-51
2 DVP-PLC Function
Special
D
D1624*
D1639*
D1640*
D1655*
D1656*
D1671*
D1672*
D1687*
D1688*
D1703*
D1704*
D1719*
D1720*
D1735*
D1736*
Function
D1751* of ID 9 PLC.
D1752* ID 9 LINK PLC writes. Communication address for
ID 9 writes is in D1423. The range is D200-D215
D1767* of ID 9 PLC.
D1768* ID 10 LINK PLC reads. Communication address
for ID 10 reads is in D1364. The range is
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Latched
Factory
setting
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
NO
R/W
NO
2 DVP-PLC Function
Special
D
D1927*
D1928*
D1943*
D1944*
D1959*
D1960*
D1975*
D1976*
D1991*
ES
Off STOP RUN
EP
EH
Attribute
EX
SA
On RUN STOP
SS
Function
Latched
Factory
setting
D200-D215 of ID 14 PLC.
ID 15 LINK PLC reads. Communication address
for ID 15 reads is in D1369. The range is
D100-D115 of ID 15 PLC.
ID 15 LINK PLC writes. Communication address
for ID 15 writes is in D1429. The range is
D200-D215 of ID 15 PLC.
ID 16 LINK PLC reads. Communication address
for ID 16 reads is in D1370. The range is
D100-D115 of ID 16 PLC.
ID 16 LINK PLC writes. Communication address
for ID 16 writes is in D1430. The range is
D200-D215 of ID 16 PLC.
NO
R/W
NO
NO
R/W
NO
1.
M1000: M1000 is On contact during runing, i.e. a normally open contact a. Using M1000 to
drive indicated lamp during running, you can know that PLC is in RUN state. M1000
is always on when PLC is RUN.
M1000~M1003
M1000
Y0
M1000 is On contact
during operation
2.
PLC is running
always ON
M1001: M1001 is Off contact during running, i.e. a normally close contact b. M1001 is
always Off when PLC is RUN.
3.
M1002: M1002 will be ON at the first scan when PLC starts RUN and then is Off. M1002 can
be regarded as scan initial pulse and pulse width is a scan time. It can be used to
initial, i.e. start positive pulse (it is ON once it is RUN).
4.
M1003: It is Off at the first scan when PLC is RUN and then is ON later, i.e. start negative
pulse (it is Off once it is RUN).
PLC RUN
M1000
M1001
M1002
M1003
scan time
2-53
2 DVP-PLC Function
Monitor
Timer
1.
2.
D1000
Monitor timer is used to moitor PLC scan time. When scan time exceeds the setting time of
moitor timer, RED ERROR LED will be light and all outputs will be Off.
The initial value of monitor timer is 200ms. You can use command MOV to change the
setting of monitor timer in the program when program is long or calculation is complicated.
Following example is set moinitor timer to 300ms.
M1002
0
MOV
K300
D1000
Primary pulse
3.
The maximum setting for monitor timer is 32,767ms. But please notice that if monitor timer
settings is too large, the detected time of calculation abnormal will be delay. Therefore, if it is
not the complicated calculateion makes scan time exceeds 200ms, it is better to set monitor
timer around 200ms.
4.
Please monitor D1010~D1012 to check if scan time exceeds D1000 setting when
calculation is complicated or PLC MPU connects too many special module to cause scan
time too long. In this situation, besides modify D1000 setting, you can also use WDT
command (API 07) in PLC program. When CPU excutes WDT command, internal monitor
timer will be clear to 0 to make scan time not exceed monitor timer setting.
It is different program capacity for different series:
Program
Capacity
D1002
Grammar
Check
If there is grammar error, PLC ERROR LED will blinking and special relay M1004=On.
2.
Time to check PLC grammar: When power is from OffOn. Other time:
M1004
D1004, D1137
It will happen with illegal operand (device) or grammar error. You can get the fault by
checking special register D1004 with fault code information. Fault address is saved in data
register D1137 (if it is general circuit error, D1137 will be invalid).
4.
Refer to chapter 2.1 Summary of DVP-PLC device number for each device usage range.
5.
Refer to chapter 2.12 Troubleshooting and Fault Information for checking grammar.
Scan Time-out 1.
Timer
2.
M1008, D1008
2-54
When scan time-out during executing, PLC ERROR LED will light and M1008=On.
Using WPLSoft or HPP to monitor D1008 which saves timeout STEP address as WDT timer
is ON.
2 DVP-PLC Function
Scan Time
Monitor
The present value, minimum value and maximum value of scan time are saved in
D1010~D1012.
1. D1010: the present scan time.
D1010~D1012
Internal Clock 1.
Pulse
There are four following clock pulses in PLC. Once PLC is power on, these four clock pulse
will act automatically.
10 ms
M1011~M1014
100 Hz
10 Hz
1 sec
1 Hz
M1013 (1 sec)
1 min
M1014 (60 sec)
2.
When PLC is STOP, clock pulse will also act. The start timing of clock pulse and RUN are
not synchronized.
High-speed
Timer
1.
M1015, D1015
There is high-speed timer command HST for EH series, refer command API 196 HST for
detail.
3.
Example:
When X10 is On, set M1015=On to start high-speed timer and record in D1015.
When X10=Off, set M1015=Off to close high-speed timer.
X10
M1015
2-55
2 DVP-PLC Function
Real
Time
Clock
1.
M1016, M1017
M1016
M1076
name
Year display of real
time clock
D1313~D1319
Fuunction
Off: show the 2 right most bits
On: show the (2 right most bits + 2000)
When OffOn, it is triggered to adjust
M1017
30 seconds
adjustment
M1076
2.
D1313
Second
0~59
D1314
Minute
0~59
D1315
Hour
0~23
D1316
Day
1~31
D1317
Month
1~12
D1318
Week
1~7
D1319
Year
If real time clock setting is error, time will reset to Jan. 1, 2000. 00:00 Saturday when PLC is
power on again.
3.
(PI)
D1018, D1019
1.
value (PI),
2.
2-56
It uses 32-bit data register which is combined with D1019 and D1018 to save floating point
2 DVP-PLC Function
Response time 1.
adjustment of
input terminal
M1019
2.
Digital filter circuit is built-in input terminals X0~X17 can set response time of receive pulse
from input terminal by the content of D1020 and D1021. Unit is ms.
When PLC is from Off On, the content of D1020 and D1021 will become to 10
automatically.
D1020, D1021
Terminal
X0
response time
0ms
1ms
0
1
setting by D1020
(default is 10)
X17
10ms
15ms
3.
10
input reflash
15
state
memory
When setting X0~X17 response time to 0ms to execute following program, the faster
response time in input terminla will be 50s due to input terminal connects to RC filter circuit
in series.
M1000
MOV
K0
D1020
normally ON contact
4.
It is not necessary to adjust response time when using high-speed counter, interrupt insert
or fast pulse catch (M1056~M1059) in program.
5.
Execution
Completed
Flag
It is the same to use command REFF (API 51) or change the content of D1020 and D1021.
API 52 MTR, API 71 HKY, API 72 DSW, API 74 SEGL, API 77 PR:
M1029=On for a scan period once the command finish executing.
M1029, M1030
2.
3.
API 63 INCD: M1029 will be On for a scan period when designated group finish comparison.
2-57
2 DVP-PLC Function
4.
5.
API 155 DABSR, API 156 ZRN, API 158 DRVI, API 158 DRVA:
M1029=On when the first output group Y0 and Y1 pulses complete sending and
M1030=On when the second output group Y2 and Y3 pulses complete sending.
M1029 or M1030 will be Off when execute this command in the next time and it will be
On after completing execution.
Clear
Command
1.
M1031, M1032
Clear unlatched
area
Output Latched
in STOP mode
M1033
2-58
When M1003 is On, the On/Off state of output will be held once PLC is from RUN to STOP. If
output contact load of PLC is heater, heaters state will be held as PLC is from RUN to STOP
and RUN after program modification.
2 DVP-PLC Function
When M1034 is drove to be On, all output Y will be Off.
All Output Y
are inhibited
M1034
M1034
RUN/STOP
Switch
1.
For EH series, when M1035 is drove to be On to start input point X0~X17 to be RUN/STOP
switch by the content of D1035 (0~17).
M1035, D1035 2.
For EP/SA series, When M1035 is drove to be On to start input point X7 to be RUN/STOP
switch.
For ES/EX/SS/EP/SA series, data response delay time can be set when PLC MPU is to be
Communication
Response Delay
D1038
Constant Scan 1.
Time
When M1039 is On, program scan time is determined by D1039. When program finishes
executing, it will execute the next scan as constant scan time attained. If D1039 is less than
program scan time, it will scan by program scan time.
M1039, D1039
M1000
M1039
normally ON
contact
MOV P
D1039
The relative commands of scan time are RAMP(API 67), HKY(API 71), SEGL(API 74),
ARWS(API 75) and PR(API 77). They should be used with constant scan time or constant
time insert interrupt.
3.
Especial for command HKY(API 71), scan time should be set to 20ms and above when it is
used 44 matrix to be 16 keys to operate.
4.
2-59
2 DVP-PLC Function
Analog
Function
D1056~D1059
1.
2.
3.
It is analog digital converter filter time setting for EX series. The factory setting is 0 and unit
D1110~D1113
D1116~D1118
Algorithm
Error Flag
5.
1.
Device
Function
D1056
D1057
D1058
D1059
D1110
D1111
D1112
D1113
D1116
D1117
D1118
M1067~M1068
D1067~D1068
2.
Explanation
STOPRUN
RUNSTOP
M1067
none
clear
latched
M1068
none
unchanged
latched
D1067
none
clear
latched
D1068
none
unchanged
latched
2-60
Latched
Function
0E18
0E19
Divisor is 0
0E1A
0E1B
0E1C
2 DVP-PLC Function
File
Register
1.
For EP/EH series, When PLC is power on or from STOP to RUN, it will check start file
register function from M1101, the start number of file register from D1101 (file registers for
EP/SA series: K0~K1,599; for EH series: K0~K9,999), read item number of file register from
M1101
D1102(read items of file registers for EP/SA series: K0~K1,600; for EH series: K0~K8,000),
D1101~D1103
D1103(file registers for save and read, start number of designated data register D (for
EP/SA series: K2,000~K4,999, for EH series: K2,000~K9,999) to determine to send file
register to designated data register automatically or not).
2.
1.
DIP Switch
Function Card
M1104~M1111
2.
Please refer to commands API 148 MEMR and API 149 MEMW explantion.
When PLC is RUN with DIP switch card, 8 DIP switches correspond to M1104~M1111
separately.
Please refer to command API 109 SWRD for detail.
When PLC is RUN with transistor output card, M1112 and M1113 correspond to 2 points
Transistor
Output Card
M1112, M1113
Pulse Output
with
Acceleration/
Deceleration
1.
The definition of special D and special M which are used by pulse output with acceleration/
deceleration:
M1115~M1119
Device
D1104
M1115
M1116
M1117
M1118
M1119
D1104
2.
Function
Start switch for accel/decel pulse output
Flag that is used in acceleration
Target frequency attained flag
Flag that is used in deceleration
Complete function flag
Using parameter index (correspond to D component)
3.
Function
+0
+1
+2
+3
+4
+5
+6
(TP)
(AP)
It doesnt need to use command, it just need to fill parameter chart and set M1115 to start.
This function can use Y0 output only, the timing is as following.
2-61
2 DVP-PLC Function
GF
Frequency
GP
TF
SF
AP
4.
AP
Pulse number
AP is pulse number of
acceleration/deceleration
Note:
This function should be executed under the following conditions all exist. Once a condition
2-62
2 DVP-PLC Function
Frequency (Hz)
5000
4000
3000
2000
1000
Time (sec)
t1
t2
t3 t4
You can get accel/decel step = (5K 1K) / 1K = 4 and output number of each pulse is
40 / 4 = 10. Therefore, you can get t1 = (1 / 1K) * 10 = 10ms, t2 = (1 / 2K) * 10 = 5ms, t3
= (1 / 3K) * 10 = 3.33ms and t4 = (1 / 4K) * 10 = 2.5ms from the following figure.
Example: Forward/Reverse accel/decel step motor control
M1002
M1115
When PLC is RUN, it will save each parameter setting into the register that designated
by D1104.
When M1115=On, acceleration/deceleration pulse starts to output.
M1116=On during acceleration, M1117=On when speed attained, M1118=On in
deceleration and M1119=On after finishing executing.
M1115 wont be reset automatically and it needs to be cleared by user.
Actual pulse output curve is in the following:
2-63
2 DVP-PLC Function
Frequency (Hz)
10K
1K
10000
Special
High-speed
pulse output
1.
90000
100000
Pulse
number
For EP series, the definition of special D and special M for special high-speed pulse (50KHz)
output function:
M1133~M1135
Device
Function
D1133
M1133
M1134
M1135
D1133
2.
Function
+0
+1
+2
+3
+4
+5
3.
Function explanation:
Output frequency and output numbers above can be modified when M1133=On and
M1135=Off. It wont affect present output pulse once output frequency or output target number
is changed. Present output pulse number will be displayed once a scan time update. It will be
cleared to 0 when M1133 is from Off On and it will keep that last output number when M1133
is from On Off.
2-64
2 DVP-PLC Function
4.
Note:
This special high-speed pulse output function can use special Y1 output point in RUN. It
can exist with PLSY Y1 at the same time and PLSY (Y0) wont be affected. If command PLSY
(Y1) is executed prior to this function, this function cant be used and vice versa. When
executing this function, general Y1 output will be invalid and outputs point of Y0 and Y2~Y7
can be used.
The difference between this function and command PLSY is higher than output frequency.
The maximum output can up to 50KHz.
Extension
Connected
Detection
D1139, D1140
D1142, D1143
D1145, D1146
1.
D1139: connection number of BCD expansion module, the maximum is 2 connections to use
with KEY expansion module.
2.
D1140: special expansion module (AD, DA, XA, PT, TC, RT, HC, PU) numbers, the
maximum is 8.
3.
4.
5.
D1145: connection number of KEY expansion module, the maximum is 2connects to use
with BCD expansion module.
6.
BCD Module
D1139
D1381~D1384
D1139
Function
connection number indication of BCD expansion module, the
maximum is 2 connections to use with KEY expansion module
D1381
D1382
D1383
D1384
2. Explanation:
PLC will update BCD module to read out BCD module value by each scan.
Special D above will be updated automatically when PLC is RUN.
The maximum number for a MPU is 2 connections, such as 2 KEY modules, a KEY
module and a BCD expansion unit or 2 BCD expansion units.
2-65
2 DVP-PLC Function
3. BCD module external wiring terminal:
DIP Switch
W8
W4
W2
W1
D7
D6
D5
D4
D3
D2
D1
D0
D6
D5
D0
DIP switch group
W8
W4
W2
W1
KEY Module
D1145
D1375~D1380
2-66
D1145
Function
Connection number indication of KEY expansion module, the
maximum is 2 connections to use with BCD expansion module
D1375
D1376
D1377
D1378
D1379
D1380
2 DVP-PLC Function
2. Explanation:
KEY module uses scan method to read data to PLC, it will just care the first button once
there are two more keys are pressed at the same time.
The maximum number for a MPU to connect is 2 connections, such as 2 KEY
modules, a KEY module and a BCD expansion unit or 2 BCD expansion units.
KEY module will be updated in each scan when PLC is RUN.
Calculated method of button number is: H+(V-1)*8. For coordinate (5,1) button, its
number is 5.
3. KEY module external wiring terminal:
Matrix Keypad
V1
V2
H1H2
Button number
D1377(D1380)
(1,1)
H1
(2,1)
V1
(1,2)
(1,3)
V3
25
33
V5
(1,6)
V7
V8
26
34
(2,6)
41
(1,7)
43
50
57
36
44
(4,7)
51
(3,8)
58
H2
52
(4,8)
59
H3
60
H4
39
46
53
47
54
61
H5
40
(8,6)
(7,7)
(6,8)
32
(8,5)
(7,6)
(6,7)
(5,8)
31
38
45
24
(8,4)
(7,5)
(6,6)
(5,7)
23
30
37
16
(8,3)
(7,4)
(6,5)
(5,6)
15
22
29
8
(8,2)
(7,3)
(6,4)
(5,5)
(4,6)
(3,7)
(2,8)
H1
35
42
49
28
14
21
(8,1)
(7,2)
(6,3)
(5,4)
(4,5)
(3,6)
(2,7)
(1,8)
27
13
20
(7,1)
(6,2)
(5,3)
(4,4)
(3,5)
12
19
(6,1)
(5,2)
(4,3)
(3,4)
(2,5)
11
18
(5,1)
(4,2)
(3,3)
(2,4)
(1,5)
10
17
(4,1)
(3,2)
(2,3)
(1,4)
V4
V6
2
(2,2)
V2
(3,1)
48
(8,7)
55
(7,8)
62
H6
56
(8,8)
63
H7
64
H8
2-67
2 DVP-PLC Function
DISP Module
1. For EH series, the definition of special D and special M definition of DISP module (7-segment
display):
D1146
Device
Function
D1385~D1393
D1146
maximum is 3 connections.
D1385
D1386
D1387
The floating point and Pre-zero setting of the first DISP module
D1388
D1389
D1390
The floating point and Pre-zero setting of the second DISP module
D1391
D1392
D1393
The floating point and Pre-zero setting of the third DISP module
2. Explanation:
It needs to use common cathode 7-segment display.
The maximum DISP module expansion units that a PLC can connect are 3 DISP
module expansion units and each DISP module expansion unit has 8 7-segment
displays.
Each 7-segment display uses 4-BITS to display.
Dot setting: there are 8 7-segment displays on a 7-segment display expansion unit.
There is a dot in each 7-segment display and each dot setting can be filled in 1~8 to
display the dot of DISP1~DISP8. If the setting is out of range, no dot of 7-segment
display will light.
Pre-zero: this function is used to decide if it needs to display 0. It will check from the
left-most bit and display 0 after non-zero bit. For example: if the values of
DISP8~DISP1 are 0, 1, 2, 3, 4, 5, 6, 7, and the 0 of DISP8 wont be displayed.
First DISP
BIT
D1385
b12~b15
D1386
b12~b15
D1387
DISP number DISP4 DISP3 DISP2 DISP1 DISP8 DISP7 DISP6 DISP5
The value of
STOP->RUN
2-68
Prezero
dot
2 DVP-PLC Function
3. DISP module external wiring terminal:
D7 D6 D5 D4 D3 D2 D1 D0
Short
circuit
2.
P
additional DC
24VDC
24VDC
24V
OV
OV
a
b
c
d
e
f
g
dot
D7
D6
D5
D4
D3
D2
D1
D0
2-69
2 DVP-PLC Function
Adjustable Acceleration/
Deceleration Pulse
Output Function
Explanation
1.
For EP/SA series, the definition of special D and special M of adjustable accel/decel pulse
output function:
Device
M1144~M1149,
M1154
D1032, D1033
D1144, D1154
D1155
2.
Function
M1144
M1145
M1146
M1147
M1148
M1149
M1154
D1032
D1033
D1144
D1154
D1155
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
2-70
Function
+n*6+2
+n*6+3
+n*6+4
+n*6+5
+n*6+6
+n*6+7
2 DVP-PLC Function
3.
Function Explanation:
This function can only be used for Y1 output point and the timing will be as follows. After
filling parameter table, set M1144 to start (it should be used in RUN mode)
GF
GF
Frequency(Hz)
GT
TF2
GT
SF3
SF2
TF3
TF1
SF4
TF4
SF1
Time(ms)
1st section
3rd section
pulse number 2nd section pulse number 4th section
pulse number
pulse number
(SE1)
(SE3)
(SE4)
(SE2)
4.
2-71
2 DVP-PLC Function
After starting to execute M1144, if M1148 outputs without attaining completed function
flag and M1144 is closed, this function will start deceleration function. If designated
acceleration function flag M1154 is Off, it will reduce 200Hz per 200ms and stop output
pulse till output frequency is less than 200Hz and set M1147 to deceleration flag. But if
designated deceleration flag M1154 is On, it will be executed by interval time and
frequency that defined by user. And interval time cant be less than or equal to 0 (if it is
less than or equal to 0, factory setting will be set to 200ms). Interval frequency cant be
greater than or equal to 0 (factory setting will be set to -1KHz when it is equal to 0 and
factory setting will be added negative sign automatically when it is greater than 0.)
When M1148 attains completed function flag and M1144 is closed, this function wont
start deceleration function and it will clear M1148 flag. Once M1144 is closed, it will
clear M1149 flag.
The execution segment of this function will execute by total segment number. The
maximum segment is 10 segments.
The acceleration/deceleration of this function will execute by start frequency of the
next segment, i.e. when target frequency of execution segment is less than start
frequency of the next segment, the next segment is acceleration and the target
frequency of the next segment must be greater than start frequency of the next
segment. When target frequency of execution segment is greater than the next
segment frequency, the next segment is deceleration, therefore, target frequency of
the next segment must be less than start frequency of the next segment. If user cant
set it by this way, we cant ensure that you can get correct output pulse.
When STOP RUN, M1144~M1149 will be cleared to Off. When RUN STOP, M1144
will be cleared and M1145~M1149 wont be cleared. D1144 will be cleared to 0 when it
is from Off On and unchanged in other case.
The usage parameter range of EP/SA series is D0~D999 and D2000~D4999. It wont
execute this command and close M1144 if parameter is out of range (includes all
usage segment parameter).
5.
2-72
2 DVP-PLC Function
Output time of target frequency is 1 / 500 * 910 = 1820 ms
Total time of this segment is 1820 + 3*100 = 2120 ms
6.
M1002
MOV K200
MOV
K2
D200
D205
D206
END
7.
2-73
2 DVP-PLC Function
Y7=OFF
TF1
SF2
TF2
X0=ON
SF1
Position
Zero point
SF1
TF2
SF2
TF1
Y7=On
Explanation:
Acceleration/deceleration setting is as example 2.
Figure above is the example of position movement. When X0 contact is On, it will start
to move and it will stop when X0 contact is Off. (Y7 is for direction setting)
Program is shown in the following.
M1002
RST
M0
RST
M1
SET
M0
ALT
M1
X0
X0
M0
M1
Y7
M1
SET
M1
M1148
RST
M0
X0
RST
END
8.
Example 4: apply acceleration and deceleration of a segment to zero point return program.
Relative flag timing chart is shown in the following.
2-74
2 DVP-PLC Function
Acceleration for
returning to zero point
Deceleration for
returning to zero point
Stop returning to zero point
X0
M1144
M1148
Frequency(Hz)
zero point
Position
Acceleration for
returning to zero point
Deceleration for
returning to zero point
Settings
+0
+2
250(Hz)
+3
100(ms)
+4
500(Hz)
+5
10000(Hz)
+6, +7
10(pulse)
+8
9750(Hz)
+9
50(ms)
+10
-500(Hz)
+11
250(Hz)
+12, +13
30000(pulse)
Program is shown in the following: (it assumes contact X7 to be start reset trigger switch)
DVP-PLC Application Manual
2-75
2 DVP-PLC Function
X7
SET
SET
X0
RST
X0
SET
RST
END
Explanation:
After contact X7 is triggered, M1144 will set to start acceleration and set M1149 not to
count pulse number. And it will send 10 pulses once deceleration switch X0 is
triggered and then enter deceleration segment.
To set M1148 to end pulse output by manual and close this function once X0 is closed.
Note: This example is just an application method that user should adjust parameters settings
used in acceleration/deceleration segment according to actual machine characteristics
and limitation.
Single Step
Execution
Function
1.
The definition of special D and special M of EH series single step execution function
Device
M1170, M1171
D1170
2.
Function explanation
M1170
M1171
D1170
Function Explanation:
Execution time: this flag is valid when PLC is at RUN mode.
Action Steps:
A.
Start M1170 to enter single step execution mode. PLC will stay at specific
command which the STEP is saved in D1170 and execute that command one
time.
B.
When Forcing M1171 to be On, PLC will execute the next command and stop at
the next command, at the same time, PLC will force M1171 to be Off. D1170 will
display present STEP value.
2-76
2 DVP-PLC Function
3.
Note:
Those commands that will be affected by scan time will be incorrect due to single STEP
execution. Example: when HKY command is executed, it needs 8 scan time to get a valid input
value of a button. Thus, single step execution will have faults.
Some commands like Pulse input/output, high-speed comparison command, wont be
affected by single STEP due to hardware start.
2-phase Pulse
Output Function
1.
For EP/SA series, the definition of special D and special M of 2-phase output function:
Device
M1172~M1174
D1172~D1177
2.
Function Explanation
M1172
M1173
M1174
D1172
D1173
D1174
D1175
D1176
D1177
Function Explanation:
Output frequency = 1/T as shown in the figure below. There are two output modes, k1 and
k2, k1 means A phase gets ahead of B phase and k2 means B phase gets ahead of A phase.
Output number calculation adds 1 once there is a phase difference, such as figure below, there
are 8 output pulses. When output numbers attains, M1174 will be On and if you want to clear
M1174, you should close M1172.
Y0(A)
Y1(B)
2-77
2 DVP-PLC Function
Output frequency, output target number and mode selection can be modified when
M1172=On and M1174=Off. The modification of output frequency and output target number
wont affect present output pulse number but mode selection modification will clear present
output pulse number to 0. Present output pulse number will be updated once scan time
updates and it will clear to 0 when M1172 is from Stop Run, and keep that last output number
when M1172 is from Run Stop.
3.
Note:
This function just can be used at RUN mode and can exist in program with PLSY
command. But if command PLSY is executed first, this function cant be used, and vice versa.
1.
VR
Potentiometer
For EH/EP/SA series, the definition of special D and special M of built-in 2 points VR
potentiometer function:
M1178~M1179
Device
D1178~D1179
M1178
M1179
D1178
D1179
2.
Function
Start potentiometer VR0
Start potentiometer VR1
VR0 value
VR1 value
Function explanation:
This function only can be used at RUN mode. When M1178=On, the variational value of
VR 0 will be converted to digit 0~255 to save in D1178. When M1179=On, the variational value
of VR 1 will be converted to digit 0~255 to save in D1179.
MODEM
Connection
Function
3.
1.
System connection
PC
MODEM
M1184~M1188
telecommunication
network
MODEM
DVP-F232 interface
WPLSoft is executing
2.
Function Explanation
Remark
When M1184=On, following actions
are valid.
This flag will be Off after finishing
initialization.
When M1185=On, M1186=Off.
When M1185=On, M1187=Off.
On means in connection
2-78
2 DVP-PLC Function
3.
(b)
(c)
(d)
STEP 4: After initialing successful, WPL software can be ready for connection on
remote PC side. WPL connection method: setting -> modem connection (you need to
install modems driver first) -> to get dial connection dialog box and then fill in dial
information as following.
4.
Caution:
(a)
It must use with RS-232 card when connecting MODEM on PLC side. If not, above
special M are invalid.
(b)
You must set M1185=On to initial MODEM after MODEM start-up (M1184=On). If not,
it cant start-up MODEM auto dial function on PLC side.
(c)
(d)
MODEM will enter to ready for dial mode on PLC side after remote PC stops
connection. If user turn MODEM power off now, it should need to initial at the next time
when turning on MODEM.
(e)
MODEM connection baud rate on PLC side is fixed to 9600bps and cant be modified.
Besides, MODEM speed must be 9600bps and faster.
(f)
Power Loss
Latched Range
Setting
1.
The initial format that used to MODEM on PLC side are ATZ and ATS0=1.
For EH/EP/SA series to set latched range. The latched range will be from start address
number to end address number.
D1200~D1219
2.
Input Point X
can force to be
ON/OFF
1.
For EP/SA series, When M1304=On, input point X (X0-X17) of MPU can force to be On-Off
M1304
For EH series, When M1304=On, input point X of MPU can force to be On-Off by using
peripheral WPLSoft and HPP.
2-79
2 DVP-PLC Function
Special
Extension
Module ID
For EH series, it will display expansion module ID in D1320~ D1327 by order when
connecting to special expansion module.
Special expansion module ID of EH series:
D1320~D1327
Expansion Module
Name
DVPEH04AD
DVP04DA-H
DVPEH04PT
DVPEH04TC
DVPEH06XA
DVPEH06RT
Easy PLC
Link
M1350-M1352
M1360-M1439
D1355-D1370
D1415-D1465
D1480-D1991
1.
Expansion Module ID
H0400
H0401
H0402
H0403
H0604
H0405
Expansion Module
Name
DVPEH01PU
DVPEH01HC
DVPEH02HC
DVPEH01DT
DVPEH02DT
Expansion Module ID
H0110
H0120
H0220
H0130
H0230
Explanation of Special D and special M explanation of EH series EASY PLC LINK ID1ID8:
MASTER PLC
SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID
1
2
3
4
5
6
7
8
read Write read Write read Write read Write read Write read Write read Write read Write
out
in
out
in
out
in out in
out
in
out
in
out
in
out
in
D1480 D1496 D1512 D1528 D1544 D1560 D1576 D1592 D1608 D1624 D1640 D1656 D1672 D1688 D1704 D1720
D1495 D1511 D1527 D1543 D1559 D1575 D1591 D1607 D1623 D1639 D1655 D1671 D1687 D1703 D1719 D1735
Item
number
Item
Item
Item
number number number
Item
Item
Item
Item
number number number number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
D1434 D1450 D1435 D1451 D1436 D1452 D1437 D1453 D1438 D1454 D1439 D1455 D1440 D1456 D1441 D1457
M1360
M1361
M1366
M1367
M1377
M1378
M1379
M1380
M1381
M1382
M1383
M1397
M1398
M1399
M1393
M1394
M1395
M1396
Read completed flag (Whenever finishing a PLC read/write, this flag will be Off automatically)
M1408
M1409
M1410
M1411
M1412
M1413
M1414
M1415
Write completed flag (whenever finishing a PLC read/write, this flag will be Off automatically)
M1424
M1425
M1426
M1427
M1428
M1429
M1430
M1431
D100 D200
D115 D215
2-80
2 DVP-PLC Function
2.
Explanation of Special D and special M explanation of EH series EASY PLC LINK ID9ID16:
MASTER PLC
SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID SLAVE ID
9
10
11
12
13
14
15
16
read Write read Write read Write read Write read Write read Write read Write read Write
out
in
out
in
out
in out in
out
in
out
in
out
in
out
in
D1736 D1752 D1768 D1784 D1800 D1816 D1832 D1848 D1864 D1880 D1896 D1912 D1928 D1944 D1960 D1976
D1751 D1767 D1783 D1799 D1815 D1831 D1847 D1863 D1879 D1895 D1911 D1927 D1943 D1959 D1975 D1991
Item
number
Item
Item
Item
number number number
Item
Item
Item
Item
number number number number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
Item
number
D1442 D1458 D1443 D1459 D1444 D1460 D1445 D1461 D1446 D1462 D1447 D1463 D1448 D1464 D1449 D1465
M1368
M1369
M1374
M1375
M1385
M1386
M1387
M1388
M1389
M1390
M1391
M1405
M1406
M1407
M1401
M1402
M1403
M1404
Read completed flag (Whenever finishing a PLC read/write, this flag will be Off automatically)
M1416
M1417
M1418
M1419
M1420
M1421
M1422
M1423
Write completed flag (whenever finishing a PLC read/write, this flag will be Off automatically)
M1432
M1433
M1434
M1435
M1436
M1437
M1438
M1439
Explanation:
The basic communication protocol for EASY PLC LINK is MODBUS
When connecting to RS-485, the baud rate for all slave peripheral and communication
format should be the same as master PLC, such as set D1120 for PLC. When EP MPU
is used to be slave, only ASCII mode can be used. When EH MPU is used to be slave,
ASCII mode and RTU mode can be used.
All communication format used to connect to PLC should be the same (set D1120 for
PLC) and it supports ASCII and RTU mode.
2-81
2 DVP-PLC Function
The maximum slave PLCs for a master PLC to connect is 16 slave PLCs.
The ID of slave PLC should be fixed to 1~16 and each slave ID cant be repeated.
RS-232, RS-485 and RS-422 can be used in one-to-one connection. When slave PLC
uses RS-232, only ASCII mode can be used and communicatioin format is (7, E, 1).
One to multiple connection can connect to RS-485 in series
4.
Operation:
Setting Master PLC ID by D1121 and slave ID first. ID cant be repeated.
Setting read/write items of slave (the maximum is 16 items). (refer to special D for
detail)
Setting device communication address to read/write to slave. (refer to Special D
explanation above for special D setting. Factory setting of communication address for
reading is H1064 (D100) and writing is H10C8 (D200).
Setting PLC LINK automatically (M1351)
Setting PLC LINK manually (M1352)
Start MASTER PLC LINK (M1350)
5.
6.
2-82
2 DVP-PLC Function
Manual mode: It needs to set times of read to D1431. One time means finish all Slave
read/write. When PLC starts Link, D1432 will start to count times of
Link. When D1431 = D1432, PLC will stop Link and force M1351 to be
Off at the same time. If M1351 is forced to be On, PLC will start to link
according to D1431 value automatically.
Caution:
1.
Automation mode M1351 and manual mode M1352 cant be On at the same
time.
2.
3.
4.
Communication time-out can be set by D1129. The setting range is from 300
to 3000. When it is out of range, it will be regarded as 300 when it is less
than 300 and regarded as 3000 when it is larger than 3000. Besides, this
setting is valid when it is set before linking.
5.
PLC LINK function is only valid when baud rate is larger than 1200 bps.
When baud rate is less than 9600 bps, please set communication time-out to
more than 1 second.
6.
7.
2-83
2 DVP-PLC Function
2.12 Fault Code Information
If the PLC ERROR LED is flashing or special relay M1004=On after writing program in PLC, the problem may be
an invalid operand or error grammar. You can get fault code saved in special register D1004 to check in following
table to get error message and error address is saved in D1137. (D1137 will be invalid if it is general loop error)
Please refer to chapter 2.1 for each model usage range.
Fault Code
0001
0002
0003
0102
Description
Operand bit device S exceeds the usage
range
Label P exceeds the usage range or
duplicated
Operand KnSm exceeds the usage range
Interrupt pointer I exceeds the usage
range or duplicated
Fault Code
0F06
0F07
0F08
1000
C403
C404
0202
C400
0302
C401
0401
0403
0501
0503
C402
C405
C407
0803
C409
0D01
0D02
0D03
0D04
0D05
0D06
0D07
0D08
0E01
0601
0604
0801
0E04
0E05
0E18
0E19
0E1A
0E1B
0E1C
0F04
0F05
2-84
Description
C408
C40A
C40B
C40C
C40D
C40E
C41C
C41D
C41E
C41F
C4FF
C4EE
3 Basic Commands
3.1 Summary of Basic Command and Step Ladder Command
Basic Commands
Command
Code
Function
Operands
ES/EX/SS/EP/SA
EH
STEP
Page
LD
Load contact A
X, Y, M, S, T, C
5.6
0.24(0.56)
1~3
3-3
LDI
Load contact B
X, Y, M, S, T, C
5.68
0.24(0.56)
1~3
3-3
AND
X, Y, M, S, T, C
4.8
0.24(0.56)
1~3
3-3
ANI
X, Y, M, S, T, C
4.88
0.24(0.56)
1~3
3-4
OR
X, Y, M, S, T, C
4.8
0.24(0.56)
1~3
3-4
ORI
X, Y, M, S, T, C
4.88
0.24(0.56)
1~3
3-5
ANB
None
4.4
0.24
1~3
3-5
ORB
None
4.4
0.24
1~3
3-5
MPS
None
4.64
0.24
1~3
3-6
MRD
None
0.24
3-6
MPP
None
4.4
0.24
3-6
STEP
Page
Output commands
Command
Code
Function
Operands
ES/EX/SS/EP/SA
EH
OUT
Drive coil
Y, S, M
6.4
0.24(0.56)
1~3
3-7
SET
Y, S, M
5.04
0.24(0.56)
1~3
3-7
RST
Y, M, S, T, C, D,
E, F
7.6
0.24(0.56)
3-7
STEP
Page
Timers, Counters
API
Command
Code
Function
Operands
ES/EX/SS/EP/SA
EH
96
TMR
16-bit timer
T-K or T-D
9.6
25
3-8
97
CNT
16-bit counter
12.8
30
3-8
97
DCNT
32-bit counter
14.32
50
3-9
STEP
Page
Function
Operands
5.6
20
3-10
5.76
15
3-10
N0~N7
3-1
3 Basic Commands
Rising-edge/falling-edge detection commands of contact
Command
Code
API
Function
Operands
ES/EX/SS/EP/SA
EH
STEP Page
90
LDP
S, X, Y, M, T, C
8.16
0.56(0.88)
3-11
91
LDF
S, X, Y, M, T, C
8.32
0.56(0.88)
3-11
92
ANDP
7.68
0.56(0.88)
3-11
93
ANDF
7.76
0.56(0.88)
3-12
94
ORP
7.68
0.56(0.88)
3-12
95
ORF
7.76
0.56(0.88)
3-13
Command
Code
Function
Operands
ES/EX/SS/EP/SA
EH
STEP
Page
89
PLS
Rising-edge output
Y, M
9.92
0.56(0.88)
3-13
99
PLF
Falling-edge output
Y, M
10.16
0.56(0.88)
3-13
STEP
Page
3-14
STEP
Page
End command
Command Code
Function
Program end
END
Operands
ES/EX/SS/EP/SA
EH
7.44
0.24
none
Other commands
API
98
Command
Code
Function
Operands
ES/EX/SS/EP/SA
EH
NOP
No function
none
3.52
0.16
3-14
INV
Inverting operation
none
3.92
0.24
3-15
Pointer
3-15
Interrupt pointer
P0~P255
I
3-15
Function
Operands
STEP
Page
STL
4-1
RET
none
4-1
Note: The value wrote in () in the column of execution speed of EH series is the execution speed of specific
operand M1536~M4095.
3-2
3 Basic Commands
3.2 Basic Commands Explanations
Command
LD
Operand
Functions
Adaptive model
ES/EX/SS EP/SA EH
Load A contact
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
The LD command is used on the A contact that has its start from the left BUS or the A
Command
Explanation
contact that is the start of a contact circuit. Function of the command is to save present
contents, and at the same time, save the acquired contact status into the accumulative
Program
Example
register.
Ladder Diagram:
X0
X1
Y1
Command
LDI
Operand
Command Code:
LD
AND
OUT
Load contact A of X0
Connect to contact A of X1 in
series
Drive Y1 coil
X0
X1
Y1
Functions
Adaptive model
ES/EX/SS EP/SA EH
Load B contact
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
The LDI command is used on the B contact that has its start from the left BUS or the B
Command
Explanation
contact that is the start of a contact circuit. Function of the command is to save present
contents, and at the same time, save the acquired contact status into the accumulative
register.
Program
Example
Ladder Diagram:
X0
X1
Y1
Command
AND
Operand
Command Code:
LDI
AND
OUT
Load contact B of X0
Connect to contact A of X1 in series
Drive Y1 coil
X0
X1
Y1
Functions
Adaptive model
ES/EX/SS EP/SA EH
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
3-3
3 Basic Commands
The AND command is used in the series connection of A contact. The function of the
Command
Explanation
command is to readout the status of present specific series connection contacts first,
and then to perform the AND calculation with the logic calculation result before the
contacts, thereafter, saving the result into the accumulative register.
Program
Example
Command Code:
Ladder Diagram:
X1
X0
Y1
Command
ANI
Operand
LDI
AND
OUT
X1
X0
Y1
Functions
Adaptive model
ES/EX/SS EP/SA EH
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
The ANI command is used in the series connection of B contact. The function of the
Command
Explanation
command is to readout the status of present specific series connection contacts first,
and then to perform the AND calculation with the logic calculation result before the
contacts, thereafter, saving the result into the accumulative register.
Program
Example
Command Code:
Ladder Diagram:
X1
LD
ANI
OUT
X0
Y1
Command
OR
Operand
Command
Explanation
X1
X0
Y1
Functions
Adaptive model
ES/EX/SS EP/SA EH
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
The OR command is used in the parallel connection of A contact. The function of the
command is to readout the status of present specific series connection contacts, and
then to perform the OR calculation with the logic calculation result before the contacts,
thereafter, saving the result into the accumulative register.
Program
Example
X0
Y1
X1
3-4
Command Code:
Ladder Diagram:
LD
OR
OUT
X0
X1
Y1
3 Basic Commands
Command
ORI
Operand
Functions
Adaptive model
ES/EX/SS EP/SA EH
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
The ORI command is used in the parallel connection of B contact. The function of the
Command
Explanation
command is to readout the status of present specific series connection contacts, and
then to perform the OR calculation with the logic calculation result before the contacts,
thereafter, saving the result into the accumulative register.
Program
Example
Command Code:
Ladder Diagram:
X0
LD
ORI
OUT
Y1
X1
Command
ANB
Functions
Program
Example
none
To perform the AND calculation between the previous reserved logic results and
contents of the accumulative register.
Command Code:
Ladder Diagram:
X0 ANB X1
X2
Y1
X3
Block A Block B
Command
ORB
LD
ORI
LDI
OR
ANB
OUT
Functions
X0
X2
X1
X3
Y1
Operand
Command
Explanation
Adaptive model
ES/EX/SS EP/SA EH
Operand
Command
Explanation
X0
X1
Y1
None
To perform the OR calculation between the previous reserved logic results and
contents of the accumulative register.
3-5
3 Basic Commands
Program
Example
Command Code:
Ladder Diagram:
X0
X1 Block A
Y1
X2
X3
ORB
Block B
Command
MPS
To save contents of the accumulative register into the operation result. (the result
operation pointer pulses 1)
Functions
None
Reading content of the operation result to the accumulative register. (the pointer of
operation result doesnt move)
Functions
Program
Example
None
To retrieve the previous reserved logic calculation result from the operation result and
save it into the accumulative register. (the pointer of result operation minus 1)
Command Code:
Ladder Diagram:
X0
MPS
X1
Y1
X2
MRD
M0
Y2
MPP
END
3-6
Adaptive model
ES/EX/SS EP/SA EH
Operand
Command
Explanation
Adaptive model
ES/EX/SS
EP
EH
Command
MPP
Adaptive model
ES/EX/SS EP/SA EH
None
Operand
Command
Explanation
Y1
Command
MRD
X0
X1
X2
X3
Functions
Operand
Command
Explanation
LD
ANI
LDI
AND
ORB
OUT
LD
MPS
AND
OUT
MRD
AND
OUT
MPP
OUT
END
X0
X1
Y1
X2
M0
Y2
3 Basic Commands
Command
OUT
Operand
Functions
Adaptive model
ES/EX/SS EP/SA EH
Output coil
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
Output the logic calculation result before the OUT command to specific device.
Command
Explanation
Program
Example
Contact
Coil
FALSE
OFF
Non-continuity
B contact (normally
close)
Continuity
TRUE
ON
Continuity
Non-continuity
Command Code:
Ladder Diagram:
X0
X1
Operand
LDI
AND
OUT
Y1
Command
SET
X0
X1
Y1
Functions
Adaptive model
ES/EX/SS EP/SA EH
LatchON
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
When the SET command is driven, its specific device is set to be ON, which will keep
Command
Explanation
ON whether the SET command is still driven. You can use the RST command to set
the device to OFF.
Program
Example
X0
Y0
SET
Command
RST
Operand
Y1
LD
ANI
SET
Functions
Y0~Y377
M0~M4,095
S0~S1,023
X0
Y0
Y1
Adaptive model
ES/EX/SS EP/SA EH
Command code
explanation:
Load contact A of X0
Connect to contact B
of Y0 in series
Y1 latch (ON)
Command Code:
Ladder Diagram:
T0~T255
C0~C255
D0~D9,999 E, F
3-7
3 Basic Commands
Command
Explanation
When the RST command is driven, motion of its specific device is as follows:
Device
S, Y, M
T, C
D, E, F
Status
Coil and contact will be set to OFF.
Present values of the timer or counter will be set to 0, and the coil and
contact will be set to OFF.
The content value will be set to 0.
If the RST command is not executed, status of specific device will not be changed.
Program
Example
Command Code:
Ladder Diagram:
X0
RST
LD
RST
Y5
X0
Y5
Command code
explanation:
Load contact A of X0
Clear contact Y5
Command
TMR
Functions
Adaptive model
ES/EX/SS EP/SA EH
16-bit timer
T-K
T0~T255, K0~K32,767
T-D
T0~T255, D0~D9,999
Operand
Command
Explanation
When TMR command is executed, the specific coil of timer is ON and timer will start to
count. When the setting value of timer is attained (counting value >= setting value), the
contact will be as following:
Program
Example
X0
TMR
T5
K1000
Open collector
Close collector
Command code
Command Code:
explanation:
LD
X0
Load contact A of X0
TMR
T5 K1000
T5 timer
Setting is K1000
Please refer to the specification of every model for the operand T usage.
Footnote
Command
CNT
Functions
16-bit counter
C-K
C0~C199, K0~K32,767
C-D
C0~C199, D0~D9,999
Adaptive model
ES/EX/SS EP/SA EH
Operand
3-8
3 Basic Commands
Command
Explanation
When the CNT command is executed from OFF ON, which means that the counter
coil is driven, and 1 should thus be added to the counters value; when the counter
achieved specific set value (value of counter = the setting value), motion of the contact
is as follows:
NO(Normally Open) contact
NC(Normally Closed) contact
Continuity
Non-continuity
If there is counting pulse input after counting is attained, the conatcts and the counting
values will be un unchanged. To re-count or to conduct the CLEAR motion, please use
the RST command.
Program
Example
Ladder Diagram:
X0
CNT
Command
DCNT
Command Code:
C20
K100
LD
CNT
X0
C20 K100
Functions
32-bit counter
C-K
C200~C254K-2,147,483,648~K2,147,483,647
C-D
C200~C254, D0~D9,999
Command code
explanation:
Load contact A of X0
C20 counter
Setting is K100
Adaptive model
ES/EX/SS EP/SA EH
Operand
Command
Explanation
DCNT is the startup command for the 32-bit high-speed counter that is utilized
especially in counters C232 to C255.
For general addition/subtraction counter C200~C234, the present value will count up
(add 1) or count down (subtract 1) when command DCNT is from OffOn.
When specific high-speed counter pulse input of high-speed addition/subtraction
counters C235~C254 is from OffOn, it will execute counting. If counter trigger input
keeps being On or Off, the counter value will be unchanged. See chapter 2.7 timer
number and function for high-speed pulse input terminals (X0~X17) and counting
(count up (add 1) and count down (subtract 1)).
When DCNT command is OFF, the counter will stop counting, but the counting values
will not be cleared. Users can use RST C2XX command to remove the counting values
and the contacts. High-speed addition/subtraction counters C235~C254 can use
Program
Example
external specific input point to remove the counting values and the contacts.
Command Code:
Command code
LadderDiagram:
M0
LD
M0
explanation:
C254 K1000 Load contact A of
K1000 DCNT
DCNT
C254
M0 and C254
LD M0
counter
Setting is K1000
DCNT C254 K1000
3-9
3 Basic Commands
Command
MC / MCR
Operand
Command
Explanation
Functions
Adaptive model
ES/EX/SS EP/SA EH
N0~N7
MC is the main-control start command. When the MC command is executed, the
execution of commands between MC and MCR will not be interrupted. When MC
command is OFF, the motion of the commands that between MC and MCR is described
as follows:
The counting value is set back to zero, the coil
and the contact are both turned OFF
The coil is OFF, and the timer value and the
contact stay at their present condition
The coil is OFF, and the counting value and the
contact stay at their present condition
Timer
Accumulative timer
Counter
Coils driven up by the OUT
command
Devices driven up by the SET
and RST commands
Application commands
MCR is the main-control ending command that is placed at the end of the main-control
program and there should not be any contact commands prior to the MCR command.
Commands of the MC-MCR main-control program supports the nest program structure,
with 8 layers as its greatest. Please use the commands in order from N0~ N7, and refer
Program
Example
to the following:
Ladder Diagram:
X0
MC
N0
X1
Y0
X2
MC
N1
X3
Y1
MCR
N1
MCR
N0
MC
N0
X10
X11
Y10
MCR
3-10
N0
3 Basic Commands
Command
LDP
Operand
Functions
Rising-edge detection operation
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
Usage of the LDP command is the same as the LD command, but the motion is
Command
Explanation
Program
Example
Adaptive model
ES/EX/SS EP/SA EH
different. It is used to reserve present contents and at the same time, saving the
detection status of the acquired contact rising-edge into the accumulative register.
Command code explanation:
Command code:
Ladder Diagram:
Start X0 rising-edge
detection
Y1
Series connection A contact
of X1
Drive Y1 coil
Please refer to the specification of every model for the operand usage.
X0
Footnote
LDP
AND
OUT
X1
X0
X1
Y1
If specific rising-edge contact state is On before PLC is power on, rising-dedge contact
will be True after PLC is power on.
Command
LDF
Operand
Functions
Falling-edge detection operation
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
D0~D9,999
Usage of the LDF command is the same as the LD command, but the motion is
different. It is used to reserve present contents and at the same time, saving the
detection status of the acquired contact falling-edge into the accumulative register.
Command code:
Ladder Diagram:
Command code
explanation:
LDF
X0
X0
X1
AND
X1
Start X0 falling-edge
Y1
OUT
Y1
detection
Series connection A
contact of X1
Drive Y1 coil
Command
Functions
ANDP
Operand
C0~C255
Command
Explanation
Program
Example
Adaptive model
ES/EX/SS EP/SA EH
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
Adaptive model
ES/EX/SS EP/SA EH
C0~C255
D0~D9,999
3-11
3 Basic Commands
ANDP command is used in the series connection of the contacts rising-edge detection.
Command
Explanation
Program
Example
X0
Command code
explanation:
Command Code:
Ladder Diagram:
X1
Y1
LD
ANDP
OUT
X0
X1
Y1
Load A contact of X0
X1 rising-edge detection in
series connection
Drive Y1 coil
Command
Functions
ANDF
Operand
X0~X377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
ANDF command is used in the series connection of the contacts falling-edge detection.
Ladder Diagram:
X0
X1
Y1
Command Code:
LD
ANDF
OUT
Load A contact of X0
X1 falling-edge detection in
series connection
Drive Y1 coil
X0
X1
Y1
Command
Functions
ORP
Operand
Command
Explanation
Program
Example
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
Adaptive model
ES/EX/SS EP/SA EH
C0~C255
D0~D9,999
The ORP commands are used in the parallel connection of the contacts rising-edge
detection.
Command Code:
Ladder Diagram:
X0
Y1
X1
3-12
D0~D9,999
Command
Explanation
Program
Example
Y0~Y377
Adaptive model
ES/EX/SS EP/SA EH
LD
ORP
OUT
X0
X1
Y1
Command code
explanation:
Load A contact of X0
X1 rising-edge detection in
parallel connection
Drive Y1 coil
3 Basic Commands
Command
Functions
ORF
Operand
X0~X377
M0~M4,095
Command Code:
Ladder Diagram:
X0
LD
ORF
OUT
Y1
D0~D9,999
X0
X1
Y1
Command code
explanation:
Load A contact of X0
X1 falling-edge detection in
parallel connection
Drive Y1 coil
Functions
Adaptive model
ES/EX/SS EP/SA EH
Rising-edge output
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
When X0=OFFON (rising-edge trigger), PLS command will be executed and M0 will
Command
Explanation
Program
Example
C0~C255
detection.
Command
Operand
T0~T255
The ORP commands are used in the parallel connection of the contacts falling-edge
X1
PLS
S0~S1,023
Command
Explanation
Program
Example
Y0~Y377
Adaptive model
ES/EX/SS EP/SA EH
send the pulse of one time which the length is a scan time.
Command Code:
Ladder Diagram:
X0
PLS
M0
SET
Y0
LD
PLS
LD
SET
M0
X0
M0
M0
Y0
Timing Diagram:
Command code
explanation:
Load A contact of X0
M0 rising-edge output
Load the contact A of
M0
Y0 latched (ON)
X0
a scan time
M0
Y0
Command
PLF
Operand
Functions
Adaptive model
ES/EX/SS EP/SA EH
Falling-edge output
X0~X377
Y0~Y377
M0~M4,095
S0~S1,023
T0~T255
C0~C255
D0~D9,999
3-13
3 Basic Commands
When X0= ONOFF (falling-edge trigger), PLF command will be executed and M0 will
Command
Explanation
Program
Example
send the pulse of one time which the length is the time for scan one time.
Command Code:
Ladder Diagram:
X0
PLF
M0
SET
Y0
LD
PLF
LD
SET
M0
X0
M0
M0
Y0
Timing Diagram:
Command code
explanation:
Load A contact of X0
M0 falling-edge output
Load the contact A of
M0
Y0 latched (ON)
X0
a scan time
M0
Y0
Command
END
Functions
Program End
Operand
Command
Explanation
Adaptive model
ES/EX/SS EP/SA EH
None
It needs to add the END command at the end of ladder diagram program or command
program. PLC will scan from address o to END command, after executing it will return
to address 0 to scan again.
Command
NOP
Functions
No operation
Operand
Command
Explanation
Adaptive model
ES/EX/SS EP/SA EH
none
This is a no-operation command and has no effect on the previous operation. NOP is
used in the following cases: To delete a command without changing the number of
steps. (Overwrite with NOP)
Program
Example
Ladder Diagram:
Command Code:
X0
Y1
Drive Y1 coil
X0
NOP
3-14
LD
NOP
OUT
Command code
explanation:
Load B contact of X0
No operation
Y1
3 Basic Commands
Command
Functions
INV
Adaptive model
ES/EX/SS EP/SA EH
Inverting Operation
Operand
None
Inverting the operation result and use the new data as an operation result.
Command
Explanation
Y1
Command
Functions
Adaptive model
ES/EX/SS EP/SA EH
Pointer
Operand
P0~P255
Pointers are used with the jump commands (CJ, CALL) in two different ways as follows.
Command
Explanation
Ladder Diagram:
Program
Example
X0
CJ
X1
P10
Y1
Command
Ladder Diagram:
X0
Program
Example
P10
LD
CJ
:
P10
LD
OUT
Functions
Interrupt Pointers (I)
Operand
Command
Explanation
X0
P10
X1
Y1
Command code
explanation:
Load A contact of X0
Jump from command CJ
to P10
Pointer P10
Load a contact of X1
Drive Y1 coil
Adaptive model
ES/EX/SS EP/SA EH
3-15
3 Basic Commands
Program
Example
Command Code:
Ladder Diagram:
EI
X1
Y1
interrupt
Service
program
pointer
DI
FEND
X2
I 001
Y2
IRET
Footnote
EI
LD
OUT
:
DI
:
FEND
I001
LD
OUT
:
IRET
Command
code explanation:
Interrupt Enable
X1 Load A contact of X1
Y1 Drive Y1 coil
Interrupt Disable
Program end
Insert point
X2 Load A contact of X2
Y2 Drive Y2 coil
Interrupt and return
3-16
STL
Function
Operand
Adaptive model
ES/EX/SS EP/SA EH
S0~S1023
The step ladder command, STL Sn, has constituted the stepping point, and when the
Command
Explanation
STL command showed up in the program, it implies that the program is now at the step
ladder diagram condition that is controlled by the step procedure. The step ladder
command RET represents the end of the step ladder diagram (from S0~S9) that is to
return to the BUS command. The SFC diagram is represented through the step ladder
diagram composed of STL/RET. The number of step point S cant be repeated.
Common
Function
Operand
RET
None
Adaptive model
ES/EX/SS EP/SA EH
At the end of the step procedure, be sure to write in the RET command; the RET
Command
Explanation
command indicates the end of the step procedure. Maximum is 10 step procedures
(S0~S9) for a PLC program and it should have RET command at the end of each step
Program
Example
procedure.
Ladder Diagram:
SFC:
M1002
S0
S
ZRST
S0
SET
S0
SET
S20
X0
S20
S
S30
Y1
S40
S
Y2
X0
Y0
S30
Y1
X2
X2
SET
S0
X1
X1
S30
S
M1002
S20
Y0
SET
S127
S40
S40
Y2
X3
X3
S0
RET
S0
END
4-1
SFC:
simple SFC design for each state and make machine works.
S0
2. The action is easy to understand and easy to adjust initial PLC start-up, detect
X0
and maintain.
S21
3. SFC edition theory is made by IEC1131-3. It is figure edition mode and the
X1
structure looks like flow chart. Each PLC internal step relay S is used to be step
X2
S22
point and also equal to each step of flow chart. After finishing present step, it
S24
X3
will transfer to the next step, i.e. next step point S, by setting condition. By
repeating this way, it can reach the result that user needs.
4. Explanation of right side SFC figure: each step has its own transition condition
X4
to move from one step to the next step. In this figure, primary step point S0 will
S24
move to step point S21 once this transition condition X0 is established, and
X5
S21 can move to S22 or S24 by transition condition X1 or X2 and S25 will
S25
X6
established. By this way, it can circulate control with repeat again and again.
S0
It is used for ladder step mode. This figure means internal edition program is a general step
ladder diagram not step ladder program.
It is for primary step point. This double-frame is used for SFC primary step point and the usage
devices are S0~S9.
It is used for general step point and the usage devices are S10~S1023.
It is JUMP step point that used to move from step point to another which is not next to it. (it can
be used to disconnected jump up or jump down in the same program procedure, return to
primary step point or jump between different program procedure.
It is the transition condition of step point that used to move between each step point.
It is alternative divergence that used for a step point to move to different corresponding step
point by different transition condition.
It is alternative convergence that used for two step points and above to move to the same step
point according to transition condition.
It is simultaneous divergence that used for a step point move to two step points and above by the
same transition condition.
It is simultaneous convergence that used for two step points and above to move to the same step
point with the same transition condition when the condition is established at the same time.
4.3
command helps the program designer to have clearer ideas on the program procedure, and thus the procedure will
be more readable. As shown in the following diagrams, we could switch our procedure diagram from the left
diagram to the right PLC structure diagram.
4-2
M1002
primary pulse
S0
S21
S22
M1002
SET
S0
S0
S
SET
S21
S21
S
SET
S22
S22
S
SET
S23
S23
S
S0
S23
RET
S10
S
Y0
SET
Y1
X0
SET
S20
S
Y0
S20
Y10
X1
When X0=ON,
S20=On,
S10=Off.
SET
Y1
SET
S20
X0
S20
S
Y10
X1
SET
S30
SET
S30
Explanation:
When S10=ON, Y0 and Y1 are ON. When X0=ON, S20=ON and Y10 is ON, too.
And when S10 is OFF, Y0 will be OFF, but Y1 is ON. (Since Y1 uses the SET command, it will keep in ON status)
2.
Step ladder timing: when state contact Sn is On, circuit will be activated and circuit wont be activated when
state contact Sn is Off. (Above action will be executed after delaying a scan time)
3.
4-3
Y0
SET
Y1
SET
S20
X0
S20
S
Y0
X1
SET
S30
S20
TMR
T1
K10
TMR
T2
K20
TMR
T1
K30
X1
S30
X2
S40
5.
use these commands could be different: when the controlling power is transferred to another step point, the status of
the original step point S and the action of the output point would all be erased. Due to that numerous step control
procedures could exist at the same program simultaneously (take S0~S9 as the starting and ending points to lead the
step ladder diagram), the transfer of steps could thus be on the same step procedure or could be transferred to
different step procedures. And thus, the transfer commands, SET Sn and OUT Sn, of the step point might vary
somewhat in usage; please refer to the following explanations:
SET Sn
S10
Y10
X0
S12
SET
S12
Y11
X1
SET
S14
Within the same procedure, transfer of the simultaneous convergence point and different procedures
are used to drive up separate step points, and after the status is transferred, outputs of previous action
status points will be clear.
4-4
OUT
Ladder diagram:
S0
S0
S
S21
S
S21
X2
S24
X2
S23
S
S24
up or down between
S24
S
S25
S
OUT
S25
X7
S0
At different procedures, it
is used to drive up
RET
SFC figure:
OUT
ladder diagram:
OUT
S0
S21
S21
S
S41
X2
OUT
S23
Drive separate
step point
S0
S
S1
S23
S
S42
S1
S
RET
S42
S43
S42
S
step procedure
inducted by S0
step procedure
inducted by S1
S43
S
RET
6.
point, output coil cant be connected from BUS directly. There will be error when compiling. It is needed to modify to
following middle and left diagram to correct diagram.
BUS
Sn
S
Y0
M0
Sn
S
Y0
Y1
Y2
7.
Sn
S
Y2
M0
modify position
Y1
or
Y0
M0
M1000
Y1
Y2
connection circuits or application commands could all be utilized, however, part of the commands are under certain
restrictions, please refer to the following descriptions:
4-5
LD/LDI/LDP/LDF
AND/ANI/ANDP/ANDF
OR/ORI/ORP/ORF
INV/OUT/SET/RST
ANB/ORB
MPS/MRD/MPP
MC/MCR
Yes
Yes
Yes
Yes
Yes
No
No
No
No
LD X0
Sn
S
X0
MPS
X1
Y1
X2
BUS
M0
MRD
X3
Y2
MPP
8.
Command code:
Explanation:
STL
LD
MPS
AND
OUT
MRD
AND
OUT
MPP
AND
OUT
Sn
X0
X1
Y1
or
LDI
before
using
Other Notice:
For general, commands (SET S or OUT S) that used to transfer to next state are better to use after finishing
S10
S
Y0
SET
Y1
S20
SET
Y1
S20
S
4-6
Y2
Y0
S20
S
S20
Y2
S20
S
X1
S0
RET
S20
S
X1
S0
RET
OUT
S0
OUT
S21
S41
OUT
S1
S42
S30
S43
4-7
4.5
Description
M1040
Step transition inhibits. When M1040 is On, all movement of step point are inhibited.
M1041
M1042
M1043
M1044
M1045
M1046
STL state setting. Once there is a step point On, M1046 is On.
M1047
D1040
D1041
D1042
D1043
D1044
D1045
D1046
D1047
Categories of Procedures
A. Single procedure: the basic step action is single procedure control action.
The first step point of step ladder diagram is called primary step point and the number is S0~S9. Those step points
after primary step point are called general step point and the number are S10~S1023. S10~S19 will be used as origin
reset step points once use command IST.
A-1 Single Procedure without Divergence and Convergence
After finishing a procedure, transferring control power of step point to primary step point.
4-8
SFC diagram
ZRST
S0
S127
M1002
S0
S0
S
SET
S0
SET
S20
X0
X0
S20
Y0
X1
S20
S
Y0
S30
X1
SET
S30
S
S30
Y1
S40
S
S40
Y2
S50
S
S40
S50
Y2
S50
Y3
X4
S60
X3
SET
X2
X3
X2
SET
Y1
Y4
X5
S0
Y3
X4
SET
S60
S
S60
Y4
X5
S0
RET
END
4-9
2.
point.
procedure.
OUT
OUT
S0
S21
OUT
S0
OUT
S21
S41
OUT
S42
S1
S41
S42
S43
S43
S0
S21
RST
S50
4-10
S20
S
SET
S21
SET
S22
SET
S23
SET
S24
S20
S22
S21
S23
S24
S20
S
X0
SET
S30
SET
S31
SET
S32
X1
X2
SFC diagram of alternative divergence:
S20
X0
S30
X1
S31
X2
S32
4-11
X2
S42
S
SET
S50
S40
S41
S42
X2
S50
S40
S
X1
S50
S
X2
SET
S60
SET
S60
SET
S60
S40
X1
S50
X2
S60
4-12
S1
S
ZRST
S0
SET
S1
SET
S20
S127
M1002
S1
X0
X0
S20
S
S20
Y0
X1
X1
SET
S30
SET
S31
SET
S32
Y3
TMR
S32
Y5
X10
S41
Y4
S42
Y6
X11
T1
K10
T1
S60
X3
S31
S
S31
X6
S50
S40
Y2
SET
Y2
X3
Y1
X7
X5
S40
X2
S40
S
Y1
X2
X7
SET
X4
S30
X4
S30
S
Y0
Y7
X12
S50
S1
Y3
X5
SET
S41
S
S41
Y4
X6
SET
S32
S
S50
Y5
X10
SET
S42
S
S42
Y6
X11
S50
S
SET
S50
TMR
T1
SET
S60
K10
T1
S60
S
Y7
X12
S1
RET
END
4-13
ZRST
S0
S127
M1002
S3
S3
S
SET
S3
SET
S20
X0
X0
S20
S
S20
X1
Y0
S30
X1
S30
S
SET
S30
SET
S31
SET
S32
Y3
S32
Y5
S42
Y6
X4
Y2
S41
TMR
T1
Y4
X5
S50
K10
T1
S60
S40
Y7
X6
Y2
S31
S
S31
X3
S40
X2
S40
S
Y1
X2
Y1
SET
Y0
S3
Y3
X3
SET
S41
S
S41
Y4
S32
S
Y5
X4
SET
S42
S
S40
S
S42
Y6
S41
S
S50
S
S42
S
X5
SET
S50
TMR
T1
K10
SET
S60
T1
S60
S
Y7
X6
S3
RET
END
4-14
M1002
S4
S
S127
M1002
ZRST
S0
SET
S4
X0
SET
S20
X1
S4
S20
X0
S20
S
S30
Y0
Y1
X2
X1
S30
S
Y0
SET
S30
SET
S31
SET
S32
S31
Y3
X4
S40
Y2
X3
S41
Y4
X5
S50
TMR
S32
Y5
S42
Y6
X6
X7
T1
K10
T1
S60
Y7
Y1
X2
SET
S40
S
S4
S40
Y2
X3
SET
S31
S
S50
Y3
X4
SET
S41
S
S41
Y4
X5
SET
S32
S
S50
Y5
X6
SET
S42
S
S42
Y6
X7
S50
S
SET
S50
TMR
T1
SET
S60
K10
T1
S60
S
Y7
X6
S4
RET
END
4-15
M1002
S0
S
ZRST
S0
SET
S0
S127
SET
S61
S
S60
S
Y0
X0
SET
S20
S
S20
Y1
SET
S0
S32
S
SET
S31
SET
S32
SET
S41
S
Y2
SET
S52
S
S40
SET
S52
SET
S53
Y11
X13
SET
Y5
S62
S
S63
S
X7
SET
S50
SET
S51
S62
Y15
Y12
X14
SET
Y7
S63
S
S62
S
X11
SET
Y6
S40
Y3
S60
S
S41
X10
X5
SET
Y4
X6
X4
S50
S
S70
Y17
S30
X3
S40
S
SET
X17
X2
S31
S
S61
Y14
S61 X15
S
S70
S
X1
S30
S
Y10
X12
S60
Y13
S63
Y16
S63 X16
S
S0
RET
END
M1002
S0
Y0
S20
Y1
X0
X1
X2
S30
Y2
X4
S31
X3
Y3
X5
S40
S32
Y4
X6
Y5
S41
X7
Y6
X10
S50
Y7
X11
S51
Y10
X12
S60
Y13
X15
S70
X17
S61
S52
Y11
X13
Y14
S53
Y12
X14
S62
Y15
S63
Y16
X16
Y17
S0
S0
4-16
S0
S
ZRST
S0
SET
S0
SET
S30
M1002
S127
S0
X0
X0
S30
S
S30
Y0
X1
X1
SET
S31
SET
S32
X1
Y2
S32
Y1
S31
X1
S31
S
Y0
X3
X2
Y1
S33
X2
SET
S32
S
S33
Y3
X4
Y2
X3
SET
S33
S
S34
S33
X5
Y3
SET
S34
SET
S36
S36
Y6
S37
Y7
X6
S35
X4
S34
S
Y4
Y5
X7
S0
Y4
X5
SET
S35
S
S35
Y5
S36
S
Y6
X6
SET
S37
S
S35
S
S37
Y7
S37
S
X7
S0
RET
END
Y0
X2
X1
S30
Y1
X11
S40
X4
X3
Y2
S31
X12
X13
OUT
S20
Y11
X20
S32
X5
S32
Y3
Y4
X15
X14
S34
X6
Y5
X15
S50
Y14
S51
Y15
X33
S70
Y32
S41
S0
S71
S52
Y16
X34
Y33
S72
Y34
S80
Y41
OUT
S53
S20
Y17
S54
Y20
S55
Y21
S74
X46
Y42
S56
S42
Y22
S57
Y23
X24
OUT S58
S20
X37
Y13
X25
Y24
X26
S59
Y25
S60
X41
X40
RST
S58
Y36
Y10
X17
X23
X36
Y35
X45
S81
SET
S37
Y7
RST
S36
Y12
X35
X51
X10
S36
X16
X22
S73
X44
X7
Y6
SET
X21
X32
S35
X15
S75
X47
SET
S0
Y37
X27
Y26
S61
X30
Y27
X31
S62
Y30
S63
Y31
X42
X43
S76
Y40
X50
OUT
S42
X52
S0
SET
S0
4-17
S
D1
D2
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Command
Explanation
Applicable models
ES/EX/SS EP/SA EH
Manual/Auto Control
IST
IST
execution
32-bit command
Flag: M1040~M1047.
Refer to following for detail.
: The smallest
: The greatest
number for the specific status step point under the auto mode.
The IST is a convenient command made specifically for the initial state of the step
ladder control procedure to accommodate the special auxiliary relay to the convenient
auto control command.
Program
Example
1
M1000
IST
X10
S20
S60
4-18
between
to
is On or M1043=On
Right-limit X2 Right-limit X3
(big balls)
(small balls)
Y0
Y3
Y2
Y1
Upper-limit X5
Big/small
sensor X0
Big
Small
Control panel
Power start
Power stop
Raise
Shift
Collect
balls robot arm to right
X20
X22
X24
Shift
Release Lower
balls robot arm to left
X21
X23
X25
Step X12
Zero return X11
Manual
operation X10
One cycle
operation X13
Continuous
operation X14
X0
X1 Y4
M1044
M1000
IST
X10
S20
S80
4-19
X20
SET
Y4
Collect balls
RST
Y4
Release balls
X21
X22 Y1
Y0
Y1
Y2
Shift to right
Y3
Shift to left
RST
Y4
Release balls
RST
Y1
Condition interlock
X23 Y0
X24 X4 Y3
X25 X4 Y2
Condition interlock
Raise robot arm to the
upper-limit (X4 is ON)
S1
X15
S10
X4
S11
X1
S12
4-20
Y0
RST
Y2
Y3
SET
M1043
RST
S12
SET
S10
RST
Y4
Release balls
RST
Y1
Y0
X4
S11
S
SET
S11
RST
Y2
S12
Y3
X1
SET
S12
S
SET
M1043
RST
S12
Y1
X5
X0
X5
X0
S30
T0
S32
Y4
TMR
T0
S40
K30
X2
T1
X4
S42
Y2
X2
SET
Y4
TMR
T1
K30
Y0
S41
Y0
S31
X4
SET
X3
Y2
X3
S50
Y1
X5
S60
T2
S80
Y4
TMR
T2
K30
Y0
S70
X4
RST
X1
Y3
X1
S2
4-21
SET
S20
Y1
X5 X0
SET
S30
SET
S40
SET
Y4
Collect balls
TMR
T0
K30
SET
S31
X5 X0
S30
S
T0
S31
S
Y0
X4
SET
S32
S
S32
X2
Shift to right
Y2
X2
S40
S
SET
S50
SET
Y4
Collect balls
TMR
T1
K30
SET
S41
T1
S41
S
Y0
X4
SET
S42
S
S42
X3
Y2
Shift to right
X3
SET
S50
S
S50
Y1
X5
S60
S
SET
S60
RST
Y4
Release balls
TMR
T2
K30
SET
S70
T2
S70
S
Y0
X4
SET
S80
S
X1
Y3
X1
S80
Shift to left and shift to
the left-limit (X1 is On)
S2
RET
END
4-22
5 Application Commands
5.1 Summary of Parameters
Transmission
Comparison
Loop Control
Classification
API
Mnemonic Codes
P
Command
16 bits
32 bits
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
CJ
CALL
SRET
IRET
EI
DI
FEND
WDT
FOR
NEXT
CMP
ZCP
MOV
SMOV
CML
BMOV
FMOV
XCH
BCD
BIN
ADD
DCMP
DZCP
DMOV
DCML
DFMOV
DXCH
DBCD
DBIN
DADD
3
3
3
3
3
3
3
3
3
3
3
3
3
21
SUB
DSUB
22
MUL
DMUL
23
24
25
DIV
INC
DEC
DDIV
DINC
DDEC
3
3
3
26
WAND
DAND
27
WOR
DOR
28
WXOR
DXOR
29
30
31
NEG
ROR
ROL
DNEG
DROR
DROL
3
3
3
32
RCR
DRCR
33
RCL
DRCL
34
SFTR
35
SFTL
36
37
38
39
WSFR
WSFL
SFWR
SFRD
3
3
3
3
40
ZRST
41
DECO
Function
Conditional jump
Call subroutine
Subroutine return
Interrupt return
Enable interrupts
Disable interrupts
First end
Watchdog timer refresh
Start of FOR-NEXT loop
End of FOR-NEXT loop
Compare
Zone compare
Data Move
Shift move
Compliment
Block move
Fill move
Data exchange
Convert BIN data into BCD
Convert BCD data into BIN
Perform the addition of BIN data
Perform the subtraction of BIN
data
Perform the multiplication of BIN
data
Perform the division of BIN data
Perform the addition of 1
Perform the subtraction of 1
Perform the logical product
(AND) operation
Perform the logical sum (OR)
operation
Perform the exclusive logical add
(XOR) operation
Negation
Rotate to the right
Rotate to the left
Rotate to the right with the carry
flag attached
Rotate to the left with the carry
flag attached
Shift the data of device specified
to the right
Shift the data of device specified
to the left
Shift the register to the right
Shift the register to the left
Shift register write
Shift register read
Resets a range of device
specified
8 256 bits decoder
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
1
1
1
1
1
1
3
1
7
9
5
11
5
7
7
5
5
5
7
13
17
9
13
9
9
9
13
6-1
6-5
6-5
6-7
6-7
6-7
6-11
6-12
6-14
6-14
6-17
6-18
6-19
6-20
6-22
6-23
6-24
6-25
6-26
6-27
6-29
13
6-30
13
6-31
3
3
3
3
3
3
3
3
3
7
3
3
13
5
5
6-32
6-34
6-34
13
6-35
13
6-36
13
6-37
3
3
3
3
3
3
3
3
3
3
5
5
5
9
9
6-38
6-41
6-42
6-43
6-44
6-45
6-46
3
3
3
3
3
3
3
3
9
9
7
7
6-47
6-48
6-49
6-50
6-51
6-53
5-1
5 Application Commands
Serial I/O
Convenience Command
Data Operation
Classification
5-2
API
Mnemonic Codes
P
Command
16 bits
32 bits
42
43
44
45
46
47
48
ENCO
SUM
BON
MEAN
ANS
ANR
SQR
DSUM
DBON
DMEAN
DSQR
3
3
3
3
3
3
49
FLT
DFLT
50
REF
51
REFF
52
MTR
53
DHSCS
54
DHSCR
55
DHSZ
56
57
58
SPD
PLSY
PWM
DPLSY
59
PLSR
DPLSR
60
61
62
63
64
65
66
67
69
70
71
72
73
74
75
76
77
78
79
80
IST
SER
ABSD
INCD
TTMR
STMR
ALT
RAMP
SORT
TKY
HKY
DSW
SEGD
SEGL
ARWS
ASC
PR
FROM
TO
RS
DSER
DABSD
DTKY
DHKY
DFROM
DTO
3
3
81
PRUN
DPRUN
82
83
84
85
86
87
88
ASCII
HEX
CCD
VRRD
VRSC
ABS
PID
DABS
DPID
3
3
3
3
3
3
Function
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
5
7
7
7
1
5
9
13
13
6-54
6-56
6-56
6-57
6-58
6-58
6-60
6-61
7-1
7-2
7-3
13
7-6
13
7-15
17
7-17
3
3
3
3
3
3
3
3
7
7
7
13
7-24
7-25
7-30
17
7-31
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
9
9
9
5
7
3
9
11
7
9
9
5
7
9
11
5
9
9
9
17
17
13
17
17
17
7-36
7-42
7-43
7-44
7-46
7-48
7-49
7-50
7-52
7-54
7-56
7-58
7-60
7-61
7-65
7-66
7-67
7-69
7-69
7-74
7-87
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
7
7
5
5
3
9
7-88
7-92
7-95
7-97
7-99
7-100
7-100
5 Application Commands
Floating Operation
Communication command of
Delta AC Motor Drives
Basic Command
Classification
API
Mnemonic Codes
16 bits
32 bits
P
Command
89
90
91
PLS
LDP
LDF
92
ANDP
93
ANDF
94
ORP
95
ORF
96
97
98
99
100
101
TMR
CNT
DCNT
INV
PLF
MODRD
MODWR
102 FWD
103 REV
104 STOP
105 RDST
106 RSTEF
107 LRC
108 CRC
109 SWRD
110
DECMP
3
3
3
3
111
DEZCP
116
117
DRAD
DDEG
3
3
118
DEBCD
119
DEBIN
120
121
DEADD
DESUB
3
3
122
DEMUL
123
DEDIV
124
DEXP
125
DLN
126
DLOG
127
DESQR
Function
Rising-edge output
Rising-edge detection operation
Falling-edge detection operation
Series connection command for
the rising-edge detection
operation
Series connection command for
the falling-edge detection
operation
Parallel connection command for
the rising-edge detection
operation
Parallel connection command for
the falling-edge detection
operation
Timer
Counter
Inverting operation
Falling-edge output
MODBUS data Read
MODBUS data write in
VFD-A series drive forward
command
VFD-A series drive reverse
command
VFD-A series drive stop
command
VFD-A series drive status read
VFD-A series drive abnormal
reset
LRC error check
CRC error check
Digital switch read
Binary floating point comparison
Binary floating point zone
comparison
Degree
Radian
Radian
Degree
Convert binary floating point to
decimal floating point
Convert decimal floating point to
binary floating point
Binary floating point addition
Binary floating point subtraction
Binary floating point
multiplication
Binary floating point division
Perform exponent operation of
binary floating point
Perform natural logarithm
operation of binary floating point
Perform logarithm operation of
binary floating point
Square root of binary floating
point
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
3
3
3
3
3
3
3
3
3
3
3
3
3-13
3-11
3-11
3-11
3-12
3-12
3-13
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
1
3
7
7
3-8
3-8
3-15
3-13
8-1
8-5
8-8
8-9
8-9
8-11
8-13
3
3
3
3
3
3
3
3
7
7
3
13
8-13
8-15
8-18
8-19
17
8-20
3
3
3
3
9
9
8-21
8-21
8-23
8-23
3
3
3
3
3
3
13
13
8-24
8-25
13
8-26
13
8-27
8-28
8-29
13
8-30
8-31
5-3
5 Application Commands
Classification
API
Floating Operation
Additional Command
Positioning
Control
Perpetual
Calendar
Gray
Code
32 bits
P
Command
DPOW
129 INT
DINT
130
DSIN
131
DCOS
132
DTAN
133
DASIN
134
DACOS
135
DATAN
136
DSINH
137
DCOSH
138
DTANH
128
5-4
Mnemonic Codes
16 bits
Function
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
13
8-32
8-33
8-34
8-36
8-37
8-39
8-40
8-41
8-42
8-42
8-43
8-44
8-45
144 GPWM
145 FTC
3
3
3
3
3
3
3
3
3
3
3
3
3
7
7
11
5
5
13
13
8-48
8-49
8-50
9-1
9-11
9-11
9-12
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
9
7
9
7
9
9
11
9
7
7
3
3
7
5
5
9
9
9
9
7
13
17
13
17
17
13
9
9
9-13
9-14
9-18
9-21
9-22
9-26
9-35
9-36
9-37
9-38
9-40
9-42
9-44
9-44
9-45
9-47
9-49
9-50
9-51
9-52
147
148
149
150
151
SWAP
DSWAP
MEMR
DMEMR
MEMW DMEMW
MODRW
PWD
152 RTMU
153 RTMD
DABSR
DZRN
DPLSV
DDRVI
DDRVA
DHOUR
DGRY
DGBIN
3
3
3
3
3
3
3
3
3
3
3
3
3
154
155
156
157
158
159
160
161
162
163
166
167
169
170
171
180
181
182
183
184
RAND
ABSR
ZRN
PLSV
DRVI
DRVA
TCMP
TZCP
TADD
TSUB
TRD
TWR
HOUR
GRY
GBIN
MAND
MOR
MXOR
MNOR
MINV
5 Application Commands
High-level
Command
Matrix Handling
Classification
API
Mnemonic Codes
16 bits
185
186
187
188
189
190
196
MCMP
MBRD
MBWR
MBS
MBR
MBC
HST
32 bits
P
Command
DHST
3
3
3
3
3
3
3
197 PLST
DPLST
198 PLSK
DPLSK
199 PLSA
DPLSA
215 LD&
DLD&
216 LD|
DLD|
217 LD^
DLD^
218 AND&
DAND&
219 AND|
DAND|
220 AND^
DAND^
221 OR&
DOR&
222 OR|
DOR|
223 OR^
DOR^
224 LD=
DLD=
225 LD>
DLD>
226 LD<
DLD<
228 LD<>
DLD<>
229 LD<=
DLD<=
230 LD>=
DLD>=
232 AND=
DAND=
233 AND>
DAND>
234 AND<
DAND<
236 AND<>
DAND<>
237 AND<=
DAND<=
238 AND>=
DAND>=
240 OR=
DOR=
Function
Matrix compare
Matrix bit read
Matrix bit write
Matrix bit shift
Matrix bit rotate
Matrix bit state count
High speed counter
Multi-frequency variable pulse
output
Multi-frequency fixed pulse
output
Multi-step pulse slope output
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 = S2 is true
Comparison contact is ON when
S1 > S2 is true
Comparison contact is ON when
S1 < S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 = S2 is true
Comparison contact is ON when
S1 > S2 is true
Comparison contact is ON when
S1 < S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 = S2 is true
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
3
3
3
3
3
3
3
9
7
7
7
7
7
3
9-52
9-54
9-55
9-56
9-58
9-59
9-60
6-8
6-9
11
11
6-10
10-1
10-1
10-1
10-2
10-2
10-2
10-3
10-3
10-3
10-4
10-4
10-4
10-4
10-4
10-4
10-5
10-5
10-5
10-5
10-5
10-5
10-6
5-5
5 Application Commands
Classification
API
Mnemonic Codes
16 bits
32 bits
P
Command
241 OR>
DOR>
242 OR<
DOR<
244 OR<>
DOR<>
245 OR<=
DOR<=
246 OR>=
DOR>=
Function
Applicable models
STEPS
Page
ES
EP
EH 16-bit 32-bit
10-6
10-6
10-6
10-6
10-6
Note 1: Applicable models ES series above includes EX and SS series; EP includes SA series.
Note 2: Above commands for ES/EX/SS models dont possess pulse execution command (P command).
5-6
5 Application Commands
5.2 Application Command Structure
Many commands may be divided into an command and a operand as follows:
Command
Operand
A command usually allows one step to be used and an operand usually allows two or four steps to be used
based on the command is a 16-bit or 32-bit command.
Explanation of the format of application command:
2
API
DECO P
41
Bit device
15
14
13
Y M S
Word device
K
C D E
Applicable models
ES/EX/SS
8
16-bit command (7 STEPS)
Continuous
Pulse
DECO execution
DECOP
execution
9
32-bit command
EP EH
n
12
11
Flag: None
10
5-7
5 Application Commands
Application Commands Input
Some application commands are only combined by command codes API, but most of them are combined by
command codes API and several operands.
The application commands of DVP-Series PLC are controlled by command codes API 00 to API 246. Each
command code has its own meaning, for example, API 12 stands for MOV (move data). When using ladder
diagram editor to input programs, you will need to type in the command MOV. If using the HPP to input the
program, we will have to enter the API command codes. Each application command has its unique operand.
X0
MOV K10
command
D10
operand
operand to the appointed
operand.
,
,
to display.
. to display.
If the operand may only be represented as a constant K, H or register then we will use
to display.
X0
MOV K10
D10
X1
D10
D20
5-8
5 Application Commands
use pulse execution commands for application, for example, INC, DEC and MOV etc. related commands.
Therefore, pulse execution commands are identified by the symbol on the right top of the command.
Pulse execution command
When X0 goes from OFFON, the MOVP command
X0
D10
D12
X1
MOV D10
D12
X1=ON,
the
MOV
command
can
be
The above figures show that when X0, X1=OFF, the command will not be executed and the contents of
the destination operand D will retmain unchanged.
The Assigned Devices of Operands
1. Bit device such as X, Y, M, S can be combined together and are defined as the WORD device. In
application commands, the bit device can serve as the word device (KnX, KnY, KnM, KnS) to store the
numeric values to operate.
2. Data register D, Timer T, Counter C and Index Register E, F are all assigned devices of operands.
3. A data register is usually a 16-bit register and it is also a register D. Hence, assigning a 32-bit register also
means assigning two register D with continuous numbers.
4. If the operand of 32-bit command assign D0, the 32-bit data register which is combined by D1 and D0 will
be occupied. D1 is the upper 16-bit and D0 is the lower 16-bit. The using rule of timer T and 16-bit
Counter(C0~C199) is the same.
5. When the 32-bit counter(C200~C255) is used as Data register, one point indicates 32-bit length. Only the
operand of 32-bit command can be assigned, the operand of 16-bit command can not be assigned.
Operand Data format
1. X, Y, M, S are only be single point ON/OFF, these are defined as a bit device.
2. However, 16-bit (or 32-bit) device T, C, D, E, F are data registers and are defined as Word device.
3. We also can add Kn in front of X, Y, M and S to be defined as word device, whereas n=1 means 4-bit. So
16-bit can be described from K1 to K4, and 32-bit can be described from K1 to K8. For example, K2M0
means there are 8-bit from M0 to M7.
5-9
5 Application Commands
When X0=On, move the contents of M0 to M7 to D10
X0
MOV
K2M0
D10
32-bit command
K-32,768~K+32,767
K-2,147,483,648~K+2,147,483,647
K1 (4 points)
0~15
K1 (4 points)
0~15
K2 (8 points)
0~255
K2 (8 points)
0~255
K3 (12 points)
0~4,095
K3 (12 points)
0~4,095
K4 (16 points)
-32,768~+32,767
K4 (16 points)
0~65,535
K5 (20 points)
0~1,048,575
K6 (24 points)
0~167,772,165
K7 (28 points)
0~268,435,455
K8 (32 points)
-2,147,483,648~+2,147,483,647
Flags
1. General Flags
For the operation result of application commands, there are following flags of DVP series PLC:
Example :
5-10
5 Application Commands
X0
SET
M0
M0
DSW X10
Y10
D0
K0
M1029
RST
M0
When error operations occur, M1067=On, D1067 will show the error number and D1069 will
D1067
D1069
If other errors occur, the contents of D1067 and D1069 will be refreshed. (when the error is
resetd, M1067=Off)
M1068
When error operations occur, M1068=On, D1068 will show the error address.
D1068
If other errors occur, the contents of D1068 will not be refreshed, M1068 must use RST
command to reset to OFF, otherwise the error will remain.
5-11
5 Application Commands
5. API 53 (DHSCS) and API 54 (DHSCR), these commands only can be executed simultaneously less than four
times in the program of DVP-ES/EX/SS models.
6. API 53 (DHSCS), API 54 (DHSCR), API 55(DHSZ) these commands only can be executed simultaneously
less than six times in the program of DVP-EP/SA models.
The Limited Using Times for Executing Commands Simultaneously:
There is no limited using time for executing the same command in the program. However, there are limited
using times for executing the commands simultaneously.
1.
API 52 (MTR), API 56 (SPD), API 62 (ABSD), API 63 (INCD), API 69 (SORT), API 70 (TKY), API 71
(HKY), API 72 (DSW) (EP models), API 74 (SEGL)(EP models), API 75 (ARWS), API 80 (RS), API 100
(MODRD), API 101 (MODWR), API 102 (FWD), API 103 (REV), API 104 (STOP), API 105 (RDST), API
106 (RSTEF), API 150 (MODRW), API 151 (PWD), these commands only can be executed simultaneously
once in the program.
2.
API 57 (PLSY), API 58 (PWM), API 59 (PLSR), API 72 (DSW) (EH models), these commands only can be
executed simultaneously twice in the program.
3.
API 169 (HOUR) (EH models) only can be executed four times in the program.
4.
API 64 (TTMR) (EH models) only can be executed eight times in the program.
5.
In the program of DVP EH models, there is no limited using time for hardware high speed counter related
commands, like DHSCS, DHSCR and DHSZ. However, there are limited using times for executing the
commands simultaneously. DHSCS, DHSCR command will use one memory unit and DHSZ command will
use two memory units. When these commands are executed simultaneously, the total used memory units
can not exceed eight memory units. If exceeding eight memory units, system will totalize the used memory
units of the commands which have been scanned and executed first, the others will be ignored.
5-12
5 Application Commands
valid data
M15
M14
M13 M12
M11 M10
M9
M8
M7
M6
M5
M4
M3
M2
M1
M0
clear to 0
D1
0
b15
b14
b13
low byte
transmit
b12
b11
b10
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
equal to
D1
low byte
1
Transmit K1M0, K2M0, K3M0 to 16-bit registers and insufficient upper bit data have not been transmitted.
Its the same as sending K1M0, K2M0, K3M0, K4M0, K5M0, K6M0, K7M0 to 32-bit registers and the
insufficient upper bit data have not been transmitted also.
The insufficient upper bit will be defined as 0 if the content of the operand assign K1 to K3 in 16-bit
operation or assign K4 to K7 in 32-bit operation. Therefore, it means the operation result is positive.
M0
BIN K2X4
D0
The numbers of Bit device can specify freely. However, it is recommended to use 0 in the lowest digit
decimal place of X and Y devices (X0, X10, X20Y0, Y10, Y20). For M and S Series, it is recommended
to use the multiple 8 but the use of 0 is the most device efficient, like M0, M10, M20etc.
Assign Continuous Numbers
For example , like D date register, the continuous numbers of D are D0, D1, D2, D3, D4etc.
For the bit device, the continuous numbers are shown as follows:
K1X0
K1X4
K1X10
K1X14
K2Y0
K2Y10
K2Y20
Y2X30
K3M0
K3M12
K3M24
K3M36.
K4S0
K4S16
K4S32
K4S48.
The bit device numbers are all of the above. To avoiding errors, please do not skip over the continuous
numbers. Furthermore, if K4Y0 is used in 32-bit operation, the upper 16bit is defined as 0. Therefore, it is
recommended to use K8Y0 in 32bit operation.
Floating Point Operation
The internal operation of DVP series PLC usually is operated by BIN integer format. When performing integer
division operation, the decimal point will be discarded. For example: 40 3 = 13, remainder is 1 and the
decimal point will be discarded. But if use floating point operation, the decimal point can be given.
5-13
5 Application Commands
The application commands related to floating point operation are shown in the following table.
API 49 (FLT),
DVP PLC represents floating point number with 32-bit number by IEEE754 and the format is in the following:
8-bit
S
b 31
23-bit
mantissa
exponent
b0
Sign bit
0: positive
1: negative
Therefore, the range of 32-bit floating is from 2-126 to 2+128, i.e. from 1.175510-38 to 3.402810+38.
Example 1: using 32-bit floating point to represent decimal number 23
Step 1: convert 23 to binary number: 23.0=10111
Step 2: Normalizing the binary: 10111=1.0111 24, 0111 is mantissa and 4 is an exponent.
Step 3: get exponent: E-B=4 E-127=4 E=131=100000112
Step 4: We can now combine the sign, exponent, and normalized mantissa into the binary IEEE short real
representation.
0 10000011 011100000000000000000002=41B8000016
Example 2: using 32-bit floating point to represent decimal number 23
The conversion steps are the same as decimal number 23. Only need to modify sign bit from 0 to 1 to get value
1 10000011 011100000000000000000002=C1B8000016
DVP PLC also uses two registers with continuous number to store binary floating point. The following is the example
that uses register (D1, D0) to store binary floating point.
D1(b15~b0)
7
2
E7
2
E6
2
E5
2
E1
D0(b15~b0)
0
-1
-2
-3
-17
-18
-19
-20
-21
-22
-23
2
2
2
2
E0 A22 A21 A20
2
A6
2
A5
2
A4
2
A3
2
A2
2
A1
2
A0
b6
b5
b4
b3
b2
b1
b0
8 bits of exponent
E0~E7=0 or 1
23 bits of constant
A0~A22=0 or 1
5-14
5 Application Commands
Decimal Floating Point
The binary floating point is not accepted by most people. Therefore, binary floating point format can be converted
to decimal floating point format for people to perform the operation of decimal numbers. However, the DVP series
PLC use binary floating point to perform the operation of decimal numbers.
Decimal floating point is stored in the register with 2 continuous numbers. The register with small number stores
constant and the register with larger number stores exponent.
For example, using register (D1, D0) to store a decimal floating point.
Decimal floating point = [constant D0] X 10 [exponent D1 ]
constant D0 = 1,000~9,999
exponent D1 = - 41~+35
the most significant bit of (D1, D0) is symbol bit.
Besides, constant 100 doesnt exist in D0 due to 100 will be shown with 1,00010-1.
The range of decimal number is from 117510-41 to 340210+38.
Decimal floating point can be used in the following commands.
The conversion command for Binary floating point
The conversion command for Decimal floating point
Zero flag (M1020), Borrow flag (M1021) and carry flag (M1022)
The flags that corresponds to the floating command are:
Zero flag: when the result is 0, M1020=On.
Borrow flag: when the result is least than the minimum unit, M1021=On
Carry flag: when the absolute value of result exceeds usage range, M1022=On
16-bit
E0
16-bit
F0
32-bit
E0
F0
upper bit
lower bit
5-15
5 Application Commands
As the left figure shown, the contents of operand will change
MOV K20E0 D10F0 according to the contents of E, F. and we name this kind of
modification as Index.
E0=8
F0=14
20+8=28 10+14=24
K28
D24
transmit
Devices can use Index register to modify in ES/EX/SS Series are: P, X, Y, M, S, KnX, KnY, KnM, KnS, T, C, D.
Devices can use Index register to modify in EP Series are: P, X, Y, M, S, KnX, KnY, KnM, KnS, T, C, D
Devices can use Index register to modify in EH Series are: P, I, X, Y, M, S, K, H, KnX, KnY, KnM, KnS, T, C, D
The above device can use index register E, F to modify. However, index register E, F cannot modify itself,
either Kn. (K4M0E0 is available, K0E0M0 is not available). In each application command, if the symbol is
added in the table of operand, it means the device can use index register E, F to modify.
Index register E, F can be used to modify P, I, X, Y, M, S, KnX, KnY, KnM, KnS, T, C, D these devices under
certain condition. Two devices, E or F can be specified when using 16-bit register. If using index register E, F to
modify constant K, H in 32-bit command, only one device, E can be specified.
When constant (K,H) is used to be index function in WPLSoft command mode, it needs to use symbol
@.
Example: MOV K10@E0 D0F0
The program example of index:
display panel.
M1000
BIN K1X0
DVP - PLC
(X3~X0)BCD
F0
(F0)BIN
(Y17~Y0)BCD
There are limited using times of some commands. If using the index register E, F to modify, the final result can
be the same as the operation result of using the same command repeatedly.
5-16
5 Application Commands
5.5 Index for Commands
Sort by Characters
Classification A P I
Mnemonic Codes
16 bits
ABS
ABSD
ABSR
ADD
ALT
DABS
DABSD
DABSR
DADD
218 AND&
DAND&
220 AND^
DAND^
219 AND|
DAND|
234 AND<
DAND<
87
62
155
20
66
232 AND=
DAND=
233 AND>
DAND>
93 ANDF
92 ANDP
ANR
ANS
ARWS
ASC
ASCII
47
46
75
76
82
32 bits
P
Command
133
DASIN
134
DACOS
135
DATAN
DBCD
DBIN
DBON
DCML
3
3
3
3
3
3
3
3
18
19
15
44
01
84
00
14
BCD
BIN
BMOV
BON
CALL
CCD
CJ
CML
Function
Absolute value
Absolute drum sequencer
ABS current value read
Perform the addition of BIN data
On/Off alternate command
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 < S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 = S2 is true
Comparison contact is ON when
S1 > S2 is true
Comparison contact is ON when
S1 S2 is true
Series connection command for
the falling-edge detection
operation
Series connection command for
the rising-edge detection
operation
Alarm device reset
Alarm device output
Arrow keyboard input
ASCII code conversion
Convert HEX to ASCII
Arcsine operation of binary
floating point
Arccosine operation of binary
floating point
Arctangent operation of binary
floating point
Convert BIN data into BCD
Convert BCD data into BIN
Block move
Determine the ON bits
Call subroutine
Check code
Conditional jump
Compliment
Applicable models
STEPS
Page
ES
EP
EH
16-bit 32-bit
3
3
3
3
3
3
3
3
3
3
3
3
9
7
7
3
5
17
13
13
7-100
7-43
9-14
6-29
7-49
10-2
10-2
10-2
10-5
10-5
10-5
10-5
10-5
10-5
3-12
3-11
3
3
3
3
3
3
3
3
3
3
1
7
9
11
7
6-58
6-58
7-65
7-66
7-88
8-39
8-40
8-41
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
5
5
7
7
3
7
3
5
9
9
13
6-26
6-27
6-23
6-56
6-5
7-95
6-1
6-22
5-17
5 Application Commands
Classification A P I
Mnemonic Codes
16 bits
10 CMP
97 CNT
DCMP
DCNT
131
DCOS
137
DCOSH
DDEC
DDEG
DDIV
DDRVA
DDRVI
DEADD
3
3
3
3
108
25
41
117
05
23
159
158
72
120
CRC
DEC
DECO
DI
DIV
DRVA
DRVI
DSW
118
DEBCD
119
DEBIN
110
123
04 EI
DECMP
DEDIV
3
3
122
DEMUL
42 ENCO
5-18
Function
Compare
Counter
Cosine operation of binary
floating point
Hyperbolic cosine operation of
binary floating point
CRC error check
Perform the subtraction of 1
8 256 bits decode
Radian Degree
Disable interrupts
Perform the division of BIN data
Data backup MEMORY write in
Drive to increment
Digital Switch input
Binary floating point addition
Convert binary floating point to
decimal floating point
Convert decimal floating point to
binary floating point
Binary floating point comparison
Binary floating point division
Enable interrupts
Binary floating point
multiplication
256 8 bits encode
Square root of binary floating
point
Binary floating point subtraction
Applicable models
STEPS
Page
ES
EP
EH
16-bit 32-bit
3
3
3
3
3
3
7
4
13
6
6-17
3-8
8-36
8-42
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
3
7
1
7
9
9
9
13
17
17
13
8-15
6-34
6-53
8-21
6-7
6-32
9-26
9-22
7-58
8-24
8-23
8-23
3
3
3
3
3
3
3
3
3
13
13
8-19
8-27
6-7
13
8-26
6-54
8-31
13
8-25
127
DESQR
121
DESUB
124
DEXP
8-28
111
DEZCP
17
8-20
First end
6-11
06 FEND
32 bits
P
Command
6-61
3
3
3
3
3
3
7
3
13
6-24
6-14
17
7-69
49 FLT
DFLT
16 FMOV
08 FOR
DFMOV
78 FROM
DFROM
102 FWD
8-8
145 FTC
8-45
144 GPWM
8-44
P
P
P
P
P
P
P
P
5
5
7
9
9
9
17
9-45
9-44
7-92
7-56
171
170
83
71
GBIN
GRY
HEX
HKY
DGBIN
DGRY
DHKY
3
3
3
5 Application Commands
Classification A P I
Mnemonic Codes
16 bits
32 bits
169 HOUR
DHOUR
54
DHSCR
53
DHSCS
196 HST
DHST
55
DHSZ
24 INC
63 INCD
DINC
129 INT
DINT
98 INV
03 IRET
60 IST
215 LD&
DLD&
217 LD^
DLD^
216 LD|
DLD|
226 LD<
DLD<
229 LD<=
DLD<=
228 LD<>
DLD<>
224 LD=
DLD=
225 LD>
DLD>
230 LD>=
DLD>=
91 LDF
90 LDP
P
Command
Function
Hour meter
High speed counter comparison
RESET
High speed counter comparison
SET
High speed counter
Zone comparison (High-speed
counter)
Perform the addition of 1
Increment drum sequencer
Convert binary floating point to
BIN integer
Inverting operation
Interrupt return
Manual/Auto control
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 < S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 = S2 is true
Comparison contact is ON when
S1 > S2 is true
Comparison contact is ON when
S1 S2 is true
Falling-edge detection operation
Rising-edge detection operation
Applicable models
STEPS
Page
ES
EP
EH
16-bit 32-bit
13
9-44
13
7-15
13
7-6
9-60
17
7-17
3
3
3
3
3
9
6-34
7-44
8-33
3
3
3
3
3
3
3
3
3
1
1
7
3-15
6-7
7-36
10-1
10-1
10-1
10-4
10-4
10-4
10-4
10-4
10-4
3
3
3
3
3
3
3
3
3-11
3-11
125
DLN
8-29
126
DLOG
13
8-30
DMEAN
DMEMR
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
9
7
7
7
7
7
9
7
7
13
13
8-13
9-47
9-59
9-58
9-54
9-56
9-55
9-52
6-57
8-49
107
180
190
189
186
188
187
185
45
148
LRC
MAND
MBC
MBR
MBRD
MBS
MBWR
MCMP
MEAN
MEMR
5-19
5 Application Commands
Classification A P I
Mnemonic Codes
16 bits
149
184
183
100
150
101
181
12
52
32 bits
MEMW DMEMW
MINV
MNOR
MODRD
MODRW
MODWR
MOR
MOV
DMOV
MTR
P
Command
3
3
3
3
3
22 MUL
DMUL
182 MXOR
29 NEG
09 NEXT
DNEG
3
3
221 OR&
DOR&
223 OR^
DOR^
222 OR|
DOR|
242 OR<
DOR<
245 OR<=
DOR<=
244 OR<>
DOR<>
240 OR=
DOR=
241 OR>
DOR>
246 OR>=
DOR>=
95 ORF
94 ORP
88 PID
99 PLF
89 PLS
Applicable models
STEPS
Page
ES
EP
EH
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
7
7
9
7
11
7
9
5
9
13
8-50
9-52
9-51
8-1
9-1
8-5
9-49
6-19
7-3
13
6-31
3
3
3
3
3
3
3
9
3
1
9-50
6-38
6-14
10-3
10-3
10-3
10-6
10-6
10-6
10-6
10-6
10-6
3-13
3-12
3
3
3
3
3
3
3
3
3
9
3
3
7-100
3-13
3-13
MEMORY write in
Matrix inverse
Matrix NOR
MODBUS data Read
MODBUS data read/write in
MODBUS data write in
Matrix OR
Data Move
Input matrix
Perform the multiplication of BIN
data
Matrix XOR
Negation
End of FOR-NEXT loop
Comparison contact is ON when
S1 & S2 is true
Comparison contact is ON when
S1 ^ S2 is true
Comparison contact is ON when
S1 | S2 is true
Comparison contact is ON when
S1 < S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 S2 is true
Comparison contact is ON when
S1 = S2 is true
Comparison contact is ON when
S1 > S2 is true
Comparison contact is ON when
S1 S2 is true
16-bit 32-bit
59 PLSR
DPLSR
17
7-31
157 PLSV
57 PLSY
DPLSV
DPLSY
3
3
7
7
13
13
9-21
7-25
128
DPOW
13
8-32
7-67
7-87
77 PR
81 PRUN
5-20
Function
DPRUN
Print
Octal number system
transmission
5 Application Commands
Classification A P I
Mnemonic Codes
16 bits
32 bits
151 PWD
P
Command
Applicable models
ES
EP
EH
STEPS
Page
16-bit 32-bit
9-11
58 PWM
116
67 RAMP
154 RAND
DRAD
3
3
3
3
3
3
3
3
9
9
7-30
8-21
7-50
9-13
33 RCL
DRCL
6-44
32 RCR
DRCR
6-43
105 RDST
8-11
50 REF
I/O refresh
7-1
51 REFF
7-2
103 REV
8-9
31 ROL
30 ROR
DROL
DROR
3
3
3
3
3
3
3
3
5
5
6-42
6-41
9
9
8-13
9-12
9-11
Function
80 RS
7-74
106 RSTEF
153 RTMD
152 RTMU
73 SEGD
7-60
74 SEGL
61 SER
39 SFRD
DSER
3
3
3
3
3
3
3
3
7
9
7
17
7-61
7-42
6-50
35 SFTL
6-46
34 SFTR
6-45
38 SFWR
6-49
8-34
8-42
3
3
3
3
3
3
3
3
3
3
3
3
3
3
11
11
7
5
1
7
6-20
7-52
7-24
6-60
6-5
7-48
8-9
13
6-30
Sum of ON bits
6-56
130
DSIN
136
DSINH
SMOV
SORT
SPD
SQR
SRET
STMR
DSQR
104 STOP
21 SUB
DSUB
43 SUM
DSUM
13
69
56
48
02
65
5-21
5 Application Commands
Classification A P I
Mnemonic Codes
16 bits
32 bits
147 SWAP
109 SWRD
DSWAP
162 TADD
X
Z
Applicable models
ES
EP
EH
STEPS
Page
16-bit 32-bit
3
3
3
3
3
3
8-48
8-18
9-37
8-37
8-43
DTAN
138
DTANH
Time compare
11
9-35
DTKY
DTO
3
3
3
3
3
3
3
3
3
3
3
3
7
4
9
3
13
17
7-54
3-8
7-69
9-40
163 TSUB
Time subtraction
9-38
TTMR
TWR
TZCP
VRRD
VRSC
3
3
3
3
3
3
3
3
3
3
3
3
3
3
5
3
9
5
5
7-46
9-42
9-36
7-97
7-99
26 WAND
DAND
13
6-35
Teaching timer
Time data write in
Time zone compare
Potentiometer read
Potentiometer scale
Perform the logical product
(AND) operation
Watchdog timer refresh
Perform the logical sum (OR)
operation
Shift the register to the left
Shift the register to the right
Perform the exclusive logical add
(XOR) operation
Data exchange
Zone compare
Zero point return
Resets a range of device
specified
6-12
13
6-36
3
3
3
3
9
9
6-48
6-47
13
6-37
3
3
3
3
3
3
3
5
9
9
9
17
17
6-25
6-18
9-18
6-51
70
96
79
166
64
167
161
85
86
TKY
TMR
TO
TRD
07 WDT
W
Function
3
3
132
160 TCMP
T
P
Command
27 WOR
DOR
37 WSFL
36 WSFR
3
3
28 WXOR
DXOR
17 XCH
11 ZCP
156 ZRN
DXCH
DZCP
DZRN
3
3
40 ZRST
Note 1: Applicable models ES series above includes EX and SS series; EP includes SA series.
Note 2: Above commands for ES/EX/SS models dont possess pulse execution command (P command).
5-22
CJ
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: Operand S can assign P
P can be modified by Index register E, F
ES Series models: Operand S can assign P0~P63
EP / EH Series models: Operand S can assign P0~P255
ES series models do not support the pulse execution
command (CJP)
Command
Explanation
Applicable models
Conditional Jump
ES
EP
EH
Flag: None
6-1
When X0=On, the program will skip from address 0 to N (label P1) automatically and
keep on executing. But the area between address 0 and N will be skipped and will not
be executed.
When X0=Off, as usual, the program will keep on executing from address 0. CJ
command will not be executed.
X0
(CJ command)
P***
CJ
P1
X1
Y1
X2
Y2
P1 N
Program
Example
2
There are five situations that the CJ command can be executed between the
commands MC and MCR.
1. Out of MC~MCR.
2. Valid in the loop P1 in the following chart.
3. In the same level N, inside of MC~MC .
4. Inside of MC, out of MCR.
5. Jump from this MC~MCR to another MC~MCR. (1)
(1)
X0
MC
N0
CJ
P0
CJ
P1
MC
N1
X2
X3
X1
M1000
Y1
P1
MCR
N1
M1000
P0
Y0
MCR
6-2
N0
10ms, 100ms
Timer
(ES/EP/EH)
1ms, 10ms,
100ms Timer (for
accumulative)
EP/EH
C0~C234
Application
command
M4 OfftOn
M4 On
M4 OntOff
M6 Off
M6 OfftOn
M6 On
M6 OntOff
M10 On/Off
trigger
M7 Off, X10
On/Off trigger
M10 On/Off
trigger
M11 Off
M11 OfftOn
M11 OntOff
M11 On
6-3
M0
CJ
P0
M1
Y1
M2
M20
M17
CJ
P0
M3
S1
M4
K10
TMR
T0
RST
T127
TMR
T127
RST
C0
CNT
C0
K20
MOV
K3
D0
CJ
P63
M5
M6
K1000
M7
M1
M11
M0
P0
M12
Y1
M13
P63
RST
T127
RST
C0
RST
D0
END
6-4
Applicable models
CALL
Call Subroutine
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: Operand S can assign P.
P can be modified by Index register E, F.
ES Series models: operand S can assign P0~P63.
EP / EH Series models: operand S can assign P0~P255.
ES Series models do not support the pulse execution
command (CALLP).
Command
Explanation
ES
EP
EH
Flag: None
API
02
Applicable models
ES
EP
EH
Subroutine Return
SRET
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
The command driven by contact is not necessary.
execution
32-bit command
Flag: None
Command
Explanation
Program
Example
1
When X0 = ON, then start CALL command, jump to P2 and run subroutine. When run
SRET command, it will jump back to address 24 and keep running.
6-5
X0
CALL
20
24
X1
P2
Y1
FEND
P2
Y0
Subroutine P2
Y0
subroutine
SRET
subroutine return
When X10 is the rising-edge triggered CALL P10 command that goes from Off to On,
Program
Example
2
INC
D0
P12
X2
Y0
CALL
INC
P10
D1
X13
Main
Program
X2
Y1
FEND
INC
INC
D10
subroutine
D40
Y12
P11
X14
subroutine
D11
X2
CALL
P14
INC
D41
subroutine
Y13
SRET
SRET
X2
INC
D31
INC
P13
Y5
P11
INC
SRET
Y4
X2
P13
X2
X11
CALL
CALL
Y11
X2
P10
D30
Y10
X10
X0
INC
D20
P14
Y6
X2
INC
D50
Y14
subroutine
X12
CALL
P12
subroutine
X2
INC
D21
SRET
END
Y7
SRET
6-6
Applicable models
ES
EP
EH
Interrupt Return
IRET
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C
Note: No operand
The command driven by contact is not necessary.
E F
IRET
execution
32-bit command
Flag: None
Command
Explanation
API
04
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
The command driven by contact is not necessary.
The pulse width of interrupt signal should be higher than 200us.
Please refer to the footnote of DI command to see the range of
numbers of each model.
API
05
Applicable models
ES
EP
EH
Enable Interrupts
EI
EI
execution
32-bit command
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
The command driven by contact is not necessary.
Disable Interrupts
DI
DI
execution
32-bit command
Flag: None
Command
Explanation
6-7
Program
Example
During the PLC operation, the program scans the commands between EI and DI, if X1
or X2 are ON, the subroutine A or B will be interruptted. When IRET is reached, the
main program will resume.
X0
EI
Y1
DI
Enabled interrupt
Disabled interrupt
EI
FEND
I 101
Y0
Enabled interrupt
Interrupt subroutine A
IRET
I 201
Y0
Interrupt subroutine B
IRET
6-8
Footnote
1.
External interrupts: (I001, X0), (I101, X1), (I201, X2), (I301, X3) 4 points.
2.
3.
External interrupts: (I001, X0), (I101, X1), (I201, X2), (I301, X3), (I401, X4),
(I501, X5) 6 points.
2.
3.
High-speed counter interrupts: I010, I020, I030, I040 4 points. (used with API 53
DHSCS command and interrupt signal occurs)
4.
5.
Function
External interrupt, I 001 masked
External interrupt, I 101 masked
External interrupt, I 201 masked
External interrupt, I 301 masked
6-9
Function
External interrupt, I 001 masked
External interrupt, I 101 masked
External interrupt, I 201 masked
External interrupt, I 301 masked
External interrupt, I 401 masked
External interrupt, I 501 masked
Time interrupt, I6 masked
Time interrupt, I7 masked
High-speed counter interrupt, I010~I040 masked
6-10
Function
External interrupt, I00masked
External interrupt, I10masked
External interrupt, I20masked
External interrupt, I30masked
External interrupt, I40masked
External interrupt, I50masked
Time interrupt, I60masked
Time interrupt, I70masked
Time interrupt, I80masked
High-speed counter interrupt, I010 masked
High-speed counter interrupt, I020 masked
High-speed counter interrupt, I030 masked
High-speed counter interrupt, I040 masked
High-speed counter interrupt, I050 masked
High-speed counter interrupt, I060 masked
Pulse output interrupt insert I110 masked
Pulse output interrupt insert I120 masked
Pulse output interrupt insert I130 masked
Pulse output interrupt insert I140 masked
Pulse output interrupt insert I150 masked
After CH0 pulse is transmitted, I110 interrupt occur
After CH1 pulse is transmitted, I120 interrupt occur
CH0 pulse is transmitted; meanwhile, I130 interrupt occur simultaneously
CH1 pulse is transmitted; meanwhile, I140 interrupt occur simultaneously
Applicable models
ES
EP
EH
First End
FEND
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
The command driven by contact is not necessary.
FEND
execution
32-bit command
Flag: None
Command
Explanation
This command denotes the end of the main routine program. It has the same function
as END command during PLC operation.
CALL must follow right after FEND command and add SRET command at the end of
the subroutine. Interrupt commands also have to follow after FEND command and add
IRET command at the end of the service program.
If using several FEND commands, please place the subroutine and interrupt service
programs between the last FEND and END command.
After CALL command is executed, the program error will occur when execute the FEND
command before SRET command is executed.
After FOR command is executed, the program error will occur when execute the FEND
command before NEXT command is executed.
CJ Command
ProgramFlow
0
main
program
X0
CJ
P0
CALL
P63
X1
main
program
P0
P63
I301
main
program
command CALL
subroutine
interrupt
subroutine
6-11
main
program
X0
CJ
P0
CALL
P63
X1
main
program
P0
P63
I301
API
07
main
program
command CALL
subroutine
interrupt
subroutine
Applicable models
WDT
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
ES series models do not support the pulse execution
command (WDTP).
ES
EP
EH
Flag: None
6-12
WDT (Watch Dog Timer) is used to monitor the PLC operation in the DVP series PLC
system.
The WDT command can be used to reset the Watch Dog Timer. If the PLC scanning
time (from step 0 to END or FEND command) is more than 200ms, the ERROR LED will
flash. The user will have to turn the PLC off and then back ON to clear the fault. PLC will
determine the status of RUN/STOP according to RUN/STOP switch. If there is no
RUN/STOP switch, PLC will return to STOP automatically.
When to use WDT:
When error occur in PLC system.
When the executing time of the program is too long to cause the scanning time to
exceed the content value of D1000. It can be modified by using the following two
methods.
Use WDT command
Program
Example
STEP0
WDT
END(FEND)
t2
T1
Use the set value of D1000 (default is 200ms) to change the watchdog time.
If the program scanning time is over 300ms, users can divide the program into 2 parts.
Insert the Watchdog Timer in between, so both programs scanning time will be less
than 200ms.
300ms program
END
150ms program
X0
WDT
150ms program
END
6-13
Applicable models
FOR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
S
Note: The contact execution command is not necessary
Refer to each model specification for usage range.
ES
EP
FOR
execution
32-bit command
EH
Flag: None
Command
Explanation
API
09
Applicable models
NEXT
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D
Note: No operand
The command driven by contact is not necessary.
ES
EP
NEXT
execution
32-bit command
EH
Flag: None
Command
Explanation
FOR and NEXT commands are used when n nested loops are needed.
N may be within the range of K1 to K32767. If the range NK1, N will always be K1.
When it is not desired to execute the FOR to NEXT commands, use the CJ command.
Error will occur in the following conditions:
NEXT command is before FOR command.
With FOR command, without NEXT command.
There is a NEXT command after the FEND or END command.
The numbers of FOR to NEXT commands are different.
The FOR to NEXT loop can be nested for five levels but please notice that if there are
too many loops, the PLC scanning time will increase and it may cause the watchdog
timer to be activated and result in error. User can use WDT command to modify.
6-14
After loop A operate 3 times, the program after the NEXT command will resume. For
every completed cycle of loop A, loop B will completely executed for 4 times, therefore,
the total number of times that loop B operate will be 3 412 times.
FOR
K3
FOR
K4
B
NEXT
NEXT
Program
Example
2
Program which executes the FOR to NEXT commands when X7 is off. It does not
execute the FOR to NEXT commands when X7 is on and CJ command jump to P6.
X7
CJ
P6
MOV
K0
FOR
K3
MOV
D0
INC
D0
M0
M0
D0
D1
MEXT
P6
X10
Y10
6-15
Program
Example
3
jump. When the most internal loop of FOR to NEXT, X1 will be ON and CJ command
will jump to P0 and not be executed.
X0
TMR
T0
FOR
K4X100
INC
D0
FOR
K2
INC
D1
FOR
K3
INC
D2
FOR
K4
K10
X0
X0
X0
X0
WDT
INC
D3
CJ
P0
FOR
K5
INC
D4
X1
X0
NEXT
P0
NEXT
NEXT
NEXT
NEXT
END
6-16
CMP
Applicable models
ES
EP
EH
Compare
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2 use with device F, it is only available in 16-bit
command.
Operand D occupies 3 continuous devices.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (CMPP, DCMPP).
Command
Explanation
Comparison result.
The contents of the comparison source
and
Program
Example
If
is set to Y0, then Y0, Y1, Y2 will work as the program example as below.
When X10=On, CMP command is driven and one of Y0, Y1, Y2 is On. When X10=Off,
CMP command is not driven and Y0, Y1, Y2 remain in the previous status.
The comparison result of , , commands can be got by the parallel connection of
Y0~Y2.
X10
CMP
K10
D10
Y0
Y0
If K10>D10, Y0 = On
Y1
Y2
If K10=D10, Y1 = On
If K10<D10, Y2= On
X10
X10
RST
M0
RST
M1
RST
M2
ZRST
M0
M2
6-17
ZCP
Bit devices
X Y M S
Applicable models
ES
EP
EH
Zone Compare
Word devices
H KnX KnY KnM KnS T
D E F
S1
S2
S
D
Command
Explanation
: Comparison value
: Comparison result.
and
and
result.
When
, set
Two comparison values are compared algebraically and this function compares the two
values that are considered binary values. If b15=1 in 16-bit command or b31=1 in 32-bit
command, the comparison will regard the value as the negative of the binary value.
Program
Example
If
is set to M0, then M0, M1, M2 will work as the program example as below.
When X0=On, ZCP command is driven and one of M0, M1, M2 is On. When X0=Off,
ZCP command is not driven and M0, M1, M2 remain in the previous status.
X0
ZCP
K10
K100
C10
M0
M0
If C10 < K10, M0 = On
M1
M2
If K10 <
= C10 <
= K100, M1 = On
If C10 > K100, M2 = On
6-18
RST
M0
RST
M1
RST
M2
ZRST
M0
M2
MOV
Bit devices
X Y M S
Applicable models
ES
EP
EH
Data Move
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: If operand S, D use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (MOVP, DMOVP)
Command
Explanation
: Data source
without any
remain unchanged.
If the calculation result is a 32-bit output, (i.e. the application MUL) and the data of a
32-bit high-speed counter, users will have to use DMOV command.
Program
Example
X1
MOV
T0
D10
DMOV
D20
D30
DMOV
C235
D40
X2
6-19
SMOV
Bit devices
X Y M S
Applicable models
ES
EP
EH
Shift Move
Word devices
H KnX KnY KnM KnS T
C D
E F
S
m1
m2
D
n
32-bit command
: Data movementsource
Command
Explanation
Program
Example
1
When M1168=Off, X0=On, assign the content of the two digits from the 4th digit
(thousands place digital) of D10 (decimal number) and move the assigned data to the
two digits from the 2nd digit (hundreds' place digits) of D20 (decimal number). Then, the
content of 103 and 100 of D20 remain unchaged after SMOV command is executed.
When BCD number is higher than 9,999 or be negative (outside range of 0 to 9,999), an
operation error will occur in PLC. Then, the command will not be executed and M1067,
M1068 will be On, D1067 record error code 0E18 (hexidecimal number).
M1001
M1168
X0
SMOV
D10
K4
K2
D20
K3
D10(BIN 16bit)
Auto conversion
10
10
10
10
No variation
No variation
10
10
10
10
D10(BCD 4 digits)
Shift move
D20(BCD 4 digits)
Auto conversion
Program
Example
2
6-20
D20(BIN 16bit)
If D10=H1234D20=H5678 before executing, D10 wont change and D20=H5128 after
finishing execution.
When M1168=On, if use SMOV command, the D10 and D20 do not move data in BCD
format. However the data is moved as a 4 digit BIN number.
Digit 4
K4
D10
Digit 3
Digit 2
K2
D20
K3
Digit 1
D10(BIN 16bit)
Shift move
D20(BIN 16bit)
Digit 4
No variation
Program
Example
3
Digit 3
Digit 2
Digit 1
No variation
Digit switch connected to the interrupted number inputs can use SMOV command to
combine.
Move the right second digit switch to the right second digit of D2 and move the left first
digit switch to the right first digit of D1.
Use SMOV command to move the first digit to the third digit of D2 and combine these
two digit switches into one group.
10
6
8
10
10
8
8
X13~X10
X27~X20
PLC
M1001
M1168
M1000
BIN K2X20
D2
(X20~X27)BCD
D2(BIN)
2 digits
BIN
K1X10
D1
(X10~X13)BCD
1 digit
D1(BIN)
SMOV
D1
K1
K1
D2
K3
6-21
CML
Bit devices
X Y M S
Applicable models
ES
EP
EH
Compliment
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: If operand S, D use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (CMLP, DCMLP)
: Transfer data source
Command
Explanation
. If the content is Constant K, this Constant K will be converted to the BIN value
automatically.
This command can be used during the counter-phase output.
Program
Example
1
X10
CML
K1Y0
D1
b 15
D1
b3
b2
b1
b0
No variation
Program
Example
2
Transfer the
counter-phase data
The left loop shown below can be displayed as the right program example by using CML
command.
X000
M0
X001
X002
X003
M1
M2
M3
M1000
6-22
M0
Normal on contact
M1
M2
M3
API
15
BMOV
Bit devices
X Y M S
Applicable models
ES
EP
EH
Block Move
Word devices
K H KnX KnY KnM KnS T C D E F
S
D
n
32-bit command
Command
Explanation
Flag: None
: Block of multiple
data
This command is used to move an assigned block of multiple data to a new destination.
Move the contents of the
device, only those that are within the enabled range will be moved.
Program
Example
1
When X10=On, move the contents of the four registers D0~D3 to their corresponding
registers D20~D23.
X10
D20
D0
D1
K4
D20
D21
D22
D23
D2
D3
Program
Example
2
If move the specified bit device, KnX, KnY, KnM, KnS, the digit numbers of
n=4
and
should be the same and this also means the number of n should be the same.
ES series models do not support KnX, KnY, KnM, KnS devices.
M1000
D0
D20
K4
M0
M1
M2
M3
M4
M5
n=3
M6
M7
M8
M9
Y10
Y11
M10
M11
Y12
Y13
6-23
Program
Example
3
and
>
When
<
in
ES series models. Otherwise, the execution result will be the same value. For
example, when the BMOV command is processed in the order as 321, the
content value of D11 to D13 will all be the content value of D10.
X10
BMOV
D20
D19
1
2
3
D20
D21
K3
D22
X11
BMOV
D10
D11
3
2
1
D10
D11
K3
D12
API
16
FMOV
Bit devices
X Y M S
D21
D11
D13
Applicable models
ES
EP
EH
Fill Move
D19
D20
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command (7 STEPS)
Continuous
Pulse
FMOV
FMOVP
execution
execution
S
D
n
32-bit command (13 STEPS)
Note: If operand S, D use with device F, it is only available in 16-bit
Continuous
Pulse
DFMOV
DFMOVP
command.
execution
execution
The usage range of operand n:
Flag: None
n=1~ 512(16-bit command), n=1~ 256 (32-bit command)
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (FMOVP, DFMOVP)
Command
Explanation
: Source device
: A quantity of multiple
devices
The data stored in the source device
destination device. Move the contents of
-assigned devices exceed the usage range, only those that are within the enabled
range will be moved.
ES series models do not support KnX, KnY, KnM, KnS devices.
6-24
Program
Example
from D10.
X10
K10
FMOV
K10
API
17
XCH
K5
K10
D10
K10
D11
K10
D12
K10
D13
K10
D14
Applicable models
ES
EP
EH
Word devices
K H KnX KnY KnM KnS T
C D E F
D1
D2
Note: If operand D1, D2 use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (XCHP, DXCHP).
Command
Explanation
Program
Example
1
n=5
Data Exchange
Bit devices
X Y M S
D10
X0
XCHP
D20
D40
Before
execution
After
execution
D20
120
40
D20
D40
40
120
D40
6-25
Program
Example
2
After
execution
Before
execution
D100
D100
D101
40
20
D200
D101
D200
D201
20
40
D201
Footnote
and
M1303=On, the upper and lower 8-bit contents of that specified devices will exchange.
In 32-bit command, when the devices specified by
and
M1303=On, the upper and lower 8-bit contents of that 32-bit devices will exchange.
When X0=On and M1303=On, the upper and lower 8-bit contents of D100, D0101 will
exchange.
Before
execution
After
execution
D100L
20
D100L
D100H
20
D100H
D101L
40
D101L
D101H
40
D101H
X0
M1303
DXCHP
API
18
BCD
D100
Bit devices
X Y M S
D100
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: If operand S, D use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
command (BCDP, DBCDP)
Command
Explanation
Applicable models
ES
EP
EH
If the BCD conversion result is outside the range of 0 to 9999, an operation error occurs,
the error flag M1067, M1068 will be On and D1067 record error code 0E18
(hexadecimal number).
6-26
Program
Example
(Y0~Y3).
X0
BCD
D10
K1Y0
API
19
BIN
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C
E F
S
D
Note: If operand S, D use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support pulse execution
command (BINP, DBINP)
Command
Explanation
: Data source
: Converted result
Applicable models
ES
EP
EH
which is
indicated as HEX being outside the range of 0 to 9), an operation error will occur, the
error flag M1067, M1068 will be On and D1067 records error code 0E18.
Constant K and H is automatically converted into the BIN data. There is no necessity for
constant to use this command.
Program
Example
When X0=ON, the BCD data K1X0 is converted to BIN data, and stored the result at
D10.
X0
BIN
K1X0
D10
6-27
Footnote
The BIN command is used to covert the source data into BIN data and store in the
PLC when PLC read a BCD format digit switch from external equipment.
The BCD command is used to convert the stored data into BCD data and transmit it
to the 7-segment display when PLC display the stored data on a BCD format
7-segment display from external equipment.
When X0=On, convert K4X0(BCD data) into BIN data and transmit it to D100. Then,
convert BIN data of D100 into BCD data and transmit it to K4Y20.
X0
10
10
10
BIN
K4X0
D100
BCD
D100
K4Y20
10
2
8
X17
X0
4 digit BCD value
Y20
6-28
ADD
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2, D use with device F, it is only available in
16-bit command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution command
(ADDP, DADDP).
: Augend
Command
Explanation
: Addend
Applicable models
ES
EP
EH
: Addition result
The most significant bit are the symbolic bit 0 and 1. 0 indicates positive and 1 indicates
negative. All calculation are algebraically processed, i.e. 3 + (-9) = -6.
Flag changes of binary addition
16-bit command:
If the operation result is 0, then the Zero flag, M1020 is set to ON.
If the operation result exceeds -32,768, the borrow flag, M1021 is set to ON.
If the operation result exceeds 32,767, the carry flag, M1022 is set to ON.
32-bit command:
1. If the operation result is 0, then the Zero flag, M1020 is set to ON.
2. If the operation result exceeds -2,147,483,648, the borrow flag, M1021 is set to ON.
3. If the operation result exceeds 2,147,483,647, the carry flag, M1022 is set to ON.
Program
Example
1
16-bit command:
When X0 is ON, the data contained within the augend D0 and addend D10 is combined
and the total is stored in the result device D20.
X0
ADD
D0
D10
D20
Program
Example
2
32-bit command:
When X0 is ON, the data contained within the augend (D31, D30) and addend (D41, D40)
is combined and the total is stored in the result device (D51, D50). (D30, D40, D50 is the
lower 16-bit data, and D31, D41, D51 is the higher 16-bit data)
X10
DADD
D30
D40
D50
6-29
Footnote
-1B 0B 1
Borrow flag
API
21
SUB
Zero flag
-1B 0B 1
2,147,483,647B 0B 1B 2
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2, D use with device F, it is only available in
16-bit command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution command
(SUBP, DSUBP).
: Minuend
Command
Explanation
Carry flag
Carry flag
Applicable models
ES
EP
EH
Bit devices
X Y M S
32,767B 0B 1B 2
Zero flag
Borrow flag
Zero flag
Zero flag
: Subtrahend
The most significant bit are the symbolic bit 0 and 1. 0 indicates positive and 1 indicates
negative. All calculation are algebraically processed.
Flag changes of binary subtraction
.
.
.
6-30
16-bit command:
If the operation result is 0, then the Zero flag, M1020 is set to ON.
If the operation result exceeds 32,768, the borrow flag, M1021 is set to ON.
If the operation result exceeds 32,767, the carry flag, M1022 is set to ON.
32-bit command:
If the operation result is 0, then the Zero flag, M1020 is set to ON.
If the operation result exceeds 2,147,483,648, the borrow flag, M1021 is set to ON.
If the operation result exceeds 2,147,483,647, the carry flag, M1022 is set to ON.
Program
Example
1
contained within the minuend D0 and the result of this calculation is stored in the result
device D20.
X0
SUB
D0
D10
D20
Program
Example
2
When X0 is ON, the data contained within the subtrahend (D41, D40) is subtracted from
the data contained within the minuend (D31, D30) and the result of this calculation is
stored in the result device (D51, D50). (D30, D40, D50 is the lower 16-bit data, and D31,
D41, D51 is the higher 16-bit data)
X10
DSUB
D30
D40
D50
API
22
MUL
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2 use with device F, it is only available in
16-bit command.
If operand D use with device E, it is only available in 16-bit
command.
In 16-bit command, operand D occupies 2 continuous devices.
In 32-bit command, operand D occupies 4 continuous devices.
Refer to each model specification for usage range.
ES series models do not support the pulse execution Command
(MULP, DMULP).
: Multiplicand
Command
Explanation
: Multiplier
: Multiplication result
and
in the
6-31
b15................ b00
X
b15 is a symbol bit
When
is bit device, it can specify K1~K4 and produce a 16-bit result. Then, the flag
M1067, M1068 will be On and D1067 record error code 0E19.
32-bit command:
+1
+1
b31.. b16 b15.. b00
+3
+1
X
b31 is a symbol bit
+2
b31=0,S 1 (S 1 +1) are positive value b31=0,S 2 (S 2 +1) are positive value
b31=1,S 1 (S 1 +1) are negative value b31=1,S 2 (S 2 +1) are negative value
When
is bit device, it can specify K1~K8 and produce a 32-bit result. The
Program
Example
MUL
D0
D10
D20
MUL
D0
D10
K8M0
API
23
DIV
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2 use with device F, it is only available in
16-bit command.
If operand D use with device E, it is only available in 16-bit
command.
In 16-bit command, operand D occupies 2 continuous
devices.
In 32-bit command, operand D occupies 4 continuous
devices.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
Command (ADDP, DADDP).
6-32
Applicable models
ES
EP
EH
Command
Explanation
: Divisor
and
command.
This command is not executed when the divisor is 0. Then, the flag M1067, M1068 will
be On and D1067 record error code 0E19.
16-bit command:
Quotient
Remainder
+1
is bit device, it can specify K1~K4 to produce a 16-bit result and occupies 2
When
continuous groups. In regards to the operation result, the quotient and remainder are
stored.
32-bit command:
Quotient
+1
+1
+1
Remainder
+3
+2
is bit device, it can specify K1~K8 and produce a 32-bit result. In regards to
When
the operation result, only the quotient is stored.
Program
Example
When X0 is ON, the primary source D0 (divisor) is divided by the second source D10
(dividend). The quotient is specified to be stored in D20 and the remainder is specified to
be stored in D21. The polarity of the result is indicated by the OFF/ON of the most
significant bit. OFF indicates the value of positive and ON indicates the value of
negative.
X0
DIV
D0
D10
D20
DIV
D0
D10
K4Y0
6-33
INC
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: If operand D use with device F, it is only available 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
(INCP, DINCP).
: Destination device
Command
Explanation
If the command is not the pulse execution command, 1 is added to the value of
destination device
Program
Example
API
25
DEC
X0
INCP
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: If operand D use with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support pulse the execution
(DECP, DDECP).
Command
Explanation
Applicable models
ES
EP
EH
Bit devices
X Y M S
D0
: Destination device
If the command is not the pulse execution command, 1 is subtracted to the value of
destination device
6-34
Program
Example
API W
26
AND
DECP
Bit devices
X Y M S
D0
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2, D use with device F, it is only available in
16-bit command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
(WANDP, DANDP)
: First data source device
Command
Explanation
: Operation result
Performs the logical product of the data source device
operation result into the device
and
General operation rule: If one of the bit contained within the data source devices is 0,
then the operation result is also 0.
Program
Example
1
When X0 is ON, the 16-bit data source device D0 and D2 are analyzed and the
operation result of the logical WAND command is stored in the device D4.
X0
WAND
Before
execution
After
execution
D0
D2
D4
b15
b00
D0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
WAND
D2 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D4 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
6-35
Program
Example
2
and the operation result of the logical DAND command is stored in the device (D41,
D40).
X1
DAND
D10
D20
D40
b31
1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
Before
execution
D11 D10
b15
b0
1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
DAND
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D21 D20
After
execution
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
D41 D40
API W
27
OR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: If operand S1, S2, D use with device F, it is only available in
16-bit command.
Refer to each model specification for usage range.
ES series models do not support the pulse execution
(WORP, DORP)
: First data source device
Command
Explanation
: Operation result
Performs the logical sum of the data source device
operation result into the device
and
General operation rule: If one of the bit contained within the data source devices is 1,
then the operation result is also 1.
Program
Example
1
When X0 is ON, the 16-bit data source device D0 and D2 are analyzed and the
operation result of the logical WOR command is stored in the device D4.
X0
WOR
Before
execution
D0
D2
D4
b15
b00
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
WOR
D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
execution
6-36
D4 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
Program
Example
2
and the operation result of the logical DOR command is stored in the device (D41, D40).
X1
DOR
D10
D20
D40
b
b31
b15
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
DOR
D11 D10
Before
execution
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D21 D20
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
After
execution
D41 D40
API W
28
XOR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Command
Explanation
Operation result
Performs the exclusive logical add of the data source device
stores the operation result into the device
and
, and
General operation rule: If both of the bit contained within the two data source devices are
the same, then the operation result is 0. But if both of the bit contained within the two
data source devices are different, then the operation result is 1.
Program
Example
1
When X0 is ON, the 16-bit data source device D0 and D2 are analyzed and the
operation result of the logical WXOR command is stored in the device D4.
X0
WXOR
Before
execution
D0
D2
D4
b15
b00
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
WOR
D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
execution
D4 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
6-37
Program
Example
2
Before
execution
and the operation result of the logical DXOR command is stored in the device (D41,
D40).
X1
DXOR
D10
D20
D40
b15
b0
b
b31
1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
D11 D10
DXOR
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D21 D20
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1
1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1
After
execution
D41 D40
API
29 D
NEG
Negation
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T
C D E F
D
Note: If operand D uses with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
ES series models do not support pulse execution (NEGP,
DNEGP).
Command
Explanation
, will be served as
the complement of 2.
This command can convert the negative BIN value to the positive number, and that is, to
get its absolute value.
This command is usually pulse execution (NEGP, DNEGP).
Program
Example
1
Program
Example
2
When X goes from OFF ON, every bit of the D10 contents will be countered (01,
10) and be added with 1, and will then be saved in the original register, D10.
X0
NEGP
D10
BON
M0
D0
K15
Normal ON contact
M0
NEGP
6-38
D0
X0
CMP
D0
D2
M0
SUB
D0
D2
D4
SUB
D2
D0
D4
M0
M1
M2
6-39
(D0)+1=1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D0)+1=2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
(D0)+1=3
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
(D0)+1=4
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
(D0)+1=5
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
(D0=-32,765)
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
(D0)+1=32,765
0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
(D0=-32,766)
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
(D0)+1=32,766
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
(D0=-32,767)
(D0)+1=32,767
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D0=-32,768)
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(D0)+1=32,768
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Max. absolute value is 32,767
6-40
ROR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
D
n
Note: If operand D uses with device F, it is only available in 16-bit
command.
If operand D is specified as KnY, KnM, KnS, only K4
(16-bit) and K8 (32-bit) is valid.
Essential condition: 1n16 (16-bit), 1n32 (32-bit)
Refer to each model specification for usage range.
ES series models do not support pulse execution (RORP,
DRORP).
Command
Explanation
Applicable models
ES
EP
EH
is rotated
Program
Example
shown in the diagram, and b3 that located at D10 originally will then be moved to the
carry flag (CY) M1022.
X0
RORP
D10
K4
lower bit
Carry
flag
D10 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 1
upper bit
16 bits
After one rotation
to the right
lower bit
D10 0 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0
*
Carry
flag
6-41
ROL
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
D
n
Note: If operand D uses with device F, it is only available in 16-bit
command.
If operand D is specified as KnY, KnM, KnS, only K4
(16-bit) and K8 (32-bit) is valid.
Essential condition: 1n16 (16-bit), 1n32 (32-bit)
Refer to each model specification for usage range.
ES series models do not support pulse execution (ROLP,
DROLP).
Command
Explanation
Applicable models
ES
EP
EH
is rotated
Program
Example
When X0 goes from OFF ON, the 16 bit data of D10 will rotate 4 bits to the left, as
shown in the diagram, and b12 that located at D10 originally will then be moved to the
carry flag (CY) M1022.
X0
D10
K4
lower bit
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Carry
flag
upper bit
1
Carry
flag
6-42
D10
16 bits
After one rotation
to the left
lower bit
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
D10
RCR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
D
n
Note: If operand D uses with device F, it is only available in 16-bit
command.
If operand D is specified as KnY, KnM, KnS, only K4 (16-bit)
and K8 (32-bit) are valid.
Essential condition: 1n16 (16-bit), 1n32 (32-bit)
Refer to each model specification for usage range.
ES series models do not support pulse execution (RCRP,
DRCRP).
Command
Explanation
Applicable models
ES
EP
EH
Program
Example
flag (M1022), will rotate 4 bits to the right, as shown in the diagram, and b3 that
located at D10 originally will then be moved to the carry flag M1022, and that the
original contents of the carry flag M1022 will be moved to the bit of b12.
X0
D10
K4
1
Carry
flag
16 bits
D10
0
Carry
flag
6-43
RCL
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T
E F
D
n
Note: If operand D uses with device F, it is only available in 16-bit
command.
If operand D is specified as KnY, KnM, KnS, only K4
(16-bit) and K8 (32-bit) is valid.
Essential condition: 1n16 (16-bit), 1n32 (32-bit)
Refer to each model specification for usage range.
ES series models do not support pulse execution (RCLP,
DRCLP).
Command
Explanation
Applicable models
ES
EP
EH
Program
Example
flag (M1022), will rotate 4 bits to the left, as shown in the diagram, and b12 that
located at D10 originally will then be moved to the carry flag M1022, and that the
original contents of the carry flag M1022 will be moved to the bit of b3.
X0
RCLP D10
K4
lower bit
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 D10
Carry
flag
16 bits
After one rotation
to the left
upper bit
lower bit
1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 D10
Carry
flag
6-44
SFTR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
S
D
n1
n2
Note: Essential condition: 1n11024, 1 n2n1
In ES series models: 1n2n1512
Refer to each model specification for usage range.
ES series models do not support pulse execution (SFTRP).
Command
Explanation
Applicable models
ES
EP
EH
Flag: None
: Starting number of
begin with
to the right by
bits.
bits, which
Program
Example
carry
M7~M4
M3~M0
M11~M8
M7~M4
M15~M12
M11~M8
X3~X0
M15~M12 complete
X0
SFTR
X0
M0
K16
K4
X2
X1
X0
5
M15 M14 M13 M12 M11 M10
M9
M8
M7
M6
M5
M4
M3
M2
M1
carry
M0
6-45
SFTL
Bit devices
X Y M S
Applicable models
ES
EP
EH
C D E F
S
D
n1
n2
Flag: None
Command
Explanation
: Starting number of
begin with
to the left by
bits.
bits, which
Program
Example
M15~M12
carry
M11~M8
M15~M12
M7~M4
M11~M8
M3~M0
M7~M4
X3~X0
M3~M0 complete
X0
SFTR
X0
M0
K16
K4
carry
X2
X1
X0
M3
M2
M1
M0
5
M15 M14 M13 M12 M11
6-46
X3
M10
M9
M8
M7
M6
M5
M4
WSFR
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T
C D E F
S
D
n1
n2
Note: When using bit devices as operand S (source) and D
(destination) the specified device must be equal, for
example, one kind is the KnX, KnY, KnM, KnS and the other
kind is T, C, D.
When using bit devices as operand S (source) and D
(destination) the Kn value must be equal.
Essential condition: 1n1512, 1 n2n1
Refer to each model specification for usage range.
ES series models do not support pulse execution (WSFR,
WSFRP).
Command
Explanation
Flag: None
: Starting number of
to the right by
words.
words,
Program
Example
1
D23~D20 carry
D27~D24 D23~D20
D31~D28 D27~D24
D35~D32 D31~D28
D13 ~D10 D35~D32 complete
X0
WSFRP D10
D13
D12
D11
D35
D34
D33 D32
D20
K16
K4
D10
5
D31
D30 D29
D28
D27 D26
D25
D24 D23
D22
D21 D20
Carry
6-47
Program
Example
2
Y17~Y10 carry
Y27~Y20 Y17~Y10
X27~X20 Y27~Y20 complete
When using Kn device, the specified value must be equal
X0
K4
K2
X27
X26
X25
X24
X23
X22
X21
Y27
Y26
Y25
Y24
Y23
Y22
Y21 Y20
X20
3
Y17
Y16
Y15
Y14 Y13
Y12
Y11 Y10
API
37
WSFL
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n1
n2
Note: When using bit devices as operand S (source) and D
(destination) the specified device must be equal, for
example, one kind is the KnX, KnY, KnM, KnS and the other
kind is T, C, D.
When using bit devices as operand S (source) and D
(destination) the Kn value must be equal.
Essential condition: 1n1512, 1 n2n1
Refer to each model specification for usage range.
ES series models do not support pulse execution (WSFL,
WSFLP)
Command
Explanation
Applicable models
ES
EP
EH
Flag: None
Carry
: Words after
to the left by
words.
words, which
6-48
Program
Example
D35~D32 carry
D31~D28 D35~D32
D27~D24 D31~D28
D23~D20 D27~D24
D13~D10 D23~D20 complete
X0
WSFLP D10
D20
K16
K4
D13
D12
D11
D24 D23
D22
D21 D20
D10
5
Carry D35
D34
D33 D32
API
38
SFWR
D27 D26
Word devices
H KnX KnY KnM KnS T C D
E F
S
D
n
Note: Essential condition: 2n512
Refer to each model specification for usage range.
ES series models do not support pulse execution (SFWR,
SFWRP).
Command
Explanation
D25
Applicable models
ES
EP
EH
Bit devices
X Y M S
D28
Data length
is the length of the First-in/First-OUT stack and the destination device
is
the head address device of the First-in/First-OUT stack. Use the first number device
as the pointer and add 1 to the content value of the pointer when executing this
command. The contents of the devices specified by
specified by the pointer
pointer
exceed the value n-1, the insertion into the First-in/First-OUT stack will
Program
Example
becomes 1 when the content of D20 is created and built in D1. After changing the
content of D20, X0 is executed to goes from OFF to ON again, then the content of D0
becomes 2 when the content of D20 is created and built in D2.
6-49
RST
D0
SFWRP
D20
X0
D0
-K10
n = 10 points
D20
D9
D8
D7
D6
D5
D4
D0 =
D3
D2
D1
D0
pointer
This API 38 SFWR command can be used with the API 39 SFRD command to execute
Footnote
API
39
SFRD
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n
Note: Essential condition: 2n512
Refer to each model specification for usage range.
ES series models do not support pulse execution (SFRD,
SFRDP).
Command
Explanation
Applicable models
ES
EP
EH
: destination device
: Data length
is the
head address device of the First-in/First-OUT stack. Use the first number device
as the pointer and subtract 1 to the content value of the pointer when executing this
command. The contents of the devices specified by
specified by the pointer of the First-in/First-OUT stack. If the contents of the pointer
are equal to 0 (zero), the First-in/First-OUT stack will be empty and the carry flag
M1022 will be turned ON.
This command is usually pulse execution (SFRDP).
6-50
Program
Example
D0
SFRDP
K10
D21
n = 10 points
D9
D8
D7
D6
D5
D4
D3
D2
D1
D21
D0
pointer
data read
This API 38 SFWR command can be used with the API 39 SFRD command to execute
Footnote
API
40
ZRST
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E
D1
D2
Note: Essential condition: D1 must be less than or equal to () D2.
Operand D1 and D2 must be in the same category.
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(ZRSTP).
Command
Explanation
Applicable models
ES
EP
EH
Flag: None
For ES series models, standard and High speed counters cannot be mixed.
For EH/EP series models, standard and High speed counters can be mixed use.
When
>
is reset.
6-51
M399
X1
ZRST
C0
C127
ZRST
T0
T127
ZRST
S0
S127
ZRST
D0
D100
ZRST
C235
C254
X10
X2
X3
X4
The RST command can be independently used in the bit device, i.e. Y, M, S and in
Footnote
6-52
RST
T0
RST
Y0
FMOV
K0
D10
K5
DECO
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T
C D E F
S
D
n
Note: When operand D is bit device, n=1~8
When operand D is word device, n=1~4
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(DECOP).
: Decode source device
Command
Explanation
Flag: None
Program
Example
1
is used in case of a bit device, 0<n8. But if n=0 or n>8, the calculation error
will occur.
When n=8, the maxium decoded data is 2 8, equal 256 points. (Must notice the range
of the stored device after decoding. Please do not use repeatly.)
When X10 goes from Off On, the data of X0~X2 will be decoded to M100~M107.
If data source is 1+2=3, M103 at the third position from M100 turns ON and is set to 1.
After the execution is completed, X10 is changed to OFF. The device which have been
decoded is still action.
X10
DECOP
7
0
6
0
5
0
X0
M100
X2
X1
X0
4
0
3
3
1
2
0
K3
1
0
0
0
6-53
Program
Example
2
occur.
When n=4, the maxium decoded data is 2 4, equal 16 points.
When X10 goes from Off On, the data in D10 (b2 to b0) will be decoded and stored
at D20 (b7 to b0). The unused bits in D20 (b15 to b8) will be all set to 0.
Decodes three lower bits in D10 and stores at eight lower bits in D20 (one bit will be 1)
and the content of eight upper bits are all 0.
After the execution is completed, X10 is changed to OFF. The device which have been
decoded is still action.
X10
DECOP
D10
D20
D10
b15
0
K3
b0
1
2 1
When 3 is specified
at b2 to b0 of D10
all be 0 (zero)
0
b15
42
ENCO
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n
Note: When operand S is bit device, n=1~8
When operand S is word device, n=1~4
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(ENCOP).
Command
Explanation
b0
Applicable models
ES
EP
EH
Bit devices
X Y M S
D20
API
Flag: None
6-54
is used in case of a bit device, 0<n8. But if n=0 or n>8, the calculation error
will occur.
When n=8, the maxium decoded data is 2 8, equal 256 points.
When X0 goes from Off On, the data of 2 3 (M0 to M7) will be decoded and stored
at three lower bits of D0 (b2 to b0). The unused bits in D0 (b15 to b3) will be all set to
0.
After the execution is completed, X10 is changed to OFF and the data in
remain unchanged.
X0
K3
D0
ENCOP M0
M06
M05
M04
M03
M02
M01
M00
0
7
0
6
0
5
0
4
1
3
0
2
0
1
0
0
all be 0 (zero)
0 0
b15
4 2 1
0
D0
Program
Example
2
is used in case of a word device, 0<n4. But if n=0 or n>4, the calculation error
will occur.
When n=4, the maxium decoded data is 2 4, equal 16 points.
When X0 goes from Off On, the data of 2 3 (b0 to b7) in D10 will be decoded and
stored at three lower bits (b2 to b0) at D20. The unused bits in D20 (b15 to b3) will be
all set to 0. (b8 to b15 in D10 is not available)
After the execution is completed, X10 is changed to OFF and the data in
remain unchanged.
X0
K3
D20
ENCOP D10
Data inactivated
b0
0
D10
b15
0
6
0
5
0
4
1
3
0
2
0
1
0
0
all be 0 (zero)
0
b15
D20
b0
6-55
Applicable models
SUM
Sum of ON Bits
Bit devices
X Y M S
S
D
ES
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command (5 STEPS)
Continuous
SUM
SUMP
execution
EP
EH
Pulse
execution
: Source device
Command
Explanation
If the contents of these 16 bits are all 0, the Zero flag, M1020=ON.
will occupy two registers when using in 32-bit command.
When X10 is ON, all the bits that with 1 as its content within D0 will be counted and
have this counted number stored in D2.
X10
D2
SUM
D0
Program
Example
API
44 D
BON
0 0
D0
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n
Note: If operand S uses with device F, it is only available in 16-bit
command.
Essential condition: n=0~15 (16-bit), n=0~31 (32-bit)
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(BONP, DBONP).
Command
Explanation
Program
Example
6-56
Bit devices
X Y M S
: Source device
3
D2
Applicable models
ES
EP
EH
0 0
D0
b0
0 M0=Off
b15
1 0
0 0
D0
b0
0 M0=On
API
45 D
MEAN
Applicable models
ES
EP
EH
Mean Value
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D
S
D
n
K15
M0
D0
Command
Explanation
registers specified by
generated.
Program
Example
When X10 is ON, add up the contents of the three registers starting from D0 (specified
by this command), and divide the sum by three to take the mean vlaue. Then store this
mean value in the specified device D10 and ignore the remainder.
X10
MEAN
(D0+D1+D2)/D3
D0
K100
D1
K113
D2
K125
D0
D10
K3
D10
K112
D10
reminder = 3, be ignored
6-57
Applicable models
ES
EP
EH
ANS
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S
m
D
Note: Operand S available range: for EP series: T0~T191
for EH series: T0~T199.
Operand m available range: K0~K32,767, in units of 100 ms
Operand D available range: S900~S1023
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(ANS).
: A timer which detect alarm
Command
Explanation
ANS
execution
32-bit command
: Time setting
: Alarm device
X3
Program
Example
API
47
ANR
ANS
T10
K50
S999
Applicable models
ES
EP
EH
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T C D E F
Note: No operand
ES series models do not support pulse execution
command (ANR, ANRP).
Flag: None
Command
Explanation
Program
Example
6-58
X3
ANRP
Flag:
Footnote
1. M1048 (Alarm device is activated): When M1049 is driven to be ON, if any one alarm
device of S899~S1023 (in EP series)/ S899~S1023 (in EH series) outputs, M1048 is
ON.
2. M1049(Monitor is valid): When M1049 is driven to be ON, D1049 will automatically
display the lowest number during the execution of this command.
Application of alarm device:
I/O devices arrangement:
X0: forward switch, X1: backward switch, X2: front location switch, X3: back location
switch, X4: alarm device reset button, Y0: forward, Y1: forward, Y2: alarm indicator,
S910: forward alarm device, S920: backward alarm
M1000
M1049
Y0
Y1
X0
X2
ANS
T0
K100
S910
ANS
T1
K200
S920
X3
X2
Y0
Y0
X1
X3
Y1
Y1
M1048
Y2
X4
ANRP
6-59
5.
6.
API
48
SQR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T
C D E F
S
D
Note: If operand S, D use with device F, it is only available in
16-bit command.
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(SQR, SQRP, DSQR, DSQRP).
Command
Explanation
Applicable models
ES
EP
EH
: Source device
and stores
Program
Example
When X10=On, the content of D0 will be stored in D12 after the operation of square
root.
X10
SQR
D0
6-60
D0
D12
D12
FLT
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: Refer to each model specification for usage range.
ES series models do not support pulse execution
command (FLT, FLTP, DFLT, DFLTP).
Command
Explanation
: Source device
Applicable models
ES
EP
EH
When M1081 is OFF, the source data is converted from BIN integer to binary floating
point. At this time,
and
If absoluted value of conversion result is larger than max. floating value, carry flag
M1022=On.
If absoluted value of conversion result is less than min. floating value, carry flag
M1021=On.
If conversion result is 0, zero flag M1020=On.
When M1081 is ON, the source data is converted from binary floating point to BIN
integer. (ignore the decimal) At this time,
occupies 2 registers and
Program
Example
1
is saved by 16 bits.
When M1081 is OFF, the source data is converted from BIN integer to binary floating
point.
When X10 is ON, D0 (BIN integer) is converted to D13, D12 (binary floating point).
When X11 is ON, D1, D0 (BIN integer) are converted to D21, D20 (binary floating
point).
If D0=K10, X10 will be On. 32-bit of floating point after conversioin will be H41200000
and it will be saved in 32-bit register D12(D13).
If 32-bit register D0(D1)=K100,000, X11 will be On. 32-bit of floating point after
conversioin will be H4735000 and it will be saved in 32-bit register D20(D21).
6-61
M1081
FLT
D0
D12
DFLT
D0
D20
X10
X11
Program
Example
2
When M1081 is On, the source data is converted from binary floating point to BIN
integer. (ignore the decimal)
When X10 is ON, D0 and D1(binary floating point) are converted to D12 (BIN integer).
If D0(D1)=H47C35000, the floating point is 100,000. The execution result will be
D12=K32,767, M1022=On due to the value exceeds max. value of 16-bit register D12.
When X11 is ON, D1, D0 (binary floating point) are converted to D21, D20 (BIN
integer). If D0(D1)=H47C35000, the floating point is 100,000. The result will be saved
in 32-bit register D20(D21).
M1002
SET
M1081
X10
FLT
D0
D12
DFLT
D0
D20
X11
Program
Example
3
(D10)
(X7~X0)
16 bit BIN 2 bit BCD
(D21,D20)
binary floating point
7
8
(D31,D30)
decimal floating point (for monitor)
(D41,D40)
32 bit integer
(D203,D202)
binary floating point
(D401,D400)
binary floating point
6-62
FLT
D10
D100
BIN
K2X0 D200
FLT
D200 D202
DEDIV K615
K10
D300
D30
D20
D40
DINT
D20
1.
2.
3.
4.
Save the result of K615 K10 to D301, D300 (binary floating point).
5.
6.
7.
Covert binary floating point (D21, D20) to decimal floating point (D31, D30).
8.
Covert binary floating point (D21, D20) to BIN integer (D41, D40).
6-63
REF
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T
C D E F
D
n
Note: Operand D should be a multiple of 10, i.e. 00, 10, 20, 30
etc., so it should be X0, X10, Y0, Y10 etc., please refer to
the command explanation.
Essential condition: n=8~256, and should be a multiple of 8,
i.e. 8, 16, 24, 32etc.
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(REFP).
Command
Explanation
Applicable models
ES
EP
EH
Flag: None
The state of all PLC inputs and outputs will be refreshed after scanning to END. The
state of inputs is read from external inputs to save in inputs memory. The output
terminals send outputs memory to output device after END command. Therefore, this
command can be used during algorithm process when need to input/output the newest
data.
The state of all inputs and outputs may change immediately after they are scanned.
If the user does not want to wait for the next scan time, the REF command may be
used.
should always be a multiple of 10, i.e. 00, 10, 20, 30 etc., so it should be X0,
X10, Y0, Y10 etc.
(8~256) or not a multiple of 8, an operation error will be generated. The usage range
may be different by various models, please refer to the footnote for detail.
Program
Example
1
When X0 = ON, PLC will read the state of X0~X7 input points immediately and
refreshed. There is no input delay occurs.
X0
REF
X0
K16
7-1
Program
Example
2
REF
Y0
K8
For ES and EP series models, the input and output points processed by this command
Footnote
API
51
REFF
are the I/O points of MPU: X0~X17, Y0~Y17 and n=K8 or K16.
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
n
Note: None
Applicable models
ES
EP
EH
Flag: None
Command
Explanation
will set in
D1020 and D1021 directly and adjust reaction time of X0~X7 and X10~X17
separately.
The operation rules when the input filters of X0~X17 inputs of DVP series PLC adjust
the response time:
When the power of PLC turns from Off to On or execute to END command,
response time is decided by the content value of D1020 and D1021.
During the program, the setting value can be moved to D1020 and D1021by using
MOV command.
The response time can be changed by using REFF command in the execution of
the program. At this time, the response time specified by REFF command will be
moved into D1020, D1021and it will be adjusted again in the next scan.
7-2
X20
REFF
K5
X0
Y1
X20
REFF
K20
X1
Y2
END
When using the interrupt parameters, or high-speed counter, or SPD command (API
Footnote
56), the response time of corresponding input terminals wont delay and its action has
no ralation with this command.
API
52
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D1
D2
n
Note: Operand S should be a multiple of 10, i.e. 00, 10, 20, 30
etc., so it should be X0, X10 etc. and occupies 8
continuous devices.
Operand D1 should be a multiple of 10, i.e. 00, 10, 20, 30
etc., so it should be Y0, Y10 etc. and occupies n
continuous devices
Operand D2 should be a multiple of 10, i.e. 00, 10, 20, 30
etc., so it should be Y0, M0, S0 etc.
Essential condition: n=2~8
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Input Matrix
MTR
MTR
execution
32-bit command
is the head address that specify all inputs of the matrix. Once the input is
specified, a selection of 8 continuous input devices is called as input matrix.
is the head address of transister output Y of the matrix.
7-3
signal being processed. Each set of 8 input signals are grouped into a bank and
there are
from
. The
.
Program
Example
When X0=On, MTR command starts to execute. The external 2 banks, total 16
devices are read by order and the result are stored in the internal relay M10~M17,
M20~M27.
M1000
MTR
X40
Y40
M10
K2
The figure below is an example wiring diagram for the operation of MTR command.
The external 2 banks consist of X40~47 and Y40~41 and total 16 devices correspond
to the internal relay M10~M17, M20~M27 are used with MTR command. For a general
precaution to aid successful operation, diodes should be placed after each input
devices. These diodes should have a rating of 0.1A, 50V.
7-4
Input devices
M21
X41
M10
M22
X42
M11
M23
X43
M12
M24
X44
M13
M25
X45
M14
M26
X46
M15
M27
X47
M16
M17
COM X40
X41
X42
X43
X44
X45
X46
X47
COM Y40
Y41
Y42
Y43
Y44
Y45
Y46
Y47
When output Y40 is ON, only those inputs in the first bank are read. These result are
stored in auxiliary coils M10~M17. The second step involves Y40 going OFF and Y41
coming ON and this time only inputs in the second bank are read. These results are
stored in M20~M27.
Read input signal in the first bank
Y40
Y41
4
25ms
7-5
HSCS
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: Operand S2 should be C235~C240, C241~C244,
C246~C249, C251~C254 or available high-speed
counters, please refer to the footnote for details.
The usage range of operand D: I010 to I060 can be set,
also can use index register E, F to modify.
There is no 16-bit command for API 53, only 32-bit
command DHSCS is available.
Refer to each model specification for usage range.
In ES and EP series models, operand S2 and D cannot use
index register E, F to modify.
Command
Explanation
: Compare value
16-bit command
Applicable models
ES
EP
EH
DHSCS
execution
Flag: M1150~M1333. Refer to the
footnote for details.
M1289~M1294. High-speed
counter interrupt disabled
flags in EH series models.
Refer to the program example
3 below.
: Compare
result
All high-speed counters use an interrupt process, therefore, all compare result devices
are updated immediately.
HSCS command compares the current value of the selected high-speed counter
against a selected comapre value
changes to a value equal to
and the present value of high-speed counter are equal, the compare result will
immediately output to the external inputs Y0~Y17, and other Y devices will be affected
by the scan cycle. However, M, S devices are immediate output, not being affected by
the scan cycle.
Program
Example
1
After PLC perform the RUN command, if M0=On, DHSCS command starts to operate.
Y10 will ON immediately when C235s present value stepped from 99100 or 101
100 and be ON constantly.
M1000
DCNT
C235
K1000
M0
DHSCS
7-6
K100
C235
Y10
On immediately
DCNT
C249
K100
DHSCS
K100
C249
SET
Y17
Y10
ON immediately
C249
Program
Example
3
7-7
C251
K1000
DHSCS
K100
C251
I010
FEND
M1000
I010
Y1
IRET
END
interrupt inhibit
flag
M1289
M1290
M1291
Interrupt pointer
I Number
I040
I050
I060
The ouput contact of high-speed counter and the compare output of DHSCS (API 53)
command, DHSCR (API 54) command and DHSZ(API 55) command are all activated
Footnote
when there are counted inputs. If using data operation command, such as DADD,
DMOVetc. commands to change the present value of high-speed counter equal to
the setting value, there is comparsion will be set or output because there is no counted
inputs.
High-speed counter provided in ES series models: total counting frequency is 30 KHz.
Type
Input
X0
X1
X2
X3
U:
D:
1-phase 1 input
1-phase 2 inputs
2-phase inputs
C235 C236 C237 C238 C241 C242 C244 C246 C247 C249 C251 C252 C254
U/D
U/D
R
U/D
U/D
U/D
R
U/D
Increasing input
Decreasing input
U/D
R
A:
B:
U
D
A phase input
B phase input
U
D
R
U
D
R
S
A
B
S:
R:
A
B
R
A
B
R
S
Start input
Reset input
1. Input point X0 and X1 can plan to be higher speed counter and 1-phase can be up
to 30KHz. But total counting frequency of these input points should be less than or
equal to total frequency 30KHz. If counting input is A/B phase signal, frequency will
be four times of counting frequency. Therefore, counting frequency of A/B phase is
almost 7KHz.
2. In ES series models, DHSCS and DHSCR command can not be used more than 4
times.
7-8
1-phase 2
inputs
1-phase 1 input
2-phase inputs
C235 C236 C237 C238 C239 C240 C241 C242 C244 C246 C247 C249 C251 C252 C254
U/D
U/D
R
U/D
U/D
U/D
R
U/D
R
U/D
U
D
U
D
R
U
D
R
S
A
B
A
B
R
A
B
R
S
U/D
U/D
Increasing input
A:
A phase input
S:
Start input
Decreasing input
B:
B phase input
R:
Reset input
1. Input point X0 and X1 can plan to be higher speed counter and 1-phase can be up
to 30KHz. But total counting frequency of these input points should be less than or
equal to total frequency 30KHz. If counting input is A/B phase signal, frequency will
be four times of counting frequency. Therefore, counting frequency of A/B phase is
almost 7KHz.
2. Input X5 has two functions.
3. In EP series models, DHSCS, DHSCR and DHSZ command can not be used more
than 6 times.
High-speed counter provided in EH series models:
1. Program interrupt type 1-phase high-speed counter, C235~C240: general counting
frequency is up to 10KHz, maximum total counting frequency is 20 KHz.
2. DVP-EH series has four Hardware high-speed counter (hereinafter referred to as
HHSC), HHSC0~3 and available device number for HHSC0~3 are C241~ C254.
Pulse output frequency of each group can reach 250 KHz.
Available device number for HHSC0: C241, C246, C251
Available device number for HHSC1: C242, C247, C252
Available device number for HHSC2: C243, C248, C253
Available device number for HHSC3: C244, C249, C254
Each HHSC can only be specified one time for one device number. Use
DCNT command to specify the HHSC.
7-9
Type
1-phase 1 input
Input C235 C236 C237 C238 C239 C240 C241 C242 C243 C244 C246 C247
X0 U/D
U/D
U
X1
U/D
D
X2
U/D
R
R
X3
U/D
S
S
X4
U/D
U/D
U
X5
U/D
D
X6
R
R
X7
S
S
X10
U/D
X11
X12
R
X13
S
X14
U/D
X15
X16
R
X17
S
U:
D:
2-phase input
A
B
R
S
A
B
R
S
U
D
R
S
A
B
R
S
U
D
R
S
A
B
R
S
Increasing input
A:
A phase input
S:
Start input
Decreasing input
B:
B phase input
R:
Reset input
4. In the program of DVP EH series models, there is no limited using time for
hardware high-speed counter related commands, like DHSCS, DHSCR and
DHSZ. However, there are limited using times for executing the commands
simultaneously. DHSCS, DHSCR command will use one group setting and DHSZ
command will use two groups settings. When these commands are executed
simultaneously, the total used groups settings can not exceed eight groups
settings. If exceeding eight groups settings, system will totalize the used memory
units of the commands which have been scanned and executed first, the others will
be ignored.
7-10
X4
X10
X14
Current value
of counter
U/D
Counting pulse
U
A
HHSC0
HHSC1
X5
X11
X15
Comparison value
reached setting
Comparator
HHSC2
Counting pulse
B
HHSC3
D1226
D1227
D1228
Counting
up/down flag
Counting mode
selection
HHSC0 M1246
M1251
C241
M1241
HHSC1 M1247
M1252
HHSC2 M1248
M1253
C242
M1242
C243
M1243
C244
M1244
HHSC3 M1249
X6
X12
X16
M1264
M1266
M1268
M1270
M1272
M1274
M1276
M1278
AND
OR
M1254
High speed
comparison
command
Comparison value
reached operation
DHSCS
SET/RESET
DHSCR
DHSCZ
Reset signal R
X7
X13
X17
M1265
M1267
M1269
M1271
M1273
M1275
M1277
M1279
AND
OR
Start signal S
I 030 M1291
I 040 M1292
I 050 M1293
I 060 M1294
6. HHSC0~3 all have reset and start signal of external input. Reset signal (R) can be
set by M1272/M1274/M1276/M1278 (belong to HHSC0 ~3) and start signal can be
set by M1273/M1275/M1277/M1279 (belong to HHSC0 ~3). When using
high-speed counter, if do not use the external signal input of R and S, you can set
M1264/M1266/M1268/M1270 and M1265/M1267/M1269 /M1271 as TRUE. Close
the operation of the input signal and the corresponding external inputs can be used
as general inputs. Please refer to the above example figure for usage.
7. Select counter modes
High-speed conter of ES / EP series is 2-phase 2 inputs counter mode and set by
special device D1022 with four double frequency modes. The content value of
register D1022 is loaded at the first scan time when PLC controller switch from
Stop to Run status. (Only V5.5 and above of DVP-ES series MPU support this
function)
Device No.
D1022
D1022=K1
D1022=K2
D1022=K4
Function Explanation
Use counting method of counter to set
double frequency
Select (normal frequency) mode
Select (double frequency) mode
Select (4 times frequency) mode
7-11
Signal Diagram
1
(normal frequency)
2
(double frequency)
2-phase 2 inputs
A-phase
B-phase
Counting up
Counting down
A-phase
B-phase
Counting up
Counting down
A-phase
B-phase
Counting up
Counting down
According to the different type of counter modes, HHSC 0~3 of EH series models can set
normal, double, thriple and four times these four frequency modes by using special
device D1225 to D1228:
Counter mode
Setting value
Type
of special D
0
(normal
frequency)
1-phase
1 input
1
(double
frequency)
0
(normal
frequency)
1-phase
2 inputs
1
(double
frequency)
7-12
Signal Diagram
Counting up(+1)
Counting down(-1)
U/D
U/D FLAG
U/D
U/D FLAG
U
D
U
D
Signal Diagram
Counting up(+1)
Counting down(-1)
A
B
A
B
A
B
A
B
U/D FLAG are special M device, M1241~M1244 and each indicates the setting flag of
C241~C244 counting up and down.
Related flags and special register of high-speed counter:
Flag
M1150
M1151
M1152
M1153
M1235 ~ M1244
M1246 ~ M1249
M1251 ~ M1254
M1260
M1261
M1264
Function Explanation
Announce that DHSZ command is used as multi groups setting
value compare mode
DHSZ command multi groups setting value compare mode
execution completed
Announce that DHSZ command is used as frequency control
mode
Frequency control mode execution completed
Specify counting direction of C235 ~ C244 high-speed counter
When M12=Off, C2 counting up
When M12=On, C2 counting down
Monitor counting direction of C246~C249, C251~C254
high-speed counter
When C2 counting up, M12=Off.
C2 counting down, M12=On.
X5 is the reset input signal of all high-speed counters
High-speed compare flag of DHSCR command
HHSC0 reset signal end (R) external control signal input contact
disable
7-13
Flag
M1265
M1266
M1267
M1268
M1269
M1270
M1271
M1272
M1273
M1274
M1275
M1276
M1277
M1278
M1279
M1289
M1290
M1291
M1292
M1293
M1294
M1312
M1313
M1314
M1315
M1316
M1317
M1320
M1321
M1322
M1323
M1324
M1325
M1328
M1329
M1330
M1331
M1332
M1333
7-14
Function Explanation
HHSC0 start signal end (S) external control signal input contact disable
HHSC1 reset signal end (R) external control signal input contact disable
HHSC1 start signal end (S) external control signal input contact disable
HHSC2 reset signal end (R) external control signal input contact disable
HHSC2 start signal end (S) external control signal input contact disable
HHSC3 reset signal end (R) external control signal input contact disable
HHSC3 start signal end (S) external control signal input contact disable
HHSC0 reset signal end (R) internal control signal input contact
HHSC0 start signal end (S) internal control signal input contact
HHSC1 reset signal end (R) internal control signal input contact
HHSC1 start signal end (S) internal control signal input contact
HHSC2 reset signal end (R) internal control signal input contact
HHSC2 start signal end (S) internal control signal input contact
HHSC3 reset signal end (R) internal control signal input contact
HHSC3 start signal end (S) internal control signal input contact
High-speed counter interrupt, I010 masked
High-speed counter interrupt, I020 masked
High-speed counter interrupt, I030 masked
High-speed counter interrupt, I040 masked
High-speed counter interrupt, I050 masked
High-speed counter interrupt, I060 masked
C235 Start input control
C236 Start input control
C237 Start input control
C238 Start input control
C239 Start input control
C240 Start input control
C235 Reset input control
C236 Reset input control
C237 Reset input control
C238 Reset input control
C239 Reset input control
C240 Reset input control
C235 Start/Reset enable control
C236 Start/Reset enable control
C237 Start/Reset enable control
C238 Start/Reset enable control
C239 Start/Reset enable control
C240 Start/Reset enable control
Special
register
D1022
D1150
D1151
D1152
(lower-bit)
D1153
(upper-bit)
D1225
D1226
D1227
D1228
D1225 ~
D1228
API
54
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: Operand S2 should be C235~C240, C241~C244,
C246~C249, C251~C254. Please refer to the footnote of
API 53 DHSCS command for details.
Operand D uses the same counter as S2 operand.
There is no 16-bit command for API 54, only 32-bit
command DHSCR is available.
Refer to each model specification for usage range.
In ES and EP series models, D operand cannot use C
device.
In ES and EP series models, S2, D operand cannot use
index register E, F to modify.
Command
Explanation
Applicable models
ES
EP
EH
HSCR
Bit devices
X Y M S
Function Explanation
: Compare value
16-bit command
DHSCR
execution
Flag: M1150~M1333. Refer to the
footnote of API 53 DHSCS
command for details.
M1261. High-speed counter
external reset mode selection.
ES and EP series models
doesnt support. Refer to the
footnote for details.
: Compare
result
HSCR command compares the current value of the selected high-speed counter
against a selected comapre value
changes to a value equal to
7-15
and the present value of high-speed counter are equal, the compare result will
immediately output to the external inputs Y0~Y17 (specified Y output will be reset),
and other Y devices will be affected by the scan cycle. However, M, S devices are
immediate output, not being affected by the scan cycle.
Program
Example
1
When M0=On and C251s present value stepped from 99100 or 101100, Y10 will
be set Off.
When C251s present value change from 199 to 200, the contact C251 will be On and
force Y0=On, but there will still be a program scan time delay output.
Y10 is status immediately reset device when specified counter reach. It also can be
used to specify the same number high-speed counter. Please refer to the program
example 2.
M1000
DCNT
C251
K200
DHSCR
K100
C251
SET
Y0
M0
Y10
C251
Program
Example
2
When specifing the same number high-speed counter, the current value of high-speed
counter C251 will change from 999 1000 or 1001 1000 and C251 contact will be
reset to Off.
M1000
DCNT
C251
K200
DHSCR K1000
C251
C251
1000
200
output
C251 contact
Footnote
7-16
DHSCR
K0
C251
Y10
X10
M1261
API
55
HSZ
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
S
D
Note: Operand S1 should be equal to or smaller than operand S2
(S1 S2)
Operand S2 should be C235~C240, C241~C244,
C246~C249, C251~C254. Please refer to the footnote of API
53 DHSCS command for details.
Operand D occupies 3 continuous devices.
There is no 16-bit command for API 55, only 32-bit command
DHSZ is available.
Refer to each model specification for usage range.
In EP series models, operand D cannot use index register E,
F to modify.
Command
Explanation
16-bit command
DHSZ
execution
Flag: M1150~M1333. Refer to the
footnote of API 53 DHSCS
command.
M1150, M1151. DHSZ command
execute multi devices comparison
mode. Refer to the program 3 below.
EP series models do not support
these flags.
M1152, M1153 DHSZ command has
been used as frequency control
mode. Refer to the program 4 below.
EP series models do not support
these flags.
Applicable models
ES
EP EH
(S1 S2).
7-17
DHSZ
K1500
K2000
C246
Y0
Y0
When current value of C246 < K1500, Y0On
Y1
When K1500 < current value of C246 < K2000, Y1=On
Y2
When current value of C246 > K2000, Y2=On
When using DHSZ command to control and stop high/low speed, C251 is AB phase
Program
Example
2
high-speed counter. There will be comparison value output of DHSZ command only
when counting pulse is stored in C251. Therefore, even the counting current value is
0, Y10 will not be On.
When X10=On, DHSZ command force Y10=On when counting current value
K2,000. In order to improve this problem, use DZCPP command to compare C251
against and K2,000 when the program RUN at the beginning. When counting current
value K2,000, Y10=On and DZCPP command is Pulse execution command.
Command DZCPP only can be executed ONCE in program and Y10 will be still be On.
When drive contact X10=Off, Y10~Y12 will be reset to Off.
X20
RST
C251
ZRST
Y10
Y12
DCNT
C251
K10000
DZCPP
K2000
K2400
C251
Y10
DHSZ
K2000
K2400
C251
Y10
M1000
X10
7-18
Speed of variable
speed rotational
equipment
0
X10
high speed
forward
Y10
low speed
forward
Y11
Stop
Y12
current value of
C251 counter
2000
2400
0
When using the multi groups setting value comparison mode of DHSZ command, if
Program
Example
3
be data register D and can be modified by index register E, F. But the number modified
by index register E, F is unchanged after the command has been executed.
is
defined as the data groups of comparison data. It only can be K1~K128 or H1~H80
and also can be can be modified by index register E, F. After the command has been
executed, it is disabled to change this value.
only can be M1150 and can be modified by index register E, F. But if it is not M1150,
then
will be disabled.
The comparison table of high-speed counter consists of the head number of register
specified by
Please input the setting value of each register before the command being executed.
When current value of C251 high-speed counter specified by
is equal to the
setting value of (D1, D0), output Y specified by D2 will be reset to Off (D3=K0) or On
(D3=K1) and latched. All of output Y use interrupt operation.
7-19
DHSZ
D0
Comparison table
32-bit comparison data
High word
Low word
D1 (K0)
D0 (K100)
D5 (K0)
D4 (K200)
D9 (K0)
D8 (K300)
D13 (K0)
D12 (K400)
K4
C251
Number of output
Y
D2 (K10)
D6 (K11)
D10 (K10)
D14 (K11)
K10:Y10
K11:Y11
M1150
On/Off
indication
D3
(K1)
D7
(K1)
D11 (K0)
D15 (K0)
K0:Off
K1:On
Table counting
register D1150
0
1
2
3
01230
Cyclic scan
C251
current value
400
300
200
100
Y10
Y11
M1151
D1050
7-20
3
0
Program
Example
4
Function Explanation
Announce that DHSZ command is used as multi groups setting
value compare mode
For DHSZ command, Multi groups setting value compare mode
execution completed
Function Explanation
For DHSZ command, Table index of DHSZ Y output
be data register D and can be modified by index register E, F. But the number modified
by index register E, F is unchanged after the command has been executed.
is
defined as the data groups of comparison data. It only can be K1~K128 or H1~H80
and also can be can be modified by index register E, F. After the command has been
executed, it is disabled to change this value.
only can be M1152 and can be modified by index register E, F. But if it is not M1152,
then
will be disabled.
This function of this command only can be used ONCE in program. In EP series
models, this function does not provided. For EH series models, it only can be used in
hardware high-speed counters C241~C254. Please input the setting value of each
register before the command being executed.
When the current value of C251 specified by
upper- and lower-limit of (D1, D0), the setting value of (D3, D2) will be converted to
pulse output frequency of DPLSY command. Then, the second groups in the
comparison table will continue to execute. After the comparison operation of all groups
are completed, M1153=On for one scan cycle and D1151 will be reset to 0, then jump
back to the first groups to execute.
If desiring to stop the execution at the last group, Please set the content of the last
group as KO.
When the drive contact X10 turns Off, the operation of the command will be
interruptted and the content of table counting register D1151 will be reset to 0.
7-21
D0
PLS
M0
DPLSY
D1152
K5
C251
K0
Y0
M1152
M0
Comparison table
32-bit comparison data
High word
Low word
D1 (K0)
D0 (K100)
Table counting
register D1151
0
D5
(K0)
D4
(K200)
D7, D6
(K10,000)
D9
(K0)
D8
(K300)
D11, D10
(K15,000)
D13 (K0)
D12 (K400)
D15, D14
(K6,000)
D17 (K0)
D16 (K0)
D19, D18
(K0)
4
01234
Cyclic scan
C251 500
current value
400
300
200
pulse output frequency
100
0
(Hz)
15000
10000
5000
0
M1153
D1051
7-22
Function Explanation
Announce that DHSZ command is used as frequency control
mode
For DHSZ command, frequency control mode execution
completed
Function Explanation
Table index changed by DHSZ D value
DHSZ command saves table counting register value that read
in sequence from pulse output frequency of each group in
D1153 and D1152.
Pulse numbers of DPLSY command output
DMOVP K10000
D6
DMOVP K15000
D10
DMOVP
K6000
D14
DMOVP
K0
D18
DMOVP
K100
D0
DMOVP
K200
D4
DMOVP
K300
D8
DMOVP
K400
D12
DMOVP
K0
D16
DHSZ
D0
K5
C251
PLS
M0
DPLSY
D1152
K0
Y0
M1152
M0
frequency
pulse output
number
Please do not change the setting value in this comparison table during the execution
of DHSZ command.
When the program has been executed to END command, the specified data will be
operated shown as the above example program. Therefore, DPLSY command should
be executed after the execution of DHSZ command.
7-23
Bit devices
X Y M S
Applicable models
ES
EP
EH
Speed Detection
SPD
Word devices
KnX KnY KnM KnS T C D E F
SPD
execution
S1
S2
D
32-bit command
Command
Explanation
: Detection
result
: Specify the input of external pulse
Pulse inputs of each series models
ES series models
Models
(V5.7 and above) and EP series models
Available
X1, X2
inputs
EH series models
X0~X3
occupies 5 registers,
pulse,
+3,
+1,
EH series models
X0/X1 (250KHz)
X2/X3 (10KHz)
When using this command in EH series models, the pulse frequency of external input
X0~X3 and the frequency of hardware high-speed counter are the same and both of
them all can reach 250KHz.
This command is mainly used to obtain a proportional value of rotation speed. The
result
and rotation speed are in proportion. The following equation can used to
(ms)
If one of X0~X3 is specified, the specified device can not be used as the pulse input of
high-speed counter or external interrupt signal.
7-24
Program
Example
K1000
D0
X7
X1
D2: current
value
D0: detection
value
D2: content
value
1000ms
1000ms
1000
D4: content
value
In ES series models (V5.7 and above), if X1 or X2 is used in SPD command, then the
Footnote
API
57
related high-speed counters or external interrupts I101, I201 can not be used.
Pulse Output
PLSY
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
S1
S2
D
Note: For the usage range of operand S1, S2 and D, please refer to
the command explanation for details.
Refer to each model specification for usage range.
In ES series models, PLSR command can be used twice but
the output cannot be repeat.
Applicable models
ES
EP
EH
PLSY
execution
DPLSY
execution
Flag: M1010~M1345. Refer to the
footnote.
7-25
: Pulse output
ES series models
Output
1~10,000Hz
frequency range
EP series
models
EH series
1~32,000Hz
1~200,000Hz
will
.
When using PLSY command in progam, the outputs of PLSY command, API 58 PWM
command and API 59 PLSR command cannot be the same.
In EP/ES series models, after Y0 pulse output completed, M1029 will be turned On,
after Y1 pulse output completed, M1030 will be turned On. When PLSY command is
Off, M1029 or M1030 will be turned Off.
In EH series models, Y0 and Y1 pulse output completed, M1029 will be turned On,
after Y2, Y3 pulse output completed, M1030 will be turned On. When PLSY command
is Off, M1029 or M1030 will be turned Off.
The execution completed flag M1029, M1030 should be clear by user after the
execution of the command has been completed.
When command PLSY has been executed, Y start to output pulse. At this time, the
output will not be affected if
command PLSY.
The ratio of Off TIME and On TIME of the pulse output is 1:1.
7-26
Program
Example
When X0=On, the pulse of 1KHz for 200 times is generated from output Y0, after the
pulse has been completed, M1029=On trigger Y10=On.
When X0=Off, pulse output Y0 immediately stop. When X0 turns On again, the first
pulse start to output.
X0
PLSY
K1000
K200
Y0
M1029
Y100
0.5ms
Output Y0
200
1ms
Footnote
Flags description:
M1010: In EH series MPU, when M1010= On, Y0, Y1 and Y2, Y3 will output pulse
while END command is executed. When output starts, M1010 will
automatically turn Off.
In EP/ES series MPU, when M1010=On, Y0 can output limitless continuous
pulses. When M1010=Off, the pulse output numbers of Y0 are decided by
.
M1023: In EP/ES series MPU, when M1023=On, Y1 can output limitless continuous
pulses. When M1023=Off, the pulse output numbers of Y1 are decided by
.
M1029: In EH series MPU, M1029= On after Y0, Y1 pulse output complete.
In EP/ES series MPU, M1029= On after Y0 pulse output complete.
M1030: In EH series MPU, M1030= On after Y2, Y3 pulse output complete.
In EP/ES series MPU, M1030= On after Y1 pulse output complete.
M1078: In EP/ES series, Y0 pulse output stop.
M1079: In EP/ES series, Y1 pulse output stop.
M1258: In EH series MPU, (PWM command) Y0, Y1 pulse output signal exchange.
M1259: In EH series MPU, (PWM command) Y2, Y3 pulse output signal exchange.
M1334: In EH series MPU, CH0 pulse output stop.
M1335: In EH series MPU, CH1 pulse output stop.
M1336: In EH series MPU, CH0 pulse output indication flag.
M1337: In EH series MPU, CH1 pulse output indication flag.
M1338: In EH series MPU, CH0 offset pulse start flag.
M1339: In EH series MPU, CH1 offset pulse start flag.
M1340: In EH series MPU, the interrupt (I110) occur after CH0 pulse output complete.
M1341: In EH series MPU, the interrupt (I120) occur after CH1 pulse output complete.
In EH series MPU, the interrupt (I130) occur simultaneously when CH0 pulse
M1342:
transmit.
In EH series MPU, the interrupt (I140) occur simultaneously when CH1 pulse
M1343:
transmit.
M1344: In EH series MPU, CH0 compensation pulse start flag.
M1345: In EH series MPU, CH1 compensation pulse start flag.
7-27
7-28
D
Output device
Y0~Y3
0~200KHz
0~2,147,483,647
K0: No output
Kn: Specified
frequency output
M1030
M1334
R/W
M1335
R/W
M1336
M1337
M1338
R/W
D1328, D1329
M1339
R/W
D1330, D1331
M1340
R/W
M1341
R/W
M1342
R/W
M1343
R/W
M1344
R/W
M1345
R/W
M1347
R/W
M1348
R/W
D1346, D1347
7-29
PWM
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: For the usage range of operand S1, S2 and D, please refer
to the command explanation.
The content value of operand S1 should be smaller than the
content value of S2.
Refer to each model specification for usage range.
In ES / EP series models, command PWM only can be used
ONCE in program.
Command
Explanation
Applicable models
ES
EP
EH
PWM
execution
32-bit command
can be specified
PWM output
EH series models
Y1
Y0, Y2
PWM command can be used TWICE in the program of EH series models. PWM
command can be used ONCE in the program of EP/ES series models.
The output cannot be the same as the output of API 57 PLSY, API 59 PLSR command
while PWM command is used in program.
When PWM command has been executed, the pulse output width
output cycle
If
>
and pulse
is 0, there is
, the pulse output
Program
Example
When X0=On, Y1 output the following pulse. When X0=Off, output Y1 will also turn
Off.
X0
PWM
K1000
K200
Y1
t=1000ms
Output Y1
T=2000ms
7-30
Flags description:
M1010:
In EH series MPU, when M1010= On, Y0, Y1 and Y2, Y3 will output pulse
while END command is executed. When output starts, M1010 will
automatically turn Off.
M1067:
M1070:
In EP/ES series MPU, When PWM command output Y1, the pulse unit will
exchange. When M1070=On, the pulse unit is 100s, when M1070=Off, the
pulse unit is 1ms.
In EH series MPU, when the first pulse output group of PWM command
output Y0, the pulse unit will exchange. When M1070=On, the pulse unit is
100s, when M1070=Off, the pulse unit is 1ms.
M1071:
In EH series MPU, when the first pulse output group of PWM command
output Y2, the pulse unit will exchange. When M1071=On, the pulse unit is
100s, when M1071=Off, the pulse unit is 1ms.
M1258:
M1259:
M1334:
M1335:
M1336:
M1337:
When several high-speed pulse output commands (PLSY, PWM, PLSR) use Y0 to
output pulse in one program and simultaneously been executed in the same scanning
cycle, PLC will perform the command which has fewest step numbers.
Explanation of PWM command and the related device of EH series models.
Functions of
EH series MPU
API
59
Device
No.
M1010
M1070
M1071
M1258
M1259
M1334
M1335
M1336
M1344
Related setting
device
Attribute
PLSR
Bit devices
X Y M S
Data
Format
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R
R/W
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
S3
D
Note: For the usage range of operand S1, S2 and D, please refer
to the command explanation.
Refer to each model specification for usage range.
In ES series models, PLSR command can be used TWICE
in program but the output can not be the same.
Applicable models
ES
EP
EH
PLSR
execution
DPLSR
execution
Flag: M1029, M1030. Execution
Completed flag.
7-31
90000
If the setting is smaller than the result of the above-mentioned equation, the
acceleration/deceleration time will be greater, and if the setting is smaller than the
9000/
3. Maximum setting of the accel/decel time could be obtained from the following
equation.
818
4. Number of the accel/decel speed variation steps is fixed to be 10. If the input
acceleration/deceleration time is greater than the maximum setting, the maximum
setting will be treated as its regular setting. If the setting is smaller than the
minimum setting, the minimum setting will be treated as its regular setting.
7-32
,a
maximum frequency
.
Even user change
or
has been
completely output, M1029=On. After the pulse numbers of the second output pulse
group (Y0, Y1) set by
command PLSR is activated again, M1029 or M1030 will turn to 0, then turn to 1 after
the PLSR command has been completed.
The output pulse of the first output group (Y0, Y1) and the cueent value of he second
output group (Y2, Y3) are stored in the special regisers D1336~D1339.
During the acceleration of each step, the pulse numbers (each frequency x time) may
not all be integer, but the output operation of PLC is conducted in whole integer
number. Therefore, the time of each interval may not be the same and has some
deviation. The offset is determined by the frequency value and the discarding decimal
point value. In order to ensure the output pulse numbers are correct, PLC will fill the
insufficiency pulse numbers to the last interval.
Program
Example
When X0=On, the maximum frequency of command PLSR is 1,000Hz. The quantity of
total pulse numbers D10, accel/decel time is 3,000ms and pulses output from output
Y0. The pulses are output and the output frequency is 1,000/10 Hz every time. The
time of output pulse of each frequency is fixed as 3,000/9.
When X10 is OFF, output will be interrupted, and when turned ON again, counting of
the pulse will be counted from 0.
X0
PLSR
K1000
D10
K3000
Y0
7-33
1010
9
8
7
Output pulses7
6
4
3
10-step
variations
10-step
variations
5
4
3
16-bit command:110~32,767PLS
32-bit command:110~2,147,483,647PLS
2
1
2
1
Accel time
Decel time
below 5000ms
below 5000ms
Time(Sec)
The output cannot be the same as the output of API 57 PLSY, API 58 PWM command
Footnote
X0
Functions of
EH series MPU
PLSR
K1000
D10
K3000
Y0
The speed range for the pulse of this command is 10~200,000Hz. And if the settings
for the high speed and the accel/decel time exceed this range, use the allowable
setting within this range for operation.
Command Explanation
S2
S3
Accel/Decel
Explanation Max. frequency
Total pulse quantity
Time
16-bit 10~32,767Hz
110~32,767
Range
1~5000ms
32-bit 10~200KHz
110~2,147,483,647
K0: Continuous pulse
Flag:
K0: No output
output
Definition
M1067
Kn: Specified
Kn: Specified pulse
M1068
frequency output
output
Operand
S1
D
Output device
Y0~Y3
Refer to the
setting of
D1220, D1221
Frequency F
Accel time
1~5000ms
7-34
Decel time
1~5000ms
Related
setting device
Content
M1010
R/W
M1029
M1030
M1334
R/W
M1335
R/W
M1336
M1337
M1067
R/W
M1068
D1068
F0 = D1340 if F0 + 60 > S1 or F0 = 0 F0 =
S3 <
S3
(30 S 2 )
(30 F0 + 29 S1 )
S1
..(1)
60
..(2)
600000
..(3)
F0
Step 2: Calculates the interval of the acceleration of each step, FG by using the following
equation. The interval of each step are the same: FG =
S1
..(4)
59
7-35
S2
2 (5)
2
F1 = F0 + FG ,
Fi = Fi 1 + FG (6)
S3
59
(7)
Step 5: Entering the result of (5), (6), (7) to the following equation can get the result as
59
follows:
F T
i =0
PG .. (8)
Step 6: In the equation of (8), if the value of the calculation result has been greater than the
PG value before item 59 has been calculated.
In EH series models, the commands that are related to acceleration and deceleration
all can use the above equations.
The parameters of command PLSR must be input before the command has been
executed.
All acceleration and deceleration commands are with brake function. When the PLC
acceleration is executed but the switch contact is Off suddenly, the brake function is
activated and PLC will decelerate in the same slope of acceleration speed.
Frequency F
S1
F0
Time T
API
60
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D1
D2
Note: Operand S will occupy 8 continuous devices.
The usage range of operand D1 and D2 is S20~S899 and
D2D1.
IST command only can be used one time in program.
Refer to each model specification for usage range.
7-36
Applicable models
ES
EP
EH
Manual/Auto Control
IST
IST
execution
32-bit command
Flag: M1040~M1047.
Refer to following for detail.
: The
: The
greatest number for the designated-status step point under the auto mode.
The IST is a convenient command made specifically for the initial state of the step
ladder control procedure to accommodate the special auxiliary relay to the convenient
auto control command.
Program
Example
1
M1000
IST
X10
S20
S60
automatically.
M1040: Movement inhibited
Program
Example
2
between
to
is On or M1043=On
Right-limit X2 Right-limit X3
(big balls)
(small balls)
Y0
Y3
Y2
Y1
Upper-limit X5
Big/small
sensor X0
Big
Small
7-37
Power stop
Raise
Shift
Collect
balls robot arm to right
X20
X22
X24
Step X12
Shift
Release Lower
balls robot arm to left
X21
X23
One cycle
operation X13
Continuous
operation X14
Manual
operation X10
X25
X0
X1 Y4
M1044
M1000
IST
X10
S20
S80
SET
Y4
Collect balls
RST
Y4
Release balls
X21
X22 Y1
Y0
X23 Y0
X24 X4 Y3
X25 X4 Y2
Y1
Y2
Shift to right
Y3
Shift to left
Condition interlock
Raise robot arm to the
upper-limit (X4 is ON)
X4
S11
X1
S12
7-38
RST
Y4
Release balls
RST
Y1
Y0
RST
Y2
Y3
SET
M1043
RST
S12
SET
S10
RST
Y4
Release balls
RST
Y1
Y0
X4
S11
S
SET
S11
RST
Y2
S12
Y3
X1
SET
S12
S
SET
M1043
RST
S12
Y1
X5
X0
X5
X0
S30
T0
S31
X4
S32
SET
Y4
TMR
T0
S40
K30
Y0
X2
T1
S42
Y2
X2
Y4
TMR
T1
K30
Y0
S41
X4
SET
X3
Y2
X3
S50
Y1
X5
S60
T2
S80
Y4
TMR
T2
K30
Y0
S70
X4
RST
X1
Y3
X1
S2
7-39
SET
S20
Y1
X5 X0
SET
S30
SET
S40
SET
Y4
Collect balls
TMR
T0
K30
SET
S31
X5 X0
S30
S
T0
S31
S
Y0
X4
SET
S32
S
S32
X2
Shift to right
Y2
X2
S40
S
SET
S50
SET
Y4
Collect balls
TMR
T1
K30
SET
S41
T1
S41
S
Y0
X4
SET
S42
S
S42
X3
Y2
Shift to right
X3
SET
S50
S
S50
Y1
X5
S60
S
SET
S60
RST
Y4
Release balls
TMR
T2
K30
SET
S70
T2
S70
S
Y0
X4
SET
S80
S
X1
Y3
X1
S80
Shift to left and shift to
the left-limit (X1 is On)
S2
RET
END
7-40
Flag explanation:
M1040: step point movement inhibited. When M1040=ON, all movements of the step point
are inhibited.
1. Manual operation mode: M1040 keeps being ON.
2. Zero point return mode/one cycle operation mode: During the time of pressing
STOP button and pressing START button again, M1040 will keep being ON.
3. Step operation mode: M1040 keeps being ON, and will only be OFF when the
START button is pressed.
4. Continuous operation mode: When PLC goes from STOPRUN, M1040 keeps
being ON, and will be OFF when the START button is pressed.
M1041: Step point movement start: the special auxiliary relay that reflects the movement of
the primary step point (S2) to the next step point.
1. Manual operation mode/Zero point return mode: M1041 keeps being OFF.
2. Step operation mode/One cycle operation mode: M1041 will only be OFF when
the START button is pressed.
3. Continuous operation mode: Keeps being ON when the START button is pressed,
and keeps being OFF when the STOP button is pressed.
M1042: START pulse: Only one pulse will be sent out when the button is pressed.
M1043: Zero point return complete: Once M1043 =ON is driven, it means that the RESET
motion has been executed.
M1044: Conditions of the origin: Under the continuous operation mode, conditions of the
origin, M1044, have to be driven to ON to execute the motion of initial step point (S2)
moving to the next step point.
M1045: All output reset inhibit.
If executing conditions: A. from manual control S0 to zero point return S1
B. from auto operation S2 to manual operation S0
C. from auto operation S2 to zero point return S1
1. When M1045=Off and one of S of D1~D2 is ON, step point of SET Y output and
actions will be cleared to Off.
2. When M1045 =On, SET Y output will be reserved and step point during action will
be cleared to Off.
3. If executing from zero point return S1 to manual operation S0, no matter
M1045=On or M1045=Off, SET Y output will be reserved and step point action will
be cleared to Off.
M1046: Setting STL state to On: If one of step point S is On, M1046=On. After M1047 forces
to be On, M1046 will be On once one of S is On. Besides, 8 points numbers before S
is on will be recorded in D1040~D1047.
M1047: STL monitor enabled. When IST command starts executing, M1047 will be forced to
be On and it will be forced to On for each scan time once IST command is still On.
This flag is used to monitor all S.
D1040~D1047: ON state number 1-8 of step point S.
7-41
SER
Bit devices
X Y M S
Applicable models
ES
EP
EH
S1
S2
D
N
Note: If operand S2 uses with device F, it is only available in
16-bit command.
Operand D occupies 5 continuous devices.
The usage of operand n: n=1~256 (16-bit command),
n=1~128 (32-bit command)
Refer to each model specification for usage range.
SER
execution
DSER
execution
Flag: None
Command
Explanation
: Value
: Data
and the
.
,
and
Program
Example
result is stored in D50~D54. If the equal value does not exist, the content of D50~D52
will all be 0.
The data is compared in algebra formate. (-102)
The largest value of all compared data will be record in D53 and the samllest value of
all compared data will be record in D54. When the numbers of largest value and
smallest are more than one, only the numbers of largest value will be recorded.
X0
SER
D10
D0
D50
K10
7-42
D10
D11
D12
D13
D14
D15
D16
D17
D18
D19
88
100
110
150
100
300
100
5
100
500
D0=K100
0
1
2
3
4
5
6
7
8
9
Result
Equal
Equal
Equal
Smallest
Equal
Largest
API
62
4
1
8
7
9
Explanation
The total data numbers of equal value
The number of the first equal value
The number of the last equal value
The number of the smallest value
The number of the largest value
Applicable models
ABSD
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
n
Note: When operand S1 is specified as KnX, KnY, KnM, KnS, K4
should be specified in 16-bit command and K8 should be
specified in 32-bit command.
The usage range of n: n=1~64
Refer to each model specification for usage range.
Command
Explanation
EP
ABSD
execution
32-bit command (17 STEPS)
Continuous
DABSD
execution
Flag: None
ES
: Number of counter
EH
Program
Example
Before executing the ABSD command, use MOV command to write each setting value
into D100~D107 in advance. The content of the even number D is the lower-limit value
and the content of the odd number D is the upper-limt value.
When X0=On, the current value of counter C10 is compared against the upper- and
lower-limit value of D100~D107 four groups. The compared result is showed in
M10~M13.
When X10=Off, the origin On/Off state of M10~M13 will not be changed.
X10
C10
ABSD
D100
RST
C10
CNT
C10
C10
M10
K4
X11
X11
K400
7-43
Output
D100= 40
D101=100
50C10100
M10=On
D102=120
D103=210
120C10210
M11=On
D104=140
D105= 170
140C10170
M12=On
D106=150
D107=390
150C10390
M13=On
When the lower-limit value is higher than the upper-limit value, if the current value of
C10 is higher than the lower-limit value and lower than the upper-limit value
(C10>140), M12=On.
Lower-limit value
Output
D100= 40
D101=100
50C10100
M10=On
D102=120
D103=210
120C10210
M11=On
D104=140
D105= 60
60C10140
M12=Off
D106=150
D107=390
150C10390
M13=On
40
100
M0
120
210
M1
60
140
M2
150
390
M3
0
API
63
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
N
Note: When operand S1 is specified as KnX, KnY, KnM, KnS, K4
should be specified.
In 16-bit command, operand S2 should be C0~C198 and will
occupy 2 continuous counters.
The usage range of operand n: n=1~64
Refer to each model specification for usage range.
7-44
400
INCD
Bit devices
X Y M S
200
Applicable models
ES
EP
EH
INCD
execution
32-bit command
: Number of counter
The INCD command is a multi-step comparison command and usually used in relative
cam control.
The current value of
. Once the
will be reset to 0
+1.
Program
Example
Before executing the INCD command, use MOV command to write each setting value
into D100~D104 in advance. D100=15, ,D101=30, D102=10, D103=40, D104=25.
The current value of counter C10 is compared against the setting value of
D100~D104. Once the current value is equal to the setting value, the current value of
C10 will be reset to 0 and be compared again.
The return times will be stored in C11.
When the content of C11 increase 1, M10~M14 will also change in response. Please
refer to the following timing diagram.
When the comparison of 5 groups data has been completed, the execution completed
falg M1029 will On one scan cycle.
When X0 turns from On to Off, C10 and C11 will all bereset to 0 and M10~M14 all turn
Off. When X0 turns On again, this command will be executed again from the
beginning.
X0
M1013
CNT
C10
K100
INCD
D100
C10
M10
K5
X0
40
30
C10
Current value
15
C11
Current value 0
25
10
30
15
15
4
0 1 0
M10
M11
M12
M13
M14
M1029
7-45
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
D
n
Note: Operand D will occupy 2 continuous devices.
The usage range of operand n: n=0~2
Refer to each model specification for usage range.
It only can use TTMR command eight times in program.
Command
Explanation
Applicable models
ES
EP
EH
Teaching Timer
TTMR
TTMR
execution
32-bit command
Flag: None
: Multiple
setting
The On duration of external button switch is measured and stored in the number of
+1, the measured unit is 100ms periods. The content of
multiplied by
and stored in
measured unit of
measured unit of
+1 in seconds is
Program
Example
1
the
The time that the button switch X0 is pushed (On duration of X0) will be stored in D1, n
is used to specify the multiple of the time and the total bit time is stored in D0. Then the
button switch can be used to adjust the setting value of timer.
When X0 turns Off, the content of D1 will be reset to 0 but the content of D0 is
unchanged.
X0
TTMR
D0
K0
X0
D1
D1
D0
D0
T
pushed time (sec)
T
pushed time (sec)
If On duration of X0 is T seconds, the relation between D0, D1 and n are shown as the
table below.
n
7-46
D0
K0 (unit: s)
1T
D1=D010
10T
D1=D0
K2 (unit: 10 ms)
100T
D1=D0/10
M11
TMR
T1
D101
TMR
T9
D109
BIN
K1X0
TTMR
D200
K0
PLF
M0
MOV
D100
M19
M1000
X10
X10
M0
D200E
For EP series models, it can only use TTMR command eight times in program. If used
Footnote
7-47
Bit devices
X Y M S
Word devices
KnX KnY KnM KnS T C D E F
S
M
D
Note: The operand S: EP series models can use T0~T191, EH
series models can use T0~T199
The usage range of operand m: m=1~32767
Operand D occupies 4 continuous devices.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Special Timer
STMR
: Number of timer
STMR
execution
32-bit command
Flag: None
: Starting
Program
Example
When X10=On, the settting value of the timer T0 specified by STMR command is 5
seconds.
Y0 is the contact of Off-delay: When X10 turns from Off to On, Y0= On. When X10
turns On to Off and delay 5 seconds, Y0=Off.
When X10 turns from On to Off, Y1= On output one time for 5 seconds.
When X10 turns from Off to On, Y2=On output one time for 5 seconds.
When X10 turns from Off to On, Y3= On after delay 5 seconds. When X10 turns from
On to Off, Y3=Off after delay 5 seconds.
X10
STMR
T0
K50
Y0
X10
Y0
5 sec
5 sec
Y1
5 sec
5 sec
Y2
Y3
7-48
5 sec
5 sec
STMR
T10
K50
Y0
X10
Y1
Y2
API
66
ALT
Applicable models
ES
EP
EH
ON/OFF Alternate
Bit devices
X Y M S
5 sec 5 sec
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
ES series models do not support pulse execution command
(ALTP).
Pulse
execution
Flag: None
Command
Explanation
Program
Example
1
: Dentisation device
This command is usually pulse execution command (ALTP).
When X0 turns from Off to On for the first time, Y0=ON. When X0 turns from Off to On
for the second time, Y0=OFF.
X0
ALTP
Y0
X0
Y0
7-49
The ALT command is a command, which use one switch to control start and stop mode.
In the beginning, M0=Off, so Y0=On, Y1=Off. When X10 is activated for the first time,
M0=ON, Y1=ON and Y0=OFF. When X10 is activated for the second time, M0=OFF,
Y0=ON, Y1=OFF.
X10
ALT
M0
M0
Y0
M0
Y1
Program
Example
3
Output Y will flash. When X10= On, T0 will generate a pulse every two seconds and
output Y0 will be switching between On and Off mode depending on the pulse of T0.
X10
T0
TMR
T0
K20
T0
ALTP
API
67
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
D
N
Note: The usage range of operand n: n=1~32767
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Ramp Signal
RAMP
Bit devices
X Y M S
Y0
RAMP
execution
32-bit command
: Current
: Scan times
This command is used to get a ramp signal. A ramp signal has a strong connection
with linear and scan time. Therefore, must fix the scan time before using this RAMP
command.
Write the start setting value of ramp signal to D10 and end setting value of ramp signal
to D11 in advance. When X0 is On, the setting value is forwarding from D10 to D11
(setting value in D10 will be increased) and the proceeding time (n= 100 times scans)
is stored in D12.
7-50
the
X10
RAMP
D10
D11
D11
D12
D10
K100
D12
D12
D11
D10
?times scans
D10<D11
?times scans
D10> D11
Footnote
M1026=ON
X10
Starting signal
M1029
X10
Starting signal
D11
D11
D10
M1026=OFF
D12
D10
D12
M1029
7-51
Bit devices
X Y M S
Applicable models
ES
EP
EH
Data Sort
SORT
Word devices
H KnX KnY KnM KnS T C D E F
S
m1
m2
D
n
SORT
execution
32-bit command
Command
Explanation
: Column
: Reference
and
register, the resulting sorted data will be the same as the content of source device
.
An ideal most right number of the head number specified by
is 0.
The data sort will be completed after the SORT command being processed m1 times.
Once the SORT command has been completed, the Flag M1029= On.
Program
Example
7-52
When X0 is On, it starts to sort specified data. After the data sort is completed,
M1029= On. During the execution of the SORT command, do not change the sort
data. If user want to re-sort the data, be sure to turn X0 from Off to On again.
X0
SORT
D0
K5
K5
D50
D100
Data numbers: m1
Row
Students
No.
Chinese
English
Mathematics
Physis and
Chemistry
D01
D590
D1075 D1566
D2079
D12
D655
D1165 D1654
D2163
D23
D780
D1298 D1789
D2290
D34
D870
D1360 D1899
D2350
D45
D995
D1479 D1975
D2469
Column
Data numbers: m1
Row
1
Students
No.
Data numbers: m2
Data Column
2
3
Chinese
English
5
Physis and
Mathematics
Chemistry
D504
D7050
D512
D7163
D521
D7279
D535
D7369
D543
D7490
Data numbers: m1
Row
1
Students
No.
Data Column
3
Chinese
English
5
Physis and
Mathematics
Chemistry
D504
D7050
D512
D7163
D525
D7269
D531
D7379
D543
D7490
7-53
Bit devices
X Y M S
Applicable models
ES
EP
EH
TKY
Word devices
H KnX KnY KnM KnS T C D E F
TKY
execution
S
D1
D2
DTKY
execution
Flag: None
Command
Explanation
external input devices is identified as decimal value of 0 to 9. These ten external input
devices are connected to ten keys respectively. When one of the ten keys is pressed,
the value of decimal numbers from 0 to 9,999 (max. 4 digits in 16-bit command) or from
0 to 99,999,999 (max. 8 digits in 32-bit command) can be inputted and stored in
destination device
. The device
Program
Example
Using this command can specify ten input terminals from X0 to connect to ten keys
which number is from 0 to 9. When X20=On, the command is executed and it will store
the BIN value which is inputted by keys into D0 and M10~M19 is used to store the
condition of that key has been pressed.
X20
TKY
X0
D0
0V
+24V
S/S
M10
X0
X1
X2
X3
X4
X5
X6
X7
X10
X11
PLC
0
number key
overflow
10
10
10
10
BCD value
BIN value
7-54
D0
l
m
X1
X3
X5
k
j
M10
M11
M13
M15
Key output
signal
M20
7-55
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D1
D2
D3
HKY
execution
DHKY
execution
Flag: M1029 execution completed flag
M1167 HKY input mode switch
Please refer to the footnote
Command
Explanation
Applicable models
ES
EP
EH
HKY
: Destination
and
is used to
can
store numbers from 0 to 99,999,999 (max. 8 digits). If the entered number exceeds the
above allowable range, the highest digits will overflow.
Program
Example
X4
HKY
7-56
X10
Y10
D0
M0
10
10
number key
BCD value
overflow
10
10
BCD value
BIN value
D0
M5
M4
M3
M2
M1
M0
COM
X10
X11
X12
X13
COM
Y10
Y11
Y12
Y13
7-57
When this command is executed, 8 times scan cycles is required to read the input
value of keys sucessfully. If the scan cycle is too long or too short, it may cause the key
to input incorrectly. Therefore, user can use the following command to avoid it.
When the scan cycle is too short, the I/O may not response in time and can not
read the key input correctly. At this time, user can fix the scan time to avoid it.
When the cycle is too long, the response of key may become slow. User can avoid
this by writing this command in a time interrupt subroutine and executing this
command in the fix time.
The function of flag M1167:
When M1167=On, HKY command can input hexadecimal value of 0~F.
When M1167=Off, A~F of HKY command are used as function keys.
API
72
DSW
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D1
D2
n
DSW
execution
32-bit command
Command
Explanation
Applicable models
ES
EP
EH
: Number of digits
This command is used to read one or two groups of 4 digits switch through 4 or 8
continuous external input devices from
. When
is 1, only
are read.
Program
Example
The first group of switches consists of X20~X23 and Y20~Y23. The second group of
switches consists of X24~X27 and Y20~Y23. When X10=On, the command starts to
execute. The setting value of the first group of switches are read and converted to BIN
value and stored in D20. The setting value of the second group of switches are read
and converted to BIN value and stored in D21.
X10
DSW
X20
Y20
D20
7-58
K2
X10
operation start
0.1s
0.1s
Y20
Y21
0.1s
0.1s
interrupt
Y22
0.1s
Y23
0.1s
execution com pleted
M1029
BCD digital
switches
10
10
10
10
should connect
a diode (1N4148)
in serial
0V
+24V
S/S
X20
X21
X22
X23
X24
X25
X26
X27
PLC
C
Y20
Y21
0
10
Y22
1
10
Y23
2
10
10
7-59
Footnote
SET
M10
DSW
X20
RST
M10
M10
Y20
D20
K2
M1029
API
73
SEGD
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
S
D
Note: Refer to each model specification for usage range.
ES series models do not support pulse execution command
(SEGDP)
Command
Explanation
Program
Example
ES
EP EH
Flag: None
: Output device after decoding
When X10=On, contents (0~F: 16 bits) of the lower 4 bits (b0~b3) of D10 will be
decoded as readable in the 7-segment display panel for output. The decoding results
will be stored in Y10~Y17.
X10
SEGD
D10
7-60
Applicable models
K2Y10
API
74
Bit
Composition
Combi- of the 7-Step
nation Display Panel
16
bits
Data
Displayed
0000
ON
ON
ON
ON
0001
OFF ON
ON
0010
ON
ON
OFF
ON
ON
OFF
ON
0011
ON
ON
ON
ON
OFF
OFF
ON
0100
OFF ON
ON
OFF OFF
ON
ON
0101
ON
OFF ON
ON
OFF
ON
ON
0110
ON
OFF ON
ON
ON
ON
ON
0111
ON
ON
ON
OFF OFF
ON
OFF
1000
ON
ON
ON
ON
ON
ON
ON
1001
ON
ON
ON
ON
OFF
ON
ON
1010
ON
ON
ON
OFF
ON
ON
ON
1011
OFF OFF ON
ON
ON
ON
ON
1100
ON
OFF ON
ON
ON
OFF
1101
OFF ON
ON
ON
OFF
ON
1110
ON
OFF OFF
ON
ON
ON
ON
1111
ON
OFF OFF
OFF
ON
ON
ON
OFF
ON
ON
ON
OFF
Applicable models
SEGL
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
S
D
n
Note: The usage range of operand n: n=0~7. Please refer to
the footnote.
In EH series models, SEGL command can only be used
twice.
Refer to each model specification for usage range.
Command
Explanation
SEGL
execution
32-bit command
EP
EH
ES
: Start device of
signal
8 or 12 continuous external output points that start from this command
can be
7-61
will decide the numbers of groups of 4 digits of 7-segment display and also
indicate the polaritys of PLC output terminal and 7-segment display input terminal.
The points number of 7-segment display output command that a group of 4 digits use
is 8 points and 2 groups of 4 digits use are 12 points.
Scan output terminal will circulate in sequence when this command executes. The
drive contact will be changed from Off to On and scan output execute again.
Program
Example
When X10=ON, command will start to execute. 7-segment display scan loop is
composed of Y10~Y17. The value of D10 will be converted to BCD code and send to
the first group of 7-segment display to display. The value of D11 will be converted to
BCD code and send to the second group of 7-segment display to display. If any value
of D10 or D11 is greater than 9999, operation error will occur.
X10
SEGL
D10
Y10
K4
When X10=ON, Y14~Y17 will scan in circles automatically. Each circle scan needs 12
scan time. M1029=ON is a scan period after a circle scan.
4 digits of a group, n=0~3.
After the terminal of 1, 2, 4, 8 of decoded 7-segment display connects itself in
parallet, they should connect to Y10~Y13 of PLC. Latch terminal of each number
connects to Y14~Y17 of PLC individually.
When X10=ON, the content of D10 will be transmitted to 7-segment display to
display in sequently according to Y14~Y17 circulates in sequence
4 digits of 2 groups, n=4~7.
After the terminal of 1, 2, 4, 8 of decoded 7-segment display connects itself in
parallet, they should connect to Y20~Y23 of PLC. Latch terminal of each number
and the first group share Y14~Y17 of PLC.
The content of D10 will be transmitted to the first group of 7-segment display and
the content of D11 will be transmitted to the second group of 7-segment display to
display. If D10=K1234 and D11=K4321, the first group will display and
the second group will display will display 1.
7-segment display scan output wiring
COM Y10
Y11
Y12
Y13
10
10
10
COM Y14
10
1
2
4
8
10
Y16
1
10
Y17
2
10
COM Y20
Y21
Y22
Y23
10
V+
The first group
7-62
10
Y15
10
10
10
1
2
4
8
V+
The second group
Footnote
Version 4.9 of ES series only provide a group of 4 digits of 7-segment display and use
8 points to output. SEGL command only can be used once in the program and the
usage range of operand n is 0 to 3.
Scan time must be longer than 10ms while this command is executed. If scan time is
shorter than 10ms, please use fixed scan time function to fix scan time on 10ms.
Please use suitable 7-segment display for the transistor that PLC uses to output.
Settings of n: it is used to set the polarity of transistor output loop. It can be set to
positive polarity or negative polarity. What 7-segment display it connects is a group of
4 digits or two groups of 4 digits.
PLC transistor output is NPN type and it is open collect output. When wiring,
output should connect a step up resistor to VCC (less than 30VDC). Therefore,
when output point Y is On, output will be low potential.
VCC
step up resistor
Y drive
Y
signal output
On
PLC
Output loop of PNP transistor: when inner signal is 1, it will output high potential.
This logic is called positive polarity.
+24V
positive
On
HIGH
Logic 1
Step down
resistor
PLC
7-63
Y output (BCDcode)
Signal output
b3
b2
b1
b0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
1
0
1
0
1
0
1
0
1
0
Y output (BCDcode)
Signal output
b3
b2
b1
b0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
Parameter n settings:
groups number of
7-segment display
A group
Two groups
7-64
Applicable models
ARWS
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
ES
ARWS
execution
S
D1
D2
n
32-bit command
Program
Example
EH
Flag: None
Refer to each model specification for
usage range.
Output point that designated by this
command should use transistor to
output.
When using this command, please fix
scan time or put this command into time
interrupt subroutine (I6~I8) to
execute.
Command
Explanation
EP
ARWS
X20
D20
Y20
K0
7-65
Y24
Digit
position
Y25
Y26
10
Y20
Y21
Y22
Y23
10
10
10
1
2
4
8
76
X23
move
to
the right
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: Operand S is 8 alphanumeric character string inputted by
WPLSoft software from PC, or ASC II code inputted by
HPP02.
Refer to each model specification for usage range.
Command
Explanation
X22
Applicable models
ES
EP
EH
ASC
Bit devices
X Y M S
move
to
the left
X20
API
X21
LED
Y27
ASC
execution
32-bit command
Program
Example
b15
42H (B)
D0
b0
41H (A)
D1
44H (D)
43H (C)
D2
46H (F)
45H (E)
D3
48H (H)
47H (G)
high byte
low byte
When M1161=On, the ASCII code converted from every character will occupy lower
8-bit (b7~b0) of one register. The high byte will be invalid and its content is filled as 0.
This also means that one register only can be used to store one character.
7-66
b0
D0
00 H
41H (A)
D1
D2
00 H
00 H
42H (B)
43H (C)
D3
D4
00 H
00 H
44H (D)
D5
D6
D7
00 H
00 H
46H (F)
00 H
48H (H)
45H (E)
47H (G)
high byte
API
77
Applicable models
ES
EP
EH
PR
Bit devices
X Y M S
low byte
Word devices
H KnX KnY KnM KnS T C D E F
PR
execution
S
D
Note: Operand S occupies 4 continuous devices.
Operand D occupies 10 continuous devices.
PR command only can be used twice in the program.
Refer to each model specification for usage range.
In EP series models, operand D does not provide index
register E, F to modify.
Command
Explanation
32-bit command
Program
Example
1
device in
First, using API 76 ASC command convert A~H to ASCII code and store them in
D0~D3. Then, using this command output them in the order of A~H.
When M1027=Off, X10 turns from Off to On, the command is executed, Y10(low byte)
to Y17(high byte) is specified as the data output devices, Y20 is specified as scan
signal and Y21 is specified as the monitor signal while the command being executed.
This mode can execute 8 character string output operation.
If X10 turns from Off to On while the command being executed, the data output will be
interrupt. When X10 is On once more, the data will be sent again.
X10
PR
D0
Y10
7-67
A B C D
Y10~Y17 data
H
T : scan time (ms)
T T T
Y20 scan singal
Y21 being executed
Program
Example
2
X10
PR
D0
Y10
first character
last character
T : scan time or
interrupt time
Footnote
When using this command, please fix the scan time or execute this command in a time
interrupt subroutine.
7-68
FROM
Bit devices
Word devices
X Y M S K H KnX KnY KnM KnS T
E F
m1
m2
D
n
Command
Explanation
Applicable models
ES
EP
EH
: Data
indicates bit operand, you can use K1~K4 for 16-bit command and
Program
Example
content of CR#30 of special module#0 to D1 of PLC. It can read 2 data at one time
(n=2).
The command will be executed when X0=ON. The command wont be executed when
X0=OFF and the content of previous reading data wont change.
X0
FROM
K0
K29
D0
K2
API
79 D
TO
Applicable models
EP
EH
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
m1
m2
S
n
Note: The usage range of operand m1: m1=0~7
The usage range of operand m2: m2=0~48
The usage range of operand n: n =1~(49- m2)
Refer to each model specification for usage range.
For ES series, it doesnt support pulse execution command
(TOP, DTOP)
DVP-PLC Application Manual
7-69
Command
Explanation
one time.
When
assigns bit operand, K1~K4 can be used for 16-bit command and K1~K8
Program
Example
Using 32-bit command DTO, program will write D11 and D10 into CR#13 and CR#12 of
special module#0. It only writes a group of data at one time (n=1)
The command will be executed when X0=ON and it wont be executed when X0=OFF.
The data that wrote in previous wont have any change.
X0
DTO
K0
K12
D10
K1
Footnote
CR #10
CR #9
Specified CR number
The number of transmission groups n. The meaning of n=2 of 16-bit command and
n=1 of 32-bit are the same.
Specified device Specified CR
D0
CR #5
D0
CR #5
D1
D2
CR #6
CR #7
D1
D2
CR #6
CR #7
D3
D4
CR #8
CR #9
D3
D4
CR #8
CR #9
D5
CR #10
D5
CR #10
In ES series models, flag M1083 is not provided. When FROM/TO command is executed,
all interrupts (including external or internal interrupt subroutines) will be disabled. All
interrupts will be executed after FROM/TO command is completed. Besides, FROM/TO
command also can be executed in the interrupt subroutine.
7-70
M1002
TO
K0
K1
H0
K1
TO
K0
K33
H0
K1
TO
K0
K18
K0
K1
TO
K0
K24
K2000
K1
X0
1. Write H0 to CR#1 of analog input mode No. 0 and set CH1 to mode 0 (voltage
input : -10V to +10V).
2. Write H0 to CR#33 and allow to adjust characteristics of CH1 to CH4.
3. When X0 turns from OFF to ON, K0LSB of OFFSET value will be wrote in CR#18
and K2000LSB of GAIN value will be wrote in CR#24.
Example 2: Adjust A/D conversion characteristic curve of DVP-04AD by setting
OFFSET value of CH2 to 2mA(=K400 LSB) and GAIN value of CH2 to 18
mA(=K3600LSB).
M1002
TO
K0
K1
H18
K1
TO
K0
K33
H0
K1
TO
K0
K19
K400
K1
TO
K0
K25
K3600
K1
X0
7-71
3. When X0 turns from OFF to ON, K400LSB of OFFSET value will be wrote in
CR#19 and K3600LSB of GAIN value will be wrote in CR#25.
Example 3: Adjust D/A conversion characteristic curve of DVP-02DA by setting
OFFSET value of CH2 to 0mA(=K0LSB) and GAIN value of CH2 to
10mA(=K1000LSB).
M1002
TO
K1
K1
H18
K1
TO
K1
K33
H0
K1
TO
K1
K22
K0
K1
TO
K1
K28
K1000
K1
X0
1. Write H18 to CR#1 of analog input mode No. 1 and set CH2 to mode 3
(current input : 0mA to +20mA).
2. Write H0 to CR#33 and allow to adjust characteristics of CH1 and CH2.
3. When X0 turns from OFF to ON, K0LSB of OFFSET value will be wrote in
CR#22 and K1000LSB of GAIN value will be wrote in CR#28.
Example 4: Adjust D/A conversion characteristic curve of DVP-02DA by setting
OFFSET value of CH2 to 2mA(=K400LSB) and GAIN value of CH2 to
18mA(=K3600LSB).
M1002
TO
K1
K1
H10
K1
TO
K1
K33
H0
K1
TO
K1
K23
K400
K1
TO
K1
K29
K3600
K1
X0
1. Write H10 to CR#1 of analog input mode No. 1 and set CH2 to mode 2
(current input : +4mA to +20mA).
2. Write H0 to CR#33 and allow to adjust characteristics of CH1 and CH2.
3. When X0 turns from OFF to ON, K400LSB of OFFSET value will be wrote in
CR#23 and K3600LSB of GAIN value will be wrote in CR#29.
7-72
LD=
H88
D0
FROM
K0
K0
D0
K1
TO
K0
K1
H3030
K1
TO
K0
K2
K32
K2
FROM
K0
K6
D20
K4
FROM
K1
K0
D0
K1
CMP
H49
D0
M0
INC
D100
ADD
D101
K5
D101
M1000
M1013
LD=
K4000
D100
RST
D100
LD=
K4000
D101
RST
D101
TO
K1
K1
H10
K1
TO
K1
K10
D100
K2
M1
M1
END
1.
Read the data of model type from expansion module K0 and distinguish if the data is
H88 (DVP-04AD model type).
2.
If the model type is DVP-04AD, the drive contact M1 is on and set input mode CR#1:
(CH1, CH3)= mode 0, (CH2, CH4)= mode 3.
3.
Set the mode of CR#2 and CR#3. The average times of CH1 and CH2 is K32.
4.
Read the input signal average value of CH1~CH4 (4 data) from CR#6~CR#9 and
store them in D20 to D23.
5.
Read the data of model type from expansion module K1 and distinguish if the data is
H49 (DVP-02DA model type).
6.
7.
When value of D100 and D101 attain to K4000, they will be reset to 0.
8.
If the model type is DVP-04AD, the drive contact M1 is on and set input mode CR#1:
CH1 mode to 0, CH2 mode to 2.
9.
Write output setting CR#10 and CR#11 to D100 and D101. Analog output will change
with D100 and D101 value.
7-73
RS
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
RS
execution
S
m
D
n
32-bit command
Command
Explanation
Applicable models
ES
EP
EH
Flag: M1120~M1131,
M1140~M1143, M1161
Please refer to the footnote.
RS command can be used in the program unlimitedly, but you cant execute two or
more RS commands at the same time.
It is invalid to change transmitting data during executing RS command.
Use this RS command to transmit and receive data of PLC and external/peripheral
equipment (AC drive, etc.) when external/peripheral equipment has RS-485 serial
communication and communication format of this equipment is public.
If communication format of external/peripheral equipment corresponds with
communication format of MODBUS, DVP series PLC provides several convenience
communication commands, API 100 MODRD, API 101 MODWR and API 150
MODRW, for user to use. Please refer to individual command explanation for detail.
Please refer to following footnote for more information of special auxiliary relay
M1120~M1161 and special data register D1120~D1131 related to RS-485
communication command.
Program
Example
1
Writing data into the register that starts from D100 and set M1122 (send request flag)
to ON.
If RS command is executed when X10=ON, PLC will in the state of waiting for
transmitting and receiving data. It will start to transmit 10 continuous data that start
from D100. M1122 will be set to OFF at the end of transmitting (Please do not use
program to execute RST M1122). After 1ms, it will start to receive external 10 data and
store them into continuous registers that start from D120.
7-74
M1002
MOV
Setting communication
transmission
request
protocol latched
Setting communication
K100 D1129 time out 100ms
pulse
RS
receiving
completed
D100
K10
D120
K10
M1123
RST M1123
Program
Example
2
receiving completed
and flag reset
M1161
X0
RS
D100
K4
D120
K7
STX
Head
code
D100L
D101L
D102L
D103L
EXT1
EXT2
source data register will start from Tail code Tail code
1
2
low byte of D100
length = 4
7-75
D121L
D122L
D123L
D124L
D125L
D126L
receive data register will start from Tail code Tail code
1
2
low byte of D120
Head
code
length = 7
PLC will receive all data that transmitted from external equipment, including head code
.
Head code and tail code of PLC transmitting data is set by using M1126 and M1130 with
D1124~D1126. After complete the setting, PLC will send head code and tail code set by
user automatically when executing RS command.
When M1161=OFF, the conversion mode will be 16-bit. 16-bit data will be divided into high
byte and low byte for data transmitting and receiving.
M1001
M1161
X0
RS
D100
K4
D120
K7
STX
D100L
Head
code
D100L
D101L
D101L
EXT1
EXT2
Tail code
2
length = 4
Receive data: (external equipment PLC)
D120L
Head
code
D120H
D121L
D121H
D122L
D122H
D123L
Tail code
2
length = 7
PLC will receive all data that transmitted from external equipment, including head code
.
and tail code. Please pay attention on setting length
7-76
Program
Example
3
Mode, M1161=OFF), it will transmit data to read 6 continuous data that start from
VFD-B parameter address H2101.
M1002
MOV
Setting communication
protocol latched
transmission
request
pulse
Setting communication
time out 100ms
RS
D100
K17
D120
K35
M1123
receiving completed
and flag reset
VFD-B, PLC transmitting: : 01 03 2101 0006 D4 CR LF
RST M1123
PLC
VFD-B
7-77
Register
D125 low byte
D125 high byte
D126 low byte
D126 high byte
D127 low byte
D127 high byte
D128 low byte
D128 high byte
D129 low byte
D129 high byte
D130 low byte
D130 high byte
D131 low byte
D131 high byte
D132 low byte
D132 high byte
D133 low byte
D133 high byte
D134 low byte
D134 high byte
D135 low byte
D135 high byte
D136 low byte
D136 high byte
D137 low byte
0
1
7
6
6
0
0
0
0
0
0
0
0
0
1
3
6
0
0
0
0
3
B
CR
LF
DATA
30 H
31 H
37 H
36 H
36 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
31 H
33 H
36 H
30 H
30 H
30 H
30 H
33 H
42 H
AH
DH
When PLC connects to VFD-B AC drive (RTU Mode, M1143=ON), (16-bit Mode,
Program
Example
4
M1161=ON), writing transmitting data, H12, in advance into VFD-B parameter address
H2000.
M1002
MOV
H86
SET
M1120
MOV
transmission
request
pulse
Setting communication
D1120 protocol 9600, 7, E, 1
Communication
protocol latched
K100 D1129
Setting communication
time out 100ms
SET
SET
SET
X10
RS
D100
K8
D120
K8
receiving
completed
Process of receiving data
M1123
7-78
DATA
01 H
06 H
20 H
00 H
00 H
12 H
02 H
07 H
Address
Function
Data address
Data content
CRC CHK Low
CRC CHK High
DATA
01 H
06 H
20 H
00 H
00 H
12 H
02 H
07 H
Address
Function
Data address
Data content
CRC CHK Low
CRC CHK High
7-79
Footnote
Function Explanation
Action
M1130
M1127
Receiving time out. This flag will be activated if D1129 is set and
M1129 the process of receiving data is not completed within the setting
time. After resetting, M1129 should be reset to OFF.
User setting
and clear
System
auto setting
and user
clear
User setting
and clear
M1161 8/16-bit mode setting. ON is 8-bit mode and OFF is 16-bit mode
7-80
Function Explanation
D1038
For ES/EP models, data response delay time setting when PLC
MPU is slave. Time unit (0.1ms).
D1050~D1055
D1070~D1085
D1089~D1099
D1120
D1121
D1122
D1123
D1124
D1125
First end word definition (ETX1). Please refer to the table above.
D1126
Second end word definition (ETX2). Please refer to the table above.
D1129
D1130
D1256~D1295
D1296~D1311
7-81
b0
b1
b2
Parity bits
Stop bits
0001 (H1) :
0010 (H2) :
0011 (H3) :
0100 (H4) :
0101 (H5) :
0110 (H6) :
0111 (H7) :
1000 (H8) :
1001 (H9) :
1010 (HA) :
1011 (HB) :
1100 (HC) :
Start word
selection
First end word
selection
Second end word
selection
No definition
b3
b4
b5
b6
b7
b8
b9
b10
b15~b11
0
1
7
8
00 :
None
01 :
Odd
11 :
Even
1 bit
2 bit
110
150
300
600
1200
2400
4800
9600
19200
38400
57600 (only in EH/EP series models)
115200 (only in EH/EP series models)
None
D1124
None
D1125
None
D1126
Start word and end word of control characters will be defined in the communication
format of peripheral equipment when using RS command. Start word and end word
can be set in D1124~D1125 by user or defined by machine/equipment. When using
M1126, M1130, D1124~D1125 to set start and end word, b8~b9 of D1120 of RS485
communication protocol should be set to 1. For the settings, please refer to the
following table:
M1130
0
D1124: H 0002
D1125: H 0003
D1126: H 0000no setting
D1124: H 003A:
D1125: H 000DCR
D1126: H 000ALF
M1126
7-82
b15
b0
D1120 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0
0
Don t care
M1002
MOV
H788 D1120
When using STX, EXT1 and EXT2 should pay attention to the On/Off relationship
between special auxiliary relay M1126 and M1130.
M1143: ASCII / RTU mode selection. ON is RTU mode and OFF is ASCII mode.
Take standard MODBUS format to explanation:
ASCII mode (M1143=Off):
STX
Address Hi
Address Lo
Function Hi
Function Lo
DATA (n-1)
.
DATA 0
LRC CHK Hi
LRC CHK Lo
END Hi
END Lo
Communication protocol is made of MODBUS ASCII (American Standard Code for
Information Interchange). Each byte consists of 2 ASCII characters. For example: a
1-byte data 64 Hex shown as 64 in ASCII, consists of 6 (36Hex) and 4 (34Hex). The
table below identifies the usable hexadecimal characters and their associated ASCII
codes.
Character
0
1
2
3
4
5
6
7
ASCII code
30H
31H
32H
33H
34H
35H
36H
37H
Character
ASCII code
8
38H
9
39H
A
41H
B
42H
C
43H
D
44H
E
45H
F
46H
7-83
:
0
1
0
3
2
1
0
2
0
0
0
2
D
7
CR
LF
Address
Function
Start address
Number of data
(count by word)
LRC Check
END
Response message:
STX
Address
Function
Number of data
(count by byte)
Content of start address
2102H
Content of address
2103H
LRC Check
END
:
0
1
0
3
0
4
1
7
7
0
0
0
0
0
7
1
CR
LF
Address
Function
DATA (n-1)
.
DATA 0
CRC CHK Low
CRC CHK High
END
START:
ES / EP series: keep none input signal to be greater or equal to 10 ms
EH series:
Baud Rate(bps) RTU Timeout Timer(ms) Baud Rate(bps) RTU Timeout Timer(ms)
300
40
9600
2
7-84
600
21
19200
1200
10
38400
2400
57600
4800
115200
7-85
01 H
Address
01 H
Function
03 H
Function
03 H
21 H
02 H
00 H
02 H
6F H
F7 H
Number of data
(count by byte)
Content of data address
8102H
Content of data address
8103H
CRC CHK Low
CRC CHK High
04 H
17 H
70 H
00 H
00 H
FE H
5C H
M1002
MOV
SET
transmission
request
pulse
MOV
H86
Setting communication
D1120 protocol 9600, 7, E, 1
Communication
M1120 protocol latched
K100 D1129
Setting communication
time out 100ms
SET
X10
RS
D100
K2
D120
K8
receiving
completed
Process of receiving data
M1123
7-86
RST M1123
receiving completed
and flag reset
Residual words of
transmitting data D1122
2
1
0
8
7
6
Residual words of
receiving data D1123
API
81 D
PRUN
Bit devices
X Y M S
S
D
Change
direction
immediately
1 2 3 1 2 3 4 5 6 7 8
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command (5 STEPS)
Continuous
Pulse
PRUN
PRUNP
execution
execution
Command
Explanation
to
7-87
Program
Example
1
format.
X3
PRUN
K4X10
K4M10
X27 X26 X25 X24 X23 X22 X21 X20 X17 X16 X15 X14 X13 X12 X11 X10
M27 M26 M25 M24 M23 M22 M21 M20 M19 M18 M17 M16 M15 M14 M13 M12 M11 M10
NO CHANGE
When X2=On, transmit the content of K4M10 to K4Y10 in octal number system format.
X2
PRUN K4M10 K4Y10
Program
Example
2
X27 X26 X25 X24 X23 X22 X21 X20 X17 X16 X15 X14 X13 X12 X11 X10
API
82
ASCI
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n
Note: Operand n available range: n=1~256
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(ASCIP)
Command
Explanation
: Converted digits
16-bit conversion mode: When M1161=Off, read
from the source devcie
and convert the data into the ASCII code. Then, store
and convert the data into the ASCII code. Then, store
7-88
Applicable models
ES
EP
EH
X0
ASCI
D10
D20
K4
Supposed condition:
(D10)
= 0123 H
0 = 30H
4 = 34H
8 = 38H
(D11)
= 4567 H
1 = 31H
5 = 35H
9 = 39H
(D12)
= 89AB H
2 = 32H
6 = 36H
A = 41H
(D13)
= CDEFH
3 = 33H
7 = 37H
B = 42H
D10=0123 H
0
30H
low byte
33H
high byte
0
low byte
31H
D21
high byte
1
D20
0
32H
D10 = H 0123
0 0 0 0 0 1
b15
0 0
0
b0
1
b0
1
b0
0
b0
0
D11 = H 4567
b15
0 1
1 0
1 0
Convert to
b15
0 0
D20
1 0 1
7
b15
0 0
D21
1 0 0
6
0 1
H 31
H 36
1
H 30
D22
1
3
H 37
1
b15
0 0
H 33
1 0
1 1
2
b0
1 0
H 32
7-89
Program
Example
2
K1
K2
K3
K4
K5
K6
K7
K8
2
3
1
2
3
0
1
2
3
7
0
1
2
3
6
7
0
1
2
3
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
no
change
K9
K10
K11
K12
K13
K14
K15
K16
B
4
5
6
7
0
1
2
3
A
B
4
5
6
7
0
1
2
3
9
A
B
4
5
6
7
0
1
2
3
8
9
A
B
4
5
6
7
0
1
2
3
F
8
9
A
B
4
5
6
7
0
1
2
3
E
F
8
9
A
B
4
5
6
7
0
1
2
3
D
E
F
8
9
A
B
4
5
6
7
0
1
2
3
C
D
E
F
8
9
A
B
4
5
6
7
0
1
2
3
no
change
X0
ASCI
7-90
D10
D20
K4
= 0123 H
0 = 30H
4 = 34H
8 = 38H
(D11)
= 4567 H
1 = 31H
5 = 35H
9 = 39H
(D12)
= 89AB H
2 = 32H
6 = 36H
A = 41H
(D13)
= CDEFH
3 = 33H
7 = 37H
B = 42H
D10 = H 0123
0 0 0 0 0 1
b15
0 0
0
b0
1
Convert to
b15
0 0
b15
0 0
D20
0 0
0 0
1 1 0 0
0
H 30
b0
0
D21
0 0
0 0
1 1
b0
1
b0
0
1
b15
0 0
b15
0 0
D22
0 0
0 0
H 31
1 1
H 32
D23
0
0 0
1 1
3
b0
1 1
H 33
7-91
83
HEX
K3
K4
K5
K6
K7
K8
2
3
1
2
3
0
1
2
3
7
0
1
2
3
6
7
0
1
2
3
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
K9
K10
K11
K12
K13
K14
K15
K16
B
4
5
6
7
0
1
2
3
A
B
4
5
6
7
0
1
2
3
9
A
B
4
5
6
7
0
1
2
3
8
9
A
B
4
5
6
7
0
1
2
3
F
8
9
A
B
4
5
6
7
0
1
2
3
E
F
8
9
A
B
4
5
6
7
0
1
2
3
D
E
F
8
9
A
B
4
5
6
7
0
1
2
3
C
D
E
F
8
9
A
B
4
5
6
7
0
1
2
3
no
change
Word devices
H KnX KnY KnM KnS T C D E F
S
D
n
Note: Operand n available range: n=1~256
Refer to each model specification for usage range.
ES series models do not support pulse execution command
(HEXP).
Command
Explanation
7-92
Applicable models
ES
EP
EH
Bit devices
X Y M S
K2
no
change
API
K1
then transmit to
by
per 4-bit for one time. Number of converted ASCII codes is set
8-bit conversion mode: When M1161=On, it is 16-bit conversion mode Convert 16-bit
ASCII code of
Program
Example
1
. (high
are all 0)
M1001
M1161
X0
HEX
D20
D10
K4
Supposed condition:
ASCII code
H 43
H 44
H 45
H 46
H 38
H 39
H 41
H 42
HEX
conversion
C
D
E
F
8
9
A
B
ASCII code
H 34
H 35
H 36
H 37
H 30
H 31
H 32
H 33
HEX
conversion
4
5
6
7
0
1
2
3
D20
41H
D21
43H
D10
30H
C
1
42H
0
B
1
7-93
n
1
2
3
4
5
6
7
8
9
D13
D11
D10
***C H
***C H
**CD H
*CDE H
CDEF H
DEF8 H
***C H
**CD H
*CDE H
CDEF H
DEF8 H
EF89 H
F89A H
89AB H
9AB4 H
**CD H
*CDE H
CDEF H
DEF8 H
EF89 H
F89A H
89AB H
EF89 H
F89A H
89AB H
9AB4 H
AB45 H
B456 H
4567 H
AB45 H
B456 H
4567 H
5670 H
6701 H
7012 H
0123 H
The used
registers which
are not
specified are all
0
10
11
12
13
14
15
16
Program
Example
2
D12
***C H
**CD H
*CDE H
CDEF H
X0
HEX
D20
D10
K4
Supposed condition:
ASCII code
D20
D21
D22
D23
D24
D25
D26
D27
H 43
H 44
H 45
H 46
H 38
H 39
H 41
H 42
HEX
conversion
C
D
E
F
8
9
A
B
ASCII code
D28
D29
D30
D31
D32
D33
D34
D35
H 34
H 35
H 36
H 37
H 30
H 31
H 32
H 33
HEX
conversion
4
5
6
7
0
1
2
3
D20
3
D21
7-94
1
0
4
D10
n
1
2
3
4
5
6
7
8
9
84
CCD
***C H
**CD H
*CDE H
CDEF H
D11
D10
***C H
***C H
**CD H
*CDE H
CDEF H
DEF8 H
***C H
**CD H
*CDE H
CDEF H
DEF8 H
EF89 H
F89A H
89AB H
9AB4 H
**CD H
*CDE H
CDEF H
DEF8 H
EF89 H
F89A H
89AB H
EF89 H
F89A H
89AB H
9AB4 H
AB45 H
B456 H
4567 H
AB45 H
B456 H
4567 H
5670 H
6701 H
7012 H
0123 H
Word devices
KnX KnY KnM KnS T C D E F
S
D
n
Note: Operand n available range: n=1~256
Refer to each model specification for usage range.
ES series models do not support this command (CCD,
CCDP)
Command
Explanation
Applicable models
ES
EP
EH
Check Code
Bit devices
X Y M S
D12
The used
registers which
are not
specified are all
0
10
11
12
13
14
15
16
API
D13
: Number of data
This command is used to check sum of words to ensure the truth of transmission data
during communication.
16-bit conversion mode: When M1161=Off, it is 16-bit conversion mode. Check the
sum of
words (8-bit in one byte) from the register specified by source devcie
+1.
8-bit conversion mode : When M1161=On, it is 8-bit conversion mode. Check the sum
of
words (8-bit in one byte, only low byte are available) from the register
+1.
7-95
X0
CCD
(S)
D0 low byte
D0 high byte
D1 low byte
D1 high byte
D2 low byte
D2 high byte
D100
D101
D0
D100
K6
Content of data(words)
K100 = 0 1 1 0 0 1 0
K111 = 0 1 1 0 1 1 1
K120 = 0 1 1 1 1 0 0
K202 = 1 1 0 0 1 0 1
K123 = 0 1 1 1 1 0 1
K211 = 1 1 0 1 0 0 1
K867
0 0 0 1 0 0 0
0
1
0
0
1
1
Total
1
Program
Example
2
D100 0
D101 0
Parity
X0
CCD
(S)
D0 low byte
D1 low byte
D2 low byte
D3 low byte
D4 low byte
D5 low byte
D100
D101
D0
D100
Content of data(words)
K100 = 0 1 1 0 0 1 0
K111 = 0 1 1 0 1 1 1
K120 = 0 1 1 1 1 0 0
K202 = 1 1 0 0 1 0 1
K123 = 0 1 1 1 1 0 1
K211 = 1 1 0 1 0 0 1
K867
0 0 0 1 0 0 0
K6
0
1
0
0
1
1
Total
1
7-96
D100 0
D101 0
Parity
VRRD
Bit devices
X Y M S
Word devices
KnX KnY KnM KnS T C D E F
S
D
Note: Operand S available range: n=0~7
Refer to each model specification for usage range.
ES series models do not support this command (VRRD,
VRRDP)
Command
Explanation
Applicable models
ES
EP
EH
Potentiometer Read
: Potentiometer number
32-bit command
potentiometer
VRRD command is used to read the two potentiometers of PLC main processing unit
and the number is No.0 and No.1., or it is used to read the six potentiometers of
function card and the number is No.2 to No.7. The read data will be converted as value
from 0 to 255 and stored in destination device
If regarding the potentiometer as the setting value of timer, the setting time of timer
can be changed by truning VR. If desiring to get the value more than 255, please
multiply
Program
Example
1
by some constant.
K0
D0
T0
D0
X1
TMR
Program
Example
2
7-97
FOR
K8
VRRD
K 0E
INC
M1000
D100E
NEXT
X10
TMR
T0
D100
T1
D101
T0
Y000
X11
TMR
T7
Y007
END
Operation of FOR~NEXT command:
1. In FOR~NEXT command area, FOR command specify K8 indicates the loop
between FOR~NEXT command is executed 8 times repeatly. After 8 times of
execution, it will continue to execute.
2. Between FOR~NEXT command (INC E), the content of E will be 0, 1, 27 and
increased by 1(one). Therefore, 8 potentiometer scales will also show as VR0
D100, VR1D101, VR2D102VR7D107 in order and be read into the
specified register.
VR means VARIABLE RESISTOR SCALE.
Footnote
For EP/EH models, built-in 2 points VR potentiometer can be used with special D and
special M.
Device
M1178
M1179
D1178
D1179
7-98
Function
Start potentiometer VR0
Start potentiometer VR1
VR0 value
VR1value
VRSC
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S
D
Note: S operand available range: n=0~7
Refer to each model specification for usage range.
ES series models do not support this command (VRSC, VRSCP).
Command
Explanation
Applicable models
ES
EP
EH
Potentiometer Scale
: Potentiometer number
Flag: None
scale
VRRD command is used to read the potentiometer scale value of two potentiometers
on PLC main processing unit and the number is No.0 and No.1., or it is used to read
the potentiometer scale value of six potentiometers on function card and the number is
No.2 to No.7 (potentiometer scale value is from 0 to 10). The read data will be stored
in destination device
Program
Example
1
Program
Example
2
When X0=On, the potentiometer scale value (0 to10) of No. 0 specified by VRSC
command is stored in device D10.
X0
VRSC
K0
D10
Regrad as digital switch: Correspond potentiometer scale 0 to 10. Only one contact is
On between M10 to M20. Using DECO command (API 41) can decode the
potentiometer scale into M0~M15.
When X0=On, store the potentiometer scale value (0 to 10) of specified No. 1
potentiometer to D1.
When X1=On, use DECO command (API 41) to decode the potentiometer scale into
M10~M25.
X0
VRSC
K1
D1
DECO
D1
M10
X1
K4
M10
On when volume scale is 0
M11
On when volume scale is 1
M20
On when volume scale is 10
7-99
API
87
ABS
Bit devices
X Y M S
Applicable models
ES
EP
EH
Absolute Value
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
ES series models do not support this command (ABSP, DABSP).
Command
Explanation
When the command is executed, take the absolute value of the specified device,
.
This command is usually pulse execution (ABSP).
When X0 goes from OFFON, take the absolute value of the D0 contents.
X0
ABS
D0
Program
Example
API
88
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
S3
D
Note: Operand S3 uses 14 continuous devices
Refer to each model specification for usage range.
For the information of the PID usage times during the
program, please refer to the footnote.
Command
Explanation
Applicable models
ES
EP
EH
PID Calculation
PID
PID
execution
32-bit command
Continuous
DPID
execution
Flag: None
: Parameter
7-100
execute after completing all parameters setting and the result will be stored in
Please give no latch register area for
Program
Example
PID
Footnote
D0
D1
D100
D150
PID command is only available in V5.7 and above of ES series models and it is not
available for other version.
There is no time limit for using PID command but the register number specified by
cannot be repeated.
For 16-bit commands,
MOV command to transmit settings to the indication register to set before PID
command executes. If the registers that parameters indicate are latch area, please
use MOVP to execute transmitting.
Parameter table of 16-bit
Device No.
Function
Sampling time (TS)
(unit: 10ms)
:
Setting range
1~2,000
(unit: 10ms)
+1:
0~30,000(%)
+2:
0~30,000(%)
+3:
+4:
+5:
+6:
+7:
Explanation
If TS is less than one program scan
time, PID command will execute one
program scan time. If TS=0, PID
command wont be activated.
When setting exceeds 30,000,
setting will be regarded as 30,000.
0~30,000(%)
0: normal control
1: Forward control (E=SV-PV)
2: Inverse control (E=PV-SV)
The range that Error
For example: if the range of error
0~32,767
value (E) doesnt
value (E) is 5, output value MV of E
work
between 5~5 is 0.
For example: if upper bound is set
to 1000 and once output (MV) is
Upper bound of
-32,768~32,767 larger than 1000, it will output 1000.
saturated output (MV)
(upper bound should larger than
lower bound, i.e. S3+6 > S3+7.)
For example: if lower bound is set
Lower bound of
-32,768~32,767 to 1000, once output (MV) is less
saturated output (MV)
than 1000, it will output 1000.
7-101
Device No.
Function
Setting range
Explanation
+8:
+14:
When parameter setting is out of setting range, it will be set to upper bound or lower
bound. But if operation method is out of range, it will be set to 0.
PID commands can be used in interrupt subroutine, step point and CJ command.
Max. range of sampling error time TS is
- a scan time+1ms~+a scan time. If error
value has influence on output, please keep the scan time fixable or execute PID
command in interrupt subroutine of timer.
If the settings of sampling time TS a scan time, CPU will have error code K6740
(PID operation error). At this time, CPU will reset TS = a scan time to execute PID
operand. In this situation, please execute PID command in time interrupt subroutine
(I6~I8).
The present measured value (PV) must be a stable value before the execution of PID
command. If using input value of DVP-04AD / DVP-04XA / DVP-04PT / DVP-04TC
these modules to perform the PID calculation, please pay attention to the A/D
conversion time of the above-mentioned modules.
32-bit command
7-102
Function
Setting range
Explanation
1~2,000
(unit: 10ms)
+1:
0~30,000(%)
+2:
0~30,000(%)
+3:
+4:
PV temporality
But user can modify by
requirement.
+5, 6:
+7, 8:
+9, 10:
+11, 12:
+13, 14:
+15, 16:
+17, 18:
+19:
For system uses, please dont use it.
+20:
Explanation of 32-bit
that capacity of
and 16-bit
+5 ~
+20.
7-103
PID
Equations
measured value.
PID operation has three control methods: normal, forward and inverse controls. The
control method is set by
operation is set by
+5.
PID equations:
1
MV = K P * E (t ) + K I * E (t ) + K D * PV (t )S
S
Control Method
Forward control, normal
control
Inverse control
PID Equations
E (t ) = SV PV
E (t ) = PV SV
E (t )
1
S
means the
You can know that this command is different from general PID command from above
equation. The difference is the change on differential usage. To avoid transient
differential value is too large when executing general PID command at the first time, this
command willl lower output (MV) value once the change of present measured value (PV)
is too large by monitoring differential value of present measured value (PV).
Symbols explanation:
MV
KP
Output value
Porprotional gain
E (t )
PV
SV
: Target value
KD
: Differential gain
E (t ) = PV SV
PV (t )S
: Differential value of
KI
: Integral gain
E (t )
7-104
1
S
: Integral value of
E (t ) = SV PV , Inverse control
PV (t )
E (t )
KI
+
KP
G(s)
KD
S
Position command
(SV)
PID
MV
Plant
Encoder
PV
Example 2: block diagram for using PID command to control speed (control method
S3+4 should be set to 0)
7-105
speed command
(S)
AC drive
Accel/Decel
output (MV)
Accel/Decel
command (SV)
speed
detection
equipment (P)
actual accel/decel
speed (PV=S-P)
PID
Example 3: block diagram for using PID command to control temperature (action
direction S3+4 should be set to 1)
temperature
command (SV)
add temperature
(MV)
heater
equipment
PID
temperature
detection
actual temperature(PV) equipment
Example 4: suggested steps of PID adjustment
Consider that transfer function of plant G (s ) =
b
(most general AC drive model is this
s+a
K P =40
SV=1
K P =20
K P =10
KP =5
0.5
7-106
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Time (sec)
PV=SV
1
0.5
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Time (sec)
Note: This example is only for reference. Therefore, user should adjust suitable control
parameters by himself according to real control system.
Application 1: using PID command in pressure control system. (use block diagram of
Applications
example 1)
Control destination: make control system reach pressure target value.
Control characteristics: this system should reach to control destination step by step,
therefore, it may cause system out of control or overload if reaching control destination
too fast.
Recommend solve method:
Method 1: reach by using long sampling time.
Method 2: reach by using delay command and its control block diagram is shown in the
following.
7-107
0rpm
511
3000
rpm
pressure
command SV
delay
D1
pressure
command
value (D0)
A
wave
PV
command
value
command
value
280
280
250
200
150
100
50
t
A wave
0V
255 5V
speed
convert
to
voltage D1116
voltage
convert
D1110
to
command
value
B
wave
MV
convert
to
speed
MV
D5
PID
AC
Drive
pressure
meter
0V
511
10V
M1002
MOV
K10
D3
TMR
T0
D3
RST
T0
M0
T0
>
D0 D1
MOV
K50
D2
<
D0 D1
MOV
K-50
D2
D0 D1
MOV
K0
D2
ADD
D2
D1
D1
CMP
D2
K0
M10
M10
<
D1 D0
MOV
D0
D1
>
D1 D0
MOV
D0
D1
PID
D1
D1116
M12
M0
7-108
D10
D5
M2=ON
D40
Speed
command
+
D30
D31
0rpm
3000rpm
D0
pressure
command
255
D32
+
speed
convert D1116 AC
to
drive
voltage
MV
convert to
accel/decel
M0=ON
D5 MV
SV
delay
PV
D1
PID
function
(optional)
D1110 pressure
meter
M1=ON
7-109
K1000
D40
MOV
D0
D1
MOV
K0
D5
MOV
D40
D30
ADD
D30
D31
M0
M1
M3
M2
>
D32 K3000
MOV
K3000
D32
<
D32
MOV
K0
D32
DIV
D32
K11
MOV
K255
D32
MOV
D32
D1116
PID
D1
D1110
>
D32
K0
K255
D32
D32
M1
7-110
D10
D5
MODRD
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C
S1
S2
n
Note: Operand S1 available range: K0~K255
Operand n available range: K1nK6
Refer to each model specification for usage range.
Command
Explanation
: Communication address.
D E F
Applicable models
ES
EP
EH
MODRD
execution
32-bit command
: Read data
length.
MODRD is a specific command for the MODBUS ASCII mode and RTU mode
communication. The RS-485 communication build-in Delta VFD series drives (except
VFD-A series) all have MODBUS communication. Therefore, MODRD command can be
used to read communication data from Delta VFD series AC drives. Please refer to the
Delta VFD series manual for more details.
is the address for reading data. If the address setting is illegal, the user will be
informed by an error message. The error code will be stored in D1130, while M1141 turn
to be ON.
The feedback (return) data from peripheral equipment will be stored in D1070 to D1085.
After receiving the feedback (return) data completed, PLC will check if all feedback
(return) data are correct. If there is an error, then M1140 will be ON.
If using ASCII mode, PLC will convert the data to value and store them in D1050 to
D1055 because the feedback (return) data are all ASCII characters. D1050 to D1055 will
be invalid if using RTU mode.
After M1140 or M1141 is On, a correct data will be transmit to peripheral equipment
again. If the feedback (return) data are all correct, then the flag M1140, M1141 will be
clear.
Program
Example
1
Communication between PLC and VFD-S series AC drives (ASCII Mode, M1143=Off)
M1002
MOV
H87
Setting communication
D1120 protocol 9600, 8, E, 1
Communication
protocol latched
Setting communication
MOV K100 D1129 time out 100ms
Setting communication command:
device address 01
K1
H2101 K6
MODRD
data address H2101
data length 6 words
SET M1120
X0
X1
M1127
receiving
completed
8-1
0
1
0
3
2
1
0
1
0
0
0
6
D
4
DATA
30 H
31 H
30 H
33 H
32 H
31 H
30 H
31 H
30 H
30 H
30 H
36 H
44 H
34 H
ADR 1
ADR 0
CMD 1
CMD 0
8-2
0
1
0
3
0
C
0
1
0
0
1
7
6
6
0
0
0
0
0
0
0
0
0
1
3
6
0
0
0
0
3
B
DATA
30 H
31 H
30 H
33 H
30 H
43 H
30 H
31 H
30 H
30 H
31 H
37 H
36 H
36 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
30 H
31 H
33 H
36 H
30 H
30 H
30 H
30 H
33 H
42 H
ADR 1
ADR 0
CMD 1
CMD 0
Number of data (count by byte)
PLC automatically convert
ASCII codes to value and
Content of
address 2101 H store the converted value in
D1050 = 0100 H
PLC automatically convert
ASCII codes to value and
Content of
address 2102 H store the converted value in
D1051 = 1766 H
PLC automatically convert
ASCII codes to value and
Content of
address 2103 H store the converted value in
D1052 = 0000 H
PLC automatically convert
ASCII codes to value and
Content of
address 2104 H store the converted value in
D1053 = 0000 H
PLC automatically convert
Content of
ASCII codes to value and
address 2105 H store the converted value in
D1054 = 0136 H
PLC automatically convert
Content of
ASCII codes to value and
address 2106 H store the converted value in
D1055 = 0000 H
LRC CHK 1
LRC CHK 0
Communication between PLC and VFD-S series AC drives (RTU Mode, M1143=On)
M1002
MOV
H83
Setting communication
D1120 protocol 9600, 8, E, 1
M1120 Communication
protocol latched
Setting communication
MOV K100 D1129 time out 100ms
SET
SET M1143
X0
MODRD
X1
M1127
receiving
completed
PLC
M1127
receiving completed
and flag reset
DATA
01 H
03 H
21 H
02 H
00 H
02 H
6F H
F7 H
Address
Function
Starting data address
Number of data (count by word)
CRC CHK Low
CRC CHK High
Program
Example
3
DATA
01 H
03 H
04 H
17 H
70 H
00 H
00 H
FE H
5C H
Address
Function
Number of data (count by byte)
Content of address 2102 H
Content of address 2103 H
CRC CHK Low
CRC CHK High
8-3
M1002
D1120
MOV
H87
SET
M1120
MOV
K100
D1129
MODRW
K1
H2100
SET
M1122
X0
X0
Setting communication
time-out to 100ms
Setting communication command:
device address 01,
K6
data address H2101
data length 6 words
M1129
Communication time-out Retry
M1140
data receive error Retry
M1141
M1127
M1127
RST
M1129
Rising-edge contact (LDP, ANDP, ORP) and falling-edge contact (LDF, ANDF, ORF)
Footnote
cant be used before API 100 MODRD, API 105 RDST, API 150 MODRW (FUNCTION
CODE H03) these three commands. Otherwise, the data stored in received register will
be incorrect.
8-4
MODWR
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C
S1
S2
n
Note: Operand S1 available range: K0~K255
Refer to each model specification for usage range.
Command
Explanation
D E F
Applicable models
ES
EP
EH
MODWR
execution
32-bit command
Write data
MODWR is a specific command for the MODBUS ASCII mode and RTU mode
communication. The RS-485 communication build-in Delta VFD series drives (except
VFD-A series) all have MODBUS communication. Therefore, MODWR command can
be used to read communication data from Delta VFD series AC drives. Please refer to
the Delta VFD series manual for more details.
is the address for reading data. If the address setting is illegal, the user will be
informed by an error message. The error code will be stored in D1130, while M1141
turn to be ON. For example, 4000H is an illegal address to VFD-S, then M1141 will turn
ON, D1130=2. For the information of error codes, please refer to VFD-S series user
manual.
The feedback (return) data from peripheral equipment will be stored in D1070 to
D1076. After receiving the feedback (return) data completed, PLC will check if all
feedback (return) data are correct. If there is an error, then M1140 will be ON.
After M1140 or M1141 is On, a correct data will be transmit to peripheral equipment
again. If the feedback (return) data are all correct, then the flag M1140, M1141 will be
clear.
Program
Example
1
Communication between PLC and VFD-S series AC drives (ASCII Mode, M1143= Off)
M1002
MOV
H87
Setting communication
D1120 protocol 9600, 8, E, 1
Communication
protocol latched
Setting communication
MOV K100 D1129 time out 100ms
Setting communication command:
device address 01
K1
H0100 H1770
MODRW
data address H0100
data H1770
Setting
transmission
flag
SET M1122
SET M1120
X0
X1
receiving
completed
M1123
receiving completed
and flag reset
8-5
VFD-B
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
ADR 1
ADR 0
CMD 1
CMD 0
Data address
Data contents
LRC CHK 1
LRC CHK 0
Program
Example
2
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
ADR 1
ADR 0
CMD 1
CMD 0
Data address
Data content
LRC CHK 1
LRC CHK 0
Communication between PLC and VFD-S series AC drives (RTU Mode, M1143=On)
M1002
MOV
H87
Setting communication
D1120 protocol 9600, 8, E, 1
Communication
protocol latched
Setting communication
K100 D1129 time out 100ms
SET M1120
MOV
SET M1143
X0
MODRW
K1
H2000
X1
H12
8-6
M1123
receiving completed
and flag reset
Program
Example
3
8-7
MOV
H87
SET
M1120
MOV
K100
D1129
MODRW
K1
H0100
SET
M1122
X0
X0
Setting communication
time-out to 100ms
Setting communication command:
H1770 device address 01,
data address H0100
data H1770
M1129
Communication time-out Retry
M1140
data receive error Retry
M1141
M1123
M1123
RST
M1129
For detail information of the related flags and special registers, please refer to the
Footnote
API
102
FWD
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: Operand S1 available range: K0~K31
Operand n available range: n=K1or K2
Refer to each model specification for usage range.
8-8
Applicable models
ES
EP
EH
FWD
execution
32-bit command
REV
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: Operand S1 available range: K0~K31
Operand n available range: n=K1or K2
Refer to each model specification for usage range.
API
104
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: Operand S1 available range: K0~K31
Operand n available range: n=K1or K2
Refer to each model specification for usage range.
Command
Explanation
REV
execution
32-bit command
: Communication address.
STOP
Applicable models
ES
EP
EH
Applicable models
ES
EP
EH
STOP
execution
32-bit command
Command object.
FWD/REV/STOP are communication commands for Delta A/H series drive, make sure
to use the communication overtime setting (D1129) when applying these commands.
indicates AC drive master frequency. AC drive master frequency setting for
VFD-A series, K0000 to K4000, represents 0.0Hz to 400.0Hz. For H series AC drive,
the setting of K0000 to K1500 represent 0Hz to 1500Hz.
command object, n=1 is for one drive. n=2 communicates to all drives
connected.
The feedback (return) data from perpherial equipment will be stored in D1070 to
D1080. After receiving the feedback (return) data completed, PLC will check if all
feedback (return) data are correct. If there is an error, then M1142 will be ON. If n = 2,
PLC will not receive the data.
8-9
Communication between PLC and VFD-A series AC drives, retry for communication
time-out and received data error.
M1002
H0073
D1120
SET
M1120
MOV
K100
FWD
K0
SET
M1122
X0
X0
M1129
M1142
Setting communication
protocol 4800, 8, O, 1
MOV
Setting communication
time-out 100ms
Setting communication command:
device address 0
K500
K1
frequency setting is 500Hz
K1 is the AC drive for
designated address
Setting transmission flag
D1129
M1123
03 H
Check sum
D1091 low
01 H
Command object
D1092 low
0
30 H
D1093 low
0
30 H
Communication address
D1094 low
0
30 H
D1095 low
1
31 H
D1096 low
0
30 H
D1097 low
5
35 H
Operation command
D1098 low
0
30 H
D1099 low
0
30 H
PLC receiving data register (response messages)
8-10
Register
D1070 low
D1071 low
DATA
C
43 H
03 H
D1072 low
06 H
D1073 low
D1074 low
D1075 low
D1076 low
D1077 low
D1078 low
D1079 low
D1080 low
0
0
0
1
0
5
0
0
30 H
30 H
30 H
31 H
30 H
35 H
30 H
30 H
Operation command
RDST
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
n
Note: Operand S1 available range: K0~K31
Operand n available range: n=K0~ K3
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
RDST
execution
32-bit command
8-11
B =
CD =
0
Stop,
5 JOG(FWD)
1
FWD operation,
6 JOG(REV)
2
Stop,
7 JOG(REV)
3
REV operation,
8 Abnormal
4
JOG(FWD),
PLC will automatically convert ASCII word of A to value and
store the value in D1051. For example, if A = 3, PLC will
automatically convert ASCII word to the value of K0003 (03 H)
and store it in the special register in D1051.
b7
b6
b5
b4
Operation command source
0
0
0
0
Digital keypad
0
0
0
1
1st Step Speed
0
0
1
0
2nd Step Speed
0
0
1
1
3rd Step Speed
0
1
0
0
4th Step Speed
0
1
0
1
5th Step Speed
0
1
1
0
6th Step Speed
0
1
1
1
7th Step Speed
1
0
0
0
JOG frequency
1
0
0
1 Analog signal frequency command
1
0
1
0 RS-485 communication interface
1
0
1
1
Up/Down control
b3
=
0 No DC braking stop 1 DC braking stop
b2
=
0 No braking startup
1 DC braking startup
b1
=
0 FWD,
1 REV
b0
=
0 Stop,
1 Operation
PLC will store the value of B in special auxiliary relays
M1168(b0)~M1175(b7)
00
No abnormal record
10
OcA
01
oc
11
Ocd
02
ov
12
Ocn
03
oH
13
GFF
04
oL
14
Lv
05
oL1
15
Lv1
06
EF
16
cF2
07
cF1
17
bb
08
cF3
18
oL2
09
HPF
19
PLC will automatically convert ASCII word of CD to value and
store the value in D1052. For example, if CD = 06, PLC will
automatically convert ASCII word to the value of 0006 H and
store it in the special register in D1052.
Rising-edge contact (LDP, ANDP, ORP) and falling-edge contact (LDF, ANDF, ORF)
Footnote
before API 100 MODRD, API 105 RDST, API 150 MODRW (FUNCTION CODE 03)
these three commands. Otherwise, the data stored in received register will be incorrect.
8-12
RSTEF
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
n
Note: Operand S1 available range: K0~K31
Operand n available range: n=K1 or K2
Refer to each model specification for usage range.
: Communication address.
Command
Explanation
Applicable models
ES
EP
EH
RSTEF
execution
32-bit command
: Command object.
Footnote
API
107
LRC
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
ES series models do not support this command (LRC,
LRCP)
Applicable models
ES
EP
EH
8-13
Command
Explanation
numbers
: Operand
: Starting device for storing the operation result. LRC check: please
will be divided into upper 8-bit and lower 8-bit and perform the operation
of LRC command on
of device
numbers. Then, store the result into upper and lower 8-bit
8-bit conversion mode: When M1161=On, divide hexadecimal data that start from the
source devcie
into upper 8-bit (invalid data) and lower 8-bit and perform the
Communication between PLC and VFD-B series AC drives (ASCII Mode, M1143= Off),
Program
Example
(8-bit Mode, M1161=On), writing transmitting data in advance to read six data from
VFD-B parameter address H2101.
M1002
MOV
Setting communication
RS
D100
K17
D120
K35
receiving
completed
Process of receiving data
M1123
RST M1123
PLC
receiving completed
and flag reset
8-14
:
0
1
0
3
2
1
0
1
0
0
0
6
DATA
3A H
30 H
31 H
30 H
33 H
32 H
31 H
30 H
31 H
30 H
30 H
30 H
36 H
STX
ADR 1
ADR 0
CMD 1
CMD 0
Register
D113 low
D114 low
D115 low
D116 low
D
4
CR
LF
DATA
44 H
34 H
AH
DH
LRC CHK 1
LRC CHK 0
END
The LRC CHK (0,1) above is error check code and it can be calculated by LRC command
(8-bit Mode, M1161=On).
M1000
LRC
D101
K12
D113
Footnote
LRC CHK Hi
LRC CHK Lo
END Hi
END Lo
:
0
1
0
3
2
1
0
2
0
0
0
2
D
7
CR
LF
LRC check:
8-bit check sum consists of 2 ASCll codes
End word:
END Hi = CR (0DH), END Lo = LF(0AH)
API
108
CRC
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
ES series models do not support this command (CRC,
CRCP)
K
8-15
: Operand
: Starting device for storing the operation result. CRC check: please
will be divided into high byte and low byte. To perform the operation of
CRC command on
device
numbers and store the result into upper and lower 8-bit of
8-bit conversion mode: When M1161=On, divide hexadecimal data that start from the
source devcie
into high byte (invalid data) and low byte. To perform the
Program
Example
When PLC connects to VFD-S AC drive (RTU Mode, M1143=ON), (16-bit Mode,
M1161=ON), writing transmitting data, H12, in advance into VFD-S parameter address
H2000
M1002
MOV
SET
MOV
transmission
request
H87
Setting communication
D1120 protocol 9600, 8, E, 1
Setting communication
time out 100ms
SET
SET
X10
RS
D100
K8
D120
K8
receiving
completed
Process of receiving data
M1123
RST M1123 receiving completed and flag reset
PLC
8-16
DATA
01 H
06 H
20 H
00 H
00 H
12 H
02 H
07 H
Address
Function
Data address
Data content
CRC CHK 0
CRC CHK 1
The CRC CHK (0,1) above is error check code and it can be calculated by CRC command
(8-bit Mode, M1161=On).
M1000
CRC
D100
K6
D106
CRC check: At the time, 02 H is stored in the lower 8-bit of D106 and 07 H is stored in the
lower 8-bit of D107.
RTU mode of communication data, the format is listed below:
Footnote
START
Address
Function
DATA (n-1)
.
DATA 0
CRC CHK Low
CRC CHK High
END
CRC check:
CRC check starts from Address and ends in Data content. CRC check starts from
Address and ends in Data content. Its calculation is as follows:
Step 1: Load the 16-bit register (the CRC register) with FFFFH.
Step 2: Exclusive OR the first 8-bit byte message command with the 16-bit CRC
register of the low byte, then store the result into the CRC register.
Step 3: Shift the CRC register one bit to the right and fill 0 in the higher bit.
Step 4: Check the value that shifts to the right. If it is 0, store the new value from
step 3 into the CRC register, otherwise, Exclusive OR A001H and the CRC
register, then store the result into the CRC register.
Step 5: Repeat step 3 and 4 and calculates the 8-bit.
Step 6: Repeat Steps 2~5 for the next 8-bit message command, till all the message
commands are processed. And finally, the obtained CRC register value is
the CRC check value. What should be noticed is that the CRC check must
be placed interchangeably in the check sum of the message command.
8-17
SWRD
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command (2 STEPS)
Pulse
Command
Explanation
Program
Example
There are total 8 DIP switchs on the digital switch function card. After using SWRD
command to read value, these 8 switchs are in association with the contact M0 to M7.
M1000
SWRD
K2M0
M0
Y0
M1
MOV
K2M0
D0
CNT
C0
K10
RST
C0
TMR
T0
M2
M3
M4
K100
Footnote
8-18
M1104~M1111 individually.
ECMP
Applicable models
ES
EP
EH
Bit devices
X Y M S
S1
S2
D
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
Command
Explanation
: Comparison value 2 of
or
.
is indicated as constant K or H, the integer value
Program
Example
M10
M11
M12
Footnote
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Values for detail.
8-19
EZCP
Applicable models
ES
EP
EH
Bit devices
X Y M S
S1
S2
S
D
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
Continuous
Pulse
DEZCP
DEZCPP
execution
execution
Note: Operand D occupies 3 continuous devices.
Flag:
None
Operand S should be smaller than operand S .
1
Command
Explanation
Program
Example
X0
DEZCP
M10
M11
M12
D0
D10
D20
M0
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
8-20
RAD
Degree
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S
D
Command
Explanation
Applicable models
ES
EP
EH
Radian
16-bit command
Program
Example
D1
D0
D 11
D 10
degree value
binary floating point
RAD value ( degree X /180)
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
117 D
DEG
Bit devices
X Y M S
S
D
Radian
Word devices
K H KnX KnY KnM KnS T
Degree
D E F
Applicable models
ES
EP
EH
16-bit command
8-21
Command
Explanation
Program
Example
D1
D0
D 11
D 10
radian value
binary floating point
degree value (radian X 180/ )
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
118 D
EBCD
Bit devices
X Y M S
S
D
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command
Command
Explanation
: Data source
: Coverted result
to decimal floating
PLC floating point is operated by the binary floating point format. DEBCD command is
the specific command used to convert binary floating point to decimal floating point.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
8-22
Program
Example
DEBCD
Binary
Floating Point
D1
D0
D0
D2
D3
D2
Real number
[D2] * 10
Exponent
[D3]
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
119 D
EBIN
Bit devices
X Y M S
S
D
Applicable models
EP
EH
D
E F 16-bit command
Command
Explanation
: Data source
: Coverted result
=1234,
.
=1.2345 x 105
to binary floating
and
8-23
Program
Example
1
DEBIN
D0
D2
Exponent
Real number
Decim al
Floating P oint
D1
D0
[D1] * 10
Binary
Floating P oint
D3
D2
[D0]
Before perform floating point operation, must use FLT (API 49) command to convert BIN
Program
Example
2
integer to binary floating point. The source data (the value which will be converted)
should be a BIN integer. However, DEBIN command can be used to convert floating
point value to binary floating point value.
When X0=On, move K314 to D0 and move K-2 to D1 to generate decimal floating point
format (3.14 = 314 10-2).
X0
MOVP K314
D0
K314
D0
[D1]
D1
314 x10
[D0]
-2
MOVP
K-2
D1
DEBIN
D0
D2
K-2
(D1 , D0)
314 x10
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
120 D
EADD
(D3 , D2)
Binary
Floating Point
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
S1
S2
32-bit command (13 STEPS)
D
Continuous
Pulse
Note: Refer to each model specification for usage range.
DEADD
DEADDP
execution
execution
This command must use the double word (32-bit) format,
Flag: M1020 (Zero flag), M1021
only 32-bit command DEADD, DEADDP are available.
(Borrow flag) and M1022
ES series models do not support pulse execution command
(Carry flag)
(DEADDP).
8-24
Command
Explanation
: Addend
: Addition result
and
. All source
data will be operated in floating point format and the result will be also stored in floating
point format.
If the source operand
or
and
can specify the same register number (the same device can be used
). If in this case and on the continuous execution of the DEADD
command, the data in the register will be added one time in every scan program during
the cycle when the condition contact is On. Therefore, the pulse execution command
(DEADDP) is generally used.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When X0=On, add binary floating point value of (D1, D0) and binary floating point
Program
Example
1
X0
DEADD
D0
D2
D10
When X2=On, add binary floating point value of (D11, D10) and K1234 (automatically
Program
Example
2
converted to binary floating point) and store the result in (D21, D20).
X2
Footnote
API
Applicable models
121 D
ESUB
Bit devices
X Y M S
ES
EP
EH
Word devices
KnY KnM KnS T C D E F 16-bit command
S1
S2
32-bit command (13 STEPS)
D
Continuous
Pulse
Note: Refer to each model specification for usage range.
DESUB
DESUBP
execution
execution
This command must use the double word (32-bit) format,
Flag: M1020 (Zero flag), M1021
only 32-bit command DESUB, DESUBP are available.
(Borrow flag) and M1022
ES series models do not support pulse command
(Carry flag)
(DESUBP).
K
H KnX
8-25
Command
Explanation
: Subtrahend
: Subtraction result
is
format and the result will be also stored in floating point format.
If the source operand
or
and
can specify the same register number (the same device can be used
). If in this case and on the continuous execution of the DESUB
command, the data in the register will be subtracted one time in every scan program
during the cycle when the condition contact is On. Therefore, the pulse execution
command (DESUBP) is generally used.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When X0=On, binary floating point value of (D3, D2) is subtracted from binary floating
Program
Example
1
point value of (D1, D0) and the result is stored in (D11, D10).
X0
DESUB
D0
D2
D10
When X2=On, binary floating point value of (D1, D0) is subtracted from K1234
Program
Example
2
(automatically converted to binary floating point) and the result is stored in (D11, D10).
X2
DESUB K1234
D0
D10
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
122 D
EMUL
Bit devices
X Y M S
Applicable models
ES
EP EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command
S1
S2
32-bit command (13 STEPS)
D
Continuous
Pulse
Note: Refer to each model specification for usage range.
DEMUL
DEMULP
execution
execution
This command must use the double word (32-bit) format,
Flag: M1020 Zero flag, M1021
only 32-bit command DEMUL, DEMULP are available.
Borrow flag and M1022 Carry
ES series models do not support pulse execution command
flag
(DEMULP).
8-26
Command
Explanation
: Multiplier
: Multiplication result
is
or
and
can specify the same register number (the same device can be used
). If in this case and on the continuous execution of the DEMUL
command, the data in the register will be multiplied one time in every scan program
during the cycle when the condition contact is On. Therefore, the pulse execution
command (DEMULP) is generally used.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When X1=On, binary floating point value of (D1, D0) is multiplied with binary floating
Program
Example
1
DEMUL
D0
D10
D20
When X2=On, binary floating point value of (D1, D0) is multiplied with K1234
Program
Example
2
(automatically converted to binary floating point) and the result is stored in (D11, D10).
X2
DEMUL K1234
D0
D10
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
123 D
EDIV
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: Refer to each model specification for usage range.
This command must use the double word (32-bit) format,
only 32-bit command DEDIV, DEDIVP are available.
ES series models do not support pulse execution command
(DEDIVP).
K
16-bit command
Applicable models
ES
EP
EH
8-27
Command
Explanation
: Divisor
is
or
will automatically be converted to binary floating point to perform the division operation.
If
is 0 (zero), the operation will fail and will result in an operand error, then this
Program
Example
1
X1
DEDIV
D0
D10
D20
When X2=On, binary floating point value of (D1, D0) is divided by K1234 (automatically
Program
Example
2
converted to binary floating point) and the result is stored in (D11, D10).
X2
DEDIV
D0
K10
D10
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
124 D
EXP
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
This command must use the double word (32-bit) format,
only 32-bit command DEXP, DEXPP are available.
ES series models do not support pulse execution command
(DEXPP).
8-28
16-bit command
Applicable models
ES
EP
EH
Command
Explanation
+1,
]=[
+1,
No matter positive or negative value are valid for S. Specific register D needs to use
32-bit format and floating point for operating. Therefore, S needs to convert to floating
point.
When operand D= e S, e=2.71828 and S is specific source data.
Error flag M1067 and M1068 read D1067 and D1068.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When M0=On, convert (D0, D1) to binary floating point and save in register (D10, D11).
Program
Example
When M1=On, use (D10, D11) to be exponent to perform exponent operation. The
value is binary floating point and save in register (D20, D21).
When M2=On, convert (D20, D21) binary floating point to decimal floating point and
save in register (D30, D31). (at this time, D31 means D30 to the power of 10)
M0
RST
M1081
M1
DEXP
D10
D20
DEBCD
D20
D30
M2
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
125 D
LN
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
This command must use the double word (32-bit) format,
only 32-bit command DLN, DLNP are available.
ES series models do not support pulse execution command
(DLNP).
K
16-bit command
Applicable models
ES
EP
EH
8-29
Command
Explanation
+1,
]=[
+1,
Only positive number is valid for S. Specific register D needs to use 32-bit format and
floating point for operating. Therefore, S needs to convert to floating point.
When operand eD=S, operand D=lnS and S is specific source data.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When M0=On, convert (D0, D1) to binary floating point and save in register (D10, D11).
Program
Example
When M1=On, use (D10, D11) to be real number to perform natural logarithm operation.
The value is binary floating point and save in register (D20, D21).
When M2=On, convert (D20, D21) binary floating point to decimal floating point and
save in register (D30, D31). (at this time, D31 means D30 to the power of 10)
M0
RST
M1081
M1
DLN
D10
D20
DEBCD
D20
D30
M2
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
126 D
LOG
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: Refer to each model specification for usage range.
This command must use the double word (32-bit) format,
only 32-bit command DLOG, DLOGP are available.
ES series models do not support pulse execution command
(DLOGP).
8-30
16-bit command
Applicable models
ES
EP
EH
Command
Explanation
: operand result
device.
Perform logarithm operation to
and
Only positive number is valid for S2 (positive and negative number are valid for S1).
Specific register D needs to use 32-bit format and floating point for operating. Therefore,
S1 and S2 need to convert to floating point.
Consider S1D=S2, D=? Log S1S2=D
Consider S1=5,S2=125, D=log 5125=?
S1D=S25D=125D=log 5125=3
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When M0=On, convert (D0, D1) and (D2, D3) to binary floating point and save in
Program
Example
M1081
D2
D12
D10
D12
D20
D30
M1
D20
M2
DEBCD
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
127 D
ESQR
Bit devices
X Y M S
Applicable models
ES
EP EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command
D
32-bit command (9 STEPS)
Note: Essential condition: S only can be a positive value. (S0)
Continuous
Pulse
DESQR
DESQRP
Refer to each model specification for usage range.
execution
execution
This command must use the double word (32-bit) format,
Flag: M1020 (Zero flag), M1067
only 32-bit command DESQR, DESQRP are available.
(Program execution error)
ES series models do not support pulse execution command
(DESQRP).
K
8-31
Command
Explanation
This command performs a square root operation on the floating point value of source
device
operated in floating point format and the result will be also stored in floating point format.
If the source operand
or
value will automatically be converted to binary floating point to perform the addition
operation.
If operation result of
Program
Example
1
DESQR
(D1, D0)
binary floating point
D0
D10
(D11 , D10)
binary floating point
When X2=On, the square root of K1234 (automatically converted to binary floating
Program
Example
2
X2
Footnote
API
128 D
POW
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command
S1
S2
32-bit command (13 STEPS)
D
Continuous
Pulse
Note: Refer to each model specification for usage range.
DPOW
DPOWP
execution
execution
This command must use the double word (32-bit) format,
Flag: no.
only 32-bit command DPOW, DPOWP are available.
ES series models do not support pulse execution command
(DPOWP).
8-32
Command
Explanation
: exponent device.
and
POW [
+1,
]^[
+1,
]=
Only positive number is valid for S1 and S2. Specific register D needs to use 32-bit
format and floating point for operating. Therefore, S1 and S2 need to convert to floating
point.
When S1S2=D, D=?
If S1=5,S2=3, D=53=?
D=53=125
Error flag M1067 and M1068 read D1067 and D1068.
If absolut of conversion result is larger than max. floating point, carry flag M1022=On.
If absolut of conversion result is less than min. floating point, borrow flag M1021=On.
If conversion result is 0, zero flag M1020=On.
When M0=On, convert (D0, D1) and (D2, D3) to binary floating point and save in
Program
Example
M1081
D2
D12
D10
D12
D20
D30
M1
D20
M2
DEBCD
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
129 D
INT
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
D
Note: Refer to each model specification for usage range.
ES series models do not support this command (INTP,
DINTP).
Applicable models
ES
EP
EH
8-33
Command
Explanation
is converted to BIN
discarded.
This command is the inverse of the API 49 (FLT) command.
If operation result of
Program
Example
integer and the result is stored in (D10). The decimal of BIN integer will be discarded.
When X1=On, the binary floating point value of (D21, D20) will be converted to BIN
integer and the result is stored in (D31, D30). The decimal of BIN integer will be
discarded.
X0
INT
D0
D10
DINT
D20
D30
X1
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
130 D
SIN
Bit devices
X Y M S
S
D
8-34
Word devices
K H KnX KnY KnM KnS T C D E F
16-bit command
Applicable models
ES
EP
EH
S: Radian
R: Result
-2
- 32
-2
-2
3
2
-1
Program
Example
1
When M1018=Off, it is radian mode. When X0=On, specify RAD value (D1, D0).
Calculate SIN value of angle and store the result in (D11, D10). The result stored in
(D11, D10) are all in binary floating point format.
M1002
RST
M1018
DSIN
D0
X0
Program
Example
2
D10
D1
D0
D1
D10
COS value
binary floating point
/ 180)
When M1018=Off, it is radian mode. Select angle from inputs X0 and X1 and convert it
to RAD value to calculate SIN value.
X0
MOVP K30
K6
(K30
D10)
MOVP K60
K6
(K60
D10)
X1
M1000
FLT
Program
Example
3
/180)
binary
floating point
(D21, D20)
binary
floating point
DEMUL D14
D20
D40
D40
D50
DSIN
When M1018=On, it is anlge mode. When X0=On, it designates angle value of (D1,
D0). Angle range is: 0angle value360. After converting to SIN value to save in
(D11, D10) with binary floating point number.
8-35
M1018
DSIN
D0
X0
D1
D0
D 11
D 10
D10
angle value
SIN value
(binary floating point)
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
131 D
COS
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T
C D E F
Command
Explanation
Applicable models
ES
EP EH
16-bit command
Source desgnated by
S: Radian
R: Result
-2
- 32
-2
-2
3
2
-1
8-36
Program
Example
1
Calculate COS value of angle and store the result in (D11, D10). The value in (D1, D0)
and the result stored in (D11, D10) are all in binary floating point format.
M1002
RST
M1018
DCOS
D0
X0
D10
D1
D0
D1
D10
COS value
binary floating point
/ 180)
When M1018=On, it is angle mode. When X0=On, it is angle of specific (D1, D0). Angle
Program
Example
2
range: 0angle360. After converting to COS value, save in (D11, D10) with binary
floating point.
M1002
SET
M1018
DCOS
D0
X0
D1
D0
D1
D 10
D10
angle value
COS value
(binary floating point)
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
132 D
TAN
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F
16-bit command
Applicable models
ES
EP
EH
8-37
-2
-2
Program
Example
1
2
0
-1 1
- 32
2
3
2
When M1018=Off, it is radian mode. When X0=On, specify RAD value (D1, D0).
Calculate TAN value of angle and store the result in (D11, D10). The value in (D1, D0)
and the result stored in (D11, D10) are all in binary floating point format.
M1002
RST
M1018
DTAN
D0
X0
Program
Example
2
D10
D1
D0
D11
D10
TAN value
binary floating point
/ 180)
When M1018=On, it is angle mode. When X0=On, it is angle of specific (D1, D0). Angle
range: 0angle360. After converting to TAN value, save in (D11, D10) with binary
floating point.
M1002
SET
M1018
DTAN
D0
X0
D1
D0
D1
D 10
D10
angle value
TAN value
(binary floating point)
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
8-38
ASIN
Applicable models
ES
EP
EH
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
Command
Explanation
stored.
ASIN value=SIN 1
Following shows the relation between radian and result:
R
S: Radian
R: Result
-1,0
1,0
-2
Program
Example
When X0=On, specify binary floating point (D1, D0). Calculate ASIN value and save the
result in (D11, D10). The result stored in (D11, D10) is all in binary floating point format.
X0
DASIN
D0
D10
D1
D0
D11
D10
ASIN value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
8-39
ACOS
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
S
D
Command
Explanation
stored
ACOS value=COS 1
-1,0
Program
Example
1,0
When X0=On, specify binary floating point (D1, D0). Calculate ACOS value and save
the result in (D11, D10). The result stored in (D11, D10) is all in binary floating point
format.
X0
DACOS D0
D10
D1
D0
D11
D10
ACOS value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
8-40
ATAN
Applicable models
ES
EP
EH
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
Command
Explanation
stored.
ATAN value=TAN 1
Following shows the relation between radian and result:
R
S: Radian
R: Result
2
Program
Example
When X0=On, specify binary floating point (D1, D0). Calculate ATAN value and save
the result in (D11, D10). The result stored in (D11, D10) is all in binary floating point
format.
X0
DATAN
D0
D10
D1
D0
D11
D10
ATAN value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
8-41
SINH
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
S
D
Command
Explanation
stored
SINH value=(es-e-s)/2
When X0=On, specify binary floating point (D1, D0). Calculate SINH value and save the
Program
Example
result in (D11, D10). The result stored in (D11, D10) is all in binary floating point format.
X0
DSINH D0
D10
137 D
COSH
D1
D0
D11
D10
SINH value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
Applicable models
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
S
D
Command
Explanation
Program
Example
8-42
stored
COSH value=(es+e-s)/2
When X0=On, specify binary floating point (D1, D0). Calculate COSH value and save
the result in (D11, D10). The result stored in (D11, D10) is all in binary floating point
format.
138 D
TANH
D1
D0
D11
D10
COSH value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Footnote
API
D10
Applicable models
ES
EP
EH
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command
Command
Explanation
Program
Example
Footnote
stored
TANH value=(es-e-s)/(es+e-s)
When X0=On, specify binary floating point (D1, D0). Calculate ASIN value and save the
result in (D11, D10). The result stored in (D11, D10) is all in binary floating point format.
X0
DTANH D0
D10
D1
D0
D11
D10
TANH value
binary floating point
As for the operation function of floating point, please refer CH 5.3 Handling of Numeric
Values for detail.
8-43
GPWM
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T C D E F 16-bit command
S1
S2
32-bit command (13 STEPS)
D
Continuous
Pulse
Note: Please refer to command explanation for usage range of
DPOW
DPOWP
execution
execution
operand S1, S2 and D.
Flag: no.
Operand S2 occupies 3 devices.
K
Command
Explanation
Program
Example
and pulse
When X0=On, Y10 will output following pulse. When X0=Off, Y10 output will also be
Off.
X0
GPWM
K1000
K2000
Y10
t=1000ms
Output Y10
Footnote
T=2000ms
This command counts by scan cycle so the maximum offset will be a PLC scan cycle.
The value of
and (
8-44
145
Applicable models
ES
EP EH
FTC
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
S3
D
Note: Refer to command explanation for operand S1, S2 and D
usage range.
Operand S3 occupies continuous 6 devices.
Refer to each model specification for usage range.
Refer to footnote for PID usage times in program.
: Target value (SV)
Command
Explanation
FTC
execution
32-bit command
Flag: None
: Parameter
The setting of (
is not these two settings (K0 and K1), this setting will be set to K0.
Operand D usage range is 0~100 to show 0%~100%. User should use with other
commands by heater type when using this command. For example, it can use with
GPWM command to control pulse output as shown in footnote (example 1).
Program
Example
X0
FTC
D0
D1
D100
D150
8-45
is in the following:
The setting of
Device
Function
Usage range
Explanation
Control Diagram:
FTC
Fuzzy
MV
Controller
PV
Temperature
Sensor
SV
D0
Fuzzy
Controller
MV
D10
PWM
Program
Y10
PV D1
Pt Module
Temperature
Sensor
Following time chart is using GPWM command to output Y10. (t is pulse output width
and T is pulse output cycle time)
8-46
T10
The setting of FTC command is sampling time D2=K10 (unit: 10ms) and temperature
unit is D3=K0(). Other example for using with temperature control are shown in
following.
M3
<>
<=
>
D11
D11
D10 D11
K0
K99
FTC
D0
MOV
D10
SET
M4
RST
Y10
CJ
P0
SET
Y10
CJ
P0
SET
Y10
RST
M4
TMR
T10
TMR
T11
RST
Y10
SET
Y10
RST
T10
D11
M4
>
T10
K99
M3
Y10
T11
T10
8-47
SWAP
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
Note: If operand D uses with device F, it is only available in 16-bit
command.
Refer to each model specification for usage range.
The continuous command (SWAP, DSWAP) are only
provided in V4.9(included) or later version of ES series
models and EP/EH series models.
Command
Explanation
Applicable models
ES
EP
EH
Program
Example
1
X0
SWAPP
D0
D0
High Byte Low Byte
Program
Example
2
When X0=ON, swapping upper 8-bit and lower 8-bit of D11 and swapping upper 8-bit
and lower 8-bit of D10.
X0
DSWAP
D11
High Byte
Low Byte
8-48
D10
D10
High Byte
Low Byte
MEMR
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command (7 STEPS)
Continuous
Pulse
m
MEMR
MEMRP
execution
execution
n
32-bit command (13 STEPS)
Note: The setting range of m operand: EP series model:
Continuous
Pulse
DMEMR
DMEMRP
m=0~1,599; EH series models: m=0~9,999.
execution
execution
The setting range of D operand: EP series model:
Flag: M1101 (Please refer the
D2000~D4999; EH series model: D2000~D9999
following footnote for detail)
The setting range of n operand:
16-bit command: EP series model: n=K1~ K1,600; EH
series models: n=K1K8,000.
32-bit command: EP series model: n=K1~ K800; EH series
models: n=K1K4,000.
Refer to each model specification for usage range.
Command
Explanation
: Address (Constant)
EP/EH series models use this command to read the data of file register and store the
read data in the data register.
EP series models provide 1,600 numbers of 16-bit file registers and EH series models
provide 10,000 numbers of 16-bit file registers.
Operand
If operands
and
,
Program
Example
1
16-bit command MEMR reads 100 items data from the 10th address of file register and
store the read data in the data register started from D2000.
When X0=On, the command is executed. When X0 goes to Off, the command is not
executed and the content of previous read data has no change.
X0
MEMR
K10
D2000
K100
Program
Example
2
32-bit command DMEMR reads 100 items data from the 20th address of file register
and store the read data in the data register started from D3000.
When X0=On, the command is executed. When X0 goes to Off, the command is not
executed and the content of previous read data has no change.
X0
DMEMR
K20
D3000
K100
8-49
MEMW
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
n
Note: The setting range of S operand: EP series model:
S=D2000~D4999; EH series model: S=D2000~D9999.
The setting range of m operand:
EP series model: m=K0~K1,599; EH series models:
m=K0~K9,999.
The setting range of n operand:
16-bit command: EP series model: n= K1~ K1,600; EH
series models: n=K1K8,000.
32-bit command: EP series model: n=K1~ K800; EH series
models: n=K1K4,000.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
: Address
data, K1~K8,000
EP/EH series models use this command to read the data of file register and store the
read data in the data register.
EP series models provide 1,600 numbers of 16-bit file registers and EH series models
provide 10,000 numbers of 16-bit file registers.
Operand
If operands
and
,
Program
Example
When X0=On, the double word command DMEMW is executed. Write 100 items 32-bit
data started from D2001, D2000 in the file register address 0 to 199.
When X0=On, the command is executed. When X0 goes to Off, the command is not
executed and the content of previous read data has no change.
X0
DMEMW D2000
K0
K100
EH series models: when EH series PLC startup or goes from STOP to RUN, EH
File Register
series PLC will determine M1101 (if startup the function of file register), D1101 (file
register starts to give number, K0~K9,999), D1102 (numbers of file registers of being
read, K1~K8,000), D1103 (destination device which stores the read data of file register,
specified data register D start to give number, K2,000~K9,999) and decide if
automatically transfer the content of file register to the specified data register.
EH series models: When the value of D1101 is less than 0, or the value of D1103 is
less than 2,000 or more than 9,999, reading data from file register to data register is
disabled.
8-50
Function Explanation
D1103
Destination device which stores the read data of file register, specified
data register D start to give number K2,000~K9,999, Latched, Default is
2,000
8-51
Bit devices
X Y M S
S1
S2
S3
S
n
MODRW
Word devices
H KnX KnY KnM KnS T C D E F
Command
Explanation
MODRW
execution
32-bit command
: Function code
: Address of being
Program
Example
1
9-1
Program
Example
1
hexadecimal data to general register to use. For ES series, other command is invalid
to this area.
Received data is stored in 8 continuous registers that start from D0 and specified by
users in hexadecimal format in RTU mode. At the same time, D1296~D1311 is invalid.
In ASCII mode or RTU mode, PLC will store the transmission data in D1256~D1295.
Users can move these register data to general register by using MOV, DMOV or
BMOV commands. Other commands are invalid to this area.
Data received from AC drive is stored in registers specified by users. After complete
receiving data, PLC will automatically check if the received data is correct. If there is
any fault, M1140 will be set to ON.
If inner data address of AC drive is illegal to specified device, it will have fault code.
Fault code will be stored in D1130 and M1141 will be on. For example, 8000H is illegal
to VFD-S and M1141=ON and D1130=2. Please refer to VFD-S user manual to fault
code.
After M1140=ON or M1141=ON, it will transmit a correct data to AC drive. If received
data is correct, M1140 and M1141 will be reset.
M1002
MOV
H87
SET M1120
MOV
setting communication
protocol 9600, 8, E, 1
D1120
communication protocol
K100 D1129
setting communication
time out 100ms
X10
M1143
X0
MODRW
K1
K3
H2100
D0
K8
X0
SET M1122
M1127
handling received data
ASCII mode : received data is stored in 16 consecutive registers that start
from D0 with ASCII format when in ASCII mode. PLC will convert the content
to hexadecimal and store in registers D1296~D1311 automatically
RTU mode : received data is stored in 8 consecutive registers that start from
D0 and specified by users in hexadecimal type in RTU mode
RST M1127
9-2
VFD-S
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
Explanation
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Data contents
LRC CHK 1
LRC CHK 0
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
Explanation
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Data content
LRC CHK 1
LRC CHK 0
VFD-S
Register
DATA
Explanation
D1256 Low
01 H
Address
D1257 Low
06 H
Function
D1258 Low
20 H
D1259 Low
00 H
Data Address
9-3
Register
DATA
Explanation
D1260 Low
00 H
D1261 Low
12 H
D1262 Low
02 H
D1263 Low
07 H
Data content
(H12)
Program
Example
2
Register
DATA
Explanation
D1070 Low
01 H
Address
D1071 Low
06 H
Function
D1072 Low
20 H
D1073 Low
00 H
D1074 Low
00 H
D1075 Low
12 H
D1076 Low
02 H
D1077 Low
07 H
Data Address
Data content
9-4
MOV
SET M1120
MOV
setting communication
protocol 9600, 8, E, 1
D1120
communication protocol
K100 D1129
setting communication
time out 100ms
X10
M1143
X0
MODRW
K6
K1
H2000
D50
K1
X0
SET M1122
M1127
handling received data
ASCII mode : received data in ASCII format stored in special registers D1070~1078.
RTU mode : received data in hexadecimal format stored in special registers D1070~1078.
RST M1127
VFD-S
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
Explanation
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Data contents
LRC CHK 1
LRC CHK 0
9-5
Register
D1070 Low
D1070 High
D1071 Low
D1071 High
D1072 Low
D1072 High
D1073 Low
D1073 High
D1074 Low
D1074 High
D1075 Low
D1075 High
D1076 Low
D1076 High
DATA
0
1
0
6
0
1
0
0
1
7
7
0
7
1
30 H
31 H
30 H
36 H
30 H
31 H
30 H
30 H
31 H
37 H
37 H
30 H
37 H
31 H
Explanation
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Data content
LRC CHK 1
LRC CHK 0
DATA
D1256 Low
D1257 Low
D1258 Low
D1259 Low
D1260 Low
D1261 Low
D1262 Low
D1263 Low
01 H
06 H
20 H
00 H
00 H
12 H
02 H
07 H
Explanation
Address
Function
Data Address
Data content
The content of
register D50 (H12)
9-6
Register
DATA
D1070 Low
D1071 Low
D1072 Low
D1073 Low
D1074 Low
D1075 Low
D1076 Low
D1077 Low
01 H
06 H
20 H
00 H
00 H
12 H
02 H
07 H
Explanation
Address
Function
Data Address
Data content
CRC CHK Low
CRC CHK High
Function code K16(H10) : write many items WORD data into register
1. PLC connects to VFD-S AC drive. (ASCII Mode when M1143=OFF)
2. PLC connects to VFD-S AC drive. (RTU Mode when M1143=ON)
When in ASCII mode, users store the data that will be wrote to AC drive in ASCII
format in 8 continuous specified register started from D0. Received data from AC drive
will be stored in registers D1070~D1078.
When in RTU mode, users store the data that will be wrote to AC drive in hexadecimal
format in 8 continuous specified register started from D0. Received data from AC drive
will be stored in registers D1070~D1078.
When in ASCII mode or RTU mode, PLC will store the transmission data in registers
D1256~D1295. Users can move these data to general registers by using MOV, DMOV
or BMOV commands. Other commands are invalid to this area.
After complete receiving data, PLC will automatically check if the received data is
correct. If there is any fault, M1140 will be set to ON.
If inner data address of AC drive is illegal to specified device, it will have fault code.
Fault code will be stored in D1130 and M1141 will be on. For example, 8000H is illegal
to VFD-S and M1141=ON and D1130=2. Please refer to VFD-S user manual to fault
code.
After M1140=ON or M1141=ON, it will transmit a correct data to AC drive. If received
data is correct, M1140 and M1141 will be reset.
M1002
MOV
H87
SET M1120
MOV
setting communication
protocol 9600, 8, E, 1
D1120
communication protocol
K100 D1129
setting communication
time out 100ms
X10
M1143
X0
MODRW
K1
K16 H2000
D50
K8
X0
SET M1122
M1127
handling received data
ASCII mode : received data in ASCII format stored in special registers D1070~1078.
RTU mode : received data in hexadecimal format stored in special registers D1070~1078.
RST M1127
9-7
VFD-S
DATA
0
1
1
0
2
0
0
0
0
0
0
2
0
4
0
0
1
2
1
7
7
0
3
0
30 H
31 H
31 H
30 H
32 H
30 H
30 H
30 H
30 H
30 H
30 H
32 H
30 H
34 H
30 H
30 H
31 H
32 H
31 H
37 H
37 H
30 H
33 H
30 H
Explanation
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Number of Register
Byte Count
Data contents 1
Data contents 2
LRC CHK 1
LRC CHK 0
DATA
0
1
1
0
2
0
0
0
0
0
0
2
C
D
30 H
31 H
31 H
30 H
32 H
30 H
30 H
30 H
30 H
30 H
30 H
32 H
43 H
44 H
Explanation
ADR 1
ADR 0
CMD 1
CMD 0
Data Address
Number of Register
LRC CHK 1
LRC CHK 0
9-8
DATA
Explanation
D1256 Low
01 H
Address
D1257 Low
10 H
Function
D1258 Low
20 H
D1259 Low
00 H
D1260 Low
00 H
D1261 Low
02 H
D1262 Low
04 H
D1263 Low
00 H
D1264 Low
12 H
D1265 Low
17 H
D1266 Low
70 H
D1262 Low
C4 H
D1263 Low
7F H
Data Address
Number of Register
Byte Count
Data content 1
Data content 2
Register
DATA
Explanation
D1070 Low
01 H
Address
D1071 Low
10 H
Function
D1072 Low
20 H
D1073 Low
00 H
D1074 Low
00 H
D1075 Low
02 H
D1076 Low
4A H
D1077 Low
08 H
Data Address
Number of Register
9-9
Footnote
commands, cannot use rising-edge contact and falling-edge. Otherwise, the data
stored in received register will be incorrect.
Related flags and special registers of RS-485 communication MODRW command:
Please refer to the footnote of API 80 RS command for more detail information.
Flag/Special
Register
M1120
M1121
M1122
M1123
M1124
M1125
M1126
M1127
M1128
M1129
M1130
M1131
M1140
M1141
M1142
M1143
D1070~D1085
D1120
D1121
D1122
D1123
D1124
D1125
D1126
D1129
D1130
D1256~D1295
D1296~D1311
9-10
Function Description
Communication setting latched. The change of D1120 will be
invalid after setting.
When it is Off, RS-485 of PLC is sending communication data.
Delivery request
Receive completed
Receive waiting message
Receive status disable
STX/ETX system definition selection
MODRD / RDST / MODRW commands data receive completed
Transmitting/receiving indication
Receive time out
Users/system definition STX/ETX
MODRD / MODWR / MODRW data convert to HEX, M1131=ON
MODRD / MODWR / MODRW data receive error
MODRD / MODWR / MODRW command parameter error
VFD-A convenience command data receive error
ASCII/RTU
mode
selection
(use
with
commands
MODRD/MODWR/MODRW) (Off is ASCII mode, ON is RTU
mode)
It is PLC built-in RS-485 communication convenience command.
This command will send messages during executing and if the
receiver receives, it will return messages and save it in
D1070~D1085. Users can view return data by this register
content.
RS-485 communication protocol
PLC communication address.(save PLC communication address,
has latched function)
Remainder characters of delivery data
Remainder characters of received data
Start text definitionSTX
Definition of the first end characterETX1
Definition of the second end characterETX2
Communication time out abnormal. Time unit:ms
Return fault code record of MODBUS
This is PLC built-in RS-485 communication convenience
command MODRW. The message that this command sends
during executing will be saved in D1256~D1295. User can check
according to this register content.
PLC will automatically convert ASCII data saved in the register
specified by users to hexadecimal format.
Bit devices
X Y M S
S
D
PWD
Word devices
H KnX KnY KnM KnS T
C D E F
Command
Explanation
: Source device
Applicable models
ES
EP
EH
PWD
execution
32-bit command
Flag: None
This command is used to detect the On pulse width of X10~X17 inputs and time unit is
100us.
occupy two continuous devices. The longest detectable time is 214,748.3647
seconds, about 3,579.139 minutes, about 59.652 hours.
If the On pulse width is less than 100us, the value of specified
is equal to
0(zero).
Program
Example
API
152
When X0=On, record the On pulse width of input X10 and store in D1, D0.
X0
PWD
X10
D0
Applicable models
EP
EH
RTMU
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F
Note: The limit of S operand is specified as K0~K9
The limit of D operand is specified as K1~K1,000
PWD
execution
32-bit command
Flag: None
Command
Explanation
: Source device
unit is 1us)
The limit range of
9-11
inputted by user is
legal, this command will get the timer started to measure the execution time of I
interrupt and reset the content of special D register specified by
to 0(zero)
simultaneously. When reaching RTMD command, the timer will be closed and
measuring the execution time of I interrupt will end. At the same time, specify the
measuring execution time to the special D register specified by RTMD command.
This RTMU command is used with the next introduced RTMD command and these
two commands are all be used to measure the execution time of I interrupt service
program for the user to deal with high speed response and restrict to providing the
execution time of ISR (Interrupt Service Routine) at the beginning of the program
development.
API
153
Applicable models
EP
EH
RTMD
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
Note: The limit of S operand is specified as K0~K9
PWD
execution
32-bit command
Flag: None
: Source device
Command
Explanation
Program
Example
start a 8-bit timer (unit time is 10us). When reaching RTMD command K0 , close the
timer and store the measurin time in special D register (there are totally ten registers
D1156~D1165 and it is specified as K0~K9).
FEND
M1000
I 001
RTMU
K0
RTMD
K0
D0
M1000
IRET
9-12
Footnote
this command.
Additional Explanation:
1. Due to the time interrupt executed by RTMU command is a less priority (less
important than other interrupts), the timer may not be triggered and cannot count the
time when executing high-speed pulse input counting or specifying high-speed pulse
input during the execution period of RTMU command.
2. If user execute RTMU command but not execute RTMD command before the end of
program interrupt, then the interrupt will not be ended.
3. Please specially notice that RTMU command is executed by starting one inner timer
interrupt of PLC, therefore, the timer may be disordered if execute multiple RTMU or
RTMD commands simultaneously.
D1156~D1165: Special D registers specified by RTMU, RTMD command (numbers is
from K0 to K9).
API
154
RAND
Bit devices
X Y M S
S1
S2
D
Word devices
K H KnX KnY KnM KnS T
Command
Explanation
Applicable models
ES
EP
EH
Random Number
Pulse
executioin
Flag: No
When user inputs S1 > S2, PLC will occur operand error and wont execute it, and
then M1067, M1068=On, and records error code 0E1A(HEX) in D1067.
Program
Example
When X10=On, the random number that produced during lower bound D0 and upper
bound D10 will save in D20.
X10
RAND
D0
D10
D20
9-13
S
D1
D2
ABSR
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
16-bit command
DABSR
execution
Flag: For the description of M1010,
M1029, M1030, M1334, M1335,
M1336, M1337, M1346, please
refer to the footnote.
Note: Operand S occupies 3 continuous devices
Operand D1 occupies 3 continuous devices
Operand D2 occupies 2 continuous devices
Refer to each model specification for usage range.
There is no 16-bit command for API 55, only 32-bit
command, DABSR is available and it can only be used for
ONCE in program.
Command
Explanation
Applicable models
ES
EP
EH
This command provides continuous absolute position data read function of mitsubishi
servo drive MR-J2 (with absolute position check function).
: Input signal from Servo
and
+1,
+2. Device
+2 is connected
to ABS data request signal. Please see the wiring drawing below for details.
PLC
DVP32EH00T
SERVO AMP
MR-J2-A
+24V
S/S
X0
X1
X2
24G
Y4
Y5
Y6
C4
9-14
ABS(bit 0)
ABS(bit 1)
transmission data is ready
SERVO ON
ABS transmission mode
ABS requirement
CN1B
VDD
D01
ZSP
TLC
SG
4
19
6
10
SON
ABSM
ABSR
5
8
9
+1.
position data should be stored in the current value registers (D1337, D1336)
corresponding to CH0 pulse or the current value registers (D1339, D1338) corresponding
to CH1 pulse, so it is recommanded to specify these two registers. If specify other
devices, finally, the user still have to transmit the data into the current value registers
(D1337, D1336) corresponding to CH0 pulse or the current value registers (D1339,
D1338) corresponding to CH1 pulse.
When DABSR command drvie contact turns ON and read starts, the command execution
completed flag M1029, M1030 will be energized. The flags must be reset by user.
When driving the DABSR command, please specify normally open contact. If the drive
contact of DABSR command turns Off when DABSR command read starts, the execution
of absolute current value read will be interrupted and result in incorrect data. Please be
careful and notice that.
If the drive contact of DABSR command turns Off after the read is completed, the Servo
On (SON) signal connected to
Program
Example
When X7= On, the absolute position data (32 bit) read from Servo should be stored in the
current value register (D1337, D1336) corresponding to CH0 pulse. At the same time,
drive a timer T10 to count 5 second. If over 5 second and the absolute position data (32
bit) read not complete, it will drvie M10=On and this means the absolute position data (32
bit) read is abnormal.
When connecting to system, please set the power of DVP-PLC and SERVO AMP to be
On at the same time or set the SERVO AMP to be ON earlier than the power of DVP-PLC.
X7
DABS
X0
Y4
TMR
T0
K50
D1336
M11
ABS read completed
T0
M10
Read overtime
M1029
SET
execution completed
flag
M11
9-15
PLC Controller
DVP-20EH
+
24V
SERVO AMP
MR-H-A
X0
X1
X2
COM
Y4
Y5
Y6
COM4
ABS(bit 0)
ABS(bit 1)
SERVO AMP
MR-J2-A
CN1
SERVO ON
ABS data transmitting mode
ABS data request
CN1B
PF
ZSP
TLC
SG
24
23
25
16
X0
X1
X2
COM
SON
D13
D14
12
44
45
Y4
Y5
Y6
D01
ZSP
TLC
SG
4
19
6
10
SON
ABSM
ABSR
5
8
9
Footnote
When DABSR command starts to execute, it will drive the signal of Servo On (SON)
and ABS data transmitting mode to output.
By the transmitting data ready flag and ABS request signal can confirm the
transmission and receipt of both sides and process the data transmission of current
value position data (32 bit) plus check data (6 bit).
Data is transmitted by ABS (bit0, bit1) two bits.
SERVO ON
SON
ABS data
transmitting mode ABSM
Transmitting
data ready
TLC
ABS data
request
ABSR
ABS(bit 1)
ABS(bit 0)
AMP output
Controller output
ZSP
AMP output
D01
AMP output
Current value position data 32-bit
+(plus) check data 6-bit
9-16
Complete zero point return by using reset signal function to execute API 156 ZRN
command.
2.
After using JOG or manual operation to adjust the zero point position of the
equipment, input reset signal SERVO AMP. As for the reset signal input, please refer
to the external switches diagram below to see if using DVP-PLC controller to output.
For the detail of the wiring between DVP-PLC and Mitsubishi MR-J2-A, please
refer to the API 159 DRVA.
Use M itsubishi MR-J2as example
reset
CR
SG
10
Flags description:
M1010:
In EH series MPU, when M1010= On, CH0 (Y0, Y1) and CH1 (Y2, Y3) will
output pulse while END command is executed. When output starts, M1010 will
automatically turn Off.
M1029:
In EH series MPU, M1029=On after the first group pulse (Y0, Y1) pulse output
complete or other relative command complete execution.
M1030:
In EH series MPU, M1030= On after the second group pulse (Y2, Y3) pulse
output complete.
M1334:
In EH series MPU, CH0 (Y0, Y1) pulse stop output when M1334= On.
M1335:
In EH series MPU, CH1 (Y2, Y3) pulse stop output when M1335= On.
M1336:
In EH series MPU, CH0 (Y0, Y1) pulse output indication flag
M1337:
In EH series MPU, CH1 (Y2, Y3) pulse output indication flag
M1346:
In EH series MPU, ZRN command CLEAR output signal enable flag
Special registers description:
D1337, D1336:
1. D1337(HIGH WORD), D1336(LOW WORD) represents the
current value registers of positioning control commands (API 156
ZRN, API 157 PLSV, API 158 DRVI, API 159 DRVA) output to the
first output group Y0, Y1, the current value increases or decreases
in accordance with the direction of rotation.
2. D1337(HIGH WORD), D1336(LOW WORD) represents the total
number of output pulse of pulse output commands (API 57 PLSY,
API 59 PLSR) output to the first output group Y0, Y1.
D1338, D1339:
1. D1339(HIGH WORD), D1338(LOW WORD) represents the
current value registers of positioning control commands (API 156
ZRN, API 157 PLSV, API 158 DRVI, API 159 DRVA) output to the
second output group Y2, Y3, the current value increases or
decreases in accordance with the direction of rotation.
2. D1339(HIGH WORD), D1338(LOW WORD) represents the total
number of output pulse of pulse output commands (API 57 PLSY,
API 59 PLSR) output to the first output group Y2, Y3.
DVP-PLC Application Manual
9-17
D1341, D1342:
D1343:
API
156 D
S1
S2
S3
D
ZRN
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
Command
Explanation
Applicable models
ES
EP
EH
ZRN
execution
DZRN
execution
Flag: For the description of M1010,
M1029, M1030, M1334, M1335,
M1336, M1337, M1346, please refer
to the footnote of API 155 ABSR
command.
: Creep speed
9-18
When executing API 158 DRVI and API 159 DRVA command, the PLC store the
FWD/REV pulse which increase or decrease during operation in current vlaue
registers (Y0: D1337,D1336, Y2: D1339, D1338) so that it can always know the
machine position. However, the data may lost when the power of PLC is Off.
Therefore, the machine should execute zero point turn during initial operation to input
the zero point.
Program
Example
When M10= On, a frequency of 20KHz outpus from Y0 and zero point return will be
energized. When it reaches the near point signal (DOG), X5= On and it will change to
creep speed. Then, a frequency of 1KHz outpus from Y0 and the command will be
energized. Pulses output will stop until X5=Off.
M10
ZRN
K20000 K1000
X5
Y0
Footnote
1.
When reset flag M1346= On, the reset signal is sent to the servo drive when zero
point trun is completed.
2.
Creep speed
ON
scan in circle
DOG ON
OFF
reset signal
Reset signal Y4 or Y5
about 20ms
+ 1 scan time
inside 1ms
ON
M1336, M1337
Pulse output monitor OFF
2.
When the Near point signal (DOG) goes from Off to On, it will decelerate to Creep
speed
3.
When the Near point signal (DOG) goes from On to Off and the same time of pulse
output stop, the content value of current value register (D1337, D1336) of CH0
pulse or current value register (D1339, D1338) of CH1 pulse will be 0(zero). Also,
if the reset signal flag M1346= On, the reset signal Y4 or Y5 will output
simultaneously.
9-19
When the operation of pulse output is completed and flag M1029, M1030 is
activated, indication flag M1336 sent by CH0 pulse or indication flag M1337 sent
by CH1 pulse will be Off.
5.
Hence, the command can not search the position of Near point signal (DOG) and
the operation of ZRN command only can be processed in unidirection. In the
operation of ZRN command, the content value of current value register (D1337,
D1336) of CH0 pulse or current value register (D1339, D1338) of CH1 pulse will
decrease.
Near point
signal
LSR
(Backward limit) (DOG)
ON switch near
zero point
DOG
LSF
(Forward limit)
Motor
Front end
Back end
Backward
Forward
decelerate to
Creep speed
initial position
Zero return speed
6.
This command is applicable to the Servo motor equipped with absolute positioning
function is connected, such as Mitsubishi MR-H-A Servo drive, MR-J2-A Servo
drvie. It can record current position even the power is Off. Besides, because the
current position of the servo drive can be read by API 155 ABSR command of
DVP-EH series PLC, the ZRN command should only be executed for one time.
After the power is Off, it is unnecessary to execute the ZRN command again.
7.
When CH0 and CH1 pulse execute the ZRN command, the current value of pulse
output frequency will display in (D1394, D1395) and (D1396, D1397). After the
operation of ZRN command is completed, the last output frequency value will be
stored in (D1394, D1395) and (D1396, D1397).
8.
When the drive contact of ZRN command is On, CH0 and CH1 pulse will read the
content value set by D1343t as aeceleration time. After accelerating to zero point
return speed, wait for the entry of the near point signal (DOG) and output the creep
speed of low speed by decelerating. Immediately stop output pulse when the near
point signal (DOG) turns Off..
9-20
Bit devices
X Y M S
S1
D1
D2
PLSV
Word devices
K H KnX KnY KnM KnS T C D E F
Note: Please refer to the command explanation for the information
of the usage range of Operand S1, S2, D.
Command
Explanation
Applicable models
ES
EP
EH
PLSV
execution
is positive (+),
is On. When
is negative (-),
is
Off.
PLSV command do not has acceleration/deceleration setting function. Therefore,
acceleration/deceleration are not performed at start and stop. If cushion start and stop
is desired, please increase or decrease the output pulse frequency by using API 67
RAMPcommand.
If the drive contact turns Off while PLSV command execute to output pulse, the
machine will stop without deceleration.
When the drive contact of PLSV command truns Off, it is impossible to drive PLSV
command again even if the pulse send indication flag M1336 of CH0 pulse or pulse
send indication flag M1337 of CH1 pulse is set.
Program
Example
When M10= On, a frequency of 20KHz outputs from Y0. Y5= On represents the
positive direction.
M10
PLSV
K20000
Y0
Y5
9-21
Bit devices
X Y M S
S1
S2
D1
D2
Word devices
H KnX KnY KnM KnS T C D E F
Note: Please refer to the command explanation for the
information of the usage range of Operand S1, S2, D1, D2.
Command
Explanation
Applicable models
ES
EP
EH
Drive to Increment
DRVI
DRVI
execution
DDRVI
execution
Flag: For the description of M1010,
M1029, M1030, M1334,
M1335, M1336, M1337,
M1346, please refer to the
footnote.
are:
are:
is positive (+),
is On. When
is negative (-),
is
Off.
The numbers of pulses will be stored in current value register (D1337 high byte, D1336
low byte) of CH0 pulse or current value register (D1339 high byte, D1338 low byte) of
CH1 pulse. When rotation direction is negative, the content value of current value
register will decrease.
The contents of each operand can not be changed while the DRVI command is
executed. The contents will be changed when the next execution is driven.
If the drive contact turns off when the DRVI command is executed, the machine will
decelerates and stops and the execution completed flag M1029, M1030 does not turn
On.
9-22
Program
Example
When M10= On, twenty thousands (20000) of 2KHz frequency pulses outputs from Y0
(relative positioning). Y5= On represents the positive direction.
M10
DRVI K20000 K2000
Y0
Y5
Operation explanation of relative positioning control: Using a positive or a negative
Footnote
symbol to specify travel distance from the current position is also a kind of drive method
of relative positioning control.
+3,000
Current
position
-3,000
Actual
acceleration
time
Output pulse
frequency
First step
acceleration
(D1340)
Current
position
Last step
deceleration
(D1340)
Accel/Decel time
Accel/Decel time
Output pulse
numbers
The minimum value of output pulse frequency which can be actually used is deternined
by the following equation:
1. Minimum value of output pulse frequency =
MaxSpeed [D1342,D1341]Hz ( 2 (Acceleration\Deceleration [ D1343]ms 1000 ))
equation
above
9-23
2.
the calculation value, 500 Hz), the frequency of 500 Hz will be still be used when
output the pulses.
3.
output pulse frequency for the first step acceleration and last step deceleration will
still be the calculation value, 500 Hz.
50000Hz
500Hz
500Hz
Flags description:
M1010:
In EH series MPU, when M1010= On, Y0, Y1 and Y2, Y3 will output pulse
while END command is executed. When output starts, M1010 will
automatically turn Off.
M1029:
M1030:
9-24
M1334:
In EH series MPU, CH0 (Y0, Y1) pulse stop output when M1334= On.
M1335:
In EH series MPU, CH1 (Y2, Y3) pulse stop output when M1335= On.
M1336:
M1337:
M1346:
2.
Operates as the frequency setting of the first step acceleration and last
step deceleration when positioning control commands (API 156 ZRN,
API 158 DRVI, API 159 DRVA) are executed.
Setting range: 1/10 or less of maximum speed (D1342, D1341)
If the current value exceeds the range, it is automatically set to 1/10 of
the maximum speed during operation.
3. Note: When controlling stepping motor, please consider the
resonance of stepping motor and limit of initial frequency while
setting speed.
9-25
Bit devices
X Y M S
S1
S2
D1
D2
DRVA
Word devices
H KnX KnY KnM KnS T C D E F
Note: Please refer to the command explanation for the
information of the usage range of Operand S1, S2, D1, D2.
Command
Explanation
Applicable models
ES
EP
EH
DRVA
execution
DDRVA
execution
Flag: For the description of M1010,
M1029, M1030, M1334, M1335,
M1336, M1337, M1346, please refer
to the footnote of API 158 DRVI
command.
32-bit command: -2,147,483,648 ~ +2,147,483,647. The positive (+) and negative (-)
symbol indicates the forward and reverser direction.
is specified as the pulse output frequency. The available numbers of
are:
is positive (+),
is On. When
is negative (-),
is
Off
The numbers of pulses will be stored in current value register (D1337 high byte, D1336
low byte) of CH0 pulse or current value register (D1339 high byte, D1338 low byte) of
CH1 pulse. When rotation direction is negative, the content value of current value
register will decrease.
The contents of each operand can not be changed while the DRVA command is
executed. The contents will be changed when the next execution is driven.
If the drive contact turns off when the DRVA command is executed, the machine will
decelerates and stops and the execution completed flag M1029, M1030 does not turn
On. D1343 is used to set acceleration / deceleration time.
When the drive contact of DRVA command turns Off, it is impossible to drive DRVA
command again even if the pulse send indication flag M1336 of CH0 pulse or pulse
send indication flag M1337 of CH1 pulse is set.
9-26
When M10= On, twenty thousands (20000) of 2KHz frequency pulses outputs from Y0
(absolute positioning), Y5= On represents the positive direction.
M10
DRVA K20000 K2000
Y0
Y5
Operation explanation of absolute positioning control: Specifying travel distance from a
Footnote
Target position
Zero point
0
Fa accelerated gradient
(D1340)
(D1340)
T Accel/Decel time
Accel/Decel time
The relation between actual frequency and acceleration / deceleration time is in the
following:
Tg: sampling time of acceleration / deceleration
T: acceleration / deceleration time
Fa: acceleration / deceleration gradient
F: Max. frequency
F0: first step acceleration, last step deceleration
P: total pulse number
1. Tg = T / ( 60 * 1000 )
2. Fa = (F F0) / 60
3. P0 (output pulse number of first step (acceleration)/last step (deceleration)) = 1
4. Each segment frequency:
i. F(n) = F0 + Fa * n ( n = 1~60)
5. Output pulse number of each segment:
P(n) = Tg * F (n)
Restriction:
1. When each segment of output pulse number P(n)1, PLC wont output pulse and
jump to next segment.
2. Speed of first step (acceleration) and last step (deceleration) F0 cant less than
10Hz. If it is less than 10Hz or larger than max. output frequency, it will output 10Hz.
DVP-PLC Application Manual
9-27
EH MPU
ASDA series
220VAC
single-phase
N
+24V
W
CN1
S/S
DO_COM
24G
X0
start
X1
X2
JOG(+)
JOG(-)
X3
stop
X5
error reset
X6
forward limit
X7
reverse limit
DI 1 : servo start
X10
SRDY
X11
ZSPD
X12
TPOS
X13
ALARM
X14
DO1+
DO1-
17
DO2+
COM+ 11
DO2-
CN1
VDD
X4
servo motor
220VAC
3-phase power
24V
DI 1
DO3+
DI 5
33
DO3DO4+
DI 6
32
DI 7
31
26 DO4-
DI 8
30
SRDY
ZSPD
TPOS
ALARM
DO_COM
COM- 50
DI 5 : servo reset
DI 6 : forward limit
CN2
DI 7 : reverse limit
DI 8 : emergency stop
CN1
/OZ
Encoder
Error
Counter
24
COM- 45
Electric
Gear
pulse clear
DI 2
Y2
Y0
pulse output
200KPPS
/PLS 43
COM- 47
C0
Y1
10
COM- 45
C2
forward/reverse direction
C1
/SIGN 36
COM- 49
DVP32EH00T
Note:
Please connect forward/reverse limit switch to SERVO AMP.
Wiring example of connection between DVP-EH series PLC and a Mitsubishi
MR-J2-A Servo drive:
9-28
EH MPU
MR-J2 series
single power
N
+24V
CN1A
S/S
CN1B
24G
SON
X0
start
RES
14
X1
LSP
16
X2
JOG(+)
LSN
17
X3
JOG(-)
TL
X4
stop
X5
error reset
X6
forward limit
reverse limit SONG servo start
RESG servo reset
X7
X10
X11
X12
X13
X14
Rcal1
Rcal2
Rcal3
EMG 15
SG
14
RD
Rc3
18
INP
Rc2
18
ALM
VDD
CN1B
Rc1
10
24V
13 COM
CN2
SV-READY
Z phase signal
(zero point signal)
servo motor
220VAC
220VAC
3-phase power
CN1A
OP
14
LG
Encoder
Error
Counter
Electric
Gear
Y2
pulse clear
C2
Y0
SG
20
pulse output
C0
Y1
CR
PP
SG
10
forward/reverse direction
C1
NP
SG
10
200KPPS
DVP32EH00T
Do not drive the position control commands which use the same output CH0(Y0,
Y1) or CH1(Y2, Y3) simultaneously. Otherwise, they will be treated as double coils
and can not function correctly.
2.
Notes when using position control commands API 156 ZRN, API 157 PLSV, API 158
DRVI, API 159 DRVA with pulse output commandsAPI 57 PLSY, API 58 PWM, API 59
PLSR:
9-29
2.
3.
1.
2.
U/D FLAG
1-phase 2 outputs (frequency limit is 10KHz)
3.
D
2-phase 2 outputs (frequency limit is 10KHz)
A
B
Please follow the PLC output settings above to set the pulse input type of parameters
on SERVO AMP or stepping motor.
Flags description:
M1010:
In EH series MPU, when M1010= On, CH0 (Y0, Y1) and CH1 (Y2, Y3) will
output pulse while END command is executed. When output starts, M1010 will
automatically turn Off.
M1029:
In EH series MPU, M1029= On after first group pulse CH0 (Y0, Y1) pulse
output complete or other relative commands complete execution.
M1030:
In EH series MPU, M1030= On after second group pulse CH1 (Y2, Y3) pulse
output complete.
M1334:
In EH series MPU, CH0 (Y0, Y1) pulse stop output when M1334= On.
M1335:
In EH series MPU, CH1 (Y2, Y3) pulse stop output when M1335= On.
M1336:
In EH series MPU, CH0 (Y0, Y1) pulse output indication flag
M1337:
In EH series MPU, CH1 (Y2, Y3) pulse output indication flag
M1346:
In EH series MPU, ZRN command output signal enable flag
9-30
The phase setting of the second output group Y2, Y3: determine by the last two
bits of D1221, other bits are invalid.
1. K0: Y2 output
2. K1: Y2, Y3 AB phase output, A leads B
3. K2: Y2, Y3 AB phase output, B leads A
4. K3: Y3 output
When several high speed pulse output commands (PLSY, PWM, PLSR) and position
control commands (ZRN, PLSV, DRVI, DRVA) all use Y0 to output pulse in one
program and simultaneously been executed in the same scanning cycle, PLC will
perform the command which has fewest step numbers.
Programming example for forward/reverse operation:
For wiring, please refer to the wiring example of connection between DVP-EH series
PLC and a Mitsubishi MR-J2-A Servo drive.
There is one operation positionng is performed by using the absolute position method
shown below:
500000
Zero point
500Hz
500Hz
Acceleration/
Deceleration time
200ms
9-31
M1346
Stop
M1000
S0
S10 S11
S12
S13
S1334
M5
Operation is stopped
M1002
DMOV
K10000
D1341
MOV
K200
D1343
9-32
M5
Zero point
return
X2
Operation
being stopped
RST
M10
RST
M12
RST
M13
SET
S0
RST
M12
RST
M13
SET
S10
RST
M12
RST
M13
SET
S11
RST
M12
RST
M13
SET
S12
RST
M12
RST
M13
SET
S13
M5
Operation
being stopped
JOG(+)
2
X3
M5
Operation
being stopped
JOG(-)
2
X4
M5
Positioning
in normal
rotation
X5
Zero point
Operation
being stopped return
completed
flag
M5
Positioning
in reverse
rotation
M10
M10
Zero point
Operation
being stopped return
completed
flag
2. The maximum size of a JOG command is 999,999 pulses, as this is equal to the
maximum number of output pulses for API 158 DRVI command. If a greater distance is
required, please execute the JOG command again.
9-33
M50
DZRN
Zero point
return
K50000
K5000
Zero point
return
speed
Creep
speed
X6
Y0
Near point
Pulse output
signal (DOG) device
M1029
Execution
completed
SET
M10
RST
S0
M1336 M50
Y0 being
output
M1000
M50
S10
JOG(+)
X2
M51
DDRVI K999999 K30000
JOG(+)
Y0
Output
Output pulse Output
pulse
numbers
pulse
(maximum
frequency device
value in (+)
direction)
M1336 M51
RST
S10
Y0 being
output
Y4
Rotation
direction
signal output
device
M1000
M51
S11
X3
M52
DDRVI K-999999 K30000
JOG(-)
JOG(-)
Output
Output pulse Output
pulse
numbers
pulse
(maximum
frequency device
value in (-)
direction)
M1336 M52
RST
Y0 being
output
M1000
Y0
S11
Y4
Rotation
direction
signal output
device
3
M52
RUN monitor
3. In order to prevent position control commands being driven at the same time, the
command drive timing is delayed by one scanning cycle.
9-34
M53
Positioning
in normal
rotation
Y0
SET
M12
RST
M12
M1336 M53
Y0 being
output
Y4
M1000
M53
S13
M54
DDRVA K100
Positioning
in reverse
rotation
K100000
M1029
Y0
Y4
SET
M13
RST
M13
Execution
completed
M1336 M54
Y0 being
output
M1000
M54
RET
END
API
160
TCMP
S1
S2
S3
S
D
Time Compare
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T
Note: The range of operand S1, S2, S3: S1=0~23, S2 =S3=S0~59
Operand S occupies 3 continuous devices.
Operand D occupies 3 continuous devices.
Refer to each model specification for usage range.
Flag: None
9-35
Command
Explanation
: setting
: Comparison result
,
and
+1 is the minute of
content is K0~K59.
The current time of real time clock specified by
Program
Example
(D20~D22) is compared to the set value 12:20:45 and the result is shown at
M10~M12. When X10 goes from OnOff, the command is not executed but the
On/Off state before M10~M12 is kept.
Connect M10~M12 in series or in parallel and then the result of , , are given.
X10
M10
TCMP
K12
K20
K45
D20
M10
ON when 12:20:45
>
ON when 12:20:45
ON when 12:20:45
<
M11
M12
API
161
TZCP
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T
S1
S2
S
D
Note: Operand S1, S2, S occupies 3 continuous devices.
S1 should be less than S2, i.e. S1 S2
Operand D occupies 3 continuous devices.
Refer to each model specification for usage range.
9-36
Applicable models
ES
EP
EH
D E F
Flag: None
Command
Explanation
time clock
: Comparison result
+1,
+1,
+1,
S ,
exceeds the range, it will result in operation error. At this time, the
command wont be executed and M1067=On, M1068=On, records error code 0E1A
(HEX) in D1067.
If
<
situations,
is On. If
>
.)
When X10= On, the command is executed and one of M10~M12 will be On. When
Program
Example
X10=Off, the command is not executed but the state of M10~M12 before X10=Off is
kept.
X10
TZCP
D0
D10
D20
M10
M10
ON when
M11
ON when
M12
ON when
API
162
TADD
S1
S2
D
Time Addition
Bit devices
X Y M S
Applicable models
ES
EP
EH
Word devices
H KnX KnY KnM KnS T
D E F
Command
Explanation
: Time addend
: Addition result
is added to
.
,
this time, the command wont be executed and M1067=On, M1068=On, records error
code 0E1A (HEX) in D1067.
If the addition result is in a value greater than 24 hours, the Carry flag M1022=On. The
value of the result shows in
If the addition result is equal to 0 (zero, 0 hour, 0 minute, 0 second), the Zero flag
M1020= On.
When X10= On, the command is executed. Add the time data specified by D0~D2 and
Program
Example
X10
TADD
D0
D10
D20
8
10
20
6
40
6
14
50
26
08:10:20
06:40:06
14:50:26
If the addition result is in a value greater than 24 hours, the Carry flag M1022=On.
X10
TADD
API
163
TSUB
Bit devices
X Y M S
D0
D20
18
40
30
11
30
8
6
10
38
18:40:30
11:30:08
06:10:38
Applicable models
ES
EP
EH
Time Subtraction
Word devices
K H KnX KnY KnM KnS T C
S1
S2
D
Note: Operand S1, S2, D occupies 3 continuous devices.
Refer to each model specification for usage range.
ES series models do not support this command
TSUBP).
9-38
D10
D E F
(TSUB,
Command
Explanation
: Time Subtrahend
: Subtraction result
is subtracted
.
,
this time, the command wont be executed and M1067=On, M1068=On, records error
code 0E1A (HEX) in D1067.
If the subtraction result is a negative value (less than 0), the Zero flag M1020= On.
The value of the result shows in
If the subtraction result is equal to 0 (zero, 0 hour, 0 minute, 0 second), the Zero flag
M1020= On.
Except using API 166 TRD command, MOV command also can be used to move the
special register D1315 (Hours), D1314 (Minutes), D1313 (Seconds) to the three
registers specified to read the current time of real time clock.
Program
Example
When X10= On, the command is executed. The time data specified by D10~D12 is
subtracted from the time data specified by D0~D2 and the result is stored in the
register specified by D20~D22.
X10
TSUB
D0
D10
D20
20
20
5
14
30
8
5
49
57
20:20:05
14:30:08
05:49:57
If the subtraction result is a negative value (less than 0), the borrow flag M1021= On.
X10
TSUB
D0
D10
D20
5
20
30
19
11
15
10
9
15
05:20:30
19:11:15
10:09:15
9-39
Applicable models
ES
EP
EH
Word devices
K H KnX KnY KnM KnS T C D E F
D
Note: Operand D occupies 7 continuous devices.
Refer to each model specification for usage range.
166
TRD
Bit devices
X Y M S
32-bit command
Command
Explanation
D1319 is read as a two digit number and this setting can be change to a four digit
number, please refer the footnote of API 167 TWR command for the detail.
Program
Example
When X0=On, read the current time of perpetual calender to the specified register
D0~D6.
The content of D1318: 1 is indicated Monday, 2 is indicated Tuesday,, 7 is indicated
Sunday.
X0
TRD
Special D
device
D1319
Meaning
Content
00~99
1~7
D1
D1317
Year (A.D.)
Day
(Mon.~Sun.)
Month
General D
device
D0
1~12
D2
Year (A.D.)
Day
(Mon.~Sun.)
Month
D1316
Date
1~31
D3
Date
D1315
Hours
0~23
D4
Hours
D1314
Minutes
0~59
D5
Minutes
D1313
Seconds
0~59
D6
Seconds
D1318
9-40
D0
Meaning
Footnote
Device
M1016
Name
year display
of perpetual
calender
M1017
30 seconds
correction
M1076
perpetual
calender fault
Function
It displays 2 right-most digit number of year of D1319
when it is Off.
It displays (2000+ 2 right-most digit number of year of
D1319) when it is On.
It will correct when it is from Off On. (if it is 0-29
seconds, it will reset to 0. If it is 30-59 seconds, add 1 to
minute and set 0 to second)
It will be On when setting is out of range or run out of
battery. (it only check when power is on)
Device
D1313
D1314
D1315
D1316
D1317
D1318
D1319
Name
Second
Minue
Hour
Day
Month
Week
Year
Range
0-59
0-59
0-23
1-31
1-12
1-7
0-99 (two right-most digit number of year)
SET
M1016
2. It will display 4 bits (two right-most digit number + 2000) to replace original 2 digit
number.
3. If you want to write new time setting in 4 digit number display mode, only 2 digit
number you can write in and its range is 00-99 which corresponds to year
2000-2099. For example, 00=year 2000, 50=year 2050 and 99=year 2099.
9-41
TWR
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S
Note: Operand D occupies 7 continuous devices.
Refer to each model specification for usage range.
Command
Explanation
time, the command wont be executed and M1067=On, M1068=On, records error
code 0E1A (HEX) in D1067.
Program
Example
1
When X0= On, write the correct current time in the built-in perpetual calender clock.
X0
TWRP D20
Meaning
Content
Special D
device
Meaning
D20
Year (A.D.)
00~99
D1319
Year (A.D.)
D21
Day
(Mon.~Sun.)
1~7
D1318
Day
(Mon.~Sun.)
D22
Month
1~12
D1317
Month
D23
Date
1~31
D1316
Date
D24
Hours
0~23
D1315
Hours
D25
Minutes
0~59
D1314
Minutes
D26
Seconds
0~59
D1313
Seconds
9-42
General D
device
Set the current time of perpetual calender and adjust the time to 2002/03/23, Tuesday,
15:27:30 (please refer the following program example).
The content of D0~D6 is the new setting time of perpetual calender.
When X10= On, then can change the current time of perpetual calender clock to
setting time.
When X11=On every time, the perpetual calender clock will perform the 30 seconds
correction. Correction means that if the second hand of perpetual calender colock is
located between 1~29, the second time will be automatically calculated as 0 (zreo)
second and the minute time wont change. However, if the second hand of perpetual
calender colock is located between 30~59, the second time will also be automatically
calculated as 0 (zreo) second but the minute time will increase 1 minute.
X10
MOV
K02
D0
Year (2002)
MOV
K2
D1
Day (Tuesday)
MOV
K3
D2
Month(March)
MOV
K26
D3
Date
MOV
K15
D4
Hours
MOV
K27
D5
Minutes
MOV
K30
D6
Seconds
TWR
D0
X11
M1017
Footnote
30 seconds correction
2. The year display will switch from two digit number to four digit number after the first
scan program when PLC is running. K2,000 in the command is a fix value.
3. If the new setting time is desired to be written in under the four digit number mode,
also only two digit number can be written in. The range for the year of two digit
number is 0~99. Hence, the corresponding range for the year of four digit number
is 1980~2079.
9-43
API
169 D
HOUR
Bit devices
X Y M S
Applicable models
ES
EP
EH
Hour Meter
Word devices
H KnX KnY KnM KnS T C D E F
S1
S2
D
Note: Operand S only can use 16-bit command when using F
device.
Operand D1 occupies 2 continuous devices.
Refer to each model specification for usage range.
Command HOUR can be used for four times in program.
Command
Explanation
HOUR
execution
32-bit command
Continuous
DHOUR
execution
Flag: None
K1~K32,767.
: current time suring counting and unit is hour. Its setting range is
K1~K32,767.
: output device.
and
+1 need to clear to 0.
+3 need to clear to 0.
When 32-bit timer counts up to max. value (2,147,483,647 hours and 3,599 seconds)
of 16-bit, it will stop. If you want to recount,
Program
Example
1
+3 need to clear to 0.
For 16-bit command: When X0=On, Y10 will turns On and start to count time. When
the time reaches 100 hours, Y0 will turns On and D0 will record the current time (unit
is hour, but if D0 is less than one hour, unit will be second and its range is 0~3599).
X0
Y10
Y10
HOUR K100
Program
Example
2
D0
Y0
For 32-bit command: When X0=On, Y10 will turns On and start to count time. When
the time reaches 40000 hours, Y0 will turns On. D0 and D1 will record the current time
(unit is hour). If current time is less than one hour, D2 will record the current time (unit:
second).
9-44
API
170 D
GRY
D0
BIN
Y0
Bit devices
X Y M S
S
D
Word devices
K H KnX KnY KnM KnS T C D E F
Note: Operands S and D only can use 16-bit command when
using F device.
Refer to each model specification for usage range.
Command
Explanation
: Source device
Applicable models
ES
EP
EH
GRAY CODE
Program
Example
When X0=On, constant K 6513 is converted to the GRAY CODE and stored in the
K4Y20.
X0
GRY
K6513
K4Y20
b0
b15
K6513=H1971 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1
Y37
Y20
GRAY6513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1
K4Y20
9-45
GBIN
GRAY CODE
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
Note: Refer to each model specification for usage range.
S
D
Command
Explanation
Applicable models
ES
EP
EH
BIN
This command can be used to read the value from an absolute position type encoder
(it is generally a gray code encoder) which is connected to PLC inputs. Convert the
value to the BIN value and store it in the specified register.
Program scan time plus input response time is equal to the output delay time specified
by
If the source is set to inputs X0~X17, it can speed up the input response time by using
REFF command (API151) or D1020 (adjust input response time).
The range of
Program
Example
When X20=On, the GRAY CODE value in the absolute position type encoder
connected to X0~X17 inputs is converted to BIN value and stored in D10.
X20
GBIN
K4X0
D10
X17
K4X0
X0
GRAY6513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1
b15
b0
H1971=K6513 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1
9-46
MAND
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: specific range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX,
KnY, KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Matrix AND
: Area where
: matrix length
Flag: None
and save
The operation rule of matix AND is: bit is 1 when 2 bits are all 1 otherwise it is 0.
Program
Example
When X0=On, do MAND and matrix AND operation to 3 rows (D0-D2) of 16-bit
register and 3 rows (D10-D12) of 16-bit register. Then save the result in 3 rows
(D20-D22) of 16-bit register.
X0
MAND
D0
D10
b15
D20
K3
b0
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
Before
Execution
MAND
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
After
Execution
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
Footnote
9-47
Left
width is 16-bit
Right
b15
D0
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b0
D1
b31 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b16
D2
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b32
b47
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
Dn-1
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
b16n-1
6. Fixed width of matrix is 16-bit.
7. Pr: matrix pointer. If Pr is 15, it means designated point is b15.
8. Matrix length is n and n is 1-256.
Example: The matrix that is made up of D0 and n=3, D0=HAAAA, D1=H5555,
D2=HAAFF
R0
R1
R2
C15
1
0
1
C14
0
1
0
C13
1
0
1
C12
0
1
0
C11
1
0
1
C10
0
1
0
C9 C8 C7 C6 C5 C4 C3 C2 C1 C0
1 0 1 0 1 0 1 0 1 0 D0
0 1 0 1 0 1 0 1 0 1 D1
1 0 1 1 1 1 1 1 1 1 D2
Example: The matrix that is made up of K2X0 and n=3, K2X0=H37, K2X10=H68,
K2X20=H45
C15 C14 C13
R0 0 0 0
R1 0 0 0
R2 0 0 0
C12
0
0
0
C11
0
0
0
C10
0
0
0
C9 C8 C7 C6 C5 C4 C3 C2 C1 C0
0 0 0 0 1 1 0 1 1 1
0 0 0 1 1 0 1 0 0 0
0 0 0 1 0 0 0 1 0 1
X0~X7
X10~X17
X20~X27
9-48
MOR
Applicable models
ES
EP
EH
Matrix OR
Bit devices
X Y M S
S1
S2
D
n
Word devices
K H KnX KnY KnM KnS T C D E F
Command
Explanation
: Area where
: matrix length
Flag: None
and save
The operation rule of matrix OR is: bit is 1 when one of 2 bits is 1 and only 2 bits are 0
bit will be 0.
Program
Example
When X0=On, do MOR and matrix OR operation to 3 rows (D0-D2) of 16-bit register
and 3 rows (D10-D12) of 16-bit register. Then save the result in 3 rows (D20-D22) of
16-bit register.
X0
MOR
D0
D10
b15
D20
K3
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
Execution
MOR
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
Execution
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
9-49
MXOR
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Matrix XOR
: Area where
: matrix length
Flag: None
and save
The operation rule of matrix XOR is: bit is 1 when 2 bits are different otherwise it is 0.
Program
Example
When X0=On, do MXOR and matrix XOR operation to 3 rows (D0-D2) of 16-bit
register and 3 rows (D10-D12) of 16-bit register. Then save the result in 3 rows
(D20-D22) of 16-bit register.
X0
MXOR
D0
D10
b15
D20
K3
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
Execution
MXOR
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
Execution
0 1 0 1 1 0 1 0 1 11 1 0 0 0 0
0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
9-50
MXNR
Applicable models
ES
EP
EH
Matrix XNR
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
: Area where
: matrix length
Flag: None
and save
The operation rule of matrix XNR is: bit is 1 when 2 bits are the same otherwise it is 0.
Program
Example
When X0=On, do MXNR and matrix XNR operation to 3 rows (D0-D2) of 16-bit
register and 3 rows (D10-D12) of 16-bit register. Then save the result in 3 rows
(D20-D22) of 16-bit register.
X0
MXNR
D0
D10
D20
b15
K3
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
Execution
MXNR
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
Execution
1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
9-51
MINV
Applicable models
ES
EP
EH
Matrix Inverse
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command (7 STEPS)
Continuous
MINV
MINVP
execution
32-bit command (13 STEPS)
Note: usage range of operand n is 1~256.
S
D
n
Command
Explanation
: result
: matrix length
Pulse
execution
When X0=On, do MINV operation to 3 rows (D0-D2) of 16-bit register and 3 rows
Program
Example
(D10-D12) of 16-bit register. Then save the result in 3 rows (D20-D22) of 16-bit register.
X0
MINV
D0
D20
K3
b15
Before
Execution
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
MINV
After
Execution
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
API
185
MCMP
Bit devices
X Y M S
Matrix Compare
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
9-52
Applicable models
ES
EP
EH
: Area where
with
to complete this
comparison.
You can find the result of comparison from comparison flag M1088. If the same,
M1088=1 and M1088=0 for difference. Once comparsion attains, it will stop
comparing immediately and set bit search flag M1091=1. When comparison attains
the last bit, matrix search end flag M1089 will be On and comparison attained number
is saved in
. For next scan period, it will start comparing from the first bit and set
Program
Example
When X0 is from OffOn, matrix search start falg M1090=0 thus it will start comparing
to find the different bit from the bit that present value +1. (M1088=0 means difference)
When present value of pointer D20=2, it can get following four results ( , , , )
when X0 is executed from OffOn for four times.
D20=5, matrix bit search flag M1091=1, matrix search end flag M1089=0.
D20=45, matrix bit search flag M1091=1, matrix search end flag M1089=0.
D20=47, matrix bit search flag M1091=0, matrix search end flag M1089=1.
D20=1, matrix bit search flag M1091=1, matrix search end flag M1089=0.
X0
MCMPP
D0
D10
K3
D20
2
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
D20
pointer
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
MCMP
b0
0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
9-53
Footnote
M1088: matrix comparison flag, if the result of comparison is the same, M1088=1,
otherwise M1088=0.
M1089: matrix search end flag, when comparing to the last bit, M1089=1.
M1090: matrix search start flag, start comparing from the first bit, M1090=1.
M1091: matrix bit search flag, it will stop comparing once comparison attained,
M1091=1.
M1092: matrix pointer error flag, pointer Pr exceeds that range, M1092=1.
API
186
MBRD
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C D E F
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
: matrix length
address.
When executing command, it will start to see if M1094 (matrix pointer clear flag) is On.
If it is On, pointer
On/Off state of each bit to M1095 (matrix rotate/shift/output/carry). It will see if M1093
(matrix pointer increase flag) is On after reading a bit. And increase 1 to
if it is
On. When reading to the last bit, M1089 (matrix search end flag) =On, pointer
records the number of read bit and then end executing this command.
Pr (pointer) is designated by user and the range is 0-16n-1 that correspond to bit b0
b16n-1 individually. If Pr value exceeds this range, matrix pointer error flag M1092 will
be 1 and this command wont be executed.
Program
Example
When X0 is from OffOn, pointer clear flag M1094=On, matrix pointer increase flag
M1093=1, and increase 1 to pointer Pr after reading a bit.
When present value of pointer D20=45, it can get following three results ( ,
MBRD
D0
D10
K3
D20
b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
pointer
b47
45
D20
Footnote
M1089: matrix search end flag, when comparing to the last bit, M1089=1.
M1092: matrix pointer error flag, pointer Pr exceeds that range, M1092=1.
M1093: matrix pointer increase flag, add 1 to present pointer.
M1094: matrix pointer clear flag, clear present pointer to 0.
M1095: matrix rotate/shift/output carry flag.
API
187
MBWR
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
: matrix length
address.
When executing command, it will start to see if M1094 (matrix pointer clear flag) is On.
If it is On, pointer
Pr (pointer) is designated by user and the range is 0-16n-1 that correspond to bit b0
b16n-1 individually. If Pr value exceeds this range, matrix pointer error flag M1092 will
be 1 and this command wont be executed.
9-55
Program
Example
X0
MBWRP
D0
K3
D20
b0
Before
Execution
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
D20 pointer
45
After
Execution
M1096
(Matrix shift/input complement flag)
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
D20 pointer
45
Explanation for flag signal
Footnote
M1089: matrix search end flag, when comparing to the last bit, M1089=1.
M1092: matrix pointer error flag, pointer Pr exceeds that range, M1092=1.
M1093: matrix pointer increase flag, add 1 to present pointer.
M1094: matrix pointer clear flag, clear present pointer to 0.
M1096: matrix shift/input complement flag
API
188
MBS
Bit devices
X Y M S
Word devices
H KnX KnY KnM KnS T C
D
n
Note: usage range of operand n is 1~256.
For EP series, when operands S1, S2 and D designate
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
9-56
Applicable models
ES
EP
EH
MBS
MBSP
execution
execution
KnX, KnY,
Flag: Please refer to explanation for
M1095-M1097
: matrix length
: result.
to left and M1097=1 moves to right. It needs to use the state of M1096 (complement
flag) to fill the empty bit (shift to left is b0 and shift to right is b16n-1) due to shiftment
for each bit. If there is one more bit due to shiftment (shift to left is b16n-1 and shift to
right is b0), it needs to send the state to M1095 (carry flag) and save the result in
.
The most use of this command is pulse execution command (MBSP).
Program
Example
1
When X0=On, M1097=Off means shift matrix to left. Setting complement flag
M1096=0, shift 16-bit registers D0-D2 to left and save the result in 16-bit register
D20-D22 and carry flag M1095 will be 1.
X0
RST
M1097
MBSP
D0
D20
K3
M1096
0
b15
Before
Execution
b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
M1095
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
MBS
M1097=0
After shifting
to left
M1095
Program
Example
2
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
When X1=On, M1097=On to shift matrix to right. Setting complement flag M1096=1,
shift 16-bit registers D0-D2 to right and save the result to 16-bit registers D20-D22 and
carry flag M1095 will be 0.
X1
M1097
MBSP
D0
D20
K3
0
b15
Before
Execution
M1096
b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
M1095
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
MBS
M1097=0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
M1095
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
9-57
Footnote
API
189
MBR
Applicable models
ES
EP
EH
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F 16-bit command (5 STEPS)
Continuous
Pulse
S
MBR
MBRP
execution
execution
n
32-bit command (9 STEPS)
Note: usage range of operand n is 1~256.
Command
Explanation
: matrix length
: result.
moves to left and M1097=1 moves to right. The empty bit (rotate to left is b0 and shift
to right is b16n-1) due to rotation will be filled by the bit (rotate to left is b16n-1 and
shift to right is b0) that rotated out and save the result in
out is not only used to fill the empty bit but also send its state to carry flag M1095.
The most use of this command is pulse execution command (MBRP).
Program
Example
1
When X0=On, M1097=Off means rotate matrix to left. To rotate 16-bit registers D0-D2
to left and save the result in 16-bit register D20-D22. The carry flag M1095 will be 1.
X0
RST
M1097
MBRP
D0
b15
Before
Execution
D20
K3
b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
M1095
MBR
M1097=0
After rotating
to left
M1095
9-58
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Program
Example
2
right and save the result to 16-bit registers D20-D22 . The carry flag M1095 will be 0.
X1
M1097
MBRP
D0
D20
K3
b15
Before
Execution
b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
M1095
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
MBR
M1097=0
After rotating
to right
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
M1095
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Footnote
API
190
MBC
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
n
Note: usage range of operand n is K1~K256.
For EP series, when operands S1, S2 and D designate KnX, KnY,
KnM and KnS, n can only be 4.
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
Pulse
execution
: result
When M1098=1, count the number of bit 1. And count the number of bit 0 when
M1098=0. If counting result is 0, M1099=1.
Program
Example
When X10=On, it counts bit 1 number of D0-D2 and save the total number in D10. When
M1098=0, it counts bit 0 number of D0-D2 and save the total number in D10.
X10
MBC
D0
K3
D10
9-59
12
M1098=0
36
M1098=1
Footnote
API
196
HST
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
Note: usage range of operand S is K0 (H0), K1(H1).
Applicable models
ES
EP
EH
Command
Explanation
=1, start high speed timer and set M1015=On, high speed timer starts and
=0, stop high speed timer and set M1015=Off, D1015 will stop counting
immediately.
When
Program
Example
When X10=On, M1015=On. It will start high speed timer and record present value in
D1015.
When X10=Off, M1015=Off. It will stop high speed timer.
X10
HST
K1
HST
K0
X10
9-60
Footnote
9-61
LD#
Bit devices
X Y M S
S1
S2
Word devices
K H KnX KnY KnM KnS T C D E F
Note: : &, |, ^
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
LD#
execution
32-bit command (9 STEPS)
Continuous
DLD#
execution
Flag: None
and
16 -bit
command
LD&
32 -bit
command
DLD&
Continuity
condition
Discontinuity
condition
&
&
=0
216
LD|
DLD|
=0
217
LD^
DLD^
=0
Program
Example
When the result that using the LD& (Logic AND operation) command to compare the
content of C0 and C10 is not equal to 0, Y10=ON.
When the result that using the LD| (Logic OR operation) command to compare the
content of D200 and D300 is not equal to 0 and X1=ON, Y10=ON and retain.
When the result that using the LD^ (Logic XOR operation) command to compare the
content of C201 and C200 is not equal to 0 or M3=ON, M50=ON.
LD &
C0
C10
LD I
D200
D300
SET
DLD ^
C201
C200
M50
Y10
X1
Y011
M3
10-1
AND#
Bit devices
X Y M S
S1
S2
Word devices
H KnX KnY KnM KnS T C
AND#
execution
Note: : &, |, ^
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
DAND#
execution
Flag: None
: Data source device 2.
and of
16 -bit
command
AND&
32 -bit
command
DAND&
Continuity
condition
Discontinuity
condition
&
&
=0
219
AND|
DAND|
=0
220
AND^
DAND^
=0
Program
Example
When X0=ON, using the AND& (Logic AND operation) command to compare the content of
C0 and C10. If the result is not equal to 0, Y10=ON.
When X1=OFF, using the AND| (Logic OR operation) command to compare the content of
D10 and D0. If the result is not equal to 0, Y11=ON and retain.
When X2=ON, using the AND^ (Logic XOR operation) command to compare the content of
32-bit registers D200(D201) and D100(D101). If the result is not equal to 0 or
M3=ON,M50=ON.
10-2
C0
C10
Y10
AND I
D10
D0
SET
DAND ^
D200
D100
M50
X1
Y11
X2
M3
API
221~
D
223
OR#
Bit devices
X Y M S
S1
S2
Word devices
H KnX KnY KnM KnS T C
Note: : &, |, ^
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
OR#
execution
DOR#
execution
Flag: None
16 -bit
32 -bit
Continuity
Discontinuity
command
command
condition
condition
221
OR&
DOR&
&
&
=0
222
OR|
DOR|
=0
223
OR^
DOR^
=0
10-3
When X1=ON, using the OR& (Logic AND operation) command to compare the
content of C0 and C10. If the result is not equal to 0, Y0=ON.
If both X2 and M30 are ON, or when using the OR| (Logic OR operation) command
to compare the content of D10 and D20 and the result is not equal to 0, or when using
the OR^ (Logic XOR operation) command to compare the content of D100 and D200
and the result is not equal to 0, M60=ON.
X1
Y0
OR &
X2
C0
C10
M30
M60
API
224~
D
230
DOR I
D10
D20
DOR ^
D100
D200
LD
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
Note: : =, >, <, <>, ,
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
execution
32-bit command (9 STEPS)
Continuous
DLD
execution
Flag: None
224
16 -bit
command
LD
32 -bit
command
DLD
Continuity
condition
Discontinuity
condition
225
LD
DLD
226
LD
DLD
228
LD
DLD
229
LD
DLD
230
LD
DLD
API No.
When the left most bit, MSB (the 16-bit command: b15, the 32-bit command: b31), from
and
comparison.
10-4
Program
Example
K200
C10
LD>
D200
K-30
Y10
X1
DLD>
K678493
SET
Y11
M50
C200
M3
API
232~
D
238
AND
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D
S1
S2
Note: : =, >, <, <>, ,
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
AND
execution
32-bit command (9 STEPS)
Continuous
DAND
execution
Flag: None
232
16 -bit
command
AND
32 -bit
command
DAND
Continuity
condition
Discontinuity
condition
233
AND
DAND
234
AND
DAND
236
AND
DAND
237
AND
DAND
238
AND
DAND
API No.
10-5
and
for comparison.
If the 32-bit length counter (C200~C254) is put into this command for comparison, be
sure to use the 32-bit command (DAND). Or if the 16-bit command (AND) is
utilized, CPU will determine it as Program Error, and the red ERROR indicator on
the MPU panel will be blinking.
Program
Example
If X0=ON and that the current value of counter C10 equals K200, Y10=ON.
If X1=OFF and that the content of register D0 not equal to K10, Y11=ON and retain.
If X2=ON and that the contents of the 32-bit registers D11 and D0 are smaller than
K678,493, M50=ON.
X0
AND=
K200
C10
Y10
AND<>
K-10
D0
SET
X1
Y11
X2
DAND>
K678493
M50
D10
M3
API
240~
D
246
OR
Bit devices
X Y M S
Word devices
K H KnX KnY KnM KnS T C D E F
S1
S2
Note: : =, >, <, <>, ,
Refer to each model specification for usage range.
Command
Explanation
Applicable models
ES
EP
EH
execution
32-bit command (9 STEPS)
Continuous
DOR
execution
Flag: None
10-6
240
16 -bit
command
OR
32 -bit
command
DOR
241
OR
DOR
242
OR
DOR
244
OR
245
246
API No.
Continuity
condition
Discontinuity
condition
DOR
OR
DOR
S1
S1
OR
DOR
S1
S1
When the left most bit, MSB (the 16-bit command: b15, the 32-bit command: b31),
and
from
for comparison.
If the 32-bit length counter (C200~C254) is put into this command for comparison, be
sure to use the 32-bit command (DOR). Or if the 16-bit command (OR) is utilized,
CPU will determine it as Program Error , and the red ERROR indicator on the MPU
panel will be blinking.
Program
Example
If X1=ON, or that the current value of counter C10 is equal to K200, Y0=ON.
If both X2 and M30 are ON, or if the contents of the 32-bit registers D101 and D100
are greater or equal to K100,000, M60=ON.
X1
Y0
OR=
X2
K200
C10
M30
M60
DOR>
=
D100
K100000
10-7