Manual de Programa 'Ao Tpw04
Manual de Programa 'Ao Tpw04
1-0
Chapter 1 PLC Component Summary
Programming Method
<<Instruction list (IL) programming>>
It refers to the sequential control instruction input with LD, AND, OUT, etc.
For example:
Step No. Instruction Device
0 LD X000
1 OR Y005
2 ANI X001
3 OUT Y005
1-1
Chapter 1 PLC Component Summary
U pper lim it
State(W orking
procedure) S 21 Fall
Low er lim it
S 22 Rise
U pper lim it
Return S0
The above three programmed sequential control programs are all stored in memory of PLC in
instruction list (content of the instruction list). Therefore, representation and edition of the
program based on any programming method can be exchanged (even if it is instruction list
program, it could represent the program based on instruction by the software corresponding to
SFC chart according to SFC conversion rule), as shown in the figure below.
L add er lo g ic SFC
1-2
Chapter 1 PLC Component Devices for PLC
2 Device Overview
The PLC software design requires various logic components and computing components, to
finish such functions as logic computation, timing and counting assigned by the program. These
components have similar functions like the hardware relay, which are called PLC devices. There
are so many relays, counters and timers in PLC, and they have many normally open contacts
(contact a) and normally close contacts (contact b). These contacts and coils are linked to make
up sequential control loop(as shown in the figure below). The arrow represents signal transfer.
In addition, there is memory device used to store data in PLC——data register (D, W).
Input terminal or
input connector
Input relay :X
. Symbol of the device is X
Interface for receiving external switching signal of PLC is input relay
1-3
Chapter 1 PLC Component Devices for PLC
Auxiliary Relay(M)
The auxiliary relay is the relay in PLC, which provide normally open and normally closed
contacts in internal programming. The auxiliary relay is different from input and output relays,
which can not obtain external input and can be used in program. Some holding relays can hold
ON/OFF state in case of power failure for PLC.
Status Relay(S)
Status relay S is an important component to form step ladder or SFC. It is the relay used as
working step number represented by step ladder or SFC. When it is not used as working step
number, as the auxiliary relay, it can be programmed as common contact or coil.In addition, it can
be used as signal alarm for diagnosing external failure.
Timer(T)
There are three timing type for the timers in PLC, namely, 1ms, 10ms, and 100ms. In the
program, the timer always works with a setting value. When timing based on clock pulse
accumulation, it adds the clock pulses of 1ms, 10ms and 100ms respectively. When specified
setting value is reached, the output contact(normally open or closed) acts. The timer based on
clock pulse can be used to detect 0.001-3276.7 seconds.
Counter(C)
The counters are divided into the following types based on different applications:
<<Internal counting>> General use/Holding for power failure
16-bit counter: for counting up, range of counting: 1~32,767.
32-bit counter: for counting up/down, range of counting: -2,147,483,648~+2,147,483,647.
These counters can be used as internal signal of PLC, with response speed less than 10Hz
(0.1s).
1-4
Chapter 1 PLC Component Devices for PLC
1-5
Chapter 1 PLC Component Memory and Parameters
Memory Structure
The PLC memory structure is as shown in the Figure. In addition, the memory devices are
divided into A, B and C according to content of initialization.
1-6
Chapter 1 PLC Component Memory and Parameters
Power is Power
Memory content STOP→RUN RUN→STOP
OFF OFF→ON
A:Battery, flash memory
backup supporting series No change
storage device
B:Auxiliary registers after
Setting of initial
M8000, data registers after Clear No change[Note]
[Note]
value
D8000, index registers
C:Other non-backup No change Clear
supporting series storage Clear
No change of M8033 drive
device
[Note]:Please pay attention to that some registers will be cleared when STOP→RUN.
Parameter Structure
The parameters are used to specify range of holding in case of power failure and capacities of
annotation and file registers. Setting and change of parameters can be executed via AP-PCLINK.
Regarding instruction and operation details, please refer to Help of AP-PCLINK. As for the
functions of the parameters, please refer to the operating manual of AP PLC .
1-7
Chapter 1 PLC Component Memory and Parameters
1-8
Chapter 1 PLC Component Notes
[P ro g ra m
p ro c e s s in g ]
R e fre s h in g o f
im a g e s to ra g e
z o n e o f d e v ic e s
[O u tp u t
p ro c e s s in g ]
T ra n s fe rrin g to
o u tp u t lo c k in g
zo n e
O FF ON ON OFF
Output
Input processing Scan cycle
( Time)
processing
1-9
Chapter 2 Device Table of Contents
TOC
Chapter 2 Device ...................................................................................................... 2-2
1 Processing of Digits, Constants K and H ........................................................................ 2-2
2 List of Device Numbers .................................................................................................... 2-4
3 Number and Function of Input / Output Relays (X/Y) ............................................ 2-10
4 Number and Function M of Auxiliary Relay ............................................................... 2-14
5 Number and Function of Status S ................................................................................. 2-17
6 Number and Function of Timer T................................................................................. 2-20
7 Number and Function of Counter C............................................................................. 2-25
8 Number and Function of Built-in High-Speed Counter C .......................................... 2-32
9 Number and Function D of Data Register D................................................................ 2-40
9.1 Data registers(D, W) ............................................................................................. 2-40
9.2 Index Registers V, Z .............................................................................................. 2-44
10 Number and Function Pointer P/I .............................................................................. 2-47
2-1
Chapter 2 Device Table of Contents
Chapter 2 Device
Processing of Digits
Decimal Setting value of timer and counter(constant K).
system digit Numbers of auxiliary relay M, timer T, counter C, status S and etc. (number of device).
DEC Specify digit and command action K in application instruction operation (constant K).
Hexadecimal
Like decimal system digit, specify digit and command action K in application instruction
system digit
operation (constant H).
HEX
Specify digits of, time, counter or data register with decimal or hexadecimal system,
Binary digit however, such digit is processed with binary system digits within PLC. When monitor
BIN is performed on AP-PCLINK, such device can be converted into decimal or hexadecimal
system digit automatically.
Device numbers of the input/output relays are executed according to octonary digit
Octonary
system, therefore, it can be numbered 0~7、10~17、……70~77,100~107 and etc.
digit OCT
There is no 8 and 9 in octonary system.
BCD code is used to express 0-9 of decimal system with 4-digit binary system. It is easy
BCD code to process, so it is used to perform digital switch of BCD output form or monitor control
of 7 codes and etc.
K is the symbol used to represent integral of decimal system.
K is the symbol used to represent integral of hexadecimal system.
Constants K
When operation related to command digit is performed on AP-PCLINK for
and H
programming, input with K for decimal digit and H for hexadecimal digit, such as K10,
H102.
E is a real number (floating-point) symbols. The main value is used to specify the
E
number of applications operating instructions
2-2
Chapter 2 Device Table of Contents
Conversion of digits
Hexadecimal
Octonary Decimal system Binary
system BCD
digit(OCT) digit(DEC) digit(BIN)
digit(HEX)
0 0 00 0000 0000 0000 0000
1 1 01 0000 0001 0000 0001
2 2 02 0000 0010 0000 0010
3 3 03 0000 0011 0000 0011
4 4 04 0000 0100 0000 0100
5 5 05 0000 0101 0000 0101
6 6 06 0000 0110 0000 0110
7 7 07 0000 0111 0000 0111
10 8 08 0000 1000 0000 1000
11 9 09 0000 1001 0000 1001
12 10 0A 0000 1010 0001 0000
13 11 0B 0000 1011 0001 0001
14 12 0C 0000 1100 0001 0010
: : : : : :
143 99 63 0110 0011 1001 1001
Internal device
Device numbers numbers except PLC BCD digit switch
Main
of input/output constant, Constant H, etc. Internal 7 codes
Application
relays input/output processing monitor
relays
2-3
Chapter 2 Device Processing of Digits
Device List
AP100 series
Input relay X X0~X377 256 points
Output relay Y Y0~Y377 256 points
Auxiliary M0~M499 M500~M1023 M1024~M1535 M8000~M8511
Relay 500 points for 524 points for 512 points for 512 for special
M general use※1 holding※2 holding※3 purpose※4
S0~S499 500 points for general use※1 S500~S1023 524 points for holding※2
Status Relay
For initialization: S0~S9; For origin return:
S For alarm: S900~S999
S10~S19
T246~T249
T0~T39,T196~T199
T200~T245 4 points, 1ms T250~T255
44 points, 100ms
Timer 46 points accumulation 6 points
For general use※5
T 10ms For holding※3 100ms accumulation
For sub-program: For general use※5 For sub-program: For holding※3
T196~T199 T246~T249
32-bit down
16-bit up counting 32-bit high-speed up/down counting
counting
C235~C245 C246~C249 C251~C254
Counter C0~C89 C90~C99 C220~C234 11 points 4 points 4 points
C 90 points 10 points 15 points 1-phase 1-phase 2-phase
For general For For 1-input 2-input 2-input
use※1 holding※2 holding※2 For For For
holding※2 holding※2 holding※2
D0~D399
Data Register D400~D511 D8000~D8511
400 points for general
D 112 points for holding※2 512 for special purpose※4
use※5
Index register V0~V15, Z0~Z15
V, Z 32 points (For indirect specifying) For general use※5
Special F0~F1999(AP-PCLINK monitoring is unavailable)
register F
P0~P127
I00*~I50* I6**~I8** I010~I060
N0~N7 128 points
6 points 3 points 6 points
Indicator 8 points Jumping and
For interruption For time For counting
N, P, I For main sub-program
input interruption interruption
control circuit Branching
Indicator Indicator Indicator
pointer
Constan K 16-bit -32,768~32,767 32-bit -2,147,483,648~2,147,483,647
t H 16-bit 0~FFFFH 32-bit 0~FFFFH
2-4
Chapter 2 Device Processing of Digits
※1:Non-holding range in case of power failure Parameters are used to set and change the
holding range in case of power failure.
※2:Range of holding in case of power failure Parameters are used to set and change the
non-holding range in case of power failure.
※3:Fixed range for holding in case of power failure The holding range can not be changed.
※4: Refer to list of special elements.
※5:Non-holding range in case of power failure The holding range in case of power failure can't
be set or change by parameters.
2-5
Chapter 2 Device Processing of Digits
AP200 series
Input relay X X0~X377 256 points
Output relay Y Y0~Y377 256 points
Auxiliary M0~M499 M500~M1023 M1024~M1535 M8000~M8511
Relay 500 points for 524 points for 512 points for 512 for special
M general use※1 holding※2 holding※3 purpose※4
S0~S499 500 points for general use※1 S500~S1023 524 points for holding※2
Status Relay
For initialization: S0~S9; For origin return:
S For alarm: S900~S999
S10~S19
T246~T249
T0~T199
T200~T245 4 points 1ms T250~T255
200 points 100ms
Timer 46 points accumulation 6 points
For general use※5
T 10ms For holding※3 100ms accumulation
For sub-program: For general use※5 For sub-program: For holding※3
T192~T199 T246~T249
32-bit down
16-bit up counting 32-bit high-speed up/down counting
counting
C235~C245 C246~C249 C250~C255
Counter C0~C99 C100~C199 C200~C234 11 points 4 points 6 points
C 100 points 100 points 35 points 1-phase 1-phase 2-phase
For general For For 1-input 2-input 2-input
use※1 holding※2 holding※2 For For For
holding※2 holding※2 holding※2
D8000~D8511
D0~D199 D200~D511 D512~D2047
Data Register 512 points
200 points 312 points 1536 points
D For special
For general use※5 For holding※2 For general use※5
purpose※4
Index register V0~V15、Z0~Z15
V, Z 32 points (For indirect specifying) For general use※5
Special
F0~F1999(AP-PCLINK monitoring is unavailable)
register F
P0~P127
I00*~I50* I6**~I8** I010~I060
N0~N7 128 points
6 points 3 points 6 points
Indicator 8 points Jumping and
For interruption For time For counting
N, P, I For main sub-program
input interruption interruption
control circuit Branching
Indicator Indicator Indicator
pointer
Constan K 16-bit -32,768~32,767 32-bit -2,147,483,648~2,147,483,647
t H 16-bit 0~FFFFH 32-bit 0~FFFFH
※1:Non-holding range in case of power failure Parameters are used to set and change the
holding range in case of power failure.
※2:Range of holding in case of power failure Parameters are used to set and change the
2-6
Chapter 2 Device Processing of Digits
2-7
Chapter 2 Device Processing of Digits
AP300 series
Input relay X X0~X377 256 points
Output relay Y Y0~Y377 256 points
Auxiliary M0~M499 M500~M1023 M1024~M7679 M8000~M8511
Relay 500 points for 524 points for 6656 points for 512 for special
M general use※1 holding※2 holding※3 purpose※4
S0~S499, 500 points for S500~S1023
Status Relay general use※1 524 points for holding※2 S1024~S4095
S For initialization: S0~S9 3072 points for holding※3
For alarm: S900~S999
For origin return: S10~S19
T0~T199,
T246~T249, 4 T250~T255,
200 points
points 1ms 6 points
100ms For T200~T245 T256~T511,256
accumulation 100ms
Timer general use※ 46 points, 10ms points
For holding※3 accumulatio
T 5 For general use 1ms For general use
n
For sub- ※5 For sub- ※5
For
program: program:
holding※3
T192~T199 T246~T249
16-bit up counting 32-bit down counting 32-bit high-speed up/down counting
C235~C245
C0~C99, C100~C C250~C255;
C200~C234 ; C246~C249
100 199,100 C506~C508
C256~C499; C500~C505 4 points
Counter points,F points 9 points
C509~C511 ;17 points 1-phase
C or For 2-phase
282 points 1-phase 2-input For
general holding 2-input For
For holding※2 1-input For holding※2
use※1 ※2 holding※2
holding※2
Note: Up/down counting function is unavailable for C256~C499, C509~C511.
D0~D199 D200~D511 D512~D7999 D8000~D8511
Data Register
200 points 312 points 7488 points 512 points
D
For general use※5 For holding※2 For holding※3 For special purpose※4
Data Register
W0~W32767 32768 points for holding※3
W
Index register V0~V15、Z0~Z15
V, Z 32 points (For indirect specifying) For general use※5
Special
F0~F1999(AP-PCLINK monitoring is unavailable)
register F
P0~P127,128 I6**~I8**,
N0~N7,8 I00*~I50*,6 I010~I060,6 points
Indicator points Jumping 3 points For
points For points For For counting
and sub-program time
N, P, I main control interruption input interruption
Branching interruption
circuit Indicator Indicator
pointer Indicator
Constan K 16-bit -32,768~32,767 32-bit -2,147,483,648~2,147,483,647
t H 16-bit 0~FFFFH 32-bit 0~FFFFH
※1:Non-holding range in case of power failure Parameters are used to set and change the
2-8
Chapter 2 Device Processing of Digits
2-9
Chapter 2 Device Device Numbers
Input/Output Relays
Numbers of input/output relays
Numbers of input and output relays are made up of inherent address No. of basic unit and
address No. assigned to the expansion module. The assigned address number of the expansion
module is based on the fixed address number of the basic unit. These address numbers are
expressed in octonary system. It will be plus 1 when it reaches 8, so there is no 8 or 9. For
example, 17 and 20 are adjacent integrals in octonary system.
Input/Output Relay X Relay Y
Type Basic unit Expansion module Basic unit Expansion module
AP-110 X000~X005 — Y000~Y003 —
AP-114 X000~X007 — Y000~Y005 —
AP-120 X000~X013 — Y000~Y007 —
AP-130 X000~X017 X020~X157 Y000~Y015 Y020~Y157
AP-224 X000~X013 X020~X357 Y000~Y013 Y020~Y357
AP-232 X000~X017 X020~X357 Y000~Y017 Y020~Y357
AP-240 X000~X027 X030~X357 Y000~Y017 Y020~Y347
AP-260 X000~X043 X050~X347 Y000~Y027 Y030~Y327
AP-324 X000~X013 X020~X377 Y000~Y013 Y020~Y377
AP-332 X000~X017 X020~X377 Y000~Y017 Y020~Y377
AP-340 X000~X027 X030~X377 Y000~Y017 Y020~Y377
AP-360 X000~X043 X050~X377 Y000~Y027 Y030~Y377
Note:
1. AP-120 and AP-130 in AP100 series can be expanded with one expansion card, and the number
of digital expansion card starts from X370 and Y370. Only AP-130 can be added or expanded with
X/Y expansion module, with the 128 input/output points in total, which means the X points of
main unit+ X points of expansion+ Y points of main unit + Y points of expansion ≤128.
2. Each model type in AP100 series can be expanded with one expansion card, and the number of
digital expansion card starts from X370 and Y370. Each model type can be added or expanded
with Y expansion module, with the 256 input/output points in total, which means the X points of
main unit+ X points of expansion+ Y points of main unit + Y points of expansion ≤256.
3. AP-360 in AP300 series can be expanded with two expansion cards, while other model types
can be only expanded with one expansion card. The number of digital expansion card starts from
X370 and Y370. Each model type can be added with X/Y expansion module, with the 384
2-10
Chapter 2 Device Device Numbers
input/output points in total, which means the X points of main unit+ X points of expansion+ Y
points of main unit + Y points of expansion ≤384. Please note that: When using the digital
expansion card, the number(X/Y) of the occupied digital expansion card can't be used in digital
expansion module.
There are 512 points in total for X/Y relays, however, in practice the I/O modules can only
use the points listed in above table as input/output. The rest output points can be used as
auxiliary relays. The numbers of X/Y relays are in octonary system, such as:X000~X007, which is
followed by X010 rather than X008.
The input relay is the window for PLC to receive the external input switch signal. Through
the optical coupler, the PLC reads and stores external signal conditions into image memory
register. The input terminal is connected to external normally opened contact or closed contact and
series connection or parallel connection circuits or electronic sensor made of several contacts
(such as, proximity switch). In echelon, normally opened contact and closed contact of input relay
can be used for many times.
PLC of output relay is the window for PLC to send loading signal. The output relay is used to
transmit output signal of PLC to the output module and the later one drives external loading.
2-11
Chapter 2 Device Device Numbers
External
power
S/S
Program
C0 ~
supply
instance
X000 X001
X000 X000 Y000 Y000
Load
Y000
X000 Normally Y000 Normally
Input opened opened
Input
terminal contact contact terminal
X000 Normally Y000 Normally
closed PLC closed
contact contact
2-12
Chapter 2 Device Device Numbers
■ Input processing
Before PLC executing Input
processing ① Read
program,ON/OFF status of all input X000
terminal block will be read into the X001
Inp
X002
image zone. ut Input
ter image
During program executing, in min zone
al
case of input change, content of input
image zone will not be changed. When
it is processed in the next cycle, such
change will be read.
In addition, even ON→OFF and
Y000
③Read
OFF→ON, there will be about 10ms X000 External
④Read image
delay for the input wave filter before zone
judging ON/OFF. M 0
⑤Read
Y000
■ Program processing
PLC reads out ON/OFF status
from input image zone or image zone
of other devices according to ⑥ Output
Output processing
command of the program memory. It
Y000
computes from step 0, then writes the Y001
results into the image zone. Therefore, Output Outpu Y002
locking t
the image zone of the device shall storage termi
zone nal
update the content with the program
execution. Moreover, the internal
contacts of the output relay actions
according to the content of the output image memory .
■ Output processing
Once all commands have been executed, ON/OFF status of image memory of output Y is
transmitted to the locking zone, which will become the actual output of PLC.
For contacts for external output of PLC, the response will be delayed according to the device
for output.
2-13
Chapter 2 Device Input / Output Relays
Auxiliary Relay
The auxiliary relay (M) is realized by device. It can not accept external input signal and also
can not drive external loading. It is an internal status sign like the mid relay in the relay control
system.
Number of auxiliary relay M is stated blow(the number is distributed according to decimal
system):
Device
Auxiliary Relay(M)
Series type
M0~M499 M500~M1023 M1024~M1535 M8000~M8511
AP100 Series
500 points for 524 points for 512 points for 512 for special
AP200 Series
general use※1 holding※2 holding※3 purpose※4
M0~M499 M500~M1023 M1024~M7679 M8000~M8511
AP300 Series 500 points for 524 points for 6656 points for 512 for special
general use※1 holding※2 holding※3 purpose※4
※1:Non-holding range in case of power failure Parameters are used to set and change the
holding range in case of power failure.
※2:Range of holding in case of power failure Parameters are used to set and change the
non-holding range in case of power failure.
※3:Fixed range for holding in case of power failure The holding range can not be changed.
※4: Refer to list of special elements.
2-14
Chapter 2 Device Input / Output Relays
M100
Circuit for self-holding in case of power Setting and clearing for the circuit holding in case
failure of power failure
Reciprocatin Brake
g platform motor
As shown in the figure, when it is operated for a second time, direction of advance is the
same as the direction before power failure.
2-15
Chapter 2 Device Input / Output Relays
X000 X001
Right drive
M600 instruction
M600
X001 X000
Left drive
M601 instruction
M601
b. (Special auxiliary relay with coil drive): the users can drive these coils for specific operation
Example: M8033: Keep memory as required
M8034: All outputs forbidden
M8039: Constant scanning
Please note that it is valid when driving and after executing END.
2-16
Chapter 2 Device Auxiliary Relay
Status
The status relay is a kind of programming element for programming sequential control,
which is used together with commands of STL and RET described in Chapter 4. The status relay
for general use does not have the function of holding in case of power failure. The status relay for
holding in case of power failure can utilize the built-in backup battery or Flash memory of PLC
for storing ON/OFF status.
The status number S is stated below (Distributed based on decimal system):
Device
Status Relay S
Series type
S0~S499 500 points for general use※1 S500~S1023 524 points for holding※2
AP100 Series
For initialization: S0~S9; For origin
AP200 Series For alarm: S900~S999
return: S10~S19
S0~S499 S500~S1023
S1024~S4095
500 points for general use※1 524 points for holding※2
AP300 Series 3072 points for
For initialization: S0~S9 For origin
For alarm: S900~S999 holding※3
return: S10~S19
※1:Non-holding range in case of power failure Parameters are used to set and change the
holding range in case of power failure.
※2:Range of holding in case of power failure Parameters are used to set and change the
non-holding range in case of power failure.
※3:Fixed range for holding in case of power failure The holding range can not be changed.
2-17
Chapter 2 Device Auxiliary Relay
2-18
Chapter 2 Device Auxiliary Relay
2-19
Chapter 2 Device Status Relay
Number of timer
Device
Timer T
Series type
T0~T39,T196~T1 T246~T249
T200~T245
99 4 points, 1ms T250~T255
46 points
44 points, 100ms accumulation 6 points
AP100 10ms
For general use※5 For holding※3 100ms accumulation
For general
For sub-program: For sub-program: For holding※3
use※5
T196~T199 T246~T249
T246~T249
T0~T199 T200~T245
4 points 1ms T250~T255
200 points 100ms 46 points
accumulation 6 points
AP200 For general use※5 10ms
For holding※3 100ms accumulation
For general
For sub-program: For sub-program: For holding※3
use※5
T192~T199 T246~T249
T246~T249
T0~T199 T200~T245 T250~T255 T256~T511
4 points 1ms
200 points 100ms 46 points 6 points 256 points
accumulation
AP300 For general use※5 10ms 100ms 1ms
For holding※3
For general accumulation For general
For sub-program: For sub-program:
use※5 For holding※3 use※5
T192~T199 T246~T249
※3:Fixed range for holding in case of power failure The holding range can not be changed.
※5:Non-holding range in case of power failure The holding range in case of power failure can't
be set or change by parameters.
Note: If it is not used as timer number of the timer, it can be also used as data register for storing
data.
Function
The timer accumulates the clock pulse of 1ms, 10ms, 100ms and etc. of PLC. When reaching
specified setting, contact of the output will act. The setting value employs the constants K(with the
range of K0~K32767)and H(with the range ofH0~H7FFF) as setting value. Besides, the content of
data registers D and W can be used for indirect specifying.
2-20
Chapter 2 Device Status Relay
As shown in the Figure below, if drive input X000 of the timer coil T200 is ON, T200
employs the clock pulse totaled 10ms of the current counter. If the value is equal to setting value
K123, output contact of the timer will act. That is, the output contacts acts 1.23 seconds after coil
drive.
Drive input X000 is cut off or powered off, the timer and the output contact will be reset.
1.23?
X000 X000
K123
T200 Setting
value
T200 Current
value
Y000
Y000
t1 t2 t1+t2=34.5?
Accumulation
X001 time
X001
T250 K345 Setting
value
T250 Current
value
Y001
X002
RST T250 Y001
X002
Note: For the accumulation timer T, if the coil is reset, but the current value doesn't reach the
default value, and the timer drive input is enabled, the coil will be reset, and the timer will
continue timing based on the current value.
2-21
Chapter 2 Device Status Relay
power failure, please note that low battery D5=K100 10s counter
voltage may lead to unstable value setting.
Processing of Digit Device
Current value of the timer can be used as value through application instruction and etc.
When it is used as data device, please refer to number and function of internal counter.
Precautions in Program
For sub-program and interruption program, please use T192~199(T196~T199 for AP100
series) or T246~T249 timer, which starts timing when executing coil command or END command.
If timing reaches setting value, when executing coil command or END command, the output
contact will act. The common timer executes coil command timing(Refer to act and precision of
the timer in the following). Therefore, under some conditions, when the coil command is used
for executing sub-program or interruption degree, it won't perform timing and cannot act normally.
If 1ms accumulation timer is used in the sub-program or interruption program, when it
reaches setting value, user shall note that when executing initial coil command, the output contact
will act.
Input processing
the initial
X010 coil
K 12
T0
instructio
T0
Y010
n will be
executed,
The 1 st cycle The 2nd cycle The nth cycle The (n+1)th cycle
2-22
Chapter 2 Device Status Relay
As shown in the above figure, action precision of timer contact from driving coil to finishing
of the contact action, can be expressed by the following:
(T-α)~(T+To)
α:Correspondent with 1ms, 10ms and 100ms timer, it is 0.001, 0.01 and 0.1 second
respectively.
T: Setting time of timer(second)
To: Scanning period(second)
When programming, the timer contact shall be written before the coil command, with
maximum error +2 To.
When setting value of the timer is 0 and the next coil command for scanning is executed, the
output contact will start acting. In addition, after 1ms interruption counter executes coil command,
1ms clock pulse counting is executed in interruption mode.
Example of Actions
Output delay OFF timer
Sparkling point
X001 T2 X001
K20 T1 T2 T1 T2
T1
T1 Y000 2s 1s 2s 1s
K10
T2
T2
Y000 1 scan cycle
In addition, F66(ALT) instruction can be used for sparkling action.
2-23
Chapter 2 Device Status Relay
M3
the Figure.
X000 M3
F65 STMR T10 K100 M0
X000
M2
M1
2-24
Chapter 2 Device Timer
Number of counter
The number of counter is stated below (Distributed based on decimal system):
Counter(C)
Device
32-bit down
Series type 16-bit up counting 32-bit high-speed up/down counting
counting
C235~C245 C246~C249 C251~C254
C0~C89
C90~C99 C220~C234、 11 points 4 points 4 points
90 points
10 points 15 points 1-phase 1-phase 2-phase
For
For For 1-input 2-input 2-input
AP100 general
holding※2 holding※2 For For For
use※1
holding※2 holding※2 holding※2
Note: In AP100 series, C250 and C255 are not high-speed up/down counters, which are
32-bit counters instead.
C235~C245 C246~C249 C250~C255
C0~C99
C100~C199 C200~C234 11 points 4 points 6 points
100 points
100 points 35 points 1-phase 1-phase 2-phase
AP200 For
For For 1-input 2-input 2-input
general
holding※2 holding※2 For For For
use※1
holding※2 holding※2 holding※2
C235~C245; C250~C255;
C200~C234 C246~C249
C0~C99 C500~C505; C506~C508
C100~C199 C256~C499; 4 points
100 points 17 points 9 points
100 points C509~C511 1-phase
For 1-phase 2-phase
For 282 points 2-input
AP300 general 1-input 2-input
holding※2 For For
use※1 For For
holding※2 holding※2
holding※2 holding※2
Note: Up/down counting function is unavailable for C256~C499, C509~C511 in AP300
series.
※1:Non-holding range in case of power failure Parameters are used to set and change the
holding range in case of power failure.
※2:Range of holding in case of power failure Parameters are used to set and change the
non-holding range in case of power failure.
<<Auxiliary relay numbers for setting counting up/down of 32-bit counter >>
2-25
Chapter 2 Device Timer
2-26
Chapter 2 Device Timer
X010
RST C0
X011
C0 K10
Setting value
C0 (constant)
Y000 Indirect
specifying
Every time the counting input X011 drives C0 coil, the current value of the counter will
increase. When it executes the coil command at the tenth time, the output contact will act. After
that, if the counting input X011 acts again, the current value of the counter will remain unchanged.
If reset input X010 is ON, RST command will be executed, current value of the counter will
be 0, and the output contact will be reset.
Setting value of the counter, besides specified by constant K, can be specified by number of
data register. For instance, when specifying D10, if D10 is 123, the setting method will be the
same as K123.
When the data above the setting value are written into current data register with MOV and
other instructions, the output coil is connected at the next input and the current register will be
changed into setting value.
2-27
Chapter 2 Device Timer
X010
X011
10
9
8
7
6
5
4
3
2
1
0
Y000
X012
M8220
X013
RST C220
X014
C220 K-5
Setting value
(constant)
C220 Indirect
Y001 specifying
2-28
Chapter 2 Device Timer
X014
5
4 4
3 3
2 2
Current value 1 1
0 0 0
-1
-2
-3 -3
-4 -4
-5 -5
If output is connected -6 -6
-7 -7
-8
Y001
When C220 coil is used to drive counting input X014, up/down counting is available.
When current value of the counter is increased from -6→-5, the output contact will be
relocated. When it is decreased from -5→-6, tht output contact will be reset.
Indirect specifying D
X001
Write content of indirect specified data register F12 MOV K100 D5
into program or input with digit switch. X003
D5
If it is specified as memory for holding in case C0
2-29
Chapter 2 Device Timer
32-bit counter
Specifying constant K 43210 counts
Indirect specifying D
X001
2 indirectly specified data memories
F12 MOV K43210 D5(D6)
are paired as one group. While setting X003 D5(D6)
value is written by 32-bit command , do not C220
use the same data register on other program.
16-bit(C)
《Structure of current value register and setting value register of counter and timer (only limited
to 16 bits)》
Upper Lower
position 16-bit position
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b15
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
*1
Symbol
0: Positive number
1: Negative number
32-bit(C)
2-30
Chapter 2 Device Timer
Upper Lower
positio 32-bit positio
n n
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
*1
b0
1,073,741,824
536,870,912
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65,536
32,768
Symbol
0: Positive
number
1: Negative
number
2-31
Chapter 2 Device Counter
AP Machine Type
1 phase 1 counting input 1 phase 2 counting 2 phase 2 counting input
input
C235 C236 C237 C238C239 C240 C241 C242C243C244C245C246C247C248C249C250 C251 C252 C253 C254 C255
X001 U/D R R D D D B B B
X003 U/D R R U B B
X011 U/D R B B
X013 U/D R B
2-32
Chapter 2 Device Counter
X000 input:
It could be corresponding to counting input of C235 counter(U/D), without interruption
reset and interruption starting input functions. It could be also corresponding to counting input
of C235 counter(U/D), without interruption reset and interruption starting input functions.
Or it could be corresponding to counting input of C244 counter(U/D), which takes X001 as
interruption reset(R) and X004 as interruption starting input(S),
and so forth.
■ For 1 phase 2 counting input:
X000 input:
It is corresponding to up counting input(U) of C246 counter(U/D), which takes X001 as
down counting(D) but doesn't support interruption reset and interruption starting input functions.
It could be also corresponding to up counting input(U) of C249 counter(U/D), which takes X001
as down counting(D) but doesn't support interruption reset(R) and interruption starting input(S)
functions,
and so forth.
■ For 2 phase 2 counting input:
X000 input:
It is corresponding to A-phase input(A) of C251 counter(A/B), which takes X001 as
B-phase input(B) but doesn't support interruption reset and interruption starting input functions. It
could be also corresponding to A-phase input(U) of C254 counter(A), which takes X001 as
B-phase input(B), X002 as interruption reset(R) and X005 as interruption starting input(S),
and so forth.
Note: The counter number C is distributed in input X000~X005(AP100/AP200/AP300),
X010~X013(AP300). X000~X005 and X10~X13 can't be used repeatedly. The input number
which is not used as high-speed counter can be used as common input relay. Besides, number of
high-speed counter which is not used as high-speed counter can be used as 32-bit data register for
data storage.
If X000 is used in C235, it can not be used in C241,C244,C246,C247,C249,C251,
C252,C254 and interruption I00*.
Function of High-Speed Counter
As shown in the table above, the high-speed counter executes interruption and performs
high-speed action according to the specific input. It has nothing to do with the PLC scanning. This
types of counter is 32-bit hexadecimal U/D counter, which can be divided into the following three
types based on different switch method between up/down counting.
Item 1 phase 1 counting input 1 phase 2 counting 2 phase 2 counting
input input
Specifying ON/OFF of The action of up/down While A-phase is ON,
2-33
Chapter 2 Device Counter
counting M8235~M8245 and counting input at the and B-phase turns from
direction, M8500~M8505 controls input point decides the OFF→ON, it will
up/down the up/down counting of up/down counter execute up counting;
C235~C245 and automatically (As while it turns from
C500~C505. shown in the table ON→OFF, it will
above). execute down
counting.
By supervising M8246~M8249 ,
Supervise
M8250~M8255 , M8506~M8508, it shows the
counting ——
status of up counting (OFF) or down counting
direction
(ON).
Various high-speed counters could determine the time to interrupt reset input and start to count by
interruption input.
《Number of M8*** relays to switch up/down 《Number of M8*** relays to monitor up/down
counting》 counting》
Type Counter Corresponding M8*** Type Counter Corresponding M8***
relay relay
C235 M8235 C246 M8246
1 Phase
C236 M8236 C247 M8247
2
C237 M8237 C248 M8248
Counting
C238 M8238 C249 M8249
ON indicating:
C239 M8239 C250 M8250
Down(DN)
C240 M8240 When it is ON, C251 M8251
C241 M8241 execute: C252 M8252
OFF
1 Phase C242 M8242 Down(DN) 2 Phase C253 M8253
indicating:
1 C243 M8243 2 C254 M8254
Up(UP)
Counting C244 M8244 When it is Counting C255 M8255
C245 M8245 OFF, execute: C506 M8506
C500 M8500 Up(UP) C507 M8507
C501 M8501 C508 M8508
C502 M8502
C503 M8503
C504 M8504
C505 M8505
2-34
Chapter 2 Device Counter
X015
( M8235 ) Increase/decrease
X016
[ RST C235 ] Clear
● When X015 is OFF, it will execute up counting; When it is ON, it will execute down counting.
● If X016 is enabled, run RST command to reset.
● When X017 is ON, C235 will count the ON/OFF times of input X000.
X000
Count input
5
4 4
3 3
2 2
Current 1 1
value 0 0 0
-1
-2
-3 -3
-4 -4
If output is executed -5 -5
-6 -6
-7 -7
-8
C235 output contact
2-35
Chapter 2 Device Counter
X010
( M8244 ) Increase/decrease
X011
[ RST C244 ]
X012
( C244 ) D0(D1)
● When X012 is ON, if the input X004 is ON, C244 will start counting immediately, and counting
input of C244 is X000. The setting value in this example employs the content of the data register
for indirect specifying(D1, D0).
● When X001 is closed, C244 will be reset immediately. Moreover, it could execute reset by X011
of sequential control as shown in the figure.
● M8235~M8245 ON / OFF can control C235~C245 counting direction(UP/Down).
●When X012 is ON, C246 executes up counting by turning X000 OFF→ON, and executes
down counting by turning X001 OFF→ON.
X011
RST C 249
X012
C 249 K1234
● When X012 is ON, and X005 is ON, C249 will start counting immediately. The up counting
input is X0000, and the down counting input is X001.
● When X002 is closed, C249 will be reset immediately. Moreover, it could execute reset by X011
of sequential control as shown in the figure.
● The counting direction(Up/Down) of C246~C249 can be supervised by M8246~M8249
ON/OFF.
2-36
Chapter 2 Device Counter
X011
RST C251
X012
C251 K1234
C251
Y002
M8251
Y003
● When X012 is ON, C251 start counting by X000(A phase) and X001(B phase). When X011 is
ON, RST command will be executed to clear C251.
● When the current value is above the setting value, Y002=ON. If it is below the setting value,
Y002 will be OFF.
● When Y003 is ON, it will count down. When Y003 is OFF, it will count up accumulatively.
X011
RST C254
X012
C254 D0(D1)
C254
Y004
M8254
Y005
● When X012 is ON, and X005 is ON, C254 will start counting, with the input points of X000(A
phase), X001(B phase).
● When X011 is ON, C254 will be cleared by the program or X002.
● When the current value is above the setting value, Y004=ON. If it is below the setting value,
Y004 will be OFF.
● When Y005 is ON, it will count down. When Y005 is OFF, it will count up.
● In this counter, when A phase is ON, B phase is turned from OFF to ON, it will judge up
counting. When B phase is turned from ON to OFF, it will judge down counting. The up/down
status of C250~C255 could be supervised by ON/OFF of M8250~M8255.
△ Action of 2 phase input signal
● 2-phase coder outputs A phase and B phase with 90° phase difference. Thus, high-speed
counter could automatically execute up/down counting as shown in the Figure below.
●The 2-phase counter is taken as a counter of one time increment.
A A
p hase phase
B +1 +1 B -1 -1 Outp
p hase phase
T im e T im e ut of
U p lin k a c tio n w h e n it D o w n lin k a c tio n w h e n it
ro ta te s fo rw a rd ly ro ta te s re v e rs e ly
2-37
Chapter 2 Device Counter
Counting Result
When the current value of the high-speed counter reaches the setting value, please use the
following application instruction if you wish to output immediately.
A. <<Comparison relocate/reset instruction for high-speed counter>>
● After it reaches the comparison value, the interruption will be ON(Y000 ON).
●As for the output of PLC, please use the transistor machine type, because the relay type doesn't
support real-time output.
X 000
D H SZ K5 K 20 C 241 Y 000
C om parison C om pariso
value 1 n value 1 2
H igh-speed O utput
counter
num ber
2-38
Chapter 2 Device Counter
Common Precautions
● Regarding the contact used to drive the coil of high-speed counter, please use continuously
connected contact when high-speed counting.
Input number corresponding to
Ex:M8000(Monitor) C235
X000
C235 C235
When programming, please use the When the counting is specified, after the relay
contact commonly used by the number is moved, the high-speed counter
counter when it stops can’t count correctly.
● If the high-speed counting is performed by the device with contact such as the analog switch,
the counter error may be caused by the switch vibration. Please pay attention to that.
● The number of input relay used for input of high-speed counter, could not be used together with
other instructions with the same input.
For example: input interruption processing(Pointer), pulse output density instruction FUN56 SPD.
● For all high-speed counters, the output point won't act as long as the counting input pulse is not
assigned even if the instruction is executed when the current value is equivalent to the setting
value.
● By connecting/disconnecting the input coil (OUT C***) of the high-speed counter, it could
start/stop counting. The output coil requires programming on the main program. If the
programming is interrupted in the circuit of step echelon, or the sub program, the counting and
stopping won't be executed until running these step echelon and sub program.
2-39
Chapter 2 Device High speed Counter
16-bit (D, W)
One data register (16-bit), with the digit range: -32,768~+32,767
Upper Lower
position
16-bit position
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b15
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
2-40
Symbol
0: Positive number
1: Negative number
Chapter 2 Device High speed Counter
Readout and writing-in of data register employ application instruction. In addition, direct
readout/writing-in can be executed from the unit (monitor) and programming equipment.
32-bit (D, W)
Two adjacent data registers are used to express 32-bit data. (The high digit bit is a large
number and the low digit bit is a small number). For example, combine D0 and D1 as 32-bit
register, wherein D1 is high bit, and D0 is low bit. (In Index register, V is a high digit and Z is
low digit). Therefore, it could process digits of -2,147,483,648~+2,147,483,647.
Upper Lower
32-bit
position position
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
b0
Symbol
1,073,741,824
536,870,912
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65,536
32,768
0: Positive
number
1: Negative
number
When 32-bit is specified, if the following digit bit (such as D0) is specified, the number after
the high digit bit (such as D1) will be occupied automatically. The low digit bit can be specified
any device element of odd or even. Considering monitoring of AP-PCLINK, the following even
device element number is recommended.
2-41
Chapter 2 Device High speed Counter
be changed, the transmission command F12 MOV is used to write in target time in D8000.
M8002
F12 MOV K250 D8000 Set monitor timer at 250ms
Initial
pulse
Monitor timer
F7 WDT
refreshing
Refer to program memory and parameter structure, as well the additional instructions for
basic functions for the holding features of special data register in case of power failure.
Refer to additional instructions for basic functions on the types of special data registers and
functional description of each type.
Example of Actions
There are a lot of applications for the data register, as introduced below. For more
information, please refer to the specific application instructions.
D0
<Data register of basic instructions > T2
■ It could specify the setting value of timer and counter.
D20
Timer and counter set values as per specified data register. C20
2-42
Chapter 2 Device High speed Counter
automatically.
2-43
Chapter 2 Device High speed Counter
M8002
F12 MOV K300 T10
16-bit
The two kinds of index registers V and Z have the same structure with the above
data registers.
16-bit 16-bit
V Z
V0~V15: 16 points Z0~Z15: 16 points
2-44
Chapter 2 Device High speed Counter
32-bit 32-bit
V0(Upper position) Z0(Lower position)
When processing device of 32-bit application instruction or
values beyond 16-bit, Z0-Z15 must be used. See the V1(Upper position) Z1(Lower position)
D MOV K 300 Z2
K 3 0 0 — (V 2 ,Z 2 )
Device index
For device that may possibly index, the content is described below:
Devices and digits of decimal system: M, S, T, C, D, W, KnM, KnS, P, K.
For instance: V0=K5, when D20V0 is executed, the executed device number is D25 (D20+5).
In addition, the constant can be changed.
For instance: For example, when K30V0 is specified, the executed element is the value
K35(K30+5) of decimal system.
Devices of octonary system: X, Y, KnX, KnY.
For instance: Z1=K8, when X0Z1 is executed, the executed device number is X10 (X0+8:
Addition of octonary system). As for device index of octonary system, content of V and Z
should be converted into octonary system digits before performing addition computation.
Therefore, assume Z1=K10, X0Z1 is specified as X12. Please note that this number is not X10.
Value of hexadecimal system: H
For instance: Constant H30V5 is specified based on V5=K30, it is regarded as H4E (30H+K30).
Besides, constant H30V5 is specified based on V5=H30, it is regarded as H60 (30H+30H).
Index Instance and Notes
Concerning operand index and notes for application instructions, please refer to operand
index of index register.
2-45
Chapter 2 Device High speed Counter
Function
Special registers F range from F0~F1999, which are mainly applied in two instructions,
FLASH STORE and FLASH LOAD.
X000
STOREP D100 F200 K3
After X0 is turned ON, the values of D100, D101 and D102 will be stored in special registers
F200, F201 and F202 of FLASH.
D100 F200
D101 F201
D102 F202
Note: F0~F999 and F1000~F1999 are two regions of FLASH. Thus, when the instruction in above
instance is used for storage, it will read and write in these two regions of FLASH, so that the
scanning cycle will be longer than that when witting in one region.
Special registers F can't monitor with AP-PCLINK.
2-46
Chapter 2 Device Data Register
Number of Pointer
The number of pointer [P] and [I] is stated below (Distributed based on decimal system).
When pointer for input interruption is used, the input code distributed to interruption can not be
used for high-speed counting and pulse wave density (FUN56).
For time For counting
For Applicable
For interruption input(10 points) interruption interruption
branching Series
(3 points) (6 points)
Input Rising edge Falling edge
X000 I001 I000
AP100, X001 I101 I100
I010
AP200, X002 I201 I200
I020
P0~P127 AP300 X003 I301 I300 I6**
I030
128 X004 I401 I400 I7**
I040
points X005 I501 I500 I8**
I050
X010 IA01 IA00
I060
X011 IB01 IB00
AP300
X012 IC01 IC00
X013 ID01 ID00
Notes: External interruption input of AP300 Version V1.1, X10~X13, is effective .
Instance of Function and Action:
Function and action of pointers for branching and interruption are stated below:
Almost all the pointers and application instructions can be used together. Therefore, refer to
the manual for operation and instruction. Function and action of pointers for branching and
interruption are stated below:
2-47
Chapter 2 Device Data Register
For branching
1. F00 (CJ)Conditional jumping 2. F01 (CALL)Call sub-program
X000
CALL P10
J Main
X000 Progr
u
CJ P1 am
m
FEND p
Jump
Mark
10 Routin
P1 sub-
R progra
When X000 is ON, instruction F00(CJ) will jump et
to the specified position, and then the program
will be executed. SRET u
r
END n
For interruption
There are 3 types of pointer for interruption, application instruction FNC03 (IRET) for
interruption return, FNC04(EI) interruption allowable and FNC05(DI) interruption forbidden,
which could be combined for use.
1. For input interruption: Receiving the input signal from a specific number is not affected by PLC
scanning cycle. When reading the signal, interruption sub-program will be executed When
input is interrupted, signal shorter than the scanning cycle can be read. During sequence control,
short time pulse wave signal can be processed in priority.
2.For time interruption:When it is the specified interrupted time cycle (3ms~99ms), the
interruption sub-program will execute the interruption process at the fixed time beyond the
scanning time of PLC.
3. For counting interruption: Execute interruption sub-program based on the comparison results of
the high-speed counters in PLC. It is used to control the processing of counting results by
high-speed counter which takes priority.
2-48
Chapter 3 Interpretation of Basic Sequential Control Instructions Table of Contents
3-1
Chapter 3 Interpretation of Basic Sequential Control Instructions Basic Instruction List
Parallel connection of NO
[OR] 1
(normally open) contacts XYMSTC
Parallel connection of NC
[ORI] XYMSTC
1
(normally closed) contacts
3-2
Chapter 3 Interpretation of Basic Sequential Control Instructions Basic Instruction List
Parallel connection of
[ORF] XYMSTC 2
falling edge pulse
Serial connection of
[ANB] X003 X004 1
multiple contact circuits
Parallel connection of
[ORB] X003 X004 1
multiple contact circuits
[NOP] No operation 1
[END] Program end 1
X001
[PLS] Rising edge pulse PLS YM 2
X001
PLF] Falling edge pulse PLF YM 2
[P] Indicator —
3-3
Chapter 3 Interpretation of Basic Sequential Control Instructions Basic Instruction List
3-4
Chapter 3 Interpretation of Basic Sequential Control Instructions LD/LDI/OUT/OUTI
Interpretation of instructions
(1) [LD] Normally open contact and bus connection instruction, for X, Y, M, T, C and S.
(2) [LD] Normally closed contact and bus connection instruction, for X, Y, M, T, C and S.
(3)[OUT]Coil drive instruction used to drive one specified coil with result of logic computation.
For instance: output contact, auxiliary relay, step point, output coil of timer/counter, which can
not be used for input coil X, but for Y, M, T, C and S.
(4) [OUTI]Inverse instruction of coil driving instruction [OUT], only for Y and M.
Programming Instance
Y00
X001 1
LD X001
Y00 OUT Y001
X001
2 LDI X001
OUTI Y002
Output of Timer/Counter
When instruction OUT is used for the timer and counter, the constants K and H are used to
specify pre-setting values. Data registers D and W can be used to specify pre-setting values
indirectly.
See the following table for the setting ranges of time constant K and setting values of
corresponding time:
Number
Timer/Counter Setting range of value K Actual setting values
of steps
1ms timer 1~32,767 0.001~32.767 seconds 3
10ms timer 1~32,767 0.01~327.67 seconds 3
100ms timer 1~32,767 0.1~3,276.7 seconds 3
16-bit counter 1~32,767 1~32,767 3
32-bit counter -2,147,483,648~+2,147,483,647 -2,147,483,648~+2,147,483,647 5
3-5
Chapter 3 Interpretation of Basic Sequential Control Instructions AND/ANI
Interpretation of instructions
(1)[AND] Normally open contact series connection instruction, for X, Y, M, T, C and S.
(2)[ANI] Normally closed contact series connection instruction, for X, Y, M, T, C and S.
● [AND] / [ANI] instruction can be only used for series connection of single contact. The
number of series connection contacts is unlimited, and cab be used repeatedly. If circuit block
with two or more contacts in parallel connection is to be series connection, instruction ANB is
used. Instruction ANB is the series connection instruction for circuit block in parallel connection,
without target device followed.
Programming Instance
X001 X005 C022 LD X001
OR C022
C022 AND X005
OUT C022
X004 X003 C023
LD X004
ORI C023
C023 ANI X003
OUT C023
Y003 X003 T1
Y004
M010
3-6
Chapter 3 Interpretation of Basic Sequential Control Instructions OR/ORI
Interpretation of instructions
(1)[OR] Normally open contact instruction in parallel connection, for X, Y, M, T, C and S.
(2)[ORI] Normally closed contact instruction in parallel connection, for X, Y, M, T, C and S.
● When control circuits of the ladder logic is comprised of several contacts in parallel connection,
instructions [OR] and [ORI] will be used.
● Instruction [OR]/[ORI] is used with said instruction [LD]/ [LDI] in parallel connection, no
restriction on using times.
● Instruction [OR]/[ORI] is only used for parallel connection of single contact. If circuit block
with two or more contacts in series connection is to be parallel connection,
Instruction ORB is used. Instruction ORB is the parallel connection instruction for series
connection circuit block, with no target device followed.
Programming Instance
Parallel connection instruction of series connection circuit block ORB
X001 Y001
ORB: Instruction that makes two or more series LD X001
ORI X002
connection circuit blocks in parallel connection. X002 OR M1
OUT Y001
For circuit block with two or more M1 LDI Y001
AND X003
contacts in series connection, when the series LD M2
Y001 X003 X004 M2 AND M4
connection circuit block is to be parallel ORB
M2 M4 ANI X004
connection, instructions LD and LDI are used at OR M3
OUT M2
the start end of the branch, while instruction M3
3-7
Chapter 3 Interpretation of Basic Sequential Control LDP/LDF/ANDP/ANDF/ORP/ORF
Instructions
Interpretation of instructions
(1) The instructions [LDP]/ [ANDP]/ [ORP] refer to the device operated by the instructions can
connect one scanning cycle when triggering (OFF→ON) on the rising edge.
(2) The instructions [LDF] / [ANDF] / [ORF] refer to the device operated by the instructions can
connect one scanning cycle when triggering (ON→OFF) on the falling edge.
Programming Instance
X001 M0
LDP X001
X002 ORP X002
OUT M0
X003 X004 M1
LDP X003
ANDP X004
OUT M1
X001 M0
LDF X001
X002 ORF X002
OUT M0
X003 X004 M1 LDF X003
ANDF X004
OUT M1
3-8
Chapter 3 Interpretation of Basic Sequential Control LDP/LDF/ANDP/ANDF/ORP/ORF
Instructions
X010
Scan cycle
M6
Under two circumstances, when X010 is switched from OFF→ON, M6 is only connected for one
scanning cycle.
X020
MOV K10 D0
X020
MOV P K10 D0
When X020 is changed from OFF→ON, data is D0 is transmitted for one time, and the two
procedures have the same drive effect.
When logic results of the instruction MOV in previous condition are ON, the data are
transmitted continuously. When the logic results are OFF, the data transmission will be stopped.
When logic results of the instruction MOVP in previous condition are switched from OFF
to ON, the data are transmitted accordingly. Such switches are in correspondence with times of
data transmission.
3-9
Chapter 3 Interpretation of Basic Sequential Control Instructions ORB
6 Instruction ORB
Interpretation of instructions
ORB: Instruction that makes two or more series connection circuits in parallel connection.
●The circuit with two or more contacts in series connection is called series connection circuit
block. When it is in parallel connection, instructions LD/LDI are used at the start end of the
branch, while instruction [ORB] is used for terminal end of the branch.
●[ORB] is a single instruction without device, without any device number followed.
● In multi-parallel connection circuit, if each series connection circuit uses the instruction ORB,
times of parallel connection will be unlimited. [ORB]
Instruction can be used continuously. At this time, times of repeated use of the instruction [LD]/
[LDI] on one bus shall be less than 8 times.
Programming Instance
LD X001
AND X002
X001 X002 Y001
LD X003
AND X004
X003 X004
ORB
LD X005
X005 X006
AND X006
ORB
OUT Y001
3-10
Chapter 3 Interpretation of Basic Sequential Control Instructions ANB
7 Instruction ANB
Interpretation of instructions
[ANB] Instruction that connects start end of the parallel connection circuit block to the last
circuit in series connection.
● Circuit with two or more contacts in parallel connection is called parallel connection circuit
block. Instruction ANB is used for connecting parallel connection circuit block in series
connection.
When it is connected to the last circuit in series connection, the instructions LD and LDI will be
taken as start end of the branch circuit. After finishing parallel circuit block of the branching
circuit, the instruction ANB can be used for finishing series connection of the two circuits.
●[ANB] is a single instruction without device, without any device number followed.
● When several circuits are in parallel connection, if each parallel connection block employs the
instruction ANB for sequential series connection, quantity of parallel connection circuits is
unlimited. The instruction [ANB] can be used collectively, but the instructions LD and LDI
must be repeatedly used less than 8 times on the same bus.
Programming Instance
X001 X002 X003 Y001 LD X001
OR X004
X004 X005 X006 LD X002
AND X003
X007 LD X005
AND X006
X010
ORB
OR X007
ANB
OR X010
OUT Y001
3-11
Chapter 3 Interpretation of Basic Sequential Control Instructions MPS/MRD/MPP
Interpretation of instructions
(1) [MPS] (PUSH) Push instruction.
(2) [MRD] (READ) Read instruction.
(3) [MPP] (POP) Pop instruction.
● The group of the instructions can execute push protection for state of the contacts. When state
of the contacts is required, the instruction pop will be MPP MPS
executed to ensure correct connection of the following
MRD
circuits.
● In the PLC, there are 8 memories available for storing the
middle computation results, which are equal to stacking in
computer. One section of memory zone is obtained according
to the principle of first in and last out.
...
● When the instruction MPS is used one time, computation
Stacking
results at the moment will be stored in the first stacking unit.
When MPS is used for a second time, the computation results will be stored on the stacking top.
The former data will be stored to the next stacking unit. When the instruction MPP is used, the
data are transmitted to the last stacking unit. After it is sprang out, the data on the stacking top
will disappear from the stacking. MRD is the special instruction for reading data on the stacking
to. Data in the stacking will not be transmitted. ●Instructions MPS, MRD and MPP are without
device, so they are without any device number followed. MPS and MPP shall be used in pair,
which shall be used less than 8 continuous times.
Programming Instance
Y001
X001 X002 LD X001
MPS
X003 Y002 AND X002
OUT Y001
X004 Y003 MRD
AND X003
Y004 OUT Y002
MRD
AND X004
OUT Y003
MPP
OUT Y004
END
3-12
Chapter 3 Interpretation of Basic Sequential Control Instructions MPS/MRD/MPP
X012
Y007
In one section of stacking, instructions ANB and ORB are applied together.
X000 X001
Y000 0 LD X000
1 MPS
X002 2 LD X001
3 OR X002
4 ANB
X003 X004 5 OUT Y000
Y001 6 MRD 12 ANB
7LD X003 13 OUT Y001
X005 X006 8 AND X004 14 MPP
9 LD X005 15 AND X007
10 AND X006 16 OUT Y002
X007 11 ORB 17 LD X010
Y002 18 OR X011
19 ANB
X010
20 OUT Y003
Y003
X011
3-13
Chapter 3 Interpretation of Basic Sequential Control Instructions MPS/MRD/MPP
X000
Y004
LD X000
X001
OUT Y004
Y003
AND X001
OUT Y003
X002
AND X002
Y002
OUT Y002
AND X003
X003
OUT Y001
Y001 AND X004
OUT Y000
X004
Y000
Compare the two programs. The circuit as shown in above figure requires programming
with quad-MPS instruction. However, if the following circuit is used, it could be programmed
conveniently without instruction MPS.
3-14
Chapter 3 Interpretation of Basic Sequential Control Instructions INV
Interpretation of instructions
(1) MC (Master Control Circuit Start) Connection instruction for public series connection
contacts (new bus for public series connection contacts).
(2)[MCR] (Master Control Circuit Reset) Reset instruction of MC instruction.
● The two instructions are set at the start and end points of the master control circuit block
respectively.
● In the chart below, when the input X001 is ON, instructions between [MC] and [MCR] are
executed. When X01 is OFF, devices between instructions [MC] and [MCR] will be in the
following state: Accumulated timer/counter and devices driven by the instruction [SET]/[RST]
will keep current state; the non-accumulated timer and devices driven by the instruction [OUT],
will be OFF.
● After executing the instruction MC, the bus (LD and LDI) will be transferred to MC contact.
To return to the original bus, the return instruction MCR is used. The instruction MC]/[MCR]
must be used in pair. When using different numbers of device Y and M, the instruction [MC] can
be used repeatedly. If the same device number is used, double coil output will occur like the
instruction [OUT]. The instruction [MC] can be used in nested way. That is, the instruction [MC]
can be used in the instruction [MC]. In this case, the number of the nested level is from small to
big. When the instruction [MCR] is returned level by level, the number of nested level is from
big to small.
Programming Instance
X001
MC N0 M1 LD X001
MC N0 M1
X002 LD X002
Y001 OUT Y001
X003
LD X003
Y002 OUT Y002
MCR N0
MCR N0
If the instruction [MC] is used in the instruction [MC], the number of the master control
point shall be from small to big (N0→N1→N2→N3→N4→N5→N6→N7). When returning, the
instruction MCR is released from big to small levels. (N7→N6→N5→N4→N3→N2→N1→N0)
The maximum nested level is 8 (N7).
3-15
Chapter 3 Interpretation of Basic Sequential Control Instructions INV
10 Instruction INV
Interpretation of instructions
[INV] (Inverse) The instruction is expressed with one short diagonal with an inclination angle
of 45°, which is to inversely obtain the computation results before the instruction.
● Instruction [INV] has no device, so it doesn't need to specify device number. The actions in the
program are described as below:
Programming Instance
X001 INV
Y001
ON
OFF OFF
X001
ON ON
Y001
OFF
As shown in the above chart, when the input relay X001 is OFF, the output coil Y001 is ON.
When X001 is ON, Y001 will be OFF. The instruction INV can be written at the same
positions for inputting AND, ANI, ANDP and ANDF. The instruction INV can not be
connected to bus like LD, LDI, LDP and LDF, or used independently like OR, ORI, ORP and
ORF.
3-16
Chapter 3 Interpretation of Basic Sequential Control Instructions SET/RST
Interpretation of instructions
(1) [PLS] differential output instruction is available for rising edge.
(2) [PLF] differential output instruction is available for falling edge.
● The two instructions are used for pulse output for target device. When input signal changes, a
pulse with width of one scanning cycle is generated.
● When the instruction [PLS] is used, if the drive input point is ON, the driven device will only
action for one scanning cycle.
● When the instruction [PLF] is used, if the drive input point is OFF, the driven device Y and M
will only action for one scanning cycle.
For instance: The input points X000 and X001 are ON according to the following chart. When
PLC is operated as ON→ OFF→ ON, by analyzing the time sequence logic of the program, we
can learn that when X000 is connected to the rising edge, M0 coil will be ON for one scanning
cycle, closing of M0 normally opened will make Y001 powered as 1; when X001 is connected to
falling edge, M1coil will be ON for one scanning cycle, closing of M1 normally opened makes
Y001 reset as 0.
Programming Instance
X000
LD X000
PLS M0
PLS M0
M0
SET Y001
LD M0
SET Y001
X001
PLF M1 LD X001
PLF M1
M1
RST Y001 LD M1
RST Y001
X000
X001
M0 Scan cycle
M1 Scan cycle
Y001
3-17
Chapter 3 Interpretation of Basic Sequential Control Instructions SET/RST
Interpretation of instructions
(1) [SET] (Set coil): Set instruction to keep the coil ON.
(2) [RST] (Reset): Reset instruction to keep the coil OFF.
● By using the instructions [SET] and [RST] in program, it can set mark and clear mark for any
state or time at any place for customers’ program conveniently.
● The instructions [SET] and [RST] have the function of self-holding. In the procedure as shown
below, when X001 is ON, even if it is turned OFF, Y001 will stay ON. Once X002 is ON, even if
it is turned OFF, Y0001 will stay ON.
●Instructions[ SET] and [RST] can be used repeatedly in any orders on the same device.
However, only the lastly executed one will be valid. Other programs can be inserted between
[SET] and [RST].
●In addition to Y, M and S, the instructions [ SET] and [RST] are also available for T, C and D.
That is, it can clear the values in data register D and index register. Moreover, the timer T and
counter C can be reset to clear the time and counting value.
Programming Instance
X 001 LD X 001
SET Y 001
SET Y 001
X 002 LD X 002
RST Y 001
RST Y 001
X 003 LD X 003
SET M1
SET M1
X 004 LD X 004
RST M1
RST M1
X 005 LD X 005
SET S1
SET S1
X 006 LD X 006
RST S1
RST S1
X 007 LD X 007
RST D1
RST D1
X 001 K 10 LD X 001
T247
OUT T247
X 007 K 10
RST T 247 LD X 007
RST T247
X 001
X 002
Y 001
3-18
Chapter 3 Interpretation of Basic Sequential Control Instructions OUT C/RST C
Programming Instance
X 010
RST C 0
X 011 K 10
C0
C 0
Y 000
X012
M ***
X010
RST C***
X011 K10
C***
C***
Y2
When single-phase and single input counter C235-C245 is used, special auxiliary relay
M8235~M8245 shall be used to specify the counting direction. As shown in above figure,
when X012 is ON, it will be down counting; when X012 is OFF, it will be up counting.
When X010 is ON, output contact of the counter C*** will return and the current value of
the counter will be cleared to 0.
If counter (C241, C242…) with the function of reset is used in the program, when the
corresponding reset input is ON, the same effect with the above instruction can be achieved
through interruption input, which doesn't require programming.
When X011 is ON, counting shall be executed for the ON/Off of counting input X000-X005,
which is determined by number of the counter.
3-19
Chapter 3 Interpretation of Basic Sequential Control Instructions OUT C/RST C
Current value of the counter is increasing, when it reaches the setting value, the output
contact will be SET; if it is smaller than then current value, it will be RST.
3-20
Chapter 3 Interpretation of Basic Sequential Control Instructions NOP/END
Interpretation of instructions
(1) NOP (No Operation) No operation instruction (or for deleting one instruction).
(2) END Instruction to end the program.
● During program debugging , if the instructions NOP and END are appropriately used, it will
bring convenience to users.
● NOP is a no operation instruction, and CPU will not execute the target instruction. The
instruction NOP occupies one step sequence in the program. There is no corresponding device to
express in the ladder logic. However, it can be reflected in the step sequence of the ladder logic.
After clearing all the executing instruction programs, all the instructions will be changed to NOP.
The program NOP can be inserted to minimize the times of changing the step number when the
instructions are modified or added.
● As for finished program, when the instruction NOP is inserted, the program will change
accordingly. Please pay attention to it.
● The instruction END is used to end the program, without target device. The instruction END
can set sections during program debugging, It can insert the instruction END by section, then
debug section by section. You should delete the instruction END after the debugging.
3-21
Chapter 3 Interpretation of Basic Sequential Control Instructions SMCS/SMCR
Interpretation of instructions
(1) [SMCS](Start circuit branching) It is equal to one conditional bus. When the condition before
the instruction is ON, the conditional bus bar will be ON.
(2) [SMCR](Start circuit branching) End conditional bus.
● In the program [SMCS] and [SMCR] must be used in pair. In the program, the instruction
[SMCS] can be used for many times continuously or discontinuously. It is mainly used for the
positions which require several occurrences in other multiple circuits, so as to simplify the
program.
Programming Instance
X001
SMCS
SMCR
Instruction [SMCS] in the program can be used for many times, as shown in the figure
below. Every time it is used, one condition for auxiliary bus is added. After the instruction
SMCS has been used for many times, only one [SMCR] instruction can clear all the conditions.
X001
SMCS
X002
X001 X002
Y015
Y015
X010
SMCS X001 X010 X003
Y016
X003
Y016 X001 X010 X004
X004 Y017
Y017
SMCR
Each instruction after [SMCS] and before [SMCR] can execute computation in CPU with
3-22
Chapter 3 Interpretation of Basic Sequential Control Instructions SMCS/SMCR
the condition before SMCS. When the common circuit is pretty complicated or recurs for
several times, such instruction can simplify the program.
Note: OUT and application instructions cannot be after [SMCS] directly.
3-23
Chapter 3 Interpretation of Basic Sequential Control Instructions JCS/JCR
Interpretation of instructions
(1) [JCS] Start jumping branching.
(2) [JCR] Reset jumping branching.
● All the instructions after [JCS] and before [JCR] will not be executed. That is, during [JCS]
conditional input is ON, content of the register will remain the same. The instruction [END] is
not allowed between [JCS] and [JCR], otherwise, the error will occur to the program, and alarm
indicator will be ON.
X001
JCS
X001
X002
Y001 X002
X003 Y001
K50
T250
X003
X004 2s 3s
RST T250
X004
JCR T250
Note 1: Pay special attention to timing signal of the timer, and the relative time relation
between the input signals of counter (switch from OFF→ON) and ON/OFF state of [JCS].
JCS
A B C
status ② ④
① ⑧
Input
signal
③ ⑤⑥ ⑦
Y001
When X002 is in ① at the rising edge, Y001 will act, for state of[ JCS] is OFF. When the
state(A) of [JCS] is OFF, the state of Y001 is determined by the input signal.
When X002 is in ② at the falling edge, ③ at the rising edge, ④ at the falling edge and ⑤ at
the rising edge, Y001will not act, for state of JCS is ON. In other words, Y001 will keep ON.
When JCS is ON, Y001 will not be affected by state change of ON→OFF or OFF→ON.
Since the state of [JCS] is OFF (B), when X002 is in ⑥ at the falling edge, the input signal
will be switched from ON→OFF, and Y001is switched from ON→OFF.
When X002 is in ⑦ at falling edge, Y001 will keep the status, for [JCS] is ON at the
3-24
Chapter 3 Interpretation of Basic Sequential Control Instructions JCS/JCR
moment.
In ⑧, [JCS] is from ON→OFF and the input signal is ON, so Y001 will act.
Note 2: When state of [JCS] is ON, instructions that will affect positions between [JCS] and
[JCR] will not be executed.
Note 3: The instruction [END] between [JCS] and [JCR] will be executed certainly, which is not
affected by ON/OFF state of [JCS]. At this time, execution of the program will be suspended and
the next scanning cycle is entered.
Note 4: Instructions [JCS] and [JCR] can be inserted between [SMCS] and [SMCR].
X000
SMCS
X001
JCS
X002
Y001
X003 K50
T250
X004
RST T250
JCR
SMCR
X000
X001
X002
Y001
X003
2s 5s
X004
Current value of Current value of
T250 is K20 T250 is K0 Current value of
T250
T250 is K50
Note 5: Another [JCS] shall be inserted between [JCS] and [JCR], but only one [JCR] can be
taken as state ending.
3-25
Chapter 3 Interpretation of Basic Sequential Control Instructions Notes for Programming
1) Ladder in the ladder logic starts from the left bus and ends in the right bus. Each row at
the left side is the combination of contacts, which represents the conditions for driving logic coil.
The logic coil representing the results can be only located at the right bus. The contacts can not
be at the right side of the coil.
2) The contacts shall be drawn on the horizontal line rather than the vertical line.
3) When parallel connection blocks employ series connection, branch with more contacts
shall be located at the left side of the ladder logic. When series connection blocks employee
parallel connection, the parallel connection branch with more contacts shall be located on the
upper side of the ladder logic.
4) Double-coil output is not recommended.
③ OR ② OR Without
④ ANB
ANB
3-26
Chapter 3 Interpretation of Basic Sequential Control Instructions Notes for Programming
1 5
2 3 6 7 9 10
4 8
11
Y004=ON.
3-27
Chapter 3 Interpretation of Basic Sequential Control Instructions Notes for Programming
A B A B
Y000 Y000
C E
Ignorable
Ignorable
C E D
Y000
D
A B
Or M100
C E
M101
D
M100
Y000
M101
Skipping instruction and step ladder logic instruction can be used to modify the above
program to the same output. When the step ladder logic instruction is used, please pay attention
to the use of double output and the same output in the master program and state program .
3-28
Chapter 3 Interpretation of Basic Sequential Control Instructions Notes for Programming
Bridge Circuit
As shown in the figure: It is the circuit that changes the direction of flow of the
bi-directional loop. (parallel connection for loops without D and B)
C E B
A B F
F
A
E
A E D
C D C
B D
E
C
3-29
Chapter 4 Instructions of Step Ladder Logic Table of Contents
4-1
Chapter 4 Instructions of Step Ladder Logic SFC Programming Introduction
4-2
Chapter 4 Instructions of Step Ladder Logic SFC Programming Introduction
frame, and the assembly number is in the frame. One control system shall have one initial state,
which is correspondence with the operation origin. The symbol of the initial state is double line
frame.
② Transfer It represents change from one state to another. Oriented segment is used to
connect the transfer to indicate the direction. Vertical line on the oriented segment and the
numeric symbol marked beside represent the transfer conditions of state.
③ Actions in correspondence with state are represented with one or several rectangles at the
right side.
(3) Basic forms of SFC is divided into three forms according to the structure:
① Single flow structure: it refers to the state is operated one after another, each state is only
connected to one transfer and vice versa;
② Selective structure: it refers to several single flow branches after one state. When the
corresponding transferring conditions are satisfied, one single flow branch can be selected one
time. Transferring conditions of selective structure is that one horizontal line is connected after
a certain state, and the first transfer of each single flow branch is connected under the horizontal
line. After ending of the single flow branch, one horizontal line shall be used to represent and
there should be no transfer under it.
③ Parallel structure: it refers that under some transfer, if the transfer conditions are satisfied,
several parallel single flow branches can be triggered simultaneously.
These parallel sequential branches shall be written between the two horizontal lines.
4-3
Chapter 4 Instructions of Step Ladder Logic SFC Programming Introduction
Firstly, create a new AP project, and then click "SFC"shown on the toolbar to access the
following interface:
The left side is used to draw the flow structure for SPC, while the right side is used to
program the ladder logic instructions. Click "L" on the left to write the initial program of SFC on
the right. For example:
M 800 2
SET S0
After finishing the initial program, start to write the initial SFC step on the fourth column of
4-4
Chapter 4 Instructions of Step Ladder Logic SFC Programming Introduction
Add the initial step S0, and then program the corresponding ladder logic instruction on the
right. If the initial step S0 doesn't have the corresponding ladder logic instruction, it will display
“? 0” as shown above. After the instruction is programmed, “?” will disappear automatically.
For example:
M 0
Y 000
After finishing the ladder logic instruction for initial step S0, you may add the transfer
condition on the fifth column, as shown below:
After adding the transfer condition flow, please program the transfer condition on the right.
The unprogrammed transfer condition will be shown as “? 0”. After it is programmed, “?”
will disappear automatically. For example:
M100
TRAN
4-5
Chapter 4 Instructions of Step Ladder Logic SFC Programming Introduction
Once the initial step and transfer condition are completed, you may add other steps and
transfer conditions in the following, as shown below:
4-6
Chapter 4 Instructions of Step Ladder Logic Step Instructions STL/RET
STL and RET are a pair of step instructions, which means starting and ending of step
instructions.
Interpretation of instructions
[STL](Step ladder) The instruction is to connect the master bus with the normally open contact.
It is represented by the normally open contacts composed of two small rectangles.
[RET](Return) Instruction of returning to master bar.
● The step instruction STL is the start of working step control for executing step point of internal
devices. The initial state must start with S0-S9. [RET] is the end of the step point (S), also it
must be ended with S0-S9. Then the program returns to the master bus. At the end of the step
ladder logic, the instruction RET is required. In one PLC program, totaled 10 step flows in
maximum can be written into S0~S9 and each step flow requires the instruction RET to end.
Write the state ladder logic according to the following rules. SFC and ladder logic are
exchangeable.
4-7
Chapter 4 Instructions of Step Ladder Logic Step Instructions STL/RET
Output interlocking
During state transfer, the two states are active at the
same time instantly(one scanning cycle). Therefore, to
avoid failure of simultaneous activation of a pair of
outputs, interlocking can be set on PLC externally.
Besides, as shown in the right figure, it also requires
setting interlocking on the corresponding program.
Repeated use of timer
In SFC chart, the timer coil can program the same
software component of the same timer under different
states as the output coil. However, it can not act under
adjacent state(As shown in the right figure). If the same
timer is set under adjacent state, the timer coil will not be
inactive in case of state transfer, and the current value can
not be reset.
The instructions OUT and SET have the same functions for state (S) after the instruction
4-8
Chapter 4 Instructions of Step Ladder Logic Step Instructions STL/RET
STL, which will reset the transfer source. In addition, it has the function of holding. However,
when the instruction OUT is used, it is used for transferring to separation state.
Step point skipping is used for transferring the state of the step point to non-adjacent
step point.
Transfer conditions of step point is state transferring conditions between two step
points.
Selecting branching chart, is to transfer the state from the same step point to the
corresponding step point under different transfer conditions.
4-9
Chapter 4 Instructions of Step Ladder Logic Step Instructions STL/RET
Selecting merging chart, is to transfer more than two different step point state to the
same step point with the transfer condition.
Parallel branching is to transfer the same step point to more than two step points with
the same transferring condition.
Parallel merging point, is to transfer more than two step points to the same step point
with the same transfer condition when they are established simultaneously.
4-10
Chapter 4 Instructions of Step Ladder Logic Instruction Action and SFC Representation
Functions of instruction
Sequential control programming of SFC is built in PLC of AP series. The SFC chart can
be inverted into instruction table or ladder logic program, and vice versa.
In SFC, each state can be regarded as a control working step. The input conditions and
output control can be programmed according to the sequence. The biggest feature of the control
is that when current working step is in operation, the previous working step does not work. The
working steps operate one after another according to program to realize step control.
The step ladder logic instruction can be represented by the ladder logic. The action is
shown as below:
If the SFC chart indicates step ladder logic loop in the above figure, it represents following
figure
In the SFC chart, function of the equipments in each working step and the whole process are
easy-to-understand. The sequential control design is easy, which could completely transmit
4-11
Chapter 4 Instructions of Step Ladder Logic Instruction Action and SFC Representation
action even to the third person. Thus, it facilitates the maintenance, modification and
troubleshooting. The SFC chart and step ladder logic instruction shall be programmed
according to certain rules, which are exchangeable with the same content. Therefore, the
familiarized ladder logic is recommended. When programming SFC chart, corresponding
peripheral equipment and programming software are required.
4-12
Chapter 4 Instructions of Step Ladder Logic Instruction Action and SFC Representation
Programming equipment
SFC chart can be programmed with personal computer (user’s software for AP series). The
sequential control program programmed by SFC can be saved in AP PLC in the form of
instruction.
4-13
Chapter 4 Instructions of Step Ladder Logic SFC Features
4 SFC Features
Action
(1) Press the State button, the trolley moves forwards. When the inching switch LS11 acts, it
moves backwards. (LS11 is normally ON, when it moves forward at limit, it is OFF. It is the
same for other inching switches.
(2) When moving backwards, the inching switch LS12 acts. After stopping for 5 seconds, it
moves forwards. After the inching switch LS13 acts, it moves backwards.
(3) When the inching switch LS12 acts for a second time, drive motor of the trolley stops.
It is very difficult to correctly represent the complicated mechanic action with words like
above actions do. The mechanical technicians and electric technicians must cooperate closely.
The electric technician should design the program based on the action chart. Basically, the
common PLC can't be programmed without action sequential control chart.
However, the step action is very complicated for electric technicians, which required rich
experience and designing time. Moreover, PLC chart seems pretty complicated from the third
person, and such designer of sequential control should take responsibility for mechanical
maintenance.
4-14
Chapter 4 Instructions of Step Ladder Logic SFC Features
simple.
4-15
Chapter 4 Instructions of Step Ladder Logic Preparation for SFC Programming
Separation of flow
1 2 3 4 5 6 7 10
OUT
1 2 3 4 5 6 7 8 9 16
It is not allowed to start to transfer or reset the separation state from or before merging .
No op state must be set. Transferring and reset can only be executed from the branching.
4-16
Chapter 4 Instructions of Step Ladder Logic Preparation for SFC Programming
There is only condition for each node in AP SFC program. To write the program at the left
side of the figure below in practice, method at the right side shall be applied
X004
X004
S30 Y000 S30 Y000
X000 X001
X000 X002 M0
X001 X003 M0 X002 X003
S31 S31
Instructions MPS, MRD and MPP can not be used in transitional conditional circuit. The
right method shall be used for programming.
Actions of ▽ and ↓
4-17
Chapter 4 Instructions of Step Ladder Logic Preparation for SFC Programming
X000
ZRSTP S 0 S 50
S0
S 50
S0
M8034
4-18
Chapter 4 Instructions of Step Ladder Logic Preparation for SFC Programming
Special Relay
To program SFC chart effectively, various special relays shall be employed with content
described below:
Device Name Function and purpose
Operation It is the relay that shall be always ON during operation of PLC, which
M8000 monitoring can be used as input state for driving programming and operation state
(contact a) indication of PLC.
The relay is active instantly (one scanning cycle) when PLC turns OFF
Starting pulse
M8002 to ON. It is used for resetting of starting setting or initial state of the
(contact b)
program.
Driving the relay forbids transfer among all states. Under the
M8040 Transfer disabled conditions of forbidding transfer, the programs in the state will still
execute. Therefore, the output coil will not be off automatically.
When any state is active, M8046 is automatically ON, which is
M8046 STL state ON applicable for avoiding simultaneous starting or for action sign of
working step with other flows.
STL monitoring is Drive the relay, then the programming function can read the executing
M8047
effective state and display.
4-19
Chapter 4 Instructions of Step Ladder Logic Preparation for SFC Programming
X002 falling edge can not be detected. When S3 is active for a second time, it is detected.
Therefore, when S3 acts for a second time, it is transferred to S42 immediately.
S3 X 001
M6
X 001 X 001
SET S42 M7
X 001 S3
M6
SET S42
M7
4-20
Chapter 4 Instructions of Step Ladder Logic Pattern of SFC Flows
It indicates the action mode combining the action mode of SFC single flow, selection
branching and parallel branching.
Skipping
Transfer to the state below or out of the series is called skipping, which uses symbol ↓ to
indicate the transferred target state.
Repeating
Transfer to the above state is called repeating. The same as above, the symbol ↓ is used to
indicate transferred target state.
4-21
Chapter 4 Instructions of Step Ladder Logic Pattern of SFC Flows
S0 S0 S60 S60
SFC chart with flow cross can't be programmed. Flow in the above chart shall be
re-programmed according to the flow at the right side to realize reversal conversion from
program to SFC chart based on instruction.
4-22
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
4-23
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
The following chart is a representative state from SFC. Each state has the functions of
driving load, specifying transfer destination and transfer conditions. When sequential control of
relay is used to represent SFC, it is the step ladder chart below. It is programmed with SFC chart
or step ladder chart. The programming sequence is driving processing of load first, then transfer
processing can be performed. Of course, there is no driving processing for the status without
driving load.
0 [STL] S 20
The instruction table is used to represent program in the above
1 OUT Y 010
chart, see the right chart.
2 LD X 010
The instruction STL is the normally open contact connected to
3 OR X 011
main bus. And then the coil is directly connected to auxiliary bus or
4 OUT Y 011
the contact is used to drive the coil.
5 LD X 000
Contact connected to the auxiliary bus uses the instruction
6 SET S 21
LD(LDI). If it returns to original bus bar, the instruction RET
As for instructions SET and
shall be used. The contact STL drives the state S, it will be
RST, it is a 2-step
automatically reset before the state S moves.
instruction.
As for a string of SFC programs, several state programs shall be executed. Only if all the
states are programmed, will it end the programming And the state sequential number can be
4-24
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
selected at your discretion. However, initial state is required before a series of STL instructions,
and the instruction RET shall be written finally.
4-25
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
As shown in the chart above, the transfer of separation states, such as transfer to upward
position (repeating), transfer to downward position (skipping) and transfer out of the flow, are as
illustrated in [6 Patterns of SFC Procedure]. As shown below, instruction OUT is used for
programming. The cross procedure in 6.1 is the same.
From S40, S52 is driven by X003, even if the instruction OUT is used, when S52 holds its
action, the transfer source S40 will be reset automatically.
As shown in the figure, it indicates resetting S65 through X007 from S65.
From S65, although resetting of other state is the same, it it not transferring. Thus, S65 will
not be reset.
4-26
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
Like the programming of general state, driving processing shall be executed, then transfer
processing shall be executed. All the transfer processing shall be executed according to the
sequence.
Instance of Selective Merging
State drive processing before merging shall be executed first, then continue transfer
processing of merging state according to the sequence. It becomes the rules of reversal
inversion towards SFC.
Pay attention to sequential numbers of the program, and the branching row and merging row
can't be crossed.
4-27
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
Like the programming of general state, driving processing shall be executed, then transfer
processing shall be executed. All the transfer processing shall be executed according to the
sequence.
The maximum number of parallel branching is 8.
4-28
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
As shown above, link directly when transferring from the merging to the branching, without
intermediate state. It is recommended inserting a null state between them.
LD X004
SET S60
4-29
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
1. Single operation (X001=OFF,X002=OFF). Press starting button, X000 will act. It acts as per
the sequence according to Y000→Y001→Y002→Y003→Y007→Y000, and returns to standby
state. Output is executed according to the sequence as per the 2-second timer.
2. Continuous operation (X001=ON), repeat actions Y001~Y007.
3. Step operation (X002=ON), press the starting button once, output actions as per the sequence.
4-30
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
4-31
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
Y000
RET END
S0
The instance shows the SFC chart transfers towards the next state by skipping some flow
and based on the conditions. It could also skip towards the previous state.
4-32
Chapter 4 Instructions of Step Ladder Logic Instance of Single Flow
The skipping flow in the previous page can be represented in selective branching and
merging flows described below. Flowing direction must be from up to down, which can not be
crossed except branching and merging.
S 25 RST Y002
K 30
T5 T5 S 31
S 26 RST Y001
K 20
T6 T6 S 32
S 27 RST Y000
Y000
RET END
S0
For instance, when the state S20 acts, if X001 is active, the state S32 acts, then the contacts
act, which skips to the state S27 directly.
There should be more than one state in the branching; therefore, null state shall be set.
4-33
Chapter 4 Instructions of Step Ladder Logic Selective Branching/Merging
4-34
Chapter 4 Instructions of Step Ladder Logic Selective Branching/Merging
For such SFC chart for selecting size or judging acceptance or not, the following branching
and merging SFC chart can be used to represent.
例如以
For M8002
example, 驅動初始脈衝
use M8002 to drive the initial pulse
S0 Sequence
各個操作順序 of each operation
X026 Start
啟動
Y007 原點位置 ( 上限、左限、釋放)
Origin position(Upper limit, left limit, release)
S 21 Y000 下降
Fall
T0 K20
It represents
表示 X002的觸點 the contact
(常閉觸點) of X002(normally closed contact)
T0 T0
Lower
X002 下限(小球) X002 未達到下限
limit(Small ball) Lower limit is not reached
T1 K 10 T1 K 10
T1 T1
Rise
S 23 Y002 上升 S 26 Y002 上升
Rise
· If若為小球時
it is small (X002=ON)左
ball(X002=ON), the
X003 Upper
上限 limit X003 上限
Upper limit left flow is valid;
側流程有效 ;若為大球 for big ball, the
right flow is valid.
時,則右側的流程有效?
X004 X005
S 24 Y003 右行
Move right S 27 Move right
Y003 右行
S 30 Y000
T2 K 10
T2
S 32 Y002 Rise
上升 · 若驅動後面提到的特殊輔助繼電器M8040, 則禁止
If the following auxiliary relay M8040 is driven, all the state
所有的狀態轉移? 在狀態S24、S27與S33中,右移
Upper limit 輸出 Y003,
X003 上限 transfer will以及左移輸出Y004中各自串聯有相?
be prohibited. In the states of S24, S27 and S33,
的互鎖觸點。
X001
the output of moving right Y003 and output of moving left
S 33 Y004 左行
Move left
Y004 have relevant interlocking contacts in series connection.
X001 Left limit
左限
S0 RET END
4-35
Chapter 4 Instructions of Step Ladder Logic Parallel Branching/Merging
● Branches with several flows executed simultaneously are called parallel branching.
● As shown in the figure, after S20 acts, X000 is on, state S21, S24 and S24 will be effective
simultaneously and the flows start.
●After all the flows are completed, when X007 is ON, merging state S30 acts and state S23, S26
and S29 do not act.
● Such merging is also called waiting merging. (Flows completing earlier shall wait until all the
flows are completed, then merging is continued, and it continues acting).
For instance: parts A, B and C are processed separately, which are assembled after processing.
This is a parallel branching and merging flow.
4-36
Chapter 5 Representation and Use of Application Instructions Table of Contents
5-1
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
X000 S· D· n
MEAN D100 D150 K5
● MEAN: An auxiliary mark of the instruction indicates calculating the mean value.
S.: Source operands, called source for short, after executing the instructions, operand of the
content will not be changed. Under the conditions of changing device number with index, add
“•” [S• ] to represent. When there is more than one operand, represent with [S1• ], [S2•] and etc.
D.: Destination operand, called destination for short, after executing the instructions, operand of
the content will be changed. Like the source, index decoration shall apply. When there is more
than one operand, represent with [D1•], [D2•] and etc.
n: other operands, which are used to represent constant or make supplementary interpretation for
the source and destination. If it is used to represent constants, decimal system figure is followed
after K and hexadecimal system figure is followed and H.
5-2
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
● Program step: the step for executing the program. Generally speaking, the function number
and auxiliary mark occupy one step respectively. Each operand occupies 2-4 steps (2 steps for
16-bit operand and 4 steps for 32-bit operand).
X001
DMOV D20 D22 Content of (D21, D20) is sent to (D23, D22).
● As for function instruction with the symbol (D), it can process 32-bit data.
●32-bit data is comprised of 2 adjacent registers.
● One device of the 32-bit counter is 32-bit, and it can not be used as 16-bit operand.
X000
MOVP D10 D12
Under pulse execution, the instruction MOV executes data transmission when X000 is
5-3
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
OFF→ON. To shorten scan time, pulse execution instruction must be used as much as possible.
The symbol P represents the pulse execution for the instruction.
F24 (INC), F25 (DEC) and etc. shall be in accordance with the instructions. If continuous
execution instruction is employed, each scan cycle and source content will change.
X001
MOV D10 D12
The above figure is continuous execution instruction, PLC works in circulating scan. If the
execution condition X001 is ON, the above instruction is repeated once in each scan cycle.
When the drive inputs X0 and X1 are OFF, the instructions out of special symbols are not
executed and the destinations do not change.
Processing of symbols
General symbols
■ The following symbols will act according to the types of application instructions.
For example: M8020: zero symbol M8022: carrying symbol
M8021: borrowing symbol M8029: execution ends
When the instructions are ON, the symbols will be active or inactive accordingly; for OFF or
error, it will not change. When there are too many instructions affecting the symbols, every time
executing the instructions, the active/inactive state will be changed. Please refer to the following
instance of symbol program.
■ Instance of program with multiple symbols (standard case of executing results).
When there are multiple application instructions for the same symbol action, please write
contact point of the symbol after the instructions.
5-4
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
M8000
DSW X010 Y010 D0 K1 Read the value of digital switch
M8029
Action finishing flag of DSW is taken as the
MUL D0 K10 D20
triggering point to increase the number 10 times.
X010
SET M0
M0 D PLSY starts
5-5
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
M8029
Execution
result
M8000
As for applied instructions employing the finishing
DSW X010 Y010 D0 K1 symbol mark, as shown in the left figure, The
finishing flag will be executed. If It Is summarized
M8000 into one for programming, it will be difficult to
judge which instruction is taken to control the
SET M0 symbol mark, moreover, it will fail to obtain the
symbol flag corresponding to each instruction.
M0
DPLSY K1000 D20 Y000
M8029
Execution
result
In case of errors in computation, M8067 will act and hold, as well as save the error
M8067 code in D8067. In case of other new errors, D8067 will update new error code.
D8067 When the error is fixed, M8067 will be OFF, and D8067 will be cleared when the PLC
is switched from STOP→RUN.
X 000 F u n c tio n e x te n s io n s y m b o l f o r X C H
M 8160 W h e n M 8 1 6 0 b e f o r e th e in s tr u c tio n X C H is
d r iv e n , a n d th e c o m p u ta tio n o b je c t a n d re s u lt
s p e c if y th e s a m e e le m e n t , i t w i l l e x c h a n g e th e
XCHP D 10 D 10 h ig h 8 - b it a n d lo w 8 - b it.
M 8000 Sam e N o.
T o re tu rn n o rm a l in s tr u c tio n , X C H M 8 1 6 0
M 8160
s h a ll b e in a c tiv e .
In addition, when the instruction for interrupting program needs the symbol for function
5-6
Chapter 5 Representation and Use of Application Instructions Representation and Execution Form
extension, write the DI instruction (interruption inhibition) before driving the symbol for function
extension, and write the instruction EI (interruption permission) after inactivation of the symbol
for function extension.
5-7
Chapter 5 Representation and Use of Application Instructions Use Data
M0
BIN K2X004 D0
● The specified number of bit element can be specified freely. It is suggested that for X and Y, the
lowest bit number shall be set 0 (X000, X010, X020…Y000, Y010 and Y020); for M and S,
multiple of 8 is ideal. To avoid confusing, it shall be set M0, M10, M20… and etc.
Attached Notes
《Specifying of continuous characters》
A series of data registers starting from D1 are D1, D2, D3, D4 and etc
Through specifying bit, in the word situation, it can be used for a series of word processing.
5-8
Chapter 5 Representation and Use of Application Instructions Use Data
5-9
Chapter 5 Representation and Use of Application Instructions Use Data
E0~E7=0 or 1 A0~A22=0 or 1
Mantissa section
symbol(0:positive, 1:negative)
b0~b31=0, it is 0
5-10
Chapter 5 Representation and Use of Application Instructions Change Operand with Index
S· D·
to D10
5-11
Chapter 5 Representation and Use of Application Instructions Change Operand with Index
5-12
Chapter 5 Representation and Use of Application Instructions Change Operand with Index
If the target device number is decorated with index registers, the program can be used to
change the target device number. As for instructions with restricted times of use, such method
has the same effect with programming the same instruction for several times.
The instruction F58 can execute the programming instruction for one time only. Without
driving several outputs simultaneously, the controlled target can be changed by changing the
output numbers.
In addition, during the instruction executing, even if Z is changed, the above switching is
invalid. To make switching valid, please set condition of the driving instruction OFF one time.
Notes
●The 16-bit counter with index change can not be used as 32-bit counter. As results of index
change, when 32-bit counter is required, please add Z0-Z15 after the counter C200.
●"n" in Kn of V and Z or used for bit specifying, can not be decorated (K4M0Z0 is valid and
K0Z0M0 is invalid).
● LD, AND, OUT and other PLC basic control instructions, as well as the step logic instructions
can't be changed with the index.
5-13
Chapter 5 Representation and Use of Application Instructions Specify Constants
When processing constants, the sequential control program uses constant K (decimal), H
(hexadecimal) or E (floating point). In peripheral equipment for programming, add K to a decimal
number, H to hexadecimal number and E to a floating point (real number) for operations
associated with numeric values in instructions. (Examples: K100 (decimal number), H64
(hexadecimal number) and E1.23 or E1.23+10) (real number))
5-14
Chapter 5 Representation and Use of Application Instructions Specify Constants
● Specify a numeric value in the format “(numeric value) of ×10n. For example:
Exponent specify “1234” in the format of “E1.234+3”.
expression “+3” in “E1.234+3” indicates n power to 10 (+3 mean 103).
5-15
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
04 EI Enable interruption *1 1 —
05 DI Disable Interruption *1 1 —
06 FEND First end *1 1 —
07 WDT Monitor timer *1 √ 1 —
08 FOR Start a for/next loop 16 3 —
09 NEXT End a for/next loop *1 1 —
10 CMP Compare 16/32 √ 7 13
11 ZCP Zone compare 16/32 √ 9 17
Transmit the constant to the
memory, one word
Transmit the constant to the
Data transfer
metic
logic
and
6-1
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
*2
52 MTR Matrix input 16 9 —
processing
6-2
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
6-3
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
6-4
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
6-5
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
6-6
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
① ②
F
ADD Addition S1· S2· D·
20 D P
6-7
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
Instance of instruction symbol: The simple symbols are explained as below(“□” indicates
functional number, “○” represents instruction symbol);
6-8
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
In this instance, the instruction name is "addition" with three operands including S1·, S2·and D·
“·” indicates the operand can be decorated by index. The operand without “·” can't be
decorated by index.
Device overview:
《Bit element》 《Character element》
X :Input relay(X) K :Integer of decimal system
Y :Output relay(Y) H :Integer of hexadecimal system
M :Auxiliary Relay(M) KnX :Bit specifying *1 of input relay (X)
S :Status relay(S) KnY :Bit specifying *1 of output relay (Y)
KnM :Bit specifying *1 of auxiliary relay (M)
KnS :Bit specifying *1 of status relay (S)
T :Current value of timer(T)
C :Current value of timer(C)
D Data Register
W :Data Register*2
V、Z :Index register
*1:When specifying Kn, please note that the range of value n for 16-bit instruction is K1~K4,
6-9
Chapter 6 Interpretation of Application Instructions List of application instructions and reading instruction
Instruction Format
The instruction is written in above format. The operands S1·, S2· and D· are augend, addend
and sum respectively.
Function S1• plus S2• with symbols, and the result is stored in D1.
6-10
Chapter 6 Interpretation of Application Instructions Program flow
Program flow
Function No. Mnemonic Name Page
F00 CJ Conditional jump 6-12
F01 CALL Sub-program call 6-15
F02 SRET Sub-program return 6-15
F03 IRET Interruption return 6-17
F04 EI Interruption permitted 6-17
F05 DI Interruption inhibited 6-18
F06 FEND Main program end 6-23
F07 WDT Timer 6-24
F08 FOR Cycle loop start 6-26
F09 NEXT Cycle loop end 6-26
6-11
Chapter 6 Interpretation of Application Instructions Program flow
CJ P·
P· :destination symbol of conditional jump
Function The instruction is executed to jump the program to the destination symbol.
When PLC is used, if some program does not need to be executed every time, such
instruction can be used to shorten the time of executing.
For example:
X000
CJ P0
Range of point (P) for AP series is: P0~P127. Of them, P63 refers to END, and do not
program it. Otherwise, it may lead to error.
Pointer number can be changed by index. As shown below:
X000
CJ P0Z0
Below is the description of the element actions during the execution of conditional jumping:
1. 1. Y, M and S keep the state before jumping.
2. 10ms and 100ms timers will suspend timing.
3. Timer T192~T199 (T196~T199 for AP100) or T246~T249 for executing subprogram will
continue timing, and the output contact will act normally
4. High-speed counter during timing will continue counting and the output contact will act
normally.
5. General counter will stop counting.
6. If clear instruction for the accumulative counter and timer is driven before jumping, it will
stay in cleared status during jumping execution.
7. General application instructions will not be executed.
6-12
Chapter 6 Interpretation of Application Instructions Program flow
For example:
X000
CJ P8 If X000 is “ON”, it will jump to
X007
RST C0
X010
C0 K20
X011
MOV K3 D0
X000 If X000 is “OFF”, it will jump to
P8 CJ P9
the next step of symbol P9.
X012
Y001
X013
P9 RST T246
RST C0
6-13
Chapter 6 Interpretation of Application Instructions Program flow
The following table describes results of state change of the element during jumping:
State of contact before Action of contact during Action of coil during
Device
jumping jumping jumping
X001、X002、X003 X001、X002、X003
Y001、M1、S1 OFF
OFF ON
Y、M、S
X001、X002、X003 X001、X002、X003
Y001、M1、S1 ON
ON OFF
X004 OFF X004 ON The timer does not act.
10ms,100ms Timing will be stopped,
Timer X004 ON X004 OFF and it will be continued
after X0 OFF.
X005、X006 OFF X006 ON The timer does not act.
Timing will be stopped,
1ms timer
X005 OFF、X006 ON X006 OFF and it will be continued
after X0 OFF.
The counter does not
X007、X010 OFF X010 ON
count.
Counter Counting will be
X007 OFF、X010 ON X010 OFF stopped, and it will be
continued after X0 OFF.
Application instruction
X011 OFF X011 ON
is not executed.
Application
The jumped application
instruction
X011 ON X011 OFF instruction is not
executed.
● Y001 becomes dual-coil, but the status of Y001 is controlled by X001 when X000=OFF. Y001
acts in accordance with X012 when X000=ON. The conditional jumping makes the same coil into
more than 2 programs either in or out of the jumping even if it is segmented program. Thus, it is
also treated as the general dual-coil.
● When reset instructions of the accumulated timer and counter is out of the jumping, reset of the
timing coil and counting coil (contact recovery and clearing of the current value) are valid.
6-14
Chapter 6 Interpretation of Application Instructions Program flow
CALL P·
P· :The destination symbol of the called sub-program.
Function The instruction is sued to call the sub-program.
Note:1. Range of point (P) for AP series is: P0~P127. Of them, P63 refers to END, which can
not be used as pointer of FNN01 (CALL).
2. Pointer number can be changed by index.
Instruction Format
SRET
Function The instruction is sued to return the sub-program. No device is applicable to the
sub-program return.
6-15
Chapter 6 Interpretation of Application Instructions Program flow
Example 1:
Example 2:
● After X001=OFF→ON, the X001
instruction CALL P P11 is executed CALL P P11
one time, it jumps to P11. FEND
● In the sub-program of P11, if the Mark
P11
instruction CALL P12 is executed, Routine
sub-program of P12 is executed. After sub-
CALL P12 program
executing the instruction SRET, it
returns to sub-program of P11 to SRET 1
execute the instruction SRET. Lastly, it Mark
P12 Routine
will return to the main program. sub-
● There are 16 layers of nesting in SRET 2 program
maximum. END
● Timer in the sub-program employs
T192~T199(T196~T199 for AP100) or
T246~T249.
6-16
Chapter 6 Interpretation of Application Instructions Program flow
Instruction Format
IRET
Function If interruption occurs when processing the main program (Input, timer, and counter),
it will jump to the interruption(I) program, and then return to the main program with instruction
IRET.
Instruction Format
EI
Function This instruction is used to change the PLC into the state of interruption enabled.
6-17
Chapter 6 Interpretation of Application Instructions Program flow
Instruction Format
DI
Function This instruction is used to disable the interruption.
Note:The above 3 instructions are single instructions without driving contacts.
● Normally, the PLC is under interruption disabled. If interruption is required, the instruction
FNN04 (EI) can be used to enable interruption.
● The index for interruption (I***) must be marked and programmed after the instruction FEND.
● Types of interruption:
1. Input interruption of external signal
2. Interruption of timer
3. Interruption of high-speed counter
6-18
Chapter 6 Interpretation of Application Instructions Program flow
Example: The interruption processing must be executed for the latest input information.
EI
FEND
M8000
REF X010 K8
I 101 X010
SET Y001
X010
RST Y001
IRET
END
As shown in the figure, if user needs to enter program I101, it requires enabling interruption
EI and M8051=0. When the rising edge of X001is ON,interruption program and input refreshing
are executed. Set Y001 ON/OFF according to the ON/OFF state of X010.
《Interruption of timer》
It is not affected by scan cycle of the controller. PLC executes the interruption sub-program
within an interval of 3ms~99ms. Timer interruption is mainly applicable to the situations of long
computation cycle of the main program. It requires processing the specific program at high speed,
or executing the program with an interval.in the sequential control scan.
See the following table for number and action of interruption pointer of 3 points.
6-19
Chapter 6 Interpretation of Application Instructions Program flow
For example: 1 is added on each 10ms, and compare with setting values.
Program step
0 EI
X000
SET M3
FEND
Interruption M3
indicator
I610 INC D0
X000
LD= K1000 D0 RST M3
IRET
END
6-20
Chapter 6 Interpretation of Application Instructions Program flow
For example:
Program EI
step 0
M8000
C235 K2,147,483,647
FEND
Interruption
indicator
I010
Interruption program
Interruption
IRET return
END
● For the coil driving the high speed counter, it is used to specify the interruption pointer in the
instruction FUN53(DHSCS).
● When current value of C255 varies from 999~1000, interruption sub-program is executed.
● As for current values of the high speed counter, if active/inactive control can be done for the
output relay or auxiliary relay, the instructionsFUN53(DHSCS) , FUN54(DHSCR) ,
FUN55(DHSZ) can be used to simplify the program.
Multi-interruption input
● In case of multiple interruptions, the earlier interruption shall take the priority. In case of
6-21
Chapter 6 Interpretation of Application Instructions Program flow
simultaneous occurrence, the smaller pointer number shall take the priority.
● During execution of interruption program, other interruptions are not allowed. However,
interruption information during the period shall be kept, and it will be executed after the routine
program is processed, with 8 interruptions in maximum.
Pulse width of input interruption
●To execute input interruption with external signal, ON or OFF signal with pulse width more than
25us shall be input.
Recovery of input and output
● When controlling the input relay and output relay during interruption processing, the recovery
instruction FUN (REF) of output relays can be used. By obtaining the latest input information or
outputting computation results immediately, it achieves high-speed control without affecting the
computation cycle of the controller.
Notes
●As the number of input relay for interruption pointer, please do not use the same number of the
application instructions for high speed counter and pulse density with the same input range
● For the sub-program and the interruption program, please employ the timer
T192~T199(T196~T199 for AP100) in the routine program. If general timer is used, timing can
not be performed. When 1ms accumulated timer is used, pay attention to it.
6-22
Chapter 6 Interpretation of Application Instructions Program flow
Instruction Format
FEND
Function This instruction is a single instruction without driving contact, which indicates the
end of main program.
The instruction has the same effect with the instruction END, which executes output
processing, input processing, refreshing of monitor timer and returning to step 0 of the program.
X011=OFF
X010 X011
CJ P20 CJ P21
X010=ON
X011=ON
FEND FEND
END END
● The instructions CALL and CALL P must be written after the instruction FEND, with the
instruction SRET to end the sub-program. The interruption program must be written after the
instruction FEND, with the instruction IRET to end the interruption program.
● After executing the instructions CALL and CALL P and before executing the instructions
SRET and IRET; or after executing the instruction FOR and before executing the instruction
NEXT; if the instruction FEND is executed, it may lead to program error.
●If multiple FEND instructions are used, the sub-program and interruption program shall be
written between the last FEDN and END instructions.
6-23
Chapter 6 Interpretation of Application Instructions Program flow
Instruction Format
WDT
Function The instruction is used for refreshing the monitor timer to avoid error of the
controller due to the delay of the scan cycle.
If the scan time exceeds a certain value, PLC will stop working. Under this s circumstance, it
should insert the instruction WDT in the appropriate program step to refresh the value of the timer.
The value of monitor timer is set by D8000, with the range of 200ms~1600ms.
For example:
X000
WDT P
One scan
X000
WDT Each scan
125ms program
250Ms
program WDT
125ms program
END
END
If value of the monitor timer is set at 200ms, when scan time of the program is 250ms, it is
divided into two parts. Insert WDT into it, and then the first part and second part of the program is
less than 200ms.
● Test time of the monitor timer can be changed by changing content of D8000, as shown in the
following figure:
6-24
Chapter 6 Interpretation of Application Instructions Program flow
M8002
MOV K300 D8000
WDT
● When the system is connected to many positioning, cam switch, ID interface, link, analog
quantity and other special extended equipments, when the controller runs, initialization time of the
buffing storage device will be extended to cause delay of the scan time. Besides, when executing
sending data to several buffing storage devices, the time will be delayed. Under this circumstance,
it may cause error of timeout monitor timer. At this time, input the above program near the starting
step to extend time of the monitor timer.
6-25
Chapter 6 Interpretation of Application Instructions Program flow
FOR S·
S· :Cycles.
Function Please refer to the description in function NEXT.
Instruction Format
NEXT
Function This instruction is a single instruction without driving contact, which should be
used with FUN08(FOR). After the instruction executes the instruction between FOR and NEXT
for n times (specifying by the instruction FOR), then steps after NEXT can be processed. It is
valid when n=1~32,767, when n= -32,767~0, it is processed as 1.
6-26
Chapter 6 Interpretation of Application Instructions Program flow
For example:
FOR K4
FOR D0Z0
X010
CJ P22
FOR K1X000 A B C
NEXT 1
P22
NEXT 2
NEXT 3
●After [C] program is executed for 4 times, it is moved to program after the instruction ③ of
NEXT; if [C] program is executed once only, content of the data register D0Z0 is 6, and the [B]
program is executed for 6 times; the instruction CJ can be used to skip program
between FOR~NEXT, for example when X010=ON.
●There are 16 layers of nesting. FOR~NEXT must be in pair, otherwise, it may lead to error.
●Too many cycles may lead to delay of the scan cycle, which may cause error of the monitor timer
and please pay attention.
6-27
Chapter 6 Interpretation of Application Instructions Data moving and compare
6-28
Chapter 6 Interpretation of Application Instructions Data moving and compare
RST M1
RST M2
6-29
Chapter 6 Interpretation of Application Instructions Data moving and compare
X 001
ZC P K 20 K 200 C 10 M 10
●Data of S1•, S2• and S0• shall be compared by integers with symbols.
● S1·≤S2·is required. WhenS2·<S1·, S2• is computed as S1•.
● The destination address occupies the following two. If M0 is specified, M1 and M2 will be
occupied automatically.
● When the instruction is not executed, the destination data is not affected.
●To clear the results, the instructions RST or ZRST are used (As shown in F10 CMP data
compare)
6-30
Chapter 6 Interpretation of Application Instructions Data moving and compare
MOV S · D·
S· :Data source.
D· :Destination address of data moving
Function The instruction is used to send the content of S• to D• directly. When the instruction
is not executed, content of D• will not be changed. The 32-bit instruction employs DMOV
instruction, and the operand occupies 2 characters automatically.
X000
MOV K1X010 K1Y010
It has the same function with the following sequential control program.
X010
Y010
X011
Y011
X012
Y012
X013
Y013
6-31
Chapter 6 Interpretation of Application Instructions Data moving and compare
S· :Data source.
m1 :Start bit number of data source.
m2 :Number of sent data source m1/ m2/ n:1~4.
D· :Destination address of data moving
n :Start number of bit of destination address
Function BCD value if the data source sends data from its low m2 bit since the m1 bit to the m2
bit since the n bit of D.
For example: SM O V D 10 K4 K2 D 20 K3
When M8168=OFF: The 4th bit The 3rd bit The 2nd bit The 1st bit
BIN code of D10 For source data
D10, Send its
BCD code converted from 103 102 101 100 converted value of
D10 BCD from the low
2 bits of the 4th
bit to the 3rd bit of
103 102 101 100
D20. Error will
BCD code of D20 occur if the BCD
value of D10 is
BIN code converted beyond 0~9,999.
automatically
When M8168=ON:
BIN code of D10 BCD code
conversion is not
executed. 4 bits
6-32
Chapter 6 Interpretation of Application Instructions Data moving and compare
CML S· D·
S· :Data source.
D· :Destination address of data moving
Function The instruction is to send the content of S·to D contrarily (0→1, 1→0). If the
content is the constant K, K will be converted into BIN value automatically.
For example:
X000
CML D10 K1Y000
D10 1 0 1 0
Unchanged 0 1 0 1
Y0 17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
6-33
Chapter 6 Interpretation of Application Instructions Data moving and compare
X001 X001
M0 M0
X002 X002
M1 M1
X003 X003
M2 M2
X004 X004
M3 M3
The two figures above equal the following
program:
M8000
CML K1X001 K1M000
6-34
Chapter 6 Interpretation of Application Instructions Data moving and compare
BMOV S· D· n
S· :Start address of data source
D· :Destination address of data moving
n :Length of moving block(n≤512).
Function With the instruction, the data of point n starting with device specified by the starting
address of source is transmitted to device of point n starting with devices specified by destination
address. (If it exceeds range of device number, it will be transmitted within the possible scope).
Instance:As shown in the figure below, when the number range overlaps, to avoid rewriting the
source data before moving, the transmission method varies with the overlapping of the number, As
shown in the figure, the data is automatically transmitted as per the sequence 1~3.
6-35
Chapter 6 Interpretation of Application Instructions Data moving and compare
FMOV S· D· n
S· :Start address of data source
D· :Destination address of data moving
n :n≤512
Function It is the multi-point moving instruction for the same data. Content of S• is sent to the
device beginning with n specified by D•. Content of device at point n is the same. When it is
beyond range of the destination device, it will be moved to possible range.
For example:
X000
FMOV D1 D10 K3
Execution D1——————>D10
results: D1——————>D11
D1——————>D12
《Notes》
The destination operand D· in 16-bit and 32-bit instruction can not specify V and Z.
6-36
Chapter 6 Interpretation of Application Instructions Data moving and compare
X000
XCHP D10 D20
6-37
Chapter 6 Interpretation of Application Instructions Data moving and compare
BCD S· D·
S· : Data source.
D· : Storage location.
Function The instruction is used to convert the data source S• from BIN to BCD, which is stored
in D•.
Note: For 16-bit instruction, if the conversion result exceeds 0-9999, it is error.
For 32-bit instruction, if the conversion result exceeds 0~99,999,999, it is error.
In case of error, M8067= ON, D8067 writes in error code. The instruction will not be
executed.
6 7 8 9
PLC
Arithmetic operation, increasing, decreasing and other instructions are executed in BIN in
PLC.
When PLC reads data of external BCD digital switch, the conversion
sending instruction FUN19(BCD→BIN) is used. When it outputs to BCD seven-section display,
the conversion sending instruction FUN18 (BIN→ BCD)is used.
6-38
Chapter 6 Interpretation of Application Instructions Data moving and compare
BIN S· D·
S· : Data source.
D· : Storage location.
Function Content of data source S• (BCD: 0~9,999 or 0~999,99,999) is converted into BIN
format, and the result is stored in D•. If S• is not BCD code, error will occur, M8067= ON, and
D8067 writes in error code. The instruction will not be executed.
●The 10 positions on the BCD digital switch are corresponding to 0~9 of decimal system.
Through the internal coding, the output of the digital switch is 4 binary numbers converted from
the decimal number corresponding to the current position. To read the setting value of BCD
digital switch in PLC, BIN instruction is used. If the data source is not BCD value, error will
occur.
● The constant K is converted into binary system automatically, so it can not be the device for the
instruction.
6-39
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
6-40
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
● The two data sources are added in BIN and sent to the destination data zone. The highest bit of
the data is the positive (0) or negative (1) symbol bit, therefore, algebraic addition shall apply.
(5+(﹣8)=﹣3)
● When the computation result is 0, the zero flag sign acts. When the computation result exceeds
32,767(16-bit computation) or 2,147,483,647(32-bit computation), the carrying flag sign will act.
If the computation result is smaller than -32,768(16-bit computation) or -2,147,483,648(32-bit
computation), the negative flag sign will act. (Refer to FUN21 SUB for the action of flag sign)
● For 32-bit computation, lower 16-bit element of character element shall be specified and upper
word of specified number is used. To avoid repeated number, even number is used for specifying
elements.
● Please specify the same number for the data source and destination data zone. If the continuous
execution instruction (ADD,D ADD) is used, the addition result of each scan time is changing.
6-41
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
● See the sequential control program in the above figure, when X000 is changed from OFF-ON,
1 is added on value of D1, which is similar to the function of instruction FUN24 INC P.
6-42
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
X000
SUB D1 D2 D3
● When X000 is ON, content of minuend D1 minus content of subtrahend D2 in algebraic means,
and the difference is stored in D3.
● As for the flag action, specifying method of 32-bit computation element, difference of the
continuous execution and pulse execution , it is the same as the instruction ADD in previous page.
● The flag actions and relation of positive/negative values are shown as below
Zero mark Zero mark Zero mark
Borrowin Carrying
g mark The highest The highest mark
bit is 1 bit is 0
Zero mark Zero mark
Borrowin Carrying
Zero mark
g mark mark
6-43
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
《16-bit computation》
X000
MUL D0 D2 D4
● The product computed from specified content of the data bit is stored in specified device (the
lower side), meanwhile, it occupies the last device to make up 32-bit data. See the above figure,
when D0)=8,(D2)=9, (D5,D4)=72.
●The highest bit of the result is the symbol bit for positive (0) and negative (0).
● When D• is bit element, it could execute bit specifying for K1~K8. When K4 is specified. only
the low 16-bit of the product can be obtained.
《32-bit computation》
X000
DMUL D0 D2 D4
6-44
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
6-45
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
S1· :Dividend.
S2· :Divisor .
D· :Quotient.
Function It is to divide the data of S1· and S2· in BIN, and store the result in D·.
For the highest bit of the data in S1·, S2· and D·, 0 represents positive, 1 represents negative,
and algebraic division is executed.
《16-bit computation》
X 000
D IV D0 D2 D4
● See the figure above: D0 is the dividend, and D2 is divisor. D4 stores the quotient by the
computation and D5 stores the residual by the computation.
《32-bit computation》
X 000
D D IV D0 D2 D4
● See the figure above: (D1,D0) is the dividend, and (D3,D2) is divisor. (D5,D4)
stores the quotient by the computation and (D7,D6) stores the residual by the computation.
● D• can not specify Z and V elements.
Note:1. When the divisor is 0, it may cause error and the instruction will not be executed
D8067=6706.
2. When D• is specified as bit element, residual can not be obtained.
3. The highest bit of the quotient and residual is the symbol bit for positive (0) and negative
(0). The quotient is negative when any of the dividend and divisor is negative; The residual is
negative when the dividend is negative.
6-46
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
INC D·
Function Every time the instruction is driven, 1 is added to D·
Note: The instruction is of pulse instruction in general. Otherwise, when the instruction is
executed, 1 is added on each scan cycle D•. Please pay attention to it.
For 16-bit computation, if 1 is added to +32,767, it becomes -32,768, and the flag does not
act.
For 32-bit computation, if 1 is added to +2,147,483,647, it becomes -2,147,483,648, and the
flag does not act.
DEC D·
Function Every time the instruction is driven, 1 is subtracted from D·
Note:The instruction is of pulse instruction in general. Otherwise, when the instruction is
executed, 1 is subtracted from each scan cycle D•. Please pay attention to it.
For 16-bit computation, if 1 is subtracted from ﹣32,768, it becomes ﹢32,767, and the
flag does not act.
For 32-bit computation, if 1 is subtracted from ﹣ 2,147,483,648, it becomes ﹢
2,147,483,647, and the flag does not act.
6-47
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
For example:
X010
MOV P K0 Z0
M1
X011
BCD P C0Z0 K4Y000
INC P Z0
CMP K10 Z0 M0
● Input reset X010 is used to clear Z0 in advance.
● When current values of the counters C0~C9 are converted for BCD, it is output to K4Y000.
●When X011 is ON one time, it outputs current values of C0, C1…C9.
6-48
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
WAND S1 · S2 · D ·
S1· :Data source 1.
S2· :Data source 2.
D· :Computation result.
Function Conduct WAND computation for the data in S1· and S2·. (WAND : 16-bit
instruction; DAND:32-bit instruction. )
If the same bit of two operands is 1 during the computation, the logic result of the bit is 1.
Otherwise, it is 0.
6-49
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
DOR:32-bit instruction )
If the same bit of either of two operands is 1 during the computation, the logic result of the bit is 1.
Otherwise, it is 0.
6-50
Chapter 6 Interpretation of Application Instructions Arithmetic and logic operations
NEG D·
Function Reverse each bit of the content specified by D•, 1 is added on them, and the result is
stored in D•.
● The instruction is of pulse instruction. The execution of continuous execution instruction will be
after each scan cycle. Please pay attention to it.
● When the instruction is used, the absolute value corresponding to negative BIN value shall be
obtained.
Note:After computation of-32,768, it is still -32,768.
M8000
BON D10 M0 K15
M0
NEG P D10
X000
CM P D10 D20 M 10
M 10
SUB D10 D20 D30
M 11
M 12
SUB D20 D10 D30
Even if complement code is not used for the above loop, (D30) represents absolute value of
the difference in subtraction.
6-51
Chapter 6 Interpretation of Application Instructions Rotation and shift
6-52
Chapter 6 Interpretation of Application Instructions Rotation and shift
ROR D· n
D· :Data source.
n :Bit number of cyclic shifting right. For 16-bit instruction, n≤16;for 32-bit instruction, n≤32.
Function It is the instruction to make each bit of 16-bit/32-bit data shift right.
ROL D· n
D· :Data source.
n :Bit number of cyclic shifting right. For 16-bit instruction, n≤16;for 32-bit instruction, n≤32.
Function It is the instruction to make each bit of 16-bit/32-bit data shift left.
6-53
Chapter 6 Interpretation of Application Instructions Rotation and shift
For example:
《Left gyration》 《Right gyration》
X000 X000
ROL P D0 K4 ROR P D0 K4
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
※
※
n bit M8022
M8022 n bit Carrying
Carry
Upper After one
After one Lower position execution Lower position
Upper position execution position 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 ※
※
M8022 0
1 M8022 ※
※
Instruction interpretation When X000 is from OFF to ON, K4-bit left(right) gyration is
executed, and the last bit is stored in the carrying flag sign M8022.
● The 16-bit/32-bit continuous execution instruction will gyrate after each scan cycle. Please pay
attention to it.
●When bit is used to specify the element, only K4 (16-bit instruction) and K8 (32-bit instruction)
are effective (Such as K4Y010 and K8M0)
6-54
Chapter 6 Interpretation of Application Instructions Rotation and shift
RCR D· n
D· :Data source.
n :Bit number of cyclic shifting right. For 16-bit instruction, n≤16;for 32-bit instruction, n≤32.
Function It is the instruction to make the carrying flag M8022 for each bit of 16-bit/32-bit data
shift right.
RCL D· n
D· :Data source.
n :Bit number of cyclic shifting right. For 16-bit instruction, n≤16;for 32-bit instruction, n≤32.
Function It is the instruction to make the carrying flag M8022 for each bit of 16-bit/32-bit data
shift left.
6-55
Chapter 6 Interpretation of Application Instructions Rotation and shift
For example:
《Left gyration with carrying》 《Right gyration with carrying》
X000 X000
RCL P D0 K4 RCR P D0 K4
Left Right
Upper Lower Upper Lower
gyration gyration
position position position position
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
※ ※
M8022 M8022
n bit
Carry n bit cycling cycling
Carrying
Ex: Ex:
M8022=OFF After one Lower Upper After one M8022=ON
Upper
position
execution position position execution Lower position
1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0
1 M8022 M8022 0
? ※
Instruction interpretation When X000 is changed from OFF to ON, K4 with carrying flag
M8022 will gyrate to the left (right).
The 16-bit/32-bit continuous execution instruction will gyrate after each scan cycle. Please
pay attention to it.
When bit is used to specify the element, only K4 (16-bit instruction) and K8 (32-bit
instruction) are effective (Such as K4Y010 and K8M0).
6-56
Chapter 6 Interpretation of Application Instructions Rotation and shift
SFTR S· D· n1 n2
S· :Start number of shift device. n1 :Data length to be shifted, n1=1~1024.
D· :Start number of device to be shift n2 :Bit number for one shifting, n2=1~n1。
Function For the bit device of n1 bits(length of moving register) started with D·, it moves
right with n2 bits. The bit device started with S. is moved to D. to fill the empty element with n2
bits.
SFTL S· D· n1 n2
S· :Start number of shift device. n1 :Bit length for one shifting, n1=1~1024.
D· :Start number of device to be shift n2 :Bit number for one shifting, n2=1~n1。
Function For the bit device of n1 bits(length of moving register) started with D·, it moves left
with n2 bits. The bit device started with S. is moved to D. to fill the empty element with n2 bits.
Note:The instruction is of pulse instruction in general. When continuous execution instruction is
used, it will execute in each scan cycle.
6-57
Chapter 6 Interpretation of Application Instructions Rotation and shift
X000 ①M3~M0→Overflow
SFTR P X000 M0 K16 K4 ②M7~M4→M3~M0
③M11~M8→M7~M4
④M15~M12→M11~M8
X003 X002 X001 X000 N2 shifting ⑤X003~X000→M15~M12
right
5 M15 M14 M13 M12 M11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0
4 3 2 1
S1 X002
8-character shifting register of S0~S7 with
S7 X000
1-bit of M0 taken as starting input
M8000
MOV K2S0 K2Y000
M8047
END
X000
X001
Even if X000 is ON, Y000 won’t act.
X007
Y000
Y001
Y007
6-58
Chapter 6 Interpretation of Application Instructions Rotation and shift
WSFR S· D· n1 n2
S· :Start number of shifting device. n1 :Bit length to be shifted with word as unit,
D· : Start number of device to be n1=1~512.
shifted. n2 :Word number for one shifting, n2=1~n1.
Function For the data tandem of n1 bits(length of moving register) started with D·, it moves
right with n2 words. The word device started with S. is moved to D. to fill the empty element with
n2 words.
WSFL S· D· n1 n2
S· :Start number of shifting device. n1 :Bit length to be shifted with word as unit,
D· : Start number of device to be n1=1~512.
shifted. n2 :Word number for one shifting, n2=1~n1.
Function For the data tandem of n1 bits(length of moving register) started with D·, it moves
left with n2 words. The word device started with S. is moved to D. to fill the empty element with
n2 words.
Note:The above two instructions generally use the pulse type instruction.
6-59
Chapter 6 Interpretation of Application Instructions Rotation and shift
S· and D· can't specify the same element. When S• and D• are specified as bit combined
device, the same bit specifying is required.
《Word shift right》
X000 ①D13~D10→Overflow
WSFR P D0 D10 K16 K4 ②D17~D14→D13~D10
③D21~D18→D17~D14
D3 D2 D1 D0
④D25~D22→D21~D18
N2 bit shifting
⑤D3~D0→D25~D22
right
5 D25 D24 D23 D22 D21 D20 D19 D18 D17 D16 D15 D14 D13 D12 D11 D10
4 3 2 1
X000
WSFR P K1X000 K1Y000 K4 K2
2 1
6-60
Chapter 6 Interpretation of Application Instructions Rotation and shift
SFWR S· D· n
S· :Source device for shifting writing
D· :Start device for writing destination data tandem
N :Data length to be written, n=2~512 (Actual data length to be written is n-1. The start device
D• is taken as the pointer for writing points).
Function It is the instruction to control the first-in first-out data writing.
For example:
X000
SFWR P D0 D1 K10
D0 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1
6-61
Chapter 6 Interpretation of Application Instructions Rotation and shift
SFRD S· D· n
S· :Tandem start device of shifting read data
D· :Destination device storing the data tandem read.
n :Data length for shifting read, n=2~512 (Actual length to be read is n-1. The read start device
is taken as pointer to judge stopping instruction execution).
Function It is the instruction to control the first-in first-out data reading.
For example:
X000
SFRD P D1 D20 K10
D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D20
● When the driving X000 is ON from OFF, content of D2 will be read to D20. At the same time,
1 is subtracted from content of the pointer D1. Data at the left side moves one bit to the right
side(content of D10 is not changed). When X000 is ON from OFF once again, content of D2 is
read to D20 and 1 is subtracted from content of D1. (When continuous execution instruction is
used, it will execute one reading and shifting in one scan cycle)
● When content of the pointer D1 is 0, the instruction stops executing, and the zero point flag
M8020 acts.
6-62
Chapter 6 Interpretation of Application Instructions Rotation and shift
6-63
Chapter 6 Interpretation of Application Instructions Data processing
Data processing
Function No. Mnemonic Name Page
F40 ZRST Zone reset 6-65
F41 DECO Decoder 6-66
F42 ENCO Encoder 6-67
F43 SUM ON bit sum 6-68
F44 BON ON bit judging 6-69
F45 MEAN Mean value 6-70
F46 ANS Alarm coil set 6-71
F47 ANR Alarm coil reset 6-72
F48 SOR BIN square root computation 6-74
F49 FLT BIN integer →binary floating point 6-75
6-64
Chapter 6 Interpretation of Application Instructions Data processing
X000
ZRSTP M100 M200
When X000 is from OFF to ON, M100 to M200 are fully cleared.
● When the operand number of D1·>the operand number of D2·, only the operand specified by
D1· can be cleared.
●The instruction is executed with 16-bit, however, D1•/D2• can specify 32-bit counter. They can't
be specified in a mixed way. For example, D1• is 16-bit counter, while D2• is 32-bit counter.
● The instruction is of pulse instruction in general.
As for bit elements Y, M and S and word elements T, C and D, they can use instruction RST,
which is an independent resetting instruction for the device.
As for word elements KnY, KnM, KnS, T, C, D, the instruction FMOV can be used to write
the constant K0 in the elements in batches.
X000
RST M0 Reset M0
RST M0 Reset D0
X001
FMOV K0 D0 K100 Write K0 to D0~D99
6-65
Chapter 6 Interpretation of Application Instructions Data processing
DECO S· D· n
X004
DECO X000 M0 K3
③
M7 M6 M5 M4 M3 M2 M1 M0
0 0 0 0 1 0 0 0
The data source is1×20+1×21+0×22=3, so M3 from the 3rd bit of M0 is set as 1, and other bits
are 0.
When D· is bit element, n=8, 28=256 points.
When D. is word element, each word element is of double byte, namely 16-bit. When n=4,
24=16 points. When n<4, the high bit of D· is for zero extension.
6-66
Chapter 6 Interpretation of Application Instructions Data processing
ENCO S· D· n
X000
ENCO M0 D0 K3
M7 M6 M5 M4 M3 M2 M1 M0
0 0 0 0 1 0 1 0
b15 b0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
←n=3 bit→
When several bits in the data source are 1, 1 at low bit will not be processed. When all data
sources are 0, it is error.
When S· is bit element, n=8, 28=256 points.
When S· is word element, n=4, 24=16 points.
6-67
Chapter 6 Interpretation of Application Instructions Data processing
SUM S· D·
S· :Source device.
D· :Destination device for storing counting values.
Function It is to count the sum of bits set as "1" in the specified source device, and store the
results in the specified destination device D.
For example:
X000
SUM D0 D2
0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 7
D0 D2
● If 16 bits in D0 are 0, the zero flag M8020 will act.
● When 32-bit instruction is used, D• still occupies 2 registers. See the figure above, number of
1 of 32-bit of (D1,D0) is written into D2, at the same time, D3 becomes 0.
6-68
Chapter 6 Interpretation of Application Instructions Data processing
BON S· D· n
S· :Source device.
D· :Device for storing judging results.
n :When specify judging bit, n=0~15 (16-bit instruction), n=0~31 (32-bit instruction).
Function It is used to judge the status of a certain bit (bit n) in the specified source device S·,
and store the results in the destination device D·. If the bit is “1”, the destination device is “1”,
otherwise, it is “0”.
For example:
X000
BON D10 M0 K15
b15 b0
0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 M0=OFF
D10
1 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 M0=ON
D10
When 16-bit computation is executed, n=0~15; for 32-bit computation, n=0~31.
6-69
Chapter 6 Interpretation of Application Instructions Data processing
MEAN S· D· n
● Mean value (the algebraic sum is divided by n) of point n is stored in the destination address.
The residual is ignored. If it exceeds the device number, max value of n is obtained in possible
range.
● When n is beyond 1~64, error will occur.
When it is beyond the range specified by n, the instruction will calculate the mean value in
effective range. See the followings:
X000
MEAN D8510 D0 K3
(D8510+D8511)/ 2 D0
6-70
Chapter 6 Interpretation of Application Instructions Data processing
ANS S· m D·
S· :Detecting alarm timer, only 100ms timer can be used.
Type Number T of 100ms timer
AP100 T0~T39,T196~T199
AP200 T0~T199
AP300 T0~T199
m :Timing time, m=1~32,767(Unit 100ms).
D· :Alarm point device, only S900~S999 can be used.
Function It is the instruction used to drive signal alarm.
For example:
X000
ANS T0 K10 S900
● If X000 is active for more than 1 second, S900 is set. Even X000 is OFF (the timer is reset),
S900 keeps acting. If it is less than 1 second, when X000 or X001 is OFF, the timer is reset.
● If M8049(The signal alarm is effective) is ON, the minimum number of the signal alarm
S900~S999 which are ON is stored in D8049. In addition, if any of S900~S999 is ON, M8048
(the alarm acts) is ON.
6-71
Chapter 6 Interpretation of Application Instructions Data processing
Instruction Format
ANR
Function It is to reset the driven alarm.
For example:
X000
ANR
If X000 is active, the acting points of the signal alarm S900~S999 are reset.
If several alarm points act simultaneously, the alarm point with minimum number will be
reset. At this time, if the effective flag M8049 of the signal alarm is ON, content of the register
D8049 will be updated timely and the minimum number of the left alarm points will be stored.
If X000 is active a second time, state of the next number will be reset.
If the instruction ANR is used, it is reset in each scan cycle according to the sequence. Please
pay attention to it.
The following figure describes the external failure diagnosis circuit. The special data register
D8049 is used to monitor the minimum number of action state numbers of S900~S999. In case
of several failures, after the failure with minimum number is fixed, the next failure number is
displayed.
6-72
Chapter 6 Interpretation of Application Instructions Data processing
M8000
M8049
Y005 X000
ANS T0 K10 S900
X001 X002
ANS T1 K20 S901
X003 X004
ANS T2 K100 S902
X005
Y005
M8048
Y006
X007
ANR P
END
● When the special auxiliary relay M8049 acts, monitoring can be performed.
● When Y005 is driven, S900 acts if X000 fails to act within 1 second.
● In case of error on DOG, if X001 and X002 fail to act simultaneously over 2 seconds, S901 acts.
● When T2 is less than 10 seconds and the input point X003 is ON, if X004 does not act during 1
operation cycle, S902 acts.
● When there is ON between S900~S999, the special auxiliary relay M8048 acts, and the output
Y006 acts.
● Before executing the external failure diagnosis program, set X007 OFF; when X007 is ON, the
minimum number will be cleared in sequence.
6-73
Chapter 6 Interpretation of Application Instructions Data processing
SQR S· D·
X000
SQR D0 D1
When X000 is ON, after square root is executed for data in D0, the result is stored in D1.
● S• is valid for non-negative. If it is negative, it may lead to error, the flag M8067 is ON, and the
instruction will not be executed.
● The computation result D• is integer, the decimal is ignored, and the borrowing flag signal
M8021 is ON.
● When the computation result is 0, the zero flag M8020 acts.
6-74
Chapter 6 Interpretation of Application Instructions Data processing
FLT S· D·
S· :Data source for conversion from BIN integral→ Binary floating-point number.
D· :Destination device for storing results.
Function It is to convert the values stored in S· into floating point value, and store the value in
D·
For example:
X000
FLT D0 D2
X001
DFLT D0 D2
● The constants K and H are automatically converted in the floating-point computation instruction,
so the instruction FLT cannot be used.
● Reverse conversion instruction for the instruction is FUN129(INT).
6-75
Chapter 6 Interpretation of Application Instructions Data processing
7 (D13,D12 )
1 2 5 4
For monitoring decimal floating-
8 point numbers
(D21 ,D20 ( D22) BIN
( (D27,D26
(
(D15,D14 )
Binary floating- 32-bit BIN
3 point number integer
(D25,D24
(
Binary floating-
point number
(D29,D28
(
Binary floating-
point number
M8000
1 (D0)→ (D21,D20)
FLT D0 D20 Binary floating-
BIN point number
(D22)→(D25,D24)
3 FLT D22 D24 Binary floating-
BIN point number
6-76
Chapter 6 Interpretation of Application Instructions High speed counting processing
6-77
Chapter 6 Interpretation of Application Instructions High speed counting processing
REF D n
D :Start device number for input and output refreshing.
n :Refreshing points.
Function When the latest input information is required or you hope to output the computation
results during PLC computation process, the input/output refresh instruction can be used.
AP Series
Type Refreshing range
X0~X5,6 points(when the refreshing point n is equal to 8, only X0~X5 can
X
be refreshed actually)
AP-110
Y0~Y3,4 points(when the refreshing point n is equal to 8, only Y0~Y3 can
Y
be refreshed actually)
X X0~X7,8 points
AP-114 Y0~Y5,6 points(when the refreshing point n is equal to 8, only Y0~Y5 can
Y
be refreshed actually)
X0~X13 , 12 points(when the refreshing point n is equal to 16, and
refreshing is started from X0, only X0~X13 can be refreshed actually;
X
AP-120 similarly, when the refreshing point n is equal to 8, and refreshing is started
from X10, only X10~X13 can be refreshed actually)
Y Y0~Y7,8 points
X0~X5,6 points(when the refreshing point n is equal to 8, only X0~X5 can
X
AP-130 be refreshed actually)
Y Y0~Y7,8 points
AP-200 X0~X5,6 points(when the refreshing point n is equal to 8, only X0~X5 can
X
series be refreshed actually)
AP-300
Y Y0~Y7,8 points
series
6-78
Chapter 6 Interpretation of Application Instructions High speed counting processing
PLC employs central input and output refreshing. The input terminal information is read by
input memory before step 0 computation. After the output terminal executes the instruction END,
it is output through the latching storage device from the output memory. However, when the latest
input information is required or you hope to output the computation results during PLC
computation process, the input/output refresh instruction can be used.
X000
Refresh X000~X007, with
REF X000 K8
8 points in total
X000
Refresh X000~X007, with
REF Y000 K8
8 points in total
● When specifying the start device number D•, set the lowest bit number 0, such as X000, X010,
and Y000.
● The refreshing point n shall be 8 or 16 points, otherwise, it may lead to error.
● In general, the REF instruction can be used among the instructions FOR~NEXT and the
instruction CJ.
● In the interruption processing with input and output actions, the latest input information and
timely output of computation results can be obtained by executing the instruction.
6-79
Chapter 6 Interpretation of Application Instructions High speed counting processing
For example:
M0
MTR X020 Y040 M10 K3
6-80
Chapter 6 Interpretation of Application Instructions High speed counting processing
Diode
0.1A(50V)
24V 0V S/S X20 X21 X22 X23 X24 X25 X26 X27
M0
Input of the first row
Y040 1 4
Input of the second row
Y041 2 5
Input of the third row
Y042 3 6
20ms
M8029
6-81
Chapter 6 Interpretation of Application Instructions High speed counting processing
●M8029 is set for a scan cycle after the first cycle ends.
《Input numbers used for the instruction MTR》
Input number of the instruction MTR shall be used after X020.
When the instruction MTR is used, the transistor output shall be connected to the resistor
(3.3K/0.5W).
Matrix
loop
COM 24V X000 X001 X002 X003 X004 X005 X006 X007
Transistor output
PLC
COM Y000 Y001 Y002 Y003 Y004 Y005 Y006 Y007
3.3KΩ/0.5W
Supplementary description:
When executing the instruction, it must go through n(number of rows for matrix scan) scan
cycles to catch the input value of a button effectively. When the scan period is too long or too
short, it may cause bad pressing. Therefore, the following skill can be applied to overcome.
1. When the scan cycle is too short, it might results in I/O fails to read the input value of a button,
you may fix the scan time in this case.
2. When the scan cycle is too long, the response of pressing button may become slow. You may
write the instruction in the time interruption sub-program,
to execute the instruction in a fixed interval.
6-82
Chapter 6 Interpretation of Application Instructions High speed counting processing
Instruction Format
6-83
Chapter 6 Interpretation of Application Instructions High speed counting processing
M8000 K100
C235
C235 The action of Y001
Y001 is affected by the
scan cycle
M8000 K2,147,483,647
C235 Y001 is set
immediately
DHSCS K100 C235 Y001
● If the instruction FUN53 is not used, the external output is correlated with the sequential control,
so it is affected by scan cycle and it drives output after the END processing.
● The instruction FUN53 can be used for interrupting processing comparison and external output,
therefore, when current value of C235 is becoming 99→100 or 101→100, Y001 is set
immediately.
《Notes》
● The instruction is exclusively for 32-bit, which must be input as the instruction DHSCS.
● These instructions can compare results and actions in case of pulse input. Therefore, even if the
current value is changed by sending instruction, the comparison output will not change as long as
there is no counting input.
● If the instructions DHSCS, DHSCR, DHSZ and etc. are used, maximum
frequency of high speed counter of the PLC will be affected greatly.
《Counting interruption》
Program
step EI
0 M8000 K2,147,483,647
C235
FEND
Interruption
Interrupt routine
indicator
program
I010
IRET
● D• of the instruction DHSCS can be specified as the interruption indicator I010~I060. (The
number can not be used repeatedly)
● When current value of the high speed counter specified by S2• is changed into the specified
value of S1•, interruption program of mark specified by D• is executed.
● When special auxiliary relay M8059=ON, interruptions of I010~I060 are prohibited.
Regarding details of interruption processing, please refer to FUN03(IRET)~FUN05(DI).
6-84
Chapter 6 Interpretation of Application Instructions High speed counting processing
Instruction Format
For example:
M8000 K2,147,483,647
C235
● If the instruction F54 is used, for comparison and external output employ interruption
processing, when the current values of C235 is changed from 199→200 or 201→200, it is not
6-85
Chapter 6 Interpretation of Application Instructions High speed counting processing
affected by scan cycle, and Y001 is immediately reset. Regarding the effect of the scan cycle,
please refer to the above FUN53.
M8000 K300
C235
400
300
Current value
of C235
Output contact
of C235
● When current value of C235 becomes 400, C235 resets immediately, the current value is 0 and
the output contact does not work.
● The instruction is exclusively for 32-bit, which must be input as the instruction DHSCR. Please
refer to Notes in FUN53 for other notes.
6-86
Chapter 6 Interpretation of Application Instructions High speed counting processing
6-87
Chapter 6 Interpretation of Application Instructions High speed counting processing
● After the instruction is executed, the output in the first scan cycle is the comparison result of
current value of S1• and S2•.
● The instruction is exclusively for 32-bit, which must be input as the instruction DHSZ. Please
refer to Notes in FUN53 for other notes.
6-88
Chapter 6 Interpretation of Application Instructions High speed counting processing
X010
SPD X000 K100 D0
X010
X000
D0: Measuring
value
D1:Current
value
100ms 100ms
100
6-89
Chapter 6 Interpretation of Application Instructions High speed counting processing
● Input pulse specified by S1• counts in time (ms) specified by S2•, and the result is stored in
device specified by D•.
● Through repeated operation, pulse density (the proportional value with rotating speed) is
obtained in D•. D• occupies 3 points of devices.
● In the figure, when X010 is ON, D1 counts OFF->ON of X000. After 100ms, the results are
stored in D0. Then D1 is reset to count the action of X000 a second time.
● D2 is used to measure time remaining.
● The specified input X herein can not be used repeatedly with the high speed counter and
interruption input.
● Maximum frequency of ON/OFF of input X is processed as the 1-phase high speed counting.
When it is used with high speed counting, instructions FUN57(PLSY)and FUN59(PLSR), sum
of the processing frequency shall be lower than the specified frequency.
6-90
Chapter 6 Interpretation of Application Instructions High speed counting processing
Function The function is used to generated certain pulses based on the specified frequency.
For example:
X010
PLSY K100 K1000 Y000
Pulsar
● During the
Y000 instruction
Frequency
execution, if content
(K1000)
of the word element
specified by S1• is changed, the output frequency will vary accordingly.
● When the value of S2. is specified as 0, the number of generated pulses is unlimited. During the
instruction execution, if the word element specified by S2• is changed, it will execute the changed
content from the next instruction driving.
● After X010 is OFF, the output Y0 stops immediately; when it is ON a second time, it acts from
the initial state, Y0 sends continuous pulse.
● Duty ratio of the pulse is 0.5. The output control is not affected by scan cycle and interruption
6-91
Chapter 6 Interpretation of Application Instructions High speed counting processing
processing is employed.
● After pulse setting is finished, the finish flag M8029 acts.
● Pleases use PLC of transistor output type.
《Notes》
● Do not drive and use the pulse output instruction under the same output channel simultaneously.
If it is driven simultaneously, the instruction driven firstly will be executed, but the instruction
driven lastly won't be executed.
●The recommended wiring method and current are as shown in the figure below
PLC
Power Loaded Virtual
supply resistor resistor
100mA
6-92
Chapter 6 Interpretation of Application Instructions High speed counting processing
● D8142, D8143 : Register of the current value for the pulse of Y1 channel output,
D8143(high bit), D8142(low bit).
● D8190, D8191 : Register of the current value for the pulse of Y2 channel output,
D8191(high bit), D8190(low bit).
● D8200, D8201 : Register of the current value for the pulse of Y3 channel output,
D8201(high bit), D8200(low bit).
6-93
Chapter 6 Interpretation of Application Instructions High speed counting processing
t
Y 000
T
6-94
Chapter 6 Interpretation of Application Instructions High speed counting processing
For specified maximum frequency, fixed acceleration is executed; after it reaches specified
output pulse quantity, fixed deceleration is executed.
6-95
Chapter 6 Interpretation of Application Instructions High speed counting processing
6-96
Chapter 6 Interpretation of Application Instructions High speed counting processing
6-97
Chapter 6 Interpretation of Application Instructions Handy instruction
Handy instruction
Function No. Mnemonic Name Page
F60 IST Initialize state 6-99
F61 SER Data searching 6-103
F62 ABSD Absolute drum 6-105
F63 INCD Incremental drum 6-107
F64 TTMR Demonstrating timer 6-109
F65 STMR Special timer 6-110
F66 ALT ON/OFF alternative output 6-111
F67 RAMP Ramp signal 6-113
F68 ROTC Rotary table control 6-115
F69 SORT Sort data 6-117
6-98
Chapter 6 Interpretation of Application Instructions Handy instruction
X000
IST X030 S20 S20
RUN monitoring
6-99
Chapter 6 Interpretation of Application Instructions Handy instruction
If the instruction is used, S10~S19 are used for origin return. Therefore, during
programming, do not take these states as common states. In addition, when S0~S9 are taken as
step points, S0~S2 are for the above manual operation, origin return and automatic operation.
Therefore, in the program, the step point circuits for the 3 states must be written, and S3~S9 can
be used freely.
The instruction shall be programmed in priority than the states S0~S2 and other STL
circuits.
To avoid the above X030~X034 are ON simultaneously, rotating switch must be used.
If origin return finishing (M8043) doesn't act, all the outputs are OFF when switching
between manual operation (X030), origin return(X031)and automatic mode(X032,X033,
X034). The automatic operation can be driven a second time after origin return finishes.
6-100
Chapter 6 Interpretation of Application Instructions Handy instruction
6-101
Chapter 6 Interpretation of Application Instructions Handy instruction
Input is not continuous Only continuous/origin return mode Only continuous / individual
number mode
Example: Example: Example:
X030:individual operation X030:Origin return X030:individual operation
X035:Origin return X031:Continuous operation X031:Continuous operation
X033:Step X032:Automatic switch and X032:Automatic switch
X040:One operation cycle origin return start X033:Stop
X032:Continuous operation X033:Stop
X034:Origin return starts
X026:Automatic start
X041:Stop
6-102
Chapter 6 Interpretation of Application Instructions Handy instruction
S1· :The first device for specifying the table starting address and data storage
S2· :Data content searched by the instruction
D· :Start device for storing the list of searching results, occupying 5 continuous points.
n : Length of data zone to be compared, n=1~256 ( 16-bit instruction ) ,
n=1~128(32-bit instruction).
Function The instruction is used for searching the same data, maximum value and minimum
value in the data table.
For example:
X 000
SER D 100 D0 D 50 K 10
6-103
Chapter 6 Interpretation of Application Instructions Handy instruction
6-104
Chapter 6 Interpretation of Application Instructions Handy instruction
For example:
X 000
ABSD D 300 C0 M0 K4
C0 X 001
RST C0
X 001
C 0 K 360
R o tatin g an g le sig n al fo r 1
p u lse fo r 1 d e g re e
6-105
Chapter 6 Interpretation of Application Instructions Handy instruction
The following data are written into D300~D307 by using sending instructions in advance
Rising point Falling point Target output
D300= 40 D301=140 M0
D302=100 D303=200 M1
D304=160 D305= 60 M2
D306=240 D307=280 M3
When X000 is ON, there are the following changes for M0~M3. Rising point/fall point
may vary according to change of data of D300~D307.
40 140
M0
100 200
M1
60 160
M2 240 280
M3
● The value n determines number of points for output target.
● When X000 is OFF, the wave output remains unchanged.
● When the instruction DABSD is used, S2•can specify high speed counter. However, the wave
output may be delayed due to the scan cycle. When high speed response is required, please use
the instruction HSZ for high-speed comparison.
6-106
Chapter 6 Interpretation of Application Instructions Handy instruction
For example:
X000
INCD D300 C0 M0 K4
M8013
K9999
C0
According to the time sequence table, we take the control n=4 points for M0-M3 for
interpretation.
● The following data are written into S1•by the sending instructions in advance.
D300= 20
D301=30
D302=10
D303=40
6-107
Chapter 6 Interpretation of Application Instructions Handy instruction
6-108
Chapter 6 Interpretation of Application Instructions Handy instruction
TTMR D· n
D· :Number of element storing the ON time of button switch, occupying 2 devices with
continuous numbers D· is in the unit of s, D·+1 is in the unit of 100ms.
n :Setting of multiple, n=0~2.
Function The time of pressing the button multiplying with the ratio is taken as the default
value of the timer, to monitor the continuity of the monitoring information.
For example:
X010
TTMR D300 K0
X010
D301
D301
D300
D300
t0 t0
Pressing time of the button X010 (100ms units) was measured by D301, multiplying by the
specified ratio of n, and the result is stored in D300 (1s units). Setting time of the timer can be
adjusted by the button. Pressing time of the button X010 is τ0 second. According to n value,
actual D301 is listed below:
n D301 (100ms units) D300 (100ms units)
K0 t0 0.1 t0
K1 t0 t0
K2 t0 10 t0
When X010 is OFF, D301 is reset and D300 does not change.
6-109
Chapter 6 Interpretation of Application Instructions Handy instruction
STMR S· m D·
X000
M0 10s 10s
M1 10s 10s
M2 10s
M3
● S specified by m is the setting value of the specified timer, which is 10 seconds in the
example.
● M0 is the delay timer.
● M1 is the single trigger timer after M1 is the input ON→OFF.
● M2 and M3 are used for twinkling.
● When X000 is off, M2 and T10 are reset. M0, M1 and M3 are off after setting the time.
● Timer used here can not be used repeatedly in other general circuits.
6-110
Chapter 6 Interpretation of Application Instructions Handy instruction
ATL D·
D· :Destination element.
Function When the instruction is driven, the state of D· will be changed.
For example:
X000
ALTP M0
X000
M0
● Every time the driving input X000 changes from OFF→ON each time, M0 takes in
reverse direction.
● When continuous execution instruction is used, each computation cycle performs reverse
actions. Please pay attention to it.
● M0 in the above figure is taken as input. When the instruction ALTP is used for driving
M1, multi-level frequency dividing output can be obtained.
M0
ALTP M1
X000
M0
M1
6-111
Chapter 6 Interpretation of Application Instructions Handy instruction
X000
ALTP M0
M0
Y000 Stop
M0
Y001 Start
《Twinkling action》
X006 T2
K50
T2
X006 T2
ALTP Y007
X006
5s 5s
T2
X007
● When the input X006 is ON, contact of the timer T2 acts instantly with an interval of 5
seconds.
● Every time the contact of T2 is ON, the output Y007 is ON/OFF alternatively.
6-112
Chapter 6 Interpretation of Application Instructions Handy instruction
X000
RAMP D1 D2 D3 K1000
● Write the preset initial value and target value into D1 and D2 in advance. If X000 is ON,
content of D3 changes slowly from D1 to D2. Time of moving is the n times of scanning.
D2 D1
(D3)
掃描次數存
儲在D4內
D1 (D3)
n個掃描時間 n個掃描時間
D1 < D2 時 D1 > D2 時
6-113
Chapter 6 Interpretation of Application Instructions Handy instruction
● The preset scanning time (a little longer than the actual scan time of the program) is written
into D8039, which is driven. The PLC is in constant scanning operation mode. If the value is
20ms, in the above case, after 20 seconds, D3 is changed from D1 to D2.
● During operation, if X000 is OFF, it becomes interrupted. When X000 is set ON a second time,
D4 is cleared and it acts from D1.
● After execution is finished, the flag M8029 is ON, value of D3 is back to D1.
● If the instruction combines the analog output, it can output buffering start/stop instruction.
●X000 turns ON and starts to RUN, the number of scan times should be clear from stored
register in advance. (Data register is holding in case of using)
M8029 M8029
6-114
Chapter 6 Interpretation of Application Instructions Handy instruction
ROTC S· m1 m2 D·
S· :Register for counting, occupying 3 devices with continuous numbers.
m1 :Splitting line of worktable, m1=2~32,767.
m2 :Number of ranges at low speed, m2=0~32,767 (m1≥m2).
D· :Start point for signal output, occupying 8 devices with continuous numbers.
Function The instruction is used to make the part specified on the rotary table move to the
exit along the shortest path.
For example:
X010
ROTC D200 K10 K2 M0
The instruction is to get/place the part on the rotary table with the splitting line m1=10, and the
getting/placing window as required is next to the rotary table.
● Please set the 2-phase switch which is to detect the forward/reverse direction of the rotary table
and the switch X002 which acts when part 0 is moved to window 0. X000~X002 are used to
drive M0~M2(The start sequential number of X and M can be set at your discretion).
● D200 occupies 3 devices with continuous numbers. D200 is used as a counting register. D201
is to set the number of target window, and D202 is to set the number of target part. D201 and
D202 are set prior to sending the instruction. When the setting value of D200 is beyond 0~9
(namely, 0~(m1-1)), D8067 = 6706.
● M0:A-phase signal M1:B-phase signal M2 : Signal for zero point
detection
M3:High speed forward M4:Low speed forward rotation M5:Stop
rotation
M6:Low speed reverse M7:High speed reverse rotation
rotation
6-115
Chapter 6 Interpretation of Application Instructions Handy instruction
When the instruction is driven under X010 ON, the results of M3~M7 can be obtained
automatically. When X010 is OFF, M3~M7 is OFF.
● When X010 is ON and the signal for zero point detection (M2) is ON, the content of counting
register D200 is cleared. It shall clear the operation before starting the instruction.
6-116
Chapter 6 Interpretation of Application Instructions Handy instruction
SORT S· m1 m2 D· n
S· :Start element of original data zone
m1 :Number of data groups, m1=1~32.
m2 :Number of data rows, m2=1~6。
D· :Start element of data zone for storing sorting result.
n :Reference number of data sorting, n=1~m2.
Function The instruction is used to sort the data.
For example:
X020
SORT D100 K5 K4 D200 D0
When X020 is ON, the data starts sorting. After finishing flag M8029 is ON, it stops
operation. During operation, do not change the operand and data content. When it is operated a
second time, set X020 OFF one time.
6-117
Chapter 6 Interpretation of Application Instructions Handy instruction
6-118
Chapter 6 Interpretation of Application Instructions Handy instruction
6-119
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
6-120
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
For example:
X030
TKY X000 D0 M10
0 1 2 3 4 5 6 7 8 9
24V 0V S/S X000 X001 X002 X003 X004 X005 X006 X007 X010 X011
PLC
6-121
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
X000 ④
X001 ②
X002 ①
X003 ③
M10
M11
M12
M13
Key sensing
output
M20 ① ② ③ ④
● Input the decimal keys according to the sequence①②③④ in the figure above, and content of
D0 is changed to 2,130. Maximum value of the input is 9,999, and overflow will occur if it is
beyond the range (content of D0 is stored in binary system).
● When the instruction D TKY is used, D1and D0 buffers are combined. When the value exceeds
99,999,999, overflow will occur.
● From the moment pressing X002 to the moment pressing other keys, M12 keeps ON and other
keys are the same.
● Similarly, if the corresponding X000~X011 act, M10~M19 will act.
● When pressing any key, if the pressing is detected, M20 will be ON. When several keys are
pressed, the earlier pressed one shall prevail.
● When the input X030 is OFF, content of D0 will not change, and M10~M2 will be all OFF.
6-122
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
For example:
X000
HKY X010 Y010 D0 M0
《Digit keys》
9 8 7 6 5 4 3 2 1 0
BCD
D0(BIN)
● Every time the digit key is pressed, values with upper limit 9,999 is stored in D0 in the form of
BIN. If it exceeds the value, overflow will occur.
● When the instruction DHKY is used, D1 and D0 are valid between 0~99999999.
6-123
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
● When several keys are operated, the earlier pressed one shall prevail.
● After one cycle scan for Y010~Y013, the finishing flag M8029 acts.
《Function keys》
F E D C B A
M5 M4 M3 M2 M1 M0
● When the key A is pressed, M0 keeps ON; when D is pressed, M0 is OFF and M3 keeps ON.
● When several keys are operated, the earlier pressed one shall prevail.
C D E F
External circuit
8 9 A B
4 5 6 7
0 1 2 3
6-124
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
Supplementary description:
When executing the instruction, it must go through 8 scan cycles to catch the input value of a
key effectively. When the scan cycle is too long or too short, it may cause bad pressing. Therefore,
the following skill can be applied to overcome.
1. 1. When the scan cycle is too short, it might results in I/O fails to read the input value of
a key, you may fix the scan time in this case.
2. 2. When the scan cycle is too long, the response of pressing button may become slow.
You may write the instruction in the time interruption sub-program, and execute it within a fixed
interval.
6-125
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
For example:
X000
DSW X020 Y020 D0 K1
6-126
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
2nd group of
BCD digital input
switch 100 101 102 103
Diode
1 2 4 8 1 2 4 8
24V 0V S/S X020 X021 X022 X023 X024 X025 X026 X027
1st group of 2nd group of
input input
《The 1st group The 4-bit BCD code digit switch connecting X020~X023 reads according to
of input》 the sequence of Y020~Y023 and stored in D0.
《The 2nd group The 4-bit BCD code digit switch connecting X024~X027 reads according to
of input》 the sequence of Y020~Y023 and stored in D1. (Valid when n=2)
X000 Cyclic
action
Y020 t t t
Y021 t
Interr
uptio
Y022 t
n
Y023 t
Execution
M8029
finishing
T: A scan cycle
● When X000 is ON, Y020~Y023 work according to the sequence (a scan cycle). After one cycle,
the finishing flag M8029 acts.
● When DSW values need continuous input, PLC with transistor output shall be used.
6-127
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
Supplementary description:
A. When PLC is used as relay output, the following method can be used:
1)When X000=ON, the instruction DSW is executed; when X000 is OFF, M10 will continue
to keep ON and it will be OFF until the scan terminal of instruction DSW finishes one cycle.
2)The condition contact X000 uses button switch. Every time it is pressed, M10 will be OFF
after the scan terminal specified by the instruction DSW finishes one cycle output. Then the
instruction stops execution and the finger-dialing switch data will be fully read. Therefore, under
the circumstances, even the scan terminal uses relay output, service life of the relay will not be
shortened.
X000
SET M10
M10
DSW X020 Y020 D20 K2
M8029
RST M10
B. When executing the instruction, it must go through 4 scan cycles to catch the input value of a
key effectively. When the scan cycle is too long or too short, it may cause bad pressing. Therefore,
the following skill can be applied to overcome.
1) When the scan cycle is too short, it might results in I/O fails to read the input value of a
button, you may fix the scan time in this case.
2) When the scan cycle is too long, the response of pressing button may become slow. You
may write the instruction in the time interruption sub-program, and execute it within a fixed
interval.
6-128
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
SEGD S· D·
S· :Source device of decoding.
D· :Output device after decoding.
Function 0-F (hexadecimal system number) of specified by low 4-bit of S• is decoded into D•
of data in the 7-section code. High 8-bit of D• does not change.
M8273 specifies logic relation of output display
When M8273=OFF, 《Seven-section Decoding Table》is shown as below:
Source Pre-setting
Hexadecim Bit 7-section Number
al combination combined number B7 B6 B5 B4 B3 B2 B1 B0 represented
number format
0 0000 B0 0 0 1 1 1 1 1 1 0
1 0001 B5 B6 B1 0 0 0 0 0 1 1 0 1
2 0010 0 1 0 1 1 0 1 1 2
B4 B2
3 0011 0 1 0 0 1 1 1 1 3
4 0100
B3 0 1 1 0 0 1 1 0 4
5 0101 0 1 1 0 1 1 0 1 5
6 0110 0 1 1 1 1 1 0 1 6
7 0111 0 0 1 0 0 1 1 1 7
8 1000 0 1 1 1 1 1 1 1 8
9 1001 0 1 1 0 1 1 1 1 9
A 1010 0 1 1 1 0 1 1 1 A
B 1011 0 1 1 1 1 1 0 0 B
C 1100 0 0 1 1 1 0 0 1 C
D 1101 0 1 0 1 1 1 1 0 D
E 1110 0 1 1 1 1 0 0 1 E
F 1111 0 1 1 1 0 0 0 1 F
6-129
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
6-130
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
SEGL S· D· n
S· :Source device to display 7-section code
D· :Start device for 7-section display scan output
n :Polarity setting of output signal and scan signal, n=0~7.
Function The instruction is used for controlling 1 or 2 groups of 4-bit 7-section code with saving
function.
For example:
X000
SEGL D0 Y000 K0
COM0 Y000 Y001 Y002 Y003 COM1 Y004 Y005 Y006 Y006 COM2 Y010 Y011 Y012 Y013
6-131
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
《Logic of PLC》
NPN transistor output loop: when the internal signal is 1, it outputs low level, which is called
negative logic.
Full-
loading
resistor Logic1
Low
Negative
PLC
PNP transistor output loop: when the internal signal is 1, it outputs high level, which is called
positive logic.
PLC
Positive
High
Unloading Logic 1
resistor
6-132
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
《Selection of parameter n》
Number of groups for
One group Two groups
7-section display
Logic between PLC output
terminal and data input Same Different Same Different
terminal of the display
Logic between PLC output
Diffe Diffe Diffe Diffe
terminal and data scan signal Same Same Same Same
rent rent rent rent
of the display
n 0 1 2 3 4 5 6 7
When logics of PLC transistor output and 7-section display are the same or not the same, it
can be matched with setting value of the parameter n.
Assume PLC output is of negative logic, data input terminal of 7-section display is also of
negative logic and control signal of 7-section monitor is of positive logic. If it is 4-bit for 1 group,
n=1; for 4-bit for 2 groups, n=5.
6-133
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
For example:
X000
ARWS X020 D0 Y020 K0
Y024 Increase
Y025
Y026
Y027 X021
● 16-bit binary BCD (effective between 0-9,999 after conversion) data is stored in D0. BCD code
is used in the following interpretation for convenience.
● When the drive input X000 is ON, it is specified as 103 bit. When pressing the abdication key
each time, it changes as per 103-102-101-100-103. In addition, when pressing the carrying key
each time, it changes as per103-100-101-102-103. The specified bit can display by LED according
6-134
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
Supplementary description:
The output points Y20~Y27 specified by the instruction must use transistor output. When
the instruction is used, please fix the scan time or the instruction is inserted into the interruption
subprogram for executing.
6-135
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
ASC S D·
S :8 letters and fingers input by the computer(A~Z, 0~9. The half-width characters are
processed, while the full-width characters won't be processed).
If the input is less than 8 characters, the low bit will fill the empty position. If the input is A, put A
at the highest bit, and leave the rest 7 bits as “ ”.
D· :Start address of the device for storing the ASCII code after conversion
Function The instruction is used to convert the characters into ASCII codes and store them in
the specified element.
For example:
X000
ASC ABCDEFGH D300
Result of instruction execution: The letters A~H are sent to D300~D303 after ASCII code
after conversion.
High Low
8-bit 8-bit
D300 42(B) 41(A)
D301 44(D) 43(C)
D302 46(F) 45(E)
D303 48(H) 47(G)
● The instruction is used for displaying error and other information on external display.
6-136
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
● After M8161 is set ON, when executing the instruction, only low 8-bit is moved to D•, which
occupies the devices with the same number of the characters moved and the high 8-bit is 0.
High Low
8-bit 8-bit
D300 00 41 A
D301 00 42 B
D302 00 43 C
D303 00 44 D
D304 00 45 E
D305 00 46 F
D306 00 47 G
D307 00 48 H
6-137
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
PR S· D·
S· :Start element for storing the ASCII code to be moved
D· :External output point of outputting ASCII code, occupying 10 continuous points.
Function The instruction is used for moving ASCII code data to Y.
For example:
X000
PR D300 Y000
When the drive input X000 is executing, if it is OFF, the moving is stopped immediately and
the external output points are all cleared. When it is ON a second time, it acts from the
initial state.
6-138
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
● When the instruction is executed with the scan cycle (T0 in the above figure), if the scan cycle is
short, please use constant scan mode; if it is long, please use timing interruption driving.
● Transistor output must be used for the PLC.
● Even if the driving X000 is in ON status continuously, it will stop outputting after a cyclic
output is finished.
Driving input
X000
Start End
Data Y007~Y000
character character
T T T
● When the instruction drives X000 on the rising edge, the instruction starts executing; if the drive
X000 is OFF during data output, the output is not stopped.
● Even if the driving X000 is in ON status continuously, it will stop outputting after a cyclic
output is finished. However, the flag 8029 will act until X000 is OFF.
6-139
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
FROM m1 m2 D· n
m1 :The unit number of the special functional unit/module, m1=0~255.
0~253:Communication port for the expansion module; 254:RS485 or RS232 expansion
card communication port ; 255:RS485 or RS232 expansion card communication port 2. (Only K
of AP300 series is in the range of 0~255, which is 0~254 for other AP series.)
m2 :Number of the buffering storage zone(BFM) for the sending source, m2=0~FFFFH.
D· :Number of the destination element.
n :Sending points, n=1~61(16bit)/1~30 (32bit).
Function It is to read the content in the buffering storage zone(BFM) of the special functional
unit/module in the PLC. When the instruction is used to read the data of multiple buffering
storage zones(BFM), error might occur to the watchdog timer.
For example:
M8000
FROM K0 K4 D0 K3
The program in the above figure reads the content of BFM#4~#6 in the special module(The
unit number is 0 fixedly) to D0~D2.
6-140
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
distributed automatically.
The unit number from the module closet to the basic unit is 0→1→2… in sequence.
2)m2 :BFM number
In the special functional unit/module, a maximum of 32,767 points of 16-bit RAM can be
built in, which is called BFM.
The BFM number is within the range of 0~32,766, in which the content depends on the
control purpose.
Setting range:H0~HFFFF.
When processing BFM with a 32-bit instruction, the specified BFM is a low 16-bit number,
while the adjacent BFM is a high 16-bit.
3)n :Sending points
Setting range: K1~K61.
n is used to specify the sending points of words.
n=2 in 16-bit instruction will get the same results as n=1 in 32-bit instruction.
《Related elements》
a) M8028 interruption permitted
1、M8028=OFF
When executing instruction FROM/TO, it will change to the state of interruption
prohibited automatically, and the input interruption and timer interruption won't be executed.
The interruption generated during this period will be executed immediately after the
execution of instruction FROM/TO is finished.
Besides, the instruction FROM/TO can be also used in the interruption program.
2、M8028=ON
If interruption is generated during the execution of instruction FROM/TO, the
interruption will be executed, and then the interruption program will be executed.
However, the instruction FROM/TO can't be used in the interruption program.
b) M8070 error alarm
The special reference coil M8070 is the indicator of communication error status. When
communication error occurs, M8070 is ON.
c) D8070 error code
When communication error occurs, the error code will be stored in the special data register
D8070.
6-141
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
6-142
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
TO m1 m2 S· n
m1 :The unit number of the special functional unit/module, m1=0~255.
0~253:Communication port for the expansion module; 254:communication port for the
RS485 or RS232 expansion card; 255:communication port 2 for the RS485 or RS232 expansion
card. (Only K of AP300 series is in the range of 0~255, which is 0~254 for other AP series.)
m2 :Number of the buffering storage zone(BFM) for the sending destination, m2=0~FFFFH.
S· :Element number of the sending source.
n :Sending points, n=1~60(16bit)/1~30 (32bit).
Function It writes the data from PLC to the BFM of the special functional unit/module. When
the instruction is used to read the data of multiple buffering storage zones(BFM), error might
occur to the watchdog timer.
For example:
M1
TO K0 K27 H0 K1
As shown in the above figure, the program writes [H0] in BFM#27 of the special
module(with the unit number is fixed to be 0).
《Specifying content of the operand》
1) m1 :The unit number of the special functional unit/module.
It is used to specify the target device for which the instruction FROM/TO acts.
Setting range: K0~255.
For the PLC, the unit number of the connected special functional unit/module can be
distributed automatically.
The unit number from the module closet to the basic unit is 0→1→2… in sequence.
6-143
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
《Related elements》
a) M8028 interruption permitted
1、M8028=OFF
When executing instruction FROM/TO, it will change to the state of interruption
prohibited automatically, and the input interruption and timer interruption won't be executed.
The interruption generated during this period will be executed immediately after the
execution of instruction FROM/TO is finished.
Besides, the instruction FROM/TO can be also used in the interruption program.
2、M8028=ON
If interruption is generated during the execution of instruction FROM/TO, the
interruption will be executed, and then the interruption program will be executed.
However, the instruction FROM/TO can't be used in the interruption program.
b) M8070 error alarm
The special reference coil M8070 is the indicator of communication error status. When
communication error occurs, M8070 is ON.
c) D8070 error code
When communication error occurs, the error code will be stored in the special data register
D8070.
6-144
Chapter 6 Interpretation of Application Instructions Peripheral devices I-O
take longer time for initialization, so it will take longer time for computation, which will
cause error of watchdog timer.
b. Multiple instructions FROM/TO driven simultaneously
When multiple instructions FROM/TO are executed to perform sending operation to
multiple BFMs, the computation time will be longer, which might also cause error of
watchdog timer.
2. Solutions
a. Change the time of watchdog timer
By modifying the content of D8000(timer of watchdog timer), it could change the
detection time of the watchdog timer.
Type in the following program, then the sequential control program will conduct
monitoring according to the new timer of watchdog timer.
M8002
Time of watchdog timer
MOV K300 D8000
Watchdog timer refreshing 300ms
When the instruction WDT is not written,
WDT the value of D8000 will become valid when
processing
6-145
Chapter 6 Interpretation of Application Instructions External serial devices
6-146
Chapter 6 Interpretation of Application Instructions External serial devices
F80 RS communications
F
RS RS communications S· m D· n K
80
RS S· m D· n K
S· :Address of data sent.
m :Length of data sent (0~255).
D· :Address of data received.
n :Length of data received (0~255).
K :Serial port selection, constant 0~1.
0:RS485 communication port; 1:RS485 or RS232 expansion card communication port ;
2:RS485 or RS232 expansion card communication port 2. (Only K of AP300 series can be 0, 1
or 2, which is 0 or 1 for other AP series.)
Function The instruction uses RS232/RS485 expansion card communication port 1/2 or the
built-in RS485 communication port to achieve serial non-protocol data sending and receiving.
●Data sending format of RS485 communication port can be set by the special register D8120.
During executing of the instruction RS, even if the settings of D8120 are changed, it is not
accepted in fact.
● Data sending format of communication port of RS485 or RS232 expansion card can be set by
the special register D8320(for the expansion card communication port 1)/D8300(for the expansion
card communication port 2).. During executing of the instruction RS, even if settings of
D8320/D8300 are changed, it is not accepted in fact.
● In the environment not for message sending, points of message sending are set at “K0”. In
addition, in the environment not for message receiving, points of information receiving are set at
(K0).
● Although one program can use a large number of RS, MBUS, DTLK, RMIO and other
6-147
Chapter 6 Interpretation of Application Instructions External serial devices
communication instructions upon demands, one communication instruction is driven at one serial
port at the same time. Moreover, the time of OFF shall be equal to or more than one scan cycle
during switching.
6-148
Chapter 6 Interpretation of Application Instructions External serial devices
Communication setting in the table above shall be set according to the following program or serial
communication of peripheral machines.
b15 b12 b11 b8 b7 b4 b3 b0
D8120 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1
↓
D8120 89H
M8002
MOV H89 D8120
6-149
Chapter 6 Interpretation of Application Instructions External serial devices
6-150
Chapter 6 Interpretation of Application Instructions External serial devices
6-151
Chapter 6 Interpretation of Application Instructions External serial devices
M 8000
M 8161 O F F 1 6 -b it m o d e
RS D 200 K4 D 500 K 10 K0
H ig h 8 -b it L o w 8 -b it
T h e 1 6 -b it d a ta is d iv id e d in to h ig h an d lo w 8 -b it fo r d ata sen d in g
a n d re ce iv in g .
Sending data
STX D200 Down D200 Up D201 Down D201 Up ETX
Start ↖ Start address No. specified by S End
Symbol ← Number of byte to be sent specified by M → character
Receiving data
STX D500 Down D500 Up D501 Down D501 Up D502 Down D502 Up ETX
Start ↖ Start address No. specified by D End
Symbol It can't exceed the maximum number of received points specified by n. The end Symbol
character ETX or n points received indicate the receiving is finished.
D201 Down
D200 Up
D201 Up
ETX
STX
D a ta to b e s e n t
4
N um ber of 3
2
re s id u a l d a ta to b e 1
sen t D 8 1 2 2 0
(2) Data received or the number of data received
D502 Down
D500 Down
D501 Down
D500 Up
D502 Up
D501 Up
ETX
STX
D a ta re c e iv e d
6 W h en th e re ce iv in g fin ish in g m a rk
5
4 M 8 1 2 3 is re se t, th e d a ta re c e iv ed w ill
N u m b e r o f d a ta 3
2 b e rese t a s w ell.
re c e iv e d 1
D 8123 0
RS D 200 K4 D 500 K 10 K0
H ig h 8 - b it ( I g n o r e d ) L o w 8 - b it
F o r 1 6 - b i t d a t a , t h e h i g h 8 - b i t w il l b e i g n o r e d , a n d
o n ly l o w 8 - b i t w i l l b e v a li d .
6-152
Chapter 6 Interpretation of Application Instructions External serial devices
Sending data
STX D200 Down D201 Down D202 Down D203 Down ETX
Start ↖ Start address No. specified by S End
Symbol ← Number of byte to be sent specified by M → Symbol
Receiving data
STX D500 Down D501 D502 Down D503 Down D504 Down D505 ETX
Down Down
Start ↖ Start address No. specified by D End
Symbol It can't exceed the maximum number of received points specified by n. The end Symbol
character ETX or n points received indicate the receiving is finished.
D202 Down
D203 Down
D201 Down
ETX
STX
Data to be sent
4
3
Number of residual 2
data to be sent D8122 1
0
D504 Down
D505 Down
D502 Down
D503 Down
ETX
STX
Data received
6
5 When the receiving finishing mark M8123 is reset,
4
3 the data received will be reset as well.
Number of data received 2
D8123 1
0
6-153
Chapter 6 Interpretation of Application Instructions External serial devices
PRUN S· D·
S· :Sending source device, n of KnX, KnM is 1~8, and lowest bit of the specified device No. is
0.
D· :Sending destination device.
Function This directive specifies the element number of bits with octal number processing and
transmit data.
X000
PRUN K4X010 K4M0
X000
PRUN K4M0 K4Y010
6-154
Chapter 6 Interpretation of Application Instructions External serial devices
ASCI S· D· n
S· :Conversion source device.
D· :Conversion destination device.
n :Bits to be converted, n=1~256.
Function The instruction is used to convert HEX code into ASCII code, with 16-bit and 8-bit
conversion modes.
For example:
X000
ASCI D100 D200 K4
Of them: D100=0ABCH
D101=1234H
D102=5678H
ASCII: [0]=30H [1]=31H [2]=32H [3]=33H [4]=34H [5]=35H
[6]=36H [7]=37H [8]=38H [9]=39H [A]=41H [B]=42H
[C]=43H [D]=44H [E]=45H [F]=46H
6-155
Chapter 6 Interpretation of Application Instructions External serial devices
0 Low 8-bit
Destination address
Conversion results:
n
K1 K2 K3 K4 K5 K6 K7 K8 K9
D·
D200 [C] [B] [A] [0] [4] [3] [2] [1] [8]
D201 [C] [B] [A] [0] [4] [3] [2] [1]
D202 [C] [B] [A] [0] [4] [3] [2]
D203 [C] [B] [A] [0] [4] [3]
D204 [C] [B] [A] [0] [4]
D205 [C] [B] [A] [0]
D206 [C] [B] [A]
Do not change
D207 [C] [B]
D208 [C]
6-156
Chapter 6 Interpretation of Application Instructions External serial devices
When BCD data is output by printing and etc., BIN→BCD conversion instruction is used
before the instruction.
6-157
Chapter 6 Interpretation of Application Instructions External serial devices
HEX S· D· n
S· :Conversion source device.
D· :Conversion destination device.
n :Bits to be converted, n=1~256.
Function The instruction is used to convert ASCII code into HEX code, with 16-bit and 8-bit
conversion modes.
For example:
X000
HEX D200 D100 K4
6-158
Chapter 6 Interpretation of Application Instructions External serial devices
When the input data is BCD code, BCD→ BIN conversion shall be executed after executing
the instruction.
6-159
Chapter 6 Interpretation of Application Instructions External serial devices
CCD S· D· n
S· :Start device of data source
D· :Store checking results.
n :number of data, n=1~256.
Function The instruction is used to compute the check code, with 16-bit and 8-bit conversion
modes.
For example:
X000
CCD D100 D0 K10
6-160
Chapter 6 Interpretation of Application Instructions External serial devices
6-161
Chapter 6 Interpretation of Application Instructions External serial devices
MBUS S· m D· n K
S· :Address of data sent.
m :Length of data sent (0~253).
D· :Address of data received.
n :Length of data received (0~253).
K :Serial port selection, constant 0~1.
0:RS485 communication port; 1:RS485 or RS232 expansion card communication port ;
2:RS485 or RS232 expansion card communication port 2. (Only K of AP300 series can be 0, 1
or 2, which is 0 or 1 for other AP series.)
Function The instruction uses RS232/RS485 expansion card communication port 1/2, RS484
communication port or the built-in RS484 communication port to achieve serial
Modbus-protocol data sending and receiving. The above two ports can realize communication
function of instruction MBUS simultaneously, and such function independently.
The instruction MBUS of PLC under AP series only supports RTU mode, and ASCII mode is
unavailable.
The instruction MBUS can be used as host station communication:
The stored instruction format of register sending data is HEX instruction code, including
address, function code and communication data. The instruction MBUS adds CRC check code(2
bytes) according to the setting mode like RTU mode before sending. The stored instruction format
in the register receiving data is address, function code and communication data, and the check
code is not stored.
●Data sending format of RS485 communication port can be set by the special register D8120.
6-162
Chapter 6 Interpretation of Application Instructions External serial devices
During executing of the instruction MBUS, even if the settings of D8120 are changed, it is not
accepted in fact.
● Data sending format of communication port of RS485 or RS232 expansion card can be set by
the special register D8320(for the expansion card communication port 1)/D8300(for the expansion
card communication port 2).. During executing of the instruction MBUS, even if settings of
D8320/D8300 are changed, it is not accepted in fact.
● In the environment not for message sending, points of message sending are set at “K0”.
● Although one program can use a large number of RS, MBUS, DTLK, RMIO and other
communication instructions upon demands, one communication instruction is driven at one serial
port at the same time. Moreover, the time of OFF shall be equal to or more than one scan cycle
during switching.
6-163
Chapter 6 Interpretation of Application Instructions External serial devices
*2. When the host is powered on, D8120, D8320, D8300 are set as 89Hex by default.
Communication setting in the table above shall be set according to the following program or serial
communication of peripheral machines.
b15 b12 b11 b8 b7 b4 b3 b0
D8320 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1
↓
D8320 99H
M8002
MOV H99 D8320
6-164
Chapter 6 Interpretation of Application Instructions External serial devices
X 010
M BUS D 200 D0 D 500 D1
K1
A d d ress an d n u m b er
A d d ress a n d n u m b e r S e le c t
o f p o in ts o f d a ta
o f p o in ts o f s e n t d a ta in te rfa c e
re c e iv e d
P u ls e
W rite c o n te n t o f d a ta to b e W rite D 0 (N u m b e r o f p o in ts o f
sen t s e n d in g ) a n d c o n te n t o f D 2 0 0 ~
Send
re q u e st S e n d r e q u e s t. I t w i l l b e r e s e t a u t o m a t i c a l l y
SET M 8322 a fte r s e n d in g is fin is h e d . P le a s e d o n ’ t re s e t
w ith p ro g ra m .
M 8323
T ra n s m it c o n te n t o f d a ta to T ra n s m it th e d a ta re c e iv e d
b e sen t to th e s p e c ifie d re g is te r
F in is h
T h e re c e iv in g fin is h in g m a rk
re c e iv in g
RST M 8323 c a n ’ t b e re s e t in o n e
c o n tin u o u s ly o p e ra te d p ro g ra m
6-165
Chapter 6 Interpretation of Application Instructions External serial devices
Sending data
6-166
Chapter 6 Interpretation of Application Instructions External serial devices
Receiving data
D500 Down D500 Up D501 Down D501 Up D502 Down D502 Up Check code
↖ Start address No. specified by D CRC(RTU)
It can't exceed the maximum number of received points specified by n. The end character
ETX or n points received indicate the receiving is finished.
D201 Down
CRC Down
R T U M ode
D200 Up
D201 Up
CRC Up
D ata to be sent
6
5
4
3
N um ber of residual 2
data to be sent 1
D 8322 0
R T U m ode
D500 Down
D501 Down
D502 Down
CRC Down
D501 Up
D502 Up
D500 Up
CRC Up
D a ta re c e iv e d
8
7
6
5 W h e n t h e r e c e i v i n g f in is h in g m a r k M 8 3 2 3 i s
4
3 re s e t, th e d a ta re c e iv e d w ill b e r e s e t a s w e ll.
N u m b e r o f d a ta re c e iv e d 2
1
D 8323 0
M 8000
M 8161 O N 8 -b it m o d e
M B U S D 200 K 4 D 500 K 6 K 1
H ig h 8 -
L o w 8 -b it
b i t (Ig n o re d )
F o r 1 6 -b it d a ta , th e h ig h 8 -b it d a ta w ill b e ig n o re d ,
6-167
Chapter 6 Interpretation of Application Instructions External serial devices
Sending data
D200 Down D201 Down D202 Down D203 Down Check code
↖ Start address No. specified by S CRC(RTU)
← Number of byte to be sent specified by M →
Receiving data
D500 D501 D502 D503 Down D504 D505 Down Check
Down Down Down Down code
↖ Start address No. specified by CRC
D (RTU)
It can't exceed the maximum number of received points specified by n. The end
character ETX or n points received indicate the receiving is finished.
D202 Down
D203 Down
D201Down
CRC Down
R T U M ode
CRC Up
D a ta to b e s e n t
6
5
4
3
N u m b e r o f re s id u a l 2
d a ta to b e s e n t 1
D 8322 0
D503 Down
D504 Down
D505 Down
RTU mode
D502 Down
CRC Down
CRC Up
Data received
8
7
6
5 When the receiving finishing mark M8323 is
4
3 reset, the data received will be reset as well.
Number of data received 2
1
D8323 0
6-168
Chapter 6 Interpretation of Application Instructions External serial devices
The program will occupy 25 data registers from S3. automatically. (the following page
displays ACT setting of control parameters. When B1, B2 and B5 are all 0, only 20 data registers
from S3 are occupied).
6-169
Chapter 6 Interpretation of Application Instructions External serial devices
Parameter setting
Setting values of parameters for control must be written with MOV and other instructions
before PID operation. In addition, when specifying data register in the zone for holding in case
of power failure, the setting values are held after power-OFF of the PLC. Therefore, it requires
no re-writing.
Address Name Operation and Function
S3· Sampling time (Ts) 1~32767[ms](No shorter than the scanning time)
Bit Content
number 0(Bit OFF) 1(Bit ON)
B0 Positive action Negative action
Without input variation
B1 With input variation alarm
alarm
Without input variation
B2 With input variation alarm
alarm
Direction of action
S3·+1 B3 Unavailable
(ACT)
Auto turning function Auto turning function
B4
disabled enabled
No upper and lower
With upper and lower
B5 limits of the output
limits of the output values
values
B6~B15 Unavailable
Note:B5 and B2 shall not be ON simultaneously.
Input wave filtering
S3·+2 0~99[%] No input wave filtering for 0
constant (a)
S3·+3 Proportional gain (Kp) 1~32767[%]
It is positively infinite for 0(no
S3·+4 Integration time (TI) 1~32767[×100ms]
integration action)
0~100[%] No differential gain for 0
S3·+5 Differential gain (KD)
0~100 are recommended, while the actual setting range is 0~200.
S3·+6 Differential time(TD) 1~32767[×10ms] No differential action for 0
S3·+7~
When PID operation is executed, it is used for internal processing.
S3·+19
Setting value of input
S3·+20 variation (increasing) 0~32767(when S3+1<ACT>bit1=1, it is effective)
alarm
Setting value of input
S3·+21 variation (decreasing) 0~32767(when S3+1<ACT>bit1=1, it is effective)
alarm
Setting value of output
S3·+22 variation (increasing) 0~32767(when S3+1<ACT> bit2=1,bit5=0, it is effective)
alarm
6-170
Chapter 6 Interpretation of Application Instructions External serial devices
Although instruction PID can be executed for many times (no restriction on times of the loop),
S3. or D. used in the computation can not be used repeatedly.
PID instruction can be used in interruption of timer, sub-program, step logic and jump
instruction.
Maximum error of sampling time Ts is between -(1 scan cycle+1ms) and +(1 scan cycle).
When Ts is too small, such variation may lead to problems. At this time, please execute with
constant scan mode or program in the interruption of the timer.
If sampling time Ts≤1 computation cycle of PLC controller, the following computation error
will occur (K6740), and PID operation will be performed based on Ts= computation cycle. At
this time, it is suggested that instruction PID can be used in interruption (I6□□~I8□□) of the
timer.
Input filter constant can be used to relieve variation of measuring values.
Increasing differential gain can be used to relieve dramatic variation of output values.
6-171
Chapter 6 Interpretation of Application Instructions External serial devices
Output
Without upper/lower
value limits of output value
Output
unavailable
S3·+22
Upper limit of
output value
S3·+23
Lower limit of
output value With upper and lower
limits of output value
Output
unavailable
In p u t v a r ia tio n
In c re a sin
g s id e
a) Variation
(Current)- (Previous) =Variation 0
S a m p lin g
tim e s
S3· +24
B1 OFF
O u tp u t v a r ia tio n
In c re a sin g
s id e
S a m p lin g
0 tim e s
ii)Output variation (B2=1)
D e c re a sin g
sid e
A la r m s y m b o l
S 3 ·+ 2 4
B2 ON OFF
S3· +24
B3 OFF ON
6-172
Chapter 6 Interpretation of Application Instructions External serial devices
Step response method is used for mathematical computation and the following is detailed
description.
The step response method is to add 0-100% step output on the control system and judge
features of actions from input variation (maximum inclination R and unavailable time L) to obtain
3 constants of PID.
Step 1 output can be obtained by 0-75% or 0-50%.
Features of actions
O u tp u t
v a lu e
100%
O u tp u t v a lu e
(M V )
0%
T im e
V a ria tio n
o f in p u t
v a lu e
1S M ax ram p (R )
T im e S
Id le tim e L ( S ) 1S
1 . 2 Outputvalu e
PID control 20L 50L
RL (MV)
6-173
Chapter 6 Interpretation of Application Instructions External serial devices
In case of error in setting values of the control parameters or data of PID operation, the
computation error M8067 is ON. The following data are stored in D8067 according to the error
content.
Processing
Code Error code description Processing method
state
Applied instruction is specified with the
K6705
incompatible register
Range and data of device address No. of
K6706 operand of applied instruction are out of
the boundary
Sampling time TS is out of the
K6730
object boundary (Ts<0)
Computation
Input wave filtering constant is out of the
K6732 of
object boundary
instruction
Proportional gain(KP) is out of the
K6733 PID stops
object boundary(KP<0)
Integration time(TI) is out of the object
K6734
boundary (TI<0)
Differential gain(KD) is out of the
K6735
object boundary(KD<0 or 201≤KD) Please confirm content of control
Differential time(TD) is out of the object data
K6736
boundary (TD<0)
K6740 Sampling time≤ Computation cycle
Overflow of measuring value variation
K6742
(PV<﹣32768 or 32767<PV)
Overflow of deviated value(EV<﹣32768
K6743
or 32767<EV) Computation
Overflow of integration computation of
K6744
value (beyond-32768~32767) instruction
Overflow of differential gain(KP) leads PID
K6745
to overflow of differential value. continues
Overflow of differential computation
K6746
value (beyond-32768~32767)
Overflow of PID computation results
K6747
(beyond -32768~32767)
6-174
Chapter 6 Interpretation of Application Instructions External serial devices
6-175
Chapter 6 Interpretation of Application Instructions External serial devices
Mark interpretation
EVn: deviation of current sampling MVn:current operand
EVn-1: deviation of one cycle Dn:current differential quantity
SV: target value Dn-1:differential item one cycle before
PVnf: measuring value of current sampling (after wave filtering) Kp:proportional gain
PVnf-1: measuring value one cycle before (after wave filtering) Ts:sampling cycle
PVnf-1: measuring value two cycles before (after wave filtering) TI:integration constant
ΔMV:variation of the output TD:differential constant
αD:differential gain
6-176
Chapter 6 Interpretation of Application Instructions Convenient communication
Convenient communication
Function No. Mnemonic Name Page
F90 COIW Single coil write in 6-178
F91 MCIR Coil reading 6-182
F92 MCIW Multi-coil write in 6-184
F93 REGW Single register write in 6-186
F94 MRGR Register read 6-188
F95 MRGW Multi-register write in 6-190
6-177
Chapter 6 Interpretation of Application Instructions Convenient communication
6-178
Chapter 6 Interpretation of Application Instructions Convenient communication
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
6-179
Chapter 6 Interpretation of Application Instructions Convenient communication
Communication setting in the table above shall be set according to the following program or serial
communication of peripheral machines.
b15 b12 b11 b8 b7 b4 b3 b0
D8120 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1
↓
D8120 89H
M8002
MOV H89 D8120
6-180
Chapter 6 Interpretation of Application Instructions Convenient communication
In case of communication error, the current error code will be stored in the register D8345,
and the error step number will be stored in register D8346. The table below lists the error code and
error information.
Code Error code description Processing state
K6760 CRC verification error Instruction operation continues
K6761 No response
K6762 Response exception
K6763 Can't identify returned data
For example:
Control the action Y0 of the slave by M0 of the AP host, and set the station number of the AP
host as 1.
Change the communication format of the slave (19200,8,N,2) to make it consistent with
the AP host, and set the station number of the salve as 2.
M8002
MOV H89 D8120 Set communication format: 19200, 8, N, 2
6-181
Chapter 6 Interpretation of Application Instructions Convenient communication
●Data sending format of RS485 communication port can be set by the special register D8120.
During the execution of the instruction MCIR, even if the settings of D8120 are changed, it won't
take effect. Only after the instruction is enabled for a second time, will it take effect.
● When using the instruction, the station number of the host and slave can't be repeated.
● Data sending format of communication port 1/2 of RS485 or RS232 expansion card can be set
by the special register D8320(for the expansion card communication port 1)/D8300(for the
expansion card communication port 2).. During the execution of the instruction MCIR, even if the
settings of D8320/ D8300 are changed, it won't take effect. Only after the instruction is enabled
for a second time, will it take effect.
● Under the environment which doesn't require reading coil, please set the number of coil to be
6-182
Chapter 6 Interpretation of Application Instructions Convenient communication
read as 0.
● The same program can apply a lot of communication instructions upon demands, such as MCIR.
COIW, MCIW, MRGR, REGW, MRGW, and etc. After the communication of the current
instruction, the current port will be released automatically, and the next instruction will be
executed. After the condition of enabling the instruction is ON, the communication will be sent. If
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
For example:
Read the status of M100~M110 on the slave from the AP host, and set the station number of
the AP host as 1.
Change the communication format of the slave (19200,8,N,2) to make it consistent with
the AP host, and set the station number of the salve as 2.
M8002
MOV H89 D8120 Set communication format: 19200, 8, N, 2
6-183
Chapter 6 Interpretation of Application Instructions Convenient communication
●Data sending format of RS485 communication port can be set by the special register D8120.
During the execution of the instruction MCIW, even if the settings of D8120 are changed, it won't
take effect. Only after the instruction is enabled for a second time, will it take effect.
● When using the instruction, the station number of the host and slave can't be repeated.
● Data sending format of communication port 1/2 of RS485 or RS232 expansion card can be set
by the special register D8320(for the expansion card communication port 1)/D8300(for the
expansion card communication port 2).. During the execution of the instruction MCIW, even if the
settings of D8320/D8300 are changed, it won't take effect. Only after the instruction is enabled for
a second time, will it take effect.
● Under the environment which doesn't require writing coil, please set the number of coil to be
6-184
Chapter 6 Interpretation of Application Instructions Convenient communication
written as 0.
● The same program can apply a lot of communication instructions upon demands, such as MCIR.
COIW, MCIW, MRGR, REGW, MRGW, and etc. After the communication of the current
instruction, the current port will be released automatically, and the next instruction will be
executed. After the condition of enabling the instruction is ON, the communication will be sent. If
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
For example:
Read the status of Y0~Y15 on the slave from the AP host, and set the station number of the
AP host as 1.
Change the communication format of the slave (19200,8,N,2) to make it consistent with
the AP host, and set the station number of the salve as 2.
M8002
MOV H89 D8120 Set communication format: 19200, 8, N, 2
6-185
Chapter 6 Interpretation of Application Instructions Convenient communication
●Data sending format of RS485 communication port can be set by the special register D8120.
During the execution of the instruction REGW, even if the settings of D8120 are changed, it won't
take effect. Only after the instruction is enabled for a second time, will it take effect.
● When using the instruction, the station number of the host and slave can't be repeated.
● Data sending format of communication port 1/2 of RS485 or RS232 expansion card can be set
by the special register D8320(for the expansion card communication port 1)/D8300(for the
expansion card communication port 2).. During the execution of the instruction REGW, even if the
settings of D8320/D8300 are changed, it won't take effect. Only after the instruction is enabled for
a second time, will it take effect.
● The same program can apply a lot of communication instructions upon demands, such as MCIR.
COIW, MCIW, MRGR, REGW, MRGW, and etc. After the communication of the current
instruction, the current port will be released automatically, and the next instruction will be
6-186
Chapter 6 Interpretation of Application Instructions Convenient communication
executed. After the condition of enabling the instruction is ON, the communication will be sent. If
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
Communication specification, special relay and data register used:
(The same as instruction F90)
6-187
Chapter 6 Interpretation of Application Instructions Convenient communication
6-188
Chapter 6 Interpretation of Application Instructions Convenient communication
COIW, MCIW, MRGR, REGW, MRGW, and etc. After the communication of the current
instruction, the current port will be released automatically, and the next instruction will be
executed. After the condition of enabling the instruction is ON, the communication will be sent. If
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
Communication specification, special relay and data register used:
(The same as instruction F90)
6-189
Chapter 6 Interpretation of Application Instructions Convenient communication
6-190
Chapter 6 Interpretation of Application Instructions Convenient communication
COIW, MCIW, MRGR, REGW, MRGW, and etc. After the communication of the current
instruction, the current port will be released automatically, and the next instruction will be
executed. After the condition of enabling the instruction is ON, the communication will be sent. If
you need to send the communication again, it shall turn OFF the said condition for a scan cycle,
and turn it ON again.
Communication specification, special relay and data register used:
(The same as instruction F90)
6-191
Chapter 6 Interpretation of Application Instructions FLASH read/write
FLASH read/write
Function No. Mnemonic Name Page
F100 STORE FLASH store 6-193
F101 LOAD FLASH data read 6-195
6-192
Chapter 6 Interpretation of Application Instructions FLASH read/write
STORE P S· D n
6-193
Chapter 6 Interpretation of Application Instructions FLASH read/write
6-194
Chapter 6 Interpretation of Application Instructions FLASH read/write
LOAD S D· n
X000
LOAD F90 D260 K3
After X0 is set ON, the values of F90, F91 and F92 in FLASH are stored in D260, D261 and
D262 respectively.
F90 D260
F91 D261
F92 D262
Note:Special registers F can't monitor with AP-PCLINK.
6-195
Chapter 6 Interpretation of Application Instructions Floating point operation
6-196
Chapter 6 Interpretation of Application Instructions Floating point operation
6-197
Chapter 6 Interpretation of Application Instructions Floating point operation
6-198
Chapter 6 Interpretation of Application Instructions Floating point operation
DEMOV S· D·
S· :Binary floating point data of transfer source or device number storing data
D· :Device number storing floating point data
Function Content (binary floating-point number) of the transfer source (S•+1, S•) is transferred
to (D•+1, D•).
For example:
X000
DEMOV D10 D0
(D11,D10)→(D1,D0)
In addition, a real number (E) can be also directly specified in S•.
X000
DEMOV E-1.23 D0
6-199
Chapter 6 Interpretation of Application Instructions Floating point operation
DEBCD S· D·
S· :Data source (binary floating-point number).
D· :Conversion results (decimal floating-point number).
Function Convert binary floating-point number in the element specified by the source data
into decimal floating-point number and store it in the destination address.
For example:
X000
DEBCD D50 D40
Index Mantissa
Decimal D41 D40
floating-point number
6-200
Chapter 6 Interpretation of Application Instructions Floating point operation
The decimal computation is executed based on the binary floating-point value in the PLC.
However, for the binary floating-point number, it is hard to judge other values, so it shall be
converted into decimal floating-point number by the instruction. It is easy for the peripheral
equipment to monitor.
6-201
Chapter 6 Interpretation of Application Instructions Floating point operation
Convert decimal floating-point number in the element D50 specified by the source data into
binary floating-point number and store it in D41, D40.
Index Mantissa
Decimal floating-point D51 D50
number
6-202
Chapter 6 Interpretation of Application Instructions Floating point operation
● If the number specified by S1• or S2• is constant, the instruction will convert the constant into
binary floating-point number for addition computation.
● S1• and S2• can specify the same register number. If the continuous execution instruction is
applied, the numbers will be plus in each computation cycle. Thus, under general conditions,
the pulse execution instruction DEADD P is applied.
● When the computation result is 0, the zero flag M8020=ON. There is no borrow/carry flag in the
instruction.
For example:
X000
DEADDP D50 D40 D10
(D51,D50)+(D41,D40)→(D11,D10)
When X000 is ON, the binary floating-point numbers (D51, D50) plus binary floating-point
numbers (D41, D40), the sum is stored in (D11, D10).
6-203
Chapter 6 Interpretation of Application Instructions Floating point operation
For example:
X000
DESUBP D50 D40 D10
(D51,D50)—(D41,D40)→(D11,D10)
When X000 is ON, the binary floating-point numbers (D51, D50) minus binary floating-point
numbers (D41, D40), the difference is stored in (D11, D10).
6-204
Chapter 6 Interpretation of Application Instructions Floating point operation
F Multiplication of binary
EMUL S1· S2· D·
122 D P floating-point numbers
For example:
X000
DEMULP D50 D40 D10
(D51,D50)×(D41,D40)→(D11,D10)
When X000 is ON, the binary floating-point numbers (D51, D50) multiple binary
floating-point numbers (D41, D40), the product is stored in (D11, D10).
6-205
Chapter 6 Interpretation of Application Instructions Floating point operation
For example:
X000
DEDIVP D50 D40 D10
(D51,D50)÷(D41,D40)→(D11,D10)
When X000 is ON, the binary floating-point numbers (D51, D50) divided by binary
floating-point numbers (D41, D40), the quotient is stored in (D11, D10).
6-206
Chapter 6 Interpretation of Application Instructions Floating point operation
DEXP S· D·
S· :exponent.
D· :power.
Function It makes operation by taking e(2.71828)as the base, and (S·+1,S·)as the
exponent, and then stores the result in (D·+1,D·). In addition, a real number can be also
directly specified in S•.
e(S·+1, S) → (D·+1, D·)
Error condition:
When the operation result is beyond the following range, it will lead to operation error, and
the error flag bit (M8067) is ON. The error code(K6706) is stored in D8067.
2-126≤|Operation result|<2128
For example:
X000
DEXP D10 D20
6-207
Chapter 6 Interpretation of Application Instructions Floating point operation
DLOGE S· D·
S· :Power.
D· :Exponent.
Function Natural logarithm [logarithm whose base is “e (2.71828)”] of (S•+1, S•) is calculated,
and the operation result is stored to (D•+1, D•). In addition, a real number can be also directly
specified in S•.
Only a positive value can be set in (S•+1, S•). (The natural logarithm operation cannot be
executed for a negative value.)
Error condition:
When a negative value or 0 is specified in S•, it will lead to operation error, and the error flag
bit (M8067) is ON. The error code(K6706) is stored in D8067.
For example:
X000
DLOGE D10 D20
6-208
Chapter 6 Interpretation of Application Instructions Floating point operation
DLOG10 S· D·
S· :Power.
D· :Exponent.
Function Natural logarithm [logarithm whose base is 10] of (S•+1, S•) is calculated, and the
operation result is stored to (D•+1, D•). In addition, a real number can be also directly specified in
S•.
Only a positive value can be set in (S•+1, S•). (The natural logarithm operation cannot be
executed for a negative value.)
Error condition:
When a negative value or 0 is specified in S•, it will lead to operation error, and the error flag
bit (M8067) is ON. The error code(K6706) is stored in D8067.
For example:
X000
DLOG10 D10 D20
6-209
Chapter 6 Interpretation of Application Instructions Floating point operation
DESQR S· D·
S· :Source element to be executed with square root(It is only valid for positive numbers. For the
negative numbers, it is regarded as computation error, and M8067is ON).
D· :Square root.
Function Square root is executed for numbers on the register specified by S•, and the square
root is stored in the register specified by D•. The square root computation is executed with binary
floating-point numbers.
If the number specified by S• is constant, the instruction will convert the constant into
binary floating-point number for square root computation.
For example:
X000
DESQR D50 D40
When X000=ON, the binary floating-point numbers (D51, D50)are conducted with square
root, and the square root is stored in (D41, D40).
6-210
Chapter 6 Interpretation of Application Instructions Floating point operation
DENEG D·
D· :Start device number of the element storing binary floating data to be executed with NEG
computation.
Function The sign of binary floating-point data stored in (D•+1, D•) is inverted, and the result
is stored to (D•+1, D•).
For example:
M0
DENEGP D10
(D11,
(D11,D10) →
D10)
1.2345 → ﹣1.2345
6-211
Chapter 6 Interpretation of Application Instructions Floating point operation
INT S· D·
S· :Source to be converted.
D· :Conversion result.
Function The register content specified by S• is converted into BIN integral with the form of
binary floating-point number, which is then temporarily stored in the register specified by D•, with
the decimal of BIN integer ignored.
Action of the instruction is opposite with the instruction F49 FLT.
When the conversion result is 0, the zero flag M8020=ON. If the decimal point is ignored in
the conversion result, the borrowing symbol M8021=ON.
If the conversion result is beyond the following range, the carrying symbol M8022=ON.
16-bit instruction:﹣32,768~32,767
32-bit instruction:﹣2,147,483,648~2,147,483,647
For example:
X000
INT D0 D10
X001
DINT D20 D30
When X000=ON, the binary decimals(D1, D0)are converted into BIN integer, the result is
stored in D10, with the decimal of the BIN integer ignored.
When X001=ON, the binary decimals(D21, D20)are converted into BIN integer, the result is
stored in (D31, D30), with the decimal of the BIN integer ignored.
6-212
Chapter 6 Interpretation of Application Instructions Floating point operation
DSIN S· D·
S· :Specified RAD value.
D· :Computation result of SINE.
Function RAD value specified by S• is equal to (angle×π/180), and SIN value is obtained and
stored in register specified by D•.
The result range: ﹣1≤D·≤1
For example:
X000
DSIN D10 D20
6-213
Chapter 6 Interpretation of Application Instructions Floating point operation
DCOS S· D·
S· :Specified RAD value.
D· :Computation result of COSINE.
Function RAD value specified by S• is equal to (angle×π/180), and COS value is obtained and
stored in register specified by D•.
The result range: ﹣1≤D·≤1
For example:
X000
DCOS D10 D20
6-214
Chapter 6 Interpretation of Application Instructions Floating point operation
DTAN S· D·
S· :Specified RAD value.
D· :Computation result of ANBENT.
Function RAD value specified by S• is equal to (angle×π/180), and TAN value is obtained and
stored in register specified by D•.
For example:
X000
DTAN D10 D20
6-215
Chapter 6 Interpretation of Application Instructions Floating point operation
DASIN S· D·
S· :Specify data source of ASIN.
D· :Computation result of ARCSINE.
Function Content ARC SIN (inverse function of SIN) specified by S. is stored in D. as binary
floating-point number.
Range of input data ﹣1≤S·≤1
source: ﹣π/2≤D·≤π/2
Result range:
For example:
X000
DASIN D10 D20
6-216
Chapter 6 Interpretation of Application Instructions Floating point operation
DACOS S· D·
S· :Specify ACOS data source.
D· :Computation result of ARCCOSINE.
Function Content ARC COS (inverse function of COS) specified by S. is stored in D. as
binary floating-point number.
Range of input data ﹣1≤S·≤1
source: 0≤D·≤π
Result range:
For example:
X000
DACOS D10 D20
6-217
Chapter 6 Interpretation of Application Instructions Floating point operation
DATAN S· D·
S· :Specify ATAN data source.
D· :Computation result of ARCTANGEBT.
Function Content ARC TAN (inverse function of TAN) specified by S. is stored in D. as
binary floating-point number.
Result range: ﹣π/2<D·<π/2
For example:
X000
DATAN D10 D20
6-218
Chapter 6 Interpretation of Application Instructions Floating point operation
DRAD S· D·
S· :Data source.
D· :Computation result.
S. and D. are in the form of binary floating-point.
Function The instruction realizes conversion from degree into radian.
For example:
X000
DRAD D10 D20
6-219
Chapter 6 Interpretation of Application Instructions Floating point operation
DDEG S· D·
S· :Data source.
D· :Computation result.
S. and D. are in the form of binary floating-point.
Function The instruction realizes conversion from radian into degree
For example:
X000
DDEG D10 D20
6-220
Chapter 6 Interpretation of Application Instructions Float to scientific
6-221
Chapter 6 Interpretation of Application Instructions Float to scientific
SWAP S·
S· :The unit to be executed with upper and lower 8-bit exchange.
Function The instruction is to exchange the high and low bits of the data.
For example:
X000
SWAPP D10
For 16-bit instruction, the high 8-bit is exchanged with the high 8-bit.
D10
High 8-bit Low 8-bit
X000
DSWAPP D10
For 32-bit instruction, each high 8-bit is exchanged with the high 8-bit.
D11 D10
High 8-bit Low 8-bit High 8-bit Low 8-bit
Note:When the instruction is executed as continuous execution type, the exchange will be
performed in each computation cycle.
The instruction has the same function as the expansion function of F17 XCH.
6-222
Chapter 6 Interpretation of Application Instructions Locating
Locating
Function No. Mnemonic Name Page
F156 ZRN Origin return 6-224
F157 PLSV Pulse V 6-227
F158 DRVI Drive to increment 6-229
F159 DRVA Drive to absolute 6-233
6-223
Chapter 6 Interpretation of Application Instructions Locating
6-224
Chapter 6 Interpretation of Application Instructions Locating
M8029
ON
Mark of executing pulse
OFF
output
6-225
Chapter 6 Interpretation of Application Instructions Locating
③ When DOG signal becomes OFF from ON, and the pulse output is stops, it writes 0 into
the current value register. In addition, when output flag of reset signal M8140 is ON, the reset
signal is output to servo driver simultaneously. After that, when the finishing flag sign (M8029)
acts, the pulse output monitors become OFF.
《Notes》
For it does not have the function of DOG searching, the origin return action shall be started
from the front end of the DOG signal.
In origin return, the values of current value registers(Y000:[D8141,D8140],Y001:
[D8143,D8142],Y002:[D8191,D8190],Y003:[D8201,D8200]) will be decreased.
6-226
Chapter 6 Interpretation of Application Instructions Locating
6-227
Chapter 6 Interpretation of Application Instructions Locating
6-228
Chapter 6 Interpretation of Application Instructions Locating
6-229
Chapter 6 Interpretation of Application Instructions Locating
Speed
Acceleration Deceleration
time time
Max speed
Base speed
Instruction Time
execution
Finishing of instruction
execution M8029
The relative location corresponding to the output pulse number S1. is stated as below:
Output to Y000: [D8141(High bit), D8140(Low bit)] (32-bit is used)
Output to Y001: [D8143(High bit), D8142(Low bit)] (32-bit is used)
Output to Y002: [D8191(High bit), D8190(Low bit)] (32-bit is used)
Output to Y003: [D8201(High bit), D8200(Low bit)] (32-bit is used)
When it rotates oppositely, the content of current value register will be decreased.
During the instruction executing, even if content of the operand is changed, it can not be
reflected to current operation . And it will take affect in the next instruction driving.
During instruction executing, when the instruction driving contact is OFF, it stops
deceleration. At this time, the finishing flag sign M8029 does not act.
The so-called absolute control means taking the current location as basic point, moving with
a certain pulse number with rotation direction.
6-230
Chapter 6 Interpretation of Application Instructions Locating
6-231
Chapter 6 Interpretation of Application Instructions Locating
● D8205: When the channel Y3 is selected, it indicates the base speed, which is used to
restrict the minimum value of the pulse speed. The factory setting value of D8205 is 500.
● D8148:For AP200, when the channel Y0,Y1 is selected, it indicates the time of
accelerating from the base speed to the maximum speed. For AP300, when the channel Y0 is
selected, it indicates the time of accelerating from the base speed to the maximum speed. The
factory setting value of D8148 is 100.
● D8168:For AP300, when the channel Y1 is selected, it indicates the time of accelerating
from the base speed to the maximum speed. For AP200, the acceleration parameters of
channel Y1 and Y0 of AP200 share the same registers. The factory setting value of D8168 is
100.
● D8198:When the channel Y2 is selected, it indicates the time of accelerating from the
base speed to the maximum speed. The factory setting value of D8168 is 100.
● D8208:When the channel Y3 is selected, it indicates the time of accelerating from the
base speed to the maximum speed. The factory setting value of D8208 is 100.
● D8157:For AP300, when the channel Y0 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8157 is 100.
● D8169:For AP300, when the channel Y1 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8169 is 100.
● D8199:For AP300, when the channel Y2 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8199 is 100.
● D8209:For AP300, when the channel Y3 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The default value of D8209 is 100.
6-232
Chapter 6 Interpretation of Application Instructions Locating
6-233
Chapter 6 Interpretation of Application Instructions Locating
Speed
Acceleration Deceleration
time time
Max speed
Base speed
Instruction Time
execution
Finishing of instruction
execution M8029
The relative location corresponding to the output pulse number S1. is stated as below:
Output to Y000: [D8141(High bit), D8140(Low bit)] (32-bit is used)
Output to Y001: [D8143(High bit), D8142(Low bit)] (32-bit is used)
Output to Y002: [D8191(High bit), D8190(Low bit)] (32-bit is used)
Output to Y003: [D8201(High bit), D8200(Low bit)] (32-bit is used)
When it rotates oppositely, the content of current value register will be decreased.
During the instruction executing, even if content of the operand is changed, it can not be
reflected to current operation . And it will take affect in the next instruction driving.
During instruction executing, when the instruction driving contact is OFF, it stops
deceleration. At this time, the finishing flag sign M8029 does not act.
The so-called absolute control means taking the current location as basic point, moving with
a certain pulse number with rotation direction.
6-234
Chapter 6 Interpretation of Application Instructions Locating
6-235
Chapter 6 Interpretation of Application Instructions Locating
● D8205: When the channel Y3 is selected, it indicates the base speed, which is used to
restrict the minimum value of the pulse speed. The factory setting value of D8205 is 500.
● D8148:For AP200, when the channel Y0,Y1 is selected, it indicates the time of
accelerating from the base speed to the maximum speed. For AP300, when the channel Y0 is
selected, it indicates the time of accelerating from the base speed to the maximum speed. The
factory setting value of D8148 is 100.
● D8168:For AP300, when the channel Y1 is selected, it indicates the time of accelerating
from the base speed to the maximum speed. For AP200, the acceleration parameters of
channel Y1 and Y0 of AP200 share the same registers. The factory setting value of D8168
is 100.
● D8198:When the channel Y2 is selected, it indicates the time of accelerating from the
base speed to the maximum speed. The factory setting value of D8198 is 100.
● D8208:When the channel Y3 is selected, it indicates the time of accelerating from the
base speed to the maximum speed. The factory setting value of D8208 is 100.
● D8157:For AP300, when the channel Y0 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8157 is 100.
● D8169:For AP300, when the channel Y1 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8169 is 100.
● D8199:For AP300, when the channel Y2 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8199 is 100.
● D8209:For AP300, when the channel Y3 is selected, it indicates the time of decelerating
from the base speed to the maximum speed. The factory setting value of D8209 is 100.
6-236
Chapter 6 Interpretation of Application Instructions Time computation
Time computation
Function No. Mnemonic Name Page
F160 TCMP Time compare 6-238
F161 TZCP Time zone compare 6-239
F162 TADD Time addition 6-240
F163 TSUB Time subtraction 6-241
F166 TRD Read time 6-242
F167 TWR Write clock data 6-243
6-237
Chapter 6 Interpretation of Application Instructions Time computation
6-238
Chapter 6 Interpretation of Application Instructions Time computation
6-239
Chapter 6 Interpretation of Application Instructions Time computation
For example:
X000
TADD D10 D20 D30
D10 10(H) D20 03(H) D30 13(H)
D11 30(M) D21 10(M) D31 40(M)
D12 10(S) D22 05(S) D32 15(S)
10H30M10S 03H10M05S 13H40M05S
● If the addition result is equal to or over 24H, the carrying flag M8022=ON. The computation
result minus 24H, and the final result is obtained and stored.
For example:
6-240
Chapter 6 Interpretation of Application Instructions Time computation
For example:
X 000
TSU B D10 D 20 D 30
D 1 0 1 0 (H ) D 2 0 0 3 (H ) D 3 0 0 7 (H )
D 1 1 3 0 (M ) D 2 1 1 0 (M ) D 3 1 2 0 (M )
D 1 2 1 0 (S ) D 2 2 0 5 (S ) D 3 2 0 5 (S )
10H 30M 10S 03H 10M 05S 07H 20M 05S
● If the subtraction result is equal to or over 24H, the carrying flag M8021=ON. The computation
result plus 24H, and the final result is obtained and stored.
For example:
6-241
Chapter 6 Interpretation of Application Instructions Time computation
TRD D·
D· : Start device storing the readout value of current time of the RTC, occupying continuous 7
points
Function The instruction reads the real-time clock data in the special registers D8013~D8019 of
the PLC, and stores the results in the 7-point data register started with the destination operand D.
For example:
X000
TRD D0
Read real-time clock data of the controller according to the following format. The reading
source is the special data registers (D8013~D8019)for storing the clock data.
6-242
Chapter 6 Interpretation of Application Instructions Time computation
TWR S·
S· :Start device to store the new setting value of the RTC.
Function The instruction is the inverse computation of the instruction TRD, which is to write
the clock data in the RTC of PLC.
For example:
X000
TWRP D10
● Write data for setting clock into the RTC of the controller. To write clock data, 7-point element
started with element address numbers specified by S• must be specified in advance.
● When the setting value is beyond the range specified in the table below, D8067 = 6706, and the
instruction won't be executed.
6-243
Chapter 6 Interpretation of Application Instructions Peripheral devices
Peripheral devices
Function No. Mnemonic Name Page
F170 GRY Binary→Gray code 6-245
F171 GBIN Gray→Binary code 6-246
6-244
Chapter 6 Interpretation of Application Instructions Peripheral devices
GRY S· D·
S· :Source device.
D· :Device for storing gray code
Function The instruction is used to convert the binary numbers in S· into gray code and send
them to the destination device D·.
When the absolute rotary coder is used to convert the binary numbers into gray code in the
control system, the instruction GRY shall be applied.
For example:
X000
GRY K1234 K3Y010
b15 b0
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
6-245
Chapter 6 Interpretation of Application Instructions Peripheral devices
GBIN S· D·
S· :Source device.
D· :Device for storing reverse conversion of gray code.
Function Reverse conversion to BIN value is executed for the gray code specified device by
S•, and the result is stored in device specified by D•.
For example:
X000
GBIN K3X000 D10
X13 X10 X7 X0
GRY 1234 0 1 1 0 1 0 1 1 1 0 1 1
b15 b0
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
● The instruction that converts gray code to BIN data and sends the data.
● 32-bit gray code reverse conversion can be executed in maximum.
● As for values of S•, it is only valid in the following range. 16-bit computation: 0~32,767;
32-bit computation: 0~2,147,483,647.
6-246
Chapter 6 Interpretation of Application Instructions Peripheral communication
Peripheral communication
Function No. Mnemonic Name Page
F188 CRC Cyclical redundancy check 6-248
F191 RMIO Remote I/O connection 6-251
F193 DTLK2 Data link 2 6-259
6-247
Chapter 6 Interpretation of Application Instructions Peripheral communication
CRC S· D· n·
S· :Start device of data.
D· :Location for storing the generated CRC value.
n· :Number of data points.
Function It generates CRC value for the n. points of 8-bit data (in bytes) started with the
device specified by S·, and stores the result in D.
The instruction supports 8-bit and 16-bit conversion modes, which are switched based on
M8161 ON/OFF.
To generate CRC values, the polynomial expression [X16+X15+X2+X1] is used. Besides, for
CRC value, there are various standardized polynomial expressions. Please note that if different
polynomial expressions are used, it will generate totally different CRC values.
《Related elements》
Device Content Remark
[M8161] ON CRC acts under 8-bit mode. It is reset when STOP→RUN.
OFF CRC acts under 16-bit mode.
6-248
Chapter 6 Interpretation of Application Instructions Peripheral communication
When S·=D100,D·=D0,n·=6:
Object data
Device
8-bit 16-bit
Low byte D100 low byte 01H
S· 0101H
High byte D100 high byte 01H
Low byte D101 low byte 03H
S·+1 CD03H
High byte D101 high byte CDH
Address for storing
Low byte D102 low byte 6BH
the object data of S·+2 056BH
High byte D102 high byte 05H
CRC value
——
Low byte
S·+n/2-1 ——
High byte
Address for storing Low byte D0 low byte 42H
D· 8242H
CRC value High byte D0 high byte 82H
6-249
Chapter 6 Interpretation of Application Instructions Peripheral communication
When S·=D100,D·=D0,n·=6:
Object data
Device
content
S· Low byte D100 low byte 01H
S·+1 Low byte D101 low byte 01H
S·+2 Low byte D102 low byte 03H
Address for storing S·+3 Low byte D103 low byte CDH
the object data of S·+4 Low byte D104 low byte 6BH
CRC value S·+5 Low byte D105 low byte 05H
——
6-250
Chapter 6 Interpretation of Application Instructions Peripheral communication
RMIO K
K :Serial port selection, constant 0~2.
0:RS485 communication port; 1:RS485 or RS232 expansion card communication port 1;
2:RS485 or RS232 expansion card communication port 2. (Only K of AP360 series can be 0, 1
or 2, which is 0 or 1 for other AP series.)
Function AP series adopts the mode to increase the I/O points of the master. The master of AP
series can communicate with 4 AP slaves in maximum.
Note:1. When 2 or 3 communication ports are ready for RMIO simultaneously, the firstly
enabled one will take the priority. Communication frame and baud rate are set through
D8120(RS485 communication port), D8320(expansion card communication port 1),
D8300(expansion card communication port 2), which is controlled by the serial port. Even if the
setting of D8120 is changed during the operation, it won't take effect until the instruction is
enabled once again.
2. When AP series is taken as the slave under remote I/O mode, it can be only used for the
expansion I/O function of the master, which can only operate the instruction RMIO, but can't
execute other user programs.
3. When AP series is enabled as the slave of remote I/O mode, you can only switch it to
other mode by stopping the program operation.
In the remote I/O mode, the master of AP series can communicate with 4 slaves under the same
series in maximum.
R R
D+ D- S D+ D- S D+ D- S D+ D- S D+ D- S
6-251
Chapter 6 Interpretation of Application Instructions Peripheral communication
Item Description
Communication
EIA RS-485
standards
Baud rate 4800bps~500000bps
Number of slaves 4 slaves in maximum
Slave 1 Input: 36 points(M1200~M1235);Output: 24points(M1440~M1463)
Remote I/O zone Slave 2 Input: 36 points(M1240~M1275);Output: 24points(M1464~M1487)
(set up by master) Slave 3 Input: 36 points(M1280~M1315);Output: 24points(M1488~M1511)
Slave 4 Input: 36 points(M1320~M1355);Output: 24points(M1512~M1535)
Cable Insulated twisted cable, collinearity, 2 lines type, total length: 1km(38400bit/s)
RS485/ RS232 expansion card communication port 1/2 (all type is available for expansion),
and RS485 communication port are available for remote I/O communication. However, they can
not be enabled simultaneously.
Note:The remote slave must be the basic unit of AP, which can't be the expansion module or
other module.
6-252
Chapter 6 Interpretation of Application Instructions Peripheral communication
2) Data register D
Response
Data Register Feature Name Description
form
Read Master/Slav
D8373 Station number Slave the local station number
only e
Read Master/Slav
D8374 Total slave number Save the total slave number
only e
Master/Slav
D8376 Write Set station number Slave the local station number
e
D8377 Write Set total slave number Set the total slave number Master
Read/W
D8379 Set retry times Set retry times Master
rite
Read/W Set communication Master/Slav
D8380 Set communication timeout
rite timeout e
Read Store current network scan
D8331 Current network scan time Master
only time
Read Maximum network scan Store maximum network scan
D8332 Master
only time time
Read Communication error Communication error count
D8333 Slave
only counting of master of master
Read Communication error Communication error count Master/Slav
D8334
only count of slave 1 of slave 1 e
Read Communication error Communication error count Master/Slav
D8335
only count of slave 2 of slave 2 e
Read Communication error Communication error count Master/Slav
D8336
only count of slave 3 of slave 3 e
Read Communication error Communication error count Master/Slav
D8337
only count of slave 4 of slave 4 e
Read Communication error code Communication error code of
D8338 Slave
only of master master
Read Communication error code Communication error code of Master/Slav
D8339
only of slave 1 slave 1 e
Read Communication error code Communication error code of Master/Slav
D8340
only of slave 2 slave 2 e
Read Communication error code Communication error code of Master/Slav
D8341
only of slave 3 slave 3 e
6-253
Chapter 6 Interpretation of Application Instructions Peripheral communication
Response
Data Register Feature Name Description
form
Read Communication error code Communication error code of Master/Slav
D8342
only of slave 4 slave 4 e
Setting
When the program is in operation, or AP is power ON, all the setting for remote I/O will take
effect.
1) Set station number (D8376)
The setting range is 0~4. 0 indicates the master, while 1~4 indicate the slave 1~4. Even if the
station number is changed during the operation, it won't take effect until the instruction is
enabled once again.
2) Set the slave number (D8377)
The setting range is 0~4. When the setting value is beyond the range, it will be 4 by default.
The setting is not required for the slave. User shall set the slave number upon actual demands, so
as to increase the communication efficiency and data refresh speed.
3) Set retry times(D8379)
The setting range is 0~50. When the setting value is beyond the range, it will be 2 by default.
That is, it will retry twice in case of communication error, and the communication instruction shall
be sent for third times. The setting is not required for the slave.
4) Set communication timeout period (D8380)
Communication timeout period=(D8380×10)ms. The setting range is 50~2550ms. That is,
the setting range for D8380 is 5~255. When the setting value is beyond the range, it will be 5 by
default. In this case, the default communication timeout period is 50ms.
The corresponding devices used for the communication
The remote I/O zone of the master is composed of:
Master Slave 1
Input M1200~M1235 X000~X043
Slave 1
Output M1440~M1463 Y000~Y027 Slave 2
Input M1240~M1275 X000~X043
Slave 2
Output M1464~M1487 Y000~Y027 Slave 3
Input M1280~M1315 X000~X043
Slave 3
Output M1488~M1511 Y000~Y027 Slave 4
Input M1320~M1355 X000~X043
Slave 4
Output M1512~M1535 Y000~Y027
Wiring method
6-254
Chapter 6 Interpretation of Application Instructions Peripheral communication
RS485—RS232
converter
R R
D+ D- S D+ D- S D+ D- S D+ D- S
Note:1. For SHLD shielding layer, please use class-3 grounding. Otherwise, the noise will cause
wrong operation.
2. Branches of communication cable should not exceed 3.
3. R represents the resistor of the communication terminal, with the spec of 120Ω,1/4W.
A co m m u n ication cy cle T
Communication sequence
The communication between the master and the slaves, the data exchange of remote I/O and
the update of communication flag are synchronous with the scan cycle of the slave. The processing
time (1 communication cycle) will increase the scan time of the master.
When there is error in communication between master and slaves, Remote I/O
communication and PLC operation will stop and enter error status.
6-255
Chapter 6 Interpretation of Application Instructions Peripheral communication
A scan cycle
Data exchange
Data exchange Data not
Communication
Communication mark update exchange
mark update
PLC scan time of slave I/O I/O I/O
Master Master
6-256
Chapter 6 Interpretation of Application Instructions Peripheral communication
X010
M1440
X000
RMIO K0
T1 T2 T3
As T1: delay for input terminal (response time for OFF to ON)
shown T2: time for master writing data to coil register (max scan
in the time)
figure: T3: program operation and output time
T4: time between the slave received data to output port
T5: delay for output terminal(response time for OFF to
ON)
Error code
When there is communication error, the special reference coils M8336~M8340 will indicate
the error status and the error code will be stored in special data registers (D8338~D8342).
Error Check
Error Error Description Check point
station station
There is no response
Check the wiring, and
Communicatio as the master sends the
01H L M run/stop status of the
n timeout error request to slave and it
power supply.
timesout.
The station number
Station doesn't comply with
02H L M Check the wiring
number error the relation between
the master and the
6-257
Chapter 6 Interpretation of Application Instructions Peripheral communication
slaves.
Communicatio Network Check the wiring and
03H n instruction L M communication the network
error instruction error configuration
Communication Check the wiring and
Communicatio
04H L M format for the slave the resource setting of
n format error
is incorrect RMIO.
After the slave
responds to the master, Check the wiring, and
Communicatio
11H M L the master does not run/stop status of the
n timeout error
send another request to power supply.
the next slaver.
Communicatio Network Check the wiring and
13H n instruction M L communication the network
error instruction error configuration
Communication Check the wiring and
Communicatio
14H M L format of the master the resource setting of
n format error
is incorrect RMIO.
M:master; L:slave.
6-258
Chapter 6 Interpretation of Application Instructions Peripheral communication
Specification
Baud rate EIA RS-485
Baud rate 4800bps~500000bps
Number of slaves 15 slaves in maximum
The start address in the range of D0~D7999 and W0~W32767 are set by
Linked zone
instruction DTLK2.
Data length for The maximum data length is 40 words, which can be set by instruction
each slave DTLK2
Cable Insulated twisted cable, collinearity, 2 lines type, total length: 1km
6-259
Chapter 6 Interpretation of Application Instructions Peripheral communication
(38400bit/s)
Wiring method
R R
D+ D- S D+ D- S D+ D- S D+ D- S
Note:1. For SHLD terminal, please use class-3 grounding. Otherwise, the noise will cause wrong
operation.
2. Branches of communication cable should not exceed 3.
3. R represents the resistor of the communication terminal, with the spec of 120Ω,1/4W.
○ ×
Connector
Connectio connection
n terminal
6-260
Chapter 6 Interpretation of Application Instructions Peripheral communication
of Data Link 2.
It is ON when the built-in
Read Master/Sl
M8418 Data Link2 mode communication port is in operation of
only ave
Data Link 2.
It is ON when the expansion
Read Master/Sl
M8419 Data Link2 mode communication port 2 is in operation
only ave
of Data Link 2.
6-261
Chapter 6 Interpretation of Application Instructions Peripheral communication
2) Data Register
Data Response
Feature Name Description
Register form
Read
D8173 Station number Slave the local station number Master/Slave
only
Read
D8174 Total slave number Save the total slave number Master/Slave
only
D8175 Reserved
D8176 Write Set station number Slave the local station number Master/Slave
D8177 Write Set total slave number Set the total slave number Master
D8178 Reserved
Read/
D8179 Set retry times Set retry times Master
Write
Read/
D8180 Set communication timeout Set communication timeout Master
Write
Read
D8401 Current network scan time Store current network scan time Master/Slave
only
Read
D8402 Maximum network scan time Store maximum network scan time Master/Slave
only
Read Communication error Communication error count of
D8403 Slave
only counting of master master
Read Communication error count of Communication error count of slave
D8404 Master/Slave
only slave 1 1
Read Communication error count of Communication error count of slave
D8405 Master/Slave
only slave 2 2
: : : : :
Read Communication error count of Communication error count of slave
D8411 Master/Slave
only slave 8 8
: : : : :
Read Communication error count of Communication error count of slave
D8417 Master/Slave
only slave 14 14
Read Communication error count of Communication error count of slave
D8418 Master/Slave
only slave 15 15
Read Communication error code of
D8419 Communication error code of master Slave
only master
D8420 Read Communication error code of Communication error code of slave Master/Slave
6-262
Chapter 6 Interpretation of Application Instructions Peripheral communication
Data Response
Feature Name Description
Register form
only slave 1 1
Read Communication error code of Communication error code of slave
D8421 Master/Slave
only slave 2 2
: : : : :
Read Communication error code of Communication error code of slave
D8427 Master/Slave
only slave 8 8
: : : : :
Read Communication error code of Communication error code of slave
D8433 Master/Slave
only slave 14 14
Read Communication error code of Communication error code of slave
D8434 Master/Slave
only slave 15 15
Setting
When the program is in operation, or AP is power ON, all the setting for Data Link2 will take
effect.
1) Set station number (D8176)
Set 0~15 to the special data register D8176. 0 is the master number, while 1~15 indicate the
slave 1~15.
2) Set the slave number (D8177)
Set 0~15 to the special data register D8177, which indicates the total number of slaves(7 by
default). The setting is not required for the slave. User shall set the slave number upon actual
demands, so as to increase the data refresh speed.
3) Set retry times(D8179)
Set 0~10 to the special data register D8179(3 by default). The setting is not required for the
slave.If a master tries to communicate with the slaves based on the retry times, it will be
communication error on the slave.
4) Set communication timeout period (D8180)
Set 0~10 to the special data register D8180(5 by default). The product of the value and 10 is
the communication timeout period (ms).
5) Current network scan time (D8401)
It is the time taken by the network scanning of the current Data Link2. The product of such
value and 10 is the current communication scan time (ms).
6) Maximum network scan time (D8402)
6-263
Chapter 6 Interpretation of Application Instructions Peripheral communication
X000
MOV K0 D8176 Slave ID setting: 0~15
MOV K2 D8177 Total number of slaves: 2(1~15) The settings
are not
MOV K3 D8179 Retry times setting: 3
required for
Communication overtime
MOV K6 D8180 slave
setting: 6(60ms)
X001
DTLK2 D0 K5 K0
Error code
When there is communication error, the special reference coils M8400~M8415 will indicate
the error status and the error code will be stored in special data registers (D8419~D8434).
Error Check
Error Error Description Check point
station station
There is no response as
Communica Check the wiring,
the master sends the
01H tion timeout L M and run/stop status
request to slave and it
Error of the power supply.
times out.
The station number
Station
doesn't comply with the
02H number L M Check the wiring
relation between the
Error
master and the slaves.
The communication
Communica counter doesn't comply
03H tion counter L M with the relation between Check the wiring
error the master and the
slaves.
Communica Communication format Check the wiring
04H tion format L M,L for the slave and the resource
Error is incorrect settings of DTLK2.
After the slave responds
Communica to the master, the master Check the wiring,
11H tion timeout M L does not send and run/stop status
Error anotherrequest to the of the power supply.
next slaver.
Communica Communication format Check the wiring
14H tion format M L of the master and the resource
Error is incorrect settings of DTLK2.
6-264
Chapter 6 Interpretation of Application Instructions Peripheral communication
Error Check
Error Error Description Check point
station station
The station number in
Without Check the setting of
21(H) L L*1 the network
slave station number
is incorrect
The station number
Station
doesn't comply with the
22(H) number L L*1 Check the wiring
relation between the
Error
master and the slaves.
The communication
Communica counter doesn't comply
*1
23(H) tion counter L L with the relation between Check the wiring
error the master and the
slaves.
Without The slave receives the
communicat request from the master Check the wiring,
31(H) ion L L*2 before the low power,
parameter communication run/stop status.
received parameters are set.
Network communication Check the network
32(H) Other errors L L*1
instruction error settings
Length or address Check the wiring
Data length
parameter of the and the resource
33(H) or address L L*1
communication settings of
error DTLK2.
instruction data is wrong
M:Master;L:Slave;L*1:Another slave;L*2:Independent station.
6-265
Chapter 6 Interpretation of Application Instructions Pulse output
Pulse output
Function No. Mnemonic Name Page
F200 PPMI Dual-axis relative point-to-point movement 6-267
F201 PPMA Dual-axis absolute point-to-point movement 6-270
F202 CWI Dual-axis relative circular interpolation 6-273
F203 CWA Dual-axis absolute circular interpolation 6-275
F204 PTPO Single-axis pulse output by table 6-278
F205 CLLM Closed loop locating management 6-281
F206 VSPO Pulse with variable speed 6-287
F207 ICF Change frequency immediately 6-291
F208 CSFO Cut speed and follow output 6-293
F209 SLCH Select channel 6-295
F210 LINI Tri-axis absolute linear interpolation 6-296
F211 LINA Tri-axis absolute linear interpolation 6-299
F212 CIMI Dual-axis relative oval interpolation 6-302
F213 CIMA Dual-axis absolute oval interpolation 6-305
6-266
Chapter 6 Interpretation of Application Instructions Pulse output
6-267
Chapter 6 Interpretation of Application Instructions Pulse output
5. When channel Y0, Y1 are selected, D8145 is for setting the start/end frequency of point-to-point
movement, while D8148 is for setting the acceleration time for the dual-axis movement, and
D8157 is for setting the deceleration time for the dual-axis movement(When the deceleration time
is equal to the acceleration time in AP200, the value of D8148 will be used). When channel Y2,
Y3 are selected, D8195 is for setting the the start/end frequency of point-to-point movement,
while D8198 is for setting the acceleration time for the dual-axis movement , and D8199 is for
setting the deceleration time for the dual-axis movement .
The setting of the acceleration/deceleration time can't be lower than 30ms. The value lower than
30ms will be set as 30ms. The factory default value is 100ms.
6. When channel Y0, Y1 are selected, the maximum output frequency is set through
(D8147,D8146). When channel Y2, Y3 are selected, the maximum output frequency is set
through (D8197,D8196). The maximum output frequency lower than 100Hz will be set as 100Hz,
and the frequency larger than 200Hz will be set as 200Hz.
7. When the instruction of dual-axis synchronous movement is enabled, it doesn't support
immediately stop flag to stop the pulse output. The immediately stop flag of channel Y0 is M8145,
which is M8146 for Y1, M8155 for Y2 and M8156 for Y3. To stop pulse output immediately,
please shut down the condition contact.
8. There is no restriction set on the using times of the instruction. However, if the output of
Y-axis(Y1) is in use, it will fail to output for X and Y axis.
9. When the dual-axis output is finished, it will be indicated by setting M8029=ON.
6-268
Chapter 6 Interpretation of Application Instructions Pulse output
and the current value will be increased or decreased according to the output direction,
D81413(High bit), D8142(Low bit).
● D8190, D8191: The current value register of the pulse output Y2 of dual-axis movement,
and the current value will be increased or decreased according to the output direction,
D8191(High bit), D8190(Low bit).
● D8200, D8201: The current value register of the pulse output Y3 of dual-axis movement,
and the current value will be increased or decreased according to the output direction,
D820(High bit), D8200(Low bit).
● D8146, D8147:When the channel Y0,Y1 are selected, it indicates the maximum speed
of PPMI and PPMA, which is used to restrict the maximum value of the linear speed.
● D8196, D8197:When the channel Y2,Y3 are selected, it indicates the maximum speed
of PPMI and PPMA, which is used to restrict the maximum value of the linear speed.
● D8145:When the channel Y0,Y1 are selected, it indicates the base speed of PPMI and
PPMA, which is used to restrict the minimum value of the linear speed.
● D8195:When the channel Y2,Y3 are selected, it indicates the base speed of PPMI and
PPMA, which is used to restrict the minimum value of the linear speed.
● D8148:When the channel Y0,Y1 are selected, it indicates the acceleration time of linear
movement (The time taken when accelerating from the base speed to the maximum speed,
while the actual acceleration time is determined by the value of S3. in proportion).
● D8157:When the channel Y0,Y1 are selected, it indicates the deceleration time of linear
movement (The time taken when decelerating from the maximum speed to the base speed,
while the actual deceleration time is determined by the value of S3. in proportion). AP300
supports the separation of acceleration and deceleration time, which this function is not
supported by AP200, which uses the value of D8148 for both.
● D8198:When the channel Y2,Y3 are selected, it indicates the acceleration time of linear
movement (The time taken when accelerating from the base speed to the maximum speed,
while the actual acceleration time is determined by the value of S3. in proportion).
● D8199:When the channel Y2,Y3 are selected, it indicates the deceleration time of linear
movement (The time taken when decelerating from the maximum speed to the base speed,
while the actual deceleration time is determined by the value of S3. in proportion).
6-269
Chapter 6 Interpretation of Application Instructions Pulse output
6-270
Chapter 6 Interpretation of Application Instructions Pulse output
6-271
Chapter 6 Interpretation of Application Instructions Pulse output
● D8142, D8143: The current value register of the pulse output Y1 of dual-axis movement,
and the current value will be increased or decreased according to the output direction,
D81413(High bit), D8142(Low bit).
● D8190, D8191: The current value register of the pulse output Y2 of dual-axis movement,
and the current value will be increased or decreased according to the output direction,
D8191(High bit), D8190(Low bit).
● D8200, D8201: The current value register of the pulse output Y3 of dual-axis movement,
and the current value will be increased or decreased according to the output direction,
D820(High bit), D8200(Low bit).
● D8146, D8147:When the channel Y0,Y1 are selected, it indicates the maximum speed
of PPMI and PPMA, which is used to restrict the maximum value of the linear speed.
● D8196, D8197:When the channel Y2,Y3 are selected, it indicates the maximum speed
of PPMI and PPMA, which is used to restrict the maximum value of the linear speed.
● D8145:When the channel Y0,Y1 are selected, it indicates the base speed of PPMI and
PPMA, which is used to restrict the minimum value of the linear speed.
● D8195:When the channel Y2,Y3 are selected, it indicates the base speed of PPMI and
PPMA, which is used to restrict the minimum value of the linear speed.
● D8148:When the channel Y0,Y1 are selected, it indicates the acceleration time of linear
movement (The time taken when accelerating from the base speed to the maximum speed,
while the actual acceleration time is determined by the value of S3. in proportion).
● D8157:When the channel Y0,Y1 are selected, it indicates the deceleration time of linear
movement (The time taken when decelerating from the maximum speed to the base speed,
while the actual deceleration time is determined by the value of S3. in proportion). AP300
supports the separation of acceleration and deceleration time, which this function is not
supported by AP200, which uses the value of D8148 for both.
● D8198:When the channel Y2,Y3 are selected, it indicates the acceleration time of linear
movement (The time taken when accelerating from the base speed to the maximum speed,
while the actual acceleration time is determined by the value of S3. in proportion).
● D8197:When the channel Y2,Y3 are selected, it indicates the deceleration time of linear
movement (The time taken when decelerating from the maximum speed to the base speed,
while the actual deceleration time is determined by the value of S3. in proportion).
6-272
Chapter 6 Interpretation of Application Instructions Pulse output
6-273
Chapter 6 Interpretation of Application Instructions Pulse output
6-274
Chapter 6 Interpretation of Application Instructions Pulse output
6-275
Chapter 6 Interpretation of Application Instructions Pulse output
circle.
7. S3· and S4· stand for the location of the circle center on X-axis and Y-axis respectively,
with the range of ﹣2,147,483,648 ~﹢2,147,483,647.
The radius shall be ranged from 100 to 1,000,000,000.
8. The distance from the start position to the circle center shall be approximately equal to the
distance from the destination position to the circle center (With the error no more than 1/1000).
9. The high 16-bit S5+1 of the 32-bit value S5. represents the time of drawing the circular, which
is in 10ms. The time is restricted by the maximum frequency of the pulse. If the frequency of the
actual operation is larger than 200K, it will be operated as 200K. In this case, it will take longer
time. The low 16-bit S5+0 represents the direction of drawing the circular. 0 indicates the
clockwise direction, while 1 indicates the counter-clockwise direction.The direction value larger
than 1 will be regarded as 1.
10. If no settings for the start frequency and acceleration/deceleration time, there will be no
acceleration/deceleration during the action process.
11. The direction of X-axis and Y-axis will be changed during the circular movement. To reflect
the direction number timely, the direction of X-axis and Y-axis is changed during the interruption.
Thus, the value Y indicating the direction will be changed out of the program during a scan cycle.
6-276
Chapter 6 Interpretation of Application Instructions Pulse output
6-277
Chapter 6 Interpretation of Application Instructions Pulse output
DPTPO S1· S2 D·
S1· :Start position of the source.
S2 :Section number.
D· :Number of pulse output object.
Function
1. According to the content of the section number S2+0, each section occupies 4 D registers(S1·
+0)、(S1·+1)、(S1·+2)、(S1·+3), which are taken as two 32-bit registers respectively.
Wherein, (S1·+1),(S1·+0) are for setting of the output frequency, while(S1·+3),
(S1·+2) are the number of pulse output for the said frequency.
2. The frequency output range of S1. is 1Hz~200,000Hz. 2. When channel Y2, Y3 are selected, the
minimum output frequency can't be smaller than 12Hz. It is recommended setting the output
frequency≥1K.
3. S2+0:It is for setting the number of sections(The setting range: 1~200. If it is beyond the
range, it will lead to instruction error). S2+1: It is for displaying the section number in execution
currently. Every time the program executes the instruction, the instruction will automatically
update the section number in execution currently.
4. D· is the pulse output device. For AP200, only the output points of Y0 and Y1 can be specified.
For AP300, Y0~Y3 can be specified. The instruction can only provide pulse output control. The
direction control requires the user to program additionally.
5. The instruction doesn't provide the function of acceleration/deceleration. Therefore, when the
instruction is disabled, the pulse output will be stopped immediately.
6. In each program scan, channel Y0, Y1, Y2 and Y3 can be only executed by one instruction.
However, there is no restriction set on the using times of the instruction.
7. When it starts to execute the instruction, the user is not allow to update the setting value of the
section frequency or number. Even if the value is change, it won't change the actual output.
6-278
Chapter 6 Interpretation of Application Instructions Pulse output
For example:
X000
DPTPO D0 D300 Y0
1. When X0 =ON, it will output according to the frequency and pulse number set for each section
by the user.
2. Table format
S2=D300, section number S1·=D0, frequency value S1·=D0, output number
(D300=K40) (S1·+0) (S1·+2)
K1(Section 1) D1,D0 D3,D2
K2(Section 2) D5,D4 D7,D6
: : :
K40(Section 40) D157,D156 D159,D158
3. The section number in execution currently can be viewed in the register D301.
4. The pulse output curve is shown as below:
Frequency (Hz)
(D239,D238)
(D237,D236)
…...
…...
(D5,D4)
(D7,D6)
(D1,D0)
(D3,D2)
Time (s)
t1 t2 t… t60
wherein, t1=(D3,D2)÷(D1,D0);t2=(D7,D6)÷(D5,D4);t60=(D239,D238)÷(D237,D236).
6-279
Chapter 6 Interpretation of Application Instructions Pulse output
6-280
Chapter 6 Interpretation of Application Instructions Pulse output
6-281
Chapter 6 Interpretation of Application Instructions Pulse output
C***, and enable high-speed interruption with the interruption service program. If the
external interruption point X is selected, it shall enable the external interruption function with
the instruction EI and the interruption service program I0*0.
d) When S1. uses the counter, it needs to enable the high-speed interruption by writing the
instruction DHSCS in the program. Moreover, the number of the high-speed counter C used
by the instruction DHSCS shall be the same as that specified by DCLLM.
2. Range of S2· output number: ﹣ 2,147,483,648~ ﹢ 2,147,483,647 ( ﹢ / ﹣ represent
forward/inverse direction). When the direction is forward, the current value register of the pulse
will be increased, and vice versa.
3. S3. : Output destination frequency. The value higher than 200Kz will be set as 200Hz. When
channel Y0, Y1 are selected, the value smaller than 1Hz will be set as 1Hz; when channel Y2, Y3
are selected, the value smaller than 12Hz will be set as 12Hz; when channel Y2, Y3 are used, it is
recommended that the output frequency ≥1K.
4. Regarding the D1. pulse output device, AP200 can only specify Y0 and Y1, while AP300 can
specify Y0~Y3. When output is ON for the direction signal, it won't be OFF immediately after the
pulse output ends. Instead, the direction signal will be OFF after the instruction condition contact
is OFF.
5. When channel Y0 is used, the register for setting the start/end frequency is D8145;
When channel Y1 is used, the register for setting the start/end frequency is D8145 in AP200,
which is D8165 for AP300;
When channel Y2 is used, the register for setting the start/end frequency is D8195;
When channel Y3 is used, the register for setting the start/end frequency is D8205.
The minimum start/end frequency setting is 0Hz, which is 500Hz by default.
6. When channel Y0 is selected, the register for setting the acceleration time is D8148, and the
register for setting the deceleration time is D8157.
When channel Y1 is used, the register for setting the acceleration/deceleration time is D8148
in AP200. In AP300, the register for setting the acceleration time is D8168, and the register for
setting the deceleration time is D8169.
When channel Y2 is selected, the register for setting the acceleration time is D8198, and the
register for setting the deceleration time is D8199.
When channel Y3 is selected, the register for setting the acceleration time is D8208, and the
register for setting the deceleration time is D8209.
AP200 uses the same register for setting the acceleration time and deceleration time. The register
of acceleration time is D8148 for channel Y0 for example.
The setting of the acceleration/deceleration time can't be lower than 30ms. The value lower than
30ms will be set as 30ms. The factory default value is 100ms.
7. When channel Y0 is selected, the output/input ratio register of the closed loop control is D8151.
6-282
Chapter 6 Interpretation of Application Instructions Pulse output
When channel Y1 is selected, the output/input ratio register of the closed loop control is
D8152.
When channel Y2 is selected, the output/input ratio register of the closed loop control is
D8155.
When channel Y3 is selected, the output/input ratio register of the closed loop control is
D8156.
K1 indicates the number of input pulse for the feedback destination is 100, while the number
of output pulse is 1; K200 indicates the number of input pulse for the feedback destination is 100,
while the number of output pulse is 200. The range of setting value is K1~K10,000.
8. When the external interruption is used, to prevent the failure of interruption, the register of
idle-speed pulse number could be used to restrict the total number of output pulse under idle speed.
When the register of idle-speed pulse number =0, it indicates the function is disabled. The factory
default value is 0.
When channel 0 is selected, the register of idle-speed pulse number is D8149.
When channel 1 is selected, the register of idle-speed pulse number is D8150.
When channel 2 is selected, the register of idle-speed pulse number is D8153.
When channel 3 is selected, the register of idle-speed pulse number is D8154.
Frequency
C high-speed counts=Feedback target
number
or
External interruption generation
Target frequency
Acceleration Deceleration
High-speed time
time time Idle-speed time
Output number=
Feedback target number? Proportional
value/100
6-283
Chapter 6 Interpretation of Application Instructions Pulse output
b) When the external interruption is used, to prevent the failure of interruption, the register of
idle-speed pulse number could be used to restrict the total number of output pulse under idle
speed. User may judge whether the execution result is good according to the time of actual
idle-speed. Technically, it is good if each time of finishing locating includes a little idle-speed
time.
6-284
Chapter 6 Interpretation of Application Instructions Pulse output
speed, which is used to restrict the maximum value of the pulse speed. For AP200, the
accelerating/decelerating parameters of channel Y1 and Y0 of AP200 share the same
registers.
● D8196, D8197: When the channel Y2 is selected, it indicates the maximum speed, which is
used to restrict the maximum value of the pulse speed.
● D8206, D8207: When the channel Y3 is selected, it indicates the maximum speed, which is
used to restrict the maximum value of the pulse speed.
● D8145:For AP200, when channel Y0,Y1 are selected, it indicates the base speed, which
is used to restrict the minimum value of the pulse speed. For AP300, when channel Y0 is
selected, it indicates the base speed, which is used to restrict the minimum value of the pulse
speed.
● D8165:For AP300, when channel Y1 is selected, it indicates the base speed, which is
used to restrict the minimum value of the pulse speed. For AP200, the base speed parameters
of channel Y1 and Y0 of AP200 share the same registers.
● D8195: When channel Y2 is selected, it indicates the base speed, which is used to restrict
the minimum value of the pulse speed.
● D8205: When channel Y3 is selected, it indicates the base speed, which is used to restrict
the minimum value of the pulse speed.
● D8148:For AP200, when channel Y0,Y1 are selected, it indicates the time of
accelerating from the base speed to the maximum speed. For AP300, when channel Y0 is
selected, it indicates the time of accelerating from the base speed to the maximum speed.
● D8168:For AP300, when the channel Y1 is selected, it indicates the time of accelerating
from the base speed to the maximum speed. For AP200, the acceleration parameters of
channel Y1 and Y0 of AP200 share the same registers.
● D8198:When channel Y2 is selected, it indicates the time of accelerating from the base
speed to the maximum speed.
● D8208:When channel Y2 is selected, it indicates the time of accelerating from the base
speed to the maximum speed.
● D8157:For AP300, when channel Y0 is selected, it indicates the time of decelerating from
the base speed to the maximum speed.
● D8169:For AP300, when channel Y1 is selected, it indicates the time of decelerating from
the base speed to the maximum speed.
● D8199:For AP300, when channel Y2 is selected, it indicates the time of decelerating from
the base speed to the maximum speed.
● D8209:For AP300, when the channel Y3 is selected, it indicates the time of decelerating
from the base speed to the maximum speed.
● D8149: Idle-speed steps of channel Y0 when CLLM is executed.
6-285
Chapter 6 Interpretation of Application Instructions Pulse output
6-286
Chapter 6 Interpretation of Application Instructions Pulse output
6-287
Chapter 6 Interpretation of Application Instructions Pulse output
6. Function description
The pulse output diagram is shown in the right: Frequency
t2
The symbols in the diagram are defined as:
t1:The destination frequency of section 1
t1
t2:The destination frequency of section 2
t3
t3:The destination frequency of section 3 Times
Frequency t1=6kHz
1kHz
0Hz Time
g1=50ms
2. Section 2:Assume t2 is 11KHz, the interval frequency is 2KHz and the interval time is 20ms.
The decomposition of section 2 is as shown in the figure below:
6-288
Chapter 6 Interpretation of Application Instructions Pulse output
Frequency
t2=11kHz
1kHz
2kHz
2kHz
t1=6kHz
Time
g2=40ms
3. Section 3:Assume t3 is 3KHz, the interval frequency is 2KHz and the interval time is 20ms.
The decomposition of section 3 is as shown in the figure below:
Frequency
Change
frequency of t3
t2=11kHz
2kHz
t3=3kHz
Time
20ms 20ms 20ms 20ms
Start g3=60ms
changing
6-289
Chapter 6 Interpretation of Application Instructions Pulse output
6-290
Chapter 6 Interpretation of Application Instructions Pulse output
6-291
Chapter 6 Interpretation of Application Instructions Pulse output
Target
Freque frequency Start frequency
ncy change changing
Interval
frequency
Time
Interval Interval
When the instruction DICF is used to change the destination frequency of the interruption
service program, it will actually change the time point of the frequency, which will be only
affected by the operation time of the instruction DICF. The speed change diagram is as shown
below:
Interval
frequency
Time
Interval Interval
6-292
Chapter 6 Interpretation of Application Instructions Pulse output
6-293
Chapter 6 Interpretation of Application Instructions Pulse output
6-294
Chapter 6 Interpretation of Application Instructions Pulse output
SLCH S1
S1 :Selected channel.
Function
1. The instruction is to specify which channel is used by the instructions of PPMI, PPMA, DCWI,
DCWA, DCIMI and DCIMA, Y0, Y1, or Y2, Y3. When S1=0, channel Y0、Y1 are selected;
When S1=2, channel Y2、Y3 are selected.
2. If channel is not specified by instruction SLCH, the instructions of PPMI, PPMA, DCWI,
DCWA, DCIMI and DCIMA, will use channel Y0, Y1 by default.
3. For AP200, when S1 uses the value rather than 0, it will lead to error of instruction operation
For AP2300, when S1 uses the value rather than 0 and 2, it will lead to error of instruction
operation
6-295
Chapter 6 Interpretation of Application Instructions Pulse output
6-296
Chapter 6 Interpretation of Application Instructions Pulse output
Speed
A c c e le ra tio n D e c e le ra tio n
tim e tim e
M a x sp e e d
O u tp u t p u ls e
fre q u e n c y S 4 ·
B a s e sp e e d
In stru c tio n T im e
e x e c u tio n
F in is h in g o f in s tru c tio n
e x e c u tio n M 8 0 2 9
6. When the instruction is enabled, the start frequency of X-axis, Y-axis and Z-axis will take the
value set for D8145, the acceleration time will take the value of D8148, the deceleration time will
take the value of D8157. In addition, the instruction doesn't support immediately stop flag
M8145、M8146 to stop the pulse output. To stop the output pulse, please disable the condition
contact.
7. There is no restriction set on the using times of the instruction. However, if the output of X-axis,
Y-axis or Z-axis is in use, it will fail to output for XYZ axis.
8. When the tri-axis output is finished, it will be indicated by setting M8029=ON.
6-297
Chapter 6 Interpretation of Application Instructions Pulse output
6-298
Chapter 6 Interpretation of Application Instructions Pulse output
6-299
Chapter 6 Interpretation of Application Instructions Pulse output
S peed
A cceleration D eceleration
tim e tim e
M ax speed
O utput pu lse
frequen cy S 4 ·
B ase speed
Instruction T im e
execu tion
F inishing o f in stru ctio n
execution M 8 0 2 9
7. When the instruction is enabled, the start frequency of X-axis, Y-axis and Z-axis will take the
value set for D8145, the acceleration time will take the value of D8148, the deceleration time will
take the value of D8157. In addition, the instruction doesn't support immediately stop flag
M8145、M8146 to stop the pulse output. To stop the output pulse, please disable the condition
contact.
8. There is no restriction set on the using times of the instruction. However, if the output of X-axis,
Y-axis or Z-axis is in use, it will fail to output for XYZ axis.
9. When the tri-axis output is finished, it will be indicated by setting M8029=ON.
6-300
Chapter 6 Interpretation of Application Instructions Pulse output
6-301
Chapter 6 Interpretation of Application Instructions Pulse output
6-302
Chapter 6 Interpretation of Application Instructions Pulse output
actual operation is larger than 200K, it will be operated as 200K. In this case, it will take longer
time. The low 16-bit S3+0 represents the direction of drawing the circular. 0 indicates the
clockwise direction, while 1 indicates the counter-clockwise direction.The direction value larger
than 1 will be regarded as 1.
8. The instruction draws an oval with the angle of 90 degrees. Figure 1 shows the clockwise
direction, while figure 2 shows the counter-clockwise direction. The maximum value of r1 and r2
can't be larger than 1,000,000,000, and the minimum value can't be smaller than 100.
Y- Y-
(S1,S2) (S1,S2)
axis axis
r1 r1
X- X-
(0,0) (0,0)
r2 axis r2 axis
Figure 1 Figure 2
9. If no settings for the start frequency and acceleration/deceleration time,
10. The direction of X-axis and Y-axis will be changed during the oval interpolation. To reflect the
direction number timely, the direction of X-axis and Y-axis is changed during the interruption.
Thus, the value Y indicating the direction will be changed out of the program during a scan cycle.
6-303
Chapter 6 Interpretation of Application Instructions Pulse output
6-304
Chapter 6 Interpretation of Application Instructions Pulse output
6-305
Chapter 6 Interpretation of Application Instructions Pulse output
actual operation is larger than 200K, it will be operated as 200K. In this case, it will take longer
time. The low 16-bit S3+0 represents the direction of drawing the circular. 0 indicates the
clockwise direction, while 1 indicates the counter-clockwise direction.The direction value larger
than 1 will be regarded as 1.
8. The instruction draws an oval with the angle of 90 degrees. Figure 1 shows the clockwise
direction, while figure 2 shows the counter-clockwise direction. The maximum value of r1 and r2
can't be larger than 1,000,000,000, and the minimum value can't be smaller than 100.
r1 r1
6-306
Chapter 6 Interpretation of Application Instructions Pulse output
6-307
Chapter 6 Interpretation of Application Instructions Contact comparison
Contact comparison
Function No. Mnemonic Name Page
F224 LD (S1·)=(S2·)
F225 LD (S1·)>(S2·)
F226 LD (S1·)<(S2·) Contact status
6-309
F228 LD (S1·)≠(S2·) comparison LD
F229 LD (S1·)≤(S2·)
F230 LD (S1·)≥(S2·)
F232 AND (S1·)=(S2·)
F233 AND (S1·)>(S2·)
Contact status
F234 AND (S1·)<(S2·)
comparison 6-310
F236 AND (S1·)≠(S2·)
AND
F237 AND (S1·)≤(S2·)
F238 AND (S1·)≥(S2·)
F240 OR (S1·)=(S2·)
F241 OR (S1·)>(S2·)
F242 OR (S1·)<(S2·) Contact status
6-311
F244 OR (S1·)≠(S2·) comparison OR
F245 OR (S1·)≤(S2·)
F246 OR (S1·)≥(S2·)
6-308
Chapter 6 Interpretation of Application Instructions Contact comparison
For example:
6-309
Chapter 6 Interpretation of Application Instructions Contact comparison
For example:
6-310
Chapter 6 Interpretation of Application Instructions Contact comparison
For example:
6-311
Chapter 7 Communication Function Table of Contents
1
Chapter 7 Communication Function Table of Contents
1 Summary
PLC of AP series could satisfy your communication and network demands, which doesn't
support simple network(Modbus protocol), but also support complicated network.
PLC of AP series supports Modbus protocol, moreover, AP300 also supports CANopen
protocol.
1. PG communication port
Pin Figure of PG Communication Port
2
Chapter 7 Communication Function Table of Contents
1:RX- 5:VCC
2:RX+ 6:GND
3:GND 7:TX+
4:TX- 8:GND
Mini Din 8-core socket (Hole)
PLC of AP series includes a built-in PG communication port.
3
Chapter 7 Communication Function Table of Contents
It is Modbus-protocol communication,
MBUS which can be enabled on two
Instruction(Onl ◎ ◎ communication ports simultaneously. It
y RTU) shall be used with the application
instruction F87 MBUS.
It can't be enabled on two communication
Remote I/O 〇 〇 ports simultaneously. It shall be used with
the application instruction F191 RMIO.
It can't be enabled on two communication
Data link 2
〇 〇 ports simultaneously. It shall be used with
(Data Link2)
the application instruction F193 DTLK2.
Register for
setting of the D8320/
D8321 D8120
communicatio D8300
n format
Remark Built-in Built-in Built-in Optional
◎:The function is available, which can be used by multiple ports simultaneously.
〇:The function is available, which can't be used by multiple ports simultaneously.
4
Chapter 7 Communication Function Table of Contents
5
Chapter 7 Communication Function Table of Contents
6
Chapter 7 Communication Function Table of Contents
(1,0,0,1):38,400
Note:1. PG communication port supports Modbus RTU and Modbus ASCII communication
protocols, with a fixed Data length of 8bit.
2. The setting of D8321 will take effect in the next scan cycle after this communication ends.
3. After the power is on, D8321 is 89Hex by default.
4. If the value of D8321 is beyond the above range, the PG communication port adopts the
default communication format: baud rate 19.2kbps, 8bit data, 2bit for stopping, and without parity
check.
5. When any of B10, B11, B12, B13, B14 and B15 is none-zero, preset the baud rate as
19.2kbps, 8bit data, 2bit for stopping, and without parity check.
6. After the baud rate is modified, it requires re-connecting PLC with AP-PCLINK.
spec of 120Ω,1/4W.
8. When the power is on, D8120, D8320, D8300 are set as 89Hex by default.
9. The setting of D8120, D8320 and D8300 will take effect in the next scan cycle after this
communication ends.
10. Please insert the communication expansion card before the host is powered on, so that the
expansion card will work normally. If you insert the expansion card after the power is on, it won't
work normally.
11. Modbus slave function only supports RTU mode.
8
Chapter 7 Communication Function Summary
2. RS/MBUS Instruction
Below is only for brief introduction. For more detail, please see the description for
instructions F80 RS and F87 MBUS.
9
Chapter 7 Communication Function Summary
The address numbers of Modbus corresponding to the internal software numbers of PLC of
AP series are as shown below:
◆ Coil Address Distribution
Applicable to
Coil Address Content point Remark
AP100 AP200 AP300
0000H~00FFH X0~X377 256 points It is used in ○ ○ ○
0100H~01FFH Y0~Y377 256 points the function ○ ○ ○
0200H~07FFH M0~M1535 1536 points codes of ○ ○ ○
0800H~0BFFH S0~S1023 1024 points 01H,05H, ○ ○ ○
0C00H~0C27H T0~T39 40 points 0FH ○ ○ ○
0C28H~0CC3H T40~T195 156 points (Read/Write) — ○ ○
0CC4H~0CFFH T196~T255 60 points ○ ○ ○
0D00H~0DFFH T256~T511 256 points — — ○
0E00H~0E63H C0~C99 100 points ○ ○ ○
0E64H~0EC7H C100~C199 100 points — ○ ○
0EC8H~0EDBH C200~C219 20 points — ○ ○
0EDCH~0EFFH C220~C255 36 points ○ ○ ○
0F00H~10FFH M8000~M8511 512 points ○ ○ ○
1100H~1CFFH S1024~S4095 3072 points — — ○
1D00H~34FFH M1536~M7679 6144 points — — ○
3500H~35FFH C256~C511 256 points — — ○
3600H~3FFFH Reserved — — — —
Note:AP series' input and output coil address is distributed in octal, such as X000~X007,
X010~X017. Other coil addresses are distributed in decimal, such as M0~M7,M8,M9,
M10…M1534,M1535.
10
Chapter 7 Communication Function Summary
11
Chapter 7 Communication Function Summary
42C9H C200 high word of present value High word high bit High word low bit
… …
4336H C255 low word of present value Low word high bit Low word low bit
4337H C255 high word of present value High word high bit High word low bit
6760H C200 low word of default value Low word high bit Low word low bit
32-bit counter
Default value
6761H C200 high word of default value High word high bit High word low bit
… …
67CEH C255 low word of default value Low word high bit Low word low bit
67CFH C255 high word of present value High word high bit High word low bit
67D0H C256 low word of present value Low word high bit Low word low bit
32-bit counter
Present value
67D1H C256 high word of present value High word high bit High word low bit
… …
69CEH C511 low word of present value Low word high bit Low word low bit
69CFH C511 high word of present value High word high bit High word low bit
69D0H C256 low word of default value Low word high bit Low word low bit
32-bit counter
Default value
69D1H C256 high word of default value High word high bit High word low bit
… …
6BCEH C511 low word of default value Low word high bit Low word low bit
6BCFH C511 high word of default value High word high bit High word low bit
12
Chapter 7 Communication Function Summary
Error code
Under the status of communication connection, when error occurs, the master will transmit
the function code plus 80H(set the highest bit as 1), together with the error code, to the main
system.
Code Name Description
01 Illegal Function The function code is invalid to the slave.
02 Error data address The data address is invalid to the slave.
03 Error data value Illegal data
04 Slave error When executing the request, error is detected on the slave.
13
Chapter 7 Communication Function Summary
05 Confirmed Reserved
06 Slave is busy Reserved
07 Operation
Error of function under operation mode/password mode
mode/password mode
Function
01H
code
Function The function code is used to read the states of multiple continuous coils.
description AP series has a maximum of 2000 coils.
The byte number is equal to the coil quantity/8. When the remainder is non-zero, 1 byte shall
be added.
Notes
User shall set the start address and coil quantity as the multiples of 8, so as to increase the
program efficiency.
In above example: The coil quantity of instruction PC→PLC is 0015(H)=21(D). However, as
21/8=2, and the remainder is 5, the response byte number is2+1=3(D)=03(H)(=3×8=24 coil states).
Thus, the byte number of PLC→PC will be 03H. The address of input coil and output coil is
distributed in octal (X000~X007,X010~X017,…),so the start address in PC→PLC is
0013(H)=23(Oct). and output state of PLC→PC should be the 24 coil from X023, that is:
X023,…,X027,X030,…X036,X037,X040,X041,…,X046 and X047, which are
21 coils states plus three 0s. It outputs the response quantity by 3 bytes, 8 bits are one byte, namely,
X023~X032,X033~X042,X043~X047. It is the same case when the coil Y is read.
In the Byte (X023~X032), X023 is the lowest valid bit and X032 is the highest valid bit. The
bytes are arranged from High bit to Low bit, that is X032~X023. When the feedback state of
14
Chapter 7 Communication Function Summary
Notes The byte number is equal to the coil quantity/8. When the remainder is non-zero, 1 byte shall be
15
Chapter 7 Communication Function Summary
added.
The length of input data is the number of bytes. As shown in above example: The number of
bytes=2, indicating the input data is of 2 bytes.
XX indicates it depends on the input data.
User shall set the start address and coil quantity as the multiples of 8, so as to increase the
program efficiency.
Function
06H
code
Function
Write content into single register
description
16
Chapter 7 Communication Function Summary
Communic D Register High 40H D Register High 40H Error code 03H
ation a address a address
Low 01H Low 01H CRC-1 Low 02H
format t t
a Input High 00H a Input High 00H 6 High 61H
Data Low 03H Data Low 03H
Low 8DH Low 8DH
CRC-16 CRC-16
High CBH High CBH
Notes
G. 08H diagnostics
It is mainly used to check the communication condition between the master and slaves, or
17
Chapter 7 Communication Function Summary
18
Chapter 7 Communication Function Summary
Function
Modify AP series ID(Address)
description
Notes ID data is the new ID(001~255). The high word must be set as 0.
19
Chapter 7 Communication Function Summary
The data length is of 8 bytes, BCD code(Second, minute, hour, date, month, year, week, 00).
XX indicates it depends on the input data.
Notes
The range of “year” is 2000~2099, which requires setting the last two digits by default. For
example, if 26 is set, the corresponding year is 2026.
This function is only available for 1-to-1 connection. When it is used for connection of multiple
machines, it will cause the bus data confusion.
Notes
When reading the AP series ID, the salve address in the instruction is a random number rather
than 0. The returned AP series ID is the real device ID.
20
Chapter 7 Communication Function Modbus
Below is only a brief introduction. See the description for instruction F191 RMIO for more
information.
Item Description
Communication EIA RS-485
standards
Baud rate 4800bps~500000bps
Number of slaves 4 slaves in maximum
Input 36 points (M1200~M1235);
Slave 1
Output 24 points (M1440~M1463)
Input 36 points (M1240~M1275);
Slave 2
Remote I/O zone Output 24 points (M1464~M1487)
(set up by master) Input 36 points (M1280~M1315);
Slave 3
Output 24 points (M1488~M1511)
Input 36 points (M1320~M1355);
Slave 4
Output 24 points (M1512~M1535)
Insulated twisted cable, collinearity, 2 lines type, total
Cable
length: 1km(38400bit/s)
Note:The remote I/O slave must be the basic unit of AP, which can't be the expansion module or
other module.
Function description
AP adopts the mode to increase the I/O points of the master. The master of AP series can
communicate with 4 AP slaves in maximum. When AP is taken as the slave under remote I/O
mode, it can be only used for the expansion I/O function of the master, which can't execute other
user programs.
21
Chapter 7 Communication Function Modbus
Below is only a brief introduction. See the description for instruction F193 DTLK2 for more
information.
Specification
Baud rate EIA RS-485
Baud rate 4800bps~500000bps
Number of slaves 15 slaves in maximum
The start address in the range of D0~D7999 and
Linked zone W0~W32767 are set by instruction DTLK2.
(Note:AP300 series supports data register W.)
The maximum data length is 40 words, which can be set by
Data length for each slave
instruction DTLK2
Insulated twisted cable, collinearity, 2 lines type, total
Cable
length: 1km(38400bit/s)
Function description
AP series adopts the mode to link the data in the system of small scale. The AP series master
can communicate with a maximum of 15 AP slaves.
22
Chapter 8 Expansion Function Table of Contents
8-1
Chapter 8 Expansion Function Table of Contents
8-2
Chapter 8 Expansion Function Table of Contents
1 Expansion card
Under AP series, each basic unit except AP110/AP114 can be installed with an expansion
card, and AP360 can be installed with two. To use the expansion card, you must insert it before
the host is powered on, otherwise, the expansion card won't work normally. When the expansion
card is not in use, you shall install the standard cover of the expansion card, so as to protect it from
dust, which may affect the connectivity of the connector. You must plug/unplug the expansion card
when the power is off. After the expansion card is plugged, the host will identify the expansion
card automatically, and display the ID in D8020(for expansion card communication port 1),
D8021(expansion card communication port 2)(ID is 0 if error occurs when identification). The
types of expansion cards are listed as below:
Remar
ID Type Description Power consumption
k
Built-i
0 AP-0CV Standard cover of expansion card N.A
n
485 multi-function communication
1 AP-485BD DC3.3V:3mA
port
232 multi-function communication
2 AP-232BD DC3.3V:11mA
port
DC3.3V :160mA
3 AP-COBD CANopen communication port
DC5V:130mA
4 AP-ENBD Ethernet communication port DC3.3V:170mA
5 AP-4DBD Digital input×4 DC3.3V:13mA
6 AP-4RBD Relay output×4 DC24V:30mA Option
Digital input×2 DC3.3V:8mA al
7 AP-2D2TBD
Transistor output×2 DC5V :14mA
8 AP-RTCBD RTC
9 AP-2AIBD 0~10V analog input port×2 DC24V:2mA
10 AP-1AOBD Analog output port×1 DC24V:23mA
0~10V analog input port×2
11 AP-3MABD DC24V:25mA
Analog output port×1
Electric cam movement control DC3.3V :190mA
12 AP-CAMBD
(one axis) DC5V:70mA
8-3
Chapter 8 Expansion Function Table of Contents
AP-485BD and AP-232BD are communication expansion cards for RS485 and RS232
communication respectively.
In AP series, such instructions as COIW, MCIR, MCIW, REGW, MRGR, MRGW, RS and
MBUS can all make communications by using expansion cards AP-485BD and AP-232BD.
AP-485BD AP-232BD
1.2 AP-COBD
AP-COBD
1.3 AP-ENBD
AP-ENBD
8-4
Chapter 8 Expansion Function Table of Contents
AP-4DBD, AP-4RBD and AP-2D2TBD are digital expansion cards, which are used to
expand digital input and output for PLC of AP series.
Type Description
AP-4DBD 4-channel digital input
AP-4RBD 4-channel relay output
AP-2D2TBD 2-channel digital input 2-channel transistor output
The numbers of the digital expansion card are arranged from X370 and Y370 respectively.
Use Instructions:
When AP-4DBD is used, the numbers of four inputs on the card are X370~X373 (Expansion
card port 1)/ X374~X377(Expansion card port 2).
When AP-4RBD is used, the numbers of four inputs on the card are Y370~Y373 (Expansion
card port 1)/ X374~X377(Expansion card port 2).
When AP-2D2TBD is used, the number of two inputs and two outputs are respectively
X370~X371 and Y370~Y371 (Expansion card port 1)/ X374~X375, Y374~Y375 (Expansion card
port 2).
8-5
Chapter 8 Expansion Function Table of Contents
1.5 AP-RTCBD
AP-RTCBD
RTC description for AP series.
AP100 Series AP-110 AP-114 AP-120 AP-130
RTC expansion card can be plugged
RTC description N/A
into for RTC function.
AP200 Series AP-224 AP-232 AP-240 AP-260
RTC function can be made on the basic module, or obtained by plugging in
RTC description
the RTC expansion card.
AP300 Series AP-324 AP-332 AP-340 AP-360
RTC description RTC function of basic module
8-6
Chapter 8 Expansion Function Table of Contents
The RTC operation can be performed from the following special coils and special registers.
Special Special
Content Description Content
coils registers
When it is ON, the clock stops D8013 Second(0~59)
timing.When it is ON~OFF, the D8014 Minute(0~59)
Clock stop clock is preset based on the data of
M8015
and preset D8013~D8019, which will be
D8015 Hour(0~23)
started. When the power is on, it
will be reset.
When it is ON, the clock stops D8016 Day(1~31)
Stop
reading/displaying time. It will be
M8016 displaying
reset when a power supply is D8017 Month(1~12)
clock time
connected.
When it is ON, it will be +/-30s
offset for internal time. It will be
M8017 ±30s offset D8018 Year(2000~2099)
reset when a power supply is
connected.
Installation ON status indicates clock is
M8018 D8019 Week(0~6)
detection installed.
M8019 Clock error ON status indicates clock error
8-7
Chapter 8 Expansion Function Table of Contents
AP-3MABD
Note:1. Only the expansion card port 1 supports the functions of expansion cards AP-2AIBD,
AP-1AOBD and AP-3MABD, which are unavailable for the expansion card port 2. Please don't
plug the above three expansion cards into the expansion card port 2.
2. When the expansion cards AP-2AIBD, AP-1AOBD and AP-3MABD are used, the
high-speed output function of Y3 will be disabled. Please pay attention to it.
AP-2AIBD:2-channel analog input port[Note](Precision2%, namely 0.2V), 0~10V input, with the
corresponding setting range: 0~1000(10bit).
AP-1AOBD:1-channel analog output port[Note](Precision2%, namely 0.2V), 0~10V input, with
the corresponding setting range: 0~4000.
AP-3MABD:2-channel analog input port[Note](Precision2%, namely 0.2V), 0~10V input, with
the corresponding setting range: 0~1000(10bit). 1-channel analog output port[Note](Precision2%,
namely 0.2V), 0~10V input, with the corresponding reading range: 0~4000.
[Note]:Software filter of input-type analog expansion card D8260: 0: The software filter is
disabled; 1~3: Software filter mode 1~3(For more details, please see 2.2.9 "System Settings for
System Memory" in this document).
The configuration relation between the data storage device and the channel of the analog
expansion module
Input-type analog expansion card (System will read data in the channel and write them in the
corresponding data address every time after the scan is completed)
Channel Channel Channel Channel Channel Channel Channel Channel
1 2 3 4 5 6 7 8
D8360 D8361 D8362 D8363 D8364 D8365 D8366 D8367
Output-type analog expansion card(System will read data from corresponding address and output
them to individual channels during the scan)
Channel Channel Channel Channel
— — — —
1 2 3 4
8-8
Chapter 8 Expansion Function Table of Contents
8-9
Chapter 8 Expansion Function Table of Contents
1.7 AP-CAMBD
AP-CAMBD
8-10
Chapter 8 Expansion Function Expansion card
2 Expansion module
Under AP series, each basic unit except AP110/AP114/AP120 can be connected with the
expansion modules. To use the expansion module, it requires plugging it before the power is on,
otherwise, the expansion module won't work normally. When the expansion module is not in use,
please install the terminal connector. You must connect the expansion module when the power is
off. The types of expansion modules are listed as below:
Type Description
AP-8EMR 4-point input/4-point output(Relay)
AP-8EMT 4-point input/4-point output(NPN transistor)
AP-8EMP 4-point input/4-point output(PNP transistor)
AP-8EYR 8-point output(Relay)
AP-8EYT 8-point output(NPN transistor)
AP-8EYP 8-point output(PNP transistor)
AP-8EXD 8-point input
AP-16EMR 8-point input/8-point output(Relay)
Digital
AP-16EMT 8-point input/8-point output(NPN transistor)
module
AP-16EMP 8-point input/8-point output(PNP transistor)
AP-16EYR 16-point output(Relay)
AP-16EYT 16-point output(NPN transistor)
AP-16EYP 16-point output(PNP transistor)
AP-16EXD 16-point input
AP-32EMR-A 16-point input/16-point output(Relay)
AP-32EMT-A 16-point input/16-point output(NPN transistor)
AP-32EMP-A 16-point input/16-point output(PNP transistor)
AP-4RD PT-100 temperature input×4-channel
AP-4RD-K PT-1000 temperature input×4-channel
AP-4TM J/K temperature input×4-channel
Analog
AP-2DA 0~10V,±10V,0~20mA,4~20mA analog output×2-channel
module
0~10V,0~20mA analog input×2-channel
AP-3MA
0~10V,±10V,0~20mA,4~20mA analog output×1-channel
AP-8AD 0~10V,0~20mA analog input×8-channel
TP03-PBUS Profibus-DP slave
Communicat
TP03-DNET DeviceNet slave
ion module
EN01 TCP/IP
8-11
Chapter 8 Expansion Function Expansion card
8-12
Chapter 8 Expansion Function Expansion card
The basic module of AP100 30-point, AP200 and AP300 can be connected with the digital
expansion module: AP100 can be expanded with 128 points in maximum, AP200 can be expanded
with 256 points in maximum, and AP100an be expanded with 384 points in maximum.
147 m/s2 (15g), 11 ms duration, 3 shocks per axis, on three mutually perpendicular
Shock resistance
axis(IEC61131-2)
Noise immunity 1,000Vpp,1us @ 30~100Hz
Dielectric 1,500VAC > 1min between all terminals to ground ( terminal block for relay )
8-13
Chapter 8 Expansion Function Expansion card
withstand
Dielectric 1,500VAC > 1min between all terminals to ground ( other terminal blocks )
withstand
Insulation 500VDC> 10MΩ between all terminals to ground
resistance
Grounding ≤100Ω
Note:Don't use it in the environment with the pressure exceeding the atmosphere, or it may
cause malfunction.
8-14
Chapter 8 Expansion Function Expansion card
Outline figure:
AP-8EMR
8-point digital module
AP-8EMT
AP-8EMP
AP-8EYR
AP-8EYT
AP-8EYP
AP-8EXD
AP-16EMR
16-point digital module
AP-16EMT
AP-16EMP\
AP-16EYR
AP-16EYT
AP-16EYP
AP-16EXD
32-point digital module
AP-32EMR-A
AP-32EMT-A
AP-32EMP-A
8-15
Chapter 8 Expansion Function Expansion card
8-16
Chapter 8 Expansion Function Expansion card
RY
Input Output
S/S
COM
1
8-17
Chapter 8 Expansion Function Expansion card
Indicator
ON
Insulation
Photo-coupling insulation
method
point 4
Voltage DC 24V
0.3A/1 point; 1.2A/1 common
Current
terminal
Type Transistor NPN
O
Response Y0 Y2
*
ut Smaller than 1ms C0 Y1 Y3
time
pu
Minimum
t 1mA @ 5VDC
load
LED indicator is ON when input is
Indicator
ON Downside terminal block
Insulation
Photo-coupling insulation
method
PWR:5V Power LED(Green)
Indicator
OE:Output Enable LED(Green)
5VDC:Max current consumption
Internal power 45mA
supply 24VDC:Max current consumption
30mA
Accessory Expansion cable(TP03-304EC :
8-18
Chapter 8 Expansion Function Expansion card
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upside Signal input terminal(Input Downsi Output wiring terminal
X0~X3 Y0~Y3
termin terminal) de block(Output terminal)
al Common circuit terminal terminal Common circuit terminal
S/S C0
block block(Common terminal) block block(Common terminal)
Note:4 output points share a common terminal.
Internal circuit
5V
COM
Trigger
Input Output Circuit
S/S
Y0
1
8-19
Chapter 8 Expansion Function Expansion card
8-20
Chapter 8 Expansion Function Expansion card
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upside Signal input terminal(Input Downsi Output wiring terminal
X0~X3 Y0~Y3
termin terminal) de block(Output terminal)
al Common circuit terminal terminal Common circuit terminal
S/S C0
block block(Common terminal) block block(Common terminal)
Note:4 output points share a common terminal.
Internal circuit
5V
COM
Trigger
Input Output Circuit
S/S
Y0
1
8-21
Chapter 8 Expansion Function Expansion card
8-22
Chapter 8 Expansion Function Expansion card
Y0
Trigger
Output Circuit
COM
8-23
Chapter 8 Expansion Function Expansion card
Response
ut Smaller than 1ms
time
pu
Minimum
t 1mA @ 5VDC
load
LED indicator is ON when input is
Indicator
ON
Insulation
Photo-coupling insulation
method
PWR:5V Power LED(Green) Y4 Y6
*
Indicator C1 Y5 Y7
OE:Output Enable LED(Green)
5VDC:Max current consumption
Internal power 25mA
supply 24VDC:Max current consumption
70mA
Downside terminal block
Expansion cable(TP03-304EC :
Accessory
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upsi Output wiring terminal Output wiring terminal
Y0~Y3 Dow Y4~Y7
de block(Output terminal) block(Output terminal)
nside
term
termi
inal Common circuit terminal Common circuit terminal
C0 nal C1
bloc block(Common terminal) block(Common terminal)
block
k
Note:4 output points share a common terminal.
Internal circuit
8-24
Chapter 8 Expansion Function Expansion card
COM
Outp Trigger
Circuit
ut
Y0
8-25
Chapter 8 Expansion Function Expansion card
8-26
Chapter 8 Expansion Function Expansion card
Y0
Outp Trigger
Circuit
ut
COM
8-27
Chapter 8 Expansion Function Expansion card
Input
S/S
8-28
Chapter 8 Expansion Function Expansion card
Photo-coupling insulation
method
point 8
Voltage AC 250V/DC 30V
Current 2A/1 point; 5A/1 common terminal
Type Relay
Mechanical
20,000,000 times
lifespan
O Electric
100,000 times @ 2A
ut lifespan Y0 Y2 C1 Y5 Y7
C0 Y1 Y3 Y4 Y6
pu Response
10ms
t time
Minimum
1mA @ 5VDC
load
LED indicator is ON when input is
Indicator Downside terminal block
ON
Insulation
Relay
method
PWR:5V Power LED(Green)
Indicator
OE:Output Enable LED(Green)
5VDC:Max current consumption
Internal power 55mA
supply 24VDC:Max current consumption
70mA
8-29
Chapter 8 Expansion Function Expansion card
Expansion cable(TP03-304EC :
Accessory
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upsi Signal input terminal(Input Output wiring terminal
X0~X7 Dow Y0~Y7
de terminal) block(Output terminal)
nside
term
termi
inal Common circuit terminal Common circuit terminal
S/S nal C0~C1
bloc block(Common terminal) block(Common terminal)
block
k
Note:4 output points share a common terminal.
Internal circuit
5V
1
Inpu Outp RY
t S/S ut COM
1
8-30
Chapter 8 Expansion Function Expansion card
8-31
Chapter 8 Expansion Function Expansion card
8-32
Chapter 8 Expansion Function Expansion card
8-33
Chapter 8 Expansion Function Expansion card
COM
Inpu Outp Trigger
Circuit
t S/S ut
Y0
1
8-34
Chapter 8 Expansion Function Expansion card
8-35
Chapter 8 Expansion Function Expansion card
Y0
Outp
Trigger
ut Circuit
CO
8-36
Chapter 8 Expansion Function Expansion card
O C0 Y1 Y3 Y4 Y6
Response
ut Smaller than 1ms
time
pu
Minimum
t 1mA @ 5VDC
load
LED indicator is ON when input is
Indicator
ON
Insulation
Photo-coupling insulation
method
PWR:5V Power LED(Green) Y10 Y12 C3 Y15 Y17
Indicator C2 Y11 Y13 Y14 Y16
OE:Output Enable LED(Green)
5VDC:Max current consumption
Internal power 35mA
supply 24VDC:Max current consumption
140mA
Downside terminal block
Expansion cable(TP03-304EC :
Accessory
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upsi Output wiring terminal Output wiring terminal
Y0~Y7 Dow Y10~Y17
de block(Output terminal) block(Output terminal)
nside
term
termi
inal Common circuit terminal Common circuit terminal
C0~C1 nal C2~C3
bloc block(Common terminal) block(Common terminal)
block
k
Note:4 output points share a common terminal.
Internal circuit
8-37
Chapter 8 Expansion Function Expansion card
Y0
Outp
ut Trigger
Circuit
COM
8-38
Chapter 8 Expansion Function Expansion card
O C0 Y1 Y3 Y4 Y6
Response
ut Smaller than 1ms
time
pu
Minimum
t 1mA @ 5VDC
load
LED indicator is ON when input is
Indicator
ON
Insulation
Photo-coupling insulation
method
PWR:5V Power LED(Green) Y10 Y12 C3 Y15 Y17
Indicator C2 Y11 Y13 Y14 Y16
OE:Output Enable LED(Green)
5VDC:Max current consumption
Internal power 35mA
supply 24VDC:Max current consumption
140mA
Downside terminal block
Expansion cable(TP03-304EC :
Accessory
4cm,26pin)
Terminal block description
Symbol Content Symbol Content
Upsi Output wiring terminal Output wiring terminal
Y0~Y7 Dow Y10~Y17
de block(Output terminal) block(Output terminal)
nside
term
termi
inal Common circuit terminal Common circuit terminal
C0~C1 nal C2~C3
bloc block(Common terminal) block(Common terminal)
block
k
Note:4 output points share a common terminal.
Internal circuit
8-39
Chapter 8 Expansion Function Expansion card
COM
Trigger
Output Circuit
Y0
8-40
Chapter 8 Expansion Function Expansion card
8-41
Chapter 8 Expansion Function Expansion card
5V
Inpu
t S/S
8-42
Chapter 8 Expansion Function Expansion card
8-43
Chapter 8 Expansion Function Expansion card
Inpu Outp RY
t S/S ut COM
1
8-44
Chapter 8 Expansion Function Expansion card
8-45
Chapter 8 Expansion Function Expansion card
8-46
Chapter 8 Expansion Function Expansion card
8-47
Chapter 8 Expansion Function Expansion card
8-48
Chapter 8 Expansion Function Expansion card
The basic unit of AP100 30-point, AP200 and AP300 can be connected with the analog
expansion module: 7 AP input-type analog expansion modules and 4 AP output-type analog
expansion modules. That is, it has 56 channels of analog input and 8 channels of analog output in
maximum.
8-49
Chapter 8 Expansion Function Expansion card
insulation
Operation
LED (5V power LED indicator: Green)
indicator
Note: Please don't use it in the environment with the pressure exceeding the atmosphere, or it may
cause malfunction.
Outline figure:
AP-4RD
AP-4RD-K
Analog module
AP-4TM
AP-2DA
AP-3MA
AP-8AD
8-50
Chapter 8 Expansion Function Expansion card
8-51
Chapter 8 Expansion Function Expansion card
Note: When choosing current/voltage mode for 8AD module, the side switch should be on the
corresponding level.
8-52
Chapter 8 Expansion Function Expansion card
Circuit diagram
A/D
converte
External Shielding Selection r
device twisted cable switch A7
S7
I7
C7
Shielding
twisted cable 24V
24V
Regulator
0V
0V
Regulate voltage/current
supply
8-53
Chapter 8 Expansion Function Expansion card
8-54
Chapter 8 Expansion Function Expansion card
LNK:Link LED(Green)
Internal power supply 5VDC:Max current 30mA
24VDC±20%
External power supply (Max current consumption
100mA)
Expansion
Accessory cable(TP03-304EC:4cm,
26pin)
8-55
Chapter 8 Expansion Function Expansion card
Circuit diagram
I0 To basic
Optical
unit
C0 coupling
D/A
converte
r
Current ouput
V1±
External Shielding
device twisted cable V1
I1
C1
Shielding
twisted cable 24V
24V
Regulator
0V
0V
Regulate voltage/current
supply
8-56
Chapter 8 Expansion Function Expansion card
8-57
Chapter 8 Expansion Function Expansion card
Expansion
Accessory cable(TP03-304EC:4cm,
26pin)
Downside terminal block
8-58
Chapter 8 Expansion Function Expansion card
Circuit diagram
Analog input circuit digram
A/D
converter
External Shielding Selection
device twisted cable switch A7
S7
I7
C7
Shielding
twisted cable 24V
24V
Regulator
0V
0V
Regulating voltage/current
supply
8-59
Chapter 8 Expansion Function Expansion card
Iout To basic
D/A Optical
unit
COM converte coupling
r
Current output
Shielding
twisted cable 24V
24V
Regulator
0V
0V
Regulating voltage/current
supply
8-60
Chapter 8 Expansion Function Expansion card
8-61
Chapter 8 Expansion Function Expansion card
Circuit diagram
Shielding cable
External device
外部設備 屏蔽綫
A0
PT100 Optical coupling
B0
b0
Optical coupling
SHLD
A/D 光耦閤
A/D converter
轉換器 至基本組
To basic unit
SHLD
穩定電壓/電流供應
Regulating
voltage/current supply
8-62
Chapter 8 Expansion Function Expansion card
8-63
Chapter 8 Expansion Function Expansion card
Circuit diagram
External device
外部設備 Shielding
屏蔽綫 cable
A0
B0
PT1000
b0
Optical coupling
SHLD
A/D converter
A/D 光耦閤
轉換器 至基本組
To basic unit
External device
外部設備 Shielding
屏蔽綫 cable
A3
B3
PT1000
b3
SHLD
穩定電壓/電流供應
Regulating
voltage/current supply
8-64
Chapter 8 Expansion Function Expansion card
8-65
Chapter 8 Expansion Function Expansion card
Circuit diagram
External
device Shielding
twisted cable TC0+
J,K
To basic
Type Optical
unit
coupling
TC0-
A/D
converter
External
device Shielding
twisted cable TC3+
J,K
Type
TC3-
Shielding
twisted cable 24V
24V
Regulator
0V
0V
8-66
Chapter 8 Expansion Function Expansion card
2.2.8 Wiring
CH2
V+
com
1. The cable for analog input should be standard isolated twisted cable, which should be away
from the power line or other wires that may cause interruption. (It is recommended that the cable
should be less than 3m in length)
2. Connect the common terminal to system ground, and then ground the system properly.
Both voltage and current inputs are available for analog unit: However, the signal should be less
than 15V or 30mA, or the analog unit will be damaged.
V+
CH1
com
Inverter
CH2
V+
com
1. The cable for analog input should be isolated twisted cable, which should be away from
the power line or other wires that may cause interruption. (It is recommended that the cable should
be less than 3m in length)
2. The improper wiring will result in wrong operation or damage the basic unit. The short
circuit in the voltage output will damage the basic unit permanently. Please pay attention to that.
You can choose the voltage output or current output for the analog output unit:
8-67
Chapter 8 Expansion Function Expansion card
External
device
External
device
Isolation amplifier
● Keep the wire without the shield as short as possible (30mm or shorter).
Connect the shield-net with the SHLD terminal, which should be connected with Flame
grand through the conducting wire of apx. 1.25mm2.
● Use 24VDC power supply or 24V output of basic unit for the D/DA module.
8-68
Chapter 8 Expansion Function Expansion card
7 AP analog expansion modules for input (If 7 AP-8AD units are used, there will be 56 input
channels. For AP-4RD, there will be 28 input channels) and 4 AP analog expansion units for
output (If 4 AP-2DA are used, there will be 8 output channels). That is, the basic unit can expand
to 56-channel analog input and 8-channel analog output maximumly. When using it, you should
pay attention to the following points:
1. One expansion unit with both input and output(AP-3MA) will occupy two expansion units,
one of which is for input, while the other is for output.
2. The total channels of each analog expansion unit is determined by the special function of
each unit. ( For the information about channels of each module, please refer to the respective
specification in the chapter below)
3. AP expansion analog unit should be connected with the expansion port of AP basic unit.
The corresponding channels are numbered from the left to the right expansion port of the basic
unit.
4. AP-3MA will occupy 4 AD channels. The first two are corresponding with the practical
analog input,while the other two are null. AP-3MA will occupy 2 DA output channels. The first
one is corresponding with the practical analog output, while the other one is null.
Example 1: AD channel
Basic unit AP-130BT-A AP-8AD AP-3MA AP-8AD AP-4RD
8-69
Chapter 8 Expansion Function Expansion card
Note:
1. The last unit should be plugged with the loop terminal connector (TP-200EC).
2. The figure above is only the logic relationship instead of the practical connection. In practice,
different numbers of power modules will be added into due to different applications. (Please see
2.4 Power Supply Module of this document)
8-70
Chapter 8 Expansion Function Expansion card
…
=0:AD mode is disabled; =4:PT100
D8274 =1:0~10V voltage input =5:PT1000 0 AD channel 53~56
D8275 mode(0~4000) =6:J AD channel 57~60
=2:0~20mA current input =7:K
mode(0~2000) Reserved
D8276
=3:4~20mA current input mode AD channel 61~64
or 1~5V voltage input mode(0~2000)
Operation mode for DA module: to set 4 HEX codes H**** in
D8277 register # D8277~ # D8279, in which the low word is DA channel 1~4
8-71
Chapter 8 Expansion Function Expansion card
⑴ ⑵ ⑸ exam
ple:
Sampling data 1=161, Sampling data 2=120, Sampling data 3=154, Sampling data 4=160,
Sampling data 5=190, Sampling data 6=169,
Sampling data 7=110, Sampling data 8=121, Sampling data 9=150, Sampling data 10=198,
Sampling data 11=199.
■ Mode 1:
①Refresh data=(161+154+160) / 3=158—filter(1,2,3,4,5)
The data of maximum value 190 and minimum value 120 will be deleted.
②Refresh data=(154+160+169) / 3=161—filter(2,3,4,5,6)
The data of maximum value 190 and minimum value 120 will be deleted.
③Refresh data=(154+160+169) / 3=161—filter(3,4,5,6,7)
The data of maximum value 190 and minimum value 110 will be deleted.
8-72
Chapter 8 Expansion Function Expansion card
:
:
⑦Refresh data=(121+150+198) / 3=156—filter(7,8,9,10,11)
The data of maximum value 199 and minimum value 110 will be deleted.
■ Mode 2:
Get the average value of the 5 data from mode 1
(①+②+③+④+⑤) / 5
■ Mode 3:
Get the average value of the max and min data among 5 consecutive data from mode 2. This
mode can efficiently filter the ripple or ripple noise.
(max + min)/2, wherein the range of max and min value is within ( ⑴⑵⑶⑷⑸ ),
8-73
Chapter 8 Expansion Function Expansion card
Type Expanded
Input/Outpu
power Description Dimension
t points
supply
TP03-PBUS N.A Profibus-DP slave
TP03-DNET 24VDC N.A DeviceNet slave W38×H90×D59mm
EN01 N.A TCP/IP
Outline figure:
8-74
Chapter 8 Expansion Function Expansion card
TP03-01SPS-A
Dimension: W57×H90×D83mm
Specification: 5V output 250mA
Internal 250mA
24V
External 400mA
24V
According to the specification, PLC of AP series can expand the digital I/O to 128
points(AP100), 256 points (AP200), 384 points(AP300) in maximum, which can expand the
analog of 56-channel input and 8-channel output. However, it shall consider the power
restriction in practice. Power supply module shall be added in case of insufficient power.
Before connected with the power module, you should calculate the total power required by all
expansion modules to be connected with AP basic unit. If the AP basic unit can't satisfy, you
should add power module in proper position(add one or more power modules upon demands), so
that all expansion modules can be supplied with power properly.
The restriction of power supply mainly considers whether the internal 5V power supply and
internal 24V output of the basic unit can satisfy the expansion.
5V Power Specification
Series type AP-130 AP200 Series AP300 Series AP-32E
5V output(mA) 300 500 500 500
8-75
Chapter 8 Expansion Function Expansion card
5V power consumption
5Vpower consumed by the basic unit
Basic unit type 5V current (mA)(max) Module Type 5V current (mA)(max)
AP-130 130 AP-324 150~160
AP-224 150 AP-332 160~170
AP-232 150 AP-340 180~190
AP-240 180 AP-360 230~240
AP-260 230
8-76
Chapter 8 Expansion Function Expansion card
8-77
Chapter 8 Expansion Function Expansion card
Step 3, fill in the table below. It will be judged as OK if the actual value is within the
specification. If all items are OK, it could be connected directly. If the power supply exceeds the
specification, it requires adding power supply.
Item Digital I/O points AD/DA points 5V power supply(mA) Internal 24V power(mA)
Specification 128 56/8 300 300
Actual value 78 8/0 250 304
Judge OK OK OK NG
Conclusion: The internal 24V power supply can't satisfy the demands, so it requires adding
power supply module.
8-78
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
9-1
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
M8000
“Normal operation”
Y000
During run, the Frequent output drive expected
constant is ON
When M8001 is RUN, the constant is
OFF
M8002,M8003
After the PLC starts to run, the initial pulse M8002 is only ON during the first computation
cycle, which will keep OFF in the left time.
The pulse is taken as the initial setting signal for program initialization, writing specified
values and other conditions.
M8003 is OFF for one computation cycle after RUN, and it keeps ON in other left time.
Time sequence of mark action
RUN input In RUN In STOP In RUN
M8000
RUN monitoring(Contact a) ON ON
M8001 ON
RUN monitoring(Contact b)
M8002
Initial pulse(Contact a) ON ON
M8003 ON ON
Initial pulse(Contact b)
9-2
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
The machine offers the following four internal clocks. When the PLC is powered on, the four
types of time will keep oscillating.
10ms
M8011
(10ms)
100ms
M8012
(100ms)
1s
M8013
(1s)
1min
M8014
(1min)
Note:Note: even the PLC is STOP, the clock still keeps operating. Therefore, falling edge of
RUN monitoring (M8000) is not synchronous with the start time of the clock.
RTC
<Forced setting>
The clock is stopped by setting M8015 ON. User could input the time value to be calibrated
in each time register(D8013~D8019), and set M8015 OFF, and then the clock will be started with
the new time.
9-3
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
For example: The figure shows how to set time by executing the normal program. Set X000 on to
set time, and then set X000 OFF to start clock.
X000
M8015
PLF M0
M0
MOV K30 D8013
MOV K20 D8014
MOV K10 D8015
MOV K25 D8016
MOV K4 D8017
MOV K0 D8018
MOV K2 D8019
ID of expansion card
D8020: ID for the storage expansion card 1; D8021: ID for the storage expansion card 2.
After the expansion card is plugged, it will be identified when the main unit is powered on.
Also the ID will be displayed on D8020 and D8021.
0 1 2 3 4 5
Without card AP-485BD AP-232BD AP-COBD AP-ENBD AP-4DBD
6 7 8 9 10 11
AP-4RBD AP-2D2TBD AP-RTCBD AP-2AIBD AP-1AOBD AP-3MABD
9-4
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
ID and specifying ID
D8003:Store ID value, Default value is 1.
M8128:When M8128 is 1, the value in D8128 will be taken as ID. After the power is ON,
M8128 will be reset.
In addition, ID could be set under "ID setting" in AP-PCLINK.
After the ID is changed, it requires re-downloading the program.
9-5
Chapter 9 Supplementary Interpretation of Basic Functions Table of Contents
9-6
Chapter 9 Supplementary Interpretation of Basic Functions Additional Interpretation for Special devices
Relation of the instruction MC-MCR and the instruction CJ has been described in the
instruction F0CJ. See the following for the relations of other instructions of program flow.
In the following table, ◎ represents the relation of inclusion, and ∞represents repeating of
the last and next inter-sections.
Example 1:◎ Example 2:∞
Upper
Upper instruction
Left Left instruction
instruction instruction
MC—CJ—P—MCR MC—CJ—MCR—P
9-8
Chapter 9 Supplementary Interpretation of Basic Functions Program flow
9-9
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Expansion card error[M8060(D8060)]
Continue to
0000 No exception —
operate
No expansion communication (No
Continue to expansion card is installed, but the Please check whether the expansion card
6006
operate expansion card related instruction is is installed correctly
applied)
PLC hardware check[M8061(D8061)]
Continue to
0000 No exception —
operate
Turn on the power supply again. If the
6101 RAM error error still occurs, please return it to the
factory for repair.
Turn on the power supply again. If the
6102 ROM error error still occurs, please return it to the
factory for repair.
6103 Body I/O bus error Return it to the factory for repair.
Re-write the user program. If the error
6104 Stop User program error still occurs, please return it to the factory
operation for repair.
The scan cycle is beyond the range
6105 Watchdog time detecting over time
(D8000), please check the user program.
Turn on the power supply again. If the
6106 RAM address line error error still occurs, please return it to the
factory for repair.
Turn on the power supply again. If the
6107 RAM operation error error still occurs, please return it to the
factory for repair.
Communication error[M8063(D8063)]
Continue to
0000 No exception —
operate
Continue to Confirm the communication parameters,
6301 DTLK2 error
operate and connections
9-10
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Confirm the communication parameters,
6302 RMIO error
and connections
Parameter error[M8064(D8064)]
Continue to
0000 No exception —
operate
Program and parameter After stopping PLC, set the parameters
6401
mismatching correctly
After stopping PLC, set the parameters
6402 Memory capacity setting error
Stop correctly
operation After stopping PLC, set the parameters
6406 Insufficient RAM
correctly
After stopping PLC, set the parameters
6409 Other errors
correctly
Syntax error [M8065(D8065)]
Continue to
0000 No exception —
operate
Instruction address combination Check whether the instructions are
6501
error applied correctly
Stop
6504 Repeated pointer Check whether P and I are used correctly
operation
Check whether the instructions are
6505 Device address is beyond range
applied correctly
Check whether the instructions are
6506 Using undefined instruction applied correctly and rewrite them into
user program
Stop If the P symbol is larger than 127, check
6507 Pointer definition error
operation whether P is used correctly
6508 Interruption pointer definition error Check whether I is used correctly
Check whether the instructions are
6509 Others
applied correctly
Circuit error[M8066(D8066)]
Continue to
0000 No exception —
operate
Stop MPS continuously used for more
6603 Check the times of using MPS
operation than 8 times
9-11
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Check the relation between MPS, MRD
6604 MPS, MRD and MPP relation error
and MPP
STL continuously used for more
6605 Check the times of using STL
than 16 times
6606 Pointer doesn't exist Check whether P is used correctly
Main program has I ,IRET and Check the program, and check whether P
6607
SRET and I are used correctly
FOR,NEXT include STL,RET,
Check whether the instructions are
6608 MC,MCR,
applied correctly
SMCS,SMCR,JCS,JCR
6609 CALL has more than 16 levels nest. Check the times of using CALL nesting
6610 FOR and NEXT mismatching Check the use of FOR,NEXT
Check the use of supporting JCS and
6611 with JCS and without JCR
JCR
Check the use of supporting STL and
6612 with STL and without RET
RET
Check the use of supporting MC and
6613 with MC and without MCR
MCR
Check the use of supporting SMCS and
6614 with SMCS and without SMCR
SMCR
6615 with I and without IRET Check the use of supporting I and IRET
MC , MCR , SMCS , SMCR and Check whether the instructions are
6616
SRET exist between STL_RET applied correctly
FOR , NEXT has more than 16
6617 Check the times of using FOR,NEXT
levels nest.
Check the program, and rewrite the
6618 No end
program
Address returned from IRET is Check whether the interruption program
6619
wrong. is correct
Check whether the instructions are
6621 Other errors
applied correctly
Computation error [M8067(D8067)]
Continue to
0000 No exception —
operate
9-12
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Check the operand of the instruction F40
6705 Address conflict ZRST according to the error step number
Continue to D8068.
operate Check the parameters of the error
6706 Parameter error instruction according to the error step
number D8068.
Check the settings of the related registers
6707 Related register setting error according to the error step number
D8068.
Check the parameter settings of F42
6709 Other errors ENCO or F100 STORE according to the
error step number D8068.
Check the parameter settings of F36
6710 Parameter mismatching WSFR and F37 WSFL according to the
error step number D8068.
6711 Over high CSFO input frequency
PID sampling time TS is out of
6730 Check setting of PID sampling time TS
range(Ts<0)
PID input filter constant is out of Check the setting of PID input filter
6732
Continue to range constant
operate PID proportional gain is out of Check the setting of PID proportional
6733
range gain
6734 PID integral time is out of range Check the setting of PID integral time
6735 PID derivative gain is out of range Check the setting of PID derivative gain
Check the setting of PID derivative
6736 PID derivative time is out of range
time
PID sampling time ≤ computation
6740 Check the setting of PID sampling time
cycle
Overflow of variational value about
6742 Check the setting of PID measuring value
measuring in PID
Check the setting of related PID
6743 Overflow of deviated value in PID
parameters
Overflow of integration Check the setting of related PID
6744
computation in PID parameters
9-13
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Overflow of differential gain leads
Check the setting of related PID
6745 to overflow of differential value in
parameters
PID
Overflow of differential Check the setting of related PID
6746
computation in PID parameters
Overflow of PID computation Check the setting of related PID
6747
results parameters
6750 PID auto tuning result error Check the setting of PID auto tuning
PID auto tuning operation direction
6751 Check the setting of PID auto tuning
is inconsistent
6752 PID auto tuning operation error Check the setting of PID auto tuning
Error step number D8068
Error
Preserve application instruction
step — —
error step number
number
Expansion error [M8069(D8069)]
Continue to
0000 No exception —
operate
Check whether the connection wire of the
6903 Expansion I/O error expansion module or the terminal
connector works normally.
Check whether the number of AD
6904 Continue to AD/DA setting error modules and number of DA channels are
operate set correctly.
AD unit is not connected with
power supply or more than one Check the power supply of AD module
6905
channel set by TP03-4RD is idle and TP03-4RD is loaded
load
Check whether the expansion point X or
Continue to The expansion I/O points are out of
6906 Y of the expansion module is beyond the
operate range
acceptable maximum value.
FROM/TO error[M8070(D8070)]
Continue to
0000 No exception —
operate
9-14
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Check whether the configuration and
7001 No response
connection are correct
SUM verification error for returned Check whether the configuration and
7002
data connection are correct
Check whether the configuration and
7003 ASC format error for returned data
connection are correct
Start/end character error for Check whether the configuration and
7004
returned data connection are correct
Functional code error for returned Check whether the configuration and
7005
data connection are correct
Module number error for returned Check whether the configuration and
7006
data connection are correct
Check whether the configuration and
7007 Number error for returned data
Continue to connection are correct
operate Check whether the configuration and
7008 Length error for returned command
connection are correct
SUM verification error for data Check whether the configuration and
7010
received by module connection are correct
ASC format error for data received Check whether the configuration and
7011
by module connection are correct
Functional code error for data Check whether the configuration and
7012
received by module connection are correct
Length error for data received by Check whether the configuration and
7013
module connection are correct
BFM range error for data received Check whether the configuration and
7014
by module connection are correct
Number out of range for data Check whether the configuration and
7015
received by module connection are correct
Communication error[M8124(Built-in communication port)/M8324(Expansion card communication port
1)/M8304(Expansion card communication port 2) (D8345)]
Continue to
0000 No exception —
operate
Continue to Check whether the configuration and
6760 CRC verification error
operate connection are correct
9-15
Chapter 9 Supplementary Interpretation of Basic Functions ASCII Code List
Action
Error
when error Error code description Solution
Code
occurs
Check whether the configuration and
6761 No response
connection are correct
Check whether the configuration and
6762 Response exception
connection are correct
Check whether the configuration and
6763 Can't identify returned data
connection are correct
Error step number D8346
Error
Save step number of
step — —
communication error
number
9-16
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
PLC Status
M8000 RUN monitor (NO contact) It is ON when RUN, and OFF when STOP ○ ○ ○
M8001 RUN monitor (NC contact) It is ON when RUN, and OFF when STOP ○ ○ ○
It is ON for a scan period when
M8002 Initial pulse (NO contact) ○ ○ ○
STOP→RUN
It is ON for a scan period when
M8003 Initial pulse (NC contact) ○ ○ ○
STOP→RUN
When M8061, M8064, M8065 and M8066
M8004 Error occurrence are ON, it will be ON, and PLC will be ○ ○ ○
forced to stop.
It will be ON when M8063, M8067 and
M8005 Warning error occurrence ○ ○ ○
M8069 are ON.
M8006 Low battery voltage It is ON when battery voltage is too low. × ○ ○
It is ON when battery voltage is too low,
Latch for low battery
M8007 while OFF when a power supply is × ○ ○
voltage
connected.
Clock
M8011 10ms period oscillation 5ms ON / 5ms OFF ○ ○ ○
M8012 100ms period oscillation 50ms ON / 50ms OFF ○ ○ ○
M8013 1s period oscillation 0.5s ON / 0.5s OFF ○ ○ ○
M8014 1min period oscillation 30s ON / 30s OFF ○ ○ ○
1:Stop timing
1→0 : Preset clock based on data of
M8015 Clock stop and preset D8013~D8019, and enable clock. ○ ○ ○
It will be reset when a power supply is
connected.
Stop reading/displaying clock time. It will
M8016 Stop displaying clock time ○ ○ ○
be reset when a power supply is connected.
M8017 ±30s offset +/-30s offset for internal time. It will be ○ ○ ○
9-17
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
reset when a power supply is connected.
Installation detection for internal time. ON
M8018 Installation detection ○ ○ ○
status indicates clock exists.
M8019 RTC error ON status indicates clock error ○ ○ ○
Flag
Computation result is 0 (F20 ADD, F21
SUB, F39 SFRD, F43 SUM, F48 SQR,
M8020 Zero ○ ○ ○
F120 EADD, F121 ESUB, F129 INT, F162
TADD, F163 TSUB)
Computation result is smaller than the
minimum negative number. (F20 ADD,
M8021 Borrow ○ ○ ○
F21 SUB, F48 SQR, F129 INT, F162
TADD, F163 TSUB)
Computation result is larger than the
maximum positive number. (F20 ADD,
M8022 Carry F21 SUB , F30 ROR , F31 ROL , F32 ○ ○ ○
RCR , F33 RCL , F38 SFWR , F129
INT,F162 TADD,F163 TSUB)
M8024 BMOV direction 0: forward; 1: reverse for F15 BMOV ○ ○ ○
M8026 RAMP mode 0: reset; 1: keep for F67 RAMP ○ ○ ○
M8027 PR mode 0: 8 bytes; 1: 16 bytes for F77 PR ○ ○ ○
FROM/TO interruption Interruption is permitted when executing
M8028 × ○ ○
enabled FROM/TO instruction.
It is on when the following instructions are
finished, F57 PLSY, F59 PLSR, F63
INCD, F67 RAMP, F69 SORT, F71 HKY,
F72 DSW, F74 SEGL, F77 PR, F156 ZRN,
M8029 Instruction execution ends F158 DRVI, F159 DRVA, F200 PPMI, ○ ○ ○
F201 PPMA, F202 CWI, F203 CWA, F204
PTPO, F205 CLLM, F206 VSPO, F210
LINI, F211 LINA, F212 CIMI, F213
CIMA.
PLC Mode
M8033 Memory holds in stop mode Memory hold ○ ○ ○
9-18
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
0:Save as required when STOP→RUN
1:Save all when STOP→RUN
It will be reset when a power supply is
connected.
1:output 0;
0:output Y;
M8034 Output prohibit ○ ○ ○
It will be reset when a power supply is
connected.
When M8035 is ON, the X specified by
D8035 can be used for RUN/STOP control.
M8035 Force RUN mode ○ ○ ○
It will be reset when a power supply is
connected.
When M8036 is on, the PLC will switch
from STOP to RUN.
M8036 Force RUN mode ○ ○ ○
It will be reset when a power supply is
connected.
When M8037 is on, the PLC will switch
from RUN to STOP.
M8037 Enforced stop instruction ○ ○ ○
It will be reset when a power supply is
connected.
1:Constant mode;
0:Non-constant mode;
M8039 Constant scan mode ○ ○ ○
It will be reset when a power supply is
connected.
Step Ladder
M8040 Transfer disabled Transfer is disabled when M8040 is ON. ○ ○ ○
It is the condition to transfer the initial
M8041 Transfer start ○[*2] ○ ○
status S2 to the next status.
Instant action when pressing the start
M8042 Enable pulse ○[*2] ○ ○
button
When M8047 is ON and any one of
M8046 STL state ON ○ ○ ○
S0~S899 is ON, M8064 will be ON.
As long as M8047 is ON, D8040~D8047
M8047 Enable STL monitor ○ ○ ○
are enabled.
9-19
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
When M8049 is ON and any one of
M8048 Annunciator ON ○ ○ ○
S900~S999 is ON, M8048 will be ON.
As long as M8049 is ON, D8049 is
M8049 Enable Annunciator ○ ○ ○
enabled.
Interruption Disable
Input interruption
M8050 ○ ○ ○
disable(I00*)
Input interruption
M8051 ○ ○ ○
disable(I10*)
Input interruption
M8052 ○ ○ ○
disable(I20*)
Input interruption
M8053 ○ ○ ○
disable(I30*)
Input interruption
M8054 ○ ○ ○
disable(I40*)
Input interruption
M8055 ○ ○ ○
disable(I50*)
Disable Interruption in ON status
Input interruption
M8055 Initialize to ON when status changes from ○ ○ ○
disable(I50*)
STOP to RUN
Input interruption
M8080 ○ ○ ○
disable(IA0*)
Input interruption
M8081 ○ ○ ○
disable(IB0*)
Input interruption
M8082 ○ ○ ○
disable(IC0*)
Timing interruption
M8083 ○ ○ ○
disable(IDxx)
Timing interruption
M8057 ○ ○ ○
disable(I7xx)
Timing interruption
M8058 ○ ○ ○
disable(I8xx)
Interruption disable for I010~I060
Counting interruption
M8059 Disable Interruption in ON status ○ ○ ○
disable
Initialize to ON when status changes from
9-20
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
STOP to RUN
Error Detection
M8060 Expansion card error ○ ○ ○
M8061 PLC hardware check PLC hardware exception ○ ○ ○
M8063 Communication error ○ ○ ○
M8064 Parameter error ○ ○ ○
M8065 Syntax error ○ ○ ○
M8066 Loop error ○ ○ ○
M8067 Computation error ○ ○ ○
M8068 Reserved ○ ○ ○
M8069 Expansion error ○ ○ ○
M8070 FROM/TO error × ○ ○
Expansion Function
When it is OFF, it remains the same as the
original expansion I/O.
When it is ON, the number of expansion
I/O is determined by D8110 and D8111.
I/O expansion function When the basic unit is connected with a
M8110 ○ ○ ○
enable power supply, and no terminal connector is
added, the enabling operation is valid.
Otherwise, it is invalid.
After a power supply is connected, M8110
will be reset.
When it is OFF, filter function is
unavailable.
When it is ON, the filter time is determined
by D8112(Filter function is available for
M8112 Input filter function enable ○ ○ ○
X0~X5 of AP series, while it is unavailable
for other inputs).
After a power supply is connected, M8112
will be reset.
Communication/Connection(RS485 communication port)
RS, MBUS instructions of RS485
M8121 Ready to send data ○ ○ ○
communication port
9-21
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
RS, MBUS instructions of RS485
M8122 Sending flag ○ ○ ○
communication port
RS, MBUS instructions of RS485
Flag of finishing reception
communication port
M8123 COIW, MCIR, MCIW, REGW, MRGR, ○ ○ ○
Flag of finishing
MRGW instructions of RS485
communication
communication port
MBUS, COIW, MCIR, MCIW, REGW,
M8124 Communication error MRGR, MRGW instructions of RS485 ○ ○ ○
communication port
PLC Status
Specifying ID enabled, which is 0 initially
M8128 Specifying ID enabled After the power is ON, M8128 will be ○ ○ ○
reset.
Communication/Connection(RS485 communication port)
RS instruction of RS485 communication
M8129 Timeout judgment ○ ○ ○
port
High Speed Platform/Position
M8130 Reserved ○ ○ ○
M8131 Reserved ○ ○ ○
M8132 Reserved ○ ○ ○
M8133 Reserved ○ ○ ○
M8134 Reserved ○ ○ ○
M8135 Reserved ○ ○ ○
M8136 Reserved ○ ○ ○
M8137 Reserved ○ ○ ○
M8138 Reserved ○ ○ ○
M8139 Reserved ○ ○ ○
Enable CLR signal output of ZRN
instruction
M8140 CLR signal output ○ ○ ○
AP100/AP200: Available for Y0/Y1
AP300:Available for Y0
Enable CLR signal output of ZRN
M8141 CLR signal output × × ○
instruction
9-22
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
AP300:Available for Y1
M8142 Reserved ○ ○ ○
M8143 Y000 pulse output finished ○ ○ ○
M8144 Y001 pulse output finished ○ ○ ○
Flag of Y000 pulse output
M8145 ○ ○ ○
stopped
Flag of Y001 pulse output
M8146 ○ ○ ○
stopped
Y000 pulse output
M8147 ○ ○ ○
monitoring (busy/read)
Y001 pulse output
M8148 ○ ○ ○
monitoring (busy/read)
Enable simultaneous output of Y000 and
M8149 Simultaneous output ○ ○ ○
Y001
Enable CLR signal output of ZRN
M8150 CLR signal output instruction × × ○
AP300:Available for Y2
Enable CLR signal output of ZRN
M8151 CLR signal output instruction × × ○
AP300:Available for Y3
M8153 Y002 pulse output finished × × ○
M8154 Y003 pulse output finished × × ○
Flag of Y002 pulse output
M8155 × × ○
stopped
Flag of Y003 pulse output
M8156 × × ○
stopped
Y002 pulse output
M8157 × × ○
monitoring (busy/read)
Y003 pulse output
M8158 × × ○
monitoring (busy/read)
Expansion Function
M8160 SWAP function In F17 XCH ○ ○ ○
In instructions of F76 ASC, F80 RS, F82
M8161 8 octal processing mode ASCI, F83 HEX, F84, CCD, F87 MBUS, ○ ○ ○
F188 CRC.
M8167 HEX data processing In F71 HKY ○ ○ ○
M8168 BIN-BCD conversion flag In F13 SMOV ○ ○ ○
9-23
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
processing
If M8170 is off, C252 will be reset by
X002.
M8170 The reset of C252 ○ ○ ○
If M8170 is on, C252 will be reset by
X005.
Counter Setting/Monitoring
Up/Down counting set for M8200~M8255 will be reset after a power
M8200 × ○ ○
C200 supply is connected.
Up/Down counting set for
M8201 × ○ ○
C201
Up/Down counting set for
M8202 × ○ ○
C202
Up/Down counting set for
M8203 × ○ ○
C203
Up/Down counting set for
M8204 × ○ ○
C204
Up/Down counting set for
M8205 × ○ ○
C205
Up/Down counting set for
M8206 × ○ ○
C206
Up/Down counting set for
M8207 × ○ ○
C207
Up/Down counting set for
M8208 × ○ ○
C208
Up/Down counting set for
M8209 × ○ ○
C209
Up/Down counting set for
M8210 × ○ ○
C210
Up/Down counting set for
M8211 × ○ ○
C211
Up/Down counting set for
M8212 × ○ ○
C212
Up/Down counting set for
M8213 × ○ ○
C213
9-24
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Up/Down counting set for
M8214 × ○ ○
C214
Up/Down counting set for
M8215 × ○ ○
C215
Up/Down counting set for
M8216 × ○ ○
C216
Up/Down counting set for
M8217 × ○ ○
C217
Up/Down counting set for
M8218 × ○ ○
C218
Up/Down counting set for
M8219 × ○ ○
C219
Up/Down counting set for
M8220 ○ ○ ○
C220
Up/Down counting set for
M8221 ○ ○ ○
C221
Up/Down counting set for
M8222 ○ ○ ○
C222
Up/Down counting set for
M8223 ○ ○ ○
C223
Up/Down counting set for
M8224 ○ ○ ○
C224
Up/Down counting set for
M8225 ○ ○ ○
C225
Up/Down counting set for
M8226 ○ ○ ○
C226
Up/Down counting set for
M8227 ○ ○ ○
C227
Up/Down counting set for
M8228 ○ ○ ○
C228
Up/Down counting set for
M8229 ○ ○ ○
C229
Up/Down counting set for
M8230 ○ ○ ○
C230
9-25
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Up/Down counting set for
M8231 ○ ○ ○
C231
Up/Down counting set for
M8232 ○ ○ ○
C232
Up/Down counting set for
M8233 ○ ○ ○
C233
Up/Down counting set for
M8234 ○ ○ ○
C234
Up/Down counting set for
M8235 ○ ○ ○
C235
Up/Down counting set for
M8236 ○ ○ ○
C236
Up/Down counting set for
M8237 ○ ○ ○
C237
Up/Down counting set for
M8238 ○ ○ ○
C238
Up/Down counting set for
M8239 ○ ○ ○
C239
Up/Down counting set for
M8240 ○ ○ ○
C240
Up/Down counting set for
M8241 ○ ○ ○
C241
Up/Down counting set for
M8242 ○ ○ ○
C242
Up/Down counting set for
M8243 ○ ○ ○
C243
Up/Down counting set for
M8244 ○ ○ ○
C244
Up/Down counting set for
M8245 ○ ○ ○
C245
Counting direction
M8246 ○ ○ ○
monitoring for C246
Counting direction
M8247 ○ ○ ○
monitoring for C247
9-26
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Counting direction
M8248 ○ ○ ○
monitoring for C248
Counting direction
M8249 ○ ○ ○
monitoring for C249
Counting direction
M8250 × ○ ○
monitoring for C250
Counting direction
M8251 ○ ○ ○
monitoring for C251
Counting direction
M8252 ○ ○ ○
monitoring for C252
Counting direction
M8253 ○ ○ ○
monitoring for C253
Counting direction
M8254 ○ ○ ○
monitoring for C254
Counting direction
M8255 × ○ ○
monitoring for C255
AD/DA
Total number of AD
M8257 ○ ○ ○
modules is wrong
Total number of DA module
M8258 ○ ○ ○
channels is wrong
Communication/connection(Expansion communication port 2)
RS, MBUS instructions of expansion
M8301 Ready to send data × × ○
communication port 2
RS, MBUS instructions of expansion
M8302 Sending flag × × ○
communication port 2
RS, MBUS, COIW, MCIR, MCIW,
M8303 Flag of finishing reception REGW, MRGR, MRGW instructions of × × ○
expansion communication port 2
MBUS, COIW, MCIR, MCIW, REGW,
M8304 Communication error MRGR, MRGW instructions of expansion × × ○
communication port 2
RS instruction of expansion
M8309 Timeout judgment × × ○
communication port 2
9-27
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Communication/connection(Expansion communication port 1)
RS, MBUS instructions of expansion
M8321 Ready to send data ○ ○ ○
communication port 1
RS, MBUS instructions of expansion
M8322 Sending flag ○ ○ ○
communication port 1
RS, MBUS, COIW, MCIR, MCIW,
M8323 Flag of finishing reception REGW, MRGR, MRGW instructions of ○ ○ ○
expansion communication port 1
MBUS, COIW, MCIR, MCIW, REGW,
M8324 Communication error MRGR, MRGW instructions of expansion ○ ○ ○
communication port 1
RS instruction of expansion
M8329 Timeout judgment ○ ○ ○
communication port 1
Communication/Connection(RMIO)
Communication error in
M8336 RMIO data transmission error ( master) ○[*2] ○ ○
master
Communication error in
M8337 RMIO data transmission error (slave 1) ○[*2] ○ ○
slave 1
Communication error in
M8338 RMIO data transmission error (slave 2) ○[*2] ○ ○
slave 2
Communication error in
M8339 RMIO data transmission error (slave 3) ○[*2] ○ ○
slave 3
Communication error in
M8340 RMIO data transmission error (slave 4) ○[*2] ○ ○
slave 4
Expansion communication Expansion communication port 1 is RMIO
M8341 ○[*2] ○ ○
port 1 is under RMIO mode
485 communication port 1
M8342 485 communication port 1 is RMIO mode ○[*2] ○ ○
is under RMIO
Expansion communication Expansion communication port 2 is RMIO
M8343 × × ○
port 2 is under RMIO mode
Communication/Connection(DTLK2)
Communication error in
M8400 DTLK2 data transmission error ( master) ○[*2] ○ ○
master
M8401 Communication error in DTLK2 data transmission error (slave 1) ○[*2] ○ ○
9-28
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
slave 1
Communication error in
M8402 DTLK2 data transmission error (slave 2) ○[*2] ○ ○
slave 2
Communication error in
M8403 DTLK2 data transmission error (slave 3) ○[*2] ○ ○
slave 3
Communication error in
M8404 DTLK2 data transmission error (slave 4) ○[*2] ○ ○
slave 4
Communication error in
M8405 DTLK2 data transmission error (slave 5) ○[*2] ○ ○
slave 5
Communication error in
M8406 DTLK2 data transmission error (slave 6) ○[*2] ○ ○
slave 6
Communication error in
M8407 DTLK2 data transmission error (slave 7) ○[*2] ○ ○
slave 7
Communication error in
M8408 DTLK2 data transmission error (slave 8) ○[*2] ○ ○
slave 8
Communication error in
M8409 DTLK2 data transmission error (slave 9) ○[*2] ○ ○
slave 9
Communication error in
M8410 DTLK2 data transmission error (slave 10) ○[*2] ○ ○
slave 10
Communication error in
M8411 DTLK2 data transmission error (slave 11) ○[*2] ○ ○
slave 11
Communication error in
M8412 DTLK2 data transmission error (slave 12) ○[*2] ○ ○
slave 12
Communication error in
M8413 DTLK2 data transmission error (slave 13) ○[*2] ○ ○
slave 13
Communication error in
M8414 DTLK2 data transmission error (slave 14) ○[*2] ○ ○
slave 14
Communication error in
M8415 DTLK2 data transmission error (slave 15) ○[*2] ○ ○
slave 15
M8416 Data communication status DTLK2 data communication status ○[*2] ○ ○
Expansion communication Expansion communication port 1 is
M8417 ○[*2] ○ ○
port 1 is under DTLK2 DTLK2 mode
485 communication port 1
M8418 485 communication port 1 is DTLK2 mode ○[*2] ○ ○
is under DTLK2
9-29
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Expansion communication Expansion communication port 2 is
M8419 × × ○
port 2 is under DTLK2 DTLK2 mode
AD/DA
Exception of AD module
M8436 ○[*1] ○ ○
channel 1
Exception of AD module
M8437 ○[*1] ○ ○
channel 2
Exception of AD module
M8438 ○[*1] ○ ○
channel 3
Exception of AD module
M8439 ○[*1] ○ ○
channel 4
Exception of AD module
M8440 ○[*1] ○ ○
channel 5
Exception of AD module
M8441 ○[*1] ○ ○
channel 6
Exception of AD module
M8442 ○[*1] ○ ○
channel 7
Exception of AD module
M8443 ○[*1] ○ ○
channel 8
Exception of AD module
M8444 ○[*1] ○ ○
channel 9
Exception of AD module
M8445 ○[*1] ○ ○
channel 10
Exception of AD module
M8446 ○[*1] ○ ○
channel 11
Exception of AD module
M8447 ○[*1] ○ ○
channel 12
Exception of AD module
M8448 ○[*1] ○ ○
channel 13
Exception of AD module
M8449 ○[*1] ○ ○
channel 14
Exception of AD module
M8450 ○[*1] ○ ○
channel 15
M8451 Exception of AD module ○[*1] ○ ○
9-30
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
channel 16
Exception of AD module
M8452 ○[*1] ○ ○
channel 17
Exception of AD module
M8453 ○[*1] ○ ○
channel 18
Exception of AD module
M8454 ○[*1] ○ ○
channel 19
Exception of AD module
M8455 ○[*1] ○ ○
channel 20
Exception of AD module
M8456 ○[*1] ○ ○
channel 21
Exception of AD module
M8457 ○[*1] ○ ○
channel 22
Exception of AD module
M8458 ○[*1] ○ ○
channel 23
Exception of AD module
M8459 ○[*1] ○ ○
channel 24
Exception of AD module
M8460 ○[*1] ○ ○
channel 25
Exception of AD module
M8461 ○[*1] ○ ○
channel 26
Exception of AD module
M8462 ○[*1] ○ ○
channel 27
Exception of AD module
M8463 ○[*1] ○ ○
channel 28
Exception of AD module
M8464 ○[*1] ○ ○
channel 29
Exception of AD module
M8465 ○[*1] ○ ○
channel 30
Exception of AD module
M8466 ○[*1] ○ ○
channel 31
Exception of AD module
M8467 ○[*1] ○ ○
channel 32
M8468 Exception of AD module ○[*1] ○ ○
9-31
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
channel 33
Exception of AD module
M8469 ○[*1] ○ ○
channel 34
Exception of AD module
M8470 ○[*1] ○ ○
channel 35
Exception of AD module
M8471 ○[*1] ○ ○
channel 36
Exception of AD module
M8472 ○[*1] ○ ○
channel 37
Exception of AD module
M8473 ○[*1] ○ ○
channel 38
Exception of AD module
M8474 ○[*1] ○ ○
channel 39
Exception of AD module
M8475 ○[*1] ○ ○
channel 40
Exception of AD module
M8476 ○[*1] ○ ○
channel 41
Exception of AD module
M8477 ○[*1] ○ ○
channel 42
Exception of AD module
M8478 ○[*1] ○ ○
channel 43
Exception of AD module
M8479 ○[*1] ○ ○
channel 44
Exception of AD module
M8480 ○[*1] ○ ○
channel 45
Exception of AD module
M8481 ○[*1] ○ ○
channel 46
Exception of AD module
M8482 ○[*1] ○ ○
channel 47
Exception of AD module
M8483 ○[*1] ○ ○
channel 48
Exception of AD module
M8484 ○[*1] ○ ○
channel 49
M8485 Exception of AD module ○[*1] ○ ○
9-32
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
channel 50
Exception of AD module
M8486 ○[*1] ○ ○
channel 51
Exception of AD module
M8487 ○[*1] ○ ○
channel 52
Exception of AD module
M8488 ○[*1] ○ ○
channel 53
Exception of AD module
M8489 ○[*1] ○ ○
channel 54
Exception of AD module
M8490 ○[*1] ○ ○
channel 55
Exception of AD module
M8491 ○[*1] ○ ○
channel 56
Exception of AD module
M8492 ○[*1] ○ ○
channel 57
Exception of AD module
M8493 ○[*1] ○ ○
channel 58
Exception of AD module
M8494 ○[*1] ○ ○
channel 59
Exception of AD module
M8495 ○[*1] ○ ○
channel 60
Counter Setting/Monitoring
Up/Down counting set for
M8500 × × ○
C500
Up/Down counting set for
M8501 × × ○
C501
Up/Down counting set for
M8502 × × ○
C502
Up/Down counting set for
M8503 × × ○
C503
Up/Down counting set for
M8504 × × ○
C504
Up/Down counting set for
M8505 × × ○
C505
9-33
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Counting direction
M8506 × × ○
monitoring for C506
Counting direction
M8507 × × ○
monitoring for C507
Counting direction
M8508 × × ○
monitoring for C508
○:Supported;×:Unsupported.
*1:AP100 1.1 and above versions are supported.
*2:AP100 1.2 and above versions are supported.
9-34
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
PLC Status
D8000 Monitor timer value ○ ○ ○
D8001 Model type ○ ○ ○
D8002 Version 10 represents 1.0 ○ ○ ○
D8003 ID ○ ○ ○
Save the corresponding buffer value when
D8004 Error code M8061, M8064, M8065 and M8066 are ○ ○ ○
ON. Please refer to error detection(D)
Save the corresponding buffer value when
D8005 Warning code M8060, M8063, M8067 ad M8069 are ON. ○ ○ ○
Please refer to error detection(D)
The maximum capacity is 4K for AP100,
D8006 Content memory ○ ○ ○
8K for AP200 and 24K for AP300.
Clock
D8010 Present scan time Present scan time(unit: 1ms) ○ ○ ○
D8011 Min scan time ○ ○ ○
D8012 Max scan time ○ ○ ○
D8013 Second(0~59) ○ ○ ○
D8014 Minute(0~59) ○ ○ ○
D8015 Hour(0~23) ○ ○ ○
D8016 日(1~31) ○ ○ ○
D8017 Month(1~12) ○ ○ ○
D8018 Year(2000~2099) ○ ○ ○
D8019 Week ○ ○ ○
Expansion Function
0: No card
1:AP-485BD expansion card
ID of expansion card
D8020 2:AP-232BD expansion card ○ ○ ○
(Expansion card port 1)
3:AP-COBD expansion card
4:AP-EMBD expansion card
9-35
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
5:AP-4DBD expansion card
6:AP-4RBD expansion card
7:AP-2D2TBD expansion card
ID of expansion card 8:AP-RTCBD expansion card
D8021
(Expansion card port 2) 9:AP-2AIBD expansion card
10:AP-1AOBD expansion card
11:AP-3MABD expansion card
12:AP-CAMBD expansion card
PLC Mode
Corresponding X is specified for
D8035 Force RUN Specifying ○ ○ ○
RUN/STOP control when M8035 is ON.
D8039 Constant scan time Unit: ms ○ ○ ○
Step Ladder
D8040 Save state address ○ ○ ○
The minimum address number for ON state
D8041 Save state address ○ ○ ○
among S0~S899 is saved in D8040, and the
D8042 Save state address ○ ○ ○
address numbers for ON state following it
D8043 Save state address ○ ○ ○
are saved in D8041~D8047. Based on this
D8044 Save state address ○ ○ ○
order, 8 components are saved, among
D8045 Save state address ○ ○ ○
which the largest component is saved in
D8046 Save state address ○ ○ ○
D8047. It is operated in RUN status.
D8047 Save state address ○ ○ ○
Save the minimum address for ON state
D8049 Save state address ○ ○ ○
among (S900 ~ S999)
Error Detection
See the Error Code List for more
D8060 Expansion card error ○ ○ ○
information
See the Error Code List for more
D8061 PLC hardware check ○ ○ ○
information
See the Error Code List for more
D8063 Communication detection ○ ○ ○
information
See the Error Code List for more
D8064 Parameter error ○ ○ ○
information
See the Error Code List for more
D8065 Syntax error ○ ○ ○
information
9-36
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
See the Error Code List for more
D8066 Loop error ○ ○ ○
information
See the Error Code List for more
D8067 Computation error ○ ○ ○
information
Preserve application instruction error step
D8068 Wrong step number ○ ○ ○
number
See the Error Code List for more
D8069 Expansion error ○ ○ ○
information
See the Error Code List for more
D8070 FROM/TO error × ○ ○
information
Expansion Function
The total number of input X(including host
input). When M8110 is ON, the total
D8110 The total number of input X ○ ○ ○
number of input X is determined by
D8110.
The total number of input Y(including host
D8111 The total number of input Y input). When M8111 is ON, the total ○ ○ ○
number of input Y is determined by D8111.
It is the input filter time in ms. When
D8112 Input filter time M8112 is ON, the input filter time is ○ ○ ○
filtered by D8112.
Communication/Connection(RS485 communication port)
Communication format for built-in RS485
D8120 Communication format ○ ○ ○
communication port is 89Hex by default.
Remaining number of Remaining number of data sent by built-in
D8122 ○ ○ ○
RS485 sending data RS485 communication port
Remaining number of data received by
D8123 Number of data received ○ ○ ○
built-in RS485 communication port
RS instruction of RS485 communication
D8124 Start character ○ ○ ○
port is 02Hex by default.
RS instruction of RS485 communication
D8125 End character ○ ○ ○
port is 03Hex by default.
Set time before sending(0~30000)ms for
D8126 Time before sending ○ ○ ○
instructions of COIW, MCIR, MCIW,
9-37
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
REGW, MRGR, MRGW, RS, MBUS in
RS485 communication port, which is 10ms
by default.
PLC Status
When M8128=1, it is taken as the ID.
D8128 Specify ID Beyond the range of 1~255, the default ○ ○ ○
value is 1.
Communication/Connection(RS485 communication port)
RS instruction of RS485 communication
Time for timeout judgment
port
D8129 Instructions of COIW, MCIR, MCIW, ○ ○ ○
Response timeout judgment REGW, MRGR, MRGW, RS, MBUS of
RS485 communication port
High Speed Platform/Position
D8136 Total number of pulses output from Y000 ○ ○ ○
Total pulse number to Y001
D8137 ○ ○ ○
D8136(low word), D8137(high word)
D8140 Total number of pulses output to Y000 ○ ○ ○
Total pulse number
D8141 D8140(low word), D8141(high word) ○ ○ ○
D8142 Total number of pulses output to Y001 ○ ○ ○
Total pulse number
D8143 D8142(low word), D8143(high word) ○ ○ ○
AP100/AP200: Base speed of Y000 and
D8145 Base speed Y001 ○ ○ ○
AP300: Base speed of Y000
D8146 AP100/AP200: Maximum speed of Y000 ○ ○ ○
and Y001
Maximum speed
D8147 AP300: Maximum speed of Y000 ○ ○ ○
D8146(low word), D8147(high word)
AP100/AP200: Acceleration/Deceleration
D8148 Acceleration time time for Y000 and Y001 ○ ○ ○
AP300: Acceleration time for Y000
Idle speed step number for Y000 when
D8149 Idle speed step number × ○ ○
executing F205 CLLM
D8150 Idle speed step number Idle speed step number for Y001 when × ○ ○
9-38
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
executing F205 CLLM
Proportion of feedback Feedback number for Y000 when
D8151 × ○ ○
number executing F205 CLLM
Proportion of feedback Feedback number for Y001 when
D8152 × ○ ○
number executing F205 CLLM
Idle speed step number for Y002 when
D8153 Idle speed step number × × ○
executing F205 CLLM
Idle speed step number for Y003 when
D8154 Idle speed step number × × ○
executing F205 CLLM
Proportion of feedback Feedback number for Y002 when
D8155 × × ○
number executing F205 CLLM
Proportion of feedback Feedback number for Y003 when
D8156 × × ○
number executing F205 CLLM
D8157 Deceleration time AP300:Deceleration time of Y000 × × ○
PWM Output
D8158 Y000 parameter time base 0:Parameter is in the unit of 1ms ○ ○ ○
1:Parameter is in the unit of 0.1ms
D8159 Y001 parameter time base ○ ○ ○
2:Parameter is in the unit of 0.01ms
High Speed Platform/Position
D8165 Base speed AP300; Base speed of Y001 × × ○
D8166 AP300; Maximum speed of Y001 × × ○
Maximum speed
D8167 D8166(Low word), D8167(High word) × × ○
D8168 Acceleration time AP300;Acceleration time of Y001 × × ○
D8169 Deceleration time AP300;Deceleration time of Y001 × × ○
Communication/Connection(DTLK2)
D8173 Station number Slave the local station number ○[*2] ○ ○
D8174 Total slave number Save the total slave number ○[*2] ○ ○
D8175 Reserved ○ ○ ○
D8176 Set station number Slave the local station number ○[*2] ○ ○
[*2]
D8177 Set total slave number Set the total slave number ○ ○ ○
D8178 Reserved ○ ○ ○
D8179 Set retry times Set retry times ○[*2] ○ ○
D8180 Set communication timeout Set communication timeout ○[*2] ○ ○
High Speed Platform/Position
9-39
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
D8190 AP300;Total number of pulses output to × × ○
Total pulse number Y002
D8191 × × ○
D8190(Low word), D8191(High word)
D8195 Base speed AP300; Base speed of Y002 × × ○
D8196 AP300; Maximum speed of Y002 × × ○
Maximum speed
D8197 D8196(Low word), D8197(High word) × × ○
D8198 Acceleration time AP300;Acceleration time for Y002 × × ○
D8199 Deceleration time AP300; Deceleration time for Y002 × × ○
D8200 AP300;Total number of pulses output to × × ○
Total pulse number Y003
D8201 × × ○
D8200(Low word), D8201(High word)
D8205 Base speed AP300; Base speed of Y003 × × ○
D8206 AP300; Maximum speed of Y003 × × ○
Maximum speed
D8207 D8196(Low word), D8197(High word) × × ○
D8208 Acceleration time AP300;Acceleration time for Y003 × × ○
D8209 Deceleration time AP300; Deceleration time for Y003 × × ○
AD/DA
D8257 Number of AD modules ○ ○ ○
Number of DA module To make a 2DA work normally, please set
D8259 ○ ○ ○
channels the value as 2.
0:No software filter; 1~3:Software filter
D8260 AD filter method ○ ○ ○
mode 1~3
D8261 AD1~4 channel mode Set module AD 1~4 channel mode ○ ○ ○
D8262 AD5~8 channel mode Set module AD 5~8 channel mode ○ ○ ○
D8263 AD9~12 channel mode Set module AD 9~12 channel mode ○ ○ ○
D8264 AD13~16 channel mode Set module AD 13~16 channel mode ○ ○ ○
D8265 AD17~20 channel mode Set module AD 17~20 channel mode ○ ○ ○
D8266 AD21~24 channel mode Set module AD 21~24 channel mode ○ ○ ○
D8267 AD25~28 channel mode Set module AD 25~28 channel mode ○ ○ ○
D8268 AD29~32 channel mode Set module AD 29~32 channel mode ○ ○ ○
D8269 AD33~36 channel mode Set module AD 33~36 channel mode ○ ○ ○
D8270 AD37~40 channel mode Set module AD 37~40 channel mode ○ ○ ○
D8271 AD41~44 channel mode Set module AD 41~44 channel mode ○ ○ ○
D8272 AD45~48 channel mode Set module AD 45~48 channel mode ○ ○ ○
9-40
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
D8273 AD49~52 channel mode Set module AD 49~52 channel mode ○ ○ ○
D8274 AD53~56 channel mode Set module AD 53~56 channel mode ○ ○ ○
D8275 AD57~60 channel mode Set module AD 57~60 channel mode ○ ○ ○
D8276 Reserved ○ ○ ○
DA1~4 channel operation
D8277 Set operation mode for DA 1~4 channels ○ ○ ○
mode
DA5~8 channel operation
D8278 Set operation mode for DA 5~8 channels ○ ○ ○
mode
DA9~10 channel operation Set operation mode for DA 9~10
D8279 ○ ○ ○
mode channels
Communication/connection(Expansion communication port 2)
Communication format for expansion
D8300 Communication format × × ○
communication port 2 is 89Hex by default.
Remaining number of Remaining number of data sent by
D8302 × × ○
RS485 sending data expansion communication port 2
Number of data received by expansion
D8303 Number of data received × × ○
communication port 2
Start character of expansion
D8304 Start character communication port 2, RS instruction × × ○
02Hex
End character of expansion communication
D8305 End character × × ○
port 2, RS instruction 03Hex
Set time before sending(0~30000)ms for
instructions of COIW, MCIR, MCIW,
D8306 Time before sending REGW, MRGR, MRGW, RS, MBUS in × × ○
expansion communication port 2, which is
10ms by default.
Time for timeout judgment for expansion
Time for timeout judgment
communication port 2, in RS instruction
Response timeout judgment for expansion
D8309 × × ○
communication port 2, in instructions of
Response timeout judgment
COIW, MCIR, MCIW, REGW, MRGR,
MRGW, RS, MBUS
Communication/connection(Expansion communication port 1)
9-41
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Communication format for expansion
D8320 Communication format ○ ○ ○
communication port 1 is 89Hex by default.
Communication format for The communication format for PG port is
D8321 ○ ○ ○
PG port 89Hex by default.
Remaining number of Remaining number of data sent by
D8322 ○ ○ ○
RS485 sending data expansion communication port 1
Number of data received by expansion
D8323 Number of data received ○ ○ ○
communication port 1
Start character of expansion
D8324 Start character communication port 1, RS instruction ○ ○ ○
02Hex
End character of expansion communication
D8325 End character ○ ○ ○
port 1, RS instruction 03Hex
Set time before sending(0~30000)ms for
instructions of COIW, MCIR, MCIW,
D8326 Time before sending REGW, MRGR, MRGW, RS, MBUS in ○ ○ ○
expansion communication port 1, which is
10ms by default.
Time for timeout judgment for expansion
Time for timeout judgment
communication port 1, in RS instruction
Response timeout judgment for expansion
D8329 ○ ○ ○
communication port 1, in instructions of
Response timeout judgment
COIW, MCIR, MCIW, REGW, MRGR,
MRGW, RS, MBUS
Communication/Connection(RMIO)
D8331 Current network scan time Current network scan time for RMIO ○[*2] ○ ○
Maximum network scan
D8332 Maximum network scan time for RMIO ○[*2] ○ ○
time
Error counting number Communication error count of RMIO
D8333 ○[*2] ○ ○
(master) master
Error counting number Communication error count of RMIO slave
D8334 ○[*2] ○ ○
(slave 1) 1
Error counting number Communication error count of RMIO slave
D8335 ○[*2] ○ ○
(slave 2) 2
9-42
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Error counting number Communication error count of RMIO slave
D8336 ○[*2] ○ ○
(slave 3) 3
Error counting number Communication error count of RMIO slave
D8337 ○[*2] ○ ○
(slave 4) 4
Communication error code of RMIO
D8338 Error code(master) ○[*2] ○ ○
master
Communication error code of RMIO slave
D8339 Error code (slave 1) ○[*2] ○ ○
1
Communication error code of RMIO slave
D8340 Error code (slave 2) ○[*2] ○ ○
2
Communication error code of RMIO slave
D8341 Error code (slave 3) ○[*2] ○ ○
3
Communication error code of RMIO slave
D8342 Error code (slave 4) ○[*2] ○ ○
4
Error Detection
See the Error Code List for more
D8345 Communication error ○ ○ ○
information
D8346 Wrong step number Save step number of communication error ○ ○ ○
AD/DA
D8351 4TM module 1 data Save the temperature data of module 1 ○ ○ ○
D8352 4TM module 2 data Save the temperature data of module 2 ○ ○ ○
D8353 4TM module 3 data Save the temperature data of module 3 ○ ○ ○
D8354 4TM module 4 data Save the temperature data of module 4 ○ ○ ○
D8355 4TM module 5 data Save the temperature data of module 5 ○ ○ ○
D8356 4TM module 6 data Save the temperature data of module 6 ○ ○ ○
D8357 4TM module 7 data Save the temperature data of module 7 ○ ○ ○
D8358 4TM module 8 data Save the temperature data of module 8 ○ ○ ○
Value of channel 1 on AD Save the data of channel 1 read from AD
D8360 ○ ○ ○
expansion card 1 expansion card 1
Value of channel 2 on AD Save the data of channel 2 read from AD
D8361 ○ ○ ○
expansion card 1 expansion card 1
Value of channel 3 on AD Save the data of channel 3 read from AD
D8362 ○ ○ ○
expansion card 1 expansion card 1
D8363 Value of channel 4 on AD Save the data of channel 4 read from AD ○ ○ ○
9-43
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
expansion card 1 expansion card 1
Value of channel 1 on AD Save the data of channel 1 read from AD
D8364 ○ ○ ○
expansion card 2 expansion card 2
Value of channel 2 on AD Save the data of channel 2 read from AD
D8365 ○ ○ ○
expansion card 2 expansion card 2
Value of channel 3 on AD Save the data of channel 3 read from AD
D8366 ○ ○ ○
expansion card 2 expansion card 2
Value of channel 4 on AD Save the data of channel 4 read from AD
D8367 ○ ○ ○
expansion card 2 expansion card 2
Value of channe1 1 on DA Save the data written in channel 1 on DA
D8368 ○ ○ ○
expansion card 1 expansion card 1
Value of channe1 1 on DA Save the data written in channel 1 on DA
D8369 ○ ○ ○
expansion card 2 expansion card 2
Value of channe1 2 on DA Save the data written in channel 2 on DA
D8370 ○ ○ ○
expansion card 1 expansion card 1
Value of channe1 2 on DA Save the data written in channel 2 on DA
D8371 ○ ○ ○
expansion card 2 expansion card 2
Communication/Connection(RMIO)
Station number setting state for RMIO
D8373 Station number(read only) ○[*2] ○ ○
local station
Slave number setting state for RMIO
D8374 Slave number(read only) ○[*2] ○ ○
communication slave
Station number setting state for RMIO
D8376 Set station number ○[*2] ○ ○
local station
Slave number setting state for RMIO
D8377 Set slave number ○[*2] ○ ○
communication slave
D8379 Set retry times Set RMIO retry times ○[*2] ○ ○
D8380 Timeout setting RMIO timeout setting ○[*2] ○ ○
AD/DA
Number of DA module Save the data written in channel 1 on DA
D8381 ○ ○ ○
channel 1 expansion card
Number of DA module Save the data written in channel 2 on DA
D8382 ○ ○ ○
channel 2 expansion card
D8383 Number of DA module Save the data written in channel 3 on DA ○ ○ ○
9-44
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
channel 3 expansion card
Number of DA module Save the data written in channel 4 on DA
D8384 ○ ○ ○
channel 4 expansion card
Number of DA module Save the data written in channel 5 on DA
D8385 ○ ○ ○
channel 5 expansion card
Number of DA module Save the data written in channel 6 on DA
D8386 ○ ○ ○
channel 6 expansion card
Number of DA module Save the data written in channel 7 on DA
D8387 ○ ○ ○
channel 7 expansion card
Number of DA module Save the data written in channel 8 on DA
D8388 ○ ○ ○
channel 8 expansion card
Number of DA module Save the data written in channel 9 on DA
D8389 ○ ○ ○
channel 9 expansion card
Number of DA module Save the data written in channel 10 on DA
D8390 ○ ○ ○
channel 10 expansion card
Communication/Connection(DTLK2)
D8401 Current network scan time DTLK2 current network scan time ○[*2] ○ ○
Maximum network scan
D8402 DTLK2 maximum network scan time ○[*2] ○ ○
time
Error counting number Communication error count of DTLK2
D8403 ○[*2] ○ ○
(master) master
Error counting number Communication error count of DTLK2
D8404 ○[*2] ○ ○
(slave 1) slave 1
Error counting number Communication error count of DTLK2
D8405 ○[*2] ○ ○
(slave 2) slave 2
Error counting number Communication error count of DTLK2
D8406 ○[*2] ○ ○
(slave 3) slave 3
Error counting number Communication error count of DTLK2
D8407 ○[*2] ○ ○
(slave 4) slave 4
Error counting number Communication error count of DTLK2
D8408 ○[*2] ○ ○
(slave 5) slave 5
Error counting number Communication error count of DTLK2
D8409 ○[*2] ○ ○
(slave 6) slave 6
D8410 Error counting number Communication error count of DTLK2 ○[*2] ○ ○
9-45
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
(slave 7) slave 7
Error counting number Communication error count of DTLK2
D8411 ○[*2] ○ ○
(slave 8) slave 8
Error counting number Communication error count of DTLK2
D8412 ○[*2] ○ ○
(slave 9) slave 9
Error counting number Communication error count of DTLK2
D8413 ○[*2] ○ ○
(slave 10) slave 10
Error counting number Communication error count of DTLK2
D8414 ○[*2] ○ ○
(slave 11) slave 11
Error counting number Communication error count of DTLK2
D8415 ○[*2] ○ ○
(slave 12) slave 12
Error counting number Communication error count of DTLK2
D8416 ○[*2] ○ ○
(slave 13) slave 13
Error counting number Communication error count of DTLK2
D8417 ○[*2] ○ ○
(slave 14) slave 14
Error counting number Communication error count of DTLK2
D8418 ○[*2] ○ ○
(slave 15) slave 15
Communication error code of DTLK2
D8419 Error code(master) ○[*2] ○ ○
master
Communication error code of DTLK2
D8420 Error code (slave 1) ○[*2] ○ ○
slave 1
Communication error code of DTLK2
D8421 Error code (slave 2) ○[*2] ○ ○
slave 2
Communication error code of DTLK2
D8422 Error code (slave 3) ○[*2] ○ ○
slave 3
Communication error code of DTLK2
D8423 Error code (slave 4) ○[*2] ○ ○
slave 4
Communication error code of DTLK2
D8424 Error code (slave 5) ○[*2] ○ ○
slave 5
Communication error code of DTLK2
D8425 Error code (slave 6) ○[*2] ○ ○
slave 6
Communication error code of DTLK2
D8426 Error code (slave 7) ○[*2] ○ ○
slave 7
D8427 Error code (slave 8) Communication error code of DTLK2 ○[*2] ○ ○
9-46
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
slave 8
Communication error code of DTLK2
D8428 Error code (slave 9) ○[*2] ○ ○
slave 9
Communication error code of DTLK2
D8429 Error code (slave 10) ○[*2] ○ ○
slave 10
Communication error code of DTLK2
D8430 Error code (slave 11) ○[*2] ○ ○
slave 11
Communication error code of DTLK2
D8431 Error code (slave 12) ○[*2] ○ ○
slave 12
Communication error code of DTLK2
D8432 Error code (slave 13) ○[*2] ○ ○
slave 13
Communication error code of DTLK2
D8433 Error code (slave 14) ○[*2] ○ ○
slave 14
Communication error code of DTLK2
D8434 Error code (slave 15) ○[*2] ○ ○
slave 15
AD/DA
Data of AD module channel Save the data of channel 1 read from AD
D8436 ○ ○ ○
1 expansion module
Data of AD module channel Save the data of channel 2 read from AD
D8437 ○ ○ ○
2 expansion module
Data of AD module channel Save the data of channel 3 read from AD
D8438 ○ ○ ○
3 expansion module
Data of AD module channel Save the data of channel 4 read from AD
D8439 ○ ○ ○
4 expansion module
Data of AD module channel Save the data of channel 5 read from AD
D8440 ○ ○ ○
5 expansion module
Data of AD module channel Save the data of channel 6 read from AD
D8441 ○ ○ ○
6 expansion module
Data of AD module channel Save the data of channel 7 read from AD
D8442 ○ ○ ○
7 expansion module
Data of AD module channel Save the data of channel 8 read from AD
D8443 ○ ○ ○
8 expansion module
Data of AD module channel Save the data of channel 9 read from AD
D8444 ○ ○ ○
9 expansion module
9-47
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Data of AD module channel Save the data of channel 10 read from AD
D8445 ○ ○ ○
10 expansion module
Data of AD module channel Save the data of channel 11 read from AD
D8446 ○ ○ ○
11 expansion module
Data of AD module channel Save the data of channel 12 read from AD
D8447 ○ ○ ○
12 expansion module
Data of AD module channel Save the data of channel 13 read from AD
D8448 ○ ○ ○
13 expansion module
Data of AD module channel Save the data of channel 14 read from AD
D8449 ○ ○ ○
14 expansion module
Data of AD module channel Save the data of channel 15 read from AD
D8450 ○ ○ ○
15 expansion module
Data of AD module channel Save the data of channel 16 read from AD
D8451 ○ ○ ○
16 expansion module
Data of AD module channel Save the data of channel 17 read from AD
D8452 ○ ○ ○
17 expansion module
Data of AD module channel Save the data of channel 18 read from AD
D8453 ○ ○ ○
18 expansion module
Data of AD module channel Save the data of channel 19 read from AD
D8454 ○ ○ ○
19 expansion module
Data of AD module channel Save the data of channel 20 read from AD
D8455 ○ ○ ○
20 expansion module
Data of AD module channel Save the data of channel 21 read from AD
D8456 ○ ○ ○
21 expansion module
Data of AD module channel Save the data of channel 22 read from AD
D8457 ○ ○ ○
22 expansion module
Data of AD module channel Save the data of channel 23 read from AD
D8458 ○ ○ ○
23 expansion module
Data of AD module channel Save the data of channel 24 read from AD
D8459 ○ ○ ○
24 expansion module
Data of AD module channel Save the data of channel 25 read from AD
D8460 ○ ○ ○
25 expansion module
Data of AD module channel Save the data of channel 26 read from AD
D8461 ○ ○ ○
26 expansion module
9-48
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Data of AD module channel Save the data of channel 27 read from AD
D8462 ○ ○ ○
27 expansion module
Data of AD module channel Save the data of channel 28 read from AD
D8463 ○ ○ ○
28 expansion module
Data of AD module channel Save the data of channel 29 read from AD
D8464 ○ ○ ○
29 expansion module
Data of AD module channel Save the data of channel 30 read from AD
D8465 ○ ○ ○
30 expansion module
Data of AD module channel Save the data of channel 31 read from AD
D8466 ○ ○ ○
31 expansion module
Data of AD module channel Save the data of channel 32 read from AD
D8467 ○ ○ ○
32 expansion module
Data of AD module channel Save the data of channel 33 read from AD
D8468 ○ ○ ○
33 expansion module
Data of AD module channel Save the data of channel 34 read from AD
D8469 ○ ○ ○
34 expansion module
Data of AD module channel Save the data of channel 35 read from AD
D8470 ○ ○ ○
35 expansion module
Data of AD module channel Save the data of channel 36 read from AD
D8471 ○ ○ ○
36 expansion module
Data of AD module channel Save the data of channel 37 read from AD
D8472 ○ ○ ○
37 expansion module
Data of AD module channel Save the data of channel 38 read from AD
D8473 ○ ○ ○
38 expansion module
Data of AD module channel Save the data of channel 39 read from AD
D8474 ○ ○ ○
39 expansion module
Data of AD module channel Save the data of channel 40 read from AD
D8475 ○ ○ ○
40 expansion module
Data of AD module channel Save the data of channel 41 read from AD
D8476 ○ ○ ○
41 expansion module
Data of AD module channel Save the data of channel 42 read from AD
D8477 ○ ○ ○
42 expansion module
Data of AD module channel Save the data of channel 43 read from AD
D8478 ○ ○ ○
43 expansion module
9-49
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
Data of AD module channel Save the data of channel 44 read from AD
D8479 ○ ○ ○
44 expansion module
Data of AD module channel Save the data of channel 45 read from AD
D8480 ○ ○ ○
45 expansion module
Data of AD module channel Save the data of channel 46 read from AD
D8481 ○ ○ ○
46 expansion module
Data of AD module channel Save the data of channel 47 read from AD
D8482 ○ ○ ○
47 expansion module
Data of AD module channel Save the data of channel 48 read from AD
D8483 ○ ○ ○
48 expansion module
Data of AD module channel Save the data of channel 49 read from AD
D8484 ○ ○ ○
49 expansion module
Data of AD module channel Save the data of channel 50 read from AD
D8485 ○ ○ ○
50 expansion module
Data of AD module channel Save the data of channel 51 read from AD
D8486 ○ ○ ○
51 expansion module
Data of AD module channel Save the data of channel 52 read from AD
D8487 ○ ○ ○
52 expansion module
Data of AD module channel Save the data of channel 53 read from AD
D8488 ○ ○ ○
53 expansion module
Data of AD module channel Save the data of channel 54 read from AD
D8489 ○ ○ ○
54 expansion module
Data of AD module channel Save the data of channel 55 read from AD
D8490 ○ ○ ○
55 expansion module
Data of AD module channel Save the data of channel 56 read from AD
D8491 ○ ○ ○
56 expansion module
Data of AD module channel Save the data of channel 57 read from AD
D8492 ○ ○ ○
57 expansion module
Data of AD module channel Save the data of channel 58 read from AD
D8493 ○ ○ ○
58 expansion module
Data of AD module channel Save the data of channel 59 read from AD
D8494 ○ ○ ○
59 expansion module
Data of AD module channel Save the data of channel 60 read from AD
D8495 ○ ○ ○
60 expansion module
9-50
Chapter 9 Supplementary Interpretation of Basic Functions Error Code List
Applicable to
No. Name Action . Function
AP100 AP200 AP300
D8496 Channel reserved for AD ○ ○ ○
D8497 Channel reserved for AD ○ ○ ○
D8498 Channel reserved for AD ○ ○ ○
D8499 Channel reserved for AD ○ ○ ○
○:Supported;×:Unsupported.
*1:AP100 1.1 and above versions are supported.
*2:AP100 1.2 and above versions are supported.
9-51