TP03 Programming Manual en V06
TP03 Programming Manual en V06
0
Summary
1. PLC Component
Product summary
TP03 M type: 20 / 30 points
Built-in Flash memory ( 8,000 Steps )
Retentive data with lithium battery
Can expand to 128 points
Can expand 8 channels AD input & 2 channels DA output
Programming mode
Instruction list (IL) programming
It refers to the sequential control instruction input with LD, AND, OUT and etc., and
such mode is the basic input form for programming sequential control program, however,
the content is hard to understand.
For example:
Step No. Instruction Device
0 LD X000
1 OR Y005
2 ANI X001
3 OUT Y005
1
Summary
1. PLC Component
X000 X001
Y005
Y005
S0 Initial state
Transfer Start
conditions
S 20 Rise
Return S0
Of the above three programmed sequential control program, they are stored in memory of
PLC in instruction list (content of the instruction list), therefore, representation and edition of the
program in accordance with chart below can be exchanged (even it is instruction list program,
according to SFC conversion rule, devices corresponding to SFC chart can be used to represent
program based on instructions).
Instruction
list
Ladder
SFC
chart
2
Device
[Link] component
There are so many relays, counters and timers in PLC, and they have many contacts a
(normally open contact) and contacts b (normally close contact). These contacts and coils make up
sequential control loop. The arrow represents signal transfer.
In addition, there is memory device used to store data in PLC-data register (D).
Input terminal or
input connector
Input relay: X
Interface for receiving extenral switching signal of PLC is input relay, and symbol of the device is X.
PLC is installed with input relay with corresponding number of points.
Auxiliary relay:
Counter: C
M
There are several
PLC has several
counters in PLC, Output relay: Y
auxiliary relays,
Timer: T and symbol of the
and symbol of Interface for
PLC has many device is C.
the device is M. driving external
timers, and
load of PLC is
symbol of the
output relay and
device is T.
State: S symbol of the
PLC has devices device is Y.
of several states, PLC can have
and the symbol is several output
S. relays.
3
Device
[Link] component
4
Device
[Link] component
5
Memory and
1. PLC Component
parameter
Power Power
Type of storage devices STOP→ RUN RUN→STOP
OFF OFF→ON
A: Battery, Flash memory backup
No change
supporting series storage device
B: Special M and D, index register Clear Setting of initial No change☆
value ☆
C: Other non-backup supporting No change Clear
Clear
series storage device No change of M8033 drive
☆ The represented part will be cleared from STOP→ RUN, please pay attention.
6
Memory and
1. PLC Component
parameter
Parameter structure
The parameters are used to specify range of holding in case of power failure and capacities of
annotation and file registers, and setting and change of parameters can be executed via
PC/PDA LINK. Regarding operation and its details, please refer to Help text of PC/PDA
LINK. Refer to TP03 operating manual of functions of the parameters.
Parameter type and setting content
① Settings of storage device capacity: D8006.
② Settings of locking range: it is used to change range of holding in case of power failure of
PLC.
③ Password registration Password can be set, which is used to error writing of programmed
sequential control program or embezzlement, however, for online operation of programming
software, password can be used to set 3 protection levels.
④ Other parameters: it is used to set validity/invalidity of RUN/STOP, specify non-battery
operation mode and set PC general communication.
Initial values of parameter settings
TP03 M/H Type
Item Initial value PC/PDA device
Capacity of storage 8K (M/H 20&30 points)
Program capacity ⊙
device 16K (40&60 points)
Annotation capacity 0 ⊙
Locking range Auxiliary relay (M) 500-1023 (0-1023) ⊙
(Holding range in State (S) 500-999 (0-1023) ⊙
case of power failure) Counter (C) (16) 100-199 (0-199) ⊙
Counter (C) (32) 200-255 (200-255) ⊙
Data register (D) 200-511 (0-511) ⊙
Password None ⊙
Input setting of terminal RUN None ⊙
Input number of terminal RUN None ⊙
PC general communication settings None ⊙
TP03 SR Type
Item Initial value PC/PDA device
Capacity of Program capacity 4K (S 14&20&26&36 points) ⊙
storage device Annotation capacity 0 ⊙
Locking range Auxiliary relay (M) 500-1023 (0-1023) ⊙
(Holding range in State (S) 500-999 (0-1023) ⊙
case of power Counter (C) (16) 90-99 (0-99) ⊙
failure) Counter (C) (32) 220-255 (220-255) ⊙
Data register (D) 400-511 (400-511) ⊙
Password None ⊙
Input setting of terminal RUN None ⊙
Input number of terminal RUN None ⊙
PC general communication settings None ⊙
⊙ : Change available
7
Notes
1. PLC component
Action time sequence and response lagging of input and output relays
[Input processing]
Input image
storage zone
[Program processing]
Refreshing of image
storage zone of
devices
[Output processing]
Transferring to
output locking zone
Output
Input processing ( Time)
processing Scan cycle
See the left chart, the same coil Y003 can be used at
Output processing
X001=ON X002=OFF
several points.
For example, take X001=ON, X002=OFF
X001
Y003
For initial Y003, for X001 is ON, the image storage zone
X003
Y004 is ON, the output Y004 is ON.
X002
Y003 However, for the secondary Y003, the input X002 is OFF.
Therefore, the image storage zone is rewritten OFF.
Output processing Therefore, actual external output Y003=OFF, Y004=ON.
Y003=OFF Y004=ON
8
2.Functions of device Table of Contents
0
2.Functions of device Table of Contents
Chapter II Device
1 Processing of digits, constants K and H
Processing of digits
Conversion of digits
Hexadecimal
Octonary digit Decimal system digit Binary digit
system digit BCD
OCT DEC BIN
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
15 13 0D 0000 1101 0001 0011
: : : : : : :
143 99 63 0110 0011 1001 1001
Device Internal device BCD digit
Internal
Main numbers of numbers except switch, 7
Constant H processing
Application input and constant, input and codes
of PLC
output relays output relays monitor
1
2.Functions of device List of device
numbers
PLC of TP03 series has 4 basic programming elements. To identify varieties of programming
elements, different symbols are specified. It is stated below:
X: Input relay, for storing on and off the external input circuit.
Y: Output relay, used to output physical signal from PLC directly.
M: Auxiliary relay and S: status relay: internal computation symbol of PLC.
There are 512 points for X and Y of relay, actual I/O module can be used for output and input, and
the left points are used as auxiliary relay. Numbers of X and Y is octonary digital system, such as
X000~X007, X010 after X007 not X008.
2
2.Functions of device List of device
numbers
※1 Non-keeping field for power failure Parameters are used to set and change the keeping field
for the keeping field for power failure.
※2 Keeping field for power failure Parameters can be used to set and non-keeping field for power
failure.
※3 Fixing range for keeping in case of power failure, and the keeping range can not be changed.
※4 Refer to list of special elements.
※5 Non-keeping field for power failure Parameters are not used to set and change the keeping
field for the keeping field for power failure.
3
2.Functions of device List of device
numbers
※1 Non-keeping field for power failure Parameters are used to set and change the keeping field
for the keeping field for power failure.
※2 Keeping field for power failure Parameters can be used to set and non-keeping field for power
failure.
※3 Fixing range for keeping in case of power failure, and the keeping range can not be changed.
※4 Refer to list of special elements.
※5 Non-keeping field for power failure Parameters are not used to set and change the keeping
field for the keeping field for power failure.
4
2. Functions of device Input and output
relays
Input relay is the window for PLC receiving external switching quantity. PLC reads and stores
external signal conditions into image memory. 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 or electronic sensor (such as, proximity switch). In
Ladder Logic, normally closed contact and closed contact of input relay can be used for many
times.
PLC of output relay is the window for PLC sending loading signal, the output relay is used to
transmit output signal of PLC to the output module and the later one drives external loading.
5
2. Functions of device Input and output
relays
Function
The following is the sketch map of PLC control system. When external input circuit of
X000 terminal is get connected, the corresponding input image memory is “1” and “0” when it is
disconnected. Status of input relay only depends on status of external input signal, which is not
controlled by users’ program. Therefore, there will not be coil of input relay in Ladder Logic
When Y000 coil is connected, normally opened contact of corresponding hardware relay of
output module of relay is closed and the external loading works. Each relay in the output relay
has only one contact, however, in Ladder Logic, normally opened contact and closed contact of
each output relay can be used for many times.
External power
supply
COM1 COM1
Program row
X000 X001
X000 X000 Y000 Y000
Load
Y000
X000 Y000
Input Normally Output
terminal opened contact terminal
X000 Y000 Normally
PLC
closed contact
Input terminal is the terminal for receiving Output terminal is the terminal connected to the
external input switch signal. PLC input terminal outside. The output relay is the point for
is connected to input component X which is an external output (transistor, double-direction
electronic relay with optical coupling features, flow, the relay is used for output terminal in
and it owns several normally opened contacts (a PLC). The output relay on PLC has many
point) and normally closed contact (b point). normally opened/closed contacts and can be
Theses points are used in PLC and input relay used. External output point and internal point
can not be driven in program. can be seen below.
6
2. Functions of device Input and output
relays
Y000
●Program processing
Y001 PLC reads out ON/OFF
Output terminal
7
2. Functions of device Auxiliary relay M
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
Number of auxiliary relay M is stated blow: the number is distributed according to decimal
system.
※1 Non-keeping field for power failure Parameters are used to set and change the keeping field
for the keeping field for power failure.
※2 Keeping field for power failure Parameters can be used to set and non-keeping field for power
failure.
※3 Fixing range for keeping in case of power failure, and the keeping range can not be changed.
Distribution of auxiliary relays for general use and keeping for power
M 100 down in TP03 can be set and adjusted through PC/PDA link.
N orm ally opened contact
M 100
N orm ally closed contact
8
2. Functions of device Auxiliary relay M
X000
SET M600 LS1(X000) LS2(X001)
X001
RST M600
When it is operated for a second time, direction of advance is the same as the direction before
power failure.
X000 X001
Right drive
M600 command
M600 X000=ON (Left limit switch) →M600=ON→ Right
drive → Power off→ Platform stops → Operate a second
X001 X000 time (M600=ON) →X001=ON (Right limit switch)
Left drive
M601 command →M600=OFF, M601=ON→ Left drive.
M601
9
2. Functions of device Auxiliary relay M
Special use
There are 512 special auxiliary relay in the PLC. These relays have its specified functions, which
are divided into two types:
a. (Special auxiliary relay with contact functioning): drive coil of PLC is used, and the user can
use such contact.
M8000: Operation monitor
M8002: Initial pulse
M8012: 100ms cycle oscillation
The user can not use undefined special auxiliary relay.
b. (Special auxiliary relay with coil drive): the users can drive these coils for specified operation.
M8033: Keep memory as required
M8034: All outputs forbidden
M8039: Constant scanning
Please note that there are two validities when driving and after executing END.
10
2. Functions of device Status
Status
The status relay is a kind of programming element for programming sequence control and it is
used with commands of STL and RET described in chapter 4. The status relay for general use does
not have the function of keeping in case of power failure. The relay for keeping in case of power
failure can utilize the built-in backup battery or Flash memory of PLC for storing ON/OFF.
The status number S is stated blow (distributed according to decimal system).
TP03M/H machine type
Status relay S0~S499 500 points S500 ~ S1023 524 points S1024 ~ S4095
S ※1 for general use ※2 for keeping 3072 points
S0~S9 for initialization S900 ~ S999 ※3 for keeping
/ S10~S19 for origin return 100 points for alarm
※1 Non-keeping field for power failure Parameters are used to set and change the keeping
field for the keeping field for power failure.
※2 Keeping field for power failure Parameters can be used to set and non-keeping field for
power failure.
※3 Relevant features for keeping for power failure, which can not change with parameters.
11
2. Functions of device Status
X001
S10 Like status relay, auxiliary relay has many normally opened and closed
S10
contacts, it can be used within the sequence control procedure.
M30
In addition, if it is not used for step echelon command, status relay S
Y005 and auxiliary relay M can be used in general sequence control.
PLC can change distribution for general use and power off use via setting of PC/PDA link
parameters.
12
2.Counter Counter C
Number of timer
TP03M/H machine type
Timer T T0~T199 200 points T200~T245 T246~T249 T250~T255 T256~T511
100ms 46 points 4 points,1ms in total 6 points,100ms 256 points,
(For sub-program 10ms (For sub-program in total 1ms
T192~T199) T246~T249)
Y000
13
2.Counter Counter C
14
2.Counter Counter C
The 1st cycle The 2nd cycle The nth cycle The (n+1)th cycle
Seen from the above figure, action precision of timer contact from driving coil to finishing, it can
be expressed in the followings:
(T+To) ~ (T-α)
a: Correspondent with 1ms, 10ms and 100ms of the counter, namely 0.001, 0.01 and 0.1Second
T: Setting time of timer (S)
To: Scanning cycle (S)
When programming, the timer contact shall be written before the coil command, with maximum
error +2T.
When setting value of the timer is 0 and the next coil command for scanning is executed, the
output contact starts acting. In addition, after 1ms counter of interrupting execution executes coil
command, 1ms clock pulse counting is executed in interruption mode.
Case of actions
Output delay on and off timer
X001 T5
X001
Y000
X001
Y000 K200 20Seconds
T5 T5
Sparkling point
When programming, the timer contact shall be written before the coil command, with maximum
error +2T.
When setting value of the timer is 0 and the next coil command for scanning is executed, the
output contact starts acting. In addition, after 1ms counter of interrupting execution executes coil
command, 1ms clock pulse counting is executed in interruption mode.
X001 T2 X001
T1 K 20
T1 T2 T1
T1 Y000
T2 K 10
T2
Y000 1 computation cy
15
2.Counter Counter C
X000
z Specified value m is the setting value of
F65 STMR T10 K100 M0
the specified counter, 10 seconds in the
X000
case.
M0 10秒 10秒
M2 10秒
z M1 is ONE-SHOT timer after input point
M3 ON—OFF.
z M2 and M3 are sparkling actions. See the
left figure.
X000 M3
F65 STMR T10 K100 M0 z See the left figure on wiring of M3, and
M1 and M2 have no sparkling.
X000
16
2.Counter Counter C
Number of counter
Number of the counter is stated below and the number is distributed according to decimal system.
TP03M/H machine type
Counter 16-bit in total 32-bit plus and minus 32-bit high speed plus and minus
C C0~C99 C100~C19 C200~C234 35 points C235~C245 C246~C249 C251~C254
100 points 9 100 ※2 for keeping 1 phase 1 phase 2 2 phase input
※1 for points 1input input ※2
general use ※2 for ※2 ※2
keeping
※1 Non-keeping field for power failure Parameters are used to set and change the keeping field
for the keeping field for power failure.
※2 Keeping field for power failure Parameters can be used to set and non-keeping field for power
failure.
17
2.Counter Counter C
Features of counter
Features of 16-bit counter and 32-bit counter are stated below. It can be used according to
switching of counting direction and range of counting.
Item 16-bit counter 32-bit counter
Counting direction Positive counting Positive counting/negative counting
switching (See the above sheet)
Setting value 0~32,767 -2,147,483,648~+2,147,483,647
Specified setting Constant K or data The same as left, one couple of memory
value register after data completion (two)
Change of current Without change after Change after positive counting (Circulating
value positive counting counter)
Output point Keep acting after Keep acting for positive counting and
positive counting negative counting for reset
Reset actions When executing RST, current value of the counter is zero, and the
output point resets
Current register 16 bits 32 bits
9
10 current value of the counter increases. When it executes
8
5
6
7
the coil command the tenth time, the output contact acts.
4
1
2
3
After that, if the counting input X011 acts a second time,
0
current value of the counter will not change.
Y000
If reset input X010 is ON, RST command is executed.
Current value of the counter is 0 and the output contact resets.
Setting value of the counter, besides specified by constant K, it can be specified by number of data
register. For instance, D10 is specified, and D10 is 123, so it is the same as setting K123.
When the setting values are written into current data register with MOV and other commands, for
the next input, the output coil is connected and the current memory is changed into setting value.
18
2.Counter Counter C
X012
M8200 If C△△△ drives M8△△△, it is minus; otherwise, it is
X013 plus.
RST C200
According to constant K and data register D, the setting
X014
C200 K—5
value can be positive and negative, and content of data
C200
Setting value (consta register with adjacent numbers are regarded as one couple
Indirect specifying
Y001 and processed as 32-bit data. Therefore, when D0 is
specified, D0 and D1 are processed as 32-bit setting value.
19
2.Counter Counter C
32-bit counter
Specifying of constant K
X003 Constant (decimal system integral)-2,147,483,648~ 2,147,483,647
C200 K 43,210
43210 counting
Indirect specifying D
X001
F12 MOV K43210 D5(D6) 2 indirectly specified data memories are grouped to one
X003 group. While 32-bit command is written into setting value,
C200 D5(D6)
do not repeat the data register on other program.
20
2.Counter Counter C
16-bit(C)
Structure of current value memory and setting value memory of counter and timer (only limited to
16 bits)
32-bit(C)
16,384
8,192
4,096
2,048
1,024
512
256
128
64
32
16
8
4
2
1
32,768
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65,536
268,435,456
134,217,728
67,108,864
33,554,432
Mark
0:Positive
number
1:Negative
number
X000
F12 MOV C 20 D 10 C20(Current value)→D10 transmission
X000
F10 CMP K 100 C 30 M0
Compare decimal system integral 100 and C30
X000
(current value), output the results to M0-M2.
F18 BCD C 10 K2Y000
Convert C10 (current value), output it to
X000
F22 MUL C5 K2 D4(D5) Y000-Y007. 7-code monitor.
X000 Double C5 (current value), send it to D5 and
F12 DMOV C 200 D0(D1)
D4.
X000
F11 DZCP K100 K20000 C 200 M10 C200(current value)→send it to D1, D0
Compare C200 (current value) and decimal system integral 100-20,000, output the results to M10-M11.
Case of application command describes how to use counter and timer as device element. Please
refer to the following instructions.
21
2. Functions of device High-speed
counter
X001 U/D R R D D D B B B
X003 U/D R B
22
2. Functions of device Data register D
16-bit (D)
One data register (16-bit digit range) -32,768~+32,767
*1
Mark
0:Positive number
1:Negative number
Readout and writing-in of data register employ application command. In addition, direct
readout/writing-in can be executed from the unit (monitor) and programming equipment.
23
2. Functions of device Data register D
32-bit (D)
Two adjacent data registers is used to express 32-bit data (the high digit bit is a big number and the
low digit bit is a small number, in Index register, V is a high digit and Z is low digit).
Therefore, we can process data of -2,147,483,648~+2,147,483,647.
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
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
67,108,864
33,554,432
16,777,216
65,536
32,768
Mark
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 PC/PDA link, the following even
device element number is recommended.
For general use/keeping for power supply
Once data is written into the data register, if other data will not be written, it will not change.
However, in case of RUN→STOP or power failure, all the data will be cleared. If special auxiliary
relay M8033 is driven, it can keep. Therefore, the data register for keeping for power failure can
keep the content in case of RUN/STOP and power failure.
PC/PDA link parameter setting can be used to change distribution of PLC for general use and
keeping for power failure, except for special device element.
When the special data memory for keeping for power failure is used for general use, please apply
RST or ZRST commands to clear it content when starting.
When inter-PC simple link or parallel connection link is used, some data register is occupied by
link.
Refer to document register D on usage of document register.
Special purpose
Data register for special purpose refers to writing in data for special purpose or writing special
data into the data register in advance. When the power supply connected, it is set at the initial
value and becomes 0 after [Link] is used to write.
For instance, in D8000, time of monitoring timer is initially set by the system ROM. If it is to be
changed, the transmission command F12 MOV is used to write in target time in D8000.
Refer to additional instructions for program memory and parameter structure for special data
register for keeping for power failure.
Refer to additional instructions for basic functions on relevant description of data register type and
function.
24
2. Functions of device Data register D
Case of action
Digit and data of data register can be used for control. Take basic command and application
command for example, the data register can be used as expected. Refer to the following
application commands.
<Data register for basic commands >
Specified setting value of timer and counter
D0 Timer/counter acts as per specified data register.
T2 <Data register of application command> Such as F12(MOV)
action case of command
D20 Change current value of counter
C20
F12 MOV D5 C2
25
2. Functions of device Data register D
16-bit (W)
One data register (16-bit digit range) -32,768~+32,767
Readout and writing-in of data register employ application command. In addition, direct
readout/writing-in can be executed from the unit (monitor) and programming equipment.
32-bit (W)
Two adjacent data registers is used to express 32-bit data (the high digit bit is a big number and the
low digit bit is a small number, in Index register, V is a high digit and Z is low digit).
Therefore, we can process data of -2,147,483,648~+2,147,483,647.
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
8,388,608
4,194,304
2,097,152
67,108,864
33,554,432
16,777,216
1,048,576
524,288
262,144
131,072
65,536
32,768
Mark
0:Positive
number
1:Negative
number
When 32-bit is specified, if the following digit bit (such as W0) is specified, the number after the
high digit bit (such as W1) will be occupied automatically. The low digit bit can be specified any
device element of odd or even. Considering monitoring of PC/PDA link, the following even
device element number is recommended.
26
2. Functions of device Data register D
In addition, pay attention that LD, AND, OUT and other basic sequence control command of PLC,
or device element number of step echelon command and Index register may be used together.
16 bit 16bit 16bit The two kinds of Index register have the same
V Z structure with the above data registers.
V0~V15: 8point Z0~Z15: 8point
32 bit
32 bit
When device element of 32-bit application
V0(Upper position)Z0(Lower position) command or values over 16 bits are process,
Z0-Z15 must be used. See the combination
V1(Upper position)Z1(Lower position) of V and Z in the left figure. TP03 PLC
takes Z as low digit bit of 32-bit digit.
Therefore, even the high digit V0-V15 is
V2(Upper position)Z2(Lower position)
specified, address-change can not be
realized. In addition, if it is specified as
V3(Upper position)Z3(Lower position) 32-bit digit, for V (high digit) and Z (low
digit) are referred simultaneously, if V is at
high digit, and other rest digit may lead to
error. Even 32-bit application command
does not exceed 16-bit digit, for writing-in
of Z, see the left figure. For DMOV and
other 32-buit command, re-write 32-bit
V14(Upper position) Z14(Lower position) Index register for V (high) and Z (low).
D MOV K300 Z2
K300—(V2,Z2)
27
2. Functions of device Data register D
28
2. Functions of device Pointer P and I
29
2. Functions of device Pointer P and I
For branching
1 F00 (CJ)Conditional jumping 2 F01 (CALL)Accessing sub-program
X000
Main program
CALL P10
X000
CJ P1 Jumping
FEND
Jumping
Routine sub-program
Mark
Mark P1 P 10
Return
When X001 is ON, F00 (CJ) is jumped to SRET
specified position and execute the program
END
For interruption
There are 3 types of pointer for interruption, application command FNC03 (IRET) for interruption
return, FNC04(EI) interruption allowable and FNC05(DI) interruption forbidden.
1. For input interruption: specified input number is not affected by PLC scanning cycle. When
reading the signal, sub-program is interrupted. When input is interrupted, signal less than the
scanning time can be read. During control of PLC, short time pulse wave signal can be
processed in priority.
2. For time interruption: the specified interrupted time cycle (10ms-99ms), interrupt the
sub-program and interruption processing program for fixed time outside PLC scanning time.
3. For counting interruption: compare the results from high-speed counter in PLC to interrupt
sub-program, and prior control is realized by counting of high-speed counter.
30
Table of
3 Interpretation of basic sequential control instructions
Contents
0
List of basic
3 Interpretation of basic sequential control instructions
instructions
XYMSTC
[LDP] Computation starting of rising edge 2
XYMSTC
[LDF] Computation starting of falling edge 2
XYMSTC
[ANDP] Rising edge checks series connection 2
XYMSTC
[ANDF] Falling edge checks series connection 2
1
List of basic
3 Interpretation of basic sequential control instructions
instructions
X001
[MC] Master control MC N YM 3
X001
[MCR] Reclosing of master control MCR N 2
[NOP] No action
[END] Programming scanning completes
[STL] Programming of step ladder style chart 1
Completion of programming of step ladder
[RET] RET 1
style chart
X001
[PLS] Rising edge energizes coil PLS YM 1
X001
[PLF] Falling edge energizes coil PLF YM 1
[P] Mark ——
[I] Interruption mark ——
Y&M:1
S&
specialM
XYMSTC
:2
[OUT] Coil T:3
C:3(32bits)
,
5(16bits
)
X001
Y,M:1
[SET] Setting coil SET YMS S,special
M:2
X001
T,C:2
[RST] Reclosing coil RST YMS D&V&Z&
special D:3
[SMCS] Starting of loop branching SMCS 1
Completing of loop
[SMCR] SMCR 1
branching
Starting of jumping
[JCS] JCS 1
branching
Completing
[JCR] JCR 1
of jumping branching
2
3 Interpretation of basic sequential control instructions LD,LDI,OUT
Programming case
X001 Y001
LD X001
OUT Y001
X001 Y002
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 vales and data memory can be used to specify pre-setting values of D, T, and C
indirectly.
See the following table on setting ranges of time constant K and setting values of corresponding
time:
Counter of timer Setting range of value K Actual setting values Number of steps
1ms 1~32,767 0.001~32.676S 3
10ms 1~32,767 0.01~327.67S 3
100ms 0.1~3,276.7S
16-bit counter 1~32,767 The same as left 3
32-bit counter -2,147,483,648~+2,147,483,647 The same as left 5
3
3 Interpretation of basic sequential control instructions AND,ANI
Programming case
Y003 X003 T1
Y004
M010
4
3 Interpretation of basic sequential control instructions OR,ORI
4 Instructions OR,ORI
[OR]/[ORI]
Interpretation of instructions
[OR ] is normally open contacts in parallel connection, for X, Y, M, T, C and S.
[ORI] is normally closed contacts in series 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.
1) Instruction [OR]/[ORI] is used with said instruction [LD]/ [LDI] in parallel connection, no
restriction on using times.
2) 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,
without device followed.
Parallel connection instruction of series connection circuit block ORB
ORB: make two or more series connection circuit blocks in parallel connection.
For circuit block with two or more contacts in series connection, when the series connection
circuit block is to be parallel connection, instructions LD and LDI are used for starting end of the
branch and instruction ORB is used for finishing end of the branch.
Programming
X001 Y001
LD X001
X002 ORI X002
OR M001
OUT Y001
M001 LDI Y001
AND X003
Y001 X003 X004 M002 OR M002
ANI X004
OR M003
M002
OUT M002
M003
OR OR
OR
OR
5
3 Interpretation of basic sequential control instructions LDP,LDF,ANDP,ANDF,ORP,ORF
5 Instructions LDP,LDF,ANDP,ANDF,ORP,ORF
Instructions
[LDP]/ [LDF]/ [ANDP]/ [ANDF]/ [ORP]/ [ORF]
Interpretation of instructions
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.
The instructions [LDF]/ [ANDF]/ [ORF] refer to the device operated by the instructions can be
active one scanning cycle when triggering (ON→OFF) on the falling edge.
Programming
X001 M000
LDP X001
X002 ORP X002
OUT M000
M1
X003 X004 LDP X003
ANDP X004
OUT M1
X001 M000
LDF X001
X002 ORF X002
M1 OUT M000
X003 X004 LDF X003
ANDF X004
OUT M1
In the above chart, when X001-X004 is switched from ON-OFF or OFF-ON, M0 or M1 is only
connected to one scanning cycle.
6
3 Interpretation of basic sequential control instructions LDP,LDF,ANDP,ANDF,ORP,ORF
X010
Scanning
M6 cycle
In two circumstances, when X010 is switched from OFF-ON, M6 is only connected to one
scanning cycle.
Pulse executing form of rising edge detecting and applied instruction
X020
M OV K10 D0
X020
M OV 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 previous condition logic results of the instruction MOV are ON, the data is transmitted
continuously; when the logic results are OFF, the data transmission is stopped.
When previous condition logic results of the instruction MOVP is switched from OFF to ON, the
data is transmitted, and such switches are in correspondence with times of data transmission.
7
3 Interpretation of basic sequential control instructions ORB
6 Instruction ORB
Instruction [ORB]
Instruction interpretation
ORB: the instruction for parallel connection for two or more series connection circuits.
The circuit with more than two series connection contacts is called series connection circuit block.
When parallel connection is used for series connection block, the instruction LD/LDI is used at the
beginning of the branch and the instruction ORB is used at the ending of the branch.
1) [ORB] and [ANB] the same, it is a single instruction without device, without any device
number followed.
2) In multi-parallel connection circuit, if each series connection circuit uses the instruction ORB,
times of parallel connection is not restricted. The instruction ORB can be used continuously. At
this time, times of repeated use of the instruction LD/LDI on one bus bar shall be less than 8
times.
Programming
LD X001
X001 X002 Y001 AND X002
LD X003
X003 X004 AND X004
ORB
X005 X006
LD X005
AND X006
ORB
OUT Y006
8
3 Interpretation of basic sequential control instructions ANB
7 Instruction ANB
Instruction [ANB]
Instruction interpretation
ANB: the instruction for starting end of the parallel connection circuit block with previous circuit
in series connection:
1) The circuit with more than two parallel connection contacts is called parallel connection block.
The instruction ANB is required for series connection of parallel connection block; when it is
connected to the previous circuit in series connection, the instructions LD and LDI can be
used as starting 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.
2) The instruction ANB does not follow any 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 circuit is not
restricted. The instruction ANB can be used collectively, but on the same bus bar, repeated use
of the instructions LD and LDI must be less than 8 times.
Programming
9
3 Interpretation of basic sequential control instructions MPS,MRD,MPP
Programming
Y001 LD X001
X001 X002
MPS
X003 Y002 AND X002
OUT Y001
X004 Y003 MRD
AND X003
Y004 OUT Y002
MRD
AND X004
OUT Y003
MPP
OUT Y004
END
10
3 Interpretation of basic sequential control instructions MPS,MRD,MPP
Case of programming:
One section of stacking
X012
Y007
11
3 Interpretation of basic sequential control instructions MPS,MRD,MPP
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
12
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
13
3 Interpretation of basic sequential control instructions MC,MCR
Instruction interpretation
1) In the chart below, when the input X001 is active, instructions between MC and MCR are
executed; when X01 is inactive, devices between instructions MC and MCR are the following
state: accumulative timer, counter and device driven by the instruction SET/RST keep current
state; if non-accumulative timer and device driven by the instruction OUT, it shall be inactive.
2) After executing the instruction MC, the bus bar (LD and LDI) is transferred to MC contact. If it
returns to original bus bar, the return instruction MCR is used. The instruction MC/MCR must
be used in couple.
When using different device numbers Y and M, the instruction MC can be used repeatedly. If
the same device number is used, like the instruction OUT, double coil output will occur.
3) The instruction MC can be used in nested way, namely, the instruction MC can be used the
instruction MC. 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
X001
MC N0 M1 LD X001
MC N0 M1
X002 LD X002
Y001 OUT Y001
LD X003
X003
Y002 OUT Y002
MRC N0
MRC N0
If the instruction MC is used in the instruction MC, 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 .(N7→N6→N5→N4→N3→N2→N1→N0)
the biggest number of nested level is 8 (N7)
14
3 Interpretation of basic sequential control instructions INC
10 Instruction INV
Instruction [INV]
The INV instruction is expressed with one short diagonal with an inclination angle of 45 degrees.
The instruction INV is required before the computation results.
Instruction interpretation
The instruction INV has no device, without specified device number, and actions in the program
are described below:
Computation Computation results
results before after executing the
executing the instruction INV
instruction INV
OFF→ ON
ON→ OFF
Programming
ON
OFF OFF
X001
ON ON
Y001
OFF
See the above chart, when the input relay X001 is inactive, the output coil Y001 is active. When
X001 is active, Y001 is inactive. 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 bar like
LD, LDI, LDP and LDF, and can not be used singly like OR, ORI, ORP and ORF.
15
3 Interpretation of basic sequential control instructions PLS,PLF
Programming
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
Scanning
M0 cycle
Scanning
M1 cycle
Y001
16
3 Interpretation of basic sequential control instructions NOP,END
Programming
X001
SET Y001
X002
RST Y001
X003 LD X001
SET M1 SET Y001
LD X002
X004 RST Y001
RST M1 LD X003
X005 SET M1
SET S1 LD X004
RST M1
X006 LD X005
RST S1 SET S1
LD X006
X007
RST D1 RST S1
LD X007
X001 RST D1
T247 LD X001
K10 OUT T247 K10
X007 LD X007
RST T247 RST T247
X001
X002
Y001
17
3 Interpretation of basic sequential control instructions NOP,END
RST)
Programming
X010
RST C0
X011 K10
C0
C0
Y000
X010
M△△△
X010
RST C△△△
X011 K10
C△△△
C△△△
Y002
z When single-phase and single input counter of C235-C245 is used, special auxiliary relay
M8235-M8245 shall be used for specifying the direction of counting. When X010 is ON, it
is decreasing counting; when X010 is OFF, it is increasing counting.
z When X010 is ON, output contact of the counter C returns and current value of the
counter returns to 0.
z If counter (C241 and 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 achieve
through interruption and program is unnecessary for it.
z When X011 is ON, counting shall be executed for the counting input ON/Off of X000-X005
determined by number of the counter. With the counter (C244 and C245) with starting input,
if the corresponding starting input point is not ON, counting can not be executed.
18
3 Interpretation of basic sequential control instructions NOP,END
z Current value of the counter is increasing, when it reaches the setting value (constant K or
content D), the output contact is SET; if it is lower than current value, it is RST.
19
3 Interpretation of basic sequential control instructions NOP,END
As for finished program, when the instruction NOP is inserted, the program will not change.
Please pay attention to it.
AND——NOP ANI——NOP
OUT——NOP
OR——NOP
ORI——NOP
4) The instruction END is used for ending of the program, without objective device. Power failure
can be set by the instruction END in the program. The instruction END can be inserted by section,
then debug section by section, after debugging, delete the instruction END.
20
3 Interpretation of basic sequential control instructions SMCS, SMCR
X001
SMCS
SMCR
Instruction SMCS in the program can be used for many times, see the chart below. After it is used
for one time, one condition for auxiliary bus bar is added. After the instruction SMCS has been
used for many times, only one SMCR instruction can clear all the conditions.
X001
SMCS
X004
Y017
SMCR
Each instruction after SMCS and before SMCR can execute computation with the condition before
SMCS.
When the common circuit is pretty complicated or reoccurs several times, such instruction can
simplify the program.
Note: OUT, TMR, CNT and applied instructions can not be after the instruction SMCS directly.
21
3 Interpretation of basic sequential control instructions JCS,JCR
X002
Y001
X003 K50
T250
X004
RST T250
JCR
X001
X002
Y001
X003
2s 3s
X004
T250
Note1: Pay special attention to timing signal of the timer, and relative time relation of input
signals of counter (switch from OFF→ON) and applied instruction and JCS ON/OFF state.
JCS state A B C
Input signal ① ② ③ ④
on on off on
When X002 is at OFF→ON of ①, Y001 will act, for state of JCS is OFF.
When X002 is at OFF→ON of ②, Y001will not act, for state of JCS is ON.
OFF→ON in ③ will not act, for state of JCS is ON.
State of [JCS] will be switched into OFF when X002 is at ③ON, Y001 will not act; for in
state (A) of JCS, Y001 will be switched from OFF to ON with input signal. When JCS is ON,
it will not be affected by state change of ON→OFF or OFF→ON; for JCS is off (state B), it
will be switched from OFF→ON, and Y001is switched from ON→OFF.
22
3 Interpretation of basic sequential control instructions JCS,JCR
When input signal in ④ is from OFF→ON, Y001 is still OFF and will not act. For state of
JCS is ON.
State of [JCS] is OFF when ④ is ON, Y001 acts.
Note 2: when state of [JCS] is ON, instructions effecting positions between JCS and JCR will not
be executed.
Note 3: the instruction between JCS and JCR will be executed certainly, which is not affected by
state ON or OFF of JCS.
At this time, execution of the program will be suspended and the next scanning cycle is entered.
Note 4: instructions between 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 1s 2s
X004
T250
Note 6: another JCS is inserted between JCS and JCR, and only one JCR can be used as state
ending.
23
3 Interpretation of basic sequential control instructions Attentions
④ ANB ③OR ② OR
Without ANB
② LD ③AND ③LD
④ ORB
Without ORB
① ⑤
③ ⑦
② ⑨ ⑩
⑥
④ ⑧
24
3 Interpretation of basic sequential control instructions Attentions
If double output (double-coil) is used in sequential control program, the later action shall execute
in priority.
Input processing
X001=ON X002=OFF
See the chart at the left side, pay attention to use of the same coil
X001 Initial
Y003 Y003 in several positions.
For instance, when 001=ON and X002=OFF,
Y003
Y004
Y004 At the beginning Y003, for X001 is active, the RAM is ON and the
the second time
X002 output Y004 is active.
Y003
Y003 is inactive for a second time by X002, and the RAM is OFF.
Therefore, actual external output is Y003= OFF and Y004=ON.
Output processing
Y003=OFF Y004=ON
A B A B
Y000 Y000
C E
ignorable ignorable
D
C E
Y000
D
A B
or
M100
C E
M101
D
M100 E
Y000
M101
Skipping instruction and step ladder style instruction can be used and the above program is
switched to the same output. When the step ladder style instruction is used, in the master program
and state program, use of double output and the same output shall be paid attention to.
25
3 Interpretation of basic sequential control instructions Attentions
Bridge circuit
See the chart below: change 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
C D
A
A B D F
C
B D
E F
26
Table of
4 Instruction instructions of step ladder style programming chart Contents
0
4 Instruction instructions of step ladder style programming chart Interpretation
1
4 Instruction instructions of step ladder style programming chart Interpretation
S1
S1
0
S1 0 3
0 S2 S4 S2 S4
S2 1 4 1 2
1 S3 S5 S3 S5
2 5
S3
3
S6
S6
2
4 Interpretation of step ladder style programming chart STL,RET
STL and RET are a couple of step instructions, which means starting and ending of step
instructions.
Instruction interpretation
(1) STL (Step ladder): connected to master bus bar normally open contact instruction, the contact
instruction TL is used to represent with normally open contacts with two small rectangles,
namely:
(2) RET (Return): return to bus bar instruction.
The step ladder is the starting of working step control for executing step point of internal devices.
The initial state must start with S0-S9, and RET is the ending of the step point (S), meanwhile, it
must be ended with S0-S9 and the program returns to the bus bar. At the end of the step ladder
style programming chart, the instruction RET is required. In one program, totaled 10 step flows in
maximum can be written and each step flow requires the instruction RET to end. Write the state
adder style programming chart according to the following rules. SFC and ladder style
programming chart are exchangeable.
Y003
programming chart.
●If the contact STL is active, there are some relevant loop [Link] the
contact STL is inactive, there are not any relevant loop actions. After one
Scanning time scanning cycle, the instruction will not be executed (skipping state).
●See the left chart, during different status, the same coil (Y002) shall be
output when programming. At this time, S21 or S22 is active, the coil Y002 will be active in
different step sequence. In ladder-shaped programming, owing to complicated action of dual-coil,
so it is not recommended.
In addition, when SFC is used for editing, when program the same output coil (Y002) for the state
in the master program or vice versa, it shall be processed in dual-coil of the ladder style
programming chart. Please pay attention.
3
4 Interpretation of step ladder style programming chart STL,RET
Y001
Output interlocking
Y002
Positive During state transfer, it is active within shortest time (one
S20
rotation
Y001 Y002
scanning cycle). Therefore, to avoid failure of simultaneous
Negative active of a couple of outputs, interlocking can be set on
S21
rotation
PLC according to manual of the PLC.
Repeated use of timer
●In SFC, the timer coil can set points for the same timer under different states as the output coil,
however, it can not be set under adjacent state; if the same timer is set under adjacent state, in case
of state transfer, the timer coil will not be inactive and the current value can not be reset.
S 10
Y001
Y003
Bus bar
in STL X005
Y002
S 10
Y001
X005
Y002
Bus bar
in STL M8000
Y003
4
4 Interpretation of step ladder style programming chart STL,RET
Step point skipping, the step point state transferred to non-adjacent step point
Transferring conditions of step point, state transferring conditions between two step
points.
Select branching chart, from the same step point transferred to the corresponding
step point under different transferring conditions
Select merging chart, more than two different step point state transferred to the same
step point with the same transferring conditions
Parallel branching, from the same step point transferred to more than two step points
with the same transferring conditions
Parallel merging point, when more than two step points are established, they are
transferred to the same step point with the same transferring conditions.
5
Representation
4. Interpretation of step ladder style programming chart of SFC
Function of instructions
Sequential control edition of SFC is built in PLC of TP03. The SFC chart can be inverted into
instruction sheet or ladder style programming chart program, and from instruction sheet or
ladder-shape chart to SFC chart.
●In SFC, each state can be regarded as micro-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 progress, the previous working step does not work, the
working steps operate according to program to realize step control.
The step ladder style programming instruction can be represented in the following actions.
X001 X001
SET S32 SET S32
S32
S32
Y030 Y030
If S32 is active, S31 active
will be inactive
Y032 automatically Y032
X002 X002
SET S33 SET S33
If the SFC chart indicates step ladder style programming loop in the left chart, see the
following chart:
In the SFC chart, function of each piece of equipment and the whole process are
understandable, the sequential control design is easy, even to the third person, it is used for
maintenance, modification and troubleshooting. The SFC chart and step ladder style programming
chart shall be programmed according to rules, which are exchangeable with the same content. The
familiarized ladder style programming chart can be used. When editing SFC chart, corresponding
peripheral equipment and programming software.
6
Representation
4. Interpretation of step ladder style programming chart of SFC
S0 X000
SET S20 S0
X000
S 20 Y023 Y023
Y021 Forward S 20 Y021
X011 Forward
SET S21 X011 Forward small
S 21 Y021 Y021
Y023 Backward S 21 Y021
X012 Backward
SET S22 X012 Backward
S 22 K50
T0 S 22 T0
T0
SET S23 T0 Forward small
S 23 X023 Y023
Y021 Forward S 23 Y021
X013 Forward
SET S24 X013 Forward
S 24 Y021 Y021
Y023 Backward S 24 Y021
X012 Backward
S0 X012 Backward
RET
END
Programming equipment
SFC can be programmed with personal computer (PC06 user’s software); sequential control
program programmed by SFC can be saved in TP03 PLC in the form of instruction.
7
Features of
4 Interpretation of step ladder style programming chart SFC
3 Features of SFC
LS11
LS13
Actions
1. Press the starting 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, 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 a second time, drive motor of the trolley stops.
When actions are described correctly, complicated mechanical actions will be simple. The
mechanical technicians and electric technicians can have deep discussions.
Basically, if electric technicians want to design PLC program, without action chart of PLC, it can
not be designed.
However, the step action is very complicated for electric technicians, which required rich
experience and designing time. And PLC chart seems pretty complicated from the third person,
and such designer of PLC takes responsibility for mechanical maintenance.
8
Features of
4 Interpretation of step ladder style programming chart SFC
S0
· In ladder circuit block LAD0, the auxiliary relay
S ta r t M8002 with action in a shortest time can make the
X 000
Y 023 initial state S0 reset (ON) during switching from
S 20 Y 021
stop-start switching of PLC.
F o rw a rd
X 011 F o r w a r d s m a ll
· As for provided initial working step, such
distributed PLC is called initial state device of
Y 021
S 21 Y 021 S0-S9.
B ack w ard · As for distributed state S02-S889 for the working
X 012 B a ck w ard steps, including the state for holding in case of
K 50 power failure, it can keep the state. In addition,
S 22 T0
when S10-S19 employs the instruction IST, they are
T0 F o r w a r d s m a ll
also for special purposes.
· Timer, counter and auxiliary relay and other
Y 023
S 23 Y 021 devices are set in PLC, which can be used at your
F o rw a rd discretion. Such timer T0 takes 0.1 second as unit
X 013 F o rw a rd action. Therefore, the setting value is K50, after the
Y 021 coil is driven for 5 seconds, the output contact acts.
S 24 Y 023
B ac k w ard
X 012 B ac k w ard
S20 RET
LAD1 EN D
S 21 S 31 S 41 S 21 S 24 S 27
X001 X011 X021 X001 X011 X021
S 22 S 32 S 42 S 22 S 25 S 28
X002 X012 X022 X002 X012 X022
S 23 S 26 S 29
S 50
X007
S 30 Merging state
9
Features of
4 Interpretation of step ladder style programming chart SFC
Separation of flow
SFC program has several initial state, and each initial state is separated program.
OUT OUT
S3 S4
S20 S40
OUT
S41
S39 S59
Take the above chart as example, after the instruction STL of S20-S39 of the initial state S3 is
executed, then relevant programs to S4 are executed then.
In the program, the instruction except the instruction STL can be used to execute other state.
In the left chart, the initial state S3 includes the instruction OUTS41. The initial state S4 includes
the instruction LD S39. Do not confuse the instruction STL.
Quantity of one parallel branching or selective branching shall be less than 10.
However, if there are several parallel branching or selective branching, total loop quantity of each
initial state may not exceed 16.
S4
1 2 3 4 5 6 7 10
OUT
1 2 3 4 5 6 7 8 9 16
State from or before merging to the separation state by transferring or reset are not allowed. No op
state must be set. Transferring and reset can only be executed from the branching.
10
Features of
4 Interpretation of step ladder style programming chart SFC
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 ↓
S0
S 90
S 10
S 90
S 19 S 70
S 80
S0
S 80
X000
ZRSTP S0 S 50
S0
S 50
S0
11
Features of
4 Interpretation of step ladder style programming chart SFC
S 10
Y001
M 10
Y005
M30
T4
It is equal to forbidding output in emergency step stop. Please comply with Safety Attentions
contained in the manual.
Special relays
To program SFC effectively, varieties of special relays shall be employed with content described
below:
Component No. Description Function and purpose
M8000 Operation monitoring During operation of PLC, the relay needs always
(contact a) connecting, which can be used as input state for
driving programming of operation state indication
of PLC.
M8002 Starting pulse The relay is active in a short time (one scanning
(contact b) cycle) from stop to start of PLC. It is used for
resetting of starting setting or initial state of the
program.
M8040 Transfer forbidden Driving the relay forbids transfer among state.
Under the conditions of forbidding transferring,
internal programs will still execute, therefore, the
output coil will not be off automatically.
M8046 STL state action When any state is active, M8046 is automatically
active for avoiding simultaneous starting or for
action sign of working step with other flows.
M8041 Step starts Flag-sign for the instruction IST
M8047 STL monitoring is Driving the relay, the programming function can
effective read the executing state and display
12
Features of
4 Interpretation of step ladder style programming chart SFC
At the end of the instruction STL, if the instruction RET is not programmed, the software can add
the instruction RET to the end of the program.
Attentions:
Attentions for detecting with rising edge and falling edge:
When rising edge and falling edge of LDP, LDF, ANDP, ANF, ORP and ORF, the changed
contacts when the state is cut off will be detected when the state is active a second time.
As for changed conditions in case of the state is cut off, if rising edge and falling edge are used to
detect, please modify the procedure according to the chart below.
S3
X001
M 6
X001
SET S 42 X002
M 7
X002
S3
M6
SET S 42
M7
If it is transferred to S42 through X001 falling edge, if X002 is falling, S3 is cut off, and X002
falling edge can not be detected. When S3 is active a second time, it is detected. Therefore, in case
of second action of S3, it is transferred to S42.
13
4. Interpretation of step ladder style programming chart Form of flow
Skipping
Tranfer to the state below or out of the series is called skippng, with symbol ↓ to indicate
transferred goal state.
↓ ↓
S 20 S 20 S 30 S 40 S 30 S 40
S 22 S 42
S 21 S 21 S 31 S 41 S 31 S 41
S 22← →S 22 S 32 →S 42 S 32 →S 42
S 23 S 23 S 33 S 43 S 33 S 43
Repeating
Transfer to the above state is called repeating. The same as above, the symbol ↓ is used to indicate
transferred goal state.
→S 0 →S 0 S 60← →S 60
S 50 S 50 S 61 S 61
S 51 S 51 S 62 →S 62
S 63 S 63 ↓
S 60
S 59 S 59
14
4. Interpretation of step ladder style programming chart Form of flow
S40 S60
A B
S51 S54
S41 S44
S43
S53
The above flows are possible programs. Flow of B is sound. Uner the conditions of flow A, there
is a waiting at the conflucence of parallel branching, pay attention to it.
S 40 S 61
S 41 S 44 S 62 S 66
S 42 S 45 S 46 S 63 S 65 S 67
╭╮ ↓
↖ S 63
S 43 不允许交叉
Cross not allowed S 64
The SFC chart can not be used for flow cross. Flow in the above chart shall be re-programmed
according to the program at the right side to realize reversal switching from program based on
instruction to SFC chart.
15
4 Interpretation of step ladder style programming chart Initial state
16
4 Interpretation of step ladder style programming chart Initial state
As for continuous SFC chart, if several state program shall be executed and all the statees are
programmed, it will end after completing programming and the state sequential number can be
selected at your discretion. However, initial state is required before a series of STL instructions,
and the instruction RET shall be written finally.
17
4 Interpretation of step ladder style programming chart Initial state
S 0 S 1 S 2 S 3 S 4
S 20 S 21 S 40 S 50 S 60
OUT
→S 21 S 51
S 22 S 22 S 41 →S 52 S 61 →S 64
OUT
S 20 S 42 S 62 S 65
S 23 OUT→S 23 S 43 S 53 S 63
RST
Repeating
重复 Skipping
跳转 Jump out of the flow
向流程外跳转 Reset复位处理
processing
See the chart above, transferring to upward position (repeating), transferring to downward position
(skipping) and transferring out of the flow and other separation state. See 4-5. The symbol ê
represents the state symbol of transferred objective. See the chart below. The instruction OUT is
programmed and cross flow in 4-5-1 is also the same.
X001
Y001
Y001
S 40 ( ) X001
Tranfering program S 52 ( ) Tranfering program
STL S 40 STL S 52
LD X001 X002 X003 X005 LD X004
OUT Y001 OUT Y002
LD X002 LD X005
S 41 ↓S 52 S 53
SET S 41 SET S 53
LD X003
With the
OUT S52 instruction OUT
From S40, S52 is driven by X003, even the instruction OUT is used, when S52 holds its action,
the transfering source S40 will be resetted automatically. The left chart indicates resetting of S65
throught X007 from S65.
From S65, although resetting of other state is the same, it it not transferring. S65 will not be
resetted.
18
Branching
4 Interpretation of step ladder style programming chart and merging
S 21 S 31 S 41
The same as programming of general state, driving processing shall be executed, then transfering
processing shall be executed. All the transfering processing shall be executed according to the
sequence.
S 50
SET
State drive processing before merging shall be executed first, then continue transfering 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 cna
19
Branching
4 Interpretation of step ladder style programming chart and merging
not be crossed.
8.2 State of parallel branching and merging
The same as program for general state, driving processing shall executed first, then transfering can
be continued. All the transfer processing shall be executed according to the sequence.
20
Branching
4 Interpretation of step ladder style programming chart and merging
S 20 S 30 S 40 S 20 S 30 S 40 S 20 S 30 S 20 S 30
X000 X001 X002
X000 X001
X000 X000
X003 X004 X001 X002
S 50 S 60 S 50 S 60 S 40 S 50 S 40 S 50
S 20 S 30 S 40 S 20 S 30 S 40 S 20 S 30 S 20 S 30
X000 X001 X002
X000 X001
X000 X000
S100 Dummy
? ? ? state S101 Dummy
? ? ? state S102 Dummy
? ? ? state S103 Dummy
? ? ? state
S101 S102
X003 X004 X001 X002
S 50 S 60 S 50 S 60 S 40 S 50 S 40 S 50
LD X004
SET S60
Direct branch after merging is not a good way, and one virtual state point is easy to write.
21
Branching
4 Interpretation of step ladder style programming chart and merging
M8000 Central
STL Monitoring
S20 Y001 indicator light
M8047 effectively
T1 T1 K20
RUN Monitoring
Ring indicator
Step Starting S 22 Y003 light
T3
M8002 T3 K20
SET S3 Initial state
Ring water
S 27 Y007
Initial pulse spraying
T7 K20
T7 T7
X001 X001
S 20 S3 RET END
S3 Y000
T0 T0 K 10
S 20 Y001
T1
T
T1 K 15
S3 RET END
Y000
Y001
1S 1.5S
22
Branching
4 Interpretation of step ladder style programming chart and merging
X013
Y023 M Y021
Big negative Big positive
rotation rotation
Limit switches X013 and X011 are set in the positions of the positive rotating angle, and limit
switches X012 and X010 are set in the positions of the negative rotating angle.
Press the starting button, execute positive rotating small→ negative rotation small → negative
rotation big→ negative rotation big and etc., then it stops.
M8000
M8047 STL effective monitoring
M8002 X000
M8040 Transfer forbidden
Initial state Starting
M8040 button Y020
M8043 All outputs forbidden
M8002 M8046
SET S6
Initial state
Initial state
The limit switches X010~X013 are normally OFF. When the cam reaches the setting angle, it is
ON.
S6 Y 020 Origin representation
S 6 RET END
z When M8047 acts, the action state monitoring is effective. After S0-S899 act and the
instruction END is executed, M8046 acts.
z State point of SFC is held by the battery. In case of power failure during action, when
pressing the starting button a second time, it will continue acting. Before pressing the
starting button, output actions below Y20 are totally forbidden.
23
Branching
4 Interpretation of step ladder style programming chart and merging
M1
M
Start M8002 Initial pulse
X000 2S S0
M2 X000 starting button
M
S20 SET Y000 MotorM1 starts
Start 3S
K 20
M3 T0 T0
M
X001 X001 Press the stop button and transfer to state S27
4S
S27 Motor M2 starts
M4 X21 SET Y001
M
K 30
T1
T1
Press the stop button and
X001 X001 transfer to state S26
S 22 S26 SET Y002 MotorM3 starts
M4 K 40
M T2
Stop T2
X001 4S Press the stop button and
X001 X001
transfer to state S25
M3
M S25 Motor M4 starts
S23 SET Y003
Stop
3S X001 Stop
M2 S 24 RST Y003 Motor M4 starts
M
K 40
2S T4 T4
M1
M S 25 RST Y002 Motor M3 starts
K 30
T5 T5
Y000
RET END
S0
24
Branching
4 Interpretation of step ladder style programming chart and merging
The skipping flow in the previous page can be represented in selective 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, the state S20 acts, if X001 is active, the state S32 acts, then the contacts act, which
skip to the state S27.
There should be more than one state in the branching; therefore, no op state shall be set.
25
Branching
4 Interpretation of step ladder style programming chart and merging
S 20
z See the left chart, X000, X010 and X020 can not be active
S 21 S23 S25 simultaneously.
X001 X011 X021 z For instance, when S20 acts and X000 is active, the action state
S 22 S24 S26 is transferred to S21, S20 will not act.
Therefore, even X010 and X020 act, S23 and S25 do not act.
X002 X012 X022 z Merging state S50 can be driven by either S22, S24 or S26.
S 50 S 50 Merging state
X002
LS2 Lower
limit
Electromagn
etY001
Proximity
switch
small big
PS0
X000
26
Branching
4 Interpretation of step ladder style programming chart and merging
For such SFC for selecting size or judging acceptance or not, the following branching and merging
SFC can be used to represent.
Take M8002 to drive initial pulse
S0 Operating sequences
X026 Starting
Y007 Origin position (upper limit, left limit and release)
S 21 Y000 Descending
T0 K20
Represent X002 contact
( normally closed contact)
T0 T0
X002 Lower limit (small ball ) X002 Fail to reach lower limit
T1 K 10 T1 K 10
T1 T1
S 30 Y000
· If it is small ball , X 004 acts; for big ball , X 005 acts.
X002 Lower limit After merging, transfer to S30.
S 31 RST Y001
T2 K 10
T2
S 32 Y002 Ascending ·If the following auxiliary relay M8040 is driven , all the
state transfers are forbidden
. Of statuses 24, 27 and 33, it
outputs S33 at the right side and S34 at the right side for
X003 Upper limit
relevant interlocking contacts in series connection
.
X001
S 33 Y004 Left moving
S0 RET END
27
Branching
4 Interpretation of step ladder style programming chart and merging
S 20
X000
S 21 S24 S27
X001 X002 X003
S 22 S25 S28
X004 X005 X006
S 23 S26 S29
X007
z Branches with several flows executed simultaneously are called parallel branching.
z Take the above chart for example, after S20 acts, X0 is on, state S21, S24 and S24 will be
effective simultaneously and the flows start.
z After all the flows are completed, when X07 is active, merging state S30 acts and state S23,
S26 and S29 do not act.
z Such merging is called waiting merging. (Flows complete earlier shall wait until all the
flows are completed, then merging is continued).
For instance, parts A, B and C are processed separately, which are assembled after processing, and
this is a parallel branching and merging flow.
28
Flexible use of
4 Interpretation of step ladder style programming chart F60 IST
See the following chart on mechanical reversal mode, and part or whole of the mode can be used.
M8000
IF the instruction IST is used, switching between modes and repeated control program sjhall be
used. We should only focus on writing program of mechanical action in the state to complete the
sequence design.
Refer to instruction F60(IST) in Applied Instrucitons.
29
5 Representation and executing form of applied instructions Table of Contents
0
Representation and
5 Representation and executing form of applied instructions executing form
X000 S. D. n
MEAN D100 D150 K5
z MEAN: Memory view of the instruction, representing average value in mathematical way.
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 and when the operand is not one, represent with [S1· ], [S2·] and etc.
D.: Destination operand, called destination for short, after executing the instructions, operand of
the content is changed. Like the source, index decoration shall apply; when the destination
operand is more, represent with [D1·], [D2·] and etc.
m , n: other operands, which are used to represent constant or make additional interpretation for
the source and destination. Decimal system figure is followed after K and hexadecimal system
figure is followed and H.
Program step: the step for executing the program. Generally speaking, the function number and
memory view occupy one step and each operand occupies 2-4 steps (2 steps for 16-bit operand
and 4 steps for 32-bit operand).
1
Representation and
5 Representation and executing form of applied instructions executing form
Under pulse executing, the instruction MOV execute on data sending from OFF→ON under the
condition X000. To shorten scan time, pulse executing instruction must be used as much as
possible.
The symbol P represents the instruction is available for pulse executing.
F24 (INC), F25 (DEC) and etc. shall be in accordance with the instructions. If continuous
executing instruction is employed, each scan cycle and source content will change.
2
Representation and
5 Representation and executing form of applied instructions executing form
Note: pulse executing instruction does not execute in the first scan cycle.
Continuous executing type
X000
MOV D10 D12
The above figure is continuous executing instruction, PLC works in circulating scan. If the
executing condition X001 is active, the above instruction is repeated one time in each scan cycle.
z When the drive inputs X0 and X1 are inactive, the instructions out of special symbols are not
executed and the destinations do not change.
Processing of symbols
General symbols
z According to types of applied instructions, the following symbols will act.
(For example) M8020: zero symbol M8022: carrying symbol
M8021: borrowing symbol M8029: executing results
When the instructions are ON, the symbols will be active or inactive; for OFF, it will not change
in case of error.
When there are too many instructions affecting the symbols, when executing the instructions each
time, the active/inactive state will be changed. Please refer to the following symbol program case.
z Program case of several symbols (standard case of executing results)
When there are several applied instructions for the same symbol action, please write symbol
contact-point after the instructions.
M8000
DSW X010 Y010 D0 K1 Read the value of digital switch
M8029
Action finishing of DSW is taken as
MUL D0 K10 D20 the triggering point to increase the
M8029 is taken number 10 times.
as action
finishing of
DSW.
X010
SET M0
D PLSY start
M0
DPLSY K1000 D20 Y000 After the number SW×10, output pulse
to Y100 with frequency of 1KHZ.
M8029 is taken
as action M8029
After setting pulse output, take action
finishing of RST M0
finishing of D PLSY as the triggering
DPLSY.
point, reset M0.
3
Representation and
5 Representation and executing form of applied instructions executing form
M8029
As for applied instructions
employing the finishing symbol
Executing results
mark,for instance, DSW and DPLSY
M8000 shall employ M9029 as the finishing
DSW X010 Y010 D0 K1 mark. See the left chart on
X000 programming, and we can not judge
SET M0 which instruction is finished.
M0
DPLSY K1000 D20 Y000
M8029
Executing results
M8067 In case of abnormal computation, M8067 will act and hold and store code of
4
Representation and
5 Representation and executing form of applied instructions executing form
X000
·When the instruction X000 is active,
XCHP D10 D20 exchange content of D10 and D11.
In addition, when the instruction for interrupting program needs the symbol for function extension,
before drive of the symbol for function extension, write the DI instruction (interruption inhibition)
and write the instruction EI (interruption permission) after inactiveness of the symbol for function
extension.
5
5 Representation and executing
Processing of data
form of applied instructions
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
No change
D0 Low
Send
0 1 0 1 0 1 0 1
M15 M14 M13 M12 M11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0
z When 16-bit data is sent to specified of K1M0~K3M0, the high-bit data (namely 4 bit in
maximum) will not be sent according to insufficient specified data length; the same for
32-bit.
z In 16-bit (or 32-bit) computation, when the bit assembly is for specified number of bit
K1-K3 (K1-K7), if the high bit is not sufficient, add 0 for processing, and the highest bit is 0,
so the data is processed as positive.
M0
BIN K2X004 D0
z The specified bit element number 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.
6
5 Representation and executing
Processing of data
form of applied instructions
Attached note
<Specifying of continuous character >
A series of data registers starting from D1 are D1, D2, D3, D4 and etc.
Through bit specifying, in the word situation, it can be used for a series of word processing. See
the followings.
K1X000 K1X004 K1X010 K1X014……, K2Y010 K2Y020 K2Y030
K3M0 K3M12 K3M24 K3M36……, K4S16 K4S32 K4S48
Namely, do not skip the device. Use the devices according to unit of the bit.
However, for 32-bit computation, if K4Y000 is used, the upper 16-bit is 0. When 32-bit data is
required, please specify K8Y000.
7
5 Representation and executing
Processing of data
form of applied instructions
D11(b15~b0) D10(b15~b0)
E0~E7=0 or 1 A0~A22=0 or 1
Mantissa section symbol(0:positive,
1:negative)
B0~b31=0, it is 0
0 -1 -2 -23
Binary floating-point number =±(2 +A22×2 +A21×2 +……+A0×2 )
(E7×27+E6×26+……+E0×20) 127
×2 /2
For example A22=1, A21=0, A20=1, A19~A0=0
E7=1, E6~E1=0, E0=1
0 -1 -2 -3 -23
Binary floating-point number =±(2 +1×2 +0×2 +1×2 +……+0×2 )
(1×27+0×26+……+1×20) 127
×2 /2
129 127 2
=±1.625×2 /2 =±1.625×2
The positive and negative symbols are determined by b31, and complement code can not be used.
z Use of zero symbol (M8020), borrowing symbol (M8021) and carrying symbol (M8022),
see the symbol action on floating-point computation.
Zero symbol: when the result is 0, it is 1.
Negative symbol: the result is not the minimum and not 0, it is 1.
Carrying symbol: if the result exceeds available range of the absolute value, it is 1.
8
5 Representation and executing
Change of operand
form of applied instructions
In interpretation of applied instructions, see the following figure on operand of index decoration.
Add the mark “•” on the source S and destination D to distinguish the operand without change
functions.
Index change available
S· D·
As for structure and function of the index register, please refer to [2-9-2 index register] mfor more
information.
Number decoration of data register
X000
MOVP K0 V0 Change of 16-bit instruction operand
Send content of K0 or K10 to the index register V0
K0→V0
X000 When X001 is active, and V0=0(D0+0=0), content of
K500 is sent to D0. If V0=10(D0+10=D10), content
MOVP K10 V0
of K500 is sent to D10.
K10→V0
X001
MOVP K500 D0V0
X002
Change of 32-bit instruction operand
DMOVP K0 Z0
For the instruction DMOV is 32-bit instruction,
therefore, the index register for the instruction shall be
K0→V0,Z0 specified as 32-bit. In the 32-bit instruction, side Z (Z0-
X002
Z15) of the 32-bit instruction is specified, including
DMOVP K10 Z0 side V (V0-V15), which is taken as actions of the 32-
bit register.
K10→V0,Z0
X003 *1 even data written in Z0 does not exceed 16 bits (0-
32, 767), and V and Z shall be rewritten with the 32-bit
MOVP K69000 D0Z0 instruction. If only size Z is written, and other data is
left on side V, it may lead to great computation error.
V0, Z0 =0: K69000→D1 ,D0 (D0+0)
V10,Z0=0: K69000→D11,D10(D0+10)
9
5 Representation and executing
Change of operand
form of applied instructions
X004
Change of the constant is the same as the device
MOV P K0 V5 number.
If X005 is ON, if V5=0, [K6+0=K6], content of
K0→V5 K6 is moved to D10.
X004 If V5=20, [K6+20=K26], content of K26 is
moved to D10.
MOV P K20 V5
Change of input and output relays (octal system
device number)
K10→V5
X005
MOV K6V5 D10
X010
When X, Y, KnX and KnY and other octal system device
MOV P K0 V3
number is executed for index change, content in the change
register of corresponding device number shall be plus after
K0→V3 octal system conversion.
X011
MOV P K8 V3
See the left figure, output Y7-Y0 with the instruction MOV
K8→V3 to change it into X7-X0, X17-X10 and X27-X20.
X012
MOVP K16 V3
V3=0: X07~X00→Y7~Y0
V8=0: X17~X10→Y7~Y0
V16=0:X27~X20→Y7~Y0
M8000
According to Z0=0-9, then
BIN K1X000 Z0
5 T0Z0=T0-T9
(X003~X000)BCD→(Z0)BIN
X011 PLC
BCD T0Z0 K4Y000
(T0Z0)BIN→(Y017~Y000)BCD
According to Z0=0-9, then T0Z0=T0-T9
10
5 Representation and executing
Change of operand
form of applied instructions
X010
MOV K0 Z0 (K0) → (Z0) Pulse width determined by content of D10 is
output to Y000 or Y001.
X010
Such switching is determined by ON/OFF of
MOV K1 Z0 (K1) → (Z0)
X010
X011
PWM T0Z0 K4Y000 Y000Z0
The instruction F58 can execute the programming instruction one time. Without driving several
outputs at the same time, the controlled objects can be changed by changing the output numbers.
In addition, during the instruction executing, even Z is changed, the above switching is invalid. To
make better switching, please set condition of the drive instruction OFF one time.
Attentions:
z The 16-bit counter with index change can not be used as 32-bit counter. As results of index
change, for 32-bit counter, please add Z0-Z15 after the counter C200.
z V and Z self or bit specifying employs Kn, and n can not be changed. (K4M0Z0 is valid and
K0Z0M0 is invalid)
z Index change can not be executed for LD, AND, OUT and other PLC basic control
instructions and step chart instructions.
11
5 Representation and executing
Change of operand
form of applied instructions
“K” indicates a decimal integer, and is mainly used to specify the set value of timers and counters
and numeric values as operands in applied instruction. (Example: K1234)
The decimal constant specification range is as follows:
- When word data (16 bits) is used … K-32768 to K32767
- When double data (32 bits) is used … K-2,147,483,648 to K2,147,483,647
“H” indicates a hexadecimal number, and is mainly used to specify numeric values a operands in
applied instructions. (Example: H1234)
When using digits 0 to 9, the bit status (1 or 0) of each bit is equivalent to the BCD code, so BCD
data can be specified also.
(Example: H1234 … When specifying BCD data, specify each digit of hexadecimal number in 0
to 9.)
The hexadecimal constant setting range is as follows:
- When word data (16 bits) is used … H0 to HFFFF (H0 to H9999 in the case of BCD
data)
- When double data (32 bits) is used … H0 to HFFFFFFFF (H0 to H99999999 in the case
of BCD data)
“E” indicates a real num (floating point data), and is mainly used to specify numeric values as
operands in applied instructions. (Example: E1.234 or E1.234+3)
The real number setting range is from -1.0× 2128 to -1.0× 2 −126 , 0 and 1.0× 2 −126 to 1.0× 2128 .
In a sequence program, a real number can be specified in two methods, “normal expression” and
12
5 Representation and executing
Change of operand
form of applied instructions
“exponent expression”.
- Normal expression: ….. Specify a numeric value as it is.
For example, specify “10.2345” in the form “E10.2345”
- Exponent expression: ... Specify a numeric value in the format “(numeric value) ×10 n ”.
For example, specify “1234” in the form “E1.234+3”.
“+3” in “E1.234+3” indicates “ 10 3 ”.
13
List of applied
6 Applied Instruction Interpretation instruction
Program chart
Function No. Memory view Name Page
00 CJ Conditional jump 1
01 CALL Call sub-program 3
02 SRET Sub-program return 3
03 IRET Interruption return 5
04 EI Interruption permitted 5
05 DI Interruption inhibited 5
06 FEND Main program end 10
07 WDT Monitor timer 11
08 FOR Cycle start 12
09 NEXT Cycle end 12
0
Sending and
6 Applied instruction interpretation comparison
Instruction format:
CJ P
P: destination symbol of conditional jump
When PLC is used, if some of the program does not need executing every time, such instruction
can be used to shorten the time of executing.
For instance,
X000
CJ P
Range of point (P) is: P0~P255 (TP03 M/H type),P0~P127 (TP03 SR type). Of them, P63 refers
to END, and do not program it. Otherwise, it may lead to error.
Index change can be done for the pointer number. See the figure below:
X000
CJ P0Z0
1
Sending and
6 Applied instruction interpretation comparison
For example:
X000
CJ P8
X 001
Y 001
X 002
M1
X 003
S1
X 004
T1 K 10
X005
R ST T246
X006
T246 K1000
X007
R ST C0
X010
C0 K20
X011
MOV K3 D0
X000
P8 CJ P9
X 012
Y 001
X013
P9 R ST T246
R ST C0
The following table describes results of state change of the element during program jump:
State of contact-joint Action of contact-joint
Element Action of coil during jump
before jump during jump
X001, X002, X003 OFF X001, X002, X003 ON Y001, M1, S1 OFF
Y, M, S
X001, X002, X003 ON X001, X002, X003 OFF Y001, M1, S1 ON
X4 OFF X4 ON The timer dos not act
10ms,100ms
Timing stops, it continues
timer X4 ON X4 OFF
after X0 OFF
X5, X6 OFF X6 ON The timer does not act
1ms timer Timing stops, it continues
X5 OFF, X6 ON X6 OFF
after X0 OFF
X007, X010 OFF X010 ON The counter does not count
Counter Counting stop, after X0 OFF,
X007 OFF, X010 ON X010 OFF
it continues counting
Applied instruction does not
X011 OFF X011 ON
Applied execute
instructions The jumped applied
X011 ON X011 OFF
instruction does not execute
z Y001 becomes dual-coil, no matter jump inside or outside, it is processed as general
dual-coil.
z When reset instructions of the accumulated timer and counter jump outside, reset of the
timing coil and counting coil (clearing of contact-joint recovery and current value) are valid.
2
Sending and
6 Applied instruction interpretation comparison
Instruction format:
CALL P
Range of pointer (P): P0~P255(TP03 M/H type),P0~P127(TP03 SR type). Of them, P63 refers to
END, which can not be used as pointer of FNC01 (CALL). Index change is available for pointer
number.
Instruction format:
SRET
For sub-program return, there is no applicable device.
Example 1:
X000
CALL P10
Main program
Mark FEND
P 10
Sub pragram
SRET
END
z When X000 is ON, the instruction CALL is executed, and it is executed after jumping to P10.
Executing the sub-program here, when the instruction SRET is executed, it is returned to the
original step.
z The pointer program shall be written after the instruction FEND.
z When it is used with the instruction CJ, the same number P can not be used.
3
Sending and
6 Applied instruction interpretation comparison
Example 2:
X001
CALLP P11
FEND
Mark
P11
Sub-program
CALL P12
SRET 1
Mark
P12
Sub-program
SRET 2
END
z After X001=OFF→ON, the instruction CALL P P11 is executed one time, it jumps to P11.
z In the sub-program of P11, if the instruction CALL P12 is executed, sub-program of P12 is
executed. After executing the instruction SRET, it returns to sub-program of P11, then the
instruction SRET is executed to return to the main program.
z There are 16 layers of nesting in maximum.
z Timer in the sub-program employs T192~T199 or T246~T249.
4
Sending and
6 Applied instruction interpretation comparison
5
Sending and
6 Applied instruction interpretation comparison
z The pointer number can not be repeatedly. As for the same outputs, the corresponding fall
edge interruption and falling edge interruption numbers can not be used for the input.
z If M8050~M8055 is ON, interruption to corresponding input is inhibited.
For example: the interruption processing must be executed for latest input information.
EI
FEND
I 101 M8000
REF X010 K8
X010
SET Y001
X010
RST Y001
IRET
END
z Rising edge testing of X001is ON, routine program for interruption and input refreshing are
executed. According to state of ON/OFF of X010, set Y001 or reset.
See the following table on numbers and actions of interruption pointers of corresponding 3 points:
6
Sending and
6 Applied instruction interpretation comparison
Ixxx
10~99 (ms)
6,7,8
For example: 1 is added on each 10ms, and compare with setting values.
Program
step EI
0
X000
SET M3
FEND
M3
I610 INC D0
X000
Interruption LD= K1000 D0 RST M3
indicator
IRET
END
See the following table on interruption pointer numbers and actions of corresponding 6 points.
7
Sending and
6 Applied instruction interpretation comparison
I0x0
1~6
Pointer
Instruction for interruption inhibition
number
I010
I020
I030
M8059
I040
I050
I060
Example
Program
step EI
0
M8000
C255 K2,147,483,647
Interruption
I010 routine program
Interruption
indicator
Interruption
IRET
return
END
z For the coil driving the high speed counter, it is used to specify the interruption pointer
in the instruction FNC (DHSCS).
z When current value of C255 varies from 999~1000, sub-program interruption is
executed.
z As for current values of the high speed counter, if active/inactive control can be done for
the output relay or auxiliary relay, the instructions FNC53(DHSCS), FNC54(DHSCR),
FNC55(DHSZ) can be used to simply the program.
8
Sending and
6 Applied instruction interpretation comparison
Attentions
z As the number of input relay for interruption pointer, please do not use the applied
instructions for high speed counter, pulse density and etc. with the same input range for
repeated numbers.
z Please use the timer T192-T199 for routine program for timer in the sub-program and
routine program interruption. If general timer is used, timing can not be performed.
When 1ms accumulated timer is used, pay attention to it.
9
Sending and
6 Applied instruction interpretation comparison
The instruction is an independent instruction without driving contact-joint, representing end of the
main program.
The instruction has the same effect with the instruction END, executing output processing, input
processing, refreshing of monitor timer and returning to step 0 of the program.
X011=ON
X011=OFF
X010 X011
CJ P20 CALL P21
FEND FEND
P20
X010=ON
P21
Main process program Main process program
END END
z 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.
z 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 abnormal program.
z If there are several FEND instruction, the sub-program and interruption program shall be
written between the last FEDN and END instructions.
10
Sending and
6 Applied instruction interpretation comparison
The instruction is used for refreshing of the monitor timer to avoid error of the controller caused
by delay of the scan cycle.
For example: If the scan time exceeds specified values, PLC will stop operation. Under the
circumstances, the instruction WDT will be inserted into appropriate program step to refresh the
timer. Value of the monitor timer is set by D8000, with range of 200ms-1600ms.
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 the first part and second part of the program is less than
200ms.
z Testing time of the monitoring timer can be changed by rewriting content of D8000, see the
following figure:
M8002
MOV K300 D8000
WDT
z When the system is connected to many station locating, cam switch, ID interface, link,
analog quantity and other special extended equipment, when the controller runs, initializing
time of the buffing storage device will be extended to cause delay of the scan time. Besides,
when executing several FROM/TO instructions for sending data to several buffing storage
devices, the time will be delayed. Under the circumstances, it may cause abnormality of
timeout monitor timer, at this time, input the above program near the starting step to extend
time of the monitor timer.
11
Sending and
6 Applied instruction interpretation comparison
Instruction format:
FOR S·
The instruction is a single instruction with driving contact-joint and used with FNC08(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.
Example:
FOR K4
FOR D0Z0
X010
CJ P22
A B C
FOR K1X000
NEXT 1
P22
NEXT 2
NEXT 3
z After [c] program executed 4 times, it is moved to program after the instruction (3) of NEXT;
if [c] program is executed, content of the data register D0Z0 is 6m the [B] program executes
6 times; the instruction CJ can be used to skip program between FOR~NEXT, like
X010=ON.
z There are 16 layers of nesting, and FOR~NEXT must be in couple, otherwise, it may lead to
error.
z Too many cycles may lead to delay of the scan cycle, which may cause error of the monitor
timer and please pay attention.
12
Sending and
6 Applied instruction interpretation comparison
0
Sending and
6 Applied instruction interpretation comparison
Instruction format:
M 10
K 20>Current value of D 10, M 10 O N
M 11
Current value of K 20=D 10, M 11 O N
M 12
Current value of K 20<D 10, M 12 O N
X000 X000
RST M0 ZRST M0 M2
RST M1
RST M2
1
Sending and
6 Applied instruction interpretation comparison
Instruction format:
M10
Current value of C10<K20, M10 ON
M11
K20≤ Current value of C10 ≤K200, M11 ON
M12
Current value of C10>K200, M12 ON
Data of S1·, S2· and S0· shall be compared by integral with symbols.
S1·≤S2· is required. When S2·<S1·, S2· is computed as S1·.
The destination address occupies 2 points automatically, if M0 is specified, it occupies M1 and M2.
When the instruction is not executed, the destination data is not affected.
If the results need to be cleared, the instructions RST or ZRST are used;
X000 X000
RST M0 ZRST M0 M2
RST M1
RST M2
2
Sending and
6 Applied instruction interpretation comparison
Instruction format:
MOV S· D·
S·: Data source
D·: Destination address of data moving
Content of S· is directly sent to D·, 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.
The 16-bit element information transmission, when the instruction is executed, 4 bit elements of
X10-X13 are sent to Y10~Y13, which has the same function with the following program.
X000
MOV K1X10 K1Y10
X10
Y10
X11
Y11
X12
Y12
X13
Y13
3
Sending and
6 Applied instruction interpretation comparison
Instruction format:
SMOV S· m1 m2 D· n
When M8168=OFF,
BIN code of D10 Conversion data
of BCD of
D10 converted into BCD 103 102 101 100 source data, the
code 2nd bit from the
4th bit is sent to
the 3 bit of the
BIN code of D20 103 102 101 100 [Link]
BCD value of
D10 exceeds
Converted into BID code 0~9,999, it will
automatically be error.
When M8168=ON:
BIN code of D10 BCD code is not
executed. 4 bits
are taken as one
BIN code of D20 unit for bit
moving.
4
Sending and
6 Applied instruction interpretation comparison
Instruction format:
CML S· D·
S· : data source
D· : destination address of data transmission
Content of S· is sent to D· contrarily (0→1, 1→0), if the content is the constant K, which is
converted into BIN value automatically.
For instance,
D10 1 0 1 0
Do not change 0 1 0 1
Y0 17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
X001 X001
OUT M0 OUT M0
X002 X002
OUT M1 OUT M1
X003 X003
OUT M2 OUT M2
X004 X004
OUT M3 OUT M3
5
Sending and
6 Applied instruction interpretation comparison
Instruction format:
BMOV S· D· n
X000
D20 3 D21
BMOV D20 D21 K3
D21 2 D22
D22 1 D23
Set M8024 ON, when executing the instruction, it rotates contrarily with the moving
direction.
X000 M8024=ON
M8024 D5 1 D10
D6 2 D11
D7 3 D12
BMOV D5 D10 K3
M8024=OFF
X000
D5 1 D10
M8024
D6 2 D11
D7 3 D12
6
Sending and
6 Applied instruction interpretation comparison
Instruction format:
FMOV S· D· n
X000
FMOV D1 D10 K3
Attentions
z The 16-bit instruction destination operand can not specify V and Z, the 32-bit instruction
destination operand can not specify V, and it can only specify Z. When Zn is specified, (Vn,
Zn) make up 32-bit data.
7
Sending and
6 Applied instruction interpretation comparison
Instruction format:
8
Sending and
6 Applied instruction interpretation comparison
Instruction format:
BCD S· D·
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
FNC19(BCD→BIN) is used; and when it outputs to BCD seven-section display, the conversion
sending instruction FNC18 (BIN→ BCD)is used.
When special instructions like FNC72(DSW), FNC74(SEGL), FNC75(ARWS) are used, it will
execute BCD/BIN conversion automatically.
9
Sending and
6 Applied instruction interpretation comparison
Instruction format:
BIN S· D·
10
6 Applied instruction interpretation Data processing
Arithmetic operation
Function No. Memory view Name Page
20 ADD Addition computation 1
21 SUB Subtraction computation 2
22 MUL Multiple computation 3
23 DIV Division computation 4
24 INC Increasing computation 5
25 DEC Decreasing computation 5
26 WAND WAND computation 6
27 WOR WOR computation 6
28 WXOR WXOR computation 6
29 NEG NEG computation 7
0
6 Applied instruction interpretation Data processing
Instruction format:
Function: S1· plus S2· with symbols, and the result is stored in D1.
If the computation result is 0, M8020 sets.
If the computation result is less than the minimum value, M8021is set.
If the computation result is more than the maximum value, M8022 is set.
Result of 16-bit computation is between -32,768 ~ +32,767.
Result of 32-bit computation is between-2,147,483,648 ~ +2,147,483,647.
z The two data sources are added in BIN and sent to the destination data zone, and the highest bit
of the data is the positive (0) or negative (1) symbol bit, therefore, algebraic addition shall apply.
(5+(-8)=-3)
z 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.
(Refer to the next page). If the computation result is less than -32,768(16-bit computation) or
-2,147,483,648(32-bit computation), the negative flag sign will act. (Refer to the next page)
z For 32-bit computation, lower 16-bit element of Word element shall be specified and upper Word
of specified number is used. To avoid repeated number, even number is used for specifying
elements.
z Please specify the same number for the data source and destination data zone. If the continuous
executing instruction (ADD,D ADD) is used, plus of each scan time is changing, and please pay
attention to it.
X000
ADD P D1 K1 D1
z 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 with the following instruction INC P.
1
6 Applied instruction interpretation Data processing
Instruction format:
Data in S1·and S2· are subtracted in BIN, and the result in D·.
For the highest bit of the data, 0 represents positive, 1 represents negative and algebraic subtraction is
executed.
Example:
X000
SUB D1 D2 D3
z When X000 is ON, content of minuend D1 minus content of subtrahend D2, and the difference is
stored in D3.
z Mark action, specifying method of 32-bit computation element, difference of the continuous
executing and pulse executing and etc. are the same with the instruction ADD in previous page.
z See the following on relation of actions and values.
Zero mark
Zero mark Zero mark
Zero mark
Mis-poistion
Carrying mark
mark
2
6 Applied instruction interpretation Data processing
Instruction format:
S1· : Multiplicand
S2· : Multiplicator
D· : Product
Data in S1· and S2· are multiplied in BIN, and the result is stored in D·.
For the highest bit symbol of data, 0 represents positive and 1 represents negative, and algebraic
multiplication is executed.
z The product computed from specified content of the data element is stored in specified element
zone (the lower side), meanwhile, it occupies the upper element to make up 32-bit data. See the
above figure, when D0)=8,(D2)=9, (D5,D4)=72.
z For the highest bit of the result, 0 for positive and 1 for negative.
z When D· is element, bit specifying for K1~K8 is required. When K4 is specified, low 16-bit of
the product can be obtained.
3
6 Applied instruction interpretation Data processing
Instruction format:
S1· : Dividend
S2· : Divisor
D· : Quotient
Data in S1· and S2· are divided by in, with result stored in D·.
For the highest bit symbol of the data, 0 represents positive, 1 represents negative and algebraic
division is carried out.
<16-bit computation >
X000
DIV D0 D2 D4
z See the figure above: D0 is the dividend, D2 is divisor, D4 stores the quotient by the
computation and D5 stores the residual by the computation.
z See the figure below, (D1,D0) are dividends, (D3,D2_are divisors,(D5,D4)store the quotient by
the computation and (D7,D6) store the residual by the computation.
z D· can not specify Z element.
Note:
z When the divisor is 0, it may cause error and the instruction will not be executed D8067=6706.
z When D· is specified as bit element, residual can not be obtained.
z The uppermost of the quotient and residual is the symbol for positive (0) and negative (0). When
the quotient is negative, any of the dividend and divisor is negative; if the residual is negative,
the dividend is negative.
4
6 Applied instruction interpretation Data processing
INC D·
z The instruction is of pulse instruction in general. Otherwise, when the instruction is executed, 1 is
added on each scan cycle D·, so please pay attention to it.
z For 16-bit computation, if 1 is added on +32,767, it becomes -32,768, and the mark does not act.
For 32-bit computation, if 1 is added on +2,147,483,647, it becomes -2,147,483,648, and the
mark does not act.
DEC D·
z 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.
z For 16-bit computation, if 1 is subtracted from -32,768, it becomes +32,767, the mark does not
act.
For 32-bit computation, if 1 is subtracted from -2,147,483,648, it becomes +2,147,483,647, the
mark does not act.
<Application case>
X010
MOV P K0 Z0
M1
X011
BCD P C 0Z0 K4Y000
INC P Z0
CMP K10 Z0 M0
z When current values of the counters C0~C9 are converted for BCD, it is output to K4Y000.
z Resetting input X010 is executed in advance to clear Z0.
z When X011 is ON one time, it outputs current values of C0, C1…C9.
5
6 Applied instruction interpretation Data processing
Instruction format:
Instruction format:
Instruction format:
6
6 Applied instruction interpretation Data processing
Instruction format:
NEG D·
z Reverse each bit of the content specified by D·, 1 is added on them, and the result is stored in D·.
z The instruction is of pulse instruction. The continuous executing instruction will execute the
instruction after each scan cycle and please pay attention to it.
z When the instruction is used, the corresponding absolute value of negative BIN value shall be
obtained.
Note: after computation is computed for -32,768, it is-32,768.
M8000
BON D10 M0 K15
M0
NEG P D10
M10
SUB D10 D20 D30
M11
M12
SUB D20 D10 D30
Even complement code is not used for the above loop, D30 represents absolute value of the difference
in subtraction.
7
6 Applied instruction interpretation Data processing
0
6 Applied instruction interpretation Data processing
Instruction format:
ROR D· n
ROL D· n
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
※ ※
M8022
M8022
Carry
Carry
Upper After one execution Lower Upper After one execution Lower
position position position position
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
※ ※
1 M8022
M8022 0
※ ※
1
6 Applied instruction interpretation Data processing
z The continuous executing instruction will gyrate after each scan cycle and please pay attention to
it.
z It is the same for the 32-bit instruction.
z 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)
2
6 Applied instruction interpretation Data processing
Instruction format:
RCR D· n
Instruction format:
RCL D· n
X000 X000
RCL P D0 K4 RCR P D0 K4
3
6 Applied instruction interpretation Data processing
Instruction interpretation: when X000 is changed from OFF to ON, K4 with carrying symbol M8022
will gyrate to the left (right).
z The continuous executing instruction will gyrate after each scan cycle and please pay attention to
it.
z It is the same for the 32-bit instruction.
z When the bit is used to specify the element, only K4 (16-bit instruction)and K8 (32-bit
instruction) are valid.(such as K4Y010, K8M0)
4
6 Applied instruction interpretation Data processing
Instruction format:
SFTR S· D· n1 n2
Instruction format:
SFTL S· D· n1 n2
5
6 Applied instruction interpretation Data processing
4 3 2 1
1 2 3 4
S1 X002
S7 X007
M000
MOV K2S0 K2Y000
M8047
END
X001
Even X000 is ON, Y000 will not act
X007
Y000
Y001
Y007
6
6 Applied instruction interpretation Data processing
Instruction format:
WSFR S· D· n1 n2
Instruction format:
WSFL S· D· n1 n2
z Data tandem with n1 word element (length of shifting buffer) started with D·, it moves right (left)
with n2 shifting number and number started with S· is moved to D· to fill the empty element with
n2 word element.
z The instruction is of pulse instruction in general.
z When S·/ D· are specified as bit combined device, the same bit specifying is required.
7
6 Applied instruction interpretation Data processing
X000 ①D13~D10→Overflow
WSFR P D0 D10 K16 K4 ②D17~D14→D13~D10
③D21~D18→D17~D14
④D25~D22→D21~D18
D3 D2 D1 D0 N2 shifting right ⑤D3~D0→D25~D22
D25 D24 D23 D22 D21 D20 D19 D18 D17 D16 D15 D14 D13 D12 D11 D10
5
4 3 2 1
X000 ①D25~D22→Overflow
WSFL P D0 D10 K16 K4 ②D21~D18→D25~D22
③D17~D14→D21~D18
④D13~D10→D17~D14
⑤D3~D0→D13~D10
N2 character shifting left D3 D2 D1 D0
D25 D24 D23 D22 D21 D20 D19 D18 D17 D16 D15 D14 D13 D12 D11 D10 5
1 2 3 4
X000
WSFR K1X00
K1Y000 K4 K2
P 0
X7 X6 X5 X4 X3 X2 X1 X0
2 1
The same bit specifying shall be done for the bit elements.
8
6 Applied instruction interpretation Data processing
Instruction format:
SFWR S· D· n
X000
SFWR D0 D1 K10
9
6 Applied instruction interpretation Data processing
Instruction format:
SFRD S· D· n
D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D20
z When the drive X000 is ON from ON, 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, content of D2 is read to D20 and
1 is subtracted fro content of D1. (When continuous executing instruction is used, each scan
cycle will execute one reading and shifting).
z When content of the pointer D1 is 0, the instruction stops executing, and the zero point mark
M8020 acts.
Shifting reading and writing case for first in and first out control
The product number is logging while warehousing. To ensure first in first out, the case is stated below:
The product is 4-bit number of hexadecimal system and the maximum number is below 99 points.
X020
MOV P K4X000 D256
M8000
MOV D357 K4Y000
10
6 Applied instruction interpretation Data processing
Data processing
Function No. Memory view Name Page
40 ZRST Full reset 1
41 DECO Decoder 2
42 ENCO Encoder 3
43 SUM ON bit quantity 4
44 BON ON Bit judging 5
45 MEAN Mean 6
46 ANS Warning coil setting 7
47 ANR Warning coil resetting 8
48 SQR BIN Square root computation 9
49 FLT BIN Integral→ Binary floating-point 10
0
6 Applied instruction interpretation Data processing
Instruction format:
X000
ZRSTP M100 M200
When X000 is from OFF to ON, M100 to M200 are fully cleared.
z When computation element number of D1·> computation element number of D2·, only the
computation element specified by D·1 can be cleared.
z The instruction is executed with 16-bit, however, D1·/D2· can specify 32-bit counter, which can
not be specified in a mixed way. For example, D1· is 16-bit counter, and D2· is 32-bit counter.
z The instruction is of pulse instruction in general.
As independent resetting instruction for the device, as for bit elements Y, M and S and word elements
T, C and D, the instruction RST can be used. As the instruction F16 FMOV for writing the constant
K0 in batches, it can be written into devices KnY,KnM,KnS,T,C,D.
X000 Reset M0
RST M0
RST D0 Rest D0
X000
FMOV K0 D0 K100
Write D0~D99 into K0
1
6 Applied instruction interpretation Data processing
Instruction format:
DECO S· D· n
Low n bit of the source device is taken for decoding and result of 2n bit length is stored in D·.
The instruction is of pulse instruction in general.
X004
DECO X000 M0 K3
M7 M6 M5 M4 M3 M2 M1 M0
0 0 0 0 1 0 0 0
The data source is 1+2=3, the M3 is set 1, and other bits are reset.
D· is bit element, when n=8, 28=256 points.
D· is word element, when n=4, 28=16 points; when n<4, high bit of D· is used for zero extension.
2
6 Applied instruction interpretation Data processing
Instruction format:
ENCO S· D· n
2 exp n bit length of the source device S· is used for coding and the result is stored in D·.
The instruction is pulse instruction in general.
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
When there are several bits in the data source are 1, 1 at low bit will not be processed. When the data
sources are 0, it is error.
S· is bit element, when n =8, 28 =256 points.
S· is word element, when n =4, 24 =16 points.
3
6 Applied instruction interpretation Data processing
Instruction format:
SUM S· D·
S· : Source device
D· : Destination device for storing counting values
X000
SUM D0 D2
0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 7
D0 D2
4
6 Applied instruction interpretation Data processing
Instruction format:
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).
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
5
6 Applied instruction interpretation Data processing
Instruction format:
MEAN S· D· n
S· : Source device
D· : Destination device for storing the mean
n: Specify number for mean, n=1~64
X000
MEAN D100 D150 K5
(D100+D101+D102+D103+D104)/ 5 D150
z Mean (the algebraic sum is divided by n) of point n is stored in the destination address and the
residual is ignored. If it exceeds the device number, minimum value of n is obtained in possible
range.
z If n is out of 1~64, it may lead to error.
When range specified by S· exceeds n, the instruction will calculate the mean in effective range.
Example:
X000
MEAN D8510 D0 K3
(D8510+D8511)/ 2 D0
6
6 Applied instruction interpretation Data processing
Instruction format:
ANS S· m D·
z If X000 is active for 1 second, S900 is set. Even X000 is OFF (the timer is reset), S900 keeps
acting.
If it is less than 1 second, X000 or X001 is OFF, the timer resets.
z Preset M8049 (available signal alarm) ON, minimum number of the signal alarm S900~S999 ON
is stored in D8049. In addition, if any of S900~S999, M8048 (the alarm acts) is ON.
7
6 Applied instruction interpretation Data processing
If X000 is active, the acting points of the signal alarm S900~S999 are reset.
If there are several alarm points simultaneously, the alarm point with minimum number will be reset.
At this time, if the effective mark M8049 of the signal alarm is ON, content of the register D8049 will
be updated timely and the minimum number of the alarm points will be left.
If X003 is active a second time, state of the next number will be reset.
If the instruction ANRP is used, it is reset in each scan cycle according to the sequence and pay
attention to it.
The following figure describes the external failure diagnosis circuit. The special data buffer D8049 is
used to monitor the minimum number of state numbers of S900~S999. In case of several failures, after
the failure with minimum number is released, the next failure number is displayed.
M8000
M0
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
z When the special auxiliary relay M8049 acts, monitoring can be performed.
z When the forward output Y005 is driven, the forward is detecting. If X000 fails to act within 1
second, S900 acts.
z In case of abnormality of DOG, if the upper limits X001 and X002 fail to act simultaneously
over 2 seconds, S901 acts.
z When T2 is less than 10 seconds and the continuous operation input point X003 is ON, during 1
cycle, if the action switch X004 does not act, S902 acts.
z When there is ON between S900~S999, the special auxiliary relay M8048 acts, the failure
represents the output Y006 acts.
z Before acting of the external failure diagnosis program, the state clearing key X007 is set OFF;
when X007 is ON, the minimum number will be cleared in sequence.
<Alarm coil effective M8049>
When M8049 is driven, minimum number of acting state of S900~S999 is stored in D8049.
<Alarm coil acting M8048>
When M8049 is driven, in case of acting between S900~S999, M8048 will act.
8
6 Applied instruction interpretation Data processing
Instruction format:
SQR S· D·
When X000 is ON, after square root is executed for data in D0, the result is stored in D1.
z S· is valid for non-negative. If it is negative, it may lead to error, the mark M8067 is ON, and the
instruction will not be executed.
z The computation result D· is integral, the decimal is ignored, and the borrowing mark signal
M8021 is ON.
z When the computation result is 0, the zero mark M8020 is ON.
9
6 Applied instruction interpretation Data processing
Instruction format:
FLT S· D·
S· : Data source for conversion from BIN integral→ Binary floating-point numbers 2
D· : Destination device for storing results
Example:
X000
FLT D0 D2
X001
DFLT D0 D2
10
6 Applied instruction interpretation Data processing
7
1 2 5 4 ( D13, D12)
Decimal floating monitoring
8
D21 ,D20 (D22)BIN (D27,D26 ) (D15,D14 )
Binary 32- bit BIN integral
3 floating
(D25,D24 )
Binary
floating
(D29,D28 )
Binary
floating
M8000
1
FLT D0 D20
11
High speed counting
6 Applied instruction interpretation processing
0
High speed counting
6 Applied instruction interpretation processing
REF D· n
z When specifying the start device number D·, set the lowest bit number 0, like X000, X010,
Y000 and etc.
z The refreshing point n shall be 8 or 16 points, otherwise, it may lead to error.
z In general, the REF instruction can be used among the instructions FOR~NEXT and the
instruction CJ.
z In the interruption processing with input and output actions, latest input information and
timely output computation can be obtained by executing the instruction.
1
High speed counting
6 Applied instruction interpretation processing
Instruction format:
S· :Start device for matrix scan input, the rightmost number shall be 0, such as X000, X010 and
etc. and occupies continuous 8 points.
D1· :Start device for matrix scan output, the rightmost number shall be 0.
D2· :Start device for matrix scan value storage, the rightmost number shall be 0.
n:row of matrix scan, n=2~8 is valid.
The instruction uses 8 points input and n points output, and reads n rows of 8 point input signal
instruction.
Example:
X010
MTR X040 Y040 M10 K3
○ ○ ○ ○ ○ ○ ○ ○
Diode ○
M20
○
M21
○
M22
○
M23
○
M24
○
M25
○
M26
○
M27
↓ ↓ ↓ ↓ ↓ ↓ ↓
X4 1 X4 2 X4 3 X4 4 X4 5 X4 6 X4 7
○ ○ ○ ○ ○ ○ ○ ○
M10 M11 M12 M13 M14 M15 M16 M17
○ ○ ○ ○ ○ ○ ○ ○
COM X4 0 X4 1 X4 2 X4 3 X4 4 X4 5 X4 6 X4 7
COM Y4 0 Y4 1 Y4 2 Y4 3 Y4 4 Y4 5 Y4 6 Y4 7
2
High speed counting
6 Applied instruction interpretation processing
M0
Y020 1 4
Y021 2 5
Y022 3 6
20ms
M8029
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
3
High speed counting
6 Applied instruction interpretation processing
Instruction format:
Example:
M8000 K100
C235
C235
Action of Y001 is affected by
Y001 scan cycle
M8000 K2,147,483,647
C235
Y 001 sets immediately
HSCS K100 C235 Y001
z The high speed counter works according to input OFF→ON in interruption mode. When
current value of the counter is equal to the setting value, output contact-joint of the counter
works immediately. If the instruction FNC53 is not used, the external output has something to
do with the sequential control, so it is affected by scan cycle and it outputs after the END
processing.
z The instruction FNC53 can be used for interrupting processing comparison and external
output, therefore, when current value of C235 is becoming 99→100 or 101→100, Y001 sets
immediately.
4
High speed counting
6 Applied instruction interpretation processing
Attentions
z The instruction is 32-bit special instruction, which must be input as the instruction DHSCS.
z These instructions can compare results and actions in case of pulse input, therefore, even
current value is changed by sending instruction, if there is no counting input, the comparison
output will not change.
z F53, F54, F55 and other instructions can be used repeatedly, however, number of
simultaneous driving of the instructions must be less than 6.
z If the instructions DHSCS, DHSCR, DHSZ and etc. are used, maximum permissible
frequency of high speed controller of the PLC will be affected greatly.
Counting interruption
Program step
0 EI
M8000
K2,147,483,647
C235
Interruption indicator
I010
FEND
IRET
z D· of the instruction DHSCS can be specified as the interruption indicator I010~I060. (The
number can not be used repeatedly)
z When current value of the high speed counter specified by S2· is changed into specified value
of S1·, interruption program of specified mark by D· is executed.
z When special auxiliary relay M8059=ON, interruptions of I010~I060 are inhibited.
5
High speed counting
6 Applied instruction interpretation processing
Instruction format:
Example
M8000
K2,147,483,647
C235
400
C235 300
Current
value
z When current value of C235 becomes 400, C235 resets immediately, the current value is 0
and the output contact does not work.
z If the instruction is 32-bit instruction, it must be used as input of the instruction DHSCR.
Please refer to Attentions in FNC53 for other attentions.
6
High speed counting
6 Applied instruction interpretation processing
Instruction format:
For instance,
M8000
K2,147,483,647
C251
7
High speed counting
6 Applied instruction interpretation processing
S1· :External pulse input terminal, TP03 M/H machine type S1· can only specify X0~X5,
TP03SR machine type can only specify X0~X3
S2· :Time of receiving pulse (the unit is ms)
D· : Result location, occupying continuous 3 devices.
Example:
X010
SPD X000 K100 D0
X010
X000
100ms 100ms
100
z Input pulse specified by S1· counts in specified time (ms) by S2·, and the result is stored in
D· specified device.
z Through repeated operation, pulse density (the proportional value with rotating speed) in
D· is obtained. D· occupies 3 points of devices.
z In the figure, when X010 is ON, D1 counts OFF->ON of X000. After 100ms, the results are
stored in D0. Then D1 resets, it counts actions of X000 a second time.
z D2 is used to measure time left.
z The specified input X000~X005 herein can not be used repeatedly with the high speed
counter and interruption input.
z Maximum frequency of ON/OFF of input X000-X005 has the same processing with 1-phase
high speed counting. When it is used high speed counting, instructions FNC57(PLSY)and
FNC59(PLSR), sum of the processing frequency shall be less than the specified frequency.
8
High speed counting
6 Applied instruction interpretation processing
Instruction format:
X000
PLSY K100 K1000 Y000
Pulsar
Y000
Frequency(K1000)
z Specified frequency is used to generate fixed pulse frequency. During the instruction
executing, if content of the word device specified by S1· is changed, the output frequency
will vary.
z When value of S2· is specified 0, there is no restriction on created pulse. During the
instruction executing, if specified word device by S2· is changed, it will execute the changed
content from the next instruction drive.
z After X010 is OFF, the output stops; when it is ON a second time, it acts from the initial state,
when it makes continuous beeper, X010 is OFF, and Y000 is also OFF.
z Duty ratio of the pulse is 0.5. The output control is not affected by scan cycle and interruption
processing is employed.
9
High speed counting
6 Applied instruction interpretation processing
<Attentions>
1. Do not drive the pulse output instruction using the same output relay (Y000 or Y001)
simultaneously. If it is driven simultaneously, it leads to use of dual-coil and it can not operate
with normal performance.
2. After drive contact-point of the pulse output instruction is OFF, a second drive shall be
executed after the following conditions are established.
Conditions: after pulse output monitor Y000: [M8147] and Y001:[M8148] ) of the previous drive
is OFF, it can be driven after one calculation performance cycle.
For additional drive of the pulse output instruction required more than 1 calculation performance
for OFF, if the drive is earlier than the conditions, the initial instruction performance may cause
normal calculation performance, when it is driven by the 2nd instruction, it starts pulse output.
Vir
Lo
Po
ad
tua
l PLC
resi
we resi
sto
r sto
r
sup r
ply
100mA
z It can not be repeated with specified output number by the instruction FNC58 (PWM).
z As for specified output numbers by the instruction FNC58 (PWM), it can not be repeated.
10
High speed counting
6 Applied instruction interpretation processing
Instruction format:
Y000
T
Attentions:
z Transistor output shall be used for PLC. For high frequency pulse output, as mentioned
above, please offer load current. (FNC57(PLSY))
z Specified output number by FNC57(PLSY)or FNC59(PLSR)can not be used repeatedly.
11
High speed counting
6 Applied instruction interpretation processing
Instruction format:
z Pulse output instruction with functions of acceleration and deceleration with fixed sizes.
For specified maximum frequency, fixed acceleration is executed; after it reaches specified
output pulse quantity, fixed deceleration is executed.
10 1
9 2
Output: Y000 or Y001 8 3 1 speed variation is
7 4 1/10 of S1·in
6 maximum
5
S2·Total output pulse quantity
5 10-level 10-level 6
4 transmission transmission 7
3 8
16-bit instruction:110~32,767PLS
2 32-bit instruction: 110~2,147,483,647PLS
9
1 10
Time s
S3· acceleration time S3· Deceleration time
Less than 5000ms Less than 5000ms
12
High speed counting
6 Applied instruction interpretation processing
90000
S3 ≥ ×5
S1
③Formula of maximum time for acceleration and deceleration
S2
S3 ≤ × 818
S1
D· Pulse output numbers:
· Only specify Y000 or Y001.
· The output is transistor output.
z Output frequency of the instruction is 10~100,000Hz, when maximum speed and variable
speed of acceleration and deceleration exceed the scope, it is lowered or carried in the range
automatically.
z The output control is not affected by scan cycle for interruption processing.
z When X010 is OFF, output is interrupted. When it is set ON a second time, it acts from the
initial position.
z During the instruction executing, even the operand is rewritten, the operation will not change.
The content of change will take effect in the next instruction drive.
z When setting pulse output finishes, the finishing mark M8029 is set ON.
13
Convenient
6 Applied instruction interpretation instructions
Convenient instructions
Function No. Memory view Name Page
F60 IST State initialization 1
F61 SER Data searching 6
F62 ABSD Control mode of cam control 8
F63 INCD Cam control increment mode 10
F64 TTMR Demonstrating teaching timer 12
F65 STMR Special timer 13
F66 ALT ON/OFF Alternative output 14
F67 RAMP Slope signal 16
F68 ROTC Rotating working bench control 18
F69 SORT Data sort 19
0
Convenient
6 Applied instruction interpretation instructions
Instruction format:
Example:
X000
IST X030 S20 S20
RUN
mnitoring
When driving the instruction, the special relays will switch automatically, if the drive input is OFF,
it will not change.
M8040:Transfer prohibited S0:Initial state for manual operation
M8041:Transfer start S1:Initial state for origin return
M8042:Start pulse S2:Initial state for automatic operation
M8047:STL
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. 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.
1
Convenient
6 Applied instruction interpretation instructions
To avoid the above X030~X034 are ON simultaneously, rotating switch must be used.
When origin return finishes(M8043)and there is no action, manual operation (X030) shall prevail.
If the origin returns (X031)and switches among(X032,X033,X034), all the inputs and outputs
are OFF. The automatic operation can be driven a second time after origin return finishes.
2
Convenient
6 Applied instruction interpretation instructions
X030:Individual operation
X031:Origin return
X032:Step
X033:One operation
X034:Continuous operation
X035:Origin return starts
X036:Automatic start
X037:Stop
X030~X034 do not act simultaneously (Selection switch is utilized)
X030
M0
X035
M1
X033
M2
X040
M3
X032
M4
X034
M5
X026
M6
X041
M7
3
Convenient
6 Applied instruction interpretation instructions
M8000
M0
X030
M1
M800
M2
M3
X031
M4
X032
M5
M6
X033
M7
M3
X031
M4
M8000
M5
X032
M6
X033
M7
4
Convenient
6 Applied instruction interpretation instructions
M8000
IST M0 S20 S29
The auxiliary relay for the instruction IST is divided into self-generated action and program for
operation preparation and control purpose.
5
Convenient
6 Applied instruction interpretation instructions
Instruction format:
The instruction is used for searching the same data, maximum value and minimum value in the
data sheet.
Example:
X000
SER D100 D0 D50 K10
6
Convenient
6 Applied instruction interpretation instructions
Note: WhenS1·,S2· and range of D· exceed the boundary, it may lead to error.
7
Convenient
6 Applied instruction interpretation instructions
Instruction format:
S1· : Comparison start device. When the computation elements specify KnX, KnY, KnM,
KnS, 16-bit instruction shall specify K4; 32-bit instruction shall specify K8 and numbers
of X, Y, M and S shall be multiple of 16.
S2· : Counter number. 16-bit instruction shall specify C0~C199, and 32-bit instruction shall
specify C200~C255.
D· : Start number of comparison result output
n:Number of groups for multi-section comparison, n =1~64
※ 1:For S2·counter number of TP03SR machine type, 16-bit instruction shall specify C0~C99,
and 32-bit instruction shall specify C220~C255.
The instruction is used to generate several output waves for current values of the counter. Take the
working bench rotating one cycle to control the auxiliary relay M0~M3 ON/OFF as example to
describe in detail.
Example:
X000
ABSD D300 C0 M0 K4
C0 X001
RST C0
X001
C0 K360
8
Convenient
6 Applied instruction interpretation instructions
The following data is written into D300~D307 by using sending instructions in advance.
Rising point Falling point Object output
D300= 40 D301=104 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
M 0
100 200
M 1
60 160
M 2
240 280
M 3
9
Convenient
6 Applied instruction interpretation instructions
Instruction format:
S1· :Comparison start element, when KnX, KnY, KnM and KnS are specified, K4 shall be
specified and number of X, Y, M and S shall be multiple of 16.
S2· :Number of the counter, the 16-bit instruction shall specify C0~C198, occupying counters
with 2 continuous numbers.
D· :Start number of comparison results
n:Number of groups for multi-section comparison n=1~64
※ 1:For S2· counter number of TP03SR machine type, 16-bit shall specify C0~C98, occupying
counters with 2 continuous numbers.
The instruction is used for several output waves generated by a couple of counters.
Example:
X000
INCD D300 C0 M0 K4
M8013
C0 K9999
According to the time sequence sheet, take the control n=4 points for M0-M3 for interpretation.
z The following data is written into S1·by the sending instructions in advance.
D300=20
D301=30
D302=10
D303=40
10
Convenient
6 Applied instruction interpretation instructions
X000
30 40 30
C0 20 20
10
3
C1 2
1 1
0 0 0
M1
M2
M3
M4
z When the counter C0 reaches setting values of D300~D303, it resets according to the
sequence.
z The working counter C1 counts times of resetting.
z Current values of corresponding counters C1, M0-M3 works according to the sequence.
z When the output actions specified by n finish, the mark M8029 acts, it returns and starts the
same actions.
z When X000 is OFF, C0 and C1 are cleared, M0~M3 is OFF. When X000 is set ON a second
time, it works from initial state.
11
Convenient
6 Applied instruction interpretation instructions
Instruction format:
TTMR D· n
D· :Element number for the storage button switch ON, D·occupies devices with 2 continuous
numbers
n:Setting of multiple, n=0~2
For example:
X010
TTMR D300 K0
X010
D301
D301
D300
D300
t0 t0
z Pressing time of the button X010 measured by D301 multiply by ratio specified by n and the
result is stored in D300. Setting time of the timer can be adjusted by the button.
z Pressing time of the button X010 isτ0 second, according to value of n, actual D300 is state
below:
n D300
K0 τ0
K1 10τ0
K2 100τ0
z When X010 is OFF, D301 resets and D300 does not change.
12
Convenient
6 Applied instruction interpretation instructions
Instruction format:
STMR S· m D·
X000
M 0 10S 10S
M 1 10S 10S
M 2 10S
M 3
z Specified value of m is the setting value of the specified timer, and it is 10 seconds in the
case.
z M0 is a delayed timer.
z M1is a single-triggering timer after inputting ON→OFF.
z M2 and M3 are used for twinkling.
z When X000 is OFF, after setting the time, M0, M1 and M3 are OFF and T10 resets.
z Timer used here can not be used repeatedly in other general circuits.
13
Convenient
6 Applied instruction interpretation instructions
Instruction format:
ALT D·
D· : Destination element
Example 1:
X000
ALTP M0
X000
M 0
z When the drive input changes from OFF→ON each time, M0 is in reverse direction.
When continuous executing instruction is used, each computation cycle performs reverse
actions, please pay attention to it.
z 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
M 0
M 1
14
Convenient
6 Applied instruction interpretation instructions
M0
Y000 Stop
M0
Y001 Start
z When pressing the button X000, the start output Y001 acts.
z When pressing the button X000, the stop output Y000 acts.
Twinkling action
X006 T2 K50
T2
X006 T2
ALT Y007
X006
5S 5S
T2
Y007
z When the input X006 is ON, contact-joint of the timer T2 acts instantaneously with an
interval of 5 seconds.
z When contact joint of T2 is ON each time, the output is ON/OFF alternatively.
15
Convenient
6 Applied instruction interpretation instructions
Instruction format:
Example:
X000
RAMP D1 D2 D3 K1000
z Write preset initial value and destination value into D1 and D2. If X000 is ON, content of D3
changes slowly from D1 to D2. Time of moving is the scan time of n times.
D 2 D 1
(D3)
Times of scan stored in D4
D 1 (D3) D 2
D1 < D2 D1 > D2
z The set scan time (a little longer than the actual scan time) is written into D8039, which is
driven. The PLC is constant scan operation mode, if the value is 20ms, in the above case,
after 20 seconds, D3 is changed from D1 to D2.
z During operation, if X000 is OFF, it becomes interrupted. When X000 is set ON a second
time, D4 is cleared and it starts from D1.
z After executing, the mark M8029 is ON, value of D3 is back to D1.
z If the instruction combines the analog output, it outputs buffering start/stop instruction.
z X000 runs when it is ON, D4 is cleared in advance (D4 is for holding in case of power
failure).
Actions of mode mark
16
Convenient
6 Applied instruction interpretation instructions
In PLC, it acts according to the mode mark M8026, and content of D3 changes as follows:
M 8026 M 8026
Drive Drive
=ON instruction = OFF instruction
X000 X000
(D2 ) (D2 )
(D3 ) (D3 )
(D1 ) (D1 )
M 8029 M 8029
17
Convenient
6 Applied instruction interpretation instructions
Instruction format:
ROTC S· m1 m2 D·
The ROTC instruction is used to aid the tracking and positional movement of the rotary table as it
moves to a specified destination.
z The ROTC instruction uses a built in 2-phase counter to detect both movement direction and
distance traveled. Devices M0and M1 are used to input the phase pulses, while device M2is
used to input the ‘zero position’ on the rotary table.
z D200 : Current position at the ‘zero point’ read only. D201 : Destination position (selected
Station to be moved to) relative to the ‘zero point’ - User defined.D202: Start position
selected station to be moved) relative to the ‘zero point’ -User defined.
z M0: A-phase counter signal - input
M1: B-phase counter signal - input
M2: Zero point detection - input
M3: High speed forward - output
M4: Low speed forward - output
M5: Stop - output
M6: Low speed reverse - output
M7: High speed reverse - output
Devices M3 to M7are automatically set by the ROTC instruction during its operation .These
are used as flags to indicate the operation which should be carried out next.
18
Convenient
6 Applied instruction interpretation instructions
When X020 is ON, the data starts sorting. After finishing, the mark M8029 ON stops operation.
During operation, do not change the operand and data content. When it is operated a second time,
set X020 OFF one time.
Working bench structure and data case
Number of row m2
Row 1 2 3 4
Line ID Height Weight Age
2 180 50 40
3 D102 D107 D112 D117
3 160 70 30
4 D103 D108 D113 D118
4 100 20 8
5 D104 D109 D114 D119
5 150 50 45
19
Convenient
6 Applied instruction interpretation instructions
z Data of the computation result starts with the element specified by D·, occupying m1×m2
data registers. When S· and D· are the same elements, before operation finishing, do not
change content of S·.
z Executing of the instruction needs m1 scan cycles, after data sorting finishes, the mark
M8029 acts.
20
Peripheral
6 Applied instruction interpretation equipment I-O
0
Peripheral
6 Applied instruction interpretation equipment I-O
0 1 2 3 4 5 6 7 8 9
COM X000 X001 X002 X003 X004 X005 X006 X007 X010 X011
PLC
z Input the decimal key 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 exceed (content of D0 is stored in binary system).
z When the instruction D TKY is used, D1and D0 buffers are used. When the value exceeds
99,999,999, overflow will occur.
z Start from pressing X002 to other keys, M12 keeps ON and other keys are the same.
z If corresponding X000~X011 act, M10~M19 will act.
z When pressing any button, during pressing, if M20 is detected, it will be ON. When several
keys are pressed, the earlier pressed shall prevail.
z When the input X030 is OFF, content of D0 will change, and M10~M2 are OFF.
X000 ④
X001 ②
X002 ①
X003 ③
M10
M11
M12
M13
M20 ① ② ③ ④
1
Peripheral
6 Applied instruction interpretation equipment I-O
Digit keys
9 8 7 6 5 4 3 2 1 0
BCD
overflow 10 3 10 2 10 1 10 0 HKY
D 0(BIN)
z When the digit key is pressed each time, values with upper limit 9,999 is stored in D0, if it
exceeds the value, overflow will occur.
z When the instruction DHKY is used, D1 and D0 are valid between 0~99999999.
z When several keys are operated, the earlier pressed shall prevail.
z After one cycle scan for Y010~Y013, the finishing mark M8029 acts.
2
Peripheral
6 Applied instruction interpretation equipment I-O
Function keys
F E D C B A
M5 M4 M3 M2 M1 M0
z When the key A is pressed, M0 keeps ON; when D is pressed, M0 is OFF and M3 keeps ON.
z When several keys are operated, the earlier pressed shall prevail.
External circuit
C D E F
8 9 A B
4 5 6 7
0 1 2 3
3
Peripheral
6 Applied instruction interpretation equipment I-O
The instruction is used for read of BCD code set by the digit switch for 1(n=1) or 2 (n=2) groups
of 4-bit numbers, when the input is not BCD code, it may lead to error.
Example:
X000
DSW X020 Y020 D0 K1
2nd group
BCD digit switch 1 2 3
0
10 10 10 10
Diode
1 2 4 8 1 2 4 8
COM X20 X21 X22 X23 X24 X25 X26 X27
1st group of input 2nd group of input
4
Peripheral
6 Applied instruction interpretation equipment I-O
z When X000 is ON, Y010~Y013 work according to the sequence(100ms). After one cycle,
the finishing mark M8029 acts.
z When DSW values need continuous input, PLC with transistor output shall be used.
Additional interpretation:
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 DSW instruction finishes one cycle.
2 The condition contact-point X000 uses button switch, when it is used one time, M10 will be
OFF after the scan terminal specified by the instruction DSW finishes one cycle output, the
instruction stops output 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
M1029
RST M10
5
Peripheral
6 Applied instruction interpretation equipment I-O
Instruction format:
SEGD S· D·
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,
See the Seven-section Code Sheet
Source 7-section Pre-setting Number
Hexadecimal Bit combined B7 B6 B5 B4 B3 B2 B1 B0 represented
system combination number
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 B4 B2 0 1 0 1 1 0 1 1 2
3 0011 B3 0 1 0 0 1 1 1 1 3
4 0100 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
Peripheral
6 Applied instruction interpretation equipment I-O
When M8273=ON,
See the following on the 7-section decoding sheet.
Source 7-section Pre-setting Number
Hexadecimal Bit combined B7 B6 B5 B4 B3 B2 B1 B0 represented
system combined number
number format
0 0000 B0 1 1 0 0 0 0 0 0 0
1 0001 B5 B6 B1 1 1 1 1 1 0 0 1 1
2 0010 B4 B2 1 0 1 0 0 1 0 0 2
3 0011 B3 1 0 1 1 0 0 0 0 3
4 0100 1 0 0 1 1 0 0 1 4
5 0101 1 0 0 1 0 0 1 0 5
6 0110 1 0 0 0 0 0 1 0 6
7 0111 1 1 0 1 1 0 0 0 7
8 1000 1 0 0 0 0 0 0 0 8
9 1001 1 0 0 1 0 0 0 0 9
A 1010 1 0 0 0 1 0 0 0 A
B 1011 1 0 0 0 0 0 1 1 B
C 1100 1 1 0 0 0 1 1 0 C
D 1101 1 0 1 0 0 0 0 1 D
E 1110 1 0 0 0 0 1 1 0 E
F 1111 1 0 0 0 1 1 1 0 F
7
Peripheral
6 Applied instruction interpretation equipment I-O
SEGL S· D· n
The instruction is used for controlling 1 or 2 groups of 4-bit seven-section code with locking.
Example:
X000
SEGL D0 Y000 K0
COM1 Y000 Y001 Y002 Y003 COM2 Y004 Y005 Y006 Y007 COM3 Y010 Y011 Y012 Y013
Group I Group II
8
Peripheral
6 Applied instruction interpretation equipment I-O
Logic of PLC
Full
loading
resistor
Logic 1
Lo
w
Ne
gati
ve
PLC
NPN transistor output loop: when the internal signal is 1, it outputs low level, and it is called
negative logic.
Pos
itiv
e
Hig Logic 1
h
Unloading
PLC
resistor
PNP transistor output loop: when internal signal is 1, it outputs high level, and it is called positive
logic.
9
Peripheral
6 Applied instruction interpretation equipment I-O
Selection of parameter n
Number of groups for
Group I Group II
7-section display
Logic between PLC
output terminal and
Same Different Same Different
monitor data input
terminal
Logic between PLC
output terminal and Same Different Same Different Same Different Same Different
monitor data scan signal
n 0 1 2 3 4 5 6 7
When logics of PLC transistor output and 7-section monitor are the same or not the same, it can be
matched with setting value of the parameter n.
Assume PLC output is negative logic, data input terminal of 7-section monitor is also negative
logic and strobe pulse signal of 7-section monitor is positive logic, if it is 4-bit for 1 group, n=1;
for 4-bit for 2 groups, n=5.
10
Peripheral
6 Applied instruction interpretation equipment I-O
Example:
X000
ARWS X020 D0 Y020 K0
Y24
Y25
Increasing
Y26
Y27
X021
11
Peripheral
6 Applied instruction interpretation equipment I-O
z 16-bit binary BCD (effective converted into 0-9,999) is stored in D0, for convenience, BCD
code is used in the following interpretation.
z 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 per 103-100-101-102-103. The specified bit can display by LED
according to the strobe pulse signals (Y024~Y027).
z As for specified bit, once the added key D0 is pressed, it changes as per
0-1-2-3-4-5-6-7-8-9-0-1; when the decreasing button is pressed, it changes as per
0-9-8-7-------1-0-9. The content is displayed by 7-section monitor.
See the above, while you are viewing the monitor, you can write the destination value into
D0.
Additional interpretation:
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.
12
Peripheral
6 Applied instruction interpretation equipment I-O
Instruction format:
ASC S D·
Executing result of the instruction: After the letters A-H is converted by ASCII, and it is moved to
D300~D303.
High 8-bit Low 8-bit
D300 42(B) 41(A)
z The instruction is used for displaying error and other information on external monitor.
z After M8161 is set ON, when executing the instruction, low 8-bit is moved to D·, which
occupies the devices with the same quantity of the character moved and the high 8-bit is 0.
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
13
Peripheral
6 Applied instruction interpretation equipment I-O
PR S· D·
z See the previous page, if ASCII data is stored in D300 ~D303, sequence of moving starts
with A and ends with H.
z The moving output is Y000 (Low bit) ~Y007 (high bit), and others include strobe pulse
signal Y010 and executing mark Y011.
A B C D H
Y000~Y007 data
T0 T0
T0: scan cycle (ms)
T0
Y010 strobe pulse signal
z When the drive input X000 is executing, if it is OFF, the moving is stopped immediately.
When it is ON a second time, it acts from the initial state.
z 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
mode.
z Transistor output must be used for the PLC.
14
Peripheral
6 Applied instruction interpretation equipment I-O
T T T
z When the instructions drive rising edge of X000, the instruction starts executing; in data
output, if the drive X000 is OFF, the output is not stopped.
z The drive X000 is ON continuously, after one cycle output, it stops output. However, the
mark 8029 will act until X000 is OFF.
15
Peripheral equipment
6 Applied instruction interpretation SER
0
Peripheral equipment
6 Applied instruction interpretation SER
Instruction symbol:
RS S m D n K
The instruction is the communication port of extended cards of RS-232 and RS-485 to achieve
sending and receiving of serial non-protocol data.
z Data sending format of RS485 communication port can be set by the special buffer D8120.
During executing of the instruction RS, even settings of D8120 are changed, it is not accepted in
fact.
z Data sending format of communication port of extended cards of RS485 or RS232 can be set by
the special buffer D8320. During executing of the instruction RS, even settings of D8320 are
changed, it is not accepted in fact.
z In the environment not for information sending, point of information sending is set at “K0”. In
addition, in the environment not for information receiving, point of information receiving is set
at (K0).
z Although one program can use a large number of RS, MBUS, DTLK, RMIO and other
communication instruction, one communication instruction is driven at one serial port at the
same time, time of OFF shall be equal to or more than one scan cycle during switching.
Communication format
<Communication format (D8120), (D8320)>
In addition to non-sequential communication from the instruction FNC80 (RS), when the
communication formats D8120 and D8320 are for other communication instructions or calculator
connection, special data buffer can be used.
1
Peripheral equipment
6 Applied instruction interpretation SER
When the instruction FNC80 (RS) used, relevant setting for other communication instructions or
calculator connection will be unavailable, please comply with the format setting of attentions.
Bit number Name Content
0(Bit OFF) 1(Bit ON)
B0 Length of data 7 bit 8 bit
B1 Parity B2,B1
B2 (0,0): None
(0,1): (ODD)
(1,0): (EVEN)
B3 Stop bit 1 bit 2 bit
B4 Communication B7,B6,B5,B4 B7,B6,B5,B4
B5 speed (0,1,1,1):9,600 (1,0,1,1):76,800
B6 (bps) (1,0,0,0):19,200 (1,1,0,0):128,000
B7 (1,0,0,1):38,400 (1,1,0,1):153,600
(1,0,1,0):57,600 (1,1,1,0):307,200
B8*1 Start character None Yes, initial value: STX(02H)
B9*1 Stop character None Yes, initial value: ETX(03H)
B10~B15*2 Unavailable
*1: content of the start character and stop character can be changed by the user. When calculator
connection is used, reset use shall apply.
*2:B10~B15 are the setting items for other communication instructions or calculator connection.
When the instruction FNC80 (RS) is used, it shall be used with “0”.
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
2
Peripheral equipment
6 Applied instruction interpretation SER
M8002
MOV H0089 D8120
3
Peripheral equipment
6 Applied instruction interpretation SER
X010
RS D200 D0 D500 D1 K0
Address and Select serial
Address and number port
number of points
of points of sent data
发送请求
Sending request of data received
RS instruction drive
RS 指令驱动OFF ON
Sending
Data
数据1 1 Data 数据4
4
data
Sending request
M8122 ON OFF
Sending waiting
M8121 OFF ON
Receiving data
Data数据2
2 数据3
Data 3
Receiving
finishing M8123 OFF ON ON
Receiving waiting
Please use sequential control program for
state starts reset, it can not enter the next data before
reset
4
Peripheral equipment
6 Applied instruction interpretation SER
D8129*10ms
Timeout judging M8129 ON
Sequential control program for
reset
<Processing of 16-bit data> When M8161=OFF, (M8161 is shared by ASCI,HEX,CCD and other
instructions)
5
Peripheral equipment
6 Applied instruction interpretation SER
Sending data
STX D200 Down D200 Up D201 Down D201 Up ETX
Start character ↑ Stop character
S.Specified start address No.
M specified number of byte to be sent
Receiving data
STX D500 D500 D501 D501 D502 D502 ETX
Down Up Down Up Down Up
Start ↑ Stop
character character
D.Specified start address No.
D201 Down
D200 UP
D201 Up
EXT
STX
Sending data
4
3
2
Number of residual data to 1
be sent D8122 0
D502 Down
D500 Up
D501 Up
D502 Up
EXT
STX
Receiving data
6
5 When receiving finishing symbol M8123 resets,
4
3 the data received will reset
Number of data received 2
D8123 1
0
<Processing of 8-bit data (extension function)>When M8161=ON, (M8161 is shared by ASCI, HEX,
CCD and other instructions)
6
Peripheral equipment
6 Applied instruction interpretation SER
M8000
M8161 ON 8-bit mode
Sending data
STX D200 down D201 down D202 down D203 down ETX
Start character ↑ Stop character
S.specified start address No.
M specifies number of byte to be sent
Receiving data
STX D500 D501 D502 D503 D504 D505 down ETX
down down down down down
Start ↑ Stop
character character
S. Specified start address No.
It may not exceed maximum points specified by n, and the stop character
EXT or points n receiving represents receiving finishing.
Sending data
4
3
Number of residual 2
data to be sent 1
D8122 0
Receiving data
6
5 Receiving finishing symbol M8123 resets, the
4 data received also resets.
3
Number of data received 2
D8123 1
0
7
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
PRUN S· D·
S·: Sending source device, n of KnX, KnM is 1~8, and minimum bit of the specified device No. is 0.
D·: Sending destination device
The instruction is specified device number with octal code system and sends data.
Example 1:
X000
PRUN K4X10 K4M0
Example 2:
X000
PRUN K4M0 K4Y10
When instructions M0~M7→ Y10~Y17, M10~M17→ Y20~Y27 are executed, values of M8 and M9
will not be sent.
8
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
ASCI S· D· n
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
16-bit conversion mode, when M8161=OFF (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
z After figures of HEX of S· are converted into ASCII code, they are sent to high 8-bit and low
8-bit of D· of S·, figure of conversion is set with n.
z D· is classified into low 8-bit and high 8-bit, which are used to store ASCII data.
9
Peripheral equipment
6 Applied instruction interpretation SER
Conversion results:
n
K1 K2 K3 K4 K5 K6 K7 K8 K9
D·
D200 Low [C] [B] [A] [0] [4] [3] [2] [1] [8]
D200 High [C] [B] [A] [0] [4] [3] [2] [1]
D201 Low [C] [B] [A] [0] [4] [3] [2]
D201 High [C] [B] [A] [0] [4] [3]
D202 Low [C] [B] [A] [0] [4]
D202 High [C] [B] [A] [0]
D203 Low Do Not Change [C] [B] [A]
D203 High [C] [B]
D204 Low [C]
8-bit conversion mode, when M8161=ON, (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
z After figures of HEX of S· are converted into ASCII code, they are sent to low 8-bit of D· and
figures of conversion is set with n.
z High 8-bit of D· is 0.
16-bit data
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 Do Not Change [C] [B] [A]
D207 [C] [B]
D208 [C]
When BCD is output by printing and etc., BIN→BCD conversion instruction is used before the
instruction.
10
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
HEX S· D· n
The instruction is used to convert ASCII code into HEX code, in 16-bit and 8-bit conversion modes.
For example:
X000
HEX D200 D100 K4
16-bit conversion mode, when M8161=OFF, M8161 is shared by RS, ASCI, HEX, CCD and other
instructions.
z After ASCII character data of high and low 8-bit of S· are converted into HEX data, it is sent to
D· every 4 bits. Bit of the conversion is set with n.
z In HEX instruction, when the stored S· data is not ASCII code, it may be computation error and
HEX conversion can not be executed. Especially M8161 is OFF, high 8-bit of S· needs to store
ASCII code, please pay attention.
Conversion results:
ASCII HEX D·
S· D102 D101 D100
code conversion n
Do not
D200 Low 30H 0 1 ···0H
change
D200 High 41H A 2 · is 0 ··0AH
D201 Low 42H B 3 ·0ABH
D201 High 43H C 4 0ABCH
D202 Low 31H 1 5 ···0H ABC1H
D202 High 32H 2 6 ··0AH BC12H
D203 Low 33H 3 7 ·0ABH C123H
D203 High 34H 4 8 0ABCH 1234H
D204 Low 35H 5 9 ···0H ABC1H 2345H
11
Peripheral equipment
6 Applied instruction interpretation SER
8-bit conversion mode, when M8161=ON, (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
z After ASCII character data of low 8-bit of S· is converted into HEX data, it is sent to D· every 4
bits. Bit of the conversion is set with n.
16-bit data
Conversion results:
ASCII HEX D·
S· D102 D101 D100
code conversion n
Do not
D200 30H 0 1 ···0H
change
z When the input data is BCD code, after executing the instruction, conversion from BCD→ BIN
shall be executed.
12
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
CCD S· D· n
16-bit conversion mode When M8161=OFF, (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
z Sum of specified high and low-bit data of point n as start by S· and horizontal check code are
stored in D· and D·+1 devices.
z It is used for check of communication code.
Conversion of the above program:
S· Data content
D100 Low K100=01100100
D100 High K111=01101111
D101 Low K100=01100100
D101 High K98=01100010
D102 Low K123=01111011
D102 High K66=01000010
D103 Low K100=01100100
D103 High K95=01011111
D104 Low K210=11010010
D104 High K88=01011000
Total K1091
Horizontal 10000101
check
13
Peripheral equipment
6 Applied instruction interpretation SER
8-bit conversion mode, when M8161=ON (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
z Sum of specified data of point n (only low 8-bit) as start by S· and horizontal check code are
stored in D· and D·+1 devices.
z It is used for check of communication data.
16-bit data
14
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
VRRD S· D·
For example:
X000
VRRD K0 D0
X001
T0 D0
z The corresponding knobs VR0~VR7 and setting values of the instruction RRD are K0~K7. In the
following program, it is decorated with the index buffer (Z0=0~7), and K0Z0=K0~K7. See the
following chart:
15
Peripheral equipment
6 Applied instruction interpretation SER
M8000
0 RST Z0
INC Z0
16 NEXT
X000
17 T0 D200
T0
21 Y000
X001
23 T1 D201
T1
27 Y001
Timing circuit:
For T0~ T7 are 100 ms timer, so
the corresponding setting value
of 0~1023 can achieve timing
from 0~102.3S.
X007
59 T7 D207
T7
63 Y007
65 END
16
Peripheral equipment
6 Applied instruction interpretation SER
VRSC S· D·
X000
VRSC K1 D1
X000
VRSC K1 D1
X000
DECO D1 M0 K4
M0
When the scale is 0, ON
M1
When the scale is 1, ON
M10
When the scale is 10, ON
z According to the potential scale 0~10, 1 point of the auxiliary relays M0~M10 is ON.
z With the instruction F41 DECO, auxiliary relays M0~M15 are occupied.
17
Peripheral equipment
6 Applied instruction interpretation SER
MBUS S m D n K
The instructions are communication ports (optional for all the models) for RS485 or RS232 extended
cards, and RS485 communication port (only built-in for model H) to reach sending and receiving of
serial Modbus protocol data. The above two ports can realize MBUS instruction communication
simultaneously, and such function independently.
The instruction MBUS can be used as host station communication:
Stored instruction format of sent data register is HEX instruction code, including address, function
code and communication data. The MBUS instruction sends according to setting mode like RTU mode
plus CRC check code (2bytes); if it is ASCII mode, send plus start character (3AH), check code LRC
(2bytes) and stop character (0DH+0AH) and the instruction code is converted into ASCII format to
send to BUFF.
Stored instruction format in the received data register is address, function code and communication
data, and start character, stop character and check code are not stored.
z Sending format of RS485 communication port data can be set with the special data buffer D8120.
During executing of MBUS instruction, even settings of D8120 are changed, it will not be
accepted.
z Sending format of communication port data of RS485 or RS232 extended card can be set with
the special data buffer D8320. During executing of MBUS instruction, even settings of D8320
are changed, it will not be accepted.
z In the environment not for information sending, point of information sending is set at “K0”
z Although a large number of RS, MBUS, DTLK, RMIO and other communication instructions
can be set in one program, only one communication instruction at one serial port at the same
18
Peripheral equipment
6 Applied instruction interpretation SER
time is driven, and OFF time shall be equal to or more than one scan cycle when switching.
Communication specifications
<Communication formats “D8120”, “D8320”>
In addition to Modbus protocol communication from the instruction FNC87 (MBUS), when the
communication formats D8120 and D8320 are for other communication instructions or calculator
connection, special data buffer can be used.
When the instruction FNC87 (MBUS) used, relevant setting for other communication instructions or
calculator connection will be unavailable, please comply with the format setting of attentions.
Bit number Name Content
0(Bit OFF) 1(Bit ON)
B0 Length of data 7 bit 8 bit
B1 Parity B2,B1
B2 (0,0): None
(0,1): (ODD)
(1,0): (EVEN)
B3 Stop bit 1 bit 2 bit
B4 Communication B7,B6,B5,B4 B7,B6,B5,B4
B5 speed (0,1,1,1):9,600 (1,0,1,1):76,800
B6 (bps) (1,0,0,0):19,200 (1,1,0,0):128,000
B7 (1,0,0,1):38,400 (1,1,0,1):153,600
(1,0,1,0):57,600 (1,1,1,0):307,200
B8~B12 *1 Unavailable
B13 Modbus mode (0) : RTU mode (1) : ASCII mode
B14~B15*1 Unavailable
*1:B8~B12,B14,B15 are setting items for other communication instructions or calculator connection.
When the instruction FNC87(MBUS) is used, it must be used with “0”.
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 1 0 0 0 0 0 1 0 0 1 1 0 0 1
↓
D8320 2099H
19
Peripheral equipment
6 Applied instruction interpretation SER
M8002
MOV H2099 D8320
b) When communication ports of RS485 or RS232 extended card are used (refer to the above article
on definitions):
1) Sending waiting (M8321)
2) Sending request (M8322)
3) Receiving finishing (M8323)
4) Timeout judging (M8329)
5) Error indication (M8324)
6) Communication format setting (D8320)
7) Number of residual data to be sent (D8322)
8) Number of data received (D8323)
9) Time of timeout judging (D8329)
20
Peripheral equipment
6 Applied instruction interpretation SER
X010
MBUS D200 D0 D500 D1 K1
Address and number Address and Select serial
of point of data to be number of points port
sent of data received
Sending request
发送请求
Write content of data to be sent Write content of D0 (Sending
写入发送数据的内容 point) and D200~.
Pulse
MBUS instruction
MBUS指令驱动 drive ON
Receiving data
Data数据2
2 数据3
Data 3
Receiving finishing
M8323 OFF ON ON
21
Peripheral equipment
6 Applied instruction interpretation SER
D8329*10ms
Judging of timeout M8329 ON
<Processing of 16-bit data>When M8161=OFF, (M8161 is shared by RS, ASCI, HEX, CCD and other
instructions)
M8000
M8161 OFF 16-bit mode
22
Peripheral equipment
6 Applied instruction interpretation SER
Receiving data
STX D500 D500 D501 D501 D502 D502 Check code ETX
Down Up Down Up Down Up
Start LRC (ASCII) Stop character
character(3A) (0D0A)
RTU (None) ↑ CRC (RTU)
D.Specified start address No.
It may not exceed maximum points specified by n,
and the stop character EXT or points n receiving
represents receiving finishing.
(3) Sending data and number of residual data to be sent
Under RTU mode
D200 Down
D201 Down
RTU mode
CRC Down
D200 Up
D201 Up
CRC Up
Sending data
6
5
4
3
2
Number of residual data to 1
be sent D8322 0
D501 Down
D501 Down
D502 Down
D502 Down
LRC Down
ASCII mode
D500 Up
D500 Up
D501 Up
D501 Up
D502 Up
D502 Up
LRC Up
3A
0D
0A
Sending data
17 16
15
14
Number of
residual data to 3 2
be sent D8322
1
0
23
Peripheral equipment
6 Applied instruction interpretation SER
D500 Down
D501 Down
D502 Down
CRC Down
RTU mode
D500 Up
D501 Up
D502 Up
CRC Up
Receiving data
8
7
6
When the receiving finishing symbol M8323
5
4 resets, the data received also resets.
3
Number of data received 2
D8323 1
0
Under ASCII mode
D500 Down
D500 Down
D501 Down
D501 Down
D502 Down
D502 Down
LRC Down
ASCII mode
D500 Up
D500 Up
D501 Up
D501 Up
D502 Up
D502 Up
LRC Up
0D
0A
Receiving data
Number of data
4
received
3
D8323 2
1
0
<Processing of 8-bit data (extension function)>When M8161=ON, (M8161 is shared by RS, ASCI,
HEX, CCD and other instructions)
M8000
M8161 ON 8-bit mode
High 8-bit
Low 8-bit
(Ignore)
16-bit data ignores high 8-bit, and only low 8-bit is valid
24
Peripheral equipment
6 Applied instruction interpretation SER
Receiving data
STX D500 D501 D502 D503 D504 D505 Check code ETX
Down Down Down Down Down Down
Start LRC (ASCII) Stop character
character(3A) (0D0A)
RTU(None) ↑ CRC (RTU)
D.Specified start address No.
It may not exceed maximum points specified by n,
and the stop character EXT or points n receiving
represents receiving finishing.
(1) Sending data and number of residual data to be sent
Under RTU mode
D200 Down
D201 Down
D202 Down
D203 Down
RTU mode
CRC Down
CRC Up
Sending data
6
5
4
3
Number of residual data to 2
be sent D8322
1
0
Under ASCII mode
D500 Down
D500 Down
D503 Down
D503 Down
D501 Down
D501 Down
D502 Down
D502 Down
D504 Down
D504 Down
D505 Down
D505 Down
LRC Down
ASCII mode
LRC Up
3A
0D
0A
Sending data
17 16
15
14
Number of
residual data to 3 2
be sent D8322
1
0
(2) Receiving data and number of data received
Under RTU mode:
D500 Down
D501 Down
D502 Down
D503 Down
D504 Down
D505 Down
CRC Down
RTU mode
CRC Up
Receiving data
8
7
6
When the receiving finishing symbol M8323
5
4 resets, the data received also resets.
3
Number of data received 2
D8323 1
0
25
Peripheral equipment
6 Applied instruction interpretation SER
D500 Down
D500 Down
D501 Down
D501 Down
D502 Down
D502 Down
D503 Down
D503 Down
D504 Down
D504 Down
D505 Down
D505 Down
ASCII Mode
LRC Down
LRC Up
0D
0A
Receiving data
26
Peripheral equipment
6 Applied instruction interpretation SER
Instruction symbol
PID S1 S2 S3 D
The instruction is the special instruction for PID computation control, after the sampling time is up,
the scanning time can reach PID computation. After setting all the parameters, PID instruction starts
executing (before PID computation, parameter setting values for PID control must be written with
MOV and other instructions), the results are temporarily stored in D. Content of D specifies temporary
data storage without holding in case of power failure (if the register with holding in case of power
failure, the register shall reset when RUN is added at the beginning of the program).
M8002
RST D***
The program will occupy 25 data registers from S3 automatically, (the following page displays ACT
setting of control parameters, when BIT1, BIT2 and BIT 5 are 0, only 20 data registers are occupied
from S3).
27
Peripheral equipment
6 Applied instruction interpretation SER
Parameter setting
Setting values of parameters for control must be written with MOV and other instructions before PID
computation. In addition, when specifying data register in the zone for holding in case of power
failure, the setting values are held after OFF of the PLC. Therefore, it requires no re-writing.
28
Peripheral equipment
6 Applied instruction interpretation SER
Output unavailable
S3+22
Upper limit of
output value
S3+23
Lower limit of
output value Upper and lower limits of
output value
Output unavailable
Time
29
Peripheral equipment
6 Applied instruction interpretation SER
a) Variation
(Previous)- (Current) =Variation
Input variation
Increasing
side
Sampling
times
0
Decreasing
side
Alarm symbol
S3+24
bit0 ON OFF
S3+24
bit1 OFF
Output variation
Increasing
side
Sampling
times
0
Decreasing
side
Alarm symbol
S3+24
bit2 ON OFF
S3+24
bit3 OFF ON
30
Peripheral equipment
6 Applied instruction interpretation SER
There will be the optimum values of 3 constants to be obtained for PID (proportional gain Kp,
integration time T1 and differential time TD).
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
Output value
100%
Output value (MV)
0%
Time
Variation of
input value
1S Maximum
inclination(R)
Time S
Useless time L(S) 1S
31
Peripheral equipment
6 Applied instruction interpretation SER
In case of error in setting values of the control parameters or PID computation, the computation error
M8067 in ON. According to the error content, the following data created in D8067.
Code Error Processing state Processing method
K6705 Operand of applied instruction is out of the PID instruction
object device computation stops
K6706 Range and data of device address No. of
operand of applied instruction are out of the
boundary
K6730 Sampling time TS is out of the object
boundary (Ts<0) Please confirm
K6732 Input wave filtering constant is out of the content of control
object boundary data
K6733 Proportional grain is out of the object
boundary
K6734 Integration time is out of the object
boundary
K6735 Differential grain is out of the object
boundary
K6736 Differential time is out of the object
boundary
K6740 Sampling time≤ Computation cycle PID instruction
K6742 Overflow of measuring value variation computation continues
K6743 Overflow of deviated value
K6744 Overflow of integration computation
K6745 Overflow of differential grain leads to
overflow of differential value
K6746 Overflow of differential computation values
K6747 Overflow of PID computation results
K6750 SV-PVnf<150,or system is unstable Auto turning stops
K6751 Large Overshoot of the Set Value Auto turning continues
K6752 Large fluctuations during Auto tuning Set Auto turning stops
Process
Key points:
Before executing PID computation, the correct measuring values shall be read into measuring value
PV of PID, especially PID computation is executed for input value of input module of analog value,
switching time shall be paid attention to.
Basic computation formula of PID instruction
PID computation is executed according to speed shape and differential shape of measuring values.
PID executes computation formula of positive action or negative action according specified direction
in S3.
In addition, values after S3 in computation, specify the used parameter content.
32
Peripheral equipment
6 Applied instruction interpretation SER
TD α D .TD
Dn = (−2 PVnf −1 + PVnf + PVnf − 2 ) + .Dn −1
Ts + α D .TD Ts + α D .TD
MVn = ∑ ΔMV
Reverse Ts
ΔMV = Kp{( EVn − EVn −1 ) + EV n+ Dn }
action T1
EVn = SV − PVnf
TD α D .TD
Dn = ( 2 PVnf −1 − PVnf − PVnf − 2 ) + .Dn −1
Ts + α D .TD Ts + α D .TD
MVn = ∑ ΔMVΔ
Mark interpretation
EVn: deviation of current sampling
EVn-1: deviation of one cycle
SV: destination value
PVnf: measuring value of current sampling (after wave filtering)
PVnf-1: measuring value one cycle before (after wave filtering)
PVnf-2: measuring value two cycles before (after wave filtering)
ΔMV: variation of the output
MVn : current operand
Dn : current differential quantity
Dn-1 : differential item one cycle before
Kp : proportional grain
Ts : sampling cycle
T1 : integration constant
TD : differential constant
αD: differential grain
33
Peripheral equipment
6 Applied instruction interpretation SER
Instruction format:
For example:
X000
EPSC K1 K0 K20 D1
z Read channel 1 of the extended card to store in D1, the minimal value is 0, the maximal value is
20.
z When the knob is rotating on the rotating scale, it become integral from 0-20 by rounding down.
34
Floating-point
6 Applied instruction interpretation instruction
F110~F119,F120-F129,F130~F137 floating
Function No. Memory view Name Page
F110 ECMP Comparison of binary floating-point 1
number
F111 EZCP Comparison of binary floating-point 2
number zone
F112 EMOV Moving of binary floating-point 3
number
F118 EBCD Binary floating-point number→ 4
Decimal floating-point number
F119 EBIN Decimal floating-point number→ 5
Binary floating-point number
F120 EADD Binary floating-point number 6
addition computation
F121 ESUB Subtraction computation of binary 7
floating-point numbers
F122 EMUL Multiplication computation of binary 8
floating-point numbers
F123 EDIV Division computation of binary 9
floating-point number
F124 EXP Exponent arithmetic computation 10
F125 LOGE Natural logarithm computation 11
F126 LOG10 Common logarithm computation 12
F127 ESQR Square root of binary floating-point 13
number
F128 ENEG Binary floating-point numbers NEG 14
computation
F129 INT Binary floating-point → BIN integral 15
conversion
F130 SIN Computation of floating-point SIN 16
F131 COS Computation of floating-point COS 17
F132 TAN Computation of floating-point TAN 18
F133 ASIN Computation of floating-point ASIN 19
F134 ACOS Computation of floating-point ACOS 20
F135 ATAN Computation of floating-point ATAN 21
F136 RAD Angle converted into radian 22
F137 DEG Radian converted into angle 23
0
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
When X000 is OFF, even the instruction ECMP is not executed, M0-M2 keeps the state of X000
not OFF.
Compare S1 and S2 floating-point number values, and the results (ON or OFF) are stored in 3-bit
started with D. When the constants K and H are specified as source data, it is converted into
binary floating-point number automatically for processing.
1
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
S1·: Lower limit value of binary floating-point number for zone comparison
S2·: Upper limit value of binary floating-point number for zone comparison
S·: Comparison value of binary floating-point number
D·: Comparison result, occupying continuous 3 points
Note: when setting, S1·≤S2·; when S1·>S2·, value of S2· shall be taken as the same value of S1·.
Example:
X000
DEZCP D30 D40 D50 M0
M0
D31,D30>D51,D50 M0=ON
M1
D31,D30=D51,D50=D41,D40 M1=ON
M2
D51,D50>D41,D40 M2=ON
When X000 is OFF, even the instruction ECMP is not executed, M0-M2 keeps the state of X000
not OFF.
Compare content of S and S+1 and range of the two specified binary floating-point number S1 and
S2. The results (ON or OFF) are stored in the 3-bit started with D.
When the constants K and H are specified as source data, it is converted into binary floating-point
number automatically for processing.
2
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
EMOV S· D·
S·: Binary floating point data (transfer source) or device number storing data
D·: Device number receiving floating point data.
Content (binary floating-point number) of the transfer source (S·+1, S·) are transferred to (D·+1,
D·). A real number (E) can be directly specified as S·.
Example:
X000
DEMOV D10 D0
X000
DEMOV E-1.23 D0
3
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
EBCD S· D·
Example:
X000
DEBCD D50 D40
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.
Binary floating-point number
D51 D50 Mantissa section 23-bit, the index section 8-bit and the symbol 1-bit
4
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
EBIN S· D·
The decimal floating-point number in the element D50 specified by source data is converted into
binary floating-point numbers, which are stored in D41 and D40.
Decimal floating-point number
Index Mantissa
D51 D50
Mantissa Index
D50×10D51
The value of Decimal floating-point number =[Mantissa D50] X10 [IndexD41]
Mantissa D50= (1,000~9,999) or 0
Index D51= -41 ~ +35
The mantissa section is 23-bit, the index section is 23-bit and the symbol is 1-bit.
5
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
S1·: Summand
S2·: Addend
Number on the buffer specified by S1· plus number on the buffer specified by S2·, the sum is
stored in the buffer specified by D· and the addition computation is executed with binary
floating-point number.
If 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 buffer number, under general conditions, the pulse executing
instruction DEADD P is used.
Example:
X000
DEADD D50 D40 D10
6
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
S1·: Minuend
S2·: Subtrahend
D·: Difference
Number on the buffer specified by S1· minus number on the buffer specified by S2·, the difference
is stored in the buffer specified by D· and the subtraction computation is executed with binary
floating-point number.
If number specified by S1· or S2· is constant, the instruction will convert the constant into binary
floating-point number for subtraction computation.
S1· and S2· can specify the same buffer number, under general conditions, the pulse executing
instruction DESUB P is used.
Example:
X000
DESUB P D50 D40 D10
7
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
S1·: Multiplicand
S2·: Multiplier
D·: Product
Number on the buffer specified by S1· multiple number on the buffer specified by S2·, the product
is stored in the buffer specified by D· and the multiplication computation is executed with binary
floating-point number.
If number specified by S1· or S2· is constant, the instruction will convert the constant into binary
floating-point number for multiplication computation.
S1· and S2· can specify the same buffer number, under general conditions, the pulse executing
instruction DEMUL P is used.
Example:
X000
DEMUL P D50 D40 D10
8
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
S1·: Dividend
S2·: Divisor (the number can not be 0, otherwise, it may be regarded as error computation, the
instruction will not execute)
D·: Quotient
Number on the buffer specified by S1· divides by number on the buffer specified by S2·, the
quotient is stored in the buffer specified by D· and the quotient computation is executed with
binary floating-point number.
If number specified by S1· or S2·, the instruction can convert the constant into binary
floating-point number for division computation.
S1· and S2· can specify the same buffer number, under general conditions, the pulse executing
instruction DEDIV P is used.
Example:
X000
DEDIV P D50 D40 D10
9
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
EXP S· D·
S·: Head device number storing binary floating point data used in exponential operation.
D·: c
The exponent of (S·+1, S·) is calculated, and the operation result is stored to (D·+1, D·).
A real number can be directly specified as S·.
In the exponential operation, the base (e) is set to “2.71828”.
Error condition:
An operation error in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the operation result is outside the following range (error code:K6706)
2−126 ≤|Operation result|< 2128
Example:
X000
DEXP D10 D20
10
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
LOGE S· D·
S·: Head device number storing binary floating point data used in the natural logarithm operation.
D·: Head device number storing binary floating point data used in exponential operation.
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·). A real number can be directly specified as 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:
An operation error in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a negative value or 0 is specified in S·. (Error code:K6706)
Example:
X000
DLOGE D10 D20
11
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
LOG10 S· D·
S·: Head device number storing binary floating point data used in the common logarithm
operation.
D·: Head device number storing binary floating point data used in exponential operation.
Natural logarithm [logarithm whose base is “10”] of (S·+1, S·) is calculated, and the operation
result is stored to (D·+1, D·). A real number can be directly specified as S·.
Only a positive value can be set in (S·+1, S·). (The common logarithm operation cannot be
executed for a negative value.)
Error condition:
An operation error in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a negative value or 0 is specified in S·. (Error code:K6706)
Example:
X000
DLOG10 D10 D20
12
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
ESQR S· D·
S·: source element to be square root(Only valid for positive numbers, if it is negative numbers, it is
regarded as computation error, M8067 ON)
D·: square root
Square root is executed for numbers on the buffer specified by S·, the square root is stored in the
buffer specified by D· and the square root computation is executed with binary floating-point
numbers.
If number specified by S· is constant, the instruction will convert the constant into binary
floating-point number for square root computation.
Example:
X000
DESQR D50 D40
13
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
ENEG D·
D·: Head device number storing binary floating data whose sign is to be inverted.
The sign of binary floating point stored in (D·+1, D·) is inverted, and the negation result is stored
to (D·+1, D·).
Example:
M0
DENEGP D10
14
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
INT S· D·
When X000=ON, the binary decimals(D1, D0)are converted into BIN integral, the result is stored
in D10, decimal of the BIN integral is ignored.
When X001=ON, the binary decimals (D21, D20) are converted into BIN integral and the result is
stored in (D31, D30), decimal of the BIN integral is ignored.
15
Floating-point
6 Applied instruction interpretation instruction
Instruction symbol:
SIN S· D·
X000
DSIN D10 D20
16
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
COS S· D·
X000
DCOS D10 D20
17
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
TAN S· D·
X000
DTAN D10 D20
18
Floating-point
6 Applied instruction interpretation instruction
Instruction symbol:
ASIN S· D·
X000
D ASIN D10 D20
19
Floating-point
6 Applied instruction interpretation instruction
Instruction symbol:
ACOS S· D·
X000
D ACOS D10 D20
20
Floating-point
6 Applied instruction interpretation instruction
Instruction symbol:
ATAN S· D·
X000
D ATAN D10 D20
21
Floating-point
6 Applied instruction interpretation instruction
Instruction symbol:
RAD S· D·
X000
DRAD D10 D20
22
Floating-point
6 Applied instruction interpretation instruction
Instruction format:
DEG S· D·
X000
DDEG D10 D20
23
F147 Conversion instruction for upper and lower characters
0
F147 Conversion instruction for upper and lower characters
Instruction format:
SWAP S·
S·: for executing exchange unit for the upper and lower 8-bit.
X000
SWAPP D10
For 16-bit instruction, exchange the low 8-bit and high 8-bit.
D10
High 8-bit Low 8-bit
X000
DSWAPP D10
For 32-bit instruction, exchange the low 8-bit and hig 8-bit.
D11 D10
High 8-bit Low 8-bit High 8-bit Low 8-bit
It is noted that when the instruction is used as continuous executing instruction, the computation
cycle needs conversing.
Function of the instruction is the same as extended function of F17 XCH.
1
6 Applied instruction interpretation Location instruction
0
6 Applied instruction interpretation Location instruction
Instruction format:
z When executing relative location control of F158 (DRVI) and absolute location control of
F159 (DRVA), PLC increases or decreases the current value with its self-generated
positive/negative pulse, which are stored in current value register (Y000: [D8141, D8140],
Y001: [D8143,D8142]). Therefore, the mechanical location always keeps, in case of power
failure of the PLC, the location will disappear. For power on and initial operation, origin
return must be executed and data of origin location of mechanical action shall be written in
advance.
S1·: Speed of origin return
Specify speed of origin return start.
[16-bit instruction]: 10~32,767 (Hz)
[32-bit instruction]: 10~100,000 (Hz)
S2·: Crawling speed
Speed of low speed after DOG signal is ON.
10~32,767(Hz)
S3·: DOG signal
Specify DOG signal input (a contact-point input)
When specifying element out of the input relay (X), affected by mathematical
performance cycle of the PLC, it may lead to greater deflection of the origin location.
D·: Object number of pulse output
Only Y000 or Y001 is specified. Output of the controller must be in the form of
transistor.
※ 1: TP03SR machine type does not support the instruction.
Output function of reset signal
z When M8140 is ON and origin return finishes, it outputs reset signal to the servo motor.
z Output number of the reset signal is determined by pulse output numbers.
Pulse output[Y000]→Clear output[Y002]
Pulse output[Y001] →Clear output[Y003]
1
6 Applied instruction interpretation Location instruction
Initial position
Origin return speed S1·
Pulse output Interruption
processing Crawling speed S2·
DOG
Reset signal
Y002 or Y003 Reset signal
Abt 20ms+1 scan cycle
Within 1ms
M8029 ON
M8147 OFF
Attentions
z For it does not have the function of DOG searching, the origin return action shall be stated
from front end of the DOG signal.
z In origin return, data of current value registers (Y000: [D8141, D8140], Y001: [D8143,
D8142]) will change towards decreasing.
2
6 Applied instruction interpretation Location instruction
Instruction format:
z The instruction is the variable speed pulse output instruction with direction of rotation.
S·: output pulse frequency
[16-bit instruction]:1~32,767 (Hz), -1~-32,768 (Hz)
[32-bit instruction]:1~100,000 (Hz), -1~-100,000 (Hz)
D1·: Object number of pulse output
Only Y000 or Y001 is specified. Output of the controller must be in the form of transistor.
D2·: Output object number for rotating direction signal
Actions are available for corresponding S·: when S· is positive, it is ON; when S· is negative,
it is OFF.
※ 1: TP03SR machine type does not support the instruction.
z Even in pulse output, the output pulse frequency S· can be changed.
z For there is no acceleration or deceleration at start/stop, if buffering is required, instructions
F67 (RAMP)and etc. can be used to change value of the pulse frequency S·.
z During pulse output, when the instruction drive contact-joint is OFF, it will not decelerate
but stop.
Attentions
z Pay attention to driving time on instructions.
3
6 Applied instruction interpretation Location instruction
Instruction format:
z The instruction is used for single-speed location control with relative drive mode.
S1·: Output pulse number (relative specifying)
[16-bit instruction]: -32,768~+32,767
[32-bit instruction]: -2,147,483,648~+2,147,483,647
S2·: Output pulse frequency
[16-bit instruction]: 10~32,767 (Hz)
[32-bit instruction]: 10~100,000 (Hz)
It can not be less than the frequency in the formula in the next page.
D1·: Object number of the pulse output
Only Y000 or Y001 is specified. Output of the controller must be in the form of transistor.
D2·: Output object number for rotating direction signal
Actions are available for corresponding S·: when S· is positive, it is ON; when S· is negative, it is
OFF.
※ 1: TP03SR machine type does not support the instruction.
z Corresponding locations of output pulse number are described below:
Output to Y000: [D8141 (high location), D8140 (low location)] (32-bit used)
Output to Y001: [D8143 (high location), D8142 (low location)] (32-bit used)
When it rotates oppositely, content of current value register will be decreased.
z During the instruction executing, even content of the operand is changed, it can not be
reflected to current operation and it will take affect in the next instruction drive.
z During instruction executing, when the instruction drive contact-joint is OFF, it stops
deceleration. At this time, the finishing flag sign M8029 does not act.
z The so-called absolute control means taking the origin location as basic point, move with a
certain pulse number with rotating direction.
z Minimum frequency of actual output pulse frequency is determined by the following
formula.
4
6 Applied instruction interpretation Location instruction
5
6 Applied instruction interpretation Location instruction
Instruction format:
z The instruction is used for executing single-seed location control with absolute drive mode.
S1·: Destination location (absolute specifying)
[16-bit instruction]: -32,768~+32,767
[32-bit instruction]: -2,147,483,648~+2,147,483,647
S2·: Output pulse frequency
[16-bit instruction]: 10~32,767 (Hz)
[32-bit instruction]: 10~100,000 (Hz)
D1·: Object number of the pulse output
Only Y000 or Y001 is specified. Output of the controller must be in the form of transistor.
D2·: Output object number for rotating direction signal
Actions are available for differences of corresponding S· and current locations: when the
difference is positive, it is ON; and is OFF for negative.
※ 1: TP03SR machine type does not support the instruction.
z Corresponding relative locations of output pulse quantity S1· are stated below:
Output to Y000: [D8141 (high location), D8140 (low location)] (32-bit used)
Output to Y001: [D8143 (high location), D8142 (low location)] (32-bit used)
When it rotates oppositely, content of current value register will be decreased.
z During the instruction executing, even content of the operand is changed, it can not be
reflected to current operation and it will take affect in the next instruction drive.
z During instruction executing, when the instruction drive contact-joint is OFF, it stops
deceleration. At this time, the finishing flag sign M8029 does not act.
z The so-called absolute control means taking the origin location as basic point, move with a
certain pulse number with rotating direction.
z Minimum frequency of actual output pulse frequency is determined by the following
formula.
Minimum frequency of output pulse frequency =
6
6 Applied instruction interpretation Location instruction
7
F160~F167 Clock computation
0
F160~F167 Clock computation
Instruction format:
M1 D0(H)
10H30M50S= D1(M) ON
D2(S)
M2 D0(H)
10H30M50S< D1(M) ON
D2(S)
Even X000 is used to stop executing the instruction TCMP, M0~M2 shall
keep the state of X000 not OFF.
z Compare time of source data (S1·, S2·, S3·)and 3-point time data started with S·, 3-point
ON/OFF state is output according to the comparison results.
1
F160~F167 Clock computation
M3 D20(H) D0(H)
D21(S) > D1(M) ON
D22(S) D2(S)
M5 D0(H) D30(H)
D1(M) > D31(M) ON
D2(S) D32(S)
2
F160~F167 Clock computation
Instruction format
X000
TADD D10 D20 D30
z If the computation result is 0 (0 H 0 M 0S), and the zero flag sign M1020=ON.
3
F160~F167 Clock computation
Instruction format:
X000
TSUB D10 D20 D30
4
F160~F167 Clock computation
Instruction format:
TRD D·
D·: start device after readout of current time of the calendar, occupying 7 points
※ 1: TP03SR machine type does not support the instruction.
Example:
X000
TRD D0
z Read real-time clock data of the controller according to the following format. The reading
source is the special data registers (D8013~D8019)for holding the clock data.
Element Item Clock data Element Item
Special D8018 Y (Solar → D0 Y (Solar
2000~2099
data calendar) calendar)
register D8017 M 1~12 → D1 M
for D8016 D 1~31 → D2 D
real-time D8015 H 0~23 → D3 H
clock D8014 M 0~59 → D4 M
D8013 S 0~59 → D5 S
D8019 Week 0(Sun)~6(Sat) → D6 Week
5
F160~F167 Clock computation
Instruction format:
TWR S·
X000
TWRP D10
z Write data for setting clock into the real-time clock of the controller. To write clock data,
7-point element started with element address numbers specified by S· must be specified.
Element Item Clock data Element Item
Data for D10 Y (Solar → D8018 Y (Solar Real-time
2000~2099
clock calendar) calendar) clock for
setting D11 M 1~12 → D8017 M special
D12 D 1~31 → D8016 D data
D13 H 0~23 → D8015 H register
D14 M 0~59 → D8014 M
D15 S 0~59 → D8013 S
D16 Week 0(Sun)~6(Sat) → D8019 Week
6
Peripheral
6 Applied instruction interpretation equipment
0
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
GRY S· D·
Example:
X000
GRY K1234 K3Y10
b15 b0
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
1
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
GBIN S· D·
b15 b0
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
2
Peripheral
6 Applied instruction interpretation equipment
0
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
CRC S D n
S·: Source device
D·: Device for storing CRC calculation value
n: Number of source device
It is the instruction for computing CRC code, in 8-bit and 16-bit conversion mode.
8-bit conversion mode when M8161 ON
16-bit conversion mode when M8161 OFF
For example:
8-bit conversion mode[M8161=ON]
In 8-bit mode, only low byte of the element source would be operated
The result will be kept in the element of D and D+1, the low byte kept in D and the high kept in
D+1
M8000
M8161 8-bit mode
X000
CRC S D n
1
Peripheral
6 Applied instruction interpretation equipment
M8000
M8161 16-bit mode
X000
CRC S D n
When S=D100,D=D0,n=6
element value
8 bit 16 bit
Address of S Low byte D100 low byte 01H 0101H
source device High byte D100 high byte 01H
S+1 Low byte D101 low byte 03H CD03H
High byte D101 high byte CDH
S+2 Low byte D102 low byte 6BH 056BH
High byte D102 high byte 05H
——
2
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
DTLK K
K,H:0,1
0: for built in RS485 port
1: for RS485 or RS232 expansion card
Operation:
This instruction F190 DTLK used by PLC can setup a small network which enables PLC
controlling other 15 PLC.
While two communication ports are ready for DTLK, only one firstly enabled is available.
Communication frame and baud rate is set through D8120 or D8320, which is controlled by the
different port.
Both the port RS485/ RS232 expansion card (all type is available for expansion), RS485 port
(only built-in port in H type) are available for Data Link. However, both of them can not be
enabled simultaneously.
Item Specification
Communication standard EIA RS-485
Baud rate 9600bps~307200bps
Number of slaves Max 15 slaves
Related devices D0~D157, M2000~M3023
Data length for each slave Max 64 bits+8 word
Communication cable Insulated twisted cable, 2 lines type,
Total length: 500m (76800bit/s), 1km(38400bit/s)
3
Peripheral
6 Applied instruction interpretation equipment
Wiring:
A B SG R A B SG A B SG R A B SG
● Note 1: SHL terminal should be 3 class ground or the production will be interrupted to error
operation because of noise.
● Note 2: Branch of communication cable should not exceed 3.
● Note 3: R represents terminal resistor (120Ω,1/4W).
○ ×
Connector
Cable nod
Related devices:
(1) Special relays
Special Feature Function Description Respond
relays from
M8400 Read-only Master error The relay will be on as master is error. L
M8401 Read-only Slave 1 error The relay will be on as slave 1 is error. M/L
M8402 Read-only Slave 2 error The relay will be on as slave 2 is error. M/L
… … … … ..
M8414 Read-only Slave 14 error The relay will be on as slave 14 is error. M/L
M8415 Read-only Slave 15 error The relay will be on as slave 15 is error. M/L
M8416 Read-only state The relay will be on as DTLK is enabled. M/L
M8417 Read-only Data Link mode The relay will be on as expansion card is M/L
in Data Link.
M8418 Read-only Data Link mode The relay will be on as RS485 port is in M/L
Data Link.
4
Peripheral
6 Applied instruction interpretation equipment
5
Peripheral
6 Applied instruction interpretation equipment
D8178 0 1 2
Data Link mode Mode 0 Mode 1 Mode 2
Refreshing Bit device (M) 0 point 32 point 64 point
range Word device (D) 4 point 4 point 8 point
The devices to be refreshed under different mode:
Mode 0 Mode 1 Mode 2
Address
(M) (D) (M) (D) (M) (D)
No 0 — D0~D3 M2000~M2031 D0~D3 M2000~M2063 D0~D7
No 1 — D10~D13 M2064~M2095 D10~D13 M2064~M2127 D10~D17
No 2 — D20~D23 M2128~M2159 D20~D23 M2128~M2191 D20~D27
No 3 — D30~D33 M2192~M2223 D30~D33 M2192~M2255 D30~D37
No 4 — D40~D43 M2256~M2287 D40~D43 M2256~M2319 D40~D47
No 5 — D50~D53 M2320~M2351 D50~D53 M2320~M2383 D50~D57
No 6 — D60~D63 M2384~M2415 D60~D63 M2384~M2447 D60~D67
No 7 — D70~D73 M2448~M2479 D70~D73 M2448~M2511 D70~D77
No 8 — D80~D83 M2512~M2543 D80~D83 M2512~M2575 D80~D87
No 9 — D90~D93 M2576~M2607 D90~D93 M2576~M2639 D90~D97
No A — D100~D103 M2640~M2671 D100~D103 M2640~M2703 D100~D107
No B — D110~D113 M2704~M2735 D110~D113 M2704~M2767 D110~D117
No C — D120~D123 M2768~M2799 D120~D123 M2768~M2831 D120~D127
No D — D130~D133 M2832~M2863 D130~D133 M2832~M2895 D130~D137
No E — D140~D143 M2896~M2927 D140~D143 M2896~M2959 D140~D147
No F — D150~D153 M2960~M2991 D150~D153 M2960~M3023 D150~D157
(4) setting retry times (D8179)
Set 0~10 to special data register D8179 (default: 3). It is unnecessary for slaves. If the master
retry communication with the slave for more than the set times, the slave will be in
communication error.
(5) setting time out (D8180)
Set 5~255 to special data register D8180 (default: 5), the product of such value and 10 is the
waiting time for communication time out (ms).
(6) Current communication scan time (D8401)
The product of such value and 10 is the current communication scan time (ms).
(7) Max communication scan time (D8402)
The example program for setting the said devices:
X 000
MOV K0 D 8176 S lave address range :0~15
Slaver num ber: 2
MOV K2 D 8177 (range: 1~15)
MOV K1 D 8178 R efresh setting : 1, m ode 1
( range: 0~2) U nnecessary
MOV K3 D 8179 for slaves
R etry tim es: 3(3 tim es)
DTLK 0
6
Peripheral
6 Applied instruction interpretation equipment
Error code:
When there is error, the special relays M8400~M8415 will indicates the error condition and the
error code will be stored in special data registers (D8419~D8434).
7
Peripheral
6 Applied instruction interpretation equipment
X010
Slave n X000
Slave 1 M2064
DTLK 0
X000
M2064
DTLK 0 Y0
Master I I I I I I I I I I
0 0 0 0 0 0 0 0 0 0
Ta Tc Tb T0 Tb T0 Tb T0 Tb T0 Ta
Input X10 ON
Slave 1 I I I I I I I I
0 0 0 0 0 0 0 0
Tt Tu Tv T1 Tc
Tw
Slave 2 I I I I I I I
0 0 0 0 0 0 0
T2 Tc
I I I I I I I
Slave n 0 0 0 0 0 0 0
Tn Tc
Tx Ty Tz Output Y0: ON
Input and output delay
8
Peripheral
6 Applied instruction interpretation equipment
Delay time:
Tu: the time required for PLC to detect the input status (max. 1 SACN TIME)
Tv: the time between the PLC received input state and program started to be scanned.
Tw: the time for operation result send out (max net scan time T);
Tx: the time between the data received and data written to registers (max. 1 scan time);
Ty: the time between program operated to output (1scan time);
Tz: output port delay
9
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
RMIO K
K,H:0,1
0: for built in RS485 port
1: for RS485 or RS232 expansion card
Operation:
This instruction F191 RMIO used by PLC can setup a small network which enables PLC
controlling other 4 PLCs.
While two communication ports are ready for RMIO, only the one firstly enabled is available.
Communication frame and baud rate is set through D8120 or D8320, which is controlled by the
different port.
● Note 1: When a PLC is set as a slave in RMIO mode, it is used as a expansion I/O for master
and only RMIO instruction is available for operation.
● Note 2: As long as PLC as a slave in RMIO mode, only stop the operation of program can
switch the RMIO to other mode.
In Remote I/O mode, the master PLC can control other 4 PLCs.
A B SG R A B SG A B SG A B SG R A B SG
Item Description
standard EIA RS485
Baud rate 9600bps~307200bps
Number of slaves Max 4 slave
Related devices Slave 1 Input: 36 points (M4200~M4235); Output: 24point (M4600~M4623)
Slave 2 Input: 36 points (M4240~M4275); Output: 24point (M4624~M4647)
Slave 3 Input: 36 points (M4280~M4315); Output: 24point (M4648~M4671)
Slave 4 Input: 36 points (M4320~M4355); Output: 24point (M4672~M4695)
Cable Insulated twisted cable, 2 lines type,
Total length: 500m (76800bit/s), 1km(38400bit/s)
Both the port RS485/ RS232 expansion card (all type is available for expansion), RS485 port
(only built-in port in H type) are available for Data Link. However, both of them can not be
enabled simultaneously.
10
Peripheral
6 Applied instruction interpretation equipment
11
Peripheral
6 Applied instruction interpretation equipment
Setting:
When the program is in operation, or PLC is power ON, all the setting for Remote I/O will take
effect.
(1) Setting the slaver address (D8376)
Set 0~4 to the special data register D8376, 0 is for master, and 1~4 is for slave.
(2) Setting the slavers number (D8377)
Set 1~4 to the special data register D8377(default: 4). It is unnecessary for slavers
The slavers number should be set according to different condition in order to raise the
refreshing speed.
R R
A B SG A B SG A B SG A B SG
● Note 1: SHL terminal should be 3 class ground or the production will be interrupted to error
operation because of noise.
● Note 2: Branch of communication cable should not exceed 3.
● Note 3: R represents terminal resistor (120Ω,1/4W).
Communication sequence and the time required for transmission
12
Peripheral
6 Applied instruction interpretation equipment
When an error occurs on the communication between the master station and slave-station, the
remote I/O communication and PLC operation will be stopped and enter error mode. Besides, all
communication flag of master-station and slave-station are set to OFF.
Possible cause of error is as follows:
c CRC error
d Slave in STOP mode or ERROR mode
e Slave not connected or connection wire broken
When the master-station is in STOP mode or ERROR mode, it will not communicate with any
slave-station. The settings for communication format between master and slave are not same.
13
Peripheral
6 Applied instruction interpretation equipment
master station SCAN TIME) required for master-station to complete the communication with all
slave-stations is as follows :
Baud Rate Communication Time out, t Communication Normal
(bps) time for each (ms) time for master, communication
slave, Tn (ms) T(ms) time for master
and 4 slaves (ms)
9600 42 D8380*10 Tn*n1+t*n2 168
19200 21 (n1: normal slave 84
38400 11 number; n2: slave 44
57600 7 number for time 28
76800 6 out) 24
128000 4 16
153600 3 12
307200 2 8
If there is communication error in slave, the communication time will be increased repeatedly (Tn
will be added to the time for each error)
14
Peripheral
6 Applied instruction interpretation equipment
Delay time:
When the remote I/O is receiving data, there will be some delay as in the following figure.
X010
M4600
X000
RMIO 0
Input terminal
T1 T2 T3
Output terminal
(output Y0 on slave 1)
T4 T5
15
Peripheral
6 Applied instruction interpretation equipment
Error code:
When there is error, the special relays M8400~M8415 will indicates the error condition and the
error code will be stored in special data registers (D8419~D8434).
Error Error Check
Error Description Check point
code address address
01H Communication L M There is no responding as the master Wiring, power
time out error sends the request to slave and time supply and run/
out. stop state
02H Communication L M Address is not set according to the Wiring
number error certain relations between master and
slave
03H Communication L M The data in communication counter Wiring
counting error does not conform to according to
the certain relations between master
and slave
04H Communication L M, L Communication frame of slave is Wiring and RMIO
frame error error setting
11H Communication M L After the slave responses to master, Wiring, power
over time error the master does not send another supply and run/
request to slavers. stop state
14H Communication M L Communication frame of master is Wiring and RMIO
frame error error setting
21H Without slave L L *1 Address in the net is wrong Address setting
22H Address error L L *1 Slave address does not comply with Wiring
the certain relations between master
and slave
23H Communication L L *1 The data in communication counter Wiring
counting error does not conform to according to
the certain relations between master
and slave
24H Communication L L *1 Communication frame of slave is Wiring and RMIO
frame error error setting
M: master L: slave
*1: another slave
16
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
TEXTP D S n
Operation:
This instruction should be used with OP07/08. After F192 is enabled, the value 13 will be written
to data register D8284, after OP07/08 saving the ‘13’ in D8284, the value 13 also will be written
to D8285 by OP07/08 itself.
As F192 is enabled, the certain text file will be saved to D8280 and D8281 (D8280 is for the file
to be displayed in the first line of OP07/08, D8281 is for the second one) and the value to be
displayed will be saved toD8295 and D8296.
The value in D8295 will be displayed in the ‘#’position of the first line, while the value in D8296
of the second line.
When there is ‘?’ on LCD, you can input data, the input data for first line will be saved in the D
register (Number =value in D8295 + 1). As for the second line, the input data in position ‘?’ will
be saved in D register (Number =value in D8296 + 1).
‘#’ and ‘?’ can be placed anywhere in the text file. However, only the former 5 ones can be set as
inputs or outputs.
Example:
LCD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
position
Text file 1:
D register 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
Content L e n g t h : # # . # # # c m
Text file 2:
D register 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
Content W e i g t h : # # . # # # k g
Text file 3:
D register 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029
Content U n i t p r i c e : $ ? ? ? ? ?
17
Peripheral
6 Applied instruction interpretation equipment
X000
MOV K2 D200
Information on OP07/08 LCD
MOV K12345 D300
Weight : 12.345 kg
M100
TEXT D200 D300 K1
Description:
1, X000 ON, 2 will be moved to D200 while 12345 will be moved toD300;
2, when M100 is ON, TEXT instruction is enabled. D8284 defaults 13, D200 will be written to
D8280; D300 to [Link] OP07/08 will enter F192 mode.
3, F192 will operate for the first time. As D8280= D200= 2, OP07/08 will display the file 2 on the
first line of LCD. Because there is a ‘#’ in the file 2, 12345 in D300 will be displayed in the
place of ‘#’.
X000
MOV K2 D200
Information on OP07/08 LCD
MOV K12345 D300
Weight : 12.345 kg
Unit price : $?????
M100
TEXT D200 D300 K2
Description:
1, X000 ON, 2 will be moved to D200 while 12345 will be moved to D300;
2, When M100 is ON, TEXT instruction is enabled. D8284 defaults 13, D200 will be written to
D8280; sum of data in D200 and 1 will be written to D8281, D300 to D8285, [Link]
OP07/08 will enter F192 mode.
3, F192 will operate for the first time. As D8280= D200= 2, D8281=3, OP07/08 will display the
file 2 on the first line of LCD and file 3 on the second line. Moreover, 12345 in D300 will be
displayed in the place of ‘#’ and the input data by the keys will be stored in D301.
18
Peripheral
6 Applied instruction interpretation equipment
Instruction format:
Operation:
This instruction F193 DTLK2 used by PLC can setup a small network which enables PLC
controlling other 15 PLC.
While two communication ports are ready for DTLK2, only one firstly enabled is available.
Communication frame and baud rate is set through D8120 or D8320, which is controlled by the
different port.
Both the port RS485/ RS232 expansion card (all type is available for expansion), RS485 port
(only built-in port in H type) are available for Data Link. However, both of them can not be
enabled simultaneously.
Item Specification
Communication standard EIA RS-485
Baud rate 9600bps~307200bps
Number of slaves Max 15 slaves
Related devices D0~D7999,first address is decided by DTLK2
Data length for each slave Max 40word, length is decided by DTLK2
Communication cable Insulated twisted cable, 2 lines type,
Total length: 500m (76800bit/s), 1km(38400bit/s)
19
Peripheral
6 Applied instruction interpretation equipment
Wiring:
A B SG R A B SG A B SG R A B SG
● Note 1: SHL terminal should be 3 class ground or the production will be interrupted to error
operation because of noise.
● Note 2: Branch of communication cable should not exceed 3.
● Note 3: R represents terminal resistor (120Ω,1/4W).
○ ×
Connector
Cable nod
Related devices:
(1) Special relays
Special Feature Function Description Respond
relays from
M8400 Read-only Master error The relay will be on as master is error. L
M8401 Read-only Slave 1 error The relay will be on as slave 1 is error. M/L
M8402 Read-only Slave 2 error The relay will be on as slave 2 is error. M/L
… … … … ..
M8414 Read-only Slave 14 error The relay will be on as slave 14 is error. M/L
M8415 Read-only Slave 15 error The relay will be on as slave 15 is error. M/L
M8416 Read-only state The relay will be on as DTLK2 is enabled. M/L
M8417 Read-only Data Link2 The relay will be on as expansion card is M/L
mode in Data Link2.
M8418 Read-only Data Link2 The relay will be on as RS485 port is in M/L
mode Data Link2.
20
Peripheral
6 Applied instruction interpretation equipment
21
Peripheral
6 Applied instruction interpretation equipment
Setting:
When the program is in operation, or TP03 is power ON, all the setting for Data Link2 will take
effect.
(1) Setting the slaver address (D8176)
Set 0~15 to the special data register D8176, 0 is for master, and 1~15 is for slave.
(2) Setting the slavers number (D8177)
Set 1~15 to the special data register D8177(default: 7). It is unnecessary for slavers,The
slavers number should be set according to different condition in order to raise the refreshing
speed.
(3) setting retry times (D8179)
Set 0~10 to special data register D8179 (default: 3). It is unnecessary for slaves. If the master
retry communication with the slave for more than the set times, the slave will be in
communication error.
(4) setting time out (D8180)
Set 5~255 to special data register D8180 (default: 5), the product of such value and 10 is the
waiting time for communication time out (ms).
(5) Current communication scan time (D8401)
The product of such value and 10 is the current communication scan time (ms).
(6) Max communication scan time (D8402)
X001
DTLK2 D0 K5 K0
22
Peripheral
6 Applied instruction interpretation equipment
Error code:
When there is error, the special relays M8400~M8415 will indicates the error condition and the
error code will be stored in special data registers (D8419~D8434).
23
Contact comparison
6 Applied Instruction Interpretation instruction
0
Contact comparison
6 Applied Instruction Interpretation instruction
X000
LD> D200 K-30 SET Y011
M3
1
Contact comparison
6 Applied Instruction Interpretation instruction
X1
AND> D200 K-30 SET Y011
X2
DAND> K6784 C200 M50
M3
2
Contact comparison
6 Applied Instruction Interpretation instruction
X1
Y10
X2 M30
M50
3
7Additional interpretation of basic functions Special device
M8000
“Normal operation”
Y000
RUN monitoring a
contact-joint Frequent output drive expected
During RUN, the constant
is ON
After the initial pulse M8002 starts operation in PLC, only one computation is ON and it keeps
OFF in the left time.
The pulse is taken as initial setting signal for program initialization, writing specified values and
etc.
Data registers for
M8002
F40 holding
D200 D299
ZRST Clearing of
Initial pulse (a
D200~D299
contact-point)
M8003 is OFF for one computation cycle after RUN, and it keeps ON in other left time.
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)
7Additional interpretation of basic functions Special device
M8006
Y001 low voltage of battery
low voltage of
battery
M8007 used for state locking for low voltage of battery
Minimum
D8011 value
Number of peripheral equipment to monitor the values
Maximum
D8012 value
The numerical values include the waiting time of constant scan time stated in the following.
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: even the PLC is STOP, the clock still keeps operating. Therefore, falling edge and starting
time of clock monitored by RUN (M8000) are not synchronous.
7Additional interpretation of basic functions Special device
Real-time clock
Y: M: D: WK:
D8018 D8017 D8016
D8015 D8014 D8013
H: M: S:
PLF M0
F12
K20 D8039 Set constant scan time at 20ms
MOVP
When the scan synchronous instructions like FNC67 (RAMP), FNC71 (HKY), FNC74 (SEGL),
FNC75 (ARWS), FNC77 (PR) and etc. are executed, constant scan mode or timing interrupted by
the timer are used to drive.
Especially the instruction FNC71 (HKY) is used, filtration wave for button input will lead to delay
response, and the scan time must be set above 20ms.
Note: in the scan time of D8010~8012, it includes the specified time of constant scan mode.
Relation of the instruction MC-MCR and the instruction CJ has been described in the instruction
F00CJ. See the following on relations of other instructions.
In the following figure, represents the relation of inclusion and represents repeating of
the front and back inter-zones.
Upper instruction Upper instruction
Left Left
instruction instruction
MC—CJ—P—MCR MC—CJ—P—MCR
EI-DI
×(6605) ×(6607)
P-SRET ×(6606) ×(6606)
×(6608) ×(6607) ×(6605)
I-IRET ×(6606) ×(6606)
×(6606) ×(6607) ×(6606)
FEND-END
×(6608) ×(6701) ×(6607) ×(6605)
O-FEND
×(6608) ×(6607) ×(6605)
O-END
(No FEND) ×(6608) ×(6701) ×(6607) ×(6605)
○: It can be used without problem.
×: Combined use prohibited, number ()is error code.
△ : Although it is not strictly prohibited, it may lead to complication of actions, which shall be
avoided as much as possible.
7 Additional interpretation of basic functions Program flow