Delta Ia PLC DVP Es2 Ex2 Ss2 Sa2 Sx2 Se TP PM en 20170426
Delta Ia PLC DVP Es2 Ex2 Ss2 Sa2 Sx2 Se TP PM en 20170426
Delta Ia PLC DVP Es2 Ex2 Ss2 Sa2 Sx2 Se TP PM en 20170426
Asia
Delta Electronics (Jiangsu) Ltd.
Wujiang Plant 3
1688 Jiangxing East Road,
Wujiang Economic Development Zone
Wujiang City, Jiang Su Province, P.R.C. 215200
TEL: 86-512-6340-3008 / FAX: 86-769-6340-7290
DVP-ES2/EX2/SS2/
TEL: 82-2-515-5303 / FAX: 82-2-515-5302
SA2/SX2/SE&TP
4 Kaki Bukit Ave 1, #05-05, Singapore 417939
TEL: 65-6747-5155 / FAX: 65-6744-9228
Europe
Deltronics (The Netherlands) B.V.
Eindhoven Office
De Witbogt 20, 5652 AG Eindhoven, The Netherlands
TEL : +31-40-2592850 / FAX : +31-40-2592851
VOIP : 170
DVP-0139720-09
*We reserve the right to change the information in this manual without prior notice.
2017-04-26
www.deltaww.com
DVP-ES2/EX2/SS2/SA2/SX2/SE&TP
Operation Manual
Programming
Revision History
I ssu e D e sc ri pt i o n of Ch a n ge s Date
F i r st
T h e f i r st edi t i o n i s i ssu e d. 2 0 1 0/ 0 2/ 26
v er si on
S e co n d
T h e sec o n d e di t i o n i s i ssu e d. 2 0 11/ 0 3/ 0 3
v er si on
1. C h a pt er 2. 8 M R el ay: Ad d M 1 0 37 , M 111 9,
M 118 2, M 13 0 8, M 1 3 46 , a n d M 1 3 56 , an d u pda t e
t h e de sc ri pt i o n of t h e f un ct i on s of
M 1 0 55~ M 1 0 5 7a n d M 118 3.
2. C h a pt er 2. 1 3 Sp eci al D a t a R e gi st er : A d d D 1 03 7,
D 1 3 1 2, D1 3 5 4, an d D 1 90 0~ D1 9 3 1, an d m o di f y
t h e at t ri bu t e s of t h e l a t c h ed f u nct i o n s of D1 06 2,
D 1114 , D 1115, a n d D111 8.
3. C h a pt er 2. 1 6 A p pl i ca t i o n s of Spe ci al M Rel ay s
a n d D R egi st er s: U p d at e t he d e scri pt i on of t h e
f u nct i o n s of RT C s; a d d M 1 0 37, D 1 0 37 E n ab l e
T hi r d
S PD f un ct i on , M 111 9 E n abl e 2- sp e e d o ut p ut 2 0 11/ 0 9/ 2 9
v er si on
f u nct i o n of D D RV I i n st r u ct i o n , M 1 3 08 , D 1 31 2
O ut p ut spe ci f i ed p ul se s o r se ek Z p h a se
si g n al wh e n z er o poi nt i s a c hi ev ed, a n d M13 4 6
O ut p ut cl e ar si g n al s wh en Z RN i s com pl et ed;
E a sy P L C Li n k i s c ha n g ed t o P LC Li nk, a n d t h e
d e sc ri p t i o n i s a d de d.
4. C h a pt er 3. 1 Ba si c I n st r uct i o n s ( wi t h o ut A PI
n um be r s) a n d Ch a pt er 3. 2 Ex pl a n at i on s t o Ba si c
I n st r uct i o n s: A d d NP a n d P N i n st ru ct i on s, a nd
a d d C h apt e r 3. 7 N um e ri c al Li st of I n st r uct i on s
(i n al ph a b et i c or d er )
I ssu e D e sc ri pt i o n of Ch a n ge s Date
5. C h a pt er 3. 6 N um eri c al Li st of I n st ru ct i o n s an d
C h a pt er 3. 8 D et ai l e d I n st r uc t i o n Ex pl a n at i o n:
I nc r ea se ex pl a n at i o n s of D SPA i n st r uct i o n, an d
a d d f l o at i ng - poi nt co n t act t y pe c om pari so n
i n st ru ct i on s F L D= , F L D> , F L D< , F L D< > , F LD< = ,
F LD> = , FAN D= , FA N D> , FA ND< , FAN D< > ,
FA ND< = , FAN D> = , F O R= , F O R> , F O R< , F O R< > ,
F O R< = , F O R> = ; a d d t h e su p pl em e n ta ry
d e sc ri p t i o n of PL SR i n st r uct i o n an d t h e
d e sc ri p t i o n of K11~ K 1 9 i n DT M i n st r u ct i o n
m o d e; up d at e t h e de sc ri pt i o n of API 1 6 6
i n st ru ct i on.
1 . S E i s a d de d i n t h e t i t l e of t he m an u al .
2 . C h a pt er 2. 16 : T h e d ef aul t v al u e i n D 1 0 62 i s K 1 0.
3 . A PI 1 5 i n C ha pt e r 3: T h e co nt e nt s a b ou t S< D ar e
d el et e d i n p r og r am ex am pl e 3 .
F o urt h 4 . A PI 1 48 a n d API 1 4 9 ar e a dd e d i n Ch a pt er 3.
2 0 1 2/ 0 7/ 01
v er si on 5 . T h e i nf o rm at i o n r el at e d t o DVP -S E i s a dd e d.
6 . T h e i nf o rm at i o n r el at e d t o DVP 3 2E S- C i s a dd e d.
7 . T h e d e scri pt i on s of t h e m o d el s a r e a d d ed i n t he
c o nt e nt s.
8 . A p p en di x A i s ad d e d.
1 . A PI 11 3 i s ad d e d.
Fifth
2 . A PI 15 0 i s u p d at ed . 2 0 1 2/ 0 9/ 01
v er si on
3 . C h a pt er 7 i s up d at ed .
1 . M 114 8, M 15 8 0, M 1 5 81 , M 1 58 4, M1 5 8 5, M 118 2 ,
a n d M11 8 3 ar e ad d e d t o Ch a pt er 2.
2 . C h a pt er 3 i s up d at ed . API 5 3, A PI 15 6, API 15 9 ,
A PI 69 , API 8 8, A PI 1 4 3, A PI 15 0, API 1 55, API 2 5 8,
a n d A PI 2 96 -3 1 3 ar e a d de d.
Si x t h
3 . T h e d e scri pt i o n of API 1 7 8 i s u p da t e d. 2 0 1 3/ 0 2/ 20
v er si on
4 . T h e d e scri pt i o n of t he i n p ut / o ut p ut m ap pi ng
a r e a s f o r D VP -ES 2 -C a s a sl av e st at i o n i s ad d e d
t o se ct i o n 7. 1. 2.
5 . C 2 3 2, C 24 9, a n d C2 5 0 ar e d el et e d f rom t he
d e sc ri p t i o n of t h e S E m em or y M a p.
I ssu e D e sc ri pt i o n of Ch a n ge s Date
6 . A p p en di x B i s a d de d.
7 . A p p en di x C i s ad d e d.
1 . T h e t i m er i nt er r up t s I 8 0 5~ I 89 9 a re a d de d t o
C h a pt er 2. T h e sp e ci al a ux i l i ary r el a y s
M 1 3 57~ M 1 3 5 9, M 1 59 0, M1 5 9 8, a nd M1 5 9 9 ar e
a d d e d t o t h e t a bl e of sp eci al a ux i l i ary rel ay s. T he
d e sc ri p t i o n s of D 1 02 7 a n d D 9 9 98 i n t h e ta bl e of
sp e ci al da t a r e gi st er s ar e u pd at e d.
D 1 0 5 6~ D 1 0 59, D 115 0~ D11 5 3, D1 2 4 6~ D 1 24 7,
a n d D 99 9 9 a r e a d d ed t o t h e t a bl e of sp eci al d a ta
r e gi st e r s. T h e d ef i ni t i on s of t he pi n s i n CO M1 are
a d d e d t o t h e de sc ri pt i o n of M1 03 5. T he n e w
sp e ci al aux i l i a ry rel ay s i n t he t a bl e of spe ci a l
d a t a r e gi st er s a n d t h e n e w sp eci al d a ta r egi st e r s
i n t he t a bl e of spe ci al d at a r egi st e r s a re
S ev ent h d e sc ri b e d i n sec t i o n 2. 16 .
2 0 1 4/ 0 7/ 04
v er si on 2 . A PI 11 4, A PI 11 5, API 1 45, a n d AP I 2 9 5 ar e a dd e d
t o Ch a pt er 3. T he d e scri pt i on s of API 1 7, API 2 2 ,
A PI 23 , API 5 9, A PI 7 8, API 8 0, AP I 8 1, A PI 83 ,
A PI 10 1~ A PI 10 6, API 112 -AP I 11 3, A PI 1 5 0,
A PI 16 6, API 1 79, a n d AP I 1 9 7 ar e u pd at e d.
3 . T h e i nf orm at i o n a b ou t M1 0 40 i s a dd e d t o Cha p t e r
5.
4 . T h e d e scri pt i o n of t he e rr or c o de C 4 50 i s add e d
t o Ch a pt er 6.
5 . I n A p pe n di x C, t h e i nf orm at i o n ab o ut T P0 4 P
se ri e s t ex t pa n el s i s c h an g e d t o t he i nf o rm at i on
a b o ut T P se ri e s t ex t pan el s.
6 . A p p en di x D i s ad d e d. I t i nt ro d uc e s t h e c urr en t
c o n sum pt i o n of sl i m P LC s/ ex t e n si on m od ul es.
1 . I n se ct i o n B. 1, t h e n um b er of RT U m od ul e s o n t o
wh i ch a D VP- SE se ri e s P L C c a n b e m a pp e d i s
Ei g ht h u p d at e d.
2 0 1 4/ 0 8/ 29
v er si on 2 . I n se ct i o n B. 2. 2 , t he d e scri pt i o n s of
C R # 2 0~ C R #8 6 ar e u p da t e d.
3 . I n se ct i o n B. 2. 3 , t he d e scri pt i o n s of
I ssu e D e sc ri pt i o n of Ch a n ge s Date
C R # 1 7~ C R #2 4 ar e u p da t e d, t h e d e scri pt i o n of
C R # 2 7 i s a dd e d, a nd t he d e scri pt i on s of
C R # 8 7~ C R 10 3 ar e u p da t e d.
4 . I n se ct i o n B. 2. 4 , t he d e scri pt i o n s of CR # 0 an d
C R # 2 0~ C R #2 6 ar e u p da t e d.
5 . S e ct i o n B. 6 i s a dd e d.
1 . C h a pt er 2: a d d Et h er n et d e scri pt i o n s i n se ct i on
2 . 1, up d at e M 111 9, M 13 3 4, M 1 3 38 ,
M 1 7 00~ M 1 7 3 1 i n se ct i on 2 . 8, u p d at ed
so f t wa r e/ h a rd wa r e hi gh sp e e d c o u nt er
d e sc ri p t i o n s i n se ct i on 2. 1 2, a dd D 1 0 21
d e sc ri p t i o n s i n se ct i on 2. 1 3, a dd i nt e rr up t
d e sc ri p t i o n s i n se ct i on 2. 1 5, a dd D 1 0 21, M 13 3 4,
M 1 3 35 a n d up d at e M 111 9 a nd P LC l i nk
d e sc ri p t i o n s i n se ct i on 2. 1 6.
2 . C h a pt er 3: u p d at e i n st r uc t i o n l i st . U p d at e
A PI 11 3, A PI 15 , API 1 7, A PI 51, API 5 9, AP I 6 8,
A PI 76 , API 8 0, A PI 1 2 3, A PI 15 0, API 1 58, API 1 5 9,
N i nt h A PI 20 6, a n d ad d n e w i n st r uc t i o n d e sc ri p t i o ns
2 0 1 7/ 0 4/ 26
v er si on A PI 33 7.
3 . C h a pt er 4: u p d at e M od b u s a d dr e ss f or SE se ri e s
i n sect i o n 4. 4.
4 . C h a pt er 6: d el et e e rr o r c o de s C4 3 0, C 44 1, an d
C 4 4 2. A dd n e w er r or c od e s C4 3 0, C 4 37 an d C 4 3 8
i n sect i o n 6. 2.
5 . A p p en di x A: ad d d e scri pt i o n s of t h e U SB
i n stal l at i on i n W i nd o ws 1 0.
6 . A p p en di x B: a dd d e scri pt i o n s of ES 2-E seri es.
7 . A p p en di x C: u p d at e d e scri pt i on s of pr o gr am
c a paci t y f or T P seri e s.
8 . A p p en di x D: a d d de sc ri pt i o n s f o r
2 8 SS 2/ 2 8SA 2/ 2 6S E.
DVP-ES2/EX2/SS2/SA2/SX2/SE&TP
Operation Manual
Programming
Contents
1 PL C Conc epts
1.1 PLC Scan Method .....................................................................................1-2
1.2 Current Flow ..............................................................................................1-3
1.3 NO Contact, NC Contact ...........................................................................1-3
1.4 PLC Registers and Relays ........................................................................1-3
1.5 Ladder Logic Symbols ...............................................................................1-3
1.5.1 Creating a PLC Ladder Program ........................................................1-5
1.5.2 LD / LDI (Load NO contact / Load NC contact) ..................................1-6
1.5.3 LDP / LDF (Load Rising edge trigger/ Load Falling edge trigger) .......1-6
1.5.4 AND / ANI (Connect NO contact in series / Connect NC contact in
series) ................................................................................................1-6
1.5.5 ANDP / ANDF (Connect Rising edge in series/ Connect Falling edge in
series) ................................................................................................1-6
1.5.6 OR / ORI (Connect NO contact in parallel / Connect NC contact in
parallel) ..............................................................................................1-6
1.5.7 ORP / ORF (Connect Rising edge in parallel/ Connect Falling edge in
parallel) ..............................................................................................1-6
1.5.8 ANB (Connect block in series) ...........................................................1-6
1.5.9 ORB (Connect block in parallel) .........................................................1-7
1.5.10 MPS / MRD / MPP (Branch instructions) ............................................1-7
1.5.11 STL (Step Ladder Programming)........................................................1-7
1.5.12 RET (Return) ......................................................................................1-8
1.6 Conversion between Ladder Diagram and Instruction List Mode ..............1-9
1.7 Fuzzy Syntax ...........................................................................................1-10
1.8 Correcting Ladder Diagram .....................................................................1-11
1.9 Basic Program Design Examples ............................................................1-13
i
2.12 High-speed Counters .............................................................................. 2-25
2.13 Special Data Register ............................................................................. 2-29
2.14 E, F Index Registers................................................................................ 2-38
2.15 Nest Level Pointer[N], Pointer[P], Interrupt Pointer [I] ............................. 2-39
2.16 Applications of Special M Relays and D Registers.................................. 2-41
3 In st ru ctio n Se t
3.1 Basic Instructions (without API numbers).................................................. 3-2
3.2 Explanations to Basic Instructions............................................................. 3-2
3.3 Pointers ................................................................................................... 3-13
3.4 Interrupt Pointers..................................................................................... 3-13
3.5 Application Programming Instructions ..................................................... 3-15
3.6 Numerical List of Instructions (classified according to the function) ........ 3-24
3.7 Numerical List of Instructions (in alphabetic order) ................................. 3-33
3.8 Detailed Instruction Explanation .............................................................. 3-40
ii
6 T roub le shoot ing
6.1 Common Problems and Solutions .............................................................6-2
6.2 Error code Table (Hex) ..............................................................................6-4
6.3 Error Detection Devices.............................................................................6-6
Appen dix A
A.1 Installing the USB Driver in Windows 7 .................................................... A-2
A.2 Installing the USB in Windows 8............................................................... A-4
A.3 Installing the USB Driver in Windows 10 .................................................. A-7
Appen dix B
B.1 Specifications for an Ethernet PLC/Module .............................................. B-2
B.2 Ethernet Control Registers ....................................................................... B-2
B.2.1 Station Addresses of Ethernet Modules............................................. B-2
B.2.2 DVP-SE Series PLC (Ethernet PLC) ................................................. B-2
B.2.3 DVPEN01-SL (Left-side Ethernet Communication Module) .............. B-4
B.2.4 DVP-FEN01 (DVP-EH3 Series Ethernet Communication Card) ....... B-6
B.3 Searching for an Ethernet PLC................................................................. B-6
B.3.1 Communication setting ...................................................................... B-7
B.3.2 Broadcast Search .............................................................................. B-8
B.3.3 Searching for a Model Specified........................................................ B-9
iii
B.3.4 Searching by an IP Address ............................................................. B-11
B.4 Data Exchange....................................................................................... B-12
B.5 EtherNet/IP List ...................................................................................... B-12
B.5.1 EtherNet/IP Information Supported by DVP-SE series PLCs .......... B-13
B.5.2 EtherNet/IP Objects Supported by DVP-SE series PLCs................ B-14
B.6 RTU Mapping ......................................................................................... B-17
B.6.1 Setting the RTU Mapping ................................................................ B-17
B.6.2 Application of the RTU Mapping ..................................................... B-18
Appen dix C
C.1 TP Memory Map....................................................................................... C-2
C.2 Special Data Register .............................................................................. C-3
C.3 Special Auxiliary Relay........................................................................... C-12
C.4 Instructions applicable to TP .................................................................. C-21
C.4.1 Basic Instructions ............................................................................ C-21
C.4.2 Numerical List of Instructions .......................................................... C-22
C.4.3 Additional Remarks on High-speed Instructions ............................. C-26
Appen dix D
D.1 Current Consumption of a Slim PLC/an Extension Module ...................... D-2
D.1.1 Current supply and current consumption of a PLC (+24VDC) .......... D-2
D.1.2 Current supply and current consumption of a digital input/output
module (+24VDC) ............................................................................. D-2
D.1.3 Current consumption of a special input/output module (+24VDC) .... D-3
D.1.4 Current consumption of a left-side high-speed special module (+24VDC)
.......................................................................................................... D-3
D.1.5 Calculating the maximum current consumed by a system ................ D-3
iv
T h e D VP seri e s PL C s a r e l i st ed b el o w.
S e ri e s Mo d el n a m e
D VP 1 6E S2 0 0 R, DVP 1 6ES 2 0 0T , DVP 2 4E S2 00 R , D VP 2 4ES 2 0 0T ,
D VP 3 2E S2 0 0 R, DVP 3 2ES 2 0 0T , DVP 3 2E S2 11 T , DV P4 0E S2 0 0 R,
D VP -E S2
D VP 4 0E S2 0 0T , DV P6 0E S 20 0 R, DVP 6 0E S2 00 T ,
D VP 4 0E S2 0 0 RM, DV P5 8E S 20 0 R, DVP 5 8E S2 0 0T
D VP -E S2 -C D VP 3 2E S2 0 0 RC, D VP 32 ES 2 00T C
D VP 2 0E S2 0 0 RE, DV P2 0E S 20 0T E , D VP 3 2ES2 0 0 RE,
D VP -E S2 -E D VP 3 2E S2 0 0T E, DV P 40 ES 2 00 RE , D VP 4 0ES2 0 0T E,
D VP 6 0E S2 0 0 RE, DV P6 0E S 20 0T E
D VP -E X2 D VP 2 0E X2 0 0 R, DVP 2 0E X2 0 0T, DVP 3 0E X2 00 R , D VP 3 0E X2 0 0T
D VP -S X2 D VP 2 0S X2 1 1 R, DVP 2 0S X2 1 1S, DV P 20 S X2 11 T
D VP -S E D VP 1 2S E1 1 R, DV P1 2S E1 1T , D VP 26 SE 1 1R , D VP 2 6S E1 1T
T P 0 4P -1 6T P1 R, T P 04 P- 3 2T P 1R , T P 0 4P- 2 2 XA 1 R,
TP T P 0 4P -2 1 E X1R , T P 7 0P- 1 6T P 1 R, T P 7 0P - 32T P 1 R,
T P 7 0P -2 2 XA 1R , T P 7 0P- 2 1E X1 R
v
PLC Concepts
This chapter introduces basic and advanced concepts of ladder logic, which is the mostly
adopted programming language of PLC. Users familiar with the PLC concepts can move to
the next chapter for further programming concepts. However, for users not familiar with the
operating principles of PLC, please refer to this chapter to get a full understanding of PLC
concepts.
Chapter Contents
1-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Scanning process:
Read the physical input status and store the data in internal
Scan input status
memory.
Evaluate the user program with data stored in internal memory.
Evaluate user program Program scanning starts from up to down and left to right until
reaching the end of the program.
Refresh the outputs Write the evaluated data to the physical outputs
Output terminal
Output Y
Scan time
The duration of the full scan cycle (read, evaluate, write) is called scan time. With more I/O or
longer program, scan time becomes longer.
PLC measures its own scan time and stores the value (0.1ms) in register
Read
D1010, minimum scan time in register D1011, and maximum scan time in
scan time
register D1012.
Measure Scan time can also be measured by toggling an output every scan and then
scan time measuring the pulse width on the output being toggled.
Scan time can be calculated by adding the known time required for each
Calculate
instruction in the user program. For scan time information of individual
scan time
instruction please refer to Ch3 in this manual.
1-2
1 . PLC Co nc e p ts
Reverse Current
When a current flows from right to left, which makes a reverse current logic, an error will be
detected when compiling the program. The example below shows the reverse current flow.
X0 X1 X2 Y0
Y0
X3 a X4 X5
b
X6
1-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Bit, word or double word memory used for counting and has coil, contact and
C register in it. The counter count once (1 pulse) when the coil goes from OFF to
(Counter) ON. When the predefined counter value is reached, the associated contact will
(Relay) be energized. There are 16-bit and 32-bit high-speed counters available for
(Word) users.
(Dword) Device indication: Indicated as C and numbered in decimal, e.g. C0, C1,
C2C255
Word memory stores values and parameters for data operations. Every
D register is able to store a word (16-bit binary value). A double word will occupy
(Data register) 2 consecutive data registers.
(Word) Device indication: Indicated as D and numbered in decimal, e.g. D0, D1,
D2D4999
Word memory used as a modifier to indicate a specified device (word and
E, F
double word) by defining an offset. Index registers not used as a modifier can
(Index register)
be used as general purpose register.
(Word)
Device indication: indicated as E0 ~ E7 and F0 ~ F7.
1.5 Ladder Logic Symbols
The following table displays list of WPLSoft symbols their description, command, and memory
registers that are able to use the symbol.
Ladder Diagram
Explanation Instruction Available Devices
Structure
NO (Normally Open)
LD X, Y, M, S, T, C
contact / A contact
NC (Normally Closed)
LDI X, Y, M, S, T, C
contact / B contact
NO contact in series AND X, Y, M, S, T, C
NO contact in parallel OR X, Y, M, S, T, C
Rising-edge trigger
LDP X, Y, M, S, T, C
switch
Falling-edge trigger
LDF X, Y, M, S, T, C
switch
Rising-edge trigger in
ANDP X, Y, M, S, T, C
series
Falling-edge trigger in
ANDF X, Y, M, S, T, C
series
Rising-edge trigger in
ORP X, Y, M, S, T, C
parallel
Falling-edge trigger in
ORF X, Y, M, S, T, C
parallel
1-4
1 . PLC Co nc e p ts
Ladder Diagram
Explanation Instruction Available Devices
Structure
MPS
Multiple output branches MRD None
MPP
When evaluating the user program, PLC scan starts from left to right and proceeds to next row
down until the PLC reaches END instruction. Output coils and basic / application instructions
belong to the output process and are placed at the right of ladder diagram. The sample program
below explains the execution order of a ladder diagram. The numbers in the black circles indicate
the execution order.
X0 X1 Y1 X4
Y1
M0 T0 M3
TMR T0 K10
X3 M1
1-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
1.5.5 ANDP / ANDF (Connect Rising edge in series/ Connect Falling edge in series)
Similar to AND instruction, ANDP (ANDF) instruction connects rising (falling) edge triggers in series
with another device or block.
1.5.6 OR / ORI (Connect NO contact in parallel / Connect NC contact in parallel)
OR (ORI) instruction connects a NO (NC) in parallel with another device or block.
1-6
1 . PLC Co nc e p ts
ORB instruction
Note: When compiling ladder diagram with WPLSoft, MPS, MRD and MPP could be automatically
added to the compiled results in instruction format. However, sometimes the branch instructions
are ignored by WPLSoft if not necessary. Users programming in instruction format can enter branch
instructions as required.
Connection points of MPS, MRD and MPP:
MPS
MPS
MRD
MPP
MPP
Note: Ladder diagram editor in ISPSoft does not support MPS, MRD and MPP instructions. To
achieve the same results as branch instructions, users have to connect all branches to the left
hand bus bar.
WPLSoft ISPSoft
1-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
previous step is completed, therefore it forms a sequential control process similar to SFC
(Sequential Function Chart) mode. The STL sequence can be converted into a PLC ladder diagram
which is called step ladder diagram as below.
M1002
M1002 SET S0
initial S0
pulse S
S0 SET S21
S21
S SET S22
S21 S22
e
S S0
S22 RET
RET
S20
e
S
RET
Note: Always connect RET instruction immediately after the last step point indicated as the above
diagram otherwise program error may occur.
1-8
1 . PLC Co nc e p ts
X0 RET Return
CNT C0 K10 LD X0
CNT C0 K10
C0 X1 LD C0 Read C0
M0 MPS
X1 AND X1
M1
M2 OUT M0
M2 MRD
Multiple
AN I X1 outputs
RST C0 OUT M1
MPP
END AN I M2
OUT M2
RST C0
END End of program
1-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
The two instruction programs can be converted into the same ladder diagram. The difference
between Better and OK method is the ANB operation conducted by MPU. ANB instruction cannot
be used continuously for more than 8 times. If more than 8 ANB instructions are used continuously,
program error will occur. Therefore, apply ANB instruction after a block is made is the better
method to prevent the possible errors. In addition, its also the more logical and clearer
programming method for general users.
Example 2:
X0 Good method Bad method
LD X0 LD X0
X1 OR X1 LD X1
OR X2 LD X2
X2 OR X3 LD X3
ORB
X3 ORB
ORB
The difference between Good and Bad method is very clear. With longer program code, the
required MPU operation memory increases in the Bad method. To sum up, following the general
principle and applying good / better method when editing programs prevents possible errors and
improves program execution speed as well.
Common Programming Errors
PLC processes the diagram program from up to down and left to right. When editing ladder
diagram users should adopt this principle as well otherwise an error would be detected by WPLSoft
when compiling user program. Common program errors are listed below:
OR operation upward is not allowed.
1-10
1 . PLC Co nc e p ts
1 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example 2:
When a device is to be connected to a block, connect the device to upper row for omitting ORB
instruction
T0 Instruction List
LD T0
X1 X2 LD X1
AND X2
ORB
X1 X2 Instruction List
LD X1
T0 AND X2
OR T0
Example 3:
Reverse current existed in diagram (a) is not allowed for PLC processing principle.
X0 Instruction List
LD X0
X1 X2 OR X1
AND X2
LD X3
X3 X4
AND X4
ORB
(a)
X3 X4 Instruction List
LD X3
X1 X2 AND X4
LD X1
X0
OR X0
AND X2
ORB
(b)
Example 4:
For multiple outputs, connect the output without additional input devices to the top of the circuit for
omitting MPS and MPP instructions.
X0 Instruction List
Y1 MPS
AND X0
Y0 OUT Y1
MPP
OUT Y0
Y0
Instruction List
OUT Y0
X0 AND X0
Y1 OUT Y1
1-12
1 . PLC Co nc e p ts
Example 5:
Correct the circuit of reverse current. The pointed reverse current loops are modified on the right.
X0 X1 X2
X0 X1 X2 X3 X4 X5
X3 X4 X5 X10
X6 X7 X10 LOO P1
X6 X7 X5
Example 6:
Correct the circuit of reverse current. The pointed reverse current loops are modified on the right.
X0 X1 X2
X0 X1 X2
X3 X4 X5
X3 X4 X5
X6 X7 X10 LOO P1
X6
X3 X4 X5 X0 X1 X4 X7 X10
X6 X7 X10 LOOP P
LOO P2
1-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Stop First circuit while SET which is lower than RST forms a Start first
Start First circuit. X2
RST Y1
X1
SET Y1
Y1 X3
X2
X2 X4 Y1
Y2 X4
Y2
Y1
Y2
Because NO contact Y1 is connected to the circuit of Y2 output, Y1 becomes one of the conditions
for enabling Y2, i.e. for turning on Y2, Y1 has to be ON
Y1 X3
X2
X2 X4 Y1 X4
Y2
Y1
Y2
Y2
1-14
1 . PLC Co nc e p ts
nT T
When X0 = ON, T0 starts timing (nT). Once the set time is reached, contact T0 = ON to enable
Y1(T). In next scan, Timer T0 is reset due to the reversed status of contact Y1. Therefore contact
T0 is reset and Y1 = OFF. In next scan, T0 starts timing again. The process forms an oscillating
circuit with output cycle nT+T.
1-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Y4
Y4 X0 T
TMR T6 K30 T6
3 secs
Vertical
Light
Horizontal
Light
1-16
1 . PLC Co nc e p ts
Timing Diagram:
Vertical
Light
Red Y0
Yellow Y1
Green Y2 25 Sec
Yellow Y21
Green Y22
25 Sec
5 Sec 5 Sec
SFC Figure:
M1002
S0
T13
S0
1-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Ladder Diagram:
M1002
ZRST S0 S127
SET S0
S0
S SET S20
SET S30
S20
S Y0
TMR T0 K350
T0
SET S21
S21
S Y2
TMR T1 K250
T1
SET S22
S22
S TMR T2 K50
M1013
Y2
T2
SET S23
S23
S Y1
S30
S Y22
RET
END
1-18
1 . PLC Co nc e p ts
0 Transfer condition 1
T0
TRANS*
S20 S30
1 5 S22
S21 S31
TMR T2 K50
M1013
2 6 Y2
S23 S33
Transfer condition 7
T12
TRANS*
4
S0
1-19
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
MEMO
1-20
Programming Concepts
DVP-ES2/EX2/SS/SA2/SX2/SE is a programmable logic controller spanning an I/O range of
10256 I/O points (SS2/SA2/SX2/SE: 512 points). PLC can control a wide variety of devices
to solve your automation needs. PLC monitors inputs and modifies outputs as controlled
by the user program. User program provides features such as boolean logic, counting,
timing, complex math operations, and communications to other communicating products.
Chapter Contents
2-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-2
2 . Pr ogr am m i n g Conc e pts
Specifications
T Current value T0~T255, 256 words
C0~C199, 16-bit counter, 200 words
C Current value
C200~C254, 32-bit counter, 55 words
D0~D407, 408 words, (*1)
General D600~D999, 400 words, (*1)
D3920~D9999, 6080 words, (*1)
Word
D408~D599, 192 words, (*2)
Register Latched
Data D2000~D3919, 1920 words, (*2) Total
D D1000~D1999, 1000 words, some
register Special 10000 points
are latched
For Special D9900~D9999100 words, (*1),
mudules (*5)
Index E0~E7, F0~F7, 16 words, (*1)
N Master control loop N0~N7, 8 points
P Pointer P0~P255, 256 points
I000/I001(X0), I100/I101(X1), I200/I201(X2),
I300/I301(X3), I400/I401(X4), I500/I501(X5),
External interrupt
I600/I601(X6), I700/I701(X7), 8 points (01: rising-
edge trigger , 00: falling-edge trigger )
I602~I699, I702~I799, 2 points (Timer resolution =
Pointer
Interrupt 1ms)
I Timer interrupt
Service I805~I899, 1 point (Timer resolution = 0.1ms)
(Supported by V2.00 and above)
High-speed I010, I020, I030, I040, I050, I060, I070, I080,8
counter interrupt points
Communication I140(COM1), I150(COM2), I160(COM3), 3 points,
interrupt (*3)
K-32,768 ~ K32,767 (16-bit operation),
K Decimal K-2,147,483,648 ~ K2,147,483,647 (32-bit
Constant operation)
H0000 ~ HFFFF (16-bit operation),
H Hexadecimal
H00000000 ~HFFFFFFFF (32-bit operation)
COM1: built-in RS-232 ((Master/Slave)
COM2: built-in RS-485 (Master/Slave)
COM3: built-in RS-485 (Master/Slave)
Serial ports
COM1 is typically the programming port.
Ethernet(*8): built-in Ethernet, refer to appendix B
for more details on operation
Real Time Clock(*6) Year, Month, Day, Week, Hours, Minutes, Seconds
Special I/O Modules Up to 8 special I/O modules can be connected
File Register(*7) K0~K4999, 5000 points (*2)
Notes:
1. Non-latched area cannot be modified
2. Latched area cannot be modified
3. COM1: built-in RS232 port. COM2: built-in RS485 port. COM3: built-in RS485 port.
4. When input points(X) are expanded to 256 points, only 16 output points(Y) are applicable. Also,
when ouput points(Y) are expanded to 256 points, only 16 input points(X) are applicable.
5. This area is applicable only when the ES2/EX2 MPU is connected with special I/O modules.
Every special I/O module occupies 10 points.
6. PLC with firmware version 2.00 or later support the function of keeping track of the current
even after the power is off. When the power is off, this function can go on for about 1 week.
7. PLC with firmware version 2.00 or later versions support the function of file register. Refer to
the instructions MEMR/MEMW for more details on operation.
2-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-4
2 . Pr ogr am m i n g Conc e pts
Specifications
T Current value T0~T255, 256 words
C0~C199, 16-bit counter, 200 words
C Current value
C200~C254, 32-bit counter, 55 words
D0~D407, 408 words, (*1)
General D600~D999, 400 words, (*1)
Word
D3920~D4999, 1080 words, (*1)
Register
Data D408~D599, 192 words, (*2) Total
D Latched
register D2000~D3919, 1920 words, (*2) 5000 points
D1000~D1999, 1000 words, some
Special
are latched
Index E0~E7, F0~F7, 16 words, (*1)
N Master control loop N0~N7, 8 points
P Pointer P0~P255, 256 points
I000/I001(X0), I100/I101(X1), I200/I201(X2),
I300/I301(X3), I400/I401(X4), I500/I501(X5),
External interrupt
I600/I601(X6), I700/I701(X7), 8 points (01: rising-
edge trigger , 00: falling-edge trigger )
Pointer I602~I699, I702~I799, 2 points (Timer resolution =
Interrupt 1ms)
I Timer interrupt
Service I805~I899, 1 point (Timer resolution = 0.1ms)
(Supported by V2.00 and above)
High-speed I010, I020, I030, I040, I050, I060, I070, I080, 8
counter interrupt points
Communication
I140(COM1), I150(COM2), 2 points, (*3)
interrupt
K-32,768 ~ K32,767 (16-bit operation),
K Decimal K-2,147,483,648 ~ K2,147,483,647 (32-bit
Constant operation)
H0000 ~ HFFFF (16-bit operation),
H Hexadecimal
H00000000 ~HFFFFFFFF (32-bit operation)
COM1: built-in RS-232 ((Master/Slave)
Serial ports COM2: built-in RS-485 (Master/Slave)
COM1 is typically the programming port.
Real Time Clock Year, Month, Day, Week, Hours, Minutes, Seconds
Special I/O Modules Up to 8 special I/O modules can be connected
Notes:
1. Non-latched area cannot be modified
2. Latched area cannot be modified
3. COM1: built-in RS232 port. COM2: built-in RS485 port.
4. SS2 MPU occupies 16 input points (X0~X17) and 16 output points (Y0~Y17).
2-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-6
2 . Pr ogr am m i n g Conc e pts
Specifications
T Current value T0~T255, 256 words
C0~C199, 16-bit counter, 200 words
C Current value
C200~C254, 32-bit counter, 55 words
D0~D407, 408 words, (*1)
General D600~D999, 400 words, (*1)
D3920~D9799, 5880 words, (*1)
D408~D599, 192 words, (*2)
Word Latched
D2000~D3919, 1920 words, (*2)
Register
Data D1000~D1999, 1000 words, some Total
D Special
register are latched 10000 points
Righ-side special
D9900~D9999, 100 words (*1) (*6)
module
Left-side special
D9800~D9899, 100 words (*1) (*7)
module
Index E0~E7, F0~F7, 16 words, (*1)
N Master control loop N0~N7, 8 points
P Pointer P0~P255, 256 points
I000/I001(X0), I100/I101(X1), I200/I201(X2),
I300/I301(X3), I400/I401(X4), I500/I501(X5),
External interrupt
I600/I601(X6), I700/I701(X7), 8 points (01: rising-
edge trigger , 00: falling-edge trigger )
Pointer I602~I699, I702~I799, 2 points (Timer resolution =
Interrupt 1ms)
I Timer interrupt
Service I805~I899, 1 point (Timer resolution = 0.1ms)
(Supported by V2.00 and above)
High-speed I010, I020, I030, I040, I050, I060, I070, I080, 8
counter interrupt points
Communication I140(COM1), I150(COM2), I160(COM3), 3 points,
interrupt (*3)
K-32,768 ~ K32,767 (16-bit operation),
K Decimal K-2,147,483,648 ~ K2,147,483,647 (32-bit
Constant operation)
H0000 ~ HFFFF (16-bit operation),
H Hexadecimal
H00000000 ~HFFFFFFFF (32-bit operation)
COM1: built-in RS-232 ((Master/Slave)
COM2: built-in RS-485 (Master/Slave)
SA2
COM3: built-in RS-485 (Master/Slave)
COM1 is typically the programming port.
Serial Ports
COM1: built-in RS-232 ((Master/Slave)
COM2: built-in RS-485 (Master/Slave)
SX2
COM3: built-in USB (Slave)
COM1 is typically the programming port.
Real Time Clock Year, Month, Day, Week, Hours, Minutes, Seconds
Right side: Up to 8 I/O modules can be connected
Special I/O Modules Left side: Up to 8 high-speed I/O module can be
connected
File Register (*5) K0~K4999, 5000 points (*2)
Notes:
1. Non-latched area cannot be modified
2. Latched area cannot be modified
3. Please refer to the table above for more information about serial ports. SX2 does not support
I160.
4. There are 8 input points (X0~X17) and 4 output points (Y0~Y3) in an SA2 series MPU. An SA2
series MPU occupies 16 input points (X0~X17), and 16 output points (Y0~Y17). There are 8
input points (X0~X17), and 6 output points (Y0~Y5) in an SX2 series MPU. An SX2 series MPU
2-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
occupies 16 input points (X0~X17), and 16 output points (Y0~Y17). Extension input points start
from X20, and extension output points start from Y17.
5. If the firmware version of an MPU is 2.0 or above, the MPU support the use of file registers.
Please refer to the instruction MEMR/MEMW for more information about the reading/writing of
data.
6. If an SA2/SX2 series MPU is connected to a right-side special module, and M1183 is Off, the
range of data registers can be used. Every special module connected to an SA2/SX2 series
MPU occupies ten data registers.
7. If an SA2/SX2 series MPU is connected to a left-side special module, and M1182 is Off, the
range of data registers can be used. Every special module connected to an SA2/SX2 series
MPU occupies ten data registers.
2-8
2 . Pr ogr am m i n g Conc e pts
2-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Specifications
T Current value T0~T255, 256 words
C0~C199, 16-bit counter, 200 words
C Current value
C200~C254, 32-bit counter, 55 words
D0~D407, 408 words, (*1)
D600~D999, 400 words, (*1)
General
D3920~D9799, 5880 words, (*1)
D10000~D11999, 2000 words, (*1)
Word D408~D599, 192 words, (*2)
Latched
Register D2000~D3919, 1920 words, (*2)
Data Total
D D1000~D1999, 1000 words, some
register Special 12000 points
are latched
Right-side special
D9900~D9999, 100 words, (*1) (*5)
module
Left-side special
D9800~D9899, 100 words, (*1) (*6)
module
Index E0~E7, F0~F7, 16 words, (*1)
N Master control loop N0~N7, 8 points
P Pointer P0~P255, 256 points
I000/I001(X0), I100/I101(X1), I200/I201(X2),
I300/I301(X3), I400/I401(X4), I500/I501(X5),
External interrupt
I600/I601(X6), I700/I701(X7), 8 points (01: rising-
edge trigger , 00: falling-edge trigger )
Pointer I602~I699, I702~I799, 2 points (Timer resolution =
Interrupt 1ms)
I Timer interrupt
Service I805~I899, 1 point (Timer resolution = 0.1ms)
(Supported by V1.60 and above)
High-speed I010, I020, I030, I040, I050, I060, I070, I080, 8
counter interrupt points
Communication
I150 (COM2), I160 (COM3), 2 points, (*3)
interrupt
K-32,768 ~ K32,767 (16-bit operation),
K Decimal K-2,147,483,648 ~ K2,147,483,647 (32-bit
Constant operation)
H0000 ~ HFFFF (16-bit operation),
H Hexadecimal
H00000000 ~HFFFFFFFF (32-bit operation)
COM1: built-in USB (Slave)
COM2: built-in RS-485 (Master/Slave)
COM3: built-in RS-485 (Master/Slave)
Serial Ports
Ethernet: built-in Ethernet (Please refer to Appendix
B for more information.)
COM1 is typically the programming port.
Real Time Clock Year, Month, Day, Week, Hours, Minutes, Seconds
Right side: Up to 8 I/O modules can be connected
Special I/O Modules Left side: Up to 8 high-speed I/O modules can be
connected
Notes:
1. Non-latched area cannot be modified
2. Latched area cannot be modified
3. COM2: built-in RS485 port. COM3: built-in RS485 port.
4. There are 8 input points (X0~X7) and 4 output points (Y0~Y3) in an SE MPU. An SE MPU
occupies 16 input points (X0~X17) and 16 output points (Y0~Y17). Extension input points start
from X20, and output points start from Y20.
5. If an SE series MPU is connected to a right-side special module, and M1183 is Off, the range
of data registers can be used. Every special module connected to an SE series MPU occupies
ten data registers.
2-10
2 . Pr ogr am m i n g Conc e pts
6. If an SE series MPU is connected to a left-side special module, and M1182 is Off, the range of
data registers can be used. Every special module connected to an SE series MPU occupies
ten data registers.
2.5 Status and Allocation of Latched Memory
Clear all
Clear all
Memory Power non-latched Factory
STOP=>RUN RUN=>STOP latched areas
type OFF=>ON areas setting
(M1032=ON)
(M1031=ON)
When
M1033=OFF,
Non- clear
Clear Unchanged Clear Unchanged 0
latched When
M1033=ON, No
change
Latched Unchanged Unchanged Clear 0
Special
M,
Initial
Special Initial Unchanged Unchanged
setting
D, Index
register
File
Unchanged HFFFF
register
2 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
W1 W0 Word
Bit
2-12
2 . Pr ogr am m i n g Conc e pts
Constant (H): A hexadecimal number in a PLC is generally preceded by H. For example, the
hexadecimal number H100 represents the decimal number 256.
Reference Table:
Hexadecimal
Binary Octal Decimal (K) BCD
(H)
(BIN) (OCT) (DEC) (Binary Code Decimal)
(HEX)
For PLC Costant K, No. of
No. of X, Y For DIP Switch and 7-
internal registers M, S, T, C, Constant H
relay segment display
operation D, E, F, P, I devices
0000 0 0 0000 0
0001 1 1 0001 1
0010 2 2 0010 2
0011 3 3 0011 3
0100 4 4 0100 4
0101 5 5 0101 5
0110 6 6 0110 6
0111 7 7 0111 7
1000 10 8 1000 8
1001 11 9 1001 9
1010 12 10 0000 A
1011 13 11 0001 B
1100 14 12 0010 C
1101 15 13 0011 D
1110 16 14 0100 E
1111 17 15 0101 F
10000 20 16 0110 10
10001 21 17 0111 11
2.8 M Relay
The types and functions of special auxiliary relays (special M) are listed in the table below. Care
should be taken that some devices of the same No. may bear different meanings in different series
MPUs. Special M and special D marked with * will be further illustrated in 2.13. Columns marked
with R refers to read only, R/W refers to read and write, - refers to the status remains
unchanged and # refers to that system will set it up according to the status of the PLC.
OFF STOP RUN
Special ES2 SA2 Latch
Function SS2 SX2 Attrib. Default
M EX2 SE -ed
ON RUN STOP
M1000* Monitor normally open contact OFF ON OFF R NO OFF
M1001* Monitor normally closed contact ON OFF ON R NO ON
Enable single positive pulse at the
M1002* moment when RUN is activate (Normally OFF ON OFF R NO OFF
OFF)
Enable single negative pulse at the
M1003* moment when RUN is activate (Normally ON OFF ON R NO ON
ON)
M1004* ON when syntax errors occur OFF OFF - R NO OFF
M1008* Watchdog timer (ON: PLC WDT time out) OFF OFF - R NO OFF
Indicate LV signal due to 24VDC
M1009 OFF - - R NO OFF
insufficiency
M1011* 10ms clock pulse, 5ms ON/5ms OFF OFF - - R NO OFF
100ms clock pulse, 50ms ON / 50ms
M1012* OFF - - R NO OFF
OFF
M1013* 1s clock pulse, 0.5s ON / 0.5s OFF OFF - - R NO OFF
M1014* 1 min clock pulse, 30s ON / 30s OFF OFF - - R NO OFF
M1015* Enable high-speed timer OFF - - R/W NO OFF
M1016* Indicate Year display mode of RTC. OFF - - R/W NO OFF
M1017* 30 seconds correction on real time clock OFF - - R/W NO OFF
M1018 Flag for Radian/Degree, ON for degree OFF - - R/W NO OFF
M1020 Zero flag OFF - - R NO OFF
2-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-14
2 . Pr ogr am m i n g Conc e pts
2-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-16
2 . Pr ogr am m i n g Conc e pts
2-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-18
2 . Pr ogr am m i n g Conc e pts
2-19
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-20
2 . Pr ogr am m i n g Conc e pts
2-21
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2.9 S Relay
Initial step relay Starting instruction in Sequential Function Chart (SFC).
S0~S9, total 10 points.
Zero return step relay Returns to zero point when using IST instruction in program. Zero
return step relays not used for IST instruction can be used as
general step relays.
S10~S19, total 10 ponits.
Latched step relay In sequential function chart (SFC), latched step relay will be saved
when power loss after running. The state of power on after power
loss will be the same as the sate before power loss.
S20 ~ S127, total 108 points.
2-22
2 . Pr ogr am m i n g Conc e pts
General purpose step relay General relays in sequential function chart (SFC). They will be
cleared when power loss after running.
S128 ~ S911, total 784 points.
Alarm step relay Used with alarm driving instruction API 46 ANS as an alarm
contact for recording the alarm messages or eliminating external
malfunctions.
S912 ~ S1023, total 112 points.
2.10 T (Timer)
The units of the timer are 1ms, 10ms and 100ms and the counting method is counting up. When
the present value in the timer equals the set value, the associated output coil will be ON. The set
value should be a K value in decimal and can be specified by the content of data register D.
The actual set time in the timer = timer resolution set value
Ex: If set value is K200 and timer resolution is 10ms, the actual set time in timer will be 10ms*200 =
2000ms = 2 sec.
General Timer
The timer executes once when the program reaches END instruction. When TMR instruction is
executed, the timer coil will be ON when the current value reaches its preset value.
When X0 = ON, TMR instruction is driven. When current value achieves K100, the assocailte timer
contact T0 is ON to drive Y0. If X0 = OFFor the power is off, the current value in T0 will be cleared
as 0 and output Y0 driven by contact T0 will be OFF.
X0
TMR T0 K100
T0
Y0 10 sec
X0
K100
present
T0 value
Y0
Accumulative Timer
The timer executes once when the program reaches END instruction. When TMR instruction is
executed, the timer coil will be ON when the current value reaches its preset value. For
accumulative timers, current value will not be cleared when timing is interrupted.
Timer T250 will be driven when X0 = ON. When X0 = OFFor the power is off, timer T250 will pause
and retain the current value. When X0 is ON again, T250 resumes timing from where it was paused.
X0
TMR T250 K100
T250
Y0
T1 T2 T1+T2=10sec
X0
K100
present
T250 value
Y0
2-23
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
the only timers that can be used in subroutines or interrupts. Generals timers used in subroutines
and interrupts will not work if the subroutines or interrupts are not executing.
2.11 C (Counter)
Counters will increment their present count value when input signals are triggered from OFFON.
16 bits
32 bits counters
counters
Type General General High speed
C232(C233)~C242,
Counters C0~C199 C200~C231(C232) C243, C244
C245~C254
Count
Count up Count up/down Count up
direction
Range 0~32,767 -2,147,483,648~+2,147,483,647 0~2,147,483,647
Preset Constant K or
value data register Constant K or data register D (Dword)
register D (Word)
Counter will keep on
counting when preset
Counter will Counter will keep on counting when preset
value is reached. The
Output stop when value reached. The count value will become
count value will
operation preset value -2,147,483,648 if one more count is added
become 0 if one more
reached to +2,147,483,647
count is added to
+2,147,483,647
Ouptut Coil
Output coil is ON when counter reaches or Output coil is ON
Output will be ON
is above preset value. when counter
contact when counter
Output coil is OFF when counter is below reaches or is above
function reaches
preset value. preset value
preset value.
Associated devices
are activated
immediately when
High speed
- preset value is -
conparison
reached, i.e.
independant of scan
time.
Reset The present value will reset to 0 when RST instruction is executed, output coil will
action be OFF.
Example:
LD X0 X0
RST C0 RST C0
LD X1 X1
CNT C0 K5
CNT C0 K5
C0
LD C0
Y0
OUT Y0
2-24
2 . Pr ogr am m i n g Conc e pts
Contacts Y0, C0
M relays M1200~M1254 are used to set the up/down counting direction for C200~C254
respectively. Setting the corresponding M relay ON will set the counter to count down.
Example:
LD X10
X10
OUT M1200
M1200
LD X11
X11
RST C200 RST C200
LD X12 X12
CNT C200 K-5 DCNT C200 K-5
LD C200 C200
Y0
OUT Y0
a) X10 drives M1200 to
determine counting direction
(up / down) of C200
b) When X11 goes from OFF to
ON, RST instsruction will be Accumulatively Accumulatively
executed and the PV (present X10 increasing Progressively increasing
value) in C200 will be cleared decreasing
and contact C200 is OFF. X11
c) When X12 goes from Off to
On, PV of C200 will count up X12
(plus 1) or count down (minus 5
1). 4 4
3 3
d) When PV in C200 changes 2 2
PV in
from K-6 to K-5, the contact C200
1 1
C200 will be energized. When 0 0 0
-1
PV in C200 changes from K-5 -2
to K-6, the contact of C200 -3 -3
-4 -4
will be reset. -5 -5
e) If MOV instruction is applied When the output contact -6 -6
was On. -7 -7
through WPLSoft or HPP to -8
Contacts
designate a value bigger than Y0, C0
SV to the PV register of C0,
next time when X1 goes from
OFF to ON, the contact C0
will be ON and PV of C0 will
equal SV.
2.12 High-speed Counters
There are two types of high speed counters provided including Software High Speed Counter
(SHSC) and Hardware High Speed Counter (HHSC). The same Input point (X) can be designated
with only one high speed counter. Double designation on the same input or the same counter will
2-25
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Note:
1. SHSC supports max 10kHz input pulse on single point. Max 8 counters are applicable in the
same time.
2. An SS2/SA2/SE model does not support a two-phase two-input counter (C232 with the input
points X0 and X2).
3. For 2-phase 2-input conuting, (X4, X5) (C233) and (X6, X7) (C234), max 5kHz. (X0,X2) (C232),
max 15kHz.
4. 2-phase 2-input counting supports double and quadruple frequency, which is selected in D1022
as the table shown below.
5. R/F (Rising edge trigger/ Falling edge trigger) can also be specified by special M. OFF = Rising;
ON = Falling.
6. U/D (Count up/Count down) can be specified by special M. OFF = count up; ON = count down.
Applicable Hardware High Speed Counters:
C 1-phase
1-phase 2-input 2-phase 2-input
input
X C243 C244 C245 C246 C247 C248 C249#2 C250#2 C251 C252 C253 C254
X0 U U/D U/D U U A A
X1 R Dir Dir D D B B
X2 U U/D U/D A A
X3 R Dir Dir B B
X4 R R R
X5 R R
U: Count up A: Phase A input Dir: Directoin signal input
D: Count down B: Phase B input R: Reset signal input
Note:
1. The max frequency of the 1-phase input counters X0 (C243) and X2 (C244) is 100kHz on
ES2/EX2/SA2/SX2 model and 20kHz on SS2 model.
2. An SE model does not support the counters C249 and C250.
3. The max frequency of the 1-phase 2-input counters (X0, X1) (C245, C246) and (X2, X3) (C249,
C250) is 100kHz on ES2/EX2/SA2/SX2 model and 20kHz on SS2 model.
4. The max frequency of the 1-phase 2-input counters (X0, X1) (C247, C248) is 10kHz on
ES2/EX2/SS2/SX2 model and 100kHz on 32ES211T and SA2 model.
5. The max frequency of the 2-phase 2-input counter (X0, X1) (C251, C252) is 5kHz on ES2/EX2
model, 10kHz on SS2/SX2 model and 30kHz on 32ES211T, 12SA2 and 12SE model. For ES2
series released after the year of 2013, the max frequency for 28SA2 and 26SE are up to 50kHz.
6. The max frequency of the 2-phase 2-input counter (X2, X3) (C253, C254) is 5kHz on
ES2/EX2/SA2 model, 10 kHz on SS2/SX2 model and 30kHz on 32ES211T. For ES2 series
released after the year of 2013, the max frequency for 28SA2 and 26SE are up to 50kHz.
7. 2-phase 2-input counting supports double and 4 times frequency, which is selected in D1022
as the table in next page. Please refer to the below table for detailed counting wave form.
2-26
2 . Pr ogr am m i n g Conc e pts
K1
K2
(Double Frequency)
K4 or other value
(Quadruple frequency)
(Default)
8. DVP-ES2/DVP-SS2 series PLCs whose firmware version is 2.80 or above support the single
frequency mode. DVP-SA2/DVP-SX2 series PLCs whose firmware version is 2.00 support the
single frequency mode. The other PLCs support the three modes.
9. C243 and C244 support count-up mode only and occupy the associate input points X1 and X3
as reset (R) function. If users do not need to apply reset function, set ON the associated
special M relays (M1243 and M1244) to disable the reset function.
10. Dir refers to direction control function. OFF indicates counting up; ON indicates counting
down.
11. When X1, X3, X4 and X5 is applied for reset function and associated external interrupts are
disabled, users can define the reset function as Rising/Falling-edge triggered by special M
relays
Reset Function X1 X3 X4 X5
R/F M1271 M1273 M1274 M1275
12. When X1, X3, X4 and X5 is applied for reset function and external interrupts are applied, the
interrupt instructions have the priority in using the input points. In addition, PLC will move the
current data in the counters to the associated data registers below then reset the counters.
Special D D1241, D1240 D1243, D1242
Counter C243 C246 C248 C252 C244 C250 C254
X1 X3
External Interrupt X4(I400/I401) X5(I500/I501)
(I100/I101) (I300/I301)
2-27
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example:
EI
M1000
DCNT C243 K100
FEND
M1000
I101 DMOV D1240 D0
IRET
END
When C243 is counting and external interrupt is triggerred from X1(I101), counted value in C243
will be move to (D1241, D1240) immediately then C243 is reset. After this interrupt I101 executes.
1-phase 1 input high-speed counter:
Example:
LD X20 X20
RST C235 RST C235
LD X21 X21
OUT M1235 M1235
LD X22 X22
DCNT C235 K5
DCNT C235 K5
C235
LD C235
Y0
OUT Y0
1. X21 drives M1235 to determine counting direction (Up/Down) of C235.
2. When X20 = ON, RST instsruction executes and the current value in C235 will be cleared.
Contact C235 will be OFF
3. When X22 = ON, C235 receives signals from X0 and counter will count up (+1) or count down
(-1).
4. When counter C235 reaches K5, contact C235 will be ON. If there is still input signal input for
X0, it will keep on counting.
counting down
X21,M1243 contact counting up
X20
X22
X0
C243
present 7
value 6 6
5 5
4 4
3 3
2
1
0
2-28
2 . Pr ogr am m i n g Conc e pts
LD X21
DCNT C247 K5
LD C247
OUT Y0
1. When X20 is ON, RST instsruction executes and the current value in C247 will be cleared.
Contact C247 will be OFF.
2. When X21=ON, C247 receives count signals from X0 and counter counts up (+1), or C247
receives count signal from X1 and counter counts down (-1)
3. When C247 reaches K5, contact C247 will be ON. If there is still input signal from X0 or X1,
C247 will keep on counting
X20
X21
X0
count up
X1
count down
C247
present 7
value 6 6
5 5
4 4
3 3
2
1
0
Y0, C247 contact
2-29
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X20
X21
A-phase X0
B-phase X1
6
C251 present value 5 5
4 4
3 3 3
2 2
1 Counting up 1
Counting down
0 0
2-30
2 . Pr ogr am m i n g Conc e pts
2-31
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-32
2 . Pr ogr am m i n g Conc e pts
2-33
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-34
2 . Pr ogr am m i n g Conc e pts
2-35
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-36
2 . Pr ogr am m i n g Conc e pts
2-37
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1768*
The data which is read from slave ID#10 in
0 - - R NO 0
the PLC LINK
D1783*
D1784*
The data which is written into slave ID#10
0 - - R/W NO 0
in the PLC LINK
D1799*
D1800*
The data which is read from slave ID#11 in
0 - - R NO 0
the PLC LINK
D1815*
D1816*
The data which is written into slave ID#11
0 - - R/W NO 0
in the PLC LINK
D1831*
D1832*
The data which is read from slave ID#12 in 0 - - R NO 0
the PLC LINK
D1847*
D1848*
The data which is written into slave ID#12 0 - - R/W NO 0
in the PLC LINK
D1863*
D1864*
The data which is read from slave ID#13 in 0 - - R NO 0
the PLC LINK
D1879*
D1880*
The data which is written into slave ID#13 0 - - R/W NO 0
in the PLC LINK
D1895*
D1896*
The data which is read from slave ID#14 in
0 - - R NO 0
the PLC LINK
D1911*
Specify the station number of Slaves for
D1900* PLC-Link when M1356 is ON. Consecutive
station numbers set by D1399 will be 0 - - R/W NO
D1931* invalid in this case. Note that the registers
are latched only when M1356 is ON.
D1912*
The data which is written into slave ID#14 0 - - R/W NO 0
in the PLC LINK
D1927*
D1928*
The data which is read from slave ID#15 in
0 - - R NO 0
the PLC LINK
D1943*
D1944*
The data which is written into slave ID#15
0 - - R/W NO 0
in the PLC LINK
D1959*
D1960*
The data which is read from slave ID#16 in
0 - - R NO 0
the PLC LINK
D1975*
D1976*
The data which is written into slave ID#16
0 - - R/W NO 0
in the PLC LINK
D1991*
Remaining times for PLC password setting
D1994 0
on DVP-PCC01
Data length for PLC ID Setting on DVP-
D1995 0 - - R/W NO 0
PCC01
st
1 Word of PLC ID Setting for DVP-PCC01
D1996 (Indicated by Hex format corresponding to 0 - - R/W NO 0
ASCII codes)
nd
2 Word of PLC ID Setting for DVP-PCC01
D1997 (Indicated by Hex format corresponding to 0 - - R/W NO 0
ASCII codes)
rd
3 Word of PLC ID Setting for DVP-PCC01
D1998 (Indicated by Hex format corresponding to 0 - - R/W NO 0
ASCII codes)
th
4 word of PLC ID Setting for DVP-PCC01
D1999 (Indicated by Hex format corresponding to 0 - - R/W NO 0
ASCII codes)
They are for left-side special modules
D9800~
which are connected to an SA2/SX2/SE - - - R/W NO 0
D9879
series MPU.
2-38
2 . Pr ogr am m i n g Conc e pts
32-bit
F0 E0
High word Low word
MOV K14 F0
2-39
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
, 00, falling-edge
The location point of
Pointer I trigger ) interrupt subroutine.
I602/I699, I702/I799, 2
Timer interrupt points (Timer
resolution=1ms)
I010, I020, I030, I040,
High-speed counter
I050, I060, I070, I080, 8
interrupt
points
I140(COM1: RS232),
Communication I150(COM2: RS-485),
interrupt I160(COM3: RS-485), 3
points
Nest Level Pointer N: used with instruction MC and MCR. MC is master start instruction. When
the MC instruction is executed, the instructions between MC and MCR will be executed normally.
MC-MCR master control instruction is nested level structure and max. 8 levels can be applicable,
which is numbered from N0 to N7.
Pointer P: used with application instructions CJ, CALL, and SRET.
CJ condition jump:
When X0 = ON, program will jump from address 0 to N (designated label P1) and keep on the
execution. Instructions between 0 and N will be ignored.
When X0 = OFF, program will execute from 0 and keep on executing the followings. CJ instruction
wont be executed at this time.
P**
X0
0 CJ P1
X1
Y1
X2
P1 N Y2
2-40
2 . Pr ogr am m i n g Conc e pts
P**
X0
20 CALL P2 Call subroutine P**
X1
24 Y1
FEND
P2 Y0
(subroutine
P2) subroutine
Y1
Interrupt pointer I: used with application instruction API 04 EI, API 05 DI, API 03 IRET. There are
four types of interruption pointers. To insert an interruption, users need to combine EI (enable
interruption), DI (disable interruption) and IRET (interruption return) instructions.
When the instruction EI is enabled, the PLC will check if there is any interrupt that need to be done
everytime an instruction is executed. If an interrupt is found, the PLC will stop executing the
instruction and execute the interrupt first. If no interrupt is found, the PLC will keep executing the
instruction. From the explanation, we can conclude that the maximum waiting time for an interrupt
to be executed is the execution time of an instruction.
1. External interrupt
When input signal of input terminal X0~X7 is triggered on rising-edge or falling-edge, it will
interrupt current program execution and jump to the designated interrupt subroutine pointer
I000/I001(X0), I100/I101(X1), I200/I201(X2), I300/I301(X3), I400/I401(X4), I500/I501(X5),
I600/I601(X6), I700/I701(X7). When IRET instruction is executed, program execution
returns to the address before interrupt occurs.
When X0 (C243) works with I100/I101 (X1), X0/X1 (C246, C248, C252) works with
I400/I401, the value of C243, C246, C248, C252 will be stored in (D1240, D1241)
When X2 (C244) works with I300/I301 (X3), X2/X3 (C250, C254) works with I500/I501, the
value of C244, C250, C254 will be stored in (D1242, D1243).
2. Timer interrupt
PLC automatically interrupts the currently executed program every a fixed period of time
(2ms~99ms or 0.5ms~9.9ms) and jumps to the execution of a designated interruption
subroutine
3. Counter interrupt
The high-speed counter comparison instruction API 53 DHSCS can designate that when the
comparison reaches the target, the currently executed program will be interrupted and jump to
the designated interruption subrountine executing the interruption pointers I010, I020, I030,
I040, I050 ,I060, I070, I080.
4. Communication interrupt
I140:
Communication instruction RS (COM1 RS-232) can be designated to send interrupt request
when specific charcters are received. Interrupt I140 and specific characters is set to low byte of
D1167.
This function can be adopted when the PLC receives data of different length during the
communication. Set up the specific end word in D1167 and write the interruption subroutine
I140. When PLC receives the end word, the program will execute I140.
I150:
Communication instruction RS (COM2 RS-485) can be designated to send interrupt request
when specific charcters are received. Interrupt I150 and specific characters is set to low byte of
D1168.
This function can be adopted when the PLC receives data of different length during the
2-41
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
communication. Set up the specific end word in D1168 and write the interruption subroutine
I150. When PLC receives the end word, the program will execute I150..
I160:
Communication instruction RS (COM3 RS-485) can be designated to send interrupt request
when specific charcters are received. Interrupt I160 and specific characters is set to low byte of
D1169
This function can be adopted when the PLC receives data of different length during the
communication. Set up the specific end word in D1169 and write the interruption subroutine
I160. When PLC receives the end word, the program will execute I160
2.16 Applications of Special M Relays and D Registers
Function Group PLC Operation Flag
Number M1000~M1003
Contents:
These relays provide information of PLC operation in RUN status.
M1000:
NO contact for monitoring PLC status. M1000 remains ON when PLC is running.
M1000
Y0 PLC is running
Normally ON contact
in PLC RUN status Keeps being ON
M1001:
NC contact for monitoring PLC status. M1001 remains OFF when PLC is running.
M1002:
Enables single positive pulse for the first scan when PLC RUN is activated. Used to initialize
registers, ouptuts, or counters when RUN is executed..
M1003:
Enables single negative pulse for the first scan when PLC RUN is activated. Used to initialize
registers, ouptuts, or counters when RUN is executed.
PLC RUN
M1000
M1001
M1002
M1003
scan time
2-42
2 . Pr ogr am m i n g Conc e pts
4. Scan time could be prolonged due to complicated instruction operations or too many I/O
modules being connected. Check D1010 ~ D1012 to see if the scan time exceeds the SV in
D1000. Besides modifying the SV in D1000, users can also apply WDT instruction (API 07).
When program execution progresses to WDT instruction, the internal monitor timer will be reset
and therefore the scan time will not exceed the set value in the monitor timer.
2-43
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
10 ms
100 ms
M1013 (1 sec) 1 Hz
1 min
2-44
2 . Pr ogr am m i n g Conc e pts
normally ON contact
5. It is not necessary to adjust response time when using high-speed counters or interrupts
6. Using API 51 REFF instruction has the same effect as modifying D1020 and D1021.
2-45
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2-46
2 . Pr ogr am m i n g Conc e pts
Port
COM1 COM2 COM3
Item
Number Communication format D1036 D1120 D1109
Communication setting holding M1138 M1120 M1136
ASCII/RTU mode M1139 M1143 M1320
Slave communication address D1121 D1255
Contents:
COM ports (COM1: RS-232, COM2: RS-485, COM3: RS-485) support communication format of
MODBUS ASCII/RTU modes. When RTU format is selected, the data length should be set as 8.
COM2 and COM3 support transmission speed up to 921kbps. COM1, COM2 and COM3 can be
used at the same time.
COM1:
Can be used in master or slave mode. Supports ASCII/RTU communication format, baudrate
(115200bps max), and modification on data length (data bits, parity bits, stop bits). D1036: COM1
(RS-232) communication protocol of master/slave PLC. (b8 - b15 are not used) Please refer to
table below for setting.
COM2:
Can be used in master or slave mode. Supports ASCII/RTU communication format, baudrate
(921kbps max), and modification on data length (data bits, parity bits, stop bits). D1120: COM2
(RS-485) communication protocol of master/slave PLC. Please refer to table below for setting.
COM3:
Can be used in master or slave mode. Supports ASCII/RTU communication format, baudrate
(921kbps max), and modification on data length (data bits, parity bits, stop bits). D1109: COM3
(RS-485) communication protocol of master/slave PLC. (b8 - b15 are not used) Please refer to
table below for setting.
2-47
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Content
0: 7 data bits, 1: 8 data bits
b0 Data Length
(RTU supports 8 data bits only)
00: None
b1
Parity bit 01: Odd
b2
11: Even
b3 Stop bits 0: 1 bit, 1: 2bits
b4 0001(H1): 110
b5 0010(H2): 150
b6 0011(H3): 300
b7 0100(H4): 600
0101(H5): 1200
0110(H6): 2400
0111(H7): 4800
1000(H8): 9600
Baud rate 1001(H9): 19200
1010(HA): 38400
1011(HB): 57600
1100(HC): 115200
500000 (COM2 /
1101(HD):
COM3)
31250 (COM2 /
1110(HE):
COM3)
921000 (COM2 /
1111(HF):
COM3)
b8 Select start bit 0: None 1: D1124
b9 Select the 1st end bit 0: None 1: D1125
b10 Select the 2nd end bit 0: None 1: D1126
b11~b15 Undefined
SET M1138
SET M1120
2-48
2 . Pr ogr am m i n g Conc e pts
SET M1136
SET M1138
SET M1139
COM2:
M1002
MOV H87 D1120
SET M1120
SET M1143
COM3:
M1002
MOV H87 D1109
SET M1136
SET M1320
Note:
1. The modified communication format will not be changed when PLC state turns from RUN to
STOP.
2. If the PLC is powered OFF then ON again in STOP status, the modified communication format
on COM1~COM3 will be reset to default communication format (9600, 7, E, 1).
2-49
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Definitions of the pins in COM1: (It is suggested that users should use the Delta communication
cable DVPACAB2A30.)
CN1 3000 50 CN2
31. 0
3 CN1
1 6
4 7
2 8 Unit: mm
5
PC/HMI COM PLC COM1
9 PI N D-S UB female 8 PIN MINI DI N
Tx 3 4 Rx 2 1
Rx 2 5 Tx 5 4 3
GND 5 8 GND 8 6
1 7 1,2 5V 7
4 8
6
END
2-50
2 . Pr ogr am m i n g Conc e pts
Number D1038
Contents:
1. Data response delay time can be set when PLC is a Slave in COM2, COM3 RS-485
communication. Unit: 0.1ms. 0~10,000 adjustable.
2. By using PLC-Link, D1038 can be set to send next communication data with delay. Unit: 1 scan
cycle. 0~10,000 adjustable
normally ON
contact MOV P K20 D1039
2. Instructions related to scan time, RAMP, HKY, SEGL, ARWS and PR should be used with
fixed scan time or timed interrupt.
3. Particularly for instruction HKY, which is applied for 16-keys input operated by 4x4 matrix,
scan time should be set to 20ms or above.
4. Scan time displayed in D1010~D1012 also includes fixed scan time.
2-51
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. The descriptions of the special data registers for the analog functions:
Device Function
Average number of times analog input signals are input through CH0~CH3 of
20EX2/SX2: 1~20, Default = K2
D1062
Average number of times analog input signals are input through CH0~CH2 of
30EX2: 1~15, Default = K2
D1110 Average value of EX2/SX2 analog input channel 0 (AD 0)
D1111 Average value of EX2/SX2 analog input channel 1 (AD 1)
D1112 Average value of EX2/SX2 analog input channel 2 (AD 2)
Average value of 20EX2/SX2 analog input channel 3 (AD 3)
If D1062 is ON, the average value is the current value.
D1113
Displaying the status of the analog input channel of 30EX2
Please see the explanation below for more information.
Enable/disable 20EX2/SX2 AD channels
(0: enable (default) / 1: disable)
D1114
bit0~bit3 sets AD0~AD3.
30EX2 does not support this function.
D1116 Output value of analog output channel 0 (DA 0) of EX2/SX2
Output value of analog output channel 1 (DA 1) of 20EX2/SX2
D1117
30EX2 does not support this function.
For EX2/SX2 series, sampling time of analog/digital conversion. Sampling
D1118
time will be regarded as 2ms If D11182.
The upper/lower limit values for the analog input mode of 30EX2:
Analog input mode Upper limit value Lower limit value
-10~+10 V
+32384 -32384
Voltage -5V~+5 V
+1 V~+5 V +32384 -384
-20 mA~+20 mA +32384 -32384
Current
+4 mA~+20 mA +32384 -384
PT100/PT1000 +8100 -1900
Temperature
NI100/NI1000 +1800 -900
Device
Function
number
20EX2/SX2 analog input/output mode setting (Default=H0)
bit0~bit5: Selection between the voltage/current mode (0: Voltage; 1: Current;
Default: Voltage)
bit0~bit3: Analog inputs (AD0~AD3)
D1115 bit4~bit5: Analog outputs (DA0~DA1)
bit8~bit 13: Current mode
bit8~bit11: AD0~AD3 (0: -20 mA~20 mA; 1: 4~20 mA)
bit12~bit13: DA0~DA1 (0: 0~20 mA; 1: 4~20 mA)
30EX2 analog input/output mode setting (Default=HFFFF)
2-52
2 . Pr ogr am m i n g Conc e pts
2-53
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M0
DMOV K100000 D0
M1
DMOV K50000 D2
M2
DMOV K100000 D10
M3
DMOV K50000 D12
DMOV K0 D1030
DMOV K0 D1336
M0
SET M1119
M1
M0
DDRVI D10 D0 Y0 Y1
M1029
S0
M1
DDRVI D10 D0 Y2 Y3
M1102
S1
END
2-54
2 . Pr ogr am m i n g Conc e pts
EI
FEND
M1000
I001 INC D0
IRET
END
2-55
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
EI
M1000
DCNT C243 K100
FEND
M1000
I101 DMOV D1240 D0
IRET
END
When external interrupt (X1, I101) occurs during counting process of C243, the count value in
C243 will be stored in (D1241, D1240) and C243 is reset. After this, the interrupt subroutine I101
will be executed
Function Group Output specified pulses or seek Z phase signal when zero point is achieved.
Number M1308, D1312
Contents:
When zero point is achieved, PLC can output specified pulses or seek Z phase signal by this
function. Input terminals X2, X3 are the Z-phase signal input point of CH1, CH2. When M1308= ON,
D1312 is the setting register to specify the additional pulses within the range -30,000~30,000.
Specified value exceeds the range will be changed as the max/min value automatically. When
D1312 is set to 0, the additional pulses output function will be disabled.
Functions of other input terminals:
X4 CH1 DOG signal input X6 CH2 DOG signal input
X5 CH1 LSN signal input X7 CH2 LSN signal input
2-56
2 . Pr ogr am m i n g Conc e pts
Function Group Mapping function of SA2/SX2/SE for left-side high-speed special modules
Number M1182, D9800~D9879
Contents:
The default value of M1182 in SA2 version 2.42/SX2 version 2.20 and below is Off. When M1182 is
Off, the mapping function is enabled.
The default value of M1182 in SA2 version 2.60/SX2 version 2.40 and above/SE is On. When
M1182 is On, the mapping function is disabled.
Example:
If the modules connected to SA2 from left to right are 04DA-SL and 04AD-SL, and M1182 is Off,
D9810~D9813 will be assigned to 04DA-SL, and D9800~D9803 will be assigned to 04AD-SL.
Model name 04DA-SL 04AD-SL SA2
Channel 1 (Ch1) D9810 D9800
Channel 2 (Ch2) D9811 D9801
Channel 3 (Ch3) D9812 D9802
Channel 4 (Ch4) D9813 D9803
2-57
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. Special D and special M corresponding to Slave ID1~ Slave ID8: (M1353 = OFF, access
available for only 16 words)
MASTER PLC
SLAVE ID 1 SLAVE ID 2 SLAVE ID 3 SLAVE ID 4 SLAVE ID 5 SLAVE ID 6 SLAVE ID 7 SLAVE ID 8
Read Write Read Write Read Write Read Write Read Write Read Write Read Write Read Write
out in out in out in out in out in out in out in out in
Special D registers for storing the read/written 16 data (Auto-assigned)
D1480 D1496 D1512 D1528 D1544 D1560 D1576 D1592 D1608 D1624 D1640 D1656 D1672 D1688 D1704 D1720
D1495 D1511 D1527 D1543 D1559 D1575 D1591 D1607 D1623 D1639 D1655 D1671 D1687 D1703 D1719 D1735
Data length for accessing the Slave (Max 16 pieces of data, no access is performed when SV = 0)
D1434 D1450 D1435 D1451 D1436 D1452 D1437 D1453 D1438 D1454 D1439 D1455 D1440 D1456 D1441 D1457
Starting reference of the Slave to be accessed*
D1355 D1415 D1356 D1416 D1357 D1417 D1358 D1418 D1359 D1419 D1360 D1420 D1361 D1421 D1362 D1422
M1355 = ON, Slave status is user-defined. Set the linking status of Slave manually by M1360~M1367.
M1355 = OFF, Slave status is auto-detected. Linking status of Slave can be monitored by M1360~M1367
M1360 M1361 M1362 M1363 M1364 M1365 M1366 M1367
Data interchange status of Slaves.
M1376 M1377 M1378 M1379 M1380 M1381 M1382 M1383
Error flag for errors occurred when reading and writing (ON = normal; OFF = error)
M1392 M1393 M1394 M1395 M1396 M1397 M1398 M1399
Reading completed flag (turns Off whenever access of a Slave is completed)
M1408 M1409 M1410 M1411 M1412 M1413 M1414 M1415
Writing completed flag (turns Off whenever access of a Slave is completed)
M1424 M1425 M1426 M1427 M1428 M1429 M1430 M1431
Slave PLC*
SLAVE ID 1 SLAVE ID 2 SLAVE ID 3 SLAVE ID 4 SLAVE ID 5 SLAVE ID 6 SLAVE ID 7 SLAVE ID 8
Read Write Read Write Read Write Read Write Read Write Read Write Read Write Read Write
out in out in out in out in out in out in out in out in
D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200
D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215
3. Special D and special M corresponding to Slave ID9~ Slave ID16: (M1353 = OFF, access
available for only 16 words)
MASTER PLC
SLAVE ID 9 SLAVE ID 10 SLAVE ID 11 SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
Special D registers for storing the read/written 16 pieces of data (Auto-assigned)
D1736 D1752 D1768 D1784 D1800 D1816 D1832 D1848 D1864 D1880 D1896 D1912 D1928 D1944 D1960 D1976
D1751 D1767 D1783 D1799 D1815 D1831 D1847 D1863 D1879 D1895 D1911 D1927 D1943 D1959 D1975 D1991
Data length for accessing the Slave (Max 16 pieces of data, no access is performed when SV = 0)
D1442 D1458 D1443 D1459 D1444 D1460 D1445 D1461 D1446 D1462 D1447 D1463 D1448 D1464 D1449 D1465
Starting reference of the Slave to be accessed*
D1363 D1423 D1364 D1424 D1365 D1425 D1366 D1426 D1367 D1427 D1368 D1428 D1369 D1429 D1370 D1430
M1355 = ON, Slave status is user-defined. Set the linking status of Slave manually by M1360~M1375.
M1355 = OFF, Slave status is auto-detected. Linking status of Slave can be monitored by M1360~M1375
M1368 M1369 M1370 M1371 M1372 M1373 M1374 M1375
Data interchange status of Slaves
M1384 M1385 M1386 M1387 M1388 M1389 M1390 M1391
Access error flag (ON = normal; OFF = error)
M1400 M1401 M1402 M1403 M1404 M1405 M1406 M1407
Reading completed flag (turns Off whenever access of a Slave is completed)
M1416 M1417 M1418 M1419 M1420 M1421 M1422 M1423
Writing completed flag (turns Off whenever access of a Slave is completed)
M1432 M1433 M1434 M1435 M1436 M1437 M1438 M1439
Slave PLC*
SLAVE ID 9 SLAVE ID 10 SLAVE ID 11 SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200
D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215
2-58
2 . Pr ogr am m i n g Conc e pts
4. Special D and special M corresponding to Slave ID1~ID8: (M1353 = ON, access available for
up to 50 words) (DVP-SE V1.6 supports 100 words at most.)
MASTER PLC
SLAVE ID 1 SLAVE ID 2 SLAVE ID 3 SLAVE ID 4 SLAVE ID 5 SLAVE ID 6 SLAVE ID 7 SLAVE ID 8
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
M1353 = ON, enable access up to 50 words.
The user can specify the starting register for storing the read/written data in registers below.
D1480 D1496 D1481 D1497 D1482 D1498 D1483 D1499 D1484 D1500 D1485 D1501 D1486 D1502 D1487 D1503
M1356 = ON, the user can specify the station number of Slave ID1~ID8 in D1900~D1907
D1900 D1901 D1902 D1903 D1904 D1905 D1906 D1907
Data length for accessing the Slave (Max 50 pieces of data, no access is performed when SV = 0)
D1434 D1450 D1435 D1451 D1436 D1452 D1437 D1453 D1438 D1454 D1439 D1455 D1440 D1456 D1441 D1457
Starting reference of the Slave to be accessed*
D1355 D1415 D1356 D1416 D1357 D1417 D1358 D1418 D1359 D1419 D1360 D1420 D1361 D1421 D1362 D1422
M1355 = ON, Slave status is user-defined. Set the linking status of Slave manually by M1360~M1367.
M1355 = OFF, Slave status is auto-detected. Linking status of Slave can be monitored by M1360~M1367
M1368 M1369 M1370 M1371 M1372 M1373 M1374 M1375
Data interchange status of Slaves
M1376 M1377 M1378 M1379 M1380 M1381 M1382 M1383
Error flag for errors occurred when reading and writing (ON = normal; OFF = error)
M1392 M1393 M1394 M1395 M1396 M1397 M1398 M1399
Reading completed flag (turns Off whenever access of a Slave is completed)
M1408 M1409 M1410 M1411 M1412 M1413 M1414 M1415
Writing completed flag (turns Off whenever access of a Slave is completed)
M1424 M1425 M1426 M1427 M1428 M1429 M1430 M1431
Slave PLC*
SLAVE ID 1 SLAVE ID 2 SLAVE ID 3 SLAVE ID 4 SLAVE ID 5 SLAVE ID 6 SLAVE ID 7 SLAVE ID 8
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200
D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215
2-59
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
5. Special D and special M corresponding to Slave ID9~ID16: (M1353 = ON, access available for
up to 50 words) (DVP-SE V1.6 supports 100 words at most.)
MASTER PLC
SLAVE ID 9 SLAVE ID 10 SLAVE ID 11 SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
M1353 = ON, enable access up to 50 words.
The user can specify the starting register for storing the read/written data in registers below.
D1488 D1504 D1489 D1505 D1490 D1506 D1491 D1507 D1492 D1508 D1493 D1509 D1494 D1510 D1495 D1511
M1356 = ON, the user can specify the station number of Slave ID9~ID16 in D1908~D1915
D1908 D1909 D1910 D1911 D1912 D1913 D1914 D1915
Data length for accessing the Slave (Max 50 pieces of data, no access is performed when SV = 0)
D1442 D1458 D1443 D1459 D1444 D1460 D1445 D1461 D1446 D1462 D1447 D1463 D1448 D1464 D1449 D1465
Starting reference of the Slave to be accessed*
D1363 D1423 D1364 D1424 D1365 D1425 D1366 D1426 D1367 D1427 D1368 D1428 D1369 D1429 D1370 D1430
M1355 = ON, Slave status is user-defined. Set the linking status of Slave manually by M1368~M1375.
M1355 = OFF, Slave status is auto-detected. Linking status of Slave can be monitored by M1368~M1375
M1368 M1369 M1370 M1371 M1372 M1373 M1374 M1375
Data interchange status of Slaves
M1384 M1385 M1386 M1387 M1388 M1389 M1390 M1391
Access error flag (ON = normal; OFF = error)
M1400 M1401 M1402 M1403 M1404 M1405 M1406 M1407
Reading completed flag (turns Off whenever access of a Slave is completed)
M1416 M1417 M1418 M1419 M1420 M1421 M1422 M1423
Writing completed flag (turns Off whenever access of a Slave is completed)
M1432 M1433 M1434 M1435 M1436 M1437 M1438 M1439
Slave PLC*
SLAVE ID 9 SLAVE ID 10 SLAVE ID 11 SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16
Read Write Read Write Read Write Reado Write Read Write Read Write Read Write Read Write
out in out in out in ut in out in out in out in out in
D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200 D100 D200
D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215 D115 D215
*Note:
Default setting for starting reference of the Slave (DVP-PLC) to be read: H1064 (D100)
Default setting for starting reference of the Slave (DVP-PLC) to be written: H10C8 (D200)
2-60
2 . Pr ogr am m i n g Conc e pts
6. Special D and special M corresponding to Slave ID17~ID24: (M1353 = ON, access available
for up to 100 words) (Model supported: DVP-SE V1.6)
MASTER PLC
SLAVE ID 17 SLAVE ID 18 SLAVE ID 19 SLAVE ID 20 SLAVE ID 21 SLAVE ID 22 SLAVE ID 23 SLAVE ID 24
Read Write Read Write Read Write Read Write Read Write Read Write Read Write Read Write
out in out in out in out in out in out in out in out in
DVP-SE supports M1353. When M1353 is On, 32 stations in the Link and the function of reading/writing more than 16 data
(SET M1353) are enabled. The user can specify the starting register for storing the read/written data in registers below.
D1576 D1592 D1577 D1593 D1578 D1594 D1579 D1595 D1580 D1596 D1581 D1597 D1582 D1598 D1583 D1599
If M1356 is ON, users can set the station numbers of slave ID17~ID24 in D1916~D1923. The master station sends
commands according to the station numbers set.
D1916 D1917 D1918 D1919 D1920 D1921 D1922 D1923
Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number
of data of data of data of data of data of data of data of data of data of data of data of data of data of data of data of data
D1544 D1560 D1545 D1561 D1546 D1562 D1547 D1563 D1548 D1564 D1549 D1565 D1550 D1566 D1551 D1567
Start Communication Address
D1512 D1528 D1513 D1529 D1514 D1530 D1515 D1531 D1516 D1532 D1517 D1533 D1518 D1534 D1519 D1535
LINK in SLAVE PLC?
M1440 M1441 M1442 M1443 M1444 M1445 M1446 M1447
Action flag for SLAVE PLC from MASTER PLC
M1456 M1457 M1458 M1459 M1460 M1461 M1462 M1463
Read/write error flag
M1472 M1473 M1474 M1475 M1476 M1477 M1478 M1479
Reading completed flag (turns Off whenever read/write a station is completed)
M1488 M1489 M1490 M1491 M1492 M1493 M1494 M1495
Writing completed flag (turns Off whenever read/write a station is completed)
M1504 M1505 M1506 M1507 M1508 M1509 M1510 M1511
2-61
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7. Special D and special M corresponding to Slave ID25~ID32: (M1353 = ON, access available
for up to 100 words) (Mode supported: DVP-SE V1.6)
MASTER PLC
SLAVE ID 25 SLAVE ID 26 SLAVE ID 27 SLAVE ID 28 SLAVE ID 29 SLAVE ID 30 SLAVE ID 31 SLAVE ID 32
Read Write Read Write Read Write Read Write Read Write Read Write Read Write Read Write
out in out in out in out in out in out in out in out in
DVP-SE supports M1353. When M1353 is On, 32 stations in the Link and the function of reading/writing more than 16 data
(SET M1353) are enabled. The user can specify the starting register for storing the read/written data in registers below.
D160
D1584 D1600 D1585 D1601 D1586 D1602 D1587 D1603 D1588 D1604 D1589 D1605 D1590 D1606 D1591
7
If M1356 is ON, users can set the station numbers of slave ID25~ID32 in D1924~D1931. The master station sends
commands according to the station numbers set.
D1924 D1925 D1926 D1927 D1928 D1929 D1930 D1931
Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number
of data of data of data of data of data of data of data of data of data of data of data of data of data of data of data of data
D157
D1552 D1568 D1553 D1569 D1554 D1570 D1555 D1571 D1556 D1572 D1557 D1573 D1558 D1574 D1559
5
Start Communication Address
D154
D1520 D1536 D1521 D1537 D1522 D1538 D1523 D1539 D1524 D1540 D1525 D1541 D1526 D1542 D1527
3
LINK in SLAVE PLC?
M1448 M1449 M1450 M1451 M1452 M1453 M1454 M1455
Action flag for SLAVE PLC from MASTER PLC
M1464 M1465 M1466 M1467 M1468 M1469 M1470 M1471
Read/write error flag
M1480 M1481 M1482 M1483 M1484 M1485 M1486 M1487
Reading completed flag (turns Off whenever read/write a station is completed)
M1496 M1497 M1498 M1499 M1500 M1501 M1502 M1503
Writing completed flag (turns Off whenever read/write a station is completed)
M1512 M1513 M1514 M1515 M1516 M1517 M1518 M1519
2-62
2 . Pr ogr am m i n g Conc e pts
2-63
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1355 = ON, Slave status is user-defined. Set the linking statuses of slave ID 1~slave
ID 16 (slave ID 1~slave ID 32) manually by M1360~M1375 (M1360~M1375 and
M1440~M1455). M1355 = OFF, the linking statuses of slave ID 1~slave ID 16 (slave ID
1~slave ID 32) are auto-detected. The linking statuses of slave ID 1~slave ID 32 can
be monitored by M1360~M1375, and M1440~M1455.
Select auto mode on PLC LINK by M1351 or manual mode by M1352 (Note that the 2
flags should not be set ON at the same time.) After this, set up the times of polling
cycle by D1431.
Finally, enable PLC LINK (M1350)
11. The Operation of Master PLC:
a) M1355 = ON indicates that Slave status is user-defined. Set the linking status of slave ID
1~slave ID 16 (slave ID 1~slave ID 32) manually by M1360~M1375 (M1360~M1375 and
M1440~M1455).
b) M1355 = OFF indicates that the linking statuses of slave ID 1~slave ID 16 (slave ID
1~slave ID 32) are auto-detected. The linking statuses of slave ID 1~slave ID 32 can be
monitored by M1360~M1375, and M1440~M1455.
Enable PLC LINK (M1350). Master PLC will detect the connected Slaves and store the
number of connected PLCs in D1433. The time for detection differs by number of
connected Slaves and time-out setting in D1129.
M1360~M1375 indicate the linking statuses of slave ID 1~slave ID 16. If M1353 is ON,
M1360~M1375 and M1440~M1455 will indicate the linking statuses of slave ID
1~slave ID 32.
If no slave is detected, M1350 will be OFF and PLC LINK will be stopped.
PLC will only detect the number of slaves at the first time when M1350 turns ON.
After auto-detection is completed, master PLC starts to access each connected slave.
Once slave PLC is added after auto-detection, master PLC cannot access it unless
auto-detection is conducted again.
c) Simultaneous read/write function (M1354) has to be set up before enabling PLC LINK.
Setting up this flag during PLC LINK execution will not take effect.
d) When M1354 = ON, PLC takes Modbus Function H17 (simultaneous read/write function)
for PLC LINK communication function. If the data length to be written is set to 0, PLC will
select Modbus Function H03 (read multiple WORDs) automatically. In the same way, if
data length to be read is set to 0, PLC will select Modbus Function H06 (write single
WORD) or Modbus Function H10 (write multiple WORDs) for PLC LINK communication
function.
e) When M1353 = OFF, PLC LINK accesses the Slave with max 16 words, and the data is
automatically stored in the corresponding registers. When M1353 = ON, up to 100 words
are accessible and the user can specify the starting register for storing the read/written
data.
For example, if the register for storing the read/written data on Slave ID1 is specified as
D1480 = K500, D1496 = K800, access data length D1434 = K50, D1450 = K50, registers
of Master PLC D500~D549 will store the data read from Slave ID1, and the data stored in
D800~D849 will be written into Slave ID1.
f) Master PLC conducts reading before writing. Both reading and writing is executed
according to the range specified by user.
g) Master PLC accesses slave PLCs in order, i.e. data access moves to next slave only when
access on previous slave is completed.
h) Modbus Function H03 will be replaced by Modbus Function H04 for read/write function
code. M1700~M1715 are corresponding to Slave ID 1~16 orderly; when the status is ON,
the read/write function code can be changed from H04 to H04 for the following series.
ES2/ 12SA2/
Series ES2-C ES2-E SS2 12SE 26SE 28SA2
EX2 SX2
Firmware
V3.48 V3.48 V3.48 V3.0 V3.60 -- V2.0 V3.0
version
2-64
2 . Pr ogr am m i n g Conc e pts
b) Manual mode (M1352): When manual mode is selected, times of polling cycle in D1431
has to be set up. A full polling cycle refers to the completion of accessing all Slaves. When
PLC LINK is enabled, D1432 starts to store the times of polling. When D1431 = D1432,
PLC LINK stops and M1352 is reset. When M1352 is set ON again, PLC will start the
polling according to times set in D1431 automatically.
c) Note:
Auto mode M1351 and manual mode M1352 cannot be enabled at the same time. If
M1351 is enabled after M1352 is ON, PLC LINK will stop and M1350 will be reset.
Communication timeout setting can be modified by D1129 with available range 200
D1129 3000. PLC will take the upper / lower bound value as the set value if the
specified value is out of the available range. D1129 has to be set up before M1350 =
ON.
PLC LINK function is only valid when baud rate is higher than 1200 bps. When baud
rate is less than 9600 bps, please set communication time-out to more than 1 second.
The communication is invalid when data length to be accessed is set to 0.
Access on 32-bit high speed counters (C200~C255) is not supported.
Available range for D1399: 1 ~ 230. PLC will take the upper / lower bound value as the
set value if the specified value exceeds the availanle range.
D1399 has to be set up before enabling PLC LINK. Setting up this register during PLC
LINK execution will not take effect.
Advantage of using D1399 (Designating the ID of starting Slave):
In old version PLC LINK, PLC detects Slaves from ID1 to ID16. Therefore, when PLC
nd
LINK is applied in multi-layer networks, e.g. 3 layers of networks, the Slave ID of 2
rd
and 3 layer will be repeated. When Slave ID is repeated, i.e. the same as Master ID,
rd
the Slave will be passed. In this case, only 15 Slaves can be connected in 3 layer. To
solve this problem, D1399 can be applied for increasing the connectable Slaves in
multi-layer network structure.
2-65
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
13. Operation flow chart: In the flow chart below, there are 16 slaves, and 50 words are accessed.
Set starting refer ence of the Slave PLC to be read: D1355~D1370
Set data length for reading from Slave PLC: D1434~D1449
Set starting refer ence of the Slave PLC to be written: D1414~D1430
Set data length for writing in Slave PLC: D1450~D1465
(PLC will take default or previous setting as the set value
if these r egisters ar e not specified)
Enable Disable
M 1355
SE T M1351 SE T M1352
Set times of polling
cycle (D1431)
SET M1350
Star t to execute EASY PLC LINK
2-66
2 . Pr ogr am m i n g Conc e pts
14. Example 1: Connect 1 Master and 2 Slaves by RS-485 and exchange 16 data between Master
and Slaves through PLC LINK
a) Write the ladder diagram program into Master PLC (ID#17)
M1002
MOV K17 D1121 Master ID#
M1350
END
b) When X1 = On, the data exchange between Master and the two Slaves will be
automatically executed by PLC LINK. The data in D100 ~ D115 in the two Slaves will be
read into D1480 ~ D1495 and D1512 ~ D1527 of the Master, and the data in D1496 ~
D1511 and D1528 ~ D1543 will be written into D200 ~ D215 of the two Slaves.
Master PLC *1 Slave PLC*2
Read
D1480 ~ D1495 D100 ~ D115 of Slave ID#1
Write
D1496 ~ D1511 D200 ~ D215 of Slave ID#1
Read
D1512 ~ D1527 D100 ~ D115 of Slave ID#2
Write
D1528 ~ D1543 D200 ~ D215 of Slave ID#2
c) Assume the data in registers for data exchange before enabling PLC LINK (M1350 = OFF)
is as below:
Master PLC Preset value Slave PLC Preset value
D1480 ~ D1495 K0 D100 ~ D115 of Slave ID#1 K5,000
D1496 ~ D1511 K1,000 D200 ~ D215 of Slave ID#1 K0
D1512 ~ D1527 K0 D100 ~ D115 of Slave ID#2 K6,000
D1528 ~ D1543 K2,000 D200 ~ D215 of Slave ID#2 K0
After PLC LINK is enabled (M1350 = ON), the data in registers for data exchange
becomes:
Master PLC Preset value Slave PLC Preset value
D1480 ~ D1495 K5,000 D100 ~ D115 of Slave ID#1 K5,000
D1496 ~ D1511 K1,000 D200 ~ D215 of Slave ID#1 K1,000
2-67
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X1
M1351 Auto mode
END
b) M1355 = ON. Set the Slave to be linked manually by M1360~M1375. Set ON M1360 to
link Slave ID#1.
c) Address H2100-H2105 maps to registers D1480-D1485 of PLC. When X1 = ON, PLC
LINK executes, and the data in H2100-H2105 will be displayed in D1480-D1485.
d) Address H2000-H2001 maps to registers D1496-D1497 of PLC. When X1 = ON, PLC LINK
executes, and the parameter in H2000-H2001 will be specified by D1496-D1497.
e) Commands of VFD can be specified by changing the value in D1496. (e.g. D1496 =
H12=>VFD forward operation; D1496 = H1=> VFD stops)
f) Frequency of VFD can be specified by changing the value in D1497. (e.g. D1497 = K5000,
set VFD frequency as 50kHz.)
g) In addition to VFD AC motor drives, devices support MODBUS protocol such as DTA/DTB
temperature controllers and ASDA servo drives can also be connected as Slaves. Up to 16
Slaves can be connected.
16. TD1354 is a PLC link scan cycle (unit: 1ms), and max. display value is K32000. D1354 = K0
when PLC Link stops or when the first scan is completed.
2-68
2 . Pr ogr am m i n g Conc e pts
2. The minimum input frequency which can be detected by the function is 0.5Hz (K500), the
maximum input frequency which can be detected by the function is 1KHz (K1000000). If the
input frequency is less than 0.5Hz, or there is no pulse input for more than 2 seconds, the
value in the corresponding special D device will automatically become 0. If the input frequency
exceeds 1KHz, the PLC will continue catch the input frequency. If the input frequency exceeds
the hardware specifications for the input, the PLC will not be able to catch the input frequency.
3. If the frequency detection function is disabled (the special M device is Off), the last value which
is stored in the special D device will be retained.
4. If the input frequency is less than 100Hz, the error will be less than one ten thousandth. If the
input frequency exceeds 100Hz, the error will become bigger, but the maximum error will not
exceed one one thousandth.
5. Difference between the frequency detection function and SPD: The frequency detection
function is mainly used to detect the frequencies less than 1KHz, and is used in the application
environments which need high precision (unit: 0.001Hz). For example, the frequency detection
function can be used to monitor the output frequency of a generator.
6. After the frequency detection function is enabled, the other functions of the input will not be
enabled. (For example, the external interrupt or SPD will not be enabled after the frequency
detection function is enabled.)
7. DVP-ES2/EX2 series PLCs (exclusive of DVP-ES2-C series PLCs) whose firmware version is
3.22 (or above), and DVP-SX2 series PLCs whose firmware version is 2.66 (or above) support
this function.
8. Example: Detecting X0s input frequency
Program in the PLC:
M0
DMOV K0 D1056
M0
M1357
If X0 s input frequency is 50Hz, the 32-bit value in (D1057, D1056) will be K50000.
2. The function needs to be used with an external interrupt (X6 (I600/I601) or X7 (I700/I701)). The
value in a hardware counter is moved to a special D device when there is a transition in a
fetching signal from low to high or form high to low. The setting of an external interrupt
determines when the value in a hardware counter is moved to a special D device.
2-69
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. DVP-ES2/EX2/SS2 series PLCs whose firmware version is 3.28 (or above), and DVP-
SA2/SX2 series PLCs whose firmware version is 2.82 (or above) support this function.
4. Example: The value in C243 is fetched when there is a transition in X6s signal from low to high.
Program in the PLC:
EI
M1002
Enabling the fetching
SET M1598 of the value in C243
M1000
DCNT C243 K100
FEND
M1000
I601 DMOV D1150 D0 Moving the value fetched from C243
to (D1,D0).
IRET
END
Function Group When the conditional contacts are closed, execute the ramp-down on the
outputs
Number M1334, M1335
Contents:
1. When M1334 or M1335 is enabled, execute API59 PLSR/DPLSR instructions on Y0 or Y2 to
ramp-down when the conditional contacts are closed.
2. When M1334 or M1335 is enabled, execute API158 DDRVI or API159 DDRVA instructions on
CH0 (CH1) to ramp-down when the conditional contacts are closed.
3. This function is available for the followings:
ES2/EX 12SA2/
Series ES2-C ES2-E SS2 26SE 28SA2
2 SX2
Firmware
V3.42 V3.48 V3.48 V2.86 V3.28 V2.0 V3.0
version
2-70
Instruction Set
This chapter explains all of the instructions that are used with DVP-ES2/EX2/SS2/
SA2/SX2/SE as well as detailed information concerning the usage of the
instructions.
Chapter Contents
3-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Execution speed
(us)
Instruction Function Operand Steps
ES2/EX2/SS2
SE
SA2/SX2
LD Load NO contact X, Y, M, S, T, C 0.76 0.64 1~3
LDI Load NC contact X, Y, M, S, T, C 0.78 0.68 1~3
AND Connect NO contact in series X, Y, M, S, T, C 0.54 0.58 1~3
ANI Connect NC contact in series X, Y, M, S, T, C 0.56 0.62 1~3
OR Connect NO contact in parallel X, Y, M, S, T, C 0.54 0.62 1~3
ORI Connect NC contact in parallel X, Y, M, S, T, C 0.56 0.64 1~3
ANB Connect a block in series N/A 0.68 0.68 1
ORB Connect a block in parallel N/A 0.76 0.76 1
Start of branches. Stores current N/A
MPS 0.74 0.68 1
result of program evaluation
Reads the stored current result N/A
MRD 0.64 0.54 1
from previous MPS
End of branches. Pops (reads and N/A
MPP resets) the stored result in 0.64 0.54 1
previous MPS
OUT Output coil Y, S, M 0.88 0.68 1~3
SET Latches the ON status Y, S, M 0.76 0.68 1~3
Y, M, S, T, C, D,
RST Resets contacts, registers or coils 2.2 1.04 3
E, F
MC Master control Start N0~N7 1 0.8 3
MCR Master control Reset N0~N7 1 0.8 3
END Program End N/A 1 0.8 1
NOP No operation N/A 0.4 0.5 1
P Pointer P0~P255 0.4 0.5 1
I Interrupt program pointer I 0.4 0.5 1
STL Step ladder start instruction S 2.2 2 1
RET Step ladder return instruction N/A 1.6 1.4 1
Negative contact to Positive
NP N/A 1.66 0.72 1
contact
Positive contact to Negative
PN N/A 1.62 0.72 1
contact
Note: The execution speed is obtained by basic test programs, therefore the actual instruction
execution time could be longer due to a more complicated program, e.g. program contains multiple
interruptions or high speed input/output.
Explanations:
1. The LD instruction is used to load NO contact which connects to left side bus line or starts a
new block of program connecting in series or parallel connection.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
3-2
3 . I ns t r u c ti o n Se t
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
X0 X1 LD X0 Load NO contact X0
Y1
AND X1 Connect NO contact X1 in series
OUT Y1 Drive coil Y1
Explanations:
1. The LDI instruction is used to load NC contact which connects to left side bus line or starts a
new block of program connecting in series or parallel connection.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
3-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Explanations:
1. The AND instruction is used to connect NO contact in series.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
Explanations:
1. The ANI instruction is used to connect NC contact in series.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
X1 X0 LD X1 Load NO contact X1
Y1
ANI X0 Connect NC contact X0 in series
OUT Y1 Drive Y1 coil
3-4
3 . I ns t r u c ti o n Se t
Explanations:
1. The OR instruction is used to connect NO contact in parallel.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
X0 LD X0 Load NO contact X0
Y1
X1 OR X1 Connect NO contact X1 in parallel
OUT Y1 Drive Y1 coil
Explanations:
1. The ORI instruction is used to connect NC contact in parallel.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands X, Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
3-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example:
Ladder diagram: Instruction: Operation:
X0 LD X0 Load NO contact X0
Y1
X1 ORI X1 Connect NC contact X1 in parallel
OUT Y1 Drive Y1 coil
Explanations:
The ORB instruction is used to connect a circuit block to the preceding block in parallel. Generally,
the circuit block to be connected in parallel consists of several contacts which form a serial
connection structure.
3-6
3 . I ns t r u c ti o n Se t
Program example:
Ladder diagram: Instruction: Operation:
Explanations:
As the start of branches, MPS stores current result of program evaluation at the point of
divergence.
Explanations:
MRD reads the stored current result from previous MPS and operates with the contact connected
after MRD.
3-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example:
Ladder diagram: Instruction: Operation:
MPS LD X0 Load NO contact X0
X0 X1
Y1 MPS Store current status
X2
AND X1 Connect NO contact X1 in series
MRD M0
OUT Y1 Drive Y1 coil
Y2
MPP
MRD Read the stored status
END
AND X2 Connect NO contact X2 in series
OUT M0 Drive M0 coil
MPP Read the stored status and reset
OUT Y2 Drive Y2 coil
END End of program
Note: When compiling ladder diagram with WPLSoft, MPS, MRD and MPP will be automatically
added to the compiled results in instruction format. However, users programming in instruction
mode have to enter branch instructions as required.
Explanations:
1. Output the program evaluation results before OUT instruction to the designated device.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Status of coil contact
OUT instruction
Evaluation result Associated Contacts
Coil
NO contactnormal open NC contactnormal close
FALSE OFF Current blocked Current flows
TRUE ON Current flows Current blocked
Program example:
Ladder diagram: Instruction: Operation:
X0 X1 LDI X0 Load NC contact X0
Y1
AND X1 Connect NO contact X1 in series
OUT Y1 Drive Y1 coil
3-8
3 . I ns t r u c ti o n Se t
Explanations:
1. When the SET instruction is driven, its designated device will be ON and latched whether the
SET instruction is still driven. In this case, RST instruction can be applied to turn off the
device.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder Diagram: Instruction: Operation:
X0 Y0 LD X0 Load NO contact X0
SET Y1
ANI Y0 Connect NC contact Y0 in series
SET Y1 Drive Y1 and latch the status
Explanations:
1. Device status when RST instruction is driven:
Device Status
S, Y, M Coil and contact are set to OFF.
T, C Current value is cleared. Associated contacts or coils are reset .
D, E, F The content is set to 0.
3-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Status of designated devices remains the same when RST instruction is not executed.
2. DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series PLCs whose version is
3.00/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose version is 2.40 (and above) support the operands Y, M,
and S. These operands can be qualified by E or F. Users have to use WPLSoft version 2.31
(or above)/ISPSoft version 2.01 (or above).
Program example:
Ladder diagram: Instruction: Operation:
X0 LD X0 Load NO contact X0
RST Y5
RST Y5 Reset contact Y5
Explanations:
MC is the master-control start instruction. When MC instruction executes, the program execution
turns to the designated nest level and executes the instructions between MC and MCR. However,
MCR is the master-control reset instruction placed at the end of the designated nest level and no
drive contact is required before MCR. When MC/MCR is not active, devices and instructions
between MC/MCR will operate as the following table.
Instruction type Explanation
General purpose timer Present value = 0, Coil is OFF, No action on associated contact
Subroutine timer Present value = 0, Coil is OFF, No action on associated contact
Accumulative timer Coil is OFF, present value and contact status remains
Counter Coil is OFF, present value and contact status remains
Coils driven by OUT instruction All OFF
Devices driven by SET/RST
Stay intact
instructions
All disabled.
The FOR-NEXT nested loop will still execute back and forth for N
Application instructions
times. Instructions between FOR-NEXT will act as other
instructions between MC and MCR.
3-10
3 . I ns t r u c ti o n Se t
Note: MC-MCR master-control instruction supports max 8 layers of nest levels. Please use the
instructions in order from N0~ N7.
Program example:
Ladder diagram: Instruction: Operation:
X0 LD X0 Load NO contact X0
MC N0
MC N0 Enable N0 nest level
X1
Y0 LD X1 Load NO contact X1
X2 OUT Y0 Drive coil Y1
MC N1 :
X3 LD X2 Load NO contact X2
Y1
MC N1 Enable N1 nest level
Explanations:
END instruction needs to be connected at the end of program. PLC will scan from address 0 to
END instruction and return to address 0 to scan again.
Explanation:
NOP instruction does not conduct any operations in the program, i.e. the operation result remains
the same after NOP is executed. Generally NOP is used for replacing certain instruction without
altering original program length.
3 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example:
Ladder Diagram: Instruction: Operation:
NOP instruction will be LD X0 Load NO contact X0
omitted in the ladder diagram
NOP No operation
X0 OUT Y1 Drive coil Y1
NOP Y1
Explanation:
When the conditions preceding NP command change from false to true, NP command (works as
contact A) will be ON for a scan cycle. In the next scan cycle it turns OFF.
Program Example:
Ladder Diagram: Instruction: Operation:
LD M0 Load NO contact M0
M0 M1 AND M1 Connect NO contact M1 in series
P Y0
NP Negative contact to Positive contact
OUT Y0 Drive coil Y0
Timing Diagram:
M0
M1
A scan cycle A scan cycle
Y0
Explanation:
When the conditions preceding PN command change from true to false, PN command (works as
contact A) will be ON for a scan cycle. In the next scan cycle it turns OFF.
Program Example:
Ladder Diagram: Instruction: Operation:
LD M0 Load NO contact M0
M0 M1 AND M1 Connect NO contact M1 in series
P Y0
PN Negative contact to Positive contact
OUT Y0 Drive coil Y0
3-12
3 . I ns t r u c ti o n Se t
Timing Diagram:
M0
M1
A scan cycle A scan cycle
Y0
3.3 Pointers
Explanation:
Pointer P is used with API 00 CJ and API 01 CALL instructions. The use of P does not need to start
from P0, and the No. of P cannot be repeated; otherwise, unexpected errors may occur. For other
information on P pointers, please refer to section 2.12 in this manual
Program example 1:
Ladder Diagram: Instruction: Operation:
X0 LD X0 Load NO contact X0
CJ P10
CJ P10 Jump to P10
X1 :
P10 Y1
P10 Pointer P10
LD X1 Load NO contact X1
OUT Y1 Drive coil Y1
Explanations:
A interruption program has to start with a interruption pointer (I) and ends with API 03 IRET. I
instruction has to be used with API 03 IRET, API 04 EI, and API 05 DI. For detailed information on
interrupt pointes, please refer to section 2.12 in this manual
3-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example:
Ladder diagram: Instruction Operation:
code:
EI Enable interruption
EI
Allowable range LD X1 Load NO contact X1
X1 for interruption
Y1 OUT Y1 Drive Y1 coil
:
DI
Pointer of DI Disable interruption
interruption :
program FEND
X2 FEND Main program ends
I 001 Y2 I001 Interruption pointer
Interruption
subroutine LD X2 Load NO contact X2
IRET
OUT Y2 Drive Y2 coil
:
IRET Interruption return
External interrupt:
ES2 supports 8 external input interrupts: (I000/I001, X0), (I100/I101, X1), (I200/I201, X2),
(I300/I301, X3), (I400/I401, X4), (I500/I501, X5), (I600/I601, X6) and (I700/I701, X7). (01,
rising-edge trigger , 00, falling-edge trigger )
Timer Interrupts:
ES2 supports 2 timer interrupts: I602~I699, I702~I799, (Timer resolution: 1ms)
Communication Interrupts:
ES2 supports 3 communication interrupts: I140, I150 and I160.
Counter Interrupts:
ES2 supports 8 high-speed counter interrupts: I010, I020, I030, I040, I050, I060, I070 and I080.
3-14
3 . I ns t r u c ti o n Se t
1. PLC instructions are provided with a unique mnemonic name to make it easy to remember
instructions. In the example below the API number given to the instruction is 12, the
mnemonic name is MOV and the function description is Move.
API Mnemonic Operands Function Controllers
SA2
12 D MOV P Move ES2/EX2 SS2 SX2
SE
X0
MOV K10 D10
Instruction Operand
3-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Source: if there are more than one source is required, it will be indicated as S1, S2....etc.
Destination: if there are more than one destination is required, it will be indicated as D1,
D2....etc.
If the operand can only be constant K/H or a register, it will be represented as m, m1, m2, n, n1,
n2etc.
1 2 3 4 5
PU LSE 16 -b it 32 -b it
8 E S2 /E X2 S S2 S A2 S X2 E S2 /E X2 S S2 S A2 S X2 E S2 /E X2 S S2 S A2 S X2
3-16
3 . I ns t r u c ti o n Se t
Operands
3. Bit devices X, Y, M, and S can be combined into word device, storing values and data for
operations in the form of KnX, KnY, KnM and KnS in an application instruction.
4. Data register D, timer T, counter C and index register E, F are designated by general
operands.
5. A data register D consists of 16 bits, i.e. a 32-bit data register consists of 2 consecutive D
registers.
6. If an operand of a 32-bit instruction designates D0, 2 consecutive registers D1 and D0 will be
occupied. D1 is thehigh word and D0 is the low word. This proncipal also applys to timer T
and 16-bit counters C0 ~ C199.
7. When the 32-bit counters C200 ~ C255 are used as data registers, they can only be
designataed by the operands of 32-bit instructions.
Operand Data format
8. X, Y, M, and S are defined as bit devices which indicate ON/OFF status.
9. 16-bit (or 32-bit) devices T, C, D, and registers E, F are defined as word devices.
3-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
10. Kn can be placed before bit devices X, Y, M and S to make it a word device for performing
word-device operations. (n = 1 refers to 4 bits. For 16-bit instruction, n = K1 ~ K4; for 32-bit
instruction, n = K1 ~ K8). For example, K2M0 refers to 8 bits, M0 ~ M7.
Kn values
16-bit instruction 32-bit instruction
Designated value: K-2,147,483,648 ~
Designated value: K-32,768 ~ K32,767
K2,147,483,647
16-bit instruction: (K1~K4) 32-bit instruction: (K1~K8)
K1 (4 bits) 0~15 K1 (4 bits) 0~15
K2 (8 bits) 0~255 K2 (8 bits) 0~255
K3 (12 bits) 0~4,095 K3 (12 bits) 0~4,095
K4 (16 bits) -32,768~+32,767 K4 (16 bits) 0~65,535
K5 (20 bits) 0~1,048,575
K6 (24 bits) 0~167,772,165
K7 (28 bits) 0~268,435,455
K8 (32 bits) -2,147,483,648~+2,147,483,647
Flags
1. General Flags
The flags listed below are used for indicating the operation result of the application
instruction:
M1020: Zero flag
M1021: Borrow flag
M1022: Carry flag
M1029: Execution of instruction is completed
All flags will turn ON or OFF according to the operation result of an instruction. For example,
the execution result of instructions ADD/SUB/MUL/DVI will affect the status of M1020 ~
M1022. When the instruction is not executed, the ON/OFF status of the flag will be held. The
status of the four flags relates to many instructions. See relevant instructions for more
details.
3-18
3 . I ns t r u c ti o n Se t
4. For counters C232~C242, the total max times for using DHSCS, DHSCR and DHSZ
instructions: 6. DHSZ can only be used less than 6 times.
5. For counters C243, C245~C248, C251, C252, the total max times for using DHSCS, DHSCR
3-19
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
and DHSZ instructions: 4. DHSZ takes up 2 times of the total available times.
6. For counters C244, C249, C250, C253, C254, the total max times for using DHSCS, DHSCR
and DHSZ instructions: 4. DHSZ takes up 2 times of the total available times.
Limitation of synchronized execution
Most instructions have no limitation on the times to be used in a program, but there are limitations
on the number of instruction to be executed in the same scan cycle.
1. Only 1 instruction can be executed at the same scan cycle: API 52 MTR, API 69 SORT, API
70 TKY, API 71 HKY, API 72 DSW, API 74 SEGL, API 75 ARWS.
2. Only 4 instruction can be executed at the same scan cycle: API 56 SPD, API 169 HOUR.
3. There is no limitation on the times of using the high-speed output instructions API 57 PLSY,
API 58 PWM, API 59 PLSR, API 156DZRN, API 158 DDRVI, API 159 DDRVA and API 195
DPTPO, but only one high-speed output instruction will be executed in the same scan time.
4. There is no limitation on the times of using the communication instructions API 80 RS, API
100 MODRD, API 101 MODWR, API 102 FWD, API 103 REV, API 104 STOP, API 105 RDST,
API 106 RSTEF , API 150 MODRW, but only one communication instruction will be executed
on single COM port during the same scan cycle.
Numeric Values
1. Devices indicates ON/OFF status are called bit devices, e.g. X, Y, M and S. Devices used for
storing values are called word devices, e.g. T, C, D, E and F. Although bit device can only be
ON/OFF for a single point, they can also be used as numeric values in the operands of
instructions if the data type declaration device Kn is added in front of the bit device.
2. For 16-bit data, K1~K4 are applicable. For 32-bit data, K1~K8 are applicable. For example,
K2M0 refers to a 8-bit value composed of M0 ~ M7.
Valid data
D1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Equals
Low byte
D1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1
3. Transmit K1M0, K2M0, K3M0 to 16-bit registers. Only the valid bit data will be transmitted
and the upper bits in the 16-bit register will all be filled with 0. The same rule applies when
sending K1M0, K2M0, K3M0, K4M0, K5M0, K6M0, K7M0 to 32-bit registers.
3-20
3 . I ns t r u c ti o n Se t
4. When the Kn value is specified as K1~K3 (K4~K7) for a 16-bit (32-bit) operation, the empty
upper bits of the target register will be filled with 0. Therefore, the operation result in this
case is positive since the MSB(Most significant bit) is 0.
M0 The BCD value combined by X0 to X7 will be
BIN K2X0 D0
converted to D0 as BIN value.
3-21
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
8-bit 23-bit
S exponent mantissa
b31 b0
Sign bit
0: positive
1: negative
Step 4: Combine the sign bit, exponent and mantissa into a floating point
0 10000011 011100000000000000000002 = 41B8000016
Example 2: Represent -23.0 in 32-bit floating point value
The steps required are the same as those in Example 1 and only differs in modifying the sign bit
into 1.
1 10000011 011100000000000000000002=C1B8000016
DVP-PLC uses registers of 2 continuous No. to store a 32-bit floating point value. For example, we
use registers (D1, D0) for storing a binary floating point value as below:
D1(b15~b0) D0(b15~b0)
7 6 5 1 0 -1 -2 -3 -17 -18 -19 -20 -21 -22 -23
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
S E7 E6 E5 E1 E0 A22 A21 A20 A6 A5 A4 A3 A2 A1 A0
b31 b30 b29 b28 b24 b23 b22 b21 b20 b6 b5 b4 b3 b2 b1 b0
3-22
3 . I ns t r u c ti o n Se t
[exponent D1 ]
Decimal floating point = [constant D0] 10
Constant D0 = 1,000 ~ 9,999
Exponent D1 = -41 ~ +35
-1
The constant 100 does not exist in D0 because 100 is represented as 1,000 10 . The range of
-41 +35
decimal floating point is 1175 10 ~ 340210 .
The decimal floating point can be used in the following instructions:
D EBCD: Convert binary floating point to decimal floating point
D EBIN: Convert decimal floating point to binary floating point
Zero flag (M1020), borrow flag (M1021), carry flag (M1022) and the floating point operation
instruction
Zero flag: M1020 = On if the operational result is 0.
Borrow flag: M1021 = On if the operational result exceeds the minimum unit.
Carry flag: M1022 = On if the absolute value of the operational result exceeds the range of
use.
Index register E, F
The index registers are 16-bit registers. There are 16 devices including E0 ~ E7 and F0 ~ F7.
E and F index registers are 16-bit data registers
which can be read and written.
If you need a 32-bit register, you have to designate
16-bit 16-bit E. In this case, F will be covered up by E and
F0 E0 cannot be used; otherwise, the contents in E may
32-bit become incorrect. (We recommend you use MOVP
3-23
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Loop Control
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
00 CJ - Conditional jump 3 -
01 CALL - Call subroutine 3 -
02 SRET - - Subroutine return 1 -
03 IRET - - Interrupt return 1 -
04 EI - - Enable interrupt 1 -
05 DI - - Disable interrupt 1 -
The end of the main program
06 FEND - - 1 -
(First end)
07 WDT - Watchdog timer refresh 1 -
08 FOR - - Start of a For-Next Loop 3 -
09 NEXT - - End of a For-Next Loop 1 -
Transmission Comparison
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
10 CMP DCMP Compare 7 13
11 ZCP DZCP Zone compare 9 17
12 MOV DMOV Move 5 9
13 SMOV - Shift move 11 -
14 CML DCML Complement 5 9
15 BMOV - Block move 7 -
16 FMOV DFMOV Fill move 7 13
17 XCH DXCH Exchange 5 9
18 BCD DBCD Convert BIN to BCD 5 9
19 BIN DBIN Convert BCD to BIN 5 9
3-24
3 . I ns t r u c ti o n Se t
Data Processing
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
40 ZRST - Zone reset 5 -
41 DECO - Decode 7 -
42 ENCO - Encode 7 -
43 SUM DSUM Sum of Active bits 5 9
44 BON DBON Check specified bit status 7 13
45 MEAN DMEAN Mean 7 13
46 ANS - - Timed Annunciator Set 7 -
47 ANR - Annunciator Reset 1 -
48 SQR DSQR Square Root 5 9
49 FLT DFLT Floating point 5 9
3-25
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Handy Instructions
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
60 IST - - Initial state 7 -
61 SER DSER Search a data stack 9 17
62 ABSD DABSD - Absolute drum sequencer 9 17
63 INCD - - Incremental drum sequencer 9 -
64 TTMR - - Teaching timer 5 -
65 STMR - - Special timer 7 -
66 ALT - Alternate state 3 -
67 RAMP DRAMP - Ramp variable value 9 17
68 DTM - Data transform and move 9 -
69 SORT DSORT - Data sort 11 21
Serial I/O
Mnemonic Applicable to STEPS
API PULSE Function ES2
16 bits 32 bits SS2 SA2 SX2 SE 16-bit 32-bit
EX2
Read CR data from special
78 FROM DFROM 9 17
modules
Write CR data into special
79 TO DTO 9 17
modules
3-26
3 . I ns t r u c ti o n Se t
Basic Instructions
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
89 PLS - - Rising-edge output 3 -
Risingedge detection
90 LDP - - 3 -
operation
Fallingedge detection
91 LDF - - 3 -
operation
92 ANDP - - Rising-edge series connection 3 -
93 ANDF - - Falling-edge series connection 3 -
94 ORP - - Rising-edge parallel connection 3 -
95 ORF - - Falling-edge parallel connection 3 -
96 TMR - - Timer 4 -
97 CNT DCNT - Counter 4 6
98 INV - - Inverse operation 1 -
99 PLF - - Falling-edge output 3 -
258 ATMR - - Contact type timer 5 -
Communication Instructions
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE 2
100 MODRD - - Read Modbus data 7 -
101 MODWR - - Write Modbus Data 7 -
102 FWD - - Forward Operation of VFD 7 -
103 REV - - Reverse Operation of VFD 7 -
104 STOP - - Stop VFD 7 -
105 RDST - - Read VFD Status 5 -
106 RSTEF - - Reset Abnormal VFD 5 -
107 LRC - LRC checksum 7 -
108 CRC - CRC checksum 7 -
150 MODRW - - MODBUS Read/ Write 11 -
3-27
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-28
3 . I ns t r u c ti o n Se t
Additional Instruction
Mnemonic Applicable to STEPS
API PULSE Function ES2
16 bits 32 bits SS2 SA2 SX2 SE 16-bit 32-bit
EX2
143 DELAY - Delay 3 -
144 GPWM - - General PWM output 7 -
145 FTC - Fuzzy Temperature Control V3.22 V2.66 V2.66 7 -
147 SWAP DSWAP Byte swap 3 5
Reading the data from the
148 MEMR - - - 7 -
file register
Writing the data into the file
149 MEMW - - - 7 -
register
154 RAND DRAND Random number 7 13
Mask and combine
168 MVM DMVM 7 13
designated Bits
176 MMOV 16-bit32-bit Conversion 5
177 GPS - - GPS data receiving - 5 -
178 - DSPA - Solar cell positioning - 9
179 WSUM DWSUM Sum of multiple devices 7 13
Proportional value
202 SCAL - 9 -
calculation
Parameter proportional value
203 SCLP DSCLP 9 13
calculation
205 CMPT DCMPT Compare table 9 17
Catch speed and
207 CSFO - - - 7 -
proportional output
Positioning Control
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
155 - DABSR - Absolute position read - 13
156 - DZRN - Zero return - 17
157 - DPLSV Adjustable speed pulse output - 13
158 - DDRVI - Relative position control - 17
159 - DDRVA - Absolute position control - 17
2-Axis Relative Point to Point
191 - DPPMR - - - 17
Motion
2-Axis Absolute Point to Point
192 - DPPMA - - - 17
Motion
2-Axis Relative Position Arc
193 - DCIMR - - - 17
Interpolation
2-Axis Absolute Position Arc
194 - DCIMA - - - 17
Interpolation
Single-Axis pulse output by
195 - DPTPO - - 13
table
197 - DCLLM - Close loop position control - 17
198 - DVSPO - Variable speed pulse output - 17
3-29
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Gray Code
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
170 GRY DGRY BIN Gray Code 5 9
171 GBIN DGBIN Gray Code BIN 5 9
Matrix Operation
Mnemonic Applicable to STEPS
API PULSE Function ES2 SA2
16 bits 32 bits SS2 SX2 16-bit 32-bit
EX2 SE
180 MAND - Matrix AND 9 -
181 MOR - Matrix OR 9 -
182 MXOR - Matrix XOR 9 -
183 MXNR - Matrix XNR 9 -
184 MINV - Matrix inverse 7 -
185 MCMP - Matrix compare 9 -
186 MBRD - Matrix bit read 7 -
187 MBWR - Matrix bit write 7 -
188 MBS - Matrix bit shift 7 -
189 MBR - Matrix bit rotate 7 -
190 MBC - Matrix bit status count 7 -
3-30
3 . I ns t r u c ti o n Se t
3-31
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-32
3 . I ns t r u c ti o n Se t
3-33
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-34
3 . I ns t r u c ti o n Se t
3-35
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-36
3 . I ns t r u c ti o n Se t
3-37
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-38
3 . I ns t r u c ti o n Se t
3-39
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-40
3 . I ns t r u c ti o n Se t
3-41
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example 1:
When X0 = ON, the program will skip from address 0 to N (Pointer P1) automatically and keep on
executing. Instructions between address 0 and N will be skipped..
When X0 = OFF, program flow will proceed with the row immediately after the CJ instruction.
(CJ instruction)
P***
X0
0 CJ P1
X1
Y1
X2
N P1 Y2
Program example 2:
1. The instruction CJ between the instruction MC and the instruction MCR can be used in the five
conditions below.
a). The execution of the program jumps from the part of the program outside one MC/MCR
loop to the part of the program outside another MC/MCR loop.
b). The execution of the program jumps from the part of the program outside the MC/MCR
loop to the part of the program inside the MC/MCR loop.
c). The execution of the program jumps from the part of the program inside the MC/MCR loop
to the part of the program inside the MC/MCR loop.
d). The execution of the program jumps from the part of the program inside the MC/MCR loop
to the part of the program outside the MC/MCR loop.
e). The execution of the program jumps from the part of the program inside one the MC/MCR
loop to the part of the program inside another the MC/MCR loop.
X0
MC N0
X2
CJ P0
X3
CJ P1
X1
MC N1
M1000
P1 Y1
MCR N1
M1000
P0 Y0
MCR N0
3-42
3 . I ns t r u c ti o n Se t
2. When the instruction MC is executed, the previous state of the switch contact is put onto the
top of the stack inside the PLC. The stack is controlled by the PLC, and can not be changed by
users. When the instruction MCR is executed, the previous state of the switch contact is
popped from the top of the stack. Under the conditions listed in (b), (d), and (e) above, the
number of times the items are pushed onto the stack may be different from the number of
times the items are popped from the stack. When this situation occurs, at most 32 items can
be pushed onto the stack, and the items can be popped form the stack until the stack is empty.
Therefore, when CJ or CJP is used with MC and MCR, users have to be careful of the pushing
of the item onto the stack and the popping of the item from the stack.
Program example 3:
The table explains the device status in the ladder diagram below.
Contact state Contact state Output coil state
Device
before CJ execution during CJ execution during CJ execution
M1, M2, M3 *1
M1, M2, M3 OFF Y1 , M20, S1 OFF
OFFON
Y, M, S
M1, M2, M3
M1, M2, M3 ON Y1 *1, M20, S1 ON
ONOFF
M4 OFF M4 OFFON Timer is not activated
10ms,
Timer T0 immediately stops and
100ms
M4 ON M4 ONOFF is latched. When M0 ON OFF,
Timer*2
T0 will be reset.
1ms,10ms, M6 OFF M6 OFFON Timer T240 is not activated
100ms Timer T240 immediately stops
accumulative M6 ON M6 ONOFF and is latched. When M0 ON
Timer OFF, T240 will still be latched.
M10 is ON/OFF
M7, M10 OFF Counter C0 stops
triggered
*3
C0~C234 Counter C0 stops and latched.
M7 OFF, M10 is M10 is ON/OFF
When M0 is OFF, C0 resumes
ON/OFF triggered triggered
counting.
Application instructions will not
M11 OFF M11 OFFON
be executed.
Application The skipped application
instruction instruction will not be executed
M11 ON M11 ONOFF
but API 53~59, API 157~159
keep executing.
*1: Y1 is dual output. When M0 is OFF, it is controlled by M1. When M0 is ON, M12 will control Y1
*2: When timer that subroutine used (T184~T199) executes first and then CJ instruction is
executed, the timer will keep counting. After the timer reaches the set value, output contact of
timer will be ON.
*3: When high-speed counters (C235~C254) executes first and then CJ instruction is executed,
the counter will keep counting and its associated output status remains.
3-43
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
M0
CJ P0
M1
Y1
M2
M20
M3
S1
M4
TMR T0 K10
M5
RST T240
M6
TMR T240 K1000
M7
RST C0
M10
CNT C0 K20
M11
MOV K3 D0
M0
P0 CJ P63
M12
Y1
M13
P63 RST T240
RST C0
RST D0
END
3-44
3 . I ns t r u c ti o n Se t
3-45
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
X0
20 CALL P2 Call subroutine P2
X1
24
Y0
FEND
M1
P2 Y1
Subroutine
M2
Y2
Program example 2:
1. When the rising-edge of X20 is triggered, CALL P10 instruction will transfer execution to
subroutine P10.
2. When X21 is ON, execute CALL P11, jump to and run subroutine P11.
3. When X22 is ON, execute CALL P12, jump to and run subroutine P12.
4. When X23 is ON, execute CALL P13, jump to and run subroutine P13.
5. When X24 is ON, execute CALL P14, jump to and run subroutine P14. When the SRET
instruction is reached, jump back to the last P subroutine to finish the remaining instructions.
6. The execution of subroutines will go backwards to the subroutine of upper level until SRET
instruction in P10 subroutine is executed. After this program execution will return to the main
program.
3-46
3 . I ns t r u c ti o n Se t
X0 X2
INC D0 P12 INC D30
Y0 Y20
X20 X23
CALL P10 CALL P13
Main Subroutine
X0 Program X2
INC D1 INC D31
Y1 Y21
FEND SRET
X2 X2
P10 INC D10 P13 INC D40
Y2 Y22
X21 X24
CALL P11 CALL P14
Subroutine Subroutine
X2 X2
INC D11 INC D41
Y3 Y23
SRET SRET
X2 X2
P11 INC D20 P14 INC D50
Y4 Y24
X22 Subroutine
CALL P12 SRET
Subroutine
X2
INC D21 END
Y5
SRET
3-47
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-48
3 . I ns t r u c ti o n Se t
3-49
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example:
During the PLC operation, the program scans the instructions between EI and DI, if X1 or X2 are
ON, the subroutine A or B will be interruptted. When IRET is reached, the main program will
resume.
EI
X1
Y0 Enabled interrupt
DI
Disabled interrupt
EI
Enabled interrupt
FEND
M0
I 101 Y1
Interrupt subroutine A
IRET
M1
I 201 Y2
Interrupt subroutine B
IRET
3-50
3 . I ns t r u c ti o n Se t
3-51
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Main program
DI
FEND
P0 Main program
FEND
SRET
IRET
END
3-52
3 . I ns t r u c ti o n Se t
Main program
DI
FEND
P0 Main program
FEND
SRET
IRET
END
3-53
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
T1 T2
ii. Use the set value in D1000 (Default: 200ms) to change the time for watchdog.
Points to note:
1. When the WDT instruction is used it will operate on every program scan as long as its input
condition has been made. To force the WDT instruction to operate for only ONE scan, users
have to use the pulse (P) format of the WDT instruction, i.e. WDTP.
2. The watchdog timer has a default setting of 200ms. This time limit can be customized to users
requirement by editing the content in D1000, the wathdog timer register.
3-54
3 . I ns t r u c ti o n Se t
Program example:
If the program scan time is over 300ms, users can divide the program into 2 parts. Insert the WDT
instruction in between, making scan time of the first half and second half of the program being less
than 200ms.
300ms program
END
Dividing the program to two parts
so that both parts scan time are
less than 200ms.
150ms program
X0
WDT Watchdog timer reset
150ms program
END
3-55
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-56
3 . I ns t r u c ti o n Se t
Program example 1:
After program A has been executed for 3 times, it will resume its execution after NEXT instruction.
Program B will be executed for 4 times whenever program A is executed once. Therefore, program
B will be executed 3 4 = 12 times in total.
FOR K3
FOR K4
B A
NEXT
NEXT
Program example 2:
When X7 = OFF, PLC will execute the program between FOR ~ NEXT. When X7 = ON, CJ
instruction jumps to P6 and avoids executing the instructions between FOR ~ NEXT.
X7
CJ P6
M0
MOV K0 D0
FOR K3
M0
MOV D0 D1
INC D0
MEXT
X10
P6 Y10
3-57
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example 3:
Users can adopt CJ instruction to skip a specified FOR ~ NEXT loop. When X1 = ON, CJ
instruction executes to skip the most inner FOR ~ NEXT loop.
X0
TMR T0 K10
FOR K4X100
X0
INC D0
FOR K2
X0
INC D1
FOR K3
X0
INC D2
FOR K4
X0
WDT
INC D3
X1
CJ P0
FOR K5
X0
INC D4
NEXT
P0 NEXT
NEXT
NEXT
NEXT
END
3-58
3 . I ns t r u c ti o n Se t
X20
CMP K10 D10 Y0
Y0
If K10>D10, Y0 = On
Y1
If K10=D10, Y1 = On
Y2
If K10<D10, Y2= On
RST M1
RST M2
3-59
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
RST M1
RST M2
3-60
3 . I ns t r u c ti o n Se t
X0
MOV K10 D0
X1
MOV T0 D10
X2
DMOV D20 D30
3-61
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-62
3 . I ns t r u c ti o n Se t
Program example 1:
th rd
1. When M1168 = OFF (in BCD mode) and X0 = ON, the 4 (thousand) and 3 (hundred) digit of
rd nd
the decimal value in D10 start to move to the 3 (hundred) and 2 (ten) digit of the decimal
3 0
value in D20. 10 and 10 of D20 remain unchanged after this instruction is executed.
2. When the BCD value exceeds the range of 0 ~ 9,999, PLC detects an operation error and will
not execute the instruction. M1067, M1068 = ON and D1067 stores the error code OE18
(hex).
M1001
M1168
X0
SMOV D10 K4 K2 D20 K3
D10(BIN 16bit)
Auto conversion
3 2 1 0
10 10 10 10 D10(BCD 4 digits)
Shift move
No variation No variation
3 2 1 0
10 10 10 10 D20(BCD 4 digits)
Auto conversion
D20(BIN 16bit)
If D10 = K1234, D20 = K5678 before execution, D10 remains unchanged and D20 = K5128
after execution.
Program example 2:
When M1168 = ON (in BIN mode) and SMOV instruction is in use, D10 and D20 will not be
converted in BCD format but be moved in BIN format (4 digits as a unit).
M1000
M1168
X0
SMOV D10 K4 K2 D20 K3
Shift move
D20(BIN 16bit)
Digit 4 Digit 3 Digit 2 Digit 1
No variation No variation
If D10 = H1234, D20 = H5678 before execution, D10 remains unchanged and D20 = H5128 after
execution.
3-63
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Program example 3:
1. This instruction can be used to combine the DIP switches connected to the input terminals
without continuous numbers.
2. Move the 2 digits of the right DIP switch (X27~X20) to the 2 digits of D2, and the 1 digit of the
st
DIP switch (X33~X30) to the 1 digit of D1.
st rd
3. Use SMOV instruction to move the 1 digit of D1 to the 3 digit of D2 and combine the values
from two DIP switches into one set of value.
2 1 0
10 10 10
6 4 2
8 8 8
X33~X30 X27~X20
PLC
M1001
M1168
M1000
BIN K2X20 D2 (X20~X27)BCD, 2 digits D2(BIN)
SMOV D1 K1 K1 D2 K3
3-64
3 . I ns t r u c ti o n Se t
b15 b3 b2 b1 b0
D1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Symbol bit ( 0=positive, 1=negative)
0 1 0 1
Program example 2:
The diagram below can be substituted by the instruction on the right.
X000
M0
X001
M1
X002
M2
X003 Normally ON contact
M3 M1000
CML K1X0 K1M0
X000
M0
X001
M1
X002
M2
X003
M3
3-65
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
3-66
3 . I ns t r u c ti o n Se t
Program example 2:
Assume the bit devices KnX, KnY, KnM and KnS are designated for moving, the number of digits
of S and D has to be the same, i.e. their n has to be the same.
M1000
BMOV K1M0 K1Y0 K3 M0 Y0
M1 Y1
M2 Y2
M3 Y3
M4 Y4
M5 Y5
n=3
M6 Y6
M7 Y7
M8 Y10
M9 Y11
M10 Y12
M11 Y13
Program example 3:
In order to prevent the error which results from the overlap between the source devices and the destination
devices, the data is transferred in the following way.
3-67
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
K10 D11
K10 D13
K10 D14
3-68
3 . I ns t r u c ti o n Se t
X0
XCHP D20 D40
Before After
execution execution
D20 120 40 D20
Points to note:
1. As a 16-bit instruction, when the devices designated by D1 and D2 are the same and M1303 =
ON, the upper and lower 8 bits of the designated devices exchange with each other.
2. As a 32-bit instruction, when the devices designated by D1 and D2 are the same and M1303 =
ON, the upper and lower 16 bits in the designated device exchange with each other.
3. When X0 = ON and M1303 = ON, 16-bit contents in D100 and those in D101 will exchange
with each other.
Before After
X0 execution execution
M 1303
D 100 1234 5678 D 100
4. When X0 = ON and M1303 = ON, the high 8 bits and the low 8 bits in D0 are exchanged, the
high 8 bits and the low 8 bits in D1 are exchanged., and the high 8 bits and the low 8 bits in D2
are exchanged.
3-69
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Before After
execution execution
X0
M 1303 E0=0, D0 L 09 20 D 0 L
D0 H 20 09 D0 H
R ST E
FOR K3 E0=1, D1 L 08 40 D1 L
X0 D1 H 40 08 D1 H
XCH D 0E D 0E
INC E E0=2, D2 L 03 60 D2 L
D2 H 60 03 D2 H
N EXT
3-70
3 . I ns t r u c ti o n Se t
3-71
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
Points to note:
1. When PLC needs to read an external DIP switch in BCD format, BIN instruction has to be first
adopted to convert the read data into BIN value and store the data in PLC.
2. On the contrary when PLC needs to display a value on a BCD format 7-segment displayer,
BCD instruction is required to convert the internal data into BCD value then sent the value to
the displayer.
3. When X0 = ON, the BCD value of K4X20 is converted into BIN value and sent to D100. The
BIN value of D100 will then be converted into BCD value and sent to K4Y20.
X0
BIN K4X20 D100
3-72
3 . I ns t r u c ti o n Se t
3 2 1 0
10 10 10 10
8 8 8 8
X37 X20
4-digit BCD value
3-73
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
MEMO
3-74
3 . I ns t r u c ti o n Se t
Program Example 2:
In 32-bit BIN addition:
When X0 = ON, the content in (D31, D30) will plus the content in (D41, D40) and the sum will be
stored in (D51, D50). D30, D40 and D50 are low word; D31, D41 and D51 are high word
X0
DADD D30 D40 D50
Operation of flags:
16-bit instruction:
1. If the operation result is 0, the zero flag M1020 will be ON.
2. If the operation result exceeds -32,768, the borrow flag M1021 will be ON.
3. If the operation result exceeds 32,767, the carry flag M1022 will be ON.
32-bit instruction:
1. If the operation result is 0, the zero flag, M1020 will be ON.
3-73
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. If the operation result exceeds -2,147,483,648, the borrow flag M1021 will be ON.
3. If the operation result exceeds 2,147,483,647, the carry flag M1022 will be ON
16-bit instruction:
-2 -1 0 -32,768 -1 0 1 32,767012
Borrow flag the most significant bit the most significant bit Carry flag
becomes 1 (negative) becomes 0 (positive)
32-bit instruction:
-2 -1 0 -2,147,483,648 -1 0 1 2,147,483,647 0 1 2
Borrow flag the most significant bit the most significant bit Carry flag
becomes 1 (negative) becomes 0 (positive)
3-74
3 . I ns t r u c ti o n Se t
Program Example 2:
In 32-bit BIN subtraction:
When X10 = ON, the content in (D31, D30) will minus the content in (D41, D40) and the results will
be stored in (D51, D50). D30, D40 and D50 are low word; D31, D41 and D51 are high word
X20
DSUB D30 D40 D50
3-75
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S1 S2 D +1 D
b31.. b16 b15.. b00 b31.. b16 b15.. b00 b63. b48 b47. b32 b31. b16 b15. b00
X =
b31 is the sign bit b31 is the sign bit b63 is the sign bit(b15 of D+3)
B31=0,S1(S1+1) is a positive value b31=0,S2(S2+1) is a positive value b63=0, D~(D+3) is a positive value
b31=1,S1(S1+1) is a negative value b31=1,S2(S2+1) is a negative value b63=1, D~(D+3) is a negative value
3-76
3 . I ns t r u c ti o n Se t
If D is specified with a word device, it can specify K1~K8 to store a 32-bit result. Users can use
2 consecutive 32-bit registers to store 64-bit data.
If the product of a 32-bit multiplication must be a 32-bit value (32-bit value x 32-bit value =
32-bit value), users have to use API 114 MUL32/MUL32P. Please refer to the explanation of
API 114 MUL32/MUL32P for more information.
Program Example:
The 16-bit D0 is multiplied by the 16-bit D10 and brings forth a 32-bit product. The higher 16 bits
are stored in D21 and the lower 16-bit are stored in D20. ON/OFF of MSB indicates the
positive/negative status of the operation result.
X0
MUL D0 D10 D20
3-77
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If D is specified with a bit device, it can designate K1 ~ K4 to store a 16-bit result. Users can
use consecutive 2 16-bit registers to store 32-bit data of the quotient and remainder.
If users want to store the quotient of a 16-bit division (leave out the remainder), they have to
use AP I115 DIV16/DIV16P. Please refer to the explanation of API 115 DIV16/DIV16P for more
information.
6. 32-bit BIN division:
Quotient Remainder
S 1 +1 S1 S 2 +1 S2 D +1 D D +3 D +2
b15..b00 b15..b00 b15..b00 b15..b00 b31..b16 b15..b00 b31..b16 b15..b00
/ =
If D is specified with a bit device, it can designate K1 ~ K8 to store a 32-bit result. Users can
use consecutive 2 32-bit registers to store the quotient and remainder.
If users want to store the quotient of a 32-bit division (leave out the remainder), they have to
use AP I115 DIV32/DIV32P. Please refer to the explanation of API 115 DIV32/DIV32P for more
information.
3-78
3 . I ns t r u c ti o n Se t
Program Example:
When X0 = ON, D0 will be divided by D10 and the quotient will be stored in D20 and remainder in
D21. ON/OFF of the MSB indicates the positive/negative status of the result value..
X0
DIV D0 D10 D20
3-79
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-80
3 . I ns t r u c ti o n Se t
3-81
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b00
D0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
Before
WAND
execution
D2 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
After
execution D4 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
3-82
3 . I ns t r u c ti o n Se t
b31 b15 b0
1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
Before D11 D10 DAND
execution
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D21 D20
After
execution 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
D41 D40
3-83
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b00
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
WOR
execution
D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
execution D4 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
3-84
3 . I ns t r u c ti o n Se t
b
b31 b15 b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
D11 D10 DOR
execution
0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D21 D20
After
execution 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
D41 D40
3-85
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b00
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
WOR
execution
D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
execution D4 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
3-86
3 . I ns t r u c ti o n Se t
b
b31 b15 b0
1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1
Before
D11 D10 DXOR
execution
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D21 D20
After
execution 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1
D41 D40
3-87
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
To obtain the absolute value of a negative value:
1. When MSB (b15) of D0 is 1, M0 = ON. (D0 is a negative value).
2. When M0 = ON, the absolute value of D0 can be obtained by NEG instruction.
M1000
BON D0 M0 K15
M0
NEGP D0
Program Example 3:
Obtain the absolute value of the remainder of the subtraction. When X0 = ON,
a) If D0 > D2, M0 = ON.
b) If D0 = D2, M1 = ON.
c) If D0 < D2, M2 = ON.
d) D4 is then able to remain positive.
3-88
3 . I ns t r u c ti o n Se t
X0
CMP D0 D2 M0
M0
SUB D0 D2 D4
M1
M2
SUB D2 D0 D4
(D0=2)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
(D0=1)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D0=0)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(D0=-1) (D0)+1=1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D0=-2) (D0)+1=2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
(D0=-3) (D0)+1=3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
(D0=-4) (D0)+1=4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
(D0=-5) (D0)+1=5
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
(D0=-32,765) (D0)+1=32,765
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
(D0=-32,766) (D0)+1=32,766
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
(D0=-32,767) (D0)+1=32,767
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
(D0=-32,768) (D0)+1=-32,768
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3-89
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
RORP D10 K4
3-90
3 . I ns t r u c ti o n Se t
3-91
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-92
3 . I ns t r u c ti o n Se t
3-93
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4 3 2 1
3-94
3 . I ns t r u c ti o n Se t
1 2 3 4
3-95
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D13 D12 D11 D10 4 registers in one group shift to the right
5
D35 D34 D33 D32 D31 D30 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20 Carry
4 3 2 1
3-96
3 . I ns t r u c ti o n Se t
Program Example 2:
1. When X0 is triggered, WSFRP instruction shifts X20~X27 into data stack Y20~Y37 and
Y20~Y37 also shift to the right with a group of 4 devices.
2. The figure below illustrates the right shift of the devices in one scan
Y27~Y20 carry
Y37~Y30 Y27~Y20
X27~X20 Y37~Y30 completed
When using Kn device, the specified Kn value
(digit) must be the same.
X0
WSFRP K1X20 K1Y20 K4 K2
2 1
3-97
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4 registers in one group shift to the left D13 D12 D11 D10
5
Carry D35 D34 D33 D32 D31 D30 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20
1 2 3 4
3-98
3 . I ns t r u c ti o n Se t
X0
SFWRP D20 D0 K10
n = 10 points
D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Pointer
D0 = 3 2 1
Points to note:
This instruction can be used together with API 39 SFRD for the reading/writing of first-in, first-out
stack data.
3-99
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
n = 10 points
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 D21
Pointer
Data read
3-100
3 . I ns t r u c ti o n Se t
Points to note:
1. Bit devices Y, M, S and word devices T, C, D can be individually reset by RST instruction.
3-101
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. For clearing multiple devices, API 16 FMOV instruction can be used to send K0 to word
devices T, C, D or bit devices KnY, KnM, KnS.
X0
RST M0
RST T0
RST Y0
FMOV K0 D10 K5
3-102
3 . I ns t r u c ti o n Se t
X2 X1 X0
0 1 1
4 2 1
3
7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0
M107 M106 M105 M104 M103 M102 M101 M100
3-103
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
1. When D is used as a word device, n = 1 ~ 4. Errors will occur if n = 0 or n > 4.
4
2. When n = 4, the decoded data is 2 = 16 bits.
3. When X20 goes from OFF to ON, the data in D10 (b2 to b0) will be decoded and stored in D20
(b7 to b0). The unused bits in D20 (b15 to b8) will be set to 0.
4. The lower 3 bits of D10 are decoded and stored in the lower 8 bits of D20. The higher 8 bits of
D20 are all 0.
5. After the execution is completed, X20 is turned OFF. The decoded results or outputs will retain
their operation.
X20
DECOP D10 D20 K3
D10
b15 b0
0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1
4 2 1
all be 0
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
b15 b0
D20
3-104
3 . I ns t r u c ti o n Se t
M7 M6 M5 M4 M3 M2 M1 M0
0 0 0 0 1 0 0 0
7 6 5 4 3 2 1 0
all be 0
4 2 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b15 D0 b0
3-105
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
1. When S is used as a word device, n = 1 ~ 4. Errors will occur if n = 0 or n > 4.
4
2. When n = 4, the decoded data is 2 = 16 bits data.
3
3. When X0 goes from OFF to ON, the 2 bits (b0 ~ b7) in D10 will be encoded and the result will
be stored in the lower 3 bits of D20 (b2 to b0). The unused bits in D20 (b15 to b3) will be set to
0.
4. After the execution is completed, X0 is turned OFF and the data in D remains unchanged
X0
ENCOP D10 D20 K3
Invalid data
b0
0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0
b15 6 5 4 3 2 1 0
D10
7
all be 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b15 D20 b0
3-106
3 . I ns t r u c ti o n Se t
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 3
D0 D2
3-107
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
BON D0 M0 K15
b15 b0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 M0=Off
D0
b15 b0
1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 M0=On
D0
3-108
3 . I ns t r u c ti o n Se t
X10
MEAN D0 D10 K3
(D0+D1+D2)/3 D10
D0 K100
3-109
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3 - 11 0
3 . I ns t r u c ti o n Se t
X3
ANRP
Points to note:
Flags:
1. M1048 (indicating alarm status): When M1049 = ON, enabling any of the alarm S912~S1023
turns M1048 ON.
2. M1049 (Enabling alarm monitoring): When M1049 = ON, D1049 will automatically hold the
lowest alarm number in active alarms.
Application example of alarm device (production line):
X0 = Forward switch X1 = Backward switch
X2 = Front position switch X3 = Back position switch
X4 = Alarm reset button
Y0 = Forward Y1 = Backward
Y2 = Alarm indicator
S912 = Forward alarm S920 = Backward alarm
3 - 111
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1000
M1049
Y0 X2
ANS T0 K100 S912
Y1 X3
ANS T1 K200 S920
X0 X2
Y0
Y0
X1 X3
Y1
Y1
M1048
Y2
X4
ANRP
3 - 11 2
3 . I ns t r u c ti o n Se t
D0 D12
3 - 11 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3 - 11 4
3 . I ns t r u c ti o n Se t
M1002
RST M1081
X20
FLT D0 D12
X21
DFLT D0 D20
Program Example 2:
1. When M1081 = ON, the source data is converted from floating point value to BIN integer.
(Decimal ignored)
2. When X20 = ON, D1 and D0 (floating point) are converted to D12 (BIN integer). If D0 (D1) =
H47C35000, the result will be 100,000 which exceeds the available range of BIN integer in
16-bit register D12. In this case the result will be D12 = K32767, and M1022 = ON
3. When X21 = ON, D1 and D0 (floating point) are converted to D21, D20 (BIN integer). If D0 (D1)
= H47C35000, the result is 100,000 and will be saved in 32-bit register D20 (D21).
M1002
SET M1081
X20
FLT D0 D12
X21
DFLT D0 D20
Program Example 3:
Apply FLT instruction to complete the following operation
7
1 2 5 4 (D31,D30)
Decimal floating point
(for monitoring)
(D101,D100) (D200) BIN (D301,D300) 8
Binary floating point Binary floating point (D41,D40)
3 32-bit integer
(D203,D202)
Binary floating point
(D401,D400)
Binary floating point
3 - 11 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1000 1
FLT D10 D100
2
BIN K2X0 D200
3
FLT D200 D202
4
DEDIV K615 K10 D300
5
DEDIV D100 D202 D400
6
DEMUL D400 D300 D20
7
DEBCD D20 D30
8
DINT D20 D40
3 - 11 6
3 . I ns t r u c ti o n Se t
Program Example 2:
When X0 = ON, the 4 output signals on Y0 ~ Y3 will be sent to output terminals immediately before
the program proceeds to END instruction.
X0
REF Y0 K4
3 - 11 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 3:
When X0 = ON, I/O points starting from X10 or Y4 will all be refreshed.
X0
REF X10 K8
X0
REF Y4 K8
Program Example 4:
For DVP-EX2/SX2 only: When X0 = ON and M1180 = ON, A/D signal in D1110~D1113 will be
refreshed immediately regardless of the settings of operands D and n
X0
SET M1180
REF X0 K8
3 - 11 8
3 . I ns t r u c ti o n Se t
X20
REFF K5
X0
Y1
X20
REFF K20
X1
Y2
END
Points to note:
Response time is ignored (no delay) when input points are occupied by external interrupts,
3 - 11 9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-120
3 . I ns t r u c ti o n Se t
3-121
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
The figure below illustrates the external wiring of the 2-array matrix input loop constructed by X40
~ X47 and Y40 ~ Y41. The 16 switches correspond to the internal relays M10 ~ M17, M20 ~ M27.
The wiring should be applied with MTR instruction.
Diode
0.1A/50V
M20 M21 M22 M23 M24 M25 M26 M27
24G +24V S/S X40 X41 X42 X43 X44 X45 X46 X47
When output Y40 is ON, only inputs in the first array are read. The results are stored in auxiliary
relays M10~M17. After Y40 goes OFF, Y41 turns ON. This time only inputs in the second array are
read. The results are stored in M20~M27.
Y40 1 3
Read input signal in the 2nd array
Y41 2 4
25ms
Processing time of each array: approx. 25ms
3-122
3 . I ns t r u c ti o n Se t
Points to note:
1. Operand S must be a multiple of 10, e.g. 00, 10, 20, which means X0, X10 etc. and
occupies 8 continuous devices.
2. Operand D1 should be a multiple of 10, i.e. 00, 10, 20, which means Y0, Y10 etc. and
occupies n continuous devices
3. Operand D2 should be a multiple of 10, i.e. 00, 10, which means M0, M10, S0, S10 etc.
4. Valid range of n = 2~8
3-123
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-124
3 . I ns t r u c ti o n Se t
Table of settings for the high-speed interrupts of the software counters and software
comparators:
Counter C232 C233 C234 C235 C236 C237
DHSCS High-speed I010 I050 I070 I010 I020 I030
interrupt
High-speed comparator C232~C242 share 6 software comparators
Set
Set / reset 2
Softwar e
Count value
counter 2
Set / reset 6
Softwar e
counter 8
3-125
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
as the source counter automatically and no syntax check error will be detected.
Designers have to specify the comparison value of a hardware comparator before they
enable a comparison instruction. If the comparison value of a hardware comparator has to
be changed after a comparison instruction is enabled, it is suggested that users should
disable the comparison instruction first. After the users specify a new comparison value,
the users can enable the comparison instruction again.
If users want to change the value of a hardware comparator without disabling the
high-speed comparison instruction which is being used, they have to check whether the
model used support this operation. The models which support this operation are listed
below.
Model name ES2/EX2 SS2 SA2 SX2 SE
V3.20 and V3.00 and V2.60 and V2.40 and V1.00 and
Version
above above above above above
Note: If the comparative value changes, it will not be stored in the hardware comparator
until the instruction is scanned.
Table of settings for the high-speed interrupts of hardware counters and comparators: (It
is not applicable to DVP-SE.)
A group B group
Hardware counter
A1 A2 A3 A4 B1 B2 B3 B4
Counter No. C243, C245~C248, C251,C252 C244, C249, C250, C253, C254
High-speed counter
I010 I020 I030 I040 I050 I060 I070 I080
interrupt
High-speed compare Share 4 hardware Share 4 hardware
Set/Reset comparators for group A comparators for group B
Table of settings for the high-speed interrupts of hardware counters and comparators: (It
is only applicable to DVP-SE.)
A group B group
Hardware counter
A1 A2 B1 B2
Counter No. C243, C245~C248, C251,C252 C244
High-speed counter
I010 I020 I050 I060
interrupt
Hi-speed compare Share 2 hardware Share 2 hardware
Set/Reset comparators for group A comparators for group B
3-126
3 . I ns t r u c ti o n Se t
Hardware Count
counter A value A
Set /res et A4
I040 A4
Hardware
comparator B x 4 Set /res et B1
I050 B1
Hardware Count
counter B value B
Set /res et B4
I080 B4
7. Difference between software and hardware comparators (it is not applicable to DVP-SE):
6 comparators are available for software counters while 8 comparators are available for 2
groups of hardware counters ( 4 comparators for each group)
Output timing of software comparator count value equals to comparative value in both
counting up/down modes.
Output timing of the hardware comparator with firmware version 1.xx count value
equals to comparative value+1 in counting-up mode; count value equals to comparative
value -1 in counting-down mode.
Output timing of the hardware comparator with firmware version 2.00 and above count
value equals to comparative value in both counting up/down modes.
8. Difference between software and hardware comparators (it is only applicable to DVP-SE):
6 comparators are available for software counters while 4 comparators are available for 2
groups of hardware counters ( 2 comparators for each group)
Output timing of software comparator count value equals to comparative value in both
counting up/down modes.
Output timing of the hardware comparator count value equals to comparative value+1
in counting-up mode; count value equals to comparative value -1 in counting-down mode.
Program Example 1:
Set/reset M0 by applying software comparator
M1000
DCNT C235 K100
3-127
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
When value in C235 varies from 99 to100, DHSCS instruction sets M0 ON. (M1235 = OFF,
C235 counts up)
When value in C235 varies from 101 to100, DHSCR instruction resets M0. (M1235 = ON,
C235 counts down)
Timing diagram for the comparison:
2 1
M0
Counting
No.
101 101
100 100
99 99
98 98
Count up Count down
Time
Program Example 2:
Set/reset M0 by applying hardware comparator
M1000
DCNT C251 K100
When C251 counts up and the value in C251 varies from 100 to101, DHSCS instruction
sets M0 ON.
When C251 counts down and the value in C251 varies from 100 to 99, DHSCR instruction
resets M0.
Timing diagram for the comparison:
1 2
M0
Counting
No.
101 101
100 100
99 99
98 98
Count up Count down
Time
3-128
3 . I ns t r u c ti o n Se t
Program Example 3:
Executes interrupt subroutine by applying software comparator.
EI
M1000
DCNT C235 K100
FEND
M1000
I010 OUT Y10
IRET
END
When value in C235 varies from 99 to100, interrupt subroutine triggered by I010 executes
immediately to set Y0 ON.
Points to note:
If operand D is specified as S, M or Y0~Y3 for the above high speed comparison, the
compare result will immediately output to the external points Y0~Y3 (Y0~Y5 for SS2/SX2).
However, if D is specified as Y4~Y337, external outputs will be updated till the end of
program (delay for one scan cycle).
9. Count value storage function of high speed interrupt:
When X1, X3, X4 and X5 is applied for reset function and associated external interrupts are
disabled, users can define the reset function as Rising/Falling-edge triggered by special M
relays specified in the table: Applicable Software High Speed Counters. However, if
external interrupts are applied, the interrupt instructions have the priority in using the input
points. In addition, PLC will move the current data in the counters to the associated data
registers below then reset the counters
When X0 (counter input) and X1 (external Interrupt I100/I101) work with C243, the count
value will be moved to D1240 and D1241 when interrupt occurs and then the counter will be
reset.
When X2 (counter input) and X3 (external Interrupt I300/I301) work with C244, the count
value will be moved to D1242 and D1243 when interrupt occurs and then the counter will be
reset.
When X0 (counter input) and X4 (external Interrupt I400/I401) work with C246, C248, C252,
the count value will be moved to D1240 and D1241 when interrupt occurs and then the
counter will be reset.
When X2 (counter input) and X5 (external Interrupt I500/I501) work with C244, C250, C254,
3-129
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
the count value will be moved to D1242 and D1243 when interrupt occurs and then the
counter will be reset.
Special D D1241, D1240 D1243, D1242
Counter C243 C246 C248 C252 C244 C250 C254
Interrupt X1(I100/I101) X4(I400/I401) X3(I300/I301) X5(I500/I501)
Program Example 4:
EI
M1000
DCNT C243 K100
FEND
M1000
I101 DMOV D1240 D0
IRET
END
If interrupt I101 is triggered from input point X1 while C243 is counting, I101 interrupt
subroutine executes immediately and the count value in C243 will be moved to D0. After
this, C243 is reset.
3-130
3 . I ns t r u c ti o n Se t
3-131
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Softwar e
comparator x 6
Softwar e
Counter 1 Set / reset 1
Set / reset 2
Softwar e
Count value
counter 2
Set / reset 6
Softwar e
counter 8
3-132
3 . I ns t r u c ti o n Se t
There are 6 software zone comparators available exclusively for zone compare operation,
hence the limit of 6 comparisons for zone compare does not include the comparisons of
DHSCS and DHSCR.
SS2/SA2/SE does not support software counter C232.
5. Explanations on hardware comparators for HSZ instruction:
Corresponding table for hardware counters and comparators (It is not applicable to
VEP-SE):
A group B group
Hardware counter
A1 A2 A3 A4 B1 B2 B3 B4
Counter No. C243, C245~C248, C251,C252 C244, C249, C250, C253, C254
High-speed compare Shares 4 hardware Shares 4 hardware
Set/Reset comparators for group A comparators for group B
Corresponding table for hardware counters and comparators (It is only applicable to
VEP-SE):
A group B group
Hardware counter
A1 A2 B1 B2
Counter No. C243, C245~C248, C251,C252 C244
High-speed Shares 2 hardware comparators Shares 2 hardware
compare Set/Reset for group A comparators for group B
Hardware Count
counter A value A
Set /res et A4
I040 A4
Hardware
comparator B x 4 Set /res et B1
I050 B1
Hardware Count
counter B value B
Set /res et B4
I080 B4
The two groups can only be used once for each group, occupying 2 comparators. For
example, when DHSZ instruction uses A3 and A4 of group A comparators, only the other 2
comparators (A1, A2) are available for DHSCS and DHSCR instructions.
When DHSCS uses I030 or I040, comparators A3 and A4 are no longer available for DHSZ
instruction. Also, when DHSCS uses I070 or I080, comparators B3 and B4 are no longer
3-133
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
available for DHSZ instruction. If comparators are used repeatedly, the syntax error will be
detected on the instruction behind.
For DVP-SE, if DHSZ instruction uses hardware comparators, two hardware comparators
are used. DHSCS instruction and DHSCR instruction can not use the same hardware
comparators.
Program Example 1: (Applying Hardware High Speed Counter)
1. When D is specified as Y0, then Y0~Y2 will be occupied automatically.
2. When DHSZ is executed, the instruction compares the current value in C246 with the
upper/lower bound (1500/2000) of the comparison zone, and Y0~Y2 will be ON according to the
comparison result.
M1000
DCNT C246 K20000
Program Example 2: (Applying DHSZ instruction for performing ramp down operation)
1. C251 is AB-phase high speed counter. When X10 = ON, DHSZ compare the present value with
K2000. Present valueK2000, Y10 = ON.
2. When X10 = OFF, Y10~Y12 are reset.
X10
RST C251
3-134
3 . I ns t r u c ti o n Se t
Timing diagram
Speed variable
transmission device
0
X10
Stop Y12
Present value
of C251 2400
2000
3-135
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
5. D occupies 5 consecutive registers, D + 1 and D store the results of previous pulse detection; D
+3 and D + 2 store the current accumulated number of pulses; D + 4 store the current time
remaining (max. 32,767ms).
3-136
3 . I ns t r u c ti o n Se t
6. If X0, X1, X2, X6 or X7 are used in a SPD instruction, their associated high-speed counters or
external interrupts I000/I001, I100/I101, I200/I201, I600/I601 or I700/I701 can not be used.
7. For ES2/EX2 before V0.92: when X0, X2, X6 and X7 are used, they will be detected as 1-phase
input. When X1 is used, X0(A) and X1(B) will be applied together as AB-phase input.
8. For SS2/SA2/SX2/SE and ES2/EX2 V1.00 or later: when X0, X2, X4 and X6 are used, they will
be detected as 1-phase input. When X1, X3, x5, X7 are used, X0, X2, X4, X6 will be applied
together as AB-phase input.
9. This instruction is mainly used to obtain the value of rotation speed and the results in D are in
proportion to the rotation speed. Rotation speed N can be calculated by the following equation
N: Rotation speed
60(D0 )
N= 10 3 (rpm ) n: The number of pulses produced per rotation
nt
t: Detecting time specified by S2 (ms)
Program Example:
1. When X7 = ON, D2 stores the high-speed pulses at X0 for 1,000ms and stops automatically.
The results are stored in D0, D1.
2. When the 1000ms of counting is completed, D2 will be reset. When X7 turns ON again, D2
starts counting again.
X7
SPD X0 K1000 D0
X7
X1
Content in D2
1,000ms 1,000ms
1,000
3-137
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-138
3 . I ns t r u c ti o n Se t
3-139
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
PLSY K1000 K200 Y0
M1029
Y20
0.5ms
Output Y0 1 2 3 200
1ms
Points to note:
1. Description of associated flags:
M1029: M1029 = ON when Y0 pulse output is completed.
M1030: M1030 = ON when Y1 pulse output is completed.
M1102: M1102 = ON when Y2 pulse output is completed.
M1103: M1103 = ON when Y3 pulse output is completed.
M1078: Y0 pulse output pause (immediately)
M1079: Y1 pulse output pause (immediately)
M1104: Y2 pulse output pause (immediately)
M1105: Y3 pulse output pause (immediately)
M1190: Se t Y0 high speed output as 0.01~10Hz.
(DVP-SE does not support this function.)
M1191: Se t Y1 high speed output as 0.01~10Hz.
(DVP-SE does not support this function.)
M1192: Se t Y2 high speed output as 0.01~10Hz.
(DVP-SE does not support this function.)
M1193: Se t Y3 high speed output as 0.01~10Hz.
(DVP-SE does not support this function.)
M1347: Auto reset Y0 when high speed pulse output completed
M1348: Auto reset Y1 when high speed pulse output completed
M1524: Auto reset Y2 when high speed pulse output completed
M1525: Auto reset Y3 when high speed pulse output completed
M1538: Indicating pause status of Y0
M1539: Indicating pause status of Y1
M1540: Indicating pause status of Y2
M1541: Indicating pause status of Y3
3-140
3 . I ns t r u c ti o n Se t
EI
FEND
M1000
I 001 SET M1347
IRET
M1000
I 101 SET M1524
IRET
END
3-141
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Explanations:
a) Whenever I001 is triggered, Y0 will output 1,000 pulses; whenever I101 is triggered, Y2 will
output 1,000 pulses.
b) When pulse output is completed, there should be an interval of at least one scan cycle before
next pulse output operation is triggered. .
Program Example 2:
X1
SET M1347
X2
PLSY K1000 K1000 Y0
END
Explanation:
When both X1 and X2 are ON, Y0 pulse output will operate continuously. However, there will be a
delay of approx. 1 scan cycle every 1000 pulses.
3-142
3 . I ns t r u c ti o n Se t
2. S1 is specified as pulse output width (t). S2 is specified as pulse output cycle (T).
Rule: S1 S2. (It is only applicable to DVP-SE.)
Reference Table for Output Cycle and Output Width
Range of Output Y0 Y1 Y2 Y3
pulse output t 0~1000 0~32767
width / cycle T 1~1000 1~32767
Flag for switching unit M1112 M1070 M1113 M1071
3-143
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
11. When M1071 = ON, the unit of Y3 output pulse is 100s, when M1071 = OFF, the unit is 1ms.
12. When M1116 is ON, M1112 and M1113 do not work. The time unit of the pulse output through
Y0 and Y2 is 1s. DVP-ES2 version 3.00/SS2 version 2.80/SA2 version 2.60/SE version
2.60/SX2 version 2.40 support this function.
13. When M1117 is ON, M1070 and M1071 do not work. The time unit of the pulse output through
Y1 and Y3 is 10s. DVP-ES2 version 3.00/SS2 version 2.80/SA2 version 2.60/SE version
2.60/SX2 version 2.40 support this function.
14. If M1116 for DVP-SS2 is enabled, the minimum pulse output width should be larger than 20.
Otherwise, due to the limitations on the hardware bandwidth of Y0 and Y2, the output result is
not the correct time width.
Program Example:
When X0 = ON, Y1 output the pulse as shown X0
PWM K1000 K2000 Y1
opposite. When X0 = OFF, output Y1 turns OFF.
t=1000ms
Output Y1
T=2000ms
Note:
1. Flag description:
M1070: Switching clock pulse of Y1 for PWM instruction (ON:100 us, OFF: 1ms)
M1071: Switching clock pulse of Y3 for PWM instruction (ON:100 us, OFF: 1ms)
M1112: Switching clock pulse of Y0 for PWM instruction (ON:10 us/100s for SE; OFF:
100 us/1ms for SE)
M1113: Switching clock pulse of Y2 for PWM instruction (ON:10 us, OFF: 100 us)
M1116: If M1116 is ON, the time unit of the pulse output through Y0 and Y2 is 1s.
M1112 and M1113 do not work.
M1117: If M1117 is ON, the time unit of the pulse output through Y1 and Y3 is 10s.
M1070 and M1071 do not work.
2. Special D registers description:
D1030 PV of Y0 pulse output (Low word)
D1031 PV of Y0 pulse output (High word)
D1032: Low word of the present value of Y1 pulse output
D1033 High word of the present value of Y1 pulse output
D1336 PV of Y2 pulse output (Low word)
D1337 PV of Y2 pulse output (High word)
D1338: Low word of the present value of Y3 pulse output.
D1339: High word of the present value of Y3 pulse output.
3-144
3 . I ns t r u c ti o n Se t
3. When output device is specified with Y0, Y2, the start/end frequency of Y0 is set by D1340 and
start/end frequency of Y2 is set by D1352.
4. When output device is specified with Y1, Y3, the start/end frequency is 0Hz.
5. When D1220/D1221 = K1 or K2, positive/negative sign of S2 denotes pulse output direction.
6. PLSR instruction supports two modes of pulse output as below list.
Mode D1220 D1221
Output K0 K1 K0 K1
Y0 Pulse Pulse
Y1 Pulse Dir
Y2 Pulse Pulse
Y3 Pulse Dir
7. When assigning Y0 and Y2 output mode as Pulse, i.e. D1220 = K0, D1221 = K0, the available range
for S2 is 1~32,767 (16-bit instruction) and 1~2,147,483,647 (32-bit instruction).
3-145
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
8. When assigning Y0 and Y2 output mode as Pulse/Dir, i.e. D1220 = K1, D1221 = K1, the available
range for S2 is 1~32,767 or -1~-32,768 (16-bit instruction) and 1~2,147,483,647 or
-1~-2,147,483,648 (32-bit instruction)
9. When assigning output device as Y1 and Y3, the available range for S2 is 1~32,767 (16-bit
instruction) and 1~2,147,483,647 (32-bit instruction).
10. S3: Ramp up/down time (unit: ms, min. 20ms).
When assigning output device as Y1 and Y3, the set value of ramp up and ramp down time should
be the same.
When assigning output device as Y0 and Y2, and if:
M1534 = OFF (Y0) and M1535 = OFF (Y2), the ramp up and ramp down time should be the
same.
M1534 = ON and M1535 = ON, then S3 specifies ramp up time only. The ramp down time is
specified by value set in D1348 (Y0) and D1349 (Y2).
11. When M1257 = OFF, ramp up/down curve of Y0 and Y2 is straight line. When M1257 = ON, ramp
up/down curve will be S curve. The ramp up/down curve of Y1 and Y3 is fixed as straight line
12. The output will not be affected if S1, S2 or S3 are changed when PLSR instruction is being executed.
PLSR instruction has to be stopped if changing values in S1, S2 or S3 is required.
13. Flags for indicating pulse output status:
Output Y0 Y1 Y2 Y3
Completion M1029 M1030 M1102 M1103
Immediately Pause M1078 M1079 M1104 M1105
a) When pulse output on Y0/Y1 specified as Pulse/Dir (D1220 = K1) is completed, completion flag
M1029 = ON.
b) When pulse output on Y2/Y3 specified as Pulse/Dir (D1221 = K1) is completed, completion flag
M1102 = On
c) When PLSR/DPLSR instruction is activated again, the completion flags will automatically be
reset.
14. During the ramp up process, the pulse numbers (frequency x time) of each speed shift may not all be
integer values, but PLC will operate integer value only. In this case, the omitted decimals will result
in errors between each speed shift, i.e. pulse number for each shift may differ due to this operation.
For ensuring the required output pulse number, PLC will fill in pulses as need automatically in order
to correct the deviation.
15. There is no limitation on the times of using this instruction in the program. However, only 4
instructions can be executed at the same scan time. When several pulse output instructions (PLSY,
PWM, PLSR) use Y1 as the output device in the same scan cycle, PLC will execute pulse output
according to the driven order of these instructions.
16. Set value falls out of the available range of operands will be automatically corrected with the min. or
max available value.
3-146
3 . I ns t r u c ti o n Se t
Pulse speed(Hz)
3-147
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Y0.
M1257: Set the ramp up/down of Y0, Y2 to be S curve. ON = S curve.
M1158: Enabling the mask and alignment mark function on I600/I601(X6) corresponding to
Y2.
M1534: Enable ramp-down time setting on Y0. Has to be used with D1348
M1535: Enable ramp-down time setting on Y2. Has to be used with D1349
2. Description on associated special registers:
For D1030~D1033, D1336~D1339, D1220, D1221, please refer to PLSY instruction
D1026: M1156 = ON, D1026 stores pulse number for masking Y0 (Low word).
D1027: M1156 = ON, D1026 stores pulse number for masking Y0 (High word).
D1135: M1158 = ON, D1135 stores pulse number for masking Y2 (Low word).
D1136: M1158 = ON, D1135 stores pulse number for masking Y2 (High word).
D1232: Output pulse number for ramp-down stop when Y0 mark sensor receives signals.
(Low word).
D1233: Output pulse number for ramp-down stop when Y0 mark sensor receives signals.
(High word).
D1234: Output pulse number for ramp-down stop when Y2 mark sensor receives signals
(Low word).
D1235: Output pulse number for ramp-down stop when Y2 mark sensor receives signals
(High word).
D1348: M1534 = ON, D1348 stores the ramp-down time of CH0(Y0, Y1) pulse output.
D1349: M1535 = ON, D1349 stores the ramp-down time of CH1(Y2, Y3) pulse output.
D1340 Start/end frequency of the pulse output CH0 (Y0, Y1)
D1352 Start/end frequency of the pulse output CH1 (Y2, Y3)
3. Operation of Mark function on Y0:
Frequency
Pulse number if no
Start/end external interrupt on X4
freuquency
D1340
Time
D1348 Ramp-down time Pulse
Ramp-up number
time
DD1232
Ramp-down stop pulse
number when Mark
is detected
3-148
3 . I ns t r u c ti o n Se t
When M1156/M1158 = ON, enable ramp-down pause (Mark function) on Y0/Y2 when X4/X6
receives interrupt signals.
When Mark function is enabled, ramp down time is independent of the ramp up time. Users can
set ramp up time in S3 and ramp down time in D1348/D1349. (Range: 20ms~32767ms)
When Mark function is executed and the ramp-down stop pulses (DD1232/DD1234) are
specified, PLC will execute ramp-down stop with specified pulses after Mark is detected.
However, if DD1232/DD1234 are less than the specified ramp-down time (D1348 / D1349), PLC
will fill DD1232/DD1234 with the value of ramp-down time. In addition, if DD1232/DD1234 is
more than the half of total output pulses, PLC will modify DD1232/DD1234 to be less than half of
the total output pulses.
Ramp-down stop pulses (DD1232/DD1234) are 32-bit value. Set value K0 will disable the Mark
function.
Y0,Y2 relative parameters for Mask and Alignment Mark function:
Parameter Pulse number Output
Ramp Pulse number
Input for ramp-down pause Pause
Mark flag down for masking
Output points of Mark (ramp status
time output
function down)
Y0 M1156 X4 D1348 D1026, D1027 D1232, D1233 M1108 M1538
Y2 M1158 X6 D1349 D1135, D1136 D1234, D1235 M1110 M1540
Program example 1:
M0
SET M1156
M0
DPLSR K100000 K1000000 K20 Y0
FEND
M1000
I401 INCP D0
IRET
END
Explanations:
When M0 is triggered, Y0 executes pulse output. If external interrupt is detected on X4, pulse
output will perform ramp down process for 10,000 pulses and then stop. M1108 will be ON to
indicate the pause status (ramp down). If no interrupt is detected, Y0 pulse output will stop after
1,000,000 pulses are completed.
When pulse output ramps down and stops after Mark is detected, M1538 will be ON to indicate
3-149
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
the pause status. If users need to complete the remaining pulses, set OFF the flag M1108 and
pulse output will resume.
4. Operation of Mask function on Y0:
Frequency
Y0 is masked from Y0 is ready for
interrupts on X4 interrupts from X4
Target
speed
Pulse number if no
Start/end external interrupt on X4
frequency
D1340 Time
Pulse
Ramp down time
number
(D1348)
Pulses to be masked,
Specified by DD1026
Ramp-down stop pulse
number when Mark
is detected (D D1232 )
Mask function on Y0 will be enabled when D1026 and D1027 are specified with values other
than 0. Mask function is disabled when D1026 and D1027 are specified with 0. If pulse output
process can not reach the target speed, PLC will clear DD1026 to disable the Mask function. If
the Mask range is set to be within the ramp-up section, PLC will automatically modify DD1026 to
be longer than the ramp-up section. On the other hand, if DD1026 is set between ramp- down
section, PLC will modify DD1026 to be the range before the beginning of ramp-down process.
Mask function setting method on Y2 is the same as Y0.
Program example 2:
M0
SET M1156
M0
DPLSR K100000 K1000000 K20 Y0
FEND
M1000
I401 INCP D0
IRET
END
Explanations:
When M0 is triggered, Y0 executes pulse output. When external interrupt is detected on X4 after
50,000 pulses, pulse output will perform ramp down process for 10,000 pulses and then stop.
3-150
3 . I ns t r u c ti o n Se t
M1108 will be ON. If no interrupt is detected on X4, Y0 pulse output will stop after 1,000,000
pulses are completed.
Interrupt triggered between 0 ~ 50,000 pulses will be invalid, i.e. no ramp-down process will be
performed before 50,000 pulses are achieved.
Points to note:
When Mark function is executed with Mask function, PLC will check the validity of Mask range
first, then ramp-down stop pulses of Mark function. If the above set values exceed the proper
range, PLC will automatically modify the set values after the instruction is executed.
When PLSR or positioning instructions with ramp-up/down section are enabled, the user can
check the pulses of ramp-up section in DD1127 and pulses of ramp-down section in DD1133.
Users can perform single speed positioning when ramp-up/down time setting is not specified.
5. Adding mask and alignment mark function for CH0 and CH1
Available for the followings
ES2/EX 12SA2/
Series ES2-C ES2-E SS2 26SE 28SA2
2 SX2
Firmware
V3.28 V3.28 V3.48 V2.82 V3.28 V2.0 V3.0
version
CH0 and CH1 relative parameters for Mask and Alignment Mark function:
pulse
pulse number
Ramp Pulse number
Mark Input Ramp start/end number for for
Output down for ramp-down
flag points up time frequency masking in masking
time of Mark function
the front in the
back
CH0 D1026 D1100
M1156 X4 D1343 D1348 D1340 D1232/D1233
(Y0/Y1) D1027 D1101
CH1 D1135 D1102
M1158 X6 D1353 D1349 D1352 D1234/D1235
(Y2/Y3) D1136 D1103
3-151
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Frequency (Hz)
Target
frequency
start/end frequency
D1340
Pulse
Number
D1026D1027 D1100D1101
Pulse number to end for masking in the front Pulse number to start for
masking in the back
Alignment mark function can be done in the sections of ramp-up, rump-down and speed.
The frequency for the normal slope is defined by the frequencies of starting, ending and the
3-152
3 . I ns t r u c ti o n Se t
target as well as the time of ramp-up and down. See the black line for reference.
The frequency for the fixed slope is defined by the frequencies of starting, ending and the
maximum as well as the time of ramp-up and down. See the red line for reference.
7. Add new functions such as adding alignment marks to the ramping down, the frequency of the fixed
slope and selected masking for the output points Y1 and Y3. The actions are the same as
aforementioned 5 and 6. And the relative parameters are listed below.
Available for the followings
ES2/EX 12SA2/
Series ES2-C ES2-E 26SE 28SA2
2 SX2
Firmware
V3.42 V3.48 V3.48 V2.86 V2.0 V3.0
version
3-153
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-154
3 . I ns t r u c ti o n Se t
Program Example 2:
Robot arm control (by IST instruction):
1. Control purpose:
Select the big balls and small balls and move them to corresponding boxes. Configure the
control panel for each operation.
2. Motion of the Robot arm:
lower robot arm, clip balls, raise robot arm, shift to right, lower robot arm, release balls, raise
robot arm, shift to left to finish the operation cycle.
3. I/O Devices
Right-limit X2 Right-limit X3
Left-limit X1 (big balls) (small balls)
Y0
Upper-limit X4 Y3 Y2
Y1
Upper-limit X5
Ball size Big Small
sensor X0
4. Operation mode:
Single step: Press single button for single step to control the ON/OFF of external load.
Zero return: Press zero return button to perform homing on the machine.
Auto (Single step / One cycle operation / Continuous operation):
Single step: the operation proceeds with one step every time when Auto ON is pressed.
One cycle operation: press Auto ON at zero position, the operation performs one full cycle
operation and stops at zero point. If Auto OFF is pressed during the cycle, the operation will
pause. If Auto ON is pressed again, the operation will resume the cycle and stop at zero
point.
Continuous operation: press Auto ON at zero position, the operation will perform continuous
operation cycles. If Auto OFF is pressed, the operation will stop at the end of the current
cycle.
5. Control panel
Clip Right
balls Ascend Shift Step X32
3-155
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. START circuit:
X0 X1 Y4
M1044
M1000
IST X30 S20 S80
7. Manual mode:
S0 X20
S SET Y4 Clip balls
X21
RST Y4 Release balls
X22 Y1
Y0 Raise robot arm
X23 Y0 Interlock
Y1 Lower robot arm
X24 X4 Y3
Y2 Shift to right Y2 and Y3 interlocked and
X25 X4 Y2 X4 = ON is the condition
Y3 Shift to left for output Y2 and Y3
S1
X35
S10 RST Y4 Release balls
3-156
3 . I ns t r u c ti o n Se t
b) Ladder Diagram:
S1 X35
S SET S10 Enter zero return mode
S10
S RST Y4 Release balls
Y3
X1 Shift to left and to reach
SET S12 the left-limit (X1 = On)
S12
S SET M1043 Enable zero return completed flag
S2
M1041
M1044
S20 Y1
X5 X5
X0 X0
S30 SET Y4 S40 SET Y4
TMR T2 K30
T2
X4
S70 Y0
X4
X1
S80 Y3
X1
S2
3-157
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b) Ladder Diagram:
S2 M1041 M1044
S SET S20 Enter auto operation mode
S20
S Y1 Lower robot arm
X5 X0
SET S30
X5 X0
SET S40
S30
S SET Y4 Clip balls
TMR T0 K30
T0
SET S31
S31 X4
Raise robot arm to the
S Y0 upper-limit (X4 = ON)
X4
SET S32
S32 X2
S Y2 Shift to right
X2
SET S50
S40
S SET Y4 Clip balls
TMR T1 K30
T1
SET S41
S41 X4
S Y0 Raise robot arm to the
upper-limit (X4 = ON)
X4
SET S42
S42 X3
S Y2 Shift to right
X3
SET S50
S50 X5
S Y1 Lower robot arm
X5
SET S60
S60
S RST Y4 Release balls
TMR T2 K30
T2
SET S70
S70 X4
S Y0 Raise robot arm to the
upper-limit (X4 = ON)
X4
SET S80
S80 X1
S Y3 Shift to left to reach
the left-limit (X1 = On)
X1
S2
RET
END
3-158
3 . I ns t r u c ti o n Se t
Flag explanation:
M1040:
Disable step transition. When M1040 = ON, all motion of step points are disabled.
1. Manual operation mode: M1040 remains ON in manual mode.
2. Zero return mode/one cycle operation mode: M1040 remains ON in the interval after Auto
Stop and before Auto Start is pressed.
3. Step operation mode: M1040 remians ON until Auto Start is pressed.
4. Continuous operation mode: When PLC goes from STOPRUN, M1040 = ON. When Auto
Start is pressed, M1040 turns OFF.
M1041:
Step transition starts. This special M indicates the transition from step point S2 to the next step
point.
1. Manual operation mode/Zero return mode: M1041 remians OFF.
2. Step operation mode/One cycle operation mode: M1041 = ON when Auto Start is pressed.
3. Continuous operation mode: M1041 stays ON when Auto Start is pressed and turns OFF
when Auto Stop is pressed.
M1042:
Enable pulse operation: When Auto Start is pressed, PLC sents out pulse once for operation. .
M1043:
Zero return completed: M1043 = ON indicates that zero return is completed.
M1044:
Zero point condition: In continuous operation mode, M1044 has to be ON as a condition for enabling
step transition from S2 to the next step point.
M1045:
Disable all output reset function.
If the machine (not at the zero point) goes,
- from manual (S0) to zero return (S1)
- from auto (S2) to manual (S0)
- from auto (S2) to zero return (S1)
And
M1045 = OFF, any of the S among D1 ~ D2 in action will be reset as well as the output Y.
M1045 = ON, output Y will be retained but the step in action will be reset.
If the machine (at the zero point) goes from zero return (S1) to manual (S0), no matter M1045 is
ON or OFF, Y output will be retained but the step in action will be reset.
M1046:
Indicates STL(Step Ladder) status. When STL operation is activate, M1046 = ON if any of the step
point S is ON. If M1047 = ON, M1046 also activates to indicate ON status of step points. In addition,
3-159
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1040 ~ D1047 records 8 step numbers from the current ON step to the previous 7 ON steps.
M1047:
Enable STL monitoring. When IST instruction executes, M1047 will be forced ON, i.e. M1047
remains ON in every scan cycle as long as IST instruction is executing. This flag is used to monitor
all step points (S).
D1040~D1047:
Records 8 step numbers from the current ON step to the previous 7 ON steps.
3-160
3 . I ns t r u c ti o n Se t
Data to be Data
S1 Content Result D Content Explanation
compared No.
D10 88 0 D50 4 The total data numbers of equal value
D11 100 S2 1 Equal D51 1 The number of the first equal value
D12 110 2 D52 8 The number of the last equal value
D13 150 3 D53 7 The number of the smallest value
n D14 100 4 Equal D54 9 The number of the largest value
D15 300 D0=K100 5
D16 100 6 Equal
D17 5 7 Smallest
D18 100 8 Equal
D19 500 9 Largest
3-161
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X21
CNT C10 K400
3-162
3 . I ns t r u c ti o n Se t
4. M10~ M13 = ON when the current value of C10 falls between lower and upper bounds.
Lower-bound value Upper- bound value Current value of C10 Output
D100= 40 D101 = 100 40C10100 M10 = ON
D102 = 120 D103 = 210 120C10210 M11 = ON
D104 = 140 D105 = 170 140C10170 M12 = ON
D106 = 150 D107 = 390 150C10390 M13 = ON
5. If the lower bound value is bigger than upper bound value, when C10<60 or C10 > 140, M12 =
ON.
Lower- bound value Upper- bound value Current value of C10 Output
D100 = 40 D101 = 100 40C10100 M10 = ON
D102 = 120 D103 = 210 120C10210 M11 = ON
D104 = 140 D105 = 60 60C10140 M12 = OFF
D106 = 150 D107 = 390 150C10390 M13 = ON
40 100
M10
120 210
M11
60 140
M12
150 390
M13
0 200 400
3-163
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-164
3 . I ns t r u c ti o n Se t
5. When X0 turns from ON OFF, C10 and C11 will all be reset to 0 and M10~M14 = OFF. When
X0 turns ON again, this instruction will be executed again from the beginning.
X0 M1013
CNT C10 K100
X0
40
30 30
25
C10 15 15 15
10
Current value
3 4
C11
2
Current value 0 1 0 1 0 1
M10
M11
M12
M13
M14
M1029
3-165
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
D1
D0
D1
D0
T T
On time (sec) On time (sec)
3. If ON duration of X0 is T sec, the relation between D0, D1 and n are shown as the table below.
n D0 (unit: sec) D1 (unit: 100 ms)
K0 T (sec) 1 D1 = D010
K1 T (sec) 10 D1 = D0
K2 T (sec) 100 D1 = D0/10
3-166
3 . I ns t r u c ti o n Se t
Program Example 2:
1. Use TMR instruction to write in 10 groups of set time.
2. Write the set values into D100 ~ D109 in advance
3. The timer resolution is 0.1 sec for timers T0 ~ T9 and 1 sec for the teaching timer.
4. Connect the 1-bit DIP switch to X0 ~ X3 and use BIN instruction to convert the set value of the
switch into a bin value and store it in E.
5. The ON duration (in sec) of X20 is stored in D200.
6. M0 is a pulse for one scan cycle generated when the teaching timer button X20 is released.
7. Use the set number of the DIP switch as the index pointer and send the content in D200 to
D100E (D100 ~ D109).
M10
TMR T0 D100
M11
TMR T1 D101
M19
TMR T9 D109
M1000
BIN K1X0 E
X20
TTMR D200 K0
X20
PLF M0
M0
MOV D100 D200E
Note:
The TTMR instruction can only be used 8 times in a program. If TTMR is used in a CALL subroutine
or interrupt subroutine, it only can be use once.
3-167
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X20
Y0 5 sec 5 sec
Y1 5 sec 5 sec
Y2 5 sec
Y3 5 sec
3-168
3 . I ns t r u c ti o n Se t
6. Apply a NC contact Y3 after the drive contact X20, and Y1, Y2 will form a flashing circuit output.
When X20 turns OFF, Y0, Y1 and Y3 = OFF and the content of T10 will be reset.
X20 Y3
STMR T10 K50 Y0
X20
Y1
Y2 5 sec 5 sec
3-169
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
Y0
Program Example 2:
Creating a flashing circuit by applying ALTP with a timer
When X20 = ON, T0 will generate a pulse every two seconds and output Y0 will be switched
between ON and OFF by the pulses from T0.
X20 T0
TMR T0 K20
T0
ALTP Y0
3-170
3 . I ns t r u c ti o n Se t
3-171
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If X20 = ON,
D11
D10
D12
D12
D11
D10
n scans n scans
D10<D11 D10 >D11
The scan times is stored in D13
Points to note:
The variation of the content in D12 according to ON/OFF state of M1026 (Ramp mode selection):
M1026=ON M1026=OFF
D11
D11
D12 D10 D12
D10
100
100
D13 D13
0 0
M1029 M1029
3-172
3 . I ns t r u c ti o n Se t
Parameters Descriptions
K5 Transform 8-bit HEX data into ASCII data (higher 4 bits, lower 4 bits)
K6 Transform 8-bit ASCII data into HEX data (higher 4 bits, lower 4 bits)
K7 Transform 8-bit ASCII data into HEX data (higher 4 bits, lower 4 bits)
3-173
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
K35 position of the first written BIT data and so on. (first in first out)
Available for ES2/EX2 V3.46, ES2-C V3.48, SA2/SX2 V2.86, SS2 V3.40
Read the last written BIT data (last in first out)
K36
Available for ES2/EX2 V3.46, ES2-C V3.48, SA2/SX2 V2.86, SS2 V3.40
3-174
3 . I ns t r u c ti o n Se t
Hi-byte Lo-byte
Hi-byte Lo-byte
K1: With n = 4, transform 8-bit data into 16-bit data (Lo-byte, Hi-byte) in the following rule:
Hi-byte Lo-byte
Hi-byte Lo-byte
K2: With n = 2, transform 16-bit data (Hi-byte, Lo-byte) into 8-bit data in the following rule:
K2 can work with K4, refer to example of K4 for more information.
Hi-byte Lo-byte
Hi-byte Lo-byte
K3: With n = 2, transform 16-bit data (Lo-byte, Hi-byte) into 8-bit data in the following rule:
Hi-byte Lo-byte
Hi-byte Lo-byte
3-175
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
K4: With n = 3, transform 8-bit HEX data into ASCII data (higher 4 bits, lower 4 bits) in the
following rule:
Hi-byte Lo-byte
Hi-byte Lo-byte H
L
H
L
H
L
M0
DTM D0 D2 K2 K2
DTM D2 D10 K4 K4
Register D0 D1
Value H1234 H5678
When the 1st DTM instruction executes (m=K2), ELC transforms the 16-bit data (Hi-byte,
Lo-byte) into 8-bit data and move to registers D2~D5.
Register D2 D3 D4 D5
Value H12 H34 H56 H78
When the 2nd DTM instruction executes (m=K4), ELC transforms the 8-bit HEX data into
ASCII data and move to registers D10~D17.
3-176
3 . I ns t r u c ti o n Se t
K5: With n = 3, transform 8-bit HEX data into ASCII data (lower 4 bits, higher 4 bits) in the
following rule:
Hi-byte Lo-byte
Hi-byte Lo-byte L
H
L
H
L
H
K6: When n = 4, transform 8-bit ASCII data (higher 4 bits, lower 4 bits) into HEX data in the
following rule: (ASCII value to be transformed includes 0 ~ 9 (0x30~0x39), A ~ F (0x41~0x46),
and a ~ f (0x61~0x66).)
Hi-byte Lo-byte
Hi-byte Lo-byte
K7: When n = 4, transform 8-bit ASCII data (lower 4 bits, higher 4 bits) into HEX data in the
following rule:
Hi-byte Lo-byte
Hi-byte Lo-byte
3-177
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
K8: Transform 8-bit GPS data into 32-bit floating point data in the following rule:
Hi-byte Lo-byte
32bit Floating (S+4=H4E )
S+0 dd
dd.mm1mm2 mm3 D+0
S+1 mm1
mm2 32bit Floating (S+4 != H4E )
S+2
S+3 mm3 dd.mm1mm2 mm3 D+0
S+4 4E
S+5 dd1
S+6 dd0
32bit Floating (S+10=H45)
S+7 mm1
dd1dd0.mm1mm2mm3 D+2
S+8 mm2
S+9 mm3 32bit Floating (S+10 != H45)
K9: Calculate the optimal frequency for positioning instructions with ramp up/ down function.
Users only need to set up the total number of pulses for positioning and the total time for
positioning first, DTM instruction will automatically calculate the optimal max output
frequency as well as the optimal start frequency for positioning instructions with
ramp-up/down function such as PLSR, DDRVI and DCLLM.
Points to note:
1. When the calculation results exceed the max frequency of PLC, the output frequency will be
set as 0.
2. When the total of ramp-up and ramp-down time exceeds the total time for operation, PLC
will change the total time for operation (S+2) into ramp-up time (S+3) + ramp-down time
(S+4) + 1 automatically.
Explanation on operands:
S+0, S+1: Total number of pulses for operation (32-bit)
S+2: Total time for operation (unit: ms)
S+3: Ramp-up time (unit: ms)
S+4: Ramp-down time (unit: ms)
D+0, D+1: Optimal max output frequency (unit: Hz) (32-bit)
D+2: Optimal start frequency (Unit: Hz)
n: Reserved
Example: K9
1. Set up total number of pulses, total time, ramp-up time and ramp-down time in source device
starting with D0. Execute DTM instruction and the optimal max frequency as well as optimal
start frequency can be obtained and executed by positioning instructions.
3-178
3 . I ns t r u c ti o n Se t
Example:
Input: Longitude F121.55, Time zone: +8, Local time: AM 8:00:00, Jan/6/2011
Conversion results: AM 8:06:12, Jan/6/2011
3-179
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S+1, S+2.. S+n: set values of multi-point areas. S+1 must be the minimum value, S+2 must
be larger than S+1 and so on. Therefore, S+n must be the maximum value.
D: output value gotten from the proportional value calculation
D+1, D +2 D+n: the range of values gotten from the proportional value calculation
n: set values of multi-point areas. The range of set values is K2~K50. When the set value
exceeds the range, it will not be executed.
D+1
D
D+2
D+4
D+3
S
S+1 S+2 S+3 S+4
3-180
3 . I ns t r u c ti o n Se t
destination data string. The source data string will be copied in byte order until the ETX (value
0x00) is reached.
Points to note:
The operand n sets the max data length after the string combination (max 256). If the ETX is not
reached after the combination, the location indicated by n will be the ETX and filled with 0x00.
The combination will be performed in the following rule:
Hi-byte Lo-byte
S+0 A
S+1 B Hi-byte Lo-byte
S+2 C D+0 a
S+3 D D+1 b
D+1 b D+6 D
D+3 0x00
Hi-byte Lo-byte
S+0 a
S+1 b Hi-byte Lo-byte
S+2 c D+0 a
n = k3
S+3 A D+1 b
S+4 B D+2 c
S+6 D
S+7 0x00
3-181
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Hi-byte Lo-byte
S+0 1
S+1 2
S+2 3
32-bit Floating value
S+3 . D+0
123.456
S+4 4 D+1
S+5 5
S+6 6
S+7 0x00
3-182
3 . I ns t r u c ti o n Se t
Hi-byte Lo-byte
D+0 1
D+1 2
D+2 3
32-bit Floating value n = k6
S+0 D+3 .
123.45678
S+1 D+4 4
D+5 5
D+6 6
D+7 0x00
K31: Copy word type data to the consecutive registers of the PLC
Copy the source value stored in S to the target device as the index value indicated and
then accumulate 1 to the index value.
Note1: when the index value (D+0) is less than 1, it will be treated as 1 and the actions of
data copy and accumulation begin. When the index value (D+0) is bigger than n (default:
n+1), the action of data copy will not begin.
Note 2: D1000~D1999 cannot be used as D devices.
3-183
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example:
1. If M0 switches OFFON for 5 times in a row, execute the instruction DTM will copy the
values stored in D0 to D101~105, as the image shown below:
2. Adding one to the value stored in D100, after the execution of the DTM instruciton is
complete.
K32: Read the first written register to the D device (target value) and move the succeeding
registers forward, for example, move the second register to where the first written register
was and so on. (first in first out)
Read and store the data stored from S+1 to the D device and move the value in S+2
forward to S+1. Put k0 to the last and then diminish the index value (S+0) by 1.
Note:
When the value in S+0 is less than 2, it means there is no data to be read/moved and no
action will be taken. When the value in S+0 is bigger than n+1, it means the data is full
and no action will be taken. No action will be taken means no error will be displayed nor
the index value (S+0) will have any change.
3-184
3 . I ns t r u c ti o n Se t
Example:
1. If M0 switches OFFON, execute the instruction DTM will copy the values stored in
D101 to D0.
2. As the image shown below, execute the instruciton DTM to copy the value K12 stored in
D101 to D0 and put K0 to D105.
3. Execute the instruciton DTM for 5 times to have the results: D0=K16 and values in
D101~105 are K0.
K33: Read the last written register to the D device (target value) (last in first out).
Diminish the index value (S+0) by 1 and then read and store the data stored from
S+[S+0] to the D device and put K0 to the source value S+[S+0].
Note:
When the value in S+0 is less than 2, it means there is no data to be read/moved and no action will
be taken. When the value in S+0 is bigger than n+1, it means the data is full and no action will be
3-185
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
taken. No action will be taken means no error will be displayed nor will the index value (S+0) have
any change.
Example:
1. If M0 switches OFFON, execute the instruction DTM will copy the values stored in D105
to D0.
2. As the image shown below, execute the instruciton DTM to copy the value K16 stored in
D105 to D0 and put K0 to D101.
3. Execute the instruciton DTM for 5 times to have the results: D0=K12 and values in
D101~105 are K0.
K34: Copy BIT type data to the consecutive registers of the PLC
S: the source start number of the M device
D: the target start number of the M device
Copy the M state from source value stored in S to the M[D+0] (target device) as the target index
value indicated and then accumulate 1 to D+1 (target index value).
3-186
3 . I ns t r u c ti o n Se t
Note1: when the target index value (D+1) is less than 0, change D+1 to 0 and the actions of
data copy and accumulation begin. When the target index value (D+1) is bigger than n-1,
change D+1 to n; the action of data copy will not begin.
Note 2: M1000~M1999 cannot be used as M devices.
Example:
1. Set D0=K50 and D100=K100, and execute the instruction DTM will copy the values stored
in M50 to M100~107. After the execution of DTM is complete, add one to the value stored in
D101.
2. Execute the instruciton DTM for 8 times to have the results as shown below:
K35: Read the first written BIT data to the BIT device (target value) and move the succeeding
BIT data forward, for example, move the second BIT data to where the first written BIT data was
and so on. (first in first out)
S: the source start number of the M device
D: the target start number of the M device
3-187
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Read and store the state stored from M[S+0]+0 to the M[D] (target value) and move the state of
the succeeding forward and change the state of the last to OFF and then diminish the index
value (S+1) by 1.
Note 1: When the value in S+1 is less than 1, it means there is no data to be read/moved and no
action will be taken. When the value in S+1 is bigger than n, it means the data is full and no
action will be taken. No action will be taken means no error will be displayed nor will the index
value (S+1) have any change.
Note 2: M1000~M1999 cannot be used as M devices.
Example:
1. Set D100=K100 and D10=K70, and execute the instruction DTM will copy the states in
M100~107 to M70. After the execution of DTM is complete, add one to the value stored in
D101.
2. Execute the instruciton DTM to move the stae 1 in M100 to M70 and put 0 in M107 as
shown below:
3-188
3 . I ns t r u c ti o n Se t
3. Execute the instruciton DTM for 8 times to have the results: M70=1 and the states in
M100~M107 are 0.
K36: Read the last written register to the D device (target value) (last in first out).
Diminish the index value (S+0) by 1 and then read and store the data stored from
S+[S+0] to the D device and put K0 to the source value S+[S+0].
Note:
When the value in S+0 is less than 2, it means there is no data to be read/moved and no action will
be taken. When the value in S+0 is bigger than n+1, it means the data is full and no action will be
taken. No action will be taken means no error will be displayed nor the index value (S+0) will have
any change.
Example:
4. If M0 switches OFFON, execute the instruction DTM will copy the values stored in D105
to D0.
5. As the image shown below, execute the instruciton DTM to copy the value K16 stored in
D105 to D0 and put K0 to D101.
3-189
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. Execute the instruciton DTM for 5 times to have the results: D0=K12 and values in
D101~105 are K0.
3-190
3 . I ns t r u c ti o n Se t
Program Example:
When X0 = ON, the sorting process starts. When the sorting is completed, M1029 will be ON. DO
NOT change the data to be sorted during the execution of the instruction. If the sorting needs to be
executed again, turn X0 from OFF to ON again.
X0
SORT D0 K5 K5 D50 D100
3-191
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
1
2 D12 D655 D1165 D1654 D2163
3 D23 D780 D1298 D1789 D2290
4 D34 D870 D1360 D1899 D2350
5 D45 D995 D1479 D1975 D2469
1
2 D512 D5655 D6165 D6654 D7163
3 D521 D5790 D6275 D6766 D7279
4 D535 D5895 D6379 D6875 D7369
5 D543 D5980 D6498 D6989 D7490
1
2 D512 D5655 D6165 D6654 D7163
3 D525 D5795 D6279 D6775 D7269
4 D531 D5890 D6375 D6866 D7379
5 D543 D5980 D6498 D6989 D7490
3-192
3 . I ns t r u c ti o n Se t
If m1 is K1, and m2 is K1, one-dimensional data will be sorted. The value in D100 is K5. The values
in D0~D4 are shown below.
1. The values in D0~D4 are listed below.
Data source (S) D0 D1 D2 D3 D4
Data 75 65 98 60 79
3-193
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
0 1 2 3 4 5 6 7 8 9
24G +24V S/S X30 X31 X32 X33 X34 X35 X36 X37 X40 X41
ELC
3-194
3 . I ns t r u c ti o n Se t
0 1 2 3 4 5 6 7 8 9 number key
overflow 10 3 10
2
10
1
10
0
BCD value
BIN value D0
2. As shown in the timing diagram below, four keys connected with X35, X33, X31 and X30 are
pressed in order. Therefore, the number 5,301 is generated and stored in D0. 9,999 is the
maximum value allowed for D0. If the entered number exceeds the available range, the highest
digit performs overflow.
3. When X35 is pressed, M15 remains ON until another key is pressed and the rule applies to
other inputs.
4. M20 = ON when any of the keys is pressed.
5. When X20 is OFF, the value in D0 remains unchanged but M10~M20 will be OFF.
X30 3
X31 4
X33 2
X35 1
M10
M11
M13
M15
Key output
signal
M20 1 2 3 4
3-195
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-196
3 . I ns t r u c ti o n Se t
overflow 10 3 10
2
10
1
10
0
BCD value
BIN value D0
F E D C B A
M5 M4 M3 M2 M1 M0
3-197
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. External wiring:
C D E F
8 9 A B
4 5 6 7
0 1 2 3
PLC(Transistor output)
Points to note:
1. When HKY instruction is executed, 8 scan cycles (matrix scan) are required for reading the
input value successfully. A scan cycle that is too long or too short may cause the input to be
read incorrectly. In this case we suggest the following solutions:
If the scan cycle is too short, I/O may not be able to respond in time, resulting in incorrect input
values. To solve this problem please fix the scan time.
If the scan period is too long, the key may respond slowly. In this case, write this instruction into
the time-interrupt subroutine to fix the execution time for this instruction.
2. The function of flag M1167:
When M1167 = ON, HKY instruction can input hexadecimal value consists of 0~F.
When M1167 = OFF, A~F of HKY instruction are used as function keys.
3-198
3 . I ns t r u c ti o n Se t
2. When X0 = ON, Y20~Y23 are scanned repeatedly. M1029 = ON for a scan time when a scan
cycle from Y20 to Y23 is completed.
X0
operation start
Y21 0.1s
interrupt
Y22 0.1s
Y23 0.1s
3-199
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Please use transistor output for Y20 ~ Y23. Every pin 1, 2, 4, 8 shall be connected to a diode
(0.1A/50V) in series before connecting to the input terminals on PLC.
Wiring diagram of DIP switch:
0 1 2 3
DIP switches for 10 10 10 10
BCD wiring
Must connect to a
diode (1N4148) in
series
1 2 4 8 1 2 4 8
0V +24V S/S X20 X21 X22 X23 X24 X25 X26 X27
PLC
C Y20 Y21 Y22 Y23
0 1 2 3
10 10 10 10
Points to note:
When the terminals to be scanned are relay outputs, the following program methods can be applied:
1. When X30 = ON, DSW instruction will be executed. When X30 goes OFF, M10 remains ON
until the current scan cycle of output terminals is completed..
2. If the drive contact X30 uses button switch, M10 turns off only when the current scan cycle on
outputs is completed, so that a correct value from DIP switch can be read. In addition, the
continuous scan cycle on outputs will be performed only when the drive contact is pressed and
held. Applying this method can reduce the driving frequency of relay outputs so as to extend to
life-span of relays.
X30
SET M10
M10
DSW X20 Y20 D20 K2
M1029
RST M10
3-200
3 . I ns t r u c ti o n Se t
0 0000 ON ON ON ON ON ON OFF
6 0110 a ON OFF ON ON ON ON ON
8 1000 c ON ON ON ON ON ON ON
d
9 1001 ON ON ON ON OFF ON ON
A 1010 ON ON ON OFF ON ON ON
3-201
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
2. When X20 = ON, Y24~Y27 will be scanned in circles automatically. Each circle requires 12
scan cycles. M1029 = ON for a scan cycle whenever a circle is completed.
3-202
3 . I ns t r u c ti o n Se t
C Y20 Y21 Y22 Y23 C Y24 Y25 Y26 Y27 C Y30 Y31 Y32 Y33
0 1 2 3
1 2 4 8
10 10 10 10
3 2 1 0 3 2 1 0
10 10 10 10 10 10 10 10
1 1
2 V+ 2
V+
4 4
8 8
Points to note:
1. For executing this instruction, scan time must be longer than 10ms. If scan time is shorter than
10ms, please fix the scan time at 10ms.
2. If the output points of PLC is transistor output, please apply proper 7-segment display.
3. Operand n is used for setting up the polarity of the transistor output and the number of sets of
the 4-digit 7-segment display.
4. The output point must be a transistor module of NPN output type with open collector outputs.
The output has to connect to a pull-up resistor to VCC (less than 30VDC). When wiring, output
should connect a pull-high resistor to VCC (less than 30VDC). Therefore, when output point Y
is ON, the output signal will be LOW.
3-203
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma nua l - Pr ogr am m i ng
VCC
Pull-up resistor
Drive Y
Y
Signal output
On
PLC
8. Parameter n settings:
Sets of 7-segment display 1 set 2 sets
BCD code data control signal
Drive (latch) signal
n 0 1 2 3 4 5 6 7
: Positive logic (Negative polarity) output
3-204
3 . I ns t r u c ti o n Se t
3-205
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. When Right key is pressed, the valid digit will shift as the following sequence:
10 10 10 10 10 10 . Besides, the digit indicators (LED, Y24 to Y27) will be ON for
3 2 1 0 3 2
3-206
3 . I ns t r u c ti o n Se t
Y24 Add / up
Y25
Digit indication
Y26 LED
X21
Y27
Move Move
X23 X22
10 3 10 2 10 1 10 0 to left to right
1
Y20 X20
2
Y21
4
Y22
8
Y23
Minus / down
3-207
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-208
3 . I ns t r u c ti o n Se t
Y20~Y27 data
A B C D H
T T T T : scan time(ms)
3-209
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
1. PR instruction supports ASCII data output of 8-bit data string when M1027 = OFF. When M1027
= ON, the PR instruction is able to execute an output of 1~16 bit data string.
2. When M1027 = ON and X20 = ON, this instruction will designate Y20 (lowest bit) ~ Y27 (highest
bit) as the output points and Y30 as scan signals, Y31 as execution flag. In this mode, users can
execute an output for 16 letters in sequence. In addition, if the drive contact X20 is OFF during
execution, the data output will stop until a full data string is completed.
3. The data 00H (NULL) in a data string indicates the end of the string and the letters coming after
will not be processed.
4. If the drive contact X20 is OFF during execution, the data output will stop until a full data string is
completed. However, if X20 remains ON, execution completed flag M1029 will not be active as
the timing diagram below.
M1002
SET M1027
X20
PR D0 Y20
T T T T : scan time or
interrupt time
M1029: execution
completed flag
Points to note:
1. Please use transistor output for the output points designated by this instruction.
2. When using this instruction, please fix the scan time or place this instruction in a timer interrupt
subroutine.
3-210
3 . I ns t r u c ti o n Se t
SA2/SX2:
n in the 16-bit n in the 32-bit
Operand m1 m2
instruction instruction
Right-side
0~7 0~48 1~6* 1~3*
module
Left-side
100~107 0~255 1~(256-m2) 1~(256-m2)/2
module
*The maximum number of values which can be read by SA2 V2.6/SX2 V2.4 (below) is 4 (16-bit
instruction/2 (32-bit instruction).
SE:
n in the 16-bit n in the 32-bit
Operand m1 m2
instruction instruction
1~4 1~2
Right-side
0~7 0~48 1~6 (SE V1.4 and 1~3 (SE V1.4
module
above) and above)
Left-side
100~108 0~255 1~(256-m2) 1~(256-m2)/2
module
3 - 2 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
SS2:
n in the 16-bit n in the 32-bit
Operand m1 m2
instruction instruction
1~4 1~2
Right-side
0~7 0~48 1~6 (SS2 V2.8 1~3 (SS2 V2.8
module
and above) and above)
Left-side
Left-side modules are not supported.
module
Program Example:
1. Read out the data in CR#29 of special module N0.0 to register D0 in PLC, and CR#30 of special
module No.0 to register D1 in PLC. 2 consecutive 16-bit data are read at one time (n = 2).
2. When X0 = ON, the instruction executes; when X0 = OFF, the previous content in D0 and D1
wont be changed.
X0
FROM K0 K29 D0 K2
3-212
3 . I ns t r u c ti o n Se t
Program Example:
1. Use 32-bit instruction DTO to write the content in D11 and D10 into CR#13 and CR#12 of
special module No.0. One 32-bit data is written at a time (n = 1)
2. When X0 = ON, the instruction executes; when X0 = OFF, the previous content in D10 and D11
wont be changed.
X0
DTO K0 K12 D10 K1
3-213
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. n: Number of data to be written at a time. n = 2 in 16-bit instruction has the same operation
results as n = 1 in 32-bit instruction.
Specified device Specified CR Specified device Specified CR
D0 CR #5 D0 CR #5
D1 CR #6 D1 CR #6
D2 CR #7 D2 CR #7
D3 CR #8 D3 CR #8
D4 CR #9 D4 CR #9
D5 CR #10 D5 CR #10
3-214
3 . I ns t r u c ti o n Se t
3-215
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-216
3 . I ns t r u c ti o n Se t
length = 4
3. The STX and ETX of external equipments will be received by PLC in data receiving process,
therefore, care should be taken on the setting of operand n (Length of data to be received).
16-bit mode:
1. STX (Start of Text) and ETX (End of text) are set up by M1126 and M1130 together with
D1124~D1126. When PLC executed RS instruction, STX and ETX will be sent out
automatically.
2. When M1161 = OFF, the 16-bit mode is selected, i.e. both high byte and low byte of the 16-bit
data will be received and transmitted.
M1001
M1161
X0
RS D100 K4 D120 K7
length = 4
3-217
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. The STX and ETX of external equipments will be received by PLC in data receiving process,
therefore, care should be taken on the setting of operand n (Length of data to be received)
Program Example 3: COM2 RS-485
1. Connect PLC to VFD-B series AC motor drives (AC motor drive in ASCII Mode; PLC in 16-bit
mode and M1161 = OFF).
2. Write the data to be sent into registers starting from D100 in advance in order to read 6 data
starting from address H2101 on VFD-B
M1002
Set up communication protocol as
MOV H86 D1120 9600,7,E,1
3-218
3 . I ns t r u c ti o n Se t
3. The status of Delta VFD series inverters can also be accessed by handy instruction API 105
RDST instruction through COM2/COM3 on PLC.
Program Example 4: COM2 RS-485
1. Connect PLC to VFD-B series AC motor drives (AC motor drive in RTU Mode; PLC in 16-bit
mode and M1161 = ON).
3-219
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. Write the data to be sent into registers starting from D100 in advance. Write H12 (Forward
running) into H2000 (VFD-B parameter address).
M1002
MOV H86 D1120 Set up communication protocol as 9600,7,E,1
3. The forward running function of Deltas VFD series inverter can also be set by handy instruction
API 102 FWD instruction through COM2/COM3 on PLC.
Program Example 5: COM1 RS-232
1. Only 8-bit mode is supported. Communication format and speed are specified by lower 8 bits of
3-220
3 . I ns t r u c ti o n Se t
D1036.
2. STX/ETX setting function (M1126/M1130/D1124~D1126) is not supported.
3. High byte of 16-bit data is not available. Only low byte is valid for data communication.
4. Write the data to be transmitted in advance into registers starting from D100 and set M1312
(COM1 sending request) as ON
5. When X0 = ON, RS instruction executes and PLC is ready for communication. D100 will then
start to send out 4 data continuously. When data sending is over, M1312 will be automatically
reset. (DO NOT apply RST M1312 in program). After approximate 1ms, PLC will start to receive
7 data and store the data in 7 consecutive registers starting from D120.
6. When data receiving is completed, M1314 will automatically be ON. When data processing on
the received data is completed, M1314 has to be reset (OFF) and the PLC will be ready for
communication again. However, DO NOT continuously execute RST M1314, i.e. it is suggested
to connect the RST M1314 instruction after the drive contact M1314
M1002
MOV H87 D1036 Setting communication protocol as 9600,8,E,1
Length = 4
3-221
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Length = 7
3-222
3 . I ns t r u c ti o n Se t
Length = 4
Length = 7
Points to note:
1. PLC COM1 RS-232: Associated flags (Auxiliary relays) and special registers (Special D) for
communication instructions RS / MODRD
Flag Function Action
COM1 retain communication settings. Communication settings will be
reset (changed) according to the content in D1036 after every scan
cycle. Users can set ON M1138 if the communication protocol User
M1138 requires to be retained. When M1138 = ON, communication settings sets and
will not be reset (changed) when communication instructions are resets
being processed, even if the content in D1036 is changed.
Supported communication instructions: RS / MODRW
COM1 ASCII / RTU mode selection, ON: RTU mode, OFF: ASCII User
M1139 mode. sets and
Supported communication instructions: RS / MODRW resets
COM1 sending request. Before executing communication instructions,
User
users need to set M1312 to ON by trigger pulse, so that the data
sets and
M1312 sending and receiving will be started. When the communication is
system
completed, PLC will reset M1312 automatically.
resets
Supported communication instructions: RS / MODRW
COM1 data receiving ready. When M1313 is ON, PLC is ready for
M1313 data receiving System
Supported communication instructions: RS / MODRW
3-223
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. PLC COM2 RS-485: Associated flags (Auxiliary relays) and special registers (Special D) for
communication instructions RS / MODRD / MODWR / FWD / REV / STOP / RDST / RSTEF /
MODRW.
Flag Function Action
Retain communication settings. Communication settings will be
reset (changed) according to the content in D1120 after every scan
cycle. Users can set ON M1120 if the communication protocol
User
M1120 requires to be retained. When M1120 = ON, communication
sets/resets
settings will not be reset (changed) when communication
instructions are being processed, even if the content in D1120 is
changed.
3-224
3 . I ns t r u c ti o n Se t
3-225
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Special
Function
register
Delay time of data response when PLC is SLAVE in COM2, COM3
RS-485 communication, Range: 0~10,000. (Unit: 0.1ms).
D1038
By using EASY PLC LINK in COM2, D1038 can be set to send next
communication data with delay. (unit: one scan cycle)
Converted data for Modbus communication data processing. PLC
automatically converts the ASCII data in D1070~D1085 into Hex data
D1050~D1055
and stores the 16-bit Hex data into D1050~D1055
Supported communication instructions: MODRD / RDST
3-226
3 . I ns t r u c ti o n Se t
Special
Function
register
Feedback data (ASCII) of Modbus communication. When PLCs RS-485
communication instruction receives feedback signals, the data will be
D1070~D1085 saved in the registers D1070~D1085 and then converted into Hex in
other registers.
RS instruction is not supported.
Sent data of Modbus communication. When PLCs RS-485
communication instruction (MODRD) sends out data, the data will be
D1089~D1099 stored in D1089~D1099. Users can check the sent data in these
registers.
RS instruction is not supported
COM2 (RS-485) communication protocol. Refer to the following table in
D1120
point 4 for protocol setting.
COM1 (RS-232) and COM2 (RS-485) PLC communication address when
D1121
PLC is slave.
D1122 COM2 (RS-485) Residual number of words of transmitting data.
D1123 COM2 (RS-485) Residual number of words of the receiving data.
COM2 (RS-485) Definition of start character (STX) Refer to the following
D1124 table in point 3 for the setting.
Supported communication instruction: RS
COM2 (RS-485) Definition of first ending character (ETX1) Refer to the
D1125 following table in point 3 for the setting.
Supported communication instruction: RS
COM2 (RS-485) Definition of second ending character (ETX2) Refer to
D1126 the following table in point 3 for the setting.
Supported communication instruction: RS
COM2 (RS-485) Communication time-out setting (unit: ms). If users set
up time-out value in D1129 and the data receiving time exceeds the
D1129 time-out value, M1129 will be set ON and the error code K1 will be stored
in D1130. M1129 has to be reset manually when time-out status is
cleared.
COM2 (RS-485) Error code returning from Modbus. RS instruction is not
included.
D1130
Supported communication instructions: MODRD / MODWR / FWD / REV
/ STOP / RDST / RSTEF / MODRW
3-227
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Special
Function
register
The specific end word to be detected for RS instruction to execute an
D1168 interruption request (I150) on COM2 (RS-485).
Supported communication instruction: RS
For COM2 RS-485 MODRW instruction. D1256~D1295 store the sent
data of MODRW instruction. When MODRW instruction sends out data,
D1256~D1295 the data will be stored in D1256~D1295. Users can check the sent data in
these registers.
Supported communication instruction: MODRW
For COM2 RS-485 MODRW instruction. D1296~D1311 store the
converted hex data from D1070 ~ D1085 (ASCII). PLC automatically
D1296~D1311
converts the received ASCII data in D1070 ~ D1085 into hex data.
Supported communication instruction: MODRW
3. PLC COM3 RS-485: Associated flags (Auxiliary relays) and special registers (Special D) for
communication instructions RS / MODRW and FWD / REV / STOP / RDST / RSTEF when
M1177 = ON.
Flag Function Action
COM3 retain communication settings. Communication settings will
be reset (changed) according to the content in D1109 after every
scan cycle. Users can set ON M1136 if the communication protocol
M1136 User
requires to be retained. When M1136 = ON, communication settings
sets and
will not be reset (changed) when communication instructions are
resets
being processed, even if the content in D1109 is changed
COM3 ASCII / RTU mode selection. ON : RTU mode, OFF: ASCII
M1320
mode.
COM3 sending request. Before executing communication User
instructions, users need to set M1316 to ON by trigger pulse, so that sets,
M1316
the data sending and receiving will be started. When the system
communication is completed, PLC will reset M1316 automatically. resets
Data receiving ready. When M1317 is ON, PLC is ready for data System
M1317
receiving. sets
System
sets,
M1318 COM3 data receiving completed.
user
resets
3-228
3 . I ns t r u c ti o n Se t
3-229
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-230
3 . I ns t r u c ti o n Se t
3-231
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. When RS instruction is applied for communication between a PLC and peripheral devices,
usually the STX (Start of the text) and the ETX (End of the text) have to be defined. User can
use D1124~D1126 to set the STX and the ETX by means of COM2, or use the STX and the
ETX defined by the PLC. If the users use M1126, M1130, D1124~D1126 to set the STX and the
ETX, b8~b10 in D1120 using the RS-485 communication protocol need to be set to 1. Please
refer to the table below.
M1130
0 1
D1124: user defined D1124: H 0002
0 D1125: user defined D1125: H 0003
M1126
M1002
MOV H788 D1120
When STX, ETX1 and ETX2 are applied, care should be taken on setting the ON/OFF status of
M1126 and M1130.
8. D1250(COM1)D1253(COM3) communication error code:
Value Error Description
3-232
3 . I ns t r u c ti o n Se t
9. Corresponding table between D1167~D1169 and the associated interrupt pointers. (Only lower
8 bits are valid)
COM Port I10 interrupt Special D
COM1 I140 D1167
COM2 I150 D1168
COM3 I160 D1169
The communication protocol is in Modbus ASCII mode, i.e. every byte is composed of 2 ASCII
characters. For example, 64Hex is 64 in ASCII, composed by 6 (36Hex) and 4 (34Hex).
Every character 09, AF corresponds to an ASCII code.
Character 0 1 2 3 4 5 6 7
ASCII code 30H 31H 32H 33H 34H 35H 36H 37H
Character 8 9 A B C D E F
ASCII code 38H 39H 41H 42H 43H 44H 45H 46H
Start word (STX): : (3AH)
Address:
0 0: Broadcasting to all drives (Broadcast)
3-233
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-234
3 . I ns t r u c ti o n Se t
RTU mode
Field Name Descriptions
START Refer to the following explanation
Address Communication address: n 8-bit binary
Function Function code: n 8-bit binary
DATA (n-1)
Data:
.
n 8-bit data
DATA 0
CRC CHK Low CRC checksum:
CRC CHK High 16-bit CRC consists of 2 8-bit binary data
END Refer to the following explanation
START/END:
RTU Timeout Timer:
Baud rate(bps) RTU timeout timer (ms) Baud rate (bps) RTU timeout timer (ms)
300 40 9,600 2
600 21 19,200 1
1,200 10 38,400 1
2,400 5 57,600 1
4,800 3 115,200 1
Address:
00 H: Broadcasting to all drives (Broadcast)
01 H: toward the drive at address 01
0F H: toward the drive at address 15
10 H: toward the drive at address 16
and so on, max. address: 254 (FE)
3-235
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Function code:
03 H: read contents from multiple registers
06 H: write one word into single register
10 H: write contents to multiple registers
Data characters:
The data sent by the user
CRC checksum: Starting from Address and ending at Data Content. The calculation is as follows:
Step 1: Set the 16-bit register (CRC register) = FFFFH
Step 2: Operate XOR on the first 8-bit message (Address) and the lower 8 bits of CRC register.
Store the result in the CRC register.
Step 3: Right shift CRC register for a bit and fill 0 into the highest bit.
Step 4: Check the lowest bit (bit 0) of the shifted value. If bit 0 is 0, fill in the new value obtained at
step 3 to CRC register; if bit 0 is NOT 0, operate XOR on A001H and the shifted value and store the
result in the CRC register.
Step 5: Repeat step 3 4 to finish all operation on all the 8 bits.
Step 6: Repeat step 2 5 until the operation of all the messages are completed. The final value
obtained in the CRC register is the CRC checksum. Care should be taken when placing the LOW
byte and HIGH byte of the obtained CRC checksum.
Example:
Read 2 continuous data stored in the registers of the drive at address 01H (see the table below).
The start register is at address 2102H
Inquiry message: Response message:
Field Name Data (Hex) Field Name Data (Hex)
Address 01 H Address 01 H
Function 03 H Function 03 H
Start data 21 H Number of data
04 H
address 02 H (count by byte)
Number of data 00 H Content of data address 17 H
(count by word) 02 H 2102H 70 H
CRC CHK Low 6F H Content of data address 00 H
CRC CHK High F7 H 2103H 00 H
CRC CHK Low FE H
CRC CHK High 5C H
3-236
3 . I ns t r u c ti o n Se t
M1002
MOV H86 D1120 Setting communication protocol 9600, 7, E, 1
X20
RS D100 K2 D120 K8
Receiving
completed
Process of receiving data
M1123
RST M1123 Receiving completed and flag reset
3-237
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Timing diagram:
SET M1122 X0
RS executes X20
Converting data
Coverting data of M1131
MODRD /RDST/MODRW
3
to hexadecimal
2
Residual words of 1
transmitting data D1122
0
8
7
6
5
Residual words of
receiving data D1123 4
3
2
1
0
3-238
3 . I ns t r u c ti o n Se t
X37 X36 X35 X34 X33 X32 X31 X30 X27 X26 X25 X24 X23 X22 X21 X20
M27 M26 M25 M24 M23 M22 M21 M20 M19 M18 M17 M16 M15 M14 M13 M12 M11 M10
No change
Program Example 2:
When X2 = ON, the content in K4M10 will be sent to K4Y10 in octal form.
X2
PRUN K4M10 K4Y10
M27 M26 M25 M24 M23 M22 M21 M20 M19 M18 M17 M16 M15 M14 M13 M12 M11 M10
Y27 Y26 Y25 Y24 Y23 Y22 Y21 Y20 Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10
3-239
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Assume:
(D10) = 0123 H 0 = 30H 4 = 34H 8 = 38H
(D11) = 4567 H 1 = 31H 5 = 35H 9 = 39H
(D12) = 89AB H 2 = 32H 6 = 36H A = 41H
(D13) = CDEF H 3 = 33H 7 = 37H B = 42H
4. When n = 4, the bit structure will be as:
3-240
3 . I ns t r u c ti o n Se t
D10=0123 H
0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1
0 1 2 3
3 33H 2 32H
Converted to
b15 D20 b0
0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 0
7 H 37 6 H 36
b15 D21 b0
0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0
1 H 31 0 H 30
b15 D22 b0
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0
3 H 33 2 H 32
6. When n = 1 to 16:
n
K1 K2 K3 K4 K5 K6 K7 K8
D
D20 low byte 3 2 1 0 7 6 5 4
D20 high byte 3 2 1 0 7 6 5
D21 low byte 3 2 1 0 7 6
D21 high byte 3 2 1 0 7
D22 low byte 3 2 1 0
D22 high byte 3 2 1
D23 low byte 3 2
D23 high byte 3
D24 low byte
D24 high byte No
D25 low byte change
D25 high byte
D26 low byte
D26 high byte
D27 low byte
D27 high byte
3-241
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
n
K9 K10 K11 K12 K13 K14 K15 K16
D
D20 low byte B A 9 8 F E D C
D20 high byte 4 B A 9 8 F E D
D21 low byte 5 4 B A 9 8 F E
D21 high byte 6 5 4 B A 9 8 F
D22 low byte 7 6 5 4 B A 9 8
D22 high byte 0 7 6 5 4 B A 9
D23 low byte 1 0 7 6 5 4 B A
D23 high byte 2 1 0 7 6 5 4 B
D24 low byte 3 2 1 0 7 6 5 4
D24 high byte 3 2 1 0 7 6 5
D25 low byte 3 2 1 0 7 6
D25 high byte 3 2 1 0 7
D26 low byte 3 2 1 0
No
D26 high byte 3 2 1
change
D27 low byte 3 2
D27 high byte 3
Program Example 2:
1. M1161 = ON, 8-bit conversion.
2. When X0 = ON, convert the 4 hex values (nibbles) in D10 into ASCII codes and send the result
to registers starting from D20.
M1000
M1161
X0
ASCI D10 D20 K4
3. Assume:
(D10) = 0123 H 0 = 30H 4 = 34H 8 = 38H
(D11) = 4567 H 1 = 31H 5 = 35H 9 = 39H
(D12) = 89AB H 2 = 32H 6 = 36H A = 41H
(D13) = CDEFH 3 = 33H 7 = 37H B = 42H
3-242
3 . I ns t r u c ti o n Se t
0 1 2 3
Converted to
b15 D20 b0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
0 H 30
b15 D21 b0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1
1 H 31
b15 D22 b0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0
2 H 32
b15 D23 b0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1
3 H 33
3-243
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. When n = 1 ~ 16:
n
K1 K2 K3 K4 K5 K6 K7 K8
D
D20 3 2 1 0 7 6 5 4
D21 3 2 1 0 7 6 5
D22 3 2 1 0 7 6
D23 3 2 1 0 7
D24 3 2 1 0
D25 3 2 1
D26 3 2
D27 3
D28
D29 No
D30 change
D31
D32
D33
D34
D35
n
K9 K10 K11 K12 K13 K14 K15 K16
D
D20 B A 9 8 F E D C
D21 4 B A 9 8 F E D
D22 5 4 B A 9 8 F E
D23 6 5 4 B A 9 8 F
D24 7 6 5 4 B A 9 8
D25 0 7 6 5 4 B A 9
D26 1 0 7 6 5 4 B A
D27 2 1 0 7 6 5 4 B
D28 3 2 1 0 7 6 5 4
D29 3 2 1 0 7 6 5
D30 3 2 1 0 7 6
D31 3 2 1 0 7
D32 3 2 1 0
No
D33 3 2 1
change
D34 3 2
D35 3
3-244
3 . I ns t r u c ti o n Se t
3. Assume:
HEX HEX
S ASCII code S ASCII code
conversion conversion
D20 low byte H 43 C D24 low byte H 34 4
D20 high byte H 44 D D24 high byte H 35 5
D21 low byte H 45 E D25 low byte H 36 6
D21 high byte H 46 F D25 high byte H 37 7
D22 low byte H 38 8 D26 low byte H 30 0
D22 high byte H 39 9 D26 high byte H 31 1
3-245
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
HEX HEX
S ASCII code S ASCII code
conversion conversion
D23 low byte H 41 A D27 low byte H 32 2
D23 high byte H 42 B D27 high byte H 33 3
D20 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
44H D 43H C
D21 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 1
46H F 45H E
D10 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1
C D E F
5. When n = 1 ~ 16:
D
D13 D12 D11 D10
n
1 ***C H
2 **CD H
3 *CDE H
4 CDEF H
5 The ***C H DEF8 H
6 undesignated **CD H EF89 H
parts in the
7 registers in use *CDE H F89A H
8 are all 0. CDEF H 89AB H
9 ***C H DEF8 H 9AB4 H
10 **CD H EF89 H AB45 H
11 *CDE H F89A H B456 H
12 CDEF H 89AB H 4567 H
13 ***C H DEF8 H 9AB4 H 5670 H
14 **CD H EF89 H AB45 H 6701 H
15 *CDE H F89A H B456 H 7012 H
16 CDEF H 89AB H 4567 H 0123 H
Program Example 2:
1. M1161 = ON: 8-bit conversion.
M1000
M1161
X0
HEX D20 D10 K4
3-246
3 . I ns t r u c ti o n Se t
2. Assume:
HEX HEX
S ASCII code S ASCII code
conversion conversion
D20 H 43 C D25 H 39 9
D21 H 44 D D26 H 41 A
D22 H 45 E D27 H 42 B
D23 H 46 F D28 H 34 4
D24 H 38 8 D29 H 35 5
D30 H 36 6 D33 H 31 1
D31 H 37 7 D34 H 32 2
D32 H 30 0 D35 H 33 3
43H C
D21 0 1 0 0 0 1 0 0
44H D
D10 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 1
C D
4. When n = 1 to 16:
D
D13 D12 D11 D10
n
1 ***C H
2 **CD H
3 *CDE H
4 CDEF H
5 The used ***C H DEF8 H
6 registers which **CD H EF89 H
are not
7 specified are all *CDE H F89A H
8 0 CDEF H 89AB H
9 ***C H DEF8 H 9AB4 H
10 **CD H EF89 H AB45 H
11 *CDE H F89A H B456 H
12 CDEF H 89AB H 4567 H
13 ***C H DEF8 H 9AB4 H 5670 H
14 **CD H EF89 H AB45 H 6701 H
15 *CDE H F89A H B456 H 7012 H
16 CDEF H 89AB H 4567 H 0123 H
3-247
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D100 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1
D101 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 Parity
3-248
3 . I ns t r u c ti o n Se t
Program Example 2:
1. M1161 = ON, 8-bit conversion.
2. When X0 = ON, 6 bytes from low byte of D0 to low byte of D5 will be summed up, and the
checksum is stored in D100 while the parity bits are stored in D101.
M1000
M1161
X0
CCD D0 D100 K6
D 10 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1
D 10 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 Parity
3-249
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Points to Note:
1. VR denotes Variable Resistor.
2. The PLC supports built-in 2 points of VR knobs which can be used with special D and M.
Device Function
M1178 Enable knob VR0
M1179 Enable knob VR1
D1178 VR0 value
D1179 VR1 value
3-250
3 . I ns t r u c ti o n Se t
Program Example 2:
Apply the VR as digital switch: The graduations 0~10 of VR correspond to M10~M20, therefore only
one of M10 ~M20 will be ON at a time. When M10~M20 is ON, use DECO instruction (API 41) to
decode the scaled value into M10~M25.
1. When X0 = ON, the graduation (0~10) of VR No.1 will be read out and stored in D1.
2. When X1 = ON, DECO instruction will decode the graduation (0~10) into M10~M25.
X0
VRSC K1 D1
X1
DECO D1 M10 K4
M10
ON when VR graduation is 0
M11
ON when VR graduation is 1
M20
ON when VR graduation is 10
3-251
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-252
3 . I ns t r u c ti o n Se t
3. Timing chart of the PID operation (max. operation time is approx. 80us)
Scan cycle Scan cycle
Note: #1 The time for equation calculation during PID operation (approx. 72us)
#2 The PID operation time without equation calculation (approx. 8us)
3-253
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Points to note:
1. There is no limitation on the times of using this instruction. However, the register No. designated
in S3~ S3+19 cannot be repeated.
2. For 16-bit instruction, S3 occupies 20 registers. In the program example above, the area
designated in S3 is D100 ~ D119.
3. Before the execution of PID instruction, users have to transmit the parameters to the designated
register area by MOV instruction. If the designated registers are latched, use MOVP instruction
to transmit all parameters only once
4. Settings of S3 in the 16-bit instruction:
Device
Function Setup Range Explanation
No.
Time interval between PID
calculations and updates of MV. If TS
= 0, PID instruction will not be
1~2,000 enabled. If TS is less than 1 program
S3: Sampling time (TS)
(unit: 10ms) scan time, PID instruction sets S3 as 1
program scan time, i.e. the minimum
TS has to be longer than the program
scan time.
The proportion for
Propotional gain
S3+1: 0~30,000(%) magnifying/minifying the error
(KP)
between SV and PV.
The proportion for
magnifying/minifying the integral
Integral gain (KI) 0~30,000(%)
value (The accumulated error). For
S3+2: control mode K0~K8.
Integral time
0~30,000 (ms) For control mode K10
constant (TI)
The proportion for
magnifying/minifying the derivative
-30,000~30,000
Derivative gain (KD) value (The rate of change of the
(%)
process error). For control mode
S3+3:
K0~K8
Derivative time -30,000~30,000
For control mode K10
constant (TD) (ms)
3-254
3 . I ns t r u c ti o n Se t
Device
Function Setup Range Explanation
No.
0: Automatic control
1: Forward control (E = SV - PV).
2: Reverse control (E = PV - SV).
3: Auto-tuning of parameter exclusively for the temperature
control. The device will automatically become K4 when
the auto-tuning is completed and KP, KI and KD is set with
appropriate value (not avaliable in the 32-bit instruction).
4: Exclusively for the adjusted temperature control (not
avaliable in the 32-bit instruction).
5: Automatic mode with MV upper/lower bound control.
When MV reaches upper/lower bound, the accumulation
of integral value stops.
7: Manual control 1: User set an MV. The accumulated
integral value increases according to the error. It is
suggested that the control mode should be used in a
control environment which change more slowly.
S3+4: Control mode
DVP-ES2/DVP-EX2/DVP-SS2/DVP-SA2/DVP-SX2
series PLCs whose version is 2.00 (or above), and
DVP-SE series PLCs whose version is 1.00 (or above)
are supported.
8: Manual control 2: User set an MV. The accumulated
integral value will stop increasing. When the control
mode becomes the automatic mode (the control mode
K5 is used), the instruction PID outputs an appropriate
accumulated integral value according to the last MV.
DVP-ES2/DVP-EX2/DVP-SS2/DVP-SA2/DVP-SX2
series PLCs whose version is 2.00 (or above), and
DVP-SE series PLCs whose version is 1.00 (or above)
are supported.
10: TI / TD mode: The control changes the integra gain and
the differential gain into integral time constant and
differential time constant.
E = the error between SV and PV. If S3
Tolerable range for +5 is set as 5, when E is between -5
S3+5: 0~32,767
error (E) and 5, E will be 0. When S3 +5 = K0,
the function will not be enabled.
Ex: if S3+6 is set as 1,000, MV will be
1,000 when it exceeds 1,000. S3+6 has
Upper bound of
S3+6: -32,768~32,767 to be bigger or equal to
output value (MV)
S3+7, otherwise the upper bound and
lower bound value will switch.
Lower bound of Ex: if S3+7 is set as -1,000, MV will be
S3+7: -32,768~32,767
output value (MV) -1,000 when it is smaller than -1,000..
Ex: if S3+8 is set as 1,000, the integral
value will be 1,000 when it is bigger
Upper bound of than 1,000 and the integration will
S3+8: -32,768~32,767
integral value stop. S3+8 has to be bigger or equal S3
+9; otherwise the upper bound and
lower bound value will switch
3-255
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Device
Function Setup Range Explanation
No.
S3+13
~ For system use only..
S3+19
5. For S3+1~3, when parameter setting exceeds its range, the upper / lower bound will be selected
as the set value.
6. If the direction setting (Forward / Reverse) exceeds its range, it will be set to 0.
7. PID instruction can be used in interruption subroutines, step ladders and CJ instruction.
8. The maximum error of sampling time TS = - (1 scan time + 1ms) ~ + (1 scan time). When the
error affects the output, please fix the scan time or execute PID instruction in timer interrupt.
9. PV of PID instruction has to be stable before PID operation executes. If users need to take the
value input from AIO modules for PID operation, care should be taken on the A/D conversion
time of these modules
10. For 32-bit instruction, S3 occupies 21 registers. In the program example above, the area
designated in S3 will be D100 ~ D120. Before the execution of PID instruction, users have to
transmit the parameters to the designated register area by MOV instruction. If the designated
registers are latched, use MOVP instruction to transmit all parameters only once.
11. Parameter table of 32-bit S3:
Device No. Function Set-point range Explanation
Time interval between PID
calculations and updates of MV.
If TS= 0, PID instruction will not
be enabled. If TS is less than 1
1~2,000
S3 Sampling time (TS) program scan time, PID
(unit: 10ms)
instruction sets S3 as 1 program
scan time, i.e. the minimum TS
has to be longer than the
program scan time.
3-256
3 . I ns t r u c ti o n Se t
3-257
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
12. The explanation of 32-bit S3 and 16-bit S3 are almost the same. The difference is the capacity of
S3+5 ~ S3+20.
PID Equations:
1. When control mode (S3+4) is selected as K0, K1, K2 and K5:
In this control mode, PID operation can be selected as Automatic, Forward, Reverse and
Automatic with MV upper/lower bound control modes. Forward / Reverse direction is
designated in S3+4. Other relevant settings of PID operation are set by the registers
designated in S3 ~ S3+5.
PID equation for control mode k0~k2:
1
MV = K P * E (t ) + K I * E (t ) + K D * PV (t )S
S
where
MV : Output value
K P : Proprotional gain
E (t ) : Error value
PV (t): Present measured value
SV (t): Target value
K D : Derivative gain
When E(t ) is smaller than 0 as the control mode is selected as forward or inverse, E(t )
will be regarded as 0"
Control mode PID equation
Forward, automatic E(t) = SV PV
Inverse E(t) = PV SV
Control diagram:
In diagram below, S is derivative operation, referring to (PVprevious PV) sampling
time. 1 / S is integral operation, referring to previous integral value + (error value
sampling time). G(S) refers to the device being controlled.
3-258
3 . I ns t r u c ti o n Se t
1/S KI
+
+ +
KP G(s)
+
KD
The equation above illustrates that this operation is different from a general PID operation
on the application of the derivative value. To avoid the fault that the transient derivative
value could be too big when a general PID instruction is first executed, our PID instruction
monitors the derivative value of the PV. When the variation of PV is excessive, the
instruction will reduce the output of MV/.
2. When control mode (S3+4) is selected as K3 and K4:
The equation is exclusively for temperature control will be modified as:
1 1 1
MV = E (t ) + E (t ) + K D * E (t )S ,
KP KI S
where E (t ) = SV (t ) - PV (t )
Control diagram:
In diagram below, 1/KI and 1/KP refer to divided by KI and divided by KP. Because this
mode is exclusively for temperature control, users have to use PID instruction together with
GPWM instruction. See Application 3 for more details
PID operation is within dotted area
1/S 1/K I
+
+ +
1/K P G(s)
+
S KD
This equation is exclusively designed for temperature control. Therefore, when the sampling
time (TS) is set as 4 seconds (K400), the range of output value (MV) will be K0 ~ K4,000 and
the cycle time of GPWM instruction used together has to be set as 4 seconds (K4000) as
well.
3-259
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If users have no idea on parameter adjustment, select K3 (auto-tuning). After all the
parameters are adjusted (the control direction will be automatically set as K4), users can
modify the parameters to better ones according to the adjusted results.
3. When control mode (S3+4) is selected as K10:
S3+2 (KI) and S3+3 (KD) in this mode will be switched to parameter settings of Integral time
constant (TI) and Derivative time constant (TD).
When output value (MV) reaches the upper bound, the accumulated integral value will not
increase. Also, when MV reaches the lower bound, the accumulated integral value will not
decrease.
The equation for this mode will be modified as:
1 d
MV = K P E (t ) + E (t )dt + TD E (t )
TI dt
Where
E(t ) = SV (t ) - PV (t )
Control diagram:
PID operation is within dotted area
1/S 1/T I
+
+ +
KP G(s)
+
S TD
3-260
3 . I ns t r u c ti o n Se t
the power is cut off. There is no guarantee that the adjusted parameters are suitable for every
control requirement. Therefore, users can modify the adjusted parameters according to specific
needs, but it is suggested to modify only KI or KD.
5. PID instruction has to be controlled with many parameters; therefore care should be taken when
setting each parameter in case the PID operation is out of control.
Example 1: Block diagram of application on positioning (S3+4 = 0)
MV Controlled
Position instruction PID
(SV) device
Encoder
PV
S+MV AC motor
Speed instruction (S)
drive
Acceleration/deceleration
output (MV)
Speed
Acceleration/deceleration detection
instruction (SV) PID
device (P)
Actual acceleration/
deceleration speed
(PV = S - P)
Heating (MV)
Temperature instruction (SV) PID Heater
Temperature
detection
Actual temperature device
(PV)
function G (s ) = b (model of general motors), SV = 1, and sampling time (TS) = 10ms. Suggested
s+a
3-261
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
1.5
K P =40 SV=1
K P =20 K P =10
1
KP =5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec)
Step 2:
When KP is 40, response overshoot occurs, so we will not select it.
When KP is 20, PV response is close to SV and wont overshoot, but transient MV will be to large
due to a fast start-up. We can put it aside and observe if there are better curves.
When KP is 10, PV response is close to SV and is smooth. We can consider using it.
When KP is 5, the response is too slow. So we wont use it.
Step 3:
Select KP = 10 and increase KI gradually, e.g. 1, 2, 4, 8. KI should not be bigger than KP. Then,
increase KD as well, e.g. 0.01, 0.05, 0.1, 0.2. KD should not exceed 10% of KP. Finally we obtain the
figure of PV and SV below.
1.5
PV=SV
0.5
K P = 10,K I = 8,K D= 0.2
0 Time (sec)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Note: The example is only for reference. Users have to adjust parameters according to the condition
of the actual control system.
Example 5: Transition between the manual mode (K7) and the automatic mode (K5)
If the setting of the PID parameters is complete, and the control mode is the manual mode (K7), the
control curve will be as shown below.
3-262
3 . I ns t r u c ti o n Se t
If the control mode becomes the automatic mode (K5), the output value MV changes from the output
value set by users to the output value of the PID operation.
Example 6: Transition between the manual mode (K8) and the automatic mode (K5)
If the setting of the PID parameters is complete, and the control mode is the manual mode (K8), the
control curve will be as shown below.
If the control mode becomes the automatic mode (K5), the accumulated integral value will be the
integral value converted from the last MV, and the accumulated integral value will be converted into
the output value of the PID operation.
The program for example 5 and program 6 are shown below. In the figure below, ,M0 is a flag for
enabling the instruction PID. When M1 is On, the manual mode is used. When M1 is Off, the
automatic mode is used.
Application 1:
PID instruction in pressure control system. (Use block diagram of example 1)
Control purpose:
Enabling the control system to reach the target pressure.
3-263
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Control properties:
The system requires a gradual control. Therefore, the system will be overloaded or out of control if
the process progresses too fast.
Suggested solution:
Solution 1: Longer sampling time
Solution 2: Using delay instruction. See the figure below
0rpm
0 0 0V
3000
511 rpm 255 5V
Wave Voltage
A Wave
B D1110 converted pressure
to meter
SV
0 0V
511 10V
SV SV
D2 stores increased
280 280 value of each shift
250 D3 stores the time interval
200 of each shift
150
100
50 Values in can modify D2 and D3
0 t t according to actual requirement
0
Wave A Wave B
3-264
3 . I ns t r u c ti o n Se t
M1002
MOV K10 D3
M0
TMR T0 D3
T0
RST T0
= D0 D1 MOV K0 D2
ADD D2 D1 D1
CMP D2 K0 M10
M10
> D1 D0 MOV D0 D1
M12
< D1 D0 MOV D0 D1
M0
PID D1 D1116 D10 D5
Application 2:
Speed control system and pressure control system work individually (use diagram of Example 2)
Control purpose:
After the speed control operates in open loop for a period of time, adding pressure control system
(PID instruction) to perform a close loop control.
Control properties:
Since the speed and pressure control systems are not interrelated, we have to structure an open
loop for speed control first following by a close loop pressure control. If users afraid that the
pressure control system changes excessively, consider adding the SC ramp-up function illustrated
in Application 1 into this control. See the control diagram below.
3-265
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
0
255
M3 M2=ON
D40 speed
+ D32 convert D1116 AC
SV of
speed D30 to drive
+ voltage
D31
0rpm
3000rpm MV
convert to
accel/decel
D0 M0=ON D5 MV
SV SV PV D1110 pressure
SV of D1
ramp-up PID
pressure meter
(optional)
M1=ON
M0
MOV D0 D1
M1
MOV K0 D5
M3
MOV D40 D30
M2
ADD D30 D31 D32
M1
PID D1 D1110 D10 D5
Application 3:
Using auto-tuning for temperature control
Control purpose:
Calculating optimal parameter of PID instruction for temperature control
Control properties:
Users may not be familiar with a new temperature environment. In this case, selecting auto-tuning
(S3+4 = K3) for an initial adjustment is suggested. After initial tuning is completed, the instruction will
auto modify control mode to the mode exclusively for adjusted temperature (S3+4 = K4). In this
3-266
3 . I ns t r u c ti o n Se t
example, the control environment is a heating oven. See the example program below.
M1002
MOV K4000 D20
TO K0 K2 K2 K1
M1013
FROM K0 K6 D11 K1
M0
MOV K3 D204
RST M0
M1
PID D10 D11 D200 D0
GPWM D0 D20 Y0
END
3-267
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
From the figure above, we can see that the temperature control after auto-tuning is working fine and
it spent only approximately 20 minutes for the control. Next, we modify the target temperature from
80C to 100C and obtain the result below.
From the result above, we can see that when the parameter is 100C, temperature control works
fine and costs only 20 minutes same as that in 80C.
3-268
3 . I ns t r u c ti o n Se t
Timing Diagram:
X0
A scan cycle
M0
Y0
3-269
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0 X1
Y1
3-270
3 . I ns t r u c ti o n Se t
X0 X1
Y1
3-271
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0 X1
Y1
3-272
3 . I ns t r u c ti o n Se t
X0 X1
Y1
3-273
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-274
3 . I ns t r u c ti o n Se t
3-275
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-276
3 . I ns t r u c ti o n Se t
3-277
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-278
3 . I ns t r u c ti o n Se t
3-279
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Timing Diagram:
X0
A scan cycle
M0
Y0
3-280
3 . I ns t r uc ti on Se t
3-281
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 1:
Communication between PLC and VFD-B series AC motor drives (ASCII Mode, M1143 = OFF)
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
3-282
3 . I ns t r uc ti on Se t
3-283
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
Communication between PLC and VFD-B series AC motor drive (RTU Mode, M1143= ON)
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
3-284
3 . I ns t r uc ti on Se t
Program Example 3:
1. In the communication between PLC and VFD-B series AC motor drive (ASCII Mode, M1143 =
OFF), executes Retry when communication time-out, data receiving error or parameter error
occurs.
2. When X0 = ON, PLC will read the data of address H2100 in device 01(VFD-B) and stores the
data in ASCII format in D1070 ~ D1085. PLC will automatically convert the data and store them
in D1050 ~ D1055.
3. M1129 will be ON when communication time-out occurs. The program will trigger M1129 and
send request for reading the data again.
4. M1140 will be ON when data receiving error occurs. The program will trigger M1140 and send
request for reading the data again.
5. M1141 will be ON when parameter error occurs. The program will trigger M1141 and send
request for reading the data again.
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
M1129
Retry when communication time-out occurs
M1140
Retry when data receiving error occurs
M1141
Retry when parameter error occurs
X0
MODRD K1 H2100 K6
Set communication instruction:
Data length: 6 words
Data address: H2100
Device address: 01
Receiving completed
M1127 The received ASCII data is stored in D1070-D1085
Handle received data and PLC converts the data and store them into
D1050-D1055 automatically.
3-285
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-286
3 . I ns t r uc ti on Se t
Program Example 1:
Communication between PLC and VFD-B series AC motor drives (ASCII Mode, M1143 = OFF)
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
X0
MODWR K1 H0100 H1770
Set communication instruction:
Data: H1770
Data address: H0100
Device address: 01
M1127
The received data is stored in
Processing received data
D1070~D1085 in ASCII format.
3-287
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
Communication between PLC and VFD-B series AC motor drives (RTU Mode, M1143 = ON)
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
3-288
3 . I ns t r uc ti on Se t
Program Example 3:
1. In the communication between PLC and VFD-B series AC motor drive (ASCII Mode, M1143 =
OFF), executes Retry when communication time-out, data receiving error or parameter error
occurs
2. When X0 = ON, PLC will write data H1770 (K6000) into address H0100 in device 01 (VFD-B).
3. M1129 will be ON when communication time-out occurs. The program will trigger M1129 and
send request for reading the data again.
4. M1140 will be ON when data receiving error occurs. The program will trigger M1140 and send
request for reading the data again.
5. M1141 will be ON when parameter error occurs. The program will trigger M1141 and send
request for reading the data again.
3-289
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
X0
SET M1122 Sending request
M1129
Retry when communication time-out occurs
M1140
Retry when data receiving error occurs
M1141
Retry when parameter error occurs
X0
MODWR K1 H0100 H1770
Set communication instruction:
Data: H1770
Data address: H0100
Device address: 01
Receiving completed
M1127
Processing received data The received data is stored in D1070-D1085
in ASCII format .
M1129
RST M1129 Reset M1129 (receiving timeout)
3-290
3 . I ns t r uc ti on Se t
3-291
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
d) The feedback data from the peripheral equipment will be stored in D1070 ~ D1080 After
data receiving is completed, PLC will check if all data are correct automatically. If there is
an error, M1142 will be ON. When n = 2, PLC will not receive any data.
Program Example: COM2 (RS-485)
1. Communication between PLC and VFD-A series inverter. Retry for communication time-out and
data receiving error.
M1002
Set up communication protocol as
MOV H0073 D1120
4800, 8, O, 1
M1142
Retry when data receiving error
Communication instruction setting:
X0 Device address: 0
FWD K0 K500 K1 Frequency: 500Hz
K1: communicate with the designated VFD
Receiving completed
M1127 The received data is stored in low byte
Processing received data of D1070 ~ D1080 in ASCII format.
3-292
3 . I ns t r uc ti on Se t
3-293
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
Set up communication protocol as
MOV H86 D1120
9600, 7, E, 1
X0
SET M1122 Sending request
M1129
Retry when communication time-out occurs
X0 Communication instruction setting:
FWD K1 K500 K0 Device address: 1
Frequency: 500Hz
Receiving completed K0:normal forward
M1127
Processing received data
3-294
3 . I ns t r uc ti on Se t
3-295
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-296
3 . I ns t r uc ti on Se t
3-297
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
user manual of specific VFD for details.) and store the feedback data in D1070~D1074.
However, the content in D1070~D1074 will not be updated when receiving error or timeout
occurs. Therefore, please check the status of receiving completed flag before applying the
received data
Program Example: COM2 (RS-485)
1. Communication between PLC and VFD-B series inverter (ASCII Mode, M1143 = OFF).
Retry when communication time-out occurs.
2. Read VFD status at parameter address 2100H~2104H and store the received data in D1070 ~
D1074.
M1002
Set up communication protocol as
MOV H86 D1120
9600, 7, E, 1
X0
SET M1122 Sending request
M1129
Retry when communication time-out occurs
X0
Communication instruction setting:
RDST K1 K0 Device address: 1
K0: Reserved
Receiving completed
M1127
Processing received data The received data is stored in
D1070 ~ D1074.
3-298
3 . I ns t r uc ti on Se t
3-299
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-300
3 . I ns t r uc ti on Se t
M1002
Set up communication protocol as
MOV H86 D1120
9600, 7, E, 1
X0
SET M1122 Sending request
M1129
X0
Communication instruction setting:
RSTEF K1 K0 Device address: 1 K0: Reserved
Receiving completed
M1127
Processing received data
3-301
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-302
3 . I ns t r uc ti on Se t
3-303
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example:
Connect PLC to VFD series AC motor drive (ASCII mode, M1143 = OFF), (8-bit mode, M1161 = ON),
Write the data to be sent into registers starting from D100 in advance for reading 6 data from
address H0708 on VFD.
M1002
MOV H86 D1120 Set up communication protocol to 9600, 7, E, 1
The error checksum LRC CHK (0, 1) can be calculated by LRC instruction (8-bit mode, M1161 =
ON).
M1000
LRC D101 K12 D113
3-304
3 . I ns t r uc ti on Se t
LRC checksum: Operate 2s complement on the summed up value from communication address
to the end of data, i.e. 01 H + 03 H + 21 H + 02 H + 00 H + 02 H = 29 H, the operation result of 29H
is D7H.
3-305
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-306
3 . I ns t r uc ti on Se t
Program Example:
Connect PLC to VFD series AC motor drive (RTU mode, M1143 = ON), (8-bit mode, M1161 = ON),
Write the data to be sent (H1770) into address H0706 on VFD.
M1002
MOV H86 D1120 Set communication protocol as
9600,7,E,1
Receiving completed
M1123
Processing received data
The error checksum CRC CHK (0,1) can be calculated by CRC instruction (8-bit mode, M1161 =
ON).
M1000
CRC D100 K6 D106
CRC checksum: 66 H is stored in low byte of D106 and AB H in low byte of of D107,
3-307
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
DECMP D0 D100 M10
M10
M10 = ON when (D1,D0)>(D101,D100)
M11
M11 = ON when (D1,D0)=(D101,D100)
M12
M12 = ON when (D1,D0)<(D101,D100)
3-308
3 . I ns t r uc ti on Se t
3-309
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-310
3 . I ns t r uc ti on Se t
Explanations:
1. S1: IP address, communication port number, and read/write mode
The operand S1 occupies five consecutive data registers. The functions are as follows.
IP address: Two data registers are occupied, that is, S1+0 and S1+1.
IP addressIP3.IP2.IP1.IP0192.168.0.2
If S1 is D100, the values in D100 and D101 are H0002 and HC0A8 respectively.
D100 (S1+0) D101 (S1+1)
High Low High Low
IP1 IP0 IP3 IP2
0 2 192 168
H0002 HC0A8
S1+2: Communication port number
The communication port number of the Ethernet port on DVP-SE and that of the
communication card installed in DVP-EH3 are K108. The communication ports on the
left-side Ethernet modules connected to a CPU module are numbered according to their
distances from the CPU module. The numbers start from K100 to K107.
S1+3: Station address of a slave
S1+4: Read/Write function code setting
The definition is the same as Modbus. The function codes supported are H01, H02, H03,
H04, H05, H06, H0F and H10.
2. S2: Device address
The definition is the same as Modbus.
3 - 3 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. The operand D specifies a source data register or a destination data register. For example, D
specifies D10 and set the function code to H03; when it reads 2 length of data, the data will be
stored in D10 and D11.
4. When setting the function code to H05, 0 in the operand D means to Reset bit and for other
values in the operand D means to Set bit.
5. n: Length of data (Unit: word, the setting range: K1~K96) (Unit: bit, the setting range: K1~K256)
If n exceeds the range, it will be taken as the maximum value or the minimum value.
6. Whenever the instruction is executed, the communication command is sent. Users do not need
to enable a special flag to send the communication command.
7. The instruction can be used several times. However, if an ETHRW instruction specifies a
module, other ETHRW instructions can not send communication commands to the module. The
next communication command can not be sent until the reception is complete or the module
replies that an error occurs.
8. If a communication command is being received, the reception stops when the execution of the
instruction stops. Besides, the flag related to the commands having being received and the
error flag are not ON.
9. The communication timeout is stored in D1349. The default timeout is 3000 milliseconds. The
range of digital values is 1~32767. If the communication timeout exceeds the range, it will be
taken as 3000 milliseconds.
10. The values of bit0~bit8 in D1395 indicate which communication port has received a command.
For example, if the communication port built in DVP-SE has received a command, BLD
D1395 K8 is satisfied.
11. The values of bit0~bit8 in D1396 indicate which module For example, if a reception error
occur in the first left-side DVP-EN01, BLD D1396 K0 is satisfied.
12. When the instruction is executed, user can not use the online editing function. Otherwise, the
data received will not be stored correctly.
13. SA2/SX2 v2.62, SE/ES2-E v1.00 and later versions support the function codes H03, H04, H06,
and H10.
14. SE v1.86, ES2-E V3.48 and later versions support the function codes H01, H02, H05, and
H0F.
Program Example 1:
(The instruction is sent and received through the Ethernet port built in DVP-SE.)
The IP address stored in D100 and D101 is 192.168.0.2, the communication port number stored in
D102 is K108, the station address stored in D103 is K1, and the function code stored in D104 is
H03. The device address is H1000, and two pieces of data are read. When M0 is ON, ETHRW is
executed. After the reception of the communication command is complete, bit8 in D1394 is ON. The
data received is stored in D10 and D11.
3-312
3 . I ns t r uc ti on Se t
M1002
MOV H0002 D100
MOV K1 D103
MOV K3 D104
M0
ETHRW D100 H1000 D10 K2
Program Example 2:
(The instruction is sent and received through the Ethernet port built in DVP-SE.)
The IP address stored in D100 and D104 is 192.168.0.2, the communication port number stored in
D102 is K108, the station address stored in D103 is K1, and the function code stored in D104 is
H02. The device address is H0400 (X0), and 32 pieces of bit data (X0~X37) are read. When M0 is
ON, ETHRW is executed. After the reception of the communication command is complete, bit8 in
D1395 is ON. The data received is stored in D10: high byte (X0~X7) and low byte (X10~X17) and
D11: low byte (X0~X27) and high byte (X30~X37).
3-313
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S1 S2 D
S 1 +1 S1 S 2 +1 S2 D D
+1
b31.......b16 b15.........b0 X b31.......b16 b15.........b0 = b31.......b16 b15.........b0
b31 is a sign bit b31 is a sign bit b31 is a sign bit
3-314
3 . I ns t r uc ti on Se t
Program Example 1:
The 16-bit value K100 in D0 is multiplied by the 16-bit value K200 in D10, and the product is stored
in D20. Whether the product is a positive value or a negative value depends on the leftmost bit (bit
15) in D20. If bit 15 in D20 is 0, the product stored in D20 is a positive value. If bit 15 in D20 is 1, the
product stored in D20 is a negative value.
X0
MUL16 D0 D10 D20
3-315
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S1 S2 D
If D is a bit device, users can use K1~K4, and form 16 bits. D only occupies 16 bits.
6. 32-bit bianry division
Quotient Remainder
S 1 +1 S1 S 2 +1 S2 D +1 D D +3 D +2
b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0
/ =
If D is a word device, users can use K1~K8, and forms 32 bits. D only occupies 32 bits.
3-316
3 . I ns t r uc ti on Se t
Program Example 1:
When X0 is ON, the dividend K103 in D0 is divided by the divisor K5 in D10, and the quotient is
stored in D20. Whether the quotient is a positive value or a negative value depends on the leftmost
bit in D20.
X0
DI V16 D0 D10 D20
D0/D10=D20
K103/K5=K20, the remainder is K3.
D20=K20 (The remainder is left out.)
Program Example 2:
When X0 is ON, the dividend K81,000 in (D1, D0) is divided by the divisor K40,000 in (D11, D10),
and the quotient is stored in (D21, D20). Whether the quotient is a positive value or a negative value
depends on the leftmost bit in (D21, D20).
X0
DI V32 D0 D10 D20
(D1,D0)/(D11,D10)=(D21,D20)
K81,000/K40,000=K2, The remainder is K1,000.
(D21,D20)=K2 (The remainder is left out.)
Note:
1. If users want to store the remainder of a 16-bit bianry division, they have to use API23 DIV/DIVP.
Please refer to the explanation of API23 DIV/DIVP for more information.
2. If users want to store the remainder of a 32-bit bianry division, they have to use API23
DDIV/DDIVP. Please refer to the explanation of API23 DDIV/DDIVP for more information.
3-317
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Degree value
D1 D0
binary floating point
3-318
3 . I ns t r uc ti on Se t
D1 D0 Radian value
binary floating point
3-319
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-320
3 . I ns t r uc ti on Se t
3-321
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
1. Use FLT instruction (API 49) to convert BIN integer into binary floating point value before
performing floating point operation. The value to be converted must be BIN integer and use
DEBIN instruction to convert the decimal floating point value into a binary one.
2. When X0 = ON, move K314 to D0 and K-2 to D1 to generate decimal floating point value (3.14 =
-2
314 10 ).
X0
MOVP K314 D0 K314 D0 [D1]
-2
314 x10
MOVP K-2 D1 K-2 D1 [D0]
3-322
3 . I ns t r uc ti on Se t
Program Example 2:
When X2 = ON, add the binary floating point value of (D11, D10) with K1234 (automatically
converted to binary floating point value) and store the result in (D21, D20).
X2
DEADD D10 K1234 D20
3-323
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
When X2 = ON, K1234 (automatically converted into binary floating point value) minuses binary
floating point (D1, D0) and the result is stored in (D11, D10).
X2
DESUB K1234 D0 D10
3-324
3 . I ns t r uc ti on Se t
Program Example 2:
When X2 = ON, K1234 (automatically converted into binary floating point value) multiplies binary
floating point (D1, D0) and the result is stored in (D11, D10).
X2
DEMUL K1234 D0 D10
3-325
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
When X2 = ON, binary floating point value of (D1, D0) is divided by K1234 (automatically converted
to binary floating point value) and the result is stored in (D11, D10).
X2
DEDIV D0 K1234 D10
3-326
3 . I ns t r uc ti on Se t
DFLT D0 D10
M1
DEXP D10 D20
M2
DEBCD D20 D30
3-327
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
DFLT D0 D10
M1
DLN D10 D20
M2
DEBCD D20 D30
3-328
3 . I ns t r uc ti on Se t
DFLT D0 D10
DFLT D2 D12
M1
DLOG D10 D12 D20
M2
DEBCD D20 D30
3-329
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
When X2 = ON, the square root of K1234 (automatically converted to binary floating value) is stored
in (D11, D10).
X2
DESQR K1234 D10
3-330
3 . I ns t r uc ti on Se t
3-331
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M0
RST M1081
DFLT D0 D10
DFLT D2 D12
M1
DPOW D10 D12 D20
M2
DEBCD D20 D30
3-332
3 . I ns t r uc ti on Se t
3-333
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S
-2 - 32 -2 -2 0
2
3
2
2
-1
3-334
3 . I ns t r uc ti on Se t
Program Example 2:
M1018 = OFF, radian mode. Select the degree value from inputs X0 and X1 and convert it to RAD
value for further sine operation.
X0
MOVP K30 D10 (K30 D10)
X1
MOVP K60 D10 (K60 D10)
M1000
FLT D10 D14 (D10 D15, D14) Binary floating oint
Program Example 3:
M1018 = ON, degree mode. When X0 = ON, DSIN instruction performs sine operation on the
degree value (0degree360) in (D1, D0) and stores the SIN value in (D11, D10) in binary
floating format.
M1002
SET M1018
X0
DSIN D0 D10
D1 D0 Degree value
SIN value
D 11 D 10 (binary floating point)
3-335
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S
-2 - 32 -2 -2 0
2
3
2
2
-1
3-336
3 . I ns t r uc ti on Se t
Program Example 2:
M1018 = ON, degree mode. When X0 = ON, DCOS instruction performs cosine operation on the
degree value (0degree360) in (D1, D0) and stores the COS value in (D11, D10) in binary
floating format..
M1002
SET M1018
X0
DCOS D0 D10
D1 D0 Degree value
COS value
D 11 D 10 binary floating point
3-337
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S: Radian
R: Result (TAN value)
S
-2 - 32 -2 -2 0
2
3
2
2
-1
3-338
3 . I ns t r uc ti on Se t
Program Example 2:
M1018 = ON, degree mode. When X0 = ON, DTAN instruction performs tangent operation on the
degree value (0degree360) in (D1, D0) and stores the TAN value in (D11, D10) in binary
floating format.
M1002
SET M1018
X0
DTAN D0 D10
D1 D0 Degree value
TAN value
D 11 D 10 (binary floating point)
3-339
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S
-1,0 0 1,0
-
2
3-340
3 . I ns t r uc ti on Se t
3-341
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S
-1,0 0 1,0
3-342
3 . I ns t r uc ti on Se t
3-343
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S
0
-
2
3-344
3 . I ns t r uc ti on Se t
3-345
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
EI Interrupt input X0
Input X1
Main program
Output Y0
FEND
M1000 T=2ms
I001 DELAY K20
X1
Y0
REF Y0 K8
IRET
END
Program Example: (for DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SS2 series
PLCs whose version is 3.00/DVP-SA2 series PLCs whose version is
2.60/DVP-SX2 series PLCs whose veresion is 2.40/DVP-SE series PLCs
whose version is 1.40 (and above))
When interrupt input X0 is triggered from OFF to ON, interrupt subroutine executes DELAY
instruction first, therefore the program after DELAY instruction (X1 = ON, Y0 = ON) will be delayed
for 1ms.
FE ND T =1ms
M1000
I001 SET M1148
DELAY K200
X1
Y0
REF Y0 K8
IRE T
END
Points to note:
1. User can adjust the delay time according to the actual needs.
2. The delay time of DELAY instruction could be increased due to the execution of communication,
high-speed counter and high-speed pulse output instructions.
3-346
3 . I ns t r uc ti on Se t
3. The delay time of DELAY instruction could be increased due to the delay of transistor or relay
when external output (transistor or relay) is specified.
3-347
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
t=1000ms
Output Y20
T=2000ms
Points to note:
1. The instruction operates by the scan cycle; therefore the maximum error will be one PLC scan
cycle. S1, S2 and (S2 - S1) should be bigger than PLC scan cycle, otherwise malfunction will
occur during GPWM outputs.
2. Please note that placing this instruction in a subroutine will cause inaccurate GPWM outputs.
3-348
3 . I ns t r uc ti on Se t
3-349
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Remarks:
1. Setting of S3:
Device No. Function Range Explanation
If TS is less than a scan time, PID
instruction will be executed for a
Sampling time (TS) 1 ~ 200
S3 scan time. If TS= 0, PID instruction
(unit: 100ms) (unit: 100ms)
will not be enabled. The minimum TS
must be greater than a scan time.
b0 =0 means oC When the value exceeds the upper
b0 =1 means oF bound, use upper bound.
b1=0 means
When without filter function, PV =
b0: temperature unit without fileter
currently measured value. When with
b1: filter function function
filter function, PV = (currently
S3 +1 b2 ~ b5: heating b1=1 means with
measured value + previous PV)/2
environnment filter function
b6 ~ b15: reserved b2=1 Slow heating environment
b3=1 General heating environment
b4=1 Fast heating environment
b5=1 High-speed heating environment
S3 +2
Parameters for system use only. Do not use them.
~
S3 +6
2. Control diagram:
FTC
+ e Fuzzy
SV MV
Controller
PV
Temperature
Sensor
3-350
3 . I ns t r uc ti on Se t
SV + e Fuzzy MV
GPWM Program Y0
D10 Controller D22
PV D11
Temperature
PT Module
Sensor
Output D22 (MV) of FTC instruction is the input D22 of GPWM instruction, as the duty cycle of
ajustable pulses. D30 is the fixed cycle time of pulses. See below for the timing diagram of Y0
output.
D22
Y0
D30
Assume parameter settings: D10 = K1,500 (target temperature), D12 = K60 (sampling time: 6 secs.),
D13 = K8 (bit3=1), D30 = K6,000 (=D12*100)
The example control program is indicated as:
M1002
MOV K1500 D10
TO K0 K2 K2 K1
FROM K0 K6 D11 K1
MOV K8 D13
SET M1
M1
FTC D10 D11 D12 D22
M1013
FROM K0 K6 D11 K1
END
3-351
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Experiment in an oven which can be heated up to 250C. See below for the records of target and
present temperatures. As shown in the diagram below, we can see that after 48 minutes, the
temperature is able to reach the target temperature with 1 C inaccuracy and exceed approx.
o
Example 2: Due to that the temperature once exceeds the target temperature, we modify the
heating environment into fast heating environment (D13 = K16). The results are shown in the
diagram below.
From the diagram below, we see that though the temperature no longer exceeds the target
temperature, it still needs to take more than 1 hour and 15 minutes to reach the target
temperature with 1 C inaccuracy. It seems that we have chosen the right environment, but
o
the sampling time is too long, resulting in the extension of heating time.
3-352
3 . I ns t r uc ti on Se t
Example 3: To speed up the speed to reach the target temperature, we correct the sampling time
as 4 seconds (D12 = K40, D30 = K4,000). The results are shown in the diagram below.
From the diagram below, we see that the overall control time has been shortened as 37 minutes.
Therefore, we find out that modifying the sampling time can speed up the time for reaching the
target temperature.
3-353
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example 4: To see if we can reach the target temperature faster, we modify the sampling time frim
example 3 into 2 seconds (D12 = K20, D30 = K2,000). The results are shown in the diagram below.
From the diagram below, we see that the sampling time that is too short will cause the control
system to become too sensitive and lead to up and down fluctuations.
3-354
3 . I ns t r uc ti on Se t
D0
High Byte Low Byte
Program Example 2:
When X0 = ON, high byte and low byte of D11 will be swapped as well as the high byte and low byte
of D10.
X0
DSWAP D10
D11 D 10
High Byte Low Byte High Byte Low Byte
3-355
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-356
3 . I ns t r uc ti on Se t
X0
MEMW D2000 K10 K100
3-357
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. S3: Address of the data to be accessed. If the address is illegal for the designated
communication device, the communication device will respond with an error message and
DVP-PLC will store the error code and associated error flag will be ON. If the function code is
3-358
3 . I ns t r u c ti o n Se t
K23, S3 only can specify a data register. Besides, S3 is a data register from which data is read,
S3+1 is a data register into which data is written.
Associated registers and flags indicating errors on PLC com ports: (For detailed information
please refer to Points to note of API 80 RS instruction.)
PLC COM COM1 COM2 COM3
Error flag M1315 M1141 M1319
Error code D1250 D1130 D1253
For example, if 8000H is illegal for DVP-PLC, the error will be in indicated by different set of
flags and registers. For COM2, M1141 will be ON and D1130 = 2; for COM1, M1315 = ON
and D1250 = 3, for COM3, M1319 = ON and D1253 = 3. Please check the user manual of
DVP-PLC for error code explanations.
5. S: Registers for storing read/written data. Registers starting from S stores the data to be written
into the communication device or the data read from the communication device. If the function
code K23 is used, S is a D device index which indicates the device in which the communication
data string received will be stored, and S+1 is a D device index which indicates the device in
which the data which will be written is stored. If a reading function code (K2, K3, K4, or K23) is
sent through COM2, the communication data string received will be stored in the register
indicated by S, and the conversion data will be stored in D1296~D1311. Please refer to program
example 1 and program example 3 for more information. If a reading function code (K2, K3, K4,
or K23) is sent through COM1 or COM3, the conversion data will be stored in the register
indicated by S. Please refer to program example 2 and program example 4 for more information.
Users can refer to example 13 and example 14 for more information about the function code
K23.
6. n: Data length for accessing.
When S2 (MODBUS function code) is specified as H05 which designates the PLC force
ON/OFF status, n = 0 indicates ON and n = 1 indicates OFF.
When S2 is specified as H01, H02, H03, H04, H0F, H10, H17 which designate the data
length for accessing, the available set range will be K1~Km, where m value should be
specified according to communication modes and COM ports as the table below.
(H01/H02/H0F, unit: Bit. H03/H04/H10/H17, unit: Word.) If the function code is H17, n is the
number of data registers from which data is read, n+1 is the number of data registers into
which data is written.
3-359
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7. The functions of S3, S, and n vary with the function code used.
Function code S3 S n
Address from which the Register in which the
H01 Length of data read
data is read data read is stored
Address from which the Register in which the
H02 Length of data read
data is read data read is stored
Address from which the Register in which the
H03 Length of data read
data is read data read is stored
Address from which the Register in which the
H04 Length of data read
data is read data read is stored
Address into which the
H05 No meaning Status value written
data is written
Address into which the Register in which the
H06 No meaning
data is written data written is stored
Address into which the Register in which the
H0F Length of data written
data is written data written is stored
Address into which the Register in which the
H10 Length of data written
data is written data written is stored
S3: Address from which S: Register in which the
n: Length of data read
the data is read data read is stored
H17 n+1: Length of data
S3+1: Address into S+1: Register in which
written
which the data is written the data written is stored
8. There is no limitation on the times of using this instruction, however only one instruction can be
executed on the same COM port at a time.
9. Rising-edge contact (LDP, ANDP, ORP) and falling-edge contact (LDF, ANDF, ORF) can not be
used as drive contact of MODRW (Function code H01, H02, H03, H04, H17) instruction,
otherwise the data stored in the receiving registers will be incorrect.
10. MODRW instruction determines the COM port according to the communication request. The
COM port determination is made following the order: COM1COM3COM2. Therefore,
please insert every MODRW instruction right after the sending request instruction for avoiding
errors on the target location for data access.
11. For detailed explanation of the associated flags and special registers, please refer to Points to
note of API 80 RS instruction.
Program Example 1: COM2(RS-485), Function Code H02 (H01 is used the same as H02.)
1. Function code K2 (H02): read multiple bit devices, up to 64 bits can be read..
2. PLC1 connects to PLC2: (M1143 = OFF, ASCII mode), (M1143 = ON, RTU Mode)
3-360
3 . I ns t r u c ti o n Se t
3. In ASCII or RTU mode, when PLCs COM2 sends out data, the data will be stored in
D1256~D1295. The feedback data will be stored in registers starting with S and converted into
D1296~D1311 in Hex automatically.
4. Take the connection between PLC1 (PLC COM2) and PLC2(PLC COM1) for example, the
tables below explains the status when PLC1 reads Y0~Y17 of PLC2.
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
ASCII mode: The received data is stored in registers starting from D0 in ASCII format and
PLC converts the content to registers D1296~D1311 in hexadecimal automatically.
RTU mode: The received data is stored in registers starting from D0 in Hex.
3-361
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-362
3 . I ns t r u c ti o n Se t
Program Example 2: COM1(RS-232) / COM3(RS-485), Function Code H02 (H01 is used the
same as H02.)
1. Function code K2 (H02): read multiple bit devices. Up to 64 bits can be read.
2. PLC1 connects to PLC2: (M1320 = OFF, ASCII mode), (M1320 = ON, RTU mode)
3. For both ASCII and RTU modes, PLC COM1/COM3 only stores the received data in registers
starting from S, and will not store the data to be sent. The stored data can be transformed and
moved by using DTM instruction for applications of other purposes.
4. Take the connection between PLC1 (PLC COM3) and PLC2(PLC COM1) for example, the
tables below explains the status when PLC1 reads Y0~Y17 of PLC2
If PLC1 applies COM1 for communication, the below program can be usable by changing:
1. D1109D1036: communication protocol
2. M1136M1138: retain communication setting
3. D1252D1249: Set value for data receiving timeout
4. M1320M1139: ASCII/RTU mode selection
5. M1316M1312: sending request
6. M1318M1314: receiving completed flag
3-363
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1109 Set communication protocol as 9600, 8, E,1
X0
MODRW K1 K2 H0500 D0 K16
3-364
3 . I ns t r u c ti o n Se t
5. Relative flags and data registers when COM1 / COM2 / COM3 works as Master:
COM2 COM1 COM3 Function
M1120 M1138 M1136 Retain communication setting
COM. M1143 M1139 M1320 ASCII/RTU mode selection
setting D1120 D1036 D1109 Communication protocol
D1121 D1121 D1255 PLC communication address
Sending M1122 M1312 M1316 Sending request
request D1129 D1249 D1252 Set value for data receiving timeout (ms)
Receiving
M1127 M1314 M1318 Data receiving completed
completed
- M1315 M1319 Data receiving error
- D1250 D1253 Communication error code
M1129 - - Receiving timeout
M1140 - - Data receiving error
Errors
Parameter error. Exception Code is stored in
M1141 - -
D1130
Error code (Exception code) returning from
D1130 - -
Modbus communication
Program Example 3: COM2 (RS-485), Function Code H03 (The function code H04 is the same
as the function code H03.)
1. Function code K3 (H03): read multiple Word devices. Up to 16 words can be read. For COM2
ASCII mode, only 8 words can be read.
2. For ASCII or RTU mode, PLC COM2 stores the data to be sent in D1256~D1295, converts the
received data in registers starting from S, and stores the converted 16-bit data in D1296 ~
D1311.
3. Take the connection between PLC (PLC COM2) and VFD-B for example, the tables below
explains the status when PLC reads status of VFD-B. (M1143 = OFF, ASCII Mode) (M1143 =
ON, RTU Mode)
3-365
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
Data length(word)
Data storing register
Data address: H2100
Function code: K3
read multiple words
Receiving completed Connection device
address: K1
M1127
Processing received data
ASCII mode : The received ASCII data is stored in registers starting from D0
and PLC converts the ASCII data to Hex value and stores them in
D1296~D1301 automatically.
RTU mode : The received data is stored in registers starting from D0 in Hex value.
3-366
3 . I ns t r u c ti o n Se t
3-367
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program example 4: COM1(RS-232) / COM3(RS-485), Function Code H03 (The function code
H04 is the same as the function code H03.)
1. Function code K3 (H03): read multiple Word devices, up to 16 words can be read. For COM2
ASCII mode, only 8 words can be read..
2. PLC COM1 / COM3 stores the received data in registers starting from S, and the stored data
can be transformed and moved by using DTM instruction for applications of other purposes.
3-368
3 . I ns t r u c ti o n Se t
3. Take the connection between PLC and VFD-B for example, the tables below explains the status
when PLC reads VFD-B status. (M1320 = OFF, ASCII Mode ), (M1320 = ON, RTU Mode)
If PLC applies COM1 for communication, the below program can be usable by changing:
1. D1109D1036: communication protocol
2. M1136M1138: retain communication setting
3. D1252D1249: Set value for data receiving timeout
4. M1320M1139: ASCII/RTU mode selection
5. M1316M1312: sending request
6. M1318M1314: receiving completed flag
M1002
MOV H87 D1109 Set communication protocol as 9600, 8, E,1
X0
MODRW K1 K3 H2100 D0 K6
Data length(word)
Data st oring register
Data address: H2100
Function code: K3
Read multiple words
Receiving completed Connection device
M1318 address: K1
Processing received data
3-369
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-370
3 . I ns t r u c ti o n Se t
M1002
MOV H87 D1120 Set communication protocol as 9600,8,E,1
X0
MODRW K1 K5 H0500 D0 K1
3-371
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-372
3 . I ns t r u c ti o n Se t
If PLC1 applies COM1 for communication, the below program can be usable by changing:
1. D1109D1036: communication protocol
2. M1136M1138: retain communication setting
3. D1252D1249: Set value for data receiving timeout
4. M1320M1139: ASCII/RTU mode selection
5. M1316M1312: sending request
6. M1318M1314: receiving completed flag
M1002
MOV H87 D1109 Set communication protocol as 9600,8,E,1
X0
MODRW K1 K5 H0500 D0 K1
3-373
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. For ASCII or RTU mode, PLC COM2 stores the data to be sent in D1256~D1295, and received
data in D1070~D1085.
4. Take the connection between PLC (PLC COM2) and VFD-B for example, the tables below
explains the status when PLC reads status of VFD-B. (M1143 = OFF, ASCII Mode) (M1143 =
ON, RTU Mode)
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
3-374
3 . I ns t r u c ti o n Se t
3-375
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1109 Set communication protocol as 9600,8,E, 1
3-376
3 . I ns t r u c ti o n Se t
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
3-377
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-378
3 . I ns t r u c ti o n Se t
Program example 10: COM1 (RS-232) / COM3 (RS-485), Function Code H0F
1. Function code K15 (H0F): write in multiple bit devices. Up to 64 bits can be written
2. PLC1 connects to PLC2: (M1143 = OFF, ASCII mode), (M1143 = ON, RTU mode)
3. PLC COM1/COM3 will not process the received data.
4. Take the connection between PLC1 (PLC COM3) and PLC2 (PLC COM1) for example, the
tables below explain the status when PLC1 force ON/OFF Y0~Y17 of PLC2.
Set value: K4Y0=1234H
Device Status Device Status Device Status Device Status
Y0 OFF Y1 OFF Y2 ON Y3 OFF
Y4 ON Y5 ON Y6 OFF Y7 OFF
Y10 OFF Y11 ON Y12 OFF Y13 OFF
Y14 ON Y15 OFF Y16 OFF Y17 OFF
If PLC applies COM1 for communication, the below program can be usable by changing:
1. D1109D1036: communication protocol
2. M1136M1138: retain communication setting
3. D1252D1249: Set value for data receiving timeout
3-379
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1109 Set communication protocol as 9600, 8, E, 1
3-380
3 . I ns t r u c ti o n Se t
3. Take the connection between PLC COM2 and VFD-B AC motor drive for example, the tables
below explain the status when PLC COM2 writes multiple word devices in VFD-B.
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
Data length(word)
Data storing register
Data address: H2000
Function code: K16
write in multiple Words
Receiving completed Connection device
address: K1
M1127
Processing received data
3-381
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-382
3 . I ns t r u c ti o n Se t
Program example 12: COM1 (RS-232) / COM3 (RS-485), Function Code H10
1. Function code K16 (H10): Write in multiple Word devices. Up to 16 Words can be written. For
PLC COM2 ASCII mode, only 8 words can be written.
2. PLC COM1/COM3 will not process the received data
3. Take the connection between PLC COM3 and VFD-B for example, the tables below explain the
status when PLC COM3 writes multiple Words in VFD-B. (M1320 = OFF, ASCII mode) (M1320
= ON, RTU mode)
If PLC applies COM1 for communication, the below program can be usable by changing:
1. D1109D1036: communication protocol
2. M1136M1138: retain communication setting
3. D1252D1249: Set value for data receiving timeout
4. M1320M1139: ASCII/RTU mode selection
5. M1316M1312: sending request
6. M1318M1314: receiving completed flag
3-383
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
MOV H87 D1109 Set communication protocol as 9600,8,E,1
M1318
Received data
3-384
3 . I ns t r u c ti o n Se t
M1002
MOV H87 D1120 Set communication protocol as 9600, 8, E, 1
X0
SET M1122 Sending request
X0
MODRW K1 K23 D0 D10 D20
D20: Length of the data read
D21: Length of the data written
D10:The index value indicates the register into which the data is read.
D11: The index value indicates the register from which the data is written.
D0: Address from which the data is read
D1: Address into which the data is written
Function code: K23
The data is read from/written into multiple word devices.
Connection device
address: K1
M1127
Processing received data
ASCII mode : The received ASCII data is stored in the registers starting from D3000.
RTU mode : The received data is stored in the registers starting from D3000 in Hex value.
3-385
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program example 14: COM1 (RS-232)/ COM3 (RS-485), Function Code H17
1. Function code K23 (H17): Data is read from multiple word devices and data is written into
multiple word devices. Data can be read from 16 word devices at most, and data can be written
into 16 word devices at most.
2. In the ASCII or RTU mode, the data received through COM1/COM3 on the PLC is stored in the
registers starting from the register indicated by the index value in S+1. Users can use the
instruction DTM to transform and move the data.
3. The connection between PLC-A (PLC COM3) and PLC-B:
Data is written into multiple word devices in PLC-B from PLC-A. (M1320=OFF, ASCII Mode)
(M1320=ON, RTU Mode)
If COM1 on PLC-A is connected, the program can be modified as shown below.
1. D1109D1036: Communication protocol
2. M1136M1138: The communication setting is retained.
3. D1252D1249: Communication timeout
4. M1320M1139: Choice between the ASCII mode and the RTU mode
5. M1316M1312: The sending of the data though the communication instruction is
requested.
6. M1318M1314: The receiving of the data through the communication instruction is
complete.
3-386
3 . I ns t r u c ti o n Se t
M1002
MOV H87 D1109 Set communication protocol as 9600, 8, E, 1
X0
SET M1316 Sending request
X0
MODRW K1 K23 D0 D10 D20
D20: Length of the data read
D21: Length of the data written
D10:The index value indicates the register into which the data is read.
D11: The index value indicates the register from which the data is written.
D0: Address from which the data is read
D1: Address into which the data is written
Function code: K23
The data is read from/written into multiple word devices.
Connection device
address: K1
M1318
Processing received data
ASCII mode : The received ASCII data is stored in the registers starting from D3000 in Hex value .
RTU mode : The received data is stored in the registers starting from D3000 in Hex value.
3-387
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-388
3 . I ns t r u c ti o n Se t
3-389
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
P LC S ERVO A MP
DV P3 2E S2 00 T MR- J2- A
S CN1 B
UP 0 V DD 3
S /S
A BS (b it 0 )
X0 D0 1 4
A BS (b it 1 )
X1 ZS P 19
Tra nsmi ssio n r ea dy
X2 TL C 6
D1
S ERVO ON
Y4 S ON 5
ABS transmission mode
Y5 A BS M 8
A BS re qu est
Y6 A BS R 9
ZP 0 SG 10
5. D2: Absolute position data (32-bit) read from servo. 2 consecutive devices D2, D2+1 are
occupied. D2 is low word and D2+1 is high word.
6. When DABSR instruction is completed, M1029 will be ON. M1029 has to be reset by users.
7. Please use NO contact as the drive contact of DABSR instruction. If the drive contact is OFF
during the execution of DABSR, the instruction will be stopped and errors will occur on read
data.
8. If the drive contact of DABSR instruction turns OFF after the instruction is completed, the servo
ON (SON) signal connected to D1 will also turn OFF and the operation will be disabled.
Explanations: (The instruction can be used in DVP-ES2/EX2 series PLCs whose version is
3.20/DVP-SA2 series PLCs whose version is 2.60/DVP-SE series PLCs whose
version is 1.40/DVP-SX2 series PLCs whose version is 2.40 (and above).)
1. This instruction reads the absolute position (ABS) of MITSUBISHI MR-J2 servo drive (with
absolute position check function), and the absolute position (ABS) of Delta ASDA-A2 servo
drive (whose firmware version is 1.045 sub12 (and above).
2. The state of M1177 determines the servo drive which is used. If M1177 is Off, MITSUBISHI
MR-J2 servo drive is used. Please refer to the points above for more information about setting
MITSUBISHI MR-J2 servo drive. If M1177 is On, Delta ASDA-A2 servo drive is used. Please
refer to the points below for more information about settiing Delta ASDA-A2 servo drive.
3. Only 32-bit instruction is applicable for ABSR instruction (DABSR) and it can only be used
ONCE in the program.
4. The input signal from a servo is stored in S. S occupies 3 consecutive devices. S, S +1, and S
+2 are connected to ABSR, ABSD, ABSW on a servo.
5. D1 will occupy 2 consecutive devices, D1, and D1 + 1. D1 is connected to ABSE on a servo.
D1+1 is connected to ABSQ on a servo. Please refer to the example below for more
information about wiring.
3-390
3 . I ns t r u c ti o n Se t
P LC S ERVO DRIVE
DV P3 2E S2 00 T A SDA -A 2
S CN1
UP 0 V DD 1 7
S /S
A BS R
X0 DO 2+ 5
A BS D
X1 DO 3+ 3
A BS W
X2 DO x+
D1
A BS E
Y4 DIx-
A BS Q
Y5 DI4 - 8
ZP 0 CO M- 9
6. D2 will occupy 4 consecutive devices D2, D2 +1. D2 +2, and D2 +3. The absolute acoordinate
system status (P0-50) is stored in D2, the encoder absolute position (multiturn) (P0-51) is
stored in D2 +1. The lower 16 bits of the encoder absolute position (pulse number within
singleturn or PUU) (P0-52) is stored in D2 +2. The higher 16 bits of the encoder absolute
position (pulse number within singleturn or PUU) (P0-52) is stored in D2 +3.
7. After the the reading of the absolute positio of a servo through the instruciton DABSR is
complete, M1580 will be On. If an error occurs during the execution of the instruciton, M1581
will be On.
8. When driving the DABSR command, please specify normally open contact. If the drive contact
of DABSR command turns Off when DABSR command read starts, the execution of absolute
current value read will be interrupted and result in incorrect data. Please be careful and notice
that.
9. If the input signals are from the high-speed input points X0~X7, it takes 2 seconds for the
instruction to be executed. if the input signals are form the input points following X10, it takes
2.5 seconds for the instruciton to be executed. The time it takes for the instruction to be
executed is affected by the scan time.
Program Example: (for DVP-ES2/EX2 series PLCs whose version is 3.00/DVP-SA2 series
PLCs whose version is 2.40/DVP-SE series PLCs whose version is
1.20/DVP-SX2 series PLCs whose veresion is 2.20/DVP-SS2 series PLCs
(and below))
1. When X7 = ON, the 32-bit absolute position data read from Mitsubishi MR-J2 servo will be
stored in the registers D0~D1. At the same time, timer T0 is enabled and starts to count for 5
seconds. If the 32-bit instruction is not completed within 5 seconds, M10 will be ON, indicating
operation errors.
2. When enabling the connection to the system, please synchronize the power input of DVP-PLC
and SERVO AMP or activate the power of SERVO AMP earlier than DVP-PLC.
3-391
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S D1 D2
X7
DABSR X0 Y4 D1348
M11
T MR T0 K50 Timeout period 5 sec onds
ABSR
completed
T0 ABS absolute position
M10 data read i s abnormal
ABSR ti meout
M1029
ABS absolute position
SET M11
data read i s c ompl eted
Exec ution
completed flag
Program Example: (for DVP-ES2/EX2 series PLCs whose version is 3.20/DVP-SA2 series
PLCs whose version is 2.60/DVP-SE series PLCs whose version is
1.40/DVP-SX2 series PLCs whose version is 2.40 (and above))
1. When X7 = On, the absolute position data read from Delta ASDA-A2 servo will be stored in the
registers D0~D3. The state of M1580 and the state of M1581 indicates whether the reading of
the absolute position is successful.
X7
SET M1177 Used with Delta ASDA-A2 serv o
S D1 D2
X7
DABSR X0 Y4 D0
M1580
SET M11 ABS absolute position data r ead completed
E xecu tio n co mpl ete d
M1581
SET M12 ABS absolute position data r ead is abnor mal
Exe cuti on er ro r
3-392
3 . I ns t r u c ti o n Se t
Servo ON SON
ABS data
transmission mode ABSM
2. When DABSR instruciton executes, servo ON (SON) and ABS data transmission mode are
driven for output.
3. By transmission ready and ABS request signals, users can confirm the transmitting and
receiving status of both sides as well as processing the transmission of the 32-bit ABS position
data and the 6-bit check data..
4. Data is transmitted by ABS (bit0, bit1).
5. This instruction is applicable for servo drive with absolute position check function, e.g.
MITSUBISHI MR-J2-A.
6. Select one of the following methods for the initial ABSR instruction:
Execute API 156 ZRN instruction with reset function to complete zero return.
Apply JOG function or manual adjustment to complete zero return, then input the reset
signal to the servo. Please refer to the diagram below for the wiring method of reset signal.
For the detailed wiring between DVP-PLC and Mitsubishi MR-J2-A, please refer to API 159
DRVA instruction.
Ex: Mitsubishi MR-J2-A
CR 8
reset
SG 10
3-393
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-394
3 . I ns t r u c ti o n Se t
Channel
CH0(Y0,Y1) CH1(Y2,Y3) Remark
Input
M1346=On Please refer to point
Y4 Y5
Start output clear signals 8 for the explanation.
M1308 = Off
Please refer to point
D1312 != 0 (seeking Z-phase signal)
9 for the explanation.
X2 X3
M1308 = On Please refer to
D1312 != 0 (outputting the designated number of point 10 for the
pulses) explanation.
4. When D is specified as Y0, its direction signal output is Y1; when D is specified as Y2, its direction
signal output is Y3.
5. When pulse output reaches zero point, pulse output execution completed flag M1029 (CH0), M1102
(CH1) is ON and the register indicating current position is reset to 0.
6. When DZRN instruction executes, external interrupt I400/I401(X4)) or I600/I601(X6) in program will
be disabled until DZRN instruction is completed. Also. If left limit switch (X5 / X7) is enabled during
instruction execution, external interrupt I500501(X5) or I700/I701(X7) will be disabled as well.
7. Zero point selection: the default position of zero point is on the left of DOG switch (the input point
OnOff) (as mode 1 shows). If the user needs to change the zero point to the right of DOG switch,
set ON M1106(CH0) or M1107(CH1) before DZRN instruction executes. (The function supports
ES2/EX2 series, V1.20 or above.)
8. Start the pulse-clearing function of the output. When DOG leaves DOG switch and is going to stop,
it will output another pulse (the width of On is about 20ms). When the pulse is OnOff, there will be
a completed flag output. Please refer to state 4 for the timing diagram of this function. (The function
supports ES2/EX2 series, V1.20 or above.)
9. When D1312 is not set to be 0, and M1308=Off, the function of seeking Z phase is started. When
D1312 is a positive value (the maximum value is 10), it indicates that the search for Z-phase signal
is toward the positive direction. When D1312 is a negative value (the minimum value is -10), it
indicates that the search for Z-phase signal is toward the negative direction. For example, if D1312
is k-2, it means that DOG stops immediately after DOG leaves DOG switch and searches in the
negative direction for second Z-phase signal (the fixed right-edge trigger) with JOG frequency.
Please refer to state 5 for the timing diagram of this function. (The function supports ES2/EX2 series
of V1.20 or above, and SS2/SX2 series of V1.20 or above.)
10. When D1312 is not set to be 0 and M1308=On, the function of outputting the designated number of
pulses is started. When Dd1312 is a positive value (the maximum value is 30000), it indicates that
the pulses are output in the positive direction. When D1312 is a negative value (the minimum value
is -30000), it indicates that the pulses are output in the negative direction. For example, if D1312 is
3-395
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
k-100, it means that DOG stops immediately after DOG leaves DOG switch and another 100 pulses
will be output in the negative direction with JOG frequency. Please refer to state 6 for the timing
diagram of this function. (The function supports ES2/EX2 series of V1.40 or above, and SS2/SX2
series of V1.20 or above.)
11. Timing Diagram:
State 1: Current position at right side of DOG switch, pulse output in reverse, limit switch disabled.
Output in reverse
JOG freq.
Time
State 2: DOG switch is ON, pulse output in reverse, limit switch disabled.
Output in reverse
On Off
DOG switch: X4/X6
Freq.
JOG freq.
Time
3-396
3 . I ns t r u c ti o n Se t
State 3: Current position at left side of zero point, pulse output in reverse, limit switch enabled.
JOG freq.
Time
Off On
M1029
Off On
Y4
Off On
X4
Freq.
Target speed
Jog speed
Time
3-397
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
State 5: Current position at right side of zero point, D1312=-2, M1308=Off, M1346=On.
Off On
M1029
Off On
Y4
Off On
X4
X2
Freq.
Target speed
Jog speed
Time
2nd Z phase in
Start Meet DOG Left DOG
Off On
M1029
X4 Off On
Y0
Freq.
Target speed
Jog speed
Time
100th pulse out
Start Meet DOG Left DOG 1st pulse out
Program Example 1:
When M0 = ON, Y0 pulse output executes zero return with a frequency of 20kHz. When it reaches the
DOG switch, X4 = ON and the frequency changes to JOG frequency of 1kHz. Y0 will then stop when X4
= OFF.
M0
DZRN K20000 K1000 X4 Y0
3-398
3 . I ns t r u c ti o n Se t
Program Example 2:
When M0 = ON, Y0 pulse output executes zero return with a frequency of 20kHz. When it reaches the
DOG switch, X4 = ON and the frequency changes to JOG frequency of 1kHz. When X4 = OFF, it seeks
the second X2(Z-phase) pulse input (right-edge trigger signal), and Y4 stops after a pulse (the width of
On is 20ms) is output from it (M1029=On).
M0
MOV K-2 D1312
RST M1308
SET M1346
M0
DZRN K20000 K1000 X4 Y0
Points to note:
1. Associated Flags:
M1029: CH0 (Y0, Y1) pulse output execution completed
M1102: Y2/CH1 (Y2, Y3) pulse output execution completed
Zero point selection. M1106=ON, change the zero point to the right of DOG switch
M1106:
for zero return on CH0
Zero point selection. M1107=ON, change the zero point to the right of DOG switch
M1107:
for zero return on CH1
M1305: Reverse Y1 pulse output direction in high speed pulse output instructions
M1306: Reverse Y3 pulse output direction in high speed pulse output instructions
M1307: For ZRN instruction, enable left limit switch
Output specified pulses (D1312) or seek Z phase signal when zero point is
M1308:
achieved.
M1346: Output clear signals when ZRN is completed
2. Special D registers:
Specify the number of additional pulses for additional pulses output and Z-phase
D1312:
seeking function of ZRN instruction (Has to be used with M1308)
3-399
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-400
3 . I ns t r u c ti o n Se t
3-401
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
9. D1343 (D1353) is the ramp up/down time setting of CH0 (CH1). Available range: 20 ~ 32,767ms.
Default: 100ms. PLC will take the upper/lower bound value as the set value when specified
value exceeds the available range.
10. D1340 (D1352) is start/end frequency setting of CH0 (CH1). Available range: 6 to 100,000Hz.
PLC will take the upper/lower bound value as the set value when specified value exceeds the
available range.
11. M1305 and M1306 can change the output direction of CH0/CH1 set in D2. When S is -, D2 will
be ON, however, if M1305/M1306 is set ON before instruction executes, D2 will be OFF during
execution of instruction..
12. Ramp-down time of CH0 and CH1 can be particularly modified by using (M1534, D1348) and
(M1535, D1349). When M1534 / M1535 = ON, CH0 / CH1 ramp-down time is specified by
D1348 / D1349.
13. If M1078 / M1104 = ON during instruction execution, Y0 / Y2 will pause immediately and M1538
/ M1540 = ON indicates the pause status. When M1078 / M1104 = OFF, M1538 / M1540 = OFF,
Y0 / Y2 will proceed to finish the remaining pulses.
14. DRVI instruction supports Alignment Mark and Mask function. Please refer to the explanation in
API 59 PLSR instruction.
15. When M1334 or M1335 is enabled, execute API158 DDRVI instruction on CH0 (CH1) to
ramp-down when the conditional contacts are closed. This function is available for the
followings:
12SA2/
Series ES2/EX2 ES2-C ES2-E SS2 26SE 28SA2
SX2
Firmware
V3.42 V3.48 V3.48 V2.86 V3.28 V2.0 V3.0
version
Program Example:
When M10= ON, 20,000 pulses (relative position) at 2kHz frequency will be generated from Y0. Y1=
OFF indicates positive direction.
M10
DDRVI K20000 K2000 Y0 Y1
Points to note:
1. Operation of relative positioning:
Pulse output executes according to the relative distance and direction from the current position
3-402
3 . I ns t r u c ti o n Se t
+3,000
Current
position
-3,000
Sample time
of ramp-up Pulse output frequency
Ramp-up
slope
Numbers of
Ramp up time Ramp down time output pulses
Current Default: 100ms Default: 100ms
position Y0(D1343) Y0(D1343)
This instruction can be used many times in user program, but only one instruction will be
activated at a time. For example, if Y0 is currently activated, other instructions use Y0 wont
be executed. Therefore, instructions first activated will be first executed.
After activating the instruction, all parameters cannot be modified unless instruction is OFF.
3. Associated Flags:
M1029: CH0 (Y0, Y1) pulse output execution completed.
M1102: CH1 (Y2, Y3) pulse output execution completed
M1078: CH0 (Y0, Y1) pulse output pause (immediate)
M1104: CH1 (Y2, Y3) pulse output pause (immediate)
M1108: CH0 (Y0, Y1) pulse output pause (ramp down).
M1110: CH1 (Y2, Y3) pulse output pause (ramp down)
M1156: Enabling the mask and alignment mark function on I400/I401(X4) corresponding
to Y0.
M1158: Enabling the mask and alignment mark function on I600/I601(X6) corresponding
to Y2.
3-403
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1305: Reverse Y1 pulse output direction in high speed pulse output instructions
M1306: Reverse Y3 pulse output direction in high speed pulse output instructions
M1347: Auto-reset Y0 when high speed pulse output completed
M1524: Auto-reset Y2 when high speed pulse output completed
M1534: Enable ramp-down time setting on Y0. Has to be used with D1348
M1535: Enable ramp-down time setting on Y2. Has to be used with D1349.
M1538: Indicating pause status of CH0 (Y0, Y1)
M1540: Indicating pause status of CH1 (Y2, Y3)
4. Special D registers:
D1030: Low word of the present value of Y0 pulse output
D1031: High word of the present value of Y0 pulse output
D1336: Low word of the present value of Y2 pulse output
D1337: High word of the present value of Y2 pulse output
D1340: Start/end frequency of the 1st group pulse output CH0 (Y0, Y1)
D1352: Start/end frequency of the 2nd group pulse output CH1 (Y2, Y3)
D1343: Ramp up/down time of the 1st group pulse output CH0 (Y0, Y1)
D1353: Ramp up/down time of the 2nd group pulse output CH1 (Y2, Y3)
D1348: CH0(Y0, Y1) pulse output. When M1534 = ON, D1348 stores the ramp-down time
D1349: CH1(Y2, Y3) pulse output. When M1535 = ON, D1349 stores the ramp-down time
D1232: Output pulse number for ramp-down stop when Y0 masking sensor receives
signals. (LOW WORD)
D1233: Output pulse number for ramp-down stop when Y0 masking sensor receives
signals. (HIGH WORD).
D1234: Output pulse number for ramp-down stop when Y2 masking sensor receives
signals (LOW WORD).
D1235: Output pulse number for ramp-down stop when Y2 masking sensor receives
signals (HIGH WORD).
D1026: Pulse number for masking Y0 when M1156 = ON (Low word)
D1027: Pulse number for masking Y0 when M1156 = ON (High word)
D1135: Pulse number for masking Y2 when M1158 = ON (Low word)
D1136: Pulse number for masking Y2 when M1158 = ON (High word)
3-404
3 . I ns t r u c ti o n Se t
3-405
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
9. D1343 (D1353) is the ramp up/down time (between start frequency and pulse output frequency)
setting of CH0 (CH1). Available range: 20 ~ 32,767ms. Default: 100ms. PLC will take 20ms as
the set value when specified value is below 20ms or above 32,767ms.
10. D1340 (D1352) is start/end frequency setting of CH0 (CH1). Available range: 6 ~ 32,767Hz.
PLC will take the start/end frequency as the pulse output frequency when pulse output
frequency S2 is smaller or equals the start/end frequency.
11. M1305 and M1306 can change the output direction of CH0/CH1 set in D2. When S is -, D2 will
be ON, however, if M1305/M1306 is set ON before instruction executes, D2 will be OFF during
execution of instruction..
12. Ramp-down time of CH0 and CH1 can be particularly modified by using (M1534, D1348) and
(M1535, D1349). When M1534 / M1535 = ON, CH0 / CH1 ramp-down time is specified by
D1348 / D1349.
13. If M1078 / M1104 = ON during instruction execution, Y0 / Y2 will pause immediately and M1538
/ M1540 = ON indicates the pause status. When M1078 / M1104 = OFF, M1538 / M1540 = OFF,
Y0 / Y2 will proceed to finish the remaining pulses.
14. DRVA/DDRVA instructions do NOT support Alignment Mark and Mask function.
15. When M1334 or M1335 is enabled, execute API158 DDRVI instruction on CH0 (CH1) to
ramp-down when the conditional contacts are closed. This function is available for the
followings:
12SA2/
Series ES2/EX2 ES2-C ES2-E SS2 26SE 28SA2
SX2
Firmware
V3.42 V3.48 V3.48 V2.86 V3.28 V2.0 V3.0
version
Program Example:
When M10 = ON, DRVA instruction executes absolute positioning on Y0 at target position 20000,
target frequency 2kHz. Y1 = OFF indicates positive direction.
M10
DRVA K20000 K2000 Y0 Y1
Points to note:
1. Operation of absolute positioning:
Pulse output executes according to the specified absolute position from zero point
+3,000
Zero point
3-406
3 . I ns t r u c ti o n Se t
Sample time
of ramp-up Pulse output frequency
Ramp-up
slope
Target position
Ramp up time Ramp down time
Current Default: 100ms Default: 100ms
position Y0(D1343) Y0(D1343)
This instruction can be used many times in user program, but only one instruction will be
activated at a time. For example, if Y0 is currently activated, other instructions use Y0 wont
be executed. Therefore, instructions first activated will be first executed.
After activating the instruction, all parameters cannot be modified unless instruction is OFF.
For associated special flags and special registers, please refer to Points to note of DDRVI
instruction.
3-407
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M10
ON when 12:20:45 >
M11
ON when 12:20:45 =
M12
ON when 12:20:45 <
3-408
3 . I ns t r u c ti o n Se t
3-409
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If the addition result is greater than 24 hours, the Carry flag M1022 = ON.
X0
TADD D0 D10 D20
3-410
3 . I ns t r u c ti o n Se t
3 - 4 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If the subtraction result is a negative value (less than 0), Borrow flag M1021 = ON.
X0
TSUB D0 D10 D20
3-412
3 . I ns t r u c ti o n Se t
3-413
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Points to note:
1. There are two methods to correct built-in RTC:
Correcting by API167 TWR instruction
Please refer to explanation of instruction TWR (API 167)
Setting by peripheral device
Using WPLSoft / ISPSoft (Ladder editor)
2. Display 4-digit year data:
D1319 only stores the 2-digit year in A.D. If 4-digit year data is required, please insert the
following instruction at the start of program.
M1002
SET M1016 Display 4-digit year data
The original 2-digit year will be switched to a 4-digit year, i.e. the 2-digit year will pluses
2,000. If users need to write in new time in 4-digit year display mode, only a 2-digit year data
is applicable (0 ~ 99, indicating year 2000 ~ 2099). For example, 00 = year 2000, 50 = year
2050 and 99 = year 2099. However, 2000 ~ 2099 can be written in ES2/EX2 V3.0, SS2 V3.2,
SA2 V2.6, SX2 V2.4, and SE V1.6 (and above).
Flags and special registers for RTC
Device Content Function
M1016 Year display OFF: D1319 stores 2-digit year data in A.D.
mode of RTC ON: D1319 stores 2-digit year data in A.D + 2000
M1017 30 seconds Correction takes place when M1017 goes from OFF
correction on to ON (Second data in 0 ~ 29: reset to 0. Second data
RTC in 30 ~ 59: minute data pluses 1, second data resets)
3-414
3 . I ns t r u c ti o n Se t
Program Example 2:
1. Set the current time in RTC as 2004/12/15, Tuesday, 15:27:30.
2. The content of D0~D6 is the set value for adjusting RTC.
3. When X0 = ON, update the time of RTC with the set value.
4. When X1 = ON, perform 30 seconds correction. Correction takes place when M1017 goes
from OFF to ON (Second data in 0 ~ 29: reset to 0. Second data in 30 ~ 59: minute data pluses
1, second data resets).
3-415
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
MOV K04 D0 Year (2004)
3-416
3 . I ns t r u c ti o n Se t
b15 b0 b15 b0
S1 D 0=H AA55 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 D 4=H 1234 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
Before the execution AND AND
S2 H FF00 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 H 00FF 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
H AA00 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 H 0034 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0
OR
After the execution D D 4=H AA34 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 0
Program Example 2 :
Simplify instructions:
X0 X0
WAND HFF00 D110 D110 = MVM D110 HFF00 D120
3-417
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 2:
3-418
3 . I ns t r u c ti o n Se t
In 32-bit instruction, when X0 = ON, Y10 will be ON and the timing will start. When the timing
reaches 40,000 hours, Y0 will be ON. D1 and D0 will record the current time measured (in hour) and
D2 will record the current time less than an hour (0 ~ 3,599; unit: second).
X0
Y10
Y10
DHOUR K40000 D0 Y0
3-419
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b0
K6513=H1971 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1
Y37 Y20
GRAY 6513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1
K4Y20
3-420
3 . I ns t r u c ti o n Se t
X17 K4X0 X0
b15 b0
H1971=K6513 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1
3-421
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program example 2:
When X0 = ON, add floating point value (D1, D0) with (D3, D2) and store the result in (D11, D10).
X0
DADDR D0 D2 D10
3-422
3 . I ns t r u c ti o n Se t
Program example 2:
When X0 = ON, subtract the floating point value (D1, D0) with (D3, D2) and store the result in (D11,
D10).
X0
DSUBR D0 D2 D10
3-423
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program example 2:
When X1= ON, multiply the floating point value (D1, D0) with (D11, D10) and store the result in
(D21, D20).
X1
DMULR D0 D10 D20
3-424
3 . I ns t r u c ti o n Se t
Program example 2:
When X1= ON, divide the floating point number value (D1, D0) by (D11, D10) and store the
obtained quotient into registers (D21, D20).
X1
DDIVR D0 D10 D20
3-425
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b0
0 "" 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 D4
1 ""
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 D7, D6
b31 b16 b15 b0
In the example above, b15 in D4 will be sent to b15~b31 of D7/D6, therefore all bits in b15~b31
will be negative.
3-426
3 . I ns t r u c ti o n Se t
When S is set as K1, sentence identifier $GPRMC is specified. D devices refer to:
No. Content Range Format Note
D+0 Hour 0 ~ 23 Word
D+1 Minute 0 ~ 59 Word
D+2 Second 0 ~ 59 Word
D + 3~4 Latitude 0 ~ 90 Float Unit: dd.mmmmmm
D+5 North / South 0 or 1 Word 0(+)North, 1(-)South
D + 6~7 Longitude 0 ~ 180 Float Unit: ddd.mmmmmm
D+8 East / West 0 or 1 Word 0(+)East, 1(-)West
D+9 GPS data valid / 0, 1, 2 Word 0 = invalid
invalid
D + 10 Day 1 ~ 31 Word
D + 11 Month 1 ~ 12 Word
D + 12 Year 2000 ~ Word
D + 13~14 Latitude -90 ~ 90 Float Unit: dd.ddddd
D + 15~16 Longitude -180 ~ 180 Float Unit: ddd.ddddd
3-427
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. When applying GPS instruction, COM1 has to be applied in Master mode, i.e. M1312 has to
be enabled to sending request. In addition, M1314 = ON indicates receiving completed.
M1315 = ON indicates receiving error. (D1250 = K1, receiving time-out; D1250 = K2,
checksum error)
5. Associated M flags and special D registers:
No. Function
M1312 COM1 (RS-232) sending request
M1313 COM1 (RS-232) ready for data receiving
M1314 COM1 (RS-232) data receiving completed
M1315 COM1 (RS-232) data receiving error
M1138 Retaining communication setting of COM1
D1036 COM1 (RS-232) Communication protocol
D1249 COM1 (RS-232) data receiving time-out setting. (Suggested value: >1s)
D1250 COM1 (RS-232) communication error code
6. Before applying the received GPS data, please check the value in D+9. If D+9 = 0, the GPS
data is invalid.
7. If data receiving error occurs, the previous data in D registers will not be cleared, i.e. the
previous received data remains intact.
Program example: Sentence identifier: $GPGGA
1. Set COM1communication protocol first
M1002
Set communication protocol
MOV H81 D1036 as 9600,8,N,1
3-428
3 . I ns t r u c ti o n Se t
3. When receiving completed, M1314 = ON. When receiving failed, M1315 = ON. The received
data will be stored in devices starting with D0.
No. Content No. Content
D0 Hour D8 East / West
D1 Minute D9 GPS data valid / invalid
D2 Second D10~D11 Altitude
D3~D4 Latitude D12~D13 Latitude. Unit: dd.ddddd
D5 North / South D14~D15 Longitude. Unit: ddd.ddddd
D6~D7 Longitude
3-429
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-430
3 . I ns t r u c ti o n Se t
3. Operand D occupies 8 consecutive word registers. The function of each device is as below:
No. Content Range Format Note
D + 0~1 Zenith 0 ~ 90 Float Horizontal=0
D + 2~3 Azimuth 0 ~ 360 Float North point=0
D + 4~5 Incidence 0 ~ 90 Float
1LSB = 0.045
D+6 Converted DA value of Zenith 0 ~ 2000 Word
degree
1LSB = 0.18
D+7 Converted DA value of Azimuth 0 ~ 2000 Word
degree
4. The execution time of SPA instruction costs up to 50ms, therefore we suggest users to
execute this instruction with an interval not less than 1 sec, preventing the instruction from
taking too much PLC operation time.
5. Definition of Zenith: 0 and 45.
0 45
6. Definition of Azimuth:
270 90
180
7. The correct time of the local longitude: If we suppose that it is AM8:00:00 in Taipei, and the
longitude is 121.55 degrees east, then the correct time of the local longitude in Taipei should
be AM8:06:12. Please refer to API168 DTM instruction (parameter k11) for more explanation.
3-431
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program example:
1. Input parameters starting from D4000: 2009/3/23/(y/m/d),10:10:30, t = 0, Local time zone =
+8, Longitude/Latitude = +119.192345 East, +24.593456 North, Elevation = 132.2M, Pressure
= 820m, MAT = 15.0, Slope = 0 degree, Azimuth = -10 degree.
M0 M1013
DSPA D4000 D5000
2. Output results: D5000: Zenith = F37.2394 degree; D5002: Azimuth = F124.7042 degree.
3-432
3 . I ns t r u c ti o n Se t
D0 K100
D2 K125
Program example 2:
When X10 = ON, 3 consecutive devices (n = 3) from (D1, D0) will be summed up and the result
will be stored in (D11, D10).
X10
DWSUM D0 K3 D10
3-433
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
(D1,D0) K100
(D5,D4) K125
3-434
3 . I ns t r u c ti o n Se t
b15 b0
D0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
Before MAND
Execution D10 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D11 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
D12 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
After D20 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
Execution D21 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
D22 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
3-435
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Points to note:
1. A matrix consists of more than 1 consecutive 16-bit registers. The number of registers is
indicated as the matrix length (n). A matrix contains 16 n bits (points) and the matrix
instructions conduct bit operation, i.e. operation is performed bit by bit.
2. Matrix instructions designate a single bit of the 16 n bits (b0 ~ b16n-1) for operation. The bits in
matrix are not operated as value operation.
3. The matrix instructions process the moving, copying, comparing and searching of
one-to-many or many-to-many matrix operation, which are a very handy and important
application instructions.
4. The matrix operation requires a 16-bit register for designating a bit among the 16n bits in the
matrix. The register is the Pointer (Pr) of the matrix, designated by the user in the instruction.
The valid range of Pr is 0 ~ 16n -1, corresponding to b0 ~ b16n-1 in the matrix.
5. The bit number decreases from left to right (see the figure below). With the bit number, matrix
operation such as bit shift left, bit shift right, bit rotation can be performed and identified.
Left Width: 16 bits Right
D0 b15 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b0
D1 b31 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b16
Length: n
D2 b47 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b32
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
Dn-1 b16n-1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
Example: This matrix is composed of K2X20, n = 3; K2X20 = H37, K2X30 = H68, K2X40 =
H45
C15 C14 C13 C12 C11 C10 C9 C8 C7 C6 C5 C4 C3 C2 C1 C0
R0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 X20~X27
R1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 X30~X37
R2 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 X40~X47
3-436
3 . I ns t r u c ti o n Se t
b15 b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before MOR
Execution
D10 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D11 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D12 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After
Execution D20 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
D21 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
D22 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
3-437
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before MXOR
Execution
D10 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D11 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D12 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After D20 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
Execution
D21 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
D22 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
3-438
3 . I ns t r u c ti o n Se t
b15 b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Before
MXNR
Execution
D10 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D11 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
D12 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
After D20 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
Execution
D21 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
D22 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1
3-439
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 b0
Before D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Execution D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
MINV
D20 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
After
Execution D21 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
D22 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
3-440
3 . I ns t r u c ti o n Se t
3-441
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2
b0 D20
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 Pointer
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
MCMP
b0
D10 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1
D11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D12 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
Points to note:
Associated flags and registers:
Matrix comparison. Comparing between equivalent values (M1088 = ON) or different
M1088:
values (M1088 = OFF)
D1089: Indicating the end of Matrix. When the comparison reaches the last bit, M1089 = ON
Indicating start of Matrix comparison. When the comparison starts from the first bit,
D1090:
M1090 = ON
Indicating matrix searching results. When the comparison has matched results,
D1091:
comparison will stop immediately and M1091 = ON
Indicating pointer error. When the pointer Pr exceeds the comparison range, M1092 =
D1092:
ON.
3-442
3 . I ns t r u c ti o n Se t
3-443
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47 Pointer
45
D20
Points to note:
Associated flags and registers:
M1089: Indicating the end of Matrix. When the comparison reaches the last bit, M1089 = ON
Indicating pointer error. When the pointer Pr exceeds the comparison range, M1092 =
M1092:
ON.
M1093: Matrix pointer increasing flag. Adding 1 to the current value of the Pr
M1094: Matrix pointer clear flag. Clear the current value of the Pr to 0
M1095: Carry flag for matrix rotation/shift/output
3-444
3 . I ns t r u c ti o n Se t
3-445
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b0
Before D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
Execution D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47 M1096
1 (Borrow flag for matrix rotation / shift / input)
45 D20 Pointer
After D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
Execution
D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D2 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
45 D20 Pointer
Points to note:
Associated flags and registers:
M1089: Indicating the end of Matrix. When the comparison reaches the last bit, M1089 = ON
Indicating pointer error. When the pointer Pr exceeds the comparison range, M1092 =
M1092:
ON.
M1093: Matrix pointer increasing flag. Adding 1 to the current value of the Pr
M1094: Matrix pointer clear flag. Clear the current value of the Pr to 0
M1096: Borrow flag for matrix rotation/shift/input
3-446
3 . I ns t r u c ti o n Se t
MBSP D0 D20 K3
3-447
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
0 M1096
b15 b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0
Before execution
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D1
M1095 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D2
MBS M1097=0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 D20
After bits shift to left
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D21
M1095 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D22
Program Example 2:
When X1 = ON, M1097 = ON, indicating a right matrix shift is performed. Assume matrix borrow
flag M1096 = ON (1) and the 16-bit registers D0 ~ D2 will perform a right matrix shift and the result
will be stored in the matrix of the 16-bit registers D20 ~ D22, meanwhile the matrix carry flag
M1095 will be OFF (0).
X1
M1097
MBSP D0 D20 K3
b15 b0
D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 M1095
Before execution D1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
D2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 M1095
After bits shift D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
to the right
D22 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
3-448
3 . I ns t r u c ti o n Se t
MBRP D0 D20 K3
3-449
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b15 B0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0
Before execution
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D1
M1095 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D2
MBR M1097=0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D20
After rotation to the left
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D21
M1095 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D22
Program Example 2:
When X1 = ON, M1097 = ON, indicating a right matrix rotation is performed. The 16-bit registers
D0 ~ D2 will perform a right matrix rotation and the result will be stored in the matrix of the 16-bit
registers D20 ~ D22. The matrix carry flag M1095 will be OFF (0).
X1
M1097
MBRP D0 D20 K3
b15 b0
D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 M1095
Before execution 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
D1
D2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
MBR M1097=1
D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 M1095
After rotation D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
to the right
D22 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
3-450
3 . I ns t r u c ti o n Se t
D0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D10 12 M1098=0
D10 36 M1098=1
3-451
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-452
3 . I ns t r u c ti o n Se t
i.e. another axis is 0, the pulse output will only be performed on the axis with output pulse
number. However, if the output pulse number is less than 20 in any of the 2 axes, the
ramp-up/down section will be disabled and pulse output will be executed with the frequency not
higher than 3kHz.
9. There is no limitation on the number of times for using the instruction. However, assume CH0 or
CH1 pulse output is in use, the X/Y axis synchronized output will not be performed.
10. M1029 will be ON when 2-axis synchronized pulse output is completed.
Program Example:
1. Draw a rhombus as the figure below.
(0, 0)
X
(0, -5 5000)
2. Steps:
a) Set the four coordinates (0,0), (-27000, -27000), (0, -55000), (27000, -27000) (as the figure
above). Calculate the relative coordinates of the four points and obtain (-27000, -27000),
(27000, -28000), (27000, 27000), and (-27000, 27000). Place them in the 32-bit registers
(D200, D202), (D204, D206), (D208, D210), (D212, D214).
b) Design instructions as follows.
c) RUN the PLC. Set ON M0 to start the 2-axis line drawing.
MOV K1 D0
M0 M1029
INCP D0
END
3-453
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Operation:
When PLC runs and M0 = ON, PLC will start the first point-to-point motion by 100KHz. D0 will
plus 1 whenever a point-to-point motion is completed and the second point-to-point motion will
start to execute automatically. The operation pattern repeats until the fourth point-to-point
motion is completed.
Points to note:
Associated flags and registers:
M1029: CH0 (Y0, Y1) pulse output execution completed
D1030: Present number of Y0 output pulses (HIGH WORD).
D1031: Present number of Y1 output pulses (LOW WORD).
D1336: Present value of Y2 pulse output. D1336 (High word)
D1337: Present value of Y2 pulse output. D1337(Low word)
Start/end frequency of pulse output CH0 (Y0), CH1(Y2) for DPPMR/DPPMA
D1340:
instruction
Ramp up/down time of pulse output CH0 (Y0), CH1(Y2) for DPPMR/DPPMA
D1343:
instruction
3-454
3 . I ns t r u c ti o n Se t
(0, 0)
X
(0, -5 5000)
3-455
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. Steps:
a) Set the four coordinates (-27000, -27000), (0, -55000), (27000, -27000) and (0,0) (as the
figure above). Place them in the 32-bit registers (D200, D202), (D204, D206), (D208, D210),
(D212, D214).
b) Design instructions as follows.
c) RUN the PLC. Set ON M0 to start the 2-axis line drawing.
MOV K1 D0
M0 M1029
INCP D0
END
3. Operation:
When PLC runs and M0 = ON, PLC will start the first point-to-point motion by 100KHz. D0 will
plus 1 whenever a point-to-point motion is completed and the second point-to-point motion will
start to execute automatically. The operation pattern repeats until the fourth point-to-point
motion is completed.
3-456
3 . I ns t r u c ti o n Se t
X X
(0,0) (0,0)
20 segments 20 segments
Figure 1 Figure 2
3-457
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Quadrant I I
X X
Quadrant I II Quadrant I V
Quadrant I V Quadrant I II
Figure 3 Figure 4
7. The settings of direction and resolution in the lower word of S can only be K0 ~ K1
8. The settings of motion time in the high word of S shall not be faster than the fastest suggested
time. If the motion time is not specified, PLC will use the fastest suggested motion time as the
setting. Refer to the table below.
Segments Max. target position (pulse) Fastest suggested set time (unit:100ms)
500 ~ 20,000 2
20-segments 20,000 ~ 29,999 3
resolution : :
Less than 10,000,000 Less than 200
9. D can designate Y0 only.
Y0 is the pulse output point of X axis;
Y1 is the direction signal output of X axis.(OFF: positive; ON: negative)
Y2 is the pulse output point of Y axis;
Y3 is the direction signal output of Y axis (OFF: positive; ON: negative)
When the pulse output is completed, the direction output signal will not be OFF unless the drive
contact is OFF
10. When the 2-axis interpolation is being executed in 20 segments, it takes approximately 2ms for
the initialization of this instruction. If only 1 axis is specified with pulse output number (with
ramp-up/down section), i.e. another axis is 0, PLC will only execute single-axis positioning
according to the specified motion time. If one of the two axes is specified with the pulse number
less than 500, PLC will execute 2-axis linear interpolation automatically. However, when either
axis is specified for pulse number over 10,000,000, the instruction will not work.
11. If the number of pulses which exceeds the above range is required, the user may adjust the
gear ratio of the servo for obtaining the desired results.
12. Every time when the instruction is executed, only one 90 arc can be drawn. It is not necessary
3-458
3 . I ns t r u c ti o n Se t
that the arc has to be a 90 arc, i.e. the numbers of output pulses in X and Y axes can be
different.
13. There are no settings of start frequency and ramp-up/down time.
14. There is no limitation on the number of times for using the instruction. However, assume CH0 or
CH1 output is in use, the X/Y axis synchronized output will not be performed
Program Example 1:
1. Draw an ellipse as the figure below.
Y
( 16 00 ,22 00 )
X
( 0,0 ) ( 32 00 ,0)
(1 6 00 ,-2 20 0)
2. Steps:
a) Set the four coordinates (0,0), (1600, 2200), (3200, 0), (1600, -2200) (as the figure above).
Calculate the relative coordinates of the four points and obtain (1600, 2200), (1600, -2200),
(-1600, -2200), and (-1600, 2200). Place them in the 32-bit registers (D200, D202), (D204,
D206), (D208, D210), (D212, D214).
b) Select draw clockwise arc and default motion time (S = D100 = K0).
c) RUN the PLC. Set ON M0 to start the drawing of the ellipse.
MOV K0 D100
MOV K1 D0
M0 M1029
INCP D0
END
3-459
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Operation:
When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will
plus 1 whenever a segment of arc is completed and the second segment of the arc will start to
execute automatically. The operation pattern repeats until the fourth segment of arc is
completed.
Program Example 2:
1. Draw a tilted ellipse as the figure below.
Y
(2 60 00 ,2 60 00 )
(3 40 00 ,1 80 00 )
X
(0 ,0)
(8 00 0,- 80 00 )
2. Steps:
a) Find the max. and min. coordinates on X and Y axes (0,0), (26000,26000), (34000,18000),
(8000,-8000) (as the figure above). Calculate the relative coordinates of the four points and
obtain (26000,26000), (8000,-8000), (-26000,-26000), (-8000,8000). Place them
respectively in the 32-bit registers (D200,D202), (D204,D206), (D208,D210) and
(D212,D214).
b) Select draw clockwise arc and default motion time (S = D100 = K0).
c) RUN the PLC. Set ON M0 to start the drawing of a tilted ellipse.
MOV K0 D100
MOV K1 D0
M0 M1029
INCP D0
END
3-460
3 . I ns t r u c ti o n Se t
3. Operation:
When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will
plus 1 whenever a segment of arc is completed and the second segment of the arc will start to
execute automatically. The operation pattern repeats until the fourth segment of arc is
completed.
Points to note:
Description of associated flags and registers:
M1029: CH0 (Y0, Y1) pulse output execution completed
D1030: Present number of Y0 output pulses (HIGH WORD).
D1031: Present number of Y1 output pulses (LOW WORD).
D1336: Present value of Y2 pulse output. D1336 (High word)
D1337: Present value of Y2 pulse output. D1337(Low word)
3-461
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
( 16 00 0,2 20 00 )
X
( 0,0 ) ( 32 00 0,0 )
(1 6 00 0,- 22 00 0)
2. Steps:
a) Set the four coordinates (0,0), (16000, 22000), (32000, 0), (16000, -22000) (as the figure
above). Place them in the 32-bit registers (D200, D202), (D204, D206), (D208, D210),
3-462
3 . I ns t r u c ti o n Se t
(D212, D214).
b) Select draw clockwise arc and default motion time (S = D100 = K0)
c) RUN the PLC. Set ON M0 to start the drawing of the ellipse.
M0
RST M1029
DMOV K0 D1030
DMOV K0 D1336
MOV K0 D100
MOV K1 D0
M0 M1029
INCP D0
END
3. Operation:
When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will
plus 1 whenever a segment of arc is completed and the second segment of the arc will start to
execute automatically. The operation pattern repeats until the fourth segment of arc is
completed.
Program Example 2:
1. Draw a tilted ellipse as the figure below.
Y
(2 60 00 ,2 60 00 )
(3 40 00 ,1 80 00 )
X
(0 ,0)
(8 00 0,- 80 00 )
3-463
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. Steps:
a) Find the max. and min. coordinates on X and Y axes (0,0), (26000,26000), (34000,18000),
(8000,-8000) (as the figure above). Place them respectively in the 32-bit registers
(D200,D202), (D204,D206), (D208,D210) and (D212,D214).
b) Select draw clockwise arc and default motion time (S = D100 = K0).
c) RUN the PLC. Set ON M0 to start the drawing of a tilted ellipse.
M0
RST M1029
DMOV K0 D1030
DMOV K0 D1336
MOV K0 D100
MOV K1 D0
M0 M1029
INCP D0
END
3. Operation:
When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will
plus 1 whenever a segment of arc is completed and the second segment of the arc will start to
execute automatically. The operation pattern repeats until the fourth segment of arc is
completed.
3-464
3 . I ns t r u c ti o n Se t
3-465
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
X0
DPTPO D0 D300 Y0
END
4. Timing diagram:
F r eq u e nc y (Hz )
( D15 7,D1 56 )
....
( D15 9,D1 58 )
( D5,D4 )
....
( D7,D6 )
( D1,D0 )
( D3,D2 )
T i me (S)
t1 t2 t .. .. t 40
Points to note:
1. Associated Flags:
M1029: CH0 (Y0) pulse output execution completed.
M1102: CH1 (Y2) pulse output execution completed
M1078: CH0 (Y0) pulse output pause (immediate)
M1104: CH1 (Y2) pulse output pause (immediate)
M1262: Enable cyclic output for table output function of DPTPO instruction. ON =
enable.
M1538: Indicating pause status of Y0
M1540: Indicating pause status of Y2
2. Special registers:
D1030: Low word of the present value of Y0 pulse output
D1031: High word of the present value of Y0 pulse output
D1336: Low word of the present value of Y2 pulse output
D1337: High word of the present value of Y2 pulse output
3-466
3 . I ns t r u c ti o n Se t
3-467
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
direction signal output will be OFF only when the drive contact of the instruction is OFF, i.e.
completion of pulse output will not reset Y1 or Y3.
5. D1340 and D1352 stores the start/end frequencies of CH0 and CH1. Min. 6Hz, default:
100Hz.
6. D1343 and D1353 stores the ramp up/down time of CH0 and CH1. If the ramp up/down time
is shorter than 20ms, PLC will operate in 20ms. Dafault: 100ms.
7. Ramp-down time of CH0 and CH1 can be particularlily specified by the setting of (M1534,
D1348) and (M1535, D1349). When M1534 / M1535 is ON, ramp-down time of CH0 and CH1
is set by D1348 and D1349.
8. D1131 and D1132 are the output/input ratio(%) of the close loop control in CH0 and CH1. K1
refers to 1 output pulse out of 100 feedback pulses; K200 refers to 200 output pulses out of
the 100 feedback pulses. In general percentage equation, the value set in D1131 and D1132
represents numerators (output pulses, available range: K1 ~ K10,000) and the denominator
(the input feedbacks) is fixed as K100 (System defined).
9. M1305 and M1306 can reverse the direction of CH0, CH1 pulse output. For example, when
direction signal output (Y1/Y3) is OFF, pulse output will operate in positive direction. If
M1305/M1306 is set ON before the execution of this instruction, the pulse output will be
reversed as negative output direction.
10. When S1 designates input points X with interrupt pointers, D1244 / D1255 can be applied for
setting the idle time as limited pulse number, in case the interrupt is not properly triggered.
11. DCLLM instruction supports Alignment Mark and Mask function. Please refer to PLSR
instruction for details.
Close Loop Explanations:
1. Function: Immediately stop the high-speed pulse output according to the number of
feedback pulses or external interruption signals.
2. Timing diagram:
Frequency
Start/end
frequency
Time
Pulse Number
3-468
3 . I ns t r u c ti o n Se t
Pulse speed(Hz )
ES2/EX2 V3.28 (and below), SA2/SX2 V2.82 (and below), and SS2/SE:
The nunmber of ouput pulses in the idle time in D1244/D4245 includes the numbers of
pulses in the last section of the ramp down time. If the target number of feedbacks is 50000,
the number of output pulses in the idle time is 1000, the number of pulses in the laste section
of the ramp down time is 50, and no external interrupt occurs, the total number of pulses will
be 50665 (50000+100-50).
ES2/EX2 V3.40 (and above), and SA2/SX2 V2.84 (and above):
The nunmber of ouput pulses in the idle time in D1244/D4245 does not include the numbers
of pulses in the last section of the ramp down time. If the target number of feedbacks is
50000, the number of output pulses in the idle time is 1000, the number of pulses in the laste
section of the ramp down time is 50, and no external interrupt occurs, the total number of
pulses will be 51000 (50000+100).
4. Principles for adjusting the completion time of positioning:
a) The completion time of positioning refers to the total time of ramp up + high speed +
ramp down + idle (see the figure above). When percentage value (D1131/D1132) is
modified, the total number of output pulses will be increased or decreased as well as the
completion time.
b) When S1 designates input points X with interrupt pointers, D1244 / D1255 can be
applied for setting the idle time as limited pulse number, in case the interrupt is not
properly triggered.Users can determine if the execution result is good or bad by the
length of the idling time. In theory, a bit of idling left is the best result for a positioning.
c) Owing to the close loop operation, the length of idle time will not be the same in every
execution. Therefore, when the content in the special D for displaying the actial number
of output pulses is smaller or larger than the calculated number of output pulses (target
3-469
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
number of feedbacks x percentage value / 100), users can improve the situation by
adjusting the percentage value, ramp-up/ramp-down time or target frequency.
Program Example1: Immediate stop high-speed pulse output by external interrupt
1. Adopt X4 as the input for external interrupt and I401 (rising-edge trigger) as the interrupt
pointer. Set target number of feedbacks = 50,000; target frequency = 100kHz; pulse output
device: Y0, Y1 (CH0); start/end frequency (D1340) = 100Hz; ramp-up time (D1343) = 100ms;
ramp-down time (D1348) = 100ms; percentage value (D1131) = 100; present value of output
pulses (D1030, D1031) = 0.
EI
M1002
MOV K100 D1131
SET M1534
DMOV K0 D1030
M0
DCLLM X4 K50000 K100000 Y0
FEND
M1000
I401 INC D0
IRET
END
2. Execution results:
Frequency
X4 = OFF --> ON
100kHz
Y0 output stops
D1340
D1340
Time
Pulse number
D1343 D1348
Specified number of output pulses: 50,000
3-470
3 . I ns t r u c ti o n Se t
Program Example 2: Immediate stop high-speed pulse output by high speed counter
1. Adopt counter C243 (better to be reset before execution) with AB-phase input from the
encoder. Set target number of feedbacks = 50,000; target frequency = 100kHz; pulse output
device: Y0, Y1 (CH0); start/end frequency (D1340) = 200Hz; ramp-up time (D1343) = 300ms;
ramp-down time (D1348) = 600ms; percentage value (D1131) = 100; present value of output
pulses (D1030, D1031) = 0..
EI
M1002
MOV K100 D1131
SET M1534
DMOV K0 D1030
DMOV K0 C243
M0
DCNT C243 K9999
FEND
M1000
I010 INC D0
IRET
END
D1340
Time
Pulse number
D1343 D1348 6s
3-471
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1340
Time
Pulse number
3-472
3 . I ns t r u c ti o n Se t
M1306: Reverse CH1 (Y2, Y3) pulse output direction. M1306 = ON, pulse output direction
is reversed
M1347: Auto-reset CH0 (Y0, Y1) when high speed pulse output completed. M1347 will be
reset after CH0 (Y0, Y1) pulse output is completed.
M1524: Auto-reset CH1 (Y2, Y3) when high speed pulse output completed. M524 will be
reset after CH1 (Y2, Y3) pulse output is completed.
M1534: Enable ramp-down time setting on Y0. Has to be used with D1348
M1535: Enable ramp-down time setting on Y2. Has to be used with D1349
2. Special registers:
D1026: Pulse number for masking Y0 when M1156 = ON (Low word). The function is
disabled when set value0. (Default = 0 )
D1027: Pulse number for masking Y0 when M1156 = ON (High word). The function is
disabled when set value0. (Default = 0 )
D1135: Pulse number for masking Y2 when M1156 = ON (Low word). The function is
disabled when set value0. (Default = 0 )
D1136: Pulse number for masking Y2 when M1156 = ON (High word). The function is
disabled when set value0. (Default = 0 )
D1030: Low word of the present value of CH0 (Y0, Y1) pulse output
D1031: High word of the present value of CH0 (Y0, Y1) pulse output
D1131: Input/output percentage value of CH0 (Y0, Y1) close loop control. Default: K100
D1132: Input/output percentage value of CH1 (Y2, Y3) close loop control. Default: K100
Idle time (pulse number) setting of CH0 (Y0, Y1) The function is disabled if set
D1244:
value0.
Idle time (pulse number) setting of CH2 (Y2, Y3) The function is disabled if set
D1245:
value0.
D1336: Low word of the present value of CH1 (Y2, Y3) pulse output
D1337: High word of the present value of CH1 (Y2, Y3) pulse output
D1340: Start/end frequency of the 1st group pulse output CH0 (Y0, Y1). Default: K100
D1352: Start/end frequency of the 2st group pulse output CH1 (Y2, Y3). Default: K100
D1343: Ramp up/down time of the 1st group pulse output CH0 (Y0, Y1). Default: K100
D1353: Ramp up/down time of the 2nd group pulse output CH1 (Y2, Y3). Default: K100
D1348: CH0(Y0, Y1) pulse output. When M1534 = ON, D1348 stores the ramp-down
time. Default: K100
D1349: CH1(Y2, Y3) pulse output. When M1535 = ON, D1349 stores the ramp-down
time. Default: K100
3-473
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-474
3 . I ns t r u c ti o n Se t
Function Explanations:
Pulse output diagram:
Freq.
t2
t1
t3
Time
Pulse number
g1 g2 g3
S2
1. Definitions:
st
t1 target frequency of 1 shift
nd
t2 target frequency of 2 shift
rd
t3 target frequency of 3 shift
st
g1 ramp-up time of 1 shift
nd
g2 ramp-up time of 2 shift
rd
g3 ramp-down time of 3 shift
S2 total output pulses
2. Explanations on each shift:
st
1 shift:
Assume t1 = 6kHz, gap freqency = 1kHz, gap time = 10ms
st
Ramp-up steps of 1 shift:
Freq.
t1=6kHz
1kHz
0Hz Time
10ms 10ms 10ms 10ms 10ms
g1=50ms
3-475
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
nd
2 shift:
Assume t2 = 11kHz, internal frequency = 2kHz, gap time = 20ms
nd
Ramp-up steps of 2 shift:
Freq.
t2=11kHz
1kHz
2kHz
2kHz
t1=6kHz
Time
20ms 20ms 20ms
g2=40ms
3rd shift:
Assume t3 = 3kHz, gap frequency = 2kHz, gap time = 20ms
rd
Ramp-down steps of 3 shift:
Freq.
Change to t3
t2=11kHz
2kHz
t3=3kHz
Time
20ms 20ms 20ms 20ms
g3=60ms
Start to change
3-476
3 . I ns t r u c ti o n Se t
3-477
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Time
Gap Gap
time time
Delayed by program scan cycle
3-478
3 . I ns t r u c ti o n Se t
2. If users change the target frequency by applying DICF instruction in insterupt subroutines, the
actual changing timing will be executed immediately with only an approx. 10us delay
(execution time of DICF instruction).
The timing diagram is as below:
Interrupt
Actual timing of changing
Freq.
Gap freq.
Time
Gap Gap
time time
approx.10us
Program Example:
1. When M0 = ON, pulse output ramps up to 100kHz. Total shifts: 100, Gap frequency: 1000Hz,
Gap time: 10ms. Calculation of total shifts: (100,000 0) 1000 = 100.
2. When X6 external interrupt executes, target frequency is changed and ramp down to 50kHz
immediately. Total shifts: 150, Gap frequency: 800Hz, Gap time: 20ms. Calculation of total
shifts: (100,000 50,000) 800 = 125
3. When X7 external interrupt executes, target frequency is changed and ramp down to 100Hz
immediately. Total shifts: 25, Gap frequency: 2000Hz, Gap time: 100ms. Calculation of total
shifts: (50,000 100) 2000 = 25.
4. When pulse output reaches 100Hz, the frequency is kept constant and pulse output stops
when 1,000,000 pulses is completed.
1000Hz
800Hz
10ms
Freq.(Hz)
100KHz 20ms
2000Hz
50KHz
100ms
100Hz
Time(ms)
1,000,000pulse
3-479
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
EI
M0
DMOVP K100000 D500
FEND
M1000
I601 DMOV K50000 D500
IRET
M1000
I701 DMOV K0 D500
IRET
END
3-480
3 . I ns t r uc ti on Se t
Source value
Min. Max.
source value source value
3-481
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 1:
1. Assume S1 = 500, S2 = 168 and S3 = -4. When X0 = ON, SCAL instruction executes and the
result of proportional calculation will be stored in D0.
2. Equation: D0 = (500 168 ) 1000 + (-4) = 80
X0
SCAL K500 K168 K-4 D0
Destination value
D Slope=168
Offset=-4
Source value
0 1= 500
Program Example 2:
1. Assume S1 = 500, S2 = -168 and S3 = 534. When X0 = ON, SCAL instruction executes and the
result of proportional calculation will be stored in D10..
2. Equation: D10 = (500 -168 ) 1000+ 534 = 450
X10
SCAL K500 K-168 K534 D10
Destination value
D
Slope = -168
Offset = 534
Source value
0 S 1 = 500
Points to note:
1. This instruction is applicable for known slope and offset. If slope and offset are unknown, please
use SCLP instruction for the calculation.
2. S2 has to be within the range -32,768 ~ 32,767. If S2 exceeds the applicable range, use SCLP
instruction instead.
3. When adopting the slope equation, the max source value must be larger than min source value,
but the max destination value does not need to be larger than min destination value.
4. If D > 32,767, D will be set as 32,767. If D < -32,768, D will be set as -32,768.
3-482
3 . I ns t r uc ti on Se t
4. Operation equation in the instruction: D = [(S1 min. source value) (max. destination value
min. destination value)] (max. source value min. source value) + min. destination value
5. The equation to obtain the operation equation of the instruction:
y = kx + b
where
y = Destination value (D)
k = Slope = (max. destination value min. destination value) (max. source value min.
source value)
x = Source value (S1)
b = Offset = Min. destination value Min. source value slope
6. Substitute the above parameters into y = kx + b and the operation instruction can be obtained. y
= kx + b = D = k S1 + b = slope S1 + offset = slope S1 + min. destination value min. source
3-483
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
value slope = slope (S1 min. source value) + min. destination value = (S1 min. source
value) (max. destination value min. destination value) (max. source value min. source
value) + min. destination value
7. If S1 > max. source value, S1 will be set as max. source value. If S1 < min. source value, S1 will
be set as min. source value. When the source value and parameters are set, the following
output figure can be obtained:
Destination value
Source value
Min. 1 Max.
source value source value
Program Example 1:
1. Assume source value S1 = 500, max. source value D0 = 3000, min. source value D1 = 200, max.
destination value D2 = 500, and min. destination value D3 = 30. When X0 = ON, SCLP
instruction executes and the result of proportional calculation will be stored in D10.
2. Equation: D10 = [(500 200) (500 30)] (3000 200) + 30 = 80.35. Rounding off the result
into an integer, D10 =80.
X0
MOV K3000 D0
MOV K200 D1
MOV K500 D2
MOV K30 D3
X0
SCLP K500 D0 D10
3-484
3 . I ns t r uc ti on Se t
Destination value
= 500
= 30
S 1 =500
Source value
0
Program Example 2:
1. Assume source value S1 = 500, max. source value D0 = 3000, min. source value D1 = 200, max.
destination value D2 = 30, and min. destination value D3 = 500. When X0 = ON, SCLP
instruction executes and the result of proportional calculation will be stored in D10.
2. Equation: D10 = [(500 200) (30 500)] (3000 200) + 500 = 449.64. Rounding off the
result into an integer, D10 = 450.
X0
MOV K3000 D0
MOV K200 D1
MOV K30 D2
MOV K500 D3
X0
SCLP K500 D0 D10
Destination value
= 500
D
= 30
S1= 500
Source value
0
3-485
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example 3:
1. Assume the source value S1, D100 = F500, max. source value D0 = F3000, min. source value
D2 = F200, max. destination value D4 = F500, and min. destination value D6 = F30. When X0 =
ON, M1162 is set up to adopt floating point operation. DSCLP instruction executes and the
result of proportional calculation will be stored in D10.
2. Equation: D10 = [(F500 F200) (F500 F30)] (F3000 F200) + F30 = F80.35. Round off
the result into an integer, D10 = F80.
X0
SET M1162
DMOVR F3000 D0
DMOVR F200 D2
DMOVR F500 D4
DMOVR F30 D6
X0
DSCLP D100 D0 D10
Points to note:
1. Range of S1 for 16-bit instruction: max. source value S1 min. source value; -32,768 ~ 32,767.
If the value exceeds the bounds, the bound value will be used for calculation.
2. Range of integer S1 for 32-bit instruction: max. source value S1 min. source value;
-2,147,483,648 ~ 2,147,483,647. If the value exceeds the bounds, the bound value will be used
for calculation.
3. Range of floating point S1 for 32-bit instruction: max. source value S1 min. source value;
adopting the range of 32-bit floating point. If the value exceeds the bounds, the bound value will
be used for calculation.
4. When adopting the slope equation, please note that the Max. source value must be larger than
the min. source value. However the max. destination value does not need to be larger than the
min. destination value.
3-486
3 . I ns t r uc ti on Se t
7. The example of setting n: If n used in the 16-bit instruction is H0108, eight pieces of data are
compared with eight pieces of data in terms of larger than. If n used in the 32-bit instruction is
H00000320, 32 pieces of data are compared with 32 pieces of data in terms of less than.
8. If the setting value of the comparison condition exceeds the range, or the firmware version does
not support the comparison condition, the default comparion condition equal to is executed.
DVP-ES2/EX2 version 3.0and above, DVP-SS2 version 2.8 and above, DVP-SA2 version 2.6
and above, DVP-SX2 version 2.4 and above, and DVP-SE support the setting of the
comparison condition.
3-487
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
9. The 16-bit comparison values used in the 16-bit instruction are signed values. The comparison
values used in the 32-bit instruction are 32-bit signed values (M1162=OFF), or floating-point
numbers (M1162=ON).
10. The 16-bit data or 32-bit data is written into D. If the data length is less than 16 bits or 32 bits,
the bit which does not have a corresponding value is 0. For example, if n is K8, bit0~7 have
corresponding values, and bit8~bit15 or bit8~bit31 are 0.
11. If the comparison result meets the comparison condition, the corresponding bit is 1. If the
comparison result does not meet the comparison condition, the corresponding bit is 0.
Program example:
When M0 = ON, compare the 16-bit value in D0~D7 with D20~D27 and store the results in D100.
M0
CMPT D0 D20 K8 D100
Content in D0~D7:
No. D0 D1 D2 D3 D4 D5 D6 D7
Value K10 K20 K30 K40 K50 K60 K70 K80
Content in D20~D27:
No. D20 D21 D22 D23 D24 D25 D26 D27
Value K12 K20 K33 K44 K50 K66 K70 K88
After the comparison of CMPT instruction, the associated bit will be 1 if two devices have the
same value, and other bits will all be 0. Therefore the results in D100 will be as below:
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7 Bit8~15
D100 0 1 0 0 1 0 1 0 00
H0052 (K82)
3-488
3 . I ns t r uc ti on Se t
3-489
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
6. For relative M flags and special D registers, please refer to explanations of API 80 RS
instruction.
Program example 1: COM2 (RS-485)
1. When X0 = ON, PLC will send out communication commands by COM2 to read status of servo
drive.
2. When PLC received the feedback data from ASDA, M1127 will be active and the read data will
be stored in D0~D4.
M1002
MOV H87 D1120 Set communication protocol as 9600,8,E,1
X0
ASDRW K1 K0 D0
Data Register
Function Code: K0
Monitor ASDA status
ASDA address: K1
M1127
Processing received data
ASCII mode: Store the received data into specified registers D0~D4 in Hex
RTU modeStore the received data into specified registers D0~D4 in Hex
3-490
3 . I ns t r uc ti on Se t
RST M1320 Set up in ASCII mode SET M1320 Set up in RTU mode
M0
SET M1316 Sending request
M0
ASDRW K1 K0 D0
Data Register
Function Code: K0
Monitor ASDA status
ASDA address: K1
M1318
Processing received data
ASCII mode: Store the received data into specified registers D0~D4 in Hex
RTU modeStore the received data into specified registers D0~D4 in Hex
Points to note:
Relative flags and special D registers of COM2/COM3 :
COM2 COM3 Function Description
M1120 M1136 Retain communication setting
Protocol M1143 M1320 ASCII/RTU mode selection
setting D1120 D1109 Communication protocol
D1121 D1255 PLC communication address
Sending M1122 M1316 Sending request
request D1129 D1252 Communication timeout setting (ms)
Receiving
M1127 M1318 Data receiving completed
completed
- M1319 Data receiving error
- D1253 Communication error code
M1129 - Communication timeout setting (ms)
COM2 (RS-485) MODRD/MODWR/MODRW
M1140 -
data receiving error
Errors
MODRD/MODWR/MODRW parameter error
M1141 - (Exception Code exists in received data)
Exception Code is stored in D1130
COM2 (RS-485) Error code (exception code)
D1130 -
returning from Modbus communication
3-491
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-492
3 . I ns t r uc ti on Se t
For example, set S1 +0 as K1 for the speed range 1Hz~1KHz, K10 for the speed range
10Hz~10KHz, K100 for the speed range 100Hz~10KHz. For single phase input, the max
frequency is 10kHz; for 2-phase 2 inputs, the max frequency is 2kHz.
7. D occupies 3 consecutive 16-bit registers. D +0 specifies the output proportion value. Valid
range: K1 (1%) ~ K10000 (10000%). If the specified value exceeds the valid range, PLC will
take the lower/upper bound value as the set value. Output proportion can be changed during
PLC operation, however the modified value will take effect until program scan proceeds to this
instruction. D+2 and D+1 indicates the output speed in 32-bit data. Unit: 1Hz. Valid range:
100kHz.
8. The speed sampled by PLC will be multiplied with the output proportion D+0, then PLC will
generate the actual output speed. PLC will take the integer of the calculated value, i.e. if the
calculated result is smaller than 1Hz, PLC will output with 0Hz. For example, input speed: 10Hz,
output proportion: K5 (5%), then the calculation result will be 10 x 0.05 = 0.5Hz. Pulse output will
be 0Hz; if output proportion is modified as K15 (15%), then the calculation result will be 10 x
0.15 = 1.5Hz. Pulse output will be 1Hz.
Program Example:
1. If D0 is set as K2, D10 is set as K100:
When the sampled speed on (X0, X1) is +10Hz (D1 = K10), (Y0, Y1) will output pulses with
+10Hz (D12, D11 = K10); When the sampled speed is -10Hz (D1 = K-10), (Y0, Y1) will output
pulses with -10Hz (D12, D11 = K-10)
2. If D0 is set as K2, D10 is set as K1000:
When the sampled speed on (X0, X1) is +10Hz (D1 = K10), (Y0, Y1) will output pulses with
+100Hz (D12, D11 = K100); When the sampled speed is -100Hz (D1 = K-100), (Y0, Y1) will
output pulses with -100Hz (D12, D11 = K-100)
3. If D0 is set as K10, D10 is set as K10:
When the sampled speed on (X0, X1) is +10Hz (D1 = K10), (Y0, Y1) will output pulses with
+1Hz (D12, D11 = K1); When the sampled speed is -10Hz (D1 = K-10), (Y0, Y1) will output
pulses with -1Hz (D12, D11 = K-1)
M0
CSF O X1 D0 D10
3-493
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Operation:
& : Logic AND operation, | : Logic OR operation, ^ : Logic XOR operation
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DLD#). If 16-bit instruction (LD#) is adopted, a program error will occur and the
ERROR indicator on the MPU panel will flash.
Program Example:
1. When the result of logical AND operation between C0 and C10 0, Y20 = ON.
2. When the result of logical OR operation between D200 and D300 0 and X1 = ON, Y21 = ON
and latched.
3-494
3 . I ns t r uc ti on Se t
3. Operation:
& : Logic AND operation, | : Logic OR operation, ^ : Logic XOR operation
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DAND#). If 16-bit instruction (AND#) is adopted, a program error will occur and the
ERROR indicator on the MPU panel will flash
Program Example:
1. When X0 = ON, and the result of logical AND operation between C0 and C10 0, Y20 = ON
2. When X1 = OFF, and the result of logical OR operation between D10 and D0 0, Y21 = ON and
latched
X0
AND & C0 C10 Y20
X1
AND | D10 D0 SET Y21
3-495
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. Operation:
& : Logic AND operation, | : Logic OR operation, ^ : Logic XOR operation
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DOR#). If 16-bit instruction (OR#) is adopted, a program error will occur and the
ERROR indicator on the MPU panel will flash
Program Example:
M60 will be ON either when both X2 and M30 are ON, or 1: the result of logical OR operation
between D10 and D20 0, or 2: the result of logical XOR operation between CD100 and D200 0.
X2 M30
M60
OR | D10 D20
OR ^ D100 D200
3-496
3 . I ns t r uc ti on Se t
3. When the MSB (16-bit instruction: b15, 32-bit instruction: b31) of S1 and S2 is 1, the comparison
value will be viewed as a negative value in comparison.
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DLD). If 16-bit instruction (LD) is adopted, a program error will occur and the
ERROR indicator on the MPU panel will flash.
Program Example:
1. When the content in C10 = K200, Y20 = ON.
2. When the content in D200 > K-30 and X1 = ON, Y21 = ON and latched.
X1
LD<= D200 K-30 SET Y21
3-497
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. When the MSB (16-bit instruction: b15, 32-bit instruction: b31) of S1 and S2 is 1, the comparison
value will be viewed as a negative value in comparison.
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DAND). If 16-bit instruction (AND) is adopted, a program error will occur and
the ERROR indicator on the MPU panel will flash.
Program Example:
1. When X0 = ON, and the content in C10 = K200, Y20 = ON
2. When X1 = OFF and the content in D0 K-10, Y21= ON and latched.
X0
AND= K200 C10 Y20
X1
AND<> K-10 D0 SET Y21
3-498
3 . I ns t r uc ti on Se t
3. When the MSB (16-bit instruction: b15, 32-bit instruction: b31) of S1 and S2 is 1, the comparison
value will be viewed as a negative value in comparison..
4. When 32-bit counters (C200 ~ C254) are used in this instruction, make sure to adopt 32-bit
instruction (DOR). If 16-bit instruction (OR) is adopted, a program error will occur and the
ERROR indicator on the MPU panel will flash
Program Example:
M60 will be ON either when both X2 and M30 are ON, or when the content in 32-bit register D100
(D101) K100,000.
X2 M30
M60
3-499
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
T5
Y0
3-500
3 . I ns t r uc ti on Se t
Program Example:
X0 X1 Instruction: Operation:
BOUT K4Y0 D0
LDI X0 Load NC contact X0
AND X1 Connect NO contact
X1 in series.
BOUT K4Y0 D0 When D0 = k1,
executes output on Y1
When D0 = k2,
executes output on Y2
3-501
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-502
3 . I ns t r uc ti on Se t
3-503
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-504
3 . I ns t r uc ti on Se t
3-505
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-506
3 . I ns t r uc ti on Se t
3-507
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-508
3 . I ns t r uc ti on Se t
3-509
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example:
When the content in D200(D201) F1.2 and X1 is ON, Y21 = ON and latched.
X1
FLD<= D200 F1.2 SET Y21
3-510
3 . I ns t r uc ti on Se t
Program Example:
When X1 is OFF and the content in D100(D101) is not equal to F1.2, Y21 = ON and latched.
X1
FAND<> F1.2 D0 SET Y21
3 - 5 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example:
When both X2 and M30 are On and the content in D100(D101) F1.234, M60 = ON..
X2 M30
M60
3-512
3 . I ns t r uc ti on Se t
Description of S1+0:
Communication port S1+0 Numbers must be used
K1~K5
COM on a PLC S1+0 ~ S1+1
K1~K5 represent PLC COM1~PLC COM5.
4. S2 is used to set a communication function code. The devices that these operand occupies and
the functions of the devices are described below.
Number Description Remark
Communication combination Please refer to the description of the function
S2+0
function code codes below.
It is only applicable to K0, and is not applicable
S2+1 Communication address
to other codes.
0: Reading
Other values: Writing
S2+2 Reading/Writing
It is only applicable to K0, and is not applicable
to other codes.
3-513
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-514
3 . I ns t r uc ti on Se t
functions as a source device at first, and then functions as a destination device when a reading
command is executed.
#2
Note : If a communication combination command is used, S2+1 and S2+2 will be set by the PLC
according to the communication combination command.
5. D1 is a source device or a destination device. Please refer to the description of the function
codes above.
6. D2 is a communication state flag. It occupies three consecutive devices. It is described below.
Number On Remark
If the DMV is busy, a communication
command will be resent automatically until
D2+0 The DMV is busy.
the DMV replies that the communication is
complete.
The communication with
D2+1
the DMV is complete.
Communication error or The DMV does not reply after a timeout
D2+2
timeout period.
1-3. When M0 is On, the PLC communicates with the DMV according to the communication data
and the communication port set by the users, and H0888 in D8 is written into H10D0 in the
DMV.
1-4. When the PLC sends the data, the operand D2 (Y0) is On (the DMV is busy).
1-5. When the DMV replies successfully, D2+1 (Y1) in the PLC is On (the communication with the
DMV is complete).
1-6. If the DMV does not reply after the timeout period 100ms, the PLC will set D2+2 (Y2) to On (a
communication timeout occurs).
1-7. If the DMV replies with an execption code, the PLC will resend the command to the DMV
automatically, and go back to step 1-3 ~ step 1-5.
The program in the PLC and the comments are shown below.
3-515
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example 2: The combination function code K3 is used. COM2 on a PLC communicates with a DMV.
The control procedure is shown below.
2-1. Write K2 into D0. (COM2 on the PLC is used.) Write K1 into D1. (The station address of the
DMV is K1.)
2-2. The operand S2+0 specifies D4. Write K3 into D4. The function code K3 is used (There are
three communication commands.)The message required are written into S2+3 and D1.
Communication
Operand Device Value Description
command
The DMV program number used is
First D1 D8 H0014
K20.
It does not need to be set. The PLC
Second - - -
enables DMV trigger 1 by itself.
The value in S2+3 indicates the
Third S2+3 D7 K2 number of data read from the output
data area in a DMV.
2-3. When M0 is ON, the PLC sends communication data to the DMV accoding to the
communication combination command order specified by the function code K3.
2-4. When the PLC sends the data, the operand D2 (Y0) is On (the DMV is busy).
2-5. When the DMV replies to the three communication commands successfully, D2+1 (Y1) in the
PLC is On (the communication with the DMV is complete).
3-516
3 . I ns t r uc ti on Se t
2-6. If the DMV does not reply after the timeout period 100ms, the PLC will set D2+2 (Y2) to On (a
communication timeout occurs).
2-7. If the DMV replies with an execption code, the PLC will resend the command to the DMV
automatically, and go back to step 2-3 ~ step 2-5.
The program in the PLC and the comments are shown below.
3-517
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. If the values of the most significant bits in S1, S2, and S3 are 1, the values in S1, S2, and S3 are
negative values.
5. A 32-bit counter (C200~) must be used with the 32-bit instruction DLDZ. If it is used with the
16-bit instruction LDZ, a program error will occur, and the ERROR LED indicator on the PLC
will blink.
3-518
3 . I ns t r uc ti on Se t
Program Example:
1. If the value in C10 is equal to K200 or K-200, Y20 will be On.
2. If the value in D200 is less than or equal to K230, and is larger than or equal to K170, and X1 is
On, Y21 will be On and latched.
X1
LDZ<= D200 K200 K-30 SET Y21
3-519
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. If the values of the most significant bits in S1, S2, and S3 are 1, the values in S1, S2, and S3 are
negative values.
5. A 32-bit counter (C200~) must be used with the 32-bit instruction DANDZ. If it is used with the
16-bit instruction ANDZ, a program error will occur, and the ERROR LED indicator on the
PLC will blink.
3-520
3 . I ns t r uc ti on Se t
Program Example:
1. If X0 is On, and the present value in C10 is equal to K200 or K-200, Y20 will be On.
2. If X1 is Off, and the value in D0 is not equal to K10 or K-10, Y21 will be On and latched.
X0
ANDZ= K200 K400 C10 Y20
X1
ANDZ<> K0 K-10 D0 SET Y21
3-521
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
4. If the values of the most significant bits in S1, S2, and S3 are 1, the values in S1, S2, and S3 are
negative values.
5. A 32-bit counter (C200~) must be used with the 32-bit instruction DORZ. If it is used with the
16-bit instruction ORZ, a program error will occur, and the ERROR LED indicator on the PLC
will blink.
3-522
3 . I ns t r uc ti on Se t
Program Example:
If X2 and M30 are On, or the value in the 32-bit register (D101, D100) is larger than or equal to
K100000, or is less than or equal to K-100000, M60 will be On.
X2 M30
M60
3-523
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Operands:
S1: Local communication port, target IP address, communication port and UDP/TCP mode S2:
Parameters S3: Data source S4: Data length D1: Receive data address D2: Receiving
completion flag
Explanations:
1. This instruction is currently available for DVP-SE series PLC with firmware V1.83 or later.
2. S1 is for setups of local communication port, target IP address, communication port and
UDP/TCP mode. This operand occupies 5 consecutive devices.
IP address settings: this occupies 2 consecutive devices, S1+1 and S1+2 respectively
IP definition IP3.IP2.IP1.IP0 192.168.0.2
If S1 is D100, the input value should be:
D100 (S1+0) D101 (S1+1) D102 (S1+2) D103 (S1+3) D104 (S1+4)
3. S2 is where you can set up parameters. Client mode 0 and 1 are exchangeable and the
connections are active. Server mode 2 and 3 are exchangeable and the connections are active.
But it is required to disconnect the connection when switching between different modes.
3-524
3 . I ns t r uc ti on Se t
Local Remote
Start
Remote IP communication communication Description
Mode
port port
Specific IP Illegal
0,1 0 0
address
Master mode,
Specific IP Specifies the IP address;
0,1 0 Not equal to 0
address but not specify the local
communication port.
Specific IP
0,1 Not equal to 0 0 Illegal
address
Master mode,
Specifies the IP address,
Specific IP
0,1 Not equal to 0 Not equal to 0 local communication port
address
and remote
communication port
No limit to the No limit to the
0,1 0.0.0.0 Illegal
value value
Specific IP No limit to the
2,3 0 Illegal
address value
Slave mode,
Specific IP Not specify the IP
2,3 Not equal to 0 0
address address and remote
communication port
Slave mode,
Specific IP Specify the IP address
2,3 Not equal to 0 Not equal to 0
address and remote
communication port
No limit to the
2,3 0.0.0.0 0 Illegal
value
Slave mode,
Not specify the IP
2,3 0.0.0.0 Not equal to 0 0
address and remote
communication port
Slave mode,
Not specify the IP
2,3 0.0.0.0 Not equal to 0 Not equal to 0
address and remote
communication port
Specific IP No limit to the
2,3 0 Illegal
address value
4. The operand S3 and S4 specify source data registers and data length. For exampleS3
specifies D150 and the value in S4 is 10. The instruction ETHRS will send 10 bytes of data,
starting from the low byte in D150, D151, D152 and so on. Users can use the instruction DTM
to transform 16-bit data into 8-bit data when the transformation is required. The setting range
for S4 is 1~200 words. If the setting values exceed the setting range, the system will use the
minimum (1) or the maximum (200) to operate.
5. The operand D1 specifies a destination data register. For example, D specifies D10 and D10 is
the received data length; the unit is byte. The data received will be stored starting from D11,
low byte in D11, D12, D13 and so on. The maximum receiving data length is 200 words; data
3-525
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
length exceeds this limit will not be stored in D. Users can use the instruction DTM to transform
16-bit data into 8-bit data when the transformation is required.
6. D2 specifies the reception completion flag and only M device can be used. When the
instruction is executed, and the transmission of packets is complete, this flag will be set to ON.
Users can learn from this flag to see if the transmission is complete or not. Once it is set to ON,
users need to set it to OFF. When there is any error occurred during the instruction execution
or any timeout occurred, the flag will not be ON.
7. Once the instruction is executed, the communication begins. There is no need to use any
special flag to trigger the sending. When the instruction is executed, there will be a special M
shown to indicate the execution.
8. There is no limitation on the times of using this instruction in the program. However, only one
instruction can be executed at a time.
9. When the instruction is forcedly stopped, the communication will also be stopped. And the
completion flag D2 will not be ON.
10. When this instruction is executed, do not use the Online Mode; otherwise errors may occur
when receiving and storing data.
11. Relative special flags and registers for the instruction ETHRS:
Item Function Defaults StopRun Attributes
ON: the connection of the self-defined
Ethernet communication port is enabled.
When the instruction ETHRS stops, the
connection will still be kept.
M1196 Off Off R/W
ON=> OFF: the connection will be disabled.
Off: use the instruction ETHRS to control the
connection, when the instruction is
executed, the connection is enabled.
ON: the instruction ETHRS is being
M1197 Off Off R
executed.
ON: when there is a communication error or
a communication timeout, the control on the
connection of the self-defined Ethernet
communication port is through M1196.
M1198 Off Off R/W
When the communication timeout occurs,
the communication instruction has to be
stopped and then start the instruction again
to start the communication.
D1176 Error code 0 0 R
3-526
3 . I ns t r uc ti on Se t
12. If M1198 is ON, it means communication errors occur and an error code will be stored in
D1176. For other error codes, please refer to the following table.
When S1+4=0 (UDP mode)
Error code Description
H2003 The value exceeds the range.
H600C The local socket has been used.
H600D Ethernet network is not connected.
H6209 UDP Socket illegal IP address
H620A UDP Socket illegal communication mode
H620C UDP Socket illegal address for sending data
H620D UDP Socket the length of sent data exceeds the range
H620E UDP Socket the device where data are sent exceeds the range
H620F UDP Socket illegal address for receiving data
H6210 UDP Socket the length of data actually received exceeds the range.
H6211 UDP Socket the device where data are received exceeds the range.
H6213 UDP Socket the size of data actually received is larger than the set data.
H6215 UDP Socket is not connected
H6217 UDP Socket connection has been triggered
3-527
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Program Example: (The command is sent and received through the Ethernet port built in DVP-SE.)
This example uses DVP-SE series as the client, M0 to activate and UDP connection mode to send
and receive data. The value in S2 is K1. When the data is received, M100 is set to ON. The relative
parameters are stated below.
TCP Socket Connection
Remote IP 192.168.1.18
Remote port 10000
Local port 1024
Send Data Address D100
Send Data Length 100
Receive Data Address D200
Communication timeout (ms) 5000
1. When M0 is ON, the transmission starts and M1197 is ON. If M1198 is ON, it means
communication errors occur and an error code will be stored in D1176.
2. When the data is received correctly and a response is received from the remote device, M100
will be ON. The data length and the contents will be stored in D200.
3-528
3 . I ns t r uc ti on Se t
Program Example 2: (The command is sent and received through the Ethernet port built in
DVP-SE.)
This example uses DVP-SE series as the client, M2 to activate and TCP connection mode to send
and receive data. The value in S2 is K2. The relative parameters are stated below.
TCP Socket Connection
Remote IP 192.168.1.31
Remote port 10000
Local port 1024
Send Data Address D100
Send Data Length 100
Receive Data Address D200
Communication timeout (ms) 30000
1. Set M1196 to ON. When using the TCP connection mode, it is suggested to set M1196 to ON to
avoid disconnecting if a communication timeout occurs.
2. When M2 is ON, DVP-SE is waiting for the TCP connection to be established. When M100 is
ON, it means the receiving is complete successfully and the data length and contents are stored
in D200 and data in D100 has been sent, the data length is 100 bytes.
3. If M1198 is ON, it means communication errors occur and an error code will be stored in D1176.
3-529
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
3-530
Communications
This chapter introduces information regarding the communications ports of the PLC.
Through this chapter, the user can obtain a full understanding about PLC
communication ports.
Chapter Contents
4-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
COM1: RS-232 communication port. COM1 can be used as master or slave and is the major COM port
for PLC programming. (It is not applicable to DVP-SE.)
COM2: RS-485 communication port. COM2 can be used as master or slave.
COM3 (ES2/EX2/SA2/SE): RS-485 communication port. COM3 can be used as master or slave. (For
DVP-ES2-C, COM3 is the CANopen port.)
COM3 (SX2): Conversion from the USB port to RS-232 port. COM3 can be used as slave only.
The 3 COM ports on the models mentioned above support Modbus ASCII or RTU communication
format.
USB (COM1) (SE): USB communication port. It only can be used as a slave. The communication
mode and format can not be modified.
Communication Format:
4-2
4 . Com m u ni c at i ons
Valid communication addresses are in the range of 0~254. Communication address equals to 0 means
broadcast to all PLCs. PLC will not respond to a broadcast message. PLC will reply a normal message
to the master device when communication address is not 0.
4-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Example, ASCII codes for communication address 16 in Decimal. (16 in Decimal = 10 in Hex)
(ADR 1, ADR 0)=1,01=31H, 0 = 30H
4.2.2 CMD (Command code) and DATA
Example: Read devices T20~T27 (address: H0614~H61B) from Slave ID#01(station number)
PCPLC
: 01 03 06 14 00 08 DA CR LF
Sent massage:
Field name ASCII Hex
STX : 3A
Slave Address 01 30 31
Command code 03 30 33
Starting Address High 06 30 36
Starting Address Low 14 31 34
Number of Points High 00 30 30
Number of Points Low 08 30 38
LRC checksum DA 44 41
END CR LF 0D 0A
PLCPC
: 01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 C8 CR LF
Responded massage:
Field name ASCII Hex
STX : 3A
Slave Address 01 30 31
Command code 03 30 33
Bytes Count 10 31 30
4-4
4 . Com m u ni c at i ons
LRC (Longitudinal Redundancy Check) is calculated by summing up the Hex values from ADR1 to last
data character then finding the 2s-complement negation of the sum.
Example: Read the content of register at address 0401H. 01H+03H+04H+01H+00+01H = 0AH.
The 2s-complement of 0AH: F6H
Field name ASCII Hex
STX : 3A
Slave Address 01 30 31
Command code 03 30 33
Starting data address Hi 04 30 34
Starting data address Lo 01 30 31
Number of data Hi 00 30 30
Number of data Lo 01 30 31
LRC checksum F6 46 36
END CR LF 0D 0A
Exception response:
The PLC is expected to return a normal response after receiving command messages from the master
device. The following table depicts the conditions that either a no response or an error response is
replied to the master device.
1. The PLC did not receive a valid message due to a communication error; thus the PLC has no
response. The master device will eventually process a timeout condition.
2. The PLC receives a valid message without a communication error, but cannot accommodate it, an
4-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
exception response will return to the master device. In the exception response, the most significant
bit of the original command code is set to 1, and an exception code explaining the condition that
caused the exception is returned.
Feedback message:
Field Name ASCII Hex
STX : 3A
Slave Address 01 30 31
Function 81 38 31
Exception Code 02 30 32
Error Check (LRC) 7C 37 43
END CR LF 0D 0A
Exception
Explanation:
code:
Illegal command code:
01
The command code received in the command message is invalid for PLC.
Illegal device address:
02
The device address received in the command message is invalid for PLC.
Illegal device content:
03
The data received in the command message is invalid for PLC.
1. Checksum Error
- Check if the checksum is correct
07 2. Illegal command messages
- The command message is too short.
- Length command message is out of range.
4-6
4 . Com m u ni c at i ons
Valid communication addresses are in the range of 0~254. Communication address equals to 0 means
broadcast to all PLCs. PLC will not respond to a broadcast message. PLC will reply a normal message
to the master device when communication address is not 0.
Example, communication address should be set to 10 (Hex) when communicating with a PLC with
address 16 (Dec) (16 in Decimal = 10 in Hex)
4.3.2 CMD (Command code) and DATA
The content of access data depends on the command code. For descriptions of available command
codes, please refer to 4.2.2 in this chapter.
Example: read consecutive 8 words from address 0614H~H61B (T20~T27) of PLC Slave ID#1.
PCPLC
01 03 06 14 00 08 04 80
Sent message:
Field Name Example (Hex)
START No data input 10 ms
Slave Address 01
Command code 03
06
Starting Address
14
00
Number of Points
08
CRC CHK Low 04
CRC CHK High 80
END No data input 10 ms
4-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
PLCPC
01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 72 98
Feedback message:
Field Name Example (Hex)
START No data input 10 ms
Slave Address 01
Command code 03
Bytes Count 10
Data Hi (T20) 00
Data Lo (T20) 01
Data Hi (T21) 00
Data Lo (T21) 02
Data Hi (T22) 00
Data Lo (T22) 03
Data Hi (T23) 00
Data Lo (T23) 04
Data Hi (T24) 00
Data Lo (T24) 05
Data Hi (T25) 00
Data Lo (T25) 06
Data Hi (T26) 00
Data Lo (T26) 07
Data Hi (T27) 00
Data Lo (T27) 08
CRC CHK Low 72
CRC CHK High 98
END No data input 10 ms
4.3.3 CRC CHK (check sum)
The CRC Check starts from Slave Address and ends in The last data content. Calculation of CRC:
Step 1: Set the 16-bit register (CRC register) = FFFFH.
Step 2: Operate XOR on the first 8-bit message (Address) and the lower 8 bits of CRC register. Store
the result in the CRC register
Step 3: Right shift CRC register for a bit and fill 0 into the highest bit.
Step 4: Check the lowest bit (bit 0) of the shifted value. If bit 0 is 0, fill in the new value obtained at step
3 to CRC register; if bit 0 is NOT 0, operate XOR on A001H and the shifted value and store the result in
the CRC register.
Step 6: Repeat step 2 5 until the operation of all the messages are completed. The final value
4-8
4 . Com m u ni c at i ons
obtained in the CRC register is the CRC checksum. Care should be taken when placing the LOW byte
and HIGH byte of the obtained CRC checksum.
Exception response:
The PLC is expected to return a normal response after receiving command messages from the master
device. The following content depicts the conditions that either no response situation occurs or an error
response is replied to the master device.
1. The PLC did not receive a valid message due to a communication error; thus the PLC has no
response. In this case, condition of communication timeout has to be set up in the master device
2. The PLC receives a valid message without a communication error, but cannot accommodate it. In
this case, an exception response will return to the master device. In the exception response, the
most significant bit of the original command code is set to 1, and an exception code explaining the
condition that caused the exception is returned.
4-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Feedback message:
Field Name Example (Hex)
START No data input 10 ms
Slave Address 01
Function 81
Exception Code 02
CRC CHK Low C1
CRC CHK High 91
END No data input 10 ms
4-10
4 . Com m u ni c at i ons
Effective Range
MODBUS
Device Range SA2/SE Address
ES2/EX2 SS2 Address
SX2
M 1536~1791 B000~B0FF
M 1792~2047 B100~B1FF
M 2048~2303 B200~B2FF
M 2304~2559 0000 B300~B3FF
M 2560~2815 ~ 0000~4095 045057~047616 B400~B4FF
M 2816~3071 B500~B5FF
4095
M 3072~3327 B600~B6FF
M 3328~3583 B700~B7FF
M 3584~3839 B800~B8FF
M 3840~4095 B900~B9FF
000~199 000~199 003585~003784 0E00~0EC7
C 000~199 (16-bit)
000~199 000~199 403585~403784 0E00~0EC7
200~255 200~255 003785~003840 0EC8~0EFF
401793~401903
C 200~255 (32-bit)
200~255 200~255 (Odd address 0700~076F
valid)
D 000~255 1000~10FF
D 256~511 1100~11FF
D 512~767 404097~405376 1200~12FF
D 768~1023 1300~13FF
D 1024~1279 1400~14FF
D 1280~1535 1500~15FF
D 1536~1791 1600~16FF
D 1792~2047 1700~17FF
D 2048~2303 1800~18FF
D 2304~2559 0000 1900~19FF
~
D 2560~2815 405377~408192 1A00~1AFF
0000 4999 0000
D 2816~3071 1B00~1BFF
~ ~
D 3072~3327 1C00~1CFF
9999 9999
D 3328~3583 1D00~1DFF
D 3584~3839 1E00~1EFF
D 3840~4095 1F00~1FFF
D 4096~4351 9000~90FF
D 4352~4999 9100~91FF
D 4608~4863 9200~92FF
D 4864~5119 9300~93FF
436865~440960
D 5120~5375 9400~94FF
D 5376~5631 9500~95FF
N/A
D 5632~5887 9600~96FF
D 5888~6143 9700~97FF
4 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Effective Range
MODBUS
Device Range SA2/SE Address
ES2/EX2 SS2 Address
SX2
D 6144~6399 9800~98FF
D 6400~6655 9900~99FF
D 6656~6911 9A00~9AFF
D 6912~7167 9B00~9BFF
436865~440960
D 7168~7423 9C00~9CFF
D 7424~7679 9D00~9DFF
D 7680~7935 9E00~9EFF
D 7936~8191 0000 0000 9F00~9FFF
~ N/A ~ A000~A0FF
D 8192~8447
9999 9999
D 8448~8703 A100~A1FF
D 8704~8959 A200~A2FF
D 8960~9215 A300~A3FF
D 440961~442768 A400~A4FF
9216~9471
D 9472~9727 A500~A5FF
D 9728~9983 A600~A6FF
D 9984~9999 A700~A70F
D 10000~11999 Applicable to DVP-SE 442769~444768 A710~AEDF
4-12
4 . Com m u ni c at i ons
Assume Number of Points in sent message is n (Dec), quotient of n/8 is M and the remainder is N.
When N = 0, Bytes Count in feedback message will be M; when N0, Bytes Count will be M+1.
PLCPC :01 01 05 CD 6B B2 0E 1B D6 CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 01
Bytes Count 05
Data (Coils T27T20) CD
Data (Coils T35T38) 6B
Data (Coils T43T36) B2
Data (Coils T51T44) 0E
Data (Coils T56T52) 1B
Error Check (LRC) E6
END 1 0D (Hex)
END 0 0A (Hex)
4.5.2 Command Code: 02, Read Status of Contact (Input point X is included)
Sent message:
Field Name ASCII
STX :
Slave Address 01
Command code 02
Starting Address Hi 05
Starting Address Lo 14
Number of Points Hi 00
Number of Points Lo 25
Error Check (LRC) BF
END 1 0D (Hex)
END 0 0A (Hex)
Assume Number of Points in sent message is n (Dec), quotient of n/8 is M and the remainder is N.
When N = 0, Bytes Count in feedback message will be M; when N0, Bytes Count will be M+1.
PLCPC : 01 01 05 CD 6B B2 0E 1B E5 CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 02
4-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Sent message:
Field Name ASCII
STX :
Slave Address 01
Command code 03
Starting Address Hi 06
Starting Address Lo 14
Number of Points Hi 00
Number of Points Lo 08
Error Check (LRC) DA
END 1 0D (Hex)
END 0 0A (Hex)
PLCPC
:01 03 10 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 B8 CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 03
Bytes Count 10
Data Hi (T20) 00
Data Lo (T20) 01
Data Hi (T21) 00
Data Lo (T21) 02
Data Hi (T22) 00
Data Lo (T22) 03
Data Hi (T23) 00
Data Lo (T23) 04
Data Hi (T24) 00
4-14
4 . Com m u ni c at i ons
PLCPC : 01 05 05 00 FF 00 F6 CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 05
Coil Address Hi 05
Coil Address Lo 00
Force Data Hi FF
Force Data Lo 00
Error Check (LRC) F6
END 1 0D (Hex)
END 0 0A (Hex)
4-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Sent message:
Field Name ASCII
STX :
Slave Address 01
Command code 06
Register Address Hi 06
Register Address Lo 00
Preset Data Hi 12
Preset Data Lo 34
Error Check (LRC) AD
END 1 0D (Hex)
END 0 0A (Hex)
PLCPC : 01 06 06 00 12 34 AD CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 06
Register T0 Address Hi 06
Register T0 Address Lo 00
Preset Data Hi 12
Preset Data Lo 34
Error Check (LRC) AD
END 1 0D (Hex)
END 0 0A (Hex)
4.5.6 Command Code: 15, Force ON/OFF multiple contacts
Max contacts/coils available for Force ON/OFF: 255
Example: Set Coil Y007Y000 = 1100 1101, Y011Y010 = 01.
PCPLC : 01 0F 05 00 00 0A 02 CD 01 11 CR LF
Sent message:
Field Name ASCII
STX :
Slave Address 01
Command code 0F
Coil Address Hi 05
Coil Address Lo 00
Quantity of Coils Hi 00
Quantity of Coils Lo 0A
4-16
4 . Com m u ni c at i ons
PLCPC : 01 0F 05 00 00 0A E1 CR LF
Feedback message:
Field Name ASCII
STX :
Slave Address 01
Command code 0F
Register T0 Address Hi 05
Register T0 Address Lo 00
Preset Data Hi 00
Preset Data Lo 0A
Error Check (LRC) E1
END 1 0D (Hex)
END 0 0A (Hex)
4.5.7 Command Code: 16, Set content of multiple registers
Example: Set register T0 to 00 0A , T1 to 01 02 .
PCPLC : 01 10 06 00 00 02 04 00 0A 01 02 D6 CR LF
Sent message:
Field Name ASCII
STX :
Slave Address 01
Command code 10
Starting Address Hi 06
Starting Address Lo 00
Number of Register Hi 00
Number of Register Lo 02
Byte Count 04
Data Hi 00
Data Lo 0A
Data Hi 01
Data Lo 02
Error Check (LRC) D6
END 1 0D(Hex)
END 0 0A(Hex)
4-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
PLCPC : 01 10 06 00 00 02 E7 CR LF
Feedback message:
Field Name ASCII
STX 3A
Slave Address 01
Command code 10
Starting Address Hi 06
Starting Address Lo 00
Number of Registers Hi 00
Number of Registers Lo 02
Error Check (LRC) E7
END 1 0D (Hex)
END 0 0A (Hex)
4-18
Sequential Function Chart
This chapter provides information for programming in SFC mode.
Chapter Contents
5.4 Points to Note for Designing a Step Ladder Program ................................................ 5-10
5-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Explanation:
STL Sn constructs a step point. When STL instruction appears in the program, the main program will
enter a step ladder status controlled by steps. The initial STL program has to start from S0 ~ S9 as
initial step points. The No. of Step points cannot be repeated.
Explanation:
RET instruction indicates the end of a step ladder program starting from S0 ~ S9, i.e. the execution
returns to main program after RET is executed. Maximum 10 initial steps (S0 ~ S9) can be applied
and every initial step requires a RET instruction as an end of STL program. With the step ladder
program composed of STL/RET instructions, SFC can perform a step by step control process.
Program Example:
END
In the application of automation control, a seamless combination between electrical control and
mechanical control is required for completing an automation process. The sequential control of
automation process can be divided into several steps (states). Each step is designated with own
5-2
5 . Se q ue nt i al Fu nc ti on Cha r t
action and the transition from one step to another generally requires some transition criteria
(condition). The action of the previous step finishes as long as all criteria is true. When next step
begins, the action of previous step will be cleared. The step-by-step transition process is the
concept for designing sequential function chart (SFC).
Features:
Step jump. Used for a step to jump to another non-adjacent step. (Jumping
up/down to non-adjacent steps in the same sequence, returning to initial step, or
jumping among different sequences.)
Transition condition. The transition condition to move between each step point.
5-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Step ladder diagram (STL) is a programming method for users to write a program which functions
similar to SFC. STL provides PLC program designers a more readable and clear programming
method as drawing a flow chart. The sequences or steps in the below SFC is quite understandable
and can be translated into the ladder diagram opposite.
STL program starts with STL instruction and ends with RET instruction. STL Sn constructs a step
point. When STL instruction appears in the program, the main program will enter a step ladder
status controlled by steps. RET instruction indicates the end of a step ladder program starting from
initial steps S0 ~ S9 and every initial step requires a RET instruction as an end of STL program.
If there is no RET instruction at the end of a step sequence, errors will be detected by WPLSoft.
M1002 M1002
primary pulse SET S0
S0 S0
S SET S21
S21
S21 S SET S22
S22
S SET S23
S22
S23
S S0
S23
RET
5-4
5 . Se q ue nt i al Fu nc ti on Cha r t
3. Designate which step will take over the control from the current step
Example:
S10 S10
S Y0 S Y0
SET Y1 SET Y1
X0 X0
When X0 = ON,
SET S20 S20 = ON, SET S20
S20 S10 = OFF. S20
S Y20 S Y20
X1 X1
SET S30 SET S30
Explanation:
When S10 = ON, Y0 and Y1 will be ON. When X0 = ON, S20 will be ON and Y20 will be ON. When
S10 = OFF, Y0 will be OFF but Y1 will still be ON (SET instruction is applied on Y1, so Y1 will be ON
and latched.)
STL Transition:
When step point Sn is ON, its following output circuit will be activated. When Sn = OFF, its following
output circuit will be OFF. The interval between the activation of the step point and its following
output circuit is one scan cycle.
S10
1. Output coils of the same number could be used S Y0
in different step points.
SET Y1
2. See the diagram opposite. There can be the X0
same output device (Y0) among different steps SET S20
S20
(sequences). Y0 remains ON when S10 S Y0
transfers to S20. X1
SET S30
3. Y0 will be OFF due to the transition from S10 to
S20. However when S20 is ON, Y0 will be ON
again. Therefore in this case, Y0 remains ON
when S10 transfers to S20.
4. For general ladder diagrams, repeated usages
of output coils should be avoided. The No. of
output coil used by a step should also avoid
being used when the step ladder diagram
returns to a general ladder diagram.
5-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
SET Sn
1. Used for driving the next step in the same sequence. After the transition, all output in the
previous step will be OFF.
S10
Y0
X0
SET S12
When SET S12 executes,
S12 S10 transfers to S12 and
Y1 output Y10 in S10 will be OFF.
X1
SET S14
2. If M1014 is used, and it is On, the transfer of the steps will be prohibited, and the states of the
steps remain unchanged.
S10
S Y1 0
X0
SET S1 2
If M1040 is On, SET S12 instr uction
S12 will not be executed, the state of S 10
S Y11 unchanged, and Y10 will be O n.
X1
SET S1 4
5-6
5 . Se q ue nt i al Fu nc ti on Cha r t
OUT Sn
Used for returning to the initial step in the same step sequence. Also for jumping up/down to
non-adjacent steps in the same sequence, or separating steps in different sequences. After the
transition, all output from the previous status will be cleared.
Returning to SFC: Ladder diagram:
the initial OUT S0 Jump to another step
S0 S of step
step in the
S21 Using OUT S24
same S21 S
X2
sequence. S24
X2
Jumping S23
S
up/down to
S24 S24
OUT S Return to initial step
non-adjacent
S25 Using OUT S0
steps in the S25 S
X7
same X7 S0
sequence. S25 returns to the initial
RET
step S0 by using OUT.
5-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
If M1014 is used, and M1040 is On, the steps in the same sequence will be cleared to Off.
Ladder diagram:
S0
S Driving the jumping of step
BUS
Sn Sn Sn
S Y0 S Y0 S Y0
M0 M0
Y1 Y2 or Y1
M0 M1000
Y2 Y1 Y2
Modify the Normally open
position of M0. contact in RUN
mode
5-8
5 . Se q ue nt i al Fu nc ti on Cha r t
LD/LDI/LDP/LDF
Basic instruction
AND/ANI/ANDP/ANDF ANB/ORB
MC/MCR
OR/ORI/ORP/ORF MPS/MRD/MPP
Step point
INV/OUT/SET/RST
Diverging step General output Yes Yes No
point/
Converging Step point transfer Yes Yes No
step point
5-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S10 S10
S Y0 S Y0
SET S20 Y1
Y1 SET S20
S20 S20
S Y2 S Y2
2. As indicated in the below diagram, make sure to connect RET instruction directly after the step
point rather than the NO or NC contact.
S20 X1
S S0
RET
S20 X1
S S0
RET
1. The first step in the SFC is called the initial step", S0 ~ S9. Use the initial step as the start of a
sequence and ends with RET instruction.
2. If no STL instruction is in use, step point S can be used as a general-purpose auxiliary relay..
3. When STL instruction is in use, the No. of step S cannot be repeated.
4. Types of sequences:
Single sequence: Only one simple sequence without alternative divergence, alternative
convergence, simultaneous divergence or simultaneous convergence in the program.
Complicated single sequence: Only one sequence with alternative divergence, alternative
convergence, simultaneous divergence and simultaneous convergence in the program.
5-10
5 . Se q ue nt i al Fu nc ti on Cha r t
5. Sequence jump: Multiple sequences are allowed to be written into the step ladder diagram.
There are two sequences, S0 and S1. PLC writes in OUT OUT
S0 S1
S0 ~ S30 first and S1 ~ S43 next..
5 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Device Description
RET
END
5-12
5 . Se q ue nt i al Fu nc ti on Cha r t
2. Step Jump
a) The control power over the step is transferred to a certain step on top.
OUT
S0
OUT
S21
S42
S43
b) The control power over the step is transferred to the step in another sequence.
OUT OUT
S0 S1
S21 S41
OUT
S42
S41 S43
3. Reset Sequence
As the opposite diagram indicates, S50 will reset itself
S0
when the transition condition is fulfilled and the sequence
ends here.
S21
RST
S50
5-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
SET S22
SET S23
SET S24
S20
5-14
5 . Se q ue nt i al Fu nc ti on Cha r t
S20
X0 X1 X2
X2
S50
5-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S60
M1002
ZRST S0 S127 M1002
S1
SET S1
S1 X0 X0
S SET S20 S20 Y0
S20
S Y0
X1 X4 X7
X1
SET S30 S30 Y1 S31 Y3 S32 Y5
X4 X2 X5 X20
SET S31
S40 Y2 S41 Y4 S42 Y6
X7
SET S32 X3 X6 X21
S30
S Y1 S50 TMR T1 K10
X2
T1
SET S40
S40 S60 Y7
S Y2 X22
X3
SET S50
S1
S31
S Y3
X5
SET S41
S41
S Y4
X6
SET S50
S32
S Y5
X20
SET S42
S42
S Y6
X21
SET S50
S50
S TMR T1 K10
T1
SET S60
S60
S Y7
X22
S1
RET
END
5-16
5 . Se q ue nt i al Fu nc ti on Cha r t
M1002
ZRST S0 S127 M1002
S3
SET S3
X0
S3 X0
S SET S20 S20 Y0
S20 X1
S Y0
X1 S30 Y1 S31 Y3 S32 Y5
SET S30
X2 X3 X4
SET S31 S40 Y2 S41 Y4 S42 Y6
SET S32 X5
S30
S Y1 S50 TMR T1 K10
X2 T1
SET S40
S60 Y7
S40
S Y2 X6
S31
S Y3 S3
X3
SET S41
S41
S Y4
S32
S Y5
X4
SET S42
S42
S Y6
S40 S41 S42 X5
S S S SET S50
S50
S TMR T1 K10
T1
SET S60
S60
S Y7
X6
S3
RET
END
5-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1002
ZRST S0 S127 M1002
S4
SET S4
X0
S4 X0
S SET S20 S20 Y0
S20 X1
S Y0
X1
SET S30 S30 Y1 S31 Y3 S32 Y5
X2 X4 X6
SET S31
S40 Y2 S41 Y4 S42 Y6
SET S32 X3 X5 X7
S30
S Y1 S50 TMR T1 K10
X2
SET S40 T1
S40 S60 Y7
S Y2
X3
SET S50
S31 S4
S Y3
X4
SET S41
S41
S Y4
X5
SET S50
S32
S Y5
X6
SET S42
S42
S Y6
X7
SET S50
S50
S TMR T1 K10
T1
SET S60
S60
S Y7
X6
S4
RET
END
5-18
5 . Se q ue nt i al Fu nc ti on Cha r t
END
5-19
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
SFC Diagram:
M1002
S0 Y0
X0
S20 Y1
X1 X2 X3
S30 Y2 S31 Y3 S32 Y4
X4 X5 X6
S40 Y5 S41 Y6
X7 X20
X25 X26
S70 Y27
S0
X27
S0
5-20
5 . Se q ue nt i al Fu nc ti on Cha r t
M1002
ZRST S0 S127 M1002
SET S0 S0
S0 X0 X0
S SET S30
S30 S30 Y0
S Y0 X1
X1 X1
SET S31
S31 Y1 S32 Y2
X1
SET S32 X2 X3
S31
S Y1
S33 Y3
X2
SET S33 X4
S32
S Y2 S34 Y4 Y6
S36
X3
SET S33 X5 X6
S33 S35 S37 Y7
Y5
S Y3
X4
SET S34 X7
SET S36 S0
S34
S Y4
X5
SET S35
S35
S Y5
S36
S Y6
X6
SET S37
S37
S Y7
S35 S37 X7
S S S0
RET
END
5-21
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
SFC Diagram:
M1002
S0
X0
S20 Y0
X1 X2 X3
S30 Y1 S31 Y2 S32 Y3
X11 X12 X14
X13 SET
S40 Y11 OUT
S0
S20
X20
X44
S80 Y41
X51
SET
S0
X4 X5 X6 X7
S32 Y4 S34 Y5 S35 Y6 S36 Y7
X15 X15 X15 X16
RST
S81 Y42
X52
SET
S0
X10
S37 Y10
X17
S42 Y13
X43
S75 Y37
S76 Y40
X47
SET X50
S0 OUT
S42
5-22
5 . Se q ue nt i al Fu nc ti on Cha r t
Operands:
S: Source device for assigning pre-defined operation modes (8 consecutive devices). D1 The
smallest No. of step points in auto mode. D2: The greatest No. of step points in auto mode.
Explanations:
1. The IST is a handy instruction specifically for the initial state of the step ladder operation modes.
2. The range of D1 and D2 : S20~S911, D1 < D2.
3. IST instruction can only be used one time in a program.
Program Example 1:
M1000
IST X20 S20 S60
1. Operation mode:
S: X20: Individual operation (Manual operation) X24: Continuous operation
X21: Zero return X25: Zero return start switch
X22: Step operation X26: Start switch
X23: One cycle operation X27: Stop switch
2. When IST instruction is executed, the following special auxiliary relays will be assigned
automatically.
M1040: Movement inhibited S0: Manual operation/initial state step point
M1041: Movement start S1: Zero point return/initial state step point
M1042: Status pulse S2: Auto operation/initial state step point
M1047: STL monitor enable
3. When IST instruction is used, S10~S19 are occupied for zero point return operation and cannot
be used as a general step point. In addition, when S0~S9 are in use, S0 initiates manual
operation mode, S1 initiates zero return mode and S2 initiates auto mode. Thus, the three
step points of initial state have to be programmed in first priority.
4. When S1 (zero return mode) is initialized, i.e. selected, zero return will NOT be executed if any
of the state S10~S19 is ON.
5-23
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
5. When S2 (auto mode) is initialized, i.e. selected, auto mode will NOT be executed if M1043 =
ON or any of the state between D1 to D2 I is ON.
Program Example 2:
Robot arm control (by IST instruction):
1. Control purpose:
Select the big balls and small balls and move them to corresponding boxes. Configure the
control panel for each operation.
2. Motion of the Robot arm:
lower robot arm, clip balls, raise robot arm, shift to right, lower robot arm, release balls, raise
robot arm, shift to left to finish the operation cycle.
3. I/O Devices
Right-limit X2 Right-limit X3
Left-limit X1 (big balls) (small balls)
Y0
Upper-limit X4 Y3 Y2
Y1
Upper-limit X5
Ball size Big Small
sensor X0
4. Operation mode:
Single step: Press single button for single step to control the ON/OFF of external load.
Zero return: Press zero return button to perform homing on the machine.
Auto (Single step / One cycle operation / Continuous operation):
Single step: the operation proceeds with one step every time when Auto ON is pressed.
One cycle operation: press Auto ON at zero position, the operation performs one full cycle
operation and stops at zero point. If Auto OFF is pressed during the cycle, the operation will
pause. If Auto ON is pressed again, the operation will resume the cycle and stop at zero
point.
Continuous operation: press Auto ON at zero position, the operation will perform continuous
operation cycles. If Auto OFF is pressed, the operation will stop at the end of the current
cycle.
5-24
5 . Se q ue nt i al Fu nc ti on Cha r t
5. Control panel
Clip Right
balls Ascend Shift Step X32
7. Manual mode:
S0 X20
S SET Y4 Clip balls
X21
RST Y4 Release balls
X22 Y1
Y0 Raise robot arm
X23 Y0 Interlock
Y1 Lower robot arm
X24 X4 Y3
Y2 Shift to right Y2 and Y3 interlocked and
X25 X4 Y2 X4 = ON is the condition
Y3 Shift to left for output Y2 and Y3
5-25
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
S1
X35
S10 RST Y4 Release balls
b) Ladder Diagram:
S1 X35
S SET S10 Enter zero return mode
S10
S RST Y4 Release balls
Y3
X1 Shift to left and to reach
SET S12 the left-limit (X1 = On)
S12
S SET M1043 Enable zero return completed flag
5-26
5 . Se q ue nt i al Fu nc ti on Cha r t
S2
M1041
M1044
S20 Y1
X5 X5
X0 X0
S30 SET Y4 S40 SET Y4
TMR T2 K30
T2
X4
S70 Y0
X4
X1
S80 Y3
X1
S2
5-27
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
b) Ladder Diagram:
S2 M1041 M1044
S SET S20 Enter auto operation mode
S20
S Y1 Lower robot arm
X5 X0
SET S30
X5 X0
SET S40
S30
S SET Y4 Clip balls
TMR T0 K30
T0
SET S31
S31 X4
Raise robot arm to the
S Y0 upper-limit (X4 = ON)
X4
SET S32
S32 X2
S Y2 Shift to right
X2
SET S50
S40
S SET Y4 Clip balls
TMR T1 K30
T1
SET S41
S41 X4
S Y0 Raise robot arm to the
upper-limit (X4 = ON)
X4
SET S42
S42 X3
S Y2 Shift to right
X3
SET S50
S50 X5
S Y1 Lower robot arm
X5
SET S60
S60
S RST Y4 Release balls
TMR T2 K30
T2
SET S70
S70 X4
S Y0 Raise robot arm to the
upper-limit (X4 = ON)
X4
SET S80
S80 X1
S Y3 Shift to left to reach
the left-limit (X1 = On)
X1
S2
RET
END
5-28
Troubleshooting
This chapter offers error code table and information for troubleshooting during PLC operation.
Chapter Contents
6.1 Common Problems and Solutions ...................................................................................... 6-2
6.2 Error code Table (Hex) ......................................................................................................... 6-4
6.3 Error Detection Devices ...................................................................................................... 6-6
6-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O pe r a t i on Ma n ua l - Pr ogr am m i ng
The following tables list some common problems and troubleshooting procedures for the PLC system
in the event of faulty operation.
System Operation
Symptom Troubleshooting and Corrective Actions
All LEDs are OFF 1. Check the power supply wiring.
2. Check If the power supplied to the PLC control units is in the range of
the rating.
3. Be sure to check the fluctuation in the power supply.
4. Disconnect the power supply wiring to the other devices if the power
supplied to the PLC control unit is shared with them.
If the LEDs on the PLC control unit turn ON at this moment, the
capacity of the power supply is not enough to control other devices
as well. Prepare another power supply for other devices or increase
the capacity of the power supply.
5. If the POWER LED still does not light up when the power is on after
the above corrective actions, the PLC should be sent back to the
dealer or the distributor whom you purchased the product from.
ERROR LED is 1. If the ERROR LED is flashing, the problem may be an invalid
flashing commands, communication error, invalid operation, or missing
instructions, error indication is given by self-checking function and
corresponding error code and error step are stored in special
registers. The corresponding error codes can be read from the
WPLSoft or HPP. Error codes and error steps are stored in the
following special registers.
Error code: D1004
Error step: D1137
2. If the connections between the PLC are failed and the LED will flash
rapidly, this indicates the DC24V power supply is down and please
check for possible DC24V overload.
3. The LED will be steady if the program loop execution time is over the
preset time (set in D1000), check the programs or the WDT (Watch
Dog Timer). If the LED remains steady, download user program
again and then power up to see if the LED will be OFF. If not, please
check if there is any noise interference or any foreign object in the
PLC.
6-2
6 . Tr o ubl e s hoo t i ng
6-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O pe r a t i on Ma n ua l - Pr ogr am m i ng
After you write the program into the PLC, the illegal use of operands (devices) or incorrect syntax in
the program will result in flashing of ERROR indicator and M1004 = ON. In this case, you can find out
the cause of the error by checking the error code (hex) in special register D1004. The address where
the error occurs is stored in the data register D1137. If the error is a general loop error, the address
stored in D1137 will be invalid.
Error code Description Action
0001 Operand bit device S exceeds the valid range
0002 Label P exceeds the valid range or duplicated
0003 Operand KnSm exceeds the valid range
0102 Interrupt pointer I exceeds the valid range or duplicated
0202 Instruction MC exceeds the valid range
0302 Instruction MCR exceeds the valid range
0401 Operand bit device X exceeds the valid range
0403 Operand KnXm exceeds the valid range
0501 Operand bit device Y exceeds the valid range
0503 Operand KnYm exceeds the valid range
0601 Operand bit device T exceeds the valid range
0604 Operand word device T register exceeds limit
Check D1137 (Error
0801 Operand bit device M exceeds the valid range step number)
0803 Operand KnMm exceeds the valid range
Re-enter the
0B01 Operand K, H available range error
instruction correctly
0D01 DECO operand misuse
0D02 ENCO operand misuse
0D03 DHSCS operand misuse
0D04 DHSCR operand misuse
0D05 PLSY operand misuse
0D06 PWM operand misuse
0D07 FROM/TO operand misuse
0D08 PID operand misuse
0D09 SPD operand misuse
0D0A DHSZ operand misuse
0D0B IST operand misuse
0E01 Operand bit device C exceeds the valid range
0E04 Operand word device C register exceeds limit
0E05 DCNT operand CXXX misuse
6-4
6 . Tr o ubl e s hoo t i ng
6-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O pe r a t i on Ma n ua l - Pr ogr am m i ng
Device D1067
Description
Error Code
0E18 BCD conversion error
0E19 Division error (divisor=0)
0E1A Floating point exceeds the usage range
0E1B The value of square root is negative
6-6
CANopen Function and Operation
Chapter Contents
7-1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-2
7 CANope n Fun c t i o n a nd O pe r a t i on
L1 61.5
L 78
Unit: millimeter
7-3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Pin Description Wh i te ( CA N_ H)
B l u e ( CA N_ L )
CA N+
CA N-
CAN+ CAN-H
SG
D+
CAN- CAN-L B l a ck( S G ) D-
Recessive Dominant
7-4
7 CANope n Fun c t i o n a nd O pe r a t i on
The data frame format is shown below. The CAN nodes transmit the CAN messages to the network
from left to right, as the data frame format below shows.
7-5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
1) Users should use standard Delta cables when creating the CANopen network. These cables
are the thick cable TAP-CB01, the thin cable TAP-CB02, and the thin cable TAP-CB10. The
communication cables should be away from the power cables.
2) TAP-TR01. CAN+ and CAN-, which are at the endpoints of the network, should be connected
to 120 ohm resistors. Users can purchase the standard Delta terminal resistor TAP-TR01.
3) The limitation on the length of the CANopen network
The transmission distance of the CANopen network depends on the transmission rate of the
CANopen network. The relation between the transmission rate and the maximum
communication distance is shown in the following table.
Transmission rate
20K 50K 125K 250K 500K 1M
(bit/second)
Maximum
communication 2500 1000 500 250 100 25
distance (meter)
4) The Delta network products related to the CANopen network are listed below.
Product Model Function
7-6
7 CANope n Fun c t i o n a nd O pe r a t i on
7-7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-8
7 CANope n Fun c t i o n a nd O pe r a t i on
CAN network
7-9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Mode 0: The PDO information is transmitted only when the PDO data changes and the
synchronous signal comes.
Modes 1~240: One piece of PDO information is transmitted every 1~240 synchronous
signals.
Mode 254: The trigger is defined the manufacturer. The definition of the PLC is the same as
mode 255.
Mode 255: PDO is transmitted when the data changes, or it is transmitted after a trigger.
7-10
7 CANope n Fun c t i o n a nd O pe r a t i on
All the data in the PDO has to be mapped from the object dictionary. The following is an
example of the PDO mapping.
1 yyyyh yyh 8
3 xxxxh xxh 8
7 - 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
(1)
Initializing
Initialization (15)
Reset application
(16)
Reset communication
(11)
(2)
(14)
Pre-operational
(7) (10)
(3) (4)
(5)
(13) Stopped
(6)
(8)
(12) (9)
Operational
(1) After the power is supplied, the device automatically enters the initialization state.
(2) After the initialization is complete, the device automatically enters the Pre-operational
state.
(3)(6) The remote node is started.
(4)(7) The device enters the Pre-operational state.
(5)(8) The remote node is stopped.
(9)(10)(11) The application layer is rest.
(12)(13)(14) The communication is reset.
(15) After the initializing is complete, the device automatically enters the reset application
state.
(16) After the reset application state is complete, the device automatically enters the
7-12
7 CANope n Fun c t i o n a nd O pe r a t i on
7-13
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Request Receiving
Receiving
Heartbeat Receiving
producing
time Heartbeat
timeout
period
Reuqest
Heartbeat
timeout
period
Heartbeat evnet
Boot-up services
After the slave completes the initialization and enters the pre-operational state, it transmits
the Boot-up message.
Other predefined CANopen communication objects (SYNC and EMCY)
SYNC Object (Synchronous object)
The synchronous object is the message broadcasted periodically by the master node in the
CANopen network. This object is used to realize the network clock signal. Every device
decides whether to use the event and undertake the synchronous communication with other
network devices according to its configuration. For example, when controlling the driving
device, the devices do not act immediately after they receive the command sent by the
master. They do act until they receive the synchronous message. In this way, many devices
can act synchronously.
7-14
7 CANope n Fun c t i o n a nd O pe r a t i on
Emergency object
The emergency object is used by the CANopen device to indicate an internal error. When
an emergency error occurs in the device, the device sent the emergency message
(including the emergency error code), and the device enters the error state. After the error
is eliminated, the device sends the emergency message, the emergency error code is 0,
and the device enters the normal state.
The format of the emergency message:
COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
Emergency error
80 (hex) Error
code Factory-defined error code
+Node-ID register
LSB MSB
Note: The value in the error register is mapped to index 1001 (hex) in the object dictionary.
If the value is 0, no error occurs. If the value is 1, a normal error occurs. If the value is
H80, an internal error occurs in the device.
7.3.3 The Predefined Connection Set
In order to decrease the configuration workload of the network, CANopen defines a default
identifier. In the predefine connection set, the structure of the 11-bit identifier is as follows.
The objects which are supported and the COB-IDs which are assigned to the objects are listed
below.
The broadcast object in the predefined connection setting
Index of the
Object Function code COB-ID communication
parameter
NMT 0000 0 -
SYNC 0001 128 (80h) 1005h, 1006h, 1007h
Time stamp 0010 256 (100h) 1012h, 1013h
The corresponding object in the predefined connection set
Index of the
Object Function code COB-ID communication
parameter
Emergency 0001 129 (81h)255 (FFh) 1014h, 1015h
PDO1 (TX) 0011 385 (181h)511 (1FFh) 1800h
PDO1 (RX) 0100 513 (201h)639 (27Fh) 1400h
PDO2 (TX) 0101 641 (281h)767 (2FFh) 1801h
PDO2 (RX) 0110 769 (301h)895 (37Fh) 1401h
PDO3 (TX) 0111 879 (381h)1023 (3FFh) 1802h
PDO3 (RX) 1000 1025 (401h)1151 (47Fh) 1402h
PDO4 (TX) 1001 1153 (481h)1279 (4FFh) 1803h
PDO4 (RX) 1010 1281 (501h)1407 (57Fh) 1403h
SDO (TX) 1011 1409 (581h)1535 (5FFh) 1200h
SDO (RX) 1100 1537 (601h)1663 (67Fh) 1200h
7-15
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Index of the
Object Function code COB-ID communication
parameter
NMT Error
1110 1793 (701h)1919 (77Fh) 1016h, 1017h
Control
7.4 Sending SDO, NMT and Reading Emergency Message through the
Ladder Diagram
Editing the request message mapping area can realize the transmission of SDO, NMT and
Emergency message.The corresponding relations between the request message mapping area,
response message mapping area and PLC device are shown below.
PLC device Mapping area Mapping length
SDO request message, NMT service message and
D6250~D6281 64 bytes
Emergency request message
SDO response message and Emergency response
D6000~D6031 64 bytes
message
1> CANopen master can only send one SDO, NMT or Emergency request message to the same
equipment at a time.
2> We suggest the request message mapping area should be cleared to zero when sending
SDO, NMT or Emergency request message through WPL program.
7.4.1 Data Structure of SDO Request Message
Sending SDO through the ladder diagram can read or write the slave parameter.
The data format of the SDO request message:
Request message
PLC device
High byte Low byte
D6250 ReqID Command (Fixed to 01)
Message Size
D6251 Reserved
Header
D6252 Type Node ID
D6253 High byte of main index Low byte of main index
D6254 Reserved Sub-index
D6255 Message Data Datum 1 Datum 0
D6256 Datum 3 Datum 2
D6257 ~ D6281 Reserved
7-16
7 CANope n Fun c t i o n a nd O pe r a t i on
Response message
PLC device
High byte Low byte
D6001 Header Reserved Size
D6002 Type Node ID
D6003 High byte of main index Low byte of main index
D6004 Reserved Sub-index
D6005 Message Data Datum 1 Datum 0
D6006 Datum 3 Datum 2
D6007 ~ D6031 Reserved
Status code:
The indication of the status code values in the response message:
7-17
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Response data:
Response message
PLC device
High byte(Hex) Low byte(Hex)
D6000 ResID =01 Command =01
Message
D6001 Reserved =0 Size =4
Header
D6002 Type =60 Node ID =03
D6003 Main index high byte =21 Main index low byte =09
D6004 Message Reserved =0 Subindex =0
D6005 data Datum 1=00 Datum 0=00
D6006 Datum 3=00 Datum 2=00
Example 2: Read the value of (Index_subindex) 2109_0 of slave of No. 3 through SDO and
the data type of (Index_subindex) 2109_0 is double words (32 bits).
Request data:
Request message
PLC device
High byte(Hex) Low byte(Hex)
D6250 ReqID =01 Command =01
Message
D6251 Reserved =0 Size =4
Header
D6252 Type =01 Node ID =03
D6253 Main index high byte =21 Main index low byte =09
D6254 Message Reserved =0 Subindex =0
D6255 data Datum 1=0 Datum 0=0
D6256 Datum 3=0 Datum 2=0
Response data:
Response message
PLC device
High byte(Hex) Low byte(Hex)
D6000 ResID =01 Command =01
Message
D6001 Reserved =0 Size =8
Header
D6002 Type =43 Node ID =03
D6003 Main index high byte =21 Main index low byte =09
D6004 Message Reserved =0 Subindex =0
D6005 data Datum 1=03 Datum 0=E8
D6006 Datum 3=01 Datum 2=02
7.4.2 Data Structure of NMT Message
NMT service can be used managing the CANopen network such as start, operation, reset of nodes
and etc.
The data format of the NMT request message:
Request message
PLC device
High byte Low byte
D6250 ReqID Command (Fixed to 01)
Message
D6251 Reserved Size (Fixed to 04)
Header
D6252 Type (Fixed to 03) Node ID
D6253 Message Reserved NMT service code
D6254 data Reserved Node ID
Command: Fixed to 01.
ReqID: The request ID. Whenever an NMT request message is sent out, the message will
be given a ReqID for the CANopen master to identify. Before another NMT request message
7-18
7 CANope n Fun c t i o n a nd O pe r a t i on
is sent out, the original ID number must be changed. In other words, to send out the NMT
request message is triggered by changing of the value of ReqID. ReqID range: 00 (Hex) ~
FF (Hex).
Node ID: The node address of the target equipment on CANopen network. (0: Broadcast)
NMT service code:
NMT service code (Hex) Function
01 Start remote node
02 Stop remote node
80 Enter the pre-operational state
81 Reset application
82 Reset communication
The data format of the NMT Response message:
Response message
PLC device
High byte Low byte
D6000 ResID Status code
Message
D6001 Reserved Reserved
header
D6002 Reserved Node ID
When status code is 1, it indicates that NMT operation succeeds. When status code is not
equal to1, it indicates that NMT operation fails and in the meantime, you should check if the
data in NMT request message are correct.
Node ID: The node address of the target equipment on CANopen network.
Example 1: Stop slave of No. 3 through NMT
Request data:
Request message
PLC device
High byte(Hex) Low byte(Hex)
D6250 ReqID =01 Command =01
Message
D6251 Reserved =0 Size =04
header
D6252 Type =03 Node ID =03
D6253 Message Reserved NMT service code =02
D6254 data Reserved Node ID =03
Response data:
Response message
PLC device
High byte(Hex) Low byte(Hex)
D6000 ResID=01 Status code =01
Message
D6001 Reserved =0 Reserved =0
header
D6002 Reserved =0 Node ID =03
7.4.3 Data Structure of EMERGENCY Request Message
Through reading Emergency, the slave error and alarm information can be read.
The data format of the Emergency request message:
Request message
PLC device
High byte Low byte
D6250 ReqID Command (Fixed to 1)
Message
D6251 Reserved Size (Fixed to 0)
header
D6252 Type (Fixed to 04) Node ID
Message
D6253~D6281 Reserved
data
Command: Fixed to 01.
ReqID: The request ID. Whenever an Emergency message is sent out, the message will be
given a ReqID for the CANopen master to identify. Before another Emergency request
7-19
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
message is sent out, the original ID number must be changed. In other words, to send out
the Emergency request message is triggered by changing of the value of ReqID. ReqID
range: 00 (Hex) ~ FF (Hex).
Node ID: The node address of the target equipment on CANopen network.
The data format of the Emergency response message:
Response message
PLC device
High byte(Hex) Low byte(Hex)
D6000 ResID Status code
Message
D6001 Reserved Size Fixed to 2A
header
D6002 Type (Fixed to 04) Node ID
D6003 Total number of data Number of data stored
D6004 Datum 1 Datum 0
D6005 Datum 3 Datum 2
D6006 Datum 5 Datum 4
D6007 Message Datum 7 Datum 6
D6008 ~ D6011 data Emergency2
D6012 ~ D6015 Emergency3
D6016 ~ D6019 Emergency4
D6020~ D6023 Emergency5
D6024~ D6031 Reserved
Command: Fixed to 01(Hex).
When status code is 1, it indicates that reading Emergency message succeeds. When status
code is not equal to1, it indicates that reading Emergency message fails and in the
meantime, you should check if the data in Emergency message are correct.
Node ID: The node address of the target equipment on CANopen network.
Total number of data: The total number of Emergency messages CANopen master receives
from the slave.
Number of data stored: The latest number of Emergency messages CANopen master
receives from the slave. (5 messages at most)
The data in D6004-D6007 are the content of Emergency 1 and every Emergency message
consists of 8 bytes of data.
The data format of Emergency message on CAN bus is shown below. Datum 0~ datum 7 in
Emergency response message correspond to byte 0~ byte 7 respectively
COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
80hex Emergency error Error storage
Vendor custom error code
+Node-ID code register
Example 1: Read the Emergency message of slave of No.2 and the Emergency messages
the slave sends out successively are shown below.
COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
82hex 43 54 20 14 0 0 0 0
7-20
7 CANope n Fun c t i o n a nd O pe r a t i on
RS-232
CAN+ CAN- SG D+ D - UP0 ZP0 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 UP1 ZP1 Y10 Y11 Y12 Y13 Y14 Y15 Y16 Y17
ASDA-A2-xxxx-M
TAP-CN03
CANopen
CANopen
7-21
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
When M0=ON, DVP-ES2-C sends out the first request message and D6000 should be
101(hex) after the response message is transmitted back successfully. In program, if the
7-22
7 CANope n Fun c t i o n a nd O pe r a t i on
value of D6000 is judged as 101(hex), the ReqID is changed into 2 and D6250 is given a new
value 201(hex) and DVP-ES2-C sends out the request message again. By dong so, the
real-time reading can be realized. After reading succeeds, the data returning from the target
device are stored in D6000~D6005. The value of D6005: 100hex is the read value of P0-09.
Explanation of Response Message Devices:
Content Explanation
PLC device
(Hex) High byte(Hex) Low byte(Hex)
D6000 0101 ResID = 01 Status code = 01
SDO D6001 0008 Reserved Size = 08
response D6002 4302 Type = 43 Node ID = 02
message D6003 2009 Main index high byte = 20 Index low byte = 09
mapping D6004 0004 Reserved Subindex = 00
area D6005 0100 Datum 1= 01 Datum 0= 00
D6006 0100 Datum 3= 00 Datum 2= 00
7.5 Indicators and Troubleshooting
There are 6 LED indicators on DVP-ES2-C. Power indicator shows whether the power is normal,
RUN and ERROR indicator display the state of running of internal program and COM3 displays the
communication state of CANopen.
7.5.1 Description of Indicators
POWER indicator
LED indicator Description How to deal with
Light is off or
The supply power is
the green light Check if the supply power is in the valid range
abnormal
flashes
The green The supply power is
No resolution is required
light keeps on normal
RUN indicator
LED indicator Description How to deal with
The green
PLC is running No resolution is required
light is on.
Make PLC run through RUN/STOP switch or
Light is off PLC is in stop status
WPLSoft
ERROR indicator
LED indicator Description How to deal with
Light is off PLC is normal No resolution is required
There are syntax
Judge the error cause according to the content
error existing in the
value of the special register D1004 in PLC; find
program written to
The red light the program error position according to the
PLC or the PLC
flashes. content value of D1137. For more details on the
device or instruction
error codes in D1004, please refer to ES2 series
is out of the allowed
PLC operation manual (Programming).
range.
The red light PLC scan is Reduce the time for executing PLC program or
keeps on. timed-out use WDT instruction
COM3CANopenIndicator
LED indicator Description How to deal with
The green DVP-ES2-C is
No resolution is required
light keeps on. normal.
The green The superior equipment is downloading the
light is in DVP-ES2-C stops. network configuration and waiting to complete
single flash. downloading.
7-23
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-24
7 CANope n Fun c t i o n a nd O pe r a t i on
7-25
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
RS-232
CAN+ CAN- SG D+ D - UP0 ZP0 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 UP1 ZP1 Y10 Y11 Y12 Y13 Y14 Y15 Y16 Y17
ASDA-A2-xxxx-M
TAP-CN03
CANopen
CANopen
Note:
1. We recommend user use the standard communication cable TAP-CB01/TAP-CB02/ TAP-CB10
and connect the terminal resistors such as Delta standard terminal resistor TAP-TR01 to either
terminal of the network when constructing the network.
2. TAP-CN03 is a distribution box and the resistance it has can be effective after its SW1 is
switched to ON. According to actual demand, user could select TAP-CN01/CN02/CN03 for
wiring.
3. M of ASD-A2-xxxx-M refers to the model code and currently only the M-model servo supports
CANopen communication.
Setting Servo Parameters:
Set servo parameters as follows:
Parameter Setting Explanation
3-00 02 The Node ID of A2 servo is 2
3-01 400 CAN communication rate is 1Mbps.
1-01 04 Speed mode
0-17 07 Drive displays the motor rotation speed (r/min)
2-10 101 Set DI1 as the signal for Servo On
2-12 114 Set DI3 and DI4 as the signal for speed selection
7-26
7 CANope n Fun c t i o n a nd O pe r a t i on
2) The following window will appear where to set up the serial port communication
parameters.
7-27
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
1> When CANopen Slave displays in the Name column, it indicates that PLC is in the
mode of CANopen slave. At that time, select Simulated online on the bottom left side
on the page and finally click OK to start the online scanning.
2> When CANopen Master displays in the Name column, it indicates that PLC is in the
mode of CANopen master. At that time, directly click OK to start the online scanning.
4) Click Network> Master Parameter and the following Master configure dialog box
appears.
7-28
7 CANope n Fun c t i o n a nd O pe r a t i on
Note:
The new parameters after being downloaded will be effective unless DVP-ES2-C is
re-powered.
7-29
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Network Scanning:
Scan the master and slave on the CANopen network by clicking menu Network>>Online.
The scanned master and slave are displayed on the page below. For detailed operation steps,
please refer to Section 11.1.1 in the help file of CANopen Builder software.
Node Configuration:
Double click the slave icon on the above page and then the following Node configuration
dialog box pops up.
Error Control Protocol
Used for setting the error control protocol for master to monitor if the slave is offline.
Auto SDO Configuration
Used for doing one write action to the slave parameter via SDO and the write action is
finished when the slave enters the operational state from pre-operational state. Up to 20
SDOs can be configured by Auto SDO configuration.
PDO Mapping and Properties
Used for setting the mapping parameter and transmission type of PDO.
For the details on the function buttons mentioned above, please refer to Section 11.1.1 in
the help file of CANopen Builder software.
7-30
7 CANope n Fun c t i o n a nd O pe r a t i on
PDO Mapping:
RxPDO1: the mapping parameter P1-09; transmission type 255.
RxPDO2: the mapping parameter P3-06, P4-07; transmission type 255.
TxPDO1: the mapping parameter P0-09; transmission type 1.
PDO transmission type :
PDO can be classified into RxPDO and TxPDO. RxPDO data are sent from master to slave
and TxPDO data are sent from slave to master.
PDO transmission type can be synchronous transmission and asynchronous transmission.
In synchronous transmission, master will send out the SYNC message in the fixed cycle.
The length of the cycle is set in master properties dialog box with the default value: 50ms.
In asynchronous transmission, the message is sent out once the PDO mapping parameter
is changed.
7-31
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-32
7 CANope n Fun c t i o n a nd O pe r a t i on
Program explanation:
While DVP-ES2-C is running for the first time, set the parameter P3-06 of servo drive to F.
When M0 turns from OFF to ON, write K256 to D6282 and then the value is written to P1-09
of servo parameter through RxPDO1.
When M1 turns from OFF to ON, turn P2-12 on and call the speed specified by parameter
P1-09 of servo for rotation.
When M1 turns from ON to OFF, the speed command becomes 0 and the motor stops
running.
7-33
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-34
7 CANope n Fun c t i o n a nd O pe r a t i on
7-35
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-36
7 CANope n Fun c t i o n a nd O pe r a t i on
7-37
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-38
7 CANope n Fun c t i o n a nd O pe r a t i on
7-39
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
7-40
7 CANope n Fun c t i o n a nd O pe r a t i on
7-41
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
MEMO
7-42
Appendix
Installing a USB Driver in the PLC
Contents
A.1 Installing the USB Driver in Windows 7 .............................................................................. A-2
A.2 Installing the USB in Windows 8 ......................................................................................... A-4
A.3 Installing the USB Driver in Windows 10 ............................................................................ A-7
A- 1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
This section introduces the installation of the DELTA PLC USB driver in the computer. After the
driver is installed, the USB interface can be used as the serial port (RS-232). Please use the
standard USB cable. The length of the cable should be within fiver meters.
Click the right mouse button, and select Update Driver to open the Hardware Update Wizard
window. Click Browse to specify the folder, and then click Next to start the installation of the driver.
A- 2
Appe dn di x A I ns ta ll i ng a USB Dr i v e r i n t h e PLC
After the driver is installed, users can find the Delta PLC device and the communication port
assigned to it in the Device Manger window. The usage of this device is the same as that of
RS-232.
A- 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&TP O p e r a t i on Ma n ua l - Pr ogr am m i ng
Select Communication Setting in Options to open the Communication Setting window. Select
RS232 in the Connection Setup box, select the communication port assigned by the USB in the
Communication Setting box, and click OK. After the communication setting is complete, users
can find that RS232 in the communication work area is checked. They can download the program
to the PLC and upload the program from the PLC through the USB, and can use the online mode.
Windows 8 driver signature enforcement provides a way to improve the security of the operating system
by validating the integrity of a driver or system file each time it is loaded into memory. However since Delta
PLC USB driver does not include the driver signature, this section will help users to disable driver signature
enforcement functionality in Windows 8 to ensure a success Delta PLC USB installation. This act is only valid
for a single time. The setting will return to its original state after restarting.
A- 4
Appe dn di x A I ns ta ll i ng a USB Dr i v e r i n t h e PLC
1. Press the button WIN+I on the keyboard to see the Setting interface. Click Change PC
settings.
2. The PC settings window will appear. Select General and then Restart now under Advanced startup.
A- 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&TP O p e r a t i on Ma n ua l - Pr ogr am m i ng
3. After the computer is restarted, select Troubleshoot under Choose an option. And then select
Advanced options.
4. From the Advanced options page, select Startup Settings to see the Startup Settings. From this page
select Restart to restart the computer.
5. Press 7 or F7 to choose Disable driver signature enforcement and the system will direct you to the
Windows 8 operating page. Users can then install the Delta PLC USB driver now.
A- 6
Appe dn di x A I ns ta ll i ng a USB Dr i v e r i n t h e PLC
Windows 10 driver signature enforcement provides a way to improve the security of the operating system
by validating the integrity of a driver or system file each time it is loaded into memory. However since Delta
PLC USB driver does not include the driver signature, this section will help users to disable driver signature
enforcement functionality in Windows 10 to ensure a success Delta PLC USB installation. This act is only valid
for a single time. The setting will return to its original state after restarting.
1. Please follow the instructions A (Setting) => B (Update & Security) => C (Recovery) => D (Restart now)
A- 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&TP O p e r a t i on Ma n ua l - Pr ogr am m i ng
2. After the computer is restarted, select Troubleshoot under Choose an option. And then select
Advanced options.
3. From the Advanced options page, select Startup Settings to see the Startup Settings. From this page
select Restart to restart the computer.
4. Press 7 or F7 to choose Disable driver signature enforcement and the system will direct you to the
Windows 10 operating page. Users can then install the Delta PLC USB driver now.
5. For the installation of the USB driver, please refer to section A1 for more information.
A- 8
Appendix
Setting and Using an Ethernet PLC/Module
Contents
B- 1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
The specifications for a DVP series Ethernet port and the functions of a DVP series Ethernet port
are listed below.
Specifications for an Ethernet interface:
Item Specifications
Interface RJ-45 with Auto MDI/MDIX
Number of ports 1 Port
Transmission method IEEE802.3, IEEE802.3u
Transmission cable Category 5e
Transmission rate 10/100 Mbps Auto-Defect
Protocol ICMP, IP, TCP, UDP, DHCP, SMTP, NTP, MODBUS TCP
Ethernet functions:
DVP-FEN01
DVP-SE / ES2-E
Function DVPEN01-SL (Function card for a
Series
DVP-EH3 series PLC)
MODBUS/TCP Master & Slave Master & Slave Master & Slave
Number of servers 16 16 4
connected
Number of clients 8 16 4
connected
Number of devices
8 24 8
exchanging data
RTU mapping 4 4 -
E-mail - 4 -
SNMP - 2 -
IP filter 4 8 4
FEN01 communication
Ethernet port in
card
Model name DVP-SE / ES2-E DVPEN01-SL
(Applicable to a
Series
DVP-EH3 series MPU)
FROM/TO station Please refer to
K108 K108
address Example 1.
In order to control and monitor Ethernet communication, users can read the data in the control
registers listed below by means of the instruction FROM, and write data into the control registers
listed below by means of the instruction TO. (Please refer to the explanation of API 78 and that of
API 79 in chapter 3 for more information about FROM/TO.)
[Note] Please refer to DVPEN01-SL Manual for more information about control registers.
B- 2
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
CR number
Attribute Register name Description
HW LW
#12~#0 - Reserved
Enabling the data Users can set CR#13 to sending the data or not
#13 R/W
exchange sending the data.
Writing function of the 0: The PLC writes data continually.
#14 R/W
RTU mapping 1: The PLC writes data when the input changes.
Enabling flag for RTU
#15 R/W 1: Enable; 0: Disable. Default = 1
mapping
b0: Status of RTU slave 1
Connection status of b1: Status of RTU slave 2
#16 R/W
RTU mapping slave b2: Status of RTU slave 3
b3: Status of RTU slave 4
Execution cycle of the
#17 R/W Time unit: ms
data exchange
#18 - Reserved
If the value of a bit is 1, an error occurs in the
States of the slaves
slave corresponding to the bit.
#19 R involved in the data
b[0:7] indicate the states of the slaves 1~8
exchange
involved in the data exchange.
#26~#20 - Reserved
0: The function code for the reading of data and
the writing of data is 17.
Function code for a 1: The function codes for the reading of data is
#27 R/W
data exchange mode 03, the function code for the writing of a single
piece of data is 06, and the function code for the
writing of multiple pieces of data is 10.
#86~#28 - Reserved
IP address setting 0: Static IP
#87 R/W
mode 1: DHCP
When the IP address is 192.168.1.5, the data in
#89 #88 R/W IP address
CR#89 is 192.168, and the data in CR#88 is 1.5.
When the mask address is 255.255.255.0 the data
#91 #90 R/W Mask address in CR#91 is 255.255, and the data in CR#90 is
255.0.
When the GIP address is 192.168.1.1, the data in
#93 #92 R/W Gateway IP address
CR#89 is 192.168, and the data in CR#88 is 1.1.
Enabling the IP 0: The setting of the IP address is not executed.
#94 R/W
address setting 1: The setting of the IP address is executed.
0: The setting is unfinished.
IP address setting
#95 R 1: The setting is being executed.
status
2: The setting is complete.
#113~#96 - Reserved
Setting up MODBUS TCP time-out (in ms)
#114 R/W MPDBUS TCP time-out
Default: 3000
Setting up whether to send out data in MODBUS
#115 R/W MODBUS TCP trigger
TCP mode
#116 R/W MODBUS TCP status Displaying current status of MODBUS TCP mode
MODBUS TCP Setting up destination IP address for MODBUS
#118 #117 R/W
destination IP TCP transaction
MODBUS TCP data Setting up the data length for MODBUS TCP
#119 R/W
length transaction
MODBUS TCP data Data buffer of MODBUS TCP for storing
#219~#120 R/W
buffer sending/receiving data
#248~#220 - Reserved
#249 R Sub-version
#250 R Update date 0xC820 (April 8, 2012)
B- 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
CR number
Attribute Register name Description
HW LW
Displaying the errors. See the error code table for
#251 R Error code
more information.
#255~#252 - Reserved
Symbols R refers to able to read data by FROM instrcution; W refers to able to write data by
TO instrcution.
B- 4
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
B- 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
This section introduces how to search for and set an Ethernet PLC by DCISoft. Before you start a
setup page, you have to select Ethernet in the Communication Setting window. Next, you can
B- 6
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
search by a broadcast, or an IP address. An Ethernet PLC is set up by UDP port 20006; therefore,
you have to be aware of the relevant settings of the firewall.
(1) Start DCISoft in your PC, and click Communication Setting on the Tools menu.
B- 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
(1) Click Search on the toolbar in DCISoft to search for all Delta Ethernet products on the network.
The window on the left hand side shows the models found, and the window on the right hand
side displays the device list of all models.
(2) Click a model on the left hand side, and you will see the device list of the model selected on the
right hand side. Click the device to be set up to enter the setup page.
B- 8
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
(1) Right-click Ethernet in the left hand side window, and click Configure to designate a model to
be searched for.
B- 9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
(2) After users select a model which will be searched for, they can click OK to auto-search for the
model on the network. In the window shown below, the DVPEN01-SL checkbox is selected.
(3) A list of specified devices is in the window. If the users have selected several models, they can
view these models.
B- 1 0
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
(1) Select Ethernet in the Type drop-down list box, type an IP address in the IP Address box, and
click OK.
(2) Click Search on the toolbar to start searching for the designated IP address.
(3) The model found will be displayed in the right hand side window. Double-click the device to
enter the setup page.
B- 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
A Delta Ethernet master can read/write data from/into a slave by means of instructions. It can also
read/write data from/into a slave by means of tables. The number of data exchanges that models
provide is different. Please refer to section B.1 for more information about the number of devices
exchanging data.
(1) Enable:
Users can enable or disable a data exchange. After a data exchange is enabled, the data will
be exchanged.
(2) Enable Condition:
You can select Always Enable or Program Control. If Always Enable is selected,
DVPEN01-SL will execute data exchange continuously until the setting in DCISoft is changed.
If Program Control is selected, DVPEN01-SL will execute data exchange according to the
program setting. The internal registers in different models used to enable data exchanges are
different. Please refer to section B.2 for more information.
(In DVPEN01-SL, the data exchange is executed if CR#13=2, and the data exchanged is not
executed if CR#13=0.)
(3) Station Address-IP Address:
You have to type the IP address of a slave. If the IP address of a slave is 192.168.0.1, and the
station number of the slave is 1, you can type 1 in the first Station Address cell, select the box
in the first Enable cell, and type 192.168.0.1 in the first IP Address cell.
(4) Master Device, Slave Device, and Quantity:
Reading (): Initial reception register in a masterInitial transmission register in a slave
Writing (): Initial transmission register in a master Initial reception register in a slave
If a data exchange is enabled, the Ethernet PLC will write data, and then read data.
Quantity: A slave station can send 100 pieces of data at most and receive 100 pieces of data at
most simultaneously.
If a device which is not a Delta PLC is connected, users can type a hexadecimal four-digit
MODBUS absolute position in the Slave Device cell.
EtherNet/IP is a communication protocol defined by ODVA, and is different from the Ethernet
mentioned in the previous sections. DVP-SE / ES2-E Series PLCs (whose version are 1.20 or
above) supports the EtherNet/IP slave communication protocol. The other DVP series PLCs can
communicate with products related to EtherNet/IP through IFD9507 (an EtherNet/IP-MODBUS
converter). The EtherNet/IP objects which are supported are described below.
B- 1 2
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
B- 1 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
B- 1 4
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
B- 1 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
B- 1 6
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
B- 1 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
mapping, the maximum number of digital outputs used for mapping, the maximum number of
registers used for mapping are described below.
Digital I/O (RX+RY): 256
Analog (Reading) register: 64
Analog (Writing) register: 64
B.6.2 Application of the RTU Mapping
Using RTU mapping to read data from/write data into remote digital inputs/outputs
Application and analog input/output registers
DVP-SE/ES2-E RTU-EN01+DVP06XA+DVP16SP
(1) Use a static IP address.
(2) IP address of DVP-SE: 192.168.1.90
(3) IP address of RTU-EN01: 92.168.1.91
(4) Use DCISoft for RTU-EN01, and check 10 pieces of mapping data for reading
and 10 pieces of mapping data for writing.
Network
(5) Set a start RX address, a start RY address, a start RCR (reading) address,
environment
and a start RCR (writing address) in DVP-SE, and set corresponding
numbers.
(6) Enable the mapping function in DVP-SE. Use M2000 and D2000 in DVP-SE
to read values from RTU-EN01, and use M3000 and D3000 to write values
into RTU-EN01.
1. Please refer to section B.6.1 for more information about setting communication.
2. Use DCISoft for RTU-EN01 to set mapping control registers used for reading/writing.
B- 1 8
Appe dn di x B Set t i ng a nd Us i ng a n Et h e r ne t PLC/M od ul e
3. Use DCISoft for DVP-SE to set start addresses and numbers. (RX: M2000~M2009; RY:
M3000~M3009; RCR (Reading): D2000~D2009; RCR (Writing): D3000~D3009)
4. Edit a ladder diagram, and download it to DVP-SE. The program edited is like the one shown
below.
Description:
(1) Enabling mapping: CR15=1
(2) Disabling mapping: CR15=0
(3) After CR#15 is enabled, M2000~M2009 and D2000~D2009 will be used to read data, and
present values will be read before M3000~M3009 and D3000~D3009 are used to write
data.
During the execution of mapping, other devices can not be used to modify the values in
mapping registers.
If DVPEN01-SL is used, K108 will be changed to the number assigned to DVPEN01-SL. If
DVPEN01-SL is the first module connected to the left side of a PLC, K108 will be changed
to K100.
B- 1 9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
MEMO
B- 2 0
Appendix
Inforamation about TP Series Text Panels
Contents
C- 1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
A- 2
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
Specifications
T Current value T0~T255, 256 words
C0~C199, 16-bit counter, 200 words
C Current value
C200~C254, 32-bit counter, 55 words
D0~D407, 408 words, (*1)
General D600~D999, 400 words, (*1)
D3920~D3999, 80 words, (*1)
Word
Register D408~D599, 192 words, (*2)
Data Latched Total
D D2000~D3919, 1920 words, (*2)
register 5000
D1000~D1999, 1000 words, some are
Special latched
D4000~D4999, 1000 words, (*3)
Index E0~E7, F0~F7, 16 words, (*1)
N Master control loop N0~N7, 8 points
P Pointer P0~P255, 256 points
I000/I001(X0), I100/I101(X1)
External
(01: rising-edge trigger , 00: falling-edge trigger
interrupt
)
Pointer I602~I699, I702~I799, 2 points (Timer resolution =
Interrupt Timer interrupt 1ms)
I
Service High-speed
counter I010,1 point
interrupt
Communication
I150(COM2), 1point, (*3)
interrupt
K-32,768 ~ K32,767 (16-bit operation)
K Decimal
K-2,147,483,648 ~ K2,147,483,647 (32-bit operation)
Constant
H0000 ~ HFFFF (16-bit operation)
H Hexadecimal
H00000000 ~HFFFFFFFF (32-bit operation)
COM1: built-in USB (Slave)
COM2: built-in RS-485 (Master/Slave)
Serial ports
COM3: built-in RS-485 (Master/Slave)
COM1 is typically the programming port.
Real Time Clock Year, Month, Day, Week, Hours, Minutes, Seconds
Notes:
1. Non-latched area cannot be modified.
2. Latched area cannot be modified.
3. COM2: built-in RS485 port.
4. There are 16-point models, and 32-point models. Extension modules are not supported.
The types and functions of special registers (special D) are listed in the table below. Care should
be taken that some registers of the same No. may bear different meanings in different series MPUs.
Special M and special D marked with * will be further illustrated in 2.13. Columns marked with R
refers to read only, R/W refers to read and write, - refers to the status remains unchanged
and # refers to that system will set it up according to the status of the PLC. For detailed
explanation please also refer to the table below.
C- 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
C- 4
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
C- 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1125 COM2(RS-485) Definition of first ending character (ETX1) H0D - - R/W NO H0D
C- 6
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
0X41: TP04P-21EX11R/TP70P-21EX11R
Max: K32000
D1354 0 0 0 R NO 0
D1354 = K0 when PLC Link stops or when the first scan
is completed
D1355* Starting reference for Master to read from Slave ID#1 - - - R/W YES H1064
D1356* Starting reference for Master to read from Slave ID#2 - - - R/W YES H1064
D1357* Starting reference for Master to read from Slave ID#3 - - - R/W YES H1064
C- 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1359* Starting reference for Master to read from Slave ID#5 - - - R/W YES H1064
D1360* Starting reference for Master to read from Slave ID#6 - - - R/W YES H1064
D1361* Starting reference for Master to read from Slave ID#7 - - - R/W YES H1064
D1362* Starting reference for Master to read from Slave ID#8 - - - R/W YES H1064
D1363* Starting reference for Master to read from Slave ID#9 - - - R/W YES H1064
D1364* Starting reference for Master to read from Slave ID#10 - - - R/W YES H1064
D1365* Starting reference for Master to read from Slave ID#11 - - - R/W YES H1064
D1366* Starting reference for Master to read from Slave ID#12 - - - R/W YES H1064
D1367* Starting reference for Master to read from Slave ID#13 - - - R/W YES H1064
D1368* Starting reference for Master to read from Slave ID#14 - - - R/W YES H1064
D1369* Starting reference for Master to read from Slave ID#15 - - - R/W YES H1064
D1370* Starting reference for Master to read from Slave ID#16 - - - R/W YES H1064
D1415* Starting reference for Master to write in Slave ID#1 - - - R/W YES H10C8
D1416* Starting reference for Master to write in Slave ID#2 - - - R/W YES H10C8
D1417* Starting reference for Master to write in Slave ID#3 - - - R/W YES H10C8
D1418* Starting reference for Master to write in Slave ID#4 - - - R/W YES H10C8
D1419* Starting reference for Master to write in Slave ID#5 - - - R/W YES H10C8
D1420* Starting reference for Master to write in Slave ID#6 - - - R/W YES H10C8
D1421* Starting reference for Master to write in Slave ID#7 - - - R/W YES H10C8
D1422* Starting reference for Master to write in Slave ID#8 - - - R/W YES H10C8
D1423* Starting reference for Master to write in Slave ID#9 - - - R/W YES H10C8
D1424* Starting reference for Master to write in Slave ID#10 - - - R/W YES H10C8
D1425* Starting reference for Master to write in Slave ID#11 - - - R/W YES H10C8
D1426* Starting reference for Master to write in Slave ID#12 - - - R/W YES H10C8
D1427* Starting reference for Master to write in Slave ID#13 - - - R/W YES H10C8
D1428* Starting reference for Master to write in Slave ID#14 - - - R/W YES H10C8
D1429* Starting reference for Master to write in Slave ID#15 - - - R/W YES H10C8
D1430* Starting reference for Master to write in Slave ID#16 - - - R/W YES H10C8
C- 8
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
The data which is read from slave ID#1 in the PLC LINK at
0 - - R NO 0
the time when M1353 is OFF
D1480*
The initial data register where the data read from slave
D1495*
ID#1~ID#16 in the PLC LINK is stored at the time when - - - R YES 0
M1353 is ON
C- 9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
D1512*
The data which is read from slave ID#2 in the PLC LINK 0 - - R NO 0
D1527*
D1528*
The data which is written into slave ID#2 in the PLC LINK 0 - - R/W NO 0
D1543*
D1544*
The data which is read from slave ID#3 in the PLC LINK 0 - - R NO 0
D1559*
D1560*
The data which is written into slave ID#3 in the PLC LINK 0 - - R/W NO 0
D1575*
D1576*
The data which is read from slave ID#4 in the PLC LINK 0 - - R NO 0
D1591*
D1592*
The data which is written into slave ID#4 in the PLC LINK 0 - - R/W NO 0
D1607*
D1608*
The data which is read from slave ID#5 in the PLC LINK 0 - - R NO 0
D1623*
D1624*
The data which is written into slave ID#5 in the PLC LINK 0 - - R/W NO 0
D1639*
D1640*
The data which is read from slave ID#6 in the PLC LINK 0 - - R NO 0
D1655*
D1656*
The data which is written into slave ID#6 in the PLC LINK 0 - - R/W NO 0
D1671*
D1672*
The data which is read from slave ID#7 in the PLC LINK 0 - - R NO 0
D1687*
D1688*
The data which is written into slave ID#7 in the PLC LINK 0 - - R/W NO 0
D1703*
D1704*
The data which is read from slave ID#8 in the PLC LINK 0 - - R NO 0
D1719*
D1720*
The data which is written into slave ID#8 in the PLC LINK 0 - - R/W NO 0
D1735*
D1736*
The data which is read from slave ID#9 in the PLC LINK 0 - - R NO 0
D1751*
D1752*
The data which is written into slave ID#9 in the PLC LINK 0 - - R/W NO 0
D1767*
D1768*
The data which is read from slave ID#10 in the PLC LINK 0 - - R NO 0
D1783*
C- 1 0
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
D1912*
The data which is written into slave ID#14 in the PLC LINK 0 - - R/W NO 0
D1927*
D1928*
The data which is read from slave ID#15 in the PLC LINK 0 - - R NO 0
D1943*
D1944*
The data which is written into slave ID#15 in the PLC LINK 0 - - R/W NO 0
D1959*
D1960*
The data which is read from slave ID#16 in the PLC LINK 0 - - R NO 0
D1975*
D1976*
The data which is written into slave ID#16 in the PLC LINK 0 - - R/W NO 0
D1991*
C- 11
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
The types and functions of special auxiliary relays (special M) are listed in the table below. Care
should be taken that some devices of the same No. may bear different meanings in different series
MPUs. Columns marked with R refers to read only, R/W refers to read and write, - refers to
the status remains unchanged and # refers to that system will set it up according to the status of
the PLC.
OFF STOP RUN
Special Latch-
Function Attrib. Default
M ed
ON RUN STOP
M1008* Watchdog timer (ON: PLC WDT time out) OFF OFF - R NO OFF
C- 1 2
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
M1028 Switch T64~T126 timer resulotion (10ms/100ms). ON =10ms OFF - - R/W NO OFF
M1037* Enable 8-sets SPD function (Has to be used with D1037) OFF OFF OFF R/W NO OFF
M1038 Switch T200~T255 timer resulotion (10ms/1ms). ON = 1ms OFF - - R/W NO OFF
C- 1 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1081 Changing conversion mode for FLT instruction OFF - - R/W NO OFF
Matrix comparison.
M1088 Comparing between equivalent values (M1088 = ON) or OFF OFF - R/W NO OFF
different values (M1088 = OFF).
M1096 Borrow flag for matrix rotation/shift/input OFF OFF - R/W NO OFF
M1097 Direction flag for matrix rotation/displacement OFF OFF - R/W NO OFF
M1098 Counting the number of bits which are 1 or 0 OFF OFF - R/W NO OFF
M1099 ON when the bits counting result is 0 OFF OFF - R/W NO OFF
M1123 For COM2(RS-485), data receiving completed OFF OFF - R/W NO OFF
M1124 For COM2(RS-485), data receiving ready OFF OFF - R/W NO OFF
C- 1 4
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
M1125 For COM2(RS-485), communication ready status reset OFF OFF OFF R/W NO OFF
M1128 For COM2(RS-485), Transmitting/Receiving status Indication OFF OFF OFF R/W NO OFF
M1129 For COM2(RS-485), receiving time out OFF OFF - R/W NO OFF
M1137 Retain DNET mapping data during non-executing period - - - R/W NO OFF
M1142 Data receiving error of VFD-A handy instructions OFF OFF - R NO OFF
M1161 8/16 bit mode (ON = 8 bit mode) OFF - - R/W NO OFF
M1200 C200 counting mode (ON: count down) OFF - - R/W NO OFF
M1201 C201 counting mode (ON: count down) OFF - - R/W NO OFF
M1202 C202 counting mode ON: count down) OFF - - R/W NO OFF
M1203 C203 counting mode (ON: count down) OFF - - R/W NO OFF
M1204 C204 counting mode (ON: count down) OFF - - R/W NO OFF
M1205 C205 counting mode (ON :count down) OFF - - R/W NO OFF
C- 1 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1206 C206 counting mode (ON: count down) OFF - - R/W NO OFF
M1207 C207 counting mode (ON: count down) OFF - - R/W NO OFF
M1208 C208 counting mode (ON: count down) OFF - - R/W NO OFF
M1209 C209 counting mode (ON: count down) OFF - - R/W NO OFF
M1210 C210 counting mode (ON: count down) OFF - - R/W NO OFF
M1211 C211 counting mode (ON: count down) OFF - - R/W NO OFF
M1212 C212 counting mode (ON: count down) OFF - - R/W NO OFF
M1213 C213 counting mode (ON: count down) OFF - - R/W NO OFF
M1214 C214 counting mode (ON: count down) OFF - - R/W NO OFF
M1215 C215 counting mode (ON: count down) OFF - - R/W NO OFF
M1216 C216 counting mode (ON: count down) OFF - - R/W NO OFF
M1217 C217 counting mode (ON: count down) OFF - - R/W NO OFF
M1218 C218 counting mode (ON: count down) OFF - - R/W NO OFF
M1219 C219 counting mode (ON: count down) OFF - - R/W NO OFF
M1220 C220 counting mode (ON: count down) OFF - - R/W NO OFF
M1221 C221 counting mode (ON: count down) OFF - - R/W NO OFF
M1222 C222 counting mode (ON: count down) OFF - - R/W NO OFF
M1223 C223 counting mode (ON: count down) OFF - - R/W NO OFF
M1224 C224 counting mode (ON: count down) OFF - - R/W NO OFF
M1225 C225 counting mode (ON: count down) OFF - - R/W NO OFF
M1226 C226 counting mode (ON: count down) OFF - - R/W NO OFF
M1227 C227 counting mode (ON: count down) OFF - - R/W NO OFF
M1228 C228 counting mode (ON: count down) OFF - - R/W NO OFF
M1229 C229 counting mode (ON: count down) OFF - - R/W NO OFF
M1230 C230 counting mode (ON: count down) OFF - - R/W NO OFF
M1231 C231 counting mode (ON: count down) OFF - - R/W NO OFF
M1235 C235 counting mode (ON: count down) OFF - - R/W NO OFF
M1236 C236 counting mode (ON: count down) OFF - - R/W NO OFF
C- 1 6
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
M1237 C237 counting mode (ON: count down) OFF - - R/W NO OFF
M1238 C238 counting mode (ON: count down) OFF - - R/W NO OFF
M1239 C239 counting mode (ON: count down) OFF - - R/W NO OFF
M1240 C240 counting mode (ON: count down) OFF - - R/W NO OFF
M1241 C241 counting mode (ON: count down) OFF - - R/W NO OFF
M1242 C242 counting mode (ON: count down) OFF - - R/W NO OFF
M1243 C243 Reset function control. ON = R function disabled OFF - - R/W NO OFF
M1244 C244 Reset function control. ON = R function disabled OFF - - R/W NO OFF
M1270 C235 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1271 C236 counting mode ON: falling-edge count) OFF - - R/W NO OFF
M1272 C237 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1273 C238 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1274 C239 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1275 C240 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1276 C241 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1277 C242 counting mode (ON: falling-edge count) OFF - - R/W NO OFF
M1303 High / low bits exchange for XCH instruction OFF - - R/W NO OFF
C- 1 7
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1360* Slave ID#1 status on PLC LINK network - - - R/W YES OFF
M1361* Slave ID#2 status on PLC LINK network - - - R/W YES OFF
M1362* Slave ID#3 status on PLC LINK network - - - R/W YES OFF
M1363* Slave ID#4 status on PLC LINK network - - - R/W YES OFF
M1364* Slave ID#5 status on PLC LINK network - - - R/W YES OFF
M1365* Slave ID#6 status on PLC LINK network - - - R/W YES OFF
M1366* Slave ID#7 status on PLC LINK network - - - R/W YES OFF
C- 1 8
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
M1367* Slave ID#8 status on PLC LINK network - - - R/W YES OFF
M1368* Slave ID#9 status on PLC LINK network - - - R/W YES OFF
M1369* Slave ID#10 status on PLC LINK network - - - R/W YES OFF
M1370* Slave ID#11 status on PLC LINK network - - - R/W YES OFF
M1371* Slave ID#12 status on PLC LINK network - - - R/W YES OFF
M1372* Slave ID#13 status on PLC LINK network - - - R/W YES OFF
M1373* Slave ID#14 status on PLC LINK network - - - R/W YES OFF
M1374* Slave ID#15 status on PLC LINK network - - - R/W YES OFF
M1375* Slave ID#16 status on PLC LINK network - - - R/W YES OFF
M1376* Indicate Slave ID#1 data interchange status on PLC LINK OFF - - R NO OFF
M1377* Indicate Slave ID#2 data interchange status on PLC LINK OFF - - R NO OFF
M1378* Indicate Slave ID#3 data interchange status on PLC LINK OFF - - R NO OFF
M1379* Indicate Slave ID#4 data interchange status on PLC LINK OFF - - R NO OFF
M1380* Indicate Slave ID#5 data interchange status on PLC LINK OFF - - R NO OFF
M1381* Indicate Slave ID#6 data interchange status on PLC LINK OFF - - R NO OFF
M1382* Indicate Slave ID#7 data interchange status on PLC LINK OFF - - R NO OFF
M1383* Indicate Slave ID#8 data interchange status on PLC LINK OFF - - R NO OFF
M1384* Indicate Slave ID#9 data interchange status on PLC LINK OFF - - R NO OFF
M1385* Indicate Slave ID#10 data interchange status on PLC LINK OFF - - R NO OFF
M1386* Indicate Slave ID#11 data interchange status on PLC LINK OFF - - R NO OFF
M1387* Indicate Slave ID#12 data interchange status on PLC LINK OFF - - R NO OFF
M1388* Indicate Slave ID#13 data interchange status on PLC LINK OFF - - R NO OFF
M1389* Indicate Slave ID#14 data interchange status on PLC LINK OFF - - R NO OFF
M1390* Indicate Slave ID#15 data interchange status on PLC LINK OFF - - R NO OFF
M1391* Indicate Slave ID#16 data interchange status on PLC LINK OFF - - R NO OFF
C- 1 9
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
M1408* Indicate that reading from Slave ID#1 is completed OFF - - R NO OFF
M1409* Indicate that reading from Slave ID#2 is completed OFF - - R NO OFF
M1410* Indicate that reading from Slave ID#3 is completed OFF - - R NO OFF
M1411* Indicate that reading from Slave ID#4 is completed OFF - - R NO OFF
M1412* Indicate that reading from Slave ID#5 is completed OFF - - R NO OFF
M1413* Indicate that reading from Slave ID#6 is completed OFF - - R NO OFF
M1414* Indicate that reading from Slave ID#7 is completed OFF - - R NO OFF
M1415* Indicate that reading from Slave ID#8 is completed OFF - - R NO OFF
M1416* Indicate that reading from Slave ID#9 is completed OFF - - R NO OFF
M1417* Indicate that reading from Slave ID#10 is completed OFF - - R NO OFF
M1418* Indicate that reading from Slave ID#11 is completed OFF - - R NO OFF
M1419* Indicate that reading from Slave ID#12 is completed OFF - - R NO OFF
M1420* Indicate that reading from Slave ID#13 is completed OFF - - R NO OFF
M1421* Indicate that reading from Slave ID#14 is completed OFF - - R NO OFF
M1422* Indicate that reading from Slave ID#15 is completed OFF - - R NO OFF
M1423* Indicate that reading from Slave ID#16 is completed OFF - - R NO OFF
C- 2 0
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
The instructions which are applicable to TP are listed below. Please refer to chapter 3 for more
information about the instructions.
Instruction Function
LD Load NO contact
LDI Load NC contact
AND Connect NO contact in series
ANI Connect NC contact in series
OR Connect NO contact in parallel
ORI Connect NC contact in parallel
ANB Connect a block in series
ORB Connect a block in parallel
MPS Start of branches. Stores current result of program evaluation
MRD Reads the stored current result from previous MPS
End of branches. Pops (reads and resets) the stored result in previous
MPP
MPS
OUT Output coil
SET Latches the ON status
RST Resets contacts, registers or coils
MC Master control Start
MCR Master control Reset
END Program End
NOP No operation
P Pointer
I Interrupt program pointer
STL Step ladder start instruction
RET Step ladder return instruction
NP Negative contact to Positive contact
C- 2 1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Instruction Function
PN Positive contact to Negative contact
Mnemonic
Classification API PULSE Function
16 bits 32 bits
00 CJ Conditional jump
01 CALL Call subroutine
02 SRET Subroutine return
03 IRET Interrupt return
04 EI Enable interrupt
Loop Control
05 DI Disable interrupt
06 FEND The end of the main program (First end)
07 WDT Watchdog timer refresh
08 FOR Start of a For-Next Loop
09 NEXT End of a For-Next Loop
10 CMP DCMP Compare
11 ZCP DZCP Zone compare
12 MOV DMOV Move
13 SMOV Shift move
Transmission 14 CML DCML Complement
Comparison 15 BMOV Block move
16 FMOV DFMOV Fill move
17 XCH DXCH Exchange
18 BCD DBCD Convert BIN to BCD
19 BIN DBIN Convert BCD to BIN
20 ADD DADD Addition
21 SUB DSUB Subtraction
22 MUL DMUL Multiplication
23 DIV DDIV Division
Four Arithmetic 24 INC DINC Increment
Operations 25 DEC DDEC Decrement
26 WAND DAND Logical Word AND
27 WOR DOR Logical Word OR
28 WXOR DXOR Logical XOR
29 NEG DNEG 2s Complement (Negation)
30 ROR DROR Rotate right
31 ROL DROL Rotate left
32 RCR DRCR Rotate right with carry
33 RCL DRCL Rotate left with carry
Rotation and
Displacement 34 SFTR Bit shift right
35 SFTL Bit shift left
36 WSFR Word shift right
37 WSFL Word shift left
38 SFWR Shift register write
C- 2 2
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
Mnemonic
Classification API PULSE Function
16 bits 32 bits
Rotation and
39 SFRD Shift register read
Displacement
40 ZRST Zone reset
41 DECO Decode
42 ENCO Encode
43 SUM DSUM Sum of Active bits
44 BON DBON Check specified bit status
Data Processing
45 MEAN DMEAN Mean
46 ANS Timed Annunciator Set
47 ANR Annunciator Reset
48 SQR DSQR Square Root
49 FLT DFLT Floating point
53 DHSCS High speed counter SET
High Speed
54 DHSCR High speed counter RESET
Processing
55 DHSZ High speed zone compare
60 IST Initial state
61 SER DSER Search a data stack
62 ABSD DABSD Absolute drum sequencer
63 INCD Incremental drum sequencer
Handy
64 TTMR Teaching timer
Instructions
65 STMR Special timer
66 ALT Alternate state
67 RAMP Ramp variable value
69 SORT Data sort
80 RS Serial communication
82 ASCI Convert HEX to ASCII
Serial I/O 83 HEX Convert ASCII to HEX
87 ABS DABS Absolute value
88 PID DPID PID control
89 PLS Rising-edge output
90 LDP Risingedge detection operation
91 LDF Fallingedge detection operation
92 ANDP Rising-edge series connection
93 ANDF Falling-edge series connection
Basic
94 ORP Rising-edge parallel connection
Instructions
95 ORF Falling-edge parallel connection
96 TMR Timer
97 CNT DCNT Counter
98 INV Inverse operation
99 PLF Falling-edge output
100 MODRD Read Modbus data
Communication 101 MODWR Write Modbus Data
Instructions 102 FWD Forward Operation of VFD
103 REV Reverse Operation of VFD
C- 2 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Mnemonic
Classification API PULSE Function
16 bits 32 bits
104 STOP Stop VFD
105 RDST Read VFD Status
106 RSTEF Reset Abnormal VFD
Communication 107 LRC LRC checksum
Instructions
108 CRC CRC checksum
150 MODRW MODBUS Read/ Write
206 ASDRW ASDA servo drive R/W
110 DECMP Floating point compare
111 DEZCP Floating point zone compare
112 DMOVR Move floating point data
116 DRAD Degree Radian
117 DDEG Radian Degree
118 DEBCD Float to scientific conversion
119 DEBIN Scientific to float conversion
120 DEADD Floating point addition
121 DESUB Floating point subtraction
122 DEMUL Floating point multiplication
123 DEDIV Floating point division
124 DEXP Float exponent operation
125 DLN Float natural logarithm operation
Floating Point
Operation 126 DLOG Float logarithm operation
127 DESQR Floating point square root
128 DPOW Floating point power operation
129 INT DINT Float to integer
130 DSIN Sine
131 DCOS Cosine
132 DTAN Tangent
133 DASIN Arc Sine
134 DACOS Arc Cosine
135 DATAN Arc Tangent
172 DADDR Floating point addition
173 DSUBR Floating point subtraction
174 DMULR Floating point multiplication
175 DDIVR Floating point division
143 DELAY Delay
144 GPWM General PWM output
147 SWAP DSWAP Byte swap
154 RAND Random number
Additional 168 MVM DMVM Mask and combine designated Bits
Instruction 176 MMOV 16-bit32-bit Conversion
179 WSUM DWSUM Sum of multiple devices
202 SCAL Proportional value calculation
203 SCLP Parameter proportional value calculation
205 CMPT DCMPT Compare table
C- 2 4
Appe nd i x C I nf or am a ti on a b out TP Se r i e s Te x t Pa ne l s
Mnemonic
Classification API PULSE Function
16 bits 32 bits
Positioning
155 DABSR Absolute position read
Control
160 TCMP Time compare
161 TZCP Time Zone Compare
162 TADD Time addition
Real Time
163 TSUB Time subtraction
Calendar
166 TRD Time read
167 TWR Time write
169 HOUR DHOUR Hour meter
170 GRY DGRY BIN Gray Code
Gray Code
171 GBIN DGBIN Gray Code BIN
180 MAND Matrix AND
181 MOR Matrix OR
182 MXOR Matrix XOR
183 MXNR Matrix XNR
184 MINV Matrix inverse
Matrix Operation 185 MCMP Matrix compare
186 MBRD Matrix bit read
187 MBWR Matrix bit write
188 MBS Matrix bit shift
189 MBR Matrix bit rotate
190 MBC Matrix bit status count
215 LD& DLD& S1 & S2
216 LD| DLD| S1 | S2
217 LD^ DLD^ S1 ^ S2
218 AND& DAND& S1 & S2
Contact Type
219 AND| DAND| S1 | S2
Logic Operation
220 AND^ DAND^ S1 ^ S2
221 OR& DOR& S1 & S2
222 OR| DOR| S1 | S2
223 OR^ DOR^ S1 ^ S2
224 LD= DLD= S1 S2
225 LD> DLD> S1 S2
226 LD< DLD< S1 S2
228 LD<> DLD<> S1 S2
229 LD<= DLD<= S1 S2
Contact Type
230 LD>= DLD>= S1 S2
Comparison
232 AND= DAND= S1 S2
233 AND> DAND> S1 S2
234 AND< DAND< S1 S2
236 AND<> DAND<> S1 S2
237 AND<= DAND<= S1 S2
238 AND>= DAND>= S1 S2
240 OR= DOR= S1 S2
Contact Type
241 OR> DOR> S1 S2
Comparison
242 OR< DOR< S1 S2
244 OR<> DOR<> S1 S2
C- 2 5
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Mnemonic
Classification API PULSE Function
16 bits 32 bits
Contact Type 245 OR<= DOR<= S1 S2
Comparison 246 OR>= DOR>= S1 S2
266 BOUT DBOUT Output specified bit of a word
267 BSET DBSET Set ON specified bit of a word
268 BRST DBRST Reset specified bit of a word
269 BLD DBLD Load NO contact by specified bit
270 BLDI DBLDI Load NC contact by specified bit
Specific Bit Connect NO contact in series by
271 BAND DBAND
Control specified bit
Connect NC contact in series by
272 BANI DBANI
specified bit
Connect NO contact in parallel by
273 BOR DBOR
specified bit
Connect NC contact in parallel by
274 BORI DBORI
specified bit
275 FLD= S1 S2
276 FLD> S1 S2
277 FLD< S1 S2
278 FLD<> S1 S2
279 FLD<= S1 S2
280 FLD>= S1 S2
281 FAND= S1 S2
282 FAND> S1 S2
Floating-Point
283 FAND< S1 S2
Contact Type
284 FAND<> S1 S2
Comparison
285 FAND<= S1 S2
286 FAND>= S1 S2
287 FOR= S1 S2
288 FOR> S1 S2
289 FOR< S1 S2
290 FOR<> S1 S2
291 FOR<= S1 S2
292 FOR>= S1 S2
1. TP only supports the high-speed inputs X0 and X1 (10KHz). (Please refer to section 2.12 for
more information.)
2. TP only supports the software counters C235 and C236. The corresponding high-speed
interrupts are I010 and I020. (Please refer to the explanations of API53 and API55 for more
information.)
3. TP onlyt supports the hardware counter C251. The corresponding high-speed interrupt is I010.
There is only one hardware comparator. (Please refer to the explanations of API53 and API55
for more information.)
C- 2 6
Appendix
Introducing the Current Consumption of Slim PLCs/Extension Modules
Contents
D- 1
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
Users can calculate the maximum current consumed by the combination of a slim PLC and
modules by means of the data in the table below.
D.1.2 Current supply and current consumption of a digital input/output module (+24VDC)
Model
32SM11N 32SN11TN
Item
Internal maximum current
40 40
consumed by the IO-BUS (mA)
Maximum current consumed by
0.16 2
the external DIO (A)
D- 2
Ap p en d i x D I n t r o d u c i n g t h e Cu r r en t Co n s u m p tio n o f Sl im PL Cs / Ext en s i o n Mo d u l es
Model
04AD-S 06AD-S 04DA-S 06XA-S 04PT-S 04TC-S 01PU-S
Item
Internal maximum current
consumed by the IO-BUS 30 30 30 30 30 30 30
(mA)
Maximum current
consumed by the external 83 83 167 83 83 83 105
AIO (mA)
Model
EN01-SL COPM-SL DNET-SL 04AD-SL 04DA-SL 02LC-SL 01LC-SL
Item
Internal maximum current
consumed by the IO-BUS 60 50 50 40 40 40 40
(mA)
Maximum current
consumed by the external 0 0 0 15 80 125 125
AIO (mA)
D- 3
DVP- ES2 / EX2 / SS2 / SA2 / SX2 / SE&T P O p e r a t i on Ma n ua l - Pr ogr am m i ng
MEMO
D- 4