Académique Documents
Professionnel Documents
Culture Documents
User Manual
Xinje Electronic
EC series
Programmable controller Preface
Operating manual
This manual includes some basic precautions which you should follow to keep you safe and protect
the products. These precautions are underlined with warning triangles in the manual. About other
manuals that we do not mention, please follow basic electric operating rules.
Precautions
Correct
Application
Catalog
PREFACE ...............................................................................................................................................1
1SUMMARY OF EC SERIES PLC..................................................................................................2
1-1SUMMARY OF EC SERIES PLC AND PROGRAM MODE...................................................................3
1-2MODEL AND TYPE OF EC SERIES PLC..........................................................................................4
1-3EXPANSIONS AND THEIR ID..........................................................................................................5
1-4GENERAL SPECIFICATION .............................................................................................................7
1-5EXTERINAL SIZE ...........................................................................................................................9
1-6TERMINAL ARRANGEMENT......................................................................................................... 11
1-7DEFINITION OF COM PORTS.......................................................................................................13
2SPECIFICATION OF CIRCUITINPUT/OUTPUT AND LAYOUT.....................................15
2-1POWER SPECIFICATION ...............................................................................................................16
2-2AC POWERDC INPUT TYPE ....................................................................................................18
2-3INPUT SPECIFICATION .................................................................................................................19
2-4 SPECIFICATION OF DC INPUT SIGNALAC POWER TYPE......................................................20
2-5OUTPUT SPECIFICATION..............................................................................................................22
2-6SPECIFICATION OF RELAY OUTPUT CIRCUIT ...............................................................................24
2-7SPECIFICATION OF TRANSISTOR OUTPUT CIRCUIT......................................................................26
3USAGE AND FUNCTION OF EVERY SOFT UNIT .................................................................29
3-1EVERY DEVICE OF PLC ..............................................................................................................30
3-2LIST OF DEVICE ID .....................................................................................................................32
3-3DATA SPECIFICATION OF PLC ....................................................................................................34
3-4SOME ENCODE PRINCIPLES OF DEVICE .......................................................................................35
3-5TIMERS NUMBER AND FUNCTION [T]......................................................................................37
3-6COUNTERS NUMBER AND FUNCTION [C] ...............................................................................40
3-7NOTE ITEMS ...............................................................................................................................44
4DESCRIPTION OF BASIC SFC INSTRUCTIONS...................................................................45
4-1LIST OF BASIC INSTRUCTIONS ....................................................................................................46
4-2LD,LDI,OUT ......................................................................................................49
4-3AND,ANI....................................................................................................................50
4-4OR,ORI .......................................................................................................................51
4-5DP,LDF,ANDP,ANDF,ORP,ORF ..............................................52
4-6CONTACTS COMPARE INSTRUCTIONS ........................................................................................54
4-7ORB ....................................................................................................................................58
4-8ANB ....................................................................................................................................59
4-9MCS,MCR ..................................................................................................................60
4-10ALT ...................................................................................................................................61
4-11PLS,PLF ....................................................................................................................62
4-12SET,RST ...................................................................................................................63
4-13OUT,RSTTO THE COUNTER .......................................................................................64
4-14NOP,END .................................................................................................................65
4-15NOTE ITEMS WHEN PROGRAMMING..........................................................................................66
5DESCRIPTION OF APPLIED INSTRUCTIONS ......................................................................67
5-1LIST OF APPLIED INSTRUCTIONS .................................................................................................68
5-2READING METHOD OF APPLIED INSTRUCTIONS ..........................................................................71
5-3PROGRAM FLOW INSTRUCTIONS.................................................................................................75
5-4DATA MOVE INSTRUCTIONS ........................................................................................................81
5-5DATA OPERATION INSTRUCTIONS................................................................................................89
5-6DATA SHIFT.................................................................................................................................99
5-7DATA CONVERT ........................................................................................................................105
5-8FLOATING OPERATION .............................................................................................................. 116
5-9CLOCK OPERATION ...................................................................................................................128
6SPECIAL FUNCTION INSTRUCTIONS .................................................................................136
6-1HIGH SPEED COUNTER ..............................................................................................................137
6-1-1.HSCs number and function................................................................................................137
6-1-2.using method of single phase HSC .....................................................................................138
6-1-3.using method of AB phase HSC .........................................................................................139
6-2PULSE OUTPUT .........................................................................................................................140
6-2-1. [PLSY] of pulse output......................................................................................................140
6-2-2. [PLSR] with speedup/speed-down pulse output ................................................................141
6-2-3. [PLSNEXT] pulse segment shift .......................................................................................145
6-2-4. [PLSF] alterable frequency pulse output ...........................................................................146
6-3MODBUS COMMUNICATION INSTRUCTIONS ...........................................................................146
6-4FREE FORMAT COMMUNICATION ..............................................................................................147
6-5PWM PULSE WIDTH MODULATE ..............................................................................................154
6-6FREQUENCY TESTING ...............................................................................................................155
6-7PRECISE TIME ...........................................................................................................................156
6-8INTERRUPT FUNCTION ..............................................................................................................157
6-8-1.time interrupt ......................................................................................................................157
7APPLIED EXAMPLES ...............................................................................................................158
7-1PULSE OUTPUT APPLIED EXAMPLES .........................................................................................159
7-2MODBUS INSTRUCTIONS .......................................................................................................161
7-3FREE FORMAT COMMUNICATION ..............................................................................................163
8APPENDIX ...................................................................................................................................169
8-1LIST OF SPECIAL AUCILIARY RELAYSPECIAL DATA REGISTER ................................................170
8-2LIST OF SPECIAL FLASH DATA REGISTER SFD ........................................................................183
ii
Preface
Specialties of programmable controller
MEMO
1-4General specification
1-5Size
1-6Terminal arrangement
Program
Format
Statement Program
Statement program is the format which usesLD
AND
OUTetc.
This format is the basic input form to compile the SFC program. But its not
convenient for understanding.
E.g Step
Instruction ID
0
LD
X000
1
OR
Y005
2
ANI
X002
3
OUT
Y005
Ladder Program
Uses sequential control signal and soft units ID to draw the sequential
circuits graph on the screen, which is called ladder program. As this method
uses trigger points symbols and coil symbols to denote the sequential
control circuitit is easy to understand the programs contents. At the same
time its also available to monitor the PLCs action via the status displayed in
the circuit.
E.g
X0
X2
Y5
Y5
Alternation
The programs compiled with the preceding two methods are both stored in
the PLCs program memory in the format of instruction table. Sothe
denotion and edition of this two program format can convert to the other.
EC3
EC series
Main Units
1 Serial Name
2 I/O points
3 Output format
RRelay output
TTransistor output
RTMix output of Transistor /RelayY0Y1 are transistor
4 Supply power
EAC power
CDC power
5 Clock
SWith Clock inside
Model
AC power
DC power
Input
Output
DC24V
RT
Relay
Transistor
Mix output
Relay
Transistor
Mix output
output
output
(R&T)
output
output
(R&T)
EC3-14R-E
EC3-14T-E
EC3-14RT-E
EC3-14R-C
EC3-14T-C
EC3-14RT-C
8 points
6 points
EC3-24R-E
EC3-24T-E
EC3-24RT-E
EC3-24R-C
EC3-24T-C
EC3-24RT-C
14 points
10 points
EC3-32R-E
EC3-32T-E
EC3-32RT-E
EC3-32R-C
EC3-32T-C
EC3-32RT-C
18 points
14 points
EC3-48R-E
EC3-48T-E
EC3-48RT-E
EC3-48R-C
EC3-48T-C
EC3-48RT-C
28 points
20 points
EC3-60R-E
EC3-60T-E
EC3-60RT-E
EC3-60R-C
EC3-60T-C
EC3-60RT-C
36 points
24 points
EC
Signal
Quantity
E
2 3
1 Serial name
2 EExpansion
3 Input points
4 XInput
5 Output points
6 Output format
YRRelay output
Model
YTTransistor output
I/O points
Input
Output
DC24V
RT
Input
Relay output
Transistor output
EC-E8YR
EC-E8YT
8 points
8 points
EC-E16X
16 points
16 points
EC-E16YR
EC-E16YT
16 points
16 points
EC-E8X8YR
EC-E8X8YT
16 points
8 points
8 points
EC-E16X16YR
EC-E16X16YT
32 points
16 points
16 points
EC-E32X
32 points
32 points
EC-E32YR
32 points
32 points
EC series PLC can be used independently or used along with the expansions. The
following is the diagram of a basic unit with 7 expansions.
Expansion
COM
COM
X0
X1
X2
X3
X4
X5
X6
X7
X10
X11
X12
X13
X14
X15
X16
X17
X20
X21
X22
X23
X24
X25
X26
X27
X30
X31
X32
X33
X34
X35
X36
X37
X40
X41
X42
X43
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
C-E16YR
X
PORT1
C5-60R-E
PORT2
PWR
RUN
ERR
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
PWR
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
PWR
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
PWR
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
PWR
FG
COM
X0
X2
X4
X6
X1
X3
X5
X7
0 1 2 3
4 5 6 7
C-8PT
X
PWR
C-6PT-P
X
PWR
RUN
RUN
ERR
0 1 2 3
4 5 6 7
C3-4AD2DA
RUN
ERR
0 1 2 3
4 5 6 7
C-8AD
RUN
ERR
0 1 2 3
4 5 6 7
C-E8X8YR
RUN
ERR
0 1 2 3
4 5 6 7
C-E16X
RUN
0 1 2 3
4 5 6 7
0 1 2 3
4 5 6 7
0 1 2 3 4 5 6 7
ERR
PWR
RUN
ERR
ERR
0 1 2 3 4 5 6 7
0 1 2 3
4 5 6 7
0 1 2 3
4 5 6 7
24V
0V
CAN+
CAN-
COM0
Y0
Y1
COM1
COM2
Y2
COM3
Constitution
Rules
Y3
Y4
Y5
Y6
COM4
Y7
Y10
Y11
Y12
COM5
Y13
Y14
Y15
Y16
COM6
Y17
Y20
Y21
Y22
Y25
Y23
COM7
Y24
Y27
Y26
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
0V
24V
Y0 COM1
Y3
Y5
COM0 Y1
Y2
Y4
0 1 2 3
4 5 6 7
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
0 1 2 3
4 5 6 7
0 1 2 3
4 5 6 7
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
0V
24V
Y0 COM1
Y3
Y5
COM0 Y1
Y2
Y4
0 1 2 3
4 5 6 7
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
0 1 2 3
4 5 6 7
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
ID
Unit
IDAs register
X100~X137
32 points
Y100~Y137
32 points
ID100~ID131
16 channels
QD100~QD131
16 channels
D8250~D8259
X200~X237
32 points
Y200~Y237
32 points
ID200~ID231
16 channels
QD200~QD231
16 channels
D8260~D8269
X300~X337
32 points
Y300~Y337
32 points
ID300~ID331
16 channels
QD300~QD331
16 channels
D8270~D8279
X400~X437
32 points
Y400~Y437
32 points
ID400~ID431
16 channels
QD400~QD431
16 channels
D8280~D8289
X500~X537
32 points
Y500~Y537
32 points
ID500~ID531
16 channels
QD500~QD531
16 channels
D8290~D8299
X600~X637
32 points
Y600~Y637
32 points
ID600~ID631
16 channels
QD600~QD631
16 channels
D8300~D8309
X700~X737
32 points
Y700~Y737
32 points
ID700~ID731
16 channels
QD700~QD731
16 channels
D8310~D8319
X1000~X1037
32 points
Y1000~Y1037
32 points
ID1000~ID1031
16 channels
QD1000~QD1031
16 channels
D8320~D8329
Assignment
Expansion
1#
Expansion
2#
Expansion
3#
Expansion
4#
Expansion
5#
Expansion
6#
Expansion
7#
BD
Expansion
Max points/
Type
Channels
1-4General Specification
General
Items
Specification
Isolation voltage
Specifications
Up to DC 500V 2M
Anti-noise
1000V 1uS
Ambient temperature
0~60
Ambient humidity
5~95%
COM 1
COM 2
COM 3
CAN Bus
Installation
Grounding
Item
Performance
Specification
14 points
24\32 points
48\60 points
Program executing
format
Program format
Cycle speed
0.5us
14\18 in
10\14 out
28\36 in
20\24 out
8512 points
Points No.
620 Points
Spec.
Points No.
635 Points
Count
Spec.
erC
0~99mS
Password
protection
Self diagnose
function
2048 words
6 bits ASCII
Power on self-diagnoseMonitor timergrammar
check
1-5Exterior Size
Exterior Size
63
55
FG
73.3
COM
X0
X2
X4
X6
X1
X3
X5
X7
TYPE:C3-14R-E
DATE:20060410
SN:0067032266
0 1 2 3
4 5 6 7
110
102
94
C3-14RT-E
X
PWR
RUN
ERR
0 1 2 3
4 5 6 7
0V
24V
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
3.5
EC3 series 32 points main unitsIncluding 24 points main units32 points expansion
139
131
FG
COM
COM
X0
X1
X2
X3
73.3
X4
X5
X6
X7
X10
X11
X12
X13
X14
X15
X16
X17
X20
X21
110
102
94
PORT2
PWR
RUN
ERR
0 1 2 3 4 5
6 7
24V
0V
COM0
B
Y0
COM1
COM2
Y1
Y3
Y2
Y5
Y4
Y6
COM3
Y10
Y7
TYPE:C3-32R-E
DATE:20060410
SN:0067032266
C3-32R-E
PORT1
0 1 2 3 4 5
6 7
COM4
Y13
Y15
Y11
Y12
Y14
3. 5
207.4
199.4
COM
COM
X3
X1
X0
X2
X5
X4
X7
X6
X11
X10
X13
X12
X15
X14
73.3
X17
X16
X21
X20
X23
X22
X25
X24
X27
X26
X31
X33
X32
X30
X35
X34
X37
X36
X41
X40
X43
X42
0 1 2 3 4 5 6 7
110
102
94
C3-60R-E
PORT2
PWR
RUN
ERR
0 1 2 3 4 5 6 7
24V
0V
CAN+
CAN-
COM0
Y0
COM1
Y1
COM2
Y2
COM3
Y3
Y4
Y5
Y6
COM4
Y7
Y10
Y11
Y12
COM5
Y13
Y14
Y15
Y16
COM6
Y17
Y20
Y21
Y22
Y23
COM7
Y25
Y24
Y27
Y26
3.5
10
TYPE:C3-60R-E
DATE:20060410
SN:0067032266
PORT1
1-6Terminal arrangement
Main Unit
Input terminals
BD expansion
Input label
COM port
COM port
COM ports cover board
Output label
Output terminals
Screws
Input indicate LED Extension port
Programming status indicate LED
Output indicate LED
COM
0V
CAN+
24V
CAN-
X0
X1
X2
COM0
X3
Y0
X5
X4
Y1
COM1
X7
X6
Y2
COM2
X11
X10
X12
X13
X14
X15
X16
X17
X21
X20
X23
X22
X24
X25
X26
X27
X30
X31
X32
X33
X34
X35
X36
X37
X40
X41
X42
X43
Y4
COM5
COM9
Y10
Y12
Y15
Y17
Y20
Y22
Y27
Y25
Y7
COM7
Y5
Y11
Y13
COM4
Y6
COM6
Y14
Y16
COM8
Y21
Y23
Y24
Y26
Y3
COM3
COM
A
0V
COM
X0
X1
CAN+
CAN-
X2
COM0
X3
Y0
X5
X4
COM1
Y1
X7
X6
COM2
Y2
X10
X11
X12
COM3
Y3
X13
Y4
X14
Y5
X15
Y6
X16
X17
COM4
Y7
X20
Y10
X21
Y11
X22
Y12
X23
X24
X25
X26
X27
X30
X31
X32
X33
Y13
Y23
Y15
COM6
Y20
Y22
COM5 Y14
Y16
Y17
Y21
COM7
24V
0V
COM
COM
COM0
A
B
X0
Y0
X1
X2
X3
X4
COM2
COM1
Y1
X5
X6
Y3
Y2
X7
X10
X11
Y5
Y4
X12
Y6
COM3
X13
Y10
Y7
X14
X15
X16
X17
X20
X21
COM4
Y13
Y15
Y11
Y12
Y14
11
FG
24V
0V
COM
A
COM
X1
X0
COM0
B
COM1
Y0
X3
X2
X4
X6
Y3
COM2
Y1
X5
Y2
X7
COM
0V
24V
X0
X1
X2
X3
X4
X5
X6
X7
Expansion
EC-E8X8YR
COM
COM0
Y0
COM1
Y1
X1
X0
COM2
Y2
X2
Y3
X3
X4
COM3
Y4
X5
Y5
X6
Y6
X7
Y7
EC-E16X
COM
COM
COM
X10
COM
X11
X0
X12
X1
X13
X2
X14
X3
X15
X4
X16
X5
X6
X7
X17
EC-E16YR
COM0
COM4
12
Y0
Y10
COM1
COM5
Y1
Y11
COM2
COM6
Y2
Y12
Y3
Y13
COM3
COM7
Y4
Y14
Y5
Y15
Y6
Y16
Y7
Y17
X12
Y6
COM3
Y0 COM1 Y3
Y5
COM0 Y1
Y2
Y4
COM
X11
Y5
Y4
X10
X13
X14
Y10
Y7
Y11
X15
COM1
Pin of COM 1
3 4
6
5
8
2PRG
4RxD
5TxD
6VCC
8GND
COM2
Pin of COM 2
3 4
6
5
7
4RxD
5TxD
8GND
5
2 1
5 43
8
6
7
Mini Din 8 core sockethole
1
9
6
DB9 pinhole
13
Memo
14
2-1Power specification
2-3Input specification
2-5Output specification
15
2-1Power specification
For the power specification of EC series programmable controllers basic units, see the following
table
AC power
Rated voltage
AC100V~240V
type
Voltage allow
range
AC90V~265V
Rated frequency
50/60Hz
Allow momentary
power-cut time
Impact current
Max power
consumption
12W
24VDC10%
max 400mA
To avoid voltage drop, please use the power cable thicker than
2mm2
Even appear power cut within 10msPLC can still go on working.
But if long time power cut or abnormal power decrease, PLC will
stop working, output will also appear OFF statuswhen recover
power supply, the PLC will auto start to work.
DC power
type
Rated voltage
DC24V
DC21.6V~26.4V
Input current
(Only basic unit)
120mA
DC24V
Allow momentary
power-cut time
10mS
DC24V
Impact current
10A
DC26.4V
Max power
consumption
12W
24VDC10%
Max 400mA
Constitution
and
connection
COM
terminal.
2-3Input Specification
Basic units
Input signals
voltage
DC24V10%
Input signals
current
7mA/DC24V
Input ON current
Up to 4.5mA
About 10ms
Input signals
format
Contact input or
NPN open collector
transistor
Circuit isolation
Opto-isolators
Input actions
display
Expansions
Input signals
voltage
DC24V10%
Input signals
current
7mA/DC24V
Input ON current
Up to 4.5mA
Below 1.5mA
About 10ms
Input signals
format
Contacts input or
NPN open collector
transistor
Circuit isolation
Opto-isolators
Input actions
display
LED lights
input ON.
with
DC input signal
Input terminal
When connect input terminal and COM terminal with contacts without voltage or
NPN open collector transistor, if input is ONLED lamp lights, which indicates input
There are many COM
terminals to connect in PLC.
Input circuit
Use optical coupling instrument to insulate the input once circuit and twice circuit
Theres a C-R filter in the twice circuitIt is set to avoid wrong operation caused by
vibration of input contacts or noise along with input signal. As the preceding reason, for
the changing of input ONOFFOFFONin PLC, the response time delays about
10msTheres a digital filter inside X000~X015This kind of filter can very from
0~15ms according to the special register (D8020).
Input sensitive
The PLCs input current is DC24V 7mAbut to be safeit needs current up to 3.5mA
when its ONlower than 1.5mA when its OFF.
Exterior
circuit used
by sensor
Input connection
2-5Output specification
Relay output
Internal power
Below AC250VDC30V
Circuit insulation
Mechanism insulation
Action denote
Max
load
Resistant
load
3A
Induce load
80VA
Lamp load
100W
Mini load
DC5V 2mA
Response
time
OFFON
10ms
ONOFF
10ms
Transistor Output
Internal power
Below DC5~30V
Circuit insulation
Optical coupling
insulation
Action denote
Max
load
Restance
load
0.8A
Induce load
12W/DC24V
Lamp load
1.5W/DC24V
Open circuits
current
leak
Mini load
Response
time
DC5V 2mA
OFFON
Below 0.2ms
ONOFF
Below 0.2ms
Output terminals
Relay output type includes 2 to 4 common terminals. So each common unit can drive
different power-voltage systems (E.g.AC200VAC100VDC24V etc.) load.
Circuits isolation
Between the relay output coils and contactsPLCs interior circuits and exterior circuits,
load circuits are electric isolated. Besides, each common block is separate.
Action display
LED lamp lights when output relays coil is energised , output contacts are ON.
Response time
From the output relay engerised (or cut) to the output contacts be ON (or OFF), the
response time is about 10ms
Output current
The current-voltage below AC250V can drive the load of pure resistance 2A/1 point
inductance load below 80VAAC100V or AC200V and lamp load below 100W
AC100V or AC200V.
Open circuits leak current
When the output contact is OFF and theres no leak currentcan directly drive Ne lamp
etc.
The life of relay output contacts
Standard life of induce AC load such as contactorelectromagnetism valve5 million
times for 20VAloadCut power devices life according to the companys test: for 80VA
load, the action life is up to 2 million times.
Constitution
of output
circuit
DC load
AC load
Output terminal
Basic units transistor output has 1 to 4 common outputs.
Exterior power
Please use DC5~30V stablised voltage power for load drive,
Circuit insulation
Use opto isolating device to isolate PLCs interior circuit and output
transistor. Besides, each common is separate.
Action denote
When LED lightsoutput transistor is ON.
Response time
From opto isolating device drive (or cut) to transistor ON (or OFF), the time
PLC uses is below 0.2ms.
Output current
The current is 0.5A per pointBut is limited to a current of 0.8A for every four points.
Open circuits current
Below 0.1mA
E.g. The following is the connection graph of RT type PLC with step motor driver
PLC side
Y0
Y1
PU
PU
MEMO
3-3Specification of data
3-7Note items
29
Auxiliary relays are the relays inside the programmable controllerthis type of output relay
is different from input/output relayit cant gain exterior inputit can only be used in the program.
The relay can be retentive and can still save its ON/OFF status in the case of PLC power
cut.
StatusS
Relay than can be used as step ladder chart. (e.g. for sequence control)
When not used as a sequence numberits the same as a auxiliary relay and can be
used as common contact/coil to carry on programming. Besides, it can also be signal
alarm to diagnose exterior trouble.
TimerT
Timer can carry out pulse operation to 1ms10ms100ms etc.
T100~T199 are timers with the unit of 100ms clock pulsetheir current values are the
accumulate values. So, even though timer coils drive input is cut, they will still hold the
current value, go on accumulating the action.
CounterC
The counters can be divided into the following sorts according to their usage and
purpose
[Used for internal count] Common use / power failure retentive use
16 bits counterUsed for plus countcount range: 1~32,767
32 bits counterUsed for add / minus countcount range: -2,147,483,648~+2
147,483,647
These counters are used for PLCs internal signals, usually their response speed is below
10Hz.
[Used for high-speed count] For power failure retentive use
32 bits counter: For plus / minus count, count range: -2,147,483,648~+2,147,483,6487
(Single phase plus countsingle phase plus/minus countAB phase
count) allocate to the special input points.
High-speed counter can count with the frequency below 200kHzindependent with the
PLCs scan cycle.
Data registerD
Data register is the soft unit used by data register to save data. EC series PLCs data
registers are all 16 bits (The high bit is the sign bit), Combining two registers can carry on
32 bits data (The highest bit is the sign bit).
r
Just as with other soft units, data registers can also be divided into be two types: for
common use and power failure retentive use.
ConstantK(H)
In the diverse value used by PLC, K means decimal integerH means Hex. Value. They
are used to be the set value and current value for the timer and counter, or applied
instructions operands.
PointerPI
Pointers are used for branch and interrupt. The pointer (P) used by branch is the jump
aim used for condition jump or subroutine jump. Pointer used for interrupt is used for the
assigned input interrupt, time interrupt.
3-2Devices ID list
For the allocation of devices ID, please see the following list
When connecting input / output expansions and special expansions on the basic units, for
the input / output relays No., please refer to the user manual.
Range
Mnemonic
Name
points
14
24\32 48 \60
points points points
14 points
24\32 points
48 \60 points
Input relay
X000~X007
X000~X015
X000~X021
X000~X033
X000~X043
8 points
14\18 28\36
points points
Output relay
Y000~Y005
Y000~Y011
Y000~Y015
Y000~Y023
Y000~Y027
6 points
10\14 20\24
points points
M0~M2999M3000~M7999
8000
512
S0~S511
S512~S1023
1024
Internal relay
Flow
Timer
T300~T39910ms accumulation
620
Counter
635
C600~C634high-speed counter
FD
Data Register
FlashROM
Register
D0~D3999
D4000~D7999
8000
512
FD0~FD1535
1536
512
Mnemonic
Set area
Function
Systems
defaulted
value
Memory range
of power drop
FD8202
4000
D4000~D8000
FD8203
3000
M3000~M8000
FD8204
620
Not set
FD8205
320
C320~C640
FD8206
512
S512~S1024
M2
M8000
MOV
K0
D0
MOV
K5
D0
MOV
D10[D0]
D100
Y0[D0]
M0
M1
M8000
MOV
K21
DY0
MOV
K3
D0
MOV
DX2[D0]
D10
In the preceding example, when M0 turns from OFF to be ON, the value of the word DY0 composed
by Y0~Y17 equals 21i.e. Y0Y2Y4 turns to be ON status.
Before M1 be activate, when D0=0, DX2[D0] means a word composed by X2~X21
When M1turns from OFF to be ON, D0=3, then DX2[D0] means a word composed by X5~X24
DXnthe range of n is the exact range of Xchoose 16 points from the head to the end,
add 0 if not enough.
Please note, the word composed by bit device couldnt carry on bit searching address.
D0.4
Y0
D5[D1].4
Y1
In the preceding example, D0.4 means when the No.4 bit of D0 is 1, Y0 set ON
D5[D1].4 means bit searching address with offset, if D1=5it says D5[D1] means the number 4
bit of D10.
The bit of word device with offset is denoted as Dn[Dm].x
Please note, to the bit of word device, they couldnt combined to be word device.
4 T/C means the difference of registers word and bit
To T and C register, Tn/Cn means be a bit register or a word register should be
distinguished by the instructions.
TC could denote the status of timercounter, or the current value of timecounter, it is
distinguished by the instructions.
X0
M0
T11
T11
MOV
T11
K99
D0
Y1
5 Tag typePI
e.g.P means the tag which using CJ instruction or CALL instruction which could jump; I
means interrupt tag.
Timers
Please see the following table for the timers [T] numberthe number is
assigned according to Hex.
number
T0~T99
T100~T199
T200~T299
T300~T399
T400~T499
T500~T599
T600~T618
(T600,T602....T618) (each
1ms with interrupt precise time32 bits takes 2 timer numbers) the number
should be even
Function
Common format
Accumulation format
X0
T10
K100
X0
MOV
K200
D5
data switch.
When assigned as power cut
X1
T10
D5
T2
Y0
X0
T2
X0
K200
Y0
T2
Flicker
X0
T1
T2
T1
K20
X0
T2
T1
K10
Y0
Y0
T2
T1
Counter
s ID
C0~C299
32 bits positive/negative
counter
Counters
The characters of 16 bits counter and 32 bits counter are the following.
characteristic
Items
16 bits counter
32 bits counter
Count direction
Positive
Positive/negative
1~32,767
-2,147,483,648~+2,147,483,647
Constant K or data
register
Changing of the
current value
Output contact
Reset activates
16 bits
32 bits
Function
16 bits binary increase counter, its valid setting value is K1~K32,767 (Decimal
constant). The set value K0 and K1 have the same meaning, i.e. act when
output contacts at the beginning of first time count.
X0
X1
C0
RST
C0
Y0
C0
K10
Every time when X001 drives coil C0, the counters current value will
increase. When execute the coil instruction the tenth time, output contact
acts. Later, even X001 activates, counters current value will not change.
If reset input X000 is ON, execute RST instruction, counters current
value is 0, output contacts activates.
For the counters set value, it could not only set by constant K, but also be
assigned by data registers ID. E.g. assign D10, if the content of D10 is
123, its the same with setting K123.
When writing the set value to the current value register via MOV instruction
etc. When input next time, output coil gets, current value register turns to
the set value.
X2
M8238
X3
X4
C300
RST
C300
C300
K10
Y1
X001
C0
K100
Indicate assignmentK
X000
X001
MOV
K100
C0
D5
32 bits counter
Constant assignmentK
X001
C300
K43,100
D5
Indicate assignmentK
X000
X001
DMOV
C300
K43100
D0
D0D1
X1
Y3
X2
Y3
Y4
Y3
Memo
4-2LD,LDI,OUT
4-3AND,ANI
4-4OR,ORI
4-5LDP,LDF,ANDP,ANDF,ORP, ORF
4-6Compare instructions
4-7ORB
4-8ANB
4-9MCS,MCR
4-10ALT
4-11PLS, PLF
4-12SET, RST
4-14NOP, END
Function
LD
(LoaD)
M0
LDI
(LoaD Inverse)
M0
LDP
(LoaD Pulse)
M0
LDF
(LoaD
Pulse)
M0
Falling
AND
(AND)
Serial connection of
(normally open) contacts
NO
M0
ANI
(AND Inverse)
Serial connection of
(normally closed) contacts
NC
M0
ANDP
(AND Pulse)
M0
ANDF
(AND
pulse)
Serial
connection
falling/trailing edge pulse
M0
Falling
of
OR
(OR)
Parallel connection of
(normally open) contacts
NO
ORI
(OR Inverse)
Parallel connection of
(normally closed) contacts
NC
ORP
(OR Pulse)
ORF
(OR
pulse)
Parallel
connection
falling/trailing edge pulse
Falling
M0
M0
M0
of
LD
LD
M0
LD=
K1
D0
LD>
K1
D0
LD
LD
LD
AND
AND
AND
AND
AND
AND
OR
OR=
K1
D0
OR>
K1
D0
OR<
K1
D0
OR< >
K1
D0
OR< =
K1
D0
OR
OR
OR
OR
LD<
K1
D0
LD< >
K1
D0
LD< =
K1
D0
LD> =
K1
D0
AND=
K1
D0
AND>
K1
D0
AND<
K1
D0
AND< >
K1
D0
AND< =
K1
D0
AND> =
K1
D0
ANB
(ANd Block)
ORB
(OR Block)
OUT
(OUT)
SET
(SET)
RST
(ReSeT)
PLS
(PuLSe)
PLF
(PuLse Falling)
MCS
(New bus line
start)
Connect
contacts
MCR
(Bus line return)
ALT
(Alternate state)
NOP
(No Operation)
END
(END)
the
public
OR> =
K1
D0
Y0
SET
Y0
RST
Y0
PLS
Y0
PLF
Y0
serial
Y0
Y0
ALT
M0
NOP
END
4-2LD,LDI,OUT
Mnemonic
Function
LD
M0
(LoaD)
LDI
M0
(LoaD Inverse)
NC (Normally Closed)
OUT
Y0
(OUT)
Connect the LD and LDI instructions directly to the left bus bar. Or use
them to define a new block of program when using ANB instruction.
OUT instruction is the coil drive instruction for the output relay
auxiliary relaystatustimercounter. For the input relay, cannot use.
Can not sequentially use parallel OUT command for many times.
For the timers time coil or counters count coil, after using OUT
instruction, set constant K is necessary.
For the constant Ks set rangeactual timer constantprograms step
relative to OUT instructioninclude the set value
See the following table
Instruction
description
Timer/counter
1ms timer
10ms timer
Setting range of K
132,767
0.0132.767 seconds
100ms timer
0.132.767 seconds
16 bits counter
132,767
32 bits counter
12,147,483,647
X0
Program
X1
Y100
M1203
T0
T0
Y1
K19
LD
OUT
LDI
OUT
OUT
SP
LD
OUT
X0
Y100
X1
M1203
T0
K19
T0
Y1
4-3AND,ANI
Mnemonic
and
Function
Description
Mnemonic
Function
AND
(AND)
Serial connection of
NO (Normally Open)
contacts
M0
ANI
(ANd Inverse)
Serial connection of
NC (Normally Closed)
contacts
M0
Use the AND and ANI instructions for serial connection of contacts.
As many contacts as required can be connected in series. They can
be used for many times.
The output processing to a coil, through writing the initial OUT
instruction is called a follow-on output (For an example see the
program below: OUT M10 and OUT Y005). Follow-on outputs are
permitted repeatedly as long as the output order is correct. Theres
no limit for the serial connected contacts No. and follow-on outputs
number.
X2 M1
Program
Y2
Y2 X3
M2
T1
Y3
LD
AND
OUT
LD
ANI
OUT
AND
OUT
X2
M1
Y2
Y2
X3
M2
T1
Y3
4-4OR,ORI
Mnemonic
and
Function
Mnemonic
Function
OR
(OR)
Parallel connection of NO
(Normally Open) contacts
M0
ORI
(OR Inverse)
Parallel connection of NC
(Normally Closed) contacts
M0
Description
X5
Program
X6
Y6
M11
Y6 M4 X7
M12
M13
Relationship
with ANB
M100
LD
OR
OR
OUT
LDI
AND
OR
ANI
OR
OUT
X5
X6
M11
Y6
Y6
M4
M12
X7
M13
M100
4-5DP,LDF,ANDP,ANDF,ORP,ORF
Mnemonic
and
Function
Mnemonic
Function
LDP
(LoaD Pulse)
Initial logical
operation-Rising edge
pulse
M0
LDF
(LoaD Falling
pulse)
M0
ANDP
(AND Pulse)
M0
ANDF
(AND Falling
pulse)
Serial
connection
of
Falling/trailing edge pulse
M0
ORP
(OR Pulse)
Parallel connection
Rising edge pulse
ORF
(OR Falling
pulse)
Parallel connection of
Falling/trailing edge pulse
of
M0
M0
Description
X5
X6
Program
M8000 X7
X5
X6
M8000 X7
M13
M15
M13
M15
LDP
ORP
OUT
LD
ANDP
OUT
X5
X6
M13
M8000
X7
M15
LDF
ORF
OUT
LD
ANDF
OUT
X5
X6
M13
M8000
X7
M15
Output
X0
X0
M20
PLS
M20
drive
In two conditions, when X0 turns from OFF to ON, M20 gets a scan cycle.
NOTE
X10
X10
MOV
MOV
K10
K10
D0
D0
Mnemonic
and
Function
Mnemonic
Function
LD
LD
LD
LD
LD
LD
AND
AND
AND
AND
AND
AND
OR
OR
OR
OR
OR
OR
Format and
Function
Program
The value of S1 and S2 are tested according to the comparison of the instruction. If
the comparison is true then the LD contact is active. If the comparison is false then
the LD contact is not active.
16 bits
32 bits
Active condition
LD
DLD
S1S2 S1S2
LD
DLD
S1S2 S1S2
LD
DLD
S1S2 S1S2
LD
DLD
S1S2 S1S2
LD
DLD
S1S2 S1S2
LD
DLD
S1S2 S1S2
X0
LD=
S1
S2
K100
C0
LD
D200
K-30
DLD
K68899
C300
Inactive condition
Y0
X0
SET
Y1
M50
M4
Note Items
Format and
Function
The value of S1 and S2 are tested according to the instruction. If the comparison is
true then the AND contact is active. If the comparison is false then the AND
contact is not active.
16 bits
32 bits
Active condition
AND
DAND
S1S2 S1S2
AND
DAND
S1S2 S1S2
AND
DAND
S1S2 S1S2
AND
DAND
S1S2 S1S2
AND
DAND
S1S2 S1S2
AND
DAND
S1S2 S1S2
Program
Inactive condition
S1
S2
AND
K100
C0
AND
K-30
D0
DAND
K68899
D10
X0
X1
X2
Y0
SET
Y1
M50
M4
Note items
Format and
Function
The value of S1 and S2 are tested according to the instruction. If the comparison is
true then the OR contact is active. If the comparison is false then the OR contact is
not active.
16 bits
32 bits
Active condition
OR
DOR
S1S2 S1S2
OR
DOR
S1S2 S1S2
OR
DOR
S1S2 S1S2
OR
DOR
S1S2 S1S2
OR
DOR
S1S2 S1S2
OR
DOR
S1S2 S1S2
Program
Inactive condition
X0
Y0
OR
X2
S1
S2
K100
C0
M4
DOR
M50
D10
K68899
Note items
When the source datas highest bit (16 bitsb1532 bitsb31) is 1
use the data as a negative.
The comparison of 32 bits counterC300~ must be 32 bits instruction.
If assigned as a 16 bits instruction, it will lead the program error or
operation error.
4-7ORB
Description
Mnemonic
Function
ORB
(OR Block)
Parallel connection of
multiply parallel circuits
To declare the starting point of the circuit (usually serial circuit blocks)
to the preceding circuit in parallel. Serial circuit blocks are those in
which more than one contacts in series or the ANB instruction is used.
An ORB instruction is an independent instruction and is not associated
with any device number.
There are no limitations to the number of parallel circuits when using an
ORB instruction in the sequential processing configuration.
When using ORB instructions in a batch, use no more than 8 LD and
LDI instructions in the definition of the program blocks (to be
connected parallel).
Program
Recommended sequencial
programming method
LD
AND
LD
AND
ORB
LDI
AND
ORB
OUT
X0
X1
X2
X3
X4
X5
Y10
Non-preferred
batch
programming method
LD
AND
LD
AND
LDI
AND
ORB
ORB
OUT
X0
X1
X2
X3
X4
X5
Y10
4-8ANB
Mnemonic
Mnemonic
Function
and
ANB
(ANd Block)
Serial connection of
multiply parallel circuits
Function
Description
Program
LD
OR
LD
AND
LDI
AND
ORB
OR
ANB
OR
OUT
X0
X1
X2
X3
X4
X5
X6
X7
Y20
Start of a branch
Start of a branch
End of a parallel circuit block
End of a parallel circuit block
Serial connect with the preceding circuit
4-9MCS,MCR
Mnemonic
and
Function
Description
Mnemonic
Function
MCS
(Master control)
MCR
(Master control Reset)
Y0
Y0
X1
Description
X2
M1
Y0
M3
M2
Y1
Y2
4-10ALT
Mnemonic
and
Function
Description
Mnemonic
Function
ALT
(Alternate
state)
ALT
M0
Program
M100
M0
M0
ALT
M0
Y0
Y1
LD
ALT
LD
OUT
LDI
OUT
M100
M0
M0
Y0
M0
Y1
4-11PLS,PLF
Mnemonic
and
Function
Mnemonic
M)
PLS
(PuLSe)
PLF
(PuLse Falling)
Falling/trailing
pulse
edge
PLS
Y0
PLF
Y0
Description
X0
Program
Function
M0
X1
M1
PLS
M0
SET
Y0
PLF
M1
RST
Y0
LD
X0
PLS
M0
LD
M0
SET
Y0
---------------------LD
X1
PLF
M1
LD
M1
RST
Y0
4-12SET,RST
Mnemonic
and
Function
Mnemonic
SET
(SET)
RST
(ReSeT)
SET
Y0
RST
Y0
Description
X10
Program
Function
X11
X12
X13
X14
X15
SET
Y0
RST
Y0
SET
M50
RST
M50
SET
S0
RST
S0
X10
X17
X10
X11
Y0
T250
RST
T250
K10
LD
SET
LD
RST
LD
SET
LD
RST
LD
SET
LD
RST
LD
OUT
SP
LD
RST
X10
Y0
X11
Y0
X12
M50
X13
M50
X14
S0
X15
S0
X10
T250
K10
X17
T250
Mnemonic
and
Function
Mnemonic
Function
OUT
(OUT)
RST
(ReSeT)
X10
Program of
internal
counter
RST
X11
C0
C0
C0
K10
Y0
RST
Program of
high speed
counter
In the preceding example, when M0 is ON, carry on positive count with OFFON of X0.
Counters current value increase, when reach the set value (K or D), the output contact is reset.
When M1 is ON, counters C600 output contact is reset, counters current value turns to be 0.
4-14NOP,END
Mnemonic
and
Function
Description
Mnemonic
Function
NOP
(No Operation)
No operation or null
step
END
(END)
NOP
END
When clear the whole program, all the instructions become NOP. If add
NOP instructions between the common instructions, they have no effect
and PLC will keep on working. If add NOP instructions in the program,
then when modify or add programs, the step vary will be decreased. But
the program should have rest quantity.
If replace the programs instructions with NOP instructions, then the
circuit will be changed, please note this.
OUTNOP
ANDNOP ANINOP
Contacts short circuit
ORNOP
ORINOP
Open circuit
When executing END instruction, refresh monitor timer. (Check if scan cycle is a long timer. )
X0
X3
X2
X4
Y0
X0
X2
X3
X4
X0
X2
X3
X4
Y0
Y0
M0
M0
M1
Y0
M1
There are other methods. E.g. jump instructions or step ladder. However, when use step ladder, if the
main programs output coil is programmed, then the signal method is the same with dual coil, please
note this.
Memo
5Applied instruction
In this chapter, we describe applied instructions function of EC series PLC.
5-3Flow Instructions
5-7Data Convert
5-8Floating Operation
5-9Clock Operation
Applied instructions
Mnemonic
Function
CJ
Condition jump
CALL
Call subroutine
SRET
Subroutine return
STL
Flow start
STLE
Flow end
SET
ST
FOR
NEXT
FEND
First end
Program
Flow
Data
Compare
Data
Move
LD
LD
LD
LD
LD activates ifS1S2
LD
LD activates ifS1S2
LD
LD activates ifS1S2
AND
AND
AND
AND
AND
AND
OR
OR activates ifS1S2
OR
OR activates ifS1S2
OR
OR activates ifS1S2
OR
OR activates ifS1S2
OR
OR activates ifS1S2
OR
OR activates ifS1S2
MOV
Move
BMOV
Block move
FMOV
Fill move
FWRT
FlashROM written
MSET
Zone set
ZRST
Zone reset
SWAP
The high and low byte of the destinated devices are exchanged
Applied instructions
Data
Operation
XCH
Exchange
ADD
Addition
SUB
Subtraction
MUL
Multiplication
DIV
Division
INC
Increment
DEC
Decrement
MEAN
Mean
WAND
Word And
WOR
Word OR
WXOR
Word exclusive OR
CML
Compliment
NEG
Negative
Applied instructions
Data Shift
Data
Convert
Float
Point
Operation
Clock
Operation
SHL
SHR
LSL
LSR
ROL
ROR
SFTL
SFTR
WSFL
WSFR
WTD
FLT
FLTD
INT
BIN
BCD
ASC
HEX
DECO
Coding
ENCO
ENCOL
ECMP
Float compare
EZCP
EADD
Float Add
ESUB
Float Subtract
EMUL
Float Multiplication
EDIV
Float division
ESQR
SIN
Sine
COS
Cosine
TAN
Tangent
TCMP
Time Compare
TZCP
TADD
Time Add
TSUB
Time Subtract
TRD
TWR
Applied instructions
Applied instructions
Note
Instructions name
Device which can be used
Ladder example
Tell the instructions basic action, using way, applied example, extend function, note items etc.
Flag after executing the instruction. Instructions without the direct flag will not display.
S : Source operand, its content wont change after executing the instruction
D : Destinate operand, its content changes with the execution of the instruction
Applied instructions
The related
description
Instruction D(NUM)
D(NUM)
Object data
Double word32 bittakes two data register, its composed by two consecutive data
registers, the first one is assigned by double word object instruction. The
range is: Dec. -214,748,364,8~214,748,364,7, Hex. 00000000~FFFFFFFF.
Double word object instruction
Instruction D(NUM)
D(NUM+1)
Object data
D(NUM)
Object data
Applied instructions
Program
Flow
16 bits
32 bits
16 bits
32 bits
CJ
WTD
CALL
FLT
DFLT
SRET
INT
DINT
STL
BIN
DBIN
BCD
DBCD
ASC
HEX
STLE
Data convert
SET
ST
FOR
DECO
NEXT
ENCO
FEND
ENCOL
MOV
DMOV
ECMP
EZCP
BMOV
Data Move
Data
operation
Data Shift
FMOV
EADD
FWRT
DFWRT
ESUB
ZRST
EMUL
SWAP
EDIV
XCH
DXCH
ESQR
ADD
DADD
SIN
SUB
DSUB
COS
MUL
DMUL
DIV
DDIV
TCMP
INC
DINC
TZCP
DEC
DDEC
TADD
MEAN
DMEAN
TSUB
WAND
DWAND
TRD
WOR
DWOR
TWR
WXOR
DWXOR
CML
DCML
NEG
DNEG
SHL
DSHL
SHR
DSHR
LSL
DLSL
LSR
DLSR
ROL
DROL
ROR
DROR
SFTL
DSFTL
SFTR
DSFTR
WSFL
DWSFL
WSFR
DWSFR
Float
operation
TAN
Clock
operation
Applied instructions
Instructions name
CJ
Condition Jump
CALL
Call subroutine
SRET
Subroutine return
STL
Flow start
STLE
Flow end
SET
Open the assigned flow, close the current flow (flow jump)
ST
Open the assigned flow, not close the current flow (Open the new flow)
FOR
NEXT
FEND
First End
Applied instructions
[CJ]
OperandP
Function
and Action
As the instructions of executing list, with CJ instructions, the operate cycle and
dual coil can be greatly shorten.
In the following chart, if X000ONthen jump from step 1 to the end step of
flag P6. When X000OFF, do not execute jump instructions.
X0
CJ
P6
X1
Y0
X2
X3
X4
RST
T246
T246
K1000
MOV
K3
CJ
P7
D0
P6
X0
X5
Y0
P7
X6
RST
T246
See the upward graph, Y000 turns to be dual coil and output. But
when X000=OFF, X001 activates. When X000=ON, X005 activates.
CJ can not jump from one STL to another STL.
If program timer T0~T640 and high speed counter C600~C640 jump
after driving, go on working, output point also activate.
Applied instructions
X0
P10
Main program
CALL
Function
FEND
P10
Subroutine
SRET
END
Applied instructions
SET
S0
SET
S1
ST
S2
Function
STL S0
STLE
STL S1
STLE
STL S2
STLE
STL and STLE should be used in pairs. STL means start of a flow, STLE
means end of a flow.
After executing of SET Sxxx instruction, the flow assigned by these
instructions is ON.
After executing RST Sxxx instruction, the assigned flow is OFF.
In flow S0, SET S1 close the current flow S0, open flow S1.
In flow S0, ST S2 open the flow S2, but dont close flow S0.
When flow turns from ON to be OFF, OFF or reset OUTPLSPLFnot
accumulate timer etc. which belongs to the flow.
ST instruction is usually used when a program needs to run more flows at
the same time.
Applied instructions
Function
M0
M1
FOR
K5
FOR
K6
INC
D0
[A]
NEXT
M3
[C]
FOR
K7
INC
D1
[B]
NEXT
NEXT
Applied instructions
Function
An FEND instruction indicates the first end of a main program and the start of the
program area to be used for subroutines. Under normal operating circumstances the
FEND instruction performs a similar action to the END instruction, i.e. output
processing, input processing and watchdog timer refresh are all carried out on
execution.
Applied instructions
5-4Data Move
Mnemonic
Function
MOV
Move
BMOV
Block Move
FMOV
Fill Move
FWRT
Written of FlashROM
ZRST
Zone Reset
SWAP
Float To Scientific
XCH
Exchange
Applied instructions
[MOV]
OperandsDXDYDMDSTCDFDK
Function
X0
MOV
K10
D10
X1
MOV
T0
D20
T0 current valueD20
MOV
K10
D20
K10D10
M0
T20
D20=K10
D20
DMOV
D0
D10
D1D0D11D10
DMOV
C235
D20
Applied instructions
[BMOV]
OperandsDXDYDMDSTCDFDK
Function
X0
BMOV
D5
D10
K3
D5
D10
D6
D11
D7
D12
n=3
D10
D9
K3
BMOV
D10
D11
K3
X2
D10
D11
D12
D10
D11
D12
D9
D10
D11
D11
D12
D13
Applied instructions
[FMOV]
OperandsDXDYDMDSTCDFDK
Function
X0
FMOV
K0
D0
K10
K0
K0
D0
K0
D1
K0
D2
K0
D3
K0
D4
n
K0
D5
K0
D6
K0
D7
K0
D8
K0
D9
Applied instructions
[FWRT]
OperandsDXDYDMDSTCDFDK
1Written of a word
Function
X0
FWRT
D0
FD0
DFWRT
D0
FD0
FWRT
D1
D3
D0
FD0
K3
Applied instructions
[ZRST]
OperandsAll bitword soft units
Function
X0
ZRST
ZRST
ZRST
D1
D2
M500
M559
D1
D2
C235
C255
D1
D2
D0
D127
D1 and D2 are assigned to be the same device, and D1 < = D2. When D1>D2, only reset device in
D1.
The instruction is 16 bits, but its available to use D1, D2 to assign 32 bits counter. But mix
assignment is not allowed. I.e. D1 is a 16 bits counter, D2 is a 32 bits counter, this condition is not
allowed.
As single reset instruction of device, RST instruction is available of
bit device YMS and word device TCD.
As Fill Move instruction of K0, you could write 0 into device DX
DYDMDSTCD.
Other reset
instructions
X1
RST
M0
RST
T0
RST
C0
FMOV
K0
Reset M0
Reset D0
X2
D0
K100
Applied instructions
[SWAP]
OperandsDXDYDMDSTCD FD
Function
D10
High 8 bits
Low 8 bits
Applied instructions
[XCH]
OperandsDXDYDMDSTCDFD
16 bits instruction
Function
X0
XCH
BeforeD10=100
D1
D2
D10
D11
After D10=101
D11=101
D11=100
When drive input X0 is ON, each scan cycle should carry on data exchange,
please note.
32 bits instruction
X0
DXCH
D1
D2
D10
D20
32 bits instruction [DXCH] swaps value composed by D10D11 and the value
composed by D20D21.
Applied instructions
Mnemonic
Function
ADD
Addition
SUB
Subtraction
MUL
Multiplication
DIV
Division
INC
Increment
DEC
Decrement
MEAN
Mean
WAND
WOR
Logic Word Or
WXOR
Logic Exclusive Or
CML
Compliment
NEG
Negation
Applied instructions
[ADD]
OperandsDXDYDMDSTCDFDK
Function
X0
ADD
S1
S2
D10
D12
D14
D10D12D14
Flag
Zero
M8020
Borrow
M8021
Carry
M8022
The data contained within the two source devices are combined and the total is stored in
the specified destination device. Each datas highest bit is the sign bit, 0 stands for
positive,1 stands for negative. All calculations are algebraic processed.5+-8=-3
If the result of a calculation is 0, the 0 flag acts. If the result exceeds 32376716
bits limitor 214748364732 bits limit, the carry flag acts.refer to the next page.
If the result exceeds -32376816 bits limitor -214748364832 bits limit, the
borrow flag actsRefer to the next page
When carry on 32 bits operation, word devices low 16 bits are assigned, the device
following closely the preceding devices ID will be the high bits. To avoid ID repetition,
we recommend you assign devices ID to be even ID.
The same device may be used as a source and a destination. If this is the case then the
result changes after every scan cycle. Please note this point.
Applied instructions
[SUB]
OperandsDXDYDMDSTCDFDK
X0
SUB
Function
S1
S2
D10
D12
D14
D10D12D14
Flag
Zero
M8020
Borrow bit
M8021
Carrier
M8022
appoint the soft units content, subtract the soft units content appointed by
format of algebra. The result will be stored in the soft unit appointed by
in the
. (5-(-8)=13)
The action of each flag, the appointment method of 32 bits operations soft units are both the same
with the preceding ADD instruction.
The relationship of the flags action and positive/negative data is the following chart.
Applied instructions
[MUL]
OperandsDXDYDMDSTCDFDK
Function
16 bits operation
S1
S2
D0
D2
D4
X0
MUL
and action
BIN
BIN
D0 (D2)
16 bits
BIN
D5D4
16 bits
32 bits
The contents of the two source devices are multiplied together and the
result is stored at the destination device in the format of 32 bits. As in
the upward chart when D0=8D2=9D5D4=72
The results highest bit is the symbol bit: positive0negative1.
When be bit unit, it can carry on the bit appointment of K1~K8. When
appoint K4, only the results low 16 bits can be obtained.
32 bits operation
S1
S2
D0
D2
D4
X1
DMUL
BIN
BIN
BIN
D1D0 (D3D2)
D7D6D5D4
32 bits
32 bits
64 bits
In 32 bits operation, when use bit device as the destination address, only
low 32 bits result can be obtained. The high 32 bits result can not be
obtained, so please operate again after transfer one time to the word device
Even use word device, 64 bits results cant be monitored at once.
In this situation, float point data operation is recommended.
Applied instructions
[DIV]
OperandsDXDYDMDSTCDFDK
16 bits operation
Function
S1
S2
D0
D2
D4
X0
DIV
and action
Dividend
Divisor
Result
BIN
BIN
BIN
BIN
(D2)
D4
(D5)
16 bits
16 bits
6 bits
(D0)
16 bits
Remainder
appoints the
S2
D0
D2
D4
X1
DDIV
Dividend
BIN
X1
(D1,D0)
32 bits
Divisor
BIN
DDIV
(D3,D2)
Result
S1
Result
S2
BIN
D0
D2
D5,D4
32 bits
32 bits
D
BIN
D4
(D7,D6)
32 bits
The result and the remainder are stored in the four sequencial devices, the
first one is appointed by
If the value of the divisor is 0, then an operation error is executed and the
operation of the DIV instruction is cancelled.
When appoint the bit device as
The highest bit of the result and remainder is the symbol bit (positive:0,
negative: 1). When any of the dividend or the divisor is negative, then the
result will be negative. When the dividend is negative, then the remainder
will be negative.
Applied instructions
Function
X0
INC
D0
D01(D0)
and action
On every execution of the instruction the device specified as the destination
has its current value incremented (increased) by a value of 1.
In 16 bits operation, when +32767 is reached, the next increment will write
-32767 to the destination device. In this case, theres no additional flag to
identify this change in the counted value.
D
X1
DEC
D0
D01(D0)
Applied instructions
[MEAN]
OperandsDXDYDMDSTCDFD
Function
X0
(D0)
MEAN
(D1) + (D2)
3
D0
D10
K3
(D10)
The value of all the devices within the source range is summed and then
divided by the number of devices summed, i.e. n.. This generates an integer
mean value which is stored in the destination device (D) The remainder of
the calculated mean is ignored.
If the value of n is specified outside the stated range (1 to 64) an error is
generated.
Applied instructions
WAND
S1
S2
D10
D12
D14
0&0=0
1&0=0
0&1=0
1&1=1
0 or 0=0
1 or 0=1
0 or 1=1
1 or 1=1
WOR
S1
S2
D10
D12
D14
WXOR
S1
S2
D10
D12
D14
0 xor 0=0
1 xor 0=1
0 xor 1=1
1 xor 1=0
If use this instruction along with CML instruction, XOR NOT operation could also
be executed .
X0
S1
S2
WXOR
D10
D12
D14
CML
D14
D14
Applied instructions
[CML]
OperandsDXDYDMDSTCDFD
Function
X0
CML
D0
DY0
Each data bit in the source device is inverted and sent to the destination device. If use constant K
in the source device, it can be auto convert to be binary.
Its available when you want to inverted output the PLCs output
X1
X2
X3
X17
M0
The
sequencial
control
instruction in the left could be
denoted by the following CML
instruction.
M1
M2
M3
M17
M8000
CML
DX0
DM0
Applied instructions
NEG
OperandsDXDYDMDSTCDFD
Function
X0
NEG
D10
(D10) +1
(D10)
and action
The bit format of the selected device is inverted, I.e. any occurrence of a 1 becomes a 0 and
any occurrence of 0 becomes 1, when this is complete, a further binary 1 is added to the bit
format. The result is the total logic sigh change of the selected devices contents.
When using continually executing instructions, then this instruction will be executed in every scan
cycle.
Applied instructions
5-6Shift instructions
Mnemonic
Function
SHL
SHR
LSL
LSR
ROL
Rotation left
ROR
Rotation right
SFTL
SFTR
WSFL
WSFR
Applied instructions
and action
Applied instructions
and action
NOTE:
In every scan cycle, loop shift left/right action will be executed
The situation of 32 bits is the same.
Applied instructions
Function
The bit format of the destination device is rotated n bit places to the left on every
operation of the instruction
Rotation shift left
and action
As there is a carry flag in the rotation circuit, so if drive M8022 before executing the
rotation instruction, it could be sent to the destination address.
Please note that rotation left/right action is executed in every scan cycle.
The situation of 32 bits is the same.
Applied instructions
Function
and action
M15~M12overflow
M11~M 8M15~M 12
M 7~M 4M11~M8
M 3~M 0M7~M4
X 3~X 0M3~M0
M 3~M 0overflow
M 7~M 4M3~M0
M11~M 8M7~M4
M15~M12M11~M8
X 3~X 0M15~M12
Applied instructions
Function
and action
D25~D22overflow
D21~D18D25~D22
D17~D14D21~D18
D13~D10D17~D14
D 3~D 0D13~D10
D13~D10overflow
D17~D14D13~D10
D21~D18D17~D14
D25~D22D21~D18
D 3~D 0D25~D22
Applied instructions
5-7Data Convert
Mnemonic
Function
WTD
FLT
FLTD
INT
BIN
BCD
ASC
HEX
DECO
Coding
ENCO
ENCOL
Applied instructions
[WTD]
OperandsDXDYDMDSTCDFD
Function
X0
WTD
D0
D10
0 or 1
D11
D0 D11D10
Single word Double word
D0
D10
Applied instructions
16 bits
Function
X0
(D10)
FLT
D10
D12
(D13,D12)
BIN integer
32 bits
X0
DFLT
D10
D12
D11,D10 D13,D12
BIN integer
64 bits
X0
FLTD
D10
D14
D13,D12,D11,D10 D17,D16,D15,D14
BIN integer
Convert BIN integer to binary float point. As the constant KH will auto convert by the float
operation instruction, so this FLT instruction cant be used.
The instruction is contrary to INT instruction.
Applied instructions
[INT]
OperandsDXDYDMDSTCDFD
16 bits
Function
X0
D11,D10
INT
D10
D20
D10
D20
(D20)
32 bits
X0
D11,D10
DINT
(D20)
The binary source number is converted into an BIN integer and stored at the destination device.
Losing the value behind the decimal point.
This instruction is contrary to FLT instruction.
When the result is 0, the flag bit is ON
When converting, less than 1 , zero flag is ON.
16 bits operation-32,768~32,767
32 bits operation-2,147,483,648~2,147,483,647
Applied instructions
[BIN]
OperandsDXDYDMDSTCDFD
Function
X0
BIN
D10
D0
Applied instructions
[BCD]
OperandsDXDYDMDSTCDFD
Function
BCD
D10
D0
When use BCD instruction, if the converted BCD number exceeds the
operational ranges of 0 to 9999(16 bits operation) and 0 to 99999999 (32
bit operation) an error will occur.
This instruction can be used to output data directly to a seven segment
display.
Applied instructions
[ASCI]
Operands: DXDYDMDSTCDFD
and action
Convert each bit of sources (S) Hex. format data to be ASCII code, move separately to the high 8
bits and low 8 bits of destination (D). The convert alphanumeric number is assigned with n.
(D) is low 8 bits, high 8 bits, store ASCII data.
[0]=30H
[A]=41H
[B]=42H
[C]=43H
[1]=31H
[2]=32H
[3]=33H
[4]=34H
[5]=35H
[6]=36H
[7]=37H
[8]=38H
n
D
K1
K2
K3
K4
K5
K6
K7
K8
K9
D200 down
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
[8]
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[C]
[B]
[A]
[0]
[4]
[3]
[C]
[B]
[A]
[0]
[4]
[C]
[B]
[A]
[0]
[C]
[B]
[A]
[C]
[B]
D200 down
D201 down
D201 up
D202 down
D202 up
D203 down
D203 up
D204 down
[C]
Applied instructions
[HEX]
OperandsDXDYDMDSTCDFD
16 bits switch modeWhen M8161=OFF
Function
and action
Convert the high and low 8 bits in source to HEX data. Move 4 bits every time to
destination. The convert alphanumeric number is assigned by n.
ASCII
(D)
HEX
Conversion
D102
D101
D100
n
0H
D200 up
30H
D200 up
41H
D201 down
42H
D201 up
43H
D202 down
31H
0H
ABC1H
D202 up
32H
0AH
BC12H
D203 down
33H
0ABH
C123H
D203 up
34H
0ABCH
1234H
D204 down
35H
ABC1H
2345H
D200
Not change to be 0
0H
0
0
30H[0]
0
43H[C]
D202
0ABH
0ABCH
41H[A]
D201
0AH
42H[B]
0
1
A
1
B
Applied instructions
[DECO]
OperandsDXDYDMDSTCDFD
When
X10
DECO
X002
0
X000
M10
K3
X001
1
X000
1
4
7
0
6
0
5
0
4
0
2
0
1
0
0
0
M17
M16
M15
M14
M13
M12
M11
M10
When
X0
is word device n4
DECO
D0
D1
K3
Source IDs low n bitsn4 are encoded to the destination ID. When n
3, destinations high bits all converts to be 0.
When n=0, no disposal, beyond n=0~4, dont execute the instruction.
Applied instructions
[ENCO]
OperandsDXDYDMDSTCDFD
When
Function
X0
M17
0
7
b15
0 0
ENCO
M10
D10
K3
M16
0
6
M15
0
5
M14
0
4
M13
1
D10
0 0
M12
0
2
M11
1
1
M10
0
0
4
0 1 1
b0
All 0
When
X1
ENCO
D0
D1
K3
If many bits in the source ID are 1, ignore the low bits. If source ID are all 0, dont
execute the instructions.
When drive input is OFF, the instruction is not executed, encode output dont change.
When n=8, if encode instructions S is bit unit, its point number is 2^8=256
Applied instructions
[ENCOL]
OperandsDXDYDMDSTCDFD
If
Function
X0
M17
0
7
b15
0 0
ENCOL
M10
D10
K3
M16
0
6
M15
1
5
M14
0
4
M13
1
D10
0 0
M12
0
2
M11
0
1
M10
0
0
4
0 1 1
b0
All 0
If
X1
ENCOL
D0
D1
K3
If many bits in the source ID are 1, ignore the high bits. If source ID are all 0, dont
execute the instructions.
When drive input is OFF, the instruction is not executed, encode output dont change.
When n=8, if encode instructions S is bit unit, its point number is 2^8=256
Applied instructions
5-8Floating Operation
Mnemonic
Function
ECMP
Float Compare
EZCP
EADD
Float Add
ESUB
Float Subtract
EMUL
Float Multiplication
EDIV
Float Division
ESQR
SIN
Sine
COS
Cosine
TAN
Tangent
Applied instructions
[ECMP]
OperandsDXDYDMDSTCDFDK
D11,D10
D21,D20M0,M1,M2
Function
and action
X0
ECMP
S1
S2
D10
D20
M0
M0
M1
(D11,D10) = (D21<D20)
M2
The status of the destination device will be kept even if the ECMP instruction is deactivated.
The binary float data of S1 is compared to S2. The result is indicated by 3 bit devices specified
with the head address entered as D.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X0
ECMP
K500
D100
M10
K500D101D100M10,M11,M12
Applied instructions
[EZCP]
OperandsDXDYDMDSTCDFDK
EZCP
and action
S1
S2
D1
D2
D10
D20
D0
M3
M3
ON
M4
(D21,D10) (D1,D0)D31D30
ON
ON
M5
The status of the destination device will be kept even if the EZCP instruction is deactivated.
The data of S1 is compared to the data of S2. The result is indicated by 3 bit devices specified
with the head address entered as D.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X0
EZCP
K10
K2800
D5
M0
K10[D6,D5]K2800M0M1M2
Please set S1<S2, when S2>S1, see S2 as the same with S1 and compare them.
Applied instructions
[EADD]
OperandsDXDYDMDSTCDFDK
Function
X0
EADD
D11,D10
S1
S2
D10
D20
D50
(D21,D20)
(D51,D50)
The floating point values stored in the source devices S1 and S2 are algebraically added and the
result stored in the destination device D.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X1
K1234
EADD
D100
K1234
+ ( D101,D100)
D110
(D111,D110)
The same device may be used as a source and as the destination. If this is the case then,on
continuous operation of the EADD instruction, the result of the prevous operation will be used as
a new source value and a new result calculated. This will happen every program scan unless the
pulse modifier or an interlock program is used.
Applied instructions
[ESUB]
OperandsDXDYDMDSTCDFDK
Function
X0
ESUB
S1
S2
D10
D20
D50
and action
(D11,D10)
(D21,D20)
(D51,D50)
The floating point value of S2 is subtracted from the floating point value of S1 and the result
stored in destination device D.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X1
K1234
ESUB
K1234
D100
D110
(D101,D100) (D111,D110)
The same device may be used as a source and as the destination. If this is the case then, on
continuous operation of the EADD instruction, the result of the previous operation will be used as
a new source value and a new result calculated. This will happen every program scan unless the
pulse modifier or an interlock program is used.
Applied instructions
[EMUL]
OperandsDXDYDMDSTCDFDK
Function
X0
EMUL
S1
S2
D10
D20
D50
and action
D11D10D21,D20(D51,D50)
The floating point value of S1 is multiplied with the floating point value point value of S2. The
result of the multiplication is stored at D as a floating point value.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X1
(K2346)
EMUL
K100
(D101,D100)
D100
D110
(111,D110)
Applied instructions
[EDIV]
OperandsDXDYDMDSTCDFDK
Function
X0
EDIV
S1
S2
D10
D20
D50
D11,D10D21,D20D51,D50
The floating point value of S1 is divided by the floating point value of S2. The result of the
division is stored in D as a floating point value. No remainer is calculated.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X1
(D101,D100)
EDIV
D100
K100
D110
(K2346) (D111,D110)
If S2 is zero then a divide by zero error occurs and the operation fails.
Applied instructions
[ESQR]
OperandsDXDYDMDSTCDFDK
Function
X0
ESOR
D10
D20
and action
(D11,D10) D21,D20
A square root is performed on the floating point value in S the result is stored in D.
If a constant K or H used as source data, the value is converted to floating point before the
addition operation.
X1
K1024D111D110
ESOR
K1024
D110
Applied instructions
[SIN]
OperandsDXDYDMDSTCDFDK
Function
X0
SIN
(D51,D50)
D50
D60
(D61,D60)SIN
D51
D50
RAD valueangle/180
Assign binary float point value
D61
D60
SIN value
Binary float point
Applied instructions
[COS]
OperandsDXDYDMDSTCDFDK
Function
X0
COS
D50
D60
and action
(D51,D50)RAD
(D61,D60)COS
RAD valueangle/180
S
D51
D50
D61
D60
COS value
Binary float point
Applied instructions
[TAN]
OperandsDXDYDMDSTCDFDK
Function
X0
TAN
(D51,D50)RAD
D50
D60
(D61,D60)TAN
D51
D50
RAD valueAngle/180
Assign binary float point value
D61
D60
TAN value
Binary float point
Applied instructions
Applied instructions
5-9Clock operation
Mnemonic
Function
TCMP
Time Compare
TZCP
TADD
Time Add
TSUB
Time Subtract
TRD
TWR
Applied instructions
[TCMP]
OperandsDXDYDMDSTCDFDK
The status of the destination devices is kept, even if the TCMP instruction is deactivated.
and
the time value in the 3 data devices specified by the head address
the 3 bit devices specified by the head address
S1
S2
S3
S
S
S
Hour
Minute
Second
Hour
1 Minute
2 Second
ON/OFF.
The valid range of Hour is0~23
The valid range of MInute is0~59
The valid range of Second is0~59
Applied instructions
[TZCP]
OperandsDXDYDMDSTCDFDK
Function
and action
X0
TCZP
time data
S1
S2
K10
K20
D0
M0
M0
D20
D21
D22
>
D0
D1
D2
M1
D20
D21
D22
D0
D1
D2
D30
D31
D32
ON
D0
D1
D2
>
D30
D31
D32
ON
M2
ON
The status of the destination devices is kept, even if the TZCP instruction is deactivated.
,
devices.
and
and
. The result is
: Assign the compare times lower limit with the format of Hour, Minute
and Second.
: Assign the compare times lower limit with the format of Hour, Minute
and Second.
: Assign the time data with the format of Hour, Minute and Second.
: According to the compare result, the 3 devices output ON/OFF.
The valid range of Hour is0~23
The valid range of Minute is0~59
The valid range of Second is0~59
Applied instructions
[TADD]
OperandsDXDYDMDSTCDFDK
Function
X0
TADD
S1
S2
D10
D20
D30
and action
(D10D11D12)D20D21D22D30D31D32
S1
D10 (Hour)
D11 (Minute)
S2
D20 (Hour)
D30 (Hour)
D21 (Minute)
D12 (Second)
D31 (Minute)
D22 (Second)
D32 (Second)
Each of S1, S2 and D specify the head address of 3 data devices to be used a time value. The time
value in S1 is added to the value in S2, the result is stored to D as a new time value.
If the addition of the two times results in a value greater than 24 hours, the value of the result is
the time remaining above 24 hours. When this happens the carry flag M8022 is set ON.
S1
18 (Hour)
10 (Minute)
30 (Second)
18 hour 10 min. 30 sec.
S2
10 (Hour)
4 (Hour)
20 (Minute)
5 (Second)
3 hour 20 min. 10 sec.
30 (Minute)
35 (Second)
4 hour 30 min. 35 sec.
Applied instructions
[TSUB]
OperandsDXDYDMDSTCDFDK
Function
X0
and action
TSUB
S1
S2
D10
D20
D30
(D10D11D12)D20D21D22D30D31D32
S1
S2
D10 (Hour)
D10 (Hour)
D11 (Minute)
D12 (Second)
D10 (Hour)
D11 (Minute)
D12 (Second)
D11 (Minute)
D12 (Second)
7 hour 0 min. 20 sec.
Each of S1, S2 and D specify the head address of 3 data devices to be used a time value. The time
value in S1 is subtracted from the time value in S2, the result is stored to D as a new time.
If the subtraction of the two times results in a value less than 00:00:00 hours, the value of the
result is the time remaining below 00:00:00 hours. When this happens the borrow flag M8021 is
set ON.
S1
S2
10 (Hour)
20 (Minute)
5 (Second)
10 hour 20 min. 5 sec.
18 (Hour)
_
10 (Minute)
4 (Hour)
=
30 (Second)
30 (Minute)
35 (Second)
When the result is 0 (0 hour 0 min. 0 sec.), zero flag set ON.
Applied instructions
[TRD]
OperandsDXDYDMDSTCDFDK
Function
X0
TRD
D0
Device
Meaning
Values
Device Meaning
1~99
D0
Year
D8017
Year
Month
1~12
Month
D8016
Date
1~31
D1
D2
D8015
0~23
D3
D8014
Hours
Minutes
Date
Hours
0~59
D4
Minutes
D8013
Seconds
0~59
D5
Seconds
D8019
Day
0 (Sat.)~6 (Sun.)
D6
Day
D8018
Applied instructions
[TWR]
OperandsDXDYDMDSTCDFDK
Function
X0
TWR
D10
Write the set clock data into PLCs real time clock.
In order to wirte real time clock, the 7 data devices specified with the head address S should be
set.
Device
Meaning
Values
Device Meaning
1~99
D8018 Year
D1
Year
Month
1~12
D2
Date
1~31
D3
0~23
D4
Hours
Minutes
D8017 Month
D8016 Date
D8015 Hours
D5
Seconds
0~59
D6
Day
0 (Sat.)~6 (Sun.)
D0
0~59
D8014 Minutes
D8013 Seconds
D8019
Day
This instruction removes the need to use M8015 during real time clock setting. When setting the time it
is a good idea to set the source data to a time a number of minutes ahead and then drive the instruction
when the real time reaches this value.
MEMO
135
6-2Pulse output
6-3Modbus instructions
6-6Frequency testing
6-7Precise time
6-8Interrupt function
136
Internal high speed counters No. is in the following table. Theyre allocated
in the input X000~X005 according to the counters No. that cannot be used
repeatedly.
When X000~X005 dont used as high speed count input, they could be used
as normal input points.
[U]count pulse input
[D]count direction judgmentOFF is +ON is -
[A]A phase input
[B]B phase input
High speed
counters
N
C600 C602 C604 C606 C608 C610 C612 C614 C616 C618 C620 C622 C624 C626 C628 C630 C632 C634
X000 U
X001
X002
X003
X004
X005
X006
X007
Function
High speed counter executes according to the format in the upward table and
to the special inputs. Go on high speed action according to the interrupt
signal. Its independent with the PLCs scan cycle.
This type of counters could be divided into the following three types:
Item
Single phase
positive count
input
Count
directions
assign method
Only positive
count is ok
Action
M0
M1
M2
M3
C600
K5
RST
C600
C604
D0(D1)
RST
C604
M4
M5
M6
M7
C620
D0(D1)
RST
C620
C622
K10
RST
C622
phase
input
M8
C630
M9
C630
K10
Y002
RST
C630
C632
M11
C632
D0(D1)
Y004
RST
C632
6-2Pulse output
OperandsYDXDYDMDSTCDK
Function
and Action
M0
M8190
S1
S2
PLSY
K30
D1
Y0
RST
M0
The instruction with the assigned frequency to generate the assigned pulsesupport 32 bits
instruction [DPLSY].
S1: assign the frequency. The range: 0~400KHz
S2: assign the generated pulse quantity.
The allowed setting range : 16 bits instruction0~32,767
32 bits instruction0~2,147,483,647
when the pulse setting number is 0, dont send pulse; assign the value as H 7FFFFFFF, there is no
limitation with the generated pulse number.
D: assign output pulses Y number, can only output at Y000 or Y001
When M0 is ON, with this PLSY instruction, Y0 output pulses with the output frequency 30Hz, the
pulse number is assigned by D1, if set pulse number as H 7FFFFFFF, it means send infinity pulses ,
at this time coil M8190 set ON. When the output pulse number reaches the set value, stop outputting
the pulse, at this time, coil M8190 set OFF, reset M0.
OperandsYDXDYDMDSTCDK
M8170
S1
S2
S3
PLSR
K3000
D300
K300
Y0
RST
M0
The instruction with the assigned frequency to generate a certain quantity pulse
support 32 bit instruction [DPLSR].
S1: highest frequency. The range is0~400KHz
S2: total output pulse number.
Allowed setting range16 bits instruction0~32,767
32 bits instruction0~2,147,483,647
If set the pulse number as 0, dont send pulse; if assign this value as H 7FFFFFFF,
there will be no limitation for the generate pulse number.
S3: speedup/speed-down time. The set rangebelow 5000ms
D: assign Y number of output pulse, could only be output at Y000 or Y001
When M0 is ON, PLSR starts pulse output, send assigned pulse number according to the
assigned speedup/speed-down slopehighest frequency. To output with the constant
speed, set the speedup/speed-down time as 0. If set the pulse number as H 7FFFFFFF,
infinity pulse number will be sold out, at this time coil M8170 set ON.
When the output pulse number reaches the set value, stop pulse outputting, at this time
coil M8170 set OFF, reset M000. See the following chart
If pulse output M000 is OFF, pulse output decreases to be 0 according to the assigned
slope. Stop pulse outputting, coil M8170 set OFF.
M8170
S1
S2
PLSR
D0
D100
Y3
RST
M0
The instruction which generates a certain quantity pulse with the assigned frequency.
S1: an area with Dn or FDn as the start address. In the above example, D0 set the highest
frequency of segment 1 pulse, D1 set the highest frequency of segment 1 pulse, D2 set the highest
frequency of segment 2 pulse, D3 set the highest frequency of segment 2 pulse, if the set
value of Dn, Dn+1 are both 0, it means segment finish.
S2: speedup/speed-down time. Here the time means the speed time from start to the first
segments speedup time, meantime, all segments frequency and time slope are defined. So the
following speedup/speed-down speed follows them. The set range is: Below 5000ms.
D: assign the Y number of output pulse, can only output at Y000 or Y001
Support double words output DPLSR, here D0D1 set the highest frequency of segment 1D2
D3 set the pulse number of segment 1, D4D5 set the highest frequency of segment 2D6D7 set
the pulse number of segment 2
M8170
S1
S2
D1
D2
PLSR
D0
D100
Y0
Y3
RST
M0
In the process of speedup/speed-down, each steps time is 5ms, this time is fixed.
The max. step is 15K. (the increase/decrease frequency of each step). If the value exceeds 15K,
count as 15Kthe minimum step frequency is 10Hz, if lower than 10Hz, calculate as 10Hz.
When carrying on pulse output, please note each segments pulse number shouldnt lower than
10, if the set value is less than 10, sent as 10.
2Frequency jump in segment pulse output
In the process of segment pulse output, if the current pulse number has sent out but still
havent reached the current segments max. frequency, then in the process from the current
segment to the next pulse output, there will be pulse frequency jump. See the following chart.
To avoid frequency jump, please note the speedup/speed-down time set value not to small.
OperandsYDXDYDMDSTCDK
Function
and Action
M0
M1
PLSY
PLSNEXT
S1
S2
D0
D100
Y0
Y0
In the condition of pulse output reaches the highest current value, then
output stable under this frequency, if M1turns from OFF to ON, enter the
next pulse output with the speedup/speed-down time
Please note, in the process of pulses speedup/speed-download, executing
this instruction is invalid.
OperandsYDXDYDMDSTCDK
Function
and Action
M0
PLSF
D0
Y0
Example
FRQM
K20
D0
PLSF
D0
Y0
K1
X003
Function
and action
COLR
S1
S2
S3
D1
D2
K1
K500
K3
M1
K2
The command read the assigned slave address assigned coil to the assigned
coil.
S1 Communication slave address
S2 Coils start ID
S3 Coils number
D1 Receive coils start address
D2 Serial ports ID. Range:1~3
INPR
S1
S2
S3
D1
D2
K1
K500
K3
M1
K2
Read the assigned slave address assigned input coil to the models assigned coil.
S1 Communication slave address ID
S2 Coils start ID
S3 Coils number
D1 Receive coils start address
D2 Serial ports ID. Range: 1~3
COLW
D1
D2
S1
S2
K1
K500
M1
K2
and action
Write the models assigned coil to the assigned slave address assigned coil
D1 Communication slave address ID
D2 Coils start ID
S1 Receive coils start address
S2 Serial ports ID. Range: 1~3
MCLW
D1
D2
D3
S1
S2
K1
K500
K3
M1
K2
Write the models assigned multi-coil to the assigned slave address assigned coil
D1 Communication slave address ID
D2 Coils start ID
D3 Coils number
S1 Receive coils start coil address
S2 Serial ports ID. Range: 1~3
REGR
S1
S2
S3
D1
D2
K1
K500
K3
D1
K2
and action
Read the models assigned register to the assigned slave address assigned register
S1 Communication slave address ID
S2 Registers start ID
S3 Registers number
D1 Receive registers start address
D2 Serial ports ID. Range: 1~3
INRR
S1
S2
S3
D1
D2
K1
K500
K3
D1
K2
Read the models assigned input register to the assigned slave address assigned register
S1 Communication slave address ID
S2 Registers start ID
S3 Registers number
D1 Receive registers start ID
D2 Serial ports ID. Range: 1~3
REGW
D1
D2
S1
S2
K1
K500
D1
K2
and action
Read the models assigned register to the assigned slave address assigned register.
D1 Communications slave address ID
D2 Registers start ID
S1 Receive registers start ID
S2 Serial ports ID. Range: 1~3
MRGW
D1
D2
D3
S1
S2
K1
K500
K3
D1
K2
Read the models assigned input register to the assigned slave address assigned register.
S1 Communication slave address ID
S2 Registers start ID
S3 Registers number
D1 Receive registers start address
D2 Serial ports ID. Range: 1~3
Description of
COM ports
Free
Communication
Free format communication transfer data in the format of data block, each
block transfer 128 bytes at most! At the same time, each block could set a
start symbol and an end symbol, or you neednt set.
Data format
Data bit7bits8bits
Parity bitodd checkeven checkno check
Stop bit1 bit2 bit
Start symbol1 bit
End symbol1 bit
The user could set a start/end symbol, after setting the start/end symbol,
when PLC sending data, start/end symbol will automatic be added. When
receiving data, automatic delete the start/end symbol.
Communication format8 bits16 bits
When choosing 8 bits format to communicate, the registers high byte
is invalid in the communication process, PLC only use registers low bytes
to send and receive data.
Format
1sending data
M0
SEND
S1
S2
D10
D100
K1
2receiving data
M1
RCV
S1
S2
D20
D200
K1
Parameter
Setting
for communication parameters setting, please refer to the following table
COM1
Number
Function
Description
FD8210
Communication mode
FD8211
Communication format
FD8212
FD8213
FD8214
Start symbol
FD8215
End symbol
FD8216
COM2
FD8220
Communication mode
FD8221
Communication format
FD8222
FD8223
FD8224
Start symbol
FD8225
End symbol
FD8226
FD8210COM1/FD8220COM2
15
14
13
12
11
10
0300bps
1600bps
21200 bps
32400 bps
44800 bps
59600 bps
619.2K bps
738.4K bps
857.6K bps
9115.2K bps
0no check
1odd
2even
02 stop bits
21 stop bit
08bits data
17bits data
FD8216COM1/FD8226COM2
15
14
13
12
11
10
keep
08 bits
116 bits
0no start
1with start
0no end
1with end
Function
X0
PWM
S1
S2
K100
D10
Y0
and action
S1
S2
T0
6-6Frequency testing
X000
Function
FRQM
S1
S2
S3
K20
D100
K1
X003
and Action
(S1) pulse cycle number. I.e. In one scan cycle, collect tested input pulse cycle number.
(S2) testing result. OperandsDCDTD
Frequency choosing. Choose rangeK1 or K2
When frequency is K1, frequency testing range>= 9Hz, precise range9~18KHz.
When frequency is K2, frequency testing range>=300Hzprecise range300~400KHz
Pulse input port X number.
When testing the frequency, choose the frequency as K2, the frequency testing precise is higher
than K1.
When X000 is ON, each scan cycle of FRQM test 20 pulse cycle from X003, calculate the
frequency value and store into D100, repeatedly testing. If the tested value is smaller than the
tested range, return the tested value as 0.
Table of X number correspond with frequency testing pulse output
Model
X number
EC3- 14 model
X2X3
EC3-24EC3-32 model
X1X11X12
EC3-48EC3-60 model
X4X5
EC3-18R model
X1X6X7
6-7Precise time
Function
and Action
X0
STR
T600
D1
D2
T600
K100
Y0
M0
RST
T600
D 1
D2
X0
T600
Timers number
Interrupt tag
T600
I3001
T602
I3002
T604
I3003
T606
I3004
T608
I3005
T610
I3006
T612
I3007
T614
I3008
T616
I3004
T618
I3010
100ms
M0
100ms
6-8Interrupt function
6-8-1.Time interrupt
Function
and action
In the condition of the main program has a long executing cycle, if you want to
operate special program, or in the sequencial control scan, a special program should
be executed at every certain interval, time interrupt function should be used. It could
be not effected by PLCs scan cycle, execute interrupt subroutine every Nms interval.
X0
Y0
FEND
I4010
M8000
INC
D0
IRET
Time interrupt subroutine is similar with other interrupt subroutines, they must be written
behind the main program, start with the instruction I40xx, end with IRET.
In I40xx,xxmeans interrupt time, the unit is ms. E.g.I4010 means every 10ms interval,
execute once interrupt.
Totally there are 10 routes time interruption, from I40xx~I49xx
158
E.gThe following is the program which realize continuous sending high-low pulse
The parameters
Parameters of step motorstep square angle =1.8 degree/step, fractionlet =40the pulse number of a
round is 8000
High frequency pulsemax frequency is 100KHzthe total pulse number is 240003 rounds
Low frequency pulseMax frequency 10KHztotal pulse number is 80001 round
Ladder program
Program description
When PLC changes from STOP to RUN, M8002 coil gets through a scan cycle, set
high frequency pulse parameters into D200D210, set speedup/speed-down time into D220,
set M0, the motor start to speedup with high frequency and work 3 rounds, set coil M8170 at
the same time; the motor runs 3 rounds, the speed-down till stop, coil M8170 reset. Here reset
M0, set M1, reverse M10 status, set low frequency parameters into D200D210. the counter
starts to delay with 2 seconds, when reach this 2 seconds, M1 is reset, M0 is set again, the
motor starts to run 1 round with low frequency. After finish this 1 round, the motor starts to
run with high frequency again! In this format, the motor runs with high frequency and low
frequency.
E.g.The following is the communication program of one master station and 4 slave stations
Each parameters
The master station number is 1, slave stations numbers are 2345. This example, we
use No.2 communication port:
Ladder program
Program description
When PLC changes from STOP to RUN, M8002 coil gets through a scan cycle. S0 flow
open, write master machines D10D14 into No.2 slave machines D10D14. after
finish communication, set M8138, at the same time write slave machines D15D19 into
master machines D15D19set communication finish flag. Realize write and read to a
slave station. At this time flow S3 will judge with the slave station. If the station number is
less than 5station number add 1offset add 10or else station number starts from number 2
station again.
Format of sending data: 81H 81H 43H 00H c8H 00H 0cH 01H (display of the current temperature)
Setting of communication parameters: baud rate: 96008 bits data bit, 2 bits stop bit, no check.
Set FD8220=255FD8221=5
Note ( both the host machine and the slave machine should use the version higher than V2.4)
Program
MEMO
168
Appendix
8Appendix
This chapter gives some auxiliary information of EC series PLC.
169
Appendix
ID
Function
Description
M8000
Working normally
ON coil
PLC be ON when
running
M8001
Working normally
OFF coil
M8002
M8003
M8005
PC statusD
170
ID
Function
Description
D8002
Registers capacity
D8005
Battery voltage
0.1V unit
Appendix
Clock M
ID
Function
Description
M8010
M8011
M8012
M8013
M8014
M8018
Bits of year
Defaulted is OFFOFF2ON4
Flag M
ID
Function
Description
M8020
Zero
M8021
Borrow
M8022
Carry
M8023
M8026
RAMP mode
M8029
171
Appendix
Clock D
ID
Function
Description
D8010
Unit: 0.1ms
D8011
Unit: 0.1ms
D8012
Unit: 0.1ms
D8013
Secondclock
D8014
Minuteclock
D8015
Hourclock
D8016
Dateclock
D8017
Monthclock
D8018
Yearclock
D8019
Weekclock
FlagD
ID
D8021
D8022
D8023
Function
Description
Model
Low byte
Serial number
High byte
Low byte
High byte
Low byte
High byte
D8024
D8025
Models information
D8026
Max 5 ASC and a\0
D8027
D8028
D8029
172
Appendix
PC modeM
ID
Function
Description
M8030
PLC initializing
M8031
M8032
M8033
M8034
M8038
Parameter setting
PC modeD
ID
Function
Description
D8030
D8031
D8032
D8033
D8034
D8035
D8036
D8037
D8038
173
Appendix
Step ladderM
ID
Function
Description
M8041
M8045
M8046
InterruptM
ID
M8050
I00
Function
Description
M8051
I10
M8052
I20
M8053
I30
M8054
I40
M8055
I50
M8056
I60
M8057
I70
M8058
174
I80
M8059
Appendix
Error checkM
ID
Function
Description
M8067
Operation error
M8070
Scan overtime
M8071
No user program
M8072
Error checkD
ID
Function
Description
D8067
Error of divide
D8068
D8069
D8070
D8074
ID of Excursion register D
Unit: 1ms
D8097
D8098
175
Appendix
CommunicationM
ID
Function
Description
M8120
COM1
M8122
M8124
M8125
M8127
M8128
M8129
the
the
the
M8130
M8132
M8134
M8135
M8137
M8138
M8139
COM2
M8140
M8142
M8144
M8145
M8147
M8148
M8149
COM3
176
Appendix
CommunicationD
ID
Function
Description
D8120
D8121
D8123
COM1
D8126
D8127
7: hardware error
10: no start sign
8: CRC check error 11: no end sign
9: slave address ID error
D8128
D8129
D8130
D8131
D8133
D8136
COM2
D8137
7: hardware error
10: no start sign
8: CRC check error 11: no end sign
9: slave address ID error
D8138
D8139
D8140
D8141
D8143
D8146
COM3
D8147
7: hardware error
10: no start sign
8: CRC check error 11: no end sign
9: slave address ID error
D8148
D8149
177
Appendix
ID
Counter
ID
Function
Description
M8150
C600
M8151
C602
M8152
C604
M8153
C606
M8154
C608
M8155
C610
M8156
C612
M8157
C614
M8158
C616
M8159
C618
M8160
C620
M8161
C622
M8162
C624
M8163
C626
M8164
C628
M8165
C630
M8166
C632
M8167
C634
M8168
C636
M8169
C638
178
Appendix
Pulse outputM
High
ID
frequency
Function
Description
pulse ID
M8170
PULSE_1
Be 1 at pulse sending
M8171
32 bits pulse
overflow flag
M8172
Direction flag
Be 1 at pulse sending
M8173
PULSE_2
sending
M8174
32 bits pulse
overflow flag
M8175
Direction flag
Be 1 at pulse sending
M8176
PULSE_3
sending
Be 1 when overflow
M8177
32 bits pulse
overflow flag
M8178
Direction flag
Be 1 at pulse sending
M8179
PULSE_4
sending
Be 1 when overflow
M8180
32 bits pulse
overflow flag
M8181
Direction flag
Be 1 at pulse sending
M8182
PULSE_5
M8183
32 bits pulse
overflow flag
M8184
Direction flag
sending
Be 1 when overflow
sending
Be 1 when overflow
Be 1 when overflow
1 is positive direction, the correspond
direction port is ON
Positive/negative count
ID
M8238
Counters ID
C300
Function
Description
Control of positive/negative
count
179
Appendix
ID
Counters ID
Function
D8150
C600
D8151
C602
D8152
C604
D8153
C606
D8154
C608
D8155
C610
D8156
C612
D8157
C614
D8158
C616
D8159
C618
D8160
C620
D8161
C622
D8162
C624
D8163
C626
D8164
C628
D8165
C630
D8166
C632
D8167
C634
D8168
C636
D8169
C638
180
Description
Appendix
Pulse outputD
181
Appendix
Expansions informationD
High
ID
frequency
Function
pulse ID
D8170
PULSE_1
D8171
D8172
D8173
PULSE_2
D8174
D8175
D8176
PULSE_3
D8177
D8178
D8179
PULSE_4
D8180
D8181
D8182
PULSE_5
D8183
D8184
D8190
PULSE_1
D8191
D8192
D8193
D8194
PULSE_3
D8199
182
PULSE_4
D8197
D8198
D8195
D8196
PULSE_5
Description
Appendix
Unit
Expansion
1#
Expansion
2#
Expansion
3#
Expansion
4#
Expansion
5#
Expansion
6#
Expansion
7#
BD
Expansion
IDas register
Max
I/O//channels
X100~X137
32 points
Y100~Y137
32 points
Input analog ID
ID100~ID131
16 channels
Output analog QD
QD100~QD131
16 channels
D8250~D8259
X200~X237
32 points
Y200~Y237
32 points
Input analog ID
ID200~ID231
16 channels
Output analog QD
QD200~QD231
16 channels
D8260~D8269
X300~X337
32 points
Y300~Y337
32 points
Input analog ID
ID300~ID331
16 channels
Output analog QD
QD300~QD331
16 channels
D8270~D8279
X400~X437
32 points
Y400~Y437
32 points
Input analog ID
ID400~ID431
16 channels
Output analog QD
QD400~QD431
16 channels
D8280~D8289
X500~X537
32 points
Y500~Y537
32 points
Input analog ID
ID500~ID531
16 channels
Output analog QD
QD500~QD531
16 channels
D8290~D8299
X600~X637
32 points
Y600~Y637
32 points
Input analog ID
ID600~ID631
16 channels
Output analog QD
QD600~QD631
16 channels
D8300~D8309
X700~X737
32 points
Y700~Y737
32 points
Input analog ID
ID700~ID731
16 channels
Output analog QD
QD700~QD731
16 channels
D8310~D8319
X1000~X1037
32 points
Y1000~Y1037
32 points
Input analog ID
ID1000~ID1031
16 channels
Output analog QD
QD1000~QD1031
16 channels
D8320~D8329
Type
Appendix
1 I filter
Number
Function
FD8000
X0~X17
input filter time value
FD8002
X20~X37
input filter time value
FD8003
X40~X57
input filter time value
Description
FD8004
FD8005
FD8006
FD8007
FD8008
FD8009
2 I mapping
Number
Function
Description
FD8010
FD8011
FD8012
FD8073
3 O mapped
Number
Function
Description
FD8074
FD8075
FD8076
FD8137
4 I property
Number
Function
Description
X00 property
0: positive logic
others: negative logic
FD8138
FD8139
X01 property
FD8140
X02 property
FD8201
X77 property
184
Number
Function
FD8202
Description
Appendix
store area
FD8203
FD8204
FD8205
FD8206
6 Communication
COM1
COM2
COM3
Number
Function
Description
FD8210
Communicate mode
FD8211
Communicate format
FD8212
Unit: ms
FD8213
FD8214
Start ASC
FD8215
End ASC
FD8216
FD8220
Communicate mode
FD8221
Communicate format
FD8222
FD8223
FD8224
Start ASC
Unit: ms
FD8225
End ASC
FD8226
FD8230
Communicate mode
FD8231
Communicate format
FD8232
185
Appendix
FD8233
FD8234
Start ASC
Unit: ms
FD8235
End ASC
FD8236
Remark
Some of instructions stated in this manual are still in developing, please note!
1Applied instructions
Data
Shift
Data
convert
Clock
operation
Floating
operation
186
SFTL
SFTR
WSFL
WSFR
FLT
FLTD
INT
BIN
BCD
TCMP
TZCP
TADD
TSUB
ECMP
Floating compare
EZCP
EADD
Addition of floating
ESUB
Subtracting of floating
EMUL
Multiplication of floating
EDIV
Division of floating
ESQR
Extraction of floating
SIN
COS
TAN
Appendix
2special functions
1 Alterable frequency pulse output [PLSF]
2 Frequency testing [FRQM]
187