0% found this document useful (0 votes)
989 views1,374 pages

Delta Ia PLC DVP Es3 Ex3 Sv3 Sx3 PM en 20240911

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
989 views1,374 pages

Delta Ia PLC DVP Es3 Ex3 Sv3 Sx3 PM en 20240911

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1374

Digitized Automation for a Changing World

DVP-ES3 / EX3 / SV3 / SX3 Series


Programming Manual

www.deltaww.com
DVP-ES3/EX3/SV3/SX3 Series
Programming Manual
Revision History

Ve r s i o n Revision Date

1st The first version was published. 2019/10/08


1. Chapter 1: Changed the name of DVP-ES3 Operation
Manual to DVP-ES3 Hardware and Operation Manual
in Section 1.1.1. Added new product information
DVP02PU-E2 in Section 1.1.2.
2. Chapter 2: Updated Relation Between the PLC Action
a n d D e v i c e Ty p e a n d a d d e d d e s c r i p t i o n o f S M 2 0 3 f l a g
in Section 2.1.3. Removed SM30, SM94, SM95,
SM468, SM488, SM508, SM528 from Sections 2.2.7
and 2.2.8. Added SM120-SM151, SM203, SM229,
SM360-SM391, SM581, SM603, SM1375-SM1423,
SM1686, and SM1700-SM1703 and updated SM464,
SM466, SM484, SM486, SM504, SM506, SM524, and
SM526 in Sections 2.2.7 and 2.2.8. Added CNT
i n s t r u c t i o n i n f o r m a t i o n i n S e c t i o n 2 . 2 . 11 C o u n t e r s .
Added DCNT instruction and 32-bit counters (HC)
information in Section 2.2.12. Added frequently
mapped registers information in Section 2.2.13. Added
new Special Data Registers (SR): SR29-SR31, SR42,
SR48, SR54, SR60, SR66, SR72, SR78, SR84, SR90,
2nd S R 9 6 , S R 1 0 2 , S R 1 0 8 , S R 11 4 , S R 1 2 0 , S R 1 2 6 , S R 1 3 2 , 2021/10/5
SR138, SR144, SR150, SR156, SR405-SR406,
S R 1 0 1 6 - S R 1 0 6 7 , S R 111 0 - S R 111 3 , S R 1 5 5 6 , S R 1 7 0 0 ,
SR1702, SR1704, SR1706, updated SR440-SR451 and
deleted SR23, SR604, SR633 in Sections 2.2.14 and
2.2.15. Added #2 error codes in SM27/SR27, updated
#22 information in Flags SM230~261, updated #7 PLC
error log information, added #24 Auto-reset flags for
pulse output in Section 2.2.16. Added and updated the
following information in section 2.2.16: SM203
information, backlash compensation information, PLC
error log, PLC download log, The flags related to the
memory card, Backlash compensation function,
Ethernet IP related flags, SM228 information,
Auto-reset flags for pulse output, Auto-reset flags for
Delta CAN communication, how to use DPLSY in
high-speed comparison interrupt (I2xx) and how to use
backlash compensation in CSFO.
3. Chapter 3: Added and updated instructions API1014,
A P I 1 0 1 5 , A P I 1 2 2 8 , A P I 1 2 2 9 , A P I 1 4 11 - A P I 1 4 1 2 ,
Ve r s i o n Revision Date

API1821, API2813-API2818 and added 32-bit


i n s t r u c t i o n s , i n c l u d i n g A P I 11 0 2 - A P I 11 0 8 ,
A P I 111 4 - A P I 111 5 a n d A P I 2 8 0 6 .
4. Chapter 6: Added a Section explaining which
instruction should be used in Ladder Programming
Language in Section 4.3. All the instructions in this
m a n u a l d o e s N O T s u p p o r t t h e d a t a t y p e U I N T. R e m o v e
UINT from the supporting list in Chapter 6: API0501,
API0600, API0704, API0708, API0709, API1002,
API1003, API1004, API1005, API1210, API1226,
API2106, API2200, API2204, API2208,
API2209/API2212, API2300, API2301, API2302,
API2304, API2703, API2706, API2708, API2710,
API2712, API2714, API2718, API2800, API2803,
API2807, API2809, API2810 and added new
instructions including API1014, , API1015, API1228,
A P I 1 2 2 9 , A P I 1 4 11 - A P I 1 4 1 2 , A P I 1 8 2 1 ,
API2813-API2818 and added 32-bit instructions
i n c l u d i n g A P I 11 0 2 - A P I 11 0 8 , A P I 111 4 - A P I 111 5 a n d
API2806.
5. C h a p t e r 7 : U p d a t e d Tr o u b l e s h o o t i n g S O P i n S e c t i o n
7.1.3. Updated the steps to do when encountering a
program syntax error in Section in Section 7.1.4.
Added new error codes 16#19B0~16#19FC and
updated error codes 16#2001~16#2027 in Section 7.2.
U p d a t e d Tr o u b l e s h o o t i n g f o r Te m p e r a t u r e M o d u l e s
a n d a d d e d a n e w S e c t i o n “ Tr o u b l e s h o o t i n g f o r
Positioning Modules (PU)” in Section 7.3. Added new
error codes 16#19B0-16#19FC and 16#C000-16#CFFF
in Section 7.4.
1. Chapter 1: Updated manual description.
2. Chapter 6: Adding supported module firmware version
in DPUMPG instruction (API1409); adding delay range
3rd i n D E L AY i n s t r u c t i o n ( A P I 1 9 0 1 ) ; a d d i n g s u p p o r t e d 20220407
module firmware version for filename in MWRIT
instruction (API2300), MREAD instruction (API2301),
MTWRIT (API2302), and MDEL instruction (API2304).
1. All chapters: Added information related to the models
DVP32ES300TEC/DVP-EX3/DVP-SX3/DVP-SV3 series,
and DIADesigner-related information.
2. Chapter 2: Added new SM devices including
4th 2 0 2 4 0 11 2
SM27/SM29/ SM217/SM264-SM266/SM408-SM410/
SM441/SM588-SM594/SM719/SM1037/SM1092/SM128
6 - S M 1 3 11 / S M 1 3 1 7 - S M 1 3 7 3 , u p d a t e d r e l e v a n t
information about SM228/SM229/SM465/SM467/
Ve r s i o n Revision Date

SM485/SM487/SM505/SM507/SM525/SM527/SM585
/SM1270-SM1285/SM1312-SM1315/SM1581-SM1588/S
M1631-SM1698; added new SR devices including
SR27/SR38/SR168-SR173/SR409/SR410/SR425/SR65
6 / S R 6 5 7 / S R 1 0 9 2 / S R 1 0 9 3 / S R 111 4 / S R 1 2 9 1 - S R 1 2 9 9 / S R
1536-SR1551/SR1593-SR1610, and updated relevant
information about SR658-SR748/SR791-SR818
/ S R 11 0 0 - S R 11 0 7 .
3. Chapter 3: Added basic instructions, LDIP/ANIP/ORIP
/ L D I F / A N I F / O R I F, a s w e l l a s a p p l i c a t i o n i n s t r u c t i o n s ,
API0712/API1016-API1018/API1428-API1430/API2213/
API2820-API2823.
4. Chapter 7: Added error codes, 16#000D/
16#140F-16#1425/16#0040-16#0047.
1. Added arithmetic instructions API0120-API0127 in
5th 20240306
Chapter 6.
1. Chapter 6 : Updated instructions,
API2801/API2802/API2803/API2804/
6th API2805/API2806/API2807/API2808/API2809/API2810/ 20240831
A P I 2 8 11 / A P I 2 8 1 2 / A P I 2 8 1 3 / A P I 2 8 1 4 / A P I 2 8 1 5 / A P I 2 8 1 6 /
API2817/API2818/API2820/API2821/API2822/API2823
DVP-ES3/EX3/SV3/SX3 Series
Programming Manual
Table of Contents
Chapter 1 Introduction

1.1 Overview ............................................................................................... 1-2


1.1.1 Related Manuals ............................................................................ 1-2
1.1.2 DVP-ES3/EX3 CPU Modules and Their I/O Modules ............................. 1-3
1.1.3 DVP-SV3/SX3 CPU Modules and Their I/O Modules ........................... 1-10

1.2 Software .............................................................................................. 1-18


1.2.1 Program Editor ............................................................................ 1-18
1.2.2 Program Organization Units and Tasks ............................................ 1-21

Chapter 2 Devices

2.1 Introduction to Devices ......................................................................... 2-2


2.1.1 Device Table .................................................................................. 2-2
2.1.2 Basic Structure of I/O Storage ......................................................... 2-3
2.1.3 Relation Between the PLC Action and the Device Type ........................ 2-3
2.1.4 Latched Areas in the Device Range................................................... 2-4

2.2. Device Functions .................................................................................. 2-6


2.2.1 Values and Constants ..................................................................... 2-6
2.2.2 Floating-point Numbers .................................................................. 2-8
2.2.3 Strings ......................................................................................... 2-9
2.2.4 Input Relays (X) .......................................................................... 2-10
2.2.5 Output Relays (Y) ........................................................................ 2-11
2.2.6 Auxiliary Relays (M) ..................................................................... 2-11
2.2.7 Special Auxiliary Relays (SM)......................................................... 2-12
2.2.8 Refresh Time for Special Auxiliary Relays ........................................ 2-44
2.2.9 Stepping Relays (S) ..................................................................... 2-51
2.2.10 Timers (T)................................................................................... 2-52
2.2.11 Counters ..................................................................................... 2-53
2.2.12 32-bit Counters (HC) .................................................................... 2-55
2.2.13 Data Registers (D) ....................................................................... 2-58
2.2.14 Special Data Registers (SR)........................................................... 2-59
2.2.15 Special Data Registers Refresh Conditions ....................................... 2-93
2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data
Registers .................................................................................... 2-97
2.2.17 Index Register (E) ....................................................................... 2-130
2.2.18 File Registers (FR) ....................................................................... 2-130

i
Chapter 3 Instruction Tables

3.1 Types of Instructions ........................................................................ 3-2


3.1.1 Basic Instructions .......................................................................... 3-2
3.1.2 Applied Instructions ....................................................................... 3-2

3.2 Understanding Instruction Tables ..................................................... 3-3


3.2.1 Basic Instructions .......................................................................... 3-3
3.2.2 Applied Instructions (Sorted numerically) ......................................... 3-4
3.2.3 Applied Instructions (Sorted Alphabetically) ...................................... 3-5
3.2.4 Device Tables ................................................................................ 3-6

3.3 Lists of Basic Instructions ................................................................. 3-7

3.4 Lists of Applied Instructions ............................................................ 3-10


3.4.1 Applied Instructions (Sorted numerically by API number)................... 3-10
3.4.2 Applied Instructions (Sorted Alphabetically) ..................................... 3-47

Chapter 4 Instruction Structure

4.1 Applied Instructions - API Description .............................................. 4-2

4.2 Operand Usage Description ............................................................... 4-5

4.3 Restrictions on the Use of Instructions ............................................. 4-7

4.4 Index Registers ................................................................................. 4-9

4.5 Pointer Registers ............................................................................. 4-12

4.6 Pointer Registers of Timers ............................................................. 4-14

4.7 Pointer Registers for 16-bit Counters .............................................. 4-16

4.8 Pointer Registers for 32-bit Counters .............................................. 4-18

4.9 File Register .................................................................................... 4-20

Chapter 5 Basic Instructions

5.1 List of Basic Instructions ................................................................... 5-2

5.2 Basic Instructions ............................................................................. 5-3

ii
Chapter 6 Applied Instructions

6.1 Comparison Instructions ....................................................................... 6-4


6.1.1 List of Comparison Instructions ............................................................. 6-4
6.1.2 Explanation of Comparison Instructions ................................................. 6-7

6.2 Arithmetic Instructions ....................................................................... 6-46


6.2.1 List of Arithmetic Instructions ............................................................. 6-46
6.2.2 Explanation of Arithmetic Instructions ................................................. 6-48

6.3 Data Conversion Instructions ............................................................ 6-107


6.3.1 List of Data Conversion Instructions ................................................... 6-107
6.3.2 Explanation of Data Conversion Instructions ........................................ 6-108

6.4 Data Transfer Instructions ................................................................ 6-151


6.4.1 List of Data Transfer Instructions ....................................................... 6-151
6.4.2 Explanation of Data Transfer Instructions ............................................ 6-152

6.5 Jump Instructions ............................................................................. 6-180


6.5.1 List of Jump Instructions ................................................................... 6-180
6.5.2 Explanation of Jump Instructions ....................................................... 6-181

6.6 Program Execution Instructions ........................................................ 6-189


6.6.1 List of Program Execution Instructions ................................................ 6-189
6.6.2 Explanation of Program Execution Instructions..................................... 6-190

6.7 IO Refreshing Instructions ................................................................ 6-202


6.7.1 List of IO Refreshing Instructions ....................................................... 6-202
6.7.2 Explanation of IO Refreshing Instructions ............................................ 6-203

6.8 Miscellaneous Instructions ................................................................ 6-210


6.8.1 List of Convenience Instructions......................................................... 6-210
6.8.2 Explanation of Convenience Instructions ............................................. 6-211

6.9 Logic Instructions .............................................................................. 6-268


6.9.1 List of Logic Instructions ................................................................... 6-268
6.9.2 Explanation of Logic Instructions ........................................................ 6-269

6.10 Rotation Instructions ....................................................................... 6-290


6.10.1 List of Rotation Instructions ............................................................. 6-290
6.10.2 Explanation of Rotation Instructions ................................................. 6-291

6.11 Timer and Counter Instructions ....................................................... 6-302


6.11.1 List of Timer and Counter Instructions .............................................. 6-302
6.11.2 Explanation of Timer and Counter Instructions ................................... 6-303

6.12 Shift Instructions............................................................................. 6-353


6.12.1 List of Shift Instructions .................................................................. 6-353

iii
6.12.2 Explanation of Shift Instructions ...................................................... 6-354

6.13 Data Processing Instructions .......................................................... 6-396


6.13.1 List of Data Processing Instructions .................................................. 6-396
6.13.2 Explanation of Data Processing Instructions ...................................... 6-398

6.14 Structure Creation Instructions ....................................................... 6-462


6.14.1 List of Structure Creation Instructions .............................................. 6-462
6.14.2 Explanation of Structure Creation Instructions ................................... 6-463

6.15 Module Instructions ........................................................................ 6-471


6.15.1 List of Module Instructions .............................................................. 6-471
6.15.2 Explanation of Module Instructions ................................................... 6-472

6.16 Floating-point Number Instructions ................................................ 6-523


6.16.1 List of Floating-point Number Instructions ......................................... 6-523
6.16.2 Explanation of Floating-point Number Instructions ............................. 6-524

6.17 Real-time Clock Instructions ........................................................... 6-558


6.17.1 List of Real-time Clock Instructions .................................................. 6-558
6.17.2 Explanation of Real-time Clock Instructions ....................................... 6-559

6.18 Peripheral Instructions.................................................................... 6-590


6.18.1 List of Peripheral Instructions .......................................................... 6-590
6.18.2 Explanation of Peripheral Instructions ............................................... 6-591

6.19 Communication Instructions ........................................................... 6-607


6.19.1 List of Communication Instructions................................................... 6-607
6.19.2 Explanation of Communication Instructions ....................................... 6-608
6.19.3 Descriptions of the Communication-related Flags and Registers ........... 6-694

6.20 Other Instructions ........................................................................... 6-697


6.20.1 List of Other Instructions ................................................................ 6-697
6.20.2 Explanation of Other Instructions ..................................................... 6-698

6.21 String Processing Instructions ........................................................ 6-710


6.21.1 List of String Processing Instructions ................................................ 6-710
6.21.2 Explanation of String Processing Instructions ..................................... 6-711

6.22 Ethernet Instructions ...................................................................... 6-773


6.22.1 List of Ethernet Instructions ............................................................ 6-773
6.22.2 Explanation of Ethernet Instructions ................................................. 6-774

6.23 Memory Card Instructions ............................................................... 6-820


6.23.1 List of Memory Card Instructions...................................................... 6-820
6.23.2 Explanation of Memory Card Instructions .......................................... 6-821

6.24 Task Control Instructions ................................................................ 6-842


6.24.1 List of Task Control Instructions ....................................................... 6-842

iv
6.24.2 Explanation of Task Control Instructions ............................................ 6-843

6.25 SFC Instructions .............................................................................. 6-847


6.25.1 List of SFC Instructions ................................................................... 6-847
6.25.2 Explanation of SFC Instructions ........................................................ 6-848

6.26 High-speed Output Instructions ...................................................... 6-855


6.26.1 List of High-speed Output Instructions .............................................. 6-855
6.26.2 Explanation of High-speed Output Instructions................................... 6-857

6.27 Delta CANopen and EtherCAT Communication Instructions ............. 6-971


6.27.1 List of Communication Instructions ................................................... 6-971
6.27.2 Explanation of CANopen and EtherCAT Instructions ............................ 6-972
6.27.3 Frequently asked questions in Delta special CANopen communication and
Troubleshooting ........................................................................... 6-1084

Chapter 7 Troubleshooting

7.1 Troubleshooting ................................................................................ 7-2


7.1.1 Basic troubleshooting steps ............................................................. 7-2
7.1.2 Clear the Error States ..................................................................... 7-2
7.1.3 Troubleshooting SOP ...................................................................... 7-3
7.1.4 System Log and Positions of the Error Step ....................................... 7-4

7.2 Troubleshooting for CPU Modules ...................................................... 7-8


7.2.1 ERROR LED Indicators Are ON ......................................................... 7-8
7.2.2 ERROR LED Indicators Blinking Every 0.5 Seconds ............................. 7-8
7.2.3 ERROR LED Indicators Blinking Rapidly Every 0.2 Seconds ................ 7-10
7.2.4 ERROR LED Indicators Slow Blinking Every 3 Seconds and Lighting up for
1 Second .................................................................................... 7-10
7.2.5 The LED RUN and ERROR Indicators are Blinking Simultaneously
Every 0.5 Seconds ....................................................................... 7-11
7.2.6 The RUN and LED Indicators are Blinking One After Another
Every 0.5 Seconds. ...................................................................... 7-11
7.2.7 Other Errors (Without LED Indicators) ............................................ 7-12

7.3 Troubleshooting for Other I/O Modules ........................................... 7-18

7.4 LED Indicators and Error Codes for CPU Modules ............................ 7-19

* All the Windows screenshots are used with permission from Microsoft.

v
1
Chapter 1 Product Introduction

Table of Contents

1.1 Overview ................................................................................................ 1-2


1.1.1 Related Manuals ................................................................................. 1-2
1.1.2 DVP-ES3/EX3 CPU Modules and Their I/O Modules .................................. 1-3
1.1.3 DVP-SV3/SX3 CPU Modules and Their I/O Modules ............................... 1-10
1.2 Software .............................................................................................. 1-18
1.2.1 Program Editors ............................................................................... 1-18
1.2.2 Program Organization Units and Tasks ................................................. 1-21

1-1
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

1.1 Overview
_1 This manual introduces you to programming the DVP-ES3/EX3/SV3/SX3 Series programmable logic

controllers, the basic instructions, and the applied instructions.

1.1.1 Related Manuals

The related manuals for DVP-ES3/EX3/SV3/SX3 Series programmable logic controllers are listed below.

 DVP-ES3/EX3/SV3/SX3 Series Programming Manual (this manual)

This introduces programming for the DVP-ES3/EX3/SV3/SX3 Series programmable logic controllers, basic
instructions, and applied instructions.

For DVP-ES2/SX2 Series PLC, refer to DVP-ES2/EX2/SS2/SA2/SX2/SE & TP Operation Manual –


Programming. For DVP-SV2 Series PLC, refer to DVP-PLC Application Manual (Programming).

 ISPSoft User Manual / DIADesigner User Manual

This introduces the use of the ISPSoft software / DIADesigner software, programming language (Ladder,
SFC, FBD, and ST), POUs, and tasks.
DVP-ES3 Series PLC can only use ISPSoft and DIADesigner for programming, NOT WPLSoft.

DVP-ES300TEC/EX3/SV3/SX3 Series PLC can only use DIADesigner for programming, neither ISPSoft
nor WPLSoft.

 DVP-ES3/EX3/SV3/SX3 Series Hardware and Operation Manual

This introduces electrical specifications, dimensions, CPU functions, devices, extension I/O module
placement, troubleshooting, and so forth.

 DVP Series Module Manual

This introduces the use of I/O modules, such as network modules, analog modules, and temperature
modules.

1-2
Chapter 1 Product Introduction

1.1.2 DVP-ES3/EX3 CPU Modules and Their I/O Modules


1_
Classification Model Name Description

24 VDC powered CPU module

NPN transistor (sinking) output, 1x Ethernet port, 2x RS-485

DVP32ES311T ports, 1x USB port, 1x CAN, 1x Micro SD interface, supporting 32

I/Os (16DI+16DO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

NPN transistor (sinking) output, 1x Ethernet port, 2x RS-485

DVP32ES300T ports, 1x USB port, 1x CAN, 1x Micro SD interface, supporting 32

I/Os (16DI+16DO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP32ES300R CAN, 1x Micro SD interface, supporting 32 I/Os (16DI+16DO)

and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks


DVP-ES3

Series CPU 100-240 VAC powered CPU module

module NPN transistor (sinking) output, 1x Ethernet port, 2x RS-485

DVP48ES300T ports, 1x USB port, 1x CAN, 1x Micro SD interface, supporting 48

I/Os (24DI+24DO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x


DVP48ES300R CAN, 1x Micro SD interface, supporting 48 I/Os (24DI+24DO)

and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

NPN transistor (sinking) output, 1x Ethernet port, 2x RS-485

DVP64ES300T ports, 1x USB port, 1x CAN, 1x Micro SD interface, supporting 64

I/Os (32DI+32DO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

1-3
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 100-240 VAC powered CPU module

Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP64ES300R CAN, 1x Micro SD interface, supporting 64 I/Os (32DI+32DO)

and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

NPN transistor (sinking) output, 1x Ethernet port, 2x RS-485

DVP80ES300T ports, 1x USB port, 1x CAN, 1x Micro SD interface, supporting 80

I/Os (40DI+40DO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP80ES300R CAN, 1x Micro SD interface, supporting 80 I/Os (40DI+40DO)

and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

NPN transistor (sinking) output, 1x Ethernet port,1x EtherCAT


DVP-ES3
port, 2x RS-485 ports, 1x USB port, 1x Micro SD interface,
EtherCAT
DVP32ES300TEC supporting 32 I/Os (16DI+16DO) and up to 256 I/Os.
communication
Program capacity: 64K steps, removable terminal blocks.
CPU module
Supporting the 8-axis point-to-point positioning control (for Delta

drives only.)

100-240 VAC powered CPU module

NPN transistor (sinking) output, 2x Ethernet ports supporting the


DVP22EX300T switch function , 2x RS-485 ports, 1x USB port, 1x CAN,1x Micro

SD interface, supporting 22 I/Os (12DI+8DO+2AI) and up to 256


DVP-EX3
I/Os. Program capacity: 64K steps, removable terminal blocks.
Series CPU

module 100-240 VAC powered CPU module

Relay output, 2x Ethernet ports supporting switch function, 2x

DVP22EX300R RS-485 ports, 1x USB port, 1x CAN, 1x Micro SD interface,

supporting 22 I/Os (12DI+8DO+2AI) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks.

1-4
Chapter 1 Product Introduction

Classification Model Name Description

100-240 VAC powered CPU module 1_


NPN transistor (sinking) output, 2x Ethernet ports supporting the

switch function , 2x RS-485 ports, 1x USB port, 1x CAN,1x Micro


DVP36EX300T
SD interface, supporting 36 I/Os (16DI+16DO+2AI+2AO) and up

to 256 I/Os. Program capacity: 64K steps, removable terminal

blocks.

100-240 VAC powered CPU module

Relay output, 2x Ethernet ports supporting the switch function, 2x

DVP36EX300R RS-485 ports, 1x USB port, 1x CAN, 1x Micro SD interface,

supporting 36 I/Os (16DI+16DO+2AI+2AO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks

100-240 VAC powered CPU module

NPN transistor (sinking) output, differential input and output, 2x

Ethernet ports supporting the switch function, 2x RS-485 ports,


DVP28EX300MT
1x USB port, 1x CAN,1x Micro SD interface, supporting 28 I/Os

(4Diff. DI+8DI+4Diff. DO+8DO+2AI+2AO) and up to 256 I/Os.

Program capacity: 64K steps, removable terminal blocks.

8 inputs

DVP08XM211N 24VDC

5mA

4 inputs

24VDC

5mA

DVP08XP211R 4 Relay outputs


Digital
250VAC
input/output
Below 30VDC
module
2A/output, 5A/COM

4 inputs

24VDC

5mA
DVP08XP211T
4 NPN (sinking) outputs

5 – 30VDC

0.5A/output, 4A/COM

1-5
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 8 Relay outputs

250VAC
DVP08XN211R
Below 30VDC

2A/output, 5A/COM

8 NPN (sinking) outputs

DVP08XN211T 5 – 30VDC

0.5A/output, 4A/COM

16 inputs

DVP16XM211N 24VDC

5mA

8 inputs

24VDC

5mA

DVP16XP211R 8 Relay outputs

250VAC

Below 30VDC

2A/output, 5A/COM

8 inputs

24VDC

5mA
DVP16XP211T
8 NPN (sinking) outputs

5 – 30VDC

0.5A/output, 4A/COM

16 Relay outputs

250VAC
DVP16XN211R
Below 30VDC

2A/output, 5A/COM

16 NPN (sinking) outputs

DVP16XN211T 5 – 30VDC

0.5A/output, 4A/COM

1-6
Chapter 1 Product Introduction

Classification Model Name Description

16 inputs 1_
24VDC

5mA

DVP24XP200R 8 Relay outputs

250VAC

Below 30VDC

2A/output, 5A/COM

16 inputs

24VDC

5mA
DVP24XP200T
8 NPN (sinking) outputs

5 – 30VDC

0.5A/output, 4A/COM

24 Relay outputs

250VAC
DVP24XN200R
Below 30VDC

2A/output, 5A/COM

24 NPN (sinking) outputs

DVP24XN200T 5 – 30VDC

0.5A/output, 4A/COM

16 inputs

24VDC

5mA

DVP32XP200R 8 Relay outputs

250VAC

Below 30VDC

2A/output, 5A/COM

16 inputs

24VDC

DVP32XP200T 5mA

16 NPN (sinking) outputs

5 – 30VDC, 0.5A/output, 4A/COM

1-7
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 4-channel analog input

Hardware resolution 14 bits: -5V ~ +5V, -10V ~ +10V, -20mA ~

DVP04AD-E2 +20mA

Hardware resolution 13 bits: 0/4 ~ 20mA

Conversion time: 400 μs/channel

2-channel analog input

DVP02DA-E2 Hardware resolution 14 bits: -10V ~ +10V, -20mA ~ +20mA

Conversion time: 400 μs/channel

4-channel analog input module


Analog
DVP04DA-E2 Hardware resolution 14 bits: -10V ~ +10V, -20mA ~ +20mA
input/output

module Conversion time: 400 μs/channel

4-channel analog input

Hardware resolution 14 bits: -5V ~ +5V, -10V ~ +10V, -20mA ~

+20mA

Hardware resolution 13 bits: 0/4 ~ 20mA


DVP06XA-E2
Conversion time: 400 μs/channel

2-channel analog output

Hardware resolution 14 bits: -10V ~ +10V, -20mA ~ +20mA

Conversion time: 400 μs/channel

4-channel, 2-wire/3-wire RTD

Sensor type: Pt100 / Pt1000 / Ni100 / Ni1000 / 0-300Ω / 0-3000Ω

DVP04PT-E2 Resolution: 0.1°C/0.1°F (16 bits)

Conversion time: 200 ms/channel

PID controller
Temperature

measurement
6-channel, 2-wire/3-wire RTD
module
Sensor type: Pt100 / Pt1000 / Ni100 / Ni1000 / Cu50 / Cu100 /

0-300Ω / 0-3000Ω / JPt100 / LG-Ni1000


DVP06PT-E2
Resolution: 0.1°C/0.1°F (16 bits)

Conversion time: 200 ms/channel

PID controller

1-8
Chapter 1 Product Introduction

Classification Model Name Description

4-channel thermocouple 1_
Sensor type: J, K, R, S, T, E, N and -80 to +80 mV

DVP04TC-E2 Resolution: 0.1°C/0.1°F (16 bits)

Conversion time: 200 ms/channel

PID controller

2-axis motion control

5-24 VDC, 1 differential input (A/B/Z phase), maximum hardware

Positioning input frequency at 200 kHz, 24 VDC, 5 mA, 5 inputs, maximum


AS02PU-A
module hardware input frequency at 1 kHz,

5 VDC, 2-axis (4 points) differential outputs, maximum output

frequency at 200 kHz

External

terminal DVPAEXT01-E2 For connecting I/O extension modules

module

1-9
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

1.1.3 DVP-SV3/SX3 CPU Modules and Their I/O Modules


_1
Classification Model Name Description

Input: 100~240 VAC, 50/60 Hz


DVPPS01
Output: 24 VDC/1A, 24 W

Power supply Input: 100~240 VAC, 50/60 Hz


DVPPS02
module Output: 24 VDC/2A, 48 W

Input: 100~240VAC, 50/60Hz


DVPPS05
Output: 24VDC/5A, 120W

24 VDC powered CPU module

NPN (sinking) output, 1x Ethernet port, 2x RS-485 ports, 1x USB

DVP28SV311T port, 1x CAN and 1x Micro SD interface, 28 I/Os (16DI+12DO),


supporting up to 256 inputs and 252 outputs.

Program capacity: 64K steps, removable terminal blocks

24 VDC powered CPU module

DVP-SV3 Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

Series DVP28SV311R CAN and 1x Micro SD interface, 28 I/Os (16DI+12DO),

CPU module supporting up to 256 inputs and 252 outputs.

Program capacity: 64K steps, removable terminal blocks

24 VDC powered CPU module

PNP output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP28SV311S CAN and 1x Micro SD interface, 28 I/Os (16DI+12DO),

supporting up to 256 inputs and 252 outputs.

Program capacity: 64K steps, removable terminal blocks

24 VDC powered CPU module

NPN (sinking) output, 1x Ethernet port, 2x RS-485 ports, 1x USB


DVP-SX3
port, 1x CAN and 1x Micro SD interface, 20 I/Os
Series DVP20SX311T
(8DI+6DO+4AI+2AO), supporting up to 248 inputs and 246
CPU module
outputs.

Program capacity: 64K steps, removable terminal blocks

1-10
Chapter 1 Product Introduction

Classification Model Name Description

24 VDC powered CPU module 1_


Relay output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP20SX311R CAN and 1x Micro SD interface, 20 I/Os (8DI+6DO+4AI+2AO),

supporting up to 248 inputs and 246 outputs.

Program capacity: 64K steps, removable terminal blocks

24 VDC powered CPU module

PNP output, 1x Ethernet port, 2x RS-485 ports, 1x USB port, 1x

DVP20SX311S CAN and 1x Micro SD interface, 20 I/Os (8DI+6DO+4AI+2AO),

supporting up to 248 inputs and 246 outputs.

Program capacity: 64K steps, removable terminal blocks

6 Relay outputs

250VAC
DVP06SN11R
Below 30VDC

6A/output

6 Relay outputs

250VAC

DVP08SN11R Below 30VDC

1.5A/output

5A/COM

8 NPN (sinking) outputs

Digital 30VDC

input/output 55°C, 0.1A/output


module DVP08SN11T 50°C, 0.15A/output

45°C, 0.2A/output

40°C, 0.3A/output

2A/COM

16 NPN (sinking) outputs

30VDC

55°C, 0.1A/output

DVP16SN11T 50°C, 0.15A/output

45°C, 0.2A/output

40°C, 0.3A/output

2A/COM

1 - 11
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 4 inputs, 24VDC, 5mA


DVP08SP11R
4 Relay outputs, 250VAC, below 30VDC, 0.5A/output, 5A/COM

4 inputs, 24VDC, 5mA

4 NPN (sinking) outputs, 30VDC

55°C, 0.1A/output

DVP08SP11T 50°C, 0.15A/output

45°C, 0.2A/output

40°C, 0.3A/output

2A/COM

8 inputs

DVP08SM11N 24VDC

5mA

8 inputs

DVP08SM10N 85~132VAC (50~60Hz)

9.2mA (10VAC/60Hz)

8 PNP (sourcing) outputs

30VDC
DVP08SN11TS
55°C, 0.3A/output

2A/COM

DVP08ST11N 8 inputs (DIP switch)

8 inputs, 24VDC, 5mA


DVP16SP11R
8 Relay outputs, 250VAC/ below 30VDC, 1.5A/ output, 5A/COM

4 inputs, 24VDC, 5mA


DVP08SP11TS
4 PNP (sourcing) outputs, 30VDC, 55°C, 0.3A/output, 2A/COM

8 inputs, 24VDC, 5mA

8 NPN (sinking) outputs, 30VDC,

55°C, 0.1A/output

DVP16SP11T 50°C, 0.15A/output

45°C, 0.2A/output

40°C, 0.3A/output

2A/COM

1-12
Chapter 1 Product Introduction

Classification Model Name Description

8 inputs, 24VDC, 5mA 1_


DVP16SP11TS
8 PNP (sourcing) outputs, 30VDC, 55°C, 0.3A/output, 2A/COM

DVP16SN11TS 16 PNP (sourcing) outputs, 30VDC, 55°C, 0.3A/output, 2A/COM

DVP16SM11N 16 inputs, 24VDC, 5mA

DVP32SN11TN 32 inputs, 24VDC, 5mA

32 NPN (sinking) outputs

5~30VDC

DVP32SM11N 0.1A/output

55°C, 1.0A/COM

25°C, 2.2A/COM

4-channel analog input (differential)

Resolution 14 bits: -10~10V, -6~10V


DVP04AD-S2
Resolution 13 bits: -20~20mA, -12~20mA

Conversion time: 3ms /channel

4-channel analog output

DVP04DA-S2 Resolution 12 bits: 0~10V, 2~10V, 0~20mA, 4~20mA

Conversion time: 3ms /channel

4-channel analog input (differential)


Analog
Resolution 12 bits: -10~10V, -6~10V
input/output

module Resolution 11 bits: -20~20mA, -12~20mA

DVP06XA-S2 Conversion time: 3ms/channel

2-channel analog output

Resolution 12 bits: 0~10V, 2~10V, 0~20mA, 4~20mA

Conversion time: 3ms/channel

2-channel analog output

DVP02DA-S Resolution 12 bits: 0~10V, 2~10V, 0~20mA, 4~20mA

Conversion time: 3ms/channel

1-13
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 6-channel analog input

Resolution 14 bits: -10~10V, -6~10V


DVP06AD-S
Resolution 13 bits: -20~20mA, -12~20mA

Conversion time: 3ms/channel

4-channel analog input (differential)

Resolution 16 bits: -10~10V, -5~5V, -20~20mA


DVP04AD-SL
Left-side Resolution 15 bits: 0~20mA, 4~20mA

high-speed Conversion time: 250us/channel

analog I/O 4-channel analog output


module Resolution 16 bits: 0~10V, -10~10V
DVP04DA-SL
Resolution 15 bits: 0~20mA, 4~20mA

Conversion time: 250us/channel

1 channel

DVP201LC-SL 24-bit resolution: 0~80mV/V

With one RS-485 port, it can work alone.

1 channel

24-bit resolution: 0~80mV/V


DVP211LC-SL
I/O: 2DI/4DO/1AO
Left-side
With one RS-485 port, it can work alone.
high-speed
2 channels
load cell
DVP202LC-SL 24-bit resolution: 0~80mV/V
module
With one RS-485 port, it can work alone.

2 channels
DVP02LC-SL
20-bit resolution: 0~6mV/V

1 channel
DVP01LC-SL
20-bit resolution: 0~6mV/V

1-14
Chapter 1 Product Introduction

Classification Model Name Description

4-channel, 2-wire/3-wire RTD; 1_


Sensor type: Pt100 / Pt1000 / Ni100 / Ni1000 / LG-Ni1000 /

Cu100 / Cu50 / 0~300Ω / 0~3000Ω;


DVP04PT-S
Resolution: 0.1°C/0.18°F;

Conversion time: 200 ms/channel;

PID controller

6-channel, 2-wire/3-wire RTD;

Sensor type: Pt100 / Pt1000 / Ni100 / Ni1000 / LG-Ni1000 /

DVP06PT-S Cu100 / Cu50 / 0~300Ω / 0~3000Ω;

Resolution: 0.1°C/0.18°F;

Conversion time: 160 ms/channel

4-channel thermocouple;

Sensor type: J, K, R, S, T;
Temperature
DVP04TC-S Resolution: 0.1°C/18°F;
measurement
Conversion time: 200 ms/channel
module
PID controller

8-channel thermistor (NTC)

Sensor type: Pt1000, Ni1000, LG-Ni1000, CTN10K, CTN100K,

DVP08NTC-S NTC20K, NTC30K, PT-42H, PT-43, PT-51F, PT-25E2, PT-312,

KTY81, two user-defined tables

Resolution: 0.1°C

2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA

Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

DVP02TUN-S Ni1000, LG-Ni1000

Resolution: 0.1°C (16-bit)

4 transistor (sinking) outputs: 24 VDC/300 mA

Output points: controlled by PID or manual

1-15
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Classification Model Name Description

_1 2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA

Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

DVP02TUR-S Ni1000, LG-Ni1000

Resolution: 0.1°C (16-bit)

4 relay outputs: 240 VAC/2 A

Temperature Output points: controlled by PID or manual

measurement 2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA


module Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

Ni1000, LG-Ni1000
DVP02TUL-S
Resolution: 0.1°C (16-bit)

2 analog outputs: 0~10V, 0~20 mA, 4~20 mA

Resolution: 12-bit

Output points: controlled by PID or manual

2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA

Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

DVP02TKN-S Ni1000, LG-Ni1000

Resolution: 0.1°C (16-bit)

Remote 4 NPN (sinking) outputs: 24 VDC/300 mA

temperature Output points: controlled by PID or manual

measurement 2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA


module Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

DVP02TKR-S Ni1000, LG-Ni1000

Resolution: 0.1°C (16-bit)

4 relay outputs: 240 VAC/2 A

Output points: controlled by PID or manual

1-16
Chapter 1 Product Introduction

Classification Model Name Description

2 generic analog inputs: 0~10V, 0~20 mA, 4~20 mA 1_


Thermocouple: J, K, R, S, T, E, N, B, C, L, U, TXK (L), PLII

Thermistor: Pt100, JPt100, Pt1000, Cu50, Cu100, Ni100, Ni120,

Ni1000, LG-Ni1000
DVP02TKL-S
Resolution: 0.1°C (16-bit)

2 analog outputs: 0~10V, 0~20 mA, 4~20 mA

Resolution: 12-bit

Output points: controlled by PID or manual

Positioning
DVP01PU-S Single-axis positioning module; 200k Hz
module

2-axis motion control

5-24 VDC, 1 differential input (A/B/Z phase), maximum hardware

Left-side input frequency 200k Hz;

positioning DVP02PU-SL 24 VDC, 5 mA, 5 inputs, maximum hardware input frequency 1k


module Hz;

5 VDC, 2-axis (4 points) differential outputs, maximum output

frequency 200k Hz

Ethernet module
DVPEN01-SL
10/100Mbps

DeviceNet master module


DVPDNET-SL
500k bps

CANopen master module


Left-side DVPCOPM-SL
1m bps
communication
PROFIBUS DP slave module
module DVPPF02-SL
12Mbps

RS-485/RS-422 serial communication module


DVPSCM12-SL
460k bps

BACnet MS/TP slave module


DVPSCM52-SL
460k bps

1-17
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

1.2 Software
_1 1.2.1 Program Editors

The section describes the program editors ISPSoft and DIADesigner.

 ISPSoft

 DIADesigner

 There are four types of programming languages: structure text (ST), ladder diagram (LD), sequential

function chart (SFC), and continuous function chart (CFC).

NOTE: ISPSoft version 3.08 or higher supports ES3 Series programming. And DIADesigner version 1.30

or higher supports ES300TEC and EX3/SV3/SX3 series programming.

1-18
Chapter 1 Product Introduction

ISPSoft DIADesigner 1_

 User-defined variables allow you to define a variable to replace a PLC device name. This enhances the

readability of the program, and saves time when addressing the device.

ISPSoft

1-19
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

_1

DIADesigner

 The Program Organization Unit (POU) framework divides the main program into several program units,

and also replaces the traditional subroutines with functions and function blocks. It makes the framework of

the program modular and easier to manage.

 Tasks manage the execution order of the programs. Tasks help you manage large-scale program

development.

ISPSoft

1-20
Chapter 1 Product Introduction

1_

DIADesigner

1.2.2 Program Organization Units and Tasks

The Program Organization Units (POUs) are the basic elements that constitute the PLC program. Unlike the

traditional PLC program, the program framework introduced by IEC 61131-3 allows you to divide a large

program into several small units. These small units are called POUs. The POUs can be classified into three

types.

1. Program (PROG): The program POU is the main program in the PLC. You can define the execution of
this POU t to be cyclic scan or interrupt driven, and arrange the scan order in the task list for program

POUs.

2. Function block (FB): The function block (FB) POU is similar to a subroutine. The instructions in the
function block are executed after a program POU calls the function block with the related parameters.

3. Function (FC): The function (FC) POU in similar to a macro instruction. That is, you can write many
operation instructions or functions into a function-type POU, and then use then in a program POU or a

function block POU.

Tasks are functions that control the order of program execution or according to certain interrupt conditions. The

task provides each program POU with a specific execution task, and specifies the execution order for the

program POUs or the way to enable them.

Normally, only some of the program POUs in a project take part in the actual execution. The task controls

whether to execute the program POU or not, and how to execute it. If the POU of the program type is not

assigned in the task, the program POU is saved as ordinary source code with the project instead of being

compiled into the execution code for the PLC. In addition, only the program POU needs to be assigned to the

task. Function block POUs or function POUs are automatically called by the program POU. There are three

types of tasks.

1. Cyclic task: The program POUs assigned to cyclic tasks are scanned cyclically, and executed in order.

1-21
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

2. Timed interrupt task: If the interrupt time is reached, all program POUs assigned to the timed interrupt

_1 task are executed in order.

3. Conditional interrupt task: Conditional Interrupts can be divided into several types, such as external
interrupts, and I/O interrupts. You must make sure that the PLC supports the interrupts before you use

conditional interrupts in a project. If you assign a program POU to a conditional interrupt task, the

program POU is similar to an interrupt subroutine. When the interrupt condition is satisfied (for example,

the contact of the external interrupt is triggered) then all program POUs assigned to the conditional

interrupt task are executed in order.

1-22
2
Chapter 2 Devices

Table of Contents
2.1 Introduction to Devices ......................................................................... 2-2
2.1.1 Device Table ................................................................................. 2-2
2.1.2 Basic Structure of I/O Storage ......................................................... 2-3
2.1.3 Relation Between the PLC Action and the Device Type ........................ 2-3
2.1.4 Latched Areas in the Device Range .................................................. 2-4

2.2. Device Functions .................................................................................. 2-6


2.2.1 Values and Constants ..................................................................... 2-6
2.2.2 Floating-point Numbers .................................................................. 2-8
2.2.3 Strings ......................................................................................... 2-9
2.2.4 Input Relays (X) ...........................................................................2-10
2.2.5 Output Relays (Y) .........................................................................2-11
2.2.6 Auxiliary Relays (M) ......................................................................2-11
2.2.7 Special Auxiliary Relays (SM) .........................................................2-12
2.2.8 Refresh Time for Special Auxiliary Relays .........................................2-44
2.2.9 Stepping Relays (S) ......................................................................2-51
2.2.10 Timers (T) ...................................................................................2-52
2.2.11 Counters ......................................................................................2-53
2.2.12 32-bit Counters (HC) .....................................................................2-55
2.2.13 Data Registers (D) ........................................................................2-58
2.2.14 Special Data Registers (SR) ...........................................................2-59
2.2.15 Special Data Registers Refresh Conditions........................................2-93
2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data
Registers .....................................................................................2-97
2.2.17 Index Register (E) ...................................................................... 2-130
2.2.18 File Registers (FR) ...................................................................... 2-130

2-1
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.1 Introduction to Devices


This section describes the values and strings processed by the PLC. It also describes the functions of devices, including
input, output and auxiliary relays, as well as timers, counters, and data registers. The PLC simulates external devices in
the PLC’s internal memory, so the word “device” is a generic name that refers to all the internal memory locations in the
PLC. A device can be a bit device or a word device. Bit devices simulate coils, contacts and flags, while word devices
simulate registers.
_2

2.1.1 Device Table


Type Device name Number of devices Range
Input relay X 256 X0–X377*1
Output relay Y 256 Y0–Y377*2
D 48,0000 D0.0–D29999.15
Data register
W 48,0000 W0.0–W29999.15 *6

Bit device Auxiliary relay M 8192 M0–M8191


Special auxiliary relay SM 2048 SM0–SM4095
Flag S 2048 S0–S2047
Timer T 512 T0–T511
Counter C 512 C0–C511
32-bit counter HC 256 HC0–HC255
Input relay X 64 X0–X63
Output relay Y 64 Y0–Y63

D 30000 D0–D29999
Data register
W 30000 W0–W29999 *6

Special auxiliary relay SR 2048 SR0–SR2047


Word device
File register FR 65536 FR0–FR65535

Timer T 512 T0–T511


Counter C 512 C0–C511
32-bit counter HC 256(512 words) HC0–HC255
10 E0–E9
Index register E
5 E10–E14 *6

16 bits: -32768 to 32767


Constant*3 Decimal system K
32 bits: -2147483648 to 2147483647

16 bits: 16#0–16#FFFF
Hexadecimal system 16#
32 bits: 16#0–16#FFFFFFFF
Constant*4
Single-precision
F 32 bits: ±1.17549435-38 to ±3.40282347+ 38
floating-point number
String*5 String “$” 1–31 characters

*1. For DVP-SV3/SX3 series PLC, 16 inputs (X0-X17) and 16 outputs (Y0-Y17) are taken. For DVP20SX3, only 8 inputs
(X0-X7) are taken but since X10-X17 are reserved, the input point for extension is starting from X20.
*2. For DVP-SV3/SX3 series PLC, 16 inputs (X0-X17) and 16 outputs (Y0-Y17) are taken. For DVP28SV3, only 12
outputs (Y0-Y13) are taken but since Y14-Y17 are reserved, the output point for extension is starting from Y20.

2-2
Ch a pt er 2 D e v ic es

For DVP20SX3, only 6 outputs (Y0-Y5) are taken, but since Y6-Y17 are reserved, the output point for extension is
starting from Y20.

*3: Constants are indicated by K in the device lists in Chapter 5 and Chapter 6 in the DVP-ES3/EX3/SV3/SX3 Series
Programming Manual. For example, when “K50” appears in the DVP-ES3/EX3/SV3/SX3 Series Programming Manual,
enter only the number 50 in ISPSoft /DIADesigner.

*4: Floating-point numbers are indicated by F/DF in the device lists in Chapter 5 and Chapter 6 in the DVP-ES3/EX3/SV3/ _2
SX3 Series Programming Manual, but they are represented by decimal points in ISPSoft/DIADesigner. For example,
for the floating-point number F500, enter 500.0 in ISPSoft/DIADesigner.

*5: Strings are indicated by $ in Chapter 5 and Chapter 6 in DVP-ES3/EX3/SV3/SX3 Series Programming Manual, but
they are represented by quotes (“ ”) in ISPSoft/DIADesigner. For example, for the string of 1234, enter “1234” in
ISPSoft/DIADesigner.

*6: Used for editing in ISPSoft/DIADesigner only.

2.1.2 Basic Structure of I/O Storage


Modify by ISPSoft Force the bit
Device Function Access by bits Access by words
/DIADesigner ON/OFF
X Input relay OK OK OK OK
Y Output relay OK OK OK OK
M Auxiliary relay OK - OK -
Special auxiliary
SM OK - OK -
relay
S Flag OK - OK -
T Timer OK OK OK -
C Counter OK OK OK -
HC 32-bit counter OK OK OK -
D Data register OK OK OK OK
Special data
SR - OK OK -
register
FR File register - OK*1 - -
E Index register - OK OK -
*1: Use an instruction for writing to an FR.

2.1.3 Relation Between the PLC Action and the Device Type
Device type Non-latched area Latched area

PLC action Other


Device Y File register Other devices
devices
Power: OFF→ON Cleared Cleared Retained Retained
Restore to defaults Cleared Cleared Cleared Cleared
The non-latched area is cleared. Cleared Cleared Retained Retained
STOP=>
RUN*1 The state of the non-latched area is
retained. Retained Retained Retained Retained
The state of
RUN=>
device Y is SM203=OFF Cleared Retained Retained Retained
STOP*1 cleared.

2-3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Device type Non-latched area Latched area

PLC action Other


Device Y File register Other devices
devices
The state of
device Y is SM203=OFF Retained Retained Retained Retained
retained.
The state of
_2 device Y is SM203=ON*3 Cleared Cleared Retained Retained
cleared.
The state of
device Y is SM203=ON Retained Cleared Retained Retained
retained.
SM204 is ON.
Cleared Cleared Retained Retained
(All non-latched areas are cleared.) *2
SM205 is ON.
Retained Retained Retained Cleared
(All latched areas are cleared.) *2
*1: For more on setting the states, see the hardware configuration of the editing software (HWCONFIG). The default for
PLC STOP->RUN is “clear not-latched area”. The default for PLC RUN->STOP is “clear the state of device Y”.

*2: The SM switches from OFF to ON, the latched areas are cleared. After the clearing is complete, SM switches from ON
to OFF automatically.

*3: When SM203=ON, the system clear the non-latched area once. This is available for ES3 PLC CPU with firmware
V1.04.00 or later and for EX3/SV3/SX3 PLC CPU with firmware V1.00.00 or later.

2.1.4 Latched Areas in the Device Range


Device Function Device range Latched area

X Input relay X0–X377 All devices are non-latched.

Y Output relay Y0–Y377 All devices are non-latched.

M*1 Auxiliary relay M0–M8191 The default range is M6000–M8191.

Some devices are latched, and cannot be


SM Special auxiliary relay SM0–SM2047 changed. Refer to the list of special auxiliary
relays for more information.

S*1 Flag S0–S2047 The default range is S512–S1023

T Timer T0–T511 All devices are non-latched.

C*1 Counter C0–C511 The default range is C448–C511

HC*1 32-bit counter HC0–HC255 The default range is HC128–HC255

D0–D29999 The default range is D20000–D29999


D*1 Data register
W0–W29999 *2

FR File register FR0–FR65535 All devices are latched.

Some are latched, and cannot be changed. Refer


SR Special data register SR0–SR2047 to the list of special data registers for more
information.

2-4
Ch a pt er 2 D e v ic es

Device Function Device range Latched area

E0–E9 All devices are non-latched.


E Index register
E10–E14 *2

*1: For more information on setting the latched area, see the setting in the hardware configuration of the software
(HWCONFIG). Setting the latched area means the other areas are seen as non-latched areas. The range of latched
areas cannot exceed the device range. For example, setting M600–M7000 as latched areas makes M0–M5999 and _2
M7001–M8191 non-latched areas.

*2: Used for editing in ISPSoft/DIADesigner only.

2-5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2. Device Functions


The following flow chart shows the procedure for processing a program in the PLC.

 Regenerating the input signal


Input terminal X 1. Before the program is executed, the state of the external input
Regener ating the input signal signal is read into the memory location for the input signal.
_2 Device memor y
2. When program is executed, the state in the memory location
for the input signal does not change even if the input signal
Device memor y

changes from ON to OFF or from OFF to ON. The input signal


P roc ess ing t he program is not refreshed until the next scan begins.
 Processing the program
After the input signal is refreshed, the instructions in the program
Device memor y
are executed in order from the start address of the program. The
results are stored in the device memory.
Regenerating the output signal  Regenerating the state of the output
and sending it to the output terminal
After the instruction END is executed, the state in the device
memory is sent to the specified output terminal.

2.2.1 Values and Constants


Name Description
Bit A bit is the basic unit in the binary system. Its state is either 1 or 0.
A nibble is composed of four consecutive bits (for example b3–b0). Nibbles
Nibble
can represent 0–9 in the decimal system, or 0–F in the hexadecimal system.

A byte is composed of two consecutive nibbles (8 bits, b7–b0). Bytes can


Byte
represent 00–FF in the hexadecimal system.

A word is composed of two consecutive bytes (16 bits, b15–b0). Words can
Word
represent 0000–FFFF in the hexadecimal system.

A double word is composed of two consecutive words (i.e. 32 bits, b31–b0).


Double word
Double words represent 00000000–FFFFFFFF in the hexadecimal system.
The relation among bits, nibbles, bytes, words, and double words in the binary system is shown in the picture below.

DW Double word

W1 W0
Word
BY3 B Y2 BY1 B Y0 Byte

NB7 NB6 NB5 NB4 NB3 NB2 NB1 NB0 Nibble

b31b30 b29 b28b27b26b25b24b23b22 b21b20b19b18b17b16 b15b14b13 b12b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Bit

The PLC uses four types of values to execute the operation according to different control purposes.

1. Binary number (BIN)

The PLC uses the binary system to operate on the values.

2-6
Ch a pt er 2 D e v ic es

2. Octal number (OCT)


DVP-PLC uses the octal number on the external input and output device number. For example:

External input device number: X0-X7, X10-X17, to X377.

External output device number: Y0-Y7, Y10-Y17, to Y377.

3. Decimal number (DEC)


_2
The PLC uses decimal numbers for:

 The setting value of a timer (T) or the setting value of a counter (C/HC); for example, TMR C0 50 (constant K).

 The device number S, M, T, C, D, E; for example, M10 and T30 (device number)

 The constant K, used as the operand in an applied instruction. For example, MOV 123 D0 (constant K).

4. Binary-coded decimal (BCD)

A decimal value that is represented by a nibble or four bits so that sixteen consecutive bits represent a four-digit
decimal value.

5. Hexadecimal number (HEX)

The PLC uses hexadecimal numbers for:

 The constant 16#, used as the operand in an applied instruction; for example, MOV 16#1A2B D0

(hexadecimal constant).

The following table shows the corresponding values.

Binary Number Decimal Number Binary Code Decimal Hexadecimal Number


(BIN) (DEC) (BCD) (HEX)

Constant K, Constant 16#,


PLC internal execution BCD related instruction
Device number Device number
0000 0 0000 0
0001 1 0001 1
0010 2 0010 2
0011 3 0011 3
0100 4 0100 4
0101 5 0101 5
0110 6 0110 6
0111 7 0111 7
1000 8 1000 8
1001 9 1001 9
1010 10 - A
1011 11 - B
1100 12 - C
1101 13 - D
1110 14 - E
1111 15 - F
10000 16 0001 0000 10
10001 17 0001 0001 11

2-7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2.2 Floating-point Numbers


Floating-point numbers are represented by decimal points in ISPSoft/DIADesigner. For example, the floating-point
number 500 is represented as 500.0.

2.2.2.1 Single-precision Floating-point Numbers


_2 Floating-point numbers are represented by a 32-bit register. The representation adopts the IEEE754 standard, and the
format shown in the following picture.
8 -b it 2 3- bi t

S E xpo ne nt Ma nti ssa

b 31 b0

S ig n b it
0 : Po siti ve
1 : Neg ati ve

Equation:
(− 1)S × 2 E − B × 1.M ; B = 127
The single-precision floating-point numbers range between ±2-126 to ±2+128, and correspond to the range between
±1.1755×10-38 to ±3.4028×10+38.

The DVP-ES3/EX3/SV3/SX3 Series PLC uses two consecutive registers for a 32-bit floating-point number. Take (D1, D0)
for example.

D1(b15~b 0) D0(b15~b0)

2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
S E7 E6 E5 E1 E0 A 22 A2 1 A2 0 A6 A5 A4 A3 A2 A1 A0

b 31 b3 0 b 29 b 28 b 24 b 23 b 22 b2 1 b2 0 b6 b5 b4 b3 b2 b1 b0

Exponent (8 bits) Mantissa ( 23bits)


The position where the decimal point is hidden

Mantissa sign bit (0: Positive; 1: Negative)


When b0~b31 are zeros, the content is zero.

Example 1:

23 is represented by a single-precision floating-point number.


Step 1: Convert 23 into the binary number, 23.0=10111.

Step 2: Normalize the binary number, 10111=1.0111 ×24 (0111 is the mantissa, and 4 is the exponent.).

Step 3: Get the value of the exponent.

∵ E-B=4→E-127=4 ∴ E=131=100000112

Step 4: Combine the sign bit, the exponent, and the mantissa to form the floating-point number.

0 10000011 011100000000000000000002=41B8000016

2-8
Ch a pt er 2 D e v ic es

Example 2:

-23 is represented by a single-precision floating-point number.

Converting -23.0 into the floating-point number uses the same steps as converting 23.0 into the floating-point number,
except that the sign bit is 1.

1 10000011 011100000000000000000002=C1B8000016
_2

2.2.2.2 Decimal Floating-point Numbers

 Single-precision floating-point numbers and double-precision floating-point numbers can be converted into decimal
floating-point numbers so people can read them. However, internally the PLC uses single-precision floating-point
numbers and double-precision floating-point numbers.

 A 32-bit decimal floating-point number is represented by two consecutive registers. The constant is stored in the first
register whose number is smaller while the exponent is stored in the register whose number is bigger. Take (D1, D0)
for example.
[E xp on e nt D1 ]
Decimal floating-point number=[Constant D0 ]* 10

Base number D0=±1,000 to ±9,999

Exponent D1=-41 to +35

The base number 100 does not exist in D0 because 100 is represented by 1,000×10-1. 32-bit decimal floating-point
numbers range between ±1175×10-41 to ±402×10+35.

2.2.3 Strings
The PLC can process strings composed of ASCII codes (*1). A complete string begins with a start character, and ends
with an ending character (NULL code). Strings can have maximum length of 31 characters, and ISPSoft/DIADesigner
automatically adds the ending character (16#00).

1. No string (NULL code) is moved.

D0=0 (NULL)

2. The string has an even number of characters.

D0 16#62 (b) 16#61 (a)

D1 16#64 (d) 16#63 (c)

D2 0 (NULL)

2-9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. The string has an odd number of characters.

_2 D0 16#62 (b) 16#61 (a)

D1 16#64 (d) 16#63 (c)

D2 0 (NULL) 16#65 (e)

*1: ASCII code chart

Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F

ASCII                

Hex 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F

ASCII                

Hex 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F

ASCII SP ! " # $ % & ' ( ) * + , - . /

Hex 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

ASCII 0 1 2 3 4 5 6 7 8 9 : ; < = > ?

Hex 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F

ASCII @ A B C D E F G H I J K L M N O

Hex 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F

ASCII P Q R S T U V W X Y Z     

Hex 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F

ASCII ` a b c d e f g h i j k l M n o

Hex 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F

ASCII p q r s t u v w x y z { | } – 
Note:  represents an invisible character. Do not use it in strings.

2.2.4 Input Relays (X)


 Input function

The input is connected to the input device (external devices such as button switches, rotary switches, and number
switches), and the PLC reads the input signal. You can use input contact A or contact B several times in the program,
and the ON/OFF state of the input varies with the ON/OFF state of the input device.

 Input number (the octal number)

For the PLC, the input numbers start from X0. The number of inputs varies with the number of inputs on the digital
input/output modules. The inputs are numbered according to the order in which the digital input/output modules are
connected to the CPU module. The maximum number of inputs for the PLC is 256, and the input number range is
between X0 to X377.

2-10
Ch a pt er 2 D e v ic es

 Input type

Inputs are classified into two types.

1. Regenerated inputs: The PLC reads the state of a regenerated input before the program is executed; for
example, LD X0.

2. Direct input: The state of a direct input is read by the PLC during the execution of the instructions; for example,
LD DX0.
_2
Note: To refresh the inputs immediately during the scan cycle is only possible for the built-in input points (DX0 to
DX17); not available for input points on digital I/O modules.

2.2.5 Output Relays (Y)


 Output function

The output sends the ON/OFF signal to drive the load connected to the output, such as an external signal lamp, a
digital display, or an electromagnetic valve. There are four types of outputs. They are relays, transistors (NPN and
PNP), and TRIACs (thyristors). You can use the output contact A or contact B several times in the program. Use
output Y only once in the program; otherwise, according the PLC’s program-scanning function, the state of the output
depends on the circuit connected to the last output Y in the program.

 Output number (the octal number)

For the PLC, the output numbers start from Y0. The number of outputs varies with the number of outputs on the digital
input/output modules. The outputs are numbered according to the order in which the digital input/output modules are
connected to the PLC. The maximum number of outputs on the PLC is 256, and the range is between Y0 and Y377.

An output that is not used as an output device can be used as a general device.

 Output types
Outputs are classified into two types.

1. Regenerated output: The state of a regenerated output is not written until the program executes the END
instruction, according to the states of the outputs; for example, OUT Y0.

2. Direct output: The state of a direct output is written by the PLC during the execution of the instructions, according
to the states of the outputs; for example, OUT DY0.

Note: To refresh the outputs immediately during the scan cycle is only possible for the built-in output points (DY0 to
DY17); not available for output points on digital I/O modules.

2.2.6 Auxiliary Relays (M)


The auxiliary relay has contact A and contact B. It can be used several times in the program. You can combine the control
loops by using the auxiliary relay, but you cannot drive the external load using the auxiliary relay. You can use the auxiliary
relays in either of the following two ways.

1. For general use: In general use, if an electric power failure occurs when the PLC is running, the
auxiliary relay resets to the OFF state. When the power is restored, the auxiliary
relay remains in the OFF state.

2. For latched use: In latched use, if an electric power failure occurs when the PLC is running, the state
of the auxiliary relay is retained. When the power is restored, the relay state remains
the same as before the power failure.

2 - 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2.7 Special Auxiliary Relays (SM)


Every special auxiliary relay has its specific function. Do not use the special auxiliary relays which are not defined.

The special auxiliary relays and their functions are listed as follows. As to the SM numbers marked “*”, you can refer to the
additional remarks on special auxiliary relays/special data registers. “R” in the Attribute column indicates that the special
auxiliary relay can be read only, whereas “R/W” in the attribute column indicates that it can be read and written. In addition,
the mark “–” indicates that the status of the special auxiliary relay does not make any change. The mark “#” indicates that
_2 the system will be set according to the status of the PLC, and users can read the setting value and refer to the related
manual for more information. "Y" in the Latched column indicates that the special auxiliary relay is latched and "N"
indicates it is non-latched. "H" means the PLC executes the program based on the setting in HWCONFIG of ISPSoft or in
Hardware Configuration of DIADesigner when the power is on, and you can edit the programs during program execution,
but the original settings in the software do not change.

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM0 Error: the operation or operand exceeds the allowed range V V OFF OFF – N R OFF
Error: the operation or operand exceeds the allowed range is
SM1 V V OFF OFF – N R OFF
locked.
SM5 Instruction inspection error V V OFF OFF – N R OFF
SM6 Data lost in the latched area V V OFF – – N R/W OFF
SM7 Insufficient power supply (24 V) V V OFF – – N R OFF
*SM8 Watchdog timer error V V OFF – – N R OFF
SM9 System error V V OFF – – N R OFF
SM10 I/O bus error V V OFF – – N R OFF
*SM22 Clearing the error log V V OFF OFF OFF N R/W OFF
SM23 Clearing the download log V V OFF OFF OFF N R/W OFF
SM24 Clearing the state-changing log of the PLC V V OFF OFF OFF N R/W OFF
The online-editing processing flag is on when the
SM25 V V OFF – – N R OFF
online-editing mode starts.
The debugging mode processing flag is on when the
SM26 V V OFF – – N R OFF
debugging mode starts.
*SM27 AD analog input alarm flag Χ V OFF – – N R OFF
Error: the output point is the same as the output that the high
SM28 V V OFF OFF OFF N R/W OFF
speed instruction used
Error flag: during the output of CSFO, the output frequency
SM29 calculated by conversion ratio exceeds the upper limit or no V V OFF OFF – N R/W OFF
pulses are input but it keeps outputting.
SM34 Incorrect password V V OFF – – N R/W OFF
Enable saving data to the memory card. When ON, the PLC
*SM36 V V OFF – – N R/W OFF
runs according to the value in SR36.
*SM96 Data is sent through COM1. V V OFF OFF – N R/W OFF
*SM97 Data is sent through COM2. V V OFF OFF – N R/W OFF
*SM98 Waiting to receive the reply through COM1 V V OFF OFF – N R OFF
*SM99 Waiting to receive the reply through COM2 V V OFF OFF – N R OFF
*SM100 Reception through COM1 is complete. V V OFF OFF – N R/W OFF
*SM101 Reception through COM2 is complete. V V OFF OFF – N R/W OFF
Error during receiving data through COM1 when using a
*SM102 V V OFF OFF – N R/W OFF
communication instruction.
Error during receiving data through COM2 when using a
*SM103 V V OFF OFF – N R/W OFF
communication instruction.

2-12
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM104
No data received through COM1 after a specified period of
V V OFF OFF – N R/W OFF _2
time.
No data received through COM2 after a specified period of
*SM105 V V OFF OFF – N R/W OFF
time.
Choice made by COM1 between the 8-bit processing mode
and the 16-bit processing mode
*SM106 V V OFF – – N R/W OFF
ON: 8-bit processing mode
OFF: 16-bit processing mode
Choice made by COM2 between the 8-bit processing mode
and the 16-bit processing mode
*SM107 V V OFF – – N R/W OFF
ON: 8-bit processing mode
OFF: 16-bit processing mode
I200 high-speed comparison interrupt for DPLSY to
*SM120 V V OFF OFF – N R/W OFF
temporarily store output parameters
I201 high-speed comparison interrupt for DPLSY to
*SM121 V V OFF OFF – N R/W OFF
temporarily store output parameters
I202 high-speed comparison interrupt for DPLSY to
*SM122 V V OFF OFF – N R/W OFF
temporarily store output parameters
I203 high-speed comparison interrupt for DPLSY to
*SM123 V V OFF OFF – N R/W OFF
temporarily store output parameters
I210 high-speed comparison interrupt for DPLSY to
*SM124 V V OFF OFF – N R/W OFF
temporarily store output parameters
I211 high-speed comparison interrupt for DPLSY to
*SM125 V V OFF OFF – N R/W OFF
temporarily store output parameters
I212 high-speed comparison interrupt for DPLSY to
*SM126 V V OFF OFF – N R/W OFF
temporarily store output parameters
I213 high-speed comparison interrupt for DPLSY to
*SM127 V V OFF OFF – N R/W OFF
temporarily store output parameters
I220 high-speed comparison interrupt for DPLSY to
*SM128 V V OFF OFF – N R/W OFF
temporarily store output parameters
I221 high-speed comparison interrupt for DPLSY to
*SM129 V V OFF OFF – N R/W OFF
temporarily store output parameters
I222 high-speed comparison interrupt for DPLSY to
*SM130 V V OFF OFF – N R/W OFF
temporarily store output parameters
I223 high-speed comparison interrupt for DPLSY to
*SM131 V V OFF OFF – N R/W OFF
temporarily store output parameters
I230 high-speed comparison interrupt for DPLSY to
*SM132 V V OFF OFF – N R/W OFF
temporarily store output parameters
I231 high-speed comparison interrupt for DPLSY to
*SM133 V V OFF OFF – N R/W OFF
temporarily store output parameters
I232 high-speed comparison interrupt for DPLSY to
*SM134 V V OFF OFF – N R/W OFF
temporarily store output parameters
I233 high-speed comparison interrupt for DPLSY to
*SM135 V V OFF OFF – N R/W OFF
temporarily store output parameters
I240 high-speed comparison interrupt for DPLSY to
*SM136 V V OFF OFF – N R/W OFF
temporarily store output parameters
I241 high-speed comparison interrupt for DPLSY to
*SM137 V V OFF OFF – N R/W OFF
temporarily store output parameters
I242 high-speed comparison interrupt for DPLSY to
*SM138 V V OFF OFF – N R/W OFF
temporarily store output parameters
I243 high-speed comparison interrupt for DPLSY to
*SM139 V V OFF OFF – N R/W OFF
temporarily store output parameters

2-13
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

I250 high-speed comparison interrupt for DPLSY to


_2 *SM140
temporarily store output parameters
V V OFF OFF – N R/W OFF
I251 high-speed comparison interrupt for DPLSY to
*SM141 V V OFF OFF – N R/W OFF
temporarily store output parameters
I252 high-speed comparison interrupt for DPLSY to
*SM142 V V OFF OFF – N R/W OFF
temporarily store output parameters
I253 high-speed comparison interrupt for DPLSY to
*SM143 V V OFF OFF – N R/W OFF
temporarily store output parameters
I260 high-speed comparison interrupt for DPLSY to
*SM144 V V OFF OFF – N R/W OFF
temporarily store output parameters
I261 high-speed comparison interrupt for DPLSY to
*SM145 V V OFF OFF – N R/W OFF
temporarily store output parameters
I262 high-speed comparison interrupt for DPLSY to
*SM146 V V OFF OFF – N R/W OFF
temporarily store output parameters
I263 high-speed comparison interrupt for DPLSY to
*SM147 V V OFF OFF – N R/W OFF
temporarily store output parameters
I264 high-speed comparison interrupt for DPLSY to
*SM148 V V OFF OFF – N R/W OFF
temporarily store output parameters
I265 high-speed comparison interrupt for DPLSY to
*SM149 V V OFF OFF – N R/W OFF
temporarily store output parameters
I266 high-speed comparison interrupt for DPLSY to
*SM150 V V OFF OFF – N R/W OFF
temporarily store output parameters
I267 high-speed comparison interrupt for DPLSY to
*SM151 V V OFF OFF – N R/W OFF
temporarily store output parameters
*SM203 When PLC RUN->STOP, it clears the non-latched area once. V V OFF – – N R/W OFF
*SM204 All non-latched areas are cleared. V V OFF OFF OFF N R/W OFF
*SM205 All latched areas are cleared. V V OFF OFF OFF N R/W OFF
SM206 All output is inhibited V V OFF – – N R/W OFF
*SM209 The communication protocol of COM1 changes V V OFF OFF OFF N R/W OFF
Choice made by COM1 between the ASCII mode and the
RTU mode
*SM210 V V – – – H R/W OFF
ON: RTU mode
OFF: ASCII mode
*SM211 The communication protocol of COM2 changes V V OFF OFF OFF N R/W OFF
Choice made by COM2 between the ASCII mode and the
RTU mode
*SM212 V V – – – H R/W OFF
ON: RTU mode
OFF: ASCII mode
SM215 Running state of the PLC V V OFF ON OFF N R/W OFF
SM217 No response when writing or reading the real-time clock V V OFF – – N R OFF
SM218 Error: real-time clock malfunction V V – – – N R OFF
SM219 Error: battery power for the real-time clock is low V V – – – N R OFF
*SM220 Calibrating the real-time clock within ±30 seconds V V OFF OFF – N R/W OFF
SM221 Enable daylight saving time (D.S.T.) V V – – – H R OFF

Calibrate system clock using NTP


SM222 (ON: successful calibration ; OFF: unsuccessful calibration or V V OFF – – N R OFF
no calibration)
Once the CPU is supplied with power, it checks the number of
*SM227 V V – – – Y R/W OFF
the connected modules.

2-14
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

ES3
V V OFF – – N R/W OFF _2
Disable the data exchange among the CPU and its EX3
*SM228
connected modules (ON: disabled ; OFF: enabled) SV3
V V ON – – N R/W ON
SX3
Disable checksum function on the right-side module. (ON:
disabled; OFF: enabled)
SM229 V Χ – – – Y R/W OFF
(Please repower the system after the state of SM229 is
switched.)
Read MAC addresses of left-side network modules
*SM264 Χ V OFF OFF OFF N R/W OFF
(works with SR1596-SR1599 )
Disable the data exchange between the CPU and its left-side
SM265 special modules Χ V ON – – N R/W ON
(ON: disable, OFF: enable)
SM266 DNET mapping area data are retained when not in RUN state. Χ V OFF – – N R/W OFF
SM270 Reversing the input direction for MPG 1 flag (X0/X1) V V OFF OFF – N R/W OFF
SM271 Reversing the input direction for MPG 2 flag (X2/X3) V V OFF OFF – N R/W OFF
SM272 Reversing the input direction for MPG 3 flag (X4/X5) V V OFF OFF – N R/W OFF
SM273 Reversing the input direction for MPG 4 flag (X6/X7) V V OFF OFF – N R/W OFF
SM274 Reversing the input direction for MPG 5 flag (X10/X11) V V OFF OFF – N R/W OFF
SM275 Reversing the input direction for MPG 6 flag (X12/X13) V V OFF OFF – N R/W OFF
SM281 Reversing the input direction for high-speed counter 1 flag V V OFF OFF – N R/W OFF
SM282 Reversing the input direction for high-speed counter 2 flag V V OFF OFF – N R/W OFF
SM283 Reversing the input direction for high-speed counter 3 flag V V OFF OFF – N R/W OFF
SM284 Reversing the input direction for high-speed counter 4 flag V V OFF OFF – N R/W OFF
SM285 Reversing the input direction for high-speed counter 5 flag V V OFF OFF – N R/W OFF
SM286 Reversing the input direction for high-speed counter 6 flag V V OFF OFF – N R/W OFF
SM287 Reversing the input direction for high-speed counter 7 flag V V OFF OFF – N R/W OFF
SM288 Reversing the input direction for high-speed counter 8 flag V V OFF OFF – N R/W OFF
SM291 Clearing the input point for high-speed counter 1 flag V V OFF OFF – N R/W OFF
SM292 Clearing the input point for high-speed counter 2 flag V V OFF OFF – N R/W OFF
SM293 Clearing the input point for high-speed counter 3 flag V V OFF OFF – N R/W OFF
SM294 Clearing the input point for high-speed counter 4 flag V V OFF OFF – N R/W OFF
SM295 Clearing the input point for high-speed counter 5 flag V V OFF OFF – N R/W OFF
SM296 Clearing the input point for high-speed counter 6 flag V OFF OFF – N R/W OFF
Setting counting mode for HC200.
SM300 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC201.
SM301 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC202.
SM302 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC203.
SM303 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC204.
SM304 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC205.
SM305 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC206.
SM306 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)

2-15
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Setting counting mode for HC207.


_2 SM307
(OFF: counting up, ON: counting down)
V V OFF – – N R OFF
Setting counting mode for HC208.
SM308 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC209.
SM309 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC210.
SM310 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC211.
SM311 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC212.
SM312 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC213.
SM313 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC214.
SM314 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC215.
SM315 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC216.
SM316 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC217.
SM317 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC218.
SM318 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC219.
SM319 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC220.
SM320 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC221.
SM321 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC222.
SM322 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC223.
SM323 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC232.
SM332 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC233.
SM333 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC234.
SM334 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC235.
SM335 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC236.
SM336 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC237.
SM337 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC238.
SM338 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC239.
SM339 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC240.
SM340 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)

2-16
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM341
Setting counting mode for HC241.
V V OFF – – N R OFF _2
(OFF: counting up, ON: counting down)
Setting counting mode for HC242.
SM342 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC243.
SM343 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC244.
SM344 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC245.
SM345 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC246.
SM346 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC247.
SM347 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC248.
SM348 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC249.
SM349 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC250.
SM350 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC251.
SM351 V V OFF – – N R OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC252.
SM352 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
Setting counting mode for HC253.
SM353 V V OFF OFF – N R/W OFF
(OFF: counting up, ON: counting down)
I200 high-speed comparison interrupt for DPLSY to activate
*SM360 V V OFF OFF – N R/W OFF
output
I201 high-speed comparison interrupt for DPLSY to activate
*SM361 V V OFF OFF – N R/W OFF
output
I202 high-speed comparison interrupt for DPLSY to activate
*SM362 V V OFF OFF – N R/W OFF
output
I203 high-speed comparison interrupt for DPLSY to activate
*SM363 V V OFF OFF – N R/W OFF
output
I210 high-speed comparison interrupt for DPLSY to activate
*SM364 V V OFF OFF – N R/W OFF
output
I211 high-speed comparison interrupt for DPLSY to activate
*SM365 V V OFF OFF – N R/W OFF
output
I212 high-speed comparison interrupt for DPLSY to activate
*SM366 V V OFF OFF – N R/W OFF
output
I213 high-speed comparison interrupt for DPLSY to activate
*SM367 V V OFF OFF – N R/W OFF
output
I220 high-speed comparison interrupt for DPLSY to activate
*SM368 V V OFF OFF – N R/W OFF
output
I221 high-speed comparison interrupt for DPLSY to activate
*SM369 V V OFF OFF – N R/W OFF
output
I222 high-speed comparison interrupt for DPLSY to activate
*SM370 V V OFF OFF – N R/W OFF
output
I223 high-speed comparison interrupt for DPLSY to activate
*SM371 output V V OFF OFF – N R/W OFF

I230 high-speed comparison interrupt for DPLSY to activate


*SM372 V V OFF OFF – N R/W OFF
output

2-17
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

I231 high-speed comparison interrupt for DPLSY to activate


_2 *SM373
output
V V OFF OFF – N R/W OFF
I232 high-speed comparison interrupt for DPLSY to activate
*SM374 V V OFF OFF – N R/W OFF
output
I233 high-speed comparison interrupt for DPLSY to activate
*SM375 V V OFF OFF – N R/W OFF
output
I240 high-speed comparison interrupt for DPLSY to activate
*SM376 V V OFF OFF – N R/W OFF
output
I241 high-speed comparison interrupt for DPLSY to activate
*SM377 V V OFF OFF – N R/W OFF
output
I242 high-speed comparison interrupt for DPLSY to activate
*SM378 V V OFF OFF – N R/W OFF
output
I243 high-speed comparison interrupt for DPLSY to activate
*SM379 V V OFF OFF – N R/W OFF
output
I250 high-speed comparison interrupt for DPLSY to activate
*SM380 V V OFF OFF – N R/W OFF
output
I251 high-speed comparison interrupt for DPLSY to activate
*SM381 V V OFF OFF – N R/W OFF
output
I252 high-speed comparison interrupt for DPLSY to activate
*SM382 V V OFF OFF – N R/W OFF
output
I253 high-speed comparison interrupt for DPLSY to activate
*SM383 V V OFF OFF – N R/W OFF
output
I260 high-speed comparison interrupt for DPLSY to activate
*SM384 V V OFF OFF – N R/W OFF
output
I261 high-speed comparison interrupt for DPLSY to activate
*SM385 V V OFF OFF – N R/W OFF
output
I262 high-speed comparison interrupt for DPLSY to activate
*SM386 V V OFF OFF – N R/W OFF
output
I263 high-speed comparison interrupt for DPLSY to activate
*SM387 V V OFF OFF – N R/W OFF
output
I264 high-speed comparison interrupt for DPLSY to activate
*SM388 V V OFF OFF – N R/W OFF
output
I265 high-speed comparison interrupt for DPLSY to activate
*SM389 V V OFF OFF – N R/W OFF
output
I266 high-speed comparison interrupt for DPLSY to activate
*SM390 V V OFF OFF – N R/W OFF
output
I267 high-speed comparison interrupt for DPLSY to activate
*SM391 V V OFF OFF – N R/W OFF
output
*SM400 The flag is always ON (normally open) when the CPU runs. V V OFF ON OFF N R OFF
*SM401 The flag is always OFF (normally closed) when the CPU runs. V V OFF OFF ON N R OFF
*SM402 The flag is ON only at the first scan. V V OFF ON OFF N R OFF
*SM403 The flag is OFF only at the first scan. V V OFF OFF ON N R OFF
10 millisecond clock pulse during which the pulse is ON for 5
*SM404 V V OFF – – N R OFF
milliseconds and then OFF for 5 milliseconds
100 millisecond clock pulse during which the pulse is ON for
*SM405 V V OFF – – N R OFF
50 milliseconds and then OFF for 50 milliseconds
200 millisecond clock pulse during which the pulse is ON for
*SM406 V V OFF – – N R OFF
100 milliseconds and then OFF for 100 milliseconds
One second clock pulse during which the pulse is ON for 500
*SM407 V V OFF – – N R OFF
milliseconds and then OFF for 500 milliseconds
2 second clock pulse (ON: 1 second, OFF: 1 second)
*SM408 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

2-18
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

2n second clock pulse (ON: n seconds, OFF: n seconds) _2


The setting value for n is in SR409.
*SM409 V V OFF – – N R OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
2n millisecond clock pulse (ON: n milliseconds, OFF: n
milliseconds)
*SM410 The setting value for n is in SR410. V V OFF – – N R OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
Enable the two-speed function of DDRVM/DDRVIC/DDRVAC
指令二段速功能啟動旗標
SM441 V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
Memory card is present
*SM450 ON: the memory card is present. V V – – – N R OFF
OFF: the memory card is not present.
The data in the memory card is being accessed.
*SM452 ON: the data in the memory card is being accessed. V V OFF – – N R OFF
OFF: the data in the memory card is not accessed.
Error during the operation of the memory card.
*SM453 ON: an error occurs. V V OFF – – N R OFF
OFF: no error.
Enabling/disabling the data logger.
SM454 ON: enable V V OFF – – N R/W OFF
OFF: disable

SM455 The data logger is currently taking samples. V V OFF – – N R OFF


ON: number of records has reached its sampling limit

*SM456 Execution of data logger and the memory card. V V OFF – – N R/W OFF
ON: execution by the values in SR902.

SM457 State of the sample parameters in data logger V V – – – N R OFF


ON: the sample parameter is set.
SM460 Outputting Y0/axis 1 (Y0/Y1). V V OFF OFF – N R OFF
SM461 Y0/axis 1 (Y0/Y1) output is complete. V V OFF OFF – N R/W OFF
SM462 Reversing the output direction of axis 1 (Y1) V V OFF OFF – N R/W OFF
*SM463 Stopping the output of Y0/axis 1 (Y0/Y1) V V OFF OFF – N R/W OFF
Enabling the hardware positive maximum value for axis 1
SM464 V V – – – Y R/W OFF
(Y0/Y1)
SM465 Alarm: positive limit for axis 1 (Y0/Y1) V V OFF OFF – N R/W OFF
Enabling the hardware negative maximum value for axis 1
SM466 V V – – – Y R/W OFF
(Y0/Y1)
SM467 Alarm: negative limit for axis 1 (Y0/Y1) V V OFF OFF – N R/W OFF
SM469 Enabling fixed slope ramp-up/down for axis 1 (Y0/Y1) V V OFF OFF – N R/W OFF
SM470 Auto-reset for Y0/axis 1 (Y0/Y1) output is complete. V V OFF OFF – N R/W OFF
Executing an interrupt I500 when pulse output ends for axis 1
SM471 V V OFF OFF – N R/W OFF
(Y0/Y1)
SM472 Outputting Y1. V V OFF OFF – N R OFF
SM473 Y1 output is complete. V V OFF OFF – N R/W OFF
*SM474 Stopping the output of Y1. V V OFF OFF – N R/W OFF

2-19
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM475 Auto-reset for Y1 output is complete. V V OFF OFF – N R/W OFF


_2 Output immediately stops when the instruction is disabled or
*SM476 V V OFF OFF – N R/W OFF
stops for Y0/axis 1 (Y0/Y1)
Output immediately stops when the instruction is disabled or
*SM477 V V OFF OFF – N R/W OFF
stops for Y1
SM478 Change the target positon while outputting Y0/axis 1 (Y0/Y1) V V OFF OFF – N R/W OFF
SM479 Change the target positon while outputting Y1 V V OFF OFF – N R/W OFF
SM480 Outputting Y2/axis 2 (Y2/Y3). V V OFF OFF – N R OFF
SM481 Y2/axis 2 (Y2/Y3) output is complete. V V OFF OFF – N R/W OFF
SM482 Reversing the output direction of axis 2 (Y3) V V OFF OFF – N R/W OFF
*SM483 Stopping the output of Y2/axis 2 (Y2/Y3) V V OFF OFF – N R/W OFF
Enabling the hardware positive maximum value for axis 2
SM484 V V – – – Y R/W OFF
(Y2/Y3).
SM485 Alarm: positive limit for axis 2 (Y2/Y3). V V OFF OFF – N R/W OFF
Enabling the hardware negative maximum value for axis 2
SM486 V V – – – Y R/W OFF
(Y2/Y3).
SM487 Alarm: negative limit for axis 2 (Y2/Y3). V V OFF OFF – N R/W OFF
SM489 Enabling fixed slope ramp-up/down for axis 2 (Y2/Y3). V V OFF OFF – N R/W OFF
SM490 Auto-reset for Y2/axis 2 (Y2/Y3) output is complete. V V OFF OFF – N R/W OFF
Executing an interrupt I501 when pulse output ends for axis 2
SM491 V V OFF OFF – N R/W OFF
(Y2/Y3).
SM492 Outputting Y3. V V OFF OFF – N R OFF
SM493 Y3 output is complete. V V OFF OFF – N R/W OFF
*SM494 Stopping the output of Y3. V V OFF OFF – N R/W OFF
SM495 Auto-reset for Y3 output is complete. V V OFF OFF – N R/W OFF
The output immediately stops when the instruction is disabled
*SM496 V V OFF OFF – N R/W OFF
or stops for Y2/axis 2 (Y2/Y3).
The output immediately stops when the instruction is disabled
*SM497 V V OFF OFF – N R/W OFF
or stops for Y3.
SM498 Change the target positon while outputting Y2/axis 2 (Y2/Y3) V V OFF OFF – N R/W OFF
SM499 Change the target positon while outputting Y3 V V OFF OFF – N R/W OFF
SM500 Outputting Y4/axis 3 (Y4/Y5). V V OFF OFF – N R OFF
SM501 Y4/axis 3 (Y4/Y5) output is complete. V V OFF OFF – N R/W OFF
SM502 Reversing the output direction of axis 3 (Y5). V V OFF OFF – N R/W OFF
*SM503 Stopping the output of Y4/axis 3 (Y4/Y5). V V OFF OFF – N R/W OFF
Enabling the hardware positive maximum value for axis 3
SM504 V V – – – Y R/W OFF
(Y4/Y5).
Alarm: positive limit for axis 3 (Y4/Y5) or the positive limit is
SM505 V V OFF OFF – N R/W OFF
reached when homing is performed by axis 3 (Y4/Y5).
Enabling the hardware negative maximum value for axis 3
SM506 V V – – – Y R/W OFF
(Y4/Y5)
Alarm: negative limit for axis 3 (Y4/Y5) or the negative limit is
SM507 V V OFF OFF – N R/W OFF
reached when homing is performed by axis 3 (Y4/Y5).
SM509 Enabling fixed slope ramp-up/down for axis 3 (Y4/Y5) V V OFF OFF – N R/W OFF
SM510 Auto-reset for Y4/axis 3 (Y4/Y5) output is complete. V V OFF OFF – N R/W OFF
Executing an interrupt I502 when pulse output ends for axis 3
SM511 V V OFF OFF – N R/W OFF
(Y4/Y5).
SM512 Outputting Y5. V V OFF OFF – N R OFF
SM513 Y5 output is complete. V V OFF OFF – N R/W OFF
*SM514 Stopping the output of Y5. V V OFF OFF – N R/W OFF

2-20
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM515 Auto-reset for Y5 output is complete. V V OFF OFF – N R/W OFF _2


Output immediately stops when the instruction is disabled or
*SM516 V V OFF OFF – N R/W OFF
stops for Y4/axis 3 (Y4/Y5).
Output immediately stops when the instruction is disabled or
*SM517 V V OFF OFF – N R/W OFF
stops for Y5.
SM518 Change the target positon while outputting Y4/axis 3 (Y4/Y5) V V OFF OFF – N R/W OFF
SM519 Change the target positon while outputting Y5 V V OFF OFF – N R/W OFF
SM520 Outputting Y6/axis 4 (Y6/Y7). V V OFF OFF – N R OFF
SM521 Y6/axis 4 (Y6/Y7) output is complete. V V OFF OFF – N R/W OFF
SM522 Reversing the output direction of axis 4 (Y7). V V OFF OFF – N R/W OFF
*SM523 Stopping the output of Y6/axis 4 (Y6/Y7). V V OFF OFF – N R/W OFF
Enabling the hardware positive maximum value for axis 4
SM524 V V – – – Y R/W OFF
(Y6/Y7).
Alarm: positive limit for axis 4 (Y6/Y7) or the positive limit is
SM525 V V OFF OFF – N R/W OFF
reached when homing is performed by axis 4 (Y6/Y7).
Enabling the hardware negative maximum value for axis 4
SM526 V V – – – Y R/W OFF
(Y6/Y7).
Alarm: negative limit for axis 4 (Y6/Y7) or the negative limit is
SM527 V V OFF OFF – N R/W OFF
reached when homing is performed by axis 4 (Y6/Y7).
SM529 Enabling fixed slope ramp-up/down for axis 4 (Y6/Y7). V V OFF OFF – N R/W OFF
SM530 Auto-reset for Y6/axis 4 (Y6/Y7) is complete. V V OFF OFF – N R/W OFF
Executing an interrupt I503 when pulse output ends for axis 4
SM531 V V OFF OFF – N R/W OFF
(Y6/Y7).
SM532 Outputting Y7. V V OFF OFF – N R OFF
SM533 Y7 output is complete. V V OFF OFF – N R/W OFF
*SM534 Stopping the output of Y7. V V OFF OFF – N R/W OFF
SM535 Auto-reset for Y7 output complete. V V OFF OFF – N R/W OFF
Output immediately stops when the instruction is disabled or
*SM536 V V OFF OFF – N R/W OFF
stops for Y6/axis 4 (Y6/Y7).
Output immediately stops when the instruction is disabled or
*SM537 V V OFF OFF – N R/W OFF
stops for Y7.
SM538 Change the target positon while outputting Y6/axis 4 (Y6/Y7) V V OFF OFF – N R/W OFF
SM539 Change the target positon while outputting Y7 V V OFF OFF – N R/W OFF
All outputs immediately stop when the instruction is disabled
SM580 V V OFF OFF – N R/W OFF
or stops.
You can change the flag of acceleration/deceleration time
SM581 V V OFF OFF – N R/W OFF
during the execution of JOG instruction.
When the single-axis parameters are modified in the position
planning table by DTPWS/DTPWL instruction, the
SM585 acceleration/deceleration time in the planning table should be V V OFF OFF – N R/W OFF
synchronized with the acceleration/deceleration time in SR for
the axis.
Used to calculate the interval frequency of acceleration and
*SM586 V V OFF OFF – N R/W OFF
deceleration (for axis 1-4)
When TPO instruction uses position planning table to control
the output, if the output is stopped during execution, the axis
*SM587 V V OFF OFF – N R/W OFF
should refer to its relevant flags (e.g. SM476, SM496-SM576)
for the action to stop.
Stopping the ongoing output sequence at a specified X point
SM588 when TPO instruction is executed. V V OFF OFF – N R/W OFF
(works with SR1297-SR1299).

2-21
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Available for ES3 CPU FW V1.08.00 or later and EX3/SX3


_2 /SV3 CPU FW V1.00.00 or later
For the acceleration / deceleration curve for pulse output, its
ramp-up / ramp-down section for the output frequency below
*SM589 1k Hz is not included in the planning table (for axes 1-4) V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and EX3/SX3/
SV3 CPU FW V1.00.00 or later
Axis 1 stops the ongoing output sequence and executes a
specific-number segment on the position planning table
SM591 during the execution of TPO instruction. V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and EX3/SX3/
SV3 CPU FW V1.00.00 or later
Axis 2 stops the ongoing output sequence and executes a
specific-number segment on the position planning table
SM592 during the execution of TPO instruction. V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
Axis 3 stops the ongoing output sequence and executes a
specific-number segment on the position planning table
SM593 during the execution of TPO instruction. V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
Axis 4 stops the ongoing output sequence and executes a
specific-number segment on the position planning table
SM594 during the execution of TPO instruction. V V OFF OFF – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
SM600 Zero flag V V OFF – – N R OFF
SM601 Borrow flag V V OFF – – N R OFF
SM602 Carry flag V V OFF – – N R OFF
The number of tasks to do has exceeded the number of tasks
SM603 V V OFF OFF – N R/W OFF
the work station can manage for XCMP instruction.
Setting the working mode of the SORT instruction.
SM604 ON: descending order V V OFF – – N R/W OFF
OFF: ascending order
SM605 Designating the working mode of the SMOV instruction. V V OFF – – N R/W OFF
8-bit or 16-bit working mode.
SM606 ON: 8-bit V V OFF – – N R/W OFF
OFF: 16-bit
Matrix comparison flag.
SM607 ON: Comparing equivalent values. V V OFF – – N R/W OFF
OFF: Comparing different values.
Matrix comparison complete. When the last bits are
SM608 V V OFF – – N R OFF
compared, SM608 is ON.
SM609 When SM609 is ON, the comparison starts from bit 0. V V OFF – – N R OFF
Matrix bit search flag. When the matrix search finds the
SM610 matching bits or completes the search, the search stops V V OFF – – N R OFF
immediately and SM610 is ON.
Matrix pointer error flag. When the value of the pointer
SM611 V V OFF – – N R OFF
exceeds the comparison range, SM611 is ON.

2-22
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM612
Matrix pointer increasing flag. The current value of the pointer
V V OFF – – N R/W OFF _2
increases by one.
Matrix pointer clearing flag. The current value of the pointer is
SM613 V V OFF – – N R/W OFF
cleared to zero.
SM614 Carry flag for the matrix rotation/shift/output. V V OFF – – N R OFF
SM615 Borrow flag for the matrix shift/output. V V OFF – – N R/W OFF
Direction flag for the matrix rotation/shift.
SM616 OFF: the bits are shifted leftward. V V OFF – – N R/W OFF
ON: The bits are shifted rightward.
SM617 The bits with the value 0 or 1 are counted. V V OFF – – N R/W OFF
SM618 ON when the matrix counting result is 0. V V OFF – – N R/W OFF
SM619 ON when the instruction EI is executed. V V OFF OFF – N R OFF
When the results from the comparison using the instruction
SM620 V V OFF – – N R OFF
CMPT# are that all devices are ON, SM620 is ON.
Setting counting mode for HC0.
SM621 V V OFF – – N R/W OFF
HC0 counts down when SM621 is ON.
Setting counting mode for HC.
SM622 V V OFF – – N R/W OFF
HC1 counts down when SM622 is ON.
Setting counting mode for HC2.
SM623 V V OFF – – N R/W OFF
HC2 counts down when SM623 is ON.
Setting counting mode for HC3.
SM624 V V OFF – – N R/W OFF
HC3 counts down when SM624 is ON.
Setting counting mode for HC4.
SM625 V V OFF – – N R/W OFF
HC4 counts down when SM625 is ON.
Setting counting mode for HC5.
SM626 V V OFF – – N R/W OFF
HC5 counts down when SM626 is ON.
Setting counting mode for HC6.
SM627 V V OFF – – N R/W OFF
HC6 counts down when SM627 is ON.
Setting counting mode for HC7.
SM628 V V OFF – – N R/W OFF
HC7 counts down when SM628 is ON.
Setting counting mode for HC8.
SM629 V V OFF – – N R/W OFF
HC8 counts down when SM629 is ON.
Setting counting mode for HC9.
SM630 V V OFF – – N R/W OFF
HC9 counts down when SM630 is ON.
Setting counting mode for HC10.
SM631 V V OFF – – N R/W OFF
HC10 counts down when SM631 is ON.
Setting counting mode for HC11.
SM632 V V OFF – – N R/W OFF
HC11 counts down when SM632 is ON.
Setting counting mode for HC12.
SM633 V V OFF – – N R/W OFF
HC12 counts down when SM633 is ON.
Setting counting mode for HC13.
SM634 V V OFF – – N R/W OFF
HC13 counts down when SM634 is ON.
Setting counting mode for HC14.
SM635 V V OFF – – N R/W OFF
HC14 counts down when SM635 is ON.
Setting counting mode for HC15.
SM636 V V OFF – – N R/W OFF
HC15 counts down when SM636 is ON.

2-23
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Setting counting mode for HC16.


_2 SM637
HC16 counts down when SM637 is ON.
V V OFF – – N R/W OFF

Setting counting mode for HC17.


SM638 V V OFF – – N R/W OFF
HC17 counts down when SM638 is ON.
Setting counting mode for HC18.
SM639 V V OFF – – N R/W OFF
HC18 counts down when SM639 is ON.
Setting counting mode for HC19.
SM640 V V OFF – – N R/W OFF
HC19 counts down when SM640 is ON.
Setting counting mode for HC20.
SM641 V V OFF – – N R/W OFF
HC20 counts down when SM641 is ON.
Setting counting mode for HC21.
SM642 V V OFF – – N R/W OFF
HC21 counts down when SM642 is ON.
Setting counting mode for HC22.
SM643 V V OFF – – N R/W OFF
HC22 counts down when SM643 is ON.
Setting counting mode for HC23.
SM644 V V OFF – – N R/W OFF
HC23 counts down when SM644 is ON.
Setting counting mode for HC24.
SM645 V V OFF – – N R/W OFF
HC24 counts down when SM645 is ON.
Setting counting mode for HC25.
SM646 V V OFF – – N R/W OFF
HC25 counts down when SM646 is ON.
Setting counting mode for HC26.
SM647 V V OFF – – N R/W OFF
HC26 counts down when SM647 is ON.
Setting counting mode for HC27.
SM648 V V OFF – – N R/W OFF
HC27 counts down when SM648 is ON.
Setting counting mode for HC28.
SM649 V V OFF – – N R/W OFF
HC28 counts down when SM649 is ON.
Setting counting mode for HC29.
SM650 V V OFF – – N R/W OFF
HC29 counts down when SM650 is ON.
Setting counting mode for HC30.
SM651 V V OFF – – N R/W OFF
HC30 counts down when SM651 is ON.
Setting counting mode for HC31.
SM652 V V OFF – – N R/W OFF
HC31 counts down when SM652 is ON.
Setting counting mode for HC32.
SM653 V V OFF – – N R/W OFF
HC32 counts down when SM653 is ON.
Setting counting mode for HC33.
SM654 V V OFF – – N R/W OFF
HC33 counts down when SM653 is ON.
Setting counting mode for HC34.
SM655 V V OFF – – N R/W OFF
HC34 counts down when SM655 is ON.
Setting counting mode for HC35.
SM656 V V OFF – – N R/W OFF
HC35 counts down when SM656 is ON.
Setting counting mode for HC36.
SM657 V V OFF – – N R/W OFF
HC36 counts down when SM657 is ON.
Setting counting mode for HC37.
SM658 V V OFF – – N R/W OFF
HC37 counts down when SM658 is ON.
Setting counting mode for HC38.
SM659 V V OFF – – N R/W OFF
HC38 counts down when SM659 is ON.

2-24
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM660
Setting counting mode for HC39.
V V OFF – – N R/W OFF _2
HC39 counts down when SM660 is ON.
Setting counting mode for HC40.
SM661 V V OFF – – N R/W OFF
HC40 counts down when SM661 is ON.
Setting counting mode for HC41.
SM662 V V OFF – – N R/W OFF
HC41 counts down when SM662 is ON.
Setting counting mode for HC42.
SM663 V V OFF – – N R/W OFF
HC42 counts down when SM663 is ON.
Setting counting mode for HC43.
SM664 V V OFF – – N R/W OFF
HC43 counts down when SM664 is ON.
Setting counting mode for HC44.
SM665 V V OFF – – N R/W OFF
HC44 counts down when SM665 is ON.
Setting counting mode for HC45.
SM666 V V OFF – – N R/W OFF
HC45 counts down when SM666 is ON.
Setting counting mode for HC46.
SM667 V V OFF – – N R/W OFF
HC46 counts down when SM667 is ON.
Setting counting mode for HC47.
SM668 V V OFF – – N R/W OFF
HC47 counts down when SM668 is ON.
Setting counting mode for HC48.
SM669 V V OFF – – N R/W OFF
HC48 counts down when SM669 is ON.
Setting counting mode for HC49.
SM670 V V OFF – – N R/W OFF
HC49 counts down when SM670 is ON.
Setting counting mode for HC50.
SM671 V V OFF – – N R/W OFF
HC50 counts down when SM671 is ON.
Setting counting mode for HC51.
SM672 V V OFF – – N R/W OFF
HC51 counts down when SM672 is ON.
Setting counting mode for HC52.
SM673 V V OFF – – N R/W OFF
HC52 counts down when SM673 is ON.
Setting counting mode for HC53.
SM674 V V OFF – – N R/W OFF
HC53 counts down when SM674 is ON.
Setting counting mode for HC54.
SM675 V V OFF – – N R/W OFF
HC54 counts down when SM675 is ON.
Setting counting mode for HC55.
SM676 V V OFF – – N R/W OFF
HC55 counts down when SM676 is ON.
Setting counting mode for HC56.
SM677 V V OFF – – N R/W OFF
HC56 counts down when SM677 is ON.
Setting counting mode for HC57.
SM678 V V OFF – – N R/W OFF
HC57 counts down when SM678 is ON.
Setting counting mode for HC58.
SM679 V V OFF – – N R/W OFF
HC58 counts down when SM679 is ON.
Setting counting mode for HC59.
SM680 V V OFF – – N R/W OFF
HC59 counts down when SM680 is ON.
Setting counting mode for HC60.
SM681 V V OFF – – N R/W OFF
HC60 counts down when SM681 is ON.
Setting counting mode for HC61.
SM682 V V OFF – – N R/W OFF
HC61 counts down when SM682 is ON.

2-25
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Setting counting mode for HC62.


_2 SM683
HC62 counts down when SM683 is ON.
V V OFF – – N R/W OFF

Setting counting mode for HC63.


SM684 V V OFF – – N R/W OFF
HC63 counts down when SM684 is ON.
SM685 The DSCLP instruction uses floating-point operations. V V OFF – – N R/W OFF
SM686 RAMP instruction mode V V OFF – – N R/W OFF
SM687 RAMP instruction execution is complete. V V OFF – – N R/W OFF
SM688 INCD instruction execution is complete. V V OFF – – N R/W OFF
SM690 String control mode. V V OFF – – N R/W OFF
HKY instruction input mode is 16-bit.
SM691 ON: the input is the hexadecimal input OFF: A–F are function V V OFF – – N R/W OFF
keys.
After the execution of the HKY instruction is complete, SM692
SM692 V V OFF – – N R/W OFF
is ON for a scan cycle.
After the execution of the SEGL instruction is complete,
SM693 V V OFF – – N R/W OFF
SM693 is ON for a scan cycle.
After the execution of the DSW instruction is complete,
SM694 V V OFF – – N R/W OFF
SM694 is ON for a scan cycle.
Radian/degree flag.
SM695 ON: degrees V V OFF – – N R/W OFF
OFF: Radians
Accelerate the left-side Ethernet data exchange.
SM719 Χ V OFF OFF – N R/W OFF
ON: enable, OFF: disable
Error occurs in the initialization of data exchange through
SM749 V V OFF – – N R/W OFF
COM1.
*SM750 Data exchange through COM1 enabled. V V OFF – OFF H R/W OFF
*SM752 Connection 1 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM753 Connection 2 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM754 Connection 3 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM755 Connection 4 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM756 Connection 5 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM757 Connection 6 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM758 Connection 7 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM759 Connection 8 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM760 Connection 9 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM761 Connection 10 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM762 Connection 11 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM763 Connection 12 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM764 Connection 13 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM765 Connection 14 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM766 Connection 15 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM767 Connection 16 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM768 Connection 17 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM769 Connection 18 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM770 Connection 19 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM771 Connection 20 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM772 Connection 21 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM773 Connection 22 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM774 Connection 23 for data exchange through COM1 started V V OFF – – H R/W OFF

2-26
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM775 Connection 24 for data exchange through COM1 started V V OFF – – H R/W OFF _2
*SM776 Connection 25 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM777 Connection 26 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM778 Connection 27 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM779 Connection 28 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM780 Connection 29 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM781 Connection 30 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM782 Connection 31 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM783 Connection 32 for data exchange through COM1 started V V OFF – – H R/W OFF
*SM784 Successful data exchange connection 1 through COM1 V V OFF – – N R OFF
*SM785 Successful data exchange connection 2 through COM1 V V OFF – – N R OFF
*SM786 Successful data exchange connection 3 through COM1 V V OFF – – N R OFF
*SM787 Successful data exchange connection 4 through COM1 V V OFF – – N R OFF
*SM788 Successful data exchange connection 5 through COM1 V V OFF – – N R OFF
*SM789 Successful data exchange connection 6 through COM1 V V OFF – – N R OFF
*SM790 Successful data exchange connection 7 through COM1 V V OFF – – N R OFF
*SM791 Successful data exchange connection 8 through COM1 V V OFF – – N R OFF
*SM792 Successful data exchange connection 9 through COM1 V V OFF – – N R OFF
*SM793 Successful data exchange connection 10 through COM1 V V OFF – – N R OFF
*SM794 Successful data exchange connection 11 through COM1 V V OFF – – N R OFF
*SM795 Successful data exchange connection 12 through COM1 V V OFF – – N R OFF
*SM796 Successful data exchange connection 13 through COM1 V V OFF – – N R OFF
*SM797 Successful data exchange connection 14 through COM1 V V OFF – – N R OFF
*SM798 Successful data exchange connection 15 through COM1 V V OFF – – N R OFF
*SM799 Successful data exchange connection 16 through COM1 V V OFF – – N R OFF
*SM800 Successful data exchange connection 17 through COM1 V V OFF – – N R OFF
*SM801 Successful data exchange connection 18 through COM1 V V OFF – – N R OFF
*SM802 Successful data exchange connection 19 through COM1 V V OFF – – N R OFF
*SM803 Successful data exchange connection 20 through COM1 V V OFF – – N R OFF
*SM804 Successful data exchange connection 21 through COM1 V V OFF – – N R OFF
*SM805 Successful data exchange connection 22 through COM1 V V OFF – – N R OFF
*SM806 Successful data exchange connection 23 through COM1 V V OFF – – N R OFF
*SM807 Successful data exchange connection 24 through COM1 V V OFF – – N R OFF
*SM808 Successful data exchange connection 25 through COM1 V V OFF – – N R OFF
*SM809 Successful data exchange connection 26 through COM1 V V OFF – – N R OFF
*SM810 Successful data exchange connection 27 through COM1 V V OFF – – N R OFF
*SM811 Successful data exchange connection 28 through COM1 V V OFF – – N R OFF
*SM812 Successful data exchange connection 29 through COM1 V V OFF – – N R OFF
*SM813 Successful data exchange connection 30 through COM1 V V OFF – – N R OFF
*SM814 Successful data exchange connection 31 through COM1 V V OFF – – N R OFF
*SM815 Successful data exchange connection 32 through COM1 V V OFF – – N R OFF
*SM816 Error in data exchange connection 1 through COM1 V V OFF – – N R OFF
*SM817 Error in data exchange connection 2 through COM1 V V OFF – – N R OFF
*SM818 Error in data exchange connection 3 through COM1 V V OFF – – N R OFF
*SM819 Error in data exchange connection 4 through COM1 V V OFF – – N R OFF
*SM820 Error in data exchange connection 5 through COM1 V V OFF – – N R OFF
*SM821 Error in data exchange connection 6 through COM1 V V OFF – – N R OFF
*SM822 Error in data exchange connection 7 through COM1 V V OFF – – N R OFF

2-27
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM823 Error in data exchange connection 8 through COM1 V V OFF – – N R OFF


_2 *SM824 Error in data exchange connection 9 through COM1 V V OFF – – N R OFF
*SM825 Error in data exchange connection 10 through COM1 V V OFF – – N R OFF
*SM826 Error in data exchange connection 11 through COM1 V V OFF – – N R OFF
*SM827 Error in data exchange connection 12 through COM1 V V OFF – – N R OFF
*SM828 Error in data exchange connection 13 through COM1 V V OFF – – N R OFF
*SM829 Error in data exchange connection 14 through COM1 V V OFF – – N R OFF
*SM830 Error in data exchange connection 15 through COM1 V V OFF – – N R OFF
*SM831 Error in data exchange connection 16 through COM1 V V OFF – – N R OFF
*SM832 Error in data exchange connection 17 through COM1 V V OFF – – N R OFF
*SM833 Error in data exchange connection 18 through COM1 V V OFF – – N R OFF
*SM834 Error in data exchange connection 19 through COM1 V V OFF – – N R OFF
*SM835 Error in data exchange connection 20 through COM1 V V OFF – – N R OFF
*SM836 Error in data exchange connection 21 through COM1 V V OFF – – N R OFF
*SM837 Error in data exchange connection 22 through COM1 V V OFF – – N R OFF
*SM838 Error in data exchange connection 23 through COM1 V V OFF – – N R OFF
*SM839 Error in data exchange connection 24 through COM1 V V OFF – – N R OFF
*SM840 Error in data exchange connection 25 through COM1 V V OFF – – N R OFF
*SM841 Error in data exchange connection 26 through COM1 V V OFF – – N R OFF
*SM842 Error in data exchange connection 27 through COM1 V V OFF – – N R OFF
*SM843 Error in data exchange connection 28 through COM1 V V OFF – – N R OFF
*SM844 Error in data exchange connection 29 through COM1 V V OFF – – N R OFF
*SM845 Error in data exchange connection 30 through COM1 V V OFF – – N R OFF
*SM846 Error in data exchange connection 31 through COM1 V V OFF – – N R OFF
*SM847 Error in data exchange connection 32 through COM1 V V OFF – – N R OFF
SM861 Error in the initialization of the data exchange through COM2. V V OFF – – N R/W OFF
*SM862 Data exchange through COM2 enabled V V OFF – OFF H R/W OFF
*SM864 Connection 1 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM865 Connection 2 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM866 Connection 3 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM867 Connection 4 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM868 Connection 5 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM869 Connection 6 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM870 Connection 7 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM871 Connection 8 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM872 Connection 9 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM873 Connection 10 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM874 Connection 11 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM875 Connection 12 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM876 Connection 13 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM877 Connection 14 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM878 Connection 15 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM879 Connection 16 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM880 Connection 17 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM881 Connection 18 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM882 Connection 19 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM883 Connection 20 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM884 Connection 21 for data exchange through COM2 started V V OFF – – H R/W OFF

2-28
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM885 Connection 22 for data exchange through COM2 started V V OFF – – H R/W OFF _2
*SM886 Connection 23 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM887 Connection 24 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM888 Connection 25 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM889 Connection 26 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM890 Connection 27 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM891 Connection 28 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM892 Connection 29 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM893 Connection 30 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM894 Connection 31 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM895 Connection 32 for data exchange through COM2 started V V OFF – – H R/W OFF
*SM896 Successful data exchange connection 1 through COM2 V V OFF – – N R OFF
*SM897 Successful data exchange connection 2 through COM2 V V OFF – – N R OFF
*SM898 Successful data exchange connection 3 through COM2 V V OFF – – N R OFF
*SM899 Successful data exchange connection 4 through COM2 V V OFF – – N R OFF
*SM900 Successful data exchange connection 5 through COM2 V V OFF – – N R OFF
*SM901 Successful data exchange connection 6 through COM2 V V OFF – – N R OFF
*SM902 Successful data exchange connection 7 through COM2 V V OFF – – N R OFF
*SM903 Successful data exchange connection 8 through COM2 V V OFF – – N R OFF
*SM904 Successful data exchange connection 9 through COM2 V V OFF – – N R OFF
*SM905 Successful data exchange connection 10 through COM2 V V OFF – – N R OFF
*SM906 Successful data exchange connection 11 through COM2 V V OFF – – N R OFF
*SM907 Successful data exchange connection 12 through COM2 V V OFF – – N R OFF
*SM908 Successful data exchange connection 13 through COM2 V V OFF – – N R OFF
*SM909 Successful data exchange connection 14 through COM2 V V OFF – – N R OFF
*SM910 Successful data exchange connection 15 through COM2 V V OFF – – N R OFF
*SM911 Successful data exchange connection 16 through COM2 V V OFF – – N R OFF
*SM912 Successful data exchange connection 17 through COM2 V V OFF – – N R OFF
*SM913 Successful data exchange connection 18 through COM2 V V OFF – – N R OFF
*SM914 Successful data exchange connection 19 through COM2 V V OFF – – N R OFF
*SM915 Successful data exchange connection 20 through COM2 V V OFF – – N R OFF
*SM916 Successful data exchange connection 21 through COM2 V V OFF – – N R OFF
*SM917 Successful data exchange connection 22 through COM2 V V OFF – – N R OFF
*SM918 Successful data exchange connection 23 through COM2 V V OFF – – N R OFF
*SM919 Successful data exchange connection 24 through COM2 V V OFF – – N R OFF
*SM920 Successful data exchange connection 25 through COM2 V V OFF – – N R OFF
*SM921 Successful data exchange connection 26 through COM2 V V OFF – – N R OFF
*SM922 Successful data exchange connection 27 through COM2 V V OFF – – N R OFF
*SM923 Successful data exchange connection 28 through COM2 V V OFF – – N R OFF
*SM924 Successful data exchange connection 29 through COM2 V V OFF – – N R OFF
*SM925 Successful data exchange connection 30 through COM2 V V OFF – – N R OFF
*SM926 Successful data exchange connection 31 through COM2 V V OFF – – N R OFF
*SM927 Successful data exchange connection 32 through COM2 V V OFF – – N R OFF
*SM928 Error in data exchange connection 1 through COM2 V V OFF – – N R OFF
*SM929 Error in data exchange connection 2 through COM2 V V OFF – – N R OFF
*SM930 Error in data exchange connection 3 through COM2 V V OFF – – N R OFF
*SM931 Error in data exchange connection 4 through COM2 V V OFF – – N R OFF
*SM932 Error in data exchange connection 5 through COM2 V V OFF – – N R OFF

2-29
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM933 Error in data exchange connection 6 through COM2 V V OFF – – N R OFF


_2 *SM934 Error in data exchange connection 7 through COM2 V V OFF – – N R OFF
*SM935 Error in data exchange connection 8 through COM2 V V OFF – – N R OFF
*SM936 Error in data exchange connection 9 through COM2 V V OFF – – N R OFF
*SM937 Error in data exchange connection 10 through COM2 V V OFF – – N R OFF
*SM938 Error in data exchange connection 11 through COM2 V V OFF – – N R OFF
*SM939 Error in data exchange connection 12 through COM2 V V OFF – – N R OFF
*SM940 Error in data exchange connection 13 through COM2 V V OFF – – N R OFF
*SM941 Error in data exchange connection 14 through COM2 V V OFF – – N R OFF
*SM942 Error in data exchange connection 15 through COM2 V V OFF – – N R OFF
*SM943 Error in data exchange connection 16 through COM2 V V OFF – – N R OFF
*SM944 Error in data exchange connection 17 through COM2 V V OFF – – N R OFF
*SM945 Error in data exchange connection 18 through COM2 V V OFF – – N R OFF
*SM946 Error in data exchange connection 19 through COM2 V V OFF – – N R OFF
*SM947 Error in data exchange connection 20 through COM2 V V OFF – – N R OFF
*SM948 Error in data exchange connection 21 through COM2 V V OFF – – N R OFF
*SM949 Error in data exchange connection 22 through COM2 V V OFF – – N R OFF
*SM950 Error in data exchange connection 23 through COM2 V V OFF – – N R OFF
*SM951 Error in data exchange connection 24 through COM2 V V OFF – – N R OFF
*SM952 Error in data exchange connection 25 through COM2 V V OFF – – N R OFF
*SM953 Error in data exchange connection 26 through COM2 V V OFF – – N R OFF
*SM954 Error in data exchange connection 27 through COM2 V V OFF – – N R OFF
*SM955 Error in data exchange connection 28 through COM2 V V OFF – – N R OFF
*SM956 Error in data exchange connection 29 through COM2 V V OFF – – N R OFF
*SM957 Error in data exchange connection 30 through COM2 V V OFF – – N R OFF
*SM958 Error in data exchange connection 31 through COM2 V V OFF – – N R OFF
*SM959 Error in data exchange connection 32 through COM2 V V OFF – – N R OFF
Ethernet setting flag; ON: the data in SR1000–SR1006 is
SM1000 V V OFF – – N R/W OFF
written into the flash memory.
SM1001 State of the Ethernet connectivity V V OFF – – N R OFF
Enable all the connections of Ethernet data exchanges with
the same IP address to be combined into one TCP
*SM1037 connection. V V OFF – – N R/W OFF
Available for ES3 CPU FW V1.08.00 or later and EX3/SX3/
SV3 CPU FW V1.00.00 or later
*SM1090 TCP connection busy. V V OFF – – N R OFF
*SM1091 UDP connection busy. V V OFF – – N R OFF
Error flag: Incorrect communication port No.of Modbus TCP
SM1092 slave V V OFF – – N R/W OFF
Available for ES3 CPU FW V1.04.30 or later
SM1100 Ethernet not connected V V OFF – – N R OFF
*SM1106 Basic Ethernet management: connection error V V OFF – – N R OFF
*SM1107 Basic Ethernet management: Basic setting error V V OFF – – N R OFF
Basic TCP/UDP socket management: the local port is already
*SM1109 V V OFF – – N R OFF
used.
SM1111 EtherNet/IP data exchange flag V V OFF – – N R/W OFF
*SM1113 Email service error V V OFF – – N R OFF
*SM1116 Trigger 1 switch for the email. V V OFF – – N R OFF

2-30
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM1117 Trigger 1 for the email V V OFF – – N R OFF _2


ON: Trigger 1 is triggered and the email has been sent
*SM1119 V V OFF – – N R OFF
successfully.
ON: Trigger 1 is triggered but the email cannot be sent due to
*SM1120 V V OFF – – N R OFF
email content error.
ON: Trigger 1 is triggered and there is an SMTP server
*SM1122 V V OFF – – N R OFF
response timeout.
ON: Trigger 1 is triggered and there is an SMTP server
*SM1123 V V OFF – – N R OFF
response error.
ON: Trigger 1 is triggered and the size of the attachment
*SM1124 V V OFF – – N R OFF
exceeds the limit.
*SM1125 Trigger 1 is triggered and the attachment is not found. V V OFF – – N R OFF
*SM1126 Trigger 2 switch for the email. V V OFF – – N R OFF
*SM1127 Trigger 2 for the email V V OFF – – N R OFF
ON: Trigger 2 is triggered and the email has been sent
*SM1129 V V OFF – – N R OFF
successfully.
ON: Trigger 2 is triggered but the email cannot be sent due to
*SM1130 V V OFF – – N R OFF
email content error.
ON: Trigger 2 is triggered and there is an SMTP server
*SM1132 V V OFF – – N R OFF
response timeout.
ON: Trigger 2 is triggered and there is an SMTP server
*SM1133 V V OFF – – N R OFF
response error.
ON: Trigger 2 is triggered and the size of the attachment
*SM1134 V V OFF – – N R OFF
exceeds the limit.
*SM1135 ON: Trigger 2 is triggered and the attachment is not found. V V OFF – – N R OFF
*SM1136 Trigger 3 switch for the email. V V OFF – – N R OFF
*SM1137 Trigger 3 for the email V V OFF – – N R OFF
ON: Trigger 3 is triggered and the email has been sent
*SM1139 V V OFF – – N R OFF
successfully.
ON: Trigger 3 is triggered but the email cannot be sent due to
*SM1140 V V OFF – – N R OFF
email content error.
ON: Trigger 3 is triggered and there is an SMTP server
*SM1142 V V OFF – – N R OFF
response timeout.
ON: Trigger 3 is triggered and there is an SMTP server
*SM1143 V V OFF – – N R OFF
response error.
ON: Trigger 3 is triggered and the size of the attachment
*SM1144 V V OFF – – N R OFF
exceeds the limit.
*SM1145 ON: Trigger 3 is triggered and the attachment is not found. V V OFF – – N R OFF
*SM1146 Trigger 4 switch for the email. V V OFF – – N R OFF
*SM1147 Trigger 4 for the email V V OFF – – N R OFF
ON: Trigger 4 is triggered and the email has been sent
*SM1149 V V OFF – – N R OFF
successfully.
ON: Trigger 4 is triggered but the email cannot be sent due to
*SM1150 V V OFF – – N R OFF
email content error.
ON: Trigger 4 is triggered and there is an SMTP server
*SM1152 V V OFF – – N R OFF
response timeout.
ON: Trigger 4 is triggered and there is an SMTP server
*SM1153 V V OFF – – N R OFF
response error.
ON: Trigger 4 is triggered and the size of the attachment
*SM1154 V V OFF – – N R OFF
exceeds the limit.
*SM1155 ON: Trigger 4 is triggered and the attachment is not found. V V OFF – – N R OFF

2-31
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM1166 Error in data exchange through Ethernet V V – – – N R OFF


_2 *SM1167 Data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1168 Connection 1 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1169 Connection 2 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1170 Connection 3 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1171 Connection 4 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1172 Connection 5 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1173 Connection 6 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1174 Connection 7 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1175 Connection 8 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1176 Connection 9 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1177 Connection 10 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1178 Connection 11 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1179 Connection 12 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1180 Connection 13 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1181 Connection 14 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1182 Connection 15 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1183 Connection 16 for data exchange through Ethernet started V V OFF – – H R/W OFF
*SM1200 Successful data exchange connection 1 through Ethernet V V OFF – – N R OFF
*SM1201 Successful data exchange connection 2 through Ethernet V V OFF – – N R OFF
*SM1202 Successful data exchange connection 3 through Ethernet V V OFF – – N R OFF
*SM1203 Successful data exchange connection 4 through Ethernet V V OFF – – N R OFF
*SM1204 Successful data exchange connection 5 through Ethernet V V OFF – – N R OFF
*SM1205 Successful data exchange connection 6 through Ethernet V V OFF – – N R OFF
*SM1206 Successful data exchange connection 7 through Ethernet V V OFF – – N R OFF
*SM1207 Successful data exchange connection 8 through Ethernet V V OFF – – N R OFF
*SM1208 Successful data exchange connection 9 through Ethernet V V OFF – – N R OFF
*SM1209 Successful data exchange connection 10 through Ethernet V V OFF – – N R OFF
*SM1210 Successful data exchange connection 11 through Ethernet V V OFF – – N R OFF
*SM1211 Successful data exchange connection 12 through Ethernet V V OFF – – N R OFF
*SM1212 Successful data exchange connection 13 through Ethernet V V OFF – – N R OFF
*SM1213 Successful data exchange connection 14 through Ethernet V V OFF – – N R OFF
*SM1214 Successful data exchange connection 15 through Ethernet V V OFF – – N R OFF
*SM1215 Successful data exchange connection 16 through Ethernet V V OFF – – N R OFF
*SM1232 Error in data exchange connection 1 through Ethernet V V OFF – – N R OFF
*SM1233 Error in data exchange connection 2 through Ethernet V V OFF – – N R OFF
*SM1234 Error in data exchange connection 3 through Ethernet V V OFF – – N R OFF
*SM1235 Error in data exchange connection 4 through Ethernet V V OFF – – N R OFF
*SM1236 Error in data exchange connection 5 through Ethernet V V OFF – – N R OFF
*SM1237 Error in data exchange connection 6 through Ethernet V V OFF – – N R OFF
*SM1238 Error in data exchange connection 7 through Ethernet V V OFF – – N R OFF
*SM1239 Error in data exchange connection 8 through Ethernet V V OFF – – N R OFF
*SM1240 Error in data exchange connection 9 through Ethernet V V OFF – – N R OFF
*SM1241 Error in data exchange connection 10 through Ethernet V V OFF – – N R OFF
*SM1242 Error in data exchange connection 11 through Ethernet V V OFF – – N R OFF
*SM1243 Error in data exchange connection 12 through Ethernet V V OFF – – N R OFF
*SM1244 Error in data exchange connection 13 through Ethernet V V OFF – – N R OFF
*SM1245 Error in data exchange connection 14 through Ethernet V V OFF – – N R OFF

2-32
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

*SM1246 Error in data exchange connection 15 through Ethernet V V OFF – – N R OFF _2


*SM1247 Error in data exchange connection 16 through Ethernet V V OFF – – N R OFF
SM1269 Socket configuration error V V OFF – – N R/W OFF
SM1270 Successful TCP socket 1 connection V V OFF – – N R OFF
SM1271 TCP socket 1 data received V V OFF – – N R OFF
SM1272 TCP socket 1 data sent V V OFF – – N R OFF
SM1273 TCP socket 1 connection starting V V OFF – – N R OFF
SM1274 TCP socket 1 connection closing V V ON – – Y R ON
SM1275 TCP socket 1 data is being sent V V OFF – – N R OFF
SM1277 TCP socket 1─Error flag V V OFF – – N R OFF
SM1278 Successful TCP socket 2 connection V V OFF – – N R OFF
SM1279 TCP socket 2 data received V V OFF – – N R OFF
SM1280 TCP socket 2 data sent V V OFF – – N R OFF
SM1281 TCP socket 2 connection starting V V OFF – – N R OFF
SM1282 TCP socket 2 connection closing V V ON – – Y R ON
SM1283 TCP socket 2 data is being sent V V OFF – – N R OFF
SM1285 TCP socket 2─Error flag V V OFF – – N R OFF
Successful TCP socket 3 connection
SM1286 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 data received
SM1287 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 data sent
SM1288 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 connection starting
SM1289 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 connection closed
SM1290 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 data is being sent.
SM1291 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 3 – error flag
SM1293 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
Successful TCP socket 4 connection
SM1294 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 4 data received
SM1295 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

TCP socket 4 data sent


SM1296 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

TCP socket 4 connection starting


SM1297 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

2-33
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

TCP socket 4 connection closed


_2 SM1298 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 4 data is being sent.
SM1299 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 4 – error flag
SM1301 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
Successful TCP socket 5 connection
SM1302 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 data received
SM1303 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 data sent
SM1304 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 connection starting
SM1305 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 connection closed
SM1306 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 data is being sent.
SM1307 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 5 – error flag
SM1309 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
Successful TCP socket 6 connection
SM1310 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 6 data received
SM1311 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 6 data sent
Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
SM1312 EX3/SX3/SV3 CPU FW V1.00.00 or later
RTU-EN01 connection 1 status
V V OFF – – N R OFF
(ON: connecting, OFF: not connected or disconnected)
TCP socket 6 connection starting
Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
SM1313 EX3/SX3/SV3 CPU FW V1.00.00 or later
RTU-EN01 connection 2 status V V OFF – – N R OFF
TCP socket 6 connection closed
Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
SM1314
EX3/SX3/SV3 CPU FW V1.00.00 or later
RTU-EN01 connection 3 status V V OFF – – N R OFF
TCP socket 6 data is being sent.
Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
SM1315 EX3/SX3/SV3 CPU FW V1.00.00 or later
RTU-EN01 connection 4 status V V OFF – – N R OFF

2-34
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

TCP socket 6 – error flag _2


SM1317 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
Successful TCP socket 7 connection
SM1318 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 data received
SM1319 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 data sent
SM1320 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 connection starting
SM1321 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 connection closed
SM1322 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 data is being sent.
SM1323 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 7 – error flag
SM1325 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
Successful TCP socket 8 connection
SM1326 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 data received
SM1327 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 data sent
SM1328 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 connection starting
SM1329 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 connection closed
SM1330 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 data is being sent.
SM1331 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
TCP socket 8 – error flag
SM1333 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
SM1334 UDP socket 1 connection started V V OFF – – N R OFF
SM1335 UDP socket 1 data received V V OFF – – N R OFF
SM1336 UDP socket 1 data sent V V OFF – – N R OFF
SM1337 UDP socket 1 connection closed V V ON – – Y R ON
SM1338 UDP socket 1- error flag V V OFF – – N R OFF
SM1339 UDP socket 2 connection started V V OFF – – N R OFF
SM1340 UDP socket 2 data received V V OFF – – N R OFF
SM1341 UDP socket 2 data sent V V OFF – – N R OFF

2-35
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM1342 UDP socket 2 connection closed V V ON – – Y R ON


_2 SM1343 UDP socket 2- error flag V V OFF – – N R OFF
UDP socket 3 connection started
SM1344 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 3 data received
SM1345 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 3 data sent
SM1346 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 3 connection closed
SM1347 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 3 – error flag
SM1348 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 4 connection started
SM1349 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 4 data received
SM1350 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 4 data sent
SM1351 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 4 connection closed
SM1352 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 4 – error flag
SM1353 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 5 connection started
SM1354 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 5 data received
SM1355 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 5 data sent
SM1356 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 5 connection closed
SM1357 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 5 – error flag
SM1358 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

UDP socket 6 connection started


SM1359 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

UDP socket 6 data received


SM1360 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later

2-36
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

UDP socket 6 data sent _2


SM1361 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 6 connection closed
SM1362 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 6 – error flag
SM1363 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 7 connection started
SM1364 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 7 data received
SM1365 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 7 data sent
SM1366 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 7 connection closed
SM1367 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 7 – error flag
SM1368 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 8 connection started
SM1369 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 8 data received
SM1370 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 8 data sent
SM1371 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 8 connection closed
SM1372 Available for ES3 CPU FW V1.08.00 or later and V V ON – – Y R ON
EX3/SX3/SV3 CPU FW V1.00.00 or later
UDP socket 8 – error flag
SM1373 Available for ES3 CPU FW V1.08.00 or later and V V OFF – – N R OFF
EX3/SX3/SV3 CPU FW V1.00.00 or later
*SM1375 Data exchange through EtherNet/IP (Scanner) started. V V OFF – – H R/W OFF
Connection 1 for data exchange through EtherNet/IP
*SM1376 V V OFF – – H R/W OFF
(Scanner) started
Connection 2 for data exchange through EtherNet/IP
*SM1377 V V OFF – – H R/W OFF
(Scanner) started
Connection 3 for data exchange through EtherNet/IP
*SM1378 V V OFF – – H R/W OFF
(Scanner) started
Connection 4 for data exchange through EtherNet/IP
*SM1379 V V OFF – – H R/W OFF
(Scanner) started
Connection 5 for data exchange through EtherNet/IP
*SM1380 V V OFF – – H R/W OFF
(Scanner) started
Connection 6 for data exchange through EtherNet/IP
*SM1381 V V OFF – – H R/W OFF
(Scanner) started
Connection 7 for data exchange through EtherNet/IP
*SM1382 V V OFF – – H R/W OFF
(Scanner) started

2-37
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Connection 8 for data exchange through EtherNet/IP


_2 *SM1383
(Scanner) started
V V OFF – – H R/W OFF
Connection 9 for data exchange through EtherNet/IP
*SM1384 V V OFF – – H R/W OFF
(Scanner) started
Connection 10 for data exchange through EtherNet/IP
*SM1385 V V OFF – – H R/W OFF
(Scanner) started
Connection 11 for data exchange through EtherNet/IP
*SM1386 V V OFF – – H R/W OFF
(Scanner) started
Connection 12 for data exchange through EtherNet/IP
*SM1387 V V OFF – – H R/W OFF
(Scanner) started
Connection 13 for data exchange through EtherNet/IP
*SM1388 V V OFF – – H R/W OFF
(Scanner) started
Connection 14 for data exchange through EtherNet/IP
*SM1389 V V OFF – – H R/W OFF
(Scanner) started
Connection 15 for data exchange through EtherNet/IP
*SM1390 V V OFF – – H R/W OFF
(Scanner) started
Connection 16 for data exchange through EtherNet/IP
*SM1391 V V OFF – – H R/W OFF
(Scanner) started
Error in data exchange connection 1 through EtherNet/IP
*SM1408 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 2 through EtherNet/IP
*SM1409 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 3 through EtherNet/IP
*SM1410 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 4 through EtherNet/IP
*SM1411 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 5 through EtherNet/IP
*SM1412 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 6 through EtherNet/IP
*SM1413 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 7 through EtherNet/IP
*SM1414 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 8 through EtherNet/IP
*SM1415 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 9 through EtherNet/IP
*SM1416 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 10 through EtherNet/IP
*SM1417 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 11 through EtherNet/IP
*SM1418 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 12 through EtherNet/IP
*SM1419 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 13 through EtherNet/IP
*SM1420 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 14 through EtherNet/IP
*SM1421 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 15 through EtherNet/IP
*SM1422 V V OFF – – H R/W OFF
(Scanner)
Error in data exchange connection 16 through EtherNet/IP
*SM1423 V V OFF – – H R/W OFF
(Scanner)
SM1440 Error in I/O connection 1 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1441 Error in I/O connection 2 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1442 Error in I/O connection 3 through EtherNet/IP (Adapter) V V OFF – – N R OFF

2-38
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM1443 Error in I/O connection 4 through EtherNet/IP (Adapter) V V OFF – – N R OFF _2


SM1444 Error in I/O connection 5 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1445 Error in I/O connection 6 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1446 Error in I/O connection 7 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1447 Error in I/O connection 8 through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1448 I/O connection 1 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1449 I/O connection 2 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1450 I/O connection 3 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1451 I/O connection 4 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1452 I/O connection 5 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1453 I/O connection 6 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1454 I/O connection 7 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
SM1455 I/O connection 8 is established through EtherNet/IP (Adapter) V V OFF – – N R OFF
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 1
SM1581
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 1
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 2
SM1582
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 2
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 3
SM1583
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 3
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 4
SM1584
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 4
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 5
SM1585
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 5
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 6
SM1586
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 6
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 7
SM1587
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 7
Refresh and then release the control right over the connection
V V OFF OFF – N R/W OFF
of Delta servo CAN axis 8
SM1588
Refresh and then release the control right over the connection
V X OFF OFF – N R/W OFF
of Delta drive EtherCAT axis 8
Refresh and then release the control over the connection of
SM1601 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 21
Refresh and then release the control over the connection of
SM1602 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 22
Refresh and then release the control over the connection of
SM1603 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 23

2-39
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

Refresh and then release the control over the connection of


_2 SM1604
Delta inverter CAN axis 24
V V OFF OFF – N R/W OFF
Refresh and then release the control over the connection of
SM1605 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 25
Refresh and then release the control over the connection of
SM1606 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 26
Refresh and then release the control over the connection of
SM1607 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 27
Refresh and then release the control over the connection of
SM1608 V V OFF OFF – N R/W OFF
Delta inverter CAN axis 28
SM1611 Heartbeat error of Delta inverter CAN communication ID 21 V V OFF OFF – N R OFF
SM1612 Heartbeat error of Delta inverter CAN communication ID 22 V V OFF OFF – N R OFF
SM1613 Heartbeat error of Delta inverter CAN communication ID 23 V V OFF OFF – N R OFF
SM1614 Heartbeat error of Delta inverter CAN communication ID 24 V V OFF OFF – N R OFF
SM1615 Heartbeat error of Delta inverter CAN communication ID 25 V V OFF OFF – N R OFF
SM1616 Heartbeat error of Delta inverter CAN communication ID 26 V V OFF OFF – N R OFF
SM1617 Heartbeat error of Delta inverter CAN communication ID 27 V V OFF OFF – N R OFF
SM1618 Heartbeat error of Delta inverter CAN communication ID 28 V V OFF OFF – N R OFF
SM1621 Delta inverter CAN communication ID 21 is starting V V OFF OFF – N R OFF
SM1622 Delta inverter CAN communication ID 22 is starting V V OFF OFF – N R OFF
SM1623 Delta inverter CAN communication ID 23 is starting V V OFF OFF – N R OFF
SM1624 Delta inverter CAN communication ID 24 is starting V V OFF OFF – N R OFF
SM1625 Delta inverter CAN communication ID 25 is starting V V OFF OFF – N R OFF
SM1626 Delta inverter CAN communication ID 26 is starting V V OFF OFF – N R OFF
SM1627 Delta inverter CAN communication ID 27 is starting V V OFF OFF – N R OFF
SM1628 Delta inverter CAN communication ID 28 is starting V V OFF OFF – N R OFF
Positioning completed for Delta servo CAN axis 1 V V OFF OFF – N R/W OFF
SM1631
Servo positioning completed for Delta drive EtherCAT axis 1 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 2 V V OFF OFF – N R/W OFF
SM1632
Servo positioning completed for Delta drive EtherCAT axis 2 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 3 V V OFF OFF – N R/W OFF
SM1633
Servo positioning completed for Delta drive EtherCAT axis 3 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 4 V V OFF OFF – N R/W OFF
SM1634
Servo positioning completed for Delta drive EtherCAT axis 4 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 5 V V OFF OFF – N R/W OFF
SM1635
Servo positioning completed for Delta drive EtherCAT axis 5 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 6 V V OFF OFF – N R/W OFF
SM1636
Servo positioning completed for Delta drive EtherCAT axis 6 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 7 V V OFF OFF – N R/W OFF
SM1637
Servo positioning completed for Delta drive EtherCAT axis 7 V X OFF OFF – N R/W OFF
Positioning completed for Delta servo CAN axis 8 V V OFF OFF – N R/W OFF
SM1638
Servo positioning completed for Delta drive EtherCAT axis 8 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 1 V V OFF OFF – N R/W OFF
SM1641
Servo stops for Delta drive EtherCAT axis 1 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 2 V V OFF OFF – N R/W OFF
SM1642
Servo stops for Delta drive EtherCAT axis 2 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 3 V V OFF OFF – N R/W OFF
SM1643
Servo stops for Delta drive EtherCAT axis 3 V X OFF OFF – N R/W OFF

2-40
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

SM1644
Communication stops for Delta servo CAN axis 4 V V OFF OFF – N R/W OFF _2
Servo stops for Delta drive EtherCAT axis 4 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 5 V V OFF OFF – N R/W OFF
SM1645
Servo stops for Delta drive EtherCAT axis 5 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 6 V V OFF OFF – N R/W OFF
SM1646
Communication stops for Delta drive EtherCAT axis 6 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 7 V V OFF OFF – N R/W OFF
SM1647
Servo stops for Delta drive EtherCAT axis 7 V X OFF OFF – N R/W OFF
Communication stops for Delta servo CAN axis 8 V V OFF OFF – N R/W OFF
SM1648
Servo stops for Delta drive EtherCAT axis 8 V X OFF OFF – N R/W OFF
Servo is ON for Delta servo CAN axis 1 V V OFF OFF – N R OFF
SM1651
Servo is ON or inverter is ON for Delta drive EtherCAT axis 1 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 2 V V OFF OFF – N R OFF
SM1652
Servo is ON or inverter is ON for Delta drive EtherCAT axis 2 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 3 V V OFF OFF – N R OFF
SM1653
Servo is ON or inverter is ON for Delta drive EtherCAT axis 3 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 4 V V OFF OFF – N R OFF
SM1654
Servo is ON or inverter is ON for Delta drive EtherCAT axis 4 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 5 V V OFF OFF – N R OFF
SM1655
Servo is ON or inverter is ON for Delta drive EtherCAT axis 5 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 6 V V OFF OFF – N R OFF
SM1656
Servo is ON or inverter is ON for Delta drive EtherCAT axis 6 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 7 V V OFF OFF – N R OFF
SM1657
Servo is ON or inverter is ON for Delta drive EtherCAT axis 7 V X OFF OFF – N R OFF
Servo is ON for Delta servo CAN axis 8 V V OFF OFF – N R OFF
SM1658
Servo is ON or inverter is ON for Delta drive EtherCAT axis 8 V X OFF OFF – N R OFF
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 1.
SM1661
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 1.
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 2.
SM1662
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 2.
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 3.
SM1663
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 3.
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 4.
SM1664
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 4.
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 5.
SM1665
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 5.
The function of going back and forth is enabled for Delta
V V OFF OFF – N R/W OFF
servo CAN axis 6.
SM1666
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 6.

2-41
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

The function of going back and forth is enabled for Delta


_2 servo CAN axis 7.
V V OFF OFF – N R/W OFF
SM1667
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 7.
The servo of going back and forth is enabled for Delta servo
V V OFF OFF – N R/W OFF
CAN axis 8.
SM1668
The servo function of going back and forth is enabled for
V X OFF OFF – N R/W OFF
Delta drive EtherCAT axis 8.
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 1
SM1671
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 1
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 2
SM1672
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 2
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 3
SM1673
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 3
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 4
SM1674
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 4
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 5
SM1675
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 5
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 6
SM1676
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 6
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 7
SM1677
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 7
The go-back/go-forth direction indication flag for Delta servo
V V OFF OFF – N R OFF
CAN axis 8
SM1678
The servo go-back/go-forth direction indication flag for Delta
V X OFF OFF – N R OFF
drive EtherCAT axis 8
Initialization and CAN communication (INITC and CASD)
V V OFF OFF – N R OFF
SM1681 completed for Delta servo
EtherCAT communication (CASD) completed for Delta drive V X OFF OFF – N R OFF
The CAN communication error flag for Delta servo V V OFF OFF – N R OFF
SM1682
The EtherCAT communication error flag for Delta drive V X OFF OFF – N R OFF

Initialization and CAN communication completed


SM1683 V V OFF OFF – N R OFF
(INITC&CASD) for Delta inverter

To set the Delta special CAN communication ON/OFF when a


connection is lost
SM1684 V V OFF OFF – N R/W OFF
OFF: stops all the communications
ON: stops only the lost-connection one

2-42
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series
OFF STOP RUN

Attribute
Latched

Default
SM Function   
ON RUN STOP

To set the Delta drive EtherCAT communication ON/OFF _2


when a connection is lost
V X OFF OFF – N R/W OFF
OFF: stops all the communications
ON: stops only the lost-connection one
SM1685 To read the self-defined Delta servo parameters P0-12 V V OFF OFF – N R/W OFF

SM1686 OFF: initialize a consecutive number of modules V V OFF OFF – N R/W OFF
ON: initialize a specific module
Heartbeat error flag of Delta special CAN axis 1 V V OFF OFF – N R OFF
SM1691
Disconnection error flag of Delta drive EtherCAT axis 1 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 2 V V OFF OFF – N R OFF
SM1692
Disconnection error flag of Delta drive EtherCAT axis 2 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 3 V V OFF OFF – N R OFF
SM1693
Disconnection error flag of Delta drive EtherCAT axis 3 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 4 V V OFF OFF – N R OFF
SM1694
Disconnection error flag of Delta drive EtherCAT axis 4 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 5 V V OFF OFF – N R OFF
SM1695
Disconnection error flag of Delta drive EtherCAT axis 5 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 6 V V OFF OFF – N R OFF
SM1696
Disconnection error flag of Delta drive EtherCAT axis 6 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 7 V V OFF OFF – N R OFF
SM1697
Disconnection error flag of Delta drive EtherCAT axis 7 V X OFF OFF – N R OFF
Heartbeat error flag of Delta special CAN axis 8 V V OFF OFF – N R OFF
SM1698
Disconnection error flag of Delta drive EtherCAT axis 8 V X OFF OFF – N R OFF
Flag to activate the backlash compensation at Y0/Y1 for
*SM1700 V V OFF OFF – N R/W OFF
CSFO instruction
Flag to activate the backlash compensation at Y2/Y3 for
*SM1701 V V OFF OFF – N R/W OFF
CSFO instruction
Flag to activate the backlash compensation at Y4/Y5 for
*SM1702 V V OFF OFF – N R/W OFF
CSFO instruction
Flag to activate the backlash compensation at Y6/Y7 for
*SM1703 V V OFF OFF – N R/W OFF
CSFO instruction

*1: For items with a * mark, refer to Additional Remarks on Special Auxiliary Relays and Special Data Registers for details.

*2: If the state is – when the SM power changes from OFF to ON and the latched area is marked as N, the system will
execute according to the parameters set in HWCONFIG of ISPSoft or in Hardware Configuration of DIADesigner.

2-43
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2.8 Refresh Time for Special Auxiliary Relays


Special auxiliary relay Refresh time
The system automatically sets the flag to ON and resets it to OFF.
SM0–SM1
ON: operation error.
The system automatically sets the flag to ON and resets it to OFF.
SM5
ON: an error occurs when the program is written in the PLC.
_2 SM6
During power-on, the system checks whether the data in the latched area has been lost.
ON: data in the latched area has been lost. You reset it to OFF.
SM7 ON: power supply (24 V) is not sufficient. You reset it to OFF.
The system automatically sets SM8 to ON and resets it to OFF.
SM8
ON: there is a watchdog timer error.
The system automatically sets SM9 to ON and resets it to OFF.
SM9
ON: there is a system error.
The system automatically sets SM10 to ON and resets it to OFF.
SM10
ON: there is an I/O bus error.
You set the flag to ON, and the system automatically resets it to OFF.
SM22–SM24
ON: the log is cleared.
ON: users are editing with the software.
SM25–SM26
OFF: users have logged out of the software.
SM27 The flag is with a built-in AD analog value. The system sets it to ON and resets it to OFF.
The system checks for anything wrong.
SM28
ON: something is wrong. You reset it to OFF.
SM29 The system sets the flag to ON, and you reset it to OFF.
SM34 ON: the wrong password is entered. The system resets it to OFF.
ON: the system saves the data to the memory card. After saving is complete, the system resets it
SM36
to OFF automatically. You set it to ON to enable saving.
SM96–SM97 You set the flag to ON. After the data is sent, the system automatically resets the flag to OFF.
ON: communication is in process. After the communication is complete, the system resets it to
SM98–SM99
OFF automatically.
The system automatically sets the flag to ON, and you reset it to OFF.
SM100–SM101
ON: the command is received.
The system automatically sets the flag to ON, and you reset it to OFF.
SM102–SM103
ON: the command received is wrong.
The system automatically sets the flag to ON, and you reset it to OFF.
SM104–SM105
ON: there is a receive timeout.
You set the flag to ON and reset it to OFF.
SM106–SM107 ON: 8-bit mode
OFF: 16-bit mode
SM120-SM151 You set the flag to ON and while executing DPLSY instruction, the system resets it to OFF.
You set the flag to ON and after PLC RUN->STOP, it clears the non-latched area. The system
SM203
automatically resets the flag to OFF.
You set the flag to ON, and the system automatically resets it to OFF.
SM204–SM205
ON: clear the non-latched/latched areas.

You set SM206 to ON and reset it to OFF.


SM206
ON: inhibit all output.

You set SM209 to ON, and the system automatically resets it to OFF.
SM209
ON: the communication protocol of COM1 changes.

2-44
Ch a pt er 2 D e v ic es

Special auxiliary relay Refresh time


You set SM210 to ON and reset it to OFF for COM1.
SM210 ON: RTU mode
OFF: ASCII mode
You set SM211 to ON, and the system automatically resets it to OFF.
SM211
ON: the communication protocol of COM2 changes.
You set SM210 to ON and reset it to OFF for COM2. _2
SM212 ON: RTU mode
OFF: ASCII mode
You set SM215 to ON and reset it to OFF.
SM215 ON: the PLC runs.
OFF: the PLC stops.
SM217 The system sets the flag to ON or OFF.
The system checks the real-time clock at power-on.
SM218 ON: real-time clock error
You reset it to OFF.
The system monitors the battery power of the real-time clock.
SM219 ON: real-time clock power is low
The system resets it to OFF.
You set SM220 to ON and reset it to OFF.
SM220
ON: calibrating the real-time clock within ±30 seconds
The flag is refreshed according to the settings in HWCONFIG or when the DST instruction (API
SM221 1607) is executed.
ON: the DST instruction is executed.
SM222 The flag is refreshed during calibration
SM227-SM228 The flag is refreshed when the CPU is supplied with power
SM229 You set the flag to ON or OFF.
You set the flag to ON to read the MAC address of a left-side module, and the system
SM264
automatically will reset it to OFF after the MAC address reading is complete.
SM265~SM266 You set the flag to ON or reset it to OFF.
The flag is ON when the CSFO instruction is executed.
SM270–SM275 ON: enable reversing the input direction
OFF: disable reversing the input direction
You set the flag to ON and reset it to OFF.
SM281–SM288 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM291–SM296 ON: enable clearing the input points
OFF: disable clearing the input points
You set the flag to ON and reset it to OFF.
SM300 ON: counting down
OFF: counting up

The system sets the flag to ON and reset it to OFF.


SM301–SM303 ON: counting down
OFF: counting up

You set the flag to ON and reset it to OFF.


SM304 ON: counting down
OFF: counting up

2-45
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special auxiliary relay Refresh time


You set the flag to ON and reset it to OFF.
SM305–SM307 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM308 ON: counting down
OFF: counting up
_2 You set the flag to ON and reset it to OFF.
SM309–SM311 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM312 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM313–SM315 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM316 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM317–SM319 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM320 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM321–SM323 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM332 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM333–SM335 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM336 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM337–SM339 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM340 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM341 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM342 ON: counting down
OFF: counting up

2-46
Ch a pt er 2 D e v ic es

Special auxiliary relay Refresh time


You set the flag to ON and reset it to OFF.
SM343 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM344 ON: counting down
OFF: counting up _2
You set the flag to ON and reset it to OFF.
SM345 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM346 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM347 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM348 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM349 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM350 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM351 ON: counting down
OFF: counting up
You set the flag to ON and reset it to OFF.
SM352–SM353 ON: counting down
OFF: counting up

SM360-SM391 You set the flag to ON or OFF.

The system automatically sets the flag to ON and resets it to OFF.


SM400–SM403
The flag is refreshed every scan cycle.
The system automatically sets the flag to ON and resets it to OFF.
SM404
SM404 is refreshed every 5 milliseconds.
The system automatically sets SM405 to ON and resets it to OFF.
SM405
SM405 is refreshed every 50 milliseconds.
The system automatically sets SM406 to ON and resets it to OFF.
SM406
SM406 is refreshed every 100 milliseconds.
The system automatically sets SM407 to ON and resets it to OFF.
SM407
SM407 is refreshed every 0.5 seconds.
The system automatically sets the flag to ON and resets it to OFF.
SM408
SM408 is refreshed every 1 second.
The system automatically sets the flag to ON and resets it to OFF.
SM409
SM409 is refreshed every n seconds and n seconds is set in SR409.
The system automatically sets the flag to ON and resets it to OFF.
SM410
SM410 is refreshed every n milliseconds and n milliseconds is set in SR410.

2-47
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special auxiliary relay Refresh time


You set the flag to ON.
SM441 When the DDRVM/DDRVIC/DDRVAC instruction is executed, the system will automatically reset
the flag to OFF.
The system automatically sets SM450 to ON and resets it to OFF.
SM450 ON: memory card is inserted into the PLC.
OFF: memory card is removed out of the PLC.
_2 SM452–SM453 The system sets the flag to ON or OFF.
SM454 You set the flag to ON or OFF.
SM455 The system sets the flag to ON or OFF.
SM456 You set the flag to ON to save. After the saving is complete, the system resets it to OFF.
SM457 The system sets the flag to ON or OFF.
SM460 The system sets the flag to ON or OFF.
SM461 The system sets the flag to ON and you reset it to OFF.
SM462–SM464 You set the flag to ON or OFF.
SM465 The system sets the flag to ON and you reset it to OFF.
SM466 You set the flag to ON or OFF.
SM467 The system sets the flag to ON and you reset it to OFF.
SM469–SM471 You set the flag to ON or OFF.
SM472 The system sets the flag to ON or OFF.
SM473 The system sets the flag to ON and you reset it to OFF.
SM474–SM477 You set the flag to ON or OFF.
SM478–SM479 You set the flag to ON or OFF and the system sets the flag to OFF.
SM480 The system sets the flag to ON or OFF.
SM481 The system sets the flag to ON and you reset it to OFF.
SM482–SM484 You set the flag to ON or OFF.
SM485 The system sets the flag to ON and you reset it to OFF.
SM486 You set the flag to ON or OFF.
SM487 The system sets the flag to ON and you reset it to OFF.
SM488–SM491 You set the flag to ON or OFF.
SM492 The system sets the flag to ON or OFF.
SM493 The system sets the flag to ON and you reset it to OFF.
SM494–SM497 You set the flag to ON or OFF.
SM498–SM499 You set the flag to ON or OFF and the system sets the flag to OFF.
SM500 The system sets the flag to ON or OFF.
SM501 The system sets the flag to ON and you reset it to OFF.
SM502–SM504 You set the flag to ON or OFF.
SM505 The system sets the flag to ON and you reset it to OFF.
SM506 You set the flag to ON or OFF.
SM507 The system sets the flag to ON and you reset it to OFF.
SM509–SM511 You set the flag to ON or OFF.
SM512 The system sets the flag to ON or OFF.
SM513 The system sets the flag to ON and you reset it to OFF.
SM514–SM517 You set the flag to ON or OFF.
SM518–SM519 You set the flag to ON or OFF and the system sets the flag to OFF.
SM520 The system sets the flag to ON or OFF.
SM521 The system sets the flag to ON and you reset it to OFF.
SM522–SM524 You set the flag to ON or OFF.

2-48
Ch a pt er 2 D e v ic es

Special auxiliary relay Refresh time


SM525 The system sets the flag to ON and you reset it to OFF.
SM526 You set the flag to ON or OFF.
SM527 The system sets the flag to ON and you reset it to OFF.
SM529–SM531 You set the flag to ON or OFF.
SM532 The system sets the flag to ON or OFF.
SM533 The system sets the flag to ON and you reset it to OFF. _2
SM534–SM537 You set the flag to ON or OFF.
SM538–SM539 You set the flag to ON or OFF and the system sets the flag to OFF.
You set the flag to ON and the system resets it to OFF.
SM580
ON: disable high-speed output
SM581 You set the flag to ON or OFF.
SM585 You set the flag to ON or OFF and the system sets the flag to OFF.
SM586—SM587 You set the flag to ON or OFF.
You set the flag to ON.
SM588
Either you or the system sets the flag to OFF.
You set the flag to ON or reset it to OFF.
SM589 The flag is used with the DPLSR/DDRVI/DDRVA/DDRVM/DPPMR/DPPMA/TPO instruction
together.
You set the flag to ON.
SM591~SM594
Either you or the system sets the flag to OFF.
The system automatically sets the flag to ON and resets it to OFF.
SM600–SM602
The flag is refreshed when the instruction is executed.
SM603 Execute XCMP instruction.
You set SM604 to ON and reset it to OFF.
SM604 ON: sort in descending order
OFF: sort in ascending order
SM605 You set SM605 to ON and reset it to OFF.
You set SM606 to ON and reset it to OFF.
SM606 ON: 8-bit mode
OFF: 16-bit mode
SM607 You set the flag to ON or OFF.
SM608 The flag is refreshed when the instruction is executed.
SM609 You set the flag to ON or OFF.
SM610–SM611 The flag is refreshed when the instruction is executed.
SM612–SM613 You set the flag to ON or OFF.
SM614 The flag is refreshed when the instruction is executed.
SM615–SM617 You set the flag to ON or OFF.
SM618 The flag is refreshed when the instruction is executed.
SM619 The flag is refreshed when the EI or DI instruction is executed.
SM620 The flag is refreshed when the CMPT instruction is executed.
SM621–SM686 You set the flag to ON or OFF.
SM687 The flag is refreshed when the RAMP instruction is executed.
SM688 The flag is refreshed when the INCD instruction is executed.
SM690–SM691 You set the flag to ON or OFF.
SM692 The flag is refreshed when the HKY instruction is executed.
SM693 The flag is refreshed when the SEGL instruction is executed.

2-49
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special auxiliary relay Refresh time


SM694 The flag is refreshed when the DSW instruction is executed.
SM695 You set the flag to ON or OFF.
SM719 You set the flag to ON and reset it to OFF.
SM749 The system is refreshed at power-on after the data exchange parameters are downloaded.
SM750–SM783 After the data exchange parameters are downloaded, you set the flag to ON or OFF.

_2 SM784–SM847 The flag is ON when the system is refreshed.


SM861 The system is refreshed at power-on after the data exchange parameters are downloaded.
SM862–SM895 After the parameters of data exchange are downloaded, you set the flag to ON or OFF.
SM896–SM959 The flag is ON, when the system is refreshed automatically.
SM976-SM990 The flag is ON, when the system is refreshed automatically.
SM1000 You set the flag to ON and after saving, the system sets the flag to OFF.
SM1006 You set the flag to ON or OFF.
SM1008–SM1015 You set the flag to ON or OFF.
SM1016–SM1031 The flag is ON, when the system is refreshed automatically.
ON: the Ethernet connection is active.
SM1001
OFF: the Ethernet connection is not active.
SM1037 You set the flag to ON or reset it to OFF.
SM1090 ON: the TCP connection is busy.
SM1091 ON: the UDP connection is busy.
SM1092 ON: when the system is refreshed.
SM1100 The flag is refreshed when API 2200-API 2210 is executed or the network cable is reconnected.
SM1106 ON: the PHY initialization fails.
SM1107 ON: the IP address, the netmask address, and the gateway address are set incorrectly.
SM1109 ON: the socket function is enabled and the same port is used.
SM1110 ON: the IP filter of AS-FEN02 is set incorrectly.
SM1111 You set the flag to ON or OFF.
SM1113 ON: there is a server error.
SM1116 ON: the trigger of the PLC parameter is enabled.
SM1117 ON: the trigger of the PLC parameter is triggered.
SM1119 ON: the trigger is enabled and the last mail has been sent successfully.
SM1120 ON: the trigger is enabled and the last mail has been sent with an error.
SM1122–SM1123 ON: the trigger is enabled and there is an SMTP server response timeout.
SM1124 ON: the trigger is enabled and the size of the attachment exceeds the limit.
SM1125 ON: the trigger is enabled and the attachment is not found.
SM1126–SM1127 ON: the trigger of the PLC parameter is enabled.
SM1129 ON: the trigger is enabled and the last mail has been sent successfully.
SM1130 ON: the trigger is enabled and the last mail has been sent with an error.
SM1132 ON: the trigger is enabled and there is an SMTP server response timeout.
SM1133 ON: the trigger is enabled and there is an SMTP server response error.
SM1134 ON: the trigger is enabled and the size of the attachment exceeds the limit.
SM1135 ON: the trigger is enabled and the attachment is not found.
SM1136 ON: the trigger for the PLC parameter is enabled.
SM1137 ON: the trigger for the PLC parameter is triggered.
SM1139 ON: the trigger is enabled and the last mail has been sent successfully.
SM1140 ON: the trigger is enabled and the last mail has been sent with an error.
SM1142 ON: the trigger is enabled and there is an SMTP server response timeout.

2-50
Ch a pt er 2 D e v ic es

Special auxiliary relay Refresh time


SM1143 ON: the trigger is enabled and there is an SMTP server response error.
SM1144 ON: the trigger is enabled and the size of the attachment exceeds the limit.
SM1145 ON: the trigger is enabled and the attachment is not found.
SM1146 ON: the trigger for the PLC parameter is enabled.
SM1147 ON: the trigger for the PLC parameter is triggered.
SM1149 ON: the trigger is enabled and the last mail has been sent successfully.
_2
SM1150 ON: the trigger is enabled and the last mail has been sent with an error.
SM1152 ON: the trigger is enabled and there is an SMTP server response timeout.
SM1153 ON: the trigger is enabled and there is an SMTP server response error.
SM1154 ON: the trigger is enabled and the size of the attachment exceeds the limit.
SM1155 ON: the trigger is enabled and the attachment is not found.
SM1166 After the data exchange parameters are downloaded, the system is refreshed.
SM1167–SM1183 After the data exchange parameters are downloaded, you set the flag to ON or OFF.
SM1200–SM1215
ON: when the system is refreshed.
SM1232–SM1247
SM1269 ON: there is a socket configuration error.
SM1270–SM1373 The flag is refreshed when the socket function is executed.
After the data exchange parameters are downloaded through EtherNet/IP, you set the flag to ON
SM1375–SM1407
or OFF.
SM1408–SM1439 ON: an error occurred in data exchange through EtherNet/IP.
SM1440–SM1447 ON: a timeout occurred in the adapter of the I/O connection through EtherNet/IP.
ON: I/O connection is established through EtherNet/IP (Adapter).
SM1448-SM1455
OFF: I/O connection is NOT established or the communication is disconnected.
SM1581–SM1588 You set the flag to ON or OFF.
SM1601–SM1608 You set the flag to ON or OFF.
SM1611-SM1618 The system sets the flag to ON or OFF.
SM1621-SM1628 The system sets the flag to ON or OFF.
SM1631–SM1638 The system sets the flag to ON and you set it to OFF.
SM1641–SM1648 You set the flag to ON or OFF.
SM1651–SM1658 The system sets the flag to ON or OFF.
SM1661–SM1668 You set the flag to ON or OFF.
SM1671–SM1682 The system sets the flag to ON or OFF.
SM1683 The system sets the flag to ON or OFF.
SM1684—SM1686 You set the flag to ON or OFF.
SM1691-SM1698 The system sets the flag to ON or OFF.
SM1700-SM1703 You set the flag to ON or OFF.

2.2.9 Stepping Relays (S)


You can easily use the stepping relays in industrial automation to set a procedure. They are the most basic devices in
ladder diagram (LD) programming.

There are 2048 stepping relays, (S0–S2047). Every stepping relay is like an output relay in that it has an output coil,
contact A, and contact B. You can use a stepping relay several times in a program, but the relay cannot directly drive the
external load. In addition, you can use the stepping relay as a general auxiliary relay when it is not used in a sequential
function chart.

2-51
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2.10 Timers (T)


This topic describes the timers available.

 100 millisecond timer: The timer specified by the TMR instruction takes 100 milliseconds as the timing unit.

 1 millisecond timer: The timer specified by the TMRH instruction takes 1 millisecond as the timing unit.

 The accumulative timers are ST0–ST511. If you want to use the device-monitoring function, these timers can monitor
_2 T0–T511.

 If you use the same timer repeatedly in a program, including in different TMR and TMRH instructions, the timer setting
value is the one that the timer matches first.

 If you use the same timer repeatedly in a program, the timer is OFF when one of the conditional contacts is OFF.

 If you use the same timer in a program as the timer for a subroutine’s exclusive use and an accumulative timer in the
program, it is OFF when one of the conditional contacts is OFF.

 When the conditional contact of the TMR instruction switches from ON to OFF, its T timer is reset to 0 but the value of
the ST timer is not cleared to 0.

 When the TMR instruction is executed, the specified timer coil is ON and the timer begins to count. When the value of
the timer matches the timer setting value (value of the timer ≧ setting value), the state of the contact is ON.

A. General-purpose timers

When the TMR instruction is executed, the general-purpose timer begins to count. When the value of the timer
matches the timer setting value, the output coil is ON.

• When M0=ON and the timer takes 100 ms as the timing unit, the output coil T0 is ON when the value of the
timer = timer setting value100.

• When M0=OFF, the value of the timer T0 is 0 and the output coil T0 is OFF.

10 sec.

M0
SV: K100
T0 (PV)

M1

2-52
Ch a pt er 2 D e v ic es

B. Accumulative timers

When the TMR instruction is executed, the accumulative timer begins to count. When the value of the timer matches
the timer setting value, the output coil is ON. As long as you add the letter S in front of the letter T, the timer becomes
an accumulative timer. When the conditional contact is OFF, the value of the accumulative timer is not reset. When
the conditional contact is ON, the accumulative timer counts from the current value.

• When M0=ON and the timer T250 takes 100 ms as the timing unit, the output coil T250 is ON when the value _2
of the timer = timer setting value 100.

• When M0=OFF, the accumulative timer T250 stops counting, and the value of the timer stays unchanged.
When M0=ON, the value of the timer is the accumulating value. When the accumulated value = timer setting
value 100, the output coil T250 is ON.

T1 T2 T1+T2=10sec

M0
SV: K100
T250 (PV)

M1

C. Timers used in function blocks

T412–T511 are the timers that you can use in the function block or in interrupts.

When the TMR or END instruction is executed, the timer in the functional block begins to count. When the value of
the timer matches the timer setting value, the output coil is ON.

If you use a general-purpose timer in a function block or an interrupt, and the function or interrupt is not executed, the
timer cannot count correctly.

2.2.11 Counters
 Characteristics of the 16-bit counter

Item 16-bit counter


Type General type
Number C0–C511

2-53
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Item 16-bit counter


Direction Counting up
Setting value 0–32,767
The setting value can be either the constant or the value in the data
Specifying the counter setting value
register.
The counter stops counting when the value of the counter matches
Change of the current value
the counter setting value.
_2
The contact is ON when the value of the counter matches the counter
Output contact
setting value.
When the instruction RST is executed, the current value is cleared to
Reset
zero, and the contact is reset of OFF.
Action of the contact After the scan is complete, the contact acts.
 Function of the counter

Each time the input switches from OFF to ON, the value of the counter is the same as the output coil. You can use
either the decimal constant or the value in the data register as the counter setting value.

16-bit counter:

1. Setting range: 0–32,767. The setting values 0 and 1 mean the same thing in that the output contact is ON when the
counter counts for the first time.

2. For the general-purpose counter, the current value of the counter is cleared when power is lost. If the counter is
latching, the current value of the counter and the state of the contact before power was lost power are retained. The
latched counter counts from the current value when the power supply is restored.

3. If you use the MOV instruction or ISPSoft/DIADesigner to transmit a value larger than the counter setting value to the
current value register C0, the contact of the counter C0 is ON and the current value becomes the same as the counter
setting value the next time M1 switches from OFF to ON.

4. You can use either the constant or the value in the data register as the counter setting value.

5. The counter setting value can be positive or negative. If the counter counts up from 32,767, the next value is 0.

6. Use the counters here with CNT instruction. The example used here is a common one. Refer to API 1003 CNT
instruction for more advanced applications.

2-54
Ch a pt er 2 D e v ic es

_2

1. When M0=ON, the RST instruction is executed, the current value of C0 is reset to zero, and the output contact of
the counter C0 is FF.

2. When M1 changes from OFF to ON, the value of the counter increments by one.

3. When the value of the counter C0 reaches the counter setting value of 5, the contact of the counter C0 is ON (the
current value of C0 = the counter setting value = 5). After that the trigger from M1 is not accepted by C0 and the
current value of C0 stays at the value 5.

M0

M1

5
4 (SV)
C0 (PV) 3
2
1
0 0

M 3, C0

2.2.12 32-bit Counters (HC)


 Characteristics of the 32-bit counter

Item 32-bit counter


Type Up/down counter Up counter High-speed counter
Number HC0–HC63 HC64–HC199 HC200–HC255
Direction Counts up/down Counts up Counts up/down

2-55
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Item 32-bit counter


Setting value -2,147,483,648 to +2,147,483,647
Specification of the The counter setting value can be either the constant or the value occupying two data
counter setting value registers (32-bit).
Change of the current The counter keeps counting even after the value of the counter matches the counter
value setting value.
The contact is ON when the value of the addition counter matches the counter
_2 setting value.
Output contact
The contact is reset to OFF when the value of the subtraction counter matches the
counter setting value.
When the RST instruction is executed, the current value is cleared to zero, and the
Reset
contact is reset to OFF.
Action of the contact After the DCNT instruction scan is complete, the contact acts.

 32-bit general-purpose addition/subtraction counter

1. The difference between the 32-bit general-purpose addition counters and the 32-bit general-purpose subtraction
counters depends on the states of the special auxiliary relays SM621–SM684. For example, the counter HC0 is
an addition counter when SM621 is OFF, whereas HC0 is a subtraction counter when SM621 is ON.

2. You can use either the constant or the value in the data registers as the counter setting value, and this setting
value can be positive or negative. If you use the value in the data registers as the counter setting value, this
setting value occupies two consecutive registers.

3. For the general-purpose counter, the current value of the counter is cleared when power is lost. If the counter is
latching, the current value of the counter and the state of the contact before loss of power is retained. The latched
counter counts from the current value when power is restored.

4. If the counter counts up from 2,147,483,647, the next incremental value is -2,147,483,648. If the counter counts
down from -2,147,483,648, the next incremental value is 2,147,483,647.

5. Use the high-speed counters here with DCNT instruction. The example used here is a common one. Refer to
API 1004 DCNT instruction for more advanced applications.

2-56
Ch a pt er 2 D e v ic es

 32-bit high speed addition/subtraction counter

Refer to the instruction description of API1004 DCNT in DVP-ES3/EX3/SV3/SX3 Series Programming Manual for more
details.

Example:

_2

1. X10.0 drives SM621 to determine the counting direction (up/down) for HC0.

2. When X11.0 changes from OFF to ON, the RST instruction is executed and the PV in HC0 is cleared to 0 and its
contact is OFF.

3. When X12.0 changes from OFF to ON, PV for HC0 will count up (plus 1) or count down (minus 1).

4. When PV in HC0 changes from -6 to -5, the contact HC0 changes from OFF to ON. When PV in HC0 changes from
-5 to -6, the contact HC0 changes from ON to OFF.

2-57
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

A cc umu lativ ely Ac c umulat ively


M1 0 inc rea sing P rogres s ive ly inc reas ing
d ec reas ing

M11

M1 2
5
4 4
3 3
_2 HC0
1
2 2
1
( PV )
0 0 0
-1
-2
-3 -3
-4 -4
-5 -5
-6 -6
Whe n the outp ut con tac t wa s ON -7 -7
-8
M0 ,
HC0 Cont ac ts

2.2.13 Data Registers (D)


The data register stores 16-bit data. The highest bit represents either a positive sign or a negative sign, and the values
that the data registers can store range between -32,768 to +32,767.

Two 16-bit registers can be combined into a 32-bit register; for example, (D+1, D) in which the lower number register
represents the low 16 bits. The highest bit represents either a positive sign or a negative sign, and the values that the data
registers can store range between -2,147,483,648 to +2,147,483,647.

 Four 16-bit registers can be combined into a 64-bit register; for example, (D+3, D+2, D+1, D) in which the lower
number register represents the lower 16 bits. The highest bit represents either a positive sign or a negative sign,
and the values that the data registers can store range between -9,223,372,036,854,776 to
+9,223,372,036,854,775,807.

 You can also use the data registers to refresh the values in the control registers in the modules other than digital I/O
modules. Refer to the ISPSoft/DIADesigner User Manual for more information on refreshing the values in the control
registers.

Types of registers.

 General-purpose registers: When the PLC changes to RUN, or is disconnected, the value in the register is cleared
to zero. If you want to retain the data when the PLC changes to RUN, Refer to the ISPSoft/DIADesigner User
Manual for more information. Note that the value is still cleared to zero when the PLC is disconnected.

 Latched register: If the PLC is disconnected, the data in the latched register is not cleared. In other words, the value
before the disconnection is retained. If you want to clear the data in the latched area, you can use the RST or ZRST
instructions.

 Area to store special extension modules data: If the PLC is connected with a special extension module, the PLC
uses registers in the areas of D16000~D19999, D28000-D28079 and D29000~D29079 and the registers in the
areas correspond to CRs to update data. If you need to use these areas, you need to pay attention not to use the
same area repetitively.

See the special extension modules and corresponding data register areas in the following table.

2-58
Ch a pt er 2 D e v ic es

Special extension module Corresponding area Remark


Use SM228 to enable or disable
Right-side special the data exchange between the
D28000~D28079
extension module PLC CPU and the connected
extension module.
Use SM265 to enable or disable
Left-side special the data exchange between the
extension module
D29000~D29079
PLC CPU and the connected _2
extension module.
Left-side DNET/COPM
D16000~D19999
extension module

2.2.14 Special Data Registers (SR)


Every special data register has its own definition and specific function. System status and the error messages are stored
in the special data registers. You can also use special data registers to monitor the system statuses. The special data
registers and their functions are listed in the table below.
 For SR numbers marked “*”, refer to the additional remarks on special auxiliary relays/special data registers.
 The “R” in the attribute column indicates that the special data register can read the data; “R/W” in the attribute
column indicates that it can read and write the data.
 The “–” indicates that the status of the special data register does not make any change.
 The “#” indicates that the system is set according to the status of the PLC, and you can read the setting. Refer to the
related manual for more information.
 The “Y” in the latched column means it is latched, the “N” means it is non-latched; and “H” means it follows the
settings in HWCONFIG of ISPSoft or in Hardware Configuration of DIADesigner when the power is on. During
execution, you can edit programs in the PLC, but the settings in the software do not change.
ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR0 PLC operation/operand error V V 0 0 - N R 0


SR1
The address of the operation error (32-bit) V V 0 0 - N R 0
SR2
SR4 Grammar check error V V 0 0 - N R 0
SR5
The address of the grammar check error (32-bit) V V 0 0 - N R 0
SR6
*SR8 Step address at which the watchdog timer is ON
V V 0 - - N R 0
SR9 (32-bit)
*SR27 Alarm code for the built-in AD analog input X V 0 - - N R/W 0
Last output number when the high speed output
SR28 V V -1 -1 -1 N R -1
instruction is used repeatedly
The output point where the lastest error occurred
SR29 V V -1 -1 -1 N R -1
while executing CSFO instruction.
SR30 Record the number of the step at which frequency
was outputted repeatedly from the most recent high V V 0 0 - N R 0
SR31 speed output point
SR32 The last instruction address that exceeded the
V V -1 -1 - N R -1
SR33 allowed range
System saves data to the memory card. This function
*SR36 V V 0 - - N R/W 0
works with SM36
SR38 EtherCAT port alarm/ error code for ES300TEC CPU V X 0 - - N R/W 0

2-59
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR40 Number of error logs V V - - - Y R 0


_2 *SR41 Error log pointer V V - - - Y R 0
*SR42 Error log 1: CPU or remote number V V - - - Y R 0
*SR43 Error log 1: module ID V V - - - Y R 0
*SR44 Error log 1: error code V V - - - Y R 0
*SR45 Error log 1: year and the month V V - - - Y R 0
*SR46 Error log 1: day and the hour V V - - - Y R 0
*SR47 Error log 1: minute and the second V V - - - Y R 0
*SR48 Error log 2: CPU or remote number V V - - - Y R 0
*SR49 Error log 2: module ID V V - - - Y R 0
*SR50 Error log 2: error code V V - - - Y R 0
*SR51 Error log 2: year and the month V V - - - Y R 0
*SR52 Error log 2: day and the hour V V - - - Y R 0
*SR53 Error log 2: minute and the second V V - - - Y R 0
*SR54 Error log32: CPU or remote number V V - - - Y R 0
*SR55 Error log 3: module ID V V - - - Y R 0
*SR56 Error log 3: error code V V - - - Y R 0
*SR57 Error log 3: year and the month V V - - - Y R 0
*SR58 Error log 3: day and the hour V V - - - Y R 0
*SR59 Error log 3: minute and the second V V - - - Y R 0
*SR60 Error log 4: CPU or remote number V V - - - Y R 0
*SR61 Error log 4: module ID V V - - - Y R 0
*SR62 Error log 4: error code V V - - - Y R 0
*SR63 Error log 4: year and the month V V - - - Y R 0
*SR64 Error log 4: day and the hour V V - - - Y R 0
*SR65 Error log 4: minute and the second V V - - - Y R 0
*SR66 Error log 5: CPU or remote number V V - - - Y R 0
*SR67 Error log 5: module ID V V - - - Y R 0
*SR68 Error log 5: error code V V - - - Y R 0
*SR69 Error log 5: year and the month V V - - - Y R 0
*SR70 Error log 5: day and the hour V V - - - Y R 0
*SR71 Error log 5: minute and the second V V - - - Y R 0
*SR72 Error log 6: CPU or remote number V V - - - Y R 0
*SR73 Error log 6: module ID V V - - - Y R 0
*SR74 Error log 6: error code V V - - - Y R 0
*SR75 Error log 6: year and the month V V - - - Y R 0
*SR76 Error log 6: day and the hour V V - - - Y R 0
*SR77 Error log 6: minute and the second V V - - - Y R 0
*SR78 Error log 7: CPU or remote number V V - - - Y R 0
*SR79 Error log 7: module ID V V - - - Y R 0
*SR80 Error log 7: error code V V - - - Y R 0
*SR81 Error log 7: year and the month V V - - - Y R 0
*SR82 Error log 7: day and the hour V V - - - Y R 0
*SR83 Error log 7: minute and the second V V - - - Y R 0
*SR84 Error log 8: CPU or remote number V V - - - Y R 0
*SR85 Error log 8: module ID V V - - - Y R 0
*SR86 Error log 8: error code V V - - - Y R 0
*SR87 Error log 8: year and the month V V - - - Y R 0

2-60
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR88 Error log 8: day and the hour V V - - - Y R 0


*SR89 Error log 8: minute and the second V V - - - Y R 0
_2
*SR90 Error log 9: CPU or remote number V V - - - Y R 0
*SR91 Error log 9: module ID V V - - - Y R 0
*SR92 Error log 9: error code V V - - - Y R 0
*SR93 Error log 9: year and the month V V - - - Y R 0
*SR94 Error log 9: day and the hour V V - - - Y R 0
*SR95 Error log 9: minute and the second V V - - - Y R 0
*SR66 Error log 10: CPU or remote number V V - - - Y R 0
*SR97 Error log 10: module ID V V - - - Y R 0
*SR98 Error log 10: error code V V - - - Y R 0
*SR99 Error log 10: year and the month V V - - - Y R 0
*SR100 Error log 10: day and the hour V V - - - Y R 0
*SR101 Error log 10: minute and the second V V - - - Y R 0
*SR102 Error log 11: CPU or remote number V V - - - Y R 0
*SR103 Error log 11: module ID V V - - - Y R 0
*SR104 Error log 11: error code V V - - - Y R 0
*SR105 Error log 11: year and the month V V - - - Y R 0
*SR106 Error log 11: day and the hour V V - - - Y R 0
*SR107 Error log 11: minute and the second V V - - - Y R 0
*SR108 Error log 12: CPU or remote number V V - - - Y R 0
*SR109 Error log 12: module ID V V - - - Y R 0
*SR110 Error log 12: error code V V - - - Y R 0
*SR111 Error log 12: year and the month V V - - - Y R 0
*SR112 Error log 12: day and the hour V V - - - Y R 0
*SR113 Error log 12: minute and the second V V - - - Y R 0
*SR114 Error log 13: CPU or remote number V V - - - Y R 0
*SR115 Error log 13: module ID V V - - - Y R 0
*SR116 Error log 13: error code V V - - - Y R 0
*SR117 Error log 13: year and the month V V - - - Y R 0
*SR118 Error log 13: day and the hour V V - - - Y R 0
*SR119 Error log 13: minute and the second V V - - - Y R 0
*SR120 Error log 14: CPU or remote number V V - - - Y R 0
*SR121 Error log 14: module ID V V - - - Y R 0
*SR122 Error log 14: error code V V - - - Y R 0
*SR123 Error log 14: year and the month V V - - - Y R 0
*SR124 Error log 14: day and the hour V V - - - Y R 0
*SR125 Error log 14: minute and the second V V - - - Y R 0
*SR126 Error log 10: CPU or remote number V V - - - Y R 0
*SR127 Error log 15: module ID V V - - - Y R 0
*SR128 Error log 15: error code V V - - - Y R 0
*SR129 Error log 15: year and the month V V - - - Y R 0
*SR130 Error log 15: day and the hour V V - - - Y R 0
*SR131 Error log 15: minute and the second V V - - - Y R 0
*SR132 Error log 16: CPU or remote number V V - - - Y R 0
*SR133 Error log 16: module ID V V - - - Y R 0
*SR134 Error log 16: error code V V - - - Y R 0
*SR135 Error log 16: year and the month V V - - - Y R 0

2-61
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR136 Error log 16: day and the hour V V - - - Y R 0


_2 *SR137 Error log 16: minute and the second V V - - - Y R 0
*SR138 Error log 17: CPU or remote number V V - - - Y R 0
*SR139 Error log 17: module ID V V - - - Y R 0
*SR140 Error log 17: error code V V - - - Y R 0
*SR141 Error log 17: year and the month V V - - - Y R 0
SR142 Error log 17: day and the hour V V - - - Y R 0
*SR143 Error log 17: minute and the second V V - - - Y R 0
*SR144 Error log 18: CPU or remote number V V - - - Y R 0
*SR145 Error log 18: module ID V V - - - Y R 0
*SR146 Error log 18: error code V V - - - Y R 0
*SR147 Error log 18: year and the month V V - - - Y R 0
*SR148 Error log 18: day and the hour V V - - - Y R 0
*SR149 Error log 18: minute and the second V V - - - Y R 0
*SR150 Error log 19: CPU or remote number V V - - - Y R 0
*SR151 Error log 19: module ID V V - - - Y R 0
*SR152 Error log 19: error code V V - - - Y R 0
*SR153 Error log 19: year and the month V V - - - Y R 0
*SR154 Error log 19: day and the hour V V - - - Y R 0
*SR155 Error log 19: minute and the second V V - - - Y R 0
*SR156 Error log 20: CPU or remote number V V - - - Y R 0
*SR157 Error log 20: module ID V V - - - Y R 0
*SR158 Error log 20: error code V V - - - Y R 0
*SR159 Error log 20: year and the month V V - - - Y R 0
*SR160 Error log 20: day and the hour V V - - - Y R 0
*SR161 Error log 20: minute and the second V V - - - Y R 0
SR162 Length of time that the PLC is powered on (unit:
V V - - - Y R -
SR163 minutes) (32-bit)
*SR168 Input value of the built-in AD channel 1 V V 0 - - N R 0
*SR169 Input value of the built-in AD channel 2 V V 0 - - N R 0
*SR170 Input value of the built-in AD channel 3 X V 0 - - N R 0
*SR171 Input value of the built-in AD channel 4 X V 0 - - N R 0
*SR172 Output value of the built-in DA channel 1 V V 0 - - N R/W 0
*SR173 Output value of the built-in DA channel 2 V V 0 - - N R/W 0
SR180 The last warning error code V V 0 - - N R 0

SR190 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 1 (default: 1-time frequency)

SR191 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 2 (default: 1-time frequency)

SR192 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 3 (default: 1-time frequency)
Frequency multiplication of the high speed counter
SR193 V V 1 - - N R/W 1
group 4 (default: 1-time frequency)

SR194 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 5 (default: 1-time frequency)

SR195 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 6 (default: 1-time frequency)

2-62
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR196 Frequency multiplication of the high speed counter V V 1 - - N R/W 1 _2


group 7 (default: 1-time frequency)

SR197 Frequency multiplication of the high speed counter V V 1 - - N R/W 1


group 8 (default: 1-time frequency)
16#0F 16#0F 16#0F 16#0FD
SR198 N
DB DB DB B
Pi (π), floating-point number (32-bit) V V R
16#40 16#404 16#404 16#404
SR199 N
49 9 9 9
*SR201 COM1 communication address V V - - - H R/W 1
*SR202 COM2 communication address V V - - - H R/W 1
16#002
*SR209 COM1 communication protocol V V - - - H R/W
4
COM1 communication timeout (unit: millisecond)
*SR210 V V - - - H R/W 0
0: no timeout
16#002
*SR212 COM2 communication protocol V V - - - H R/W
4

*SR213 COM2 communication timeout (unit: millisecond) V V - - - H R/W 0


0: no timeout
SR217 COM1 baudrate value (unit:100 bps) V V 96 - - H R/W 96
SR218 COM2 baudrate value (unit:100 bps) V V 96 - - H R/W 96
*SR220 Real-time clock (RTC) year value: 00–99 (BCD ) V V - - - Y R 0
*SR221 Real-time clock (RTC) month value : 01–12 (BCD) V V - - - Y R 1
*SR222 Real-time clock (RTC) day value : 1–31 (BCD) V V - - - Y R 1
*SR223 Real-time clock (RTC) hour value: 00–23 (BCD) V V - - - Y R 0
*SR224 Real-time clock (RTC) minute value: 00–59 (BCD) V V - - - Y R 0
*SR225 Real-time clock (RTC) second value: 00–59 (BCD) V V - - - Y R 0
*SR226 Real-time clock (RTC) week value: 1–7 (BCD) V V - - - Y R 1
*SR227 Number of download logs (maximum is 20) V V - - - Y R 0
*SR228 Download log pointer V V - - - Y R 0
*SR229 Download log 1: action number V V - - - Y R 0
*SR230 Download log 1: year and the month V V - - - Y R 0
*SR231 Download log 1: day and the hour V V - - - Y R 0
*SR232 Download log 1: minute and the second V V - - - Y R 0
*SR233 Download log 2: action number V V - - - Y R 0
*SR234 Download log 2: year and the month V V - - - Y R 0
*SR235 Download log 2: day and the hour V V - - - Y R 0
*SR236 Download log 2: minute and the second V V - - - Y R 0
*SR237 Download log 3: action number V V - - - Y R 0
*SR238 Download log 3: year and the month V V - - - Y R 0
*SR239 Download log 3: day and the hour V V - - - Y R 0
*SR240 Download log 3: minute and the second V V - - - Y R 0
*SR241 Download log 4: action number V V - - - Y R 0
*SR242 Download log 4: year and the month V V - - - Y R 0
*SR243 Download log 4: day and the hour V V - - - Y R 0
*SR244 Download log 4: minute and the second V V - - - Y R 0
*SR245 Download log 5: action number V V - - - Y R 0
*SR246 Download log 5: year and the month V V - - - Y R 0
*SR247 Download log 5: day and the hour V V - - - Y R 0
*SR248 Download log 5: minute and the second V V - - - Y R 0

2-63
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR249 Download log 6: action number V V - - - Y R 0


_2 *SR250 Download log 6: year and the month V V - - - Y R 0
*SR251 Download log 6: day and the hour V V - - - Y R 0
*SR252 Download log 6: minute and the second V V - - - Y R 0
*SR253 Download log 7: action number V V - - - Y R 0
*SR254 Download log 7: year and the month V V - - - Y R 0
*SR255 Download log 7: day and the hour V V - - - Y R 0
*SR256 Download log 7: minute and the second V V - - - Y R 0
*SR257 Download log 8: action number V V - - - Y R 0
*SR258 Download log 8: year and the month V V - - - Y R 0
*SR259 Download log 8: day and the hour V V - - - Y R 0
*SR260 Download log 8: minute and the second V V - - - Y R 0
*SR261 Download log 9: action number V V - - - Y R 0
*SR262 Download log 9: year and the month V V - - - Y R 0
*SR263 Download log 9: day and the hour V V - - - Y R 0
*SR264 Download log 9: minute and the second V V - - - Y R 0
*SR265 Download log 10: action number V V - - - Y R 0
*SR266 Download log 10: year and the month V V - - - Y R 0
*SR267 Download log 10: day and the hour V V - - - Y R 0
*SR268 Download log 10: minute and the second V V - - - Y R 0
*SR269 Download log 11: action number V V - - - Y R 0
*SR270 Download log 11: year and the month V V - - - Y R 0
*SR271 Download log 11: day and the hour V V - - - Y R 0
*SR272 Download log 11: minute and the second V V - - - Y R 0
*SR273 Download log 12: action number V V - - - Y R 0
*SR274 Download log 12: year and the month V V - - - Y R 0
*SR275 Download log 12: day and the hour V V - - - Y R 0
*SR276 Download log 12: minute and the second V V - - - Y R 0
*SR277 Download log 13: action number V V - - - Y R 0
*SR278 Download log 13: year and the month V V - - - Y R 0
*SR279 Download log 13: day and the hour V V - - - Y R 0
*SR280 Download log 13: minute and the second V V - - - Y R 0
*SR281 Download log 14: action number V V - - - Y R 0
*SR282 Download log 14: year and the month V V - - - Y R 0
*SR283 Download log 14: day and the hour V V - - - Y R 0
*SR284 Download log 14: minute and the second V V - - - Y R 0
*SR285 Download log 15: action number V V - - - Y R 0
*SR286 Download log 15: year and the month V V - - - Y R 0
*SR287 Download log 15: day and the hour V V - - - Y R 0
*SR288 Download log 15: minute and the second V V - - - Y R 0
*SR289 Download log 16: action number V V - - - Y R 0
*SR290 Download log 16: year and the month V V - - - Y R 0
*SR291 Download log 16: day and the hour V V - - - Y R 0
*SR292 Download log 16: minute and the second V V - - - Y R 0
*SR293 Download log 17: action number V V - - - Y R 0
*SR294 Download log 17: year and the month V V - - - Y R 0
*SR295 Download log 17: day and the hour V V - - - Y R 0
*SR296 Download log 17: minute and the second V V - - - Y R 0

2-64
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR297 Download log 18: action number V V - - - Y R 0


*SR298 Download log 18: year and the month V V - - - Y R 0
_2
*SR299 Download log 18: day and the hour V V - - - Y R 0
*SR300 Download log 18: minute and the second V V - - - Y R 0
*SR301 Download log 19: action number V V - - - Y R 0
*SR302 Download log 19: year and the month V V - - - Y R 0
*SR303 Download log 19: day and the hour V V - - - Y R 0
*SR304 Download log 19: minute and the second V V - - - Y R 0
*SR305 Download log 20: action number V V - - - Y R 0
*SR306 Download log 20: year and the month V V - - - Y R 0
*SR307 Download log 20: day and the hour V V - - - Y R 0
*SR308 Download log 20: minute and the second V V - - - Y R 0
*SR309 Number of PLC status change logs (maximum is 20) V V - - - Y R 0
*SR310 PLC status change log pointer V V - - - Y R 0
*SR311 PLC status change log 1: action number V V - - - Y R 0
*SR312 PLC status change log 1: year and the month V V - - - Y R 0
*SR313 PLC status change log 1: day and the hour V V - - - Y R 0
*SR314 PLC status change log 1: minute and the second V V - - - Y R 0
*SR315 PLC status change log 2: action number V V - - - Y R 0
*SR316 PLC status change log 2: year and the month V V - - - Y R 0
*SR317 PLC status change log 2: day and the hour V V - - - Y R 0
*SR318 PLC status change log 2: minute and the second V V - - - Y R 0
*SR319 PLC status change log 3: action number V V - - - Y R 0
*SR320 PLC status change log 3: year and the month V V - - - Y R 0
*SR321 PLC status change log 3: day and the hour V V - - - Y R 0
*SR322 PLC status change log 3: minute and the second V V - - - Y R 0
*SR323 PLC status change log 4: action number V V - - - Y R 0
*SR324 PLC status change log 4: year and the month V V - - - Y R 0
*SR325 PLC status change log 4: day and the hour V V - - - Y R 0
*SR326 PLC status change log 4: minute and the second V V - - - Y R 0
*SR327 PLC status change log 5: action number V V - - - Y R 0
*SR328 PLC status change log 5: year and the month V V - - - Y R 0
*SR329 PLC status change log 5: day and the hour V V - - - Y R 0
*SR330 PLC status change log 5: minute and the second V V - - - Y R 0
*SR331 PLC status change log 6: action number V V - - - Y R 0
*SR332 PLC status change log 6: year and the month V V - - - Y R 0
*SR333 PLC status change log 6: day and the hour V V - - - Y R 0
*SR334 PLC status change log 6: minute and the second V V - - - Y R 0
*SR335 PLC status change log 7: action number V V - - - Y R 0
*SR336 PLC status change log 7: year and the month V V - - - Y R 0
*SR337 PLC status change log 7: day and the hour V V - - - Y R 0
*SR338 PLC status change log 7: minute and the second V V - - - Y R 0
*SR339 PLC status change log 8: action number V V - - - Y R 0
*SR340 PLC status change log 8: year and the month V V - - - Y R 0
*SR341 PLC status change log 8: day and the hour V V - - - Y R 0
*SR342 PLC status change log 8: minute and the second V V - - - Y R 0
*SR343 PLC status change log 9: action number V V - - - Y R 0
*SR344 PLC status change log 9: year and the month V V - - - Y R 0

2-65
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR345 PLC status change log 9: day and the hour V V - - - Y R 0


_2 *SR346 PLC status change log 9: minute and the second V V - - - Y R 0
*SR347 PLC status change log 10: action number V V - - - Y R 0
*SR348 PLC status change log 10: year and the month V V - - - Y R 0
*SR349 PLC status change log 10: day and the hour V V - - - Y R 0
*SR350 PLC status change log 10: minute and the second V V - - - Y R 0
*SR351 PLC status change log 11: action number V V - - - Y R 0
*SR352 PLC status change log 11: year and the month V V - - - Y R 0
*SR353 PLC status change log 11: day and the hour V V - - - Y R 0
*SR354 PLC status change log 11: minute and the second V V - - - Y R 0
*SR355 PLC status change log 12: action number V V - - - Y R 0
*SR356 PLC status change log 12: year and the month V V - - - Y R 0
*SR357 PLC status change log 12: day and the hour V V - - - Y R 0
*SR358 PLC status change log 12: minute and the second V V - - - Y R 0
*SR359 PLC status change log 13: action number V V - - - Y R 0
*SR360 PLC status change log 13: year and the month V V - - - Y R 0
*SR361 PLC status change log 13: day and the hour V V - - - Y R 0
*SR362 PLC status change log 13: minute and the second V V - - - Y R 0
*SR363 PLC status change log 14: action number V V - - - Y R 0
*SR364 PLC status change log 14: year and the month V V - - - Y R 0
*SR365 PLC status change log 14: day and the hour V V - - - Y R 0
*SR366 PLC status change log 14: minute and the second V V - - - Y R 0
*SR367 PLC status change log 15: action number V V - - - Y R 0
*SR368 PLC status change log 15: year and the month V V - - - Y R 0
*SR369 PLC status change log 15: day and the hour V V - - - Y R 0
*SR370 PLC status change log 15: minute and the second V V - - - Y R 0
*SR371 PLC status change log 16: action number V V - - - Y R 0
*SR372 PLC status change log 16: year and the month V V - - - Y R 0
*SR373 PLC status change log 16: day and the hour V V - - - Y R 0
*SR374 PLC status change log 16: minute and the second V V - - - Y R 0
*SR375 PLC status change log 17: action number V V - - - Y R 0
*SR376 PLC status change log 17: year and the month V V - - - Y R 0
*SR377 PLC status change log 17: day and the hour V V - - - Y R 0
*SR378 PLC status change log 17: minute and the second V V - - - Y R 0
*SR379 PLC status change log 18: action number V V - - - Y R 0
*SR380 PLC status change log 18: year and the month V V - - - Y R 0
*SR381 PLC status change log 18: day and the hour V V - - - Y R 0
*SR382 PLC status change log 18: minute and the second V V - - - Y R 0
*SR383 PLC status change log 19: action number V V - - - Y R 0
*SR384 PLC status change log 19: year and the month V V - - - Y R 0
*SR385 PLC status change log 19: day and the hour V V - - - Y R 0
*SR386 PLC status change log 19: minute and the second V V - - - Y R 0
*SR387 PLC status change log 20: action number V V - - - Y R 0
*SR388 PLC status change log 20: year and the month V V - - - Y R 0
*SR389 PLC status change log 20: day and the hour V V - - - Y R 0
*SR390 PLC status change log 20: minute and the second V V - - - Y R 0
*SR391 Real-time clock (RTC) year value: 00–99 (DEC) V V - - - Y R 0
*SR392 Real-time clock (RTC) month value: 01–12 (DEC) V V - - - Y R 1

2-66
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR393 Real-time clock (RTC) day value: 1–31 (DEC) V V - - - Y R 1


*SR394 Real-time clock (RTC) hour value: 00–23 (DEC) V V - - - Y R 0
_2
*SR395 Real-time clock (RTC) minute value: 00–59 (DEC) V V - - - Y R 0
*SR396 Real-time clock (RTC) second value: 00–59 (DEC) V V - - - Y R 0
*SR397 Real-time clock (RTC) week value: 1–7 (DEC) V V - - - Y R 1

SR405 PLC main processor firmware version V V - - - Y R -


(e.g. 10670 = V1.06.70)
PLC sub-processor firmware version (e.g. 0 = no
SR406 V V - - - Y R -
sub-processor)
When the PLC runs, the value in SR407 increases by
SR407 one every second. SR407 counts from 0 to 32767, V V 0 0 - N R/W 0
and then from -32768 to 0.
When the PLC runs, the value in SR408 increases by
SR408 one every scan cycle. SR408 counts from 0 to 32767, V V 0 0 - N R/W 0
and then from -32768 to 0.
Setting value of n, unit: second, range: 1–32767
*SR409 Available for ES3 CPU FW V1.08.00 or later and V V - - - N R/W 30
EX3/SX3/SV3 CPU FW V1.00.00 or later
Setting value of n, unit: millisecond, range: 1–32767
*SR410 Available for ES3 CPU FW V1.08.00 or later and V V - - - N R/W 30
EX3/SX3/SV3 CPU FW V1.00.00 or later
The current scan time is stored in SR411 and SR412
(unit of measurement is 100 microseconds).
Milliseconds are stored in SR411 (range is 0–65535).
SR411 Microseconds are stored in SR412 (the range is V V 0 - - N R 0
0–900).
For example, if SR411=12 and SR412=300, then the
current scan time is 12.3 milliseconds.
The current scan time is stored in SR411 and SR412
(unit of measurement is 100 microseconds).
Milliseconds are stored in SR411 (range is 0–65535).
SR412 Microseconds are stored in SR412 (the range is V V 0 - - N R 0
0–900).
For example, if SR411=12 and SR412=300, then the
current scan time is 12.3 milliseconds.
SR413 The maximum scan time is stored in SR413 and
SR414 (unit of measurement is 100 microseconds). V V 0 - - N R 0
SR414 Milliseconds are stored in SR413.

SR415 The minimum scan time is stored in SR415 and


SR416 (unit of measurement is 100 microseconds). V V 0 - - N R 0
SR416 Milliseconds are stored in SR415.

Duration of the timer interrupt I601 (unit: millisecond).


SR421 The default is 0, meaning the system uses the V V 0 0 - N R/W 0
settings in HWCONFIG.

Duration of the timer interrupt I602 (unit: millisecond).


SR422 The default is 0, meaning the system uses the V V 0 0 - N R/W 0
settings in HWCONFIG.

2-67
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Duration of the timer interrupt I603 (unit: millisecond).


_2 SR423 The default is 0, meaning the system uses the V V 0 0 - N R/W 0
settings in HWCONFIG.
Duration of the timer interrupt I604 (unit: 0.1
SR424 millisecond). The default is 0, meaning the system V V 0 0 - N R/W 0
uses the settings in HWCONFIG.

Setting up the determining time for the pulse input to


stop for DCSFOC instruction; the setting range is from
SR425 0 to 1100; unit: 1ms; 0 indicates this function is V V 0 0 - N R/W 0
disabled. (for all axes)
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/SV3 CPU FW V1.00.00 or later
SR440 - - - Y R -
MAC address
SR441 (Example: 12:34:56:78:9A:BC => SR440=16#1234, V V - - - Y R -
SR441=16#5678, SR442=16#9ABC)
SR442 (Updates once, when the PLC is supplied with power) - - - Y R -

SR443 PLC serial number - - - Y R -


SR444 (Updates once, when the PLC is supplied with power) - - - Y R -
SR445 EX:AS324MTAW15500012 - - - Y R -
SR446 - - - Y R -
AS SR443 = 16#5341
SR447 - - - Y R -
32  SR444 = 16#3233
SR448 - - - Y R -
4M  SR445 = 16#4D34 V V
SR449 TA  SR446 = 16#4154 - - - Y R -
W1  SR447 = 16#3157
SR450 55  SR448 = 16#3535 - - - Y R -
00  SR449 = 16#3030
SR451 01  SR450 = 16#3130 - - - Y R -
2  SR451 = 16#0032
If an error occurs during the operation of the memory
*SR453 V V - - - Y R 0
card, the error code is recorded.
SR460
Y0/axis 1 (Y0/Y1) position (unit: number of pulse) V V - - - Y R/W 0
SR461
SR462 Axis 1 (Y0/Y1) output mode V V - - - Y R/W 0
SR463 Axis 1 (Y0/Y1) starting/ending frequency V V - - - Y R/W 200
SR464 Axis 1 (Y0/Y1) accelerating time V V - - - Y R/W 200
SR465 Axis 1 (Y0/Y1) decelerating time V V - - - Y R/W 200
SR466 Axis 1 (Y0/Y1) JOG frequency V V - - - Y R/W 200
Axis 1 (Y0/Y1) number in the current position
SR467 V V 0 0 - N R 0
planning table
Axis 1 (Y0/Y1) numerator value transferred from the
SR468 V V - - - H R/W 0
machine unit
Axis 1 (Y0/Y1) denominator value transferred from
SR469 V V - - - H R/W 0
the machine unit
SR470 Axis 1 (Y0/Y1) position of the machine unit
V V - - - Y R 0
SR471 (single-precision floating-point values)
SR472
Axis 1 (Y0/Y1) target frequency for fixed slope V V - - - Y R 0
SR473

2-68
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR474
SR475
Y1 position (unit: number of pulse) V V - - - Y R/W 0 _2
SR476 Y1 starting/ending frequency V V - - - Y R/W 200
SR477 Y1 accelerating/decelerating time V V - - - Y R/W 200
SR478 Axis 1 (Y0) backlash compensation pulse V V - - - Y R/W 0
SR479 Y1 backlash compensation pulse V V - - - Y R/W 0
SR480
Y2/axis 2 (Y2/Y3) position (unit: number of pulse) V V - - - Y R/W 0
SR481
SR482 Y2/axis 2 (Y2/Y3) output mode V V - - - Y R/W 0
SR483 Y2/axis 2 (Y2/Y3) starting/ending frequency V V - - - Y R/W 200
SR484 Y2/axis 2 (Y2/Y3) accelerating time V V - - - Y R/W 200
SR485 Y2/axis 2 (Y2/Y3) decelerating time V V - - - Y R/W 200
SR486 Y2/axis 2 (Y2/Y3) JOG frequency V V - - - Y R/W 200
Y2/axis 2 (Y2/Y3) number in the current position
SR487 V V 0 0 - N R 0
planning table
Y2/axis 2 (Y2/Y3) numerator value transferred from
SR488 V V - - - H R/W 0
the machine unit
Y2/axis 2 (Y2/Y3) denominator value transferred from
SR489 V V - - - H R/W 0
the machine unit
SR490 Y2/axis 2 (Y2/Y3) position of the Machine unit
V V - - - Y R 0
SR491 (single-precision floating-point values)
SR492
Y2/axis 2 (Y2/Y3) target frequency for fixed slope V V - - - Y R 0
SR493
SR494
Y3 position (unit: number of pulse) V V - - - Y R/W 0
SR495
SR496 Y3 starting/ending frequency V V - - - Y R/W 200
SR497 Y3 accelerating/decelerating time V V - - - Y R/W 200
SR498 Axis 2 (Y2) backlash compensation pulse V V - - - Y R/W 0
SR499 Y3 backlash compensation pulse V V - - - Y R/W 0
SR500
Y4/axis 3 (Y4/Y5) position (unit: number of pulses) V V - - - Y R/W 0
SR501
SR502 Y4/axis 3 (Y4/Y5) output mode V V - - - Y R/W 0
SR503 Y4/axis 3 (Y4/Y5) starting/ending frequency V V - - - Y R/W 200
SR504 Y4/axis 3 (Y4/Y5) accelerating time V V - - - Y R/W 200
SR505 Y4/axis 3 (Y4/Y5) decelerating time V V - - - Y R/W 200
SR506 Y4/axis 3 (Y4/Y5) JOG frequency V V - - - Y R/W 200
Y4/axis 3 (Y4/Y5) number in the current position
SR507 V V 0 0 - N R 0
planning table
Y4/axis 3 (Y4/Y5) numerator value transferred from
SR508 V V - - - H R/W 0
the machine unit
Y4/axis 3 (Y4/Y5) denominator value transferred from
SR509 V V - - - H R/W 0
the machine unit
SR510 Y4/axis 3 (Y4/Y5) position of the Machine unit
V V - - - Y R 0
SR511 (single-precision floating-point values)
SR512
Y4/axis 3 (Y4/Y5) target frequency for fixed slope V V - - - Y R 0
SR513
SR514
Y5 position (unit: number of pulses) V V - - - Y R/W 0
SR515
SR516 Y5 starting/ending frequency V V - - - Y R/W 200

2-69
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR517 Y5 accelerating/decelerating time V V - - - Y R/W 200


_2 SR518 Axis 3 (Y4) backlash compensation pulse V V - - - Y R/W 0
SR519 Y5 backlash compensation pulse V V - - - Y R/W 0
SR520 V V
Y6/axis 4 (Y6/Y7) position (unit: number of pulses) - - - Y R/W 0
SR521 V V
SR522 Y6/axis 4 (Y6/Y7) output mode V V - - - Y R/W 0
SR523 Y6/axis 4 (Y6/Y7) starting/ending frequency V V - - - Y R/W 200
SR524 Y6/axis 4 (Y6/Y7) accelerating time V V - - - Y R/W 200
SR525 Y6/axis 4 (Y6/Y7) decelerating time V V - - - Y R/W 200
SR526 Y6/axis 4 (Y6/Y7) JOG frequency V V - - - Y R/W 200
Y6/axis 4 (Y6/Y7) number in the current position
SR527 V V 0 0 - N R 0
planning table
Y6/axis 4 (Y6/Y7) numerator value transferred from
SR528 V V - - - H R/W 0
the machine unit
Y6/axis 4 (Y6/Y7) denominator value transferred from
SR529 V V - - - H R/W 0
the machine unit
SR530 Y6/axis 4 (Y6/Y7) position of the Machine V V
- - - Y R 0
SR531 unit(single-precision floating-point values) V V
SR532 V V
Y6/axis 4 (Y6/Y7) target frequency for fixed slope - - - Y R 0
SR533 V V
SR534 V V
Y7 position (unit: number of pulses) - - - Y R/W 0
SR535 V V
SR536 Y7 starting/ending frequency V V - - - Y R/W 200
SR537 Y7 accelerating/decelerating time V V - - - Y R/W 200
SR538 Axis 4 (Y6) backlash compensation pulse V V - - - Y R/W 0
SR539 Y7 backlash compensation pulse V V - - - Y R/W 0
*SR580 Axis 1 (Y0/Y1) positive limit in the software (unit:
V V - - - H R/W 0
*SR581 number of pulses)

*SR582 Axis 1 (Y0/Y1) negative limit in the software (unit:


V V - - - H R/W 0
*SR583 number of pulses)

*SR584 Axis 2 (Y2/Y3) positive limit in the software (unit:


V V - - - H R/W 0
*SR585 number of pulses)

*SR586
Axis 2 (Y2/Y3) negative limit in the software (unit:
V V - - - H R/W 0
*SR587 number of pulses)

*SR588 Axis 3(Y4/Y5) positive limit in the software (unit:


V V - - - H R/W 0
*SR589 number of pulses)

*SR590
Axis 3(Y4/Y5) negative limit in the software (unit:
V V - - - H R/W 0
number of pulses)
*SR591

*SR592 Axis 4(Y6/Y7) positive limit in the software (unit:


V V - - - H R/W 0
*SR593 number of pulses)

2-70
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR594 Axis 4(Y6/Y7) negative limit in the software (unit:


V V - - - H R/W 0
_2
*SR595 number of pulses)

SR610
Axis 1 (Y0/Y1) current output speed (unit: Hz) V V 0 0 0 N R 0
SR611
SR612
axis 2 (Y2/Y3) current output speed (unit: Hz) V V 0 0 0 N R 0
SR613
SR614
Axis 3 (Y4/Y5) current output speed (unit: Hz) V V 0 0 0 N R 0
SR615
SR616
Axis 4 (Y6/Y7) current output speed (unit: Hz) V V 0 0 0 N R 0
SR617
External input interrupt condition: the X0–X15 input
SR623 V V FFFF FFFF - N R FFFF
points are falling-edge triggered
External input interrupt condition: the X0–X15 input
SR624 V V FFFF FFFF - N R FFFF
points are rising-edge triggered
Condition of the high-speed comparison interrupt
SR625 V V FFFF FFFF - N R FFFF
I200–I233
Condition of the high-speed comparison interrupt
SR626 V V FFFF FFFF - N R FFFF
I240–I253
Condition of the high-speed comparison interrupt
SR627 V V FFFF FFFF - N R FFFF
I260–I267
SR628 Condition of the communication interrupts I300–I307 V V FFFF FFFF - N R FFFF
SR629 Condition of the output interrupts I500–I505 V V FFFF FFFF - N R FFFF
SR630 Condition of the output interrupts I510–I519 V V FFFF FFFF - N R FFFF
SR632 Condition of the timer interrupts I601–I604 V V FFFF FFFF - N R FFFF
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR640 V V 0 - - N R/W 0
work with the Y0 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR641 V V 0 - - N R/W 0
work with the Y1 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR642 V V 0 - - N R/W 0
work with the Y2 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR643 V V 0 - - N R/W 0
work with the Y3 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR644 V V 0 - - N R/W 0
work with the Y4 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR645 V V 0 - - N R/W 0
work with the Y5 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR646 V V 0 - - N R/W 0
work with the Y6 output pulse
Set the outputting time 0-20ms sooner (unit: 1ms) to
SR647 V V 0 - - N R/W 0
work with the Y7 output pulse
*SR652 Pulse number in acceleration from the latest position V V 0 0 - N R 0
*SR653 output (32 bits) -
*SR654 Pulse number in deceleration from the latest position V V 0 0 - N R 0
*SR655 output (32 bits)
SR656 Delta drive SDO abort code for EtherCAT
V X 0 0 - N R/W 0
SR657 communication (32 bits)
The number of the Delta CAN communication axis
V V 0 - - N R 0
from the Delta drive which has a communication error
SR658 The number of the Delta EtherCAT communication
axis from the Delta drive which has a communication V X 0 - - N R 0
error

2-71
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

CAN communication error code from Delta drive V V 0 - - N R 0


SR659
_2 EtherCAT communication error code from Delta drive V X 0 - - N R 0
PR command of the Delta CAN communication axis 1
V V 0 - - N R 0
from Delta servo
SR661
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 1 from Delta drive
PR command of the Delta CAN communication axis 2
V V 0 - - N R 0
from Delta servo
SR662
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 2 from Delta drive
PR command of the Delta CAN communication axis 3
V V 0 - - N R 0
from Delta servo
SR663
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 3 from Delta drive
PR command of the Delta CAN communication axis 4
V V 0 - - N R 0
from Delta servo
SR664
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 4 from Delta drive
PR command of the Delta CAN communication axis 5
V V 0 - - N R 0
from Delta servo
SR665
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 5 from Delta drive
PR command of the Delta CAN communication axis 6
V V 0 - - N R 0
from Delta servo
SR666
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 6 from Delta drive
PR command of the Delta CAN communication axis 7
V V 0 - - N R 0
from Delta servo
SR667
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 7 from Delta drive
PR command of the Delta CAN communication axis 8
V V 0 - - N R 0
from Delta servo
SR668
Servo PR command or inverter status of Delta
V X 0 - - N R 0
EtherCAT communication axis 8 from Delta drive
Alarm code of Delta CAN communication axis 1 from
V V 0 - - N R 0
Delta servo
SR671
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 1 from Delta drive
Alarm code of Delta CAN communication axis 2 from
V V 0 - - N R 0
Delta servo
SR672
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 2 from Delta drive
Alarm code of Delta CAN communication axis 3 from
V V 0 - - N R 0
Delta servo
SR673
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 3 from Delta drive
Alarm code of Delta CAN communication axis 4 from
V V 0 - - N R 0
Delta servo
SR674
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 4 from Delta drive

Alarm code of Delta CAN communication axis 5 from


V V 0 - - N R 0
Delta servo
SR675
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 5 from Delta drive

2-72
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Alarm code of Delta CAN communication axis 6 from


Delta servo
V V 0 - - N R 0 _2
SR676
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 6 from Delta drive
Alarm code of Delta CAN communication axis 7 from
V V 0 - - N R 0
Delta servo
SR677
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 7 from Delta drive
Alarm code of Delta CAN communication axis 8 from
V V 0 - - N R 0
Delta servo
SR678
Servo alarm code of Delta EtherCAT communication
V X 0 - - N R 0
axis 8 from Delta drive
DO state of Delta CAN communication axis 1 from
V V 0 - - N R 0
Delta servo
SR681
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 1 from Delta drive
DO state of Delta CAN communication axis 2 from
V V 0 - - N R 0
Delta servo
SR682
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 2 from Delta drive
DO state of Delta CAN communication axis 3 from
V V 0 - - N R 0
Delta servo
SR683
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 3 from Delta drive
DO state of Delta CAN communication axis 4 from
V V 0 - - N R 0
Delta servo
SR684
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 4 from Delta drive
DO state of Delta CAN communication axis 5 from
V V 0 - - N R 0
Delta servo
SR685
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 5 from Delta drive
DO state of Delta CAN communication axis 6 from
V V 0 - - N R 0
Delta servo
SR686
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 6 from Delta drive
DO state of Delta CAN communication axis 7 from
V V 0 - - N R 0
Delta servo
SR687
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 7 from Delta drive
DO state of Delta CAN communication axis 8 from
V V 0 - - N R 0
Delta servo
SR688
Servo DO state of Delta EtherCAT communication
V X 0 - - N R 0
axis 8 from Delta drive
SR691 Current position of Delta CAN communication axis 1
V V 0 - - N R 0
SR692 from Delta servo (32-bit)

SR691 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR692 communication axis 1 from Delta drive (32-bit)

SR693 Current position of Delta CAN communication axis 2


V V 0 - - N R 0
SR694 from Delta servo (32-bit)

SR693 Current servo position of Delta EtherCAT V X 0 - - N R 0

2-73
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR694 communication axis 2 from Delta drive (32-bit)


_2
SR695 Current position of Delta CAN communication axis 3
V V 0 - - N R 0
SR696 from Delta servo (32-bit)

SR695 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR696 communication axis 3 from Delta drive (32-bit)

SR697 Current position of Delta CAN communication axis 4


V V 0 - - N R 0
SR698 from Delta servo (32-bit)

SR697 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR698 communication axis 4 from Delta drive (32-bit)

SR699 Current position of Delta CAN communication axis 5


V V 0 - - N R 0
SR700 from Delta servo (32-bit)

SR699 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR700 communication axis 5 from Delta drive (32-bit)

SR701 Current position of Delta CAN communication axis 6


V V 0 - - N R 0
SR702 from Delta servo (32-bit)

SR701 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR702 communication axis 6 from Delta drive (32-bit)

SR703 Current position of Delta CAN communication axis 7


V V 0 - - N R 0
SR704 from Delta servo (32-bit)

SR703 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR704 communication axis 7 from Delta drive (32-bit)

SR705 Current position of Delta CAN communication axis 8


V V 0 - - N R 0
SR706 from Delta servo (32-bit)

SR705 Current servo position of Delta EtherCAT


V X 0 - - N R 0
SR706 communication axis 8 from Delta drive (32-bit)

SR711 Target position of Delta CAN communication axis 1


V V 0 - - N R 0
SR712 from Delta servo (32-bit)

SR711 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR712 communication axis 1 from Delta drive (32-bit)

SR713 Target position of Delta CAN communication axis 2


V V 0 - - N R 0
SR714 from Delta servo (32-bit)

SR713 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR714 communication axis 2 from Delta drive (32-bit)

SR715 Target position of Delta CAN communication axis 3 V V 0 - - N R 0

2-74
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR716 from Delta servo (32-bit)


_2
SR715 Servo target position of Delta EtherCAT
V X 0 - - N R 0
SR716 communication axis 3 from Delta drive (32-bit)

SR717 Target position of Delta CAN communication axis 4


V V 0 - - N R 0
SR718 from Delta servo (32-bit)

SR717 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR718 communication axis 4 from Delta drive (32-bit)

SR719 Target position of Delta CAN communication axis 5


V V 0 - - N R 0
SR720 from Delta servo (32-bit)

SR719 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR720 communication axis 5 from Delta drive (32-bit)

SR721 Target position of Delta CAN communication axis 6


V V 0 - - N R 0
SR722 from Delta servo (32-bit)

SR721 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR722 communication axis 6 from Delta drive (32-bit)

SR723 Target position of Delta CAN communication axis 7


V V 0 - - N R 0
SR724 from Delta servo (32-bit)

SR723 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR724 communication axis 7 from Delta drive (32-bit)

SR725 Target position of Delta CAN communication axis 8


V V 0 - - N R 0
SR726 from Delta servo (32-bit)

SR725 Servo target position of Delta EtherCAT


V X 0 - - N R 0
SR726 communication axis 8 from Delta drive (32-bit)

Current DI state of Delta CAN communication ID 1


V V 0 - - N R 0
from Delta servo
SR731
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 1 from Delta drive
Current DI state of Delta CAN communication ID 2
V V 0 - - N R 0
from Delta servo

SR732
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 2 from Delta drive

Current DI state of Delta CAN communication ID 3


V V 0 - - N R 0
from Delta servo
SR733
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 3 from Delta drive

2-75
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Current DI state of Delta CAN communication ID 4


_2 from Delta servo
V V 0 - - N R 0
SR734
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 4 from Delta drive
Current DI state of Delta CAN communication ID 5
V V 0 - - N R 0
from Delta servo
SR735
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 5 from Delta drive
Current DI state of Delta CAN communication ID 6
V V 0 - - N R 0
from Delta servo
SR736
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 6 from Delta drive
Current DI state of Delta CAN communication ID 7
V V 0 - - N R 0
from Delta servo
SR737
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 7 from Delta drive
Current DI state of Delta CAN communication ID 8
V V 0 - - N R 0
from Delta servo
SR738
Current servo DI state of Delta EtherCAT
V X 0 - - N R 0
communication ID 8 from Delta drive
Current torque of Delta CAN communication ID 1
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR741
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 1 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 2
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR742
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 2 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 3
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR743
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 3 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 4
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR744
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 4 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 5
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR745
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 5 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 6
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR746
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 6 from Delta drive (unit: 0.1%)

2-76
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Current torque of Delta CAN communication ID 7


V V 0 - - N R 0 _2
from Delta servo (unit: 0.1%)
SR747
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 7 from Delta drive (unit: 0.1%)
Current torque of Delta CAN communication ID 8
V V 0 - - N R 0
from Delta servo (unit: 0.1%)
SR748
Current servo torque of Delta EtherCAT
V X 0 - - N R 0
communication ID 8 from Delta drive (unit: 0.1%)
Current state of Delta CAN communication slave ID
SR751 V V 0 - - N R 0
21 from the Delta inverter
Current state of Delta CAN communication slave ID
SR752 V V 0 - - N R 0
22 from the Delta inverter
Current state of Delta CAN communication slave ID
SR753 V V 0 - - N R 0
23 from the Delta inverter
Current state of Delta CAN communication slave ID
SR754 V V 0 - - N R 0
24 from the Delta inverter
Current state of Delta CAN communication slave ID
SR755 V V 0 - - N R 0
25 from the Delta inverter
Current state of Delta CAN communication slave ID
SR756 V V 0 - - N R 0
26 from the Delta inverter
Current state of Delta CAN communication slave ID
SR757 V V 0 - - N R 0
27 from the Delta inverter
Current state of Delta CAN communication slave ID
SR758 V V 0 - - N R 0
28 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR761 V V 0 - - N R 0
21 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR762 V V 0 - - N R 0
22 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR763 V V 0 - - N R 0
23 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR764 V V 0 - - N R 0
24 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR765 V V 0 - - N R 0
25 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR766 V V 0 - - N R 0
26 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR767 V V 0 - - N R 0
27 from the Delta inverter
Current RPM of Delta CAN communication slave ID
SR768 V V 0 - - N R 0
28 from the Delta inverter
Current torque of Delta CAN communication ID 21
SR771 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current torque of Delta CAN communication ID 22
SR772 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)

2-77
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Current torque of Delta CAN communication ID 23


_2 SR773
from the Delta inverter (unit: 0.1%)
V V 0 - - N R 0

Current torque of Delta CAN communication ID 24


SR774 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current torque of Delta CAN communication ID 25
SR775 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current torque of Delta CAN communication ID 26
SR776 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current torque of Delta CAN communication ID 27
SR777 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current torque of Delta CAN communication ID 28
SR778 V V 0 - - N R 0
from the Delta inverter (unit: 0.1%)
Current DI state of Delta CAN communication ID 21
SR781 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 22
SR782 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 23
SR783 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 24
SR784 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 25
SR785 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 26
SR786 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 27
SR787 V V 0 - - N R 0
from the Delta inverter
Current DI state of Delta CAN communication ID 28
SR788 V V 0 - - N R 0
from the Delta inverter
SR791 Read the self-defined value from Delta servo CAN
V V 0 - - N R 0
SR792 communication axis 1 (32 bits)

SR791 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR792 EtherCAT communication axis 1 (32 bits)

SR793 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR794 communication axis 2 (lower 16 bits)

SR793 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR794 EtherCAT communication axis 2 (32 bits)

SR795 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR796 communication axis 3 (lower 16 bits)

SR795 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR796 EtherCAT communication axis 3 (32 bits)

2-78
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR797 Read the self-defined value from Delta CAN


V V 0 - - N R 0
_2
SR798 communication axis 4 (lower 16 bits)

SR797 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR798 EtherCAT communication axis 4 (32 bits)

SR799 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR800 communication axis 5 (lower 16 bits)

SR799 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR800 EtherCAT communication axis 5 (32 bits)

SR801 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR802 communication axis 6 (lower 16 bits)

SR801 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR802 EtherCAT communication axis 6 (32 bits)

SR803 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR804 communication axis 7 (lower 16 bits)

SR803 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR804 EtherCAT communication axis 7 (32 bits)

SR805 Read the self-defined value from Delta CAN


V V 0 - - N R 0
SR806 communication axis 8 (lower 16 bits)

SR805 Read the self-defined value for servo from Delta drive
V X 0 - - N R 0
SR806 EtherCAT communication axis 8 (32 bits)

The setting value for Delta CAN communication axis


1 to complete positioning.
(If the setting value is 0, it indicates the current
position should be the same as the target position to V V 0 - - N RW 0
complete the positioning. If the setting value is 5, it
SR811
indicates the distance between the current position
and the target position can be +5 to -5 to complete
the positioning.)
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 1 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
2 to complete positioning.
SR812
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 2 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
3 to complete positioning.
SR813
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 3 to complete servo positioning.

2-79
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

The setting value for Delta CAN communication axis


_2 4 to complete positioning.
V V 0 - - N RW 0
SR814
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 4 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
5 to complete positioning.
SR815
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 5 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
6 to complete positioning.
SR816
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 6 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
7 to complete positioning.
SR817
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 7 to complete servo positioning.
The setting value for Delta CAN communication axis
V V 0 - - N RW 0
8 to complete positioning.
SR818
The setting value for Delta drive EtherCAT
V X 0 - - N RW 0
communication axis 8 to complete servo positioning.
Code for the state of the master/slave in CANopen
SR820 V V - - - Y R 0
DS301 communication
SR821 CANopen DS301 version code V V - - - Y R -
SR822 CAN communication baudrate (unit: 1kbps) V V - - - H R 125
The number of hardware receiving error during CAN
*SR823 V V 0 - - N R 0
communication (Max. 255)
The number of hardware sending error during CAN
*SR824 V V 0 - - N R 0
communication (Max. 255)
Code for the master state in CANopen DS301
SR825 V V -1 - - N R -1
communication
State of slave ID 1–16 in CANopen DS301
SR826 V V -1 - - N R -1
communication
State of slave ID 17–32 in CANopen DS301
SR827 V V -1 - - N R -1
communication
State of slave ID 33–48 in CANopen DS301
SR828 V V -1 - - N R -1
communication
State of slave ID 49–64 in CANopen DS301
SR829 V V -1 - - N R -1
communication
State of slave ID 1 in CANopen DS301
SR830 V V -1 - - N R -1
communication
State of slave ID 2 in CANopen DS301
SR831 V V -1 - - N R -1
communication
State of slave ID 3 in CANopen DS301
SR832 V V -1 - - N R -1
communication

2-80
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR833
State of slave ID 4 in CANopen DS301
V V -1 - - N R -1 _2
communication
State of slave ID 5 in CANopen DS301
SR834 V V -1 - - N R -1
communication
State of slave ID 6 in CANopen DS301
SR835 V V -1 - - N R -1
communication
State of slave ID 7 in CANopen DS301
SR836 V V -1 - - N R -1
communication
State of slave ID 8 in CANopen DS301
SR837 V V -1 - - N R -1
communication
State of slave ID 9 in CANopen DS301
SR838 V V -1 - - N R -1
communication
State of slave ID 10 in CANopen DS301
SR839 V V -1 - - N R -1
communication
State of slave ID 11 in CANopen DS301
SR840 V V -1 - - N R -1
communication
State of slave ID 12 in CANopen DS301
SR841 V V -1 - - N R -1
communication
State of slave ID 13 in CANopen DS301
SR842 V V -1 - - N R -1
communication
State of slave ID 14 in CANopen DS301
SR843 V V -1 - - N R -1
communication
State of slave ID 15 in CANopen DS301
SR844 V V -1 - - N R -1
communication
State of slave ID 16 in CANopen DS301
SR845 V V -1 - - N R -1
communication
State of slave ID 17 in CANopen DS301
SR846 V V -1 - - N R -1
communication
State of slave ID 18 in CANopen DS301
SR847 V V -1 - - N R -1
communication
State of slave ID 19 in CANopen DS301
SR848 V V -1 - - N R -1
communication
State of slave ID 20 in CANopen DS301
SR849 V V -1 - - N R -1
communication
State of slave ID 21 in CANopen DS301
SR850 V V -1 - - N R -1
communication
State of slave ID 22 in CANopen DS301
SR851 V V -1 - - N R -1
communication
State of slave ID 23 in CANopen DS301
SR852 V V -1 - - N R -1
communication
State of slave ID 24 in CANopen DS301
SR853 V V -1 - - N R -1
communication
State of slave ID 25 in CANopen DS301
SR854 V V -1 - - N R -1
communication

2-81
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

State of slave ID 26 in CANopen DS301


_2 SR855
communication
V V -1 - - N R -1

State of slave ID 27 in CANopen DS301


SR856 V V -1 - - N R -1
communication
State of slave ID 28 in CANopen DS301
SR857 V V -1 - - N R -1
communication
State of slave ID 29 in CANopen DS301
SR858 V V -1 - - N R -1
communication
State of slave ID 30 in CANopen DS301
SR859 V V -1 - - N R -1
communication
State of slave ID 31 in CANopen DS301
SR860 V V -1 - - N R -1
communication
State of slave ID 32 in CANopen DS301
SR861 V V -1 - - N R -1
communication
State of slave ID 33 in CANopen DS301
SR862 V V -1 - - N R -1
communication
State of slave ID 34 in CANopen DS301
SR863 V V -1 - - N R -1
communication
State of slave ID 35 in CANopen DS301
SR864 V V -1 - - N R -1
communication
State of slave ID 36in CANopen DS301
SR865 V V -1 - - N R -1
communication
State of slave ID 37 in CANopen DS301
SR866 V V -1 - - N R -1
communication
State of slave ID 38 in CANopen DS301
SR867 V V -1 - - N R -1
communication
State of slave ID 39 in CANopen DS301
SR868 V V -1 - - N R -1
communication
State of slave ID 40 in CANopen DS301
SR869 V V -1 - - N R -1
communication
State of slave ID 41 in CANopen DS301
SR870 V V -1 - - N R -1
communication
State of slave ID 42 in CANopen DS301
SR871 V V -1 - - N R -1
communication
State of slave ID 43 in CANopen DS301
SR872 V V -1 - - N R -1
communication
State of slave ID 44 in CANopen DS301
SR873 V V -1 - - N R -1
communication
State of slave ID 45 in CANopen DS301
SR874 V V -1 - - N R -1
communication

State of slave ID 46 in CANopen DS301


SR875 V V -1 - - N R -1
communication

State of slave ID 47 in CANopen DS301


SR876 V V -1 - - N R -1
communication

2-82
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR877
State of slave ID 48 in CANopen DS301
V V -1 - - N R -1 _2
communication
State of slave ID 49 in CANopen DS301
SR878 V V -1 - - N R -1
communication
State of slave ID 50 in CANopen DS301
SR879 V V -1 - - N R -1
communication
State of slave ID 51 in CANopen DS301
SR880 V V -1 - - N R -1
communication
State of slave ID 52 in CANopen DS301
SR881 V V -1 - - N R -1
communication
State of slave ID 53 in CANopen DS301
SR882 V V -1 - - N R -1
communication
State of slave ID 54 in CANopen DS301
SR883 V V -1 - - N R -1
communication
State of slave ID 55 in CANopen DS301
SR884 V V -1 - - N R -1
communication
State of slave ID 56 in CANopen DS301
SR885 V V -1 - - N R -1
communication
State of slave ID 57 in CANopen DS301
SR886 V V -1 - - N R -1
communication
State of slave ID 58 in CANopen DS301
SR887 V V -1 - - N R -1
communication
State of slave ID 59 in CANopen DS301
SR888 V V -1 - - N R -1
communication
State of slave ID 60 in CANopen DS301 -1 -1
SR889 V V - - N R
communication
State of slave ID 61 in CANopen DS301 -1 -1
SR890 V V - - N R
communication
State of slave ID 62 in CANopen DS301 -1 -1
SR891 V V - - N R
communication
State of slave ID 63 in CANopen DS301 -1 -1
SR892 V V - - N R
communication
State of slave ID 64 in CANopen DS301 -1 -1
SR893 V V - - N R
communication
SR900
Number of samples in the data logger (32-bit) V V 0 - - N R 0
SR901
Code for the executions of data logger and the
SR902 V V 0 - - N R/W 0
memory card (works with SM456).
*SR1000
Ethernet IP address (32-bit) V V - - - H R/W 0
*SR1001
*SR1002
Ethernet netmask address (32-bit) V V - - - H R/W 0
*SR1003
*SR1004
Ethernet gateway address (32-bit) V V - - - H R/W 0
*SR1005
*SR1006 Duration of the TCP connection (sec.) V V - - - H R/W 30

2-83
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR1007 Ethernet transmission speed V V 0 - - N R 0


_2 *SR1009 Number of TCP connections V V 0 - - N R 0
Specific time when to resend through the TCP
*SR1010 V V - - - N R/W 20
connection (ms)
*SR1011 Connection number of the MODBUS/TCP Server V V 0 - - N R 0
*SR1012 Connection number of the MODBUS/TCP Client V V 0 - - N R 0
*SR1013 Connection number of the EtherNet/IP Adapter V V 0 - - N R 0
*SR1014 Connection number of the EtherNet/IP Scanner V V 0 - - N R 0
*SR1015 MODBUS/TCP Server packet receiving timeout (ms) V V 10 - - N R/W 10
The delay time for the data to be sent after the
*SR1016 connection of Modbus/TCP Client is established. V V 0 - - N R/W 0
(ms) (0-1000)
The maximum number of Ethernet packets that can
*SR1017 V V - - - Y R/W 80
be handled in one scan cycle.
The number of Ethernet packets that is handled in the
*SR1018 V V 0 - - N R 0
last scan cycle.
The accumulated number of Ethernet packets which
*SR1019 are dropped after the packets in the buffer zone is V V 0 - - N R/W 0
full.
*SR1020 State of the EtherNet/IP connection 1 V V 0 - - N R 0
*SR1021 State of the EtherNet/IP connection 2 V V 0 - - N R 0
*SR1022 State of the EtherNet/IP connection 3 V V 0 - - N R 0
*SR1023 State of the EtherNet/IP connection 4 V V 0 - - N R 0
*SR1024 State of the EtherNet/IP connection 5 V V 0 - - N R 0
*SR1025 State of the EtherNet/IP connection 6 V V 0 - - N R 0
*SR1026 State of the EtherNet/IP connection 7 V V 0 - - N R 0
*SR1027 State of the EtherNet/IP connection 8 V V 0 - - N R 0
*SR1028 State of the EtherNet/IP connection 9 V V 0 - - N R 0
*SR1029 State of the EtherNet/IP connection 10 V V 0 - - N R 0
*SR1030 State of the EtherNet/IP connection 11 V V 0 - - N R 0
*SR1031 State of the EtherNet/IP connection 12 V V 0 - - N R 0
*SR1032 State of the EtherNet/IP connection 13 V V 0 - - N R 0
*SR1033 State of the EtherNet/IP connection 14 V V 0 - - N R 0
*SR1034 State of the EtherNet/IP connection 15 V V 0 - - N R 0
*SR1035 State of the EtherNet/IP connection 16 V V 0 - - N R 0

Refresh time for the EtherNet/IP connection 1 (Unit:


SR1052 V V 0 - - N R 0
ms)

Refresh time for the EtherNet/IP connection 2 (Unit:


SR1053 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 3 (Unit:
SR1054 V V 0 - - N R 0
ms)

2-84
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR1055
Refresh time for the EtherNet/IP connection 4 (Unit:
V V 0 - - N R 0 _2
ms)
SR1056 ```` V V 0 - - N R 0
Refresh time for the EtherNet/IP connection 6 (Unit:
SR1057 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 7 (Unit:
SR1058 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 8 (Unit:
SR1059 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 9 (Unit:
SR1060 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 10 (Unit:
SR1061 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 11 (Unit:
SR1062 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 12 (Unit:
SR1063 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 13 (Unit:
SR1064 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 14 (Unit:
SR1065 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 15 (Unit:
SR1066 V V 0 - - N R 0
ms)
Refresh time for the EtherNet/IP connection 16 (Unit:
SR1067 V V 0 - - N R 0
ms)
Communication port No. of Modbus TCP slave (The
SR1092 PLC works as Slave.) V V 502 - - N R/W 502
Available for ES3 CPU FW V1.04.30 or later
Communication port No. for the Modbus TCP data
SR1093 exchange table (The PLC works as Master.) V V 502 - - N R/W 502
Available for ES3 CPU FW V1.04.30 or later
SR1100 Value of the input packet counter (higher 16 bits)
V V 0 - - N R 0
SR1101 Value of the input packet counter (lower 16 bits)
SR1102 Value of the input octet counter (higher 16 bits)
V V 0 - - N R 0
SR1103 Value of the input octet counter (lower 16 bits)
SR1104 Value of the output packet counter (higher 16 bits)
V V 0 - - N R 0
SR1105 Value of the output packet counter (lower 16 bits)
SR1106 Value of the output octet counter (higher 16 bits)
V V 0 - - N R 0
SR1107 Value of the output octet counter (lower 16 bits)
Code for modifying the NTP parameter.
NTP server should be enabled and this should be
SR1110 used with the changing code 16#1234 to modify the V V 0 0 - N R/W 0
parameter. After that the sysem clears this code off
automatically.

2-85
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR1111 Upper byte of the NTP server IP address V V 0 0 - N R/W 0


_2 SR1112 Lower byte of the NTP server IP address V V 0 0 - N R/W 0
Refreshing cycle time for NTP server (unit: min);
SR1113 when the value exceeds the allowable range, use the V V 0 0 - N R/W 0
maximum/minimum value instead.
SR1114 NTP time zone (Unit: hour) V V 0 0 - N R/W 0
SR1116 Email counter V V 0 - - N R 0
SR1117 Email error counter V V 0 - - N R 0
Actual connection time for data exchange through the
*SR1120 V V 0 - - N R 0
Ethernet connection 1 (Unit: ms)
Actual connection time for data exchange through the
*SR1121 V V 0 - - N R 0
Ethernet connection 2 (Unit: ms)
Actual connection time for data exchange through the
*SR1122 V V 0 - - N R 0
Ethernet connection 3 (Unit: ms)
Actual connection time for data exchange through the
*SR1123 V V 0 - - N R 0
Ethernet connection 4 (Unit: ms)
Actual connection time for data exchange through the
*SR1124 V V 0 - - N R 0
Ethernet connection 5 (Unit: ms)
Actual connection time for data exchange through the
*SR1125 V V 0 - - N R 0
Ethernet connection 6 (Unit: ms)
Actual connection time for data exchange through the
*SR1126 V V 0 - - N R 0
Ethernet connection 7 (Unit: ms)
Actual connection time for data exchange through the
*SR1127 V V 0 - - N R 0
Ethernet connection 8 (Unit: ms)
Actual connection time for data exchange through the
*SR1128 V V 0 - - N R 0
Ethernet connection 9 (Unit: ms)
Actual connection time for data exchange through the
*SR1129 V V 0 - - N R 0
Ethernet connection 10 (Unit: ms)
Actual connection time for data exchange through the
*SR1130 V V 0 - - N R 0
Ethernet connection 11 (Unit: ms)
Actual connection time for data exchange through the
*SR1131 V V 0 - - N R 0
Ethernet connection 12 (Unit: ms)
Actual connection time for data exchange through the
*SR1132 V V 0 - - N R 0
Ethernet connection 13 (Unit: ms)
Actual connection time for data exchange through the
*SR1133 V V 0 - - N R 0
Ethernet connection 14 (Unit: ms)
Actual connection time for data exchange through the
*SR1134 V V 0 - - N R 0
Ethernet connection 15 (Unit: ms)
Actual connection time for data exchange through the
*SR1135 V V 0 - - N R 0
Ethernet connection 16 (Unit: ms)
The error code for data exchange through the
*SR1152 V V 0 - - N R 0
Ethernet connection 1
The error code for data exchange through the
*SR1153 V V 0 - - N R 0
Ethernet connection 2

2-86
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR1154
The error code for data exchange through the
V V 0 - - N R 0 _2
Ethernet connection 3
The error code for data exchange through the
*SR1155 V V 0 - - N R 0
Ethernet connection 4
The error code for data exchange through the
*SR1156 V V 0 - - N R 0
Ethernet connection 5
The error code for data exchange through the
*SR1157 V V 0 - - N R 0
Ethernet connection 6
The error code for data exchange through the
*SR1158 V V 0 - - N R 0
Ethernet connection 7
The error code for data exchange through the
*SR1159 V V 0 - - N R 0
Ethernet connection 8
The error code for data exchange through the
*SR1160 V V 0 - - N R 0
Ethernet connection 9
The error code for data exchange through the
*SR1161 V V 0 - - N R 0
Ethernet connection 10
The error code for data exchange through the
*SR1162 V V 0 - - N R 0
Ethernet connection 11
The error code for data exchange through the
*SR1163 V V 0 - - N R 0
Ethernet connection 12
The error code for data exchange through the
*SR1164 V V 0 - - N R 0
Ethernet connection 13
The error code for data exchange through the
*SR1165 V V 0 - - N R 0
Ethernet connection 14
The error code for data exchange through the
*SR1166 V V 0 - - N R 0
Ethernet connection 15
The error code for data exchange through the
*SR1167 V V 0 - - N R 0
Ethernet connection 16
Specify the number of the position planning table for
axis 1 to switch to during the execution of TPO
SR1291 instruction. This SR device works with SM591. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
Specify the number of the position planning table for
axis 2 to switch to during the execution of TPO
SR1292 instruction. This SR device works with SM592. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
Specify the number of the position planning table for
axis 3 to switch to during the execution of TPO
SR1293 instruction. This SR device works with SM593. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later

2-87
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Specify the number of the position planning table for


_2 axis 4 to switch to during the execution of TPO
SR1294 instruction. This SR device works with SM594. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
Specify the number of of the position planning table
to switch to after the interrupt at the X input is
executed during the execution of TPO instruction;
SR1297 this SR device works with SM588. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
Set the value in SR1298 (low word) to keep a certain
number of segments of output unaffected by the
interrupts at X inputs during the execution of TPO
SR1298 instruction. This SR device works with SM588. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
Set the value in SR1299 (high word) to keep a certain
number of segments of output unaffected by the
interrupts at X inputs during the execution of TPO
SR1299 instruction. This SR device works with SM588. V V 0 0 - N R/W 0
Available for ES3 CPU FW V1.08.00 or later and
EX3/SX3/
SV3 CPU FW V1.00.00 or later
*SR1312 Communication code for RTU-EN01 connection 1 V V 0 - - N R 0
*SR1313 Communication code for RTU-EN01 connection 2 V V 0 - - N R 0
*SR1314 Communication code for RTU-EN01 connection 3 V V 0 - - N R 0
*SR1315 Communication code for RTU-EN01 connection 4 V V 0 - - N R 0
SR1318 Socket input counter V V 0 - - N R 0
SR1319 Socket output counter V V 0 - - N R 0
SR1320 Socket error counter V V 0 - - N R 0
Actual cycle time of connection 1–32 for data
*SR1335 V V 0 - - N R 0
exchange through COM1 (Unit: ms)
Number of the connection that is currently performing
*SR1336 V V 0 - - N R 0
a cyclical data exchange through COM1
Error code for data exchange through the COM1
*SR1340 V V 0 - - N R 0
connection 1
Error code for data exchange through the COM1
*SR1341 V V 0 - - N R 0
connection 2

Error code for data exchange through the COM1


*SR1342 V V 0 - - N R 0
connection 3

Error code for data exchange through the COM1


*SR1343 V V 0 - - N R 0
connection 4

2-88
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR1344
Error code for data exchange through the COM1
V V 0 - - N R 0 _2
connection 5
Error code for data exchange through the COM1
*SR1345 V V 0 - - N R 0
connection 6
Error code for data exchange through the COM1
*SR1346 V V 0 - - N R 0
connection 7
Error code for data exchange through the COM1
*SR1347 V V 0 - - N R 0
connection 8
Error code for data exchange through the COM1
*SR1348 V V 0 - - N R 0
connection 9
Error code for data exchange through the COM1
*SR1349 V V 0 - - N R 0
connection 10
Error code for data exchange through the COM1
*SR1350 V V 0 - - N R 0
connection 11
Error code for data exchange through the COM1
*SR1351 V V 0 - - N R 0
connection 12
Error code for data exchange through the COM1
*SR1352 V V 0 - - N R 0
connection 13
Error code for data exchange through the COM1
*SR1353 V V 0 - - N R 0
connection 14
Error code for data exchange through the COM1
*SR1354 V V 0 - - N R 0
connection 15
Error code for data exchange through the COM1
*SR1355 V V 0 - - N R 0
connection 16
Error code for data exchange through the COM1
*SR1356 V V 0 - - N R 0
connection 17
Error code for data exchange through the COM1
*SR1357 V V 0 - - N R 0
connection 18
Error code for data exchange through the COM1
*SR1358 V V 0 - - N R 0
connection 19
Error code for data exchange through the COM1
*SR1359 V V 0 - - N R 0
connection 20
Error code for data exchange through the COM1
*SR1360 V V 0 - - N R 0
connection 21
Error code for data exchange through the COM1
*SR1361 V V 0 - - N R 0
connection 22
Error code for data exchange through the COM1
*SR1362 V V 0 - - N R 0
connection 23
Error code for data exchange through the COM1
*SR1363 V V 0 - - N R 0
connection 24
Error code for data exchange through the COM1
*SR1364 V V 0 - - N R 0
connection 25
Error code for data exchange through the COM1
*SR1365 V V 0 - - N R 0
connection 26

2-89
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Error code for data exchange through the COM1


_2 *SR1366
connection 27
V V 0 - - N R 0

Error code for data exchange through the COM1


*SR1367 V V 0 - - N R 0
connection 28
Error code for data exchange through the COM1
*SR1368 V V 0 - - N R 0
connection 29
Error code for data exchange through the COM1
*SR1369 V V 0 - - N R 0
connection 30
Error code for data exchange through the COM1
*SR1370 V V 0 - - N R 0
connection 31
Error code for data exchange through the COM1
*SR1371 V V 0 - - N R 0
connection 32
Actual cycle time of connection 1–32 for data
*SR1375 V V 0 - - N R 0
exchange through COM2 (Unit: ms)
Number of the connection that is currently performing
*SR1376 V V 0 - - N R 0
a cyclical data exchange through COM2
Error code for data exchange through the COM2
*SR1380 V V 0 - - N R 0
connection 1
Error code for data exchange through the COM2
*SR1381 V V 0 - - N R 0
connection 2
Error code for data exchange through the COM2
*SR1382 V V 0 - - N R 0
connection 3
Error code for data exchange through the COM2
*SR1383 V V 0 - - N R 0
connection 4
Error code for data exchange through the COM2
*SR1384 V V 0 - - N R 0
connection 5
Error code for data exchange through the COM2
*SR1385 V V 0 - - N R 0
connection 6
Error code for data exchange through the COM2
*SR1386 V V 0 - - N R 0
connection 7
Error code for data exchange through the COM2
*SR1387 V V 0 - - N R 0
connection 8
Error code for data exchange through the COM2
*SR1388 V V 0 - - N R 0
connection 9
Error code for data exchange through the COM2
*SR1389 V V 0 - - N R 0
connection 10
Error code for data exchange through the COM2
*SR1390 V V 0 - - N R 0
connection 11
Error code for data exchange through the COM2
*SR1391 V V 0 - - N R 0
connection 12

Error code for data exchange through the COM2


*SR1392 V V 0 - - N R 0
connection 13

Error code for data exchange through the COM2


*SR1393 V V 0 - - N R 0
connection 14

2-90
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

*SR1394
Error code for data exchange through the COM2
V V 0 - - N R 0 _2
connection 15
Error code for data exchange through the COM2
*SR1395 V V 0 - - N R 0
connection 16
Error code for data exchange through the COM2
*SR1396 V V 0 - - N R 0
connection 17
Error code for data exchange through the COM2
*SR1397 V V 0 - - N R 0
connection 18
Error code for data exchange through the COM2
*SR1398 V V 0 - - N R 0
connection 19
Error code for data exchange through the COM2
*SR1399 V V 0 - - N R 0
connection 20
Error code for data exchange through the COM2
*SR1400 V V 0 - - N R 0
connection 21
Error code for data exchange through the COM2
*SR1401 V V 0 - - N R 0
connection 22
Error code for data exchange through the COM2
*SR1402 V V 0 - - N R 0
connection 23
Error code for data exchange through the COM2
*SR1403 V V 0 - - N R 0
connection 24
Error code for data exchange through the COM2
*SR1404 V V 0 - - N R 0
connection 25
Error code for data exchange through the COM2
*SR1405 V V 0 - - N R 0
connection 26
Error code for data exchange through the COM2
*SR1406 V V 0 - - N R 0
connection 27
Error code for data exchange through the COM2
*SR1407 V V 0 - - N R 0
connection 28
Error code for data exchange through the COM2
*SR1408 V V 0 - - N R 0
connection 29
Error code for data exchange through the COM2
*SR1409 V V 0 - - N R 0
connection 30
Error code for data exchange through the COM2
*SR1410 V V 0 - - N R 0
connection 31
Error code for data exchange through the COM2
*SR1411 V V 0 - - N R 0
connection 32
*SR1536 Number of TCP connections through EtherCAT port V X 0 - - N R 0
Connection number of Modubs/TCP Server through
*SR1537 V X 0 - - N R 0
EtherCAT port
SR1543 Number of extension modules on the left of the CPU X V 0 - - N R 0
Model code of the 1st extension module on the left of
SR1544 X V 0 - - N R 0
the CPU
Model code of the 2nd extension module on the left of
SR1545 X V 0 - - N R 0
the CPU

2-91
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

Model code of the 3rd extension module on the left of


_2 SR1546
the CPU
X V 0 - - N R 0

Model code of the 4th extension module on the left of


SR1547 X V 0 - - N R 0
the CPU
Model code of the 5th extension module on the left of
SR1548 X V 0 - - N R 0
the CPU
Model code of the 6th extension module on the left of
SR1549 X V 0 - - N R 0
the CPU
Model code of the 7th extension module on the left of
SR1550 X V 0 - - N R 0
the CPU
Model code of the 8th extension module on the left of
SR1551 X V 0 - - N R 0
the CPU
Once the CPU is supplied with power, it checks if the
*SR1553 V V - - - Y R/W 0
parameters of the extension module DI are correct.
Once the CPU is supplied with power, it checks if the
*SR1554 V V - - - Y R/W 0
parameters of the extension module DO are correct.
Once the CPU is supplied with power, it checks if the
*SR1555 V V - - - Y R/W 0
number of the connected modules is correct.
Check if the checksum function for the right-side
module is enabled. Bit 0-7 indicates the right-side
SR1556 V V 0 - - N R/W 0
module 1 to 8. (DIO modules are excluded.) Check
the value in the bit, 0: disabled; 1: enabled.
Total DI points of the connected modules (CPU
SR1557 V V 0 - - N R 0
built-in DI points NOT included)
Total DO points of the connected modules (CPU
SR1558 V V 0 - - N R 0
built-in DO points NOT included)
Number of the right-side special modules connected
*SR1560 V V 0 - - N R 0
to the CPU module
Model code of the 1st right-side special module
*SR1561 V V 0 - - N R 0
connected to the CPU module
Model code of the 2nd right-side special module
*SR1562 V V 0 - - N R 0
connected to the CPU module
Model code of the 3rd right-side special module
*SR1563 V V 0 - - N R 0
connected to the CPU module
Model code of the 4th right-side special module
*SR1564 V V 0 - - N R 0
connected to the CPU module
Model code of the 5th right-side special module
*SR1565 V V 0 - - N R 0
connected to the CPU module
Model code of the 6th right-side special module
*SR1566 V V 0 - - N R 0
connected to the CPU module
Model code of the 7th right-side special module
*SR1567 connected to the CPU module V V 0 - - N R 0

Model code of the 8th right-side special module


*SR1568 V V 0 - - N R 0
connected to the CPU module

2-92
Ch a pt er 2 D e v ic es

ES3/EX3 Series
SV3/SX3 Series

Attribute
Latched
OFF STOP RUN

Default
SR Function   
ON RUN STOP

SR1593
Set the timeout time when receiving data through the
X V 0 - - N R/W 0 _2
ETHRW instruction for the DVPEN01-SL module.
Reception complete flag of the ETHRW instruction for
SR1594 X V 0 0 N R 0
the DVPEN01-SL module
Reception error flag of the ETHRW instruction for the
SR1595 X V 0 0 N R 0
DVPEN01-SL module
Specify the module ID of the DVPEN01-SL, the MAC
*SR1596 X V 0 - - N R/W 0
address of which is to be read.
*SR1597 Store the MAC address of a DVPEN01-SL module. X V 0 - - N R 0
*SR1598 Store the MAC address of a DVPEN01-SL module. X V 0 - - N R 0
*SR1599 Store the MAC address of a DVPEN01-SL module. X V 0 - - N R 0
Set the timeout time when communicating through
SR1609 the CANRS instruction for the DVPCOPM-SL X V 200 - - N R/W 200
module. (unit: ms)
Number of packets received in broadcast mode
SR1610 through the CANRS instruction for DVPCOPM-SL, X V 0 0 - N R 0
which is the number of slaves.
Flag to define the frequency to compensate
*SR1700 V V 0 0 - N R/W 0
backlashes at Y0/Y1 for CSFO instruction (Hz)
Flag to define the frequency to compensate
*SR1702 V V 0 0 - N R/W 0
backlashes at Y2/Y3 for CSFO instruction (Hz)
Flag to define the frequency to compensate
*SR1704 V V 0 0 - N R/W 0
backlashes at Y4/Y5 for CSFO instruction (Hz)
Flag to define the frequency to compensate
*SR1706 V V 0 0 - N R/W 0
backlashes at Y6/Y7 for CSFO instruction (Hz)
Note 1: for SR*, refer to Additional Remarks on Special Auxiliary Relays and Special Data Registers for more details

2.2.15 Special Data Registers Refresh Conditions


Special data
Time to refresh
register
SR0–SR2 Refresh the register when there is a program execution error.
SR4–SR6 Refresh the register when there is a grammar check error
SR8–SR9 Refresh the register when there is a watchdog timer error.
SR27 Register is refreshed and cleared by the system.
Refresh the register when the output is used repeatedly by more than one high-speed output
SR28
instruction.
SR29 Execute CSFO instruction
Refresh the register when the output is used repeatedly by more than one high-speed output
SR30-SR31
instruction.
Refresh the register once when there is an error.
SR32
-1: no error occurred.
The register is refreshed by you. You set the flag SM36 to ON and the system saves the data to the
SR36
memory card. After saving is complete, the system automatically resets it to OFF

2-93
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special data
Time to refresh
register
SR38 Register is refreshed by the system and cleared by you.
SR40–SR161 Refresh the register when there is an error.
After the manufactured PLC leaves the factory, every minute the PLC is supplied with power is
SR162–SR163
counted and the register is refreshed every minute.
SR168~SR171 Register is refreshed by the system.
_2
SR172~SR173 Register is refreshed by you.
SR180 Refresh the register when the PLC is powered on and powered off.
SR190–SR197 Register is refreshed by you.
SR198–SR199 After a cycle scan when the PLC is powered on.
The register is refreshed according to the settings in HWCONFIG when the PLC is powered on. You
SR201–SR213
can edit the settings afterwards.
The register is refreshed according to the settings in HWCONFIG when powered on. You can edit
SR217–SR218
the settings afterwards.
SR220–SR226 Refresh the register every scan cycle.
SR227–SR308 Refresh the register when the program is downloaded to the PLC.
SR309–SR390 Refresh the register when the status of the PLC changes.
SR391–SR397 Refresh the register every scan cycle.
SR405, SR406 After a cycle scan when the PLC is powered on.
SR407 Refresh the register every second.
SR408 Refresh the register whenever the instruction END is executed.
SR409~SR410 Register is refreshed and cleared by you.
SR411~SR416 Refresh the register whenever the instruction END is executed.
SR421–SR424 Register is refreshed by you.
SR425 Register is refreshed by you.
SR440–SR443 Refresh the register when the PLC is powered on.
SR444–SR451 Refresh the register when the PLC is powered on.
SR453 Refresh the register when there is an error.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR460
scanned. If the instruction is not executed, you can edit the settings.
SR462–SR466 Register is refreshed by you.
SR467 Register is refreshed by the system.
When the PLC is supplied with power, the register is refreshed according to the position planning
SR468–SR469
table. You can edit the settings afterwards.
SR470 Register is refreshed by the system.
SR472 Register is refreshed you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR474
scanned. If the instruction is not executed, you can edit the settings.
SR476–SR477 Register is refreshed by you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR480
scanned. If the instruction is not executed, you can edit the settings.
SR482–SR486 Register is refreshed by you.
SR487 Register is refreshed by the system.
Refresh the register when the PLC is powered on according to the position planning table. You can
SR488–SR489
edit the settings afterwards.
SR490 Register is refreshed by the system.
SR492 Register is refreshed by you.

2-94
Ch a pt er 2 D e v ic es

Special data
Time to refresh
register
Refresh the register whenever the high-speed output instruction is executed and the program is
SR494
scanned. If the instruction is not executed, you can edit the settings.
SR496–SR497 Register is refreshed by you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR500
scanned. If the instruction is not executed, you can edit the settings. _2
SR502–SR506 Register is refreshed by you.
SR507 Register is refreshed by the system.
Refresh the register when the PLC is powered on according to the position planning table. You can
SR508–SR509
edit the settings afterwards.
SR510 Register is refreshed by the system.
SR512 Register is refreshed by you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR514
scanned. If the instruction is not executed, you can edit the settings.
SR516–SR517 Register is refreshed by you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR520
scanned. If the instruction is not executed, you can edit the settings.
SR522–SR526 Register is refreshed by you.
SR527 Register is refreshed by the system.
Refresh the register when the PLC is powered on according to the position planning table. You can
SR528–SR529
edit the settings afterwards.
SR530 Register is refreshed by the system.
SR532 Register is refreshed by you.
Refresh the register whenever the high-speed output instruction is executed and the program is
SR534
scanned. If the instruction is not executed, you can edit the setting.
SR536–SR537 Register is refreshed by a user.
Refresh the register according to the settings in HWCONFIG when the PLC is powered on. You can
SR580–SR595
edit the settings afterwards.
SR610–SR617 Refresh the register whenever the output instruction is executed.
Refresh the register whenever the EIX or DIX instruction is executed.
SR623–SR632 ON: interrupt is enabled
OFF: interrupt is disabled
SR640–SR647 Register is refreshed by you.
SR652–SR655 Register is refreshed by the system.
SR656~SR657 Register is refreshed by the system or by you.
SR658–SR726 Register is refreshed by the system.
SR731–SR738 Register is refreshed by the system.
SR741–SR748 Register is refreshed by the system.
SR751-SR768 Register is refreshed by you.
SR771–SR778 Register is refreshed by the system.
SR781–SR788 Register is refreshed by the system.
SR791–SR806 Register is refreshed by the system.
SR811–SR818 Register is refreshed by you.
SR820 Refresh the register according to the settings in CANopen Builder.
SR821 Refresh the register when the firmware is updated.
SR822 Refresh the register according to the settings in HWCONFIG.
SR823–SR893 Register is refreshed by the system.

2-95
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special data
Time to refresh
register
SR900–SR901 Register is refreshed by the system.
SR902 Register is refreshed by you.
1. Register is refreshed by you.
SR1000–SR1006
2. Register is refreshed after power-on or after HWCONFIG is downloaded.
SR1007 Register is refreshed by the system.
_2
SR1009 Register is refreshed by the system.
SR1010 Register is refreshed by you.
SR1011–SR1014 Register is refreshed by the system.
SR1015-SR1017 Register is refreshed by you.
SR1018 Refresh the register every scan cycle.
1. Refresh the register every scan cycle.
SR1019
2. Register is refreshed by you.
SR1020-SR1035 1. Refresh the register when a connection is established.
SR1052-SR1067 2. Refresh the register every scan cycle.
SR1092~SR1093 Register is refreshed by you.
SR1110 You set the register up and after saving, the system clears the register.
SR1111-SR1114 Register is refreshed by you.
1. Refresh the register when a connection is established.
SR1020–SR1107
2. Refresh the register every scan cycle.
SR1116, SR1117 Refresh the register when the program is downloaded to the PLC.
SR1120–SR1183 Refresh the register when the communication is complete.
SR1291~SR1294 Register is refreshed by you and cleared by the system.
SR1297 Register is refreshed by you, and is cleared by the system or you.
SR1298~SR1299 Register is refreshed and cleared by you.
SR1312-SR1315 Refresh the register during communication
Refresh the register when the parameter is downloaded to the PLC, or when the PLC is supplied
SR1318–SR1320
with power.
SR1335–SR1336 Refresh the register every scan cycle after the function of data exchange is enabled.
SR1340–SR1371 Refresh the register when there is an error.
SR1375–SR1376 Refresh the register every scan cycle after the function of data exchange is enabled.
SR1380–SR1411 Refresh the register when there is an error.
SR1536~SR1537 Register is refreshed by the system.
When there is a left-side special module connected, the register is refreshed when the PLC switches
SR1543
from STOP to RUN.
SR1544~SR1551 Register is refreshed by the system.
SR1553-SR1555 Register is refreshed by you.
When there is a right-side module connected, the register is refreshed when the PLC switches from
SR1556
STOP to RUN.
SR1557-SR1568 Register is refreshed by the system.
SR1593 Register is refreshed by you.
SR1594~SR1595 Register is refreshed by the system.
SR1596 Register is refreshed by you.
SR1597~SR1599 Register is refreshed by the system.
SR1609 Register is refreshed by you.
SR1610 Register is refreshed by the system.
SR1700, SR1702 Register is refreshed by you.

2-96
Ch a pt er 2 D e v ic es

Special data
Time to refresh
register
SR1704, SR1706 Register is refreshed by you.

2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data


Registers
_2
1. Scan timeout timer
 SM8/SR8
When a scan timeout occurs during the execution of the program, the error LED on the PLC changes to
continuous ON, and SM8 changes to ON.
SR8 contains the step address at which the watchdog timer changed to ON.

2. Clearing the warning light


 SM22
Setting SM22 to ON clears the error log and the warning light.
3. AD/DA built in the CPU
 Analog input
Applicable to EX3/SX3 series CPU with built-in AD
Item Voltage Current Current
Rated range of input -10V ~ +10V -20mA ~ 20mA 4mA ~ 20mA
Resolution 12 bits 11 bits 11 bits

Rated range of digital


-2000 ~ 2000 -1000 ~ 1000 0 ~ 1000
conversion value

SR168 (channel1)
SR169 (channel 2)
SR No. (Channel No.) SR170 (channel 3)
SR171 (channel 4)
Channels 3~4 are not supported by EX3 series CPU

 SM27/SR27: analog input alarm flag and alarm code


Enable the AD Analog Input Warning function in HWCONFIG first. When the analog input conversion value exceeds
the allowed the range or disconnection occurs, the analog input alarm flag SM27 will be ON, and SR27 will show the
alarm code for recording the cause of the alarm.

2-97
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_2

Code Description Solution


The conversion value of built-in AD input channel 1 exceeds the
16#0040 Check the actual input signal.
allowed range.
The conversion value of built-in AD input channel 2 exceeds the
16#0041 Check the actual input signal.
allowed range.
The conversion value of built-in AD input channel 3 exceeds the
16#0042 Check the actual input signal.
allowed range.
The conversion value of built-in AD input channel 4 exceeds the
16#0043 Check the actual input signal.
allowed range.
Disconnection occurs in the built-in AD channel 1 current input mode Ensure that the connection is
16#0044
(4mA~20mA) successful.
Disconnection occurs in the built-in AD channel 2 current input mode Ensure that the connection is
16#0045
(4mA~20mA) successful.
Disconnection occurs in the built-in AD channel 3 current input mode Ensure that the connection is
16#0046
(4mA~20mA) successful.
Disconnection occurs in the built-in AD channel 4 current input mode Ensure that the connection is
16#0047
(4mA~20mA) successful.

Range of corresponding
Analog input mode Remark
digital value
1. When the digital value is less than -2024 or greater
than 2023, it is regarded as being out of the allowed
Voltage: -10V ~ 10V -2000 ~ 2000
range.
2. Disconnection detection is not supported.
1. When the digital value is less than -1012 or greater
than 1011, it is seen as being out of the allowed
Current: -20mA ~ 20mA -1000 ~ 1000
range.
2. Disconnection detection is not supported.
1. When the digital value is less than -12 or greater
than 1011, it is out of the allowed range.
Current: 4mA ~ 20mA 0 ~ 1000
2. When the digital value is less than -36, it indicates
that the disconnection occurs.

2-98
Ch a pt er 2 D e v ic es

 Analog output
Applicable to EX3/SX3 series CPU with built-in DA

Item Voltage Current

Rated range of output -10V ~ +10V 0 ~ 20mA

Resolution 12 bits 12 bits


Rate range of digital _2
-2000 ~ 2000 0 ~ 4000
input value

SR172 (channel 1)
SR No. (Channel No.)
SR173 (channel 2)

4. The real-time clock


 SM220, SR220–SR226, and SR391–SR397
SM220: Calibrate the real-time clock within ±30 seconds
When SM220 changes from OFF to ON, the system calibrates the real-time clock.
If the second value in the real-time clock is in the range 0–29, the minutes value is fixed, and the seconds value
is cleared to zero.
If the value of the second in the real-time clock is in the range 30–59, the minutes value increases by one, and
the seconds value is cleared to zero.
This table lists the corresponding functions and values of SR220–SR226 and SR391–SR397.
Device
Binary-coded Decimal Function Value
decimal system system
SR220 SR391 Year 00–99 (A.D.)
SR221 SR392 Month 1–12
SR222 SR393 Day 1–31
SR223 SR394 Hour 0–23
SR224 SR395 Minute 0–59
SR225 SR396 Second 0–59
SR226 SR397 Week 1–7
SR391–SR397 correspond to SR220–SR226. The difference between SR220–SR226 and SR391–SR397 is that
the former uses the binary-coded decimal while the latter uses the decimal system. For example, December is
represented as 12 in SR392 while it is represented as 1100 in the binary-coded decimal. Refer to Chapter 6 for
more information on the real-time clock.

5. Communication functions
 SM96–SM107, SM209–SM212, SR201–SR202, and SR209–SR213

SR209 records the communication format of the COM1 port on the PLC, and SR212 records the communication
format of the COM2 port on the PLC. The following table lists the settings for the communication protocols. Refer
to Chapter 6 for more information on the communication instructions.

b0 Data length 7 (value=0) 8 (value=1)

b1 00 : None
Parity bits
b2 01 : Odd parity bits

2-99
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

10 : Even parity bits


b3 Stop bits 1 bit (value=0) 2 bits (value=1)
b4 0001 (H 1) : 4800
b5
0010 (H 2) : 9600
b6
b7 0011 (H 3) : 19200
_2 0100 (H 4) : 38400

0101 (H 5) : 57600

0110 (H 6) : 115200

0111 (H 7) : 230400

1000 (H 8) : 500000

1001 (H 9) : 921000

1010 (16#A) : Undefined

1011 (16#B) : Undefined

1100 (16#C) : Undefined

1101 (16#D) : Undefined

1110 (16#E) : Undefined

1111 (16#F) : User-defined*1


b8-b15 Undefined (reserved)
*1: Refer to the settings in HWCONFIG of ISPSoft or in Hardware Configuration of DIADesigner for the user-defined
baudrate. Use SR217/SR218 to set user-defined baudrate (unit: 100bps); when you input 96 in SR217/SR218, it
means 9600bps.
*2: Refer to section 6.19.3 for the use of communication flags and registers.

6. Clearing the device contents

 SM203/SM204/SM205

Device number Device which is cleared


The non-latched areas in the input relays, the output relays, the stepping relays, and
the auxiliary relays are cleared.
SM203/SM204
The non-latched areas in the timers, the counters, and the 32-bit counters are
All non-latched areas are
cleared.
cleared.
The non-latched areas in the data registers and the index registers are cleared.
The watchdog timer does not act during this period of time.
The latched areas in the timers, counters, and 32-bit counters are cleared.
SM205 The latched auxiliary relays are cleared.
All latched areas are cleared. The latched data registers are cleared.
The watchdog timer does not act during this period of time.
Refer to Section 2.1.4 for more information on the latched areas in the device range.

7. PLC error log


 SR40-SR161

SR40: The maximum number of error logs stored in SR40 is 20. If the number of the error logs exceeds the
maximum number 20, only 20 of them will be stored. Each error log occupies 6 registers.

SR41: The error log pointer points to the latest error log. When an error occurs, the value of the error log pointer

2-100
Ch a pt er 2 D e v ic es

increases by one. The range of pointer values is 0–19. For example, the error log pointer points to the
fourth error log when the value in SR41 is 3. If the value in SR41 is 20, that means the number of error
logs exceeds 20 and is now in cycle.

SR42-SR161: The time and error code when the error occurs are recorded in SR42–SR161. The following table
lists the corresponding functions of these SRs.

Explanation of the Slot column: _2


High byte The error occurs in the CPU (No.: 1)
Low byte The error occurs in the CPU (No.: 0)

CPU Error Time when the error occurs


Number Slot
ID code Year Month Day Hour Minute Second
SR45 High SR45 Low SR46 High SR46 Low SR47 High SR47 Low
1 SR42 SR43 SR44
byte byte byte byte byte byte
SR51 High SR51 Low SR52 High SR52 Low SR53 High SR53 Low
2 SR48 SR49 SR50
byte byte byte byte byte byte
SR57 High SR57 Low SR58 High SR58 Low SR59 High SR59 Low
3 SR54 SR55 SR56
byte byte byte byte byte byte
SR63 High SR63 Low SR64 High SR64 Low SR65 High SR65 Low
4 SR60 SR61 SR62
byte byte byte byte byte byte
SR69 High SR69 Low SR70 High SR70 Low SR71 High SR71 Low
5 SR66 SR67 SR68
byte byte byte byte byte byte
SR75 High SR75 Low SR76 High SR76 Low SR77 High SR77 Low
6 SR72 SR73 SR74
byte byte byte byte byte byte
SR81 High SR81 Low SR82 High SR82 Low SR83 High SR83 Low
7 SR78 SR79 SR80
byte byte byte byte byte byte
SR87 High SR87 Low SR88 High SR88 Low SR89 High SR89 Low
8 SR84 SR85 SR86
byte byte byte byte byte byte
SR93 High SR93 Low SR94 High SR94 Low SR95 High SR95 Low
9 SR90 SR91 SR92
byte byte byte byte byte byte
SR99 High SR99 Low SR100 High SR100 Low SR101 High SR101 Low
10 SR96 SR97 SR98
byte byte byte byte byte byte
SR105 High SR105 SR106 High SR106 Low SR107 High SR107 Low
11 SR102 SR103 SR104
byte Low byte byte byte byte byte
SR111 High SR111 Low SR112 High SR112 Low SR113 High SR113 Low
12 SR108 SR109 SR110
byte byte byte byte byte byte
SR117 High SR117 SR118 High SR118 Low SR119 High SR119 Low
13 SR114 SR115 SR116
byte Low byte byte byte byte byte
SR123 High SR123 SR124 High SR124 Low SR125 High SR125 Low
14 SR120 SR121 SR122
byte Low byte byte byte byte byte
SR129 High SR129 SR130 High SR130 Low SR131 High SR131 Low
15 SR126 SR127 SR128
byte Low byte byte byte byte byte
SR135 High SR135 SR136 High SR136 Low SR137 High SR137 Low
16 SR132 SR133 SR134
byte Low byte byte byte byte byte
SR141 High SR141 SR142 High SR142 Low SR143 High SR143 Low
17 SR138 SR139 SR140
byte Low byte byte byte byte byte
SR147 High SR147 SR148 High SR148 Low SR149 High SR149 Low
18 SR144 SR145 SR146
byte Low byte byte byte byte byte

2-101
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

CPU Error Time when the error occurs


Number Slot
ID code Year Month Day Hour Minute Second
SR153 High SR153 SR154 High SR154 Low SR155 High SR155 Low
19 SR150 SR151 SR152
byte Low byte byte byte byte byte
SR159 High SR159 SR160 High SR160 Low SR161 High SR161 Low
20 SR156 SR157 SR158
byte Low byte byte byte byte byte
_2
8. PLC download log
 SR227-SR308
SR227: The maximum number of download logs which are stored in SR227 is 20. Every download log occupies
4 registers. The download actions which are recorded are numbered, as shown in the following table.
ES3 CPU firmware V1.04.00 or later works with ISPSoft V3.13 or later or DIADesigner V1.30 or later.
EX3/SV3/SX3 CPU firmware V1.00.00 or later works with DIADesigner V1.30 or later.
The following download actions 000A~0015 are supported.

Number (HEX) Download action


0x0001 Downloading the program
0x0002 Downloading the PLC setting
0x0003 Downloading the I/O module table
0x000A PLC operation codes (ISP)
0x000B PLC parameters (HWCONFIG)
0x000C Module configurations (HWCONFIG)
0x000D PLC operation codes and programs (ISP)
0x000E PLC operation codes (Online editing)
0x000F PLC operation codes and programs (Online editing)
0x0010 PLC operation codes and programs (Restoration from SD card)
0x0011 Module configurations and PLC parameters (HWCONFIG)
0x0012 Module configurations and data exchange table (HWCONFIG)
0x0013 Module configurations and data exchange table (HWCONFIG)
0x0014 Module configurations (EIP Builder)
0x0015 Module configurations, PLC parameters and data exchange table (Restoration from SD card)

SR228: The download log pointer points to the latest download log. When a download action is executed, the value
of the download log pointer increases by one. The range of pointer values is 0–19. For example, the
download log pointer points to the fourth download log when the value in SR228 is 3.

The time of the downloading and the action numbers are recorded in SR229–SR30. The following table lists the
corresponding functions of these data registers.

Action *Time when the download occurs


Number
number Year Month Day Hour Minute Second
SR230 SR230 SR231 SR231 SR232 SR232
1 SR229
High byte Low byte High byte Low byte High byte Low byte
2 SR233 SR234 SR234 SR235 SR235 SR236 SR236

2-102
Ch a pt er 2 D e v ic es

Action *Time when the download occurs


Number
number Year Month Day Hour Minute Second
High byte Low byte High byte Low byte High byte Low byte
SR238 SR238 SR239 SR239 SR240 SR240
3 SR237
High byte Low byte High byte Low byte High byte Low byte
SR242 SR242 SR243 SR243 SR244 SR244
4 SR241
High byte Low byte High byte Low byte High byte Low byte _2
SR246 SR246 SR247 SR247 SR248 SR248
5 SR245
High byte Low byte High byte Low byte High byte Low byte
SR250 SR250 SR251 SR251 SR252 SR252
6 SR249
High byte Low byte High byte Low byte High byte Low byte
SR254 SR254 SR255 SR255 SR256 SR256
7 SR253
High byte Low byte High byte Low byte High byte Low byte
SR258 SR258 SR259 SR259 SR260 SR260
8 SR257
High byte Low byte High byte Low byte High byte Low byte
SR262 SR262 SR263 SR263 SR264 SR264
9 SR261
High byte Low byte High byte Low byte High byte Low byte
SR266 SR266 SR267 SR267 SR268 SR268
10 SR265
High byte Low byte High byte Low byte High byte Low byte
SR270 SR270 SR271 SR271 SR272 SR272
11 SR269
High byte Low byte High byte Low byte High byte Low byte
SR274 SR274 SR275 SR275 SR276 SR276
12 SR273
High byte Low byte High byte Low byte High byte Low byte
SR278 SR278 SR279 SR279 SR280 SR280
13 SR277
High byte Low byte High byte Low byte High byte Low byte
SR282 SR282 SR283 SR283 SR284 SR284
14 SR281
High byte Low byte High byte Low byte High byte Low byte
SR286 SR286 SR287 SR287 SR288 SR288
15 SR285
High byte Low byte High byte Low byte High byte Low byte
SR290 SR290 SR291 SR291 SR292 SR292
16 SR289
High byte Low byte High byte Low byte High byte Low byte
SR294 SR294 SR295 SR295 SR296 SR296
17 SR293
High byte Low byte High byte Low byte High byte Low byte
SR298 SR298 SR299 SR299 SR300 SR300
18 SR297
High byte Low byte High byte Low byte High byte Low byte
SR302 SR302 SR303 SR303 SR304 SR304
19 SR301
High byte Low byte High byte Low byte High byte Low byte
SR306 SR306 SR307 SR307 SR308 SR308
20 SR305
High byte Low byte High byte Low byte High byte Low byte
* The format for the download action time: the data is stored as a binary-coded decimal. The following table lists the
range of values.

Function Value
Year 00–99 (A.D.)
Month 01–12
Day 01–31
Hour 00–23

2-103
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Function Value
Minute 00–59
Second 00–59

9. The PLC status change log

 SR309–SR390
_2
SR309: The maximum number of PLC status change logs stored in SR309 is 20. Each PLC status
change log occupies 4 registers. The recorded PLC status change actions are numbered, as shown in the
following table.

PLC status change Number

PLC powered on. 1

PLC powered off. 2

PLC starts to run. 3

PLC stops. 4

Default setting in the PLC 5

Emergency stop of outputs


7
(SM580)

Write real-time clock (RTC) 8

SR310: The PLC status change log pointer points to the latest PLC status change log. When the PLC status
changes, the value of the PLC status change log pointer increases by one. The range of pointer values is 0–19. For
example, PLC status change log pointer points to the fourth PLC status change log when the value in SR310 is 3.

The time when the PLC status change actions occur is recorded in SR311–SR390. The flowing table lists the
corresponding functions of these data registers.

Action *Time when the PLC status change occurs


Number
number Year Month Day Hour Minute Second
SR312 SR312 SR313 SR313 SR314 SR314
1 SR311
High byte Low byte High byte Low byte High byte Low byte
SR316 SR316 SR317 SR317 SR318 SR318
2 SR315
High byte Low byte High byte Low byte High byte Low byte
SR320 SR320 SR321 SR321 SR322 SR322
3 SR319
High byte Low byte High byte Low byte High byte Low byte
SR324 SR324 SR325 SR325 SR326 SR326
4 SR323
High byte Low byte High byte Low byte High byte Low byte
SR328 SR328 SR329 SR329 SR330 SR330
5 SR327 High byte Low byte High byte Low byte High byte Low byte

SR332 SR332 SR333 SR333 SR334 SR334


6 SR331 High byte Low byte High byte Low byte High byte Low byte

SR336 SR336 SR337 SR337 SR338 SR338


7 SR335
High byte Low byte High byte Low byte High byte Low byte

2-104
Ch a pt er 2 D e v ic es

Action *Time when the PLC status change occurs


Number
number Year Month Day Hour Minute Second
SR340 SR340 SR341 SR341 SR342 SR342
8 SR339
High byte Low byte High byte Low byte High byte Low byte
SR344 SR344 SR345 SR345 SR346 SR346
9 SR343
High byte Low byte High byte Low byte High byte Low byte
SR348 SR348 SR349 SR349 SR350 SR350 _2
10 SR347
High byte Low byte High byte Low byte High byte Low byte
SR352 SR352 SR353 SR353 SR354 SR354
11 SR351
High byte Low byte High byte Low byte High byte Low byte
SR356 SR356 SR357 SR357 SR358 SR358
12 SR355
High byte Low byte High byte Low byte High byte Low byte
SR360 SR360 SR361 SR361 SR362 SR362
13 SR359
High byte Low byte High byte Low byte High byte Low byte
SR364 SR364 SR365 SR365 SR366 SR366
14 SR363
High byte Low byte High byte Low byte High byte Low byte
SR368 SR368 SR369 SR369 SR370 SR370
15 SR367
High byte Low byte High byte Low byte High byte Low byte
SR372 SR372 SR373 SR373 SR374 SR374
16 SR371
High byte Low byte High byte Low byte High byte Low byte
SR376 SR376 SR377 SR377 SR378 SR378
17 SR375
High byte Low byte High byte Low byte High byte Low byte
SR380 SR380 SR381 SR381 SR382 SR382
18 SR379
High byte Low byte High byte Low byte High byte Low byte
SR384 SR384 SR385 SR385 SR386 SR386
19 SR383
High byte Low byte High byte Low byte High byte Low byte
SR388 SR388 SR389 SR389 SR390 SR390
20 SR387
High byte Low byte High byte Low byte High byte Low byte
*Format for the PLC status change time: the data is stored as a binary-coded decimal. The following table lists the
range of values.

Function Value
Year 00–99 (A.D.)
Month 01–12
Day 01–31
Hour 00–23
Minute 00–59
Second 00–59

2-105
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

10. The PLC operation flag

 SM400-SM403

SM400: The flag is always ON when CPU runs.

SM401: The flag is always OFF when CPU runs.

SM402: The flag is ON only at the first scan. The pulse width equals one scan time. You can use this contact for the
_2 initial value setting.

SM403: The flag is OFF only at the first scan. That is, the negative pulse is generated the moment the PLC runs.

The PLC runs.

SM400

SM401

SM402

SM403
Scan time

11. The initial clock pulse

 SM404~SM410, SR409~SR410

The PLC provides the following types of clock pulses. When the PLC is powered on, these clock pulses act
automatically, among which there are two types of clock pulses (SM409 and SM410) which you can set their time
intervals on you own.

Device Function

SM404 10 millisecond clock pulse during which the pulse is ON for 5 milliseconds and then is OFF for 5 milliseconds
100 millisecond clock pulse during which the pulse is ON for 50 milliseconds and then is OFF for 50
SM405
milliseconds
200 millisecond clock pulse during which the pulse is ON for 100 milliseconds and then is OFF for 100
SM406
milliseconds
One second clock pulse during which the pulse is ON for 500 milliseconds and then is OFF for 500
SM407
milliseconds
SM408 2 second clock pulse (ON: 1 second, OFF: 1 second)
2n second clock pulse (ON: n seconds, OFF: n seconds)
SM409
The setting value for n is in SR409.
2n millisecond clock pulse (ON: n milliseconds, OFF: n milliseconds)
SM410 The setting value for n is in SR410.

Note: The clock pulses above are not affected by the PLC’s scan time.

2-106
Ch a pt er 2 D e v ic es

The clock pulses are illustrated in the following graphs.


10 ms

SM404 (10 ms) 100 Hz

5 ms

100 ms _2
SM405 (100 ms) 10 Hz

50 ms

200 ms

SM406 (200 ms) 5 Hz

100 ms

1 sec

SM407 (1 sec) 1 Hz

500 ms
2 sec
0.5 Hz
SM408 (2 sec)

1 sec

2n sec
1/2n Hz

SM409 (2n sec)

n sec

2n ms

SM410 (2n ms)

n ms

12. The flags related to the memory card

 SM36, SM450-SM453, SM456-SR36, SR453, SR902

You use the memory card to back up the data in the PLC. Refer to Chapter 6 for instructions concerning the memory
card.

Device Function

SM36 Enable saving data to the memory card. When ON, the PLC runs according to the value in the SR36.
Memory card is present.
SM450 ON: memory card is present.
OFF: memory card is not present.

2-107
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Device Function

SM451 Memory card is write-protected.


Data in the memory card is being accessed.
SM452 ON: data in the memory card is being accessed.
OFF: data in the memory card is not accessed.
Error during the operation of the memory card.
_2 SM453 ON: error occurred.
OFF: no error.
Execution of data logger and the memory card.
SM456
ON: execution by the values in SR902.
When an error occurs in the memory card, the error codes are stored here.
A. 16#005D: no memory card installed
B. 16#005E: an error occurs when the memory card is initialized
C. 16#005F: the path is incorrect or the file does not exist
D. 16#0060: cannot create the default folder
E. 16#0061: the memory space is insufficient
F. 16#0062: the memory card is write protected
SR453 G. 16#0063: an error occurs when the data is written into the file
H. 16#0064: the data cannot be read from the memory card
I. 16#0065: the file is a read-only file
J. 16#0066: when restoring the memory card PLC is in RUN status
K. 16#0067: when restoring the memory card PLC ID is not matched when restoring the memory card
L. 16#0068: when restoring the memory card the password is not matched
M. 16#0069: when restoring the memory card, the file path and the file name contain the CPU module
name, but it is not matched with the actual CPU module
The code for the executions of data logger and the memory card (works with SM456); for example,
SR902
H5AA5: write the sampling data from the data logger into the memory card.
Use the following function codes to backup or restore data. Enable SM36 for the function codes to work.
A. K1122 (backup) #1, it indicates backing up the PLC programs to the memory card. (PLC ID and
password are included) Execute this backup when the PLC is in the RUN/Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\user_program.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\user_program.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\user_program.dup
SX3 file name: SDCard\PLC CARD\SX3\SysDup\user_program.dup
B. K2211 (restore) #2, it indicates restoring the PLC programs from the memory card. (PLC ID and
password are included) Execute the restoring when the PLC is in the Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\user_program.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\user_program.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\user_program.dup
SR36 SX3 file name: SDCard\PLC CARD\SX3\SysDup\user_program.dup
C. K3344 (backup) #1, it indicates backing up the latched values (D, S, M, C, HC) and the latched range
to the memory card. Execute this backup when the PLC is in the RUN/Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\retained_data.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\retained_data.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\retained_data.dup
SX3 file name:SDCard\PLC CARD\SX3\SysDup\retained_data.dup
D. K4433 (restore) #2, it indicates resoring the latched values (D, S, M, C, HC) and the latched range
from the memory card. Execute the restoring when the PLC is in the Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\retained_data.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\retained_data.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\retained_data.dup
SX3file name: SDCard\PLC CARD\SX3\SysDup\retained_data.dup

2-108
Ch a pt er 2 D e v ic es

Device Function
E. K5566 (backup) #1,it indicates backing up the PLC programs and parameters to the memory card.
(the status and values of latched devices are NOT included). Execute this backup when the PLC is
in the Stop status.
F. K5577 (backup) #1, it indicates restoring the PLC programs and parameters from the memory card.
(the status and values of latched devices are included). Execute this backup when the PLC is in the
Stop status. _2
*E & F functions are the same as the backup and restore functions in Card Utility.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\ES3_save_backup.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\EX3_save_backup.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\SV3_save_backup.dup
SX3 file name: SDCard\PLC CARD\SX3\SysDup\SX3_save_backup.dup
G. K6755 (restore) #2, it indicates restoring all PLC data (according to the backup value E or F) from the
memory card. Execute the restoring when the PLC is in the Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\ES3_save_backup.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\EX3_save_backup.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\SV3_save_backup.dup
SX3 file name: SDCard\PLC CARD\SX3\SysDup\SX3_save_backup.dup
Note: if you need to restore from POWER-ON, you need to modify the backup file name and save it
to the path: SDCard\PLC CARD\ES3\SysDup\ES3_BACKUP.dup before performing restoring from
POWER-ON. Here you should change the path into the right one based on your own model name.
H. K5588 (backup) #1, it indicates backing up all FR file registers from the PLC to the memory card.
Execute this backup when the PLC is in the Stop status.
ES3 file name: SDCard\PLC CARD\ES3\SysDup\ES3_FR_backup.dup
EX3 file name: SDCard\PLC CARD\EX3\SysDup\EX3_FR_backup.dup
SV3 file name: SDCard\PLC CARD\SV3\SysDup\SV3_FR_backup.dup
SX3 file name: SDCard\PLC CARD\SX3\SysDup\SX3_FR_backup.dup
I. K8855 (restore) #2, it indicates restoring all FR file registers from the memory card to the PLC.
Execute the restoring when the PLC is in the Stop status. The file name should be the same as the
file name in H shows.
(Default file name: SDCard\PLC CARD\ES3\SysDup\ES3_FR_backup.dup)
#1: While backing up, if there is a file with the same file name, the system overwrites the existing file.
#2:
While restoring, if the file path and the file name are not identical to the backup file, the system does not execute the
restoring.

Note: The definitions of the above mentioned PLC program, parameters and retainable devices:
The PLC program includes PLC programming execution codes, programming codes, project password and PLC ID.
The parameters include HWCONFIG configurations, data mapping table and position planning table.
The latched area means parameters and all the values set in this area are retainable.

2-109
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 While restoring the PLC program from the memory card, the system verifies the backup file, PLC ID and
password.
 PLC ID check: if the backup file is set with PLC ID, it prevents restoring the PLC program to the wrong PLC.

CPU module with PLC ID CPU module without PLC ID


PLC ID matched: checking the
Backup file with PLC ID password Not restoring
_2 PLC ID not matched: not restoring
Backup file without PLC ID Not restoring Checking the password

 Password check: if the backup file is set with password, it ensures the security of the PLC program and prevents
restoring the PLC program to the wrong PLC.

CPU module with password CPU module without password


Password matched: restoring Restoring and you can also set the
Backup file with password
Password not matched: not restoring CPU module with password
Backup file without password Not restoring Restoring

 SR36 only stores 2 logs:

A. The number 1234 means the PLC stores the error log (SR40–SR161) in the memory card.
B. The number 3456 means the PLC stores the error log (SR40–SR161) and the PLC state changing log
(SR309–SR390) in the memory card.

13. The high-speed output instruction is being executed. The output immediately stops when the instruction is
disabled or stops.

 SM587: while using the position planning table to control the output, the axis should refer to the following flags for
the action to stop.

 SM476, SM477, SM496, SM497, SM516, SM517, SM536, SM537, SM556, SM557, SM576, SM577:

OFF (default): deceleration stop

ON: immediate stop

 SM463, SM474, SM483, SM494, SM503, SM514, SM523, SM534, SM543, SM554, SM563, SM574:use these
flags to pause output.
When the flag changes from OFF to ON, it means stop the output. This works with these flags; refer to the
section above for more actions on stop.

When the flag changes from ON to OFF, it means execute the rest of the outputs.

14. The flag for position output axis 1-4 (even-number high-speed pulse output points) in ramp up / ramp down
area.

 SM586

OFF (default): use high-intensity 250 steps to switch to different speeds in the ramp up/ramp down area and the
error rate of switching time is about 10%.
ON:use high-intensity 25 steps to switch to different speeds in the ramp up/ramp down area and the error rate of
switching time is about 1%.

2 - 11 0
Ch a pt er 2 D e v ic es

15. Position control output limit

 SR580-SR595

Positive output limit: set the limit in the software. When the output position is greater than the positive limit, the
output stops immediately.

Negative output limit: set the limit in the software. When the output position is smaller than the negative limit, the
output stops immediately.
_2
When the positive and negative output limits are both 0, the function is disabled. This function works with the output
instructions. The system only checks the limit set in the software when the instruction is executed. Thus the system
does not come to an immediate stop even when it is beyond the output limit. If an immediate stop is needed, using
the external input as the way to check the limit is recommended.

16. Backlash compensation function

 SR478, SR479, SR498, SR499, SR518, SR519, SR538, SR539

For DVP-ES3/EX3/SV3 Series, up to 8 high-speed outputs (Y0-Y7) can be set. For DVP-SX3 Series, up to 6
high-speed outputs (Y0-Y5) can be set. Each output works with a corresponding SR for users to set the output
number for backlash compensations. The setting range is 0-32767. If the setting value is <= 0, this function is
disabled.

 The output instructions that support odd number axis outputs and are directional output by default are JOG,
DZRN, DPLSV, DDRVI, DDRVA, DPPMR, DPPMA, DCICR, DCICA, DCICCR, DCICCA, DCCMR, DCCMA,
DPPGB and TPO. For even number axis outputs, you can use the following instructions JOG, DPLSV, DDRVI
and DDRVA. CSFO instruction is supported by ES3 firmware version 1.04.00 or later and EX3/SV3/SX3 firmware
version 1.00.00 or later.

 If the above-mentioned supported instructions are used and the instruction is stopped right after the output
direction is changed, if the backlash compensation function is enabled under this condition, PLC needs to run the
compensated ones before a real stop. So that there will be no uncompensated backlashes left when the next
output is enabled.

17. Flags to show the output number of the current positioning output in the ramp up / ramp down area.

 SR652-653 (32-bit value)

The output number in the ramp up area: the accumulated output number counted from the acceleration starting
point to the target speed point (not included).

 SR654-655 (32-bit value)

The output number in the ramp down area: the accumulated output number counted from the target speed point
(not included) to the output stopping point.

18. Flags to show the CAN communication quality

 SR823
Hardware receiving error counter for CAN communication: when the error number exceeds 127, it indicates the
hardware error occurrence is too frequent, you need to check the communication cables or adjust the
transmission speed or modify the sample points manually.

2 - 111
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 SR824

Hardware sending error counter for CAN communication: when the error number exceeds 127, it indicates the
hardware error occurrence is too frequent, you need to check the communication cables or adjust the
transmission speed or modify the sample points manually.

_2 19. Ethernet IP related flags

 SM1000, SR1000-SR1016, SR1536~ SR1537

SM/SR Function Action


ON: the values in SR1000–SR1006 are written into the flash
memory. After writing the values, the PLC resets it to OFF.
NOTE 1: do not set the flag to ON continuously to avoid
SM1000 Ethernet setting flag.
damage to the flash memory.
NOTE 2: the PLC must be in STOP state before writing the
values into the flash memory.
SR1000 For example: 192.168.1.5, SR1000 is 16#C0A8 and SR1001
Ethernet IP address (32-bit)
SR1001 is 0105.
SR1002 For example: 255.255.255.0, SR1002 is 16#FFFF, and
Ethernet netmask address (32-bit)
SR1003 SR1003 is FF00
SR1004 For example: 192.168.1.1, SR1004 is 16#C0A8, and
Ethernet gateway address (32-bit)
SR1005 SR1005 is 0101
Unit: second; default: 30 seconds; setting range: 1-32000; if
the setting value exceeds the setting range, when
SR1006 Duration of the TCP connection
When the value exceeds the range, the system treats the
value as the minimum 1 or the maximum 32000.
SR1007 Current Ethernet speed Unit: Mbps
SR1009 Current TCP connection number Number of all the TCP connections
Unit: ms; default: 20 ms; setting range: 0-32000; when the
value exceeds the range, the system treats the value as the
SR1010 Time to restart TCP communication
minimum 0 or the maximum 32000. If the setting value is 0, it
indicates system restarts communication automatically.
SR1011 MODBUS/TCP Server connection number The system is refreshed automatically.
SR1012 MODBUS/TCP Client connection number The system is refreshed automatically.
SR1013 EtherNet/IP Adapter connection number The system is refreshed automatically.
SR1014 EtherNet/IP Scanner connection number The system is refreshed automatically.
Unit: ms; default: 10 ms; setting range: 0-32000; when the
MODBUS/TCP Server packet receiving
SR1015 value exceeds the range, the system treats the value as the
timeout
minimum 0 or the maximum 32000
The delay time for the data to be sent after Unit: ms; default: 10 ms; setting range: 0-1000; when the
SR1016 the connection of Modbus/TCP Client is value exceeds the range, the system treats the value as the
established. (ms) (0-1000) minimum 0 or the maximum 1000
Number of TCP connections through
SR1536 Total number of all current TCP connections
EtherCATport
Number of MODBUS/TCP server
SR1537 Refreshed by the system
connections through EtherCATport

 Ethernet communication quality-related devices are available for ES3/EX3 firmware version 1.04.00 or later and
SV3/SX3 firmware version 1.00.00 or later.

2 - 11 2
Ch a pt er 2 D e v ic es

SR Function Action
Default: 80 packets, setting range: 10-1000; when the value
The maximum number of Ethernet
exceeds the range, the system treats the value as the
SR1017 packets that can be handled in one
minimum 10 or the maximum 1000.
scan cycle.
Register is refreshed by you.
The number of Ethernet packets that Refresh the register every scan cycle by the system.
SR1018
is handled in the last scan cycle. _2
The accumulated number of Ethernet 1. Refresh the register every scan cycle by the system.
SR1019 packets which are dropped after the 2. Register can be cleared to 0 by you.
packets in the buffer zone is full.

Example:
1. Determine the Ethernet communication quality
Step 1: Check if the value in SR1019 is 0.
SR1019 = 0 Good communication quality
SR1019 > 0 Error occurred during communication, go to step 2

Step 2: Check the current values in SR1017 and SR1018


The network load is less than 80%, which indicates the communication quality is good; set
SR1018/SR1017<0.8 the value in SR1019 to 0. If the error occurs from time to time, ask your network administer
to check if there is any device that can cause a communication error in the network.
The network load is equal to 80%, which indicates high-load status.
If the value in SR1019 is NOT 0, it indicates the communication is not normal. You need to
SR1018/SR1017≥ lower the workload of data exchange or adjust the network capacity.
0.8

2. Refresh the network capacity


 When you raise the value in SR1017, the value in SR1019 is not raised accordingly but the ratio of SR1018 to
SR1017 remains greater than 0.8, which indicates that the communication workload is almost full. In this case,
we suggest you continue to raise the value in SR1017 to lower the ratio to under 0.8. You can clear the value in
SR1019 to see if it works whenever you change the value in SR1017.

 When the network traffic is heavy, if you raise the value in SR1017, every 10 more increased value, adds
around 2.2 ms more on the scan time. (the test environment: no extension module, no RTU or data exchange
table.) Therefore, after the value in SR1017 is raised, you need to pay attention on the scan time. If the network
traffic is not too heavy, the value in SR1017 will not affect the scan time too much. However, if the network is
abnormal, CPU uses more resources on the packet handling and that will increase the scan time. You need to
consider the network workload and the scan time, when you set the value in SR1017.

 If the packets cannot be handled in the allowable scan time, you can consider the followings to lower the
network workload.

2 - 11 3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Decrease the network connections with the CPU, for example, decrease the data exchange numbers via
Modbus TCP or EtherNet/IP.
 Lower the refreshing rate in data exchange, for example lessen the refreshing cycle for data exchange via
Modbus TCP, or increase the value in RPI for data exchange via EtherNet/IP.

 SM1090, SM1091, SM1106-SM1109


_2 SM Function Action
SM1090 TCP connection is busy. ON: TCP connection timeout
SM1091 UDP connection is busy. ON: UDP connection timeout
AS-FEN02 Ethernet - Filter Setting When the program is downloaded to the PLC
SM1110
Error
ON: PHY initialization fails.
SM1106 Ethernet connection error
OFF: PHY initialization succeeds.
ON: basic setting error
SM1107 Ethernet basic setting error
OFF: correct basic setting
TCP/UDP socket local port is already
SM1109 ON: the same port in use
used.
For the error codes, the corresponding LED indicators, and other troubleshooting, Refer to Chapter 7 in the
DVP-ES3/EX3/SV3/SX3 Series Hardware and Operation Manual.

20. Email settings

 SM1113, SM1116-SM1155

If the sending an email fails, the flag of the email service error SM1113 is ON.

The following table lists the triggers for sending email and the corresponding flags (SM1116–SM1155).

Item
Trigger 1 Trigger 2 Trigger 3 Trigger 4
Function

SM1116 SM1126 SM1136 SM1146


Email service
ON: enabled, OFF: disabled
SM1117 SM1127 SM1137 SM1147
Email sending
ON: sending email now, OFF: email sent
SM1119 SM1129 SM1139 SM1149
Emails sent successfully
ON: email sent successfully

SM1120 SM1130 SM1140 SM1150


Email sending error 1
The email cannot be sent due to email content error

SM1122 SM1132 SM1142 SM1152


SMTP response timeout
After sending the email, the SMTP server response timeout.

SMTP server response SM1123 SM1133 SM1143 SM1153


error After sending the email, the SMTP server response error.

SM1124 SM1134 SM1144 SM1154


Email sending error 2 of
After sending the email, the size of the attachment exceeds the limit.

2 - 11 4
Ch a pt er 2 D e v ic es

Item
Trigger 1 Trigger 2 Trigger 3 Trigger 4
Function

SM1125 SM1135 SM1145 SM1155


Email sending Error 3
After sending the email, the attachment is not found, SM1125 is ON.

_2
21. Flags and registers concerning data exchange

 Flags for data exchange through COM1 connections

SM Type Function

SM750 R/W Data exchange through COM1 enabled.

SM752–SM783 R/W Connection 1–32 through COM1 for data exchange started.
SM784–SM815 R Data received through COM 1 connection 1–32 for data exchange.
SM816–SM847 R Error in the COM1 connection 1–32 for data exchange.

 Flags for data exchange through COM2 connections

SM Type Function
SM862 R/W Data exchange through COM2 enabled.
SM864–SM895 R/W Connection 1–32 through COM2 for data exchange started.
SM896–SM927 R Data received through COM2 connection 1–32 for data exchange.
SM928–SM959 R Error in the COM2 connection 1–32 for data exchange

 Registers for data exchange through COM1 and COM2 connections

SR Function
SR1335 Actual cycle time of connection 1–32 for data exchange through COM1
Number of the connection that is currently performing a cyclical data exchange
SR1336
through COM1
SR1340–SR1371 Error code for data exchange through the COM1 connection 1–32
SR1375 Actual cycle time of connection 1–32 for data exchange through COM2
Number of connection that is currently performing a cyclical data exchange
SR1376
through COM2
SR1380–SR1411 Error code for data exchange through the COM2 connection 1–32
The error codes 1–7 are the standard response error codes of the Modbus protocol. Error code 9 means timeout.

 Flags for data exchange through Ethernet connections

SM Type Function
SM1167 R/W Data exchange through Ethernet port enabled.
SM1168–SM1183 R/W Connection 1–16 through Ethernet port for data exchange started.
SM1200–SM1215 R Data received through Ethernet port connection 1–16 for data exchange.
SM1232–SM1247 R Error in the Ethernet port connection 1–16 for data exchange
 The following are the registers for data exchange function through the Ethernet port.
SR Description
Actual connection times for data exchange through the Ethernet
SR1120 ~ SR1135
connections 1-16

2 - 11 5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

SR Description

SR1152 ~ SR1167 The error codes for data exchange through the Ethernet
connections 1-16

 The following SM and SR devices for setting the data exchange function through the Ethernet port are available
for ES3 firmware V1.04.30 or later and EX3/SV3/SX3 firmware V1.00.00 or later
_2 SM Attr. Description
SM1092 R/W Error flag: Incorrect communication port No.of Modbus TCP slave

SR Description
SR1092 Communication port No. of Modbus TCP slave (The PLC works as Slave.)
Communication port No. for the Modbus TCP data exchange table (The PLC works as
SR1093
Master.)

Explanation of operation of devices above:


1. When the PLC works as the Modbus TCP slave,
 The port 502 is connected to the remote master by default for the Modbus TCP communication.
 When the target port of the remote master cannot use 502, you can change the value in SR1092 to a
desired port number.
 The setting value in SR1092 is not retainable, which will change back to 502 each time the power is on
again. Please set it in the PLC program when using the device.
 If the port number set in SR1092 is occupied by another function such as Socket or Web, the port
setting is invalid and SM1092 automatically sets to ON.
2. When the PLC works as the Modbus TCP master,
 The default port of the remote slave is 502 for the Modbus TCP communication.
 When the remote slave cannot use 502 as the communication port, you can change the value in
SR1093 to a desired port number.
 The setting value in SR1093 is not retainable, which will change back to 502 each time the power is on
again. Please set it in the PLC program when using the device.
 The setting in SR1093 modifies the number of the expected communication port of the remote slave
only, which does not affect the master’s local port.

 Error codes for Ethernet connections


Error code Description
Remote module response error
16#00XX
Codes 1-7 are standard Modbus TCP protocol error codes
16#F000 Ethernet connection is not established
16#F001 Remote module response timeout

16#F003 TCP connection timeout


16#F007 Response error
16#F009 Connection lost in the remote module

 The list of SM/SR states when connecting to RTU-EN01 through Ethernet port
SM / SR Description
SM1312 - SM1315 The communication state flags of RTU-EN01 connection ID 1-4
SR1312 - SR1315 The communication state codes of RTU-EN01 connection ID 1-4

SR SM state Description
0 OFF Connection closed
1 ON Successful connection

2 - 11 6
Ch a pt er 2 D e v ic es

SR SM state Description
2 OFF Communication timeout
3 OFF Connection closed by force
4 OFF RTU-EN01 response: error in contents
5 OFF RTU-EN01 response: error
6 OFF Network not connected or connection failed
RX & RCR Read data RY & RCR Write data
SM state
OFF  ON
(input mapping area) (output mapping area) _2
Clear to 0 Clear to 0
ON  OFF No change No change
Note: Before the connection is established, it is suggested NOT to use data (RX/RY/RCR Read/RCR Write) in the
mapping area in the CPU.

 Ethernet/IP communication flags are available for PLC FW V1.06 or later.


SM Attr. Ethernet/IP Data Exchange Description
SM1375 R/W Data exchange through EtherNet/IP (Scanner) started.

SM1376 - SM1407 R/W Connection 1-32 for data exchange through EtherNet/IP (Scanner) started

SM1408 - SM1439 R Error in data exchange connection 1-32 through EtherNet/IP (Scanner)
SM1440 - SM1447 R Error in I/O connection 1-8 through EtherNet/IP (Adapter)

SM1448 – SM1455 R I/O connection 1-8 is established through EtherNet/IP (Adapter)

 Ethernet/IP communication registers are available for PLC FW V1.06 or later.


SR Attr. Ethernet/IP Data Exchange Description
Status code of the connection 1-32 for data exchange through EtherNet/IP
SR1020 - SR1051 R
(Scanner)

 Ethernet/IP communication error codes are listed below. Refer to Chapter 9 in ES3/EX3/SV3/SX3 Series Hardware
and Operation Manual for more details.
Error Code Description
16#0100 I/O connections duplicated
16#0106 Scanner ownership of I/O connections conflicts
16#0110 Incorrect adapter configuration
16#0111 Adapter RPI not supported
16#0113 Insufficient I/O connections
16#0119 The connection of non-Listen only is not established.
16#0127 Incorrect adapter input size
16#0128 Incorrect adapter output size
16#012D Consumed TAG does not exist.
16#012E Produced TAG does not exist.
16#0204 I/O connection connecting timeout
16#0302 Network bandwidth NOT available for data
16#0315 Incorrect adapter input/output instance
16#0203 I/O connection communication timeout

22. Number of points & units and model code of extension modules
 SM227 and SR1553 - SR1555 for auto-checking points and units of extension modules when power on

2 - 11 7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

You can set SM227 to ON and use SR1553, SR1554, SR1555 to check if the parameters of the extension module
DI/DO and the number of the connected modules are correct, once the CPU is supplied with power. If the result is
incorrect, the CPU stops running and stores the error (16#1414) in SR180 and SM10 = ON.
 SM228 and D2800 - D28079 for the data exchange with special modules on the right of the CPU
When SM228 is OFF, the data in the special modules are automatically read and written in D2800-D28079 after the
CPU is supplied with power.
_2 See the example below to learn how this works for ES3 series.
Arrangement
order of
1 2 3 4 5 6
right-side
modules
Model DVP02PU-E2 DVP06XA-E2 DVP04DA-E2 DVP04TC-E2 DVP04PT-E2 DVP06PT-E2
Devices for
storing data D28000 ~ D28010 ~ D28030 ~ D28040 ~ D28050 ~
N/A
read from the D28001 D28013 D28033 D28043 D28055
module
Devices for
storing data to (D28014 - (D28020 -
N/A N/A N/A N/A
write to the D28015) D28023)
module
Reading
values from Reading
D28000: the values from Reading Reading Reading
Writing values
input value of AD channels values from values from values from
Action into DA
X point and 1-4; writing TC channels PT channels PT channels
channels 1-4
D28001: the values into DA 1-4 1-4 1-6
code of the channels 1-2
axis state
When SM228 is ON, the PLC CPU will disable the data exchange function with the module.

The following is the list of state codes for the PU module.


State Code
Description Axis 1-2
Byte #
0 Error flag
1 The output is active.
2 The output has stopped working.
3 The instruction execution is complete.
Axis 1
4 The positive limit is reached.
5 The negative limit is reached.
6 Current position value overflow
7 Pulse direction (positive or negative)
8 Error flag
9 The output is active.
10 The output has stopped working.
11 The instruction execution is complete.
Axis 2
12 The positive limit is reached.
13 The negative limit is reached.
14 Current position value overflow
15 Pulse direction (positive or negative)

The corresponding error flag will be ON when the above mentioned incidents happened: 4/12, 5/13, 6/14. Once the error
flag is ON, you need to use the API instruction to clear the shown error codes.

2 - 11 8
Ch a pt er 2 D e v ic es

 SM265 and D29000~D29079 for the data exchange function of the analog modules on the left side of the CPU
When SM265=OFF, the CPU module will automatically read key data from the analog modules on its left side and
write them to D29000~D29079 after the power is on. The relations between devices and corresponding modules
are shown in the following table.
1
Arrangement
(the one
order of left-side 2 3 4 5 6
closest to the
modules
CPU)
Model (DVP) 04AD-SL 04DA-SL COPM-SL 04AD-SL EN01-SL 04DA-SL _2
Devices for storing
D29000 ~ D28030 ~
data read from N/A N/A N/A N/A
D29003 D28033
modules
Devices for storing
D28010 ~ D28050 ~
data to write to N/A N/A N/A N/A
D28013 D28053
modules
Read Read
Write output write output
conversion temperature
Actions value of DA values of DA
values of AD values of AD
channels 1-4. channels 1-4
channels 1-4 channels 1-4
When SM265=ON, the CPU disables the function of data exchange with its left-side special modules.
 SR1544~SR1551 for storing device codes of special modules on the left of the CPU
SR Description
SR1543 Number of special modules connected on the left of the CPU module
SR1544~SR1551 Displays the device codes of the 1st to 8th modules on the left of the CPU module

Special modules on the left of SV3/SX3 series CPU and their device codes
Model (DVP) 04AD-SL 04DA-SL 01LC-SL 02LC-SL
Device code 16#4400 16#4401 16#4106 16#4206
Model (DVP) EN01-SL SCM12-SL SCM52-SL 02PU-SL
Device code 16#4050 16#4041 16#4042 16#4207
Model (DVP) 201LC-SL 202LC-SL 211LC-SL -
Device code 16#5106 16#5206 16#5906 -
Model (DVP) COPM-SL DNET-SL Reserved for fieldbus modules
Device code 16#4133 16#4131 16#4130~16#413F

 Descriptions of the values in SR1560-SR1568


SR Description
SR1560 Number of the right-side modules connected to the CPU module
SR1561-SR1568 Model code of the 1st – 8th right-side module connected to the CPU module

ES3/EX3 series special modules and their device codes:


Model (DVP) 04AD-E2 04DA-E2 02DA-E2 06XA-E2
Device code 16#0080 16#0081 16#0041 16#00C4
Model (DVP) 04PT-E2 04TC-E2 06PT-E2 02PU-E2
Device code 16#0082 16#0083 16#00C2 16#0045

SV3/SX3 series special modules and their device codes:


Model (DVP) 04AD-S 06AD-S 04AD-S2 04DA-S
Device code 16#0088 16#00C8 16#0090 16#0089
Model (DVP) 02DA-S 04DA-S2 06XA-S 06XA-S2
Device code 16#0049 16#0091 16#00CC 16#00D4
Model (DVP) 04PT-S 06PT-S 04TC-S 08NTC-S
Device code 16#008A 16#00CA 16#008B 16#010D
Model (DVP) 02TUN-S 02TUR-S 02TUL-S 01PU-S
Device code 16#024F 16#034F 16#014F 16#0110

2 - 11 9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

23. Auto-reset flags for pulse output

 While executing the pulse output instructions, to avoid the control over the same pulse output device is taken
repeatedly by different type or different triggered output instructions. PLC auto-reset the right to control the
pulse instruction to the first executed instruction till the assigned instruction is completely stopped. Because of
the unique characteristic, PLC scan cannot detect if the pulse instruction is stopped when you use the pulse
output instruction in the ST language, interrupt subroutine or one-time function block. Therefore, the right to
_2 control the pulse instruction is kept and any ongoing instructions can neither be executed nor outputted
normally.
 To free the right to execute other pulse output instructions, you can use the auto-reset flags for the PLC to
check if the output is complete.
Note: you can set the auto-reset flags to ON and once the output is complete, the flag resets to OFF automatically.

Even number axis for output Y0 Y2 Y4 Y6


Auto-reset when the output is complete. SM470 SM490 SM510 SM530
Odd number axis for output Y1 Y3 Y5 Y7
Auto-reset when the output is complete. SM475 SM495 SM515 SM535

 List of pulse output instructions related to the auto reset:


Even Odd
Auto-reset
Instruction number numbe Auto-reset flag Remarks
timing
axis r axis
PWM/DPWM V V  No need to set up the
number of pulses to
JOG/DJOG V V output.
 It is suggested to use in
DPLSV V V applications that the
Auto-reset instruction is stopped
DPPGB V Yes
flag is ON and the instruction will
not be scanned again.
(for example ST
CSFO V language programming,
interrupts, and one-time
function block).
PLSR V V
PLSY V V
DDRVI V V  Need to set up the
DDRVA V V number of pulses to
DDRVM V output.
Auto-reset
 Directional output
DPPMR V flag is ON,
instructions with
DPPMA V Yes and pulse
positive/negative limits
DCICR V output is
 For more than two axes,
DCICA V complete.
each axis requires an
DCICCR V auto-reset flag; one axis,
DCICCA V one auto-reset flag.
DCCMR V
DCCMA V
 The instruction must be
DZRN V
Yes scanned and monitored
(supported by each time
Auto-reset
ES3 firmware  It is suggested that you
flag is ON
V1.06.00 or later should not use it in the
and the
and function block which is
output
DZRN2 V V EX3/SV3/SX3 called only once.
completion
firmware  In the ST programming
flag is ON
V1.00.00 or language, the auto-reset
later) flag is needed to disable
the instruction.

2-120
Ch a pt er 2 D e v ic es

Example 1 (used in function blocks or interrupts)


POU

_2
Function block (FB) or interrupts:

Explanation
A. When M0 is ON, Y0 outputs 1000 pulses at 1kHz, and set SM470 on Y0.
B. When Y0 output is complete, PLC frees the right for the Y0 to be ready again.
C. When M0 is from OFF to ON again, Y0 output can start again.

Example 2 (used in ST programming language)

Explanation
A. When M0 is ON, Y0 outputs 1000 pulses at 1kHz, and set M1 to ON to record Y0 is taken.
B. When M0 is OFF, once Y0 output is complete, SM461 is ON. IF M1 is ON, it triggers the auto-reset flag of Y0
(SM470=ON) and PLC frees the right for the Y0 to be ready again.
C. When M0 is from OFF to ON again, Y0 output can start again.

24. Auto-rest flags for Delta CAN communication

 While executing the CAN instructions, to avoid the control over the same ID of Servo/Inverter is taken
repeatedly by different type or different triggered CAN instructions. PLC assigns the right to control the pulse
instruction to the first executed instruction till the assigned instruction is completely stopped. Because of the
unique characteristic, PLC scan cannot detect if the CAN instruction is stopped when you use the CAN
instruction in the ST language, interrupt subroutine or one-time function block. Therefore, the right to control the
CAN instruction is kept and any ongoing instructions can nether be executed nor control the servo/inverter
normally.

2-121
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 To free the right to execute other CAN output instructions, you can use the auto-reset flags for the PLC to check
if the communication between Delta Servo or Delta Moto is complete.
Note: you can set the auto-reset flags to ON and once the CAN communication is complete, the flag resets to
OFF automatically.

Delta Servo
1 2 3 4 5 6 7 8
Station ID
Auto-reset the
_2 right to execute
SM1581 SM1582 SM1583 SM1584 SM1585 SM1586 SM1587 SM1588
other CAN
instructions.
Delta Inverter
21 22 23 24 25 26 27 28
Station ID
Auto-reset the
right to execute
SM1601 SM1602 SM1603 SM1604 SM1605 SM1606 SM1607 SM1608
other CAN
instructions.

 List of CAN communication instructions:


Delta Delta Auto-reset
Instruction Auto-reset timing Remarks
Servo inverter flag
INITC V V
ASDON V V
CASD V V
DDRVIC V
DDRVAC V
DPLSVC V V Yes Auto-reset flag is ON
ZRNC/DZRNC V
RSTD V V
DCSFOC V
DTQC V V
DTQLC V V
ZRNM V
EMER V V
COPRW V V Instructions will be
COPWL/DCOPWL V V scanned and
N/A
ECAMD V monitored; no need
DECAMS V for an auto-reset flag.
ECAMA V
ECAMC V

Example 1 (used in function blocks)

POU:

2-122
Ch a pt er 2 D e v ic es

FB:

_2

Explanation

A. When M0 is ON, Servo #1 runs to the relative position 10000 PUU at the speed of 100.0 r/min. And set M1 to ON to
record that communication right of Servo#1 is taken.
B. When SM1631 is ON (positioning completed) and M1 is ON, trigger SM1581 to ON to have the PLC free the
communication right for Servo #1.
C. When M0 is from OFF to ON again, Servo #1 is ready to positioning again.

Example 2 (used in ST programming language)

Explanation
A. When M0 is ON, Servo #1 runs to the relative position 10000 PUU at the speed of 100.0 r/min. And set M1 to ON to
record that communication right of Servo#1 is taken.
B. When M0 is OFF, SM1631 ON (positioning completed) and M1 ON, trigger SM1581 to ON to have the PLC free the
communication right for Servo #1.
C. When M0 is from OFF to ON again, Servo #1 is ready to positioning again.

25. Use DPLSY in high-speed comparison interrupt (I2xx), available for ES3 FW V1.04.00 or later and
EX3/SV3/SX3 FW V1.00.00 or later.

Examples of the PLC program:


 Start the instructions of high speed counter (DCNT) and high speed comparison (DHSCS) in the program cycle.

2-123
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_2

Note: When M0 is ON, HC200 high-speed counter is started. When the counted value in S2 reached 50, the
high-speed comparison interrupt I200 is triggered.

 Write an instruction DPLSY in the high-speed comparison interrupt I200.

Note: Auto-reset the control when outputting 1000 pulses at 1kHz frequency from Y0. is complete.

 The procedure
There are four procedures A-D, when the input counted value changes 49 -> 50 to output the pulses through Y0.

A. The input counted value changes from 49 to 50.


B. The high-speed comparison interrupt is triggered. The PLC program is interrupted and the high-speed
comparison interrupt is executed.
C. Execute instruction DPLSY that is written in the high-speed comparison interrupt.
D. Pulses are outputted from Y0.
Since the interrupt is affected by the time it is triggered and by the PLC on-going executions, such as IO points refreshing,
communication implementing and so forth, the time when the pulses to be outputted can be greatly delayed.

 To improve the execution time (A to D procedure), new SM flags are added for ES3/EX3/SV3/SX3 series CPU.
The corresponding numbers of high-speed comparison interrupt to the newly added SMs are listed below.
Number of the high-speed To pre-store the parameters for To enable triggering DPLSY in
comparison interrupt DPLSY to output the interrupt to output pulses
I200 SM120 SM360
I201 SM121 SM361
I202 SM122 SM362
I203 SM123 SM363
I210 SM124 SM364

2-124
Ch a pt er 2 D e v ic es

Number of the high-speed To pre-store the parameters for To enable triggering DPLSY in
comparison interrupt DPLSY to output the interrupt to output pulses
I211 SM125 SM365
I212 SM126 SM366
I213 SM127 SM367
I220 SM128 SM368
_2
I221 SM129 SM369
I222 SM130 SM370
I223 SM131 SM371
I230 SM132 SM372
I231 SM133 SM373
I232 SM134 SM374
I233 SM135 SM375
I240 SM136 SM376
I241 SM137 SM377
I242 SM138 SM378
I243 SM139 SM379
I250 SM140 SM380
I251 SM141 SM381
I252 SM142 SM382
I253 SM143 SM383
I260 SM144 SM384
I261 SM145 SM385
I262 SM146 SM386
I263 SM147 SM387
I264 SM148 SM388
I265 SM149 SM389
I266 SM150 SM390
I267 SM151 SM391

Note1: SM120-SM151: To pre-store the parameters for DPLSY to output


Set the SM in this category to ON to save the DPLSY to-be-outputted parameters, including output point number, target
frequency and number of pulses to the PLC flash memory. When the high-speed comparison interrupt is triggered and any
of the SM360-391 is set to ON, the output can be started right away. Once any of SM120-151 is used, it is set to OFF. You
need to set it to ON before using it again.

Note2: SM360-SM391: To enable triggering DPLSY in the interrupt to output pulses


When the high-speed comparison interrupt is triggered and any of the SM360-391 is set to ON, the output can be started
right away to output any of the SM120-151 stored DPLSY parameters. Auto-reset the control, after the output is complete.

Use the above-mentioned new SM in the PLC program.

2-125
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_2

Explanation
Set M0 to ON to trigger SM120 to ON to save the DPLSY to-be-outputted parameters (outputting 1000 pulses at 1kHz
frequency) to the PLC flash memory.
Stat HC200 high-speed counter and set SM360 to ON. When the counted value in S2 reached 50, the high-speed
comparison interrupt I200 is triggered. The moment when the interrupt is triggered, Y0 starts to output 1000 pulses at
1kHz frequency.
 The high-speed comparison interrupt I200

Explanation
Since the execution of high-speed output has been completed in POU, there is no need to write any program in the
interrupt.

26. Use backlash compensation in CSFO (available for ES3 FW V1.04.00 or later and EX3/SV3/SX3 FW V1.00.00
or later.)

PLC uses the propositional conversion formula to converse the frequency and pulse numbers for inputs into what are
suitable for outputs. From input to output, this process not only takes time and it may also cause backlash issues. When
the number of pulses run through the input goes larger, so does the backlash.
To precise operation, use the following SM/SR to compensate for backlashes caused by a longtime CSFO operation.

2-126
Ch a pt er 2 D e v ic es

Output axis designated by Flag to activate the backlash Increase the frequency to
CSFO compensation compensate backlashes (Hz)
Y0 / Y1 SM1700 SR1700
Y2 / Y3 SM1701 SR1702
Y4 / Y5 SM1702 SR1704
Y6 / Y7 SM1703 SR1706

 SM1700-1705: Flag to activate the backlash compensation _2


ON: To increase the actual output frequency and the number of output pulses to close the distance between the
position of input and output. The compensation stops automatically once the positions of input and output are the
same. You can also set this flag to OFF, if the positions of input and output do not need to be the same.

OFF: To decrease the actual output frequency and the number of output pulses to stop compensating till the output
falls behind to its original delayed position.

NOTE: Be sure to close the flag to deactivate the compensation before stopping the execution of CSFO. If not, you
may find the compensated output is still running even after the execution of CSFO has stopped.

 SR1700-1710: Increase the frequency to compensate backlashes


You can define the frequency, ranging from 50 Hz-10 KHz (unit: 50 Hz) for the compensation of the backlashes. At
first, it is recommended to try a lower frequency. Otherwise, sudden and quick movements may have an impact on
the mechanism operation. The compensation stops automatically once the positions of input and output are the
same. The frequency unit is 50 Hz; thus, if using 80 Hz, it will be seen as 50 Hz and 120Hz will be treated as 100
Hz.
The illustration of using backlash compensation in CSFO.
Number of pulses

Frequency Black Line: Input


Green Line: output
The ratio of the number of input and output pulses is 1:1.
The timings are shown as , , , . See the explanations below.

:Since the number of pulse runs through input is large and the input frequency is fast, the output cannot catch up with
it, the distance between input and output grows bigger and bigger. The backlash compensation has not started yet.
:Enable the flag to activate the backlash compensation. Increase the number of output pulses according to the
frequency of input and compensation till the positions of input and output are the same.
:Disable the flag to deactivate the backlash compensation. Decrease the actual output frequency and number of output
pulses to stop compensating till the output falls behind to its original delayed position.
:When the flag to activate the backlash compensation is enabled or disable, the PLC calculates and to increase or
decrease the output frequency to enhance the smoothness of the compensation.

2-127
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The example here shows if the current output frequency is 1 KHz and the compensated frequency is 100 Hz, the actual
output frequency should be around 1.1 KHz.

27. Reading MAC address of DVPEN01-SL (applicable to SV3/SX3 series only)

To read the MAC address of a DVPEN01-SL module, you need to use SM264 with the device SR1596 for setting the
module number, and the read result is stored in SR1597 to SR1599.
_2 Example:
 Enter K101 in SR1596 to read the MAC address of the second module EN01 on the left side of the PLC CPU.
 After SM264 is set to ON, PLC stores the MAC address of the EN01 module in SR1597 to SR1599.
 For example, EN01’s MAC address is 11:22:33:44:55:66, you can see SR1597=0x1122, SR1598=0x3344 and
SR1599=0x5566.

28. Combing all the connections of Ethernet data exchange with the same IP address into one connection

SM Attri. Description
Enable all the connections of Ethernet data exchange with the same IP address
SM1037 R/W
to be combined into one connection.

Operation:

1. When the PLC CPU acts as Modbus TCP Master, the connection mode can be set for the execution of data
exchange instructions. It is available for ES3 CPU FW V1.08.00 or later and EX3/SX3/SV3 CPU FW V1.00.00
or later.

2. Modes:

 SM1037=OFF: Independent connection mode (default). It is suitable for applications with many slaves.
In this mode, each data exchange takes one TCP connection. For example, when the device A (IP
address 192.168.1.20) has 5 pieces of data to do data exchange, there will be 5 TCP connections to
perform data exchange, one connection for one data exchange instruction.
 SM1037=ON: Combined connections with the same IP address into one connection. It is suitable for
applications without many slaves.
In this mode, all the connections with the same IP address can be combined into one TCP connection.
For example, when the device A (IP address 192.168.1.20) has 5 pieces of data to do data exchange
with the device B (IP address 192.168.1.30), there will be only one combined TCP connection to
perform 5 data exchange instructions, one by one, according to their order.

3. When to use:

 SM1037=OFF: Independent connection mode (default): For this mode, multiple instructions can be
executed at the same time with no need to wait for other instructions to complete. That means you can
set multiple instructions for the device at a time; however, it will take more than one TCP connection to
complete the tasks. This mode will satisfy most of the employments.
 SM1037=ON: Combined connections with the same IP address into one connection. This mode is great
for the application that requires more TCP connections than the system can process. For example if the
number of TCP connections for the slave is limited to 2 but you need to create 3 data exchange, this
mode can help. This mode reduces the number of TCP connections between Master and Slave. But
you will need to wait for the previous instruction to compete before the next one can proceed. Thus the
transmission efficiency for the application with data exchanges will be affected and so does the
response time of the slave.

2-128
Ch a pt er 2 D e v ic es

4. Things to note:

 SM1037 is not retainable. You will need to set SM1037 again after power-off. Write SM1037=ON in your
PLC program after each power-off, if you need this function to be enabled.
 If setting SM1037 during the data exchange, the original data exchange connection will be cut off. A new
connection needs to be established again.

_2
29. Not taking the pulses in the ramp-up and ramp-down area (under 1K Hz) into account.

SM Attri. Description
The graph of pulse output acceleration and deceleration does NOT take the
SM589 R/W pulses in the ramp-up and ramp-down area (under 1K Hz) into account.
(applicable to axes 1 to 4)

Operation

The graph is created according to the start frequency (e.g. SR463), the target frequency, the number of output pulses,
acceleration time (e.g. SR464), and deceleration time (e.g. SR465). The actual pulse output starts at the start frequency,
accelerates to the target frequency and then decelerates to the end frequency. The section from the start frequency to 1 K
Hz and from 1K Hz to the end frequency is called the ramp-up and ramp-down area.

During the execution of the following instructions DPLSR, DDRVI, DDRVA, DDRVM, DPPMR, DPPMA, or TPO, you can
set SM589 to ON to leave out the ramp-up and ramp-down areas when creating a graph of acceleration and deceleration.

Example

Start frequency: 200 Hz, Target frequency: 5K Hz, Number of output pulses: 900, Acceleration time: 200 ms, Deceleration
time: 200 ms

SM589 = OFF: The ramp-up and ramp-down areas are marked in a green circle.

SM589 = ON

2-129
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2.2.17 Index Register (E)


The Index register is a 16-bit data register. It is similar to the General register in that data can be read from it and written to
it; however, it is mainly used as the index register. The range of index registers is E0–E9. Refer to Section 4.4 in the
DVP-ES3/EX3/SV3/SX3 Series Programming Manual for more information about using index registers.

_2
2.2.18 File Registers (FR)
 The DVP-ES3/EX3/SV3/SX3 Series PLC provides you with File registers for storing larger numbers of parameters.

 You can edit, upload, and download the parameters in the File registers through ISPSoft/DIADesigner.

 You can read the values in File registers while operating the PLC. Refer to the MEMW instruction (API 2303) in the
DVP-ES3/EX3/SV3/SX3 Series Programming Manual for more information about how to write to the File registers.

2-130
3
Chapter 3 Instruction Tables

Table of Contents

3.1 Types of Instructions......................................................................... 3-2


3.1.1 Basic Instructions .......................................................................... 3-2
3.1.2 Applied Instructions ....................................................................... 3-2

3.2 Understanding Instruction Tables ..................................................... 3-3


3.2.1 Basic Instructions .......................................................................... 3-3
3.2.2 Applied Instructions (Sorted numerically) ......................................... 3-4
3.2.3 Applied Instructions (Sorted Alphabetically) ...................................... 3-5
3.2.4 Device Tables ................................................................................ 3-6

3.3 Lists of Basic Instructions ................................................................. 3-7

3.4 Lists of Applied Instructions ............................................................ 3-10


3.4.1 Applied Instructions (Sorted numerically by API number) ...................3-10
3.4.2 Applied Instructions (Sorted Alphabetically) .....................................3-47

3-1
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3.1 Types of Instructions


Instructions used in the DVP-ES3/EX3/SV3/SX3 Series PLC include basic instructions and applied instructions.

3.1.1 Basic Instructions


Classification Description
Instructions such as loading the contact, connecting the contact in series, and
Contact instructions
connecting the contact in parallel
Output instructions Bit device output; pulse output
Master control Instructions Setting and resetting the master control

_3 Rising-edge/Falling-edge Triggering the instructions that load the contact, connect the contacts in series, and
detection contact instructions connect the contacts in parallel
Rising-edge/Falling-edge
Bit device differential output
differential output instructions
Other instructions Other instructions

3.1.2 Applied Instructions


API Classification Description
0000-0083 Comparison instructions Comparisons such as =, <>, >, >=, <, <=
Using binary numbers or binary-coded decimal numbers to add,
0100-0127 Arithmetic instructions
subtract, multiply, or divide
Converting a binary-coded decimal number into a binary number,
0200-0222 Data conversion instructions
and converting a binary number into a binary-coded decimal number
0300-0310 Data transfer instructions Transfer the specified data
0400-0402 Jump instructions Control jumps to a different part of the program
Program execution
0500-0504 Enabling or disabling the interrupt
instructions
0600-0602 I/O refreshing instructions Refreshing the I/O
Instructions such as those that apply to the counters, the teach
0700-0712 Miscellaneous instructions
mode timers, and the special timers
0800-0817 Logic instructions Logical operations such as logical addition and logical multiplication
0900-0904 Rotation instructions Rotating/Shifting the specified data
1000-1018 Basic instructions Timer instructions and counter instructions
1100-1115 Shift instructions Shifting the specified data
1200-1229 Data processing instructions 16-bit data processing such as decoding and encoding
Structure creation
1300-1302 Nested loops
instructions
Reading the data from a specific module and writing the data into a
1400-1430 Module instructions
specific module
Floating-point number
1500-1517 Floating-point number operations
instructions
1600-1608 Real-time clock instructions Reading and writing, adding, subtracting and comparing the time
1700-1704 Peripheral instructions I/O points connected to the peripheral
1806-1821 Communication instructions Controlling the peripheral though communication
Watchdog timer, program delay timer, pulse width, and index
1900-1906 Other instructions
registers

3-2
C ha pt er 3 I ns tr uc t i o n Tab l es

API Classification Description


Conversion between binary or binary-coded decimal numbers and
String processing ASCII codes; conversion between binary numbers and strings;
2100-2123
instructions conversion between floating-point numbers and strings; string
processing
2200-2213 Ethernet instructions Controlling the Ethernet data exchange
Memory card / File register Reading the data from the memory card / file register and writing the
2300-2304
instructions data to the memory card / file register
2400-2401 Task control instructions Controlling tasks in the program
Sequential function charts
2500-2502 Controlling the SFC instructions
(SFC) instructions
High-speed output
2700-2724
instructions
High-speed output and position control instructions
3_
Delta special CANopen and
CANopen and EtherCAT communication instructions especially for
2800-2823 EtherCAT communication
Delta devices
instructions

3.2 Understanding Instruction Tables


This section describes the table format that this chapter and the rest of this manual uses to describe each instruction. The
format is different depending on the type of instruction: Basic or Applied.

3.2.1 Basic Instructions


This section describes the table format that this chapter uses to describe basic instructions in Section 3.3.

Description:

: The instruction name

: The symbol for the instruction in the ladder diagram in ISPSoft/DIADesigner

: The function of the instruction

: The operands supported by the instruction

3-3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3.2.2 Applied Instructions (Sorted numerically)


This section describes the table format that this chapter uses to describe applied instructions (sorted by API number) in
Section 3.4.1.

_3

Description:

: The applied instruction number

: The instruction name

: If a 16-bit instruction can be used as a 32-bit instruction, add a D in front of the 16-bit instruction to form the 32-bit
instruction.

:  indicates that you can use the instruction as a pulse instruction, whereas ─ indicates that it cannot be used as a
pulse instruction. For pulse instructions, add a P in back of the instruction.

: The symbol for the instruction in the ladder diagram in ISPSoft/DIADesigner

: The function of the instruction

: For single-precision floating-point instructions (32-bit), an F appears in the instruction.

3-4
C ha pt er 3 I ns tr uc t i o n Tab l es

3.2.3 Applied Instructions (Sorted Alphabetically)


This section describes the table format that this chapter uses to describe applied instructions (sorted alphabetically) in
Section 3.4.2.

3_

Description:

: The initial of the instruction name

: The applied instruction number

~:The instruction names

If the 16-bit instruction can be used as the 32-bit instruction, add a D in front of the 16-bit instruction to form the 32-bit
instruction.

: indicates that you can use the instruction as a pulse instruction, whereas ─ indicates that it cannot be used as a
pulse instruction. For the pulse instruction, add a P at the end of the instruction.

: The function of the instruction

3-5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3.2.4 Device Tables


This section describes the table format used in the rest of this manual to describe each instruction.

_3

Description:

: The applied instruction number

: The instruction name

If the 16-bit instruction can be used as the 32-bit instruction, add a D in front of the 16-bit instruction to form the 32-bit
instruction.

: The operand

: The function of the instructions

: The devices that are supported by the operand

1. The decimal forms are indicated by “K”, but you enter them directly in ISPSoft/DIADesigner. For example, enter
the decimal number 30 in ISPSoft/DIADesigner.
2. The hexadecimal forms are indicated by 16#. For example, the decimal number 30 is represented by 16#1E in
the hexadecimal system.
3. The floating-point numbers are indicated by “F” or ”DF”, but they are represented by decimal points in ISPSoft
/DIADesigner. For example, the floating-point number F500 is represented by 500.0 in ISPSoft/DIADesigner.
4. The strings are indicated by “$”, but they are represented by quotes (“ ”) in ISPSoft/DIADesigner. For example,

3-6
C ha pt er 3 I ns tr uc t i o n Tab l es

the string 1234 is represented by “1234” in ISPSoft/DIADesigner.


5. ○: The hollow circle
Indicates that the device cannot be modified by an index register.
6. ●: The solid circle
Indicates that the device cannot be modified by an index register.
:The unit of the operand

:The format of the instruction

Indicates whether the instruction can be used as a pulse instruction, a 16-bit instruction, or a 32-bit instruction.

:The symbol for the instruction in the ladder diagram in ISPSoft/DIADesigner.


3_

3.3 Lists of Basic Instructions


 Contact instructions

Instruction
Symbol Function Operand
code

LD

Loading contact A/Connecting


AND contact A in series/Connecting DX, X, Y, M, SM, S, T, C, HC, D
contact A in parallel

OR

LDI

Loading contact B/Connecting


ANI contact B in series/Connecting DX, X, Y, M, SM, S, T, C, HC, D
contact B in parallel

ORI

 Output instructions

Instruction Execution
Symbol Function Operand
code condition

OUT Driving the coil DY, Y, M, SM, S, T, C, HC, D

Keeping the
SET DY, Y, M, SM, S, T, C, HC, D
device on

3-7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Master control instructions

Instruction
Symbol Function Operand
code

MC Setting the master control N

MCR Resetting the master control N

_3  Rising-edge/Falling-edge detection contact instructions

Instruction code Symbol Function Operand Instruction code

LDP Starting the


rising-edge
detection/Connecti
ng the rising-edge
ANDP DX, X, Y, M, SM, S, T, C, HC, D
detection in
series/Connecting
the rising-edge
ORP detection in parallel

LDIP Starting the


Rising-edge
Non-Active
ANIP detection DX, X, Y, M, SM, S, T, C, HC, D
/Connecting it in
series/Connecting it
ORIP in parallel

PED Starting the


rising-edge
detection/Connecti
ng the rising-edge
APED X, Y,M, SM, S, T, C, HC, D
detection in
series/Connecting
the rising-edge
OPED detection in parallel

LDF Starting the


falling-edge
detection/Connecti
ng the falling-edge
ANDF DX, X, Y, M, SM, S, T, C, HC, D
detection in
series/Connecting
the falling-edge
ORF detection in parallel

3-8
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Symbol Function Operand Instruction code

LDIF Starting the


Falling-edge DX、X、Y、M、SM、S、T、C、HC、
Non-Active D
ANIF detection
/Connecting it in
series/Connecting it
in parallel DX、X、Y、M、SM、S、T、C、HC、
ORIF
D

NED Starting the


falling-edge
detection/Connecti 3_
ng the falling-edge
ANED X, Y,M, SM, S, T, C, HC, D
detection in
series/Connecting
the falling-edge
ONED detection in parallel

 Rising-edge/Falling-edge differential output instructions

Execution
Instruction code Symbol Function Operand
condition

Rising-edge
PLS Y, M, SM, S
differential output

Falling-edge
PLF Y, M, SM, S
differential output

 Other instructions

Instruction code Symbol Function Operand


Inverting the logical
INV ─
operation result
The circuit is rising
NP ─
edge-triggered.
The circuit is falling
PN ─
edge-triggered.
The circuit is rising
FB_NP Y, M, S, D
edge-triggered.
The circuit is falling
FB_PN Y, M, S, D
edge-triggered.

3-9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3.4 Lists of Applied Instructions


3.4.1 Applied Instructions (Sorted Numerically by API number)
 Comparison instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing values
0000 LD= DLD= ─ ON: S1=S2 V V
OFF: S1≠S2
_3 Comparing values
0001 LD<> DLD<> ─ ON: S1≠S2 V V
OFF: S1=S2
Comparing values
0002 LD> DLD> ─ ON: S1>S2 V V
OFF: S1≦S2
Comparing values
0003 LD>= DLD>= ─ ON: S1≧S2 V V
OFF: S1<S2
Comparing values
0004 LD< DLD< ─ ON: S1<S2 V V
OFF: S1≧S2
Comparing values
0005 LD<= DLD<= ─ ON: S1≦S2 V V
OFF: S1>S2
Comparing values
0006 AND= DAND= ─ ON: S1=S2 V V
OFF: S1≠S2
Comparing values
0007 AND<> DAND<> ─ ON: S1≠S2 V V
OFF: S1=S2
Comparing values
0008 AND> DAND> ─ ON: S1>S2 V V
OFF: S1≦S2
Comparing values
0009 AND>= DAND>= ─ ON: S1≧S2 V V
OFF: S1<S2
Comparing values
0010 AND< DAND< ─ ON: S1<S2 V V
OFF: S1≧S2
Comparing values
0011 AND<= DAND<= ─ ON: S1≦S2 V V
OFF: S1>S2

3-10
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing values
0012 OR= DOR= ─ ON: S1=S2 V V
OFF: S1≠S2
Comparing values
0013 OR<> DOR<> ─ ON: S1≠S2 V V
OFF: S1=S2
Comparing values
0014 OR> DOR> ─ ON: S1>S2 V V
OFF: S1≦S2
3_
Comparing values
0015 OR>= DOR>= ─ ON: S1≧S2 V V
OFF: S1<S2
Comparing values
0016 OR< DOR< ─ ON: S1<S2 V V
OFF: S1≧S2
Comparing values
0017 OR<= DOR<= ─ ON: S1≦S2 V V
OFF: S1>S2
Comparing floating-point
numbers
0018 ─ FLD= ─ V V
ON: S1=S2
OFF: S1≠S2
Comparing floating-point
numbers
0019 ─ FLD<> ─ ON: S11≠S2 V V

OFF: S1=S2
Comparing floating-point
numbers
0020 ─ FLD> ─ ON: S1>S2 V V

OFF: S1≦S2
Comparing floating-point
numbers
0021 ─ FLD>= ─ ON: S1≧S2 V V

OFF: S1<S2
Comparing floating-point
numbers
0022 ─ FLD< ─ ON: S1<S2 V V

OFF: S1≧S2
Comparing floating-point
numbers
0023 ─ FLD<= ─ ON: S1≦S2 V V

OFF: S1>S2

3 - 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing floating-point
numbers
0024 ─ FAND= ─ V V
ON: S1=S2
OFF: S1≠S2
Comparing floating-point
numbers
0025 ─ FAND<> ─ ON: S1≠S2 V V

OFF: S1=S2

_3 Comparing floating-point
numbers
0026 ─ FAND> ─ ON: S1>S2 V V

OFF: S1≦S2
Comparing floating-point
numbers
0027 ─ FAND>= ─ ON: S1≧S2 V V

OFF: S1<S2
Comparing floating-point
numbers
0028 ─ FAND< ─ ON: S1<S2 V V

OFF: S1≧S2
Comparing floating-point
numbers
0029 ─ FAND<= ─ ON: S1≦S2 V V

OFF: S1>S2
Comparing floating-point
numbers
0030 ─ FOR= ─ V V
ON: S1=S2
OFF: S1≠S2
Comparing floating-point
numbers
0031 ─ FOR<> ─ ON: S1≠S2 V V

OFF: S1=S2
Comparing floating-point
numbers
0032 ─ FOR> ─ ON: S1>S2 V V

OFF: S1≦S2
Comparing floating-point
numbers
0033 ─ FOR>= ─ ON: S1≧S2 V V

OFF: S1<S2

3-12
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing floating-point
numbers
0034 ─ FOR< ─ ON: S1<S2 V V

OFF: S1≧S2
Comparing floating-point
numbers
0035 ─ FOR<= ─ ON: S1≦S2 V V

OFF: S1>S2
Comparing strings
3_
0036 LD$= ─ ─ ON: S1=S2 V V
ON: S1≠S2
Comparing strings
0037 LD$<> ─ ─ ON: S1≠S2 V V
OFF: S1=S2
Comparing strings
0042 AND$= ─ ─ ON: S1=S2 V V
OFF S1≠S2
Comparing strings
0043 AND$<> ─ ─ ON: S1≠S2 V V
OFF: S1=S2
Comparing strings
0048 OR$= ─ ─ ON: S1=S2 V V
OFF: S1≠S2
Comparing strings
0049 OR$<> ─ ─ ON: S1≠S2 V V
OFF: S1=S2

0054 CMP DCMP  Comparing values V V

0055 ZCP DZCP  Zone comparison V V

Comparing floating-point
0056 ─ FCMP  V V
numbers

3-13
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3

Floating-point zone
0057 ─ FZCP  V V
comparison

0058 MCMP ─  Matrix comparison V V

Comparing tables
_3 0059 CMPT= ─  V V
ON: =

Comparing tables
0060 CMPT<> ─  V V
ON: ≠

Comparing tables
0061 CMPT> ─  V V
ON: >

Comparing tables
0062 CMPT>= ─  V V
ON: ≧

Comparing tables
0063 CMPT< ─  V V
ON: <

Comparing tables
0064 CMPT<= ─  V V
ON: ≦

Checking the address of the


0065 CHKADR ─ ─ contact type of a pointer V V
register

Comparing the absolute result


of the contact type
0066 LDZ= DLDZ= ─ V V
ON: | S1- S2|=| S3|
OFF: | S1- S2| ≠ | S3|
Comparing the absolute result
of the contact type
0067 LDZ<> DLDZ<> ─ ON: | S1- S2|≠| S3| V V

OFF: | S1- S2|=| S3|


Comparing the absolute result
of the contact type
0068 LDZ> DLDZ> ─ ON: | S1- S2|>| S3| V V

OFF: | S1- S2| ≦ | S3|

3-14
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing the absolute result
of the contact type
0069 LDZ>= DLDZ>= ─ ON: | S1- S2|≧| S3| V V

OFF: | S1- S2|<| S3|


Comparing the absolute result
of the contact type
0070 LDZ< DLDZ< ─ ON: | S1- S2|<| S3| V V

OFF: | S1- S2|≧ | S3|


Comparing the absolute result
3_
of the contact type
0071 LDZ<= DLDZ<= ─ ON:| S1- S2|≦| S3| V V

OFF: | S1- S2|>| S3|


Comparing the absolute result
of the contact type
0072 ANDZ= DANDZ= ─ V V
ON: | S1- S2|=| S3|
OFF: | S1- S2| ≠ | S3|
Comparing the absolute result
of the contact type
0073 ANDZ<> DANDZ<> ─ ON: | S1- S2|≠| S3| V V

OFF: | S1- S2|=| S3|


Comparing the absolute result
of the contact type
0074 ANDZ> DANDZ> ─ ON: | S1- S2|>| S3| V V

OFF: | S1- S2| ≦ | S3|


Comparing the absolute result
of the contact type
0075 ANDZ>= DANDZ>= ─ ON: | S1- S2|≧| S3| V V

OFF: | S1- S2|<| S3|


Comparing the absolute result
of the contact type
0076 ANDZ< DANDZ< ─ ON: | S1- S2|<| S3| V V

OFF: | S1- S2|≧ | S3|


Comparing the absolute result
of the contact type
0077 ANDZ<= DANDZ<= ─ ON: | S1- S2|≦| S3| V V

OFF: | S1- S2|>| S3|


Comparing the absolute result
of the contact type
0078 ORZ= DORZ= ─ V V
ON: | S1- S2|=| S3|
OFF: | S1- S2| ≠ | S3|

3-15
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit Instruction
EX3 SX3
Comparing the absolute result
of the contact type
0079 ORZ<> DORZ<> ─ ON: | S1- S2| ≠ | S3| V V

OFF: | S1- S2|=| S3|


Comparing the absolute result
of the contact type
0080 ORZ> DORZ> ─ ON: | S1- S2|>| S3| V V

OFF: | S1- S2| ≦ | S3|


_3 Comparing the absolute result
of the contact type
0081 ORZ>= DORZ>= ─ ON: | S1- S2| ≧ | S3| V V

OFF: | S1- S2|<| S3|


Comparing the absolute result
of the contact type
0082 ORZ< DORZ< ─ ON: | S1- S2|<| S3| V V

OFF: | S1- S2| ≧ | S3|


Comparing the absolute result
of the contact type
0083 ORZ<= DORZ<= ─ ON: | S1- S2| ≦ | S3| V V

OFF: | S1- S2|>| S3|

 Arithmetic instructions

Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

Adding binary numbers


0100 + D+  V V
S1+S2=D

Subtracting binary numbers


0101 - D-  V V
S1-S2=D

Multiplying binary numbers


0102 * D*  V V
S1*S2=D

3-16
C ha pt er 3 I ns tr uc t i o n Tab l es

Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

Dividing binary numbers


0103 / D/  V V
S1/S2=D

Adding floating-point
0104 ─ F+  numbers V V 3_
S1+S2=D

Subtracting floating-point
0105 ─ F-  numbers V V
S1-S2=D
Multiplying floating-point
0106 ─ F*  numbers V V
S1*S2=D

Dividing floating-point
0107 ─ F/  numbers V V
S1/S2=D

Adding binary numbers in


0112 BK+ DBK+  V V
blocks

Subtracting binary numbers


0113 BK- DBK-  V V
in blocks

0114 $+ ─  Linking strings V V

Adding one to a binary


0115 INC DINC  V V
number

Subtracting one from a


0116 DEC DDEC  V V
binary number

3-17
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

Multiplying binary numbers


for 16-bit
0117 MUL16 MUL32  V V
multiplying binary numbers
for 32-bit

Dividing binary numbers for


16-bit
0118 DIV16 DIV32  V V
Dividing binary numbers for
_3 32-bit

Multiplying binary numbers in


0120 BK* DBK*  V V
blocks

Dividing binary numbers in


0121 BK/ DBK/  V V
blocks

Adding floating-point
0122 – BKF+  V V
numbers in blocks

Subtracting floating-point
0123 – BKF-  V V
numbers in blocks

Multiplying floating-point
0124 – BKF*  V V
numbers in blocks

Dividing floating-point
0125 – BKF/  V V
numbers in blocks

MUL16: Multiplying 16-bit


binary numbers in blocks
0126 BKMUL16 BKMUL32  V V
MUL32: Multiplying 32-bit
binary numbers in blocks

3-18
C ha pt er 3 I ns tr uc t i o n Tab l es

Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

DIV16: Dividing16-bit binary


numbers in blocks
0127 BKDIV16 BKDIV32  DIV32: Dividing 32-bit binary V V
numbers in blocks

 Data conversion instructions


3_
Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

Converting a binary number into


0200 BCD DBCD  the binary-coded decimal V V
number

Converting a binary-coded
0201 BIN DBIN  decimal number into a binary V V
number

Converting a binary integer into


0202 FLT DFLT  V V
a binary floating-point number

Converting a 32-bit floating-point


0204 INT DINT  V V
number into a binary integer

Converting a 16-bit value into a


0206 MMOV ─  V V
32-bit value

Converting a 32-bit value into a


0207 RMOV ─  V V
16-bit value

Converting a binary number into


0208 GRY DGRY  V V
a Gray code

Converting a Gray code into a


0209 GBIN DGBIN  V V
binary number

3-19
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Applicable
Instruction code
Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

0210 NEG DNEG  Two’s complement of a number V V

Reversing the sign of a 32-bit


0211 ─ FNEG  V V
floating-point number
Converting a binary
_3 0212 ─ FBCD  floating-point number into a V V
decimal floating-point number
Converting a decimal
0213 ─ FBIN  floating-point number into a V V
binary floating-point number
Converting a binary numbers in
0214 BKBCD ─  blocks into a binary-coded V V
decimal numbers in blocks
Converting a binary numbers in
0215 BKBIN ─  blocks into a binary-coded V V
decimal numbers in blocks

Finding a scaled value


0216 SCAL DSCAL  V V
(point-slope)

Finding a scaled value (two


0217 SCLP DSCLP  V V
points)

0222 SCLM DSCLM  Multi-point area ratio operation V V

3-20
C ha pt er 3 I ns tr uc t i o n Tab l es

 Data transfer instructions

Instruction Applicable
code Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

Transferring data
0300 MOV DMOV  S: Data source V V
D: Data destination

0302 $MOV ─  Transferring a string V V


3_

0303 CML DCML  Inverting data V V

0304 BMOV DBMOV  Transferring all data V V

Transferring data to several


0305 NMOV DNMOV  V V
devices

0306 XCH DXCH  Exchanging the data V V

0307 BXCH ─  Exchanging all data V V

Exchanging the high byte with the


0308 SWAP DSWAP  V V
low byte

0309 SMOV ─  Transferring the digits V V

3-21
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction Applicable
code Pulse Model
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

0310 MOVB ─  Transferring several bits V V

 Jump instructions

Instruction code Applicable Model


_3 API
Pulse
Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

0400 CJ ─  Conditional jump V V

0401 JMP ─ ─ Unconditional jump V V

0402 GOEND ─ ─ Jump to END V V

 Program execution instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

0500 DI ─ ─ Disabling an interrupt V V

0501 EI ─ ─ Enabling an interrupt V V

0503 EIX ─ ─ Disabling a specific interrupt V V

0504 DIX ─ ─ Enabling a specific interrupt V V

 I/O refreshing instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

060
REF ─  Refreshing the I/O V V
0

060 Refreshing the values of high-speed


─ DHSRF  V V
1 comparison

060
REFF ─  Refreshing the I/O filtering time V V
2

3-22
C ha pt er 3 I ns tr uc t i o n Tab l es

 Miscellaneous instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

0700 ALT ─  Alternating between ON and OFF V V

0701 TTMR ─ ─ Teach mode timer V V

0702 STMR ─ ─ Special timer V V

3_
0703 RAMP DRAMP ─ Cyclic ramp signal V V

0704 MTR ─ ─ Matrix input V V

0705 ABSD DABSD ─ Absolute drum sequencer V V

0706 INCD ─ ─ Incremental drum sequencer V V

0708 ─ DPIDE ─ PID algorithm V V

Setting up to compare the inputs


0709 XCMP ─ ─ V V
of multiple work stations

Comparing the outputs of multiple


0710 YOUT ─ ─ V V
work stations

3-23
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Setting up the sunrise and sunset


0711 ─ DSUNRS  V V
times

0712 ─ DSPA ─ Solar panel positioning X V

 Logic instructions
_3
Instruction code Applicable Model
Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

0800 WAND DAND  Logical AND operation V V

0801 MAND ─  Matrix AND operation V V

0802 WOR DOR  Logical OR operation V V

0803 MOR ─  Matrix OR operation V V

0804 WXOR DXOR  Logical exclusive OR operation V V

0805 MXOR ─  Matrix exclusive OR operation V V

0808 WINV DINV  Logical reversed INV operation V V

0809 LD& DLD& ─ S1&S2 V V

3-24
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

0810 LD| DLD| ─ S1|S2 V V

0811 LD^ DLD^ ─ S1^S2 V V

0812 AND& DAND& ─ S1&S2 V V

3_
0813 AND| DAND| ─ S1|S2 V V

0814 AND^ DAND^ ─ S1^S2 V V

0815 OR& DOR& ─ S1&S2 V V

0816 OR| DOR| ─ S1|S2 V V

0817 OR^ DOR^ ─ S1^S2 V V

 Rotation instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Rotating bits in a group to the


0900 ROR DROR  V V
right

Rotating bits in a group to the


0901 RCR DRCR  V V
right with the carry flag

Rotating bits in a group to the


0902 ROL DROL  V V
left

3-25
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Rotating bits in a group to the


0903 RCL DRCL  V V
left with the carry flag

Rotating bits to the right or the


0904 MBR ─  V V
left in a matrix

_3
 Timer and counter instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3
Resetting the contact to OFF or
1000 RST DRST ─ V V
clearing the value in the register

1001 TMR ─ ─ 16-bit timer (Unit: 100ms) V V

1002 TMRH ─ ─ 16-bit timer (Unit: 1ms) V V

1003 CNT ─ ─ 16-bit counter V V

32-bit counter (Including the use


1004 ─ DCNT ─ V V
of high-speed counters)

DHSC
1005 ─ ─ Setting high-speed comparison V V
S

DHSC Resetting high-speed


1006 ─ ─ V V
R comparison

High-speed input zone


1007 ─ DHSZ ─ V V
comparison

1008 ─ DSPD ─ Speed detection V V

1009 PWD ─ ─ Pulse width detection V V

Capturing the high-speed count


1010 ─ DCAP ─ value in the external input V V
interrupt

1011 TMRM ─ ─ 16-bit timer (Unit: 10ms) V V

3-26
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3
The start of the instruction
1012 IETS ─ 
execution time measurement
V V

The end of the instruction


1013 IETE ─ 
execution time measurement
V V

DHSC Cyclic counting, comparing and


1014 ─
Y

outputting
V V

1015 PPDT ─ ─
Detecting the time difference
V V
3_
between two phases

16-bit contact timer (Unit: 100


1016 ATMR ─ ─ V V
ms)

1017 ATMRH ─ ─ 16-bit contact timer (Unit: 1 ms) V V

1018 ATMRM ─ ─ 16-bit contact timer (Unit: 10 ms) V V

 Shift instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Shifting the states of the


1100 SFTR ─  V V
devices to the right

Shifting the states of the


1101 SFTL ─  V V
devices to the left

Shifting the data in the word


1102 WSFR DWSFR  V V
devices to the right

Shifting the data in the word


1103 WSFL DWFL  V V
devices to the left

3-27
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Shifting the data and writing it


1104 SFWR DSFWR  V V
to the word device

Shifting the data and reading it


1105 SFRD DSFRD  V V
from the word device
_3

Reading the latest data from


1106 SFPO DSFPO  V V
the data list

Deleting the data from the data


1107 SFDEL DSFDEL  V V
list

Inserting the data into the data


1108 SFINS DSFINS  V V
list

1109 MBS ─  Shifting the matrix bits V V

Shifting the values of the bits in


1110 SFR DSFR  the registers by n bits to the V V
right

Shifting the values of the bits in


1111 SFL DSFL  V V
the registers by n bits to the left

Shifting the states of the n bit


1112 BSFR ─  V V
devices by one bit to the right

Shifting the states of the n bit


1113 BSFL ─  V V
devices by one bit to the left

3-28
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1114 NSFR DNSFR  Shifting n registers to the right V V

1115 NSFL DNSFL  Shifting n registers to the left V V

3_
 Data processing instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1200 SER DSER  Searching the data V V

Number of bits whose


1201 SUM DSUM  V V
states are ON

1202 DECO ─  Decoder V V

1203 ENCO ─  Encoder V V

Seven-segment
1204 SEGD ─  V V
decoding

1205 SORT DSORT  Sorting the data V V

1206 ZRST ─  Resetting the zone V V

3-29
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Checking the state of the


1207 BON DBON  V V
bit

_3 1208 MEAN DMEAN  Mean V V

1209 CCD ─  Sum check V V

1210 ABS DABS  Absolute value V V

1211 MINV ─  Inverting the matrix bits V V

1212 MBRD ─  Reading the matrix bit V V

1213 MBWR ─  Writing the matrix bit V V

Counting the bits with the


1214 MBC ─  V V
value 0 or 1

1215 DIS ─  Disuniting 16-bit data V V

1216 UNI ─  Uniting 16-bit data V V

1217 WSUM DWSUM  Getting the sum V V

3-30
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Confining a value within


1221 LIMIT DLIMIT  V V
bounds

3_

1222 BAND DBAND  Deadband control V V

1223 ZONE DZONE  Controlling the zone V V

Mean of the floating point


1224 ─ FMEAN  V V
numbers

Sum of the floating point


1225 ─ FSUM  V V
numbers

1226 DTM ─  Transfer and move data V V

1228 ─ ZSET  Zone setup V V

Sorting data in
1229 ─ FSORT  V V
floating-point format

 Structure creation instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1300 FOR ─ ─ Start of the nested loop V V

1301 NEXT ─ ─ End of the nested loop V V

3-31
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1302 BREAK ─ ─ Terminating the FOR-NEXT loop V V

 Module instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

_3
Reading the data from the
1400 FROM DFROM  control register in the V V
special module

Writing the data to the


1401 TO DTO  control register in the V V
special module

Setting output control


1402 ─ DPUCONF  V V
parameters of PU module

Reading PU module output


1403 PUSTAT ─ ─ V V
state

PU module pulse output


1404 ─ DPUPLS ─ V V
(no acceleration)

3-32
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Relative position output of


PU module (with
1405 ─ DPUDRI ─ V V
acceleration and
deceleration)

3_
Absolute addressing
output of PU module
1406 ─ DPUDRA ─ V V
(with acceleration and
deceleration)

1407 ─ DPUZRN ─ PU module homing V V

1408 ─ DPUJOG ─ PU module jog output V V

1409 ─ DPUMPG ─ PU module MPG output V V

3-33
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

High-speed counter
1410 ─ DPUCNT ─ V V
function of PU module

_3

Setting PU module input


1428 PUX –  V V
point mode

Setting PU module
1429 – DPULS  V V
software limits

Digital low-pass filter for


1430 MLPF – – V V
analog input signals

 Floating-point number instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1500 ─ FSIN  Sine of a floating-point number V V

1501 ─ FCOS  Cosine of a floating-point number V V

1502 ─ FTAN  Tangent of a floating-point number V V

3-34
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1503 ─ FASIN  Arcsine of a floating-point number V V

Arccosine of a floating-point
1504 ─ FACOS  V V
number

Arctangent of a floating-point
1505 ─ FATAN  V V
number

Hyperbolic sine of a floating-point


1506 ─ FSINH  V V
number 3_
Hyperbolic cosine of a
1507 ─ FCOSH  V V
floating-point number

Hyperbolic tangent of a
1508 ─ FTANH  V V
floating-point number

Converting from degrees to


1509 ─ FRAD  V V
radians

Converting from radians to


1510 ─ FDEG  V V
degrees

1511 SQR DSQR  Square root of a binary number V V

Square root of a floating-point


1512 ─ FSQR  V V
number

Exponent of a floating-point
1513 ─ FEXP  V V
number

Logarithm of a floating-point
1514 ─ FLOG  V V
number

Natural logarithm of a binary


1515 ─ FLN  V V
floating-point number

Raising a floating-point number to


1516 ─ FPOW  V V
a power

1517 RAND ─  Random number V V

3-35
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Real-time clock instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1600 TRD ─  Reading the time V V

1601 TWR ─  Writing the time V V

1602 T+ ─  Adding the time V V


_3

1603 T- ─  Subtracting the time V V

1604 HOUR ─ ─ Running-time meter V V

1605 TCMP ─  Comparing the time V V

1606 TZCP ─  Time zone comparison V V

1607 DST ─  Daylight saving time V V

1608 WWON ─ ─ Weekly working time setup V V

 Peripheral instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1700 TKY DTKY ─ Ten-key keypad V V

1701 HKY DHKY ─ Sixteen-key keypad V V

3-36
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1702 DSW ─ ─ DIP switch V V

1703 ARWS ─ ─ Arrow keys V V

1704 SEGL ─ ─
Seven-segment display with
latches
V V 3_

 Communication instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

1806 LRC ─ ─ Longitudinal parity check V V

1807 CRC ─ ─ Cyclic redundancy check V V

Reading and Writing


1808 MODRW ─ ─ V V
MODBUS data

Sending and receiving


1812 COMRS ─ ─ V V
communication data

Setting the communication


1813 COMDF ─  format for a serial V V
communication port

Serial communication
1814 VFDRW ─ ─ instruction, exclusively for V V
Delta AC motor drive

Serial communication
1815 ASDRW ─ ─ instruction, exclusively for V V
Delta servo drive

3-37
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Setting the parameters in the


1816 CCONF ─  data exchange table for a V V
communication port

_3 1817 MODRWE ─ ─
Reading and writing Modbus
V V
data without using any flags

Reading and writing


1818 DNETRW ─ ─ DeviceNet communication V V
data

User-defined CAN
1819 CANRS ─ ─ communication sending and V V
receiving

Enabling Delta DMV detection


1820 DMVSH ─ ─ V V
and communication

Execute the appointed


1821 DESO ─ ─ communication number of the V V
data exchange table once

 Other instructions

Instruction code Pulse Applicable Model


API instructio Symbol Function ES3/ SV3/
16-bit 32-bit n EX3 SX3
1900 WDT ─  Watchdog timer V V
Delaying the execution of
1901 DELAY ─  V V
a program

General pulse width


1902 GPWM ─ ─ V V
modulation

Storing the contents of the


1904 EPUSH ─  V V
index registers
Reading data into the
1905 EPOP ─  V V
index registers

3-38
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse Applicable Model


API instructio Symbol Function ES3/ SV3/
16-bit 32-bit n EX3 SX3

1906 INFO ─  Reading the system data V V

 String processing instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Converting a signed decimal 3_


2100 BINDA DBINDA  V V
number into ASCII code

Converting a binary
2101 BINHA DBINHA  hexadecimal number into V V
hexadecimal ASCII code

Converting a binary-coded
2102 BCDDA DBCDDA  V V
decimal number into ASCII code

Converting a signed decimal


2103 DABIN DDABIN  ASCII code into a signed V V
decimal binary number

Converting a hexadecimal
2104 HABIN DHABIN  ASCII code into a hexadecimal V V
binary number

Converting an ASCII code into a


2105 DABCD DDABCD  V V
binary-coded decimal number

2106 $LEN ─  Calculating the length of a string V V

Converting a floating-point
2109 $FSTR ─  V V
number into a string

Converting a string into a


2110 $FVAL ─  V V
floating-point number

$RIGH Retrieving characters from a


2111 ─  V V
T string begins from the right.

Retrieving characters from a


2112 $LEFT ─  V V
string begins from the left.

2113 $MIDR ─  Retrieving a part of a string V V

3-39
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

2115 $SER ─  Searching a string V V

Replacing the characters in a


2116 $RPLC ─  V V
string

Deleting the characters in a


2117 $DEL ─  V V
string
_3
2118 $CLR ─  Clearing a string V V

2119 $INS ─  Inserting a string V V

2122 SPLIT ─  Splitting a string V V

MERG
2123 ─  Merging a string V V
E

 Ethernet instructions

Instruction code Applicable Model


API Pulse instruction Symbol Function ES3/ SV3/
16-bit 32-bit
EX3 SX3

2200 SOPEN ─  Opening a socket V V

Sending data through


2201 SSEND ─  V V
the socket

2203 SCLOSE ─  Closing a socket V V

2204 MSEND ─  Sending an email V V

Converting an IP
address of the integer
2206 INTOA ─  type into an IP V V
address of the string
type
Converting an IP
address of the string
2207 IATON ─  type into an IP V V
address of the integer
type

3-40
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


API Pulse instruction Symbol Function ES3/ SV3/
16-bit 32-bit
EX3 SX3

Reading and writing


2208 EIPRW ─ ─ V V
EtherNet/IP data

2209 SCONF ─  Setting TCP/UDP


V V 3_
socket parameters

Reading/Writing
2210 MCONF ─  V V
Modbus TCP data

EMCON Setting email server


2211 ─  V V
F1 parameter values

EMCON
2212 ─  Setting email address V V
F2

Ethernet
2213 ETHRW ─ ─ X V
communication

3-41
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Memory card / File register instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Writing data from the PLC into


2300 MWRIT ─  V V
a memory card

MREA Reading data from the


2301 ─  V V
D memory card into the PLC
_3

MTWRI Writing a string into the


2302 ─  V V
T memory card

Writing data into the file


2303 MEMW ─  V V
register

Deleting files on the memory


2304 MDEL ─  V V
card

 Task control instructions

Instruction
Applicable Model
code Pulse
API Symbol Function
instruction ES3/ SV3/
16-bit 32-bit
EX3 SX3

2400 TKON ─  Enabling a cyclic task V V

2401 TKOFF ─  Disabling a cyclic task V V

 Sequential function charts (SFC) instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

2500 SFCRUN – – Enabling SFC V V

2501 SFCPSE – – Pausing SFC V V

2502 SFCSTP – – Stopping SFC V V

3-42
C ha pt er 3 I ns tr uc t i o n Tab l es

 High-speed output instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3
High-speed pulse output
2700 – DPLSY – (without ramp-up/down V V
process)

High-speed pulse output (with


2701 – DPLSR – V V
ramp-up/down process)

2702 PWM DPWM – Pulse width modulation V V


3_
2703 JOG DJOG – JOG output V V

2704 – DZRN – Zero return V V

2705 – DPLSV – Adjustable pulse output V V

2706 – DDRVI – Relative position control V V

2707 – DDRVA – Absolute position control V V

Catch speed and proportional


2708 CSFO – – V V
output

2709 – DDRVM – Mark alignment positioning V V

2-Axis relative-coordinate
2710 – DPPMR – point-to-point synchronized V V
motion
2-Axis absolute-coordinate
2711 – DPPMA – point-to-point synchronized V V
motion

2-Axis relative-position
2712 – DCICR – clockwise arc V V
interpolation

2-Axis absolute-position
2713 – DCICA – clockwise arc V V
interpolation

3-43
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

2-Axis relative-position
2714 – DCICCR – counterclockwise arc V V
interpolation

2-Axis absolute-position
2715 – DCICCA – counterclockwise arc V V
interpolation

_3 Relative-position circle
2716 – DCCMR – V V
drawing

Absolute-position circle
2717 – DCCMA – V V
drawing

The position planning table


2718 TPO – – V V
controls the output

Setting single-axis output


2719 – DTPWS  parameters in the position V V
planning table

Setting linear interpolation


2720 – DTPWL  parameters in the position V V
planning table

Setting arc interpolation


2721 – DPTWC  parameters in the position V V
planning table

Point to point go back and


2723 – DPPGB – V V
forth

Zero return 2
2724 – DZRN2 – V V
(output direction can be set)

 Delta Special CANopen and EtherCAT Communication Instructions

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3
Initializing the servo for
2800 INITC – – V V
CANopen communication

2801 ASDON – – Servo-ON and Servo-OFF V V

3-44
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Setting the acceleration time and


2802 CASD – – V V
deceleration time for a servo

2803 – DDRVIC – Servo relative position control V V

2804 – DDRVAC – Servo absolute position control V V

2805 – DPLSVC – Servo speed control V V 3_

2806 ZRNC DZRNC – Servo homing V V

Reading and writing CANopen


2807 COPRW – – V V
communication data

Writing multiple CANopen


2808 COPWL DCOPWL – V V
parameter values

Sending Reset or NMT


2809 RSTD ─ ─ V V
command

Setting the homing mode for


2810 ZRNM ─ ─ V V
Delta servo

2811 EMER ─ ─ Reading Emergency message V V

Controlling the tracking function


2812 – DCSFOC – V V
of a servo via communication

Downloading E-CAM chart to


2813 ECAMD – – V V
the Slave

E-CAM parameter setting and


2814 – DECAMS – V V
planning

Activating E-CAM control and


2815 ECAMA – – V V
displaying the status

3-45
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Applicable Model


Pulse
API Symbol Function ES3/ SV3/
16-bit 32-bit instruction
EX3 SX3

Modifying the starting address


2816 ECAMC – – for E-CAM chart and the E-CAM V V
chart length in the servo

2817 – DTQC – Torque control V V

2818 – DTQLC – Speed of torque control V V


_3

Initializing the slaves for


2820 INITEC ─ ─ V X
EtherCAT communication

Reading and writing EtherCAT


2821 ECATRW ─ ─ V X
SDO data

Reading Motion state of an


2822 MOTST ─ ─ V X
EtherCAT slave

Reading the state of an


2823 ECATST ─ ─ V X
EtherCAT slave

3-46
C ha pt er 3 I ns tr uc t i o n Tab l es

3.4.2 Applied Instructions (Sorted Alphabetically)


Instruction code Pulse
Classification API Function
16-bit 32-bit instruction

0114 $+ –  Linking two strings

2118 $CLR –  Clearing a string

2117 $DEL –  Deleting the characters in a string

2109 $FSTR –  Converting a floating-point number into a string

2110 $FVAL –  Converting a string into a floating-point number

2119 $INS –  Inserting a string

2112 $LEFT –  Retrieving characters in a string begins from the left.


3_
2106 $LEN –  Calculating the length of a string
Symbol
2113 $MIDR –  Retrieving a part of a string

0302 $MOV –  Transferring a string

2111 $RIGHT –  Retrieving characters in a string begins from the right.

2116 $RPLC –  Replacing the characters in a string

2115 $SER –  Searching a string

0102 * D*  Multiplication of binary numbers

0103 / D/  Division of binary numbers

0100 + D+  Addition of binary numbers

1210 ABS DABS  Absolute value

0705 ABSD DABSD – Absolute drum sequencer

0700 ALT –  Alternating between ON and OFF

0043 AND$<> – – S1≠S2

0042 AND$= – – S1=S2

0812 AND& DAND& – S1&S2

0814 AND^ DAND^ – S1^S2

0813 AND| DAND| – S1|S2

0010 AND< DAND< – S1<S2


A
0011 AND<= DAND<= – S1≦S2

0007 AND<> DAND<> – S1≠S2

0006 AND= DAND= – S1=S2

0008 AND> DAND> – S1>S2

0009 AND>= DAND>= – S1≧S2

0076 ANDZ< DANDZ< – |S1-S2|<|S3|

0077 ANDZ<= DANDZ<= – |S1-S2|≦|S3|

0073 ANDZ<> DANDZ<> – |S1-S2|≠|S3|

0072 ANDZ= DANDZ= – |S1-S2|=|S3|

3-47
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

0074 ANDZ> DANDZ> – |S1-S2|>|S3|

0075 ANDZ>= DANDZ>= – |S1-S2|≧|S3|

1703 ARWS – – Arrow key input

2801 ASDON – – Servo-ON and servo-OFF


– Serial communication instruction exclusive for Delta
1815 ASDRW –
servo drive
1016 ATMR – – 16-bit contact timer (Unit: 100 ms)

_3 1017 ATMRH – – 16-bit contact timer (Unit: 1 ms)

1018 ATMRM – – 16-bit contact timer (Unit: 10 ms)

0122 – BKF+  Adding floating-point numbers in blocks

0123 – BKF-  Subtracting floating-point numbers in blocks

0124 – BKF*  Multiplying floating-point numbers in blocks

0125 – BKF/  Dividing floating-point numbers in blocks

1222 BAND DBAND  Deadband control


Converting a binary number into a binary-coded
0200 BCD DBCD 
decimal number
Converting a binary-coded decimal number into
2102 BCDDA DBCDDA 
ASCII code
Converting a binary-coded decimal number into a
0201 BIN DBIN 
binary number
2100 BINDA DBINDA  Converting a singed decimal number into ASCII code
Converting a binary hexadecimal number into the
2101 BINHA DBINHA 
hexadecimal ASCII code
0112 BK+ DBK+  Adding binary numbers in blocks

0113 BK- DBK-  Subtracting binary numbers in blocks


B
0120 BK* DBK*  Multiplying binary numbers in blocks

0121 BK/ DBK/  Dividing binary numbers in blocks


– Converting binary numbers in blocks into
0214 BKBCD 
binary-coded decimal numbers in blocks
– Converting binary numbers in blocks into
0215 BKBIN 
binary-coded decimal numbers in blocks
DIV16: Dividing16-bit binary numbers in blocks
0127 BKDIV16 BKDIV32 
DIV32: Dividing 32-bit binary numbers in blocks
MUL16: Multiplying 16-bit binary numbers in blocks
0126 BKMUL16 BKMUL32 
MUL32: Multiplying 32-bit binary numbers in blocks
0304 BMOV DBMOV  Transferring all data

1207 BON DBON  Checking the state of a bit

1302 BREAK – – Terminating the FOR-NEXT loop


– Shifting the states of the n bit devices by one bit to the
1113 BSFL 
left
1112 BSFR –  Shifting the states of the n bit devices by one bit to the

3-48
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

right

0307 BXCH –  Exchanging all data


– User-defined CAN communication sending and
1819 CANRS –
receiving
Setting the acceleration time and deceleration time
2802 CASD – –
for a servo
1209 CCD –  Checksum
– Setting the parameters in the data exchange table of
1816 CCONF 
a communication port
3_
0065 CHKADR – – Checking the address of the pointer register

0400 CJ –  Conditional jump

0303 CML DCML  Inverting data

0054 CMP DCMP  Comparing values


Comparing tables
0063 CMPT< – 
ON: <
Comparing tables
0064 CMPT<= – 
ON: ≦

C Comparing tables
0060 CMPT<> – 
ON: ≠
Comparing tables
0059 CMPT= – 
ON: =
Comparing tables
0061 CMPT> – 
ON: >
Comparing tables
0062 CMPT>= – 
ON: ≧
1003 CNT – – 16-bit counter
– Setting the communication format for a serial
1813 COMDF 
communication port
1812 COMRS – – Sending and receiving communication data

2807 COPRW – – Reading and writing CANopen communication data

2808 COPWL DCOPWL – Writing multiple CANopen parameter values

1807 CRC – – Cyclic redundancy check

2708 CSFO – – Catch speed and proportional output


Subtracting binary numbers
0101 – D- 
S1-S2=D
Capturing the high-speed count value in the external
1010 – DCAP –
input interrupt
2717 – DCCMA – Absolute-position circle drawing
D
2716 – DCCMR – Relative-position circle drawing

2713 – DCICA – 2-Axis absolute-position clockwise arc interpolation


2-Axis absolute-position counterclockwise arc
2715 – DCICCA –
interpolation

3-49
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

2-Axis relative-position counterclockwise arc


2714 – DCICCR –
interpolation
2-Axis relative-position clockwise arc
2712 – DCICR –
interpolation
1004 – DCNT – 32-bit counter
– Controlling the tracking function of a servo via
2812 – DCSFOC
communication
2707 – DDRVA – Absolute position control

_3 2804 – DDRVAC Servo absolute position control

2706 – DDRVI – Relative position control

2803 – DDRVIC – Servo relative position control

2709 – DDRVM – Mark alignment positioning

2814 – DECAMS – E-CAM parameter setting and planning

1006 – DHSCR – Resetting high-speed comparison

1005 – DHSCS – Setting high-speed comparison


1014 – DHSCY – Cyclic counting, comparing and outputting

0601 – DHSRF  Refreshing the values of high-speed comparison

1007 – DHSZ – High-speed input zone comparison

0708 – DPIDE – PID algorithm


High-speed pulse output (with ramp-up/down
2701 – DPLSR –
process)
2705 – DPLSV – Adjustable pulse output

2805 – DPLSVC – Servo speed control


High-speed pulse output (without ramp-up/down
2700 – DPLSY –
process)
2723 – DPPGB – Point to point go back and forth
2-Axis absolute-coordinate point-to-point
2711 – DPPMA –
synchronized motion
2-Axis relative-coordinate point-to-point synchronized
2710 – DPPMR –
motion
– Setting arc interpolation parameters in the position
2721 DPTWC 
planning table
1410 – DPUCNT – High-speed counter function of PU module
1402 – DPUCONF  Setting output control parameters of PU module
Absolute addressing output of PU module (with
1406 – DPUDRA –
acceleration and deceleration)
Relative position output of PU module (with
1405 – DPUDRI –
acceleration and deceleration)
1408 – DPUJOG – PU module jog output
1429 – DPULS  Setting PU module software limits
1409 – DPUMPG – PU module MPG output

3-50
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

1404 – DPUPLS – PU module pulse output (no acceleration)


1407 – DPUZRN – PU module homing
0712 ─ DSPA ─ Solar panel positioning
1008 – DSPD – Detecting speed
0711 – DSUNRS – Setting up the sunrise and sunset times
1226 – DTM  Transfer and move data
–  Setting linear interpolation parameters in the position
2720 DTPWL
planning table 3_
 Setting single-axis output parameters in the position
2719 – DTPWS
planning table
2817 – DTQC – Torque control
2818 – DTQLC – Speed of torque control

2704 – DZRN – Zero return

2724 – DZRN2 – Zero return 2 (output direction can be set)


Converting an ASCII code into a binary-coded
2105 DABCD DDABCD 
decimal number
Converting a signed decimal ASCII code into a
2103 DABIN DDABIN 
signed decimal binary number
0116 DEC DDEC  Subtracting one from a binary number

1202 DECO –  Decoder

1901 DELAY –  Delaying the execution of a program


Execute the appointed communication number of the
1821 DESO – –
data exchange table once
0500 DI – – Disabling the interrupt

1215 DIS –  Disuniting the 16-bit data


Division of binary numbers for 16-bit
0118 DIV16 DIV32 
Division of binary numbers for 32-bit
0504 DIX – – Enabling a specific interrupt
1820 DMVSH – – Enabling Delta DMV detection and communication
1818 DNETRW – – Reading and writing DeviceNet communication data

1607 DST –  Daylight saving time

1702 DSW – – DIP switch


2815 ECAMA – – Activating E-CAM control and displaying the status
Modifying the starting address for E-CAM chart and
2816 ECAMC – –
the E-CAM chart length in the servo
2813 ECAMD – – Downloading E-CAM chart to the Slave
E
2815 ECAMA – – Activating E-CAM control and displaying the status

2821 ECATRW – – Reading and writing EtherCAT SDO data

2823 ECATST – – Reading the state of an EtherCAT slave

3-51
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

0501 EI – – Enabling an interrupt


Reading and writing through an EtherNet/IP
2208 EIPRW – –
connection
0503 EIX – – Disabling a specific interrupt
2211 EMCONF1 –  Setting email server parameter values

2212 EMCONF2 –  Setting email address

2811 EMER – – Reading Emergency message



_3 1203 ENCO  Encoder

1905 EPOP –  Reading data into the index registers

1904 EPUSH –  Storing the contents of the index registers

2213 ETHRW – – Ethernet communication


Subtracting floating-point numbers
0105 – F- 
S1-S2=D
– Multiplying floating-point numbers
0106 F* 
S1*S2=D
– Dividing floating-point numbers
0107 F/ 
S1/S2=D
Adding floating-point numbers
0104 – F+ 
S1+S2=D
1504 – FACOS  Arccosine of the floating-point number

0028 – FAND< – S1<S2

0029 – FAND<= – S1≦S2

0025 – FAND<> – S1≠S2

0024 – FAND= – S1=S2

0026 – FAND> – S1>S2


F 0027 – FAND>= – S1≧S2

1503 – FASIN  Arcsine of a floating-point number

1505 – FATAN  Arctangent of a floating-point number


Converting a binary floating-point number into a
0212 – FBCD 
decimal floating-point number
Converting a decimal floating-point number into a
0213 – FBIN 
binary floating-point number
0056 – FCMP  Comparing floating-point numbers

1501 – FCOS  Cosine of a floating-point number

1507 – FCOSH  Hyperbolic cosine of a floating-point number

1510 – FDEG  Converting radians to degrees

1513 – FEXP  The exponent of a floating-point number

0022 – FLD< – S1<S2

0023 – FLD<= – S1≦S2

3-52
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

0019 – FLD<> – S1≠S2

0018 – FLD= – S1=S2

0020 – FLD> – S1>S2

0021 – FLD>= – S1≧S2

1515 – FLN  Natural logarithm of a binary floating-point number

1514 – FLOG  Logarithm of a floating-point number

1224 – FMEAN  The mean of floating point numbers

0211 – FNEG  Reversing the sign of a floating-point number 3_


0034 – FOR< – S1<S2

0035 – FOR<= – S1≦S2

0031 – FOR<> – S1≠S2

0030 – FOR= – S1=S2

0032 – FOR> – S1>S2

0033 – FOR>= – S1≧S2

1516 – FPOW  Raising a floating-point number to a power

1509 – FRAD  Converting degrees to radians

1500 – FSIN  Sine of a floating-point number

1506 – FSINH  Hyperbolic sine of a floating-point number

1229 – FSORT  Sorting data in floating-point format

1512 – FSQR  Square root of a floating-point number

1225 – FSUM  The sum of floating point numbers

1502 – FTAN  Tangent of a floating-point number

1508 – FTANH  Hyperbolic tangent of a floating-point number

0057 – FZCP  Floating-point zone comparison


Converting a binary integer into a binary floating-point
0202 FLT DFLT 
number
1300 FOR – – Start of a nested loop
Reading data from the control register in the
1400 FROM DFROM 
extension module
0209 GBIN DGBIN  Converting a Gray code into a binary number

0402 GOEND – – Jumping to END


G
1902 GPWM – – General pulse width modulation

0208 GRY DGRY  Converting a binary number into a Gray code


Converting a hexadecimal ASCII code into a
2104 HABIN DHABIN 
hexadecimal binary number
H 1701 HKY DHKY – Hexadecimal key input

1604 HOUR – – Running-time meter

3-53
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

Converting an IP address of the string type into an IP


2207 IATON – 
address of the integer type
The start of the instruction execution time
1012 IETS – 
measurement
The end of the instruction execution time
1013 IETE – 
measurement
0115 INC DINC  Adding one to a binary number

0706 INCD – – Incremental drum sequencer


I
INFO –
_3 1906  Reading the system data

2800 INITC – – Initializing the servo for CANopen communication

2820 INITEC – – Initializing the slaves for EtherCAT communication


Converting a 32-bit floating-point number into a
0204 INT DINT 
binary integer
Converting an IP address of the integer type into an
2206 INTOA – 
IP address of the string type
0401 JMP – – Unconditional jump
J
2703 JOG DJOG – JOG output

0037 LD$<> – – S1≠S2

0036 LD$= – – S1=S2

0809 LD& DLD& – S1&S2

0811 LD^ DLD^ – S1^S2

0810 LD| DLD| – S1|S2

0004 LD< DLD< – S1<S2

0005 LD<= DLD<= – S1≦S2

0001 LD<> DLD<> – S1≠S2

0000 LD= DLD= – S1=S2

L 0002 LD> DLD> – S1>S2

0003 LD>= DLD>= – S1≧S2

0070 LDZ< DLDZ< – |S1-S2|<|S3|

0071 LDZ<= DLDZ<= – |S1-S2|≦|S3|

0067 LDZ<> DLDZ<> – |S1-S2|≠|S3|

0066 LDZ= DLDZ= – |S1-S2|=|S3|

0068 LDZ> DLDZ> – |S1-S2|>|S3|

0069 LDZ>= DLDZ>= – |S1-S2|≧|S3|

1221 LIMIT DLIMIT  Confining a value within bounds

1806 LRC – – Longitudinal parity check

0801 MAND –  Matrix AND operation


M
2304 MDEL –  Deleting files on the memory card

3-54
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

2123 MERGE –  Merging a string

1214 MBC –  Counting the bits with the value 0 or 1

0904 MBR –  Rotating the matrix bits

1212 MBRD –  Reading the matrix bit

1109 MBS –  Shifting the matrix bits

1213 MBWR –  Writing the matrix bit

0058 MCMP –  Matrix comparison

2210 MCONF –  Reading/Writing Modbus TCP data 3_


1208 MEAN DMEAN  Mean

2303 MEMW –  Writing data into the file register

1211 MINV –  Inverting matrix bits

1430 MLPF – – Digital low-pass filter for analog input signals

0206 MMOV –  Converting a 16-bit value into a 32-bit value

1808 MODRW – – Reading/Writing MODBUS data


– Reading and writing Modbus data without using any
1817 MODRWE –
flags
0803 MOR –  Matrix OR operation

2822 MOTST – – Reading Motion state of an EtherCAT slave

0300 MOV DMOV  Transferring data

0310 MOVB –  Transferring several bits

2301 MREAD –  Reading data from the memory card into the PLC

2204 MSEND –  Sending an email

0704 MTR – – Matrix input

2302 MTWRIT –  Writing a string into the memory card

0117 MUL16 MUL32  Multiplying binary numbers for 16-bit/32-bit

2300 MWRIT –  Writing data from the PLC to the memory card

0805 MXOR –  Matrix exclusive OR operation

0210 NEG DNEG  Two’s complement

1301 NEXT – – End of the nested loop

N 0305 NMOV DNMOV  Transferring data to several devices

1115 NSFL DNSFL  Shifting n registers to the left

1114 NSFR DNSFR  Shifting n registers to the right

0049 OR$<> – – S1≠S2

0048 OR$= – – S1=S2


O
0815 OR& DOR& – S1&S2

0817 OR^ DOR^ – S1^S2

3-55
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

0816 OR| DOR| – S1|S2

0016 OR< DOR< – S1<S2

0017 OR<= DOR<= – S1≦S2

0013 OR<> DOR<> – S1 ≠ S2

0012 OR= DOR= – S1=S2

0014 OR> DOR> – S1>S2

0015 OR>= DOR>= – S1≧S2


_3 0082 ORZ< DORZ< – |S1-S2|<|S3|

0083 ORZ<= DORZ<= – |S1-S2|≦|S3|

0079 ORZ<> DORZ<> – |S1-S2|≠|S3|

0078 ORZ= DORZ= – |S1-S2|=|S3|

0080 ORZ> DORZ> – |S1-S2|>|S3|

0081 ORZ>= DORZ>= – |S1-S2|≧|S3|

1015 PPDT – – Detecting the time difference between two phases


1403 PUSTAT – – Reading PU module output state

P 1428 PUX –  Setting PU module input point mode


1009 PWD – – Pulse width detection

2702 PWM DPWM – Pulse width modulation

0703 RAMP DRAMP – Ramp signal

1517 RAND –  Random number

0903 RCL DRCL  Rotating to the left with the carry flag

0901 RCR DRCR  Rotating to the right with the carry flag

0600 REF –  Refreshing the I/O

R 0602 REFF –  Refreshing the I/O filtering time

0207 RMOV –  Converting a 32-bit value into a 16-bit value

0902 ROL DROL  Rotating to the left

0900 ROR DROR  Rotating to the right

1000 RST DRST – Resetting the contact or clearing the register

2809 RSTD – – Sending Reset or NMT command

0216 SCAL DSCAL  Scale value operation

0222 SCLM DSCLM  Multi-point area ratio operation

2203 SCLOSE –  Closing the socket

S 0217 SCLP DSCLP  Parameter type of scale value operation

2209 SCONF –  Setting TCP/UDP socket parameters

1204 SEGD –  Seven-segment decoding

1704 SEGL – – Seven-segment display with latches

3-56
C ha pt er 3 I ns tr uc t i o n Tab l es

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

1200 SER DSER  Searching the data

2501 SFCPSE – – Causing SFC to pause

2500 SFCRUN – – Enabling SFC

2502 SFCSTP – – Stopping SFC

1107 SFDEL DSFDEL  Deleting the data from the data list

1108 SFINS DSFINS  Inserting the data into the data list
Shifting the values of the bits in the registers by n bits
1111 SFL DSFL 
to the left 3_
1106 SFPO DSFPO  Reading the latest data from the data list
Shifting the values of the bits in the registers by n bits
1110 SFR DSFR 
to the right
1105 SFRD DSFRD  Shifting the data and reading it from the word device

1101 SFTL –  Shifting the states of the devices to the left

1100 SFTR –  Shifting the states of the devices to the right

1104 SFWR DSFWR  Shifting the data and writing it into the word device

0309 SMOV –  Transferring the digits

2122 SPLIT –  Splitting a string

2200 SOPEN –  Opening the socket

1205 SORT DSORT  Sorting the data

1511 SQR DSQR  Square root of a binary number

2201 SSEND –  Sending the data through the socket

0702 STMR – – Special timer

1201 SUM DSUM  Number of bits whose states are ON

0308 SWAP DSWAP  Exchange the high byte with the low byte

1603 T- –  Subtracting a time

1602 T+ –  Adding a time

1605 TCMP –  Comparing a time

2401 TKOFF –  Disabling a cyclic task

2400 TKON –  Enabling a cyclic task

1700 TKY DTKY – Ten key input


T – – 16-bit timer (unit: 100 ms)
1001 TMR

1002 TMRH – – 16-bit timer (unit: 1 ms)

1011 TMRM – – 16-bit timer (unit: 10 ms)


Writing the data to the control register in the special
1401 TO DTO 
module
2718 TPO – – The position planning table controls the output

1600 TRD –  Reading the time

3-57
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


Classification API Function
16-bit 32-bit instruction

0701 TTMR – – Teach mode timer

1601 TWR –  Writing the time

1606 TZCP –  Time zone comparison

U 1216 UNI –  Uniting the 16-bit data


Serial communication instruction exclusively for Delta
V 1814 VFDRW – –
AC motor drive
0800 WAND DAND  Logical AND operation

_3 1608 WWON – – Weekly working time setup

1900 WDT –  Watchdog timer

0808 WINV DINV  Logical reversed INV operation

W 0802 WOR DOR  Logical OR operation

1103 WSFL DWSFL  Shifting data in the word devices to the left

1102 WSFR DWSFR  Shifting data in the word devices to the right

1217 WSUM DWSUM  Getting the sum

0804 WXOR DXOR  Logical exclusive OR operation

0306 XCH DXCH  Exchanging data


X Setup for comparing the inputs of multiple work
0709 XCMP – –
stations
Y 0710 YOUT – – Comparing the outputs of multiple work stations

0055 ZCP DZCP  Zone comparison

1223 ZONE DZONE  Controlling the zone

2806 ZRNC DZRNC – Servo homing


Z
2810 ZRNM – – Setting the homing mode for Delta servo

1206 ZRST –  Resetting the zone

1228 – ZSET  Zone setup

3-58
4
Chapter 4 Instruction Structure
Table of Contents
4.1 Applied Instructions - API Description ........................................... 4-2
4.2 Operand Usage Description ............................................................ 4-5

4.3 Restrictions on the Use of Instructions .......................................... 4-7

4.4 Index Registers ............................................................................. 4-9


4.5 Pointer Registers ......................................................................... 4-12

4.6 Pointer Registers of Timers.......................................................... 4-14

4.7 Pointer Registers for 16-bit Counters .......................................... 4-16


4.8 Pointer Registers for 32-bit Counters .......................................... 4-18

4.9 File Register ................................................................................. 4-20

4-1
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.1 Applied Instructions - API Description


This section describes the way this manual documents each API instruction. Every instruction has its own instruction code
and API number. The instructions are divided into sections based on the related functions of the instructions, so that all
the arithmetic instructions are in one section, and all the comparison instructions are in another section. The following
example uses the MOV instruction. The API number of the instruction in the table is 0300, the instruction code is MOV,
and the function is transferring data.

API Instruction code Operand Function

0300 D MOV P S,D Transferring the data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S            
D       

_4
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

S       
D       

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol:

S : Data source

D : Data destination

1. The devices used by the instruction are listed in the operand column. S, D, n, and m are used as the operands
according to their functions. When more than one operand is used, and these operands share the same function,
they are differentiated by subscripts; for example, S1, and S2.

2. If you can use a 16-bit instruction as a 32-bit instruction, the letter D prepended to the 16-bit instruction code to form
the 32-bit instruction form. If you can use the instruction as a pulse instruction, the letter P is appended to the
instruction code. For example, “D***P” in which “***” is the instruction code indicates a 32-bit pulse instruction.

3. F in the operand area indicates a single precision floating point number (32-bit).

4. The solid circle ● indicates that the device can be modified by an index register, and the hollow circle ○ indicates
that the device cannot be modified by an index register. For example, the data register designated by the operand S
can be modified by an index register.

5. The applicable model is indicated in the table. You can check whether you can use the instruction as a pulse
instruction, a 16-bit instruction, a 32-bit instruction, or a 64-bit instruction according to the information in the table.

6. If you want to use an instruction in a function block, and the output (Y), input (X), and data (D) devices are supported
in the operands, you have to use the pointer registers. For a timer (T), a 16-bit counter (C), and a 32-bit counter (HC)

4-2
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

that are supported in the operands, you have to use the timer pointer register, the 16-bit counter pointer register,
and the 32-bit counter pointer register. Refer to Sections 4.4–4.7 for more information or Section 7.2.4 in the
ISPSoft manual or Section 8.2.2 in DIADesigner manual.

7. The symbols representing the MOV instruction in ISPSoft/DIADesigner are:

MOV, MOVP, DMOV, and DMOVP are the Instruction codes for this instruction

En: Enable

S: The data source (the applicable format of the operand is a word/double word.)

D: The data destination (the applicable format of the operand is a word/double word.)

Applied instructions composition

Some applied instructions are composed of instruction codes. For example, the EI, DI, and WDT instructions; however,
most applied instructions consist of instruction codes and several operands.

Every applied instruction has its own API number and instruction code. For example, the instruction code API 0300 is the
MOV (transfer data) instruction. You can enter an applied instruction in three ways.

Enter the instruction directly: you can enter the instruction in ISPSoft/DIADesigner. For the MOV instruction, enter
4_
the instruction name and the operands to designate “MOV D0

Enter the instruction by dragging: you can drag the MOV instruction from APIs in ISPSoft/DIADesigner to the ladder
diagram editor.

Enter the instruction from the toolbar: you can click API/FB Selection on the toolbar in ISPSoft/DIADesigner, and then
click API. Finally, click the MOV instruction in Data Transfer.

Source operand
S If there is more than one source operand, the source operands are represented by subscript (for
example S1, S2).
Destination operand
D If there is more than one destination operand, the destination operands are represented by
subscript (for example, D1, D2).
If the operand only can be a constant K/H or a register value, it is represented by m, m1, m2, n, n1, or n2.

The length of the operand (6-bit, 32-bit, or floating-point number instructions):


16-bit or 32-bit instructions
Operand values in instructions are divided into 16-bit values and the 32-bit values. In order to process data of difference
lengths, the instructions are divided into 16-bit and 32-bit instructions. To differentiate a 32-bit instruction from the 16-bit
form, a D is added in front of the 16-bit instruction code (16-bit MOV and 32-bit DMOV).

4-3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The floating-point number instruction


16-bit MOV instruction

When M1 is ON, the data in D0 is


transferred to D1.

32-bit DMOV instruction

When M1 is ON, the data in (D1,


D0) is transferred to (D3, D2).

Floating-point number instructions


Floating-point number instructions support 32-bit floating-point number instructions that correspond to the single-precision
floating-point number instructions. Refer to Chapter 2 for more information about floating-point numbers.

_4 32-bit single-precision floating-point number F+ instruction

When M0 is ON, the data in (D11,


D10) and (D21, D20) is
transferred to (D31, D30).

Continuous execution and pulse execution of instructions


1. Instruction execution can be divided into continuous and pulse execution. You can reduce the scan cycle with pulse
instructions because when the instruction is not executed, less time is needed to execute the program.
2. The pulse function allows the related instruction to enable the rising edge-triggered control input. The instruction is
ON for one scan cycle.
3. If the control input stays ON, and the related instruction is not executed, the control input must be switched from
OFF to ON again in order to execute the instruction.
4. The following shows the difference between pulse and continuous instruction:
Pulse execution When M1 switches from OFF to
ON, the MOVP instruction is
executed once. The instruction is
not executed again in the scan
cycle. Therefore, it is called a
pulse instruction.
Continuous execution Whenever M1 is ON during the
scan cycle, the MOV instruction
is executed once. Therefore, the
instruction is called a continuous
instruction.
When the conditional contact M1 is OFF, neither instruction is executed, nor the value in the destination
operand D changes.

4-4
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

4.2 Operand Usage Description


There are 2 types of operands in the DVP-ES3/EX3/SV3/SX3 Series: user-defined and system-defined.

User-defined operands

• Input relays: X0–X377 (octal format)

• Output relays: Y0–Y377 (octal format)

• Internal relays: M0–M8191

• Stepping relays: S0–S2047

• Timers: T0–T511

• 16-bit counters: C0–C511

• 32-bit counters: HC0–HC255

• Data registers: D0–D29999 or D0.0–D29999.15

• File registers: FR0–FR65535


4_
• Special auxiliary flags: SM0–SM4095

• Special data registers: SR0–SR2047

• Index registers: E0–E9

• Constants: The decimal constants are indicated by K, and the hexadecimal constants are indicated by 16#.

• Strings: “$”

• Floating-point numbers: The single-precision floating-point numbers are indicated by F.

• The length of the data in one register is generally 16 bits. If you want to store 32-bit data in the register, designate
two consecutive registers for the data.

• If the operand in a 32-bit instruction uses D0, it occupies the 32-bit data register composed of (D1, D0). D1
represents the higher 16 bits, and D0 represents the lower 16 bits. The same rule applies to the timer and the 16-bit
counter.

• When you use the 32-bit counter HC as the data register, it can only be used by the operand in a 32-bit instruction.

• You can only use index registers in 16-bit instructions.

Refer to Chapter 2 Devices for more information.

4-5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

System-defined operands

• The system assigns the variables to declare such as BOOL, WORD, INT and so on: U0–U16387 and W0–W29999.

• To start or stop a task use the TK0–TK31 instructions.

The following table lists the pointer type variable symbols, the supporting devices and usage.

Pointer type Usage

Device range PR0–PR15,PR0.0–PR15.15

General pointer Maximum quantity Use up to 16 pointers in each function block


(Pointer) Variable symbols of WORD/DWORD/LWORD/INT/DINT/LINT
Can be assigned to types or data register, input relay or output relay devices
(e.g. X0, Y0, etc.)

Device range TR0–TR7


Pointer for a timer
Maximum quantity Use up to 8 pointers in each function block
(T_POINTER)
_4
Can be assigned to Variable symbols of timer type or timer type devices

Device range CR0–CR7


Pointer for a counter
Maximum quantity Use up to 8 pointers in each function block
(C_POINTER)
Can be assigned to Variable symbols of counter type or counter type devices

Device range HCR0–HCR7


Pointer for a
high-speed counter Maximum quantity Use up to 8 pointers in each function block
(HC_POINTER) Variable symbols of 32-bit counter type or 32-bit counter type
Can be assigned to
devices

4-6
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

4.3 Restrictions on the Use of Instructions


 You can use the following instructions only in function blocks:

API0065 CHKADR, FB_NP, FB_PN, NED, ANED, ONED, PED, APED, OPED

 You cannot use the following instruction in interrupt tasks:

GOEND

 You cannot use the in function blocks:

LDP, ANDP, ORP, LDF, ANDF, ORF, PLS, PLF, NP, PN, MC/MCR, GOEND and all pulse instructions in applied
instructions.

If you want to use some of the instructions mentioned above, you can use the substitute instructions in the following
table.

Instruction which cannot be used in the function block Substitute instruction in the function block

LDP/ANDP/ORP PED/APED/OPED

LDF/ANDF/ORF NED/ANED/ONED
4_

PLS -

PLF -

NP FB_NP

PN FB_PN

MC -

MCR -

All pulse instructions in applied commands *1

*1: Pulse instructions cannot be used in function blocks. If you want to get the function of the pulse instruction in a
function block, refer to the following example.

Example:

1. First, declare 10 bit variables tempBit[10] to be used in the system.

2. When StartBit1 switches from OFF to ON, method 1 (network 1) and method 2 (network 2) can only execute the
MOV instruction once; you can choose which one to use.

3. You cannot use the variable tempBit in the system more than once.

4-7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_4
 Use the following instructions with the Ladder Programming Language
For the following instructions, you need to start the instruction execution while the PLC switch from STOP to RUN.
And when the following instructions stop executing, the PLC should stop programming too. It is suggested to use
the following instructions with the Ladder Programming Language. Do NOT use the programming language that
only does one time execution, for example, function blocks that only can be called once. Or do not use the
programming language that stops scanning once the executing the instruction stops, for example ST and SFC
programming languages. If the function block can be called several times by different programs, it is not suitable for
the following instructions either.

Type of Instruction Instructions


Timer and Counter
CNT, DCNT, DHSCS, DHSCR, DHSZ, DHSCY
Instructions
Peripheral
TKY, DTKY, HKY, DHKY, DSW, ARWS
Instructions
Miscellaneous
RAMP, DRAMP, MTR, INCD
Instruction
Module Instructions DPUCONF, PUSTAT
CANopen
Communication CANRS, COPRW, COPWL, DCOPWL, ZRNM, ECAMD, ECAMS, ECAMA, ECAMC
Instructions
Memory Card / File
MEMW
Register Instructions
Communication
DNETRW
Instructions
Other Instructions INFO

4-8
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

4.4 Index Registers


Index registers are 16-bit data registers. They are similar to the general register in that you can read data from them and
write data into them. However, they are mainly used as index registers. The range of index registers is E0–E9. It is not
recommended to use the index registers for global variables; they can only be used for partial variables and for temporary.

Index registers are used as follows.

1. Using the register name to modify the device:

4_

When M0 is ON, E0=10, E1=17, D1@E0=D (1+10)=D11, D11 is ON.

NOTE 1: DVP-ES3/EX3/SV3/SX3 Series support using the register name to modify the device; for example,
D0.1@E0 but does not support 2-layered modification for example, [email protected]@E0.

NOTE 2: When E0=17, D0.1@E0=D0.(1+17)=D1.2, and D1.2 is ON. The bit part 1@E0=(1+17)=18. However, the
maximum bit number is 15. Since m=18/16=1 and the remainder is 2, the last modification result is D (0+1).2=D1.2.
D1.2 is ON.

When M0 is ON, E0=10, and M1@E0=M (1+10)=M11. M11 is ON.

4-9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. Declaring the variables first, and then modifying the device:


 Declare the three variables StartBit, Var1, and Var2 in ISPSoft/DIADesigner.
The type of StartBit is a Boolean array, and its size is 2 bits. The range is from StartBit[0] to StartBit[1].
The type of Var1 is a word array, and its size is 11 words. The range is from Var1[0] to Var1[10].
The type of Var2 is a word, and its size is one word.

 When StartBit[0] is ON, E0=10, E1=1, Var1[0]@E0=Var1[10], Var2=Var1[10], and StarrtBit[0]@E1=StartBit[1].


StartBit[1] is ON.

_4

Additional remark: When you declare the variables in ISPSoft/DIADesigner, and the variables are added to the
contents of the registers to form the addresses to the actual data, you must note the addresses
to prevent the program from being executed incorrectly.

3. Using index registers in an interrupt instruction:

 The index registers E0~E9 in the main program (e.g. POU, SFC, and FB) are different from the ones
(index registers E0~E9) in the interrupt program. They are independent groups of index registers and
they work separately.

 You can use ISPSoft/DIADesigner to monitor the values of index registers in the main program.

 Application: If you use E0 in the main program and in the interrupt program. When an interrupt occurs,
before executing the interrupt program, the system stores the value of E0 in the main program. After the
interrupt program is executed, the value of E0 in the main program will be retained. So that the interrupt
program will not affect the value of E0 in the main program and the result of the main program execution
can stay unaffected.

 Refer to the following example, if you need to monitor the values of index registers E0-E9 in the
interrupt program, or if the main program is also using the values of index registers E0-E9 in the
interrupt program. (Note: It is NOT recommended to use index registers as global variables. If you need
to use it as a global variable, you need to declare or define other devices to use it as a global variable.)

4-10
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

 Example: Declare D100 as the variable of the index register E0. And this example use MOVE
instruction to demonstrate. Whenever an external interrupt occurs at X0, the value in D200 accumulates
the occurrences in the values in D1000 ~ D1199.

4_

4 - 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.5 Pointer Registers


 ISPSoft/DIADesigner supports function blocks. When the variable declaration type is VAR_IN_OUT, and the data
type is POINTER, the variable is a pointer register. The value in the pointer register can refer directly to the value
stored in a device X, Y, or D; and the pointer register can point to the address associated with the variable set
automatically in ISPSoft/DIADesigner.

 You can declare 16 pointer registers in every function block. The range is PR0–PR15, or PR0.0–PR15.15.

Example:

1. Create a program organization unit (POU) in ISPSoft/DIADesigner.

2. Create a function block called FB0.

_4 3. Create the program in the function block FB0.

4. Declare the variable in the function block FB0.

Choose VAR_IN_OUT as the declaration type, Point1 as the identifier, POINTER as the data type. The variable is
the pointer register.

5. Declare the variable in the program organization unit (POU).

6. Call the function block FB0 in the program organization unit (POU).

4-12
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

7. The program in the program organization unit (POU) operates as shown below.

Network 1: When StartBit[0] is ON, the address of D0 is transmitted to Point 1 in FB0.

When VarBit1 in FB0 is ON, E0=1, Var1=D0, Point1@E0=D (0+1)=D1, and Var2=D1.

Network 2: When StartBit[1] is ON, the address of CVar1[0] is transmitted to Point1 in FB0.

4_

Var2=CVar1[1]。When VarBit1 in FB0 is ON, E0=1, Var1=CVar1[0], Point1@E0=CVar1 (0+1)=Cvar1[1], and


Var2=CVar1[1].

4-13
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.6 Pointer Registers of Timers


 ISPSoft/DIADesigner supports function blocks. If you want to use a timer in a function block, you must declare a
timer pointer register in the function block. The address of the timer is transmitted to the timer pointer register when
the function block is called.

 When the variable declaration type is VAR_IN_OUT, and the data type is T_POINTER, the variable is the timer
pointer register. The value in the timer pointer register can refer directly to the value stored in the device T, or in the
variable which is the timer in ISPSoft/DIADesigner.

 You can declare up to 8 timer pointer registers in every function block. The range is TR0–TR7.

 If you want to use an instruction in the function block, and the timer is supported by the operands, you must use a
timer pointer register.

Example: using a timer in a function block.

1. Create a program organization unit (POU) in ISPSoft/DIADesigner.


_4 2. Create a function block which is called FB0.

3. Declare the variable in the function block FB0.

Choose VAR_IN_OUT as the declaration type, TPoint1 as the identifier, and T_POINTER as the data type. The
variable is the timer pointer register.

4. The program in the function block FB0 appears as shown below.

4-14
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

5. Declare the variable in the program organization unit (POU).

The data type of CVar1 should be TIMER.

6. Call the function block FB0 in the program organization unit (POU).

7. The program in the program organization unit (POU) operates as shown below.

Network 1: When StartBit[0] is ON, the address of T511 is transmitted to TPoint1 in FB0.

4_

When VarBit1 in the FB0 is ON, the TMR instruction is executed, and TPoint1 (T511) starts counting.
When the value of TPoint1 matches the TPoint1 setting, VarOut is ON.

Network 2: When StartBit[1] is ON, the address of CVar1[0] is transmitted to TPoint1 in FB0.

When VarBit1 in FB0 is ON, the TMR instruction is executed, and TPoint (CVar1) starts counting. When
the value of TPoint1 matches the TPoint1 setting, VarOut is ON.

4-15
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.7 Pointer Registers for 16-bit Counters


 ISPSoft/DIADesigner supports function blocks. If you want to use a 16-bit counter in a function block, you must
declare a 16-bit counter pointer register in the function block. The address of the 16-bit counter is transmitted to the
16-bit counter pointer register when the function block is called.

 When the variable declaration type is VAR_IN_OUT, and the data type is C_POINTE, the variable is the 16-bit
counter pointer register. The value in the 16-bit counter pointer register can refer directly to the value stored in the
device T, or in the variable which is the counter in ISPSoft/DIADesigner.

 You can declare up to eight 16-bit counter pointer registers in every function block. The range is CR0–CR7.

 If you want to use an instruction in the function block, and the counter is supported by the operands, you have to use
a 16-bit counter pointer register.

Example: using a 16-bit counter in a function block.

1. Create a program organization unit (POU) in ISPSoft/DIADesigner.


_4 2. Create a function block which is called FB0.

3. Declare the variable in the function block FB0.

Choose VAR_IN_OUT as the declaration type, CPoint1 as the identifier, C_POINTER as the data type. The variable
is a 16-bit counter pointer register.

4. The program in the function block FB0 appears as shown below:

5. Declare the variable in the program organization unit (POU).

The data type of CVar1 should be COUNTER.

6. Call the function block FB0 in the program organization unit (POU).

4-16
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

7. The program in the program organization unit (POU) operates as shown below.

Network 1: When StartBit[0] is ON, the address of C0 is transmitted to CPoint1 in FB0.

When VarBit1 in FB0 is ON, CPoint1 (C0) is ON.

Network 2: When StartBit[1] is ON, the address of CVar1 is transmitted to CPoint1 in FB0.

4_
When VarBit1 in FB0 is ON, CPoint1 (CVar1) is ON.

4-17
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.8 Pointer Registers for 32-bit Counters


 ISPSoft/DIADesigner supports function blocks. If you want to use a 32-bit counter in the function block, you must
declare a 32-bit counter pointer register in the function block. The address of the 32-bit counter is transmitted to the
32-bit counter pointer register when the function block is called.

 When the variable declaration type is VAR_IN_OUT, and the data type is HC_POINTER, the variable is a 32-bit
counter pointer register. The value in a 32-bit counter pointer register can refer directly to the value stored in the
device HC or in the variable which is the counter in ISPSoft/DIADesigner.

 You can declare up to eight 32-bit counter pointer registers in every function block. The range is HCR0–HCR7.

 If you want to use an instruction in the function block, and the 32-bit counter is supported by the operands, you must
use the 32-bit counter pointer register.

Example: using a 32-bit counter in a function block.

1. Create a function block called FB0.


_4

2. Declare the variable in the function block FB0.

Choose VAR_IN_OUT as the declaration type, HCPoint1 as the identifier, HC_POINTER as the data type. The
variable is a 32-bit counter pointer register.

3. The program in the function block FB0 appears as follows:

4. Declare the variable in the program organization unit (POU).

The data type of CVar1 should be COUNTER, and you must fill in the address column with a valid address of the
32-bit counter.

5. Call the function block FB0 in the program organization unit (POU).

6. The program in the program organization unit (POU) operates as follows:

4-18
Ch a pt er 4 Ins tr uc t i on Str uc t ur e

Network 1: When StartBit[0] is ON, the address of HC0 is transmitted to HCPoint1 in FB0.

When VarBit1 in FB0 is ON, HCPoint1 (HC0) is ON.

Network: When StartBit[1] is ON, the address of CVar1 is transmitted to HCPoint1 in FB0.

4_
When VarBit1 in FB0 is ON, HCPoint1 (CVar1) is ON.

4-19
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4.9 File Register


 DVP-ES3/EX3/SV3/SX3 Series PLC provides File registers (FR) for storing larger numbers of parameters.

 You can edit, upload, and download the parameters in the file registers with ISPSoft/DIADesigner.

 The values in file registers can be read while the PLC is running. Refer to the MEMW instruction (API 2303) in the
DVP-ES3/EX3/SV3/SX3 Series Programming Manual for more information about how to read and write parameters
to file registers.

_4

4-20
5
Chapter 5 Basic Instructions

Table of Contents
5.1 List of Basic Instructions ................................................................... 5-2

5.2 Basic Instructions.............................................................................. 5-3

5-1
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5.1 List of Basic Instructions


The following table lists the Basic instructions covered in this chapter.

Operation
Instruction code Function Operand time
(µs)
Loading contact A/Connecting contact
LD/AND/OR A in series/Connecting contact A in DX, X, Y, M, SM, S, T, C, HC, D 0.025
parallel
Loading contact B/Connecting contact
LDI/ANI/ORI B in series/Connecting contact B in DX, X, Y, M, SM, S, T, C, HC, D 0.03
parallel
OUT Driving the coil DY, Y, M, SM, S, T, C, HC, D 0.04
SET Keeping the device on DY, Y, M, SM, S, T, C, HC, D 0.04
MC/MCR Setting/Resetting the master control N 0.24
Starting the rising-edge
detection/Connecting the rising-edge
LDP/ANDP/ORP DX, X, Y, M, SM, S, T, C, HC, D 0.22
detection in series/Connecting the
rising-edge detection in parallel
Starting the Rising-edge Non-Active
LDIP/ANIP/ORIP detection /Connecting it in DX, X, Y, M, SM, S, T, C, HC, D 0.22
series/Connecting it in parallel
Starting the falling-edge
_5 detection/Connecting the falling-edge
LDF/ANDF/ORF DX, X, Y, M, SM, S, T, C, HC, D 0.22
detection in series/Connecting the
falling-edge detection in parallel
Starting the Falling-edge Non-Active
LDIF/ANIF/ORIF detection /Connecting it in DX, X, Y, M, SM, S, T, C, HC, D 0.22
series/Connecting it in parallel
Starting the rising-edge
detection/Connecting the rising
PED/APED/OPED X, Y, M, SM, S, T, C, HC, D 0.22
edge-detection in series/Connecting
the rising-edge detection in parallel
Starting the falling-edge
detection/Connecting the falling-edge
NED/ANED/ONED X, Y, M, SM, S, T, C, HC, D 0.22
detection in series/Connecting the
falling-edge detection in parallel
PLS Rising-edge output Y, M, SM, S, D 0.22
PLF Falling-edge output Y, M, SM, S, D 0.22
INV Inverting the logical operation result – 0.22
NP The circuit is rising edge-triggered. – 0.24
PN The circuit is falling edge-triggered. – 0.24
FB_NP The circuit is rising edge-triggered. Y, M, S, D 0.24
FB_PN The circuit is falling edge-triggered. Y, M, S, D 0.24

5-2
C ha pt er 5 Bas ic I ns t r uc t i ons

5.2 Basic Instructions


Instruction code Operand Function
Loading contact A/Connecting contact A in
LD/AND/OR S
series/Connecting contact A in parallel

Device DX DY X Y M SM S T C HC D
S          

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LD S : Specified device

AND

OR
5_
Explanation

1. LD applies to contact A that starts from the main line or contact A which is the start of a contact circuit. Use it to save
the current contents, and store the contact state in the accumulative register.

2. AND connects contact A in series. It reads the state of the contact that is specified as connected in series, and
performs the AND operation with the previous logical operation result. It stores the final result in the accumulative
register.

3. OR connects contact A in parallel. It reads the state of the contact that is specified as connected in parallel, and
performs the OR operation with the previous logical operation result. It stores the final result in the accumulative
register.

Example

1. Contact A of M0 is loaded, contact A of M1 is connected in series, contact A of M2 is connected in parallel, and the
coil M20 is driven.

2. When both M0 and M1 are ON, or when M2 is ON, M20 is ON.

5-3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function


Loading contact B/Connecting contact B in
LDI/ANI/ORI S
series/Connecting contact B in parallel

Device DX DY X Y M SM S T C HC D
S          

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LDI S : Specified device

ANI

ORI

Explanation
_5 1. LDI applies to contact B that starts from the main line or contact B that is the start of a contact circuit. Use it to save
the current contents, and store the contact state in the accumulative register.

2. ANI connects contact B in series. It reads the state of the contact that is specified as connected in series, and
performs the AND operation with the previous logical operation result. It stores the final result in the accumulative
register.

3. ORI connects contact B in parallel. It reads the state of the contact that is specified as connected in parallel, and
performs the OR operation with the previous logical operation result. It stores the final result in the accumulative
register.

Example

1. Contact B of M0 is loaded, contact B of M1 is connected in series, contact B of M2 is connected in parallel, and the
coil M20 is driven.

2. When both M0 and M1 are ON, or when M2 is ON, M20 is ON.

5-4
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

OUT D Driving the coil

Device DX DY X Y M SM S T C HC D
D      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

D 
Symbol

D : Specified device

Explanation

1. The logical operation result prior to the application of the OUT instruction is output to the specified device.

2. The following table describes the action of the coil contact.

OUT
Operation Contact
result Coil Contact A Contact B
5_
(normally open) (normally closed)
False OFF OFF ON
True ON ON OFF

Example

1. Contact B of M0 is loaded, contact A of M1 is connected in series, and the coil M20 is driven.

2. When M0 is OFF, and M1 is ON, M20 is ON.

5-5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function

SET D Keeping the device on

Device DX DY X Y M SM S T C HC D
D      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

D 
Symbol

D : Specified device

Explanation

When the instruction SET is driven, the specified device is set to ON. It does not matter if the SET instruction is still driven,
the specified device stays ON. You can set the specified device to OFF with the RST instruction.

Example
_5 1. Contact B of M0 is loaded, contact A of M1 is connected in series, and M20 stays ON.

2. When M0 is OFF, and M1 is ON, M20 is ON. Even if the operation result changes, M20 still stays ON.

5-6
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

MC/MCR N Setting/Resetting the master control

Symbol

Level of the nested


MC N : N0~N31
program structure

MCR

Explanation

1. MC sets the master control. When the MC instruction is executed, the instructions between MC and MCR are
executed as usual. When the MC instruction is OFF, the actions of the instructions between MC and MCR are as
described in the following table.
Instruction type Description
The timer value is reset to zero. The coil and the contact
General-purpose timer
are OFF.
The timer value is reset to zero. The coil and the contact
Timer in the function block
are OFF.
Accumulative timer
The coil is OFF. The timer value and the state of the 5_
contact remain the same.
The coil is OFF. The timer value and the state of the
Counter
contact remain the same.
Coils driven by OUT All coils are OFF.
Devices driven by SET and RST The states of the devices remain the same.
All applied instructions are not executed. The FOR/NEXT
loop is still repeated N times, but the actions of the
Applied instruction
instructions inside the FOR/NEXT loop follow those of the
instructions between MC and MR.
2. MCR resets the master control, and is placed at the end of the master control program. There should not be any
contact instruction before MCR.

3. MC/MCR supports the nested program structure. There are at most 32 levels of nested program structures
(N0–N31). Refer to the example below.

5-7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

_5

5-8
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function


Starting the rising-edge detection/Connecting the
LDP/ANDP/ORP S rising-edge detection in series/Connecting the
rising-edge detection in parallel

Device DX DY X Y M SM S T C HC D
S          

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LDP

ANDP S : Specified device

ORP

Explanation
5_
1. LDP stores the current contents, and stores the rising-edge detection of the contact in the accumulative register.

2. ANDP connects the rising-edge detection of the contact in series.

3. ORP connects the rising-edge detection of the contact in parallel.

4. The system must scan LDP/ANDP/ORP to get the state of the device. Changes to the device state are not detected
until LDP/ANDP/ORP is scanned the next time.

5. Use the corresponding PED, APED, and OPED instructions in subroutines.

Example

1. The rising-edge detection of M0 starts, the rising-edge detection of M1 is connected in series, the rising-edge
detection of M2 is connected in parallel, and the coil M20 is driven.

2. When both M0 and M1 are switched from OFF to ON, or when M2 is switched from OFF to ON, M20 is ON for a
scan cycle.

5-9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function


Starting the Rising-edge Non-Active detection
LDIP/ANIP/ORIP S /Connecting it in series/Connecting it in parallel

Device DX DY X Y M SM S T C HC D
S          

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LDIP

ANIP S : Specified device

ORIP

_5 Explanation

1. This instruction is available for ES3 CPU firmware V1.08.00 or later, which works with ISPSoft V3.18 or later
/DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later, which
works with DIADesigner V1.30 or later only.

2. The LDIP instruction is similar to the LDP instruction in usage, but they are different in action. The function of LDIF is
to save the current content and get the detected rising-edge status of the contact inverted and stored in the
accumulative register.

3. ANIP connects the rising-edge detection of the contact in series.

4. ORIP connects the rising-edge detection of the contact in parallel.

5. The system must scan LDIP/ANIP/ORIP to get the state of the device. Changes to the device state are not detected
until LDIP/ANIP/ORIP is scanned the next time.

5-10
C ha pt er 5 Bas ic I ns t r uc t i ons

Example

When M0 switches from OFF to ON, the value in D0 does not increase by one within a scan cycle.
But when M0 is ON or OFF, the value in D0 continues to increase.

3
D0 2

1
0
ON 5_
M0
OFF
#1 #2 #3 #4 #5 #6 Scan Cycle

5 - 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function


Starting the falling-edge detection/Connecting the
LDF/ANDF/ORF S falling-edge detection in series/Connecting the
falling-edge detection in parallel

Device DX DY X Y M SM S T C HC D
S          
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LDF

ANDF S : Specified device

ORF

_5 Explanation

6. LDF saves the current contents, and stores the contact falling-edge detection in the accumulative register.

7. ANDF connects the falling-edge detection of the contact in series.

8. ORP connects the falling-edge detection of the contact in parallel.

9. The system must scan LDF/ANDF/ORF to get the state of the device. Changes to the device state are not detected
until LDF/ANDF/ORF is scanned the next time.

10. Use the corresponding NED, ANED, and ONED instructions in subroutines.

Example

1. The falling-edge detection of M0 starts, the falling-edge detection of M1 is connected in series, the falling-edge
detection of M2 is connected in parallel, and the coil M20 is driven.

2. When both M0 and M1 switches from OFF to ON, or when M2 switches from OFF to ON, M20 is ON for a scan
cycle.

5-12
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function


Starting the Falling-edge Non-Active detection
LDIF/ANIF/ORIF S
/Connecting it in series/Connecting it in parallel

Device DX DY X Y M SM S T C HC D
S          

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 
Symbol

LDIF

ANIF S : Specified device

ORIF

Explanation 5_
1. This instruction is available for ES3 CPU firmware V1.08.00 or later, which works with ISPSoft V3.18 or later
/DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later, which
works with DIADesigner V1.30 or later only.

2. The LDIF instruction is similar to the LDIP instruction in usage, but they are different in action. The function of LDIF
is to save the current content and get the detected falling-edge status of the contact inverted and stored in the
accumulative register.

3. ANIF connects the falling-edge detection of the contact in series.

4. ORIF connects the falling-edge detection of the contact in parallel.

5. The system must scan LDIF/ANIF/ORIF to get the state of the device. Changes to the device state are not detected
until LDIF/ANIF/ORIF is scanned the next time.

5-13
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 switches from ON to OFF, the value in D0 does not increase by one within a scan cycle.
But when M0 is ON or OFF, the value in D0 continues to increase.

4
3
D0 2

1
_5 0
ON
M0
OFF
#1 #2 #3 #4 #5 #6 Scan Cycle

5-14
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function


Starting the rising-edge detection/Connecting the rising
PED/APED/OPED S1,S2 edge-detection in series/Connecting the rising-edge
detection in parallel

Device DX DY X Y M SM S T C HC D
S1         
S2    

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S1 
S2 
Symbol

PED S1 : Specified device

APED S2 : For internal use


5_

Output the state of the


OPED Q :
operation result

Explanation

1. PED/APED/OPED correspond to LDP/ANDP/ORP. The only difference between PED/APED/OPED and


LDP/ANDP/ORP is that you must specify the bit device S2 in which to store the previous state of the contact when
PED/APED/OPED is executed. Do not use the device S2 repeatedly in the program. Otherwise, the wrong execution
result appears.

2. APED connects the rising-edge detection of the contact in series.

3. OPED connects the rising-edge detection of the contact in parallel.

4. The system must scan PED/APED/OPED to get the state of the device. Changes to the device state are not
detected until PED/APED/OPED is scanned the next time

5. You can use PED/APED/OPED only in function blocks.

6. The state of the operation result is automatically output after the instruction is executed. You do not need to use an
input device for this.

5-15
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. The rising-edge detection of M0 starts, the rising-edge detection of M1 is connected in series, the rising-edge
detection of M2 is connected in parallel, and the coil M20 is driven.

2. When both M0 and M1 switch from OFF to ON, or when M2 switches from OFF to ON, M20 is ON for a scan cycle.

_5

5-16
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function


Starting the falling-edge detection/Connecting the
NED/ANED/ONED S1,S2 falling-edge detection in series/Connecting the
falling-edge detection in parallel

Device DX DY X Y M SM S T C HC D
S1         
S2    

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S1 
S2 
Symbol

NED S1 : Specified device

ANED S2 : For internal use

5_

Output the state of


ONED Q :
the operation result

Explanation

1. NED/ANED/ONED correspond to LDF/ANDF/ORF. The only difference between NED/ANED/ONED and


LDF/ANDF/ORF is that you must specify the bit device S2 in which to store the previous state of the contact when
NED/ANED/ONED is executed. Do not use the device S2 repeatedly in the program. Otherwise, the wrong
execution result appears.

2. ANED connects the falling-edge detection of the contact in series.

3. ONED connects the falling-edge detection of the contact in parallel.

4. The system must scan NED/ANED/ONED to get the state of the device. Changes to the device state are not
detected until NED/ANED/ONED is scanned the next time

5. You can use NED/ANED/ONED only in function blocks.

6. The state of the operation result is automatically output after the instruction is executed. You do not need to use
input device for this.

5-17
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. The falling -edge detection of M0 starts, the falling -edge detection of M1 is connected in series, the falling -edge
detection of M2 is connected in parallel, and the coil M20 is driven.

2. When both M0 and M1 switch from OFF to ON, or when M2 switches from OFF to ON, M20 is ON for a scan cycle.

_5

5-18
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

PLS D Rising-edge output

Device DX DY X Y M SM S T C HC D
D     

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

D 
Symbol

PLS D : Specified device

Explanation

1. When the conditional contact switches from OFF to ON, the PLS instruction is executed, and the device D sends out
a pulse for a scan cycle.

2. Do not use the PLS instruction in function blocks. 5_


3. ISPSoft V3.17 supports data type D and the BOOL type variable for declaration.

Example

When M0 is ON, M10 is ON for a pulse time. When M10 is ON, M20 is set to ON.

Timing diagram

M0
X0.0
On e scan cycle
M10
M0. 0

Y0.0
M20

5-19
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function

PLF D Falling-edge output

Device DX DY X Y M SM S T C HC D
D     

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

D 
Symbol

PLF D :Specified device

Explanation

1. When the conditional contact switches from ON to OFF, the instruction PLF is executed, and the device D sends out
a pulse for a scan cycle.

2. Do not use the instruction PLS in function blocks.


_5
3. ISPSoft V3.17 supports data type D and the BOOL type variable for declaration.

Example

When M0 is ON, M10 is ON for a pulse time. When M10 is ON, M20 is set to ON.

Timing chart

M0
X 0.0
On e scan c ycle
M10
M0

M20
Y 0.0

5-20
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

INV - Inverting the logical operation result

Symbol

Explanation
The logical operation result preceding the INV instruction is inverted, and the inversion result stored in the accumulative
register.

Example
When M0 is ON, M20 is OFF. When M0 is OFF, M20 is ON.

5_

5-21
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function

NP - Triggering the circuit on the rising edge.

Symbol

Explanation
1. When the value in the accumulative register switches from 0 to 1, the NP instruction keeps the value 1 in the
accumulative register for a scan cycle. After the second scan cycle is finished, the value in the accumulative register
changes to 0.
2. Use the FB_NP instruction in function blocks.

Example

Instruction Operation

_5 LD M0 Contact A of M0 is loaded.

AND M1 Contact A of M1 is connected in series.

NP The circuit is rising edge-triggered.

OUT M20 The coil M20 is driven.

Timing diagram

M0M0
M1M1
One scan cycle One sca n c ycle
M20
Y0 .0

5-22
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

PN - Triggering the circuit on the falling edge.

Symbol

Explanation

1. When the value in the accumulative register switches from 1 to 0, the PN instruction keeps the value 1 in the
accumulative register for a scan cycle. After the second scan cycle is finished, the value in the accumulative register
changes to 0.

2. Use the FB_ PN instruction in function blocks.

Example

5_
Instruction Operation

LD M0 Contact A of M0 is loaded.

AND M1 Contact A of M1 is connected in series.

PN The circuit is falling edge-triggered.

OUT M20 The coil M20 is driven.

Timing diagram

M0M 0
M1M 1 One s can c y cle One s can c ycle
M20
Y0 .0

5-23
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Operand Function

FB_NP S Triggering the circuit on the rising edge.

Device DX DY X Y M SM S T C HC D
S    

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 

Symbol

S : For internal use

Explanation

1. When the value in the accumulative register turns from 0 to 1, the FB_NP instruction keeps the value 1 in the
accumulative register for a scan cycle. After the second scan cycle is finished, the value in the accumulative register

_5 changes to 0.

2. The previous state of the contact is stored in the bit device S. Do not use S repeatedly in the program. Otherwise,
the wrong execution result appears.

3. Use FB_NP only in function blocks.

Example

Instruction Operation

LD M0 Contact A of M0 is loaded.

AND M1 Contact A of M1 is connected in series.

FB_NP D0.0 The circuit is rising edge-triggered.

OUT M20 The coil M20 is driven.

Timing diagram

M0
M0

M1
M1
One scan cycl e One scan cycl e
M20
Y0 .0

5-24
C ha pt er 5 Bas ic I ns t r uc t i ons

Instruction code Operand Function

FB_PN S Triggering the circuit on the falling edge.

Device DX DY X Y M SM S T C HC D
S    

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

S 

Symbol

S : For internal use

Explanation

1. When the value in the accumulative register switches from 1 to 0, the FB_PN instruction keeps the value 1 in the
accumulative register for a scan cycle. After the second scan cycle is finished, the value in the accumulative register
changes to 0.

2. The previous state of the contact is stored in the bit device S. Do not use S repeatedly in the program. Otherwise,
5_
the wrong execution result appears.

3. Use FB_PN only in function blocks.

Example

Instruction Operation

LD M0 Contact A of M0 is loaded.

AND M1 Contact A of M1 is connected in series.

FB_PN D0.0 The circuit is falling edge-triggered.

OUT M20 The coil M20 is driven.

Timing diagram

M0M0
M1M1 One scan cycl e One scan cycle

M20
Y 0. 0

5-25
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

MEMO

_5

5-26
6
Chapter 6 Applied Instructions

Table of Contents
6.1 Comparison Instructions ....................................................................... 6-4
6.1.1 List of Comparison Instructions ............................................................. 6-4
6.1.2 Explanation of Comparison Instructions ................................................. 6-7

6.2 Arithmetic Instructions ....................................................................... 6-46


6.2.1 List of Arithmetic Instructions ..............................................................6-46
6.2.2 Explanation of Arithmetic Instructions ..................................................6-48

6.3 Data Conversion Instructions ............................................................ 6-107


6.3.1 List of Data Conversion Instructions ................................................... 6-107
6.3.2 Explanation of Data Conversion Instructions ........................................ 6-108

6.4 Data Transfer Instructions ................................................................ 6-151


6.4.1 List of Data Transfer Instructions ....................................................... 6-151
6.4.2 Explanation of Data Transfer Instructions ............................................ 6-152

6.5 Jump Instructions ............................................................................. 6-180


6.5.1 List of Jump Instructions ................................................................... 6-180
6.5.2 Explanation of Jump Instructions ....................................................... 6-181

6.6 Program Execution Instructions ........................................................ 6-189


6.6.1 List of Program Execution Instructions ................................................ 6-189
6.6.2 Explanation of Program Execution Instructions .................................... 6-190

6.7 IO Refreshing Instructions ................................................................ 6-202


6.7.1 List of IO Refreshing Instructions ....................................................... 6-202
6.7.2 Explanation of IO Refreshing Instructions ............................................ 6-203

6.8 Miscellaneous Instructions ................................................................ 6-210


6.8.1 List of Convenience Instructions......................................................... 6-210
6.8.2 Explanation of Convenience Instructions ............................................. 6-211

6.9 Logic Instructions .............................................................................. 6-268


6.9.1 List of Logic Instructions ................................................................... 6-268
6.9.2 Explanation of Logic Instructions........................................................ 6-269

6.10 Rotation Instructions....................................................................... 6-290


6.10.1 List of Rotation Instructions ............................................................. 6-290
6.10.2 Explanation of Rotation Instructions ................................................. 6-291

6-1
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.11 Timer and Counter Instructions ....................................................... 6-302


6.11.1 List of Timer and Counter Instructions .............................................. 6-302
6.11.2 Explanation of Timer and Counter Instructions ................................... 6-303

6.12 Shift Instructions ............................................................................ 6-353


6.12.1 List of Shift Instructions .................................................................. 6-353
6.12.2 Explanation of Shift Instructions ...................................................... 6-354

6.13 Data Processing Instructions .......................................................... 6-396


6.13.1 List of Data Processing Instructions .................................................. 6-396
6.13.2 Explanation of Data Processing Instructions ...................................... 6-398

6.14 Structure Creation Instructions ....................................................... 6-462


6.14.1 List of Structure Creation Instructions .............................................. 6-462
6.14.2 Explanation of Structure Creation Instructions ................................... 6-463

6.15 Module Instructions ........................................................................ 6-471


6.15.1 List of Module Instructions .............................................................. 6-471
6.15.2 Explanation of Module Instructions ................................................... 6-472

6.16 Floating-point Number Instructions ................................................ 6-523


6.16.1 List of Floating-point Number Instructions ......................................... 6-523
6.16.2 Explanation of Floating-point Number Instructions ............................. 6-524

6.17 Real-time Clock Instructions ........................................................... 6-558


6.17.1 List of Real-time Clock Instructions .................................................. 6-558
6.17.2 Explanation of Real-time Clock Instructions ....................................... 6-559
_6
6.18 Peripheral Instructions.................................................................... 6-590
6.18.1 List of Peripheral Instructions .......................................................... 6-590
6.18.2 Explanation of Peripheral Instructions ............................................... 6-591

6.19 Communication Instructions ........................................................... 6-607


6.19.1 List of Communication Instructions................................................... 6-607
6.19.2 Explanation of Communication Instructions ....................................... 6-608
6.19.3 Descriptions of the Communication-related Flags and Registers ........... 6-694

6.20 Other Instructions ........................................................................... 6-697


6.20.1 List of Other Instructions ................................................................ 6-697
6.20.2 Explanation of Other Instructions ..................................................... 6-698

6.21 String Processing Instructions ........................................................ 6-710


6.21.1 List of String Processing Instructions ................................................ 6-710
6.21.2 Explanation of String Processing Instructions ..................................... 6-711

6.22 Ethernet Instructions ...................................................................... 6-773


6.22.1 List of Ethernet Instructions ............................................................ 6-773
6.22.2 Explanation of Ethernet Instructions ................................................. 6-774

6.23 Memory Card Instructions ............................................................... 6-820

6-2
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6.23.1 List of Memory Card Instructions ...................................................... 6-820


6.23.2 Explanation of Memory Card Instructions .......................................... 6-821

6.24 Task Control Instructions ................................................................ 6-842


6.24.1 List of Task Control Instructions ....................................................... 6-842
6.24.2 Explanation of Task Control Instructions ............................................ 6-843

6.25 SFC Instructions .............................................................................. 6-847


6.25.1 List of SFC Instructions ................................................................... 6-847
6.25.2 Explanation of SFC Instructions........................................................ 6-848

6.26 High-speed Output Instructions ...................................................... 6-855


6.26.1 List of High-speed Output Instructions .............................................. 6-855
6.26.2 Explanation of High-speed Output Instructions................................... 6-857

6.27 Delta CANopen and EtherCAT Communication Instructions ............. 6-971


6.27.1 List of Communication Instructions ................................................... 6-971
6.27.2 Explanation of CANopen and EtherCAT Instructions ............................ 6-972
6.27.3 Frequently asked questions in Delta special CANopen communication and
Troubleshooting ........................................................................... 6-1084

6_

6-3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.1 Comparison Instructions


6.1.1 List of Comparison Instructions
The following table lists the Comparison instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0000 LD= DLD= – S1=S2

0001 LD<> DLD<> – S1≠S2


0002 LD> DLD> – S1>S2

0003 LD>= DLD>= – S1≧S2

0004 LD< DLD< – S1<S2

0005 LD<= DLD<= – S1≦S2

0006 AND= DAND= – S1=S2

0007 AND<> DAND<> – S1≠S2


0008 AND> DAND> – S1>S2

0009 AND>= DAND>= – S1≧S2

0010 AND< DAND< – S1<S2

0011 AND<= DAND<= – S1≦S2

0012 OR= DOR= – S1=S2

0013 OR<> DOR<> – S1 ≠ S2


0014 OR> DOR> – S1>S2
_6 S1≧S2
0015 OR>= DOR>= –
0016 OR< DOR< – S1<S2

0017 OR<= DOR<= – S1≦S2

0018 – FLD= – S1=S2

0019 – FLD<> – S1≠S2


0020 – FLD> – S1>S2

0021 – FLD>= – S1≧S2

0022 – FLD< – S1<S2

0023 – FLD<= – S1≦S2

0024 – FAND= – S1=S2

0025 – FAND<> – S1≠S2


0026 – FAND> – S1>S2

0027 – FAND>= – S1≧S2

0028 – FAND< – S1<S2

0029 – FAND<= – S1≦S2

0030 – FOR= – S1=S2

0031 – FOR<> – S1≠S2

6-4
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Instruction code Pulse


API Function
16-bit 32-bit instruction

0032 – FOR> – S1>S2

0033 – FOR>= – S1≧S2

0034 – FOR< – S1<S2

0035 – FOR<= – S1≦S2

0036 LD$= – – S1=S2

0037 LD$<> – – S1≠S2


0042 AND$= – – S1=S2

0043 AND$<> – – S1≠S2


0048 OR$= – – S1=S2

0049 OR$<> – – S1≠S2


0054 CMP DCMP  Comparing values
0055 ZCP DZCP  Zone comparison
0056 – FCMP  Comparing the floating-point numbers
0057 – FZCP  Floating-point zone comparison
0058 MCMP –  Matrix comparison
Comparing tables
0059 CMPT= – 
ON: =
Comparing tables
0060 CMPT<> – 
ON: <>
Comparing tables
0061 CMPT> – 
ON: > 6_
Comparing tables
0062 CMPT>= – 
ON: ≧
Comparing tables
0063 CMPT< – 
ON: <
Comparing tables
0064 CMPT<= – 
ON: ≦

0065 CHKADR – – Checking the address in a pointer register


0066 LDZ= DLDZ= – |S1-S2|=|S3|
0067 LDZ<> DLDZ<> – |S1-S2|≠|S3|
0068 LDZ> DLDZ> – |S1-S2|>|S3|

0069 LDZ>= DLDZ>= – |S1-S2|≧|S3|

0070 LDZ< DLDZ< – |S1-S2|<|S3|

0071 LDZ<= DLDZ<= – |S1-S2|≦|S3|

0072 ANDZ= DANDZ= – |S1-S2|=|S3|


0073 ANDZ<> DANDZ<> – |S1-S2|≠|S3|
0074 ANDZ> DANDZ> – |S1-S2|>|S3|

0075 ANDZ>= DANDZ>= – |S1-S2|≧|S3|

6-5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse


API Function
16-bit 32-bit instruction

0076 ANDZ< DANDZ< – |S1-S2|<|S3|

0077 ANDZ<= DANDZ<= – |S1-S2|≦|S3|

0078 ORZ= DORZ= – |S1-S2|=|S3|


0079 ORZ<> DORZ<> – |S1-S2|≠|S3|
0080 ORZ> DORZ> – |S1-S2|>|S3|

0081 ORZ>= DORZ>= – |S1-S2|≧|S3|

0082 ORZ< DORZ< – |S1-S2|<|S3|

0083 ORZ<= DORZ<= – |S1-S2|≦|S3|

_6

6-6
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6.1.2 Explanation of Comparison Instructions

API Instruction code Operand Function

0000-0005 D LD※ S1,S2 Comparing values LD※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source 1

S2 : Data source 1

Taking LD= and DLD= for example

Explanation
6_
1. These instructions compare the values in S1 and S2. Take the LD= instruction for example. When the comparison
result is that the value in S1 is equal to that in S2, the continuity condition of the instruction is met. When the
comparison result is that the value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit counter, but not the device E.

16-bit 32-bit Continuity Discontinuity


API number
instruction instruction condition condition
0000 LD= DLD= S1=S2 S1≠S2

0001 LD<> DLD<> S1≠S2 S1=S2

0002 LD> DLD> S1>S2 S1≦S2

0003 LD>= DLD>= S1≧S2 S1<S2

0004 LD< DLD< S1<S2 S1≧S2

0005 LD<= DLD<= S1≦S2 S1>S2

6-7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When the value in C10 is equal to 200, M10 is ON.

2. When the value in D200 is greater than -30, M11 stays ON.

3. When the value in (C201, C200) is less than 678,493, or when M3 is ON, M50 is ON.

_6

6-8
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0006-0011 D AND※ S1,S2 Comparing values AND※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source 1

S2 : Data source 2

Taking AND= and DAND=


for example
Explanation

1. These instructions compare the values in S1 and S2. Take the AND= instruction for example. When the comparison
result is that the value in S1 is equal to that in S2, the continuity condition of the instruction is met. When the 6_
comparison result is that the value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit counter, but not the device E.

16-bit Continuity Discontinuity


API number 32-bit instruction
instruction condition condition
0006 AND= DAND= S1=S2 S1≠S2
0007 AND<> DAND<> S1≠S2 S1=S2
0008 AND> DAND> S1>S2 S1≦S2

0009 AND>= DAND>= S1≧S2 S1<S2


0010 AND< DAND< S1<S2 S1≧S2

0011 AND<= DAND<= S1≦S2 S1>S2

6-9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When M0 is ON and the current value in C10 is equal to 100, M10 is ON.

2. When M1 is OFF and the value in D0 is not equal to -10, M11 stays ON.

3. When M2 is ON and the value in (D11, D10) is less than 678,493, or when M3 is ON, M50 is ON.

_6

6-10
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0012-0017 D OR※ S1,S2 Comparing values OR※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source 1

S2 : Data source 2

Taking OR= and DOR= for example

Explanation

1. These instructions compare the values in S1 and S2. Take the OR= instruction for example. When the comparison
6_
result is that the value in S1 is equal to that in S2, the continuity condition of the instruction is met. When the
comparison result is that the value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit counter, but not the device E.

16-bit 32-bit Continuity Discontinuity


API number
instruction instruction condition condition
0012 OR= DOR= S1=S2 S1≠S2

0013 OR<> DOR<> S1≠S2 S1=S2

0014 OR> DOR> S1>S2 S1≦S2

0015 OR>= DOR>= S1≧S2 S1<S2

0016 OR< DOR< S1<S2 S1≧S2

0017 OR<= DOR<= S1≦S2 S1>S2

6 - 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When M1 is ON, or when the current value in C10 is equal to 100, M10 is ON.

2. When both M2 and M30 are ON, or when the value in (D101, D100) is greater than or equal to 1000,000, M60 is
ON.

_6

6-12
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Comparing floating-point numbers LD
0018-0023 FLD※ S1,S2

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
Symbol
S1 : Data source 1

S2 : Data source 2

Taking FLD= for example

Explanation

1. These instructions compare the 32-bit single precision floating point number 6_
2. Compare values in S1 and S2. Take the FLD= instruction for example. When the comparison result is that the value
in S1 is equal to that in S2, the continuity condition of the instruction is met. When the comparison result is that the
value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met. Refer to Additional Remarks
point 2 below for more information on the instruction of FLD=.

32-bit Continuity Discontinuity


API number
instruction condition condition
0018 FLD= S1=S2 S1≠S2

0019 FLD<> S1≠S2 S1=S2

0020 FLD> S1>S2 S1≦S2

0021 FLD>= S1≧S2 S1<S2

0022 FLD< S1<S2 S1≧S2

0023 FLD<= S1≦S2 S1>S2

6-13
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Take the FLD= instruction for example. When the value in D0 is larger than 1.999 and is smaller than 2.001, M10 is ON.

Additional remarks

1. If the value in S1 or S2 exceeds the range of values that can be represented by floating-point numbers, the contact is
OFF, SM is ON, and the error code in SR0 is 16#2013.

2. If the floating-point value in S1 or S2 is from external input, or from the software, chances are a minor value
difference may occur and the result of the “FLD=” instruction may not be dependable. Use instructions “FLD<” and”
FAND>” or “FLD>” and “FAND<” instead when the floating-point value in S1 or S2 is from external input, or from the
software.

_6

6-14
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Comparing floating-point numbers
0024-0029 FAND※ S1,S2
AND※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
Symbol

S1 : Data source 1

S2 : Data source 2

Taking FAND= and DFAND= for example

Explanation

1. These instructions compare the 32-bit single precision floating point numbers
6_
2. Compare values in S1 and S2. Take the FAND= instruction for example. When the comparison result is that the value
in S1 is equal to that in S2, the continuity condition of the instruction is met. When the comparison result is that the
value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met.

32-bit Continuity Discontinuity


API number
instruction condition condition
0024 FAND= S1=S2 S1≠S2
0025 FAND<> S1≠S2 S1=S2
0026 FAND> S1>S2 S1≦S2

0027 FAND>= S1≧S2 S1<S2


0028 FAND< S1<S2 S1≧S2

0029 FAND<= S1≦S2 S1>S2

6-15
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Take the instruction FAND= for example. When M0 is ON and the value in D0 is equal to that in D2, M10 is ON.

Additional remarks

1. If the value in S1 or S2 exceeds the range of values that can be represented by floating-point numbers, the contact is
OFF, SM is ON, and the error code in SR0 is 16#2013.

_6

6-16
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Comparing floating-point numbers
0030-0035 FOR※ S1,S2
OR※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
Symbol
S1 : Data source1

S2 : Data source2

Taking FOR= and DFOR= for example

Explanation

1. These instructions compare the 32-bit single precision floating point numbers.
6_
2. Compare values in S1 and S2. Take the FOR= instruction for example. When the comparison result is that the value
in S1 is equal to that in S2, the continuity condition of the instruction is met. When the comparison result is that the
value in S1 is not equal to that in S2, the discontinuity condition of the instruction is met.

32-bit Continuity Discontinuity


API number
instruction condition condition
0030 FOR= S1=S2 S1≠S2

0031 FOR<> S1≠S2 S1=S2

0032 FOR> S1>S2 S1≦S2

0033 FOR>= S1≧S2 S1<S2

0034 FOR< S1<S2 S1≧S2

0035 FOR<= S1≦S2 S1>S2

6-17
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, or when the value in D0 is equal to that in D2, M10 is ON.

Additional remarks

1. If the value in S1 or S2 exceeds the range of values that can be represented by floating-point numbers, the contact is
OFF, SM is ON, and the error code in SR0 is 16#2013.

_6

6-18
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0036-0037 LD$※ S1,S2 Comparing strings LD$※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
Symbol

S1 : Data source1

S2 : Data source2

Taking LD$= for example

Explanation

1. These instructions compare the strings in S1 and S2.

2. S1 and S2 can contain strings up to 256 characters (16#00 the end symbol is included). 6_
3. Take the instruction LD$= for example. When the comparison result is that the value in S1 is equal to that in S2, the
continuity condition of the instruction is met. When the comparison result is that the value in S1 is not equal to that in
S2, the discontinuity condition of the instruction is met.

16-bit Continuity Discontinuity


API number
instruction condition condition
0036 LD$= S1=S2 S1≠S2

0037 LD$<> S1≠S2 S1=S2


4. Only when the data in S–S+n (n indicates the nth device, up to 256 characters in each string) includes 16#00 can the
data be compared complete strings. For example:

b 15 b8 b7 b0

S 16#32( 2) 16#31( 1)

S+1 16#34( 4) 16#33( 3)

S+2 16#00 16#35( 5)

" 12345 "

6-19
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. When the two strings are the same, the corresponding comparison results of the instructions are listed below. For
example:
b 15 b8 b7 b0 b1 5 b 8 b7 b0
S1 16#42(B) 16#41( A) Compar ison sign S2 16#42(B) 16#41(A)
S1 +1 16#44(D) 16#43(C) S2 +1 16#44(D) 16#43(C)
S1 +2 16#00 16#45(E) S2 +2 16#00 16#45(E)

“ABCDE” “ ABCDE”

Comparison symbol Comparison operation result


$= Continuity
$<> Discontinuity

Example

When the string starting with the data in D0-16#00 is equal to the string staring with D2-16#00, M10 is ON.

_6
Additional remarks

1. If the string contains more than 256 characters or the string does not end with 16#00, the instruction is not executed,
SM is ON, and the error code in SR0 is 16#200E.

2. During the string comparison, the string ends when the end symbol 16#00 is found. The symbol 16#00 determines
the length of the string.

6-20
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0042-0043 AND$※ S1,S2 Comparing strings AND$※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
Symbol
S1 : Data source1

S2 : Data source2

Taking AND$= for example

Explanation
1. These instructions compare the strings in S1 and S2.
2. S1 and S2 can contain string up to 256 characters (16#00 the end symbol is included). 6_
3. Take the AND$= instruction for example. When the comparison result is that the value in S1 is equal to that in S2, the
continuity condition of the instruction is met. When the comparison result is that the value in S1 is not equal to that in
S2, the discontinuity condition of the instruction is met.
16-bit Continuity Discontinuity
API number
instruction condition condition
0042 AND$= S1=S2 S1≠S2

0043 AND$<> S1≠S2 S1=S2

Only when the data in S–S+n (n indicates the nth device, up to 256 characters in each string) includes 16#00 can the
instruction compare the data as complete strings. For example:

b 15 b8 b7 b0

S 16#32( 2) 16#31( 1)

S+1 16#34( 4) 16#33( 3)

S+2 16#00 16#35( 5)

" 12345 "

6-21
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. When two strings are the same, the corresponding comparison operation results of the instructions are listed below.
For example:

b1 5 b8 b7 b0 b 15 b8 b 7 b0
S1 16#42( B) 16#41(A) S2 16#42(B) 16#41( A)
Comparison sign
S1 +1 16#44(D) 16#43(C) S2 +1 16#44(D) 16#43(C)
S1 +2 16#00 16#45(E) S2 +2 16#00 16#45(E)

“ ABCDE” “ABCDE”

Comparison symbol Comparison operation result


$= Continuity
$<> Discontinuity

Example

When the string starting with the data in D0-16#00 is equal to the string staring with D2-16#00, M10 is ON.

_6

Additional remarks

1. If the string contains more than 256 characters or the string does not end with 16#00, the instruction is not executed,
SM is ON, and the error code in SR0 is 16#200E.

2. During the string comparison, the string ends when the end symbol 16#00 is found. The symbol 16#00 determines
the length of the string.

6-22
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0048-0049 OR$※ S1,S2 Comparing strings OR$※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
Symbol
S1 : Data source1

S2 : Data source2

Taking OR$= for example

Explanation
1. These instructions compare the strings in S1 and S2.
6_
2. S1 and S2 can contain up to 256 characters (16#00 the end symbol is included).
3. Take the instruction OR$= for example. When the comparison result is that the value in S1 is equal to that in S2, the
continuity condition of the instruction is met. When the comparison result is that the value in S1 is not equal to that in
S2, the discontinuity condition of the instruction is met.

16-bit Continuity Discontinuity


API number
instruction condition condition
0048 OR$= S1=S2 S1≠S2
0049 OR$<> S1≠S2 S1=S2

Only when the data in S–S+n (n indicates the nth device, up to 256 characters in each string) includes 16#00 can the
instruction compare the data as complete strings. For example:
b 15 b8 b7 b0

S 16#32( 2) 16#31( 1)

S+1 16#34( 4) 16#33( 3)

S+2 16#00 16#35( 5)

" 12345 "

6-23
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. When two strings are the same, the corresponding comparison operation results of the instructions are listed below.
For example:

b 15 b8 b7 b0 b15 b8 b7 b0
S1 16#42(B) 16#41(A) S2 16#42(B) 16#41(A)
Comparison sign
S1 +1 16#44(D) 16#43(C) S 2 +1 16#44(D) 16#43( C)
S1 +2 16#00 16#45(E) S 2 +2 16#00 16#45( E)

“ABCDE” “AB CDE”

Comparison symbol Comparison operation result


$= Continuity
$<> Discontinuity

Example

When the string starting with the data in D0-16#00 is equal to the string staring with D2-16#00, M10 is ON.

_6

Additional remarks

1. If the string contains more than 256 characters or the string does not end with 16#00, the instruction is not executed,
SM is ON, and the error code in SR0 is 16#200E.

2. During the string comparison, the string ends when the end symbol 16#00 is found. The symbol 16#00 determines
the length of the string.

6-24
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0054 D CMP P S1,S2,D Comparing values

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Comparison value1

S2 : Comparison value2

D : Comparison result

6_

Explanation

1. These instructions compare the single decimal numbers in S1 and S2 and store the comparison results in D.

2. The operand D occupies 3 consecutive devices. The comparison results are stored in D, D+1, and D+2. If the value
in S1 is greater than the value in S2, D is ON. If the value in S1 is equal to the value in S2, D+1 is ON. If the value in
S1 is less than the value in S2, D+2 is ON.

3. Only the DCMP and DCMPP instructions can use the 32-bit counter, but not the device E.

6-25
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. If the operand D is M0, the comparison results are stored in M0, M1 and M2, as shown below.

2. When M0 is ON, the CMP instruction is executed. M10, M11, or M12 is ON. When M0 is OFF, the execution of the
CMP instruction stops and the state of M10, the state of M11, and the state of M12 remain unchanged.

3. If you need to clear the comparison result, use the RST or ZRST instruction.

_6

Additional remarks

1. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.

2. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-26
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0055 D ZCP P S1,S2,S,D Zone comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S         
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
S      
D 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
Minimum value of the zone
S1 :
comparison
Maximum value of the zone
S2 :
comparison
S : Comparison value

D : Comparison result 6_

Explanation

1. These instructions compare signed decimal numbers in S and S1, and compare the signed decimal numbers in S
and S2, and stores the comparison results in D.

2. The value in S1 must be less than that in S2. If the value in S1 is larger than that in S2, S1 is the maximum/minimum
value during the execution of the ZCP instruction.

3. The operand D occupies three consecutive devices. The comparison results are stored in D, D+1, and D+2.
If the value in S1 is less than the value in S, D is ON.
If the value in S is between the values in S1 and S2, D+1 is ON.
If the value in S is greater than the value in S2, D+2 is ON.

4. Only the DZCP and DZCPP instructions can use the 32-bit counter, but not the device E.

6-27
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. If the operand D is M0, the comparison results are stored in M0, M1 and M2, as shown below.

2. When M0 is ON, the ZCP instruction is executed. M10, M11, or M12 is ON. When M0 is OFF, the ZCP instruction is
not executed, and the state of M10, the state of M11, and the state of M12 remain unchanged.

3. If you need to clear the comparison result, use the RST or ZRST instruction.

_6

Additional remarks

1. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.

2. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-28
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0056 FCMP P S1,S2,D Comparing floating-point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3
Symbol
S1 : Floating-point comparison value1

S2 : Floating-point comparison value2

D : Comparison result

6_
Explanation

1. This instruction compares the floating-point numbers in S1 and S2, and stores the comparison results (>,=,<) in
D.

2. The operand D occupies three consecutive devices. The comparison results are stored in D, D+1, and D+2. If the
value in S1 is greater than the value in S1, D is ON. If the value in S1 is equal to the value in S2, D+1 is ON. If the
value in S1 is less than the value in S2, D+2 is ON.

Example

1. If the operand D is M10, the comparison results is stored in M10, M11 and M12, as shown below.

2. When M0 is ON, the FCMP instruction is executed. M10, M11, or M12 is ON. When M0 is OFF, the FCMP
instruction is not executed and the state of M10, the state of M11, and the state of M12 remain unchanged.

3. If you want to get the comparison result ≧, ≦, or ≠, connect M10–M12 is series or in parallel.

4. If you want to clear the comparison result, use the RST or ZRST instruction.

6-29
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the value in S1 or S2 exceeds the range of values that can be represented by the floating-point numbers, the
contact is OFF, SM is ON, and the error code in SR0 is 16#2013.

2. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.

3. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

_6

6-30
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0057 FZCP P S1,S2,S,D Floating-point zone comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
S 
D 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3
Symbol
Minimum value of the zone
S1 :
comparison
Maximum value of the zone
S2 :
comparison
S : Comparison value

D : Comparison result 6_
Explanation

1. This instruction compares the floating-point numbers in S and S1, and compare the floating-point numbers in S with
that in S2, and then stores the results in D.

2. The value in S1 must be less than that in S2. If the value in S1 is larger than that in S2, S1 is the maximum/minimum
value during the execution of the FZCP instruction.

3. The operand D occupies three consecutive devices. The comparison results are stored in D, D+1, and D+2. If the
value in S1 is greater than the value in S, D is ON. If the value in S is between the value in S1 and the value in S2,
D+1 is ON. If the compared value in S2 is less than the value in S, D+2 is ON.

Example

1. If the operand D is M0, the comparison results are stored in M0, M1 and M2.

2. When M0 is ON, the FZCP instruction is executed. M10, M11, or M12 is ON. When M0 is OFF, the FZCP instruction
is not executed, and the state of M10, the state of M11, and the state of M12 remain unchanged.

3. If you want to clear the comparison result, use the RST or ZRST instruction.

6-31
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the value in S1 or S2 or S exceeds the range of values that can be represented by the floating-point numbers, the
contact is OFF, SM is ON, and the error code in SR0 is 16#2013.

2. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.

3. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

_6

6-32
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0058 MCMP P S1,S2,n,D Matrix comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
n  
D  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1 : Matrix source device 1

S2 : Matrix source device 2

n : Length of the array

D : Pointer 6_

Explanation

1. This instruction searches for the bits with different states, starting from the bits specified by adding one to the current
value in D. After finding the bits with different states, the instruction stores the bit number in D, and the comparison
is finished.

2. The operand n must be between 1–256.

3. When SM607 is ON, the equivalent values are compared. When SM607 is OFF, the different values are compared.
When the matching bits are found, the comparison stops immediately, and SM610 is ON. When the last bits are
compared, SM608 is ON, and the bit number is stored in D. The comparison starts from the 0th bits in the next scan
cycle, and SM609 is ON. When the value in D exceeds the range, SM611 is ON.

4. When the MCMP instruction is executed, you need a 16-bit register to specify a certain bit among the 16n bits in the
matrix for the operation. The register is called the pointer, and is specified by you. The value in the register is
between 0–16n-1, and corresponds to the bit between b0 to b16n-1. During the operation, you are prevented from
altering the value of the pointer in case the search for the matching bits is affected. If the value of the pointer
exceeds the range, SM611 is ON, and the MCMP instruction is not executed.

5. If SM608 and SM610 occur simultaneously, they are ON simultaneously.

6-33
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When M0 is switched from OFF to ON, SM609 is OFF. The search for the bits with different states (SM607 is OFF)
starts from the bits specified by the adding one to the current value of the pointer.

2. Suppose the current value in D20 is 2. When M0 is switched from OFF to ON four times, you get the following
execution results.

 The value in D20 is 5, SM610 is ON, and SM608 is OFF.

 The value in D20 is 45, SM610 is ON, and SM608 is OFF.

 The value in D20 is 47, SM610 is OFF, and SM608 is ON.

 The value in D20 is 1, SM610 is ON, and SM608 is OFF.

2 Pointer
b0 D20
S1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
b47
MCMP
b0
_6 S2 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1
b47

Additional remarks

1. Operation error codes: If the devices S1+n-1 and S2+n-1 exceed the range, the MCMP instruction is not executed,
SM is ON, and the error code in SR0 is 16#2003. If the value in the operand n is not between 1 and 256, the MCMP
instruction is not executed, SM is ON, and the error code in SR0 is 16#200B.
2. Operation flags:
Matrix comparison flag.

SM607: ON: comparing equivalent values

OFF: comparing different values

SM608: The matrix comparison ends. When the last bits are compared, SM608 is ON.

SM609: ON: the comparison starts from bit 0.

Matrix bit search flag. When the matching bits are found, the comparison stops immediately, and
SM610:
SM610 is ON.

Matrix pointer error flag. When the value of the pointer exceeds the comparison range, SM611 is
SM611:
ON.

6-34
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0059-0064 CMPT※ P S1,S2,n,D Comparing tables

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2     
n        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
n  
D 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1 : Source device 1

S2 : Source device 2

n : Data length

D : Comparison result 6_

Explanation

1. This instruction compares n signed decimal numbers in devices starting at S1 with those in devices starting at S2,
and then stores the comparison results in D.

2. The operand n must be between 1–256.

3. The value that is written into the operand D is a one-bit value.

4. When the results of the comparison using the CMPT# instruction are that all devices are ON, SM620 is ON.
Otherwise, SM620 is OFF.

5. If the operand S1 is a device, the comparison is as shown below.


Comparison result
S1 1234(BIN) S2 1111(BIN) D 1
S 1 +1 5678(BIN) S2 +1 2222(BIN) D +1 1
S 1 +2 5000(BIN) Comparison sign S2 +2 3333(BIN) D +2 1
S 1 +3 1000(BIN) n > S2 +3 4444(BIN) n D +3 0
~

S1 +(N-2) 10(BIN) S2 +(N-2) 8888(BIN) D +(N-2) 0


S1 +(N-1) 90(BIN) S 2 +(N-1) 9999(BIN) D +(N-1) 0

6-35
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. If the operand S1 is a constant between -32768 to 32767, the comparison is as shown below.
Compar ison result
S2 1111(BIN) D 0
S2 +1 2222(B IN) D +1 0
Compariosn sign S2 +2 3333(B IN) D +2 1
S1 3333(B IN) = S2 +3 4444(B IN) n D +3 0

~
S 2 +(N-2) 8888(B IN) D +( N-2) 0
S2 +(N-1) 9999(B IN) D +(N-1) 0

7. The corresponding comparison operation results of the instructions are listed in the following table.

Comparison operation result


API number 16-bit instruction
ON OFF
0059 CMPT= S1=S2 S1≠S2

0060 CMPT<> S1≠S2 S1=S2

0061 CMPT> S1>S2 S1≦S2

0062 CMPT>= S1≧S2 S1<S2

0063 CMPT< S1<S2 S1≧S2

0064 CMPT<= S1≦S2 S1>S2

Example

The data in D0–D3 are compared with that in D10–D13. If the comparison result is that the data in D0–D3 are the same as
that in D10–D13, M11–M14 are ON.

_6

C ompari son
比較結果
resul t
1000 C om pari son
D0 si gn D10 1000 M11 1
比較符號
D1 2000 = D11 1000 M12 0
D2 3000 D12 1000 M13 0
D3 4000 D13 1000 M14 0

Additional remarks

1. If the value in the operand n is not between 1–256, the instruction is not executed, SM is ON, and the error code in
SR0 is 16#200B.

2. If the number of devices specified by S1–S1+n, S2–S2+n, or D is insufficient, the instruction is not executed, SM0 is
ON, and the error code in SR0 is 16#2003.

6-36
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Checking the addresses in a pointer
0065 CHKADR S,n,D
register

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S
n        
D  
DWORD
  

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S
n  
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
Symbol

S : Pointer register

n : Number of devices

D : Check result

6_
Explanation

1. This instruction checks whether the value in S and (the value in S)+n-1 exceed the device range. If the result is that
the value in S and (the value in S)+n-1 do not exceed the device range, the device D is ON. Otherwise, it is OFF.

2. S supports the pointer registers D, T, C, HC (POINTER/T_POINTER/C_POINTER/HC_POINTER).

3. The operand n must be between 1–1024.

4. You can use the CHKADR instruction only in a function block. Use CHKADR during the initial program development
phase or when you are not sure if the device range will be exceeded. After the program is written and debugged,
you can delete this instruction.

6-37
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. Create a program (Prog0) and a function block (FB0) in ISPSoft.

Declare two variables in the program.

2. Declare VarPR1, VarTR1, VarCR1, and VarHCR1 in the function block, and assign the data types POINTER,
T_POINTER, C_POINTER, and HC_POINTER to them respectively.

_6

3. Call the function block FB0 in the program, and assign D29999, T0, C511, and HC50 to VarPR1, VarTR1, VarCR1,
and VarHCR1 in FB0 respectively.

4. Use the CHKADR instruction to check whether VarPR1, VarTR1, VarCR1, and VarHCR1 exceed the range.

5. When chkPR is ON, the actual device represented by VarPR1 is D29999. Since the legal range of devices is from
D0 to D29999, and D29999+10-1=D30008 which exceeds the range, PR_ChkBit is OFF.

6-38
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6. When chkTR is ON, the actual device represented by VarTR1 is T0. Since the legal range of devices is from T0 to
T511, and T0+10-1=T9 which does not exceed the range, TR_ChkBit is ON.

7. When chkCR is ON, the actual device represented by C511. Since the legal range of devices is from C0 to C511,
and C511+10-1=C520 which exceeds the range, CR_ChkBit is OFF.

8. When chkHCR is ON, the actual device represented by HC50 is VarHCR1. Since the legal range of deices is from
HC0 to HC255, and HC50+10-1=HC59 which does not exceed the range, HCR_ChkBit is ON.
6_

Additional remarks

1. If the value (the actual device address) in S exceeds the device range, the CHKADR instruction is not executed, SM
is ON, and the error code in SR0 is 16#2003.

2. If the value in the operand n is not between 1–1024, the CHKADR instruction is not executed, SM is ON, and the
error code in SR0 is 16#200B.

6-39
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

Comparing contact type


0066- 0071 D LDZ※ S1,S2,S3
absolute values LDZ※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
S3      

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source1

S2 : Data source2

S3 : Comparison result

Taking LDZ= and DLDZ= for example


_6
Explanation

1. These instructions compare the absolute value of the difference between S1 and S2 with the absolute value of S3.
Take the LDZ= instruction for example. If the comparison result is that the absolute value of the difference between
S1 and S2 is equal to the absolute value of S3, the continuity condition of the instruction is met. If the comparison
result is that the absolute value of the difference between S1 and S2 is not equal to the absolute value of S3, the
discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit HC device, but not the device E.

16-bit 32-bit Continuity Discontinuity


API number
instruction instruction condition condition
0066 LDZ= DLDZ= | S1- S2|=| S3| | S1- S2| ≠ | S3|

0067 LDZ<> DLDZ<> | S1- S2|≠| S3| | S1- S2|=| S3|

0068 LDZ> DLDZ> | S1- S2|>| S3| | S1- S2| ≦ | S3|

0069 LDZ>= DLDZ>= | S1- S2|≧| S3| | S1- S2|<| S3|

0070 LDZ< DLDZ< | S1- S2|<| S3| | S1- S2|≧ | S3|

0071 LDZ<= DLDZ<= | S1- S2|≦| S3| | S1- S2|>| S3|

6-40
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example

1. When the absolute difference of D10 and D11 is greater than 200, M10 is ON. While the absolute difference is less
than 200, M10 is OFF.

6_

6-41
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Comparing contact type
0072-0077 D ANDZ※ S1,S2,S3
absolute values ANDZ※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
S3      

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source1

S2 : Data source2

S3 : Comparison result

Taking ANDZ= and DANDZ= for example


_6
Explanation

1. These instructions compare the absolute value of the difference between S1 and S2 with the absolute value of S3.
Take the ANDZ= instruction for example. If the comparison result is that the absolute value of the difference
between S1 and S2 is equal to the absolute value of S3, the continuity condition of the instruction is met. If the
comparison result is that the absolute value of the difference between S1 and S2 is not equal to the absolute value of
S3, the discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit HC device, but not the device E.

Continuity Discontinuity
API number 16-bit instruction 32-bit instruction
condition condition
0072 ANDZ= DANDZ= | S1- S2|=| S3| | S1- S2| ≠ | S3|
0073 ANDZ<> DANDZ<> | S1- S2|≠| S3| | S1- S2|=| S3|
0074 ANDZ> DANDZ> | S1- S2|>| S3| | S1- S2| ≦ | S3|

0075 ANDZ>= DANDZ>= | S1- S2|≧| S3| | S1- S2|<| S3|


0076 ANDZ< DANDZ< | S1- S2|<| S3| | S1- S2|≧ | S3|

0077 ANDZ<= DANDZ<= | S1- S2|≦| S3| | S1- S2|>| S3|

6-42
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example

1. When M0 is ON and the absolute difference of D10 and D11 is greater than 200, M10 is ON. While the absolute
difference is less than 200, M10 is OFF.

6_

6-43
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Comparing contact type
0078-0083 D ORZ※ S1,S2,S3
absolute values ORZ※

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
S3      

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
Symbol
S1 : Data source1

S2 : Data source2

S3 : Comparison result

Taking ORZ= and DORZ= for example


_6
Explanation

1. These instructions compare the absolute value of the difference between S1 and S2 with the absolute value of S3.
Take the ORZ= instruction for example. If the comparison result is that the absolute value of the difference between
S1 and S2 is equal to the absolute value of S3, the continuity condition of the instruction is met. If the comparison
result is that the absolute value of the difference between S1 and S2 is not equal to the absolute value of S3, the
discontinuity condition of the instruction is met.

2. Only the 32-bit instruction can use the 32-bit HC device, but not the device E.

Continuity Discontinuity
API number 16-bit instruction 32-bit instruction
condition condition
0078 ORZ= DORZ= | S1- S2|=| S3| | S1- S2| ≠ | S3|
0079 ORZ<> DORZ<> | S1- S2|≠| S3| | S1- S2|=| S3|
0080 ORZ> DORZ> | S1- S2|>| S3| | S1- S2| ≦ | S3|

0081 ORZ>= DORZ>= | S1- S2|≧| S3| | S1- S2|<| S3|


0082 ORZ< DORZ< | S1- S2|<| S3| | S1- S2|≧ | S3|

0083 ORZ<= DORZ<= | S1- S2|≦| S3| | S1- S2|>| S3|

6-44
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example

1. When M0 is ON and the absolute difference of D10 and D11 is greater than 200, M10 is ON. While the absolute
difference is less than 200, M10 is OFF.

6_

6-45
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.2 Arithmetic Instructions


6.2.1 List of Arithmetic Instructions
The following table lists the Arithmetic instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0100 + D+  Adding binary numbers

0101 - D-  Subtracting binary numbers

0102 * D*  Multiplying binary numbers

0103 / D/  Dividing binary numbers

0104 – F+  Adding floating-point numbers

0105 – F-  Subtracting floating-point numbers

0106 – F*  Multiplying floating-point numbers

0107 – F/  Dividing floating-point numbers

0112 BK+ DBK+  Adding binary numbers in blocks

0113 BK- DBK-  Subtracting binary numbers in blocks

0114 $+ –  Linking strings

0115 INC DINC  Adding one to a binary number


_6
0116 DEC DDEC  Subtracting one from a binary number

MUL16: Multiplying binary numbers for 16-bit instructions


0117 MUL16 MUL32 
MUL32: Multiplying binary numbers for 32-bit instructions

DIV16: Dividing binary numbers for 16-bit instructions


0118 DIV16 DIV32 
DIV32: Dividing binary numbers for 32-bit instructions

0120 BK* DBK*  Multiplying binary numbers in blocks

0121 BK/ DBK/  Dividing binary numbers in blocks

0122 – BKF+  Adding floating-point numbers in blocks

0123 – BKF-  Subtracting floating-point numbers in blocks

0124 – BKF*  Multiplying floating-point numbers in blocks

0125 – BKF/  Dividing floating-point numbers in blocks

BKMUL16: Multiplying 16-bit binary numbers in blocks


0126 BKMUL16 BKMUL32 
BKMUL32: Multiplying 32-bit binary numbers in blocks

6-46
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Instruction code Pulse


API Function
16-bit 32-bit instruction

BKDIV16: Dividing16-bit binary numbers in blocks


0127 BKDIV16 BKDIV32 
BKDIV32: Dividing 32-bit binary numbers in blocks

6_

6-47
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.2.2 Explanation of Arithmetic Instructions

API Instruction code Operand Function

0100 D + P S1,S2,D Adding binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D      
DWORD

STRING
LWORD

Data

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Augend

S2 : Addend

_6 D : Sum

Explanation

1. This instruction adds the binary value in S2 to the binary value in S1, and stores the sum in D.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

4. When the operation result is zero, SM600 is ON. Otherwise, it is OFF.

5. For 16-bit binary values, when the operation result exceeds the range of 16-bit binary values, SM602 is ON.

Otherwise, it is OFF.

6-48
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6. For 32-bit binary values, when the operation result exceeds the range of 32-bit binary values, SM602 is ON.

Otherwise, it is OFF.

Example 1

Adding 16-bit binary values: when M0 is ON, the instruction adds the addend in D10 to the augend in D0, and stores the

sum in D20.

 When the values in D0 and D10 are 100 and 10 respectively, D0 plus D10 equals 110, and 110 is stored in D20.

 When the values in D0 and D10 are 16#7FFF and 16#1 respectively, D0 plus D10 equals 16#8000, and 16#8000 is

stored in D20.

 When the values in D0 and D10 are 16#FFFF and 16#1 respectively, D0 plus D10 equals 16#10000. Since the

operation result exceeds the range of 16-bit binary values, SM602 is ON, and the value stored in D20 is 16#0. Since

the operation result is 16#0, SM600 is ON.

6_
Example 2

Adding 32-bit binary values: when M0 is ON, the instruction adds the addend in (D41, D40) to the augend in (D31, D30),

and stores the sum in (D51, D50). The data in D30, D40, and D50 is the lower 16-bit data, whereas the data in D31, D41,

and D51 is the higher 16-bit data.

 When the values in (D31, D30) and (D41, D40) are 11111111 and 44444444 respectively, (D31, D30) plus (D41,

D40) equals 55555555, and 55555555 is stored in (D51, D50).

 When the values in (D31, D30) and (D41, D40) are 16#80000000 and 16#FFFFFFFF respectively, (D31, D30) plus

(D41, D40) equals 16#17FFFFFFF. Since the operation result exceeds the range of 32-bit binary values, SM602 is

ON, and the value stored in (D51, D50) is 16#7FFFFFFF.

6-49
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Flags

For 16-bit binary values:

1. If the operation result is zero, SM600 is ON.

2. If the operation result exceeds 65,535, SM602 is ON.

For 32-bit values:

1. If the operation result is zero, SM600 is set to ON.

2. If the operation result exceeds 4,294,967,295, SM602 is set to ON.

The 16-bit instruction: Zero flag Zero flag Zero flag

65,535、0、1 65,535、0、1 65,535、0、1 、2

Borrow flag Carry flag

The 32-bit instruction: Zero flag Zero flag Zero flag

_6
4,294,967,295 、0、1 4,294,967,295 、0、1 4,294,967,295 、0、1、2

Borrow flag Carry flag

6-50
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0101 D - P S1,S2,D Subtracting binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Minuend

S2 : Subtrahend

D : Difference

6_

Explanation

1. This instruction subtracts the binary value in S2 from the binary value in S1, and stores the difference in D.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

4. When the operation result is zero, SM600 is ON. Otherwise, it is OFF.

5. When borrowing occurs during the arithmetic, SM601 is ON. Otherwise, it is OFF.

6-51
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

Subtracting 16-bit binary values: when M0 is ON, the instruction subtracts the subtrahend in D10 from the minuend in D0,

and stores the difference in D20.

 When the values in D0 and D10 are 100 and 10 respectively, D0 minus D10 leaves 90, and 90 is stored in D20.

 When the values in D0 and D10 are 16#8000 and 16#1 respectively, D0 minus D10 leaves 16#7FFF, and 16#7FFF

is stored in D20.

 When the values in D0 and D10 are 16#1 and 16#2 respectively, D0 minus D10 leaves 16#FFFF. Since borrowing

occurs during the operation, SM601 is ON, and the value stored in D20 is 16#FFFF.

 When the values in D0 and D10 are 16#0 and 16#FFFF respectively, D0 minus D10 leaves 16#F0001. Since

borrowing occurs during the operation, SM601 is ON, and the value stored in D20 is 16#1.

Example 2

_6 Adding 32-bit binary values: when M0 is ON, the instruction subtracts the subtrahend in (D41, D40) from the minuend in

(D31, D30), and stores the sum in (D51, D50). The data in D30, D40, and D50 is the lower 16-bit data, whereas the data in

D31, D41, and D51 is the higher 16-bit data.

 When the values in (D31, D30) and (D41, D40) are 55555555 and 11111111 respectively, (D31, D30) minus (D41,

D40) D10 leaves 44444444, and 44444444 is stored in (D51, D50).

 When the values in (D31, D30) and (D41, D40) are 16#80000000 and 16#FFFFFFFF respectively, (D31, D30)

minus (D41, D40) leaves 16#F80000001. Since borrowing occurs during the operation, SM601 is ON, and the value

stored in (D51, D50) is 16#80000001.

6-52
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0102 D * P S1,S2,D Multiplying binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D DWORD     

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol:

S1 : Multiplicand

S2 : Multiplier

D : Product

6_

Explanation

1. This instruction multiplies the signed binary value in S1 by the signed binary value in S2, and stores the product in D.

2. Only the instruction D* can use the 32-bit counter.

3. Multiplying 16-bit binary values:

S1 S2 D +1 D

b15..............b0 b15..............b0 b31.........b16 b15...........b0

b15 is the si gn bit.


* b15 is the si gn bit.= b31, i.e. b15 in D+ 1, is the sign bit.
The product is a 32-bit value, and is stored in the register (D+1, D), which is composed of 32 bits. When the sign bit

b31 is 0, the product is a positive value. When the sign bit b31 is 1, the product is a negative value.

4. Multiplying 32-bit binary values:

6-53
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

S 1 +1 S1 S 2 +1 S2 D +3 D +2 D +1 D

b31...b16 b15...b0 b31...b16 b15...b0 b63...b48 b47...b32 b31...b16 b15...b0

* =
b31 is the si gn bit. b31 is the si gn bit. b63, i.e. b15 in D+3, is the sign bit.

The product is a 64-bit value, and is stored in the register (D+3, D+2, D+1, D0), which is composed of 64 bits. When

the sign bit b63 is 0, the product is a positive value. When the sign bit b63 is 1, the product is a negative value.

Example

The instruction multiplies the 16-bit value in D0 by the 16-bit value in D10, and stores the 32-bit product in (D21, D20). The

data in D21 is the higher 16-bit data, whereas the data in D20 is the lower 16-bit data. Whether the result is a positive

value or a negative value depends on the state of the highest bit b31. When b31 is OFF, the result is a positive value.

When b31 is ON, the result is a negative value.

D0×D10=(D21, D20)
_6
16-bit value×16-bit value=32-bit value

6-54
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0103 D / P S1,S2,D Dividing binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

D : Quotient; remainder

6_

Explanation

1. This instruction divides the signed binary value in S1 by the signed binary value in S2, and stores the quotient and
the remainder in D.

2. Only the 32-bit instructions can use the 32-bit counter.

3. When the sign bit is 0, the value is a positive one. When the sign bit is 1, the value is a negative one.

4. Dividing 16-bit values:

Quotient Remainder
S1 S2 D D+1

b15..............b0 b15..............b0 b15..............b0 b15..............b0


/ =

6-55
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The operand D occupies two consecutive devices. The quotient is stored in D, and the remainder is stored in D+1.

5. Dividing 32-bit values:

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


/ =
The operand D occupies two devices. The quotient is stored in (D+1, D), and the remainder is stored in (D+3, D+2).

Example

When M0 is ON, the instruction divides the dividend in D0 by the divisor in D10, and stores the quotient in D20, and stores

the remainder in D21. Whether the result is a positive value or a negative value depends on the state of the highest bit.

Additional remarks
_6
1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.

3. If you declare the operand D used during the execution of the 16-bit instruction in ISPSoft, the data type is ARRAY
[2] of WORD/INT.

4. If you declare the operand D used during the execution of the 32-bit instruction in ISPSoft, the data type is ARRAY
[2] of DWORD/DINT.

6-56
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0104 F+ P S1,S2,D Adding floating-point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D DWORD    

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Augend

S2 : Addend

D : Sum

Explanation
6_
1. This instruction adds the 32-bit single-precision floating-point numbers in S2 and S1, and stores the sum in D.

2. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

 When the operation result is zero, SM600 is ON. Otherwise, it is OFF.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 is ON.

 When the absolute value of the operation result is larger than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 is ON.

6-57
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Adding single-precision floating-point numbers: when M0 is ON, the instruction adds the addend 16#4046B852 in (D21,

D20) to the augend 16#3FB9999A in (D11, D10), and stores the sum 16#4091C28F in (D31, D30). 16#4046B852,

16#3FB9999A, and 16#4091C28F represent the floating point numbers 3.105, 1.450, and 4.555 respectively.

Additional remark

If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point numbers, the
instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

_6

6-58
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0105 F- P S1,S2,D Subtracting floating-point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D DWORD    

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Minuend

S2 : Subtrahend

D : Difference

6_
Explanation

1. This instruction subtracts the 32-bit single-precision floating-point number in S2 from the 32-bit single-precision
floating-point numbers number in S1, and stores the difference in D.

2. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

 When the operation result is zero, SM600 is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 is ON.

 When the absolute value of the operation result is larger than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 is ON.

S 1 +1 S1 S 2 +1 S2 D+1 D

b31.........b16 b15...........b0 b31.........b16 b15...........b0 b31.........b16 b15...........b0


- =

6-59
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Subtracting 32-bit single-precision floating-point numbers: when M0 is ON, the instruction subtracts the subtrahend in

(D21, D20) from the minuend in (D21, D20), and stores the difference in (D31, D30).

Additional remarks

If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point numbers, the
instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

_6

6-60
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0106 F* P S1,S2,D Multiplying floating-point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D DWORD    

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Multiplicand

S2 : Multiplier

D : Product

6_
Explanation

1. This instruction multiplies the 32-bit single-precision floating-point number in S1 by the 32-bit single-precision
floating-point number in S2, and stores the product in D.

2. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

 When the operation result is zero, SM600 is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 is ON.

 When the absolute value of the operation result is larger than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 is ON.

S 1 +1 S1 S 2 +1 S2 D+1 D

b31.........b16 b15...........b0 b31.........b16 b15...........b0 b31.........b16 b15...........b0


* =

6-61
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Multiplying 32-bit single-precision floating-point numbers: when M0 is ON, the instruction multiplies the multiplicand 32.5

by the multiplier in (D1, D0), and stores the product in (D11, D10).

Additional remarks

If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point numbers, the
instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

_6

6-62
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0107 F/ P S1,S2,D Dividing floating-point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D DWORD    

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

D : Quotient

6_
Explanation

1. This instruction is divides the 32-bit single-precision floating-point number in S1 by the 32-bit single-precision
floating-point number in S2, and stores the quotient in D.

2. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

 When the operation result is zero, SM600 is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 is ON.

 When the absolute value of the operation result is larger than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 is ON.

S1 +1 S1 S 2 +1 S2 D +1 D

b31.........b16 b15...........b0 b3 1.........b16 b15 ...........b0 b31.........b16 b15...........b 0


/ =

6-63
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Dividing 32-bit single-precision floating-point numbers: when M0 is ON, the instruction divides the dividend in (D1, D0) by

the divisor 100.7, and stores the quotient in (D11, D10).

Additional remarks

1. If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.

2. If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point
numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

_6

6-64
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0112 D BK+ P S1,S2,n,D Adding binary values in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
n    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Augend

S2 : Addend

n : Data length
D : Sum
6_

Explanation

1. This instruction adds n pieces of data in devices starting from S2 to those in devices starting from S1. The augends

and the addends are binary values, and the instruction stores the sums in D.

2. The operand n must be between 1–256.

3. Only the 32-bit instructions can use the 32-bit counter.

4. When the operation result is zero, SM600 is ON.

5. For the 16-bit instructions, when the operation result is less than –32,768, SM601 is ON.

6. For the 16-bit instructions, when the operation result is larger than 32,767, SM602 is ON.

7. For the 32-bit instructions, when the operation result is less than–21,474,836,488, SM601 is ON.

8. For the 32-bit instructions, when the operation result is larger than 2,147,483,647, SM602 is ON.

6-65
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

9. 16-bit instruction example: when the operand S2 is a device (not a constant or a hexadecimal value)

} } }
S1 1 S2 1 D 1 +1 =2
S1 +1 2 + S2 +1 2 = D +1 2 +2 =4
.
.
.
.
.
n .
.
.
.
n .
.
. n
. . .
. . . . . .
. .
. .
. .

S1 +n-1 5 S2 +n-1 5 D +n-1 5 +5 =10

10. 16-bit instruction example: when the operand S2 is a constant or a hexadecimal value

} } }
S1 1 S2 10 D 1+10=11
S1 +1 2 + S2 10 = D +1 2+10=12
.
.
.
.
.
n .
.
.
.
n .
.
. n
. . .
. . . . . .
. .
. .
. .

S1 +n-1 5 S2 10 D +n-1 5 + 1 0 = 1 5

Example 1

When M0 is ON, the instruction adds the binary values in D10–D14 to the binary values in D0–D4, and stores the sums.

_6

Execution r esult
D0 1 D10 10 D100 11
D1 2 D11 11 D101 13
D2 3 + D12 12 D102 15
D3 4 D13 13 D103 17
D4 5 D14 14 D104 19

6-66
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 2

When M0 is ON, the instruction adds the addend 10 to the binary values in D0–D4, and stores the sums in D100–D104.

Ex ec ution result

D0 1 10 D100 11
D1 2 10 D101 12
D2 3 + 10 D102 13

D3 4 10 D103 14
D4 5 10 D104 15

Additional remarks

1. For 16-bit instructions, if the devices S1–S1+n-1, S2–S2+n-1, or D–D+n-1 exceed the device range, the instruction is
6_
not executed, SM is ON, and the error code in SR0 is 16#2003.

2. For 32-bit instructions, if the devices S1–S1+2*n-1, S2–S2+2*n-1, or D–D+2*n-1 exceed the device range, the
instruction is not executed, SM is ON, and the error code in SR0 is 16#2003.

3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. For 16-bit instructions, if S1–S1+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

5. For 32-bit instructions, if S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

6. For 16-bit instructions, if S2–S2+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

7. For 32-bit instructions, if S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

6-67
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0113 D BK- P S1,S2,n,D Subtracting binary values in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1    
S2    
n    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Minuend

S2 : Subtrahend

n : Data length
_6 D : Difference

Explanation

1. This instruction subtracts n pieces of data in devices starting from S2 from those in devices starting from S1. The

minuends and the subtrahends are binary values, and the instruction stores the differences in D.

2. The operand n must be between 1–256.

3. Only the 32-bit instructions can use the 32-bit counter.

4. When the operation result is zero, SM600 is ON.

5. For 16-bit instructions, when the operation result is less than –32,768, SM601 is ON.

6. For 16-bit instructions, when the operation result is larger than 32,767, SM602 is ON.

7. For 32-bit instructions, when the operation result is less than –2,147,483,648, SM601 is ON.

6-68
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

8. For 32-bit instructions, when the operation result is larger than 2,147,483,647, SM602 is ON.

9. 16-bit instruction example: when the operand S2 is a device (not a constant or a hexadecimal value)

} } }
S1 5 S2 1 D 5 -1 =4
S1 +1 4 - S2 1 = D +1 4 -1 =3
.
.
.
.
.
n .
.
.
.
n .
.
. n
. . .
. . . . . .
. .
. .
. .

S1 +n-1 1 S2 1 D +n-1 1 -1 =0

10. 16-bit instruction example: when the operand S2 is a constant or a hexadecimal value

} } }
S1 5 S2 1 D 5 -1 =4
S1 +1 4 - S2 1 = D +1 4 -1 =3
.
.
.
.
.
n .
.
.
.
n .
.
. n
. . .
. . . . . .
. .
. .
. .

S1 +n-1 1 S2 1 D +n-1 1 -1 =0

Example 1

When M0 is ON, the instruction subtracts the binary values in D10–D14 from the binary values in D0–D4, and stores
6_
the differences in D100–D104.

Execution result

D0 5 D10 1 D100 4 1
D1 4 D11 2 D101 2 SM600

D2 3 - D12 3 D102 0
D3 2 D13 4 D103 -2
D4 1 D14 5 D104 -4

6-69
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

When M0 is ON, the instruction subtracts the subtrahend 1 from the binary values in D0–D4, and stores the

differences in D100–D104.

Execution result
D0 10 1 D100 9
D1 9 1 D101 8
D2 8 - 1 D102 7
D3 7 1 D103 6
D4 6 1 D104 5

Additional remarks

_6 1. For 16-bit instructions, if the devices S1–S1+n-1, S2–S2+n-1, or D–D+n-1 exceed the device range, the instruction is
not executed, SM is ON, and the error code in SR0 is 16#2003.

2. For 32-bit instructions, if the devices S1–S1+2*n-1, S2–S2+2*n-1, or D–D+2*n-1 exceed the device range, the
instruction is not executed, SM is ON, and the error code in SR0 is 16#2003.

3. If n Is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. For 16-bit instructions, if S1–S1+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

5. For 32-bit instructions, if S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

6. For 16-bit instructions, if S2–S2+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

7. For 32-bit instructions, if S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

6-70
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0114 $+ P S1,S2,D Linking strings

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String 1

S2 : String 2

D : Device in which the string is stored

Explanation

1. This instruction links the string starting with the data in the device specified by S1 (exclusive of 16#00), and the 6_
string starting with the data in the device specified by S2 (exclusive of 16#00) and stores the result in D. In addition,

the instruction adds the code 16#00 to the end of the linked string in D. When the instruction is not executed, the
data in D is unchanged.

2. When S1, S2 or D is not a string ($), the content of the data source can be up to 256 characters (including the ending

code 16#00).

3. If successful, the string in S1 and the string in S2 are linked and stored in D, as shown below.

S1 B (1 6# 6 2) A( 16 # 61 ) S2 B( 1 6# 42 ) A( 16 # 41 ) D B ( 16 #6 2 ) A( 1 6# 61 )

S 1 +1 D (1 6# 6 4) C( 16 # 63 ) S 2 +1 D(1 6# 4 4) C( 16 # 43 ) = D +1 D (1 6# 6 4) C( 1 6# 63 )

S 1 +2 (1 6# 0 0) E (1 6 #6 5) S2 1+ 2 (16 #0 0 ) (16 #0 0 ) D +2 A( 16 # 41 ) E ( 16 #6 5 )

D +3 C(1 6 #4 3) B( 16 # 42 )

D +4
1 (1 6# 0 0) D (1 6# 4 4)

Turning i nto 1 6#00 automatic ally

6-71
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

S1 B(16#62) A (16#61) S2 B(16#42) A(16#41) D d(16#62) a(16#61)

S 1 +1 D(16#64) C(16#63) S2 +1 D(16#44) C(16#43) = D +1 d(16#64) c(16#63)

S1 +2 E(16#65) (16#00) S2 +2
1 (16#00) (16#00) D +2 B(16#42) A(16#41)

D +3 D(16#44) C(16#43)

D +4
1 (16#00) (16#00)

Turning i nto 16 #00 au toma ticall y

4. When S1, S2 or D is not a string ($), the ending code 16#00 is added to the end of the data that is moved.

5. If S1 or S2 is not a string, then when the instruction is executed and the first character is the code 16#00, 16#00 is

still linked and moved.

6. The string “abcde” in S1 is shown as below.

S1 b(16#62) a(16#61)

S 1 +1 d(16#64) c(16#63)

S 1 +2 (16#00) e(16#65)

Example

Suppose S1 is the string “ab” and S2 is the string “c”. After the conditional contact M0 is enabled, the data in D0 is 16#6261
and the data in D65535 is16#0063.
_6

Additional remarks

1. If S1 or S2 is a string, at most 31 characters can be moved.

2. If D is not sufficient to contain the string composed of the strings in S1 and S2, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

3. If the string of S1+S2 is more than 256 characters (the ending code 16#00 included), the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003.

4. If S1 or S2 overlaps D, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C.

5. If the string in S1 or S2 does not end with 16#00, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#200E.

6-72
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0115 D INC P D Adding one to a binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Destination device

Explanation

1. This instruction adds 1 to the value in D. 6_

2. Only the DINC instruction can use the 32-bit counter.

3. For the 16-bit operation, 32,767 plus 1 equals -32,768. For the 32-bit operation, 2,147,483,647 plus 1 equals

-2,147,483,648.

Example

When M0 switches from OFF to ON, the value in D0 increases by one.

6-73
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0116 D DEC P D Subtracting one from a binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Destination device

Explanation

_6 1. This instruction subtracts 1 from the value in D.

2. Only the DDEC instruction can use the 32-bit counter.

3. For the 16-bit operation, -32,768 minus 1 leaves 32,767. For the 32-bit operation, -2,147,483,648 minus 1 leaves

2,147,483,647.

Example

When M0 switches from OFF to ON, the value in D0 decreases by one.

6-74
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


MUL16 Multiplying 16-bit binary numbers
0117 P S1,S2,D
MUL32 Multiplying 32-bit binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Multiplicand

S2 : Multiplier

D : Product

6_

Explanation

1. This instruction multiplies the signed binary value in S1 by the signed binary value in S2, and stores the product in D.

2. Only the MUL32 instruction can use an HC device.

3. 16-bit binary multiplication:

S1 S2 D

b15..............b0 b15..............b0 b15..............b0

* =
Bit 15 is a sign bit. Bit 15 is a sign bit. Bit 15 is a sign bit.

The product is a 16-bit value stored in D which is a 16-bit register. If b15 in D is 0, the product stored in D is a

positive value. If b15 in D is 1, the product stored in D is a negative value.

4. 32-bit binary multiplication:

6-75
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

S 1 +1 S1 S 2 +1 S2 D +1 D

b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0

Bit 31 is a si gn bit.
* Bit 31 is a si gn bit.= Bit 31 is a si gn bit.
The product is a 32-bit value stored in (D, D+1) which is a 32-bit register. If b31 in D is 0, the product stored in (D, D+1) is

a positive value. If b31 in D is 1, the product stored in (D, D+1) is a negative value.

Example

The instruction multiplies the 16-bit value in D0 by the 16-bit value in D10, and stores the product in D20. The sign of the

product (positive or negative) 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.

D0×D10=D20

16-bit value×16-bit value=16-bit value


_6
Additional remarks

1. If the product of a 16-bit multiplication is not a 16-bit signed value available, and is greater than the maximum 16-bit

positive number K32767, or less than the minimum negative number K-32768, the carry flag SM602 is ON, and only

the low 16 bits are written.

2. If you need the complete result of a 16-bit multiplication (a 32-bit value), use the */*P instruction (API 0102). Refer to

the explanation for the * instruction (API 0102) for more information.

3. If the product of a 32-bit multiplication is not a 32-bit signed value available, and is greater than the maximum 32-bit

positive number K2147483647, or less than the minimum negative number K-2147483648, the carry flag SM602 is

ON, and only the low 32 bits are written.

4. If you need the complete result of a 32-bit multiplication (a 64-bit value), use API 0102 D*/D*P. Refer to the

explanation for the * instruction (API 0102) for more information.

6-76
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


DIV16 Dividing 16-bit binary numbers
0118 P S1,S2,D
DIV32 Dividing 32-bit binary numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

D : Quotient; remainder

6_
Explanation

1. This instruction divides the signed binary value in S1 by the signed binary value in S2, and stores the quotient in D.

2. Only the 32-bit instruction can use an HC device.

3. Sign bit=0 (Positive number); sign bit =1 (Negative number)

4. 16-bit binary division:

Quotient
S1 S2 D

b15..............b0 b15..............b0 b15..............b0


/ =
The quotient is stored in D.

6-77
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. 32-bit binary division:

Quotient
S 1 +1 S1 S 2 +1 S2 D+1 D

b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0


/ =
D occupies two consecutive devices. The quotient is stored in (D+1, D).

Example

When M0 is ON, the instruction divides the dividend in D0 by the divisor in D10, and stores the quotient D20. Whether the

quotient is a positive value or a negative value depends on the leftmost bit in D20.

_6
Additional remarks

1. If the device is not available, the instruction is not executed, SM0 will be ON, and the error code stored in SR0 is

16#2003.

2. If the divisor is 0, the instruction is not executed, SM0 will be ON, and the error code stored in SR0 is 16#2012.

3. If you want to store the remainder, use the “/” instruction (Dividing binary values). Refer to the explanation for the “/”

instruction (API 0103) for more information.

6-78
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0120 D BK* P S1, S2, n, D Multiplying binary numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
Type

S1      
S2      
n      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Multiplicand

S2 : Multiplier

n : Data length
6_
D : Product

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instruction multiplies n pieces of data in devices starting from S1 by those in devices starting from S2. The

multiplicands and multipliers are signed binary values, and the instruction stores the products in D.

3. The operand n must be between 1–256.

4. Only the 32-bit instructions can use the HC device.

6-79
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. Multiplying 16-bit binary values in blocks:

 When the operand S2 is a device or a variable (not a K/16# constant))

b15..............b0 b15..............b0 b31..............b16 b15..............b0


S1 a S2 c D+1, D a*c
S1+1 b S2+1 d D+3, D+2 b*d
n * n = n
……

……

……

……

……

……
S1+n-1 S2+n-1 D+2n-1, D+2n-2
b15 is the sign bit. b15 is the sign bit. b31 (i.e. b15 in D+2n-1) is the sign bit

 When the operand S2 is a constant (K/16#)

b15..............b0 b31..............b16 b15..............b0


S1 a D+1, D a*c
S1+1 b b15..............b0 D+3, D+2 b*c
n * S2 c = n
……

……

……

……
b15 is the sign bit.
S1+n-1 D+2n-1, D+2n-2
b15 is the sign bit. b31 (i.e. b15 in D+2n-1) is the sign bit.

The products are 32-bit values, and all of them are stored in the 32 bit registers each of which is composed of two

consecutive D. When the sign bit b31 is 0, the product is a positive value. When the sign bit b31 is 1, the product is a
negative value.

6. Multiplying 32-bit binary values in blocks:

 When the operand S2 is a device or a variable (not a K/16# constant)

b31...b16 b15...b0 b31...b16 b15...b0 b63..b48 b47..b32 b31..b16 b15..b0


S1+1, S1 a S2+1, S2 c D+3 ~ D a*c
S1+3, S1+2 b S2+3, S2+2 d D+7 ~ D+4 b*c
n * n = n
……

……
……

……
……

……

_6 S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+4n-1 ~ D+4n-4


b31 is the sign bit. b31 is the sign bit. b63 (i.e. b15 in D+4n-1) is the sign bit.

 When the operand S2 is a constant (K/16#)

b31...b16 b15...b0 b63..b48 b47..b32 b31..b16 b15..b0


S1+1, S1 a D+3 ~ D a*c
S1+3, S1+2 b b31...b16 b15...b0 D+7 ~ D+4 b*c
n * S2 c = n
……
……

……
……

b31 is the sign bit.


S1+2n-1, S1+2n-2 D+4n-1 ~ D+4n-4
b31 is the sign bit. b63 (i.e. b15 in D+4n-1) is the sign bit.

The products are 64-bit values, and all of them are stored in the 64-bit registers each of which is composed of four

consecutive D. When the sign bit b63 is 0, the product is a positive value. When the sign bit b63 is 1, the product is a

negative value.

6-80
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 1

When M0 is ON, the instruction multiplies the binary values in D0–D4 (multiplicands) by the binary values in D10–D14

(multipliers), and stores the products in (D21, D20)–(D29, D28). Take a look at the first data operation in the following

example. The 16-bit value in D0 is multiplied by the 16-bit value in D10 and the product is a 32-bit value, which is stored in

(D21, D20). The data in D21 is the higher 16-bit data, whereas the data in D20 is the lower 16-bit data. Whether the result

is a positive value or a negative value depends on the state ON/OFF of the highest bit b31. When b31 is OFF (0), the

result is a positive value. When b31 is ON (1), the result is a negative value.

D0 1 D10 10 (D21, D20) 10


D1 2 D11 11 (D23, D22) 22
D2 3 * D12 12 = (D25, D24) 36
D3 4 D13 13 (D27, D26) 52
D4 5 D14 14 (D29, D28) 70

Example 2

When M0 is ON, the instruction multiplies the binary values in D0-D4 by 10 respectively, and stores the products in (D21, 6_
D20) – (D29, D28).

D0 1 (D21, D20) 10
D1 2 (D23, D22) 20
D2 3 * 10 = (D25, D24) 30
D3 4 (D27, D26) 40
D4 5 (D29, D28) 50

6-81
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. For 16-bit instructions, if the devices S1–S1+n-1 and S2–S2+n-1 exceed the device range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. For 16-bit instructions, if the devices D–D+2*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

3. For 32-bit instructions, if the devices S1–S1+2*n-1 and S2–S2+2*n-1 exceed the device range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

4. For 32-bit instructions, if the devices D–D+4*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

5. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6. For 16-bit instructions, if S1–S1+n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

7. For 32-bit instructions, if S1–S1+2*n-1 overlap D–D+4*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

8. For 16-bit instructions, if S2–S2+n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

9. For 32-bit instructions, if S2–S2+2*n-1 overlap D–D+4*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

_6

6-82
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0121 D BK/ P S1, S2, n, D Dividing binary numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
Type

S1      
S2      
n      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

n : Data length

D : Quotient; remainder 6_

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instruction divides n pieces of data in devices starting from S1 by those in devices starting from S2. The
dividends and divisors are signed binary values, and the quotients and remainders are stored in D.

3. The operand n must be between 1–256.

4. Only the 32-bit instructions can use the HC device.

5. When the sign bit is 0, the value is a positive one. When the sign bit is 1, the value is a negative one.

6-83
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. Dividing 16-bit binary values in blocks

 When the operand S2 is a device or a variable (not a K/16# constant)

Quotient Remainder
b15..............b0 b15..............b0 b15..............b0 b15..............b0
S1 S2 D D+1
S1+1 S2+1 D+2 D+3
n / n = n n

……

……
……

……

……

……

……

……
S1+n-1 S2+n-1 D+2n-2 D+2n-1
b15 is the sign bit. b15 is the sign bit. b15 is the sign bit. b15 is the sign bit.

 When the operand S2 is a constant (K/16#)

Quotient Remainder
b15..............b0 b15..............b0 b15..............b0
S1 D D+1
S1+1 b15..............b0 D+2 D+3
n / S2 = n n

……

……
……

……

……

……
b15 is the sign bit.
S1+n-1 D+2n-2 D+2n-1
b15 is the sign bit. b15 is the sign bit. b15 is the sign bit.

Each operation result occupies two consecutive D. Take the first one for example, the quotient is stored in D, and

the remainder is stored in D+1.

7. Dividing 32-bit binary values in blocks

 When the operand S2 is a device or a variable (not a K/16# constant)

Quotient Remainder
b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0
S1+1, S1 S2+1, S2 D+1, D D+3, D+2
S1+3, S1+2 S2+3, S2+2 D+5, D+4 D+7, D+6
n / n = n n
……
……

……

……

……
……

……

……

_6 S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+4n-3, D+4n-4 D+4n-1, D+4n-2


b31 is the sign bit. b31 is the sign bit. b31 is the sign bit. b31 is the sign bit.

 When the operand S2 is a constant (K/16#)

Quotient Remainder
b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0
S1+1, S1 D+1, D D+3, D+2
S1+3, S1+2 b31...b16 b15...b0 D+5, D+4 D+7, D+6
n / S2 = n n
……
……

……

……
……

……

b31 is the sign bit.


S1+2n-1, S1+2n-2 D+4n-3, D+4n-4 D+4n-1, D+4n-2
b31 is the sign bit. b31 is the sign bit. b31 is the sign bit.

Each operation result occupies four consecutive D. Take the first one for example, the quotient is stored in (D+1, D)

devices, and the remainder is stored in (D+3, D+2) devices.

6-84
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 1

When M0 is ON, the instruction divides the binary values in D0–D4 (dividends) by the binary values in D10–D14 (divisors),

and stores the quotients in D20, D22, D24, D26 and D28, and remainders in D21, D23, D25, D27 and D29. Whether the

result is a positive value or a negative value depends on the state ON/OFF of the highest bit.

Quotient Remainder
D0 6 D10 1 D20 6 D21 0
D1 7 D11 2 D22 3 D23 1
D2 8 / D12 3 = D24 2 D25 2
D3 9 D13 4 D26 2 D27 1
D4 10 D14 5 D28 2 D29 0

Example 2

When M0 is ON, the instruction divides the binary values in D0–D4 (dividends) by the divisor 3 respectively, and

respectively stores the quotients in D20, D22, D24, D26 and D28, and remainders in D21, D23, D25, D27 and D29.

Whether the result is a positive value or a negative value depends on the state ON/OFF of the highest bit. 6_

Quotient Remainder
D0 6 D20 2 D21 0
D1 7 D22 2 D23 1
D2 8 / 3 = D24 2 D25 2
D3 9 D26 3 D27 0
D4 10 D28 3 D29 1

6-85
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks
1. If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.
2. For 16-bit instructions, if the devices S1–S1+n-1 and S2–S2+n-1 exceed the device range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. For 16-bit instructions, if the devices D–D+2*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

4. For 32-bit instructions, if the devices S1–S1+2*n-1 and S2–S2+2*n-1 exceed the device range, the instruction is not
executed, SM0 is ON, and the error code in SR0 is 16#2003.

5. For 32-bit instructions, if the devices D–D+4*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

6. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

7. For 16-bit instructions, if S1–S1+n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

8. For 32-bit instructions, if S1–S1+2*n-1 overlap D–D+4*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

9. For 16-bit instructions, if S2–S2+n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

10. For 32-bit instructions, if S2–S2+2*n-1 overlap D–D+4*n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.


_6

6-86
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0122 BKF+ P S1, S2, n, D Adding floating-point numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2      
n      
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
Type

S1 
S2 
n    
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Augend

S2 : Addend

n : Data length
6_
D : Sum

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instructions are for addition operations of 32-bit single-precision floating-point numbers.

3. The instruction adds n pieces of data in devices starting from S2 to those in devices starting from S1. The augends

and addends are 32-bit single-precision floating-point numbers, and the instruction stores the sums in D.

4. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag).

The instruction resets the flags SM600–SM602 to OFF first when it is executed. The corresponding flag will change

to ON when any of following operation results occurs during instruction execution.

 When the operation result is zero, SM600 (zero flag) is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 (borrow flag) is ON.

6-87
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 When the absolute value of the operation result is greater than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 (carry flag) is ON.

5. When the operand S2 is a device or a variable (not a floating-point number)

S1+1, S1 a S2+1, S2 c D+1, D a+c


S1+3, S1+2 b S2+3, S2+2 d D+3, D+2 b+d
n + n = n
……

……

……
……

……

……
S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+2n-1, D+2n-2

6. When the operand S2 is a constant (a floating-point number)

S1+1, S1 a D+1, D a+c


S1+3, S1+2 b D+3, D+2 b+c
n + S2 c = n
……

……
……

……
S1+2n-1, S1+2n-2 D+2n-1, D+2n-2

Example 1

Addition operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction adds the addends (D21, D20) – (D29, D28) to corresponding augends (D11, D10) – (D19,

D18), and stores the sums in (D31, D30) – (D39, D38).

_6

(D11,D10) 1.1 (D21,D20) 0.1 (D31,D30) 1.2


(D13,D12) 2.2 (D23,D22) 0.2 (D33,D32) 2.4
(D15,D14) 3.3 + (D25,D24) 0.3 = (D35,D34) 3.6
(D17,D16) 4.4 (D27,D26) 0.4 (D37,D36) 4.8
(D19,D18) 5.5 (D29,D28) 0.5 (D39,D38) 6.0

6-88
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 2

Addition operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction adds the floating-point number 0.1 to respective augends (D11, D10) – (D19, D18), and

stores the sums in (D31, D30) – (D39, D38).

(D11,D10) 1.1 (D31,D30) 1.2


(D13,D12) 2.2 (D33,D32) 2.3
(D15,D14) 3.3 + 0.1 = (D35,D34) 3.4
(D17,D16) 4.4 (D37,D36) 4.5
(D19,D18) 5.5 (D39,D38) 5.6

Additional remarks

1. If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point

numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If the devices S1–S1+2*n-1, S2–S2+2*n-1, and D–D+2*n-1 exceed the device range, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003. 6_


3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. If S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200C.

5. If S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200C.

6-89
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0123 BKF- P S1, S2, n, D Subtracting floating-point numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2      
n      
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
Type

S1 
S2 
n    
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Minuend

S2 : Subtrahend

n : Data length
_6
D : Difference

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instructions are for subtraction operations of 32-bit single-precision floating-point numbers.

3. The instruction subtracts n pieces of data in devices starting from S2 from those in devices starting from S1. The

minuends and subtrahends are 32-bit single-precision floating-point numbers, and the instruction stores the

differences in D.
4. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag).
The instruction resets the flags SM600–SM602 to OFF first when it is executed. The corresponding flag will change

to ON when any of following operation results occurs during instruction execution.

 When the operation result is zero, SM600 (zero flag) is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 (borrow flag) is ON.

6-90
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

 When the absolute value of the operation result is greater than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 (carry flag) is ON.

5. When the operand S2 is a device or a variable (not a floating-point number)

S1+1, S1 a S2+1, S2 c D+1, D a-c


S1+3, S1+2 b S2+3, S2+2 d D+3, D+2 b-d
n - n = n

……

……

……
……

……

……
S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+2n-1, D+2n-2

6. When the operand S2 is a constant (a floating-point number)

S1+1, S1 a D+1, D a-c


S1+3, S1+2 b D+3, D+2 b-c
n - S2 c = n
……

……
……

……
S1+2n-1, S1+2n-2 D+2n-1, D+2n-2

Example 1

Subtraction operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction subtracts the subtrahends (D21, D20) – (D29, D28) from corresponding minuends (D11,

D10) – (D19, D18), and stores the differences in (D31, D30) – (D39, D38).

6_

(D11,D10) 1.1 (D21,D20) 0.6 (D31,D30) 0.5


(D13,D12) 2.2 (D23,D22) 0.7 (D33,D32) 1.5
(D15,D14) 3.3 - (D25,D24) 0.8 = (D35,D34) 2.5
(D17,D16) 4.4 (D27,D26) 0.9 (D37,D36) 3.5
(D19,D18) 5.5 (D29,D28) 1.0 (D39,D38) 4.5

Example 2

Subtraction operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction subtracts the floating-point value 0.1 from respective minuends (D11, D10) – (D19, D18),

and stores the differences in (D31, D30) – (D39, D38).

6-91
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

(D11,D10) 1.1 (D31,D30) 1.0


(D13,D12) 2.2 (D33,D32) 2.1
(D15,D14) 3.3 - 0.1 = (D35,D34) 3.2
(D17,D16) 4.4 (D37,D36) 4.3
(D19,D18) 5.5 (D39,D38) 5.4

Additional remarks

1. If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point

numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If the devices S1–S1+2*n-1, S2–S2+2*n-1, and D–D+2*n-1 exceed the device range, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003.

3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. If S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200C.
_6
5. If S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200C.

6-92
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0124 BKF* P S1, S2, n, D Multiplying floating-point numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2      
n      
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
Type

S1 
S2 
n    
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Multiplicand

S2 : Multiplier

n : Data length
6_
D : Product

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instructions are for multiplication operations of 32-bit single-precision floating-point numbers.

3. The instruction multiplies n pieces of data in devices starting from S1 by those in devices starting from S2. The
multiplicands and multipliers are 32-bit single-precision floating-point numbers, and the instruction stores the

products in D.

4. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag).

The instruction resets the flags SM600–SM602 to OFF first when it is executed. The corresponding flag will change

to ON when any of following operation results occurs during instruction execution.

 When the operation result is zero, SM600 (zero flag) is ON.

6-93
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 (borrow flag) is ON.

 When the absolute value of the operation result is greater than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 (carry flag) is ON.

5. When the operand S2 is a device or a variable (not a floating-point number)

S1+1, S1 a S2+1, S2 c D+1, D a*c


S1+3, S1+2 b S2+3, S2+2 d D+3, D+2 b*d
n * n = n
……

……

……
……

……

……
S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+2n-1, D+2n-2

6. When the operand S2 is a constant (a floating-point number)

S1+1, S1 a D+1, D a*c


S1+3, S1+2 b D+3, D+2 b*c
n * S2 c = n
……

……
……

……
S1+2n-1, S1+2n-2 D+2n-1, D+2n-2

Example 1

Multiplication operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction multiplies the multiplicands (D11, D10) – (D19, D18) by corresponding multipliers (D21,

D20) – (D29, D28), and stores the products in (D31, D30) – (D39, D38).

_6

(D11,D10) 1.1 (D21,D20) 0.1 (D31,D30) 0.11


(D13,D12) 1.2 (D23,D22) 0.2 (D33,D32) 0.24
(D15,D14) 1.3 * (D25,D24) 0.3 = (D35,D34) 0.39
(D17,D16) 1.4 (D27,D26) 0.4 (D37,D36) 0.56
(D19,D18) 1.5 (D29,D28) 0.5 (D39,D38) 0.75

6-94
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 2

Multiplication operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction multiplies the multiplicands (D11, D10) – (D19, D18) by the floating-point value 0.1, and

stores the products in (D31, D30) – (D39, D38).

(D11,D10) 1.1 (D31,D30) 0.11


(D13,D12) 1.2 (D33,D32) 0.12
(D15,D14) 1.3 * 0.1 = (D35,D34) 0.13
(D17,D16) 1.4 (D37,D36) 0.14
(D19,D18) 1.5 (D39,D38) 0.15

Additional remarks

1. If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point

numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If the devices S1–S1+2*n-1, S2–S2+2*n-1, and D–D+2*n-1 exceed the device range, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003. 6_


3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. If S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200C.

5. If S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200C.

6-95
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0125 BKF/ P S1, S2, n, D Dividing floating-point numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2      
n      
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
Type

S1 
S2 
n    
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

n : Data length
_6
D : Quotient

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.


2. The instructions are for division operations of 32-bit single-precision floating-point numbers.
3. The instruction divides n pieces of data in devices starting from S1 by those in devices starting from S2. The
dividends and divisors are 32-bit single-precision floating-point numbers, and the instruction stores the results in D.
4. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag).
The instruction resets the flags SM600–SM602 to OFF first when it is executed. The corresponding flag will change

to ON when any of following operation results occurs during instruction execution.

 When the operation result is zero, SM600 (zero flag) is ON.

 When the absolute value of the operation result is less than the value that can be represented by the

minimum floating-point number, the value in D is 16#FF800000 and SM601 (borrow flag) is ON.

6-96
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

 When the absolute value of the operation result is greater than the value that can be represented by the

maximum floating-point number, the value in D is 16#7F800000 and SM602 (carry flag) is ON.

5. When the operand S2 is a device or a variable (not a floating-point number)

S1+1, S1 a S2+1, S2 c D+1, D a/c


S1+3, S1+2 b S2+3, S2+2 d D+3, D+2 b/d
n / n = n
……

……

……
……

……

……
S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+2n-1, D+2n-2

6. When the operand S2 is a constant (a floating-point number)

S1+1, S1 a D+1, D a/c


S1+3, S1+2 b D+3, D+2 b/c
n / S2 c = n
……

……
……

……
S1+2n-1, S1+2n-2 D+2n-1, D+2n-2

Example 1

Division operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction divides the dividends (D11, D10) – (D19, D18) by corresponding divisors (D21, D20) –

(D29, D28), and stores the results in (D31, D30) – (D39, D38).

6_

(D11,D10) 1.1 (D21,D20) 0.1 (D31,D30) 11.0


(D13,D12) 1.2 (D23,D22) 0.2 (D33,D32) 6.0
(D15,D14) 1.3 / (D25,D24) 0.3 = (D35,D34) 4.333
(D17,D16) 1.4 (D27,D26) 0.4 (D37,D36) 3.5
(D19,D18) 1.5 (D29,D28) 0.5 (D39,D38) 3.0

6-97
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

Division operations of 32-bit single-precision floating-point numbers:

When M0 is ON, the instruction divides the dividends (D11, D10) – (D19, D18) by the floating-point value 0.2, and stores

the results in (D31, D30) – (D39, D38).

(D11,D10) 1.1 (D31,D30) 5.5


(D13,D12) 1.2 (D33,D32) 6.0
(D15,D14) 1.3 / 0.2 = (D35,D34) 6.5
(D17,D16) 1.4 (D37,D36) 7.0
(D19,D18) 1.5 (D39,D38) 7.5

Additional remarks
1. If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.
2. If the value in S1 or the value in S2 exceeds the range of values that can be represented by the floating-point

numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

3. If the devices S1–S1+2*n-1, S2–S2+2*n-1, and D–D+2*n-1 exceed the device range, the instruction is not executed,
_6 SM0 is ON, and the error code in SR0 is 16#2003.

4. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

5. If S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200C.

6. If S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200C.

6-98
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

BKMUL16 Multiplying 16-bit binary numbers in blocks


0126 P S1, S2, n, D
BKMUL32 Multiplying 32-bit binary numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
Type

S1      
S2      
n      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Multiplicand

S2 : Multiplier

n : Data length
6_
D : Product

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instruction multiplies n pieces of data in devices starting from S1 by those in devices starting from S2. The
multiplicands and multipliers are signed binary values, and the instruction stores the products in D.

3. The operand n must be between 1–256.

4. Only the BKMUL32 instruction can use the HC device.

6-99
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. SM602: carry flag. The instruction resets SM602 to OFF first when it is executed. The corresponding flag will

change to ON when any of following operation results occurs during instruction execution.

 For the 16-bit instruction, the carry flag SM602 is ON when the operation result is greater than the maximum

16-bit positive number (K32767) or less than the minimum16-bit negative number (K-32768).

 For the 32-bit instruction, the carry flag SM602 is ON when the operation result is greater than the maximum

32-bit positive number (K2147483647) or less than the minimum 32-bit negative number (K-2147483648).

6. Multiplication operations of 16-bit binary values in blocks:

 When the operand S2 is a device or a variable (not a K/16# constant)

b15..............b0 b15..............b0 b15..............b0


S1 a S2 c D a*c
S1+1 b S2+1 d D+1 b*d
n * n = n
……

……

……

……

……

……
S1+n-1 S2+n-1 D+n-1
b15 is the sign bit. b15 is the sign bit. b15 is the sign bit.

 When the operand S2 is a constant (K/16#)

b15..............b0 b15..............b0
S1 a D a*c
S1+1 b b15..............b0 D+1 b*c
n * S2 c = n
……

……

……

……
b15 is the sign bit.
S1+n-1 D+n-1
b15 is the sign bit. b15 is the sign bit.
_6
The products are 16-bit values, and all of them are stored in D. When the sign bit b15 is 0, the product is a positive

value. When the sign bit b15 is 1, the product is a negative value.

7. Multiplication operations of 32-bit binary values in blocks:

 When the operand S2 is a device or a variable (not a K/16# constant)

b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0


S1+1, S1 a S2+1, S2 c D+1, D a*c
S1+3, S1+2 b S2+3, S2+2 d D+3, D+2 b*d
n * n = n
……
……
……

……
……

……

S1+2n-1, S1+2n-2 S2+2n-1, S2+2n-2 D+2n-1, D+2n-2


b31 is the sign bit. b31 is the sign bit. b31 is the sign bit.

 When the operand S2 is a constant (K/16#)

b31...b16 b15...b0 b31...b16 b15...b0


S1+1, S1 a D+1, D a*c
S1+3, S1+2 b b31...b16 b15...b0 D+3, D+2 b*c
n * S2 c = n
……
……
……
……

b31 is the sign bit.


S1+2n-1, S1+2n-2 D+2n-1, D+2n-2
b31 is the sign bit. b31 is the sign bit.

6-100
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

The products are 32-bit values, and all of them are stored in the 32 bit registers each of which is composed of two

consecutive D. When the sign bit b31 is 0, the product is a positive value. When the sign bit b31 is 1, the product is a

negative value.

Example 1

When M0 is ON, the instruction multiplies the 16-bit binary values in D0–D4 (multiplicands) by the 16-bit binary values in

D10–D14 (multipliers), and stores the 16-bit products in D20–D24. Take a look at the first data operation in the following

example. The 16-bit value in D0 is multiplied by the 16-bit value in D10 and the product is a 16-bit value stored in D20.

Whether the result is a positive value or a negative value depends on the state ON/OFF of the highest bit b15. When b15

is OFF (0), the result is a positive value. When b15 is ON (1), the result is a negative value.

D0 1 D10 6 D20 11
D1 2 D11 7 D21 12
D2 3 * D12 8 = D22 13
D3 4 D13 9 D23 14
D4 5 D14 10 D24 15

6_
Example 2

When M0 is ON, the instruction respectively multiplies the 16-bit binary values in D0–D4 (multiplicands) by the multiplier

10, and stores the 16-bit products in D20–D24.

D0 1 D20 10
D1 2 D21 20
D2 3 * 10 = D22 30
D3 4 D23 40
D4 5 D24 50

6-101
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the product of a 16-bit multiplication is not a 16-bit signed value available, and is greater than the maximum 16-bit

positive number (K32767), or less than the minimum negative number (K-32768), the carry flag SM602 is ON, and

only the value for low 16 bits is written.

2. If you need complete results of 16-bit multiplications (32-bit values), use the BK* / BK*P instruction (API0120). Refer

to the explanation of BK* / BK*P instruction in API0120 for more information.

3. If the product of a 32-bit multiplication is not a 32-bit signed value available, and is greater than the maximum 32-bit

positive number (K2147483647), or less than the minimum negative number (K-2147483648), the carry flag SM602

is ON, and only the value for low 32 bits is written.

4. If you need complete results of 32-bit multiplications (64-bit values), use DBK* / DBK*P (API0120). Refer to the

explanation of DBK* / DBK*P instruction in API0120 for more information.

5. For the 16-bit instruction, if the devices S1–S1+n-1 and S2–S2+n-1 exceed the device range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6. For the 16-bit instruction, if the devices D–D+n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

7. For the 32-bit instruction, if the devices S1–S1+2*n-1 and S2–S2+2*n-1 exceed the device range, the instruction is
not executed, SM0 is ON, and the error code in SR0 is 16#2003.

8. For the 32-bit instruction, if the devices D–D+2*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

9. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.
_6
10. For the 16-bit instruction, if S1–S1+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200C.

11. For the 32-bit instruction, if S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200C.

12. For the 16-bit instruction, if S2–S2+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

13. For the 32-bit instruction, if S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200C.

6-102
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

BKDIV16 Dividing 16-bit binary numbers in blocks


0127 P S1, S2, n, D
BKDIV32 Dividing 32-bit binary numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2       
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
Type

S1      
S2      
n      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Dividend

S2 : Divisor

n : Data length
6_
D : Quotient

Explanation

1. This instruction is available for ES3 CPU with firmware V1.08.00 or later, which works with ISPSoft V3.17 or later/

DIADesigner V1.30 or later, and also available for ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later only.

2. The instruction divides n pieces of data in devices starting from S1 by those in devices starting from S2. The
dividends and divisors are signed binary values, and the instruction stores the quotients in D.

3. The operand n must be between 1–256.

4. Only the BKDIV32 instruction can use the HC device.

5. Division operations of 16-bit binary values in blocks:

6-103
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 When the operand S2 is a device or a variable (not a K/16# constant)

Quotient
b15..............b0 b15..............b0 b15..............b0
S1 S2 D
S1+1 S2+1 D+1
n / n = n
……

……

……

……

……

……
S1+n-1 S2+n-1 D+n-1
b15 is the sign bit. b15 is the sign bit. b15 is the sign bit.

 When the operand S2 is a constant (K/16#)

Quotient
b15..............b0 b15..............b0
S1 D
S1+1 b15..............b0 D+1
n / S2 = n
……

……

……

……
b15 is the sign bit.
S1+n-1 D+n-1
b15 is the sign bit. b15 is the sign bit.

Each operation result (quotient) is stored in a 16-bit register D. When the sign bit b15 is 0, the quotient is a positive

value. When the sign bit b15 is 1, the quotient is a negative value.

6. Division operations of 32-bit binary values in blocks:

 When the operand S2 is a device or a variable (not a K/16# constant)

Quotient
b31...b16 b15...b0 b31...b16 b15...b0 b31...b16 b15...b0
S1+1, S1 S2+1, S2 D+1, D
S1+3, S1+2 S2+3, S2+2 D+3, D+2
n / n = n
……

……

……
……

……

……

_6 S1+2n-1, S1+2n-2
b31 is the sign bit.
S2+2n-1, S2+2n-2
b31 is the sign bit.
D+2n-1, D+2n-2
b31 is the sign bit.

 When the operand S2 is a constant (K/16#)

Quotient
b31...b16 b15...b0 b31...b16 b15...b0
S1+1, S1 D+1, D
S1+3, S1+2 b31...b16 b15...b0 D+3, D+2
n / S2 = n
……

……
……

……

b31 is the sign bit.


S1+2n-1, S1+2n-2 D+2n-1, D+2n-2
b31 is the sign bit. b31 is the sign bit.

Each operation result (quotient) is stored in a 32-bit register which is composed of two consecutive D. When the

sign bit b31 is 0, the quotient is a positive value. When the sign bit b31 is 1, the quotient is a negative value.

Example 1

When M0 is ON, the instruction divides the 16-bit binary values in D0–D4 (dividends) by the 16-bit binary values in

D10–D14 (divisors), and stores the 16-bit quotients in D20–D24 in order. Take a look at the first data operation in the

following example. The 16-bit value in D0 is divided by the 16-bit value in D10 and the quotient is a 16-bit value stored in

D20. Whether the result is a positive value or a negative value depends on the state ON/OFF of the highest bit b15. When

b15 is OFF (0), the result is a positive value. When b15 is ON (1), the result is a negative value.

6-104
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Quotient
D0 10 D10 6 D20 1
D1 20 D11 7 D21 2
D2 30 / D12 8 = D22 3
D3 40 D13 9 D23 4
D4 50 D14 10 D24 5

Example 2

When M0 is ON, the instruction respectively divides the 16-bit binary values in D0–D4 (dividends) by the divisor 6, and

stores the 16-bit quotients in D20–D24 in order.

6_

Quotient
D0 10 D20 1
D1 20 D21 3
D2 30 / 6 = D22 5
D3 40 D23 6
D4 50 D24 8

Additional remarks

1. If the divisor is 0, the instruction is not executed, SM0 will be ON, and the error code stored in SR0 is 16#2012.

2. For the 16-bit instruction, if you want to store the remainder, use the BK/ or BK/P instruction (API0121). Refer to the

explanation of BK/ or BK/P instruction in API0121 for more information.

3. For the 32-bit instruction, if you want to store the remainder, use the DBK/ or DBK/P instruction (API0121). Refer to

the explanation of DBK/ or DBK/P instruction in API0121 for more information.

4. For the 16-bit instruction, if the devices S1–S1+n-1 and S2–S2+n-1 exceed the device range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-105
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. For the 16-bit instruction, if the devices D–D+n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

6. For the 32-bit instruction, if the devices S1–S1+2*n-1 and S2–S2+2*n-1 exceed the device range, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2003.

7. For the 32-bit instruction, if the devices D–D+2*n-1 exceed the device range, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

8. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

9. For the 16-bit instruction, if S1–S1+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

10. For the 32-bit instruction, if S1–S1+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200C.

11. For the 16-bit instruction, if S2–S2+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#200C.

12. For the 32-bit instruction, if S2–S2+2*n-1 overlap D–D+2*n-1, the instruction is not executed, SM0 is ON, and the
error code in SR0 is 16#200C.

_6

6-106
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6.3 Data Conversion Instructions


6.3.1 List of Data Conversion Instructions
The following table lists the Data Conversion instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0200 BCD DBCD  Converting a binary number into a binary-coded decimal number

0201 BIN DBIN  Converting a binary-coded decimal number into a binary number

0202 FLT DFLT  Converting a binary integer into a binary floating-point number

0204 INT DINT  Converting a 32-bit floating-point number into a binary integer

0206 MMOV –  Converting a 16-bit value into a 32-bit value

0207 RMOV –  Converting a 32-bit value into a 16-bit value

0208 GRY DGRY  Converting a binary number into a Gray code

0209 GBIN DGBIN  Converting a Gray code into a binary number

0210 NEG DNEG  Two’s complement

0211 – FNEG  Reversing the sign of a 32-bit floating-point number

Converting a binary floating-point number into a decimal


0212 – FBCD 
floating-point number

Converting a decimal floating-point number into a binary 6_


0213 – FBIN 
floating-point number

– Converting a binary numbers in blocks into a binary-coded


0214 BKBCD 
decimal numbers in blocks

– Converting a binary numbers in blocks into a binary-coded


0215 BKBIN 
decimal numbers in blocks

0216 SCAL DSCAL  Finding a scaled value (point-slope)

0217 SCLP DSCLP  Finding a scaled value (two points)

0222 SCLM DSCLM  Multi-point area ratio operation

6-107
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.3.2 Explanation of Data Conversion Instructions

API Instruction code Operand Function

Converting a binary number into a


0200 D BCD P S, D
binary-coded decimal number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

_6
Explanation

1. This instruction converts a binary value in S into a binary-coded decimal value, and stores the conversion result in

D.

2. Only the DBCD instruction can use the 32-bit counter, but not the device E.

3. The four fundamental arithmetic operations in the PLC, the INC instruction, and the DEC instruction all operate on

binary numbers. To show the decimal value on the display, use the BCD instruction to convert a binary value into a

binary-coded decimal value

6-108
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example

1. When M0 is ON, the instruction converts a binary value in D10 into a binary-code decimal value, and stores the

conversion result in D100.

2. If D10=16#04D2=1234, the conversion result is D100=16#1234.

Additional remarks

1. If the conversion result exceeds the range 0–9,999, the instruction BCD is not executed, SM0 is ON, and the error
code in SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal value, but one of digits

is not between 0–9.

2. If the conversion result exceeds the range 0–99,999,999, the instruction DBCD is not executed, SM0 is ON, and the
error code in SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal value, but one of

digits is not between 0–9.

6_

6-109
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Converting a binary-coded decimal
0201 D BIN P S, D
number into a binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

Explanation

_6 1. This instruction converts a binary-coded decimal value in S into a binary value, and stores the conversion result in

D.

2. The 16-bit binary-coded decimal value in S must be between 0–9,999, and the 32-bit binary-coded decimal value in

S must be between 0–99,999,999.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

4. The system converts constants and hexadecimal values into binary values automatically. Therefore, you do not

need to use the instruction for that conversion.

Example

When M0 is ON, the instruction converts the binary-coded decimal value in D10 into the binary value, and stores the

conversion result in D100.

6 - 11 0
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Additional remarks

1. If the value in S is not the binary-coded decimal value, an operation error occurs, SM0 is ON, and the error code in

SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal value, but one of digits is not

between 0–9.

2. Application of the BCD and BIN instructions:

 Before the value of the binary-coded decimal type of DIP switch is read into the PLC, use the BIN instruction

to convert the data into the binary value and store the conversion result in the PLC.

 If you want to display the data stored inside the PLC in a seven-segment display of the binary-coded decimal

type, use the BCD instruction to convert the data into the binary-coded decimal value before the data is sent

to the seven-segment display.

 When M0 is ON, move values in X0-X17 to D98. BIN instruction converts the binary-coded decimal value into

the binary value, and stores the conversion result in D100. Subsequently, the BCD instruction converts the

binary value in D100 into the binary-coded decimal value and stores the value in D102; after that move the

conversion result to Y0–Y17.

6_

6 - 111
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3 2 1 0
10 10 10 10
Four-digit binary-coded
6 6 4 2 decimal type of DIP switch

8 1 8 1 8 1 8 1

X0.15 X0.0
Four-digit binary-coded decimal v alue

T he instruction BIN is used to store


the binary v alue in D100.

The instr uction BCD is used to convert


the value in D100 into the four-digit
binary- coded decimal v alue.
Y0.15 Y0.0

Four-digit binary-coded decimal type


of seven- segment display

_6

6 - 11 2
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a binary integer into a binary
0202 D FLT P S, D
floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S      
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

Explanation

1. This instruction converts the binary integer in S into the single-precision floating-point number and stores the 6_
conversion result in D.

2. The operand S used in the instruction FLT cannot be the 32-bit counter, and not the device E.

3. The source device S used in the instruction FLT occupies one register, and D used in FLT occupies two registers.

4. The source device S used in the instruction DFLT occupies two registers, and D used in DFLT also occupies two

registers.

 When the absolute value of the conversion result is larger than the value that can be represented by the
maximum floating-point number, SM602 is ON, and the maximum floating-point number is stored in D.

 When the absolute value of the conversion result is less than the value that can be represented by the

minimum floating-point number, SM601 is ON, and the minimum floating-point number is stored in D.

 When the conversion result is zero, SM600 is ON.

6 - 11 3
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. When M0 is ON, the instruction converts the binary integer in D0 into a single-precision floating-point number, and

stores the conversion result in (D13, D12).

2. When M1 is ON, the instruction converts the binary integer in (D1, D0) into a single-precision floating-point number,

and stores the conversion result in (D21, D20).

3. Suppose the value in D0 is 10. When M0 is ON, the instruction converts 10 into the single-precision floating-point

number 16#41200000, and then stores 16#41200000 in the 32-bit register (D13, D12).

4. Suppose the value in the 32-bit register (D1, D0) is 100,000. When M1 is ON, the instruction converts 100,000 into

the single-precision floating-point number 16#47C35000, and stores 16#47C35000 in the 32-bit register (D21, D20).

_6
Example 2

You can use the applied instructions to perform the following calculation.

 Convert the binary integer in D10 into the single-precision floating-point number, and store the conversion

result in (D101, D100).

 Move the binary-coded decimal value in X0–X17 to D150.

 Convert the binary-coded decimal value in D150 into the binary value and store the conversion result in D150.

 Convert the binary integer in D200 into the single-precision floating-point number, and store the conversion

result in (D203, D202).

 Divide the constant 615 by the constant 10, and store the quotient which is the single-precision floating-point

number in (D301, D300).

 Divide the single-precision floating-point number in (D101, D100) by the single-precision floating-point

number in (D203, D202), and store the quotient which is the single-precision floating-point number in (D401,

D400).

6 - 11 4
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

 Multiply the single-precision floating-point number in (D401, D400) by the single-precision floating-point

number in (D301, D300), and store the product which is the single-precision floating-point number in (D21,

D20).

 Convert the single-precision floating-point number in (D21, D20) into the decimal floating-point number, and

store the conversion result in (D31, D30).

 Convert the single-precision floating-point number in (D21, D20) into the binary integer, and store the

conversion result in (D41, D40).

(D10 ) X0~~X
(X 0.0 X17
0 .15 ) F61.5
K 6 1. 5
16- b it bi nary fo ur -digi t
numbe r binar y-coded (D2 1 ,D2 0 ) Single-pr ecision
decimal nu mb er 6 floating-point number

1 2 5 4 7
(D3 1 ,D3 0 )
Dec imal f lo at ing -poin t nu mb er
(D10 1,D 100 ) (D20 0) BIN ( D3 01, D3 00 )
8
(D4 1 ,D4 0 )
Single-precisi on 3 Single- precision
f loati ng-point number f loati ng- point number 3 2- bit in te ger

( D2 0 3, D2 02)
Single-precisi on
f loati ng-point number
(D4 0 1, D4 00)
Single-precision 6_
floating-point number

6 - 11 5
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

6 - 11 6
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a 32-bit floating-point number
0204 D INT P S, D
into a binary integer

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

6_
Explanation

1. This instruction converts a single-precision floating-point number in S into a binary integer, then rounds the binary

floating-point number down to the nearest whole digit to becomes a binary integer, and then the instruction stores

the binary integer in D.

2. The source device S used in the INT instruction occupies two registers, and D used in INT occupies one register.

3. The source device S used in the DINT instruction occupies two registers, and D used in DINT also occupies two

registers.

4. The operand D used in the INT instruction cannot be the 32-bit counter, but not the device E.

5. The INT instruction is the opposite of the FLT instruction.

6. When the conversion result is zero, SM600 is ON.

7. During the conversion, if the floating-point number is rounded down to the nearest whole digit, SM601 is ON.

8. When the conversion result exceeds the range, SM602 is ON.

6 - 11 7
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

9. For the INT/IINTP instructions, the range of conversion result is between -32,768 and 32,767.

10. For the DINT/DINTP instructions, the range of conversion result is between -2,147,483,648 and 2,147,483,647.

Example

1. When M0 is ON, the instruction converts the single-precision floating-point number in (D1, D0) into a binary integer,

and stores the conversion result in D10. The instruction rounds the binary floating-point number down to the nearest

whole digit.

2. When M1 is ON, the instruction converts the single-precision floating-point number in (D21, D20) into a binary

integer, and stores the conversion result in (D31, D30). The instruction rounds the binary floating-point number

down to the nearest whole digit.

_6

Additional remarks

If the value in S exceeds the range of values that can be represented by the floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6 - 11 8
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a 16-bit value into a 32-bit
0206 MMOV P S, D
value

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S     
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source device

D : Conversion result

Explanation

This instruction copies the data in the 16-bit device S to the 32-bit device D, and copies the sign bit from S to D.

Example 6_
When M0 is ON, the instruction copies the value of b15 in D4 to b15–b31 in (D7, D6), copies the values of b0–b14 to the

corresponding bits in (D7, D6), and ignores the bits b15–b30. The data in (D7, D6) is a negative value (same as the

source).

b1 5 b0
0 Plus sign
1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 D4
1 Minus sign

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
b3 1 b 16 b 15 b0

6 - 11 9
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Converting a 32-bit value into a 16-bit
0207 RMOV P S, D
value

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D     

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source device

D : Conversion result

Explanation

This instruction copies the data in the 32-bit device S to the 16-bit device D, and copies the sign bit from b31 to b15 so that

the value in D4 is negative (same as b31).


_6
Example

When M0 is ON, the instruction copies the value of b31 in D7 to b15 in D4, copies the values of b0–b14 to the

corresponding bits in D4, and ignores bits b15–b30. The data in (D7, D6) is a negative value (same as the source).

b31 b16 b15 b0


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

1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 D4
b15 b0

6-120
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a binary number into a Gray
0208 D GRY P S, D
code

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

Explanation
6_
1. This instruction converts the binary value in the device specified by S into a Gray code, and stores the conversion

result in the device specified by D.

2. Only the DGRY instruction can use the 32-counter, but not the device E.

3. The value in S should be within the available range.

The value in S in the 16-bit instruction must be between 0–32,767.

The value in S in the 32-bit instruction must be between 0–2,147,483,647.

6-121
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction converts the constant 6513 into a Gray code, and stores the conversion result in D0.

b 15 b0
K65 13=H197 1 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1

b1 5 b0
GR AY 6 513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1
D0

Additional remarks

If the value in S is less than 0, the operation error occurs, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

_6

6-122
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a Gray code into a binary
0209 D GBIN P S, D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S      
D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Conversion result

Explanation

1. This instruction converts the Gray code in the device specified by S into the binary value, and stores the conversion
6_
result in the device specified by D.

2. Use this instruction to convert the Gray code in the absolute position encoder which is connected to the input

terminal of the PLC to the binary value. The conversion result is stored in the specified register.

3. Only the DGBIN instruction can use the 32-counter, but not the device E.

4. The value in the device D must be within the available range.

The value in the device D in the 16-bit instruction must be between 0–32,767.

The value in the device D in the 32-bit instruction must be between 0–2,147,483,647.

6-123
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction converts the Gray code in D0 into the binary value, and stores the conversion result in

D10.

D0
b15 b0

GR AY CO DE 6513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1

b15 b0

H1971=K6513 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1

Additional remarks

If the value in S is less than 0, the operation error occurs, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.
_6

6-124
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0210 D NEG P D Finding the two’s complement

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D      

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device in which the two’s


complement is stored

Explanation

1. This instruction converts a negative binary value into the two’s compliment.

2. Only the DNEG instruction can use the 32-bit counter. 6_


3. Generally, you use the NEGP and DNEGP pulse instructions.

Example 1

When M0 is switched from OFF to ON, this instruction inverts all bits in D0 (0 becomes 1, and 1 becomes 0), and 1 is

added to the result, and then stores the final value in the original register D10.

6-125
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

Finding the two’s compliment of the negative value:

1. When the value of the 15th bit in D0 is 1, M0 is ON, and the value in D0 is a negative value.

2. When M0 is ON, the NEG instruction finds the two’s complement of the negative value in D0 (the corresponding

positive value).

Example 3

Finding the two’s compliment of the difference between two values:

When M0 is ON,
_6
1. If the value in D0 is greater than that in D2, M10 is ON.

2. If the value in D0 is equal to that in D2, M11 is ON.

3. If the value in D0 is less than that in D2, M12 is ON.

4. The value in D4 is a positive value.

6-126
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Additional remarks

Binary representation of the value and its absolute value:

1. Whether the data is a positive value or a negative value depends on the value of the highest bit in the register. If the

highest bit in the register is 0, the data is a positive value. If the highest bit is 1, the data is a negative value.

2. You can convert the negative value into its absolute value with the instruction NEG.
6_
(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

6-127
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Reversing the sign of a 32-bit floating-point
0211 FNEG P D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D DWORD     

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

D : Device in which the sign of the


value is reversed

Explanation

This instruction reverses the sign of a single-precision floating-point number in D.

Example
_6
Before the instruction is executed, the value in (D1, D0) is the negative value 16#AE0F9000. When M0 switches from

OFF to ON, the instruction reverses the sign of the single-precision floating-point number in (D1, D0). In other words, after

the instruction is executed, the value in (D1, D0) is the positive value 16#2E0F9000.

Before the instruction is executed, the value in (D1, D0) is the positive value 16#2E0F9000. When M0 switches from OFF

to ON, the instruction reverses the sign of the single-precision floating-point number in (D1, D0). In other words, after the

instruction is executed, the value in (D1, D0) is the negative value 16#AE0F9000.

6-128
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a binary floating-point number
0212 FBCD P S, D
into a decimal floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Conversion result

Explanation

1. This instruction converts thee single-precision floating-point number in the register specified by S into the decimal

floating-point number, and stores the conversion result in the register specified by D.
6_
2. The floating-point operation in the PLC is based on single-precision floating-point numbers. Use the FBCD

instruction to convert a single-precision floating-point number into a decimal floating-point number.

3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag)

When the absolute value of the conversion result is larger than the value that can be represented by the maximum

floating-point number, SM602 is ON.

When the absolute value of the conversion result is less than the value that can be represented by the minimum

floating-point number, SM601 is ON.

When the conversion result is zero, SM600 is ON.

6-129
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction converts the single-precision floating-point number in (D1, D0) into the decimal

floating-point number, and stores the conversion result in (D3, D2).

Binary floating-point number D1 D0 Real number: 23 bits; Exponent: 8 bits; sign: 1 bit

Exponent Real number


[ D3]
Decimal fl oating-point number D3 D2 Mathematical for m [D2] X10

Additional remarks

If the value in S exceeds the range of values that can be represented by the floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

_6

6-130
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting a decimal floating-point
0213 FBIN P S, D
number into a binary floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Conversion result

Explanation

1. This instruction converts the decimal floating-point number in the register specified by S into the single-precision

floating-point number, and stores the conversion result in the register specified by D.
6_
2. Suppose the value in S is 1234, and the value in S+1 is 3. The instruction converts the value in S into 1.234x10 6.

3. The value in D should be a single-precision floating-point number, and the values in S and S+1 represent the

decimal real number and the decimal exponent respectively.

4. Use the FBIN instruction to convert a decimal floating-point number into a single-precision floating-point number.

5. The real number of decimal floating-point numbers are from -9,999 to +9,999, the exponents of decimal

floating-point numbers are from -41 to +35. The practical range of decimal floating-point numbers in the PLC is

between ±1175×10-41 and ±3402×10+35. When the operation result is zero, SM600 is ON.

6-131
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. When M0 is ON, the instruction converts the decimal floating-point number in the register in (D1, D0) into the

single-precision floating-point number, and stores the conversion result is stored in (D3, D2).

Exponent Real number


[D 1]
Decimal floating-point number D1 D0 Mathematical form [D0] X10

Binar y floating-point number D3 D2 Real number: 23 bits; Ex ponent: 8 bits; sign: 1 bit

Example 2

1. Before the floating-point operation is performed, use the FLT instruction to convert the binary integer into a

single-precision floating-point number. Make sure the value to be converted is a binary integer before conversion.

You can use the FBIN instruction to convert the floating-point number into the single-precision floating-point

number.
_6
2. When M0 is ON, K314 and K-2 are moved to D0 and D1 respectively, and then FBIN combines them into the

decimal floating-point number (3.14=314×10-2).

Additional remarks

If the real number part of the decimal floating-point number in S is not between -9,999 to +9,999, or if the exponent of the

decimal floating-point number in S is not between -41 to +35, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#2013.

6-132
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting binary numbers in blocks into
0214 BKBCD P S, n, D
binary-coded decimal numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
n      
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

n : Data length

D : Conversion result

Explanation

1. The instruction converts n pieces of data (the binary values) starting from S into the binary-coded decimal values, 6_
and stores the conversion results in D.

2. The operand n must be between 1–256.

Example

When M0 is ON, the instruction converts the binary values in D0 and D1 into the binary-coded decimal values, and stores

the conversion results in D4 and D5.

6-133
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If n is less than 1, or larger than 256, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#200B.

2. If the devices specified by S+n-1 and D+n-1 exceed the range of possible devices, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003.

3. If the conversion result is not between 0–9,999, the instruction is not executed, and the error code in SR0 is

16#200D. The binary-coded decimal value is represented by the hexadecimal number, but one of digits is not in

between 0–9.

4. If S–S+n-1 overlaps D–D+n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C.

_6

6-134
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function


Converting binary numbers in blocks into
0215 BKBIN P S, n, D
binary-coded decimal numbers in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
n      
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

n : Data length

D : Conversion result

Explanation
6_
1. The instruction converts n pieces of data (the binary-coded decimal values) starting from S into the binary values,

and stores the conversion results in D.

2. The binary-coded decimal value in S must be between 0–9,999.

3. The operand n must be between 1 and 256.

Example

When M0 is ON, the instruction converts the binary-code decimal values in D0 and D1 into the binary values, and stores

the conversion results in D4 and D5.

6-135
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

2. If the devices specified by S+n-1 and D+n-1 exceed the range of possible devices, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#2003.

3. If the data in S is not a binary-coded decimal, the instruction is not executed, and the error code in SR0 is 16#200D.

The binary-coded decimal value is represented by the hexadecimal number, but one of digits is not between 0–9.

4. If S–S+n-1 overlap D–D+n-1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C.

_6

6-136
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0216 SCAL P S1, S2, S3, D Finding a scaled value (point-slope)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1        
S2        
S3        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
S3    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source

S2 : Slope

S3 : Offset

D : Destination device 6_

Explanation

1. This instruction finds a scaled linear value for the number in S1 using the slope of the line in S2 and the offset in S3

to define the scaling factor, and stores the result in D.

2. The operation equation in the instruction is D=(S1×S2)÷1,000+S3

3. To get the values in S2 and S3, use the slope equation and the offset equation below first, and then round off the

results to the nearest whole digit. Enter the final 16-bit values into S2 and S3.

The slope equation: S2=[(Maximum destination value–Minimum destination value)÷(Maximum source

value–Minimum source value)]×1,000

The offset equation: S3=Minimum destination value–Minimum source value×S2÷1,000

6-137
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The output curve is shown below:

Example 1

1. Suppose the values in S1, S2, and S3 are 500, 168, and -4 respectively. When M0 is ON, the SCAL instruction
calculates the scaled value, and stores the scaled value in D0.

2. For equation: D0=(500×168)÷1,000+(-4)=80

_6

Destination value

D
Slope=168
Offset=-4

Source value
0 S1=500

6-138
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Example 2

1. Suppose the values in S1, S2, and S3 are 500, -168, and 534 respectively. When M0 is ON, the SCAL instruction

calculates the scaled value, and stores the scaled value in D10.

2. For the equation: D10=(500×-168)÷1,000+534=450

6_
Additional remarks

1. You must know the slope and the offset to use SCAL. If the slope and the offset are unknown, you can use the

SCLP instruction.

2. When the 16-bit instruction is performed, the value entered into S2 must be between –32,768 to 32,767. If the value
in S2 exceeds the range, use the SCLP instruction.

3. When the 32-bit instruction is performed, the value entered into S2 must be between -2,147,483,648 to

2,147,483,647. If the value in S2 exceeds the range, use the SCLP instruction.

4. When you use the slope equation, note that the maximum source value should be larger than the minimum source

value. However, the maximum destination value is not necessarily larger than the minimum destination value.

5. For the 16-bit instruction, if the value in D is larger than 32,767, the value stored in D is 32,767. If the value in D is

less than -32,768, the value stored in D is -32,768.

6. When the 32-bit instruction is performed, if the value in D is larger than 2,147,483,647, the value stored in D will be

2,147,483,6477. If the value in D is less than -2,147,483,648, the value stored in D will be -2,147,483,648.

6-139
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0217 D SCLP P S1,S2,S3,D Finding a scaled value (two points)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1          
S2     
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1     
S2     
D     

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source

S2 : Parameter

D : Destination device

_6

Explanation

1. This instruction finds a scaled linear value for the value in S1 using two points in S2 to define the scaling factor, and
stores the result in D.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

3. The following table list the constant usage for the operand S1

32-bit instruction
Constant 16-bit instruction
SM685 ON SM685 OFF

Constant  X 

Hexadecimal  X 

Floating number X  X

The flag SM685 (whether to use floating point operation or not) can only be used for 32-bit instructions.

6-140
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

4. The operand S2 used in the 16-bit instruction is set as shown in the following table.

Device number Parameter Setting range

S2 Maximum source value -32,768 to 32,767

S2+1 Minimum source value -32,768 to 32,767

S2+2 Maximum destination value -32,768 to 32,767

S2+3 Minimum destination value -32,768 to 32,767

5. The operand S2 used in the 16-bit instruction occupies four devices.

6. The operand S2 used in the 32-bit instruction is set as shown in the following table.

Setting range
Device number Parameter
Integer Floating-point number

S2、S2+1 Maximum source value

S2+2、3 Minimum source value


-2,147,483,648 to The range of 32-bit

2,147,483,647 floating-point numbers


S2+4、5 Maximum destination value

S2+6、7 Minimum destination value

7. The operand S2 used in the 32-bit instruction occupies eight devices. 6_


8. If the values in the 32-bit instruction are floating-point numbers, set SM658 to ON. If the values are decimal integers,
set SM685 to OFF.

9. The operation equation in the instruction is:


D = [(S1–Minimum source value)×(Maximum destination value–Minimum destination value)]÷(Maximum source
value)+Minimum destination value

10. The operational relation between the source value and the destination value is:

y = kx+b

y=Destination value (D)

k=Slope=(Maximum destination value–Minimum destination value)÷(Maximum source value–Minimum source

value)

x=Source value (S1)

b=Offset =Minimum destination value–Minimum source value×Slope

6-141
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The parameters above are substituted for y, k, x, and b in the equation y = kx+b to get the operation equation as

follows:

y=kx+b=D=kS1+b=Slope×S1+Offset=Slope×S1+Minimum destination value–Minimum source

value×Slope=Slope×(S1–Minimum source value)+Minimum destination value =(S1–Minimum source


value)×(Maximum destination value–Minimum destination value)÷(Maximum source value–Minimum source value)

+Minimum destination value

11. If S1 is larger than the maximum source value, the maximum source value is the value in S1. If S1 is less than the
minimum source value, the minimum source value is the value in S1. The output curve is shown below.

_6

Example 1

1. Suppose the value in S1 is 500, the maximum source value in D0 is 3,000, the minimum source value in D1 is 200,
the maximum destination value in D2 is 500, and the minimum destination value in D3 is 30. When M0 is ON, the

SCLP instruction calculates the scale value and stores it in D10.

2. The operation equation: D10=[(500–200)×(500–30)]÷(3,000–200)+30=80.35

80.35 is rounded off to the nearest whole digit, and becomes 80. 80 is stored in D10.

6-142
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Destination value

Maximum desti nation 6_


value =500

D
Minimum destination
value =30 S1=500
Source value
0 Minimum Maxi mum
source value =200 source value =3000

Example 2

1. Suppose the value in S1 is 500, the maximum source value in D0 is 3,000, the minimum source value in D1 is 200,
the maximum destination value in D2 is 30, and the minimum destination value in D3 is 500. When M0 is ON, the

SCLP instruction calculates the scales value, and stores it in D10.

2. The operation equation: D10=[(500–200)×(30–500)]÷(3,000–200)+500=449.64

449.64 is rounded off to the nearest whole digit, and becomes 450. 450 is stored in D10.

6-143
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

Example 3

1. Suppose the value in S1 is 500.0, the maximum source value in D0 is 3000.0, the minimum source value in D2 is
200.0, the maximum destination value in D4 is 500.0, and the minimum destination value in D6 is 30.0. When M0 is

ON, SM685 is set to ON, the instruction DSCLP calculates the scale value and stores it in D10.

2. The operation equation: D10=[(500.0–200.0)×(500.0–30.0)]÷(3000.0–200.0)+30.0=80.35

6-144
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

80.35 is rounded off to the nearest whole digit, and becomes 80.0. 80.0 is stored in D10.

6_

Additional remarks

1. The value in S1 for 16-bit instructions must be between the minimum source value and the maximum source value;

that is, between -32,768 to 32,767. If the value exceeds the boundary value, the calculation uses the boundary

value.

6-145
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. The integer in S1 for 32-bit instructions must be between the minimum source value and the maximum source value;

that is, between -2,147,483,648 to 2,147,483,647. If the integer exceeds the boundary value, the calculation uses

the boundary value.

3. The floating-point number in S1 for 32-bit instructions must be between the minimum source value and the

maximum source value; that is, within the range of floating-point numbers. If the floating-point number exceeds the

boundary value, the calculation uses the boundary value.

4. Note that the maximum source value must be larger than the minimum source value. However, the maximum

destination value is not necessarily larger than the minimum destination value.

5. When the maximum source value is the same as the minimum source value, the instruction is be executed, SM0 is

ON and the error code in SR0 is 16#2012.

6. If you declare S2 for a 16-bit instruction in ISPSoft/DIADesigner, the data type is ARRAY [4] of WORD.

7. If you declare S2 for a 32-bit instruction in ISPSoft/DIADesigner, the data type is ARRAY [4] of DWORD.

_6

6-146
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction Operand Description

0222 D SCLM P S1,S2,S3,S4,D Multi-point area ratio operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2      
S3     
S4     
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1     
S2    
S3    
S4    
D     

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source

S2 : Number of multi-point areas


6_
S3 : Comparison value in a multi-point area

S4 : Conversion reference value

D : Operation result

Explanation

1. Only the 32-bit instruction can use HC devices but not E devices.

2. See the following table about data types that the operands S1, S3 and S4 correspond to. ( represents ‘Usable’. X
represents ‘Unusable’.)

6-147
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

32-bit instruction
16-bit
Constant
instruction SM685 ON SM685 OFF

K  X 

16#  X 

F X  X

Note: SM685=ON (the floating point number operation) works for the 32-bit instruction only.

3. S1 is the data source. S2 is the number of multi-point areas and the value should be between 2 and 50. If the value

exceeds the range, the instruction will be executed automatically at the minimum value or maximum value. S3 is a

setting value for comparison in a multi-point area. S4 is a conversion reference value that a multi-point area

comparison value corresponds to, e.g. the number of areas, S2 is 10. Then S3 ~ S3+9 are comparison values in 10

areas. S4 ~ S4+9 are 10 corresponding conversion reference values.

4. The comparison order for multi-point areas is 0, 1, 2 …S2 –1. The comparison rule is S1 >= S3+0 and S1 < S3+1. If S1

value does not belong to an area, the comparison will move on to the next area. For example, S1 >= S3+1 and S1 <

S3+2, the comparison keeps going until the number of comparison times reaches S2 – 1.

5. The instruction compares areas in the order from small to large. Please design the value comparison of S3 area in

the order from small to large as well.

6. See the figure below for the conversion of multi-point area values. (Set the number of areas, S2 to 4.)

_6 S4

S4+0
D
S4+1
S4+3

S4+2

S3
S3+0 S3+1 S3+2 S3+3
S1
7. If S1 value is between S3+0 and S3+1, the conversion formula: D =﹝ ( S1 – S3+0) x ( S4+1 – S4+0 ) / ( S3+1 –

S3+0 ) ﹞+ S4+0.

8. If S1 value does not belong to any specified area, the execution result in D is explained as below.

If S1 value > the last specified area, D will store the last conversion reference value of S4, e.g. if S1 value > S3+3

value in the figure above, D=S4+3.

6-148
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

If S1 value < the first specified area, D will store the first conversion reference value of S4, e.g. if S1 value < S3+0

value in the figure above, D=S4+0.

9. If S3 and S4 of the16-bit instruction are declared on ISPSoft/DIADesigner, the data type is ARRAY [S2] of WORD.

10. If S3 and S4 of the 32-bit instruction are declared on ISPSoft/DIADesigner, the data type is ARRAY [S2] of DWORD

(SM685=OFF) or ARRAY [S2] of REAL (SM685=ON).

11. For ES3 CPU with firmware V1.06.10 or later and EX3/SV3/SX3 CPU with firmware V1.00.00 or later, DSCLM
instruction (32-bit) supports the application of Thread Gauge Calibration. And the differences of the thread ring and
pitch diameter between the physical parameter and the number of output pulses can be corrected.
Operational steps:
A. Measure each pitch diameter of the thread ring and the corresponding number of output pulses and then enter

the measured values in S3 and S4 respectively.

Calibration
section number 1 2 3 … 6 7 … 16

Self-defined value -5000 -4000 0 1000 10000

Number of actual output pulses -5002 -4003 0 1003 10005

Zero
Max. value Max. value
point
of the negative direction of the positive direction

Calibration areas of the positive


Calibration areas of the negative direction
direction

6_
Calibration section Target position Number of actual output pulses
number Value in S3 Value in S4
1 -5000 (D100, D101) -5002 (D200, D201)
2 -4000 (D102, D103) -4003 (D202, D203)

6 0 (D110, D111) 0 (D210, D211)


7 1000 (D112, D113) 1003 (D212, D213)

16 10000 (D130, D131) 10005 (D230, D231)

B. The low byte in S2 is where you specify the number of calibration sections; up to 50 sections can be set. While

the high byte in S2 is where you specify the axis number to execute the calibration function and the setting

value can be 1 to 8, which stands for the output point Y0 to Y7 respectively. The setting value 0 in the high byte

means to perform the original data conversion. The operands S1 and D are invalid while the calibration is

performed.

6-149
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

C. Use EN contact to start DSCLM instruction (the calibration function), and the positioning instruction for the

output axis will modify the number of actual output pulses according to the calibration parameters. When

DSCLM instruction is disabled, the calibration is disabled.

Example

The comparison values of S3 for multi-point areas are given as follows.


Device D100 D101 D102 D103
Content 100 200 300 400
The corresponding conversion reference values of S4 are given as follows.
Device D200 D201 D202 D203
Content 4000 3000 1500 2000

Here is the explanation about the value in D2 obtained through a conversion based on the data resource D0.

Set D0=10,
Since D0<D100 (in the first area), D2=D200=4000 (the first conversion reference value)

Set D0=K150,
D0 value is in between (D100, D101) = (100, 200) and the corresponding reference value is (D200, D201) =
_6 (4000, 3000)
Therefore,
D2= (150-100)* (3000-4000) / (200-100) +4000=3500

Set D0=450,
Since D0>D103 (in the last area), D2=D203=2000 (the last conversion reference value)

Set D0=K250,
D0 value is between (D101, D102) = (200, 300) and the corresponding reference value is (D201, D202) = (3000,
1500).
Therefore,
D2= (250-200) *(1500-3000) / (300-200) +3000=2250

Set D0=K350,
D0 is between (D102, D103) = (300, 400) and the corresponding reference value is (D202, D203) = (1500, 2000)
Therefore,
D2= (350-300) * (2000-1500) / (400-300) +1500=1750

6-150
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.4 Data Transfer Instructions


6.4.1 List of Data Transfer Instructions
The following table lists the Data Transfer instructions covered in this section.

Instruction code
API Pulse instruction Function
16-bit 32-bit

0300 MOV DMOV  Transferring data

0302 $MOV –  Transferring a string

0303 CML DCML  Inverting data

0304 BMOV DBMOV  Transferring data in blocks

0305 NMOV DNMOV  Transferring data to multiple devices

0306 XCH DXCH  Exchanging data

0307 BXCH –  Exchanging data in blocks

0308 SWAP DSWAP  Exchanging the high byte with the low byte

0309 SMOV –  Transferring digits in blocks

0310 MOVB –  Transferring bits in blocks

6_

6-151
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.4.2 Explanation of Data Transfer Instructions

API Instruction code Operand Function

0300 D MOV P S, D Transferring data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S          
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S       
D       

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Data destination

_6
Explanation

1. This instruction transfers the data in S to D.

2. You must use a 32-bit instruction when the data in S is a floating-point number.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

1. To transfer 16-bit data, use MOV.

 When M0 is OFF, the data in D0 is unchanged. When M0 is ON, the instruction transfers 10 to the data

register D0.

 When M1 is OFF, the data in D10 is unchanged. When M1 is ON, the instruction transfers the current value of

T0 to the data register D10.

6-152
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. For 32-bit data, use DMOV.

 When M2 is OFF, the data in (D31, D30) and (D41, D40) is unchanged. When M2 is ON, the instruction

transfers the current value in (D21, D20) to (D31, D30), and transfers the current value of HC0 to (D41, D40).

3. For floating-point numbers, use DMOV.

 When M3 is OFF, the data in (D51, D50) is unchanged. When M3 is ON, the instruction converts the

floating-point number 3.450 into a binary floating-point number, and transfers the conversion result is to (D51,

D50).

6_

6-153
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0302 $MOV P S, D Transferring a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

D : Data destination

Explanation

1. This instruction transfers the string in S to D, and adds the code 16#00 to the end of the string.
_6
2. When the operand S is not a string, the instruction adds the code 16#00 to the end of the data transferred.

3. When the ending code16#00 cannot be found in S for 256 characters in a row or even beyond the device range, the

instruction is not executed; SM0 is ON and the error code in SR0 is 16#200E.

4. When the operand S is not a string and the instruction is executed, the string starting with the data in the device

specified by S (including 16#00) is transferred to D. When the instruction is not executed, the data in D is
unchanged.

5. If D is not sufficient to contain the string composed of the values in S, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

6. Suppose the operand S is not a string. When the instruction is executed and the first character in S is the code

16#00, 16#00 is still transferred to D.

6-154
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

7. When 16#00 appears in the low byte, the execution of the instruction is as follows.

Before t he instruction is executed:


b15~b8 b7~b0 B15~b8 b7~b0
S 16#31 16#30 D 16#38 16#39
S+1 16#33 16#32 D+1 16#36 16#37
S+2 16#35 16#34 D+2 16#34 16#35
S+3 16#30 16#00 D+3 16#32 16#33

After t he instruct ion is executed:


b15~b8 b7~b0 b15~b8 b7~b0
S 16#31 16#30 D 16#31 16#30
S+1 16#33 16#32 D+1 16#33 16#32
S+2 16#35 16#34 D+2 16#35 16#34
S+3 16#30 16#00 D+3 16#00 16#00

16#30 in the high byte 16#32 in t he high byte


is not t ransferred. turns into 16#00.

8. When 16#00 appears in the high byte, the execution of the instruction is as follows. The transfer stops when the

code 16#00, leaving the remainder of D unchanged.

Before t he instruct ion is executed:


b15~ b8 b7~b0 b15~b8 b7~b0
S 16#31 16#30 D 16#38 16#39 6_
S +1 16#33 16#32 D+1 16#36 16#37
S +2 16#00 16#34 D+2 16#34 16#35
S+ 3 16#37 16#36 D+ 3 16#32 16#33

A fter the instruct ion is ex ecuted:

b15~b8 b7~b0 b15~b8 b7~b0


S 16#31 16#30 D 16#31 16#30
S+1 16#33 16#32 D+1 16#33 16#32
S+2 16#00 16#34 D+2 16#00 16#34
S +3 16#37 16#36 D+3 16#32 16#33

6-155
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

9. When S overlaps D and the device number of S is less than the device number of D, the transfer of the data to D

starts form the ending code 16#00.

Before t he i nstructi on i s exe cuted:


b15 ~b8 b7~b0 b 15~b8 b7~b0
D0 1 6#31 16#30 D1 16#3 3 16# 32
D1 16#3 3 16#32 D2 16 #35 16# 34
D2 16 #35 16#34 D3 16#30 16 #00
D3 16 #30 16#00 D4 16#3 8 16#37

After the i nstruction i s executed :


b15~b8 b7~b 0 b1 5~b8 b7~b0
D0 1 6#31 16#30 D1 16#31 16#3 0
D1 16#33 16#32 D2 16# 33 16#3 2
D2 16# 35 16#34 D3 1 6#35 16# 34
D3 16#30 1 6#00 D4 1 6#00 16# 00

10. When D operand directly uses devices for editing, after compiling the program, the software will show a warning on

the data length so as to prevent you from occupying other data areas.

Example 1

If D operand is a variable, the declared length of the STRING type is the total of the maximum length + 1, with an ending

code included. Suppose the maximum length of the string data in S is 4, the declared length of the STRING type must be
_6
5.

Suppose the data in S is the string “1234” (even number of bytes). When M0 is enabled, the string “1234” and the ending

code 16#00 are transferred to D0–D3, as follows.

Local Symbols

No. Class Identifiers Address Type Initial Value Identifier Comment

1 VAR MOV_String D0 STRING(5) NA

The operand S:

String ‘1’ ‘2’ ‘3’ ‘4’

Hexadecimal
16#31 16#32 16#33 16#34
value

6-156
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

After the instruction is executed, the data in D is as follows.

Device High byte Low byte Note

D0 16#32 16#31 ‘1’=16#31; ‘2’=16#32

D1 16#34 16#33 ‘3’=16#33; ‘4’=16#34

The ending code 16#00 is in the low byte.


D2 16#00 16#00
16#00 is automatically added in the high byte.

D3 Unchanged Unchanged

Example 2

If D operand is a variable, the declared length of the STRING type is the total of the maximum length + 1, with an ending

code included. Suppose the maximum length of the string data in S is 5, the declared length of the STRING type must be

6.

Suppose the data in S is the string “12345” (odd number of bytes). When M0 is enabled, the data 12345 is transferred to

D0–D3 as follows.

Local Symbols

No. Class Identifiers Address Type Initial Value Identifier Comment

1 VAR MOV_String D0 STRING(6) NA


6_

The operand S:

String ‘1’ ‘2’ ‘3’ ‘4’ ‘5’

Hexadecimal
16#31 16#32 16#33 16#34 16#35
value

After the instruction is executed, the data in the operand D is as follows.

Device High byte Low byte Note

D0 16#32 16#31 ‘1’=16#31; ‘2’=16#32

D1 16#34 16#33 ‘3’=16#33; ‘4’=16#34

D2 16#00 16#35 The ending code 16#00 is in the high byte.

D3 Unchanged Unchanged

6-157
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 3

When the data in S is not a string and the ending code 16#00 appears in the low byte, the execution of the instruction is as

follows.

Local Symbols

No. Class Identifiers Address Type Initial Value Identifier Comment

1 VAR String_In D100 STRING(8) NA


2 VAR MOV_String D0 STRING(8) NA

The operand S:

Device High byte Low byte Note

D100 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D101 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D102 16#35 16#34 ‘5’=16#35; ‘4’=16#34

D103 16#30 16#00 ‘0’=16#30; 16#00 is the ending code.


_6 After the instruction is executed, the data in the operand D is as follows.

Device High byte Low byte Note

D0 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D1 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D2 16#35 16#34 ‘5’=16#35; ‘4’=16#34

The ending code 16#00 is in the low byte.


D3 16#00 16#00
16#00 is automatically added in the high byte.

D4 Unchanged Unchanged

Example 4

When the data in S is not a string and the ending code 16#00 appears in the high byte, the execution of the instruction is

as follows.

6-158
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Local Symbols

No. Class Identifiers Address Type Initial Value Identifier Comment

1 VAR String_In D100 STRING(8) NA

2 VAR MOV_String D0 STRING(8) NA

The operand S:

Device High byte Low byte Note

D100 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D101 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D102 16#00 16#34 16#00 is the ending code. ‘4’=16#34

D103 16#37 16#36 ‘7’=16#37; ‘6’=16#36

After the instruction is executed, the data in the operand D is as follows.


6_
Device High byte Low byte Note

D0 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D1 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D2 16#00 16#34 16#00 is the ending code. ‘4’=16#34

D3 Unchanged Unchanged

Example 5

When S overlaps D, and the device number of S is less than the device number of D, the transfer of the data to D starts

from the ending code 16#00.

6-159
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The operand S:

Device High byte Low byte Note

D0 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D1 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D2 16#35 16#34 ‘5’=16#35; ‘4’=16#34

D3 16#30 16#00 ‘0’=16#30; 16#00 is the ending code.

D4 16#38 16#37 ‘8’=16#38; ‘7’=16#37

After the instruction is executed, the data in D is as follows.

Device High byte Low byte Note

D1 16#31 16#30 ‘1’=16#31; ‘0’=16#30

D2 16#33 16#32 ‘3’=16#33; ‘2’=16#32

D3 16#35 16#34 ‘5’=16#35; ‘4’=16#34

The ending code 16#00 is in the low byte.


_6 D4 16#00 16#00
16#00 is automatically added in the high byte.

D5 Unchanged Unchanged

6-160
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0303 D CML P S, D Inverting data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Data destination

Explanation

1. This instruction inverts all bits in S; that is, 0 becomes 1, and 1 becomes 0, and stores the inversion result in D. If the 6_
data in S is a constant, the instruction converts it into a binary value.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example 1

When M0 is ON, the instruction inverts b0~b15 in D1, and stores the conversion result in b0~b15 in D10.

b 15 b 3 b2 b1 b 0
D1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
S i g n bi t (0 : P o s it iv e s ig n ; 1 : N e g a tiv e s i gn )

D10
Y0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

I n ve r si o n r e su l t

6-161
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0304 D BMOV P S, D, n Transferring data in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D    
n       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Data destination

n : Data length

_6

Explanation

1. This instruction transfers n pieces of data in a block starting from the device specified by S to the devices starting

from the device specified by D.

2. The value in n must be between 1–256.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

4. To prevent overlapping the source and the destination, the instruction transfers the data in the following way (using

the 16-bit instruction as an example).

When the device number of S is larger than the device number of D, the data is transferred in the order from  to .

1
D 20 D 19
2
D 21 D 20
3
D 22 D 21

6-162
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

When the device number of S is less than the device number of D, the data is transferred in the order from  to .

1
D 19 D 20
2
D 20 D 21
3
D 21 D 22

Example 1

When M0 is ON, the instruction transfers the data in D0–D3 to D20–D23.

D0 D20
D1 D21
N=4
D2 D22
D3 D23

Example 2

To prevent overlapping the source and the destination, the data is transferred in the following way.
6_
1. When the device number of S is larger than the device number of D, the data is transferred in the order from  to .

1
D20 D19
2
D21 D20
3
D22 D21

6-163
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. When the device number of S is less than the device number of D, the data is transferred in the order from  to .

1
D10 D11
2
D11 D12
3
D12 D13

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

_6

6-164
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0305 D NMOV P S, D, n Transferring data to multiple devices

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D    
n DWORD       

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Data destination

n : Data length

6_

Explanation

1. This instruction transfers the data in S to the n devices starting from the device specified by D. When the instruction

is not executed, the data in D is unchanged.

2. Only the 32-bit instructions can use the 32-bit counter.

3. The value in n in the NMOV instruction must be between 1–256.

S S D

S D+1

S D+2 N=5

S D+3

S D+4

6-165
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, 100 is transferred to D0-D9.

Additional remarks

1. If D-D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If the value in n in the 16-bit instruction is not between 1–256, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200B.

_6

6-166
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0306 D XCH P S1, S2 Exchanging data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data to exchange

S2 : Data to exchange

6_
Explanation
1. This instruction exchanges the data in the device specified by S1 with the data in the device specified by S2.
2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example 1
When M0 is switched from OFF to ON, the instruction exchanges the data in D20 with the data in D40.

Before the instru ctio n After th e instruction


is execute d: is exe cuted :
D20 120 40 D20
D40 40 120 D40

Example 2
When M0 switches from OFF to ON, the instruction exchanges the data in D100 with the data in D200.

6-167
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

D 201 40 20 D201
D 20 0 8 9 D200

D 101 20 40 D101
D 10 0 9 8 D100
is e xe cut e d : is e x e c u t e d :
Be f o re th e inst ruct io n Af te r t h e in s t r u c t io n

_6

6-168
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0307 BXCH P S1,S2,n Exchanging data in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2   
n DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Data to exchange

S2 : Data to exchange

n : Data length

Explanation
6_
1. This instruction exchanges the data in S1–S1+n-1 with the data in S2–S2+n-1.

2. The value in n must be between 1–256.

S1 S1 +1 S1 +2 .... S1 +n- 1 S2 S2 +1 S2 +2 .... S2 +n- 1

S1 S1 +1 S1 +2 .... S1 +n- 1 S2 S2 +1 S2 +2 .... S2 +n- 1

6-169
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction exchanges the data in D10–D14 with the data in D100–D104.

D10 D11 D12 D13 D14 D100 D101 D102 D103 D104

1 2 3 4 5 16 17 18 19 20

After the instruction is executed

D10 D11 D12 D13 D14 D100 D101 D102 D103 D104
16 17 18 19 20 1 2 3 4 5

Additional remarks

1. If S1+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.
_6
2. If S2+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

3. If the value in n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

6-170
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0308 D SWAP P S Exchanging the high byte with the low byte

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

Explanation

1. The 16-bit instruction exchanges the data in the low byte in S with the data in the high byte in S. 6_
2. The 32-bit instruction exchanges the data in the low byte of the high word in S with the data in the high byte of the

high word in S, and exchanges the data in the low byte of the low word in S with the data in the high byte of the low

word in S.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example 1

When M0 is ON, the instruction exchanges the data in the low byte in D0 with the data in the high byte in D0.

D0

High by te Low byte

6-171
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

When M0 is ON, the instruction exchanges the data in the low byte in D11 with the data in the high byte in D11, and

exchanges the data in the low byte in D10 with the data in the high byte in D10.

D11 D10
Hig h byte Lo w byte Hig h byte Lo w byte

_6

6-172
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0309 SMOV P S, m1, m2, D, n Transferring digits in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      
m1      
m2      
D   
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
m1  
m2  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

m1 : Start digit to transfer from the source device


6_
m2 : Number of digits to transfer

D : Data destination
Start digit where the source data is stored in
n :
the destination device
Explanation

1. This instruction allocates and combines data. The instruction transfers m2 digits of the number starting from the m1th

digit of the number in S to the m2 digits of the number starting from the nth digit of the number in D.

2. The value in m1 must be between 1–4. The value in m2 must be between 1–m1. The value in n must be between

m2–4 (the instruction treats four bits as a unit.)

3. When SM605 is OFF, the data in S are binary-coded decimal numbers.

6-173
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

D10 (16-bit binary number)


Conversion
3 2 1 0
10 10 10 10 D10 (4-digit binary-coded decimal)

Unchanged Unchanged Transferring the digits


3 2 1 0
10 10 10 10 D20 (4-digit binary-coded decimal)
Conversion

D20 (16-bit binary number)

Suppose the number in S is K1234, and the number in D is K5678. After the instruction is executed, the number in S

is 1234, and the number in D is 5128.

4. When SM605 is ON, the data involved in the instruction is binary numbers.

4 digit 3 d igit 2 di gi t 1 digit


th rd nd st

D10 (16-bit bi nary number)

Transferring the digits

D20 (16-bit bi nary number)


4 digit 3 d igit
th rd
2 di gi t
nd
1 digit
st

Unchanged Unchanged

Suppose the number in S is 16#1234, and the number in D is 16#5678. After the instruction is executed, the number

in S is 16#1234, and the number in D is 16#5128.

_6
Example 1

1. When SM605 is OFF, the data in S are binary-coded decimal numbers. When M0 is ON, the instruction transfers

two digits of the decimal number starting from the fourth digit of the decimal number (the digit in the thousands place

of the decimal number) in D10 to the two digits of the decimal number starting from the third digit of the decimal

number (the digit in the hundreds place of the decimal number) in D20. After the instruction is executed, the digits in

the thousands place of the decimal number (103) and the ones place of the decimal number (100) in D20 are

unchanged.

2. When the binary-code decimal number is not between 0–9,999, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200D.

6-174
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

D10 (16-bit binary number)


Conversion
3 2 1 0
10 10 10 10 D10 (4-digit binary-coded decimal)

Unchanged Unchanged Transferring the digits


3 2 1 0
10 10 10 10 D20 (4-digit binary-coded decimal)
Conversion

D20 (16-bit binary number)

Suppose the number in D10 is 1234, and the number in D20 is 5678. After the instruction is executed, the number in

D10 is unchanged, and the number in D20 is 5128.

6_
Example 2

When SM605 is ON, the data are binary numbers. The SMOV instruction transfers the digit composed of four bits. The

instruction does not transform the data into binary-coded decimal numbers.

6-175
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4 digit 3 di git 2 digit 1 digit


th rd nd st

D10 (16-bi t binary number)

Transferring the digits

D20 (16-bi t binary number)


4 digit 3 di git 2 digit 1 digit
th rd nd st

Unchanged Unchanged

Suppose the number in D10 is 16#1234, and the number in D20 is 16#5678. After the instruction is executed, the

number in D10 is unchanged, and the number in D20 is 16#5128.

Example 3

1. You can use the instruction to combine the values of the DIP switches that are connected to the input terminals

whose numbers are not consecutive.

2. The two digits of the value of the DIP switch at the right are transferred to the two digits of the number which start

from the second digit of the number in D2, and the one digit of the value of the DIP switch at the left is transferred to

the first digit of the number in D1.

3. You can use the SMOV instruction to transfer the first digit of the number in D1 to the third digit of the number in D2.

In other words, the two DIP switches can be combined into one DIP switch by means of the SMOV instruction.

_6 2 1 0
10 10 10

6 4 2

4 1 8 5
4 1

X 3~X 0 X 17~X10

PLC

6-176
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

1. Suppose the data are binary-coded decimal numbers. If the number in S is not between 0–9999, or if the number in 6_
D is not between 0–9999, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200D.

2. If m1 is less than 1, or if m1 is larger than 4, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

3. If m2 is less than 1, or if m2 is larger than m1, the instruction is not executed, SM0 is ON, and the error code in SR0
is 16#200B.

4. If n is less than m2, or if n is larger than 4, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

6-177
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


0310 MOVB P S, n, D Transferring bits in blocks

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
n        
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
n  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

n : Data length

D : Data destination

Explanation

1. This instruction transfers n pieces of data in devices starting from the device specified by S to the devices starting
_6 from the device specified by D.

2. When S is T, C or HC, the instruction transfers only the state of the device, but does not transfer the current value of

the device.

3. The value in n must be between 1–256. When n not between 1–256, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#200B.

Example

When M0 is ON, the instruction transfers the data in D0.8–D0.13 to D1.2–D1.7.

6-178
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

2. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

6_

6-179
DV P- E S 3/ EX 3/ S V 3/ SX S er i es Pr o gr am m ing Ma n ua l

6.5 Jump Instructions


6.5.1 List of Jump Instructions
The following table lists the Jump instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0400 CJ –  Conditional jump

0401 JMP – – Unconditional jump

0402 GOEND – – Jumping to the end of the program

_6

6-180
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.5.2 Explanation of Jump Instructions

API Instruction code Operand Function

0400 CJ P S Conditional jump

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX ES3/EX3/SV3/SX -

Symbol

S : Jump destination

Explanation

1. This instruction jumps from the current program execution to a label (destination) in a different part of the program in

the PLC. You specify the label (pointer) in S. You can use the CJ or CJP instruction to shorten the scan time. You

can also use the CJ or CJP instruction when using a dual output. 6_
2. If the program specified by the jump destination (label) is prior to the CJ instruction, the watchdog timer error occurs,

and the PLC stops running the program. Use this instruction carefully.

3. You can specify the same label repeatedly with the multiple different CJ instructions.

4. When the instruction is executed, the actions of the devices are as described below.

 The state of Y, the state of M, and the state of S remain the same as before the execution of the jump.

 The timer keeps counting and when it reaches the time setting value, the program drives the output T-coil.

 For more information on the MC and MCR instructions, refer to Example 2 below.

 The general applied instructions are not executed.

6-181
DV P- E S 3/ EX 3/ S V 3/ SX S er i es Pr o gr am m ing Ma n ua l

Example 1

1. When M0 is ON, the execution jumps from NETWORK 1 to LABEL1 (NETWORK 3) and skips NETWORK 2.

2. When M0 is OFF, the execution of the program goes from NETWORK 1 to NETWORK 2 to NETWORK 3 in

sequence, and the CJ instruction is not executed.

Example 2

_6 1. You can use the CJ instruction between the MC and the MCR instructions 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.

2. When the PLC executes an MC instruction, it puts the previous state of the switch contact onto the top of the stack

inside the PLC. The stack is controlled by the PLC, and cannot be changed. When the PLC executes the MCR

instruction, the PLC pops the previous state of the switch contact from the top of the stack. Under the conditions

6-182
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

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; items can be popped from the stack until the stack is empty. Therefore, when you use CJ or CJP

with MC and MCR, be careful of how the program pushes items onto the stack and pops items from the stack.

6_

6-183
DV P- E S 3/ EX 3/ S V 3/ SX S er i es Pr o gr am m ing Ma n ua l

Example 3

The states of the devices are listed below.

State of the contact State of the contact during the State of the output coil during the

Device before the execution execution of CJ execution of CJ

of CJ M0=OFF M0=ON M0=ON

M1, M2, and M3 are M1, M2, and M3 switch from OFF to
Y1*1, M20, and S1 are OFF.
OFF. ON.
Y, M, and S
M1, M2, and M3 M1, M2, and M3 switch from ON to
Y1*1, M20, and S1 are ON.
are ON. OFF.

M4 is OFF. M4 switches from OFF to ON. The timer is not enabled.

The timer keeps counting and when


Timer
M4 is ON. M4 switches from ON to OFF the timer setting value is reached, it

drives the output T-coil.

M6 is OFF. M6 switches from OFF to ON. ST1 is not enabled.

The accumulative timer keeps


Accumulative
counting and when the timer setting
timer M6 is ON. M6 switches from ON to OFF.
value is reached, it drives the output

T-coil.
_6
M7 and M10 are
M10 is ON/OFF. The counter is not enabled.
OFF.
Counter
M7 is OFF. M10 is C0 stops counting. When M0 switches
M10 is ON/OFF.
ON/OFF. OFF, C0 keeps counting.

M11 is OFF. M11 switches from OFF to ON The applied instruction is not executed.
Applied
The applied instruction is skipped (not
instruction M11 is ON. M11 switches from ON to OFF
executed).

*1:Y1 is a dual output. When M0 is OFF, Y1 is controlled by M1. When M0 is ON, Y1 is controlled by M12.

6-184
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6_

6-185
DV P- E S 3/ EX 3/ S V 3/ SX S er i es Pr o gr am m ing Ma n ua l

_6
Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on the use of labels (pointers) with Jump instructions.

6-186
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0401 JMP S Unconditional jump

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX -

Symbol

S : Jump destination

Explanation

1. This instruction causes the execution of the program to jump to the part of the program specified by the label in S

(pointer) without any condition.

6_
2. If the program specified by the label is prior to the instruction JMP, the watchdog timer error occurs, and the PLC

stops running the program. Use this instruction carefully.

3. Refer to the CJ instruction (API 400) for more information on the states of devices while executing this instruction.

4. Refer to the ISPSoft/DIADesigner User Manual for more information on the use of labels (pointers) with Jump

instructions.

6-187
DV P- E S 3/ EX 3/ S V 3/ SX S er i es Pr o gr am m ing Ma n ua l

API Instruction code Operand Function

0402 GOEND ─ Jumping to END

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX -

Symbol

Explanation

1. This instruction causes program execution to jump to END in the program.

2. Function blocks and interrupt tasks do not support the GOEND instruction. You cannot use the instruction between
the FOR instruction and the NEXT instruction.

3. When the PLC executes the GOEND instruction, the instructions skipped are not executed, the data in all devices is

unchanged, and the states of all devices are also unchanged.

_6

6-188
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

6.6 Program Execution Instructions


6.6.1 List of Program Execution Instructions
The following table lists the Program Execution instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0500 DI – – Disabling the interrupt function

0501 EI – – Enabling the interrupt function

0503 EIX – – Disabling a specific interrupt

0504 DIX – – Enabling a specific interrupt

6_

6-189
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.6.2 Explanation of Program Execution Instructions

API Instruction code Operand Function

0500 DI - Disabling the interrupt function

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Explanation

Refer to the EI instruction (API 0501) for more information.

_6

6-190
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0501 EI - Enabling the interrupt function

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Explanation

1. Use the EI instruction to enable interrupt tasks in a program (refer to next page for more information on tasks).

2. You can use the interrupt task between the EI instruction and the DI instruction in a program. You can choose not to

use the DI instruction when there is no part of the program in which the interrupt is disabled.

3. During the execution of one interrupt task, a new interrupt generated is not executed, but is stored. After the

execution of the present interrupt task is complete, the next interrupt task is executed. For example, during the

execution of I0 (by trigged order #1), 2 new I0s (by trigged order #2, by trigged order #3) are generated, only by

trigged order #2 I0 will be stored for later execution. By trigged order #3 IO is not stored for execution.

4. When several interrupts occur, the interrupt task with the highest priority is executed first. When several interrupts

occur simultaneously, the interrupt task with the smallest pointer number is executed first.
6_
5. When the interrupt task occurs between DI and EI, it cannot be executed, and the interrupt request is ignored. It is

suggested that you not use the instruction DI to disable interrupts while PLC is running.

6. When the immediate I/O signal is required in the execution of the interrupt task, you can use the REF instruction or

the device DX/DY in the program to refresh the state of the I/O.

7. Every interrupt number has a temporary function that can be masked. See below for the list of interrupt numbers.

Example:

 Set up the timed I601 interrupt task to 500ms in HWCONFIG in ISPSoft.

 When the PLC runs the program Cyclic_0, it scans the EI instruction, enables interrupt tasks, and then executes the

I601 interrupt task. When the interrupt task execution is complete, the main program is executed.

 When M0 is ON, the I601 timer interrupt task is disabled.

 When M1 is ON, the I601 timer interrupt task is enabled.

6-191
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 When M2 is ON, the SR632 is 0 and the I601 timer interrupt task is disabled.

 When M3 is ON, the SR632 is 1 and the I601 timer interrupt task is enabled.

The program Cyclic_0:

_6
The interrupt task:

6-192
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Timer interrupts in a diagram:

M0 =O N
Exec ute the i nstruction EIX
to e nable i nterrupt

M1 =O N
S R623= 0
interr upt d isabled

M2 =O N
SR623=1
interrupt enabled

M3 =O N

0 .5
Y0 0 .5 s ec
se c

Additional remarks

There are 6 types of interrupt tasks:

1. External interrupts (I000–I115)

I000 specifies that the input X0 is falling edge triggered.

I100 specifies that the input X0 is rising edge triggered.


6_
I001 specifies that the input X1 is falling edge triggered.

I101 specifies that the input X1 is rising edge triggered. The rest can be done in the same manner.

2. Hardware high-speed comparison interrupts (I200–I253)

This type of interrupts can be further divided into 6 groups. Each group corresponds to a hardware high-speed counter

(refer to the DCNT instruction API 1003 for more information). Each group has with 4 interrupt numbers (refer to the

DHSCS instruction API 1005 for more information). For example, the interrupt numbers for the first group are

I200–I203, and for the second group are I210–I213.

3. Software high-speed comparison interrupts (I260–I267)

There are 8 interrupts for software high-speed comparisons and these 8 interrupts are shared with 8 high-speed

counters.

4. Communication interrupts

You can use the communication interrupt as the RS instruction; that is, receiving a specific character triggers the

interrupt, or you can use it as a general interrupt. Refer to the COMRS instruction (API1812) for more information.

6-193
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

COM1: I300

COM2: I302

5. High-speed output interrupts (I500–I519)

When the pulse output is complete, the interrupt request is sent. The interrupts (I500–I505) for the completing the

execution of the positioning instruction work with special devices (SM) to activate the interrupt service. For example,

when the DDRVI instruction completes the execution of the first axis, the interrupt request I500 is sent; you can set

SM471 to ON to activate the interrupt service. The interrupts (I510–I519) for the completing the execution of the

position planning table instruction work with the TPO instruction. When the pulse output is complete, the interrupt

request is sent.

6. Timer interrupts (I601–I604)

Set the timer interrupts set in HWCONFIG.

For the timer interrupts I601–I603: The default value is 10 milliseconds (unit: 1ms) (1–2000 milliseconds).

For the timer interrupts I604: The default value is 1 milliseconds (unit: 0.1ms) (0.1–200 milliseconds).

The complete list of interrupt numbers, descriptions and the maskable interrupts (SR) are listed in the following table.

Interrupt Maskable interrupts


Description Bit No.
number SR
_6
I000 External interrupt: input X0 is falling edge triggered. 0

I001 External interrupt: input X1 is falling edge triggered. 1

I002 External interrupt: input X2 is falling edge triggered. 2

I003 External interrupt: input X3 is falling edge triggered. 3

I004 External interrupt: input X4 is falling edge triggered. 4

I005 External interrupt: input X5 is falling edge triggered. 5

I006 External interrupt: input X6 is falling edge triggered. 6


SR623
I007 External interrupt: input X7 is falling edge triggered. 7

I008 External interrupt: input X10 is falling edge triggered. 8

I009 External interrupt: input X11 is falling edge triggered. 9

I010 External interrupt: input X12 is falling edge triggered. 10

I011 External interrupt: input X13 is falling edge triggered. 11

I012 External interrupt: input X14 is falling edge triggered. 12

I013 External interrupt: input X15 is falling edge triggered. 13

6-194
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Interrupt Maskable interrupts


Description Bit No.
number SR

I014 External interrupt: input X16 is falling edge triggered. 14

I015 External interrupt: input X17 is falling edge triggered. 15

I100 External interrupt: input X0 is rising-edge triggered. 0

I101 External interrupt: input X1 is rising-edge triggered. 1

I102 External interrupt: input X2 is rising-edge triggered. 2

I103 External interrupt: input X3 is rising-edge triggered. 3

I104 External interrupt: input X4 is rising-edge triggered. 4

I105 External interrupt: input X5 is rising-edge triggered. 5

I106 External interrupt: input X6 is rising-edge triggered. 6

I107 External interrupt: input X7 is rising-edge triggered. 7


SR624
I108 External interrupt: input X10 is rising-edge triggered. 8

I109 External interrupt: input X11 is rising-edge triggered. 9

I110 External interrupt: input X12 is rising-edge triggered. 10

I111 External interrupt: input X13 is rising-edge triggered. 11

I112 External interrupt: input X14 is rising-edge triggered. 12

I113 External interrupt: input X15 is rising-edge triggered. 13


6_
I114 External interrupt: input X16 is rising-edge triggered. 14

I115 External interrupt: input X17 is rising-edge triggered. 15

High-speed comparison interrupt 1 for the hardware


0
I200 high-speed counter 1

High-speed comparison interrupt 2 for the hardware


1
I201 high-speed counter 1

High-speed comparison interrupt 3 for the hardware


2
I202 high-speed counter 1

SR625
High-speed comparison interrupt 4 for the hardware 3
I203 high-speed counter 1

High-speed comparison interrupt 1 for the hardware


4
I210 high-speed counter 2

High-speed comparison interrupt 2 for the hardware


5
I211 high-speed counter 2

6-195
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Interrupt Maskable interrupts


Description Bit No.
number SR

High-speed comparison interrupt 3 for the hardware


6
I212 high-speed counter 2

High-speed comparison interrupt 4 for the hardware


7
I213 high-speed counter 2

High-speed comparison interrupt 1 for the hardware


8
I220 high-speed counter 3

High-speed comparison interrupt 2 for the hardware


9
I221 high-speed counter 3

High-speed comparison interrupt 3 for the hardware


10
I222 high-speed counter 3

High-speed comparison interrupt 4 for the hardware


11
I223 high-speed counter 3

High-speed comparison interrupt 1 for the hardware


12
I230 high-speed counter 4

High-speed comparison interrupt 2 for the hardware


13
I231 high-speed counter 4

High-speed comparison interrupt 3 for the hardware


14
_6 I232 high-speed counter 4

High-speed comparison interrupt 4 for the hardware


15
I233 high-speed counter 4

High-speed comparison interrupt 1 for the hardware


0
I240 high-speed counter 5

High-speed comparison interrupt 2 for the hardware


1
I241 high-speed counter 5

High-speed comparison interrupt 3 for the hardware


2
I242 high-speed counter 5
SR626
High-speed comparison interrupt 4 for the hardware
3
I243 high-speed counter 5

High-speed comparison interrupt 1 for the hardware


4
I250 high-speed counter 6

High-speed comparison interrupt 2 for the hardware


5
high-speed counter 6
I251

6-196
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Interrupt Maskable interrupts


Description Bit No.
number SR

High-speed comparison interrupt 3 for the hardware


6
I252 high-speed counter 6

High-speed comparison interrupt 4 for the hardware


7
I253 high-speed counter 6

High-speed comparison interrupt 1 for the software


0
I260 high-speed counter

High-speed comparison interrupt 2 for the software


1
I261 high-speed counter

High-speed comparison interrupt 3 for the software


2
I262 high-speed counter

High-speed comparison interrupt 4 for the software


3
I263 high-speed counter
SR627
High-speed comparison interrupt 5 for the software
4
I264 high-speed counter

High-speed comparison interrupt 6 for the software


5
I265 high-speed counter

High-speed comparison interrupt 7 for the software


6
I266 high-speed counter 6_
High-speed comparison interrupt 8 for the software
7
I267 high-speed counter

Receiving a specific word triggers communication interruption


0
I300 in COM1

I301 Reserved 1

Receiving a specific word triggers communication interruption


2
I302 in COM1
SR628
I303 Reserved 3

I304 Reserved 4

I305 Reserved 5

I306 Reserved 6

I307 Reserved 7

High-speed output interrupt: the 1st axis positioning


SR629 0
I500 instruction completes

6-197
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Interrupt Maskable interrupts


Description Bit No.
number SR

High-speed output interrupt: the 2nd axis positioning


1
I501 instruction completes

High-speed output interrupt: the 3rd axis positioning


2
I502 instruction completes

High-speed output interrupt: the 4th axis positioning


3
I503 instruction completes

High-speed output interrupt: the 5th axis positioning


4
I504 instruction completes

High-speed output interrupt: the 6th axis positioning


5
I505 instruction completes

High-speed output interrupt 1: the position planning table


0
I510 instruction completes

High-speed output interrupt 2: the position planning table


1
I511 instruction completes

High-speed output interrupt 3: the position planning table


2
I512 instruction completes

High-speed output interrupt 4: the position planning table


3
_6 I513 instruction completes

High-speed output interrupt 5: the position planning table


4
I514 instruction completes
SR630
High-speed output interrupt 6: the position planning table
5
I515 instruction completes

High-speed output interrupt 7: the position planning table


6
I516 instruction completes

High-speed output interrupt 8: the position planning table


7
I517 instruction completes

High-speed output interrupt 9: the position planning table


8
I518 instruction completes

High-speed output interrupt 10: the position planning table


9
I519 instruction completes

I601 Timer interrupts 1 (unit 1ms) 0

I602 Timer interrupts 1 (unit 1ms) SR632 1

I603 Timer interrupts 1 (unit 1ms) 2

6-198
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

Interrupt Maskable interrupts


Description Bit No.
number SR

I604 Timer interrupts 1 (unit 0.1ms) 3

Note: When several interrupts occur simultaneously, the interrupt task whose pointer number is smallest is executed

first. The PLC completes the on-going interrupt, and then execute other interrupts according to their pointer numbers.

For example, during the execution of I400 interrupt, if I500 and I300 occur simultaneously, the PLC executes the I300

interrupt (smaller pointer number) after executing the I400 interrupt.

6_

6-199
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0503 EIX S Enabling a specific interrupt

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S DWORD 

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : Data source

Explanation

1. The data source S can only contain a decimal number, and the number must be an interrupt number. If the number
is not an interrupt number, the instruction is not executed and no warning is shown. For example, use EIX500 in S

when you want to enable the I500 interrupt. Refer to the interrupt number list in the explanation of the EI instruction.

_6
2. The default for interrupt tasks in the ES3/EX3/SV3/SX3 Series is enabled. If you use the DIX instruction to disable
the interrupts, you must use the EIX instruction to enable the interrupts.

3. You can use this instruction to enable the interrupt tasks in SR623–SR634.

4. If this instruction is not executed, then the contents of SR623–SR634 determine whether an interrupt task is
performed or not.

5. Refer to the examples for the EI instruction (API 0501) for more information.

6-200
Ch a pt er 6 A pp l i e d I n s tr uc t io ns

API Instruction code Operand Function

0504 DIX S Disabling a specific interrupt

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : Data source

Explanation

1. The data source S can contain only decimal numbers, and the number must be an interrupt number. If the number in
S is not an interrupt number, the instruction is not executed and no warning is shown. For example, use DIX500

when you want to disable the I500 interrupt. Refer to the interrupt number list in the explanation of the EI instruction.

2. The default for interrupt tasks in the ES3/EX3/SV3/SX3 Series is enabled. Use the DIX instruction to disable the
interrupts.
6_

3. You can use this instruction to disable the interrupt tasks in SR623–SR634.

4. If this instruction is not executed, then the contents of SR623–SR634 determine whether an interrupt task is
performed or not.

5. Refer to the examples for the EI instruction (API 0501) for more information.

6-201
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

6.7 I/O Refreshing Instructions


6.7.1 I/O List of I/O Refreshing Instructions
The following table lists the I/O Refreshing instructions covered in this section.
Instruction code Pulse
API Function
16-bit 32-bit instruction

0600 REF –  Refreshing the I/O


0601 – DHSRF  Immediate refresh of a high-speed comparative value
0602 REFF –  Refreshing the I/O filtering time

_6

6-202
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.7.2 Explanation of I/O Refreshing Instructions

API Instruction code Operand Function

0600 REF P D, n Refreshing the I/O

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D  
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D 
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : I/O point state to refresh

n : Number of I/O points to refresh states

Explanation 6_
1. The I/O states are normally not refreshed until the PLC executes the END instruction. When the PLC starts

scanning the program, it reads and stores the states of the external inputs in memory. After executing the END

instruction, the PLC sends the states of the outputs in the memory to the output terminals. Therefore, when you

need the latest I/O data during the operation process, you can use this instruction, or use the device DX/DY to

refresh the input/output.

2. The n operand takes “1 point” as the unit of its value for the I/O status refresh of the PLC CPU. The range of the

value in n is 1 – 256.

3. The immediate I/O updates only apply for local I/O points of the CPU.

4. The number of the high-speed output point is stored in D device. If n is 1, it indicates to refresh the high-speed

output value of the corresponding SR immediately. If n is 0, it indicates to stop high-speed output and refresh the SR

current value. For example, during the execution of this instruction, if n is 0 and the external interrupt input is

received through X0, it indicates an external interrupt occurs in X0 and high-speed outputting through Y0 should be

stopped immediately. The PLC sets the stop flag SM463 to ON and refresh the current corresponding output

position in SR. Note: if the output completion auto-reset flag is set to ON, the PLC sets the output completion

6-203
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

auto-rest flag to OFF and refresh the current corresponding output position in SR. But the PLC does not set the stop

flag SM463 to ON.

5. Explanation of n and D operands

Value in n D device Action Descriptions

n = multiples of Refresh I/O immediately


Y0 or X0
eight See Example 1 and 2

Refresh new pulse position


n=1 High-speed output point
See Example 3

Stop high-speed outputting, set the


High-speed output point stop flag SM463 to ON and refresh
n=0
the current corresponding output
Without output completion auto-reset flag
position. See Example 3

Set the output completion auto-reset


High-speed output point flag to OFF and refresh the current
n=0
With output completion auto-reset flag corresponding output position. See
Example 3.

Refresh data mapping area in DS301


n = -1#1 Any X input point
TxPDO (Slave to Master) immediately

Refresh data mapping area in DS301


_6 n= -1#1 Any Y output point RxPDO (Master to Slave)
immediately

Respond that the Modbus TCP


n= -2#2 Any X input point communication command is already
received (PLC acts as Server).

Refresh the local analog input


Any X input point
channel of the PLC CPU immediately.
n= -10#3
Refresh the local analog output
Any Y output point
channel of the PLC CPU immediately.

Note#1:

Note #1: Only available for the Masters: ES3/EX3 with firmware V1.02.00 or later and SV3/SX3 with firmware

V1.00.00 or later, as well as the Slaves: ES3/EX3 with firmware V1.06.00 or later and SV3/SX3 with

firmware V1.00.00 or later. The settings do not speed up PDO data exchange. It is suggested that they

are used in the situation where the PLC scan time is greater than the PDO refresh time in the DS301

communication.

Note #2: Needs to work with ES3/EX3 firmware V1.06.00 or later, and SV3/SX3 firmware V1.00.00 or later. When

the PLC program scan cycle time is too great, you can use this setting with a timer interrupt program

6-204
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

together to regularly respond to the communication commands that the upper device sends through

Modbus TCP, which could speed up the communication between the upper device and the PLC. It is

suggested that you set the shortest interrupt time to 5 ms. If the interrupt time is too short, it may slow

down the scan of PLC program. NOTE: The communication response function will process all data in real

time, during which reading or writing data might happen within a PLC scan cycle.

Note #3: Needs to work with EX3 firmware V1.00.00 or later and SX3 firmware V1.00.00 or later. It is suggested that

you use this instruction when the PLC scan cycle is too great, and please note the following time delay. For

analog input channels, the sampling interval is still set up according to the formula "analog input sampling

time × number of enabled channels", and the values in the special registers (SR) for the input channels

using the REF instruction for refresh are not the current analog values when the REF is in execution. For

analog output channels, set their corresponding special registers (SR) first, and then execute the REF

instruction for refresh. NOTE: The maximum delay time from the execution of REF to the refresh of the

output channels is 2 ms.

Example 1

1. When M0 is ON, the PLC reads 16 states of the inputs X0–X7 and X10-17 immediately, and refreshes the input
signals without any delay.

6_

Example 2

When M0 is ON, the 8 output signals from Y0–Y7 are sent to the output terminals. The output signals are refreshed
immediately without waiting for the END instruction to be executed.

6-205
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

Example 3

1. During the execution of this instruction, if the external interrupt input is received through X0

Value in n D device Action Descriptions

Refresh new pulse positon Y0


n=1 High-speed output point Y0
immediately (SR460)

1. Stop high-speed Y2 outputting

High-speed output point Y2 2. Set the stop flag SM483 to ON


n=0
Without output completion auto-reset flag 3. Refresh the current
corresponding output position
SR480

1. Clear the completion auto-reset


flag SM510 (RST SM510)
High-speed output point Y4
n=0
2. Refresh the current
With output completion auto-reset flag SM510
_6 corresponding output position
SR500

X0 external interrupt program:

6-206
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description


Immediate refresh of a high-speed
0601 D HSRF P S,S1
comparative value

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
S1 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S 
S1  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : High-speed counter to be refreshed

S1 : Quantity of I/O to be updated

Explanation

1. The timing for the PLC to update the comparative value in its comparator is when the DHSCS or DHSCR instruction 6_
is scanned by a program successfully. However, the refresh may fail if the scan time is too long or the input signal

comes too fast. In this event, users can use the instruction to assign the new comparative value to the hardware

comparator in the PLC and achieve the real-time comparison.

2. S is the No of the specified high-speed counter to be refreshed. S1 has the same component or variable name as

that in the DHSCS or DHSCR instruction and the immediate value can not be set for S1. If S1 does not have the

same operand as that in the high-speed comparison instruction which has been enabled, the instruction execution

will not take effect.

6-207
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

Example

1. As PLC runs, the comparative value in DHSCS instruction is 5000.

2. When the X0 external interrupt occurs, the comparative value in DHSCS is set to 8000 immediately.

Main program:

X0 external interrupt program:

Assign the new comparative value to the same variable (E.g. D10 in the example) first and then execute DHSRF
_6
instruction for the update.

6-208
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0602 REFF P Xno, Length, Filter Refreshing the I/O filtering time

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Xno 
Length      
Filter DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Xno 
Length  
Filter  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

The starting device number of X to


Xno :
refresh

n : Number of I/O points states to refresh

6_
Filter : Filtering time to refresh (unit: µs)

Explanation

1. This instruction works only with ISPSoft V3.06 or later versions.

2. Xno is the starting input number to refresh (X0~X7 and X10~17). Length is the length to refresh. When Xno is X3,

the value of Length is 3, after executing the REFF instruction, the input filtering time of X3 ~ X5 are refreshed.

3. Xno and Length should be set in the input of PLC input system. If the setting exceeds the range, even if you have

executed REFF instruction, the I/O will NOT be refreshed and error message will NOT be shown.

4. The filtering time unit is µs. This instruction is for refreshing the current filtering time; filtering time set in HWCONFIG

will NOT be affected. But when the value of Filter in the instruction exceeds the setting range in HWCONFIG, PLC

treats the value of Filter as the maximum or the minimum value set in HWCONFIG.

5. When power-on, the filtering time of the CPU is refreshed according to the filtering time set in HWCONFIG.

6. The REFF instruction refreshes the filtering time only at its first execution.

6-209
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.8 Miscellaneous Instructions


6.8.1 List of Miscellaneous Instructions
The following table lists the miscellaneous instructions covered in this section.
Instruction code Pulse
API Function
16-Bit 32-Bit instruction

0700 ALT –  Alternating between ON and OFF


0701 TTMR – – Teach mode timer
0702 STMR – – Special timer
0703 RAMP DRAMP – Cyclic ramp signal
0704 MTR – – Matrix input
0705 ABSD DABSD – Absolute drum sequencer
0706 INCD – – Incremental drum sequencer
0708 – DPIDE – PID algorithm
0709 XCMP – – Setting up to compare the inputs of multiple work stations
0710 YOUT – – Comparing the outputs of multiple work stations
0711 – DSUNRS  Sunrise and sunset times
0712 – DSPA – Solar panel positioning

_6

6-210
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.8.2 Explanation of Miscellaneous Instructions

API Instruction code Operand Function

0700 ALT P D Alternating between ON and OFF

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D 

Pulse instruction 16-Bit instruction 32-Bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : Destination device

Explanation

1. This instruction alternates the state of the device specified by D between ON and OFF. 6_
2. In general, use the ALTP pulse instruction.

Example 1

When M0 switches from OFF to ON for the first time, M1 is ON. When M0 switches from OFF to ON for the second time,

M1 is OFF.

6 - 2 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

In the beginning, M0 is OFF; therefore, M20 is ON, and M21 is OFF. When X0 switches from OFF to ON for the first time,

M10 is ON; therefore, M20 is OFF, and M21 is ON. When X0 switches from OFF to ON for the second time, M10 is OFF;

therefore, M20 is ON, and M21 is OFF.

Example 3
_6
When M0 is ON, T0 generates a pulse every two seconds. The output M20 alternates between ON and OFF according to

the pulses generated by T0.

6-212
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0701 TTMR D, n Teach mode timer

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D  
n     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D  
n  

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

D : Recorded time

n : Multiplier

Explanation

1. This instruction uses seconds as the unit of time. The time for which a button switch has been turned ON is

multiplied by n, and the product is stored in D. D+1 is for system use only. When the instruction is executed, the

value in D+1 cannot be altered. Otherwise, the time is counted incorrectly.


6_
2. When the conditional contact is ON, D is reset to 0.

3. Setting the multiplier: when n is 0, D uses a second as the timing unit. When n is 1, the time for which the button

switch has been turned ON is multiplied by 10, and D uses 100 milliseconds as the timing unit. When n is 2, the time

for which the button switch has been turned ON is multiplied by 100, and D uses 10 milliseconds as the timing unit.

The greater the value in n, the higher the timing resolution.

n D

K0 (unit: 1 second) 1×T

K1 (unit: 100 milliseconds) 10×T

K2 (unit: 10 milliseconds) 100×T

4. When you use on-line editing, reset the conditional contact to initialize the instruction.

5. The value in n must be between 0–2.

6-213
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. The instruction multiplies the time for which the button switch M0 has been turned ON by n, and stores the product

in D0. You can use the button switch (ON) to record the time.

2. When M0 is switched OFF, the value in D0 is unchanged.

M0
X0.0

D0
D0

T T
The time for whic h The ti me for whi c h
th e butto n sw itc h is the b utton s witc h is
tu rn ed on. turned on.
(U nit: Se cond) (Uni t: Second )

_6 Additional remarks

1. If D+1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If the value in n is not between 0–2, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

3. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6-214
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0702 STMR S, m, D Special timer

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
m     
D   
DWORD  

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
m  
D 

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : Timer number (T0-T511)

m : Setting value of the timer

D : Output device

Explanation

1. This instruction generates timing for the off-delay relay, the one-shot circuit, and the flashing circuit. 6_

2. This instruction uses 100 milliseconds as the timing unit. If the setting value for m is 50, the time value is 5 seconds.

3. You cannot use this timer repeatedly.

4. D occupies four consecutive devices.

5. Before the instruction is executed, reset D-D+3.

6. When the conditional contact is not enabled and the value of the device meets one of the two conditions mentioned

below, D, D+1, and D+3 are ON for m seconds before they are switched OFF. When the conditional contact is not

enabled and the value of the device does not meet either of the two conditions mentioned below, D-D+3 keep OFF.

 The value of the timer is less than or equal to m, D is ON, and D+1 is OFF.

 The value of the timer is less than m, D +2 is OFF, and D, D+1, and D+3 are ON.

7. When the on-line editing is used, Reset the conditional contact to initialize the instruction.

8. The value in m must be between 1–32767.

6-215
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When M0 is ON, the instruction specifies the timer T0, and the setting value of T0 is five seconds.

2. M20 is the off-delay contact. When M0 switches to ON, M20 is ON. Five seconds after M0 switches to OFF, M20 is
OFF.

3. When M0 switches to OFF, M21 is ON for five seconds.

4. When M0 switches ON, M22 is ON for five seconds.

5. Five seconds after M0 switches to ON, M23 is ON. Five seconds after M0 switches to OFF, M23 is OFF.

M0
X0.0

M20
Y0.0
5 s ec onds 5 s ec onds
M21
Y0.1
5 s econds 5 s econds
_6 M22
Y0.2
5 s econds

M23
Y0.3
5 s econds 5 s econd s 5 s econd s

6. When the conditional contact M0 is followed by the b contact M23, the flasher circuit passes through M21 and M22.
When M0 is switched OFF, M20, M21, and M23 are switched OFF, and T0 is reset to 0.

6-216
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

X0.0
M0

M21
Y0.1
5 seconds
Y0.2
M22
5 seconds

Additional remarks

1. If D+3 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If the value in m is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [4] of BOOL.

6_

6-217
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0703 D RAMP S1, S2, D, n Cyclic ramp signal

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
D  
n       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D    
n    

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Initial value of the ramp signal

S2 : Final value of the ramp signal

D : Duration of the ramp signal

_6 n : Number of scan cycles

Explanation

1. This instruction gets the linear slope, which has an absolute relationship with the scan time. Therefore it is

suggested that you set a fixed scan time or write this instruction in a timer interrupt task.

2. You write the initial value and final value of the ramp signal into S1 and S2 respectively in advance. When M0 is ON,

D increases from the setting value in S1 to the setting value in S2. The number of scan cycles is stored in D+1. When

the value in D is equal to that in S2, or when the value in D+1 is equal to n (to the number of scan cycles), then

SM687 is ON.

3. When the conditional contact is not enabled, the value in D, and D+1 are both 0, and SM687 is OFF.

4. When using on-line editing, Reset the conditional contact to initialize the instruction.

5. Refer to the ISPSoft/DIADesigner User Manual for more information on setting a fixed scan time.

6. The value of n must be between 1–32767. When n is out of range, this instruction is not executed.

7. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

6-218
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

8. Use the SM686 flag to reset the value in D to 0. Refer to the examples below for details.

Example

When you use the instruction with an analog signal output, it acts to cushion the starting and stopping of the machinery.

1. During execution, when M0 switches to OFF, the execution of the instruction stops. When M0 switches to ON again,

SM687 is OFF, D12 is reset to the setting value in D10, D13 is reset to 0, and the ramp calculation is restarted.

2. During execution, SM686 is OFF, and when D12 reaches the setting value in D11, SM687 switches to ON as a scan

cycle. When D12 resets to the setting value in D10, D13 resets to 0.

D11
D10
D12 D12
D11

D10

The number of s can cycle is n.


The number of scan cycle is n. 6_
D10<D11 D10>D11
The number of s can cycle is s tored in D13.

3. When SM686 is ON, and D12 reaches the setting value in D11, the value in D12 is not reset to 0, and SM687 is ON.

As long as the conditional contact is closed (ON), the value in D12 resets to 0 and SM687 is OFF. When SM686 is

ON or OFF, the value in D12 changes as shown below.

SM686 =O N SM686 =O FF

M0
X0. 0 X0 M0
.0
The s ig nal is enabled. The signal is ena bled .

D11
D11
D12 D12
D10 D10

SM687 SM687

6-219
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If D+1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If n is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. For the 16-bit instruction, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of

WORD/INT.

4. For the 32-Bit instruction, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of

DWORD/DINT.

_6

6-220
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0704 MTR S, D1, D2, n Matrix input

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
D1 
D2    
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D1 
D2 
n  

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -
Symbol

S : First input device in the matrix scan

First output device in the matrix


D1 :
scan
First corresponding device in the
D2 :
matrix scan 6_
n : Number of rows to scan

Explanation

1. This instruction scans and stores the states of eight sequential input devices. S specifies the first input device in the

matrix scan.

2. D1 specifies the transistor output device Y as the first device in the matrix scan. When the conditional contact is OFF,

the states of the n devices starting from D1 are OFF.

3. One row of inputs is refreshed every scan cycle. There are 16 inputs in a row, and the scan starts from the first row

and goes to the nth row.

4. The eight input devices starting from the device specified by S are connected to the n output devices starting from

the device specified by D1 to form the n rows of switches. The matrix scan reads the states of the n rows of switches,

and stores the states in the devices starting from the device specified by D2.

5. You can connect up to 8 rows of input switches in parallel to get 64 inputs (8×8=64).

6. The interval between executions of this instruction should be longer than the time it takes for the states of the I/O

6-221
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

points on the module to be refreshed. Otherwise, the instruction cannot read the correct states of the inputs. See

Additional remarks, below.

7. In general, the conditional contact used in the instruction is SM400: the flag is always ON when CPU runs.

8. The value in n must be between 2–8.

Example 1

1. When M0 is ON, the MTR instruction is executed. The instruction reads the states of the two rows of switches in

order, and stores them in the internal relays M10–M17 and M20–M27 respectively.

2. The diagram below is the external wiring diagram of the 2-by-8 matrix input circuit for X0–X7 and Y0–Y1. The

corresponding internal relays of the 16 switches are M10–M17 and M20–M27.

_6
M20 M21 M22 M23 M24 M25 M26 M27

Y1
Y0
X1 X2 X3 X4 X5 X6 X7

M10 M11 M12 M13 M14 M15 M16 M17

X0 X1 X2 X3 X4 X5 X6 X7

3. The instruction connects eight input devices starting from M0 to the two output devices starting from M1 to form the

two rows of switches. The matrix scan reads the states of the two rows of switches, and stores the states in the

devices starting from M10 (specified by D2). That is, it stores the states of the first row of switches in M10–M17, and
stores the states of the second row of switches in M20–M27.

6-222
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

T he firs t ro w of input s igna ls ar e read.

Y0
Y0. 0 1 3
T he seco nd row of inp ut s ignal s ar e rea d.

Y0. 1
Y1 2 4

Additional remarks

1. When this instruction is executed, a cycle time that is too long or a too short causes the state of the switches to be
read incorrectly. Use the following tips to solve this issue.

 When the scan cycle is too short, the I/O may not be able to respond in time and the correct states of the

inputs cannot be read. You can set a fixed scan time to solve this issue.

 When the scan cycle is too long, the switch may be slow to react. You can write this instruction in a timer

interrupt task to set a fixed time to execute this instruction.

2. If S+7, D1+n-1, or D2+(n*8)-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#2003.

3. If n is not between 2–8, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [8] of BOOL.
6_

6-223
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0705 D ABSD S1, S2, D, n Absolute drum sequencer

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
D    
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D 
n    

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

Initial device for the


S1 :
comparison

S2 : Comparison value

_6 D : Comparison result

n : Number of comparison groups

Explanation

1. Use this instruction to generate multiple pulses corresponding to the current values of the counter.

2. Only the DABSD instruction can use the 32-Bit counter, but not the device E.

3. When using the ABSD instruction, n must be between 1–256.

Example 1

1. Before the ABSD instruction is executed, the MOV instruction writes the setting values in D100–D107. The values in

the even devices are minimum values, and the values in the odd devices are maximum values.

2. When M0 is ON, the instruction compares the current value of the counter C10 with the maximum values and the

minimum values in D100–D107, and stores the comparison results in M10–M13.

3. When M0 is OFF, the original states of M10–M13 are unchanged.

6-224
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

4. When the current value of C10 is between the minimum value and the maximum value, M10–M13 are ON.

Otherwise, M10–M13 are OFF.

Minimum value Maximum value Current value of C10 Output

D100=40 D101=100 40≦C10≦100 M10=ON

D102=120 D103=210 120≦C10≦210 M11=ON 6_


D104=140 D105=170 140≦C10≦170 M12=ON

D106=150 D107=390 150≦C10≦390 M13=ON

5. Suppose the minimum value is larger than the maximum value. When the current value of C10 is less than the

maximum value (C10<60), or when the current value of C10 is larger than the minimum value (C10>140), M12 is
ON. Otherwise, M12 is OFF.

Minimum value Maximum value Current value of C10 Output

D100=40 D101=100 40≦C10≦100 M10=ON

D102=120 D103=210 120≦C10≦210 M11=ON

D104=140 D105=60 60≦C10≦140 M12=OFF

D106=150 D107=390 150≦C10≦390 M13=ON

6-225
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

40 100
M10

120 210
M11

60 140
M12

150 390
M13

0 200 400

Additional remarks

1. For the 16-bit instruction, if S+2*n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. For the 32-bit instruction, if S+4*n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

3. For the 16-bit instruction, if D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

4. For the 32-bit instruction, if D+2*n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

_6 5. For both the 16-bit instruction and the 32-bit instruction, if n is not between 1–256, the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#200B.

6-226
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0706 INCD S1, S2, n, D Incremental drum sequencer

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
D    
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D 
n  

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -
Symbol

S1 : Initial device for comparison

S2 : Counter number

D : Comparison result

n : Number of comparison groups 6_

Explanation

1. This instruction generates multiple pulses for a pair of counters.

2. The instruction compares the current value of S2 with the setting value in S1. When the current value matches the

setting value, the instruction resets the current value of S2 to 0, and the stores the current comparison group number

in S2+1.

3. After the comparison between the current values of S2 and the n groups of values is complete, SM688 is ON for a

scan cycle.

4. When the conditional contact is not enabled, the value in S2 is 0, the value in S2+1 is 0, D-D+n-1 are OFF, and

SM688 is OFF.

5. When using on-line editing, Reset the conditional contact to initialize the instruction.

6. The value in n must be between 1–256.

6-227
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. Before the INCD instruction is executed, the MOV instruction writes the setting values in D100–D104. The values in

D100–D104 are 15, 30, 10, 40, and 25 respectively.

2. The instruction compares the current values in C10 with the setting values in D100–D104. When the current value
matches the setting value, the instruction resets C10 to 0, and counts again.

3. The instruction stores the current comparison group number in C11.

4. When the value in C11 changes by one, M10–M14 act correspondingly. Refer to the following timing diagram.

5. When the comparison between the current values in C10 and the values in D100–D104 is complete, SM688 is ON
for a scan cycle.

6. When M0 is switched from ON to OFF, C10 and C11 are reset to 0, and M10–M14 are switched OFF. When M0
switches to ON again, the instruction execution starts from the beginning.

_6

6-228
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

M0
X0 .0
40
30 30
25
C1 0 15 15 15
10
Cu rre nt v al ue

C11 3 4
2
C urrent v alue 0 1 1 1
0 0

M10

M11

M1 2

M1 3

M1 4

SM688

Additional remarks
6_
1. If S2+1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If S1+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

3. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

4. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

5. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6-229
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0708 D PIDE As shown in the following table PID algorithm

Device X Y M S T C HC D FR SM SR E K 16# “$” F


PID_RUN     
SV  
PV  
PID_MODE   
PID_MAN     
MOUT_AUTO     
CYCLE   
KC_Kp 
Ti_Ki 
Td_Kd 
Tf  
PID_EQ     
PID_DE     
PID_DIR     
ERR_DBW   
MV_MAX   
MV_MIN   
MOUT 
BIES3   
I_MV 
_6 MV 
DWORD

STRING
LWORD

Data
LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

Pulse instruction 16-Bit instruction 32-Bit instruction


- - ES3/EX3/SV3/SX3

6-230
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Symbol

EN : Enable/Disable the instruction

PID_RUN : Enable the PID algorithm

SV : Target value (SV)

PV : Process value (PV)

PID_MODE : PID control mode

PID_MAN : PID Auto/Manual mode

MOUT_AUTO : Manual/Auto output value

CYCLE : Sampling time (CYCLE)

Kc_Kp : Proportional gain

Ti_Ki : Integral coefficient (sec. or 1/sec)

Td_Kd : Derivative coefficient (sec)

Tf : Derivate-action time constant (sec)

PID_EQ : PID formula types

PID_DE : Calculation of the PID derivative error

PID_DIR : PID forward/reverse direction (PID_DIR)

Range within which the error value is


ERR_DBW :
counted as 0
6_
MV_MAX : Maximum output value (MV_MAX)

MV_MIN : Minimum output value (MV_MIN)

MOUT : Manual output value (MOUT)

BIES3 : Feed forward output value

I_MV : Accumulated integral value

MV : Output value (MV)

Explanation

1. This instruction implements the PID algorithm. After the sampling time is reached, the instruction applies PID

algorithm. PID stands for Proportional, Integral and Derivative. The PID control is widely applied to mechanical,

pneumatic, and electronic equipment.

2. The parameter settings are listed in the following table.

6-231
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting
Operand Data type Function Description
range

True: use the PID algorithm.

PID_RUN BOOL Enabling the PID algorithm False: reset the output value (MV) to

0, and stop using the PID algorithm.

Range of

single-

precision
SV REAL SV Target value
floating-

point

numbers

Range of
single-

precision
PV REAL PV Process value
floating-

point

numbers

0: Automatic control

_6 When PID_MAN switches from

True to False, invoke the output

value (MV) in the automatic

algorithm. I_MV value will stop

changing when MV is greater than

MV_MAX or less than MV_MIN.

1: Auto tuning the parameters for the

temperature control. After tuning


PID_MODE DWORD/DINT PID control mode
is done, the system is in auto

control mode (PID_MODE is set

to 0) and fill in the appropriate

parameters (Kc_Kp, Ti_Ki,

Td_Kd, and Tf)

2:Automatic control (including the

revision of I_MV). When

PID_MAN switches from True to

False, invoke the output value

6-232
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Setting
Operand Data type Function Description
range

(MV) in the automatic algorithm.

When MV is greater than

MV_MAX or less than MV_MIN,

I_MV value will be automatically

revised by reasoning based on

the formula. The method shortens

the response time for the reverse

control.

Note: when the mode is set to 1,

auto tuning the parameter, you

cannot use numerical value to

set up.

True: Manual

Output the MV according to

MOUT, but it is still between

MV_MIN and the MV_MAX.

This setting has no effect

PID_MAN BOOL PID A/M mode when PID_MODE is set to 1.

False: Automatic 6_
Output the MV according to

the PID algorithm, and the

output value is between

MV_MIN and MV_MAX.

True: Automatic

MOUT varies with the MV.

MOUT_AUTO BOOL MOUT automatic change mode False: Normal

MOUT does not vary with the

MV.

When the instruction is

scanned, use the PID


1–40,000 algorithm according to
CYCLE DWORD/DINT Sampling time (TS)
(unit: ms) the sampling time, and

refresh MV. The PLC

requires that the

6-233
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting
Operand Data type Function Description
range

instruction execute; it

will not run the

sampling time

automatically. If TS is

less than 1, it is counted

as 1. If TS is larger than

40,000, it is counted as

40,000.

When using the PID

instruction in an interval

interrupt task, the

sampling time is the

same as the interval


between the timed

interrupt tasks. The

sampling cycle setting

of the sampling cycle is

ignored here.

_6 Range of Calculated proportional

positive coefficient (Kc or Kp)

Calculated proportional single- If the P coefficient is

Kc_Kp REAL coefficient (Kc or Kp, according to precision less than 0, the Kc_Kp

the settings in PID_EQ) floating- is 0. Independently, if

point Kc_Kp is 0, it is not

numbers controlled by P.

6-234
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Setting
Operand Data type Function Description
range

Range of If the calculated

positive coefficient I is less than

single- 0, Ti_Ki is 0. If Ti_Ki is

precision 0, it is not controlled by


Integral coefficient (Ti or Ki,
floating- I.
Ti_Ki REAL according to the settings in
point
PID_EQ)
numbers

(unit: Ti

= sec; Ki

= 1/sec)

Range of If the calculated


positive coefficient D is less
single- than 0, Td_Kd is 0. If

Derivative coefficient (Td or Kd, precision Ti_Ki is 0, it is not

Td_Kd REAL according to the settings in floating- controlled by D.

PID_EQ) point

numbers

(unit:
6_
sec)

Range of If the derivate-action

positive time constant is less

single- than 0, Tf is 0 and it is

precision not controlled by the

Tf REAL Derivate-action time constant floating- derivate-action time

point constant (derivative

numbers smoothing).

(unit:

sec)

TRUE: dependent formula


PID_EQ BOOL PID formula types
FALSE: independent formula

TRUE: use the variations in the PV to


The calculation of the PID calculate the control value of
PID_DE BOOL
derivative error the derivative (Derivative of the

PV).

6-235
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting
Operand Data type Function Description
range

FALSE: use the variations in the error

(E) to calculate the control

value of the derivative

(derivative of the error).

True: reverse action (E=SV-PV)


PID_DIR BOOL PID forward/reverse direction
False: forward action (E=PV-SV)

The error value (E) is

the difference between

the SV and the PV.

When the setting value

is 0, the function

disabled; otherwise the

CPU module checks

whether the present

error is less than the

absolute value of

ERR_DBW, and checks


Range of
whether the present
_6 single-
error meets the cross
Range within which the error precision
ERR_DBW REAL status condition. If the
value is counted as 0. floating-
present error is less
point
than the absolute value
numbers
of ERR_DBW, and

meets the cross status

condition, the present

error is counted as 0,

and the PLC applies the

PID algorithm;

otherwise the present

error is brought into the

PID algorithm

according to the normal

processing.

6-236
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Setting
Operand Data type Function Description
range

Suppose MV_MAX is

set to 1,000. When MV

is larger than 1,000,


Range of
1,000 is the output. The
single-
value in MV_MAX
precision
MV_MAX REAL Maximum output value should be larger than
floating-
that in MV_MIN.
point
Otherwise, the
numbers
maximum MV and the

minimum MV are

reversed.

Range of

single- Suppose MV_MIN is

precision set to -1,000. When the


MV_MIN REAL Minimum output value
floating- MV is less than -1,000,

point -1,000 is the output.

numbers

Range of When set to PID


6_
single- Manual, the MV value is

precision output as the setting


MOUT REAL MV
floating- value for MOUNT,

point between MV_MAX and

numbers MV_MIN.

Range of
single-
Feed forward output
precision
BIES3 REAL Feed forward output value value, used for the PID
floating-
feed forward.
point

numbers

Range of Accumulated integral

I_MV (occupies Accumulated single- value temporarily stored,

15 consecutive REAL I_MV integral precision and usually for reference.

DWord devices) value floating- You can still clear or

point modify it according to your

6-237
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting
Operand Data type Function Description
range

numbers needs. When the MV is

greater than MV_MAX, or

when the MV is less than

MV_MIN, the accumulated

integral value in I_MV

stops changing if the PID

control mode is 0

(automatic control).

When the MV is greater

than MV_MAX, or when

the MV is less than


MV_MIN, the accumulated

integral value in I_MV is

automatically revised by

reversely reasoning based

on the formula if the PID

control mode is 2

_6 (automatic control

including the revision of

I_MV).

I_MV+1 The previous error value is temporarily stored here.

I_MV+2–I_MV+5 For system use only

I_MV+6 The previous PV is temporarily stored here.

I_MV+7–
For system use only
I_MV+14

MV REAL MV The MV is between the MV_MIN and the MV_MAX.

6-238
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The diagram of switching to PID_MAN / MOUT_AUTO:

PID_MAN

PID
Calculation FALSE

MV

Manual input TRUE


MOUT

TRUE

FALSE

MOUT_AUTO

1. When switching the control mode (PID_MAN=0) from automatic to manual, you can set the flag MOUT_AUTO

to 1 and the output value of MOUT goes along with the output value of MV. After switching to the manual mode

(PID_MAN=1), you can set the MOUT_AUTO to 0.

2. When PID_RUN changes from TRUE to FALSE, the PLC resets the value in MV to 0. When the value in MV is

to be retained, you can set EN to FALSE to dismiss the instruction and to keep the output value in MV.

Example 1

1. Set all parameters before executing this instruction.

2. When M0 is ON, the instruction is executed. When PID_RUN is ON, the instruction applies the DPID algorithm.
When PIC_RUN is OFF, MV is 0, and store the value in MV. When M0 switches to OFF, the instruction is not
6_
executed, and the previous data is unchanged.

6-239
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. The instruction can be used several times, but the registers specified by I_MV–I_MV+14 cannot be the same.

2. I_MV occupies 30 registers.

3. You can only use the 32-bit instruction in cyclic tasks and interval interrupt tasks. When using the 32-bit instruction in

an interval interrupt task, the sampling time (Cycle) is the same as the interval between the timed interrupt tasks.

4. When the instruction is scanned, the 32-bit PID algorithm is applied according to the sampling time (Cycle), and it

refreshes MV. When you use the instruction in an interrupt task, the sampling time (Cycle) is the same as the

interval between the timed interrupt tasks. The PID algorithm is applied according to the interval between the timed

interrupt tasks.

5. Before the 32-bit PID algorithm is applied, the process value used in the PID instruction has to be a stable value.

When you need the input value in the module to implement the DPID algorithm, must note the time it takes for the

analog input to be converted into the digital input.

6. When the PV (process value) is in the range of ERR_DBW, at the beginning, the present error is brought into the

PID algorithm according to the normal processing, and then the CPU module checks whether the present error

meets the cross status condition: PV (process value) goes beyond the SV (target value). Once the condition is met,

the present error is counted as 0 when applying the PID algorithm. After the PV (process value) is out of the

ERR_DBW range, the present error is brought into the PID algorithm again. If PID_DE is true, that means it uses

the variations in the PV to calculate the control value of the derivative, and after the cross status condition is met,
_6
the PLC treats Δ PV as 0 to apply the PID algorithm. (Δ PV= current PV – previous PV). In the following example,

the present error is brought into the PID algorithm according to the normal processing in section A ,and the present

error or Δ PV is counted as 0 to apply the PID algorithm in the section B.

6-240
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The PID algorithm:

1. When you set PID_MODE to 0, the PID control mode is the automatic control mode.

 Independent Formula & Derivative of E(PID_EQ=False & PID_DE=False)

t
dE
MV = K P E + Ki ∫ Edt + K d * + BIAS E = SV – PV or E = PV – SV
0
dt

 Independent Formula & Derivative of PV(PID_EQ=False & PID_DE=True)

t
dPV
MV = K P E + Ki ∫ Edt − K d * + BIAS E = SV – PV
0
dt

Or

t
dPV
MV = K P E + Ki ∫ Edt + K d * + BIAS E =PV – SV
0
dt

 Dependent Formula & Derivative of E(PID_EQ=True & PID_DE=False)

 1
t
dE 
MV = K c  E + ∫ Edt + Td *  + BIAS E = SV – PV or E = PV – SV
 Ti 0 dt 

 Dependent Formula & Derivative of PV(PID_EQ=True & PID_DE=True) 6_

 1
t
dE 
MV = K c  E + ∫ Edt − Td *  + BIAS E = SV – PV
 Ti 0 dt 

Or

 1
t
dE 
MV = K c  E + ∫ Edt + Td *  + BIAS E = PV – SV
 Ti 0 dt 

2. When you set PID_MODE to 1, the PID control mode is the automatic tuning mode. After the tuning of the

parameter is complete, PID_MODE is set to 0. The PID control mode then becomes the automatic control mode.

6-241
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

PID Block Diagram:

PID Block Diagram (Independent)


PID_D IR
E
+ 1
SV + DEAD BAND
-
PV REVERSE
0
X(-1)

ERR_DBW

Kc_Kp
PID-P
>0 PID_MAN
BIAS
+ 0
<=0 +
0 +
Kc_Kp MV_LIMIT
1
MV
Ti_Ki
PID-I
>0
MV_MAX, MV_MIN
+
<=0 +
0 +
Ti_Ki MOUT_AUTO
+ MOUT
0
Td_Kd MOUT
PID-D PID_MAN
>0 1
0

<=0
0 1
Td_Kd, Tf MOUT

_6 PID Block Diagram (Dependent)


PID_D IR
E
+ 1
SV + DEAD BAND PID-P
-
REVERSE
PV 0
X(-1)

Kc_Kp
ERR_DBW Kc_Kp
>0

<=0
0

PID_MAN
BIAS
+ 0
+
+
MV_LIMIT
1
Ti_Ki MV
PID-I
>0
MV_MAX, M V_MIN
<=0
0
Ti_Ki MOUT_AUTO
MOUT
0
Td_Kd MOUT PID_MAN
PID-D
>0 1
0

<=0
0 1
Td_Kd, Tf MOUT

6-242
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Suggestions

1. Since you can use the 32-bit instruction in a lot of controlled environments, you must choose the appropriate control

function. For example, to prevent improper control, do not use PID_MODE in the motor controlled environment when

it is set to 1.

2. When you tune the parameters Kc_Kp, Ti_Ki, and Td_Kd (PID_MODE is set to 0), you must tune KP first (based on

experience), and then set Ti_Ki and Td_Kd to 0. When you can handle the control, you can increase Ti_Ki and

Td_Kd. When Kc_Kp is 1, it means that the proportional gain is 100%. That is, the error value is increased by a factor

of one. When the proportional gain is less than 100%, the error value is decreased. When the proportional gain is

larger than 100%, the error value is increased.

3. To prevent the parameters that have been tuned automatically from disappearing after a loss of power, you must

store the parameters in the latched data registers when PID_MODE is set to 1. The parameters that have been

automatically tuned are not necessarily suitable for every controlled environment. Therefore, you can modify the

automatically tuned parameters; however, it is suggested that you only modify the Ti_Ki and the Td_Kd.

4. You can use this instruction with many parameters, but to prevent improper control, do not set the parameters

randomly.

Example 2: Tuning the parameters used with the PID instruction

b 6_
Suppose that the transfer function of the plant is the first-order function G(s) = , the SV is 1, the sampling time Ts is
s+a
10 milliseconds. It is suggested that you follow these steps when tuning the parameters.

Step 1: First, set the KI and the KD to 0. Next, set the KP to 5, 10, 20 and 40 successively, and record the target values and
the process values. The results are shown in the following diagram.

1.5

K P =40 SV= 1
K P =20 K P =10
1

K P =5
0.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 T im e (s ec)

6-243
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Step 2: When the KP is 40, there is overreaction. When the KP is 20, the reaction curve of PV is close to SV, and there is

no overreaction. However, due to the fast start-up, the transient output value (MV) is big. Neither 40 nor 20 is a

suitable value. When the KP is 10, the reaction curve of PV approaches SV smoothly. When KP is 5, the reaction is

too slow. Therefore, KP = 10 is the best choice.

Step 3: After setting KP to 10, increase KI. For example, KI is successively set to 1, 2, 4, and 8. KI should not be larger than

KP. Then, increase KD. For example, successively set KD to 0.01, 0.05, 0.1, and 0.2. KD should not be larger than

ten percent of KP. Finally, the relation between PV and SV is shown in the following diagram.

1 .5

PV= SV

0 .5
K P =10,KI = 8,K D=0.2

0 0 .1 0 .2 0 .3 0 .4 0 .5 0 .6 0 .7 0 .8 0 .9 1 T im e (s ec)

Note: This example is only for reference. You must tune the parameters properly according to the actual condition of the

control system.

_6

6-244
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 3: Using the automatic tuning function to control the temperature

Because you may not be familiar with the characteristics of the temperature environment to be controlled, you can use the

automatic tuning function to make an initial adjustment (PID_MODE is set to 1). After the automatic tuning of the

parameter is complete, PID_MODE is set to 0. The controlled environment in this sample is an oven. The following

example program shows the setting values for the instruction.

6_

6-245
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The experimental result of the automatic tuning function is shown in the following graph.

The following graph shows the result of using the automatically tuned parameters to control the temperature.

_6

This graph shows that using automatically tuned parameters can result in a good temperature control result. It only takes

about twenty minutes to control the temperature. The following graph shows the result of changing the target temperature

from 80°C to 100°C.

6-246
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

This graph shows that when the target temperature changes from 80°C to 100°C, the automatically tuned parameters still

work to control the temperature in a reasonable amount of time.

Example 4: Creating a DPIDE instruction in a function block and setting to the cyclic task mode to read the function block

written with a DPIDE instruction to control the temperature.

1. Set the value in DPIDE_CYCLE to 1000 ms, and execute the DPIDE instruction by reading the function block written

with a DPIDE instruction. Whenever the function block is scanned, the PID algorithm is applied according to the sampling
6_
time (Cycle), and it refreshes the output value (DPIDE_MV).

2. Set the DPIDE_MODE =1 for auto tuning the parameters for the temperature control. After tuning is done, the
system is in auto control mode (PID_MODE is set to 0) and fill in the appropriate parameters (Kc_Kp, Ti_Ki, Td_Kd, and

Tf).

3. Main program (cyclic task): Since PLC only executes the DPIDE instruction when it is scanned. If we use TMRH to work

with the DPIDE instruction, for example, set the TMRH to 1000 ms, the system calls the function block written with a

DPIDE instruction (ES3_DPIDE) every 1000 ms. See the example program below.

6-247
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. Function block (FB_DPIDE): Execute the DPIDE instruction by reading the function block written with a DPIDE

instruction. Whenever the function block is scanned, the PID algorithm is applied according to the sampling time (Cycle),
_6
and it refreshes the output value (DPIDE_MV). (Refer to ISPSoft/DIADesigner Manual for more details on how to create a

function block.)

NOTE: The six parameters PID_MODE, Kc_Kp, Ti_Ki, Td_Kd, Tf and I_MV in the function block written with a DPIDE
instruction should be declared as VAR_IN_OUT.

6-248
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 5: Creating a DPIDE instruction in a time interrupt program to control the temperature. (Note: use the time

interrupt as the cycle time of DPIDE.) 6_


1. Set the time interrupt to 1000 ms in HWCONFIG.
2. Create a DPIDE instruction in a time interrupt program. Whenever a time interrupt occurs, the PID
algorithm is applied. The setting in DPIDE_CYCLE is invalid here.

3. Set the DPIDE_MODE =1 for auto tuning the parameters for the temperature control. After tuning is done,
the system is in auto control mode (PID_MODE is set to 0) and fill in the appropriate parameters (Kc_Kp, Ti_Ki,

Td_Kd, and Tf).

Main program (cyclic task)

6-249
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Time interrupt program I601 and the setting parameters

_6

6-250
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Setting up to compare the inputs of
0709 XCMP S1, S2, S3, S4, D,
multiple work stations

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
S3 
S4 
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
S3  
S4  
D  

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -
Symbol

S1 : Trigger input point

S2 : High-speed counter number

Setting for the numbers for work station 6_


S3 :
and objects
Reference value for comparison and
S4 :
the observational error
First corresponding device for the
D :
comparison result in the stack area

Explanation

1. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

2. It is suggested to use the instruction along with the YOUT instruction (API0710). Generally, it is often used in

applications where there are multiple work stations for one production line and multiple work pieces are required to

be arranged in order and to be processed at the same time, e.g. wood processing, painting, etc.

3. Use S1 for setting the trigger input points; the high-speed inputs are X0–X7 & X10–X17 and the other inputs are

general type. Executing the instruction enables the external interrupts for the inputs (M0–X0.15). Therefore do NOT

use the inputs with interrupt tasks; otherwise, when the instruction is executed, the interrupts are disabled and

resumed only after the instruction completes. The general type inputs are affected by the scan time though they are

suitable for the environments where the inputs are not as stable.

6-251
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. S2 works with 32-bit counters (HC0–HC255). When the inputs are the high-speed trigger input type, implement the

hardware high-speed counter and use the DCNT instruction to enable the counter. When you need high-speed

output, use the DMOV instruction to copy the output current position; for example copying the axis of SR460 to HC0,

(DMOV SR460 HC0).

5. S3 occupies seven consecutive 16-bit devices. S3+0 is n (the work station number) and S3+1 is m (the maximum

object number). S3+2 is the result of the object being filtered. The range for n and m is between 1–64. When this

value is out of range, the value used is treated as the maximum (32) or the minimum (1). The range for S3+2 (the

number of filter) is between 0–32767. Zero is used for any value less than 0; and a value of 0 disables the filtering

function. S3+3 (Low Word) and S3+4 (High Word) are for rising-edge values. S3+5 (Low Word) and S3+6 (High Word)

are for falling-edge values (32-bit). Be sure to declare an array of 7 words or 7 consecutive word type variables.

6. Set the maximum number for S3+1 (m). If m < n, note the objects and make sure they are sufficient on the

production line.

7. S4 occupies 3xn consecutive 32-bit devices (6xn 16-bit devices). If the required space exceeds the range of device

D, the instruction is not executed. The value of n is the work station number set in the operand S3. The following

table lists the functions for each device and the corresponding number for S4. Be sure to declare an array of 3n

double words or 3 consecutive double word type variables for S.

Function Work station 1 Work station 2 ‧‧‧ Work station n

Reference value for comparison (32-bit) S4+0 S4+2 ‧‧‧ S4+(n-1)x2

_6 Observational error of the compared S4+2xn S4+2xn+2 ‧‧‧ S4+(2xn-1)x2

stack area for the entering-work-station

ones (32-bit)

Observational error of the compared S4+4xn S4+4xn+2 ‧‧‧ S4+(3xn-1)x2

stack area for the leaving-work-station

ones (32-bit)

When you set the reference value to 0 for a specific work station, the specific work station stops working. You can

use this technique to manage work stations.

8. D is the first corresponding device for the comparison result in the stack area. D occupies 2xn consecutive 16-bit

devices and 2xmxn consecutive 32-bit devices (or 4xmxn consecutive 16-bit devices). If the required space

exceeds the range of device D, the instruction is not executed. The following table lists the functions for each device

and the corresponding number for D.

6-252
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Function Work station 1 Work station 2 ‧‧‧ Work station n

Value of the head index (16-bit) D+0 D+1 ‧‧‧ D+(n-1)

Value of the tail index (16-bit) D+n D+(n+1) ‧‧‧ D+(2xn-1)

Compared stack area 1 for the D+2xn D+2xn+2 ‧‧‧ D+2xn+2(n-1)

entering -work-station ones (32-bit)

Compared stack area 1 for the D+4xn D+4xn+2 ‧‧‧ D+4xn+2(n-1)

leaving-work-station ones (32-bit)

: : : : :

Compared stack area m for the D+4xmxn-2xn ‧‧‧ D+4xmxn-2

entering -work-station ones (32-bit)

Compared stack area m for the D+4xmxn ‧‧‧ D+4xmxn+2 (n-1)

leaving-work-station ones (32-bit)

D tends to occupy more space in the stack area. If the required space exceeds the range of device D, the PLC only

executes what is valid in the storage and does not show a no warning. It is suggested that you declare an array of

2xn+4xmxn words for D.

9. There is no limit on the number of times you can execute this instruction. For ES3 CPU firmware V1.06.00 or earlier,

only one instruction can be executed at a time. For ES3 CPU firmware V1.08.00 or later and EX3/SV3/SX3 CPU

firmware V1.00.00 or later, up to three instructions can be executed at a time.

10. It is suggested to use this instruction with the YOUT instruction (API 0710), and use the same first corresponding
6_
device for the comparison result in the stack area (D).

11. The following timing diagram shows executing the high-speed counter and filter (reading from right to left).

① PLC reads the current counter value and stores the value in a register.

② Drop the counter value: the number of filters read is less than the number of filters set.

③ Record the counter value to the compared stack area for the entering-work-station ones, when the signal is
stable.

6-253
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

④ Record the counter value to the compared stack area for the leaving-work-station ones, when the signal is
stable.

⑤ The number of filters

12. When the signal is rising- or falling-edge triggered, and the PLC completes processing the filters, the PLC reads the

high-speed counter value and adds one in the value of the head index. The PLC then records the entering and

leaving counter results for each work station. The compared counter result is the current counter value + reference

value + observational error. For either rising- or falling-edge triggered, the value of the head index is incremented.

The maximum value for the head index mx2 (the maximum number of objects).

13. The value of the head index is cyclically incremented, when the signal is rising- or falling-edge triggered and

completes processing the number of filters (the default for trigger input is OFF). The maximum value for the head

index is mx2 (the maximum number of objects). For example, if you set the number of objects to 10, the value of the

head index (default: 0) is incremented to 1, 2, 3 to 20 and then 1, 2, 3 to 20 repeatedly. When the value of the head

index is 0, it means no object has entered after executing the instruction. The PLC adds one to the value of the head

index, and then checks the value of the tail index. If the value (after adding one) in the value of the head index

equals the value of the tail index, the PLC cancels the addition and records the counter result.

14. When the instruction is executed and the state of the initial input is OFF, the rising-edge trigger corresponds to the

odd numbers of the head index value, and the falling-edge trigger corresponds to the even numbers of the head

index value.

_6 15. When the PLC executes the instruction and the state of the initial input is ON, the falling-edge trigger corresponds

to the odd numbers of the head index value, and the rising-edge trigger corresponds to the even numbers of the

head index value.

16. When the PLC executes the instruction, it does not clear the values in the accumulated area and the index areas. If

the data is in a latched area and needs to be enabled again, use the ZRST instruction to clear the values in the head

and tail indexes.

Example

Refer to the example in the YOUT instruction (API 0710) for more information.

6-254
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Comparing the outputs of multiple work
0710 YOUT S1,S2,S3,D
stations

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
S3 
D  
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
S3  
D 

Pulse instruction 16-Bit instruction 32-Bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : High-speed counter number

Setting for the number for work stations


S2 :
and objects
First corresponding device for the
S3 :
comparison result in the stack area
D :
First corresponding device for the 6_
output work station
Explanation

1. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

2. S1 is for the setting of the high-speed counter. Use the same settings for the high-speed counter as for the

high-speed counter for the XCMP instruction.

3. S2 occupies two consecutive 16-bit devices. S2+0 is n (the work station number) and S2+1 is m (the maximum
number of objects). The range for n and m is between 1–64. When the value is out of range, the value used is the

maximum (32) or the minimum (1). The settings for the operands should be the same as for the XCMP instruction.

4. S3 is first corresponding device for the comparison result in the stack area. S3 occupies 2xn consecutive 16-bit

devices and 2xmxn consecutive 32-bit devices (or 4xmxn consecutive 16-bit devices). For information on the

functions of each device and the corresponding number for D, refer to the XCMP instruction (API 0709). It is

suggested that you use the same variable as you use for the XCMP instruction.

6-255
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. There is no limit on the number of times you can execute this instruction. For ES3 CPU firmware V1.06.00 or earlier,

only one instruction can be executed at a time. For ES3 CPU firmware V1.08.00 or later and EX3/SV3/SX3 CPU

firmware V1.00.00 or later, up to three instructions can be executed at a time.

6. It is suggested that you use with the XCMP instruction, and use the same first corresponding device for the

comparison result in the stack area (S3).

7. D is only for the outputs of Y and M devices; Y and M should be the BOOL data type. It occupies a consecutive

number of work stations Xn. When used as the output point of Y or the M device, the instruction refreshes the output

states.

8. The odd numbered head index values (for example 1, 3, 5,…) are the compared counter results for the object when

entering (Compared stack areas for the entering -work-station ones). The even numbered head index values (for

example 2, 4, 6,…) are the compared counter result of the object when leaving (Compared stack areas for the

entering -work-station ones).

9. When the compared counter result for entering and leaving in the stack area are 0, the actions in this area are not

executed and the state of the corresponding output work station is OFF. Add 2 to the value of the tail index and the

added value in the tail index should not exceed the value of the head index.

10. When the YOUT instruction is executed, each work station checks the compared value for entering and leaving in

the tail index. When the counter value is larger or the same as the compared value for entering, the corresponding

output point is ON and adds 1 to the value of the tail index. When the counter value is larger or the same as the

compared value for leaving, the corresponding output is OFF and adds 1 to the value of the tail index; but the value

of the tail index (after adding 1) does not exceed the value of the head index.
_6

Example: three work stations and up to four objects

Wo rk Work Work
station station station
Object 1 2 3
detection

Obj ect

En co der

Step 1: use the input point X4 as the object detection interrupt, HC202 as the high-speed counter for the encoder and

output point Y0 as the first output point for the work station.

Step 2: edit the register to set up the reference values, and the observational error when entering and leaving.

6-256
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Device D D500 D502 D504

Reference value for comparison (32-bit) K2000 K3000 K4000

Device D D506 D508 D510

Observational error when entering (32-bit) K100 K120 K130

Device D D512 D514 D516

Observational error when leaving (32-bit) K50 K-20 K20

Device D D2000 D2001 D2002

Value of the head index (16-bit) K0 K0 K0

Device D D2003 D2004 D2005

Value of the tail index (16-bit) K0 K0 K0

Step 3: set up the initial values and write the programs.

6_

6-257
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Set up three work stations for D0, 4 objects for D1 and 50 filters for D2. After the contact M0 is activated, the system sets
the object detection, the compared values, the compared counter result of the object entering and leaving, and the output

controls for each work station. For example, the system detects two objects have entered and then four triggers to read

the compared counter results: 3000, 3500, 4500, and 5000 in HC202 (HC202=K5060). The following table shows the

compared value and the head/tail index in the stack area.

Device D D2000 D2001 D2002

Value of the head index (16-bit) K4 K4 K4


_6
Device D number D2003 D2004 D2005

Value of the tail index (16-bit) K1 K1 K1

Device D number D2006 D2008 D2010

Compared stack area 1 for the entering


K5100 K6120 K7130
-work-station ones (32-bit)

Device D number D2012 D2014 D2016

Compared stack area 1 for the


K5550 K6480 K7520
leaving-work-station ones (32-bit)

Device D number D2018 D2020 D2022

Compared stack area 1 for the entering


K6600 K7620 K8630
-work-station ones (32-bit)

Device D number D2024 D2026 D2028

Compared stack area 2 for the


K7050 K7980 K9020
leaving-work-station ones (32-bit)

6-258
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Device D number D2030 D2032 D2034

Compared stack area 3 for the entering


K0 K0 K0
-work-station ones (32-bit)

Device D number D2036 D2038 D2040

Compared stack area 3 for the


K0 K0 K0
leaving-work-station ones (32-bit)

The following table shows the state of the output point Y when the high-speed counter HC202 reaches 5200.

Output point Y number Y0 Y1 Y2

16-bit value ON OFF OFF

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005

Value of the tail index


K2 K1 K1
(16-bit)

6_
The following table shows the state of the output point Y when the high-speed counter HC202 reaching 6200.

Output point Y number Y0 Y1 Y2

16-bit value OFF ON OFF

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005

Value of the tail index


K3 K2 K1
(16-bit)

6-259
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The following table shows the state of the output point Y when the high-speed counter HC202 reaching 6800.

Output point Y number Y0 Y1 Y2

16-bit value ON OFF OFF

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005

Value of the tail index


K4 K3 K1
(16-bit)

The following table shows the state of the output point Y when the high-speed counter HC202 reaching 7300.

Output point Y number Y0 Y1 Y2

16-bit value OFF OFF ON

D2002
Device D number D2000 D2001

Value of the head index


K4 K4 K4
(16-bit)
_6
Device D number D2003 D2004 D2005

Value of the tail index K4 K3 K2


(16-bit)

The following table shows the state of the output point Y when the high-speed counter HC202 reaching 7700.

Output point Y number Y0 Y1 Y2

16-bit value OFF ON OFF

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005

Value of the tail index


K4 K4 K3
(16-bit)

6-260
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The following table shows the state of the output point Y when the high-speed counter HC202 reaching 8000.

Output point Y number Y0 Y1 Y2

Output state OFF OFF OFF

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005

Value of the tail index


K4 K4 K3
(16-bit)

The following table shows the state of the output point Y when the high-speed counter HC202 reaching 8700.

Output point Y number Y0 Y1 Y2

Output state OFF OFF ON

Device D number D2000 D2001 D2002

Value of the head index


K4 K4 K4
(16-bit)

Device D number D2003 D2004 D2005


6_
Value of the tail index
K4 K4 K4
(16-bit)

6-261
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0711 D SUNRS P Longi ~ SSec Sunrise and sunset times

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Longi  
Lati  
TimeZ  
DST    
Year  
Month  
Date  
RHour 
RMin 
RSec 
SHour 
SMin 
SSec 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

Data REAL
UINT

DINT

LINT

TMR

CNT
INT

type

Longi 
Lati 
TimeZ  
DST 
_6 Year  
Month  
Date  
RHour  
RMin  
RSec  
SHour  
SMin  
SSec  

Pulse instruction 16-Bit instruction 32-Bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

SUNRS Longi : Longitude (REAL type)


EN

Longi RHour Lati : Latitude (REAL type)


Lati RMin
TimeZ : Time zone(integer) (-12 ~ +14)
RSec
TimeZ
SHour DST : Daylight saving time
DST
SMin
Year Year Year
SSec
Month
Month Month
Date

6-262
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Date Date
The hour to sunrise on the set date
RHour
(24 hour time format)
RMin The minute to sunrise on the set date

RSec The second to sunrise on the set date


The hour to sunset on the set date
SHour
(24 hour time format)
SMin The minute to sunset on the set date

SSec The second to sunset on the set date

Explanation

1. The sunrise and sunset times may not be as accurate as the local weather report publishes because the values that

you have entered may be incorrect or the altitude of where the device is installed may interfere with the accuracy.

When the result is not as accurate, you can adjust the values manually. After self-evaluation, the error range of this

instruction is less than 5 minutes.

2. Enter values for the local longitude and latitude in numbers. For example, the longitude and latitude of Taoyuan,

Taiwan is 121.30098 and 24.99363. Latitudes north of the Equator are denoted by a positive sign. Latitudes south of

the Equator are given negative values.

3. Enter values for the local time zone, ranging from -12 to +14. The time zone cannot be calculated through the set

longitude and latitude; if the setting is out of range or the value is incorrect, no error message will be shown.

4. When the daylight saving time is enabled (ON), the instruction checks if the daylight saving time on the PLC is

enabled. When the daylight saving time is enabled on the PLC, DST time will be added on the sunrise and sunset
6_
times.
5. Enter values for the local date, month, and year in decimal format. Make sure you have entered correct values. The

instruction does not check if the values are correctly entered.


6. After calculation, the instruction output the hour, minute and second to sunrise and sunset in integer, in decimal

format and 24 hour time format.

Example

Calculate the time to sunrise and sunset in Taoyuan, Taiwan on January 1st, 2018. The official time zone in Taiwan is

defined by an UTC offset of +08:00. And daily saving time is NOT implemented in Taiwan.

After calculation, the time to sunrise is at 06:39:47 and the time to sunset is at 17:16:42. See the example program below.

Checked with the official weather website, the actual sunrise occurred at 06:39:44 and the actual sunset occurred at

17:16:45. The difference between the PLC calculation and the actual occurrence is ±3 seconds.

6-263
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

6-264
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0712 D SPA S,D Solar panel positioning

Device X Y M S T C HC D FR SM SR E K 16# “$” F

S  
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Refer to the data type descriptions for operands below.

Pulse instruction 16-Bit instruction 32-Bit instruction


- - SV3/SX3

Symbol

S : Start device for input parameters

D : Start device for output parameters

Explanation

1. This instruction is a function provided for free, which is for non-commercial use only. If you want to use the

instruction for a commercial purpose, you have to get the permission from relevant organizations before selling your

devices.
6_
2. The operator S occupies 26 consecutive word registers, and the function of each input parameter is shown in the

following table:

No. Function Setting range Data type Description

S+0 Year 2000 ~ Word

S+1 Month Please enter the correct time of the


1 ~ 12 Word
local longitude. Refer to API 1226
S+2 Date 1 ~ 31 Word
DTM (parameter k11) for the
S+3 Hour 0 ~ 23 Word
conversion formula. See point 7
S+4 Minute 0 ~ 59 Word below for short description.
S+5 Second 0 ~ 59 Word

S + 6~7 Time difference (Δt) (sec) ± 8000 Float

S + 8~9 Local time zone ± 12 Float West: negative.

S + 10~11 West: negative.


Longitude ± 180 Float
(Unit: degree)

S + 12~13 South: negative.


Latitude ± 90 Float
(Unit: degree)

6-265
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

No. Function Setting range Data type Description

S + 14~15 Elevation 0~ 6500000 Float Unit: meter

S + 16~17 Pressure 0 ~ 5000 Float Unit: millibar

S + 18~19 Mean annual temperature Unit: °C


-273~6000 Float
(MAT)

S + 20~21 Slope ± 360 Float

S + 22~23 Azimuth ± 360 Float

S + 24~25 Atmospheric refraction


±5 Float
between sunrise and sunset

3. Operand D occupies 8 consecutive word registers. The function of each output parameter is as below:

No. Function Setting range Data type Description

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

D+6 Converted DA value of Zenith 0 ~ 2000 Word 1LSB = 0.045 degree

D+7 Converted DA value of Azimuth 0 ~ 2000 Word 1LSB = 0.18 degree

4. The execution time of the DSPA instruction costs up to 50ms, therefore we suggest you execute this instruction with

the quickest interval time of 1 sec, preventing the instruction from taking too much PLC operation time.

5. Definition of Zenith: 0° and 45°.

_6

0° 45°
6. Definition of Azimuth:

270° 90°

180°

6-266
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

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 API1226

DTM instruction (parameter k11) for more explanation on conversion.

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 = 30 degrees,
Azimuth = -10 degrees.

2. Output results: D5000: Zenith = F37.2394 degrees; D5002: Azimuth = F124.7042 degrees.

6_

6-267
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.9 Logic Instructions


6.9.1 List of Logic Instructions
The following table lists the Logic instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0800 WAND DAND  Logical AND operation

0801 MAND –  Matrix AND operation

0802 WOR DOR  Logical OR operation

0803 MOR –  Matrix OR operation

0804 WXOR DXOR  Logical exclusive OR operation

0805 MXOR –  Matrix exclusive OR operation

0808 WINV DINV  Logical reversed INV operation

0809 LD& DLD& – S1&S2

0810 LD| DLD| – S1|S2

0811 LD^ DLD^ – S1^S2

0812 AND& DAND& – S1&S2

0813 AND| DAND| – S1|S2


_6
0814 AND^ DAND^ – S1^S2

0815 OR& DOR& – S1&S2

0816 OR| DOR| – S1|S2

0817 OR^ DOR^ – S1^S2

6-268
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.9.2 Explanation of Logic Instructions

API Instruction code Operand Function

0800 D WAND P S1, S2, D Logical AND operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

D : Operation result
6_

Explanation

1. This instruction applies the logical operator AND to the binary representations in S1 and S2 It performs the logical
AND operation on each pair of corresponding bits and stores the result in D.

2. Only the DAND instruction can use the 32-bit counter.

3. The result in each position is 1 if the first bit is 1 and the second bit is 1; otherwise, the result is 0.

6-269
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When M0 is ON, the instruction performs the logical operation AND on each pair of corresponding bits in the 16-bit device

D0 and the 16-bit device D2. It stores the result in D4.

D0

D2

D4

Example 2

When M0 is ON, the instruction performs the logical operation AND on each pair of corresponding bits in the 32-bit device
_6 (D11, D10) and the 32-bit device (D21, D20). It stores the result in (D41, D40).

S1
b 31 b 15 b0
Y11
Be fore th e instructio n D D10 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
11 Y10
i s executed S2
DA ND

Y21
D 21 Y20
D20 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
Afte r t he instru cti on D
is e xe cu ted
Y41
D D40 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0
41 Y40 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0

6-270
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0801 MAND P S1, S2, D, n Matrix AND operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
D   
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Matrix source 1

S2 : Matrix source 2

D : Operation result

n : Length of the array 6_

Explanation

1. This instruction applies the logical operator MAND to the n rows of binary representations in S1 and the n rows of
binary representations in S2. It performs the matrix operation AND on each pair of corresponding bits, and stores the

operation result in D.

2. The result in each position is 1 if the first bit is 1 and the second bit is 1; otherwise, the result is 0.

3. The operand n must be between 1–256.

6-271
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, this instruction performs the matrix operation AND on each pair of corresponding bits on the data in the

16-bit devices D0–D2 and the data in 16-bit devices D10–D12. It stores the result in the 16-bit devices D20–D22.

S1 b15 b0
D0
Y0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1

D1
Y1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1

D2
Y2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
Before the instruct ion
is executed S2 b15 b0
D10
Y10 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

D11
Y11 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

D12
Y12 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

D b15 b0
D20
Y20 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
After the instruct ion
is execut ed
D21
Y21 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0

D22
Y22 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0

_6 Additional remarks

1. If S1+n-1, S2+n-1, or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. Explanation of matrix instructions:

 A matrix is composed of more than one 16-bit register. The number of registers in a matrix is the length of the

array n. There are 16×n bits in a matrix, and the matrix operation is performed on one bit at a time.

 The matrix instruction takes the 16×n bits in a matrix as a string of bits, rather than as values. The matrix

operation is performed on each bit.

 Matrix instructions mainly process the one-to-many or many-to-many status, such as moving, copying,

comparing, and searching by bit.

 You must specify a 16-bit register for the matrix instruction. The 16-bit register specifies a certain bit among

the 16n bits in the matrix for the operation, and the 16-bit register is called the pointer. The value in the

register is between 0–16n-1, and corresponds to the bit between b0–b16n-1.

6-272
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

 Shifting or rotating of the specified data can be involved in the matrix operation. Note that the bit number

decreases from the left to the right, as illustrated below.

Le ft Widt h: 16 bits Right

D0
Y0 b1 5 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b0
D1
Y1 b3 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 b16

L ength: n
D2
Y2 b4 7 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

Mn-1 b16n- 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

 The width of the matrix is 16 bits.

 Pr represents the pointer. When the value in Pr is 15, it specifies b15.

Example: The following matrix is composed of the three 16-bit devices D30, D31, and D32. The data in D30 is

16#AAAA, the data in D31 is 16#5555, and the data in D32 is 16#AAFF.

b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D30

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D31

1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 D32

Example: The following matrix is composed of the three 16-bit devices D40, D41, and D42. The data in D40 is 6_
16#37, the data in D41 is 16#68, and the data in D42 is 16#45.

b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 D40

0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 D41

0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 D42

6-273
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0802 D WOR P S1, S2, D Logical OR operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

D : Operation result

_6

Explanation

1. This instruction applies the logical operator OR to the binary representations in S1 and S2. It performs the logical

inclusive operation OR on each pair of corresponding bits, and stores the operation result in D.

2. Only the DOR instruction can use the 32-bit counter but not the device E.

3. The result in each position is 1 if the first bit is 1, the second bit is 1, or both bits are 1; otherwise, the result is 0.

Example 1

When M0 is ON, This instruction performs the logical inclusive operation OR on each pair of corresponding bits in the

16-bit device D0 and the 16-bit device D2. It stores the operation result in D4.

6-274
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

b15 b0
S1 D0
Y 0 011 0 1 0 1 0 1 0 1 0 1 0 1 0 1
B e fo re th e i n stru ct io n
i s e xe cu te d
S2 D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1
Y2

b 15 b0
A fte r t he in st ru cti on
D YD4
4 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
i s e xe cu te d

Example 2

When M0 is ON, the instruction performs the logical inclusive operation OR on each pair of corresponding bits in the 32-bit

device (D11, D10) and the 32-bit device (D21, D20). It stores the operation result in (D41, D40).

S1 b3 1 b15 b0
Be fore the in stru cti on Y11
D 11 Y 10 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
D10
i s e xe cu ted DO R
S2
Y21
D Y20 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
2 1 D20 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

After the in stru cti on D


is execute d 4 1 D40
Y41 Y40 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1
D 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1

6_

6-275
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0803 MOR P S1, S2, D, n Matrix OR operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
D   
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Matrix source 1

S2 : Matrix source 2

D : Operation result

_6 n : Length of the array

Explanation

1. This instruction applies the logical operator OR to the n rows of binary representations in S1 and the n rows of binary

representations in S2. It performs the matrix operation OR on each pair of corresponding bits and stores the operation

result in D.

2. The result in each position is 1 if the first bit is 1, the second bit is 1, or both bits are 1; otherwise, the result is 0.

3. The operand n must be between 1–256.

6-276
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the instruction performs the matrix operation OR on each pair of corresponding bits in the 16-bit devices

D0–D2 and the data in 16-bit devices D10–D12. It stores the operation result in the 16-bit devices D20–D22.

S1 b15 b0
D0
Y0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
After the
D1
Y1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 instruc tion
D2 is executed D b1 5 b0
Y2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Be fore the
MOR b0
D20
Y20 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
i nstruction S2 b15
i s e xe cu ted D10
Y1 0 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 D21
Y21 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1

D11
Y11 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 D22
Y22 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1

D12
Y1 2 0 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1

Additional remarks

1. If S1+n-1, S2+n-1, or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error
6_
code in SR0 is 16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-277
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0804 D WXOR P S1, S2, D Logical exclusive OR operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

D : Operation result

_6

Explanation

1. This instruction applies the logical operator XOR to the binary representations in S1 and S2. It performs the logical
exclusive operation OR on each pair of corresponding bits, and stores the operation result in D.

2. Only the DXOR instruction can use the 32-bit counter, but not the device E.

3. The result in each position is 1 if the two bits are different, and 0 if they are the same.

Example 1

When M0 is ON, the instruction performs the exclusive operation OR on each pair of corresponding bits in the 16-bit

device D0 and the 16-bit device D2. It stores the operation result in D4.

6-278
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

b15 b0
D0 011 0 1 0 1 0 1 0 1 0 1 0 1 0 1
S1 Y0
Before t he inst ruction
is execut ed
S2 Y2
D2 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1

b15 b0
Af ter the instruction
D4 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
D Y4
is execut ed

Example 2

When M0 is ON, the instruction performs the logical exclusive operation OR on each pair of corresponding bits in the

32-bit device (D11, D10) and the 32-bit device (D21, D20). It stores the operation result in (D41, D40).

Befor e the instruction S1 b31 b15 b0


is executed. 執行前 D11 D10 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
S2 DX OR

D21 D20 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
After the instruction
執行後 D
is executed.
D41 D40 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
6_

6-279
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0805 MXOR P S1, S2, D, n Matrix exclusive OR operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
D   
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Matrix source 1

S2 : Matrix source 2

D : Operation result

_6 n : Length of the array

Explanation

1. This instruction applies the logical operator XOR to the n rows of binary representations in S1 and the n rows of

binary representations in of S2. It performs the matrix exclusive operation OR on each pair of corresponding bits and

stores the operation result in D.

2. The result in each position is 1 if the two bits are different, and 0 if they are the same.

3. The operand n must be between 1–256.

6-280
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the instruction performs the matrix exclusive operation OR on each pair of corresponding bits in the

16-bit devices D0–D2 and the data in 16-bit devices D10–D12. It stores the operation result in the 16-bit devices

D20–D22.

S1 b 15 b0
D0
Y0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
A fte r t he
D1
Y1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D
i nstru c ti on
D2 i s exe cut ed b0
B ef or e th e Y2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b1 5
i nst ruc ti o n S2 b 15 MXO R b0 D20
Y 20 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
i s e xecu te d D10
Y1 0 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 Y 21 0
D21 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0

D11
Y11 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 Y 22 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0
D22
Y1 2 0
D12 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1

Additional remarks
6_
1. If S1+n-1, S2+n-1, or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-281
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0808 D WINV P S, D Logical reversed INV operation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

D : Operation result

Explanation
_6
1. This instruction applies the INV instruction to the data in S , and stores the operation result in D.

2. Only the DINV instruction can use the 32-bit counter but not the device E.

3. This instruction performs reverse processing on the data in S. If the state of S is 0 before executing the INV

instruction, the state changes to 1 as a result of the INV instruction.

Example 1

When M0 is ON, the instruction performs the INV operation on the corresponding bits in the 16-bit device D0. It stores the

operation result in the 16-bit device D4.

6-282
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 2

When M0 is ON, the instruction performs the INV operation on each pair of corresponding bits in the 32-bit devices

D11–D10. It stores the operation result in the 32-bit device D41–D40.

6_

6-283
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0809- 0811 D LD# S1, S2 Contact type of logical operation LD#

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

Taking LD& and DLD& for example

_6 Explanation

1. The instruction is used to compare the data in S1 with that in S2. When the comparison result is not 0, the condition of

the instruction is met. When the comparison result is 0, the condition of the instruction is not met.

2. Only the instruction DLD#can use the 32-bit counter but not the device E.

3. The instruction LD#can be connected to the mother line directly.

Comparison operation result


API No. 16-bit instruction 32-bit instruction
ON OFF

0809 LD& DLD& S1&S2 ≠ 0 S1&S2 = 0

0810 LD| DLD| S1|S2 ≠ 0 S1|S2 = 0

0811 LD^ DLD^ S1^S2 ≠ 0 S1^S2 = 0

4. &: Logical AND operation

5. |: Logical OR operation

6. ^: Logical exclusive OR operation

6-284
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. The logical operator AND takes the data in C0 and C1, and performs the logical AND operation on each pair of
corresponding bits. When the operation result is not 0, M10 is ON.

2. The instruction performs the logical operation OR on each pair of corresponding bits in D200 and D300, when the
operation result is not 0 and M20 is ON, M11 is ON and is retentive.

3. The instruction performs logical exclusive operation XOR on each pair of corresponding bits in C201 and C200,
when the operation result is not 0, or when M21 is ON, M12 is ON.

6_

Additional remarks

If S1 or S2 is illegal, the condition of the instruction is not met, SM0 is ON, and the error in SR0 is 16#2003.

6-285
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0812- 0814 D AND# S1, S2 Contact type of logical operation AND#

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

Taking AND& and DAND& for example

_6 Explanation

1. This instruction compares the data in S1 with that in S2. When the comparison result is not 0, the condition of the
instruction is met. When the comparison result is 0, the condition of the instruction is not met.

2. Only the DAND#instruction can use the 32-bit counter, but not the device E.

3. Connect the AND#instruction and the contact in series.

Comparison operation result


API No. 16-bit instruction 32-bit instruction
ON OFF

0812 AND& DAND& S1&S2 ≠ 0 S1&S2 = 0

0813 AND| DAND| S1|S ≠ 0 S1|S2 = 0

0814 AND^ DAND^ S1^S2 ≠ 0 S1^S = 0

4. &: Logical AND operation

5. |: Logical OR operation

6. ^: Logical exclusive OR operation

6-286
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. When M0 is ON, the instruction performs the logical operation AND on each pair of corresponding bits in C0 and C10.

When the operation result is not 0, M10 is ON.

2. When M1 is OFF, the instruction performs the logical operation OR on each pair of corresponding bits in D10 and D0.

When the operation result is not 0, M11 is ON.

3. When M2 is ON, the instruction performs the logical exclusive operation OR on each pair of corresponding bits in the

32-bit register (D200, D201) and the data in the 32-bit register (D100, D101). When the operation result is not 0, or

when M3 is ON, M12 is ON.

6_

Additional remarks

If the value in S1 or S2 is not valid, the condition of the instruction is not met, SM0 is ON, and the error in SR0 is 16#2003.

6-287
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

0815- 0817 D OR# S1, S2 Contact type of logical operation OR#

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1      
S2      

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Data source 1

S2 : Data source 2

Taking OR& and DOR& for example

_6 Explanation

1. This instruction compares the data in S1 with that in S2. When the comparison result is not 0, the condition of the

instruction is met. When the comparison result is 0, the condition of the instruction is not met.

2. Only the DOR# instruction can use the 32-bit counter.

3. Connect the OR#instruction and the contact in parallel.

Comparison operation result


API No. 16-bit instruction 32-bit instruction
ON OFF

0815 OR& DOR& S1&S2 ≠ 0 S1&S2 = 0

0816 OR| DOR| S1|S2 ≠ 0 S1|S2 = 0

0817 OR^ DOR^ S1^S2 ≠ 0 S1^S2 = 0

4. &: Logical AND operation

5. |: Logical OR operation

6. ^: Logical exclusive OR operation

6-288
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. When M1 is ON, M10 is ON. The instruction performs the logical operation AND on each pair of corresponding bits in

C0 and C10. When the operation result is not 0, M10 is ON.

2. When M2 and M3 are ON, M11 is ON. The instruction performs the logical operation OR on each pair of

corresponding bits in the 32-bit register (D10, D11) and the 32-bit register (D20, D21). When the operation result is

not 0, M11 is ON. The instruction performs the logical exclusive operation OR on each pair of corresponding bits in

the 32-bit counter HC0. and the 32-bit register (D200, D201). When the operation result is not 0, M11 is ON.

6_

Additional remarks

If the value in S1 or S2 is not valid, the condition of the instruction is not met, SM0 is ON, and the error in SR0 is 16#2003.

6-289
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.10 Rotation Instructions


6.10.1 List of Rotation Instructions
The following table lists the Rotation instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

0900 ROR DROR  Rotating bits in a group to the right

0901 RCR DRCR  Rotating bits in a group to the right with the carry flag

0902 ROL DROL  Rotating bits in a group to the left

0903 RCL DRCL  Rotating bits in a group to the left with the carry flag

0904 MBR –  Rotating bits to the right or left in a matrix

_6

6-290
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.10.2 Explanation of Rotation Instructions

API Instruction code Operand Function

0900 D ROR P D, n Rotating bits in a group to the right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device to rotate

n : Number of bits in a group

6_

Explanation

1. This instruction divides the bits in the device specified by D into groups (n bits in a group), and then rotates these

groups to the right without the carry flag.

2. Only the DROR instruction can use the 32-bit counter, but not the device E.

3. For the 16-bit instruction, the value of n used must be between 1–6. For the 32-bit instruction, the value of n must be

between 1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is

executed with n at the maximum value (32) of the range.

4. In general, the RORP and DRORP pulse instructions are used.

6-291
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 switches from OFF to ON, the instruction divides the values of the bits in D10 into groups (four bits in a group),
and rotates these groups to the right. The value of the bit marked ※ is transmitted to the carry flag SM602.

b 15 ※ b0 Carry flag
0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 1

After the rotation is executed

b1 5 b0 Carry flag
0 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0

Additional remarks

1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
_6

6-292
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Rotating bits in a group to the right with the
0901 D RCR P D, n
carry flag

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device to rotate

n : Number of bits in a group

6_
Explanation

1. This instruction divides the bits in the device specified by D into groups (n bits in a group), and then rotates these

groups to the right with the carry flag SM602.

2. Only the DRCR instruction can use the 32-bit counter, but not the device E.

3. For 16-bit instructions, the value of n used must be between 1–16. For 32-bit instructions, the value of n must be

between 1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is

executed with n at the maximum value (32) of the range.

4. In general, the RCRP and DRCRP pulse instructions are used.

6-293
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 switches from OFF to ON, the instruction divides the values of the bits in D10 into groups (four bits as a group),
and then rotates these groups to the right with the carry flag SM602. The value of the bit marked ※ is transmitted to the

carry flag SM602.

※ Carry fl ag
b15 b0
0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 1

After the rotation is executed

Carr y flag b 15 b0
0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0

Additional remarks
_6
1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-294
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

0902 D ROL P D, n Rotating bits in a group to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device to rotate

n : Number of bits in a group

6_

Explanation

1. This instruction divides the bits in the device specified by D into groups (n bits in a group), and then rotates these

groups to the left.

2. Only the DROL instruction can use the 32-bit counter, but not the device E.

3. For 16-bit instructions, the value of n must be between 1–16. For 32-bit instructions, the value of n must be between

1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is executed

with n at the maximum value (32) of the range.

4. In general, the ROLP and DROLP pulse instructions are used.

6-295
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 switches from OFF to ON, the instruction divides the values of the bits in D10 into groups (four bits as a group),
and then rotates these groups to the left. The value of the bit marked ※ is transmitted to the carry flag SM602.

Carr y flag b15 ※ b0


1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

After the rotation is executed

Carr y flag b 15 b0
1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1

Additional remarks

1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
_6

6-296
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Rotating bits in a group to the left with the
0903 D RCL P D, n
carry flag

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device to rotate

n : Number of bits in a group

6_

Explanation

1. This instruction divides the bits in the device specified by D into groups (n bits in a group), and then rotates these

groups to the left with the carry flag SM602.

2. Only the DRCL instruction can use the 32-bit counter, but not the device E.

3. For 16-bit instructions, the value in n must be between 1–16. For 32-bit instructions, the value of n must be between

1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is executed

with n at the maximum value (32) of the range.

4. In general, the RCLP and DRCLP pulse instructions are used.

6-297
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 switches from OFF to ON, the instruction divides the values of the bits in D10 into groups (four bits as a group),
and then rotates these groups to the left with the carry flag SM602. The value of the bit marked ※ is transmitted to the

carry flag SM602.

Carr y flag ※
b 15 b0
0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

After the rotation is executed

Carry fl ag
b 15 b0
1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1

Additional remarks

_6 1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-298
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Rotating bits in a group to the right or the
0904 MBR P S, D, n
left in a matrix

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n DWORD      

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

D : Operation result

n : Length of the array

Explanation 6_

1. This instruction rotates the values of n rows of bits in S to the right or to the left. When SM616 is OFF, the instruction

rotates the values of the bits to the left. When SM616 is ON, the instruction rotates the values of the bits to the right.

The instruction fills the vacancy resulting from the rotation with the value of the bit rotated last, and stores the

operation result in D. The value of the bit rotated last not only fills the vacancy, but also is transmitted to the carry

flag SM614.

2. For 16-bit instructions, the value of n must be between 1–16. For 32-bit instructions, the value of n must be between

1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is executed

with n at the maximum value (32) of the range.

3. In general, the MBRP pulse instruction is used.

6-299
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1:

When M0 is ON and SM616 is OFF, the instruction rotates the values of the bits in the 16-bit registers D0–D2 to the left,
and stores the operation result in the 16-bit registers D20–D22. The value of the bit marked ※ is transmitted to the carry

flag SM614.

Befor e the rotation


S
is executed b15 b0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0
Carry fl ag
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D1
SM614 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D2

After MBR is executed

D
S M616=0 b15 b0
After the rotation 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D20
to the left is executed Carry fl ag 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D21

_6 S M614 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D22

Example 2:

When M0 is ON and SM616 is ON, the instruction rotates the values of the bits in the 16-bit registers D0–D2 to the right,
and stores the operation result in the 16-bit registers D20–D22. The value of the bit marked ※ is transmitted to the carry

flag SM614.

6-300
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Before the r otation S Carry flag


is executed b15 ※ b0
D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 SM614
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

MBR

SM616=0 D
b15 b0 Carry flag
After the r otation D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
to the left is executed 0
D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D22 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
S M614

Additional remarks

1. If S+n-1 or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0

is 16#2003.

2. Instruction flags:

SM614: The carry flag for the matrix rotation/shift/output

SM616: The direction flag for the matrix rotation/shift

6_

6-301
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.11 Timer and Counter Instructions


6.11.1 List of Timer and Counter Instructions
The following table lists the Timer and Counter instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1000 RST DRST – Resetting a contact to OFF or clearing the value in a register.

1001 TMR – – 16-bit timer (Unit: 100ms)

1002 TMRH – – 16-bit timer (Unit: 1ms)

1003 CNT – – 16-bit counter

1004 – DCNT – 32-bit counter (including the use of high-speed counters)

1005 – DHSCS – Setting high-speed comparison

1006 – DHSCR – Resetting high-speed comparison

1007 – DHSZ – High-speed input zone comparison

1008 – DSPD – Detecting speed

1009 PWD – – Detecting pulse width

– Capturing the high-speed count value in an external input


1010 – DCAP
interrupt
_6
1011 TMRM – – 16-bit timer (Unit: 10ms)

1012 IETS –  The start of the instruction execution time measurement

1013 IETE –  The end of the instruction execution time measurement

1014 – DHSCY – Cyclic counting, comparing and outputting

1015 PPDT – – Detecting the time difference between two phases

1016 ATMR – – 16-bit contact timer (Unit: 100 ms)

1017 ATMRH – – 16-bit contact timer (Unit: 1 ms)

1018 ATMRM – – 16-bit contact timer (Unit: 10 ms)

6-302
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.11.2 Explanation of Timer and Counter Instructions

API Instruction code Operand Function

Resetting a contact or clearing a


1000 D RST D
register

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D          
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S        

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device to reset

Explanation 6_
1. This instruction clears the values in a 32-bit HC device or two consecutive 16-bit D devices. For other devices, use

the RST instruction to clear the values.

2. The following table shows the actions of the RST instruction.

Device State

Bit Sets the coil and contact to OFF.

T, C Set the current timer value and counter value to 0, and sets the coil and contact to OFF.

Word Clears the 16-bit content value to 0.

DWord, HC, Real Clears the 32-bit content value, including floating point numbers, to 0.

3. If the RST instruction is not executed, the state of the device specified by D is unchanged.

4. The instruction supports direct output.

6-303
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction sets M1 to OFF.

The instruction clears the 32-bit D1 and D0 to zero when M0 is ON.

_6

6-304
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1001 TMR S1, S2 16-bit timer (100ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Timer number

S2 : Setting value of the timer

Explanation

Refer to the explanation of the TMRH instruction (API 1002) for details. 6_

6-305
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1002 TMRH S1, S2 16-bit timer (1ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Timer number

S2 : Setting value for the timer

Explanation

1. The TMR instruction uses 100ms as the timing unit in the timer, while, the TMRH instruction uses 1ms as the timing

unit in the timer.


_6
2. The value of S2 for both the TMR and TMRH instructions is between 0–32767.

3. If you use the same timer repeatedly in the program, including using it in different TMR and TMRH instructions, the

timer that completes the measurement first will be the only one that counts.

4. The T timer resets to zero automatically when the conditional contact changes from ON to OFF.

5. When you add the letter S in front of the device T, the timer in the instruction TMR is an accumulative timer. When

the conditional contact is OFF, the value of the accumulative timer is not cleared. When the conditional contact is

ON, the timer counts from the current value. Use the RST instruction with the ST accumulative timer when you want

to clear the value of the timer.

6. If you use the same T timer in the program, it is OFF when one of the conditional contacts is OFF.

7. If you use the same T timer for T and ST in the program, T is OFF when one of the conditional contacts is OFF.

8. When the instruction TMR is executed, the specified timer coil is ON and the timer begins to count. As the value of

the timer matches the setting value, the contact is ON.

6-306
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

9. The timers T0–T411 are defined as general timers, and T412–T511 are subroutine timers by default. Use the

hardware configuration software HWCONFIG if you need to change the ranges of the two types of timers.

10. The general timers compare the timing values when the TMR instruction is scanned. The system applies the timer

to the condition every time the TMR instruction status is scanned.

For the subroutine timers, the system counts the time and compares the timing values after the END instruction is

executed. Use subroutine timers when the TMR instruction is executed not in every scan, but you need longer

lasting timing and comparing.

Example 1 (General 100ms timer)

When M0 is ON, the instruction loads the setting value 50 to the timer T0, and T0 counts from 0 to 50. When the value of

T0 matches 50, the contact of T0 is ON.

Example 2 (Accumulative 100ms timer)

When M0 is ON, the instruction loads the setting value 50 to the timer ST0. When the value of T0 is 25 and M0 switches

from OFF to ON, then T0 counts up from 25 to 50, and the contact of T0 is ON (accumulative). 6_

Example 3 (General 1ms timer)

When M0 is ON, the instruction loads the setting value 1000 to the timer T5, and T5 counts up from 0 to 1000, and the

contact of T5 is ON.

6-307
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 4 (Accumulative 1ms timer)

When M0 is ON, the instruction loads the setting value 1000 to the timer T5. When the value of T5 is 500 and

M0 switches from OFF to ON, T5 counts up from 500 to 1000, and the contact of T5 is ON (accumulative).

Example 5: Use the TMRH instruction in a function block (FB).

Step 1: Declare the counter as T_Pointer type in the function block.

D0 is reset every 5 seconds in the function block.

_6

Step 2: Specify the number for the T device in the program organization unit. (Here is T0)

6-308
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

When you declare the operand S1 in ISPSoft/DIADesigner, select the data type TIMER for the general T timer. For an

accumulative ST timer, specify the ST device.

6_

6-309
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1003 CNT S1, S2 16-bit counter

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Counter number

S2 : Setting value for the counter

Explanation

1. This instruction changes a specified counter coil from OFF to ON, and then increments the value of the counter by 1.

When the value of the counter matches the setting value, the contact of the counter is ON.
_6
2. When the value of the counter matches the setting value, the instruction does not change the state of the contact

and value of the counter if any more counting pulses are input. Use the RST instruction (API 1000) to reset the

counter and enable counting again.

3. Refer to Example 1 below for how to use the CNT instruction for counting in a program of unit (POU).

Refer to Example 2 below for how to use the CNT instruction for counting in a function block (FB).

4. You can use the same device C number of CNT instruction in a POU for more than once. The system will count

according to different contact status, OFF or ON separately.

5. You can NOT use the same device C number of CNT instruction in a FB for more than once. It is suggested that you

use 8 different device C numbers at most.

Example 1: (using CNT instruction in a POU)

When SM408 is ON for the first time, the instruction loads the setting value 10 to the counter C0 and the counter begins

counting. After SM408 switches from OFF to ON ten times, the value in C0 is 10 and the contact of C0 is ON. After C0 is

ON, if SM408 continues to switch from OFF to ON, the instruction does not increase the value in C0 after it reaches the

setting value for C0.

6-310
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 2: (using CNT instructions in a FB).

Step 1: Declare the counter as C_Pointer type in the function block.

The function block:

6_

Step 2: Specify the numbers for the C devices in the POU program. (Here are C0 and C1)

Additional remarks

When you declare the operand S1 in ISPSoft/DIADesigner, select the data type COUNTER.

6 - 3 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1004 DCNT S1, S2 32-bit counter

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Counter number

S2 : Setting value for the counter

Explanation

_6 1. This instruction enables the 32-bit counter between HC0–HC255.

2. If you declare the operand S1 in ISPSoft/DIADesigner, you cannot select the CNT data type; instead, specify an HC
device number.

3. For the count-up/count-down counters HC0–HC63, when the conditional contact of this instruction switches from

OFF to ON, the counters count up by incrementing the values by 1 when SM621–SM684 are OFF or count down by

decrementing the values by 1 when SM621–SM684 are ON.

4. Count-up counters HC64–HC199 count up by increasing the values by 1 when the conditional contact of the DCNT

instruction switches from OFF to ON.

5. The counter stops counting when the DCNT instruction is OFF, but the instruction does not clear the original count

value. Use the RST instruction to clear the count value and reset the contact to OFF.

6. Refer to Example 2 of CNT instruction if you want to use the DCNT instruction for counting in a function block (FB).

7. Refer to the following pages for details on the high-speed counter HC200–HC255. It is suggested that you use them

in the program organization unit (POU) since the value of the specified counter will be refreshed once the instruction

is scanned inside the PLC during the high-speed counting.

6-312
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

8. Since ES3/EX3/SV3/SX3 Series PLC is with various built-in input types, different maximum input frequencies are

suggested. See the table below for reference.

The maximum input frequencies of the Sinking/Sourcing input points are listed in the table below. The expected

maximum frequencies may not be reached since output points are of open collector type and the drive current is

insufficient. Refer to Chapter 4 Installing Hardware in DVP-ES3/EX3/SV3/SX3 Series Operation Manual for more

information.

Maximum Input
Model Name Input Type Input Number
Frequency

X0~X7 200KHz
ES3/SV3 Sink/Source
X10~X17 10KHz

SX3 Sink/Source X0~X7 200KHz

X0~X7 200KHz
22EX3 Sink/Source
X10~X13 10KHz

Differential X0~X3 4MHz

28EX3 X4~X7 200KHz


Sink/Source
X10~X13 10KHz

X0~X7 200KHz
36EX3 Sink/Source 6_
X10~X17 10KHz

Example 1

NETWORK1:

When PLC runs, the value of the counter HC0 is cleared and the counter counts because SM621 is OFF. At this time,

SM408 is ON for the first time. So the instruction loads the setting value 10 to the counter HC0 and the counter begins

counting.

NETWORK2:

After SM408 switches from OFF to ON ten times, the value of the counter HC0 matches the setting value 10, and the

contact of HC0 is ON. After HC0 is ON, the value of the counter keeps increasing because SM408 continues to change

from OFF to ON even though the value of HC0 has reached the setting value.

NETWORK3:

When HC0 continues to count up and the value reaches the setting value 20, the counter counts down because SM621 is

6-313
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ON in the program. After SM408 switches from OFF to ON ten times and the value of HC0 decreases from 10 to 9, the

contact of HC0 is OFF.

After the contact of HC0 is OFF, the value of HC0 still continues to decrease because SM408 continues to change from

OFF to ON.

Additional remarks
_6
For setting the mode of SM621–SM684, refer to the explanation of the 32-bit counter HC in Chapter 2.

Example 2

NETWORK1:

When PLC runs, set the value of the counter HC202 to four times frequency (mode setting should be set before executing

the DCNT instruction). And then the value of the counter HC202 is cleared.

NETWORK2:

After the value of the counter HC202 reached the setting value 1000, the contact of HC202 is ON.

6-314
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Explanation of the high-speed counter:

ES3/EX3/SV3/SX3 Series high-speed counters can be divided into hardware counters (up to a maximum of 200KHz or

10KHz) and software counters (up to a maximum of 10KHz). Refer to hardware specification for more details on the input

limit.

Hardware counter

Input X

HC No. 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17
6_
HC200 P#1 R#4

HC201 P D#1 R

HC202 A#1 B#1 R

HC203 --#2 -- --

HC204 P R

HC205 P D R

HC206 A B R

HC207 -- -- --

HC208 P R

HC209 P D R

HC210 A B R

HC211 -- -- --

HC212 P R

6-315
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

HC213 P D R

HC214 A B R

HC215 -- -- --

HC216 P

HC217 P D

HC218 A B

HC219 -- --

HC220 P

HC221 P D

HC222 A B

HC223 -- --

Note 1: P: single-phase pulse input, D: Direction signal input, A and B: two phase two input, R: Reset signal input. Only

one of the four input modes can be used in PLC programing. For example, if HC200 is edited, the HC201-HC203 can no

longer be edited. ISPSoft/DIADesigner does not check for repeated input modes during compiling a program. However,

after the program is downloaded to the PLC, the error code of counter misuse (16#0E05) is shown in SR4.

Note 2: -- indicates that the counting mode is reserved and not available now. An empty box indicates no function.

Note3: refer to the SM/SR table for count up/down state selection and the number of times for frequency input.
_6
Note 4: the R function (reset input) is disabled by default. Refer to the SM/SR comparison table for how to use R.

Take HC200 for example. SM291 switches to ON to start the R function and then the rising edge of X14 triggers clearing

the value of HC200. If there is no built-in input point, including X14 ~ X17, in the PLC you are using, you can use external

interrupts or use counter eraser instructions to clear the counters.

Software counter:

Input X

HC No. 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17

HC232 P

HC233 P D

HC234 A B

HC235 UP#5 DN#5

HC236 P

HC237 P D

6-316
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

HC238 A B

HC239 UP DN

HC240 P

HC241 UP DN

HC242 P

HC243 UP DN

HC244 P

HC245 UP DN

HC246 P

HC247 UP DN

HC248 P

HC249 UP DN

HC250 P

HC251 UP DN

HC252 P

HC253 P

Note 5: UP: single phase count-up input (same as CW), DN: single phase count-down input (same as CCW)
6_
The high-speed counters between HC200–HC255, are reserved devices inside PLC and are not listed in this table. It is

not recommended to use these counters in a program.

The following table lists the high-speed counter, function, reset, reversing, and counting mode.

Count-up/count-down function Starting the Reversing the Counting mode

Reset function direction

HC No. SM No. Attribute Explanation SM No. SM No. SR No.

HC200 SM300 R/W Show/ set SM281

HC201 SM301 R Show (Applicable for


SM291 SR190
HC201 and
HC202 SM302 R Show
HC202)

HC204 SM304 R/W Show/ set SM282

HC205 SM305 R Show (Applicable for


SM292 SR191
HC205 and
HC206 SM306 R Show
HC206)

6-317
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Count-up/count-down function Starting the Reversing the Counting mode

Reset function direction

HC No. SM No. Attribute Explanation SM No. SM No. SR No.

HC208 SM308 R/W Show/ set SM283

HC209 SM309 R Show (Applicable for


SM293 SR192
HC209 and
HC210 SM310 R Show
HC210)

HC212 SM312 R/W Show/ set SM284

HC213 SM313 R Show (Applicable for


SM294 SR193
HC213 and
HC214 SM314 R Show
HC214)

HC216 SM316 R/W Show/ set SM285

HC217 SM317 R Show (Applicable for


-- SR194
HC217 and
HC218 SM318 R Show
HC218)

HC220 SM320 R/W Show/ set SM286

HC221 SM321 R Show (Applicable for


-- SR195
HC221 and
HC222 SM322 R Show
HC222)
_6
HC232 SM332 R/W Show/ set
SM287
HC233 SM333 R Show (Applicable for
-- SR196
HC234 SM334 R Show HC233 and

HC234)
HC235 SM335 R Show

HC236 SM336 R/W Show/ set


SM288
HC237 SM337 R Show (Applicable for
-- SR197
HC238 SM338 R Show HC237 and

HC238)
HC239 SM339 R Show

HC240 SM340 R/W Show/ set

HC241 SM341 R Show


Supports one time
HC242 SM342 R/W Show/ set frequency and rising
-- --
HC243 SM343 R Show edge –triggered

counting only
HC244 SM344 R/W Show/ set

HC245 SM345 R Show

6-318
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Count-up/count-down function Starting the Reversing the Counting mode

Reset function direction

HC No. SM No. Attribute Explanation SM No. SM No. SR No.

Supports one time

frequency and rising


HC246 SM346 R/W Show/ set -- --
edge –triggered

counting only

HC247 SM347 R Show

HC248 SM348 R/W Show/ set

HC249 SM349 R Show Supports one time

frequency and rising


HC250 SM350 R/W Show/ set -- --
edge –triggered
HC251 SM351 R Show
counting only
HC252 SM352 R/W Show/ set

HC253 SM353 R Show

Note 1: All SM special flags in the above table are OFF by default.

Note 2: When SM under “Count-up/count-down function” is OFF, it indicates that the corresponding counter counts up or

displays that it is counting up. If SM is ON, it indicates that the corresponding counter counts down or displays that it

is counting down.
6_
Note 3: The “under Attribute indicates “Read only” and R/W indicates “Read/Write”.

Note 4: The SR special registers under “Counting mode” are one time frequency input by default. Use 2 for the input value

for double frequency and 4 for four times frequency. Four times frequency is only applicable to the A/B 2-phase

input counter. If the input value is not 1, 2 or 4 in SR, this indicates that the PLC uses one time frequency.

Note 5: All single-phase counters in the table count using one times frequency, and the rising-edge counting mode

changes the input point from OFF to ON.

Note 6: P (Pulse input) and D (Direction) counters can reverse direction. When SM is ON, the counting direction (up/down)

is reversed. For example, when the preset direction input is OFF, the counter counts up. When SM switches to ON,

the counter changes to count down.

6-319
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1005 D HSCS S1, S2, D Setting high-speed comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2   
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Counter number

S2 : Comparative value

D : Comparison result

_6 Explanation

1. Use this instruction with high-speed counters with numbers HC200 and above. If the value in the high-speed counter

specified by S1 changes by increasing or decreasing by 1, the DHSCS instruction makes the comparison immediately.
When the current value of the high-speed counter is equal to the comparative value specified in S2, the device

specified by D changes to ON. After that, the device specified by D remains ON even if the comparison result is that

the current value and the comparative value are not equal.

2. If the device specified by D is Y0–Y7 and Y10–Y13, and the value of S2 is equal to the current value, the comparison

result of the high-speed counter is output to the output terminals Y0–Y7 and Y10–Y13. Other Y devices are affected

by the scan cycle, but this instruction updates all devices immediately and is not affected by the scan cycle.

3. The D operand can also specify an I interrupt device between 1200–1267.

4. The high-speed counters are divided into software counters and hardware counters. The available high-speed

comparators and interrupt device numbers are listed in the following table.

6-320
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Type Range of counter numbers High-speed comparator High-speed interrupt

number device number

HC200 - HC203 Comparator: I200-I203

HCC00-HCC03

HC204 - HC207 Comparator: I210-I213

HCC04-HCC07

HC208 - HC211 Comparator: I220-I223

HCC08-HCC11
Hardware counter
HC212 - HC215 Comparator: I230-I233

HCC12-HCC15

HC216 - HC219 Comparator: I240-I243

HCC16-HCC19

HC220 - HC223 Comparator: I250-I253

HCC20-HC223

Software counter HC232 - HC253 - I260-I267

5. Explanation of the hardware comparators for DHSCS, DHSCR, DHSCY and DHSZ instructions:

 Every one group of hardware counters shares 4 high-speed comparators. One DHSCS or DHSCR instruction

occupies 1 high-speed comparator. One DHSZ or DHSCY instruction uses 2 high-speed comparators.

6_
 During program editing, every group of hardware counters can use 4 high-speed comparators at most for
DHSCS, DHSCR, DHSCY or DHSZ instructions; otherwise, a syntax error occurs.

6. Explanation of the software comparators for DHSCS, DHSCR and DHSCY instructions:

 There are 8 software comparators to compare the Set or Reset function. Each DHSCS, DHSCR or DHSCY
instruction uses one high-speed comparator.

 The software comparators compare the interrupt by assigning a corresponding software comparator
according to the interrupt numbers. Note that the same interrupt number cannot be used repeatedly.

 For DHSCS, DHSCR or DHSCY instructions, the number of Set or Reset comparators cannot exceed eight
occurrences in the program; otherwise, a syntax error occurs.

7. Explanation of the software comparators for DHSZ instruction:

 There are eight software comparators for the zone comparison. One DHSZ instruction uses one comparator.

 DHSZ instruction can use a maximum of eight software comparators; otherwise, a syntax error occurs if more
than eight comparators are used.

6-321
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

8. The instructions DHSCS, DHSCR, DHSCY and DHSZ cannot be used in the ST programming language, interrupt

tasks or function block which is called only once.

Example 1

When M0 is ON, the DHSCS instruction is executed.

When the current value of HC200 changes from 99 to 100 or from 101 to 100, Y10 is ON, which outputs to the external

output terminal Y10 in real time, and remains ON.

Example 2

The Y output of DHSCS instruction is different from the general Y output.

1. When M0 is ON, the DHSCS instruction is executed. When the current value of HC200 changes from 99 to 100 or
_6 from 101 to 100, Y10 outputs its state to the external output terminal immediately, and is not affected by the program

scan time.

2. When the current value of HC200 changes from 99 to100, the contact of HC200 is ON immediately. When SET

Y0.11 is executed, Y11 is still affected by the scan time, and outputs its state only after END is passed.

6-322
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 3

Using an interrupt in hardware high-speed comparison.

When the current value of HC200 changes from 99 to100 or 101 to100, the program jumps to the interrupt pointer to

execute the interrupt program, and Y10 is ON.

Main program:

I200 interrupt program:


6_

6-323
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1006 D HSCR S1, S2, D Resetting high-speed input comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2   
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Counter number

S2 : Comparative value

D : Comparison result

_6 Explanation

1. Use this instruction with the high-speed counter numbered HC200 and above. If the value in the high-speed counter
specified by S1 changes by increasing or decreasing, the DHSCR instruction makes the comparison immediately.

When the current value of the high-speed counter is equal to the comparative value specified in S2, the device

specified by D changes to OFF. After that, the device specified by D remains OFF even if the comparison result is that

the current value and the comparative value are not equal.

2. If the device specified by D is Y0–Y7 and Y10–Y13, and the comparative value of S2 is equal to the current value of

the counter, the comparison result is output to the external output terminals Y0–Y7 and Y10–Y13. Other Y devices

are affected by the scan cycle, but this instruction updates all devices immediately and is not affected by the scan

cycle.

3. The D operand can also specify the HC device to reset, and is limited to the condition in which the high-speed counter

number is the same as that of S1.

4. Refer to the DHSCS instruction (API 1005) for more information.

6-324
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

1. When M0 is ON and HC200 changes its current value from 99 to 100 or from 101 to 100, Y10 is reset to OFF.

2. When HC200 changes its current value from 199 to 200, the contact of HC200 is ON and Y0.11 is ON, but the

output is delayed by the program scan time.

6_
Example 2

If you specify HC200 as the hardware high-speed counter of the same number, the contact of HC200 is reset to OFF

when HC200 changes its current value from 999 to 1000 or from 1001 to 1000.

6-325
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

1 00 0

2 00

not affec ted b y the s can ti me


HC2 00

affected by the s can ti me

_6

6-326
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1007 D HSZ S1, S2, S3, D High-speed input zone comparison

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2   
S3   
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
S3  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Counter number
Lower bound of the comparison
S2 :
zone
Upper bound of the comparison
S3 :
zone
D :
Comparison result (3 consecutive 6_
devices)
Explanation

1. Use this instruction with the high-speed counter numbers HC200 and above. The lower bound of S2 must be less than

the upper bound of S3. If you do not set the zone limit values properly, the PLC automatically adjusts them.

2. If S1 specifies a software counter and the specified counter changes by increasing or decreasing by 1 in value, the

DHSZ instruction makes the comparison immediately. The comparison condition and output state are shown in the

following table.

Comparison condition D+0 state D+1 state D+2 state

The count value of S1 < the lower bound (S2) ON OFF OFF

The lower bound (S2) <= the count value of S1


OFF ON OFF
<= the upper bound (S3)

The count value of S1 >= the upper bound


OFF OFF ON
(S3)

6-327
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Note: You must set the lower bound (S2) to be less than the upper bound (S3). If you set the zone boundaries

incorrectly, the PLC automatically makes the adjustment.

3. If S1 specifies a hardware counter and the value of the specified counter reaches the lower bound (S2) or the upper

bound (S3), the DHSZ instruction makes the comparison immediately according to the count direction (up/down). The

comparison condition and output state are shown in the following table.

Count direction Comparison condition D+0 state D+1 state D+2 state

The count value of S1 == the lower


OFF ON OFF
bound (S2)
Count up
The count value of S1 == the
OFF OFF ON
upper bound (S3)

The count value of S1 == the lower


ON OFF OFF
bound (S2)
Count down
The count value of S1 == the
OFF ON OFF
upper bound (S3)

4. If the device specified by D is Y0–Y7 and Y10–Y13, the comparison result is output to the external output terminals

Y0–Y7 and Y10–Y13. Other Y devices are affected by the scan cycle, but this instruction updates all devices

immediately and is not affected by the scan cycle.

5. Refer to the DHSCS instruction (API 1005) for more information on the high-speed zone comparison.
_6

Example

1. When D is specified as Y10, Y11–Y12 are also specified automatically.

2. The instruction compares the current value in HC200 with the upper/lower bound (1500/2000) of the comparison

zone, and one of Y10–Y12 is ON according to the comparison result.

3. When the current value in HC200 <1500, Y10 is ON. When 1500<= the current value in HC200<2000, Y11 is ON.

When the current value in HC200>=2000, Y12 is ON.

6-328
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1008 D SPD S1, S2, D Detecting speed

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
D DWORD 

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Counter value

S2 : Setting value for the cycle time

D : Number of pulses from the previous scan cycle

Explanation

1. This instruction requires that you use S1 with the DCNT instruction (API 1004) to enable the high speed counter with 6_
counter numbers above HC200 (including HC200).

2. The time units for S2 (the setting value for the cycle time) are millisecond (ms). The setting must be between 10–1000.

When the value is out of range, the PLC executes the instruction with S2 at the minimum value or the maximum value

and there are no error messages.

3. When the count reaches the setting value in S2, this instruction stores the number of pulses in the device specified by

D, and is not affected by the PLC scan cycle.

4. This instruction has no limitation when editing, but it only allows eight sets of speed detection instructions to run

simultaneously. The system ignores the ninth set of the speed detection instruction and there are no error messages.

When executing this instruction, the setting values for the operand are recorded, and during the execution of this

instruction, you cannot edit the parameters.

6-329
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

You can use the DSPD instruction for speed detection where there is an input pulse signal in M0. When M0 is ON, the

instruction updates the number of pulses counted by HC200 in D0 every 500ms.

In the following example, the value in D0 is 7500 and the actual pulse input frequency of M0 is 15kHz (7500/500ms).

_6

6-330
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1009 PWD S1, S2, D Detecting pulse width

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
D1 
D2   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D1  
D2 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Number of the input point

S2 : Unit of measurement
Pulse width detection time (32-bit
D1 :
value)
D2 : Update flag 6_
Explanation

1. S1 supports the following 12 inputs, X0~X13, but S1 cannot share the same inputs with the high speed counter.

2. S2 is the unit of measurement. The instruction is not executed if the setting value of S2 is not a valid S2 code from the

following table.

S2 code Measurement Unit Detection range Frequency range Remark

0 1us 1Hz - 10kHz


Duty-on
1 1ms 0.02Hz - 100Hz

Odd-numbered inputs are NOT


2 10ns 10Hz - 1MHz
supported.

4 1us Cycle time 1Hz - 10kHz

5 1ms 0.02Hz - 100Hz

Other values The instruction is not executed.

6-331
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. The instruction stores the pulse width detection time (32-bit value) in D1 and the detection range is 0–100,000,000. If

the value is over the maximum value, it is processed as the maximum value. If the value is 0, that means is no input

switched from ON to OFF during the execution of this instruction.

4. D2 is the update flag. Whenever the detection of the S1 input is completed and the instruction is scanned, the updated

flag switches to ON for one scan cycle time. You can check if the detection value has been updated with the update

flag. When the system executes the instruction for the first time, the update flag resets to OFF.

5. When the value in S2 is 0, 1 or 2, refer to the timing diagram below for the procedures performed, such as storing

detection values and updating flags during the execution of the instruction. The timer starts when the S1 input

switches from OFF to ON as it is shown in the position  of the following diagram. The instruction stores the detection

time when the S1 input switches from ON to OFF as shown in the position  of the following diagram.

enable

PWD disable    disable

S1
  

D1 0 100 101 100

D2
_6 Figure 1 Detection mode when the value in S2 is 0, 1 or 2

6. When the value in S2 is 4 or 5, refer to the timing diagram below for the procedures performed, such as storing

detection values and updating flags during the execution of the instruction. The timer starts when the S1 input

switches from OFF to ON as it is shown in the position  of the following diagram. The instruction stores the detection

time when the S1 input switches from OFF to ON as shown in the position  of the following diagram.

enable

PWD disable    disable

S1
 

D1 0 100 101

D2
Figure 2 Detection mode when the value in S2 is 4 or 5

6-332
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

7. This instruction has no limitation during editing, but it only allows eight sets of pulse width detection instructions to run

simultaneously. The system ignores the ninth or later sets of the pulse width detection instruction and there are no

error messages. When executing this instruction, the setting values for the operands are recorded, and you cannot

edit the parameters during execution.

8. Before executing this instruction, check the input hardware response time and the pulse time set in HWCONFIG. For

example, when the value in S2 is set to 0 or 2, that means the unit of time measurement is microseconds (μs). Set the

S1 input value to 0 to disable the Input Point Filter Time in HWCONFIG.

Example

Suppose there is a pulse signal of 10kHz in the input M0. When M0 is ON, the PWD instruction detects the input

signal on X0 with the pulse width stored in D10/D11 (32-bit data), the time unit is set to 0, and the detected pulse

width from D10 is 50µs.

6_

6-333
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Capturing the high-speed count value in the
1010 D CAP S1, S2, D
external input interrupt

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol
External interrupt input point
S1 :
number
S2 : High-speed counter number
Register for storing the captured
D :
value
Explanation

_6 1. You can use only the 16 input points X0–X7 and X10–X17 of the PLC in S1. Use one of these input points with the

external interrupt service program to start the function. Note that S1 cannot share the same input point with the

high-speed counter.

2. Select the high-speed counter HC device in S2. You must use the HC device with the DCNT instruction (API 1004) to

start the counting function.

3. The instruction stores the captured value from the high-speed counter (32-bit) in D when the interrupt occurs. The

instruction stores data when the interrupt occurs, and is not affected by the PLC program scanning.

4. The instruction operation is shown below. The input interrupt is triggered by the falling edge.

  When the execution of the instruction starts, the value in D does not change and you can enter the default

setting value.

  When the interrupt in S1 occurs, the instruction captures the value of the counter specified by S2 immediately

and stores it in D.

6-334
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

enable

DCAP disable disable

S2

S1
  

D -- 1000 2000 500

5. The instruction can start DCAP instructions for four different input points at most. If you set one input point as the

external interrupt triggered by the rising edge and falling edge, the instruction captures the value when the input is

triggered by the rising edge and by falling edge respectively, and stores the count value in the device specified by D.

When two instructions specify the same interrupt input point, the one that starts first uses the interrupt input point first.

6. Set the HC device number in S2. It is recommended that you use the high-speed counters between HC200–HC255.
For details on the counters, refer to the explanation of the DCNT instruction (API 1004).

Example

6_

External interrupt is triggered by the rising edge in X7.

6-335
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

External interrupt is triggered by the falling edge in X7.

_6

Additional remarks

1. When M0 is ON, the DCAP instruction is enabled. When an external interrupt occurs in X0.7, the instruction
captures the value in HC200 and stores it in (32-bit) D0.

2. When the external input interrupt is triggered by the rising edge once, the instruction modifies E0 to 0 by setting
D100, stores the count value in D0 in D10 by modifying E0, and the value in D100 is 0+2.

3. When the external input interrupt is triggered by the falling edge one time, the instruction modifies E0 to 2 by
setting D100, stores the count value (10+E0=12) in D0 in D12 by modifying E0, and the value in D100 is 0+2.

When the value in D100 is 20, D100 is cleared to 0.

6-336
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

4. If the external interrupt is triggered by the rising edge and falling edge five times respectively, the instruction
captures the value 10 times and stores the captured values in D10, D12…D28.

The 1st captured value= D10

The 2nd captured value= D12

The 10th captured value=D28

The 11th captured value=D10

6_

6-337
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1011 TMRM S1, S2 16-bit timer (10ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Timer number

S2 : Setting value for the timer

Explanation

This instruction uses 10ms as the unit of time.

_6 Refer to the explanation of the TMRH instruction (API 1002) for details.

6-338
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description


The start of the instruction execution time
1012 IETS P D
measurement

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D 

DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

D  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : The time measurement result

Explanation

1. The IETS instruction need be used with the API1013 IETE instruction together in order to measure the time for the
execution of the instruction in a PLC program which is specified to execute. The unit for the measured time is 1us.

2. When the IETS instruction is enabled, the timing starts immediately until the IETE instruction is also executed. The
measurement result is stored in D device. 6_

3. Minimum and maximum time measurement results are 0us and 32767us respectively. After the IETS instruction is
enabled, the PLC will automatically finish the time measurement and store the measurement result in D device if no

IETE instruction has been scanned and the PLC program scanning reaches the END instruction.

4. For the instructions IETS and IETE, there is no limit to how many of them are written in the program. But only one
set of IETS and IETE can be enabled every time the scan is executed. If IETS is enabled repeatedly for measuring

time, the timing of enabling the last IETS instruction is taken as the start of the time measurement. On the contrary,

if the execution of multiple IETE instructions is completely finished, the PLC will see the point when the first IETE
instruction is disabled as the end point when the time measurement is finished.

5. The IETS instruction is usually used to measure the running time of a PLC program such as interrupt service
program function blocks and etc. Since PLC’s time-measurement resource will be occupied as the time

measurement function is enabled, we suggest the two instructions should be removed after the measuring is

completed in order to avoid occupying the PLC resource during the normal execution.

6-339
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

Calculate the instruction execution time based on the formula for the floating point number operation and the operation

result is stored in D100.

_6

6-340
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description


The end of the instruction execution time
1013 IETE P ─
measurement

Device X Y M S T C HC D FR SM SR E K 16# “$” F

DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

Explanation

The IETE instruction should be used with the API1012 IETS instruction together. Refer to the explanation of the API 1012

instruction for more information.


6_

6-341
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Function

1014 D HSCY HCno ~ CurNo Cyclic counting, comparing and outputting

Device X Y M S T C HC D FR SM SR E K 16# “$” F


HCno 
CmpLen   
CmpS   
Action  
Yno  
CurNo 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

HCno 
CmpLen  
CmpS  
Action  
Yno  
CurNo  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

_6 HCno : 32-bit input counter number

CmpLen : The length of data to be compared

CmpS : The source value of data in 32-bit to be compared

Action : Action to be taken when the comparison is made.

Yno : The number of Y output point

CurNo : The current group number that is making the comparison

Explanation

1. HCno: If the counter is a general one, the comparison will not begin even when the timing to execute comparison is
reached. The comparison begins only when the instruction is scanned. If the counter is a high-speed one, the
comparison begins when the timing to execute comparison is reached, not affected by the PLC scan cycle. Refer to
DHSCS instruction for more details on the usage and the restriction of the high-speed number.

2. CmpLen: To select a set of groups for comparison. The set group compares in a cyclic manner. The setting value of
the group can be between 4 and 32. If the setting value exceeds the acceptable range, this instruction is not executed.
And SM0 will be switched to ON. Error code SR0: 0x200B.

6-342
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

3. CmpS (supposedly set as D100), Action (supposedly set as D200), Yno (supposedly set as D300), CmpLen
(supposedly set as 6), CurNo (as it is set below).

CurNo CmpS Action Yno


(Current Group (The source value of data in (Action to be taken when (The number of Y
Number) 32-bit to be compared) the comparison is made.) output point)

1 D100 = 1000 D200 = 1 (Set) D300 = 16#04 (Y4)

2 D102 = 2000 D201 = 1 (Set) D301 = 16#05 (Y5)

3 D104 = 3000 D202 = 1 (Set) D302 = 16#06 (Y6)

4 D106 = 4500 D203 = 0 (Reset) D303 = 16#04 (Y4)

5 D108 = 5500 D204 = 0 (Reset) D304 = 16#05 (Y5)

6 D110 = 6500 D205 = 0 (Reset) D305 = 16#06 (Y6)

 CmpS: The source value of data in 32-bit integer. It takes several Dword space in CmLen. Thus it is suggested to
declare the array in the data type of Dword. The compared value is arranged in ascending order when the source
value is positive integers. The compared value is arranged in descending order when the source value is negative
integers. If the compared value is arranged not by the rules as mentioned, the instruction is not executed and SM0
will be switched to ON. Error code SR0: 0x200B.

 Action: Action to be taken when the comparison is made. The value is in 16-bit integer and it takes one word
space in CmLen. The value “1” here means setting the output point to ON. The value “0” here means setting the
output point to OFF. Use 16#8000 to clear the counter value to 0 and restart the cyclic counting. Only use the value
1, 0 or 16#8000 in here. It is suggested to declare the array in the data type of Word.
6_
 Yno: The number of the Y output point, this value should be a 16-bit integer. It takes several Word space in CmLen.
The Y output point number is octal and so you need to make the conversion between decimal and octal numbers.
For example, 16#0004 means the Y4 output point, 16#0016 Y26 output point, and 16#00AF Y257 output point. It is
suggested to declare the array in the data type of Word.

 CurNo: The current group number that is making the comparison. From the table above, you can see if the setting
value in CmLen is 1000, the CurNo. Is 1.

4. When the value you use in Yno is not the CPU built-in output points, the outputting is affected by the PLC scan cycle.
If you need the immediate output, use CPU built-in output points and hardware type high-speed counter in HCno.

5. Since this instruction is for cyclic comparing and outputting, you need to set a way to clear the counter value to 0 to
set a range for cyclic operation. It is suggested to use hardware input to set the counter to 0. Or you can also use a
setting to clear the counter. For example, you need 6 groups to perform cyclic comparison. You can set the setting
value in CmpLen as 7 and you will have a 7 groups of CruNo (defined by CmpS). And then use 16#8000 as the
setting value in Action to clear HC. See the table below for reference.

CurNo CmpS Action Yno


(Current Group (The source value of data in (Action to be taken when (The number of Y
Number) 32-bit to be compared) the comparison is made.) output point)

D206 = 16#8000 D306 = 0


7 (CurNo=0) D112 = 8000
(Clear HC) (none)

6-343
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. When the instruction is firstly executed, it compares the current counter value to the value set in CmpS and set the
value in CurNo accordingly. See the example table in number 2. If the current counter value is 2000, that
corresponds to the value (D102 = 2000) set in CmpS and the corresponding value of CurNo is 2. From there you
know the Y5 is ON.

7. See the example in chronological illustration below.

  The instruction is firstly executed, comparing the current counter value (1500) and the value set in CmpS
(HC202). And set the value in CurNo to 1 and Y4 output to ON accordingly.

  When the current counter value reaches 2000, CurNo = 2 and Y5 is ON.

  When the current counter value reaches 3000, CurNo = 3 and Y6 is ON.

  When the current counter value reaches 4500, CurNo = 4 and Y4 is OFF.

  When the current counter value reaches 5500, CurNo = 5 and Y5 is OFF.

  When the current counter value reaches 6500, CurNo = 6 and Y6 is OFF.

  The external interrupt is triggered to clear. CurNo = 0 and HC202 = 0.

  When the current counter value reaches 1000, CurNo = 1 and Y4 is ON.

EN

Clear flag

_6 HC202 1500 2000 3000 4500 5500 6500 0 1000

CurNo. 1 2 3 4 5 6 0 1

Y0.4

Y0.5

Y0.6

       

Cyclic comparison for illustration purpose only.

6-344
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Clear Point

HC202=6500 reset Y0.6


No.6
No.1 HC202=1000 set Y0.4

HC202=5500 reset Y0.5 No.5

No.2 HC202=2000 set Y0.5

HC202=4500 reset Y0.4 No.4


No.3 HC202=3000 set Y0.6

Example:

1. Define the following parameters as below.

CurNo CmpS Action Yno


(Current Group (The source value of data in (Action to be taken when (The number of
Number) 32-bit to be compared) the comparison is made.) Y output point)

1 D100 = 1000 D200 = 1 (Set) D300 = 16#04 (Y4)

2 D102 = 2000 D201 = 1 (Set) D301 = 16#05 (Y5)

3 D104 = 3000 D202 = 1 (Set) D302 = 16#06 (Y6)

4 D106 = 4500 D203 = 0 (Reset) D303 = 16#04 (Y4)


6_
5 D108 = 5500 D204 = 0 (Reset) D304 = 16#05 (Y5)

6 D110 = 6500 D205 = 0 (Reset) D305 = 16#06 (Y6)

2. When M0 is ON, the instruction is executed.

  The instruction is firstly executed, comparing the current counter value and the value set in CmpS (HC202).
And set the value in CurNo to 1 and Y4 output to ON accordingly.

  When the current counter value reaches 2000, CurNo = 2 and Y5 is ON.

  When the current counter value reaches 3000, CurNo = 3 and Y6 is ON.

  When the current counter value reaches 4500, CurNo = 4 and Y4 is OFF.

  When the current counter value reaches 5500, CurNo = 5 and Y5 is OFF.

  When the current counter value reaches 6500, CurNo = 6 and Y6 is OFF.

  The external interrupt is triggered to clear. CurNo = 0 and HC202 = 0.

  When the current counter value reaches 1000, CurNo = 1 and Y4 is ON.

6-345
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

External interrupt is triggered at X4.

_6

6-346
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Function

Detecting the time difference between two


1015 PPDT XnoA,XnoB,PhaseT,Exe phases

Device X Y M S T C HC D FR SM SR E K 16# “$” F


XnoA 
XnoB 
PhaseT 
Exe   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

XnoA 
XnoB 
PhaseT  
Exe 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

XnoA : Phase A input

XnoB : Phase B input

Phase T : Time differences between two phases (32-bit integer)


6_
Exe : Timing flag

Explanation

1. You can only use the CPU built-in input points from X0 to X13 for XnoA and XnoB. And the number of the input points
can NOT be duplicated. When the input points used are not from X0 to X13 or the number of the input points are
duplicated, the instruction is not executed, SM0 is switched to ON and Error code SR0 is 16#2003.

2. When XnoA is rising-edge triggered, the timer starts timing immediately, not affected by the PLC scan cycle. When
XnoB is rising-edge triggered, the timer stops timing immediately, not affected by the PLC scan cycle. And the time
that is timed (unit: 1 us) will be stored in PhaseT when this instruction is scanned by the PLC.

3. When the timer starts and this instruction is scanned to execute, the Exe flag will be ON. When the timer stops and
this instruction is scanned to execute, the Exe flag will be OFF.

4. Whenever this instruction is firstly activated, its initial action is to clear the value in PhaseT and set the Exe flag to
OFF.

5. XnoA is always timed before XnoB. Even if XnoB is rising-edge triggered before XnoA is triggered. If you need
XnoB to be timed before XnoA, you need to re-define XnoA, XnoB and the input points in them.

6-347
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. There is no limit to the number of times the instruction can be executed. And to use the same number of input points
is also no problem. But since PLC uses the number of input point for XnoA as the number of the internal timer. It is
NOT suggested to use two identical numbers of the input point for XnoA at the same time. Or the system will get
confused. And the timing result from the timer will be messed up.

7. See the example in chronological illustration below.

EN

XnoA

XnoB

PhaseT 0 3000 2900

Exe

    

  Whenever this instruction is firstly activated, it clears the value in PhaseT and sets the Exe flag to OFF.

  When XnoA is rising-triggered to start timing, the Exe flag will be ON.
  When XnoB is rising-triggered to stop timing, the Exe flag will be OFF and stores the timed result in PhaseT.

_6 Example

When M0 is ON, the instruction is executed. This instruction calculates the phase time difference between X1 and X0 and
stores the timed result in D0. (The timed result here is 13790 us.)

6-348
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1016 ATMR Tno, Tsv 16-bit contact timer (Unit: 100 ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Tno 
Tsv    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

Tno 
Tsv  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Tno : Timer number

Tsv : Setting value for the timer

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or later/

DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later, which 6_
works with DIADesigner V1.30 or later.

2. The ATMR instruction takes 100ms as the timing unit in the timer. Refer to the explanation of the ATMRH instruction

(API 1017) for details.

6-349
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1017 ATMRH Tno, Tsv 16-bit contact timer (Unit: 1 ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Tno 
Tsv    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

Tno 
Tsv  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Tno : Timer number

Tsv : Setting value for the timer

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or later/

DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,
_6 which works with DIADesigner V1.30 or later.

2. The ATMRH instruction is the same as the combination of AND and TMRH instructions.

If the conditional contact is met, the coil for the specified timer is ON and the timer starts timing. When the specified

timing value is reached (timing value >= setting value), its contact will act as the following table shows. If the

condition for the AND contact action is met but the conditional contact is not met, the ATMRH instruction

automatically clears the timing value in the timer.

NO (Normally Open) contact Continuity

NC (Normally Closed) contact Discontinuity

Example

The program executes as the following:

When the normally open contact M0 is ON, T0 timer starts timing, when the timing value is greater than or equal to

K1000, the normally open contact M100 is ON.

6-350
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Ladder diagram (Using TMRH instruction)

Ladder diagram (Using ATMRH instruction)

6_

6-351
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1018 ATMRM Tno, Tsv 16-bit contact timer (Unit: 10 ms)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Tno 
Tsv    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

Tno 
Tsv  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Tno : Timer number

Tsv : Setting value for the timer

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or later/
_6
DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later, which

works with DIADesigner V1.30 or later.

2. The ATMRM instruction takes 10ms as the timing unit in the timer. Refer to the explanation of the ATMRH instruction

(API 1017) for details.

6-352
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.12 Shift Instructions


6.12.1 The List of Shift Instructions
The following table lists the Shift instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1100 SFTR –  Shifting the states of devices to the right

1101 SFTL –  Shifting the states of devices to the left

1102 WSFR DWSFR  Shifting the data in word devices to the right

1103 WSFL DWSFL  Shifting the data in word devices to the left

1104 SFWR DSFWR  Shifting the data and writing it into a word device

1105 SFRD DSFRD  Shifting the data and reading it from a word device

1106 SFPO DSFPO  Reading the latest data from the data list

1107 SFDEL DSFDEL  Deleting data from the data list

1108 SFINS DSFINS  Inserting the data into the data list

1109 MBS –  Shifting matrix bits

1110 SFR DSFR  Shifting the values of the bits in registers by n bits to the right

1111 SFL DSFL  Shifting the values of the bits in registers by n bits to the left
6_
1112 BSFR –  Shifting the states of n bit devices by one bit to the right

1113 BSFL –  Shifting the states of n bit devices by one bit to the left

1114 NSFR DNSFR  Shifting n registers to the right

1115 NSFL DNSFL  Shifting n registers to the left

6-353
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.12.2 Explanation of Shift Instructions

API Instruction code Operand Function

Shifting the states of devices to the


1100 SFTR P S, D, n1, n2
right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D    
n1      
n2      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

S 
D 
n1  
n2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : First device where the value is shifted from

D : First device where the value is shifted to


_6
n1 : Length of the data to be shifted

n2 : Number of bits in a group

Explanation

1. This instruction divides the states of the n1 bit devices starting from D into groups (n2 bits in a group), and shifts

these groups to the right. This instruction then shifts the states of the n2 bit devices starting from S to the devices

starting from D to fill the vacancy.

2. In general, the SFTRP pulse instruction is used.

3. For ES3 CPU firmware V1.04.30 or earlier, the operand n1 must be between 1–1024 and the operand n2 must be
between 1–n1. For ES3/EX3 CPU firmware V1.06.00 or later and SV3/SX3 CPU firmware V1.00.00 or later, the

operand n1 must be 1–4096 and the operand n2 must be between 1–n1.

6-354
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

1. When M500 switches from OFF to ON, the instruction divides the states of the sixteen bit devices starting from M0

to M15 into groups (four bits in a group), and shifts these groups to the right.

2. The shift of the states of the bit devices to the right during a scan is shown below.

 M3-M0 → Being carried

 M7-M4 → M3-M0

 M11-M8 → M7-M4

 M15-M12 → M11-M8

 M103-X100 → M15-M12

6_
4 bits are as a group shi fted to the ri ght.
M10 3 M102 M1 01 M1 00
5
M1 5 M14 M13 M12 M11 M1 0 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0

4 3 2 1

6-355
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. When X50 switches from OFF to ON, the instruction divides the states of the sixteen bit devices starting from M0 to

M15 into groups (five bits as a group), and shifts these groups to the right.

2. The shift of the states of the bit devices to the right during a scan is shown below.

 M0 → Being carried

 M5 → M0

 M10-M6 → M5-M1

 M15-M11 → M10-M6

 M104-M100 → M15-M11

_6 M104 M10 3 M10 2 M101 M100


5 bi ts are as a group shif ted to the right.

5
M 15 M 14 M 13 M 12 M 11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0

4 3 2 1

Additional remarks

1. If S+n2-1 or D+n1-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0

is 16#2003.

2. If n1 not between 1–1024, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. If n2 is not between 1–n1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-356
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1101 SFTL P S, D, n1, n2 Shifting the states of devices to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D    
n1      
n2      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 
n1  
n2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : First device where the value is shifted from

D : First device where the value is shifted to

n1 : Length of the data to be shifted

n2 : Number of bits in a group 6_

Explanation

1. This instruction divides the states of the n1 bit devices starting from D into groups (n2 bits in a group), and shifts

these groups to the left. This instruction then shifts the states of the n2 bit devices starting from S to the devices

starting from D to fill the vacancy.

2. In general, the SFTLP pulse instruction is used.

3. For ES3 CPU firmware V1.04.30 or earlier, the operand n1 must be between 1–1024 and the operand n2 must be

between 1–n1. For ES3/EX3 CPU firmware V1.06.00 or later and SV3/SX3 CPU firmware V1.00.00 or later, the

operand n1 must be 1–4096 and the operand n2 must be between 1–n1.

6-357
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. When M50 switches from OFF to ON, the instruction divides the states of the sixteen bit devices starting from M0 to

M15 into groups (four bits in a group), and shifts these groups to the left.

2. The shift of the states of the bit devices to the left during a scan is shown below.

 M15-M12 → Being carried

 M11-M8 → M15-M12

 M7-M4 → M11-M8

 M3-M0 → M7-M4

 M103-M100 → M3-M0

F ou r bi ts a s a g r ou p ar e sh if te d t o th e le ft
X0.3
M X0.22 M1
103 M10 X0.1 X0.0
01 M 100

_6 5
B e in g ca r ri ed M15 M14 M13 M12 M11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0

1 2 3 4

6-358
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 2

1. When M50 switches from OFF to ON, the instruction divides the states of the sixteen bit devices starting from M0 to

M15 into groups (five bits in a group), and shifts these groups to the left.

2. The shift of the states of the bit devices to the left during a scan is shown below.

 M15 → Being carried

 M10 → M15

 M9-M5 → M14-M10

 M4-M0 → M9-M5

 M104-M100 → M4-M0

6_
F ive b its a s a g ro up a r e sh i fte d to t h e le ft.
M
X 10
0.44 M1
X 0.3
03 M10 X 10
X 0. 22 M 0. 11 M10
X 0. 00
5
B e in g ca r ri ed M1 5 M1 4 M13 M12 M1 1 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0

1 2 3 4

Additional remarks

1. If S+n2-1 or D+n1-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0
is 16#2003.

2. If n1 is not between 1–1024, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. If n2 is not between 1–n1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-359
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the data in word devices to the
1102 D WSFR P S, D, n1, n2
right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      
D    
n1      
n2      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n1    
n2    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3-

Symbol
First device where the value is shifted
S : from

First device where the value is shifted


D : to

_6 n1 : Length of the data to be shifted

n2 : Number of bits in a group

Explanation

1. This instruction divides the data in the n1 word devices starting from D into groups (n2 words in a group), and shifts

these groups to the right. This instruction then shifts the data in the n2 word devices starting from S to the devices

starting from D to fill the vacancy.

2. In general, the WSFRP pulse instruction is used.

3. The operand n1 must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. The 32-bit

instruction needs to be used with ISPSoft V3.09.07 or later version.

4. The operand n2 must be between 1–n1.

6-360
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

1. When M0 switches from OFF to ON, the instruction divides the data in the sixteen word devices starting from D20 to

D35 into groups (four words in a group), and shifts these groups to the right.

2. When M0 switches from OFF to ON during a scan, the data in the word devices shift to the right as shown below.

 D23-D20 → Being carried

 D27-D24 → D23-D20

 D31-D28 → D27-D24

 D35-D32 → D31-D28

 D13-D10 → D35-D32

6_
Four registers as a group are shifted to the r ight.
D1 3 D12 D11 D1 0

5
D35 D3 4 D33 D3 2 D31 D30 D2 9 D2 8 D27 D2 6 D25 D24 D23 D2 2 D21 D2 0 Being carried

4 3 2 1

6-361
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. When M0 switches from OFF to ON, the instruction divides the data in the sixteen word devices starting from D20 to

D35 into groups (five words in a group), and shifts these groups to the right.

2. When M0 switches from OFF to ON during a scan, the shift of the data in the word devices to the right is shown
below.

 D20 → Being carried

 D25 → D20

 D30-D26 → D25-D21

 D35-D31 → D30-D26

 D14-D10 → D35-D31

_6
Five registers as a gr oup ar e shifter to the r ight.
D14 D13 D12 D11 D1 0

5
D3 5 D34 D3 3 D32 D31 D3 0 D2 9 D28 D2 7 D26 D25 D24 D23 D2 2 D21 D2 0 Being carried

4 3 2 1

6-362
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 3

1. When M0 switches from OFF to ON, the instruction divides the data in the eight 32-bit devices starting from D20 to

D35 into groups (two 32-bit devices in a group), and shifts these groups to the right.

2. When M0 switches from OFF to ON during a scan, the shift of the data in the 32-bit devices to the right is shown
below.

D23~D20 → Being carried


D27~D24 → D23~D20

D31~D28 → D27~D24

D35~D32 → D31~D28
D13~D10 → D35~D32

E
D12 D10 Data in two 32-bit registers as a group shift to the right

6_
A B C D
D34 D32 D30 D28 D 26 D24 D22 D20 Being carried

Additional remarks

1. If S+n2-1 or D+n1-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0

is 16#2003.

2. n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. Otherwise, the instruction is

not executed, SM0 is ON, and error code in SR0 is 16#200B.

3. If n2 < 1 or n2 > n1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-363
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1103 D WSFL P S, D, n1, n2 Shifting the data in word devices to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n1      
n2      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n1    
n2    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol
First device in which the value is
S :
shifted
First device in which the value is
D :
shifted
n1 : Length of the data to be shifted

_6

n2 : Number of bits in a group

Explanation

1. This instruction divides the data in the n1 word devices starting from D into groups (n2 words in a group), and shifts
these groups to the left. This instruction then shifts the data in the n2 word devices starting from S to the devices

starting from D to fill the vacancy.

2. In general, the WSFLP pulse instruction is used.

3. The operand n1 must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. The 32-bit

instruction needs to be used with ISPSoft V3.09.07 or later version.

4. The operand n2 must be between 1–n1.

6-364
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

1. When M0 switches from OFF to ON, the instruction divides the data in the sixteen word devices starting from D20 to

D35 into groups (four words in a group), and shifts these groups to the left.

2. When M0 switches from OFF to ON during a scan, the shift of the data in the word devices to the left is shown

below.

 D35-D32 → Being carried

 D31-D28 → D35-D32

 D27-D24 → D31-D28

 D23-D20 → D27-D24

 D13-D10 → D23-D20

6_
Four registers as a group are shifted to the left.
D1 3 D1 2 D11 D1 0

5
Being carried D35 D3 4 D33 D3 2 D31 D30 D2 9 D2 8 D27 D2 6 D25 D2 4 D23 D22 D21 D20

1 2 3 4

6-365
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. When M0 switches from OFF to ON, the instruction divides the data in the sixteen word devices starting from D20 to

D35 into groups (five words in a group), and shifts these groups to the left.

2. The shift of the data in the word devices to the left during a scan is shown below.

 D35 → Being carried

 D30 → D35

 D29-D25 → D34-D30

 D24-D20 → D29-D25

 D14-D10 → D24-D20

Five r egisters a s a group are shifted to the l eft.


_6 D1 4 D1 3 D1 2 D11 D1 0

5
Being car ried D3 5 D34 D33 D3 2 D3 1 D30 D29 D28 D2 7 D2 6 D25 D2 4 D2 3 D22 D21 D2 0

1 2 3 4

Additional remarks

1. If S+n2-1 or D+n1-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0
is 16#2003.

2. n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. Otherwise, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. If n2 is not between 1–n1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-366
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Shifting the data and writing it into a word
1104 D SFWR P S, D, n
device

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S        
D   
n DWORD        

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Device where the data is shifted

D : First device

n : Data length

6_

Explanation

1. This instruction defines the data in the n word devices starting from the device specified by D as a first in-first out list

type, and takes the device specified by D as a pointer. This instruction increments the value of the pointer by one,

and writes the data in the device specified by S into the device specified by the pointer. When the value of the

pointer is larger than or equal to n-1, the instruction stops writing data, and sets the carry flag SM602 is ON.

2. In general, the SFWRP pulse instruction is used.

3. The instruction is often used for the PUSH operation of the Stack. Please refer to the SFRD and SFPO instructions if

you need the POP operation.

4. The operand n must be between 2~512 for the 16-bit instruction and 2~256 for the 32-bit instruction. The 32-bit
instruction needs to be used with ISPSoft V3.09.07 or later version.

6-367
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. The instruction clears the value of the pointer D0 to 0 first. When M0 switches from OFF to ON, the instruction writes

the data in D20 into D1, and increments the value in D0 to 1. When M0 switches from OFF to ON again, the

instruction writes the data in D20 to D2, and increments the value in D0 to 2.

2. The instruction shifts and writes the data in the word device as shown below.

 The data in D20 is written into D1.

 The value in D0 becomes 1.

n=10
Source
_6 D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Pointer
D0=3 2 1

6-368
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 2

1. The instruction clears the value of the pointer D0/D1 to 0 first. When M0 switches from OFF to ON, the data in

D20/D21 is written to D2/D3 and the value of the pointer D0/D1 becomes 1. When M0 switches from OFF to ON

again after the data in D20/D21 is changed, the data in D20/D21 is written to D4/D5 and the value of D0/D1

becomes 2.

2. The instruction shifts and writes the data in the device as shown below.

 The data in D20/D21 is written to D2/D3.

 The value of D0/D1 becomes 1.

6_
n=5

Source Pointer
D20 D8 D6 D4 D2 D0

D0=3 2 1

Additional remarks

1. If the value in D is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If D+n-1 exceeds the device range, the instruction is not executed. SM0 is ON, and the error code in SR0 is

16#2003.

3. n must be between 2~512 for the 16-bit instruction and 2~256 for the 32-bit instruction. Otherwise, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. You can use the SFWR instruction with the SFRD (API 1105) instruction to write and read the data.

6-369
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the data and reading it from a word
1105 D SFRD P S, D, n
device

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device

D : Device where the data is shifted

n : Data length

_6

Explanation

1. This instruction defines the data in the n word devices starting from the device specified by S as a first in-first out list

type, and takes the device specified by S as a pointer. This instruction decrements the value in the device specified

by S by one, writes the data in the device specified by S+1 into the device specified by D, shifts the data in the

devices specified by S+n-1–S+2 to the right, and leaves the data in the device specified by S+n-1 unchanged.

When the value in the device specified by S is equal to 0, the instruction stops reading the data, and sets the zero

flag SM600 is ON.

2. In general, the SFRDP pulse instruction is used.

3. The operand n must be between 2~512 for the 16-bit instruction and 2~256 for the 32-bit instruction. The 32-bit

instruction needs to be used with ISPSoft V3.09.07 or later version.

6-370
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

1. When the value in D20 is set to 10 and M0 switches from OFF to ON, the instruction writes the data in D21 into D0,

shifts the data in D29–D22 to the right, leaves the data in D29 unchanged, and decrements the value in D20 by one.

2. The data in the word device is shifted and read as shown below.

 The data in D21 is read and shifted to D0.

 The data in D29-D22 is shifted to the right.

 The value in D20 decreases by one.

n=10

D0 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20
Pointer

The data i s read.

6_

6-371
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. When the value in D20/D21 is set to 5 and M0 switches from OFF to ON, the instruction writes the data in D22/D23

into D0/D1, shifts the 32-bit data in D29–D22 to the right, leaves the data in D28/D29 unchanged, and decrements

the value in D20/D21 by one.

2. The 32-bit data in the device is shifted and read as shown below.

 The data in D22/23 is read and shifted to D0/D1.

 The 32-bit data in D29-D22 is shifted to the right.

 The value in D20 decreases by one.

n=5

_6 Pointer
D0 D 28 D26 D24 D22 D20

The data is read.

Additional remarks

1. If the value in S is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

3. n must be between 2~512 for the 16-bit instruction and 2~256 for the 32-bit instruction. Otherwise, the instruction is
not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. You can use the SFWR instruction with the SFRD instruction (API 1105) to write and read the data.

6-372
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1106 D SFPO P S, D Reading the latest data from a data list

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device

D : Destination device where the data is stored

Explanation 6_

1. This instruction takes the device specified by S as a pointer. This instruction writes the data in the device specified

by the value of the pointer into the device specified by D and clears it to 0, and decrements the value in the device

specified by S by one. When the value in the device specified by S is equal to 0, the instruction stops reading the

data, and sets the zero flag SM600 is ON.

2. In general, the SFPOP pulse instruction is used.

3. The instruction is often used for the POP operation of the Stack.

4. The 32-bit instruction needs to be used with ISPSoft V3.09.07 or later version.

6-373
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When the value in D0 is set to 7 and M0 is ON, the instruction writes the data in the device specified by D0 into D10. After

the instruction shifts the data, the instruction clears the data in the device specified by D0 to 0, and decrements the value

in D0 by 1.

D S
D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
1000 7
Pointer
The data is read.

D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
1000 0 6
Pointer

Example 2

When the value in D0/D1 is set to 4 and M0 switches to ON, the instruction writes the data in the device specified by

D0/D1 into D10/D11. After the instruction shifts the data, the instruction clears the data in the device specified by D0/D1 to
_6 0, and decrements the value in D0/D1 by 1.

D10/D11 D8/D9 D6/D7 D4/D5 D2/D3 D0/D1


1000 4
Pointer

D10/D11 D8/D9 D6/D7 D4/D5 D2/D3 D0/D1


1000 0 3
Pointer

Additional remarks

1. If the value in S is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If S+(the value in S) exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#2003.

6-374
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1107 D SFDEL P S, D, n Deleting data from a data list

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D     
n DWORD        

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device

D : Device where the data is stored

n : Device where the data is deleted

6_

Explanation

1. For this instruction, the length of the data is the value in the device specified by S, and the data itself is in the

devices specified by S+1–S+(the value in S). This instruction stores the data in the device specified by S+n in D and

deletes it, shifts the data in the devices specified by S+n+1–S+(The value in S) to the right, clears the data in the

device specified by S+(the value in S) to 0, and decrements the value in the device specified by S by one. When the

value in the device specified by S is equal to 0, the instruction stops deleting the data, and sets the zero flag SM600

is ON.

2. In general, the SFDELP pulse instruction is used.

3. The operand n must be between 1~32767 for the 16-bit instruction and 1~16383 for the 32-bit instruction.

4. The 32-bit instruction needs to be used with ISPSoft V3.09.07 or later version.

6-375
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

Suppose the value in D0 is 9, and n is 4. When M0 is ON, the instruction stores the data in D4 in D20. After the instruction

deletes the data in D4, it shifts the data in D5–D9 to the right, and decrements the value in D0 by one.

S
D n=4
D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
4712 857 123 100 111 22 48 5 799 9
The length of the data
The data is deleted.

D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
22 0 4712 857 123 100 111 48 5 799 8
The length of the data

Example 2
_6
Suppose the value in D0/D1 is 4, and n is 3. When M0 is ON, the instruction stores the data in D6/D7 in D20, deletes the

data in D6/D7 and shifts the data in D8/D9 to the right, and decrements the value in D0/D1 by one.

n=3
D20/D21 D8/D9 D6/D7 D4/D5 D2/D3 D0/D1
20000 50000 45000 40000 4
The length of the data

D20/D21 D8/D9 D6/D7 D4/D5 D2/D3 D0/D1


50000 0 20000 45000 40000 3
The length of the data

6-376
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. If the value in S is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If S+n exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. If S+(the value in S) exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

4. If n is not between 0–S, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-377
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1108 D SFINS P S, D, n Inserting data into a data list

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D        
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device

D : Data to be inserted

n : Device where the data is inserted


_6

Explanation

1. For this instruction, the length of the data is the value in the device specified by S, and the data itself is in the

devices specified by S+1–S+(the value in S). This instruction inserts the data in D into S+n, shifts the original data in
the devices specified by S+n–S+(the value in S) to the left, and increments the value in the device specified by S by

one. When the value in the device specified by S is equal to 32767, the instruction stops writing the data, stops

incrementing the value in the device specified by S, and sets the carry flag SM602 is ON.

2. In general, the SFINSP pulse instruction is used.

3. The operand n must be between 1~32767 for the 16-bit instruction and 1~16383 for the 32-bit instruction.

4. The 32-bit instruction needs to be used with ISPSoft V3.09.07 or later version.

6-378
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

Suppose the value in D0 is 8, and n is 4. When M0 is ON, the instruction inserts the data in D200 into D4, shifts the

original data in D4–D8 to D5–D9, and increments the value in D0 by one.

D n=4 S
D200 D8 D7 D6 D5 D4 D3 D2 D1 D0
22 4712 857 123 100 111 48 5 799 8
The length of the data
The data is inserted.

D200 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
22 4712 857 123 100 111 22 48 5 799 9
The length of the data

Example 2

Suppose the value in D0/D1 is 4, and n is 3. When M0 is ON, the instruction inserts the data in D200/D201 into D6/D7,

shifts the original data in D6~D9 to D8~D11, and increments the value in D0/D1 by one.
6_

n=3
D8/D9 D6/D7 D 4/D5 D2/D3 D0/D1
22000 20000 50000 45000 40000 4
The length of the data

D200/D201 D 10/D11 D8/D9 D6/D7 D 4/D5 D2/D3 D0/D1


22000 20000 50000 22000 45000 40000 5
The length of the data

6-379
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the value in S is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If S+n exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003

3. If S+(the value in S)+1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

4. If n is not between 0–S, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

_6

6-380
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1109 MBS P S, D, n Shifting matrix bits

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n DWORD       

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

D : Operation result

n : Length of the array

Explanation

1. This instruction shifts the values of the n rows of bits in S to the right or to the left. When SM616 is OFF, the 6_
instruction shifts the values of the bits to the left. When SM616 is ON, the instruction shifts the values of the bits to

the right. The instruction fills the vacancy (b0 when shifting to the left, and b16n-1 when shifting to the right) resulting
from the shift with the state of the borrow flag SM615.The instruction transmits the value of the bit shifted last (from

shifting to the left is b16n-1 and from shifting to the right is b0) to the carry flag SM614, and stores the operation

result in D.

2. The operand n must be between 1–256.

3. In general, the MBSP pulse instruction is used.

6-381
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When M0 is ON, SM616 is OFF. The instructions shifts the values of the bits to the left. Suppose SM615 is OFF. After the

instruction shifts the values of the bits in the 16-bit registers D0–D2 to the left, it stores the operation result in the 16-bit

registers D20–D22, and SM614 is ON.

b 15 b0 Borrow flag
D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0
Carry flag 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

After the shift

b 15 b0
Borrow flag
D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0
Carry fl ag D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1 D22 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
_6

Example 2

When M0 is ON, SM616 is ON. The instruction shifts the values of the bits to the right. Suppose SM615 is ON. After the

instruction shifts the values of the bits in the 16-bit registers D0–D2 to the right, it stores the operation result in the 16-bit

registers D20–D22, and SM614 is OFF.

6-382
C ha pt er 6 A p pl i e d In s tr uc t io ns

b15 b0 Carry flag


D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Borrow flag 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

After the shift

b 15 b0 Carry fl ag
D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Borrow flag D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1 D22 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Additional remarks

1. If S+n-1 or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0

is 16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. Instruction flags

SM614: Carry flag for the matrix rotation/shift/output.

SM615: Borrow flag for the matrix shift/output.

SM616: Direction flag for the matrix rotation/shift.


6_

6-383
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the values of the bits in registers by
1110 D SFR P D, n
n bits to the right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device for the shift

n : Number of bits

Explanation

1. This instruction shifts the values of the bits in D by n bits to the right. The 16-bit instruction fills the vacancies
(b15–b15-n+1) resulting from the shift with 0 and the 32-bit instruction fills the vacancies (b31–b31-n+1) resulting from the
shift with 0. The value of bn-1 is transmitted to SM602.
_6
2. The operand n must be between 1–16 for 16-bit instructions and the operand n must be between 1–32 for 32-bit

instructions.

3. In general, the SFRP/DSFRP pulse instruction is used more commonly.

4. Only the DSFR/DSFRP instruction (32-bit instructions) can use the 32-bit counter (high counter) but not the device

E.

Example

When M0 is ON, the instruction shifts the values of b0–b15 in D0 by 6 bits to the right, and transmits the value of b5 to

SM602. The instruction clears the values of b10–b15 to zero after the shift.

The shift of the values of the bits to the right during a scan is shown below.

 b5-b0 → Being carried (The value of b5 is transmitted to SM602.)

 b15-b6 → b9-b0

0 → b15-b10

6-384
C ha pt er 6 A p pl i e d In s tr uc t io ns

b 15 ※ b0 Car ry flag
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

After the shift

b1 5 b0 Car ry flag
0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0

Being filled by 0

Additional remarks

If n is not between 0–16 (for 16-bit instructions) or between 0-32 (for 32-bit instructions), the instruction is not executed,

SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-385
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the values of the bits in registers by
1111 D SFL P D, n
n bits to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : Device for the shift

n : Number of bits

Explanation

1. This instruction shifts the values of the bits in D by n bits to the left. The instructions fill the vacancies (b0–bn-1)
resulting from the shift with 0 and transmit the value of b16-n (for 16-bit instruction) or b32-n (for 32-bit instruction) to

SM602.
_6
2. The operand n must be between 1–16 for 16-bit instructions and the operand n must be between 1–32 for 32-bit

instructions.

3. In general, the SFRP/DSFRP pulse instruction is used more commonly.

4. Only the DSFR/DSFRP instruction (32-bit instructions) can use the 32-bit counter (high counter) but not the device

E.

Example

When M0 is ON, the instruction shifts the values of b0–b15 in D0 by 6 bits to the right, and transmits the value of b10 to

SM602. The instruction fills the values of b0–b5 with zeros after the shift.

The shift of the values of the bits to the left during a scan shown below.

 b15-b10 → Being carried (The value of b10 is transmitted to SM602.

 b9-b0 → b15-b6

0 → b5-b0

6-386
C ha pt er 6 A p pl i e d In s tr uc t io ns

b 15 ※ b0
Carry flag
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

After the shift

Carr y flag
b1 5 b0
1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1

Being filled by 0

Additional remarks

If n<=0 or n>16 (for 16-bit instructions) or n>32 (for 32-bit instructions), the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#200B.

6_

6-387
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the states of n bit devices by one bit to the
1112 BSFR P D, n
right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D 
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : First device for the shift

n : Data length

Explanation

1. This instruction shifts the states of the n bit devices starting from D by one bit to the right. The instruction clears

_6 state of D+n-1 to 0, and transmits the state of D to the carry flag SM602.

2. In general, the BSFRP pulse instruction is used.

3. The operand n must be between 1–1024.

Example

When M50 is ON, the instruction shifts the states of M0–M5 by one bit to the right, clears the state of M5 to zero, and

transmits the state of M0 to the carry flag SM602.

6-388
C ha pt er 6 A p pl i e d In s tr uc t io ns

M5 M4 M3 M2 M1 M0 Carry fl ag
0 0 0 1 0 1
After the shift

M5 M4 M3 M2 M1 M0 Carry flag
0 0 0 0 1 0 1

Being cleared to 0

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n not between 1–1024, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-389
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Shifting the states of n bit devices by one bit
1113 BSFL P D, n
to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D    
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D 
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : First device for the shift

n : Data length

Explanation

1. This instruction shifts the states of the n bit devices starting from D by one bit to the left. The instruction clears the
_6 state of D to 0, and transmits the state of D+n-1 to the carry flag SM602.

2. In general, the BSFLP pulse instruction is used.

3. The operand n must be between 1–1024.

Example

When M50 is ON, the instruction shifts the states of M0–M5 by one bit to the left, clears the state of M0 to 0, and transmits

the state of M5 to the carry flag SM602.

6-390
C ha pt er 6 A p pl i e d In s tr uc t io ns

M5 M4 M3 M2 M1 M0 Carr y flag
0 0 0 1 0 1

After the shift

M5 M4 M3 M2 M1 M0 Carr y flag
0 0 1 0 1 0 0

Being cleared to 0

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n not between 1–1024, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-391
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1114 D NSFR P D, n Shifting n registers to the right

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : First device for the shift

n : Data length

Explanation
_6
1. This instruction shifts the data in the n registers starting from D to the right, and clears the data in D+n-1 to 0.

2. In general, the NSFRP pulse instruction is used.

3. The operand n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. The 32-bit
instruction needs to be used with ISPSoft V3.09.07 or later version.

6-392
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

When M0 switches from OFF to ON, the instruction shifts the data in D1–D6 by one device to the right, and clears the data

in D6 to 0.

D6 D5 D4 D3 D2 D1 D0
30 2235 9578 754 28 423 11
After the shift

D6 D5 D4 D3 D2 D1 D0
0 30 2235 9578 754 28 423

Being cleared to 0

Example 2

When M0 switches from OFF to ON, the instruction shifts seven 32-bit data in D0~D13 by one 32-bit device to the right,

and clears the data in D12 to 0.

6_

D12 D10 D8 D6 D4 D2 D0
90000 80000 70000 60000 50000 30000 40000

After the shift

D12 D10 D8 D6 D4 D2 D0
0 90000 80000 70000 60000 50000 30000

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. Otherwise, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-393
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1115 D NSFL P D, n Shifting n registers to the left

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D    
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

D : First device for the shift

n : Data length

_6 Explanation

1. This instruction shifts the data in the n registers starting from D to the left, and clears the data in D to 0.

2. In general, the NSFLP pulse instruction is used.

3. The operand n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. The 32-bit
instruction needs to be used with ISPSoft V3.09.07 or later version.

6-394
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

When M0 switches from OFF to ON, the instruction shifts the data in D0–D5 to the left, and clears the data in D0 to 0.

D6 D5 D4 D3 D2 D1 D0
30 2235 9578 754 28 423 11
After the shift

D6 D5 D4 D3 D2 D1 D0
2235 9578 754 28 423 11 0

Being cleared to 0

Additional remarks

1. If D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. n must be between 1~512 for the 16-bit instruction and 1~256 for the 32-bit instruction. Otherwise, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#200B.
6_

6-395
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.13 Data Processing Instructions


6.13.1 List of Data Processing Instructions
The following table lists the Data Processing instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1200 SER DSER  Searching the data

1201 SUM DSUM  Finding the number of bits whose states are ON

1202 DECO –  Decoding bits

1203 ENCO –  Encoding bits

1204 SEGD –  Seven-segment decoding

1205 SORT DSORT  Sorting data

1206 ZRST –  Resetting a zone

1207 BON DBON  Checking the state of a bit

1208 MEAN DMEAN  Finding the mean

1209 CCD –  Finding the sum check

1210 ABS DABS  Finding the absolute value

1211 MINV –  Inverting matrix bits


_6
1212 MBRD –  Reading a matrix bit

1213 MBWR –  Writing a matrix bit

1214 MBC –  Counting the bits with the value zero or one

1215 DIS –  Disuniting 16-bit data

1216 UNI –  Uniting 16-bit data

1217 WSUM DWSUM  Finding the sum

1221 LIMIT DLIMIT  Confining a value within bounds

1222 BAND DBAND  Deadband control

1223 ZONE DZONE  Controlling the zone

1224 – FMEAN  Finding the mean of floating point numbers

1225 – FSUM  Finding the sum of floating point numbers

1226 DTM –  Data conversion and move

1228 ZSET –  Zone setup

6-396
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Instruction code Pulse


API Function
16-bit 32-bit instruction

1229 – FSORT  Sorting data in floating-point format

6_

6-397
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.13.2 Explanation of Data Processing Instructions

API Instruction code Operand Function

1200 D SER P S1, S2, D, n Searching the data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2         
D    
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : First device for the comparison

S2 : Compared data
_6
D : First device where the comparison result is stored

n : Data length

Explanation

1. This instruction compares n signed decimal values in the registers starting from the register specified by S1 with the

signed decimal value in the register specified by S2, and stores the comparison results in the registers D–D+4.

Device Description

D Number of equal values

D+1 Data number of the first equal value

D+2 Data number of the last equal value

D+3 Data number of the minimum value

D+4 Data number of the maximum value

6-398
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. The operand n must be between 1–256.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

1. When M0 is ON, the instruction compares the values in D10–D19 with the value in D0, and stores the comparison

results in D50–D54. When the equal value does not exist in D10–D19, the values in D50–D52 are 0.

2. The instruction stores the data number of the minimum value in D53, and stores the data number of the maximum

value in D54. If there is more than one minimum value or maximum value, the instruction stores the data number

that is bigger.

Compared Data
S1 Value Result D Value Description
data number

D10 88 0 D50 4 Number of equal values 6_


Data number of the first
D11 100 1 Equal D51 1
equal value

Data number of the last


D12 110 2 D52 8
equal value

Data number of the


D13 150 3 D53 7
minimum value
n S2

D0=100 Data number of the


D14 100 4 Equal D54 9
maximum value

D15 300 5

D16 100 6 Equal

D17 5 7 Minimum

D18 100 8 Equal

D19 500 9 Maximum

6-399
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If S1+n-1 or D+4 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. For 16-bit instructions, if the value in n is not between 1–256, the instruction is not executed, SM0 is ON, and the
error code in SR0 is 16#200B.

3. For 32-bit instructions, if the value in n is not between 1–128, the instruction is not executed, SM0 is ON, and the
error code in SR0 is 16#200B.

4. For 16-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [5] of

WORD/INT.

5. For 32-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [5] of

DWORD/DINT.

_6

6-400
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Finding the number of bits whose states
1201 D SUM P S, D
are ON

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Destination device

Explanation

1. This instruction finds the number of bits in S whose values are ON and stores the number of ON bits in D.
6_

2. When the values of all the bits in the source device specified by S are 0, the zero flag SM600 is ON.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

When M0 is ON, the instruction stores the number of bits whose values are one in D0 in D2.

b15 b0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 3
D0 D2

Additional remarks

If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-401
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1202 DECO P S, D, n Decoding bits

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S           
D       
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S   
D   
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source device

D : Device where the decoded values are stored

n : Number of bits whose values are decoded

_6
Explanation

1. This instruction decodes the values of the lower n bits in the source device specified by S as the values of the lower

2n bits in D.

2. The instruction decodes the values of the consecutive n bits in the source device specified by S as the values of the

lower 2n bits in D.

3. When the source device specified by S is a timer or counter, the instruction treats the device as a word device.

4. When D is a bit device, n between1–8. When n is 8, the instruction decodes the values of the eight bits as the
values of the 256 bits. Please note that the devices in which the decoded values are stored cannot be used

repeatedly.

5. When D is a word device, n between 1–4. When n is 4, the instruction decodes the values of the four bits as the
values of the 16 bits.

6. In general, the DECOP pulse instruction is used.

6-402
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

1. When M0 switches from OFF to ON, the DECO instruction decodes the values of the 3 bits in M10–M12 as the

values of the 8 bits in M100–M107.

2. The instruction adds the values of the 3 bits in M10–M12 to get the value 3. The instruction sets the third bit in
M10–M1007, that is, the bit in M103 to 1.

3. After the DECO instruction is executed and M0 switches to OFF, the values of the eight bits in M100–M107 are
unchanged.

X0.2 X0.1
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

6_

Example 2

1. When M0 switches from OFF to ON, the DECO instruction decodes the values of b2–b0 in D10 as the values of

b7–b0 in D20, and sets the values of b15–b8 in D10 to 0.

2. The instruction decodes the values of the lower three bits in D10 as the values of the lower eight bits in D20. The
instruction sets the values of the higher eight bits to 0.

3. After the DECO instruction is executed and M0 switches to OFF, the data in D20 is unchanged.

6-403
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 D10 b0
0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1
4 2 1
T he values of b15~b8
in D10 bec ome 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 D20 b0

Additional remarks

1. If D is a bit device and if n not between 1–8, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

2. If D is a word device and if n is not between 1–4, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#200B.

3. If S is a bit device and if S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#2003.

4. If D is a bit device and if D+(2^n)-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

_6

6-404
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1203 ENCO P S, D, n Encoding bits

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S           
D     
n DWORD        

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source device

D : Device where the encoded values are stored

n : Number of bits whose values are encoded

Explanation 6_
1. When S is a word device, this instruction encodes the values of the lower 2n bits in the source device specified by S
as the values of the lower n bits in D.

2. When S is a bit device, the instruction processes the higher bit with the value S+(n-1) from the lower 2n bits and

stores the result in D.

3. When the source device specified by S is a timer or counter, the instruction treats the device as a word device.

4. When S is a bit device, n is between 1–8. When n is 8, the instruction encodes the values of the 256 bits as the
values of the eight bits.

5. When S is a word device, n is between 1–4. When n is 4, the instruction encodes the values of the 16 bits as the
values of the four bits.

6. In general, the ENCOP pulse instruction is used.

6-405
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. When M50 switches from OFF to ON, the ENCO instruction encodes the values of the 8 bits in M0–M7 as the

values of the lower 3 bits in D0, and sets the values of b15–b3 in D0 to 0.

2. After the ENCO instruction is executed and M50 switches to OFF, the data in D is unchanged.

M7 M6 M5 M4 M3 M2 M1 M0
0 0 0 0 1 0 0 0
7 6 5 4 3 2 1 0

b15 D0 4 2 1

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
The values of b15~b3 in D0 become 0.

Example 2

1. When M0 switches from OFF to ON, the ENCO instruction encodes the values of b0–b7 in D10 as the values of
_6
b2–b0 in D20, and sets the values of b15–b3 in D20 to zero. The values of b8–b18 in D10 are invalid data.

2. After the ENCO instruction is executed and M0 switches OFF, the data in D is unchanged.

b15 D10 b0
0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0
7 6 5 4 3 2 1 0
T he values of b8~b18 in D10 ar e invalid data.

b15 D20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
The values of b15~b3 in D20 become 0.

6-406
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

1. If there is no bit whose value is one in the source device specified by S, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

2. If S is a bit device and if n is not between 1–8, the instruction is not executed, SM0 is ON, and the error code in SR0
is 16#200B.

3. If S is a word device and if n is not between 1–4, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#200B.

4. If S is a bit device and if S+(2^n)-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

5. If D is a bit device and if D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#2003.

6_

6-407
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1204 SEGD P S, D Seven-segment decoding

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source device

D : Device where the seven-segment data is stored

Explanation

The instruction decodes the values of the lower four bits (b0–b3) in the source device specified by S as the

_6 seven-segment data stored in D.

Example

When M0 is ON, the instruction decodes the values of b0–b3 in D0 as the seven-segment data and store it in D100. After

that move the data to Y0–Y3. If the data in the source device exceeds four bits, the instruction decodes the values of the

lower four bits.

6-408
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The following table shows the relation between the seven-segment data and the bit pattern of source data.

Segment state
Bit Assignment
Hex Display
pattern of segments B0(a) B1(b) B2(c) B3(d) B4(e) B5(f) B6(g)

0 0000 ON ON ON ON ON ON OFF

1 0001 OFF ON ON OF F OFF OF F OFF


2 0010 ON ON OFF ON ON OFF ON

3 0011 ON ON ON ON OFF OFF ON


4 0100 OFF ON ON OFF OFF ON ON

5 0101 ON OFF ON ON OFF ON ON

6 0110 a ON OFF ON ON ON ON ON

7 0111 f g b ON ON ON OF F OFF ON OF F

8 1000 e 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

B 1011 OFF OFF ON ON ON ON ON

C 1100 ON OFF OFF ON ON ON OFF

D 1101 OF F ON ON ON ON OFF ON

E 1110 ON OFF OFF ON ON ON ON

F 1111 ON OFF OFF OFF ON ON ON

6_

6-409
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1205 D SORT P S, m1, m2, D, n Sorting data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
m1   
m2   
D 
n   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
m1    
m2    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device where the original data is stored

m1 : Number of rows of data


_6
m2 : Number of columns of data

D : First device where the sorted data is stored

n : Reference value for sorting the data

Explanation

1. This instruction stores the data to be sorted in the m1×m2 registers starting from the register specified by D. If S and

D specify the same register, the sorted data is the same as the original data in the register specified by S.

2. The operand m1 must be between 1–32. The operand m2 must be between 1–6. The operand n must be between
1–m2.

3. When SM604 is OFF, the instruction sorts the data in ascending order. When SM604 is ON, the instruction sorts the

data in descending order.

4. It is suggested that you use the SORTP or DSORTP pulse type instruction instead of sorting repeatedly.

5. Only the 32-bit instruction can use the 32-bit counter, but not the device E.

6-410
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. Suppose SM604 is OFF. When M0 switches from OFF to ON, the instruction sorts the data in ascending order.

2. The data which to be sorted is as in the following table.

m2 columns of data

Column

Column 1 2 3 4 5

Student
Chinese English Math Physics
Row number

1 (D0) 1 (D5) 90 (D10) 75 (D15) 66 (D20) 79


6_
2 (D1) 2 (D6) 55 (D11) 65 (D16) 54 (D21) 63
m1 rows of data

3 (D2) 3 (D7) 80 (D12) 98 (D17) 89 (D22) 90

4 (D3) 4 (D8) 70 (D13) 60 (D18) 99 (D23) 50

5 (D4) 5 (D9) 95 (D14) 79 (D19) 75 (D24) 69

6 - 4 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. When the value in D100 is 3, the data is sorted as in the following table.

m2 columns of data

Column

Column 1 2 3 4 5

Student
Chinese English Math Physics
Row number

1 (D50) 4 (D55) 70 (D60) 60 (D65) 99 (D70) 50

2 (D51) 2 (D56) 55 (D61) 65 (D66) 54 (D71) 63


m1 rows of data

3 (D52) 1 (D57) 90 (D62) 75 (D67) 66 (D72) 79

4 (D53) 5 (D58) 95 (D63) 79 (D68) 75 (D73) 69

5 (D54) 3 (D59) 80 (D64) 98 (D69) 89 (D74) 90

4. When the value in D100 is 5, the data is as in the following table.

m2 columns of data
_6
Column

Column 1 2 3 4 5

Student
Chinese English Math Physics
Row number

1 (D50) 4 (D55) 70 (D60) 60 (D65) 99 (D70) 50

2 (D51) 2 (D56) 55 (D61) 65 (D66) 54 (D71) 63


m1 rows of data

3 (D52) 5 (D57) 95 (D62) 79 (D67) 75 (D72) 69

4 (D53) 1 (D58) 90 (D63) 75 (D68) 66 (D73) 79

5 (D54) 3 (D59) 80 (D64) 98 (D69) 89 (D74) 90

6-412
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

1. If the device exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If m1, m2, or n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-413
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1206 ZRST P D1, D2 Resetting a zone

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D1          
D2          
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

D1   
D2   

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D1 : First device to be reset

D2 : Last device to be reset

Explanation

1. This instruction clears the values in D1–D2. The device type for D1–D2 should be the same for this instruction.

_6 2. When the device number of D1 is larger than the device number of D2, the instruction resets only D2.

3. The ZRST instruction can use the 32-bit counter.

Example

1. When M0 is ON, the instruction resets the auxiliary relays M300–M399 to OFF.

2. When M1 is ON, the instruction resets the 16-bit counters C0–C127. The values of C0–C127 are cleared to zero,

and the contact and the coil are reset to OFF.

3. When M2 is ON, the instruction resets the stepping relays S0–S127 to OFF.

4. When M3 is ON, the instruction resets the output relays Y0–Y15 to OFF.

5. WhenM4 is ON, the instruction resets the 32-bit counters HC0–HC63. The values of HC0–HC63 are cleared to zero,

and the contact and the coil are reset to OFF.

6. When M5 is ON, the instruction resets the timers T0–T127. The values of T0–T127 are cleared to 0. and the contact

and the coil are reset to OFF.

6-414
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6_

Additional remarks

1. If D1 and D2 are different types of devices, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2007.

2. If D1 and D2 contain different data formats, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2007.

6-415
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1207 D BON P S, D, n Checking the state of a bit

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D     
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
D 
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source device

D : Device where the check result is stored

n : Bit whose state is checked

_6

Explanation

1. This instruction checks the state of the nth bit in S, and stores the result in D.

2. The operand n used in the 16-bit instruction must be between 0–15. For 32-bit instructions, n must be between

0–31.

3. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

1. When M0 is ON, if the value of the 15th bit in D0 is one, M11 is ON. M11 is OFF if the value of the 15th bit in D0 is 0.

2. When M0 switches to OFF, the state of M1 remains the same as before M0 switches to OFF.

6-416
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

b15 b0
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 Y0.1=OFF
D0
b15 b0
1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 Y0.1=ON
D0

Additional remarks

If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-417
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1208 D MEAN P S, D, n Finding the mean

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D      
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First device

D : Device where the mean is stored

n : Number of devices

_6

Explanation

1. This instruction adds up the values in the n devices starting from the device specified by S, and the stores the mean

of the sum in D.

2. If a remainder appears in the calculation, the instruction discards it.

3. For 16-bit instructions, n must be between 1–256.

4. For 32-bit instructions, n must be between 1–128.

5. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

6-418
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the instruction adds up the values in the three registers starting from D0. The instruction divides the sum

by 3. The instruction stores the quotient in D10, and leaves out the remainder.

(D0+D1+D2)/3 D10

D0 100
After the instruction
D1 113 D10 112
is executed

D2 125 The quotient 2 i s left out.

Additional remarks

1. For 16-bit instructions, if n not between 1–256, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#200B.
6_
2. For 32-bit instruction, if n is not between1–128, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#200B.

3. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

6-419
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1209 CCD P S, D, n Finding the sum check

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : First device

D : Device where the sum is stored

n : Number of pieces of data

_6 Explanation

1. Communication protocols use the sum check function to compare checksums on the same data on different
occasions or on different representations of the data to verify data integrity.

2. When SM606 is OFF, the instruction uses the 16-bit conversion mode. The instruction adds up n pieces of data in

the registers starting from the register specified by S (eight bits as a group). The instruction stores the sum in the

register specified by D, and stores the values of the parity bits in D+1.

3. When SM606 is ON, the instruction uses the 8-bit conversion mode. The instruction adds up the n pieces of data in

the registers starting from the register specified by S (eight bits in a group, and only low eight bits are valid). The

instruction stores the sum in the register specified by D, and stores the values of the parity bits in D+1.

4. The operand n must be between 1–256.

6-420
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

1. When SM606 is OFF, the instruction uses the 16-bit conversion mode.

2. When M0 is ON, the instruction adds up the six pieces of data in D0–D2 (eight bits in a group). The instruction

stores the sum in D100, and stores the values of the parity bits in D101.

S Data
D0 Low 100 = 0 1 1 0 0 1 0 0
D0 High 111 = 0 1 1 0 1 1 1 1
D1 Low 120 = 0 1 1 1 1 0 0 0
D1 High 202 = 1 1 0 0 1 0 1 0
D2 Low 123 = 0 1 1 1 1 0 1 1
6_
D2 High 211 = 1 1 0 1 0 0 1 1
D100 867 Sum
D101 0001000 1
The parity bit is set to 1 if the number of ones is odd.
The parity bit is set to 0 if the number of ones is even.

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 Par ity bits

6-421
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. When SM606 is ON, the instruction uses the 8-bit conversion mode.

2. When M0 is ON, the instruction adds up the six pieces of data in D0–D5 (eight bits in a group). The instruction

stores the sum in D100, and stores the values of the parity bits in D101.

S Data
D0 Low 100 = 0 1 1 0 0 1 0 0
D1 Low 111 = 0 1 1 0 1 1 1 1
D2 Low 120 = 0 1 1 1 1 0 0 0
D3 Low 202 = 1 1 0 0 1 0 1 0
D4 Low 123 = 0 1 1 1 1 0 1 1
D5 Low 211 = 1 1 0 1 0 0 1 1
D100 867
_6 D101 0001000 1
Sum

The parity bit is set to 1 if the number of ones i s odd.


The parity bit is set to 0 if the number of ones is even.

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 bits

Additional remarks

1. Suppose SM606 is ON. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. Suppose SM606 is OFF. If S+n/2-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

3. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

4. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6-422
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1210 D ABS P D Finding the absolute value

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D      

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol
Device holding the original
D :
value

Explanation

1. This instruction finds the absolute value of the value in the device specified by D.
6_
2. In general, the ABSP pulse instruction is used.

3. Only the 32-bit instructions can use the 32-bit counter HC, but not the device E.

4. When the instruction works with a minimum signed number (a minimum negative number), the result remains the

number. E.g. if the original value is the minimum 16-bit signed number, -32768, the result is still -32768 in the

instruction. Similarly, if the instruction works with the minimum 32-bit signed number (a minimum negative number),

the result remains the number.

Example

Suppose the value in D0 is originally -1234. When M0 switches from OFF to ON, the instruction finds the absolute value of

-1234 in D0. That is, the value in D0 becomes 1234 after the instruction is executed.

6-423
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1211 MINV P S, D, n Inverting matrix bits

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D   
n       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  
n  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

D : Operation result

n : Length of the array

Explanation

_6 1. This instruction inverts the bits in the n devices starting from the device specified by S, and stores the inversion

result in D.

2. The operand n must be between 1–256.

Example

When M0 is ON, the instruction inverts the bits in the three 16-bit registers D0–D2, and stores the inversion result in the

16-bit registers D20–D22.

6-424
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

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

After the instruction is executed


b15 b0
D20 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
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

Additional remarks

1. If S+n-1 or D+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0
is 16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6_

6-425
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1212 MBRD P S, n, D Reading a matrix bit

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

n : Length of the array

D : Pointer

_6 Explanation

1. This instruction checks the state of SM613. If SM613 is ON, the instruction clears the value of the pointer D to zero.

The instruction reads the value of the bit specified by the value of the pointer D into SM614, and then checks the

state of SM612. If SM612 is ON, the instruction increments the value of the pointer D by adding one.

2. When the instruction reads the value of the last bit, SM608 is ON, and the instruction stores the bit number in the

pointer D.

3. The operand n must be between 1–256.

4. You specify the value of the pointer. The values are between 0–16n−1, and correspond to the range between

b0–b16n−1. If the value of the pointer exceeds the range, SM611 is set to one, and the instruction is not executed.

6-426
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. Suppose SM613 is OFF and SM612 is ON when M0 switches from OFF to ON.

2. Suppose the current value in D20 is 45. When M0 is switched from OFF to ON three times, the instruction gives the

following execution results.

 The value in D20 is 46, SM614 is OFF, and SM608 is OFF.

 The value in D20 is 47, SM614 is ON, and SM608 is OFF.

 The value in D20 is 47, SM614 is OFF, and SM608 is ON.

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

45 Ptr
D20
6_
Additional remarks

1. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. Instruction flags:

SM608: The matrix comparison comes to an end. When the last bits are compared, SM608 is

ON.

SM611: Matrix pointer error flag. When the value of the pointer exceeds the comparison range,

SM611 is ON.

SM612: Matrix pointer increasing flag. The current value of the pointer increases by one.

SM613: Matrix pointer clearing flag. The current value of the pointer is cleared to zero.

SM614: Carry flag for the matrix rotation/shift/output.

6-427
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1213 MBWR P S, n, D Writing a matrix bit

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

n : Length of the array

D : Pointer

_6 Explanation

1. This instruction checks the state of SM613. If SM613 is ON, the instruction clears the value of the pointer D to 0.

The instruction writes the state of SM615 into the bit specified by the value of the pointer D and then checks the

state of SM612. If SM612 is ON, the instruction increments the value in the pointer D by one.

2. When the instruction writes the state of SM615 into the last bit, sets SM608 is ON, and records the bit number in the

pointer D. If value of the pointer D exceeds the range, SM611 is ON.

3. The operand n must be between 1–256.

4. You specify the value of the pointer. The values are between 0–16n−1, and correspond to the range between

b0–b16n−1. If the value of the pointer exceeds the range, SM611 is set to one, and the instruction is not executed.

6-428
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

1. Suppose SM613 is OFF and SM612 is ON when M0 switches from OFF to ON.

2. Suppose the current value in D20 is 45. When M0 switches from OFF to ON one time, the instruction gives the

execution result shown below. When the value in D20 is 45, SM615 is OFF, and SM608 is OFF.

b15 b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 SM 615
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

45 Ptr

Aft e r t h e in s t ru c t io n i s e xe c u te d D20

b15 b0
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 SM 615
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

46 Ptr
6_
D20

Additional remarks

1. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

3. Instruction flags:

SM608: The matrix comparison comes to an end. When the last bits are compared, SM608 is ON.

SM611: Matrix pointer error flag. When the value of the pointer exceeds the comparison range, SM611 is ON.

SM612: Matrix pointer increasing flag. The current value of the pointer increases by one.

SM613: Matrix pointer clearing flag. The current value of the pointer is cleared to zero.

SM615: Borrow flag for the matrix shift/output.

6-429
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Counting the bits with the value zero or
1214 MBC P S, n, D
one

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
n       
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Matrix source

n : Length of the array

D : Operation result

_6 Explanation

1. This instruction counts the bits with the value one or zero in the n devices starting from the device specified by S.

The instruction stores the operation result in D.

2. When SM617 is ON, the instruction counts the bits with the value one. When SM617 is OFF, the instruction counts

the bits with the value 0. When the operation result is 0, SM618 is ON.

3. The value in n must be between 1–256.

6-430
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

Suppose SM617 is ON. When M0 is ON, the instruction counts the bits with the value one, and stores the operation result

in D20. Suppose SM617 is OFF. When M0 is ON, the instruction counts the bits with the value zero, and stores the

operation result in D20.

b15 b0
D0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 12
D1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 SM 617 D20
D2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
1 36
SM 617 D20

Additional remarks

1. If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. 6_
3. Instruction flags:

SM617: The bits with the value zero or one are counted.

SM618: ON when the matrix counting result is 0.

6-431
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1215 DIS P S, n, D Disuniting 16-bit data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      
n        
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

n : Number of devices

D : Operation result

_6 Explanation

1. This instruction divides the 16-bit value in the register specified by S into four groups (four bits in a group), and

stores these groups in the low four bits in every register (the registers range from D to D+(n-1)).

b15 b 12b11 b 8 b7 b 4 b3 b0 b15 b 4 b3 b0


S D

D +1 n
D +2
D +3

All becomes 0. The positions i n whcih


the data is stored.

2. The value in n must be between 1–4.

6-432
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

Suppose the value in D0 is 16#1234. When M0 is enabled, the instruction divides the value in D0 into four groups (four

bits in a group), and stores these groups in the low four bits in every register (the registers range from D10 to D13.).

b15 b 12 b11 b 8 b7 b 4 b3 b0 b15 b 4 b3 b0


D0 1 2 3 4 4 D1 0
3 D11
4
2 D1 2
1 D13

All becomes 0. The positions in whcih


the data is stor ed.
6_
Additional remarks

1. If D–D+(n-1) exceed the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

2. If n is not between 1–4, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-433
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1216 UNI P S, n, D Uniting 16-bit data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
n        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

n : Data length

D : Operation result

_6
Explanation

1. This instruction divides the 16-bit values in the registers specified by S–S+(n-1) into groups (four bits in a group),

and stores every group that is in b0–b3 in the register specified by D (b0–b15).

b15 b 4 b3 b0
S
S+1
S +2
S +3 D
b15 b 12 b11 b 8 b7 b 4 b3 b0

Being ignor ed The data which


is stored

2. The value in n must be between 1–4.

6-434
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

Suppose the values in D0–D3 are 16#1234, 16#5678, 16#8765, and 16#4321 respectively. When M0 is enabled, the UNI

instruction divides the values in D0–D3 into groups (four bits in a group), and stores every group in b0–b3 in D10(b0–b15).

b15 b4 b3 b0
D0 1 2 3 4

D1 5 6 7 8
D2 8 7 6 5
D3 4 3 2 1 1 5 8 4 D1 0
b15 b12 b11 b8 b7 b4 b3 b0

6_

Additional remarks

1. If S to S+(n-1) exceed the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If n not between 1–4, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

6-435
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1217 D WSUM P S, n, D Getting the sum

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
n         
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S    
n    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Data source

n : Data length

D : Operation result

_6

Explanation

1. The instruction adds up the signed decimal values in S to S+n-1, and stores the sum in the register specified by D.

S
S +1
D +1 D
S +2
B in ar y val ue s n
S +3
S +4 B in ar y val ue
S +5

S S +1

S +3 S +2
D +1 D

S +5 S +4
B in ar y val ue s n D +3 D +2

S +7 S +6

B in ar y val ue
S +9 S +8

6-436
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. For 16-bit instructions, the value in n must be between 1–256.

3. For 32-bit instructions, the value in n must be between 1–128.

4. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

The WSUM instruction adds up the values in D0–D2, and stores the sum (32-bit) in D10.

(D0+D1+D2) D10

D0 100

After the instruction


D1 113 D10 338
is executed

D2 125

6_
Additional remarks

1. For 16-bit instructions, the value in n is not between 1–256, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200B.

2. For 32-bit instructions, the value in n is not between 1–128, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#200B.

3. If S+n-1 or D exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

4. For 16-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is DWORD or ARRAY [2]

of WORD.

5. For 32-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of

DWORD.

6-437
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1221 D LIMIT P S1, S2, S3, D Confining a value within bounds

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1    
S2    
S3    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Minimum output value


S2 : Maximum output value
_6 S3 : Input value
D : Output value

Explanation

1. The instruction compares the input value in S3 with the minimum output value in S1 and the maximum output value

in S2, and stores the comparison result in D.

If the input value in S3 is smaller than the minimum output value in S1, the instructions stores minimum

output value S1 in D.

If the input value in S3 is larger than the maximum output value in S2, the instruction stores the maximum

output value S2 in D.

If the input value in S3 is between the minimum output value S1 and the maximum output value S2, the

instruction stores the input value S3 in D.

If the minimum output value in S1 is larger than the maximum output value in S2, the instruction is not

executed.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

6-438
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

 When M0 is ON, the instruction compares the value in D0 with 500 and 5000, and stores the comparison result in

D1.

Minimum output Maximum output


Input value in D0 Function Output value in D1
value value

499 D0 < 500 500

500 5000 5001 D0 > 5000 5000

600 500 ≦ D0 ≦ 5000 600

Additional remarks

If the minimum output value in S1 is larger than the maximum output value in S2, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003. 6_

6-439
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1222 D BAND P S1, S2, S3, D Deadband control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
S3    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Minimum value of the deadband

_6 S2 : Maximum value of the deadband

S3 : Input value

D : Output value

Explanation

1. This instruction subtracts the minimum value of the deadband in S1 or the maximum value of the deadband in S2
from the input value in S3, and stores the difference in D.

If the input value in S3 is smaller than the minimum value of the deadband in S1, the instruction subtracts S1 from

S3, and stores the difference in D.

If the input value in S3 is greater than the maximum value of the deadband in S2, the instruction subtracts S2 from

S3, and stores the difference in D.

If the input value in S3 is between the minimum of the deadband in S1 and the maximum value of the deadband in

S2, the instruction stores zero in D.

6-440
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

If the minimum value of the deadband in S1 is larger than the maximum value of the deadband in S2, the instruction

is not executed.

2. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

3. The following graphs show how this instruction uses the deadband.

BAND is not executed. BAND is executed.

Output value Output value

T he lower limit value


of the deadband

Input value Input value

The upper limit value


of the deadband

4. The minimum value of the deadband in S1, the maximum value of the deadband in S2, the input value in S3, and the
output value in D must be within the range described below.

5. For the BAND instruction, the minimum value of the deadband in S1, the maximum value of the deadband in S2, the

input value in S3, and the output value in D must be between -32768 to 32767. Suppose the minimum value of the

deadband in S1 is 10 and the maximum value of the deadband in S3 is -32768. The instruction calculates the output 6_
value in D as follows.

Output value in D = -32768-10=16#8000-16#000A=16#7FF6=32758

6. For the DBAND instruction, the minimum value of the deadband in S1, the maximum value of the deadband in S2,

the input value in S3, and the output value in D must be between -2147483648 to 2147483647. Suppose the

minimum value of the deadband in (S1+1, S1) is 1000 and the maximum value of the deadband in (S3+1, S3) is

-2147483648. The instruction calculates the output value in (D+1, D) as follows.

Output value in (D+1, D)

=-2147483648 – 1000 = 16#80000000 - 16#000003E8 = 16#7FFFFC18

=2147482648

6-441
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When M0 is ON, the instruction subtracts -1000 or 1000 from the value in D0, and stores the difference in D1.

The following table shows the execution results.

Minimum value Maximum


Input value in
of the value of the Function Output value in D1
D0
deadband deadband

-1200 D0 < -1000 => D1= D0 – (-1000) -200

-1000 1000 1200 D0 > 1000 => D1 = D0 - 1000 200

500 -1000 ≦ D0 ≦ 1000 = > D0 = 0 0

Example 2

_6 When M0 is ON, the instruction subtracts -10000 or 10000 from the value in (D0, D1), and stores the difference in (D11,

D10).

6-442
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The following table shows the execution results.

Minimum value Maximum


Input value in Output value in (D11,
of the value of the Function
(D1, D0) D10)
deadband deadband

(D1, D0) < -10000


-12000 -2000
=> (D11, D10) = (D1, D0) – (-10000)

(D1, D0) > 10000


-10000 10000 12000 2000
 (D11, D10) = (D1, D0) -10000

-10000 ≦ (D1, D0) ≦10000


5000 0
=> (D1, D0) = 0

Additional remarks

If the minimum value of the deadband in S1 is larger than the maximum value of the deadband in S2, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6_

6-443
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1223 D ZONE P S1, S2, S3, D Controlling the zone

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1         
S2         
S3         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
S3    
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Negative deviation

S2 : Positive deviation

_6 S3 : Input value

D : Output value

Explanation

1. This instruction adds the negative deviation in S1 or the positive deviation in S2 to the input value in S3, and stores
the sum in D.

If the input value in S3 is less than 0, the instruction adds the negative deviation in S1 to the input value in S3, and

stores the sum in D.

If the input value in S3 is larger than 0, the instruction adds the positive deviation in S2 to the input value in S3, and

stores the sum in D.

If the input value in S3 is equal to zero, the instruction stores zero in D.

6-444
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. The following graphs show how this instruction uses the zone:

ZO NE is not ex ec uted. ZO NE is ex ecut ed.

Out put value Out put value

Po sitive deviation

Input value Input value

Negativ e dev iat ion

3. Only the 32-bit instructions can use the 32-bit counter but not the device E.

4. The negative deviation in S1, the positive deviation in S2, the input value in S3, and the output value in D must be

within the range described below.

 For the ZONE instruction, the negative deviation in S1, the positive deviation in S2, the input value in S3, and

the output value in D must be between -32768 to 32767. Suppose the negative deviation in S1 is -100 and the

input value in S3 is -32768. The instruction calculates the output value in D as follows.

Output value in D= (-32768) + (-100) = 16#8000 + 16#FF9C = 16#7F9C = 32668

 For the DZONE instruction, the negative deviation in S1, the positive deviation in S2, the input value in S3, and
6_
the output value in D must be between -2147483648 to 2147483647. Suppose the negative deviation in (S1+1,

S1) is -1000 and the input value in (S3+1, S3) is -2147483648. The instruction calculates the output value in

(D+1, D) as follows.

Output value in (D+1, D)

= -2147483648 + (-1000) = 16#80000000 + 16#FFFFFC18 = 16#7FFFFC18 = 2147482648

6-445
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When M0 is ON, the instruction adds -100 or 100 to the value in D0, and stores the sum in D10.

The following table shows the execution results.

Negative Positive Input value in Output value in D10


Function
deviation deviation D0

-10 D0 < 0 = > D10 = (-10) + (-100) -110

-100 100 0 D0 = 0 = > D10 = 0 0

50 D0 > 0 = > D10 = 50 + 100 150

Example 2

When M0 is ON, the instruction adds -10000 or 10000 to the value in (D0, D1), and stores the sum in (D11, D10).
_6

The following table shows the execution results.


Negative Positive Input value in (D1, Output value in (D11,
Function
deviation deviation D0) D10)
(D1, D0) < 0
-10 -10010
=> (D11, D10) = (-10) + (-10000)
(D1, D0) = 0
-10000 10000 0 0
 (D11, D10) = 0
(D1, D0) > 0
50 10050
 (D11, D10) = 50 + 10000

6-446
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1224 FMEAN P S, D, n Finding the mean of floating point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
n    
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
n  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : First device

D : Device where the mean is stored

n : Number of devices

Explanation
6_
1. This instruction adds up the single precision floating points in the n devices starting from the device specified by S,

divides the sum by the value in n, then stores the mean of the sum in D.

2. For 16-bit instructions, the value in n must be between 1–256,

3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), SM602 (carry flag):

 When the operation result is zero, SM600 is ON. Otherwise, it is OFF.

 If the value while adding or the absolute result of the operation is less than the floating point number that can

be shown, the D=16#FF800000 and the borrow flag SM601 is ON.

 If the value while adding or the absolute result of the operation is larger than the floating point number that can

be shown, the D=16#7F800000 and the carry flag SM602 is ON.

6-447
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the instruction adds the values of the 3 single precision floating points in (D1, D0), (D3, D2), (D5, D4) and

then divides the addition result by 3, then stores the result in (D11, D10).

[(D1, D0) +( D3, D 2)+(D5, D4 )]/3 ( D11, D 10)

(D1, D 0) 10 0.1 Aft er the inst ruc ti on is execu ted.

( D11, D1 0) 11 2.2
(D3, D 2) 113.2

(D5, D 4) 123.3

Additional remarks

1. If the value in n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is
_6
16#200B.

2. If S+2*n-1exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

3. If the value in S exceeds the range of floating point numbers that can be shown, the instruction is not executed, SM0
is ON, and the error code in SR0 is 16#2013.

6-448
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1225 FSUM P S, n, D Finding the sum of floating point numbers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
n    
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
n  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Data source

n : Data length

D : Operation result

Explanation
6_
1. This instruction adds up the single precision floating points in the n devices starting from the device specified by S,

then stores the sum in D.

2. For 16-bit instructions, the value in n must be between 1–256,

3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), SM602 (carry flag):

 When the operation result is zero, SM600 is ON. Otherwise, it is OFF.

 If the value while adding or the absolute result of the operation is less than the floating point number that can

be shown, the D=16#FF800000 and the borrow flag SM601 is ON.

 If the value while adding or the absolute result of the operation is larger than the floating point number that can

be shown, the D=16#7F800000 and the carry flag SM602 is ON.

6-449
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

S +1 S

S +3 S +2

S +5 S +4 D +1 D
F lo at ing p oi nt nu mb ers n=5

S +7 S +6
F l oatin g po int n umbers

S +9 S +8

Example

The FSUM instruction adds up the values of the 3 single precision floating points in (D1, D0), (D3, D2), (D5, D4) and

stores the result in (D11, D10).

[( D1, D 0)+( D3, D 2)+(D5 , D4)] ( D11, D10 )

(D1, D0) 10 0.1


_6 Aft er t he inst ruc tio n is execu ted.

(D3, D2) 113.2 (D11, D10) 33 8.6

(D5, D4) 125.3

Additional remarks

1. If the value in n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

2. If S+2*n-1exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#2003.

3. If the value in S exceeds the range of the floating point numbers that can be shown, the instruction is not executed,
SM0 is ON, and the error code in SR0 is 16#2013.

6-450
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description

1226 DTM P S,D,m,n Data conversion and move

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D   
m   
n   
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  
m  
n  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source data device

D : Device where the conversion result is stored

m : Conversion mode selection

n : The length of the data to be executed 6_


Explanation

1. The parameter m is for you to select a conversion mode from the following table. See the details on modes in the

following sections. If the parameter value is not one of the values in the following table, there will be no data

conversion or move and no error message.

Parameter Description

0 8-bit data converted into 16-bit data (high 8 bits, low 8 bits)

1 8-bit data converted into 16-bit data (low 8 bits, high 8 bits)

2 16-bit data (high 8 bits, low 8 bits) converted into 8-bit data

3 16-bit data (low 8 bits, high 8 bits) converted into 8-bit data

4 8-bit hex data (high 4 bits, low 4 bits) converted into ES3CII data

5 8-bit hex data (low 4 bits, high 4 bits) converted into ES3CII data.

6 8-bit ES3CII data converted into hex data (high 4 bits, low 4 bits).)

7 8-bit ES3CII data converted into hex data (low 4 bits, high 4 bits).

6-451
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

11 Convert a regional time to the exact time of the local longitude #1

18 String to floating point conversion

19 Floating point to string conversion

42 Calculate the duration of 2-Axis relative-position clockwise arc interpolation

43 Calculate the duration of 2-Axis relative-position counterclockwise arc interpolation

44 Set up the built-in input points filtering time for the PLC

46 Calculate the pulse output time in acceleration and deceleration for relative positioning

#1Note: The parameter is available for SV3/SX3 series only.


2. n is the setting value of data length. The range of the setting value is 1-256. If the input value exceeds the range, the

PLC will execute the instruction at the minimum or maximum value.

3. The conversion modes and move modes are explained as below.

 When m=0:
If n=4, the 8-bit data is converted into the 16-bit data (high 8-bits, low 8-bits), the conversion is as the

following figure shows.

Hi-byte Lo-byte
 Hi-byte Lo-byte
_6   
  

 When m=1:
If n=4, the 8-bit data is converted into the 16-bit data (low 8-bits, high 8-bits), the conversion is as the

following figure shows.

Hi-byte Lo-byte
 Hi-byte Lo-byte
  
  

 When m=2:
If n=4, the 16-bit data (high 8-bits, low 8-bits) is converted into the 8-bit data, the conversion is as the

following figure shows.

6-452
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Hi-byte Lo-byte

Hi-byte Lo-byte 
  
  

 When m=3:
If n=2, the 16-bit data (low 8-bits, high 8-bits) is converted into the 8-bit data, the conversion is as the
following figure shows.

Hi-byte Lo-byte
Hi-byte Lo-byte 
  
  

 When m=4:
If n=3, the 8-bit hex data (high 4-bits, low 4-bits) is converted into the ES3CII data and the conversion is as

the following figure shows.

Hi-byte Lo-byte 6_
Hi-byte Lo-byte H
 L
 H
 L
H
L

 When m=5:
If n=3, the 8-bit hex data (low 4-bits, high 4-bits) is converted into the ES3CII data, the conversion is as the

following figure shows.


Hi-byte Lo-byte

Hi-byte Lo-byte L
 H
 L
 H
L
H

6-453
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 When m=6:
If n=4, the 8-bit ES3CII data is converted into the hex data (high 4-bits, low 4-bits), the conversion is as the

following figure shows. ES3CII conversion values can be: 0 ~ 9 (0x30~0x39), A ~ F (0x41~0x46), a ~ f

(0x61~0x66).

Hi-byte Lo-byte
 Hi-byte Lo-byte
  
  

 When m=7:

If n=4, the 8-bit ES3CII data is converted into the hex data (low 4-bits, high 4-bits), the conversion is as the

following figure shows.

Hi-byte Lo-byte

 Hi-byte Lo-byte
  

_6   

 When m=11: Convert a regional time to the exact time of the local longitude.

The data source devices and destination devices are described as follows:
S: S+0 and S+1 stand for the longitude (32-bit floating point number) (East: positive, West: negative)
S+2: time zone (16-bit integer) (unit: hour)

S+3~S+8: represent year, month, date, hour, minute and second of a regional time (16-bit integer)

D: D+0~D+5 represent the actual year, month, date, hour, minute and second after conversion (16-bit integer)

n: reserved, it can be any value.

Example:

Enter the values for parameters, longitude= +F121.55 East, time zone=+8, regional time=January 6, 2011 AM

8:00:00

Conversion result: January 6, 2011 AM 8:06:12

6-454
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

 When m=18:

Convert the string value in source device S (Lo-byte) into a floating-point value (operand n; decimal point

excluded) and store this value in device D.

Note:

1. The setting value in operand n should be less than 8. If the value you set is exceeding the maximum

value 8, it will be treated as the maximum value 8. For example, if n = k6, when you convert the string

123.45678 into a floating-point value, the result is 123.456.

2. If the source value includes not just numeral characters, the non-numeral character will be treated as 0

when it is shown before the decimal point and it will be treated as the ending character when it is shown

after the decimal point. For example, if n = k6, when you convert the string BC12.4K59 into a

floating-point value, the result is 0012.4.

3. If there is no decimal point in the string, the string is converted directly into a floating-point value. Seethe

illustration below for reference.

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 6_
S+5 ‘5’
S+6 ‘6’
S+7 0x00

 When m=19:

Convert the floating-point value in source device S into a string value (operand n; decimal point excluded) and

store this value in device D.

Note:

1. The setting value in operand n should be less than 8. If the value you set is exceeding the maximum

value 8, it will be treated as the maximum value 8. For example, if n = k6, when you convert the

floating-point value F123.45678 into a string value, the result is 123.456.

2. If the number of digits of the source value is bigger than the setting value in the operand n, only the most

left n digits of the source value are converted into a string value. For example, if the floating point value

is F123456.78 and n is k4, the conversion result is 1234. See the illustration below for reference.

6-455
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

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

 When m=42:

Operand S1:

S1+0, S1+1: X axis target coordinate (relative positioning)

S1+2, S1+3: Y axis target coordinate (relative positioning)

S1+4, S1+5: Shift of the center (integer type) or central angle (floating point type)

S1+6, S1+7: Target reference frequency (1~200000Hz; if exceeding the allowable range, the system uses the

maximum or minimum value instead)

S1+8: Function selections

(K0, K1, K2: Shift of the center mode; shifts at 10 degree, 5 degree or 1 degree)

(K10, K11, K12: Central angle; shifts at 10 degree, 5 degree or 1 degree)

Operand D: D+0, D+1: Calculation of the duration of 2-Axis relative-position clockwise arc interpolation; unit:
_6 ms

Operand m: Function code K42

Operand n: Reserved

 When m=43:

Operand S1:

S1+0, S1+1: X axis target coordinate (relative positioning)

S1+2, S1+3: Y axis target coordinate (relative positioning)

S1+4, S1+5: Shift of the center (integer type) or central angle (floating point type)

S1+6, S1+7: Target reference frequency (1~200000Hz; if exceeding the allowable range, the system uses the

maximum or minimum value instead)

S1+8: Function selections

(K0, K1, K2: Shift of the center mode; shifts at 10 degree, 5 degree or 1 degree)

(K10, K11, K12: Central angle; shifts at 10 degree, 5 degree or 1 degree)

Operand D: D+0, D+1: Calculation of the duration of 2-Axis relative-position anti-clockwise arc interpolation;

6-456
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

unit: ms

Operand m: Function code K43

Operand n: Reserved

 When m=44:

Operand S1: the starting point of PLC input points (K0~K15  X0~X17)

Operand D: filtering time; unit: µs (0~20000)

Operand m: function code K44

Operand n: total number of input points to be updated

 When m=46:

Operand S1: S1+0, S1+1: number of pulse output (relative –position)

S1+2, S1+3: frequency of pulse output (1~200KHz)

S1+4: device of pulse output (K0~K7: Y0~Y7)

Operand D: D+0, D+1: Calculate the relative -position pulse output time in acceleration and deceleration; unit:

ms 6_
Operand m: Function code K46

Operand n: Reserved

Additional remarks

1. Using the matrix variables of Word data type for S and D is recommended.

6-457
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Function

1228 ZSET P SBit, EBit Zone setup

Device X Y M S T C HC D FR SM SR E K 16# “$” F


SBit     
EBit     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

SBit 
EBit 

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

SBit : Starting device of the zone

EBit : Ending device of the zone

Explanation

1. Set the bit in the zone between SBit and EBit to ON. The type of starting and ending devices should be the same

before setting up.


_6
2. If the number of SBit is larger than the number of EBit, only EBit can be set. Set the number SBit to a smaller one.

3. Except T, C and HC devices, this instruction is available for bit-type devices and BOOL type data.

Example

1. When M0 is ON, the auxiliary relays M300~M399 are ON.

6-458
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1229 F SORT P src ~ ref Sorting data in floating-point format

Device X Y M S T C HC D FR SM SR E K 16# “$” F


src 
group   
column   
ref   
dst 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

src 
group  
column  
ref  
dst 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

src : First device where the original data is stored


group : Number of rows of data 6_
column : Number of columns of data
ref : Reference value for sorting the data
dst : First device where the sorted data is stored

Explanation

1. This instruction stores the data to be sorted in the group×columnx2 registers starting from the register specified by

dst. If src and dst specify the same register, the sorted data is the same as the original data in the register specified

by src.

2. The operand group must be between 1–32. The operand column must be between 1–6. The operand ref must be

between 1– column.

3. When SM604 is OFF, the instruction sorts the data in ascending order. When SM604 is ON, the instruction sorts the

data in descending order.

4. It is suggested that you use the pulse type instruction, FSORTP, instead of sorting repeatedly.

6-459
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. Suppose SM604 is OFF. When X0 switches from OFF to ON, the instruction sorts the data in ascending order.

2. The data which to be sorted is as in the following table.

Number of columns of data column x 2


columns of data

Column 1 2 3 4 5

Student
Chinese English Math Physics
Row number

1 (D0,D1) 1.0 (D10,D11) 90.0 (D20,D21) 75.0 (D30,D31) 66.0 (D40,D41) 79.0
Number of rows of data:

2 (D2,D3) 2.0 (D12,D13) 55.0 (D22,D23) 65.0 (D32,D33) 54.0 (D42,D43) 63.0
group x 2

_6 3 (D4,D4) 3.0 (D14,D15) 80.0 (D24,D25) 98.0 (D34,D35) 89.0 (D44,D45) 90.0

4 (D6,D7) 4.0 (D16,D17) 70.0 (D26,D27) 60.0 (D36,D37) 99.0 (D46,D47) 50.0

5 (D8,D9) 5.0 (D18,D19) 95.0 (D28,D29) 79.0 (D38,D39) 75.0 (D48,D49) 69.0

6-460
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

3. When the value in D100 is 3, the data is sorted as in the following table.

Number of columns of data column x 2


columns of data

Column 1 2 3 4 5

Student
Chinese English Math Physics
Row number

1 (D50,D51) 4.0 (D60,D61) 70.0 (D70,D71) 60.0 (D80,D81) 99.0 (D90,D91) 50.0
Number of rows of data:

2 (D52,D53) 2.0 (D62,D63) 55.0 (D72,D73) 65.0 (D82,D83) 54.0 (D92,D93) 63.0
group x 2

3 (D54,D55) 1.0 (D64,D65) 90.0 (D74,D75) 75.0 (D84,D85) 66.0 (D94,D95) 79.0

4 (D56,D57) 5.0 (D66,D67) 95.0 (D76,D77) 79.0 (D86,D87) 75.0 (D96,D97) 69.0

5 (D58,D59) 3.0 (D68,D69) 80.0 (D78,D79) 98.0 (D88,D89) 89.0 (D98,D99) 90.0

4. When the value in D100 is 5, the data is as in the following table.

Number of columns of data column x 2


columns of data

Column 1 2 3 4 5

Student
Row
Chinese English Math Physics 6_
number

1 (D50,D51) 4.0 (D60,D61) 70.0 (D70,D71) 60.0 (D80,D81) 99.0 (D90,D91) 50.0
Number of rows of data:

2 (D52,D53) 2.0 (D62,D63) 55.0 (D72,D73) 65.0 (D82,D83) 54.0 (D92,D93) 63.0
group x 2

3 (D54,D55) 5.0 (D64,D65) 95.0 (D74,D75) 79.0 (D84,D85) 75.0 (D94,D95) 69.0

4 (D56,D57) 1.0 (D66,D67) 90.0 (D76,D77) 75.0 (D86,D87) 66.0 (D96,D97) 79.0

5 (D58,D59) 3.0 (D68,D69) 80.0 (D78,D79) 98.0 (D88,D89) 89.0 (D98,D99) 90.0

Additional remarks

1. If the value in the the device exceeds the range, the instruction is NOT executed, SM0 is ON, and the error code in
SR0 is 16#2003.
2. If the value in group, column, or ref exceeds the range, the instruction is NOT executed, SM0 is ON, and the error
code in SR0 is 16#200B.
3. If the value in src exceeds the range of a floating-point value, the instruction is NOT executed, SM0 is ON, and the
error code in SR0 is 16#2013.

6-461
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.14 Structure Creation Instructions


6.14.1 List of Structure Creation Instructions
The following table lists the Data Processing instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1300 FOR – – Starting a nested loop

1301 NEXT – – Ending a nested loop

1302 BREAK – – Terminating a FOR-NEXT loop

_6

6-462
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.14.2 Explanation of Structure Creation Instructions

API Instruction code Operand Function

1300 FOR S Starting a nested loop

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S DWORD       

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : Number of times the loop is executed

Explanation

Refer to the NEXT instruction (API 1301) for more details.

6_

6-463
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1301 NEXT - Ending a nested loop

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Explanation

1. This instruction executes the program between the FOR and NEXT instructions N times, where N is the value in S

specified for the FOR instruction (API 1300). After the program between the FOR and NEXT instructions is executed

N times, the program following the NEXT instruction is executed. The instruction FOR specifies the number of times

the program between the FOR and NEXT instructions is executed.

2. N must be between 1–32,767. If N is less than 1, the instruction processes it as 1.

3. If you do not want to execute the program between the FOR and NEXT instructions, you can skip it with the CJ

instruction (API 0400).

4. The following conditions result in errors.

 The NEXT instruction is prior to the FOR instruction.


_6
 The FOR instruction exists, but the NEXT instruction does not exist.

 The NEXT instruction follows the FEND or END instruction.

 The number of times the FOR instruction is used in the program is different from the number of times the

NEXT instruction is used in the program.

5. The FOR and NEXT instructions support the nested program structure. There can be at most 32 levels of nested

program structures. If a loop is executed many times, it takes more time for the PLC to scan the program, and the

watchdog timer error may occur. You can use the WDT instruction (API 1900) to resolve the problem.

6-464
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

After program A is executed three times, the program following the instruction NEXT is executed. Program B is executed

four times every time program A is executed. Therefore, program B is executed twelve times in total.

Example 2

When M0 is OFF, the program between FOR and NEXT is executed. When M0 is ON, the CJ instruction is executed. The

execution of the program jumps to LABEL 1:, i.e. network 6, and network 4–5 are not executed. 6_

6-465
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 3

If the program between FOR and NEXT is not to be executed, you can skip it with the CJ instruction. When M1 in network

8 is ON, the instruction CJ is executed. The execution of the program jumps to LABEL 1:, i.e. network 12, and network

9–11 are not executed.

_6

6-466
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6_

6-467
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on using labels.

_6

6-468
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1302 BREAK D Terminating the FOR-NEXT loop

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D     

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol
Device where the remaining number
D : of times the loop can be executed is
stored

Explanation

1. This instruction terminates the FOR/NEXT loop. The remaining number of times the FOR/NEXT loop can be

repeated is stored in D. After the loop has executed D times, the program jumps to the NEXT instruction and

executes the instruction after the NEXT instruction.


6_
2. When the instruction is executed, the remaining number of times the FOR/NEXT loop can be repeated is stored in D,

including this time the instruction BREAK is executed.

3. When the BREAK instruction is executed for the first time to terminate the FOR/NEXT loop, the program does not

jump out of the FOR/NEXT loop to execute the next instruction. If the BREAK instruction is executed more than one

time to terminate the FOR/NEXT loop, the program jumps to the NEXT instruction and executes the instruction

following the NEXT instruction.

6-469
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When the FOR/NEXT loop is executed, 1 is added to the value in D0. When the value in D0 is equal to 30, the FOR/NEXT

loop is terminated, and the remaining number of times the FOR/NEXT loop can be repeated, i.e. 71, is stored in D10. The

execution of the program jumps to LABEL 1:, i.e. network 6, and 1 is added to the value in D2.

_6

Additional remarks

1. If the instruction BREAK is outside the FOR/NEXT loop, it causes an operation error, the instruction is not executed,
SM0 is ON, and the error code in SR0 is 16#2017.

2. Refer to the ISPSoft/DIADesigner User Manual for more information on using labels.

6-470
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.15 Module Instructions


6.15.1 List of Module Instructions
The following table lists the Module instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1400 FROM DFROM  Reading data from the control register in an extension module

1401 TO DTO  Writing data into the control register in an extension module

1402 DPUCONF  Setting output control parameters of PU module

1403 PUSTAT – – Reading PU module output state

1404 – DPUPLS – PU module pulse output (no acceleration)

Relative position output of PU module (with acceleration and


1405 – DPUDRI –
deceleration)

Absolute addressing output of PU module


1406 – DPUDRA –
(with acceleration and deceleration)

1407 – DPUZRN – PU module homing

1408 – DPUJOG – PU module jog output

1409 – DPUMPG – PU module MPG output

1410 – DPUCNT – High-speed counter function of PU module


6__
1428 PUX –  Setting PU module input point mode

1429 – DPULS  Setting PU module software limits

1430 MLPF – – Low-pass filter for analog input signals

6-471
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.15.2 Explanation of Module Instructions

API Instruction code Operand Function

Reading data from the control register


1400 D FROM P m1, m2, m3, D1, D2, n
in an extension module

Device X Y M S T C HC D FR SM SR E K 16# “$” F


m1         
m2         
m3         
D1    
D2    
n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

m1    
m2    
m3    
D1    
D2    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3
_6
Symbol

m1 : CPU module number or the remote extension module number

m2 : Order numbers of the extension number

m3 : Control register number

D1 : Device where the data is stored

D2 : Device where the error code is stored

n : Data length

Explanation

1. This instruction reads data from the control register in an extension module.

2. The value in m1 must be 0. If the value in m1 is NOT 0, it will be seen as 0.

3. The operand m2 represents the number of the right-side special extension modules (digital I/O module excluded)

6-472
C ha pt er 6 A p pl i e d In s tr uc t io ns

that are connected to the CPU module. The first device is number 1, the second device is number 2 and so on.

Connected modules are counted and up to 8 devices can be connected.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

4. The operand m3 specifies the control register number.

5. The FROM instruction sets D2 to 0. When an error occurs, the instruction does not set D2 to 0.

6. The operand n must be between 1–8.

7. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

When M0 is switched from OFF to ON, the instruction reads the data stored in CR#2 from the right side of the first module

and stores the data in D100. If no error occurs, the code in D110 is 16#0000.

6__

Additional remarks

1. If the values in m1 and m2 exceed their range, an operation error occurs, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

2. If D1 to D1+n-1 exceed the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

3. If the value in n exceeds the range, the operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200B.

4. Due to the fact that the FROM instruction decreases the execution efficiency of both the CPU module and the I/O

module, it is suggested that you use the pulse type instruction to perform a single trigger as in the example shown

above.

6-473
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Writing data into the control register in an
1401 D TO P m1, m2, m3, S, D, n
extension module

Device X Y M S T C HC D FR SM SR E K 16# “$” F

m1         

m2         

m3         

S       

D    

n         
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

m1    
m2    
m3    
S    
D    
n    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

_6 Symbol

m1 : CPU module number or the remote extension module number

m2 : Order numbers of the extension number

m3 : Control register number

S : Device where the data is stored

D : Device where the error code is stored

n : Data length

Explanation

1. This instruction writes data to the control register in an extension module.

2. The value in m1 must be 0. If the value in m1 is NOT 0, it will be seen as 0.

3. The operand m2 represents the number of the right-side special extension modules (digital I/O module excluded)

6-474
C ha pt er 6 A p pl i e d In s tr uc t io ns

that are connected to the CPU module. The first device is number 1, the second device is number 2 and so on.

Connected modules are counted and up to 8 devices can be connected.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

4. The operand m3 specifies the control register number.

5. The TO instruction sets D to 0. When an error occurs, the instruction does not set D2 to 0.

6. The operand m1 must be between 1–8.

7. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

8. When S is a hexadecimal value, the instruction transmits n hexadecimal values to the I/O module. Suppose S is

16#0001 and n is 3. The instruction transmits three 16#0001s to the I/O module.

Example

When M0 switches from OFF to ON, the TO instruction writes the data stored in D100 to CR#2 in the right side of the first

module. If no error occurs, the code in D110 is 16#0000.

6__

Additional remarks

1. If the values in m1 and m2 exceed their range, an operation error occurs, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

2. If D1-D1+n-1 exceed the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

3. If the value in n exceeds the range, the operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200B.

4. Due to the fact that the TO instruction decreases the execution efficiency of both the CPU module and the I/O

module, it is suggested that you use the pulse type instruction to perform a single trigger as in the example shown

above.

6-475
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Setting output control parameters of
1402 D PUCONF P Module ~ Error, ErrCode
PU module

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

Mode   

SSpeed   

Atime   

Dtime   

MSpeed   

Z_no   

Offset   

Done    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
_6 Axis  
Mode  
SSpeed  
Atime  
Dtime  
Mspeed  
Z_no  
Offset  
Done 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

6-476
C ha pt er 6 A p pl i e d In s tr uc t io ns

Symbol

Module : Module number

Axis : Output axis number

Mode : Output mode


SSpeed : Speed for starting/ ending frequency
Atime : Acceleration time
Dtime : Deceleration time
MSpeed : Maximum output frequency
Number of Z phases to look for after returning to the
Z_no :
original point
Specify the number of outputs after returning to the
Offset :
original point
Done : Completion flag
Error : Error flag
ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. The timing to set this instruction is when En changes from OFF to ON.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is
number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8. 6__
For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

See the following combination of axis numbers and corresponding output points of PU modules.

PU module name Axis 1 Axis 2

DVP02PU-E2
Y0 / Y1 Y2 / Y3
DVP02PU-SL

5. Mode sets the output mode of an output axis and the setting values are explained in the following table.

6-477
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Output mode value Description Remark

Single-point pulse output (An even-number


0 E.g. Y0 or Y2 for output
point for output only)

E.g. Y0 is for the pulse and Y1 is for the


Pulse (An even-number point) + direction
1 direction. Y1: ON, negative direction;
(An odd-number point)
Y1: OFF, positive direction

CW (An even-number point) + CCW (An E.g. Y0 is for CW (positive direction) and Y1
2
odd-number point) is for CCW (negative direction)

E.g. Y0 is for phase A and Y1 is for phase B.

Phase A (An even-number point) + Phase B When phase A is leading phase B: positive
3
(An odd-number point) direction; when phase B is leading phase A:

negative direction

Automatically switch to mode 1 (default


Others
value)

6. SSpeed~ Offset
See the explanation of the following non-latched parameters and setting values. If the setting values exceed the

range, the instruction will automatically be executed at the minimum or maximum value.

Parameter Function Range Default Remark

_6 SSpeed Starting/ending frequency 0 ~ 10,000 (Unit: Hz) 100

Atime Acceleration time 0 ~ 10,000 (Unit: ms) 100

Dtime Deceleration time 0 ~ 10,000 (Unit: ms) 100

MSpeed Maximum output frequency 100 ~ 200,000 (Unit: Hz) 100K A 32-bit value

Number of Z phase signals to seek after


Z_no -100 ~ 100 (Unit: times) 0 0: disabled
returning to the origin.

Outputs the offset position after the


-10,000 ~ 10,000 (Unit:
Offset homing is finished and Z phase seeking 0 0: disabled
pulses)
is done.

7. Done, an output of the specified PU module has been set as the completion flag. When Done is On, it indicates that

the parameter setting is successful. You can continue to perform positioning output based on the On state of the

completion flag. The clearing of the Done flag need be conducted by manual. The Done flag changes to ON only

when the setting is completed.

8. Error, an output of the specified PU module is a parameter error flag. Most parameter ranges are filtered

automatically by the PLC. Thus if the error flag is ON, it means that there is no specified PU module or the PU

6-478
C ha pt er 6 A p pl i e d In s tr uc t io ns

module number is wrong or the output axis number is incorrect.

9. The instruction is a pulse instruction. Even if the A contact is adopted as the condition contact, PU module

parameters are also set only when the instruction is started. Therefore, if a parameter value is to be updated, restart

the instruction to make the parameter set again.

10. Since the set parameters are delivered through the module communication command, confirm the state of the

output Done or Error before a parameter value is modified and then proceed with relevant operations.

11. ErrCode shows error codes. See the description as follows.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

Example

Refer to the description of DPUDRI instruction (API 1405) for more information.

6__

6-479
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1403 PUSTAT Module ~ ErrCode Reading PU module output state

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

ZeroS     

C_Posi 

Execute    

Pause    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
ZeroS 
C_Posi  
Execute 
Pause 
_6 Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Module : Module number

Axis : Output axis number

ZeroS : Clear present output position to 0


C_Posi : Current output position
Execute : Execution flag
Pause : Pause flag

Error : Error flag


ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

6-480
C ha pt er 6 A p pl i e d In s tr uc t io ns

2. The En must be set to ON so as to update the status of the specified axis continuously.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. ZeroS clears the present output position to 0. If the present axis position is to be cleared to 0, set ZeroS from OFF

to ON when the instruction is started.

6. C_Posi sets the present position of the output axis for the specified PU module. The parameter value is a latched

value and stored in the PU module.

7. Execute is a read-only flag which means the output axis of the specified PU module is outputting or not. When

Execute is On, it means the output is being conducted. When Execute is Off, it means the output axis is unused

and can accept the next output command.

8. Pause is a read-only flag to control the output axis of the specified PU module to pause its output. When Pause is 6__
On, it means the output is paused, the present velocity is 0 and the present output has not reached the specified

target output position. If you restore the output, the flag will be cleared automatically.

Note: While Pause is On, Execute is constantly On as well.

9. Error is a read-only error flag which means an error occurs during the reading of the specified PU module. Refer to

the explanation of error codes in ErrCode.

10. After the PUSTAT instruction gives the pause command, the flags Execute, Pause and Error become read-only

flags and at the moment, their states cannot be modified. The Execute, Pause and Error flags can be set or

cleared only when the PUSTAT instruction is turned off.

11. For PU module state, check out the data exchange function of the special extension module through SM228. Refer

to Section 2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data Registers in the

DVP-ES3/EX3/SV3/SX3 Series Programming Manual for details.

12. ErrCode shows error codes and the explanations are seen in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

6-481
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Error code Description

16#1403 There is no such output axis number in the PU module.

Example

Refer to the description of DPUDRI instruction (API 1405) for more information.

_6

6-482
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


PU module pulse output
1404 D PUPLS Module ~ ErrCode
(no acceleration)

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

TarPulse   

TarSpeed   

Done    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
TarPulse  
TarSpeed  
Done 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction 6__


- - ES3/EX3/SV3/SX3

Symbol

Module : Module number

Axis : Output axis number

TarPulse : Target number of output pulses


TarSpeed : Target output frequency
Done : Completion flag
Error : Error flag

ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

6-483
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would stop immediately.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. TarPulse sets the number of output pulses. The pulse number is a positive signed 32-bit value. When the value is 0,

it means the output is always being performed, the number of output pulses is not limited and the output is not

stopped until the instruction is disabled. When the value is less than 0, the PLC automatically uses 2's complement

to transform the value into a positive integer as the number of output pulses.

6. TarSpeed sets the target output speed (Unit: Hz). The input value is a signed 32-bit value within the range of

-200,000 (-200K) ~ 200,000 (200K). You can modify the target frequency any time after the instruction is enabled

and the PU module will automatically switch to the newly set target frequency after outputting a full pulse.
_6 7. When TarSpeed is a positive number (>0), it means that the “positive direction” output point is Off. When TarSpeed

is a negative number (<0), it means that the “negative direction” output point is On. When TarSpeed is 0, it means

that the output will be paused after the being executed pulse is output fully.

8. The instruction does not support the function of acceleration and deceleration. Use the DPUDRI instruction instead

if you need the function of acceleration and deceleration.

9. The instruction can be used for the speed change. While the instruction is being executed, you can change the

value of TarSpeed so as to change the output speed. When the setting value exceeds the maximum frequency, the

instruction would be executed at the maximum frequency. But changing the speed would not change the direction. If

the direction is to be changed, set the value of TarSpeed to 0 first and then modify the target speed.

10. When the outputs have reached the pulse number specified by TarPulse, the Done flag changes to ON. The Done

flag need be cleared by manual. The instruction sets the completion flag to ON only when the output is completed.

11. The instruction can be used with the software and hardware limit points. When the limits are triggered, the output

stops immediately and the Error flag changes to ON.

12. If any error occurs as the instruction is in process of the output, the Error flag changes to ON. Refer to the error

codes ErrCode shows for the trouble shooting.

13. The error codes that ErrCode shows are listed in the following table.

6-484
C ha pt er 6 A p pl i e d In s tr uc t io ns

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

16#1403 There is no such output axis number in the PU module.

The output axis specified by the PU module is outputting data. It is not allowed to specify
16#1405
the output repeatedly.

16#1406 PU module stops Output pulse when the positive limit is reached.

16#1407 PU module stops Output pulse when the negative limit is reached.

Example

1. When M0 is ON, the DPUCONF instruction for axis 1 is executed to modify the parameters by setting Mode to 1
(Pulse Y0 + direction Y1), SSpeed to 200Hz, Atime to 200ms, Dtime to 200ms and MSpeed to 100kHz. After the

output of Done is completed, M1 is ON.

2. When M10 is ON, the DPUPLS instruction for axis 1 starts to output 20,000 pulses from Y0 at the frequency of 2KHz

(without acceleration and deceleration). Y1 is OFF, which indicates the positive direction and M11 is ON after the

pulse output is finished.

6__

6-485
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Relative position output of PU module
1405 D PUDRI Module ~ ErrCode
(with acceleration and deceleration)

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

RTarPosi   

TarSpeed   

Done    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
RTarPosi  
TarSpeed  
Done 
Error 
ErrCode  

_6 Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Module : Module number

Axis : Output axis number

RTarPosi : Number of output pulses for relative positioning


TarSpeed : Target output frequency
Done : Completion flag
Error : Error flag

ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later..

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would decelerate to stop.

6-486
C ha pt er 6 A p pl i e d In s tr uc t io ns

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. RTarPosi sets the position for relative positioning. The pulse number is a signed 32-bit value. When the value is

greater than 0, the output will go in the positive direction (and the direction output point is off). When the value is

less than 0, the output will go in the negative direction (and the direction output point is on). When the value is 0, the

output completion flag Done changes to ON.

6. TarSpeed sets the target output frequency (Unit: Hz). The frequency value is a positive signed 32-bit integer. When

the value is less than 0, the instruction will automatically use 2’s complement to transform the value into a positive

integer. When the value is 0, the instruction will notify the module to enter the pause mode. The actual output is

decelerated at the deceleration rate till the output speed is equal to 0 and the pause flag changes to ON. Refer to

PUSTAT instruction for more details.

See the setting range of TarSpeed for the module in the following table.
6__
Module Name TarSpeed Setting Range

DVP02PU-E2
-200,000(-200K)~ 200,000(200K)
DVP02PU-SL

7. After the output is started, the target frequency is allowed to change any time. In the actual frequency change, the

PLC will automatically change the frequency based on the set acceleration and deceleration rate in the DPUCONF

instruction. When the modified speed exceeds the allowed maximum frequency, the output will be performed at the

maximum frequency.

8. When the outputs have reached the pulse number for relative positioning specified by RTarPosi, the Done flag

changes to ON. The Done flag need be cleared by manual. The instruction sets the completion flag to ON only

when the output is completed.

9. The instruction can be used with the software and hardware limit points. The output stops immediately and the Error

flag changes to ON when the limits are triggered.

10. If any error occurs as the instruction is in process of the output, the Error flag changes to ON. Refer to the error

codes that ErrCode shows for the trouble shooting.

11. The error codes that ErrCode shows are listed in the following table.

6-487
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Error code Description


16#1400 The module does not support the function.
16#1402 There is no response from the module; communication timeout occurs.
16#1403 There is no such output axis number in the PU module.
The output axis specified by the PU module is outputting data. It is not allowed to specify
16#1405
the output repeatedly.
16#1406 PU module stops Output pulse when the positive limit is reached.
16#1407 PU module stops Output pulse when the negative limit is reached.

12. Illustration of the acceleration and deceleration curve of the DPUDRI instruction

Freq.

 
Time
Pulse No.

 

 : Maximum output frequency value. Refer to the setting in the DPUCONF instruction for the parameter setting.

Alternatively, set the parameter value through HWCONFIG.

_6 : The target frequency specified by the PU module output instruction. The target frequency output must not exceed

the maximum output frequency. If the maximum output frequency is exceeded, the maximum output frequency is

regarded as the output frequency.

: Starting/ending output frequency value. Refer to the setting in the DPUCONF instruction for the parameter setting.
Alternatively, set the parameter value through HWCONFIG.

: The acceleration time value. Refer to the setting in the DPUCONF instruction for the parameter setting.

Alternatively, set the parameter value through HWCONFIG.

: The deceleration time value. Refer to the setting in the DPUCONF instruction for the parameter setting.

Alternatively, set the parameter value through HWCONFIG.

The acceleration and deceleration that the PU module controls is performed according to the fixed slope. So the

actual acceleration time and deceleration time change based on the output target frequency. The formula for

calculation of acceleration rate and deceleration rate are respectively shown as follows.

(Max. output frequency - starting frequency)/acceleration time;

(Max. output frequency - ending frequency)/deceleration time.

6-488
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

1. When M0 is ON, the PUX instruction is executed to set the input parameters of DVP02PU-E2 module with “Axis 1,

DOG, Rising-edge triggered” for input point X0, “Axis 1, Z phase, Rising-edge triggered” for input point X1 and “15m”

for X0 / X1 filter time. When the output of Done is completed, M1/M3 changes to ON.

2. When M10 is ON, the DPULS instruction for axis 1 is executed to set the software limit points with “-50000” for LSN

and “50000” for LSP. When the output of Done is completed, M11 changes to ON.

3. When M20 is ON, the DPUCONF instruction for axis 1 is executed to change the parameters by setting Mode to 1

(Pulse Y0+ Direction Y1), SSpeed (start speed) to 200Hz, Atime (acceleration time) to 200ms, Dtime (deceleration

time) to 200ms, MSpeed (maximum speed) to 100kHz, Z_NO (Number of Z phases to look for after returning to the

home position) to 1 and Offset (number of outputs after homing is finished) to -100. And M21 changes to ON as the

output of Done is completed.

4. When M30=ON, the PUSTAT instruction for axis 1 is executed to read the PU module output state. To clear current

output position, you can set M31 to ON so that the current position of axis 1 (rising-edge triggered) in D30 would be

cleared to 0.

5. When M40 is ON, the DPUZRN instruction for axis1 starts to perform homing and the PUSTAT instruction displays

the current position in D30. The output point Y0 outputs pulses at the frequency of 1kHz and the search for the home

starts in positive direction. Once the near home signal (DOG) is reached and X0 is ON, the axis starts to decelerate

and then moves at the Jogspeed of 100Hz in the negative direction. When X0=OFF, the axis moves in the positive

direction to search for Z phase until the first rising-edge triggered signal at X1 (Z phase) is detected, then it moves

toward negative direction after 100 output pulses are completed. Finally, M41 changes to ON after the output of Done

is finished.
6__
6. When M50 is ON, the DPUDRI instruction for axis 1 starts to perform relative positioning output. The PUSTAT

instruction displays the current position in D0 and the output point Y0 outputs 20,000 pulses at the frequency of 2kHz

(relative addressing). Y1 is OFF, which indicates that the direction is positive and the PUSTAT instruction displays

the current position in D30. Finally, M51 changes to ON after the output of Done is completed.

6-489
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

6-490
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Absolute addressing output of PU
1406 D PUDRA Module ~ ErrCode module
(with acceleration and deceleration)

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

ATarPosi   

TarSpeed   

Done   

Error   

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
ATarPosi  
TarSpeed  
Done 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


6__
- - ES3/EX3/SV3/SX3

Symbol

Module : Module number

Axis : Output axis number

ATarPosi : Number of output pulses for absolute addressing


TarSpeed : Target output frequency
Done : Completion/pause flag
Error : Error flag
ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

6-491
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would decelerate to stop.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. ATarPosi is the position for absolute addressing. The input pulse number is a signed 32 bit value. The PU module

will automatically compare it with the present position. If the comparison result is greater than 0, the output will be

conducted in the positive direction (and the direction output point is off). If the comparison result is less than 0, the

output will be conducted in the negative direction and the direction output point is on). When the value is 0, the

instruction sets the Done flag to ON.

6. Refer to the DPUDRI instruction for the explanation of other parameters.

Example
_6
1. When M0 is ON, the DPUCONF instruction for axis 1 is executed to modify the parameters by setting Mode to 1

(Pulse Y0+ Direction Y1), SSpeed (the speed for starting) to 200Hz, Atime (acceleration time) to 200ms, Dtime

(deceleration time) to 200ms and MSpeed (maximum output frequency) to 100kHz. And M1 changes to ON as the

output of Done is completed.

2. When M10 is ON, the DPUDRA instruction for axis 1 is executed to output pulses from Y0 at the frequency of 2kHz

until the current position reaches 20,000 (absolute addressing). When Y1 is OFF, the direction is positive. And M11

changes to ON as the output of Done is completed.

6-492
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1407 D PUZRN Module ~ ErrCode PU module homing

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

Mode   

TarSpeed   

JogSpeed   

Done   

Error   

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
Mode  
TarSpeed  
JogSpeed  
Done 
Error  6__
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3

Symbol

Module : Module number

Axis : Output axis number

Mode : Homing mode selection


TarSpeed : Maximum output frequency for the homing
JogSpeed : The jog frequency for the homing

Done : Completion flag

Error : Error flag


ErrCode : Error code

6-493
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would decelerate to stop.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. Mode sets a homing mode. The explanation of modes is shown in the following table.

Use matching input


Mode
_6 value
Function points by PUX Remark

instruction

0 Directly clear the current position to 0. None

The axis starts to go toward the negative

1 direction and then stops after leaving the DOG

DOG point position

The axis starts to go toward the positive

2 direction and then stops after leaving the DOG

DOG point position

Use DPUCONF
After Mode 1 is finished, seek the set
3 DOG and Z phase input instruction to set up the
number of Z phases.
number of Z phases.

After Mode 2 is finished, seek the set


4 DOG and Z phase input
number of Z phases.

Use DPUCONF
After Mode 1 is finished, output the offset
5 DOG instruction to set up the
position.
offset position.

6-494
C ha pt er 6 A p pl i e d In s tr uc t io ns

Use matching input


Mode
Function points by PUX Remark
value
instruction

After Mode 2 is finished, output the offset


6 DOG
position.

Use DPUCONF
After Mode 1 is finished, seek the set
instruction to set up the
7 number of Z phases and then output the DOG and Z phase input
number of Z phases
offset position.
and offset position.

After Mode 2 is finished, seek the set

8 number of Z phases and then output the DOG and Z phase input

offset position.

Modify the current output position for the Use the setting value
255 None
axis. of TarSpeed

Others Reserved

Note 1: The specified homing behavior may not be realized if the input point for the selected mode is not used

together with the PUX instruction. Refer to the following No.12 Homing modes for more information.

6. TarSpeed sets the maximum output frequency for the homing. The setting value is a signed 32-bit value. When

Mode value is between 1~8, the range of the setting value is -200,000 ~ -100 (Hz) and 100 ~ 200,000 (Hz). If Mode

value is 255, TarSpeed value will become the present output position value of the PU module.
6__
7. JogSpeed is the jog frequency for reaching the home position and also represents the start/end frequency for

homing. The setting value is a signed 16-bit value within the range of 1~10,000 (Hz).

8. When the specified home position is reached during the instruction is executed, the Done flag changes to ON. The

Done flag need be cleared by manual. The instruction sets the completion flag to ON only when the output is

completed.

9. The instruction does not support software limit points. It can be used with hardware limit points only. When a
hardware limit point is triggered during the output, the Error flag will be set to ON.
The following cases and corresponding axis actions occur when a hardware limit point is triggered.

Case Action

The axis stops immediately, then speeds up toward the opposite direction from the

DOG is not entered frequency specified by JogSpeed until the frequency specified by TarSeed is reached and

continues to seek the DOG signal.

The axis stops immediately, then moves toward the opposite direction at the frequency
At DOG
specified by JogSpeed and continues to seek the DOG signal.
DOG is moved away
The axis stops immediately.
from.

6-495
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

10. If any error occurs as the instruction is in process of the output, the Error flag changes to ON. Refer to the error

codes that ErrCode shows for the trouble shooting.

11. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

16#1403 There is no such output axis number in the PU module.

The output axis specified by the PU module is outputting data. It is not allowed to specify
16#1405
the output repeatedly.

16#1406 PU module stops Output pulse when the positive limit is reached.

16#1407 PU module stops Output pulse when the negative limit is reached.

12. Explanation of DOG (A) and DOG (B) signals

Contact
Type
The DOG signal emerges and the axis enters DOG

when the contact switches from OFF to ON.


DOG(A)
The DOG signal disappears and the axis leaves

_6 DOG when the contact switches from ON to OFF.

The DOG signal emerges and the axis enters DOG

when the contact switches from ON to OFF.


DOG(B)
The DOG signal disappears and the axis leaves

DOG when the contact switches from OFF to ON.

13. Explanation of homing modes

Mode 0:Directly clear the current position to 0.

6-496
C ha pt er 6 A p pl i e d In s tr uc t io ns

Mode 1:The axis starts to go toward the negative direction and then stops after leaving the DOG point position

Description of cases under mode 1

The motion starts in the negative direction. As the


DOG point is encountered, The axis starts to
Case A
decelerate until the JOG speed is reached and then
the axis stops while leaving the DOG point.
The motion starts in the positive direction; the
Case B deceleration time is less than the duration for the
DOG signal.
The motion starts in the positive direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

6__

① The DPUZRN instruction is started; the axis accelerates from the speed specified by JogSpeed to the target speed

specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the axis keeps

moving at the target speed.

② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.

 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving

the DOG signal.

 In the positive direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then stops. After

that, it moves at the JOG speed in the opposite direction and prepares for moving away from the DOG signal.

③ The DOG signal is moved away from and meanwhile the axis stops immediately.

6-497
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Mode 2:The axis starts to go toward the positive direction and then stops after leaving the DOG point position
Description of cases under mode 2
The motion starts in the positive direction. As the
DOG point is encountered, the axis starts to
Case A
decrease its speed until the JOG speed is reached
and then stops after leaving the DOG point.
The motion starts in the negative direction, the
Case B deceleration time is less than the duration for the
DOG signal.
The motion starts in the negative direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

_6

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target

speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the motion

continues at the target speed.

② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.

 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving

the DOG signal.

 In the negative direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then stops. After

that, it goes at the JOG speed in the opposite direction and prepares for leaving the DOG signal.
③ The DOG signal is left and meanwhile the axis stops immediately.

6-498
C ha pt er 6 A p pl i e d In s tr uc t io ns

Mode 3:After Mode 1 is finished, seek the set number of Z phases.

Description of cases under mode 3


The motion starts in the negative direction. As the
DOG point is encountered, the axis starts to
Case A decelerate until the JOG speed is reached and then
the search for a set number of Z phases begins
before the axis stops immediately.
The motion starts in the positive direction; the
Case B deceleration time is less than the duration for the
DOG signal.
The motion starts in the positive direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

6__

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion continues at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the positive direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then the axis stops.
After that, the axis goes at the JOG speed in the opposite direction and prepares for leaving the DOG signal.
③ After the DOG signal is moved away from, the search for the set number of Z phase pulses begins (positive
direction: the value > 0 or negative direction: the value < 0).
④ The first Z phase pulse is counted from.
⑤ When counting to the Nth Z phase pulse, the axis stops immediately.

6-499
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Mode 4:After Mode 2 is finished, seek the set number of Z phases.


Description of cases under mode 4
The motion starts in the positive direction. As the DOG
point is encountered, the axis starts to decelerate until
Case A the JOG speed is reached and then the search for a
set number of Z phases begins before the axis stops
immediately.
The motion starts in the negative direction; the
Case B deceleration time is less than the duration for the DOG
signal.
The motion starts in the negative direction; the
Case C deceleration time is greater than duration for the DOG
signal.

_6

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion goes on at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the negative direction as CaseB/CaseC shows, the axis accelerates to the JOG speed and then the motion
stops. After that, the axis continues at the JOG speed in the opposite direction and prepares for leaving the DOG
signal.
③ After the DOG signal is left, the search for a set number of Z phase pulses starts (positive direction: the value > 0 or
negative direction: the value < 0)
④ The first Z phase pulse is counted from.
⑤ When counting to the Nth Z phase pulse is completed, the axis stops immediately.

6-500
C ha pt er 6 A p pl i e d In s tr uc t io ns

Mode 5:After Mode 1 is finished, output the offset position.

Description of cases under mode 5

The motion starts in the negative direction. As the


DOG point is encountered, the axis starts to
Case A decelerate until the JOG speed is reached, and then
the offset position is output. When the offset outputs
are completed, the axis stops right away.
The motion starts in the positive direction; the
Case B deceleration time is less than the duration for the
DOG signal.
The motion starts in the positive direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

6__

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion goes on at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the positive direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then stops. After
that, the axis continues at the JOG speed in the opposite direction and prepares for leaving the DOG signal.
③ After the DOG signal is moved away from, the pulses of the number specified by Offset are output (positive
direction: the value > 0 or negative direction: the value < 0).
④ The first offset pulse is output.
⑤ When the Nth offset pulse output is completed, the axis stops immediately.

6-501
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Mode 6:After Mode 2 is finished, output the offset position.

Description of cases under mode 6

The motion starts in the positive direction. As the


DOG point is encountered, the axis starts to
Case A decelerate until the JOG speed is reached and then
the offset position is output. When the offset outputs
are completed, the axis stops right away.
The motion starts in the negative direction; the
Case B deceleration time is less than the duration for the
DOG signal.
The motion starts in the negative direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

_6

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion goes on at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the negative direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then it stops. After
that, the axis continues at the JOG speed in the opposite direction and prepares for leaving the DOG signal.
③ After the DOG signal is moved away from, the pulses of the number specified by Offset are output (positive
direction: the value > 0 or negative direction: the value < 0).
④ The first offset pulse is output.
⑤ When the Nth offset pulse output is completed, the axis stops immediately.

6-502
C ha pt er 6 A p pl i e d In s tr uc t io ns

Mode 7:After Mode 1 is finished, seek the set number of Z phases and then output the offset position.

Description of cases under mode 7

The motion starts in the negative direction. As the DOG


point is encountered, the axis starts to decelerate until
the JOG speed is reached and then the search for Z
Case A
phases starts. After the last Z phase is counted to, the
offset position output begins. When offset outputs are
completed, the axis stops right away.
The motion starts in the positive direction; the
Case B deceleration time is less than the duration for the DOG
signal.
The motion starts in the positive direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

6__

① The DPUZRN instruction is started and the motion accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion goes on at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the positive direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then stops. After
that, the axis continues at the JOG speed in the opposite direction and prepares for moving away from the DOG
signal.
③ After the DOG signal is moved away from, the search for a set number of Z phases (positive direction: the value > 0
or negative direction: the value < 0).
④ The first Z phase pulse is counted from.
⑤ When counting to the Nth Z phase pulse, the first offset pulse output starts (positive direction: the value > 0 or
negative direction: the value < 0).
⑥ When the Nth offset pulse output is completed, the axis stops immediately.

6-503
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Mode 8:After Mode 2 is finished, seek the set number of Z phases and then output the offset position.
Description of cases under mode 2
The motion starts in the positive direction. As the DOG
point is encountered, the axis starts to decelerate until
the JOG speed is reached and then the search for Z
Case A
phases starts. After the last Z phase is counted to, the
offset position output begins. When offset outputs are
completed, the axis stops right away.
The motion starts in the negative direction; the
Case B deceleration time is less than the duration for the DOG
signal.
The motion starts in the negative direction; the
Case C deceleration time is greater than the duration for the
DOG signal.

_6

① The DPUZRN instruction is started and the axis accelerates from the speed specified by JogSpeed to the target
speed specified by TarSpeed (positive direction: the value > 0 or negative direction: the value < 0) and then the
motion goes on at the target speed.
② After the DOG signal appears, the DOG signal is left in the following directions according to the selected mode.
 In the previous direction as Case A shows, the axis decelerates to the JOG speed and then prepares for leaving
the DOG signal.
 In the negative direction as CaseB/CaseC shows, the axis decelerates to the JOG speed and then stops. After
that, the axis continues at the JOG speed in the opposite direction and prepares for moving away from the DOG
signal.
③ After the DOG signal is moved away from, the search for a set number of Z phases (positive direction: the value > 0
or negative direction: the value < 0).
④ The first Z phase pulse is counted from.
⑤ When counting to the Nth Z phase pulse, the first offset pulse output starts (positive direction: the value > 0 or
negative direction: the value < 0).
⑥ When the Nth offset pulse output is completed, the axis stops immediately.

Example

Refer to the description of DPUDRI instruction (API 1405) for more information.

6-504
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1408 D PUJOG Module - ErrCode PU module jog output

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

JogSpeed   

Busy    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

Module  
Axis  
JogSpeed  
Busy 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol 6__
Module : Module number

Axis : Output axis number

JogSpeed : Jog output frequency


Busy : Output in execution
Error : Error flag
ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would decelerate to stop.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

6-505
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. JogSpeed sets the jog output frequency. The setting value is a signed 32 bit value within the range of -200,000

(-200K) ~200,000 (200K) (Hz). When the value is greater than 0, the output will go in the positive direction (and the

direction output point is off). When the value is less than 0, the output will go in the negative direction (and the

direction output point is on). When the value is 0, the output will stop.

6. The instruction can be used for the speed change. While the instruction is being executed, you can change the

value of TarSpeed so as to change the output speed. When the setting value exceeds the maximum frequency, the
instruction would be executed at the maximum frequency. But changing the speed would not change the direction.

To change the direction, set the value of TarSpeed to 0 first and then modify the target speed.

7. The instruction can be used with the software and hardware limit points. When the limits are triggered, the output

stops immediately and the Error flag changes to ON.

8. If any error occurs as the instruction is in process of the output, the Error flag changes to ON. Refer to the error

codes that ErrCode shows for the trouble shooting.


_6
9. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

16#1403 There is no such output axis number in the PU module.

The output axis specified by the PU module is outputting data. It is not allowed to specify
16#1405
the output repeatedly.

16#1406 PU module stops Output pulse when the positive limit is reached.

16#1407 PU module stops Output pulse when the negative limit is reached.

10. See the output timing diagram as below. (Jog_in is the switch to start the instruction and the Busy flag is the Busy
flag.)

6-506
C ha pt er 6 A p pl i e d In s tr uc t io ns

Jog_in

Busy flag
J ogSpeed > 0 Incr ea se Decr ea se

0 Time

Incr ea se Decr ea se
J ogSpeed < 0

11. After the PUJOG instruction is disabled and the Busy flag is off, other output control can be carried out.

Example

1. When M0 is ON, the DPUCONF instruction for axis 1 is executed to modify the parameters by setting Mode to 1

(Pulse Y0 + direction Y1), SSpeed to 200Hz, Atime to 200ms, Dtime to 200ms and MSpeed to 100kHz. After the
output of Done is completed, M1 is ON.

2. When M10 is ON, the DPUJOG instruction for axis 1 starts to perform jog outputs. The pulses are output from Y0 at

the frequency of 2KHz. If Y1 is OFF, the direction is positive. And M11 is ON during the instruction execution.

6__

6-507
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1409 D PUMPG Module ~ ErrCode PU module MPG output

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

InMode   

InPulse 

InSpeed 

Rate  

OPulse 

OSpeed 

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
InMode  
InPulse  
_6 InSpeed  
Rate 
OPulse  
OSpeed  
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

6-508
C ha pt er 6 A p pl i e d In s tr uc t io ns

Symbol

Module : Module number

Axis : Output axis number


Encoder input mode and |frequency |multiplication for
InMode :
counting
InPulse : Number of pulses which have been input
InSpeed : Detected input frequency
Rate : Input/output rate (floating point number)

OPulse : Number of pulses which have been output


OSpeed : Frequency at which pulses are being output

Error : Error flag


ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the output of pulses

uncompleted would decelerate to stop.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.
6__
For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2

output of the specified PU module respectively. If the PU module has no corresponding axis number for output, the

error flag Error will change to ON.

5. InMode sets the input mode of the encoder source and the frequency |multiplication for counting.

See the explanation of InMode value in the following table.

Input Modes
Value
Input mode; set as the following values, otherwise the module will use the defaults to run.
Fourfold frequency A/B phase input (default).
16#0000 Phase A leads phase B, indicating counting in the positive direction.
Phase B leads phase A, indicating counting in the negative direction.
16#0001 Onefold frequency A/B phase input.

6-509
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Input Modes
Value
Input mode; set as the following values, otherwise the module will use the defaults to run.
Phase A leads phase B, indicating counting in the positive direction.
Phase B leads phase A, indicating counting in the negative direction.
Twofold frequency A/B phase input.
16#0002 Phase A leads phase B, indicating counting in the positive direction.
Phase B leads phase A, indicating counting in the negative direction.
16#0003 Reserved
Fourfold frequency A/B phase input
16#0004 Phase A leads phase B, indicating counting in the positive direction.
Phase B leads phase A, indicating counting in the negative direction.
Pulse + directional input (A+/A-: pulse input; B+/B-: directional input)

Phase B ON: counting in the negative direction


16#0005
Phase B OFF: counting in the positive direction
Phase A: counting is started by rising-edge trigger.
Pulse + directional input (A+/A-: pulse input; B+/B-: directional input)

Phase B ON: counting in the positive direction


16#0006
Phase B OFF: counting in the negative direction
Phase A: counting is started by rising-edge trigger.
Single phase pulse input (A+/A-: pulse input)
16#0007
Phase A: counting is started by rising-edge trigger.
Others Reserved

6. InPulse displays the number of already input pulses, which is a signed 32-bit value. Every time the instruction is
_6
started, the PU module will automatically clear the value to 0 and then starts counting.

7. InSpeed displays the already detected input frequency which is a 32-bit value. The basic time for the frequency
detection is 20ms. Therefore, the detected input frequency is 0 if there is no counting value within 20ms. If there is a

counting value within 20ms, the output starts at the minimum frequency of 50Hz. Even if OSpeed value is lower

than 50Hz through the Rate-value-based conversion, the output is still conducted at 50Hz.

8. Rate is the input / output rate and the value is a floating point number. The number of actual output pulses and

frequency are respectively equal to the input pulse number and frequency multiplied by the rate value.

For example: The input frequency is 100Hz and rate is 0.5. So the output frequency is 100x0.5=50Hz. If the

maximum output frequency after conversion exceeds 100KHz, the output frequency is limited to 100KHz.

Note: The long-time maximum frequency output may lead to the fact that as the MPG has stopped running, the

number of outputs is still increased and the output need keep going until it is complete.

9. OPulse shows the number of pulses which have been output. OSpeed displays the frequency at which the output is

being conducted. They are signed 32-bit values.

6-510
C ha pt er 6 A p pl i e d In s tr uc t io ns

10. When the DPUMPG instruction is disabled, check the frequency at which the output is being conducted and see if it

has reached 0. If the instruction is disabled before the frequency reaches 0, the PU module will stop the output

immediately and the output of the pulses which are counted based on the conversion rate will not continue any

more.

11. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

16#1403 There is no such output axis number in the PU module.

The output axis specified by the PU module is outputting data. It is not allowed to specify
16#1405
the output repeatedly.

16#1406 PU module stops Output pulse when the positive limit is reached.

16#1407 PU module stops Output pulse when the negative limit is reached.

12. When the DPUMPG instruction is enabled or disabled, the PLC will have to notify the module to enable or disable

the high-speed counter function. Thus the instruction can not be used with API1410 DPUCNT together. Otherwise it

may occur that the two instructions enable or disable the counting of the module with each other.

6__

6 - 5 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


High-speed counter function of PU
1410 D PUCNT Module ~ ErrCode
module

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

InMode   

Period   

ZeroS     

InPulse 

InSpeed 

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
InMode  
Period  
ZeroS 
InPulse  
InSpeed  
_6 Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Module : Module number


Encoder input mode and frequency multiplication
InMode :
for counting
Period : Period time for capturing the frequency

ZeroS : Clear the counter to 0


InPulse : Number of pulses which have been input
InSpeed : Number of pulses per cycle

Error : Error flag


ErrCode : Error code

6-512
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. When En is set to ON, this instruction would be effective. Once En changes to OFF, the counting would stop

immediately.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules. If the specified module is not a PU module, the error flag Error will

change to ON.

4. InMode sets the input mode of the encoder source and the frequency |multiplication for counting.

See the explanation of InMode value in the following table.

Note: Phase A leads phase B, indicating counting in the positive direction.

Phase B leads phase A, indicating counting in the negative direction

Input Modes
Value
Input mode; set as the following values, otherwise the module will use the defaults to run. 6__
16#0000 Reserved

16#0001 Onefold frequency A/B phase input

16#0002 Twofold frequency A/B phase input

16#0003 Reserved

16#0004 Fourfold frequency A/B phase input (default)

Pulse + directional input (A+/A-: pulse input; B+/B-: directional input)

Phase B ON: counting in the negative direction


16#0005
Phase B OFF: counting in the positive direction

Phase A: counting is started by rising-edge trigger.

Pulse + directional input (A+/A-: pulse input; B+/B-: directional input)

Phase B ON: counting in the positive direction


16#0006
Phase B OFF: counting in the negative direction

Phase A: counting is started by rising-edge trigger.

Single phase pulse input (A+/A-: pulse input)


16#0007
Phase A: counting is started by rising-edge trigger.

6-513
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Input Modes
Value
Input mode; set as the following values, otherwise the module will use the defaults to run.

Others Reserved

5. Period is the setting value of a cycle time for capturing the frequency within the range of 10ms ~ 1000ms. If the

setting value exceeds the range, the maximum value or minimum value will be automatically taken as the setting

value by the PLC.

6. ZeroS clears the present output position to 0. If the present axis position is to be cleared to 0, set ZeroS from OFF

to ON when the instruction is started.

7. InPulse is the number of already input pulses, which is a signed 32-bit value. The counting value is a latched value.

If the value need be cleared to 0, just set ZeroS from Off to ON while the instruction is running.

8. InSpeed displays the counting value for every Period time, which is a signed 32-bit value. If you need convert it into

the value with the unit of Hz, use the calculation formula for conversion by yourself.

9. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

10. When the DPUCNT instruction is enabled or disabled, the PLC will have to notify the module to enable or disable
_6
the high-speed counter function. Thus the instruction can not be used with API1409 DPUMPG together. Otherwise it
may occur that the two instructions enable or disable the counting of the module with each other.

Example

1. When M0 is ON, the DPUCNT instruction is executed and InMode is set to “twofold frequency A/B phase input”.

2. When M1 is ON, the counted number of pulses on axis 1 in InPulse is cleared.

3. When the input number of pulses is 100 and frequency is 10Hz, InPulse and InSpeed show 200 pulses and 20Hz

respectively.

6-514
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1428 PUX P Module ~ Error,ErrCode Setting PU module input point mode

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Xno   

XMode   

Xfilter   

Done    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Xno  
XMode  
Xfilter  
Done 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction 6__


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol

Module : Module number


Xno : Input point number
XMode : Input point mode
Xfilter : Input point filter time
Done : Completion flag
Error : Error flag
ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. The timing to set this instruction is when the En changes from OFF to ON.

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

6-515
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules, but is not applicable to the PU modules at the right of the remote

module. If the specified module is not a PU module, the error flag Error will change to ON.

4. Xno sets the input point number for the PU module with one of the input values 0~4 which respectively represent

the input points X0~X4. If there is no corresponding input point in the PU module, the error flag Error will change to

ON. The value in Xno and the corresponding input point are listed in the following table.

Setting in Xno 0 1 2 3 4 Others

DVP02PU-E2
X0 X1 X2 X3 X4 No input point
DVP02PU-SL

5. XMode selects an input mode for input points. Setting values are explained in the following table:

Setting in XMode DVP02PU-E2 / DVP02PU-SL

0 General input (Default)

1 Axis 1, Z phase, Rising-edge triggered

2 Axis 2, Z phase, Rising-edge triggered

3 Axis 1, Z phase, Falling-edge triggered

4 Axis 2, Z phase, Falling-edge triggered


_6 5 Axis 1, DOG, Rising-edge triggered

6 Axis 2, DOG, Rising-edge triggered

7 Axis 1, DOG, Falling-edge triggered

8 Axis 2, DOG, Falling-edge triggered

9 Axis 1, LSN, Rising-edge triggered

10 Axis 2, LSN, Rising -edge triggered

11 Axis 1, LSN, Falling-edge triggered

12 Axis 2, LSN, Falling-edge triggered

13 Axis 1, LSP, Rising-edge triggered

14 Axis 2, LSP, Rising-edge triggered

15 Axis 1, LSP, Falling-edge triggered

16 Axis 2, LSP, Falling-edge triggered

Other Automatically switch to mode 0 (default)

6-516
C ha pt er 6 A p pl i e d In s tr uc t io ns

6. Xfilter is explained in the following table. The value in Xfilter is the default value if the setting is out of the allowed

range.

Parameter Function Range Default

Xfilter Input point filter time 0 ~ 25 (unit:ms) 10

7. Done, an output of the specified PU module has been set as the completion flag. When Done is On, it indicates that

the parameter setting is successful. You can continue to perform positioning output based on the state of the

completion flag (ON). The clearing of the Done flag need be conducted by manual. The Done flag changes to ON

only when the setting is completed.

8. Error, an output of the specified PU module is a parameter error flag. Most parameter ranges are filtered

automatically by the PLC. Thus if the error flag is ON, it means that there is no specified PU module or the PU

module number is wrong or the output axis number is incorrect.

9. The instruction is a pulse instruction. Even if the A contact is adopted as the condition contact, PU module

parameters are also set only when the instruction is started. Therefore, if a parameter value is to be updated, restart

the instruction to make the parameter set again.

10. Since the set parameters are delivered through the module communication command, confirm the state of the

output Done or Error before a parameter value is modified and then proceed with relevant operations.

11. For the state of PU module input points, check the data exchange function of the special extension module, SM228.

Refer to Section 2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data Registers in 6__
DVP-ES3/EX3/SV3/SX3 Series Programming Manual for details on SM228.

12. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

Example

Refer to the description of DPUDRI instruction (API 1405) for more information.

6-517
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1429 D PULS P Module ~ Error,ErrCode Setting PU module software limits

Device X Y M S T C HC D FR SM SR E K 16# “$” F

Module   

Axis   

LSN   

LSP   

Done    

Error    

ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Module  
Axis  
LSN  
LSP  
Done 
Error 
ErrCode  

_6 Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3
Symbol

Module : Module number


Axis : Output axis number
LSN : Software negative limit
LSP : Software positive limit
Done : Completion flag
Error : Error flag
ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or

later/DIADesigner V1.30 or later, as well as available for ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later,

which works with DIADesigner V1.30 or later.

2. The timing to set this instruction is when the En changes from OFF to ON.

6-518
C ha pt er 6 A p pl i e d In s tr uc t io ns

3. Module sets the serial number of modules at the right of the PLC. The first one is number 1, the second one is

number 2 and so on. Whatever modules at the right of the PLC must be numbered. The maximum number is 8.

For SV3/SX3 series, they support left-side extension modules. The first one of the extension modules connected on

the left side of the SV3/SX3 CPU is number 100, and the second one is number 101 and so on. And the maximum

number of modules that can be connected is 8. (Setting range: 100-107)

The instruction is exclusive to the PU modules, but is not applicable to the PU modules at the right of the remote

module. If the specified module is not a PU module, the error flag Error will change to ON.

4. Axis sets the output axis number for the specified PU module. The setting values 1~2 represent the axis1~axis2 of

the specified PU module respectively. If the PU module has no corresponding axis number for output, the error flag

Error will change to ON.

See the following combination of axis numbers and corresponding output points of PU modules.

PU module name Axis 1 Axis 2

DVP02PU-E2 /DVP02PU-SL Y0 / Y1 Y2 / Y3

5. See the explanation of LSN and LSP and setting values in the following table. If the setting value is outside the

range, the instruction will automatically be executed at the minimum or maximum value.

Parameter Function Range Default Remark

LSN Software negative limit -2,147,483,648 ~ +2,147,483,647 0 Inactive when both

LSP Software positive limit -2,147,483,648 ~ +2,147,483,647 0 are set to 0

6. Done, an output of the specified PU module has been set as the completion flag. When Done is On, it indicates that

the parameter setting is successful. You can continue to perform positioning output based on the state of the
6__
completion flag (ON). The clearing of the Done flag need be conducted by manual. The Done flag changes to ON

only when the setting is completed.

7. Error, an output of the specified PU module is a parameter error flag. Most parameter ranges are filtered

automatically by the PLC. Thus if the error flag is ON, it means that there is no specified PU module or the PU

module number is wrong or the output axis number is incorrect.

8. The instruction is a pulse instruction. Even if the A contact is adopted as the condition contact, PU module

parameters are also set only when the instruction is started. Therefore, if a parameter value is to be updated, restart

the instruction to make the parameter set again.

9. Since the set parameters are delivered through the module communication command, confirm the state of the

output Done or Error before a parameter value is modified and then proceed with relevant operations.

10. The error codes that ErrCode shows are listed in the following table.

Error code Description

16#1400 The module does not support the function.

16#1402 There is no response from the module; communication timeout occurs.

Example

Refer to the description of DPUDRI instruction (API 1405) for more information.

6-519
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

Low-pass filter for analog input


1430 MLPF Group ~ ErrCode
signals

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Group   
Module   
ChNo   
Fcutoff   
Error    
ErrCode 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

Group  
Module  
ChNo  
Fcutoff  
Error 
ErrCode  

Pulse instruction 16-bit instruction 32-bit instruction


- EX3/SX3 -

Symbol

_6 Group : Group number

Module : Module number

ChNo : Channel number

Fcutoff : Cutoff frequency

Error : Error flag

ErrCode : Error code

6-520
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. The instruction provides the function of a digital low-pass filter for PLC’s built-in analog input signals. And it needs to

work with DIADesigner V1.30 or later.

The firmware versions of the required device:

Item Model Firmware

PLC with built-in AD Major: V1.00 or later


EX3/SX3
channels Minor: V2.00 or later

2. After enabling the MLPF instruction, the input value corresponding to the channel changes from the original average

value to the result of the digital filter.

3. For the assigned device, if the MLPF instruction is enabled for any of the channels, the sampling time of all analog

channels will be specified mandatorily and the original sampling time setting will be invalid. If the MLPF instruction is

disabled, then the sampling will be conducted according to original sampling time setting.

Model name PLC’s built-in AD

Sampling time specified


2 ms
mandatorily

4. Group must set the group number to 0.

5. Module must set the module number to 0.

6. ChNo sets the channel number to enable the low-pass filter.

ChNo Description
1 Analog input channel 1 built in the PLC CPU 6__
2 Analog input channel 2 built in the PLC CPU
3 Analog input channel 3 built in the PLC CPU
4 Analog input channel 4 built in the PLC CPU

7. Fcutoff is the cut-off frequency of the low-pass filter and the setting range is as follows:

Range
Model name Characteristic
of Fcutoff value
EX3 0 -3 dB (Amplitude ratio: 0.707)
(with built-in AI/AO 5~100, unit: Hz
-20
channels)
Magnitude (dB)

Slope: -40dB/decade
-40

-60

SX3 -80
(with built-in AI/AO 5~50, unit: Hz
-100
channels)
0.001fc 0.01fc 0.1fc fc 10fc 100fc
Frequency

6-521
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

8. Before modifying any parameters during execution, you need to disable MLPF instruction first. After the modification
is complete, enable the instruction again.
9. Refer to the following table for the description of error codes (ErrCode) when the error flag Error is ON.
Error code Description

0x1400 The function is not supported by the device.


0x1401 The group number or module number setting is incorrect.
0x1402 There is no such channel.
0x1403 Fcutoff value exceeds the setting range.
The digital low-pass filter function for the specified channel has been enabled.
0x1405
Repeatedly specifying the same channel is not allowed.

Example

1. Take EX3’s built-in analog input channel 1 as an example, setting the input parameters: Group = 0, Module = 0,
ChNo = 1, Fcutoff = 10 (Hz).
2. The frequency of the digital low-pass filter corresponds to the magnitude as follows.

0 -3 dB (Amplitude ratio: 0.707)

-20
Magnitude (dB)

Slope: -40dB/decade
-40

-60

-80

_6 -100

0.001 0.01 1 10 100 1000


Frequency (Hz)

3. Input the signal for testing:


The 5Vdc + 60Hz sinusoidal wave is a blue waveform as below (peak-to-peak: 4V).
After the signal passes through the low-pass filter, a red waveform is output. It can be seen that the 60Hz sinusoidal
wave is attenuated and what is left is the 5Vdc direct current in the curve.

8
Voltage (V)

2 Input Siganl
Filtered Signal

0 Time t

6-522
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.16 Floating-point Number Instructions


6.16.1 List of Floating-point Number Instructions
The following table lists the Module instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1500 – FSIN  Sine of a floating-point number

1501 – FCOS  Cosine of a floating-point number

1502 – FTAN  Tangent of a floating-point number

1503 – FES3IN  Arcsine of a floating-point number

1504 – FACOS  Arccosine of a floating-point number

1505 – FATAN  Arctangent of a floating-point number

1506 – FSINH  Hyperbolic sine of a floating-point number

1507 – FCOSH  Hyperbolic cosine of a floating-point number

1508 – FTANH  Hyperbolic tangent of a floating-point number

1509 – FRAD  Converting degrees to radians

1510 – FDEG  Converting radians to the degrees

1511 SQR DSQR  Square root of a binary number


6_
1512 – FSQR  Square root of a floating-point number

1513 – FEXP  Exponentiation of a floating-point number

1514 – FLOG  Logarithm of a floating-point number

1515 – FLN  Natural logarithm of a binary floating-point number

1516 – FPOW  Power of a floating-point number

1517 RAND –  Generating a random number

6-523
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.16.2 Explanation of Floating-point Number Instructions

API Instruction code Operand Function

1500 FSIN P S, D Sine of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Sine value

Explanation

1. This instruction finds the sine of the value in S and stores it in D. The state of SM695 determines whether the source
_6 value in S is in radians or degrees.

2. If SM695 is OFF, the source value is S in radians


Radian=Degree×π/180.

3. If SM695 is ON, the source value in S is in degrees.

Degree=Radian×180/π. (0o≦Degree≦3600)

4. If the conversion result is zero, SM600 is ON.

5. The following graph shows the relation between radian and sine values.

6-524
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the FRAD instruction converts a floating-point number in (D11, D10) into radians, and stores the

conversion result in (D21, D20). The FSIN instruction finds the sine of the radian value in (D21, D20), and stores it in (D31,

D30). The sine value is a floating-point number.

D11~D10 F RAD D21~D20 F SIN D31~D30


R90 R1.570796 R1
F loating- point F loating-point Floating-point
number number number

Note: “R” indicates REAL type data.

Additional remarks

1. If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is 6_
not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If SM695 is ON, and the value in S is not between 0–360, the instruction is not executed, SM0 is ON, and the error
code is 16#2003.

6-525
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1501 FCOS P S, D Cosine of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Cosine value

Explanation

1. This instruction finds the cosine of the value in S and stores it in D. The state of SM695 determines whether the

_6 source value in S is in radians or degrees.

2. If SM695 is OFF, the source value in S is in radians.

Radian=Degree×π/180.

3. If SM695 is ON, the source value in S is in degrees.

Degree=Radian×180/π. (0o≦Degree≦3600)

4. If the conversion result is zero, SM600 is ON.

5. The following graph shows the relation between radians and cosine values.

6-526
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the FRAD instruction converts a floating-point number in (D11, D10) into radians, and stores the

conversion result in (D21, D20). The FCOS instruction finds the cosine of the radian value in (D21, D20) and stores it in

(D31, D30). The cosine value is a floating-point number.

D11~D10 F RAD D21~D20 F COS D31~D30


R360 R6.283185 R1
F loating- point Floating-point Floati ng-point
number number number

Note: "R” indicates REAL type data.

Additional remarks

1. If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is 6_
not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If SM695 is ON, and the value in S is not between 1–360, the instruction is not executed, SM0 is ON, and the error

code is 16#2003.

6-527
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1502 FTAN P S, D Tangent of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Tangent value

Explanation

1. This instruction finds the tangent of the value in S and stores it in D. The state of SM695 determines whether the
source value in S is in radians or in degrees.

_6 2. If SM695 is OFF, the source value in S is in radians.

Radian=Degree×π/180.

3. If SM695 is ON, the source value in S is in degrees.

Degree=Radian×180/π. (0o≦Degree≦3600)

4. If the conversion result is zero, SM600 is ON.

5. The following graph shows the relation between radians and tangent values.

6-528
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the FRAD instruction converts the floating-point number in (D11, D10) into radians, and stores the

conversion result in (D21, D20). The FTAN instruction finds the tangent of the radian value in (D21, D20) and stores it in

(D31, D30). The tangent value is a floating-point number.

D11~D10 FRA D D21~D20 FTA N D31~D30


R56 R0.785398 R1
F loating-point F loating- point Floati ng-point
number number number

Note: "R” indicates REAL type data.

Additional remarks 6_
1. If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If SM695 is ON, and the value in S is not between 0–360, the instruction is not executed, SM0 is ON, and the error

code is 16#2003.

6-529
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1503 FES3IN P S, D Arcsine of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Arcsine value

Explanation

1. This instruction finds the arcsine of the value in S and stores it in D. Arcsine value=sin-1

_6 The following graph shows the relation between sine and arcsine values.

2. If the conversion result is zero, SM600 is ON.

6-530
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the instruction finds the arcsine of the floating-point number in (D1, D0) and stores it in (D11, D10). The

FDEG instruction converts the arcsine value in (D11, D10) into degrees, and stores the conversion result in (D21, D20).

D0 FASIN D11~D10 FDEG D21~D20


R1 R1.570796 R90
F loating- point Floating-point Floating-point
number number number

Note: "R” indicates REAL type data.

Additional remarks
6_
1. The floating-point number specified by the operand S must be between –1.0 to 1.0. If the floating-point number is

not in that range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2013.

6-531
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1504 FACOS P S, D Arccosine of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Arccosine value

Explanation

1. This instruction finds the arccosine of the value in S and stores it in D. Arccosine value=cos-1

The following graph shows the relation between cosine and arccosine values.

_6

2. If the absolute value of the conversion result is larger than the value that can be represented by the maximum

floating-point number, SM602 is ON.

3. If the absolute value of the conversion result is less than the value that can be represented by the minimum

floating-point number, SM601 is ON.

4. If the conversion result is zero, SM600 is ON.

6-532
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the FACOS instruction finds the arccosine of the floating-point number in (D1, D0) and stores it in (D11,

D10). The FDEG instruction converts the arccosine value in (D11, D10) into degrees, and stores the conversion result in

(D21, D20).

D0 FACOS D11~D10 FDEG D21~D20


R-1 R3.141592 R180
F loating- point Floating-point Floating-point
number number number

Note: "R” indicates REAL type data.

Additional remarks

1. The floating-point number specified by the operand S must be between –1.0 to 1.0. If the floating-point number is 6_
not in the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2013.

6-533
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1505 FATAN P S, D Arctangent of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Arctangent value

Explanation

1. This instruction finds the arctangent of the value in S and stores it in D. Arctangent value=tan-1

_6 2. The following graph shows the relation between tangent and arctangent values.

3. If the conversion result is zero, SM600 is ON.

6-534
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the FATAN instruction finds the arctangent of the floating-point number in (D1, D0) and stores it in (D11,

D10). The FDEG instruction converts the arctangent value in (D11, D10) is converted into degrees, and stores the

conversion result in (D21, D20).

D0 FATAN D11~D10 FDEG D21~D20


R1 R0.785398 R45
F loating- point F loating-point Floati ng-point
number number number

Note: "R” indicates REAL type data.

Additional remarks
6_
If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6-535
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1506 FSINH P S, D Hyperbolic sine of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S :

D :

Explanation

1. This instruction finds the hyperbolic sine of the value in S and stores it in D. Hyperbolic sine value=(es-e-s)/2.

2. If the absolute value of the conversion result is larger than the value that can be represented by floating-point

_6 numbers, the value in D is 16#7F800000, and SM602 is ON.

3. If the absolute value of the conversion result is less than the value that can be represented by floating-point

numbers, the value in D is 16#FF800000, and SM601 is ON.

4. If the conversion result is zero, SM600 is ON.

Example

1. When M0 is ON, the instruction finds the hyperbolic sine of the floating-point number in (D1, D0) and stores it in
(D11, D10). The hyperbolic sine value in (D11, D10) is a floating-point number.

6-536
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

S D1 D0 Single-precision
floating-point number

D D11 D10 Hyperbolic sine value

2. If the absolute value of the conversion result is larger than the value that can be represented by floating-point
numbers, SM602 is ON.

3. If the absolute value of the conversion result is less than the value that can be represented by floating-point
numbers, SM601 is ON.

4. If the conversion result is zero, SM600 is ON.

Additional remarks

If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6_

6-537
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Hyperbolic cosine of a floating-point
1507 FCOSH P S, D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Hyperbolic cosine value

Explanation

1. This instruction finds the hyperbolic cosine of the value in S and stores it in D. Hyperbolic cosine value=(es+e-s)/2.

2. If the absolute value of the conversion result is larger than the value that can be represented by floating-point

_6 numbers, the value in D is 16#7F800000, and SM602 is ON.

3. If the absolute value of the conversion result is less than the value that can be represented by floating-point

numbers, the value in D is 16#FF800000, and SM601 is ON.

4. If the conversion result is zero, SM600 is ON.

Example

1. When M0 is ON, the instruction finds the hyperbolic cosine of the floating-point number in (D1, D0) and stores it in

(D11, D10). The hyperbolic cosine value in (D11, D10) is a floating-point number.

6-538
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

S D1 D0 Single- pr ecision
floating-point number

D D11 D10 Hy perbolic c osine value

2. If the absolute value of the conversion result is larger than the value that can be represented by floating-point

numbers, SM602 is ON.

3. If the absolute value of the conversion result is less than the value that can be represented by floating-point

numbers, SM601 is ON.

4. If the conversion result is zero, SM600 is ON.

Additional remarks

If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6_

6-539
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Hyperbolic tangent of a floating-point
1508 FTANH P S, D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Hyperbolic tangent value

Explanation

1. This instruction finds the hyperbolic tangent of the value in S and stores it in D.
Hyperbolic tangent value=(es-e-s)/(es+e-s).

_6 2. If the conversion result is 0, SM600 is ON.

Example

1. When M0 is ON, the instruction finds the hyperbolic tangent of the floating-point number in (D1, D0) and stores it in

(D11, D10). The hyperbolic tangent value in (D11, D10) is a floating-point number.

Single-pr ecision
S D1 D0
floating-point number

D D11 D10 Hyperbolic tangent value

2. If the conversion result is zero, SM600 is ON.

6-540
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6_

6-541
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1509 FRAD P S, D Converting degrees to radians

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value (in degrees)

D : Conversion result (in radians)

Explanation

1. This instruction converts the degrees value in S into radians, and stores it in D.

_6
2. Radian=Degree×(π/180).

3. If the conversion result is zero, SM600 is ON.

Example

When M0 is ON, the instruction converts the degree value in (D1, D0) to the radians value, and stores the conversion

result in (D11, D10). The radian in (D11, D10) is a floating-point number.

6-542
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Degree
S D1 D0
Floating- point number

D D11 D10 Radian (Degree ×π/180 )


Floating-point number

Additional remarks

If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6_

6-543
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1510 FDEG P S, D Converting radians to degrees

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value (in radians)

D : Conversion result (in degrees)

Explanation

1. This instruction converts the radians value in S to degrees, and stores it in D.

2. Degree=Radian×(180/π).

_6
3. If the absolute value of the conversion result is larger than the value that can be represented by floating-point

numbers, the value in D is 16#7F7FFFFF.

4. If the absolute value of the conversion result is less than the value that can be represented by floating-point

numbers, the value in D is 16#7F7FFFFF.

5. If the conversion result is zero, SM600 is ON.

Example

When M0 is ON, the instruction converts the radians values in (D1, D0) to the degree value, and stores the conversion

result in (D11, D10). The degree in (D11, D10) is a floating-point number.

6-544
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Radian
S D1 D0 Floating-point number

D D11 D10 Degree (Radian ×180 /π )


Floating-point number

Additional remarks

If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2013.

6_

6-545
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1511 D SQR P S, D Square root of a binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S      
     

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the result is stored

Explanation

_6 1. This instruction calculates the square root of the value in S, and stores the result in the device specified by D.

2. The operation result stored in D is an integer. If a floating-point number is rounded down to the nearest whole digit,

SM601 is ON.

3. If the operation result stored in D is 0, SM600 is ON.

4. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example

When M0 is ON, the instruction calculates the square root of the value in D0, and stores the result in D10.

6-546
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Additional remarks

The value in S only can be a positive value. If the value in S is a negative value, an operation error occurs, the instruction

is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6_

6-547
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1512 FSQR P S, D Square root of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the result is stored

Explanation

1. This instruction calculates the square root of the floating-point number in S, and stores the result in the device
specified by D.

_6 2. If the operation result stored in D is 0, SM600 is ON.

Example 1

When M0 is ON, the instruction calculates the square root of the floating-point number in (D1, D0), and stores the result in

(D11, D10).

Additional remarks

The value in S only can be a positive value. If the value in S is a negative value, an operation error occurs, the instruction

is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-548
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1513 FEXP P S, D Exponentiation of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value (exponent)

Device where the operation result is


D :
stored

Explanation

1. This function calculates the value of the number e raised to the power in S. Exponentiation involves two numbers,
the base e which represents 2.71828, and the exponent in S.

2. EXP[D+1, D]=[S+1, S]. 6_


3. The number in S can be a positive number or a negative number. The device specified by D should be a 32-bit

register, and the number in the device specified by S should be a floating-point number.

4. The value in the register specified by D is eS (e is 2.71828, and S represents the source value).

5. If the absolute value of the conversion result is larger than the value that can be represented by floating-point

numbers, the value in the register specified by D is 16#7F800000, and SM602 is ON.

6. If the operation result stored in D is 0, SM600 is ON.

Example

1. When M0 is ON, the DFLT instruction converts the value in (D1, D0) into a floating-point number, and stores the

conversion result in (D11, D10).

2. When M1 is ON, the FEXP instruction performs the exponentiation with the value in (D11, D10), and stores the

floating-point number result in (D21, D20).

6-549
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

6-550
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1514 FLOG P S1, S2, D Logarithm of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
D DWORD     

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Base for the logarithm

S2 : Source value
Device where the operation result is
D :
stored
Explanation

1. This instruction calculates the logarithm of the value in S2 with respect to the value in S1, and stores the 6_
single-precision floating-point operation result in D.

2. The values in S1 and S2 only can be positive values.

3. S1D=S2.→D=LogS1S2.

4. Example: suppose the values in S1 and S2 are 5 and 125 respectively. Find log5125 (log base 5 of the number 125).

5. S1D=S2.→5D=125.→D=log5125=3.

6. If the operation result stored in D is 0, SM600 is ON.

Example

1. When M0 is ON, the DFLT instruction converts the values in (D1, D0) and (D3, D2) into the floating-point numbers,
and stores the conversion results in (D11, D10) and (D13, D12) respectively.

2. When M1 is ON, the FLOG instruction calculates the logarithm of the floating-point number in (D13, D12) with
respect to the floating-point number in (D11, D10), and stores the operation result in (D21, D20).

6-551
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

If the value in S1 is less than or equal to 1, or if the value in S2 is less or equal to 0, the instruction is not executed, SM0 is
ON, and the error code in SR0 is 16#2003.

_6

6-552
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Natural logarithm of a binary floating-point
1515 FLN P S, D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S       
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S : Source value

Device where the operation result is


D:
stored

Explanation

1. This instruction calculates the natural logarithm of the operand S in a single-precision floating-point operation.

2. The value in S only can be a positive value.

6_
3. eD=S.→The value in D=lnS.

4. If the operation result stored in D is 0, SM600 is ON.

Example

1. When M0 is ON, the DFLT instruction converts the value in (D1, D0) into the floating-point number, and stores the

conversion result in (D11, D10).

2. When M1 is ON, the FLN instruction calculates the natural logarithm of the floating-point number in (D11, D10), and

stores the operation result in (D21, D20).

6-553
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

If the value in S is less than or equal to 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

_6

6-554
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1516 FPOW P S1, S2, D Power of a floating-point number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D DWORD    

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : Source value

S2 : Exponent value
Device where the operation result is
D :
stored

Explanation

1. This instruction raises the single-precision floating-point number in S1 to the power of the value in S2, and stores the 6_
single-precision floating-point operation result in D.

2. D=POW[S1+1,S1]^[S2+1,S2]

3. The value in S1 only can be a positive value, but the value in S2 can be a positive value or a negative value.

4. Suppose the values in S1 and S2 are 5 and 3 respectively: D=53=125.

5. If the absolute value of the operation result is larger than the value that can be represented by floating-point

numbers, the value in D is 16#7F7FFFFF, and SM602 is ON.

6. If the absolute value of the operation result is less than the value that can be represented by floating-point numbers,

the value in D is 16#FF800000, and SM601 is ON.

7. If the operation result stored in D is 0, SM600 is ON.

6-555
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. When M0 is ON, the DFLT instruction converts the values in (D1, D0) and (D3, D2) into floating-point numbers, and

stores the conversion results in (D11, D10) and (D13, D12) respectively.

2. When M1 is ON, the FPOW instruction raises the floating-point number in (D11, D10) to the power of the

floating-point number in (D13, D12), and stores the operation result in (D21, D20).

3. When M2 is ON, the FBCD instruction converts the binary floating-point number in (D21, D20) into the binary-coded

decimal floating-point number, and stores the conversion result in (D31, D30).

_6

Additional remarks

If the value in S1 is less than 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-556
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1517 RAND P S1, S2, D Generating a random number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1        
S2        
D DWORD     

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Minimum value

S2 : Maximum value

D : Device where the result is stored

Explanation

1. This instruction generates a random number between the minimum value in S1 and the maximum value in S2, and 6_
then stores the result in D.

2. If the value in S1 is larger than the value in S2, the instruction takes the values in S1 and S2 as the maximum value

and the minimum value respectively.

Example

When M0 is ON, the instruction generates a random number between the minimum value in D0 and the maximum value in

D10, and stores the result in D20.

Additional remarks

The values in S1 and S2 must be between 0–32767. If the value in S1 or S2 exceeds the range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-557
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.17 Real-time Clock Instructions


6.17.1 List of Real-time Clock Instructions
The following table lists the Real-time Clock instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1600 TRD –  Reading the time

1601 TWR –  Writing the time

1602 T+ –  Adding the time

1603 T- –  Subtracting the time

1604 HOUR – – Running-time meter

1605 TCMP –  Comparing the time

1606 TZCP –  Time zone comparison

1607 DST –  Daylight saving time

1608 WWON – – Setting up weekly working time setup

_6

6-558
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.17.2 Explanation of Real-time Clock Instructions

API Instruction code Operand Function

1600 TRD P D Reading the time

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : Device where the result is stored

Explanation

1. This instruction reads the current time from the built-in real time clock in the CPU module, and stores the current time
6_
in D.

2. The operand D occupies seven consecutive devices.

3. The built-in real-time clock provides the year, the week, the moth, the day, the minute, and the second. The data is

stored in SR391–SR397.

4. The last two digits of the year number for A.D. are stored in SR391.

Example

When M0 is ON, the instruction reads the current time from the real-time clock into D0–D6. The value 1 in SR397

represents Monday, the value 2 represents Tuesday, and this continues to the value 7 represents Sunday.

6-559
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Special data General data


Item Value Item
register register

SR391 Year (A.D.) 00-99 D0 Year (A.D.)

SR392 Month 1-12 D1 Month

SR393 Day 1-31 D2 Day

SR394 Hour 0-23 D3 Hour

SR395 Minute 0-59 D4 Minute

SR396 Second 0-59 D5 Second

SR397 Week 1-7 D6 Week

Additional remarks

1. If D+6 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. When SM220 is ON, the real-time clock is calibrated within ±30 seconds. If the value of the seconds read from the

real-time clock is between 0–29, the instruction clears the seconds value to zero. If the value of the seconds read

from the real-time clock is between 30–59, the instruction increments the value of the minute by one, and clears the

seconds value to zero.

_6

6-560
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1601 TWR P S Writing the time

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Data source

Explanation

1. This instruction adjusts the built-in real-time clock in the CPU module by writing the correct current time in S into the

built-in real-time clock.

2. The operand S occupies seven consecutive devices. (Use 24 hour time format) 6_

3. The instruction instantly writes the new setting time into the real-time clock in the PLC.

4. Make sure that when the instruction executes, the new setting time in S is consistent with the actual time.

5. It is suggested to use it as a pulse instruction. If the contact is normally open, the instruction is executed to write the

time constantly. But the PLC only writes the time at the first scan. If the built-in real-time clock needs to be updated,

you can close the contact for a scan time and then execute this instruction again to update the clock.

Example

When M0 is ON, the instruction writes the correct current time into the built-in real-time clock in the PLC.

6-561
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

General data Special data


Item Value Item
register register

D20 Year (A.D.) 00-99 SR391 Year (A.D.)

D21 Month 1-12 SR392 Month


New setting time

Real time clock


D22 Day 1-31 SR393 Day

D23 Hour 0-23 SR394 Hour

D24 Minute 0-59 SR395 Minute

D25 Second 0-59 SR396 Second

D26 Week 1-7 SR397 Week

Additional remarks

1. If the value in S exceeds the range, an operation error occurs, the instruction is not executed, SM is ON, and the

error code in SR is 16#2003.

2. If S+6 exceeds the device range, an operation error occurs, the instruction is not executed, SM is ON, and the error

code in SR is 16#2003.

3. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [7] of WORD/INT.

_6

6-562
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1602 T+ P S1, S2, D Adding the time

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Source device 1

S2 : Source device 2

D : Device where the result is stored

Explanation 6_
1. This instruction adds the value of the hour, the minute, and the second in the real-time clock specified by S2 to the

value of the hour, the minute, and the second in the real-time clock specified by S1, and then stores the sum in the

register specified by D.

2. The operands S1, S2, and D each occupy three consecutive devices.

3. If the sum is larger than or equal to 24 hours, SM602 is ON, and the instruction subtracts 24 hours from the sum

before storing the result in D.

4. If the sum is zero (zero hour zero minute zero second), SM600 is ON.

Example

When M0 is ON, the instruction adds the value of the hour, the minute, and the second in D10–D12 to the value of the

hour, the minute, and the second in D0–D2, and stores the sum in D20–D22.

6-563
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

D0 8 ( Hour ) D10 6 ( Hour ) D20 14 ( Hour )


D1 10 ( Minute) + D11 40 ( Minute ) D21 50 ( Minute )
D2 20 ( Second) D12 6 ( Second ) D22 26 ( Second )
8 hour 10 minute 20 second 6 hour 40 minute 6 second 14 hour 50 minute 26 second

Additional remarks

1. If the value in S1 or S2 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#2003.

2. If S1+2, S2+2, or D+2 exceeds the device range, an operation error occurs, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

3. If you declare the operand S1 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

4. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/IN.
_6
5. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

6-564
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1603 T- P S1, S2, D Subtracting the time

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Source device 1

S2 : Source device 2

D : Device where the result is stored

Explanation
6_

1. This instruction subtracts the value of the hour, the minute, and the second in the real-time clock specified by S2

from the value of the hour, the minute, and the second in the real-time clock specified by S1, and stores the

difference in the register specified by D.

2. The operands S1, S2, and D all occupy three consecutive devices.

3. If the difference is a negative, SM601 is ON, and the instruction adds 24 hours to the difference and then stores the

result in D.

4. If the difference is zero (zero hour zero minute zero second), SM600 is ON.

Example

1. When M0 is ON, the instruction subtracts the value of the hour, the minute, and the second in D10–D12 from the

value of the hour, the minute, and the second in D0–D2, and stores the difference in D20–D22.

6-565
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

D0 20 ( Hour ) D10 14 ( Hour ) D20 5 ( Hour )


D1 20 ( Minute) - D11 30 ( Minute ) D21 49 ( Minute )
D2 5 ( Second ) D12 8 ( Second ) D22 57 ( Second )
20 hour 20 minute 5 second 14 hour 30 minute 8 second 5 hour 49 minute 57 second

2. If the difference is a negative, SM601 is ON.

5 ( Ho u r ) 1 9 ( Ho ur ) 10 ( H ou r )
2 0 ( Min u te ) - 11 ( M inu t e ) 9 ( M in ut e )
3 0 ( S e c on d ) 1 5 ( S ec o nd ) 1 5 ( S ec o nd )
5 ho u r 20 m inu te 3 0 s e c on d 1 9 h ou r 11 min ut e 1 5 s e c on d 1 0 h ou r 9 min ut e 1 5 s ec o n d

Additional remarks

1. If the value in S1 or S2 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#2003.

2. If S1+2, S2+2, or D+2 exceeds the device range, an operation error occurs, the instruction is not executed, SM0 is
_6 ON, and the error code in SR0 is 16#2003.

3. If you declare the operand S1 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

4. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

5. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

6-566
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1604 HOUR S, D1, D2 Running-time meter

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S        
D1 
D2     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
D1  
D2 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3

Symbol
Time after which the output
S :
device is ON
D1 : Current time

D2 : Output device

Explanation

1. This instruction switches the output device specified by D2 to ON after the amount of time in S.
6_

2. S: The time after which the output device is ON (Unit: Hour)

The operand S used in the 16-bit instruction must be between 1–32,767.

3. D1: The current time (Unit: Hour). The value in D1 must be between 0–32,767.

D1+1: The current time which is less than one hour (Unit: Second). The value in D1+1 should be between 0–3,599.

D1+2 is for system use only. The value in it cannot be altered when the instruction is executed; otherwise, an error

occurs.

When the current time is 32,767 hour 3,599 second, the timer stops counting. After the values in D1 and D1+1 are

cleared to 0, the timer starts to count again.

4. When the time for which the input contact has been ON reaches the setting time in S, the output device is ON.

Before that the output device is not ON. This function allows you to manage the running time of the machine and

maintenance.

5. After the output device is ON, the timer continues to count.

6-567
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. When using on-line editing, reset the conditional contact to initialize the instruction.

Example

When M0 is ON, the instruction timer starts to count. When the time for which M0 has been ON reaches 100 hours, M10 is

ON. The current time is recorded in D0, and the current time which is less than one hour is recorded in D1. D2 is for

system use. The value in it cannot be altered; otherwise, an error occurs.

Additional remarks

1. When S is less than or equal to 0, the instruction is not executed, and the state of the output device is unchanged.

2. If the value in D1 is less than 0, the state of the output device is unchanged.

3. If D1+2 exceeds the device range, an operation error occurs, the instruction is not executed, SM0 is ON, and the
_6 error code in SR0 is 16#2003.

4. If you declare the operand D1 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

6-568
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1605 TCMP P S1, S2, S3, S, D Comparing the time

Device
X Y M S T C HC D FR SM SR E K 16# “$” F
S1        
S2        
S3        
S   
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Hour for the setting time

S2 : Minute for the setting time


6_
S3 : Second for the setting time

S : Current time

D : Comparison result

Explanation

1. This instruction compares the value of the hour, the minute, and the second specified by S1–S3 with the value of the
hour, the minute, and the second in the devices starting from the device specified by S, and stores the comparison

result in D.

2. The hour of the current time is in the device specified by S, and the value of the hour between 0–23. The minute of

the current time is in the device specified by S+1, and the value of the minute must be between 0–59. The second of

the current time is in the device specified by S+2, and the value of the second must be between 0–59.

3. The operand D occupies three consecutive devices. The comparison result is stored in D, D+1, and D+2.

4. In general, use the TRD instruction (API 1600) to read the current time from the real-time clock first, and then use

the TCMP instruction to compare the time.

5. If the setting time in S1-S3 is larger than the current time in S, D is ON, D+1 is OFF, and D+2 is OFF.

6-569
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. If the setting time in S1-S3 is equal to the current time in S, D is OFF, D+1 is ON, and D+2 is OFF.

7. If the setting time in S1-S3 is less than the current time in S, D is OFF, D+1 is OFF, and D+2 is ON.

Example

1. When M0 is ON, the instruction compares the setting time 12 hour 20 minute 45 second with the current time in

D20–D22, and stores the comparison result in M10–M12. When M0 switches from ON to OFF, the instruction is not
executed, and the states of M10, M11, and M12 remain the same as they were before M0 switched to ON.

2. If you want to get the comparison result ≧, ≦, or ≠, you can connect M10–M12 in series or in parallel.

_6

Additional remarks

1. If S+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. If the value in S exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

6-570
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

4. If the values in S1–S3 exceed the range, an operation error occurs, the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#2003.

5. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD.

6. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of BOOL.

6_

6-571
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1606 TZCP P S1,S2,S,D Time zone comparison

Device
X Y M S T C HC D FR SM SR E K 16# “$” F
S1    
S2    
S   
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Lower limit time

S2 : Upper limit time

S : Current time

_6 D : Comparison result

Explanation

1. This instruction compares the current time specified by S with the lower limit time specified by S1, and with the upper

limit time specified by S2, and stores the comparison result in D.

2. The hour of the lower limit time is in the device specified by S1, the minute of the lower limit time is in the device

specified by S1+1, and the second of the lower limit time is in the device specified by S1+2.

3. The hour of the upper limit time is in the device specified by S2, the minute of the upper limit time is in the device

specified by S2+1, and the second of the upper limit time is in the device specified by S2+2.

4. The hour of the current time is in the device specified by S, the minute of the current time is in the device specified

by S+1, and the second of the current time is in the device specified by S+2.

5. The time in the device specified by S1 must be less than the time in the device specified by S2. If the time in the

device specified by S1 is larger than the time in the device specified by S2, the instruction takes the time in the

device specified by S1 as the upper limit time during the execution of the instruction.

6-572
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6. In general, use the TRD instruction (API 1600) to read the current time from the real-time clock first, and then use

the TZCP instruction to compare the time.

7. If the current time in the device specified by S is less than the lower limit time in the device specified by S1, and is

less than the upper limit time in the device specified by S2, D is ON. If the current time in the device specified by S is

larger than the lower limit time in the device specified by S1, and is larger than the upper limit time in the device

specified by S2, D+2 is ON; otherwise D+1 is ON.

Example

When M0 is ON, the TZCP instruction is executed. M10, M11, or M12 is ON. When M0 is OFF, the instruction is not

executed, the state of M10, the state of M11, and the state of M12 remain the same as before M0 switched to ON.

6_

Additional remarks

1. If S1+2, S2+2, S+2, or D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code
in SR0 is 16#2003.

6-573
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. If the values in S1, S2, and S exceed the range, an operation error occurs, the instruction is not executed, SM0 is ON,
and the error code in SR0 is 16#2003

3. If you declare the operand S1 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

4. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

5. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

6. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of BOOL.

_6

6-574
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1607 DST P S, S1, S2, S3, S4, S5, D Daylight saving time

Device
X Y M S T C HC D FR SM SR E K 16# “$” F
S     
S1     
S2     
S3     
S4     
S5     
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S  
S1  
S2  
S3  
S4  
S5  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
6_
Symbol

S : Daylight saving time function codes

S1 : Month of the daylight saving start time

S2 : Date of the daylight saving start time

S3 : Month of the daylight saving end time

S4 : Date of the daylight saving end time


Change due to daylight saving time
S5 :
(minutes)
D : The state of the daylight saving function

6-575
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. Operands used in this instruction are described below:

S: Daylight saving time function codes

Function codes Description


0 Disable daylight saving time
1 Enable daylight saving time mode 1
2 Read daylight saving time
3 Enable daylight saving time mode 1
4 Disable daylight saving time (set by the system)
5 Daylight saving time mode 1 enabled (set by the system)
7 Daylight saving time mode 2 enabled (set by the system)
6, 8~ Reserved or viewed as reading daylight saving time
Note 1: When the code in S is 4, 5 or 7, the execution of instruction is of no use.

Note 2: Read more for information on the various modes in the following sections.

S1: setting for the month to start daylight saving time

S2: setting for the date to start daylight saving time

S=1 (daylight saving time mode 1 enabled), S2: settings for the date to start daylight saving time

_6 S=3 (daylight saving time mode 2 enabled), S2: settings for the week to start daylight saving time, S2+1: on which

weekday of S2

S3: setting for the month to end daylight saving time

S4: settings for the date to end daylight saving time

S=1 (daylight saving time mode 1 enabled), S4: settings for the date to end daylight saving time

S=3 (daylight saving time mode 2 enabled), S4: settings for the week to end daylight saving time, S2+1: on which

weekday of S4

S5: settings for the change due to daylight saving time; unit: minute

D: stores the state of the daylight saving time; when the value in D is OFF, daylight saving time is disabled. When the

value in D is ON, daylight saving time is enabled.

6-576
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. Descriptions on the value in function code S for daylight saving time functions

D.S.T State S Function Code Description

Disabled 0 Disabled daylight saving time function

Enabled 1, 3 Enabled daylight saving time function

Read 2 Read the daylight saving time setting

• Disabled daylight saving time function (refer to example 1 below)


When the operand S is 0, the function of daylight saving time is disabled. When S is set to disable the daylight

saving time, the values in S1–S5 are irrelevant and the operand D shows the daylight saving time state as
OFF.

• Enabled daylight saving time function (refer to example 2 and 3)


When the value in S is 1 or 3, daylight saving time function is enabled: S1 and S2: setting for the month to
start daylight saving time; S3 and S4: setting for the month to end daylight saving time; S5: settings for the

change due to daylight saving time; unit: minute; the operand D shows the daylight saving time state. When

the function of daylight saving time is enabled and the system runs for the first time during the start time (S1,
S2), the system time adds the value set in S5 once. When the function of daylight saving time is disabled and

the system runs for the first time during the end time (S1, S2), the system time subtracts the value set in S5

once.

Modes for daylight saving

Mode S Function Code Rules 6_


Mode 1 1 By month and date

Mode 2 3 By month and week

Mode 1 (S=1): enabled by month and date (refer to example 2)

Operand Description

The month to start daylight saving time


S1
Range: 1-12

The date to start daylight saving time


S2
Range: 1-31

The month to end daylight saving time


S3
Range: 1-12

The date to end daylight saving time


S4
Range: 1-31

Time that changed due to daylight saving time; unit: minute


S5
Range: 1-1439 (within 1 day)

6-577
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Note 1: If this function is enabled, the value in D is ON.

Note 2: If the date is set incorrectly, the daylight saving function cannot be enabled. The SM0 is ON, and the

error code in SR0 is 16#200B. For example if a non-existed date is set, such as April 31, or the

starting date is set smaller than the ending date in a calendar year, for example starting date is

October 1 and ending date is April 01.

Note 3: If S5 is set out of range, the daylight saving function cannot be enabled. The SM0 is ON, and the error

code in SR0 is 16#200B.

Mode 2 (S=3): enabled by week and weekday (refer to example 3)

Operand Description

The month to start daylight saving time


S1
Range: 1-12

S2 S2: settings for the week to start daylight saving time; range: 1-4

S2+1 S2+1: on which weekday of the S2; range: 1-7 (Monday: 1, Tuesday: 2…, Sunday: 7)

The month to end daylight saving time


S3
Range: 1-12

S4 S4: settings for the week to end daylight saving time; range: 1-4

S4+1 S4+1: on which weekday of the S4; range: 1-7 (Monday: 1, Tuesday: 2…, Sunday: 7)

_6 S5
Time that changed due to daylight saving time; unit: minute

Range: 1-1439 (within 1 day)

Note 1: If this function is enabled, the value in D is ON.

Note 2: The setting range for S2 and S4 is 1— 4 or -1— -4. The value -1 indicates the last week of the month

and -2 indicates the last 2nd week. If the value in S2 is -2 and S2+1 is 7, it indicates the last 2 Sunday of

the month. If the date is set incorrectly, the daylight saving function cannot be enabled. The SM0 is ON,

and the error code in SR0 is 16#200B.

Note 3: If the value in S2+1 / S4+1 is out of range, the default setting value is 7, indicating Sunday.

Note 4: If S5 is set out of range, the daylight saving function cannot be enabled. The SM0 is ON, and the error

code in SR0 is 16#200B.

Note 5: If the device for operand S2 and S4 is K or 16#, the values are not saved, the SM0 is ON, and the error

code in SR0 is 16#2003.

• Read the daylight saving time function (refer to example 1-3)

When the operand S is 2, the function of daylight saving time is being read. S1 and S2: setting for the month to start

daylight saving time; S3 and S4: setting for the month to end daylight saving time; S5: settings for the change due to

daylight saving time; unit: minute. When S is set to read the state of the daylight saving function and the output state

6-578
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

of D is ON, the PLC saves the setting values in the operands S1–S5. The device is set to D while S is set to read. If

the device is set to K or 16#, the values are not saved, the SM0 is ON, and the error code in SR0 is 16#2003.

Adds 4 to the function codes in S, after the daylight saving state is read. For example, after the daylight saving state

is read, the function codes 0, 1, 3 become 4, 5 and 7.

When the DST state is OFF, the operand and descriptions are shown below.

Operand Description

S Function code is 4, indicating the DST state is OFF.

S1- S5 Invalid operand

D DST state is OFF.

When the DST state is ON and in mode 1, the operand and descriptions are shown below.
Operand Description

S Function code is 5, indicating the DST state is ON and in mode 1.

S1 The month to start daylight saving time

S2 The date to start daylight saving time

S3 The month to end daylight saving time

S4 The date to end daylight saving time

S5 Time that changed due to daylight saving time; unit: minute


6_
D The DST state is ON (enabled).

When the DST state is ON and in mode 2, the operand and descriptions are shown below.
Operand Description

S Function code is 7, indicating the DST state is ON and in mode 2.

S1 The month to start daylight saving time

S2 S2: settings for the week to start daylight saving time

S2+1 S2+1: on which weekday of the S2

S3 The month to end daylight saving time

S4 S4: settings for the week to end daylight saving time

S4+1 S4+1: on which weekday of the S4

S5 Time that changed due to daylight saving time; unit: minute

Operand The DST state is ON (enabled).

3. This instruction is to enable / disable the daylight saving time function. Whether the contact is normally open or close

will not affect the daylight saving time setting. (refer to example 2 for more details on how to switch the contact M0

OFF=>ON) You can reset the daylight saving time by executing the instruction again. There is no need to disable

6-579
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

and then enable this function to reset the daylight saving time.

4. When setting the daylight saving time to start on April 1st and to end on September 1st, and the duration is 60 minutes;

the real-time clock goes like below.

Daylight saving time function disabled Daylight saving time function enabled

1st March, 3 o’clock 1st March, 3 o’clock

31st March, 3 o’clock 31st March, 3 o’clock

1st April, 3 o’clock 1st April, 4 o’clock

1st May, 3 o’clock 1st May, 4 o’clock

1st June, 3 o’clock 1st June, 4 o’clock

1st July, 3 o’clock, 1st July, 4 o’clock

1st August, 3 o’clock 1st August, 4 o’clock,

31st August, 3 o’clock 31st August, 4 o’clock

1st September, 3 o’clock 1st September, 3 o’clock

Example 1

Disable DST function and read the DST state.

_6

6-580
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Setting values and descriptions:

Device Setting Value Description

D0 0 Disable DST function

D1 X Invalid operand

D2 X Invalid operand

D11 X Invalid operand

D12 X Invalid operand

D20 X Invalid operand

Enable contact M0

M20=OFF, indicating DST function is disabled.

D100=K2, indicating DST state is being read.

Enable contact M1

Setting values and descriptions:

Device Setting Value Description

D100 4 Function code is 4, indicating the DST state is OFF.

D101 X Invalid operand

D102 X Invalid operand

D111 X Invalid operand

D112 X Invalid operand


6_
D120 X Invalid operand

M21 OFF Node state is OFF.

Example 2

Enable DST function and read the DST state.

Set the DST to start on 1st April and to end on 3rd September and the duration is 60 minutes.

6-581
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting values and descriptions:

Device Setting Value Description

D0 1 The DST state is ON and in mode 1.

D1 4 Starting month: April

D2 1 Starting date: the 1st

D11 9 Ending month: September

D12 3 Ending date: the 3rd

D20 60 Duration: 60 minutes

Enable contact M0

M20=ON, indicating DST function is enabled.

The PLC system time adds 60 minutes when the date April 1st arrives, and subtracts 60 minutes when the date

_6 September 3rd arrives to end daylight saving time.

D100=K2, indicating DST state is being read.

Enable contact M1
Setting values and descriptions:

Setting
Device Description
Value

D100 5 Function code is 5, indicating the DST state is ON and in mode 1.

D101 4 Starting month: April

D102 1 Starting date: the 1st

D111 9 Ending month: September

D112 3 Ending date: the 3rd

D120 60 Duration: 60 minutes

M21 ON Node state is ON.

Use the instruction DST or HWCONFIG in ISPSoft to read the daylight saving state. The HWCONFIG converts the result

from week number to the corresponding dates and months automatically.

6-582
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Enable the contact M0 OFF=>ON again; this act has no impact on the DST. The DST does not reset.

Setting values and descriptions:

Setting
Device Description
Value

D100 5 Function code is 5, indicating the DST state is ON and in mode 1.

D101 4 Starting month: April

D102 1 Starting date: the 1st

D111 9 Ending month: September

D112 3 Ending date: the 3rd

D120 60 Duration: 60 minutes

M21 ON Node state is ON.

If the daylight saving time starts from 3 o’clock of 1st April, 60 minutes is added; the real-time clock shows 4 o’clock of 1st

April. No matter how many times the contact M0 is disabled or enabled, the real-time clock keeps the same daylight

saving time.

Example 3

Enable DST function and in mode 2.

Set the DST to start from the 2nd Wednesday of May and to end on 3rd Friday of September and the duration is 60 minutes.

6_

6-583
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting values and descriptions:

Device Setting Value Description

D0 3 The DST state is ON and in mode 2.

D1 5 Starting month: May

D2 2 Starting week number: the 2nd week

D3 3 Starting day: Wednesday

D11 9 Ending month: September

D12 3 Ending week number: the 3rd week

D13 5 Ending day: Friday

D20 60 Duration: 60 minutes

Enable contact M0

M20=ON, indicating DST function is enabled.

For the year 2017, the 2nd Wednesday of May is 10th May and the 3rd Friday of September is 15th September. The PLC

system time adds 60 minutes when the date May 10th arrives and subtracts 60 minutes when the date September 15th

arrives to end daylight saving time.

D100=K2, indicating DST state is being read.

Enable contact M1

Setting values and descriptions:

Setting
_6 Device Description
Value

D100 7 Function code is 4, indicating the DST state is ON and in mode 2.

D101 5 Starting month: May

D102 2 Starting week number: the 2nd week

D103 3 Starting day: Wednesday

D111 9 Ending month: September

D112 3 Ending week number: the 3rd week

D113 5 Ending day: Friday

D120 60 Duration: 60 minutes

M21 ON Node state is ON.

Use the instruction DST or HWCONFIG in ISPSoft to read the daylight saving state. The HWCONFIG converts the result

from week number to the corresponding dates and months automatically.

6-584
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

1608 WWON S1, S2, D Setting up weekly working time

Device
X Y M S T C HC D FR SM SR E K 16# “$” F
S1 
S2 
S3 
S4 
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S4  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : The hour to start working (occupies 7 consecutive devices)


The minute to start working (occupies 7 consecutive
S2 :
devices) 6_
S3 : The hour to stop working (occupies 7 consecutive devices)
The minute to stop working (occupies 7 consecutive
S4 :
devices)
D : Output control

Explanation

1. This instruction allows you to set the time to start working for the week. S1–S1+6 allows you to set the time on Sunday
/ Monday / Tuesday / Wednesday / Thursday / Friday / Saturday respectively. This operand occupies 7 consecutive

devices. You can use the variables in an ARRAY to declare the operands in ISPSoft/DIADesigner.

2. S2–S2+6 S1–S1+6 allows you to set the minutes to start working on Sunday / Monday / Tuesday / Wednesday /
Thursday / Friday / Saturday respectively. This operand occupies 7 consecutive devices. You can use the variables

in an ARRAY to declare the operands in ISPSoft/DIADesigner.

3. S3–S3+6 allows you to set the hour to stop working on Sunday / Monday / Tuesday / Wednesday / Thursday / Friday /

Saturday respectively. This operand occupies 7 consecutive devices. You can use the variables in an ARRAY to

declare the operands in ISPSoft/DIADesigner.

6-585
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. S4–S4+6 allows you to set the minutes to stop working on Sunday / Monday / Tuesday / Wednesday / Thursday /

Friday / Saturday respectively. This operand occupies 7 consecutive devices. You can use the variables in an

ARRAY to declare the operands in ISPSoft/DIADesigner.

5. When the hour value in S1 is larger than the value set in S3, it means the time to stop working is the next day. For

example, when you set the time to start working at 18:00 on Monday and the time to stop working at 6:00, it means

the time to stop working is at 6:00 Tuesday.

Start working time Stop working time

Day Start Hour Start Minute Stop Hour Stop Minute

Sunday S1 24 S2 00 S3 24 S4 00

Monday S1+1 18 S2+1 00 S3+1 06 S4+1 00

6. The setting value for the hour is between 0–23. When the setting value is out of range, this function is not enabled.

The setting value for the minute is between 0–59. When the setting value is out of range, this function is enabled but

uses 0 as the setting value.

7. When it is required to set the work time to be more than 1 day, you can set the hour as 24, which means the system

does not check the start working time and the stop working time. For example, to set the start working time to 8 am

Monday and the stop working time to 8pm Tuesday, use S1+1=8, S3+1=24, S1+2 =24 and S3+2=20. See the formula

in the following table.

Start working time Stop working time


_6
Day Start Hour Start Minute Stop Hour Stop Minute

Sunday S1 24 S2 00 S3 24 S4 00

Monday S1+1 08 S2+1 00 S3+1 24 S4+1 00

Tuesday S1+2 24 S2+2 00 S3+2 20 S4+2 00

8. This instruction should work with the real-time clock in the PLC. Before operating, make sure the PLC battery is

securely installed and working correctly.

9. There is no limit on the number of times you can execute the instruction but the output control device D cannot be

used repeatedly. If you use the device D repeatedly, only the last output result from the WWON instruction is

executed.

10. If more than 1 set of work hours are needed, use the WWON instruction repeatedly as required. Note that you

cannot use the output control device D repeatedly.

6-586
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

Set a working time from 8:00 to 18:00 from Monday to Friday and no work on Saturday and Sunday.

The following table lists the settings for the device D.

Start working time Stop working time

Day Start Hour Start Minute Stop Hour Stop Minute

Sunday D0 24 D10 00 D20 24 D30 00

Monday D1 08 D11 00 D21 18 D31 00

Tuesday D2 08 D12 00 D22 18 D32 00

Wednesday D3 08 D13 00 D23 18 D33 00

Thursday D4 08 D14 00 D24 18 D34 00

Friday D5 08 D15 00 D25 18 D35 00


6_
Saturday D6 24 D16 00 D26 24 D36 00

When M0 is ON, M20 is ON from 8:00 to 18:00 from Monday to Friday; for other times the M20 is OFF.

Example 2

Set a working time from 18:00 Monday to 08:00 Tuesday and from 18:00 Tuesday to 08: 00 Wednesday. Follow this

pattern to 08:00 Saturday and no work on Sunday.

6-587
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The following table lists the settings for the device D.

Start working time Stop working time

Day Start Hour Start Minute Stop Hour Stop Minute

Sunday D0 24 D10 00 D20 24 D30 00

Monday D1 18 D11 00 D21 08 D31 00

Tuesday D2 18 D12 00 D22 08 D32 00

Wednesday D3 18 D13 00 D23 08 D33 00

Thursday D4 18 D14 00 D24 08 D34 00

Friday D5 18 D15 00 D25 08 D35 00

Saturday D6 24 D16 00 D26 24 D36 00

When M0 is ON, M20 is ON from 18:00 to 8:00 the next day from Monday to Friday and for other times the M20 is OFF.

Example 3

Set a working time from 08:00 to 12:00 and from 14:00 to 17:30 from Monday to Friday. No work on Saturday and Sunday.

_6

6-588
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

The following table lists the settings in the morning for the device D.

Start working time Stop working time

Day Start Hour Start Minute Stop Hour Stop Minute

Sunday D0 24 D10 00 D20 24 D30 00

Monday D1 08 D11 00 D21 12 D31 00

Tuesday D2 08 D12 00 D22 12 D32 00

Wednesday D3 08 D13 00 D23 12 D33 00

Thursday D4 08 D14 00 D24 12 D34 00

Friday D5 08 D15 00 D25 12 D35 00

Saturday D6 24 D16 00 D26 24 D36 00

The following table lists the settings in the afternoon for the device D.

Start working time Stop working time

Day Start Hour Start Minute Stop Hour Stop Minute

Sunday D40 24 D50 00 D60 24 D70 00

Monday D41 14 D51 00 D61 17 D71 30

Tuesday D42 14 D52 00 D62 17 D72 30


6_
Wednesday D43 14 D53 00 D63 17 D73 30

Thursday D44 14 D54 00 D64 17 D74 30

Friday D45 14 D55 00 D65 17 D75 30

Saturday D46 24 D56 00 D66 24 D76 00

When M0 is ON, M20 is ON from 08:00 to 12:00 and 14:00 to 17:30 from Monday to Friday and for other times the M20 is

OFF.

6-589
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.18 Peripheral Instructions


6.18.1 List of Peripheral Instructions
The following table lists the Peripheral instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1700 TKY DTKY – Ten-key keypad

1701 HKY DHKY – Sixteen-key keypad

1702 DSW – – DIP switch

1703 ARWS – – Arrow keys

1704 SEGL – – Seven-segment display with latches

_6

6-590
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.18.2 Explanation of Peripheral Instructions

API Instruction code Operand Function

1700 D TKY S, D1, D2 Ten-key keypad

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
D1    
D2    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S 
D1    
D2 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : First input device


Device where the value is
D1 :
stored
D2 : Output signal

Explanation 6_

1. The ten external inputs starting from the input specified by S represents 0–9 in the decimal system. They are

connected to ten keys. You can enter a four-digit decimal value 0–9,999 (16-bit instruction) or an eight-digit decimal

value 0–99,999,999 (32-bit instruction) by pressing the keys in order. The instruction stores the decimal value in D1,

and stores the output signals in D2.

2. The operand S occupies ten bits.

3. The operand D2 occupies eleven bits. Please do not change the states of the bits during the execution of the

instruction.

4. When the conditional contact is not enabled, the eleven bits starting from the bit specified by D2 are OFF.

5. When using on-line editing, please reset the conditional contact to initialize the instruction.

6. You can use the 32-bit counter only when D1 uses 32-bit instructions.

6-591
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. The ten external inputs starting from X0 are connected to ten keys that represent 0–9 in the decimal system. When
M0 is ON, the instruction stores the value that you enter as a binary value in D0, and stores the output signals in

M10–M19.

0 1 2 3 4 5 6 7 8 9

24V DC

X0 X1 X2 X3 X4 X5 X6 X7 X1 0 X11 S/S
Not e: The digital input module is used in this example.

0 1 2 3 4 5 6 7 8 9 Numeric k eys

Binar y-coded One- digit binary-coded


_6 decimal value decimal code

3 2 1 0
Overflowing 10 10 10 10

Binary-coded
decimal v alue

Binary
D0
value

2. If the keys connected to X5, X3, X0, and X1 are pressed in the order shown in the timing chart, the instruction stores
the result 5,301 in D0. The maximum value that can be stored in D0 is 9,999. If the value exceeds four digits, the

first digit from the left overflows.

3. After the key connected to the X2 is pressed and before other keys are pressed, M12 is ON. The same applies to
the other keys.

4. When a key connected to the input within the range between X0~X7 and X10~X11 is pressed, the corresponding
output within the range between M10 and M19 is ON.

5. When one of the keys is pressed, M20 is ON.

6-592
C ha pt er 6 A p pl i e d In s tr uc t io ns

6. When the conditional contact M0 is switched OFF, the value stored in D0 is unchanged; however, M10–M20 are
switched OFF.

X0 3

X1 4

X3 2

X5 1

M1 0

M11

M1 3

M1 5

Ou tp ut si g na l

M2 0 1 2 3 4

Additional remarks

1. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [10] of BOOL.

2. If you declare the operand D2 in ISPSoft/DIADesigner, the data type is ARRAY [11] of BOOL.

6_

6-593
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1701 D HKY S1, S2, D1, D2, D3 Sixteen-key keypad

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
D1 
D2    
D3    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1 
S2  
D1 
D2    
D3 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : First input device

S2 : For system use only


_6
D1 : First output device

D2 : Device where the value is stored

D3 : Output signal

Explanation

1. The four external inputs starting from the input specified by S are connected to the four external outputs starting

from the output specified by D1 to form a 16-key keypad. The instruction stores the value that you enter by pressing
the keys in D2, and stores the output signals in D3. If you press several keys simultaneously, the value that is smaller

is stored.

2. The value that you enter by pressing the keys is temporarily stored in D2. For the 16-bit HKY instruction, the

maximum value that can be stored in D2 is 9,999. If the value exceeds four digits, the first digit from the left

overflows. For the 32-bit DHKY instruction, the maximum value that can be stored in D2 is 9,999. If the value

exceeds eight digits, the first digit from the left overflows.

3. After the instruction completes, SM692 is ON. That is, SM692 is ON for a scan cycle after the execution of the

matrix scan is complete.

6-594
C ha pt er 6 A p pl i e d In s tr uc t io ns

4. You can use the 32-bit counter only when D2 uses 32-bit instructions.

Example

1. The four external inputs X0–X3 are connected to the four external outputs Y0–Y3 to form a 16-key keypad. When
X10 is ON, the instruction stores the value that you enter as a binary value in D0, and stores the output signals in

M0–M7.

The function of SM691:

 If SM691 is ON, the 16-bit instruction takes 0–F as hexadecimal values.

 Numeric keys:

0 1 2 3 4 5 6 7 8 9 A B C D E F Keys

6_
3 2 1 0
Overflowing 16 16 16 16

D0

 If SM691 is OFF, the 16-bit instruction takes A–F as function keys.

 Numeric keys:

0 1 2 3 4 5 6 7 8 9 Numeric k eys

Binary-coded
One-digit binar y-coded
decimal value
decimal c ode

3 2 1 0
Overflowing 10 10 10 10

Binary-coded
decimal value

Binary
D0
value

6-595
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Function keys:

 When A is pressed, M0 stays ON. When D is pressed, M0 switches OFF, and M3 stays ON.

 If several function keys are pressed, the key which is pressed first has priority.

F E D C B A

M5 M4 M3 M2 M1 M0

2. Output signals:

 When a key within the range between A and F is pressed, M6 is ON.

 When a key within the range between 0 and 9 is pressed, M7 is ON.

3. When the conditional contact M10 switches to OFF, the value that was stored in D0 is unchanged. However, M0–M7
are switched OFF.

4. The external wiring:

C D E F

8 9 A B

4 5 6 7

_6 0 1 2 3
24VDC
+
X0 X1 X2 X3 S /S Y0 Y1 Y2 Y3 C0

No te: T h e tra nsisto r o utp ut m odu le i s u se d in t his e xa mp le .

Additional remarks

1. When this instruction is executed, a too long or a too short scan cycle time will cause the state of the switches to be

read incorrectly. Use the following tips to solve the issue.

 When the scan cycle is too short, the I/O may not be able to respond in time and cannot read the correct

states of the inputs. You can set a fixed scan time to solve this issue.

 When the scan cycle is too long, the switch may become slow to react. You can write this instruction to a timer

interrupt task to set a fixed time to execute this instruction.

2. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [4] of BOOL.

3. If you declare the operand D1 in ISPSoft/DIADesigner, the data type is ARRAY [4] of BOOL.

4. If you declare the operand D3 in ISPSoft/DIADesigner, the data type is ARRAY [8] of BOOL.

6-596
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1702 DSW S1, S2, D1, D2, n DIP switch

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
D1 
D2   
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D1 
D2  
n  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : First input device

S2 : For system use only

D1 : First output device 6_


D2 : Device where the value is stored

n : Number of DIP switches

Explanation

1. The four or eight external inputs starting from the input specified by S1 are connected to the four external outputs

starting from the output specified by D1 to form a four-digit DIP switch or two four-digit DIP switches. The instruction

stores the value from the DIP switch in D2. Whether there is one four-digit DIP switch or two four-digit DIP switches
depends on n.

2. If n is 1, the operand D2 occupies one register. If n is 2, the operand D2 occupies two registers.

3. S2 and S2+1, are for system use only, and occupy two devices. Please do not alter the values in these devices.

4. After the instruction completes, SM694 is ON for a scan cycle.

5. When the conditional contact is not enabled, the four external outputs starting from the output specified by D1 stay

OFF.

6-597
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. When using on-line editing, please reset the conditional contact to initialize the instruction.

Example

1. X0–X3 are connected to Y0–Y3 to form the first DIP switch, and X4–X7 are connected to Y0–Y3 to form the second

DIP switch. When M10 is ON, the instruction converts the value that you enter with the first DIP switch into the

binary value, and stores the conversion result in D20. The instruction converts the value that you enter with the

second DIP switch into the binary value, and stores the conversion result in D21.

2. When M10 is ON, Y0–Y3 are ON cyclically. After the instruction completes, SM694 is ON for a scan cycle.

3. The following graphic shows the outputs. Y0–Y3 must be transistors.

M10
Cyc li c acti o n
Y0 0.1 s 0 .1s 0.1 s
_6
Y1 0 .1 s

In te rr up tio n
Y2 0 .1s

Y3 0 .1s

I nstr uct io n exe cuti on


S M6 94 i s co mp le te.

6-598
C ha pt er 6 A p pl i e d In s tr uc t io ns

4. The following graphic shows the DIP switches.

0 1 2 3
10 10 10 10

Binary- coded dec imal


wiring of DI P swit ches

A diode (1N4148) must


be connected in series.

+
3 2 1 0
1 2 4 8 1 2 4 8 10 10 10 10
X0 X1 X2 X3 X4 X5 X6 X7 S/S Y3 Y2 Y1 Y0 C0

1st DI P switch 2nd DIP switch


No te : The transistor ou tp ut module i s used i n th is exa mple.

Additional remarks

1. If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.
6_
2. If you declare the operand D1 in ISPSoft/DIADesigner, the data type is ARRAY [4] of BOOL.

6-599
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1703 ARWS S1, S2, D1, D2, n Arrow keys

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
D1   
D2 
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1 
S2  
D1  
D2 
n  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : First input device

S2 : For system use only


_6 D1 : Device where the setting value is stored

D2 : First output device

n : Positive/Negative logic

Explanation

1. This instruction defines S1 as the down arrow, S1+1 as the up arrow, S1+2 as the right arrow, and S1+3 as the left
arrow. The instruction stores the setting value in D1, and the value must be between 0–9,999.

2. The operand S1 occupies four consecutive bit devices.

3. S2 is for system use only. Please do not alter the value in it.

4. The operand D2 occupies eight consecutive bit devices.

5. When the conditional contact is disabled, the eight bit devices starting from the bit device specified by D2 stay OFF.

6. The operand n must be between 0–3.

7. When using on-line editing, please reset the conditional contact to initialize the instruction.

6-600
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

1. The instruction defines X0 as the down arrow, X1 as the up arrow, X2 as the right arrow, and X3 as the left arrow.

The instruction stores the setting value in D20, and the setting value must be between 0–9,999.

2. When M10 is ON, the digit in the place 103 is selected. If the left arrow is pressed, the places are selected in

sequence (103→100→101→102→103→100).

3. If you press right arrow, the places are selected in sequence (103→102→101→100→103→102). The LED indicators

for the corresponding places are connected to Y4–Y7. When the digits in the places are selected in sequence, the

LED indicators are ON in sequence.

4. If you press the up arrow, the digit in the place selected changes (0→1→2→…8→9→0→1). If you press the down

arrow, the digit in the place selected changes (0→9→8→…1→0→9). The new digit is shown on seven-segment

display.

U p arrow

Y4
6_
Y5 X1
Y6
Y7 LED indicators
Left ar row X3 X2 R ight a r row
3 2 1 0
10 10 10 10
1 X0
Y0 2
Y1 4
Y2 8
Y3 D own ar row

The fo ur k ey s a re use d to se le ct t he plac e


Fo u r- d ig i t se ve n- se g me nt di sp la y a nd ch ang e the digit s .

Additional remarks

1. If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

2. If you declare the operand S1 in ISPSoft/DIADesigner, the data type is ARRAY [4] of BOOL.

3. If you declare the operand D2 in ISPSoft/DIADesigner, the data type is ARRAY [8] of BOOLL.

6-601
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1704 SEGL S1, S2, D, n Seven-segment display with latches

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2 
D 
n        
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D 
n  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Source device

S2 : For system use only

D : First output device

_6 n : Positive/Negative logic

Explanation

1. The eight external outputs starting from the output specified by D are connected to a four-digit seven-segment

display; or the twelve external outputs starting from the output specified by D are connected to two four-digit

seven-segment displays. Every place is equipped with a driver that converts a binary-coded decimal value into

seven-segment data, and every driver is equipped with a latch that can be used to store state information.

2. The value in S1 is the value to show on first seven-segment display, and the value in S1+1 is the value to show on

second seven-segment display.

3. S2 is for system use only. Please do not alter the value in it.

4. The operand n must be between 0–7. Please refer to the Additional remark for more information.

5. Whether there is one four-digit seven-segment display or two four-digit seven-segment displays, and whether an

output is a positive logic output or a negative logic output depends on n.

6. If there is one four-digit seven-segment display, eight outputs are occupied. If there are two four-digit

seven-segment displays, twelve outputs are occupied.

6-602
C ha pt er 6 A p pl i e d In s tr uc t io ns

7. When the instruction is executed, the outputs are ON cyclically. If the conditional contact switches from OFF to ON

during the execution of the instruction, the outputs are ON cyclically again.

8. After the execution of the instruction is complete, SM693 is ON for a scan cycle.

Example

1. When M10 is ON, the instruction is executed. Y0–Y7 form a circuit. The instruction converts the value in D10 into

the binary-coded decimal value, and shows the conversion result on first seven-segment display. The instruction

converts the value in D11 into the binary-coded decimal value, and shows the conversion result on second

seven-segment display. If the value in D10 or D11 exceeds 9,999, an operation error occurs.

2. When M10 is ON, Y4–Y7 are ON cyclically. It takes twelve scan cycles for Y0.4–Y0.7 to be ON. After the instruction

completes, SM693 is ON for a scan cycle.

3. If there is one four-digit seven-segment display, n is between 0–3.


6_
 Connect the pins 1, 2, 4, and 8 in parallel, then connect them to Y0–Y3 on the PLC, and connect the latches

to Y4–Y7 on the PLC.

 When M10 is ON, the instruction is executed. Y4–Y7 are ON cyclically, and the value in D10 is shown on

seven-segment display.

4. If there are two four-digit seven-segment displays, n is between 4–7.

 Connect the pins 1, 2, 4, and 8 in parallel, then connect them to Y10–Y13 on the PLC, and connect the

latches to Y4–Y7 on the PLC.

 The value in D10 is shown on first seven-segment display, and the value in D11 is shown on second

seven-segment display. If the values in D10 and D11 are 1234 and 4321 respectively, 1234 is shown on

second seven-segment display.

6-603
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. The wiring:

Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y10 Y11 Y12 Y13 C0

1 2 4 8 0 1 2 3
10 10 10 10

3 2 1 0 3 2 1 0
10 10 10 10 10 10 10 10
1
2 V+ 1
2 V+
4 4
8 8

Fi rs t 7-se g me n t disp l ay S e co nd 7 - se gm en t di sp la y

No te: T he tra ns isto r o utput m o dule i s us e d in this e x amp le.

Additional remarks

 Whether an output is a positive output or a negative output, and whether there is one four-digit

seven-segment display or two four-digit seven-segment displays depend on n.

 The outputs on the PLC should be NPN transistors whose collectors are open collectors. In addition, an

output has to connect a pull-up resistor to the DC power supply (less than 30 VDC). Therefore, when an

output is ON, a signal of low potential is output.

 The following table shows the negative logic.


_6
Output
Binary-coded
(Binary-coded Signal
decimal value
decimal code)

b3 b2 b1 b0 8 4 2 1 A B C D

0 0 0 0 0 0 0 0 1 1 1 1

0 0 0 1 0 0 0 1 1 1 1 0

0 0 1 0 0 0 1 0 1 1 0 1

0 0 1 1 0 0 1 1 1 1 0 0

0 1 0 0 0 1 0 0 1 0 1 1

0 1 0 1 0 1 0 1 1 0 1 0

0 1 1 0 0 1 1 0 1 0 0 1

0 1 1 1 0 1 1 1 1 0 0 0

1 0 0 0 1 0 0 0 0 1 1 1

1 0 0 1 1 0 0 1 0 1 1 0

6-604
C ha pt er 6 A p pl i e d In s tr uc t io ns

 The following table shows the positive logic.

Output
Binary-coded
(Binary-coded Signal
decimal value
decimal code)

b3 b2 b1 b0 8 4 2 1 A B C D

0 0 0 0 1 1 1 1 0 0 0 0

0 0 0 1 1 1 1 0 0 0 0 1

0 0 1 0 1 1 0 1 0 0 1 0

0 0 1 1 1 1 0 0 0 0 1 1

0 1 0 0 1 0 1 1 0 1 0 0

0 1 0 1 1 0 1 0 0 1 0 1

0 1 1 0 1 0 0 1 0 1 1 0

0 1 1 1 1 0 0 0 0 1 1 1

1 0 0 0 0 1 1 1 1 0 0 0

1 0 0 1 0 1 1 0 1 0 0 1

 The following table shows the latch.

Positive logic Negative logic


Latch Signal Latch Signal
1 0 0 1
6_
 The following table shows the setting value of the parameter n.

Number of

seven-segment One Two

displays

Output

(Binary-coded + - + -

decimal code)

Latch + - + - + - + -

n 0 1 2 3 4 5 6 7

‘+’: Positive logic

‘-’: Negative logic

 You can edit the parameters in n to modify the logics for the output transistor and the input of the

seven-segment display.

6-605
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 The following graphic shows the connection of the common-anode four-digit seven-segment display with IC

7447.

3 2 1 0
8 4 2 1 10 10 10 10

1K 120

B Vcc
C f
LT g 3 a f 2 1 b
+
5VDC RBO a
RBI b e d c h g 0
D c
A d
GND e
IC7447
C0

_6

6-606
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.19 Communication Instructions


6.19.1 List of Communication Instructions
The following table lists the Communication instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

1806 LRC – – Longitudinal parity check

1807 CRC – – Cyclic Redundancy Check

1808 MODRW – – Reading and Writing Modbus data

1812 COMRS – – Sending and receiving communication data

– Setting the communication format for a serial communication


1813 COMDF 
port

– Serial communication instruction exclusively for Delta AC


1814 VFDRW –
motor drives

– Serial communication instruction exclusively for Delta servo


1815 ASDRW –
drives

– Setting the parameters in the data exchange table for a


1816 CCONF 
communication port

1817 MODRWE – – Reading and writing Modbus data without using any flags 6_
1818 DNETRW – – Reading and writing DeviceNet communication data

1819 CANRS – – User-defined CAN communication sending and receiving

1820 DMVSH – – Enabling Delta DMV detection and communication

Execute the appointed communication number of the data


1821 DESO – –
exchange table once

6-607
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.19.2 Explanation of Communication Instructions


API Instruction code Operand Function

1806 LRC S, n, D Longitudinal parity check

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
n    
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : First device to which the LRC is applied

n : Number of bytes
First device where the operation result is
D :
stored

_6 Explanation

1. This instruction performs a longitudinal parity check on n bytes in the device specified by S. Please refer to the

Additional remark for this instruction (below) for more information about the LRC check code.

2. The operand n must be an even number, and must be between 1–1000. If n is not in the range, an operation error

occurs, the instruction is not executed, SM0 and SM1 are ON, and the error code in SR0 is 16#200B.

3. The 16-bit conversion mode: When SM606 is OFF, the instruction divides the hexadecimal data in the device

specified by S into the high 8-bit data and the low 8-bit data. The instruction applies the LRC to every byte, and

stores the operation result in the high 8-bit and the low 8-bit in the device specified by D. The number of bytes

depends on n.

4. The 8-bit conversion mode: When SM606 is ON, the instruction divides the hexadecimal data in the device

specified by S into the high 8-bit data (invalid data) and the low 8-bit data. The instruction applies the LRC to every

byte, and stores the operation result in the low 8-bit in the two registers. The number of bytes depends on n. The

values of the high 8 bits in the two registers are 0.

6-608
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

1. The PLC is connected to the VFD-S series AC motor drive (ASCII modeSM210 is OFF; 8-bit mode: SM606 is ON.).

The PLC sends the command, and reads the data in the six devices at the addresses starting from 16#2101 in the

VFD-S series AC motor drive.

PLCVFD-S

The PLC sends “:01 03 2101 0006 D4 CR LF”.

The PLC sends the data in the following table.

Register Data Description


D100
Low 8 bits ‘:’ 16#3A STX
D101
‘0’ 16#30 ADR 1
Low 8 bits
AD (1, 0) is the station address of the AC motor drive.
D102
‘1’ 16#31 ADR 0
Low 8 bits
D103
Low 8 bits ‘0’ 16#30 CMD 1
CMD (10) is the command code.
D104
‘3’ 16#33 CMD 0
Low 8 bits
D105
‘2’ 16#32
Low 8 bits
D106
Low 8 bits ‘1’ 16#31
Initial data address
D107
‘0’ 16#30 6_
Low 8 bits
D108
‘1’ 16#31
Low 8 bits
D109
Low 8 bits ‘0’ 16#30
D110
‘0’ 16#30
Low 8 bits
Number of data (counted by the word)
D111
‘0’ 16#30
Low 8 bits
D112
Low 8 bits ‘6’ 16#36
D113
‘D’ 16#44 LRC CHK 0
Low 8 bits
LRC CHK (01) is the error checking code.
D114
Low 8 bits ‘4’ 16#34 LRC CHK 1
D115
Low 8 bits CR 16#0D
END
D116
LF 16#0A
Low 8 bits
LRC CHK (01) above is the error checking code. You can use the LRC instruction to calculate it (8-bit mode: SM606

is ON).

6-609
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

LRC check code: 16#01+16#03+16#21+16#01+16#00+16#06=16#2C

The two’s complement of 16#2C is 16#D4. ‘D’ (16#44) is stored in the low 8-bit in D113, and ‘4’

(16#34) is stored in the low 8-bit in D114.

Additional remarks

1. The following table lists the format of the communication data in the ASCII mode.

STX ‘:’ The start-of-text character is ‘:’ (16#3A).

Address Hi ‘0’ Communication address:

Address Lo ‘1’ The 8-bit address is composed of two ASCII codes.

Function Hi ‘0’ Function code:

Function Lo ‘3’ The 8-bit function code is composed of two ASCII codes.

‘2’ Data: The n×8-bit data is composed of 2n ASCII codes.

‘1’

_6 ‘0’
DATA(n-1)
‘2’
…….
‘0’
DATA 0
‘0’

‘0’

‘2’

LRC CHK Hi ‘D’ LRC check code:

LRC CHK Lo ‘7’ The 8-bit check code is composed of two ASCII codes.

END Hi CR End-of-text character:

END Lo LF END Hi=CR (16#0D), END Lo=LF (16#0A)

2. LRC check code: The instruction adds up the values starting from the communication address to the data, then the

instruction calculates the two’s complement of the sum that is the LRC check code.

Example 16#01+16#03+16#21+16#02+16#00+16#02=16#29

The two’s complement of 16#29 is 16#D7.

6-610
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1807 CRC S, n, D Cyclic Redundancy Check

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
n    
D DWORD 

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : First device to which the CRC is applied

n : Number of bytes
First device in which the operation result is
D:
stored

Explanation

1. This instruction performs a cyclic redundancy check on n bytes starting with the device specified by S. Please refer 6_
to the Additional remark for this instruction (below) for more information about the CRC check code.

2. The operand n must be between 1–1000. If n is not in the range, an operation error occurs, the instruction is not

executed, SM0 and SM1 are ON, and the error code in SR0 is 16#200B.

3. The 16-bit conversion mode: When SM606 is OFF, the instruction divides the hexadecimal data in the device

specified by S into the high 8-bit data and the low 8-bit data. The instruction applies the CRC to every byte, and the

stores the operation result in the high 8-bit and the low 8-bit in the device specified by D. The number of bytes

depends on n.

4. The 8-bit conversion mode: When SM606 is ON, the instruction divides the hexadecimal data in the device

specified by S into the high 8-bit data (invalid data) and the low 8-bit data. The instruction applies the CRC to every

byte, and stores the operation result in the low 8-bit in the two registers. The number of bytes depends on n.

6 - 6 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. The PLC is connected to the VFD-S series AC motor drive (RTU modeSM210 is ON; 8-bit mode: SM606 is ON.).

The value 16#12, to be written into the device at 16#2000 in the VFD-S series AC motor drive, is written into the

device in the PLC first.

PLCVFD-S

The PLC sends 01 06 2000 0012 02 07.

The PLC sends the data as the following table shown.

Register Data Description


D100
16#01 Address
Low 8 bits
D101
16#06 Function
Low 8 bits
D102
16#20
Low 8 bits
Data address
D103
16#00
Low 8 bits
D104
16#00
Low 8 bits
Data
D105
16#12
Low 8 bits
D106
16#02 CRC CHK 0
Low 8 bits
_6 D107
16#07 CRC CHK 1
Low 8 bits
CRC CHK (01) above is the error checking code. You can calculate it with the CRC instruction (8-bit mode: SM606

is ON).

CRC check code: 16#02 is stored in the low 8-bit in D106, and 16#07 is stored in the low 8-bit in D107.

6-612
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. The following table shows the format of the communication data in RTU mode.

START Time interval

Address Communication address: 8-bit binary address

Function Function code: 8-bit binary code

DATA(n-1) Data: n×8-bit data

…….

DATA 0

CRC check code:


CRC CHK Low
The 16-bit check code is composed of two 8-bit binary codes.

CRC CHK High

END Time interval

2. CRC check code: The check code starts from the address to the data. The operation rule is shown in the following

table.

Step 1: Suppose the data in the 16-bit register (the register where the CRC check code is stored) is 16#FFFF.

Step 2: The logical operator XOR takes the first 8-bit message and the low 8-bit data in the 16-bit register, and
6_
performs the logical exclusive OR operation on each pair of corresponding bits. The operation result is

stored in the 16-bit register.

Step 3: The values of the bits in the 16-bit registers are shifted by one bit to the right. The value of the highest bit

becomes 0.

Step 4: If the value of the right-most bit that is shifted to the right is 0, the data from step 3 is stored in the 16-bit

register. Otherwise, the logical operator XOR takes 16#A001 and the data in the 16-bit register, and

performs the logical exclusive OR operation on each pair of corresponding bits. The operation result is

stored in the 16-bit register.

Step 5: Repeat step 3 and step 4, and perform the operation on the 8-bit message.

Step 6: Repeat step 2–5, and then get the next 8-bit message. Perform the operations on all messages. The

final result in the 16-bit register is the CRC check code. Notice that the low 8-bit data in the 16-bit register

is interchanged with the high 8-bit data in the 16-bit register before the CRC check code is put into the

check code of the message.

6-613
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1808 MODRW S1, S2, S3, S, n Reading and Writing Modbus data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S 
n    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
S   
n  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Unit address

S2 : Function code
_6
S3 : Device address

S : Register for reading/writing the data

n : Data length

Explanation

1. The operand S1 must be between 0–254; 0 is the broadcasting mode.

2. S2 is the function code.

The following table shows an example.

Function Data Devices that support devices for


Description
code length ES3/EX3/SV3/SX3 slaves

16#01 PLC reads the data from several bit devices. 1-1600 X, Y, M, SM, S, T, C, HC

16#02 PLC reads the data from several bit devices. 1-1600 X, Y, M, SM, S, T, C, HC

PLC reads the data from several word


16#03 1-100 X, Y, SR, D, T, C, HC, E
devices.

6-614
C ha pt er 6 A p pl i e d In s tr uc t io ns

Function Data Devices that support devices for


Description
code length ES3/EX3/SV3/SX3 slaves

PLC reads the data from several word


16#04 1-100 X
devices.

16#05 PLC writes the state into a bit device. 1 Y, M, SM, S, T, C, HC

16#06 PLC writes the data into a word device. 1 Y, SR, D, T, C, HC, E

16#0F PLC writes the states into several bit devices. 1-1600 Y, M, SM, S, T, C, HC

PLC writes the data into several word


16#10 1-100 Y, SR, D, T, C, HC, E
devices.

The instruction supports only the function codes mentioned above, and cannot execute other function codes.

Please refer to the examples below.

3. S3 is the device address. If the address is invalid for the designated communication device, the communication

device responds with an error message. For example, the device address 16#8000 is invalid in the DVP-ES2.

4. S is the register involved in the reading/writing the data.

The data to be written into the external equipment is stored in the register in advance.

The data to be read from the external equipment is stored in the register.

5. N is the length of the data

For word-type communication function codes, the data length cannot exceed 100 words.
6_
For bit-type (BOOL) communication function codes, the data length is between 1–1600 bits.

6. The following table shows how the functions of S3, S, and n vary with the function code used.

Function
S3 S n
code

Address from where the Register where the


16#01 Length of data read
data is read data read is stored

Address from where the Register where the


16#02 Length of data read
data is read data read is stored

Address from where the Register where the


16#03 Length of data read
data is read data read is stored

Address from where the Register where the


16#04 Length of data read
data is read data read is stored

6-615
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Function
S3 S n
code

Address into where the


16#05 Status value written No meaning
data is written

Address into where the Register where the


16#06 No meaning
data is written data written is stored

Address into where the Register where the


16#0F Length of data written
data is written data written is stored

Address into where the Register where the


16#10 Length of data written
data is written data written is stored

7. There is no limitation on the number of times you can use this instruction; however only one instruction can be

executed on the same COM port at a time. You need to decide and use the sending flag for the COM to be used

before executing this instruction. Otherwise, the data from 2 different communication COMs may be mixed up.

8. If a communication timeout occurs, the timeout flags are ON. After you solve the problem, you must reset timeout

flags to OFF. When using this instruction, the timeout value cannot 0. Set the value between 100–32767ms; when

the value is set to 0, it is processed as 200 ms.

9. In Modbus ASCII mode, you need to set up only the data (non-ASCII mode) for transmission. The instruction

converts the non-ASCII mode to the ASCII mode, consisting of the head code (:), the converted ASCII code,
_6 checksum (LRC) and tail code (CRLF). The instruction stores the data received in ASCII character in the internal

register. The PLC automatically converts the data into the hexadecimal value, and if the communication data is

correct, stores the conversion result in S. and sets the completion flag SM to ON.

10. In Modbus RTU mode, you need to set up only the data for transmission. The instruction adds the checksum (CRC)

and the stores the data received in ASCII character in the internal register. The PLC automatically converts the data

into the hexadecimal value, and if the communication data is correct, stores the conversion result stored in S.

11. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called
only once.

Communication protocol setup example

1. The following examples use PLC communication port 1 and special registers to demonstrate how to setup a

communication protocol.

2. You can set up the PLC communication port with HWCONFIG in ISPSoft or DIADesigner, or with the relative

special registers, or you can use the COMDF instruction (API 1813) to set up the communication. Please refer to

the ISPSoft/DIADesigner manual for more. For communication register setups (SM, SR), please refer to section

6.19.3 for more details.

6-616
C ha pt er 6 A p pl i e d In s tr uc t io ns

3. The communication setup for this example is RS485 ASCII , 9600, 8, E, 1 (SR209=16#0025).

4. Set the communication timeout to 3000ms (SR210=3000).

5. Set the communication mode to ASCII mode (SM210=OFF).

6. Enable the communication protocol (SM209=ON).

If you set up the communication port with the COMDF instruction (API 1813), you can ignore this step.
6_

If you set up the communication port in ISPSoft->HWCONFIG->COM Port, you can ignore this step.

6-617
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. Function code 01 (16#01): the PLC reads the data from several bit devices that are not discrete input devices (16

pieces of data is read in this example). For function code 02, the operation is the same as for function code 01.

ES3 Series CPU module is connected to the DVP-ES2 Series PLC.

When SM96 and M0 are on, the ES3 Series CPU sends and receives the Y0–Y17 commands from the DVP-ES2.
_6 When the address of Y0 is 16#0500, the states of Y0–Y17 in DVP-ES2 are listed in the following table.

Device Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0

State ON ON OFF ON OFF OFF ON OFF

Value D 2

Device Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10

State OFF OFF OFF OFF OFF ON OFF OFF

Value 0 4

The following table lists the operands for the MODRW instruction.

Operand Description Device

S1 Unit address 16#0001

S2 Function code 16#0001

S3 Device address 16#0500

6-618
C ha pt er 6 A p pl i e d In s tr uc t io ns

Operand Description Device

S Register for reading and writing the data D10.0

n Data length 16

ASCII mode

You do not need to convert the ASCII codes and they are all expressed in 16# values.

 ES3 sends the communication command: “:01 01 05 00 00 10 E9 CR LF”.

 ES3 receives the communication command: “:01 01 02 D2 04 26 CR LF”.

RTU mode

 ES3 sends the communication command: “01 01 05 00 00 10 3D 0A”.

 ES3 receives the communication command: “01 01 02 D2 04 E4 9F”.

If the format is correct, SM100 is ON.

2. The response messages from the DVP-ES2 are stored in registers D10.0 to 10.15 (the data read is

D10.15–D10.0=16#04D2).

6_
Device D10.7 D10.6 D10.5 D10.4 D10.3 D10.2 D10.1 D10.0

State ON ON OFF ON OFF OFF ON OFF

Value D 2

Device D10.15 D10.14 D10.13 D10.12 D10.11 D10.10 D10.9 D10.8

State OFF OFF OFF OFF OFF ON OFF OFF

Value 0 4

3. After the receiving the data sent back from the DVP-ES2, the PLC confirms the data format sent back from

DVP-ES2 and determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are

ON; if not SM102 is ON.

6-619
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

1. Function code 03 (16#03): the PLC reads the data from several bit devices that are not discrete input devices (eight

pieces of data is read in this example). For function code 04, the operation is the same as for function code 03.

2. ES3 Series CPU module is connected to the DVP-ES2 Series PLC.

When SM96 and M0 are on, the ES3 Series CPU module sends and receives D32–D39 from the DVP-ES2.
_6
3. When the address of D32 is 16#1020, the values of D32–D39 in DVP-ES2 are listed in the following table.

Device D32 D33 D34 D35 D36 D37 D38 D39

Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC

The following table lists the operands of the MODRW instruction.

Operand Description Device

S1 Unit address 16#0001

S2 Function code 16#0003

S3 Device address (D32) 16#1020

S Register involved for reading and writing the data D10

n Data length 8

6-620
C ha pt er 6 A p pl i e d In s tr uc t io ns

ASCII mode

You do not need to convert the ASCII codes, and they are all expressed in 16# values.

 ES3 sends the communication command: “:01 03 10 20 00 08 C4 CR LF”.

 ES3 receives the communication command: “:01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC AA

CR LF”.

RTU mode

 ES3 sends the communication command: “01 03 10 20 00 08 41 06”.

 ES3 receives the communication command: “01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC 90


FE”.

If the format is correct, SM100 is ON.

 The response messages from the DVP-ES2 is stored in registers D10 to D17.

 The following table lists the values in D10–D17.

Device D10 D11 D12 D13 D14 D15 D16 D17

Value
1234 5678 1122 3344 5566 7788 99AA BBCC
(16#)

4. After the receiving the data sent back from the DVP-ES2, the PLC confirms the data format sent back from 6_
DVP-ES2 and determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are

ON; if not SM102 is ON.

6-621
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 3

1. Function code 05 (16#05): the PLC writes the state into a bit device. The device is set to ON in this example.

_6

2. The ES3 Series CPU module is connected to the DVP-ES2 series PLC. D10.0 is ON and Y0 in the DVP-ES2 Series

PLC is also ON. When SM96 and M0 are ON, the PLC can set the state of Y0.

The following table lists the operands for the MODRW instruction.

Operand Description Device

S1 Unit address 1

S2 Function code 16#0005

S3 Device address 16#0500

S Register for reading and writing the data D10.0

n Data length (not used with this function code) 1

6-622
C ha pt er 6 A p pl i e d In s tr uc t io ns

ASCII mode

The numbers below are only for reference. Instead of showing the values in the ASCII codes, here the expressions

are shown in 16# values.

 ES3 sends the communication command: “:01 05 05 00 FF 00 F6 CR LF”

 ES3 receives the communication command: “:01 05 05 00 FF 00 F6 CR LF”

RTU mode

 ES3 sends the communication command: “01 05 05 00 FF 00 8C F6”

 ES3 receives the communication command: “01 05 05 00 FF 00 8C F6”

If the format is correct, SM100 is ON.

1. After receiving the data from the DVP-ES2, the PLC confirms the data format sent back from the DVP-ES2 and

determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are ON; if not

SM102 is ON.

2. When the DVP-ES2 receives this instruction, the Y0 is ON.

3. Since this function code writes data, the operand n is ignored.


6_

6-623
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 4

1. Function code 06 (16#06): the PLC writes the state into a word device.

2. ES3 Series CPU module is connected to the DVP-ES2 series PLC.

3. Suppose D10 is 16#55AA (waiting to write data to the device T0 of the DVP-ES2).
_6
When SM96 and M0 are ON, the PLC can write data to the T0 of the DVP-ES2 series PLC. The address of T0 is

16#0600.

The following table lists the operands for the MODRW instruction.

Operand Description Device

S1 Unit address 1

S2 Function code 16#0006

S3 Device address of T0 16#0600

S Register T0 for reading and writing the data D10

n Data length (not used with this function code) 0

6-624
C ha pt er 6 A p pl i e d In s tr uc t io ns

ASCII mode

You do not need to convert the ASCII codes, and they are all expressed in 16# values.

 ES3 sends the communication command: “:01 06 06 00 55 AA F4 CR LF”

 ES3 receives the communication command: “:01 06 06 00 55 AA F4 CR LF”

RTU mode

 ES3 sends the communication command: “01 06 06 00 55 AA 36 6D”

 ES3 receives the communication command: “01 06 06 00 55 AA 36 6D”

If the format is correct, SM100 is ON.

1. After receiving the data from the DVP-ES2, the PLC confirms the data format sent back from the DVP-ES2 and

determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are ON; if not

SM102 is ON.

2. When the DVP-ES2 receives this instruction, it writes the data stored in the device D10 to the device T0 in the

DVP-ES2.

3. Since this function code writes data, the operand n is ignored.


6_

6-625
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 5

1. Function code 0F (16#0F): the PLC writes the states into several bit devices.

2. ES3 Series CPU module is connected to the DVP-ES2 series PLC.

 Suppose D10.15-D10.0=16#04D2 (waiting to write the state of Y0-Y17 of the DVP-ES2)


_6
Device D10.7 D10.6 D10.5 D10.4 D10.3 D10.2 D10.1 D10.0

State ON ON OFF ON OFF OFF ON OFF

Value D 2

Device D10.15 D10.14 D10.13 D10.12 D10.11 D10.10 D10.9 D10.8

State OFF OFF OFF OFF OFF ON OFF OFF

Value 0 4

When SM96 and M0 are ON, the PLC can set the state of Y0-Y17 in the DVP-ES2. The address of Y0 is 16#0500.

6-626
C ha pt er 6 A p pl i e d In s tr uc t io ns

The following table lists the operands for the MODRW instruction.

Operand Description Device

S1 Unit address 1

S2 Function code 16#000F

S3 Device address of Y0 16#0500

S Registers Y0–Y17 for reading and writing the data D10.0

n Data length 16

ASCII mode

You do not need to convert the ASCII codes, and they are all expressed in 16# values.

 ES3 sends the communication command: “:01 0F 0500 0010 02 D2 04 03 CR LF”

 ES3 receives the communication command: “:01 0F A0 00 00 10 40 CR LF”

RTU mode

 ES3 sends the communication command: “01 0F 05 00 00 10 02 D2 04 EA 43”

 ES3 receives the communication command: “01 0F A0 00 00 10 76 07”


6_
If the format is correct, SM100 is ON.

1. After receiving the data sent back from the DVP-ES2, the PLC confirms the data format sent back from the

DVP-ES2 and determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are

ON; if not SM102 is ON.

Device Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0

State ON ON OFF ON OFF OFF ON OFF

Value D 2

Device Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10

State OFF OFF OFF OFF OFF ON OFF OFF

Value 0 4
2. Since this function code writes data, the operand n is ignored.

6-627
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 6

1. Function code 10 (16#10): the PLC writes the states into several word devices.

2. ES3 Series CPU module is connected to the DVP-ES2 series PLC.

3. Suppose the values for D20–27 are listed in the following table (waiting to write data to the devices T0–7 of the

_6 DVP-ES2).

Device D20 D21 D22 D23 D24 D25 D26 D27

Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC

When SM96 and M0 are ON, the PLC can write data to the T0–7 in the DVP-ES2 series PLC. The address of T0 is

16#0600.

The following table lists the operands of the MODRW instruction.

Operand Description Device

S1 Unit address 1

S2 Function code 16#0010

S3 Device address of T0 16#0600

S Register T0–7 for reading and writing the data D20

n Data length (not used with this function code) 8

6-628
C ha pt er 6 A p pl i e d In s tr uc t io ns

ASCII mode

You do not need to convert the ASCII codes, and they are all expressed in 16# values.

 ES3 sends the communication command: “:01 10 0600 00 08 10 1234 5678 1122 3344 5566 7788 99AA
BBCC 8F CR LF”

 ES3 receives the communication command: “:01 10 06 00 00 08 E1 CR LF”

RTU mode

 ES3 sends the communication command: “01 10 06 00 00 08 10 1234 5678 1122 3344 5566 7788 99AA
BBCC 0B 0C”

 ES3 receives the communication command: “01 10 06 00 00 08 C1 47”

If the format is correct, SM100 is ON.

1. After receiving the data sent back from the DVP-ES2, the PLC confirms the data format sent back from the

DVP-ES2, and determines if it is correct. If no error occurs in the format, the corresponding special flags SM100 are

ON; if not SM102 is ON. When the DVP-ES2 receives this instruction, it writes data stored in the devices D20–27 to

the device T0–7 in the DVP-ES2.

Device T0 T1 T2 T3 T4 T5 T6 T7
6_
Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC

2. Since this function code writes data, the operand n is ignored.

Additional remarks

1. If the value in S1 or S2 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

2. If the device specified by S is not sufficient to contain the n pieces of data, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

3. If n exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#200B.

4. If the function code specified by S2 is related to bit devices, the device specified by S must be a bit device;

otherwise, an operation error occurs, the instruction is not executed, and the error code in SR0 is 16#2003.

5. If the function code specified by S2 is related to word devices, the device specified by S must be a word device;

6-629
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

otherwise, an operation error occurs, the instruction is not executed, and the error code in SR0 is 16#2003.

6. If the communication command is 0x05 or 0x06, the value in n can be ignored. The length of the data is only one bit

or one word.

7. The MODRW instruction is not executed if the sending flags SM96 and SM97 are not ON.

8. If a communication timeout occurs, the timeout flags SM104 and SM105 are ON, and the receiving flags SM98 and

SM99 are OFF.

9. If an error occurs while receiving data, the error flags SM102 and SM103 are ON, and the receiving flags SM98 and

SM99 are OFF.

10. If the function code specified by S2 is related to word devices, the device in the external equipment with which the

PLC communicates must be a word device. If the function code specified by S2 is related to bit devices, the device

in the external equipment with which the PLC communicates must be a bit device.

11. Please refer to section 6.19.3 for more details on communication register setups (SM, SR).

_6

6-630
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

1812 COMRS S1, S2, S3, D1, D2 Sending and receiving communication data

Device X Y M S T C HC D FR SM SR E K 16# “$” F

S1    

S2  

S3    

D1 

D2 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
D1  
D2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Communication port number (1–2)


6_
S2 : Source of the data to be sent

S3 : Length of the data to be sent

D1 : First device where communication data received is stored

D2 Condition for ending receiving data

Explanation

1. S1 is a communication port number: COM1 is number 1 and COM 2 is number 2. If the data is out of the

communication port range, the instruction does not execute any sending or receiving.

2. If you use a specific character or characters to end receiving data, it is suggested that you apply the instruction to

ASCII data. If you do not apply the instruction to ASCII data, it is suggested that you use a timeout period to end

receiving data.

3. S2 is the source of the data to be sent.

S3 is the length of the data to be sent.

If S2 is D100 and S3 is 10, the instruction sends the values in the low bytes in D100–D109 through the

communication port specified by S1.

6-631
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. No strings are sent if the setting value in S3 is 0. The maximum number of characters that can be sent is 256 words.

5. D1 is the length of the data that is received.

D1+1–D1+n are the devices to store the data that is received

If D1 is D200, the value in D2 is 3, and the value in D2+1 is 16#0D0A, the instruction stores data received in the low

bytes in the devices starting from D201 (the high bytes is unchanged) The instruction continues to receive data until

it receives the consecutive stop characters 16#0D and 16#0A. The instruction writes the length of the data received

to D200 after receiving 16#0D and 16#0A, and sets a completion flag to ON after the receiving data stops.

6. D2 is the mode for receiving data

D2+1 is the condition that ends receiving of data

D2 and D2+1 are described in the following table.

D2 Mode for receiving data Setting value in D2+1 Remark

After the sending of data is


Not receiving communication
0 Unused complete, set a completion flag
data
to ON.

If the time that you set is greater

When the time after the last The setting value in D2+1 is time. than 3000 milliseconds, the

piece of data received exceeds The unit of measurement is 1 value in D2+1 is 3000. If the time
1
the time set in D2+1, the millisecond. The setting value in that you set is less than 5
_6
receiving of data is complete. D2+1 is between 5–3000. milliseconds, the value in D2+1 is

5.

The data received ends with a The setting value in D2+1 is a If a specific character is 16#0A,
2
specific character. specific character. the value in D2+1 is 16#000A.

If two specific characters are


The data received ends with two The setting value in D2+1 is two
3 16#0D and 16#0A, the value in
consecutive specific characters. specific characters.
D2+1 is 16#0D0A.

The data received starts with a A specific character is stored in


specific character. When the the high byte in D2+1, and the
If a start character is 16#3A, and
time after the last piece of data is time is stored in the low byte in
4 time is 15 milliseconds, the value
received exceeds the time set in D2+1. The time set in the low
in D2+1 is 16#3A0F.
D2+1, the receiving of data is byte in D2+1 is in the range of

complete. 5–255 milliseconds.

The data received starts with a The setting value in D2+1 is a If a start character is 16#3A, and

5 specific character, and ends with specific start character, and a a stop character is 16#0A, the
a specific character. specific end character. value in D2+1 is 16#3A0A.

6-632
C ha pt er 6 A p pl i e d In s tr uc t io ns

D2 Mode for receiving data Setting value in D2+1 Remark

The setting value in D2+1 is the If you want to receive 10


A specific quantity of data is
6 length of the data to receive. The characters, set the value in D2+1
received.
setting value is between 1–256. to 10.

The data received ends with a


The setting value in D2+1 is a If an end character is 16#0A, the
7 specific character and generates
specific end character. value in D2+1 is 16#000A.
communication interrupts.

Set the quantity of data received The setting value in D2+1 is the If you want to receive 10

8 and then generate length of the data received. The characters, set the value in D2+1

communication interrupts. setting value is between 1–256. to 10.

A specific end character is


The data received ends with a
stored in the high byte in D2+1, If an end character is 16#0A,
specific character or a specific
and the time is stored in the low and time is 15 milliseconds, the
9 quantity of data received; when
byte in D2+1. The time set in the data length is 15 words, the
either condition is met, the
low byte in D2+1 must be value in D2+1 is 16#0A0F.
transmission is complete.
between 1–255 milliseconds.

If the mode used is not

Others supported, the instruction is not

executed.

6_
7. Except for mode 6 and 8, when data received in D2 exceeds the maximum range of the received data length (256

words) and no ending character is received, the instruction stops executing and treats this operation as a receiving

error. D1+0 is 0 and D1+1–D1+n do not store the received data.

8. The interactions among the communication port, the related special auxiliary relays, and the related special data

register are described in Section 6.19.3.

9. Timing diagrams

 Mode for receiving data: 0

When data is sent, you cannot cancel the sending of data. If the conditional contact preceding the instruction

is not enabled, the data will still be sent, but the completion flag will not be set to ON after sending of the data

is complete.

 Mode for receiving data: 1 or 4

6-633
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Starting the ex ecution


of the ins truc ti on
Sending d ata

Reception fl ag

Rec eiving d ata

Completion fl ag

Comm uni cation


timeout fl ag

2 3 2 5
1 4 4 1

Description:

① Start/stop the execution of the instruction.

② Time during which data is sent. The period of time in which data is sent is not measured.

③ After the first character is received, the time that passes before the next character is received is

measured. Whenever a character is received, the instruction clears the time measured. The completion

flag is not be set to ON until the time measured is greater than the setting value in D2+1.
_6
④ If the instruction is still enabled after you reset the completion flag or the communication flag, the next

communication data is sent automatically when the instruction is scanned in the next cycle.

⑤ When the PLC begins to receive data, it begins to measure the time that passes. It does not set the

communication timeout to ON until the time measured exceeds the timeout period. It is suggested that

you set the timeout period to be longer than the time set in D2+1.

6-634
C ha pt er 6 A p pl i e d In s tr uc t io ns

 Mode for receiving data: 2, 3, 5, 6, or 9.

Starting the ex ecution


of the ins truc ti on
Sending d ata

Reception fl ag

Rec eiving d ata

Completion fl ag

Comm uni cation


timeout fl ag

2 3 2 2
1 4 4 1

Description:

①  Start/stop the execution of the instruction.

②  Time during which data is sent. The period of time in which data is sent is not measured.

③  After the first character is received, the time that passes before the next character is

received is measured. Whenever a character is received, the instruction clears the time measured.

The communication timeout flag is not set to ON until the time measured exceeds the
6_
timeout period.

④  If the instruction is still enabled after you reset a completion flag or a communication flag,

the next communication data is sent automatically when the instruction is scanned in the

next cycle.

10. Mode for sending data / Mode for receiving data

8-bit mode: The command that is edited is stored in the initial transmission device, and the command to be sent

includes the head code and the tail code. The instruction divides the 16-bit data into the high 8-bit data and the low

8-bit data. The instruction ignores the high 8-bit data, and can send or receive the low 8-bit data can be sent or

received. Take standard Modbus for example.

Sending the data: (PLC→external equipment)

6-635
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Receiving the data: (External equipment→PLC)

16-bit mode: The command that is edited is stored in the initial transmission device, and the command to be sent

includes the head code and the tail code. When SM106/SM107 is OFF, the instruction divides the 16-bit data into

the high 8-bit data and the low 8-bit data.

Sending the data: (PLC→external equipment)

Receiving the data: (External equipment→PLC)

_6

The data that the PLC receives from the external equipment includes the head and the tail code; therefore, you

have to be aware of the setting for the length.

11. When the mode is 7 or 8, the corresponding communication port and the interrupt number are listed in the following

table.

Communication port
COM1 COM2 Card1 Card2
number

Interruption number I300 I302 I304 I306

12. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called
only once.

6-636
C ha pt er 6 A p pl i e d In s tr uc t io ns

The following examples use COM1 (RS485).

Example 1

The mode in D2 is 0 (not receiving communication data) and you set the mode for sending and receiving data to 8-bit

mode (SM106=ON).

1. The length for the data to be sent: D20=4.

2. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

3. Set D10=16#0000 (sending data only, not receiving data).

4. Enable the contact M0.

5. The PLC sends 4 pieces of data.

6. Sending data: PLC→external equipment 31 32 33 34.

7. Since receiving data is not required, after the PLC sends out the data, the operation ends, and SM100=0. 6_
8. To send more data, set the flag SM100 to OFF to start the operation again.

Example 2

The mode in D2 is 1 (setting the timeout value to 5–3000 ms) and you set the mode for sending and receiving data to
16-bit mode (SM106=OFF).

1. The length for the data to be sent: D20=4.

2. The contents for the data to be sent: D100=16#3231, D101=16#3433.

6-637
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. Set D10=16#0001 (mode: 1), D11=300 (set the timeout value to 300 ms).

4. Enable the contact M0.

5. PLC sends 4 pieces of data.

6. Sending data: PLC→external equipment 31 32 33 34.

7. After the external equipment receives the data from the PLC, it sends 5 consecutive data to the PLC, each sent in

less than 20 ms. External equipment→PLC 35 36 37 38 39.

8. D200=5 (number of data received), and the content of data received: D201=16#3635, D202=16#3837,

D203=16#0039.

9. SM100=ON: reception of data is complete.

10. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the sending of data is complete, the receiving flag SM98 is ON, and then the PLC starts to receive data. You

set the timeout between each data reception in D11. When the interval time exceeds the set timeout and no data is

received, SM100 is ON.

Example 3

_6 The mode in D2 is 2 (the data received ends with a specific character.) and you set the mode of sending and receiving

data to 8-bit mode (SM106=ON).

1. Set the length of the data to be sent: D20=0, meaning the PLC will not send data but only receives data.

2. Set D10=16#0002 (mode: 2), D11=16#000A (the ending character is 16#0A).

3. Enable the contact M0.

4. The PLC waits to receive data from the external equipment. D20=0 means that the PLC does not send data to the

external equipment.

5. The external equipment sends data to the PLC.

External equipment → PLC 31 32 33 34 35 0A.

6-638
C ha pt er 6 A p pl i e d In s tr uc t io ns

6. D200=6 (number the data received), the content of data received: D201=16#0031, D202=16#0032, D203=16#0033,

D201=16#0034, D202=16#0035, D203=16#000A

7. SM100=ON: reception of data is complete.

8. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the sending of data is complete, the receiving flag SM98 is ON and then the PLC starts receiving data until

receiving the ending character (16#0A). When the reception of data is complete, SM100 is ON. If the

communication timeout occurs but the ending character (16#0A) is still not received, the communication timeout

flag SM104 is ON.

Example 4

The mode in D2 is 3 (the data received ends with two specific characters.) and you set the mode for sending and receiving

data to 16-bit mode (SM106=OFF).

This example uses a DVP-ES2 as the external equipment and writes H1234 to D100 in the DVP-ES2.

6_

1. The length for the data to be sent: D20=17.

2. The contents for the data to be sent: D100=16#303A, D101=16#3031, D102=16#3136, D103=16#3630,

D104=16#3134, D105=16#3332, D106=16#3334, D107=16#0D46, D108=16#000A.

3. Set D10=16#0003 (mode: 3), D11=16#0D0A (the ending characters are 16#0D and 16#0A).

4. Enable the contact M0.

5. The PLC sends 17 pieces of data.

Sending data: PLC→external equipment 3A 30 31 30 36 31 30 36 34 31 32 33 34 33 46 0D 0A

(ASCII code: 0106106412343FCRLF)

6. The external equipment receives the data from the PLC and the last 2 data are 16#0D and 16#0A.

External equipment → PLC 3A 30 31 30 36 31 30 36 34 31 32 33 34 33 46 0D 0A

(ASCII code: 0106106412343FCRLF)

6-639
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

7. D200=17 (number of the data received), and the content of the received data: D201=16#303A, D202=16#3031,

D203=16#3136, D204=16#3630, D205=16#3134, D206=16#3332, D207=16#3334, D208=16#0D46,

D209=16#000A.

8. SM100=ON: reception of data is complete.

9. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When sending of data is complete, the receiving flag SM98 is ON and then the PLC starts receiving data until it

receives the ending character (16#0D0A). When the reception of data is complete, SM100 is ON. If the

communication timeout occurs but the ending character (16#0D0A) is still not received, the communication

timeout flag SM104 is ON.

Example 5

The mode in D2 is 4 (the data received starts with a specific character and you set the timeout value to 5–255 ms.) and

you set the mode of sending and receiving data to 8-bit mode (SM106=ON).

_6

1. The length for the data to be sent: D20=4.

2. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

3. Set D10=16#0004 (mode: 4), D11=16#3A0F (the starting character is 16#3A and set the time value to 16#0F,

meaning 15ms).

4. Enable the contact M0.

5. The PLC sends 4 pieces of data.

Sending data: PLC→external equipment 31 32 33 34

6. The external equipment receives data from the PLC and then sends 7 consecutive words to the PLC with an

interval of 1 ms between each sending.

External equipment → PLC 30 3A 35 36 37 38 39

7. D200=6 (number of the data received), and the content of the received data: D201=16#003A, D202=16#0035,

D203=16#0036, D204=16#0037, D205=16#0038, D206=16#0039.

6-640
C ha pt er 6 A p pl i e d In s tr uc t io ns

8. SM100=ON: reception of data is complete.

9. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the sending of data is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When the PLC receives the starting character 16#3A, it starts receiving data. The interval timeout between

receiving each piece of data is set in D11. When the interval time exceeds the set timeout 16#0F (15 ms) and no

data is coming in, SM100 is ON.

Example 6

The mode in D2 is 5 (the data received starts and ends with a specific character) and you set the mode of sending and

receiving data to 16-bit mode (SM106=OFF).

The example uses a DVP-ES2 as the external equipment and reads data from D100 in the DVP-ES2.

1. The length for the data to be sent: D20=17.


6_
2. The contents for the data to be sent: D100=16#303A, D101=16#3031, D102=16#3133, D103=16#3630,

D104=16#3034, D105=16#3030, D106=16#3831, D107=16#0D37, D108=16#000A

3. Set D10=16#0005 (mode: 5), D11=16#3A0A (the starting character is 16#3A and the ending character is 16#0A).

4. Enable the contact M0.

5. The PLC sends 17 pieces of data.

Sending data: PLC→external equipment 3A 30 31 30 36 31 30 36 34 31 32 33 34 33 46 0D 0A

(ASCII code: 0106106412343FCRLF)

6. The external equipment receives data from the PLC and the last 2 data are 16#0D and 16#0A.

External equipment → PLC 3A 30 31 30 36 31 30 36 34 31 32 33 34 33 46 0D 0A

(ASCII code: 0106106412343FCRLF)

7. D200=15 (number of the data received), and the content of the received data: D201=16#303A, D202=16#3031,

D203=16#3033, D204=16#3132, D205=16#3332, D206=16#4234, D207=16#0D34, D208=16#000A.

8. SM100=ON: reception of data is complete.

6-641
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

9. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the data sending is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When the PLC receives the starting character 16#3A, it starts receiving data until receiving the ending character

16#0A, and SM100 is ON. If the communication timeout occurs but the starting character 16#3A or the ending

character 16#0A is still not received, the communication timeout flag SM104 is ON.

Example 7

The mode in D2 is 6 (the received data length) and you set the mode of sending and receiving data to 8-bit mode

(SM106=ON).

1. The length for the data to be sent: D20=4.

2. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

3. Set D10=16#0006 (mode: 6), D11=16#0008 (8 pieces of data to be received).


_6
4. Enable the contact M0.

5. The PLC sends out 4 pieces of data.

Sending data: PLC→external equipment 31 32 33 34

6. The external equipment receives data from the PLC and then sends 8 consecutive data to the PLC.

External equipment → PLC 32 33 34 35 36 37 38 39

7. D200=8 (number of the data received), and the content of the received data: D201=16#0032, D202=16#0033,

D203=16#0034, D204=16#0035, D205=16#0036, D206=16#0037, D207=16#0038, D208=16#0039.

8. SM100=ON: reception of data is complete.

9. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the data sending is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When receiving a set quantity of data, the SM100 is ON. If the communication timeout occurs but the set quantity

of data is still not received, the communication timeout flag SM104 is ON.

6-642
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 8

The mode in D2 is 7 (the data received ends with a specific character and generates communication interrupts) and you

set the mode of sending and receiving data to 8-bit mode (SM106=ON).

Communication interrupt programs:

1. Clear the interrupt: D30=0.

2. The length for the data to be sent: D20=4.

3. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

4. Set D10=16#0007 (mode: 7), D11=16#000A (16#0A is the ending character).

5. Enable the contact M0.


6_
6. The PLC sends out 4 pieces of data.

Sending data: PLC→external equipment 31 32 33 34

7. D30=0 (the programs in the interrupt are not executed).

8. The external equipment sends data to the PLC.

External equipment → PLC 31 32 33 34 35 0A

9. D200=6 (number of the data received), and the content of the received data: D201=16#0031, D202=16#0032,

D203=16#0033, D201=16#0034, D202=16#0035, D203=16#000A.

10. SM100=ON: reception of data is complete.

11. D30=1 (the interrupt is triggered and then INC D30 is executed).

12. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the data sending is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When receiving the set ending character (16#06), SM100 is ON. If the communication timeout occurs but the set

ending character is still not received, the communication timeout flag SM104 is ON.

6-643
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 9

The mode in D2 is 8 (the set quantity of data is received and generates communication interrupts) and you set the mode

of sending and receiving data to 8-bit mode (SM106=ON).

Communication interrupt programs:

1. Clear the interrupt: D30=0

2. The length for the data to be sent: D20=4.

3. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

4. Set D10=16#0008 (mode: 8), D11=16#0008 (8 pieces of data to be received).

5. Enable the contact M0.


_6
6. The PLC sends out 4 pieces of data.

Sending data: PLC→external equipment 31 32 33 34

7. D30=0 (the programs in the interrupt are not executed).

8. The external equipment receives data from the PLC and then sends 8 consecutive data to the PLC.

9. External equipment → PLC 32 33 34 35 36 37 38 39

10. D200=8 (number of the data received), and the content of the received data: D201=16#0032, D202=16#0033,

D203=16#0034, D204=16#0035, D205=16#0036, D206=16#0037, D207=16#0038, D208=16#0039.

11. SM100=ON: reception of data is complete.

12. D30=1 (the interrupt is triggered and then the INC D30 is executed).

13. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the data sending is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When receiving the set quantity of data, SM100 is ON. If the communication timeout occurs but the set quantity of

data is still not received, the communication timeout flag SM104 is ON.

6-644
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 10

The mode in D2 is 9 (the set ending character or the set quantity of data is received) and set the mode of sending

data/mode of receiving data to 8-bit mode (SM106=ON).

1. The length for the data to be sent: D20=4.

2. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.

3. Set D10=16#0009 (mode: 9), D11=16#0A0F (the ending character is 16#0A and the set data length is 16#0F).

4. Enable the contact M0.

5. The PLC sends out 4 pieces of data.

Sending data: PLC→external equipment 31 32 33 34

6. The external equipment receives data from the PLC and then sends 15 pieces of data to the PLC.

External equipment → PLC 31 32 33 34 35 0A 41 42 43 44 45 46 47 48 49


6_
7. D200=6 (number of the data received), and the content of the received data: D201=16#0031, D202=16#0032,

D203=16#0033, D204=16#0034, D205=16#0035, D206=16#000A.

The PLC stops receiving data after the 6th piece of data is received.

8. SM100=ON: reception of data is complete.

9. To send more data, set the flag SM100 to OFF to start the operation again.

NOTE: When the data sending is complete, the receiving flag SM98 is ON and then the PLC is ready to receive data.

When receiving the set ending character or the set quantity of data, the SM100 is ON. If the communication

timeout occurs but the set ending character or the set quantity of data is still not received, the communication

timeout flag SM104 is ON.

6-645
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. There is no limit on the number of times you can execute the COMRS communication instruction. However, each
communication port can only be enabled by one communication instruction, and the later communication

instructions that follow are not executed.

2. The instruction does not use checksum when you execute this instruction. If you need a checksum, use COMRS
and another available instruction.

3. If the value in D2 is 2, 3, 5, 6 or 9, it is suggested that you set a timeout period. After you set a timeout period, the
instruction tries to send the data again if a stop character is not received.

4. The instruction does not automatically clear the value in D1–D1+n whenever the instruction is executed or the PLC
begins to receive new communication data. You can know whether and how much data the PLC receives only after

a completion flag switches from OFF to ON. If you want to clear the values in D1–D1+n, use the ZRST instruction

(API 1206).

5. If the value in S1 is out of range, the instruction is not executed.

6. If the number of devices starting from S2 is not equal to the value in S3, the instruction is executed, SM0 is ON, and
the error code in SR0 is 16#2003.

7. If the value in D2 is not between 0–9, the instruction is not executed, SM0 is ON, and the error code in SR0 is
16#200B.

8. If the value in D2 is 6, 8 or 9, and the number of devices starting from D1 is not equal to the value in D2+1, the
instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

9.
_6 If the quantity of data received is greater than the number of devices starting from D1, the data that cannot be stored
is ignored.

10. If a completion flag is ON, the PLC stops receiving data. If a communication port receives data when a completion
flag is ON, the data is not received.

11. If the setting value in S3 is not between 0–256, the instruction is not executed, SM0 is ON, and the error code in
SR0 is 16#200B.

12. When the mode of D2 is 6 or 8, the length of D2+1 not between 1–256, the instruction is not executed. SM0 is ON,
and the error code in SR0 is 16#200B.

6-646
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

Setting the communication format for a serial


1813 COMDF P S1, S2, S3, S4, S5, D
communication port

Device X Y M S T C HC D FR SM SR E K 16# “$” F

S1  

S2  

S3  

S4  

S5  

D  
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

S1
S2
S3
S4
S5
D

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
6_
Symbol

S1 : Baud Rate (Unit:100 bps)

S2 : Number of data bits

S3 : Parity bit

S4 : Number of end bits

S5 : Modbus format selection

D : Communication port number

Explanation

1. This instruction provides a way to directly set the parameter values, instead of declaring variables.

2. S1 sets the baud rate with the units 100 bps. For example, a value 96 indicates 9600 bps.

3. S2 sets the number of data bits. The value 7 indicates 7 data bits and 8 indicates 8 data bits. If the value is not 7 or 8

in S2, the instruction uses the default value.

6-647
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. S3 sets the parity bit. The value 0 indicates None (no parity bit). The value 1 indicates Odd bit checking. The value 2

corresponds to Even bit checking. If the value in S3 is not 0, 1 or 2, the instruction uses the default value.

5. S4 sets the number of end bits. The value 1 (preset) indicates 1 bit. The value 2 indicates 2 bits. If the value in S4 is

not 1 or 2, the instruction uses the default value.

6. S5 sets the communication mode for Modbus communication. The value 0 indicates ASCII (default value). The

value of 1 indicates RTU. If the value in S5 is not 0 or 1, the instruction uses the default value.

7. D sets communication port number. The number for COM1 is 1 and COM2 is 2. If the setting value is out of the valid

range, the instruction does not set the communication port format.

8. You can also directly set the communication port in HWCONFIG in ISPSoft/DIADesigner (COM Port settings) or

with the special registers. For more, see the ISPSoft/DIADesigner user manual. Refer to Section 6.19.3 for setting

the communication-related SR and SM registers.

9. The communication at the actual communication port changes immediately after you change the setting of the

instruction. If some communication is being carried out at the moment, it is forced to cancel. Additionally, the

corresponding setting value in SM/SR changes accordingly. For details on SM/SR, refer to Section 6.19.3.

10. This instruction does not change any setting for the actual communication port when the communication format

setting is the same as the previous setting.

Example
_6
1. This example uses the PLC COM1 port. Other PLC communication ports are similar.

2. The contact for the start condition is M0.

3. Set the (RS485) communication format of PLC COM1 to 115200, 8, E and 1.

4. Set the (RS485) communication mode of PLC COM1 to ASCII.

5. The following table explains the COMDF operands for the example.

Operand Description Content value

S1 Baud Rate 115200 bps 1152

S2 Number of data bits 8 8

S3 Parity bit E 2

S4 Number of end bits 1 1

S5 Modbus format selection ASCII 0

D Communication port number PLC COM1 1

6-648
C ha pt er 6 A p pl i e d In s tr uc t io ns

6_

6-649
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

Serial communication instruction exclusive for


1814 VFDRW S1, S2, S3, S
Delta AC motor drive

Device X Y M S T C HC D FR SM SR E K 16# “$” F

S1      

S2      

S3      

S 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Communication port number

S2 : VFD station address


_6
S3 : Function code

S : Source and received data

Explanation

1. S1 sets the communication port number. The number for COM1 is 1 and COM2 is 2. If the value exceeds the valid

range, the instruction does not receive any communication data.

2. S2 sets the station address for the VFD AC motor drive. 0 indicates that the instruction uses the broadcast mode.

The range is between 0–254, and the instruction is not executed if this value is out of the valid range.

3. S3 is the communication function code, and S is the source or received data as explained in the following table.

S3 function
S3 function name S source and received data Remark
code

0 Reset due to abnormality Unused Any value can be stored in S.

1 Clockwise running command Velocity value Refer to AC motor drive user

6-650
C ha pt er 6 A p pl i e d In s tr uc t io ns

S3 function
S3 function name S source and received data Remark
code

Counterclockwise running manual for the setting value and


2 Velocity value
command the unit.

3 Stop Unused Any value can be stored in S.

Jog clockwise running


4 Unused Refer to AC motor drive user
command
manual for setting the jog
Jog counterclockwise running
5 Unused velocity.
command

Refer to AC motor drive user

manual for the meaning of the

state values of the 5 bit


6 Reading the state Received state values
addresses H2100–H2104 for

VFD.

4. The following chart shows the timing for sending and receiving data.

Enable/disable t he exec ution


of the instruction

Sending data 6_

Rec eption fl ag

Receiv ing data

Compl etion fl ag

  
 
Description:

  Start or stop the execution of the instruction.

  Transmitting data begins. During this time, the communication timeout time is not measured.

  The reception flag is set. From the moment when the first character is received to the moment when the next

character is received, the period of time is measured. Whenever a character is received, the measured time is

cleared to 0. The instruction generates the communication timeout flag if the time measured is greater than

the communication timeout setting value.

6-651
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

  When receiving of data is complete, the instruction sets the completion flag. You must clear the flag before

receiving more data.

  The instruction is stopped for one cycle after the completion flag is set. Then the instruction can be started in

the next cycle.

5. There is no limit to the number of times the instruction can be executed. The instruction can use only one

communication port for the output and execution of one communication instruction each time. If receiving and

sending data is complete, you must disable the instruction to correctly release the communication control.

6. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called
only once.

Example of setting the communication protocol

1. Set the PLC COM1 (RS485) port with station address 2 and the communication format in HWCONFIG with these

values: ASCII , 115200, 7, N, 2.

2. Set the motor drive parameters using the panel on the Delta C2000 AC motor drive according to the following steps.

A. Set 09-00 to 1: the station address of the AC motor drive is set to 1.

B. Set 09-01 to 115.2: RS485 baud rate of the AC motor drive is 115200.

C. Set 09-04 to 1: RS485 communication format of the AC motor drive is 7, N, 2.


_6
D. Set 09-20 to 1: the frequency instruction is input through RS485.

E. Set 09-21 to 2: the running instruction is input through RS485.

6-652
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

Use the VFDRW instruction to control the velocity: make the VFD run forward at the frequency of 120Hz, then run in

reverse at the frequency of 180Hz, and then stop running.

6_

1. Connect ES3 CPU to VFD.

Set D202=12000 initially. When M1 is ON, VFD starts to accelerate after receiving the clockwise running command,

and runs clockwise at 120Hz.

2. Set D204=18000 initially. When M2 is ON, VFD starts to decelerate until it stops after receiving the

counterclockwise running command, and runs counterclockwise at 180Hz.

6-653
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. When M3 is ON (at this time, the value in D206 is ignored), VFD decelerates to stop after receiving the stop

command.

4. When M4 is ON, the instruction reads the values of H2100–H2104 of VFD and stores them in D220–224.

Device D220 D221 D222 D223 D224

Frequency
Content Error code VFD state Output frequency Output current
command

The state of the VFD:

Bit2=1 causes the VFD to execute the Jog command. Bit4–3=11B causes the VFD to run counterclockwise. The

frequency command is 18000, and causes the VFD to run at 180Hz. For the definitions of the parameter addresses

in the communication protocol, refer to the Delta AC Motor Drive user manual.

5. The reception completion flag SM100 is ON, and the values of M1–M5 are cleared to avoid interfering with the next

communication command.

After receiving the data that the VFD sends back, the instruction checks the format of the data sent back from VFD.

If the data format is correct, SM100 is ON; otherwise, SM102 is ON.

_6

6-654
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

Serial communication instruction exclusive for


1815 ASDRW S1, S2, S3, S
Delta servo drive

Device X Y M S T C HC D FR SM SR E K 16# “$” F

S1      

S2      

S3      

S 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Communication port number

S2 : Station address of the servo


6_
S3 : Function code

S : Source and received data

Explanation

1. S1 sets the communication port number. The number for COM1 is 1 and COM2 is 2. If the value exceeds the valid

range, the instruction does not receive any communication data.

2. S2 sets the station address for the servo. 0 indicates that the instruction uses the broadcast mode. The range of the

value is between 0–254. The instruction is not executed if the value is out of the valid range.

3. Refer to Delta Servo Operation manual for details on servo parameters.

4. S3 is the communication function code, and S is the source or received data as explained in the following table.

6-655
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

S3 and S operands for the A, AB, A+, B Series

S3 function
S3 function name S source or received data Remark
code

Occupies 5 consecutive devices Reading the state value from


0 Reading the servo state value
S–S+4 P0-04–P0-08

Occupies 8 consecutive devices Reading the value from the


1 Reading the servo register value
S–S+7 registers P0-09–P0-16

Occupies 8 consecutive devices Writing the data in the registers


2 Writing the servo register value
S–S+7 P0-09–P0-16

The range of velocity: 1–3000;


Jog velocity input, clockwise
4999 (run clockwise) Writing the data into the registers
3 running, counterclockwise
4998 (run counterclockwise) P4-05
running and stop
5000 (stop)

1: Servo On Writing the data into the registers


4 Servo ON/OFF
Any other value: Servo OFF P2-30

Writing the data into the registers


5 Velocity command Valid range: -5000 to 5000
P1-09–P1-11

Writing the data into the registers


6 Torque command Valid range: -300 to 300
P1-12–P1-14
_6

S3 and S operands for the A2, B2 Series

S3 function
S3 function name S source or received data Remark
code

Reading the state value from the


Occupies 10 consecutive registers P0-09–P0-13
16 Reading the servo state value
devices S–S+9
(32-bit value)

Writing the data into the registers

Writing data into the servo Occupies 8 consecutive devices P0-17–P0-20


17
register S–S+7 (32-bit value)

Writing the data into the registers


Writing the mapping parameter Occupies 8 consecutive devices
18 P0-25–P0-28
value *1 S–S+7
(32-bit value)

6-656
C ha pt er 6 A p pl i e d In s tr uc t io ns

S3 and S operands for the A2, B2 Series

S3 function
S3 function name S source or received data Remark
code

Valid range of velocity: Valid Writing data into the registers

Jog velocity input, run clockwise, range 1–5000; P4-05

19 run counterclockwise, 4999 (run clockwise)

stop 4998 (run counterclockwise)

0 (stop)

1: Servo On Writing the data into the registers


20 Servo ON/OFF
Any other value: Servo OFF P2-30

Occupies 6 consecutive devices Writing data into the registers


Velocity command
21 with the valid setting value P1-09–P1-11
(3 sets)
range: -60000 to 60000 (32-bit value)

Occupies 6 consecutive devices Writing the data into the registers


Torque command
22 with the valid setting value P1-12–P1-14
(3 sets)
range: -300 to 300 (32-bit value)

Writing the data into the registers


Setting the mapping targets of Occupies 8 consecutive devices
23 P0-35–P0-38
servo parameters S–S+7
(32-bit value)
6_
*1: B2 series does not support function code 18 and 23.

5. The following chart shows the timing for sending and receiving data.

Enable/disable t he exec ution


of the instruction

Sending data

Rec eption fl ag

Receiv ing data

Compl etion fl ag

  
 
Description:

6-657
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Start or stop the execution of the instruction.

Transmitting data begins. During this period, the communication timeout time is not measured.

 The reception flag is set. From the moment when the first character is received to the moment when the next

character is received, the period of time is measured. Whenever a character is received, the measured is

cleared to 0. The instruction generates the communication timeout flag if the time measured is greater than

the communication timeout setting value.

  When receiving of data is complete, the instruction sets the completion flag. You must clear the flag before

receiving more data.

  The instruction is disabled for one cycle after the completion flag is set. Then the instruction can be started in

the next cycle.

6. There is no limit to the number of times the instruction can be executed. The instruction can use only one

communication port for the output and execution of one communication instruction each time. If receiving and

sending data is complete, you must disable the instruction to correctly release the communication control.

7. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called
only once.

Example of setting the communication protocol:

_6 1. Set the PLC COM1 (RS485) port in HWCONFIG with these values: ASCII , 115200, 8, E, 1

2. Set the servo parameters using the panel on the Delta ASDA-A2 servo according to the following steps.

A. Set P2-08 to 10 to restore the factory settings.

B. Cycle the power on the servo off and then back on.

C. Set P1-01 to 0001 (PR mode).

D. Set P3-00 to 2: the station address of the servo is set to 2.

E. Set P3-01 to 0205: the RS485 baud rate of the servo is set to 115200.

F. Set P3-02 to 0004: the RS485 communication format of the servo is set to 8, E, 1.

G. Cycle the power to the servo again after completing these settings.

6-658
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

Use the ASDRW instruction to control the velocity: make the servo run to the relative position 5000000 PUU by

accelerating for 400 ms to the speed 3000.0 r/min and then decelerating for 200 ms.

6_

6-659
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

1. Connect the ES3 CPU to ASDA-A2.

Set D100=1 initially. When M1 is ON, ASDA-A2 is Servo ON.

2. Set the values in D200–D207 as in the following table, which are written to P0-35–P0-38 in the ASDA-A2. The

values occupies 8 consecutive devices.

Device D200 D201 D202 D203 D204 D205 D206 D207

Setting value (16#) 05140515 06020602 06030603 053C0507

When M2 is ON, the values in D200–D207 are written to P0-35–P0-38 in the ASDA-A2.

The setting values of P0-35–P0-38 are set the mapping target for P0-25–P0-28. You can set the mapping target;

refer to the Delta servo operation manual.

ASDA-A2 P0-35 P0-36 P0-37 P0-38

Setting value (16#) 0514 0515 0602 0602 0603 0603 053C 0507

Setting the value of P0-38 to 053C 0507indicates that the mapping parameter target for P0-28 is P5-60 (16 bits)
_6 and P5-07 (16 bits).

ASDA-A2 P0-25 P0-26 P0-27 P0-28

Mapping parameter
P5-20, P5-21 P6-02 P6-03 P5-60, P5-07
target

Acceleration/deceleration
Target velocity and
time1
Parameter name Path type1 Path1 data PR command trigger
Acceleration/deceleration

time2

3. The following table shows the setting values in D220–D227.

Device D220 D221 D222 D223 D224 D225 D226 D227

Setting value (16#) 0190 00C8 0000 1083 4C4B40 7530 0001

When M3 is ON, the values in D220-D227 are written into P0-25–28 in the ASDA-A2.

ASDA-A2 P0-25 P0-26 P0-27 P0-28

Setting value (16#) 0190 00C8 0000 1083 4C4B40 7530 0001

6-660
C ha pt er 6 A p pl i e d In s tr uc t io ns

The servo starts running with the parameters: acceleration time=0190 (400 ms), deceleration time=00C8 (200 ms),

path type=1083, position command=4C4B40 (5000000 PUU), target velocity=7530 (3000.0 rpm) and PR command

trigger =1.

4. Set the values in D240-D247 as shown in the following table, to be written into P0-17–P0-20 in the ASDA-A2. The

values occupy 8 consecutive devices.

Device D240 D241 D242 D243 D244 D245 D246 D247

Setting value (10#) 41 0 0 0

When M4 is ON, the values in D240–D247 are written into P0-17–20 in the ASDA-A2.

The setting values of P0-17–20 set the contents of P0-09–12.

You can set the contents to be displayed; refer to the Delta Servo Operation manual.

ASDA-A2 P0-17 P0-18 P0-19 P0-20

Setting value (10#) 41 0 0 0

Setting P0-17 to 41 indicates that the contents of P0-09 is the drive state.

ASDA-A2 P0-09 P0-10 P0-11 P0-12

Number of motor Number of motor Number of motor


Content Drive state
feedback pulses feedback pulses feedback pulses
6_
5. When M5 is set to ON, the values of P0-17- P0-20 of ASDA-A2 are read to D260-D267.

Device D260 D262 D264 D266

Number of motor Number of motor Number of motor


Content Drive state
feedback pulses feedback pulses feedback pulses

When the drive state bit (Bit 4) is one, it indicates that the target position is reached.

Refer to Delta servo operation manual for the explanation for P0-46.

6. When the reception completion flag SM100 is set to ON, the instruction clears the values of M1–M5 to avoid

interfering with the next communication command.

After receiving the data that the ASDA-A2 sends back, the PLC checks the format of the data sent back from the

ASDA-A2. If the data format is correct, SM100 is ON; otherwise, SM102 is ON if the data format is incorrect.

6-661
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Setting the parameters in the data
1816 CCONF P S1-S11
exchange table for a communication port

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
S5    
S6    
S7  
S8    
S9    
S10    
S11  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1-S11 Refer to the explanation for the instruction.

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1-S11 : Refer to the explanation for the instruction.

_6

6-662
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. The following table lists the names and descriptions of S1–S11.

Device Name Description Data type Remark

1=COM1, 2=COM2.
Communication port
S1 Any other value, the instruction does not WORD
number
modify the operand.

Valid range: 1–32.


Item number in the data
S2 If the value is out the range, the instruction WORD
exchange table
does not modify the operand.

Valid range: 0 and 1–240. A

If the value is greater than 240, the negative


The station address of the
S3 instruction uses 240 as the value. If the WORD number is
remote equipment
value is less than or equal to 0, the original processed

station address is not changed. as 0.

Supports 16#01, 02, 03, 04 and 17.

Function code for reading If the value exceeds the valid range, the
S4 WORD
data instruction does not modify the operand. If

S4=16#17, it is processed as 16#17.

Reading the remote 6_


S5 16#0000–16#FFFF WORD
communication address

Bit function code, 16#01, 02: Supports

1–256 bits for the CPU firmware V1.06.00


or earlier, and 1–1600 bits for the CPU
firmware V1.08.00 or later;

Word function code, 16#03, 04, 17:


S6 Reading data length WORD
Supports 1–100 words.

If the value is 0 or less than 0, it indicates

not reading data.

If the value is greater than the maximum,

the instruction uses the maximum value.

Bit function code: only M device can be

The local register for selected. BOOL


S7
storing the data received Word function code: only D device can be WORD

selected.

6-663
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Device Name Description Data type Remark

Supports 16#05, 06, 0F, 10.


Function code for writing
S8 If the value is out of the range, the WORD
data
instruction does not modify the operand.

Writing the remote


S9 16#0000–16#FFFF WORD
communication address

Bit function code, 16#0F: Supports 1–256

bits for the CPU firmware V1.06.00 or

earlier, and 1–1600 bits for the CPU


firmware V1.08.00 or later;

Word function code, 16#10: Supports 1–100

S10 Writing data length words. For function code 16#06, the value WORD
can only be 1.

If the value is 0 or less than 0, it indicates

not writing data.

If the value is greater than the maximum,

the instruction uses the maximum value.

The local register into


Bit function code: only M can be selected. BOOL
S11 which the remote data are
Word function code: only D can be selected. WORD
_6 written

2. It is suggested that you use the pulse instruction.

3. See the details about the Modbus function codes in S4 and S8 below.

The command for the ES3/EX3/SV3/SX3 reads the data from several bit devices (which are not discrete input

devices) is 1 (16#01).

The command for the ES3/EX3/SV3/SX3 reads the data from several bit devices (which are only discrete input

devices) is 2 (16#02).

The command for the ES3/EX3/SV3/SX3 to read the data from several word devices (which are not input registers)

is 3 (16#03).

The command for the ES3/EX3/SV3/SX3 to read the data from several word devices (which are only input registers)

is 4 (16#04).

The command for the ES3/EX3/SV3/SX3 to write the state into a bit device is 5 (16#05).

The command for the ES3/EX3/SV3/SX3 to write the state into a word device is 6 (16#06).

6-664
C ha pt er 6 A p pl i e d In s tr uc t io ns

The command for the ES3/EX3/SV3/SX3 to write the state into several bit devices is 15 (16#0F).

The command for the ES3/EX3/SV3/SX3 to write the data into several word devices is 16 (16#10).

The command for the ES3/EX3/SV3/SX3 to synchronously read from and to write the data into several word

devices is 23 (16#17).

Only the function codes listed above are supported. Other function code setting values, such as 0, are invalid

(including communication address, length and the start register), and the instruction executes the data exchange

function based on the original communication parameter settings.

4. When you select 16#17 (for reading and writing synchronously) in S4 (the function code for reading), the operand S8

(the function code for writing) is processed as invalid and 16#17 is automatically processed for writing data.

5. The parameter values specified by the instruction are valid only while PLC is running. If you cycle the power on the

PLC, the data in the data exchange table set in HWCONFIG are taken as default values. If you want to modify the

values for parameters, use this instruction.

6. You can use the instruction to immediately set the parameters for the communication connection when the data

exchange function is not running. The new communication parameters are not used until the next cycle if the data

exchange function is running; however, the instruction changes the communication parameters for the connection

number.

For example, while the data exchange function is running with the parameters set for connection 3, you can specify

new the parameters for connection 3. The new parameters are not used until the next cycle when connection 3 6_
starts.

7. The instruction only allows you to change the communication parameters. Refer to the following table for the flags

to start and close the communication connection function if you use the PLC program to perform those functions.

When you set the automatic scan function through the editing software, the start/stop flag of the connection number

automatically updates the start/stop state once after the data exchange function finishes executing the scan.

The following table describes the SM flags.

SM No. Attribute Explanation for COM1 data exchange parameters

SM750 R/W Enables data exchange

SM752–SM783 R/W Enables data exchange connections 1–32

SM784–SM815 R Reading success for data exchange connections 1–32

SM816–SM847 R Error flags for data exchange connections 1–32

6-665
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

SM No. Attribute Explanation for COM2 data exchange parameters

SM862 R/W Enables data exchange

SM864–SM895 R/W Enables data exchange connections 1–32

SM896–SM927 R Reading success for data exchange connections 1–32

SM928–SM959 R Error flags for data exchange connections 1–32

The PLC sets the flag to ON when the reading success flag indicates that receiving data is complete and the data

checked are correct. If an error occurs in receiving data or a communication timeout occurs, the error flag is set to

ON refer to the error codes). The PLC does not reset any of the reading success or error flags to OFF in the data

exchange since the reading success flag and error flag of every connection number are not ON simultaneously.

8. The following table describes the SR (only-read registers) in the data exchange function.

SR No. Description

SR1335 Cycle of the actual connections 1–32 in the COM1 data exchange

SR1336 Cyclic connection number in the current COM1 data exchange

SR1340–SR1371 Error codes of the connections 1–32 in the COM1 data exchange

SR1375 Cycle of the actual connections 1–32 in the COM2 data exchange

SR1376 Cyclic connection number in the current COM2 data exchange

_6 SR1380–SR1411 Error codes for connections 1–32 in the COM2 data exchange

9. The data exchange function does not provide a writing success flag. It is suggested that you refer to the connection

number in the execution to judge whether the writing of data succeeds or not.

For example, when the executed connection number is 3 in SR1336, the successive communication actions are to

read the communication data first, and then to write the communication data after reading is completed. The

connection number is incremented to 4 after writing is completed.

10. If the reading data length value in S6 and the initial device in S7 are out of the range of the D or M device, the length

value in S6 is automatically set to be in the valid range. For example, if the length value in S6 is100 and the initial

device of S7 is M8182, the value in S6 is set to 10 automatically.

11. In the following cases, the instruction is not executed and the parameter settings in HWCONFIG are not changed

for the communication port, and SM0 is set to ON, and the error code in SR0 is 16#200B.

 An input error occurs when the setting values in S1, S2, S4 and S8 are out of the specified range.

 When S4 or S8 function code selects the bit type for reading or writing data, the local device for storing data S7

or S11 must select the M device. An input error occurs if the selection is not M.

6-666
C ha pt er 6 A p pl i e d In s tr uc t io ns

 When the S4 or S8 function code selects the word type for reading or writing data, the local device for storing

data S7 or S11 must select the D device. An input error occurs if the selection is not D.

Example: ES3 COM1 (RS485)

1. For the data exchange between the ES3 Series CPU and the DVP-ES2 CPU, the following table shows the COM1
data exchange table in HWCONFIG in ISPSoft.

Remote
Detection Remote Function
Item No. station Local device Length How to start
method device code
address

Specified D50  D50 50 H03 Program


1 2
connection D100  D100 50 H10 control

Specified D150  D150 50 H03 Program


2 2
connection D200  D200 50 H10 control

2. Before starting data exchange, suppose that the corresponding data between the ES3 Series CPU and the
DVP-ES2 CPU are listed in the following table.

ES3 PLC (Master) Content value ES2 PLC (Slave) Content value

D50-D99 0 D50-D99 1-50

D100-D149 100-149 D100-D149 0


6_
D150-D199 0 D150-D199 150-199

D200-D249 200-249 D200-D249 0

3. The data exchange between the ES3 Series CPU and the DVP-ES2 CPU starts when X0 is ON.

6-667
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. After data exchange starts, the corresponding data between the ES3 Series CPU and the DVP-ES2 CPU change
_6 as shown in the following table.

ES3 PLC (Master) Content value ES2 PLC (Slave) Content value

D50-D99 1-50 D50-D99 1-50

D100-D149 100-149 D100-D149 100-149

D150-D199 150-199 D150-D199 150-199

D200-D249 200-249 D200-D249 200-249

5. When M0 is ON, the COM1 data exchange table parameters in the ES3 Series CPU are modified as shown in the
following table.

Item Remote station Remote Function How to


Detection method Local device Length
No. address device code start

Specified D5000  D500 1 H04 Program


1 3
connection D6000  D600 1 H06 control

2 Specified 3 M100  M0 10 H01 Program

6-668
C ha pt er 6 A p pl i e d In s tr uc t io ns

Item Remote station Remote Function How to


Detection method Local device Length
No. address device code start

connection M110  M50 10 control


H0F

6. Due to the change of COM1 data exchange table parameters, the corresponding data between the ES3 Series
CPU and the DVP-ES2 CPU are modified as shown in the following table.

ES3 PLC (Master) Content value ES2 PLC (Slave) Content value

D5000 3000 D500 3000

D6000 4000 D600 4000

M100-M109 ON M0-M9 ON

M110-M119 OFF M50-M59 OFF

6_

6-669
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Reading and writing Modbus data without using any
1817 MODRWE S1, S2, S3, S4, S, n, D
flags

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
S 
n    
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3  
S4  
S   
n  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
_6 Symbol

S1 : Communication port number

S2 : Unit address

S3 : Function code

S4 : Device address

S : Register for reading and writing the data

n : Data length

D : Flag for completion of the reading and writing data

Explanation

1. S1 sets the serial number of a communication port. The number of COM1 is 1 and COM2 is 2. If the value exceeds

the valid range, the instruction does not receive any communication data.

2. Refer to the explanation of the MODRW instruction (API 1808) for the meaning of the operands S2, S3, S4, S and n.

3. D sets the communication state flags when the instruction completes the communication, and the flags occupy 3

consecutive devices. You must reset the flags to OFF. The following table gives explanations of the flag states.

6-670
C ha pt er 6 A p pl i e d In s tr uc t io ns

Operand Description

D Receiving data successful.

D +1 Error occurs in receiving data.

D +2 Reception timeout flag

NOTE: Only one flag is set to ON among the three state flags, and the corresponding special flags (SM) are also

set to ON every time the communication is completed. Refer to Section 6.19.3 for the use of the special

flags.

4. The timing for sending the instruction begins when the instruction starts. You must disable the instruction for a scan

cycle after communication is completed. The next communication instruction can be sent as soon as the instruction

is restarted.

5. The communication action and control sequence of the instruction are similar to MODRW instruction (API 1808).

The only difference between the two instructions is that you can send the communication command without control

over the flag for sending data.

6. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

Example
6_
You can compare the MODRW program and MODRWE program, for example, by using the PLC COM1 and function code

03 to read eight pieces of data from D20 in the DVP-ES2. The same is true for other PLC communication ports. Refer to

the MODRW instruction (API 1808) and the following example for the use of other function codes.

1. The device address of D20 in the DVP-ES2 CPU (16#1020) and the content values in D20–D27 are shown in the

following table.

Device D20 D21 D22 D23 D24 D25 D26 D27

Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC

2. The ES3 Series PLC reads the content values from D20–D27 in the DVP-ES2 CPU through communication.

6-671
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Method 1: Using MODRW instruction

The data in D20-D27 of the DVP-ES2 are read when SM96 is ON and M0 is ON.

The following table explains the MODRW operands.

Operand Description Device


_6
S1 Unit address 16#0001

S2 Function code 16#0003

S3 Reading the device address of D20 16#1020

S First register for storing the data read D10

n Reading the data length 8

The communication response between the ES3 Series CPU and the DVP-ES2 depends on the mode.

ASCII mode: You do not need to convert the ASCII codes, and they are expressed in 16# values.

 ES3 sends the communication command: “01 03 10 20 00 08 C4 CR LF”

 ES3 receives the communication command: “01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC AA


CR LF”

6-672
C ha pt er 6 A p pl i e d In s tr uc t io ns

RTU mode

 ES3 sends the communication command: “ 01 03 10 20 00 08 41 06”

 ES3 receives the communication command: “01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC 90


FE”

SM100 is ON if there is no error in the data.

After the receiving of the data sent from the DVP-ES2, the PLC confirms the data format sent back from the
DVP-ES2. If there are no errors in the format, SM100 is ON; otherwise, SM102 is ON. SM104 is ON if there is no

response.

Method 2: Using MODRWE instruction

The data in D20-D27 of the DVP-ES2 are read when M0 is ON.

6_

The following table explains the MODRWE operands.

Operand Description Device

S1 Communication port number 16#0001

S2 Unit address 16#0001

S3 Function code 16#0003

S4 Reading the device address of D20 16#1020

S First register for storing the data read D10

n Reading the data length 8

D Flag for completion of reading and writing data M0

The communication response between the ES3 series CPU and the DVP-ES2 depends on the mode.

6-673
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

ASCII mode: You do not need to convert the ASCII codes, and they are expressed in 16# values.

 ES3 sends the communication command: “01 03 10 20 00 08 C4 CR LF”

 ES3 receives the communication command: “01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC AA


CR LF”

RTU mode

 ES3 sends the communication command: “01 03 10 20 00 08 41 06”

 ES3 receives the communication command: “01 03 10 12 34 56 78 11 22 33 44 55 66 77 88 99 AA BB CC 90


FE”

M0 is ON when there is no error in the data.

After the receiving of the data sent from the DVP-ES2, the PLC confirms the data format sent from DVP-ES2. If
there is no error in the format, M0 is ON; otherwise, M1 is ON. M2 is ON if there is no response. The corresponding

special flags SM100, SM102 and SM104 are ON as well.

3. The following table lists the content values in D10–D17 of ES3 CPU.

Device D10 D11 D12 D13 D14 D15 D16 D17

Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC

_6
Additional remarks

1. If you declare the operand in ISPSoft/DIADesigner, the data type is ARRAY [3] of BOOL.

2. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON and the error code in SR0is 16#2003.

6-674
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

S1,S2,S3,S4,S5,S6,S7,S8,S9,S10, Reading and writing DeviceNet


1818 DNETRW
D1,D2,D3,D4,D5 communication data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
S5    
S6    
S7    
S8 
S9    
S10    
D1   
D2   
D3 
D4 
D5 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2   6_
S3  
S4  
S5  
S6  
S7  
S8  
S9  
S10  
D1 
D2 
D3  
D4  
D5  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

6-675
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Symbol
Number of the module sending the DeviceNet
S1 :
communication
S2 : DeviceNet MAC ID

S3 : Service Code

S4 : Class ID

S5 : Instance ID

S6 : Attribute ID

S7 : Written-data length

S8 : Device for storing written data

S9 : Communication timeout time

S10 : Number of times of retransmission

D1 : Completion flag

D2 : Error flag

D3 : Error code

D4 : Read-data length

D5 : Device for storing read data

_6 Explanation

1. S1 is the serial number of the module at the right of the PLC. The first one is number 1, the second one is number 2
and so on. Whatever modules at the right of the PLC must be numbered. The setting range is 1~32. If the setting

value (<1 or >32) exceeds the range, the instruction will run at the minimum value or maximum value.

2. S2 is the DeviceNet Mac ID within the range: 0~63. It can be the Mac ID of the slave which the master is to read and

write as well as the Mac ID of the master which means to read and write the data in the master.

3. S3 is the DeviceNet service code.

Service code Description

0x01 Read all attributes (Get_Attribute_All)

0x02 Set all attributes (Set_Attribute_All)

0x0E Read one single attribute

(Get_Attribute_Single)

0x10 Set one single attribute (Set_Attribute_Single)

4. S4, S5 and S6 are respectively class ID, instance ID and attribute ID for specifying the parameter path in the EPATH of

the DeviceNet protocol.

6-676
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. S7 is the length of written data with the unit of byte.

6. S8 is the starting address of the devices where written data are stored in the order from low bit to high bit.

7. S9 is the communication timeout time. The range of the setting value is 1~100 and the unit is 0.1s (second).

8. S10 is the number of retransmission times and the range is 0~3. When the communication timeout occurs, the

communication will be transmitted again.

9. D3 displays the read or write error code.

Error code
Description
Code 1 (High Byte) Code 2 (Low Byte)

XX FF Not conform with DeviceNet standard

20 01 The target slave does not exist.

20 02 Making the connection with the slave failed.

20 03 Sending the explicit message failed.

16 00 Communication timeout

10. D4 is the read data length with the unit of byte.

11. D5 is the starting address of the devices where read data are stored in the order from low bit to high bit.

12. D1 is the communication completion flag and D2 is the error flag. See the detailed communication sending procedure 6_
and sequence diagram.

 The DNETRW instruction is enabled for the first time and the command will be sent out immediately if the

instruction is not be occupied by other DeviceNet communication.

 The command is being sent.

 The data sending is completed and the completion flag or error flag changes to On according to the response.

 The next message is ready to be sent out. The next command is sent out right after the completion flag or error flag

is cleared.

 The command sending is completed and the DNETRW instruction is disabled.

6-677
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

13. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called only

once.

_6

6-678
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description


User-defined CAN communication sending and
1819 CANRS S1,S2,S3,S4,D1,D2,D3
receiving

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2  
S3    
S4  
D1 
D2    
D3    
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
S4  
D1  
D2 
D3 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol 6_
S1 : Communication mode setting

S2 : Communication ID (MsgID)

S3 : Sent-data length

S4 : Starting device where sent source data are stored

D1 : Starting device where received data are stored

D2 : Communication completion flag

D3 : Communication error flag

Explanation

1. It is not suggested that you use the instruction in the ST programming language, interrupt tasks or function block

which is called only once.

2. The CANRS instruction for sending the user-defined CAN Bus packet is applicable to the PLC with a CAN port.

(Note that the hardware configuration (HWCONFIG) must have selected the mode of CANopen DS301 before the

6-679
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

instruction is executed.) And it is also applicable to the DVPCOPM-SL module connected on the left side of

SV3/SX3 series PLC.

3. S1 sets the communication mode. See the following modes that the instruction supports. If the setting value is

incorrect, the error flag D3 changes to On and the error code SR659 is set to 1.

S1: Communication mode setting

COM port Communication format Communication mode

(b15 ~ b9) (b8) (b7 ~ b0)

Setting range: Setting range: Setting range:

0–8 0–1 0–3

0: Master mode. The master will wait to receive the

response message after sending out the communication

0: the CPU’s built-in data.

communication port 1: Master mode. After sending the broadcast command,

1: the first module on the the master will enter the mode of receiving messages

left side from multiple slaves until the receiving timeout occurs or

the quantity of messages received is up to 100.


2: the second module on
0: 2.0A (ID 11 bits)
the left side 2: Slave mode. The slave receives a message first and
1: 2.0B (ID 29 bits)
. then sends back the response message.

_6 .
3: Slave mode. The slave only receives messages. (For
.
the CPU’s built-in communication port, the slave only
8: the eighth module on
receives one message. For the communication port of the
the left side
DVPCOPM-SL module on the left side, it receives

multiple messages until the receiving timeout occurs or

the quantity of messages received is up to 100.)

4. S2 is the ID of the transmitted message. According to 2.0A or 2.0B protocol, the transmitted data automatically

occupies D buffer registers.

When 2.0A is selected, S2 is 11 bits of ID code with the following data transmission format.

S2 No. S2

Description Msg. ID

When 2.0B is selected, S2 (Lo-word) and S2+1 (Hi-word) are both 29 bits of ID code.

S2 No. S2 S2+1

Description Msg. ID(Lo-word) Msg. ID(Hi-word)

6-680
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. S3 is the length of the transmitted message. The setting value should be in the range of 0~8 with the unit of byte

(8bits). If the setting value (<0 or >8) exceeds the range, the instruction will run at the minimum value 0 or the

maximum 8. If the length of the transmitted message is 0, the communication mode will automatically change into

the slave mode to receive messages without sending out any data. The mode can be used to monitor the

communication packet.

6. S4 is the starting device where transmitted data are stored and only the following 8 bits of data are used.

For example, 4 messages are transmitted with D10 as the starting device. See the data transmission sequence as

below.

S4 No. D10 D11 D12 D13

Description Data1 Data2 Data3 Data4

7. If S1 is the master mode in which the master will wait to receive data after sending data or the slave mode, the

received data will be directly stored in the device specified by D1. D100 is specified by D1 Here See the stored

content format.

2.0A mode setting:

D1 No. D100 D101 D102 ~ D109 (Lower 8 bits)

Description Msg. ID Data Length Data1 ~ Data8

2.0B mode setting

D1 No. D100 D101 D102 D103 ~ D110 (Lower 8 bits)


6_
Description Msg. ID(Lo-word) Msg. ID(Hi-word) Data Length Data1 ~ Data8

Note: If the Msg. ID to be received need be specified at the stage of receiving data, set the value of D1/ D1+1

beforehand based on the 2.0A/2.0B mode. If the Msg. ID is not specified, please clear the value of D1/ D1+1 to 0

before receiving data.

8. If S1 is the master broadcast mode, the received data will be stored in the device specified by D1. D100 is specified

by D1 here. See the storage format as below.

Selecting 2.0A mode: (Here is the introduction of receiving data from 2 slaves. For other data, please increase the

Device number specified by D1)

Response Data from the second


Data from the first slave Data from the third slave
sequence slave

D103 ~ D110
D1 No. D100 D101 D102 D111 D112~D120 D121~130
(Lower 8 bits)

Receiving
Data
Description Packet Msg. ID Data1 ~ Data8 Msg. ID Length, Data ID, Length, Data
Length
number

6-681
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Selecting 2.0B mode: (Here is the introduction of receiving data from 2 slaves. For other data, increase the number of

D1)

Response Data from the second


Data from the first slave
sequence slave

D104 ~ D111
D1 No. D100 D101 D102 D103 D112~D122
(Lower 8 bits)

Receiving
Msg. ID Msg. ID Data
Description Packet Data1 ~ Data8 ID, Length, Data
(Lo-word) (Hi-word) Length
number

9. D2 and D3 are the receiving-completed flag and error flag respectively. The two flags will judge if the data receiving

is completed or an error occurs based on the current communication state when the instruction is scanned. If the

data receiving is completed or an error occurs, the flags will change to On. The two flags will be cleared and change

to Off automatically every time the instruction is enabled.

10. When the instruction is set to the master mode, using the receiving timeout setting in HWCONFIG is recommended.

So D3 will change to On and the error code 2 will be recorded in SR659 if the communication packet has not been

received fully within the specified period of time.

If the receiving timeout time is set to 0, it indicates that the communication timeout is not limited and the status can

be applied to the slave mode.

_6 Note: The communication control right can not be released until the instruction is disabled by manual when the

method in which there is no limit to the communication timeout is adopted.

COM port type How to set the receiving timeout Remark

Set it in HWCONFIG.
CPU’s built-in
Setting range: 0~3000 (default: 200)
communication port
Unit: milliseconds (ms)

In the master broadcast mode, the receiving


Set the value in the special register
timeout setting cannot be 0; if the setting value
DVPCOPM-SL SR1609.
is 0, it will be automatically revised to 200.
module Setting range: 0 - 3000 (default: 200)
In addition, the broadcast communication ends
Unit: milliseconds (ms).
when the communication timeout occurs.

11. There is no limit to the number of times of using the instruction. But only one CAN communication command is

allowed to be sent every time. If one command is being sent or received currently, the next CANRS instruction can

not be enabled.

12. Here is the CAN BUS format and every bit of content for Msg. ID is explained as below.

6-682
C ha pt er 6 A p pl i e d In s tr uc t io ns

As 2.0A protocol is selected and the value of S2 is 16#0123, the Msg. ID content is shown in the following table.

Bit No. 15 ~ 11 10 ~ 8 7~4 3~0

S2 value (16bits) - 1 2 3

As 2.0B protocol is selected, the value of S2 is set to 16#1234 (Lo-word) and S2+1 is 16#0567 (Hi-word), the Msg.

ID content is shown in the following table.

Bit No. 31 ~ 29 28 27 ~ 24 23 ~ 20 19 ~ 16 15 ~ 0

S2 value (32bits) - 0 5 6 7 1234

13. If the operand D1 is declared in a variable, using the Word-type matrix is recommended.

14. See CANRS communication sequence diagram and explanation.

:The CANRS instruction is enabled. If no other CANRS instruction occupies the control right, the flags D2 and D3

are cleared and then the data are sent out right away.

:The data sending is completed and meanwhile the data receiving starts. After the receiving is completed, the

completion flag D2 changes to On.

:The instruction sends data again after you clear the flag D2.

:As the receiving timeout occurs, D3 changes to On.

:If an error is found, you can disable the instruction. Alternatively, you can have the instruction resend data after
6_
clearing the flag D3.

enable

CANRS disable disable




S4
 
D1
 

D2

D3

Example 1

Master Mode

Using the CANRS instruction, the 6-byte data in D10~D15 are transmitted to the slave and the response data from the

slave are stored in the devices starting from D100. M100 changes to On when the sending and receiving are over.

6-683
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

See the explanation of relevant parameters.

Master mode_MsgID=2

0= master mode, waits to receive the response from the slave after sending out
Communication mode
data.

The MsgID of the sent message


Communication ID
D0=1

Sent-data length 6 BYTE

Starting device where sent


D10
data are stored

D100 for storing MsgID,


Starting device where received
D101 for storing the number of received packets
data are stored
D102…. for storing received data

Communication completion
M100
flag

Communication error flag M101

1. As M1 is on, set the MsgID of the sent message to 1 and MsgID of the received message to 2. Then the data sending
_6 begins.

A. Sending the data in D10~D15 (6 bytes) to the slave is performed.

Device D10~D15

Content H0A (Defined by users)

B. The received response data from the slave are stored in D100~D109. M100 changes to On as the receiving is

done.

Device D100 D101 D102~D109

Content 2 8 H0B

2. Master programming example

6-684
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 2

Slave Mode

Using the CANRS instruction, the received data from the master are stored in the devices starting from D120 and the

8-byte data in D20~D27 are sent back. M110 changes to On when the sending and receiving are over.

See the explanation of relevant parameters.

Slave mode_MsgID=1
6_
Communication mode 2= Slave mode, sends data after receiving data.

MsgID of the sent message,


Communication ID
D0=2

Sent-data length 8 BYTE

Starting device where


D20
sent data are stored

D120 for storing MsgID


Starting device where
D121 for storing the number of received packets
received data are stored
D122…. for storing received data

Communication
M110
completion flag

Communication error flag M111

6-685
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

1. As M1 is on, set the MsgID of the sent message to 2 and MsgID of the received message to 1 and then wait to

receive data.

A. The received 6-byte data from the master are placed in D120~D127.

Device D120 D121 D122~D127

Content 1 6 H0A

B. Then the 8-byte data in D20~D27 start to be sent back to the master. M110 changes to On as the data sending is

done.

Device D10~D15

Content H0B (Defined by users)

2. Slave programming example

_6

6-686
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

1820 DMVSH Mode ~ ErrCode Enabling Delta DMV detection and communication

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Mode   
Start1    
Start2    
Ready 
ComNo   
Id_Ip   
Address   
Length   
Shoot1 
Shoot2 
RdData 
Ok    
Err    
ErrCode 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

Mode 
Start1 
Start2 
Ready  6_
ComNo  
Id_Ip  
Address  
Length  
Shoot1 
Shoot2 
RdData  
Ok 
Err 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

6-687
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Symbol

Mode : The triggering and receiving method

Start1 : Trigger signal for starting set1

Start2 : Trigger signal for starting set2

Completion signal of when receiving response data from DMV is


Ready :
complete

A serial port or network communication port for the PLC to send or


ComNo :
receive data

Id_Ip : Serial communication station address or network IP of DMV

Address : Starting device where DMV data to be read are stored

Length : Length of the data to be read

Output signal when PLC notifies DMV to enable the detection of


Shoot1 :
set1

Output signal when PLC notifies DMV to enable the detection of


Shoot2 :
set2

Starting device where the data that the PLC receives from the DMV
RdData :
are stored

Ok : Communication success flag


_6
Err : Communication error flag

ErrCode : Communication error code

Explanation

1. Mode sets the method through which the PLC triggers DMV including DMV1000 and DMV2000 and the receiving

method. There are 2 modes: 0 and 1 for option. If the setting exceeds the range, PLC will automatically run in mode

0.

2. Please refer to following example explanation for the function of Start1, Start2, Ready, Shoot1, Shoot2, RdData

and Ok and the process of detection triggering.

3. ComNo sets a communication port number of the PLC. The number 1 represents COM1, number 2 represents

COM2, and number 4 represents Ethernet port. If the setting is not one of the numbers mentioned above or

represents the communication port that the PLC does not support, the error flag Err will change to On and the error

code 16#0001 will show up.

4. Id_Ip sets the communication station address (Mac ID) of the slave DMV or network IP. Address is the

communication address where DMV detection result is read. Length is the length of the read detection data.

6-688
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. See the explanation of the values of ErrCode in the table below.

Error code Description Correction

16#0001 The specified communication port is incorrect. Specify a new communication port number.

16#0002 DMV response fault Check the communication address

16#0003 No response from DMV Check if the cable is connected properly or

DMV has been enabled.

16#0004 Waiting for the response from DMV; DMV Modify the timing of enabling DMV detection.

detection cannot be enabled repeatedly.

Example 1

Mode=0

Only set1 is used to trigger the DMV detection and receiving of DMV response data.
See the sequence control diagram below.

En

Start1

Shoot1

Ready
6_
Com.
send receive
port

Ok

       

Explanation of the timings:

 The DMVSH instruction is enabled.

 Set Start1 to On to notify the instruction to send the output signal Shoot1 (ON for about 10ms) and notify DMV to
enable the detection function.

 After DMV receives the trigger message, Ready is set from On to Off.

 Shoot1 is cleared to Off automatically by the PLC.

 After DMV detection is finished, Ready is set from Off to On. The PLC starts to judge if Ready is on after waiting for 1.5
times the input filtering time. The PLC receives the message that Ready changes from Off to On and sends a read
command via Modbus 0x03.

6-689
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 The Ok flag is set to On after the PLC receives the communication data sent back from DMV. At the moment, the
already received data can be processed.

 The Start1 and Ok flags can be cleared to Off by manual.

 If the detection need be retriggered to execute, directly set Start1 to On to start the next-round DMV detection. (Return
to step 2 to continue.)

Example 2

Mode = 1

Set1 and set2 are used to trigger the DMV detection separately. But the communication data reading command can not

be sent until both Readys change to On. (The example is applicable to the two-camera DMV1000 detection.)

See the sequence control diagram below.

En

Start1

Shoot1

_6
Ready

Start2

Shoot2

Com.
port send receive

Ok

      

 The DMVSH instruction is enabled.

 Set Start1 to On to notify the instruction to send the output signal Shoot1 (which is on for about 10ms) and notify DMV
to enable the detection function of the first camera.

 After DMV receives the trigger message, Ready is set from On to Off.

6-690
C ha pt er 6 A p pl i e d In s tr uc t io ns

 Shoot1 is cleared to Off automatically by the PLC.

 Set Start2 to On to notify the instruction to send the output signal Shoot2 (which is on for about 10ms) and notify DMV
to enable the detection function of the second camera.

 Shoot2 is cleared to Off automatically by the PLC.

 After DMV detection is finished, Ready is set from Off to On and the two detections are complete. Then the PLC sends
a read command via Modbus 0x03.

 The Ok flag is set to On after the PLC receives the communication data sent back from DMV. At the moment, the
already received data can be processed.

 The Start1, Start2 and Ok flags can be cleared to Off by manual. If the detection need be retriggered to execute,
return to step 2 to proceed.

6_

6-691
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


Execute the appointed communication number of
1821 DESO ComNo ~ ErrCode
the data exchange table once

Device X Y M S T C HC D FR SM SR E K 16# “$” F


ComNo   
ListNo   
OK    
Error    
ErrCode 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

ComNo  
ListNo  
OK 
Error 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

ComNo : Communication port for data exchange

ListNo : Communication number of the data exchange table


_6
OK : Completion flag

Error : Error flag

ErrCode : Error code

Explanation

1. This instruction is available for ES3 CPU firmware V1.06.00 or later, which works with ISPSoft V3.16 or later

/DIADesigner V1.30 or later, as well as available for EX3/SV3/SX3 CPU firmware V1.00.00 or later, which works

with DIADesigner V1.30 or later.

2. Make sure the data exchange table of the PLC CPU is already created before executing this instruction. If not, the

Error flag switches to ON and ErrCode is recorded as 1.

3. ComNo is the communication port for data exchange.

Communication Port COM1 COM2 Ethernet

Number in decimal format 1 2 3

4. ListNo is the communication number of the data exchange table.

6-692
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. When the instruction is enabled, only the appointed communication number of the data exchange table will be

executed. When the communication is done and the slave device responds with OK, the OK flag will be ON. The

corresponding SM of the communication number will be ON and the Error Code is recorded as 0.

6. Before executing this instruction, the system checks if the communication number to be executed is in cyclic

communication mode. If yes, this instruction will not be executed. The Error flag is ON. Error Code is recorded as 2.

7. Refer to the following table for more details when any of the Error flag is ON.

Error Code Description

0 No error or the transmission is complete.

1 The data exchange table or the communication number does NOT exist.

The connection of the data exchange table is started; do NOT start another connection
2
again.

3 No response from the slaves.

4 Slave responds with a communication error.

5 The same communication port is in use.

The communication port does NOT exist or the communication card (AS-F232/422/485) is
6
NOT installed. .

7 The communication number of the data exchange table exceeds the setting rang (1~32).

8. The communication timeout is set in the data exchange table.

9. This instruction is suggested for applications where the slave device is better not to receive or be sent with

communication requests regularly. Since only one communication will be opened during the instruction execution,

you need to disable the instruciton to start another communication if the same communicaitron port is being used. 6_
10. There is no limit on the number of times you execute the instruction but only one communication can be established

for each communication port. If you execute the insturcion again when the same comunicaiton port is being used,

the Error flag will be ON and the Error Code is recorded as 5.

Example:

When M0 is ON, the instruction starts to execute the number four communication of the data exchange table in COM1.

The data exchange table of COM1

6-693
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.19.3 Descriptions of the Communication-related Flags and Registers


Communication-related flags (SM)

Flag
Description Action
COM1 COM2

Data sending request flag

If you want to use the instruction to send and receive data,

you must use the pulse instruction to set the flag to ON. You set the flag to ON, and the system
SM96 SM97
When the instruction is executed, the PLC sends and automatically resets it to OFF.

receives the data. After sending the data, the system

automatically resets the flag to OFF.

The system automatically sets the flag


SM98 SM99 When the flag is ON, the PLC is waiting to receive the data.
to ON and resets it to OFF.

Reception complete flag

After receiving the data, the system automatically sets the


The system automatically sets the flag
SM100 SM101 flag to ON. When the flag is ON, the data received can be
to ON, and you reset it to OFF.
processed. After processing the data received, you must to

reset flags to OFF.

Data receiving error flag


The system automatically sets the flag
SM102 SM103 An error occurs during receiving data using the data
_6 to ON, and you reset it to OFF.
receiving instruction.

Communication timeout error flag

If you set the communication timeout (in SR) and no data is The system automatically sets the flag
SM104 SM105
received after the timeout period, the flag is ON. After the to ON, and you reset it to OFF.

problem is solved, you must reset the flag to OFF.

The choice between the 8-bit processing mode and the 16-bit

processing mode You set the flag to ON and reset it to


SM106 SM107
ON: 8-bit processing mode OFF.

OFF: 16-bit processing mode

Communication mode

ON: RTU mode


You set the flag to ON and reset it to
SM210 SM212 OFF: ASCII mode
OFF.
You can set this value in HWCONFIG. Not available for

Card1 and Card 2.

6-694
C ha pt er 6 A p pl i e d In s tr uc t io ns

Flag
Description Action
COM1 COM2

Communication protocol changed flag

The communication protocol changes in accordance with the

setting values in SR. If the flag is set to ON, the

communication protocol changes in accordance with the

setting values in SR and then the system automatically


You set the flag to ON and reset it to
SM209 SM211 resets the flag to OFF.
OFF.
NOTE: this change does not affect the parameters that you

set in HWCONFIG. When the PLC is powered-on

again, the PLC operates according to the

communication protocol set in HWCONFIG.

NOTE: the above flags are non-latching types.

Communication-related registers (SR)

Special data

register Description

COM1 COM2

SR201 SR202 Communication port address


6_

Communication protocol

SR209 SR212 For details, please refer to the following table to set up the communication format for a serial

communication port.

Communication timeout, unit: ms

Suppose the setting value is larger than 0. When the PLC executes the communication instruction

and is in the receiving state, but no data is received after the timeout period or the intervening time
SR210 SR213
between two characters exceeds the setting value, the timeout flag is ON. You can set the register

to 0 to disable communication timeout monitoring. See the MODRW instruction set between

100–32767 (ms).

6-695
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Setting the communication format for a serial communication port

b0 Data length 7 (value=0) 8 (value=1)

00 : None

b2-b1 Parity bits 01 : Odd

10 : Even

b3 stop bits 1 bit (value=0) 2 bits (value=1)

0001 (16#1) : 4800

0010 (16#2) : 9600

0011 (16#3) : 19200

0100 (16#4) : 38400

0101 (16#5) : 57600


b7-b4
0110 (16#6) : 115200

0111 (16#7) : 230400 Not available for RS-232

1000 (16#8) : 500000 Not available for RS-232

1001 (16#9) : 921000 Not available for RS-232

1111 (16#F) : Self-defined*1

b8-b15 Undefined (reserved)


_6 *1: You can set the baud rate in HWCONFIG in ISPSoft /DIADesigner.

The data transmission speed is listed in the following table.

Baud rate (bps) RTU timeout timer (ms) Baud rate (bps) RTU timeout timer (ms)

4800 9 115200 1

9600 5 230400 1

19200 3 - -

38400 2 - -

57600 1 - -

6-696
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.20 Other Instructions


6.20.1 List of Other Instructions
The following table lists the Other Instructions covered in this section.
Instruction code Pulse
API Function
instruction
16-bit 32-bit
1900 WDT –  Watchdog timer

1901 DELAY –  Delaying the execution of the program

1902 GPWM – – General pulse width modulation

1904 EPUSH –  Storing the contents of the index registers

1905 EPOP –  Reading data into the index registers

1906 INFO –  Reading the system data

6_

6-697
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.20.2 Explanation of Other Instructions

API Instruction code Operand Function

1900 WDT P - Watchdog timer

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

Explanation

1. This instruction resets the watchdog timer to monitor the operation of the ES3/EX3/SV3/SX3 Series PLC system.

2. If the program scanning time in the PLC exceeds 200 milliseconds, the error LED indicator is ON, and the PLC

stops running.

3. The watchdog timer acts in the following cases.

 The system is behaving abnormally.

 Program execution takes too much time, and therefore the scan time is longer than the watchdog timer setting

value. There are two way you can improve the situation.

_6 (a) Use the WDT instruction to reset the watchdog timer.

STEP0 END
WDT

t1 t2

(b) Refer to the ISPSoft/DIADesigner User Manual for more information about changing the watchdog timer

setting value.

6-698
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

Suppose the program scanning time is 300 milliseconds. After the program is divided into two parts, and you insert the

instruction WDT between these two parts, the time it takes to scan either the first part of the program or the second part of

the program must be less than 200 milliseconds.

6_

6-699
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1901 DELAY P S Delaying the execution of the program

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S DWORD        

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Delay

Explanation

This instruction delays the execution of the program following the DELAY instruction for a period of time specified in S.

The unit of S is 0.1 milliseconds.

Example
_6
When M0 is ON, the instruction delays the execution of the program following the DELAY instruction for two milliseconds.

That is, Y0 is ON and the states of Y0–Y7 and Y10–Y17 are refreshed two milliseconds after the DELAY instruction is

executed.

6-700
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

In p ut M0

Ou tp ut Y 0

T=2ms

Additional remarks

1. If S I less than 0, there is no delay.

2. If S is larger than 1000, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. You can adjust the delay according to the actual conditions of your equipment.

4. The delay can be larger than S due to communication or other influences.

6_

6-701
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1902 GPWM S1, S2, D General pulse width modulation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2   
D    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Pulse width

S2 : Pulse cycle

D : Output device

Explanation

_6 1. This instruction outputs every pulse with a width specified by S1 and with a cycle specified by S2 from the device

specified by D.

2. The pulse width specified by S1 is t. t must be between 0–3276 milliseconds.

3. The pulse cycle specified by S2 is T. T must be between 1–32767 milliseconds, and S1 should be less than S2.

4. The S2+1 and S2+2 parameters are for system use. Please do not change them.

5. If S1 is less than 0, there is no pulse output. If S1 is larger than S2, the output device stays ON.

6. You can change S1 and S2 during the execution of this instruction.

7. If the conditional contact is not enabled, there is no pulse output.

8. When using on-line editing, please reset the conditional contact to initialize the instruction.

6-702
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When the program is executed, the values in D0 and D2 are 1000 and 2000 respectively. When M0 is ON, the device Y0

outputs the pulses illustrated below. When M0 is OFF, Y0 is OFF.

t=1000ms

M0

T=2000ms 6_

Additional remarks

1. The instruction counts by the scan cycle. Therefore, the maximum error is one scan cycle. Besides, S1, S2, and

(S2-S1) should be larger than the scan cycle; otherwise, an error occurs when the GPWM instruction is executed.

2. If you use the instruction in a function block or an interrupt task, an inaccurate pulse output occurs.

3. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [3] of WORD/INT.

6-703
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1904 EPUSH P D Storing the contents of the index registers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D DWORD 

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : Device to store the value in the index registers

Explanation

1. This instruction stores the values in E0–E9 in the devices specified by D. The valid range for D is between 0–99.

The instruction is not executed for values that exceed the range.

2. The instruction uses sixteen devices, and the last six devices are for system use. If you execute the instruction and

the number of times the data is stored is n (the value in D), the instruction stores data in E0–E9 in
_6
D+(16*n+1)–D+(16*n+16), and increments the value in D to n+1.

3. The storage for the device D is 1601 (16x100+1).

4. This instruction uses a pulse instruction to interact with the stack, pushing a value onto the stack. Therefore, you

must reset the contact before the next operation.

5. When you use this instruction with the EPOP instruction (API 1905), the value stored last in the device specified by

D is read first, following the LIFO (last in first out) principle.

The num ber of ti mes


D t he dat a is stored .

D+1 E0
D+2 E1
......

......

D + 10 E9

For system u se
D +16

D +17 E0
D + 18 E1
D + 19 E2
......

......

6-704
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

Suppose the value in D0 is 0.

When M0 is ON for the first time, the instruction transmits the data in E0–E9 to D1–D10 and increments the value in D0 to

1.

When M0 switches from OFF to ON for the second time, the instruction transmits the data in E0–E9 to D17–D26, and

increments the value in D0 to 2.

When M0 switches from OFF to ON for the nth time, the instruction transmits the data in E0–E9 to (n*16)+1–(n*16)+10.

Additional remarks

1. If the value in D is not between 0–99, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If the range of devices is not sufficient for D+((the value in D)+1)*16-1), the instruction is not executed, SM0 is ON, 6_
and the error code in SR0 is 16#2003.

6-705
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

1905 EPOP P D Reading the data into the index registers

Device X Y M S T C HC D FR SM SR E K 16# “$” F


D DWORD 

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

D : Device from which the value is read

Explanation

1. This instruction reads the values in the devices specified by D into E0–E9, and decrements the value in D by one.

The valid value for D is between 1–100. The instruction does not execute values that exceed the range.

2. The instruction involves sixteen devices, and the last six devices are for system use. If you execute the instruction

and the number of times the data is stored is n (the value in D), the instruction stores the data in E0–E9 in
_6 D+16*(n-1)+1–D+16*(n-1)+10, and decrements the value in D to n-1.

3. This instruction uses a pulse instruction to interact with the stack, taking the TOP VALUE from the stack and
assigning it to the specified variable; therefore, you must reset the contact before the next operation.

4. The value that the instruction stores last in the device specified by D is read first, following the LIFO (last in first out)

principle.

The num ber of t im es


D t he data i s st ored .

D+1 E0
D+2 E1
......

......

D + 10 E9

D +16 F or syst em u se

D +17 E0
D + 18 E1

D + 19 E2
......

......

6-706
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example

When M0 is ON, the MOV instruction sets the value in D0 is set to 0, and the EPUSH instruction transmits the values in

E0–E9 to D1–D10. After the execution of FB0 is complete, the EPOP instruction reads the values in D1–D9 into E0–E9.

6_

Additional remarks

1. If the value in D is not in the range 0–100, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

2. If the range of device is not sufficient for D+((the value in D) *16-1), the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#2003.

6-707
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

1906 INFO P S,D Reading the system data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S 
D 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S: System-data reading code

D: Starting device where the read system data are stored

Explanation
_6
1. S is the system information reading code and the codes are listed in the following table.

Number of consecutive

S code No. Description D devices Remark

(Number of Words)

Reads the serial number of the


0 9 ASCII code
product

1 Reads Ethernet Mac ID 3 Hex value

2 Reads already-power-on time 2 32-bit value, unit: minutes

The instruction is not


others Reserved 0
executed.

6-708
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

2. If the product serial no. is 32ES311TW19450012, the reading code of the instruction is 0 and the read data are

stored in the devices starting from D0, the product serial no. is stored in the order as below.

D0 D1 D2 D3 D4 D5 D6 D7 D8

16#3233 16#5345 16#3133 16#5431 16#3157 16#3439 16#3035 16#3130 16#0032


‘32’ ‘ES‘ ‘31’ ‘1T’ ‘W1’ ‘94’ ‘50’ ‘01’ ‘2’

3. If Mac ID is 16#123456789ABC, the reading code of the instruction is 1 and the read data are stored in the devices

starting from D10, the Mac ID data are stored in the order as below.

D10 D11 D12

16#1234 16#5678 16#9ABC

4. If the already-power-on time is 70000 minutes (16#00011170), the reading code of the instruction is 2 and the read

data are stored in the devices starting from D20, the already-power-on time data are stored in the order as below.

D20 D21

16#1170 16#0001

5. Only the first-time execution of the INFO instruction is effective when the conditional contact is met. Therefore, it is

recommended to use the pulse instruction INFOP. If the INFO instruction is used with the normally-open contact

together, the instruction will be automatically executed only once.

Additional remark:
6_

If D is declared in a variable and the code is 0, 1 and 2, they can be declared respectively in ARRAY [9], [3], [2] of WORD.

6-709
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.21 String Processing Instructions


6.21.1 List of String Processing Instructions
The following table lists the String Processing instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

2100 BINDA DBINDA  Converting a signed decimal number into an ASCII code

Converting a binary hexadecimal number into an


2101 BINHA DBINHA 
hexadecimal ASCII code

Converting a binary-coded decimal number into an ASCII


2102 BCDDA DBCDDA 
code

Converting a signed decimal ASCII code into a signed


2103 DABIN DDABIN 
decimal binary number

Converting a hexadecimal ASCII code into a hexadecimal


2104 HABIN DHABIN 
binary number

Converting an ASCII code into a binary-coded decimal


2105 DABCD DDABCD 
number

2106 $LEN –  Calculating the length of a string

2109 $FSTR –  Converting a floating-point number into a string


_6
2110 $FVAL –  Converting a string into a floating-point number

2111 $RIGHT –  Retrieving characters from a string starting from the right

2112 $LEFT –  Retrieving characters from a string starting from the left

2113 $MIDR –  Retrieving a part of a string

2115 $SER –  Searching a string

2116 $RPLC –  Replacing the characters in a string

2117 $DEL –  Deleting the characters in a string

2118 $CLR –  Clearing a string

2119 $INS –  Inserting a string

2122 SPLIT –  Splitting a string

2123 MERGE –  Merging strings

6-710
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.21.2 Explanation of String Processing Instructions

API Instruction code Operand Function

Converting a signed decimal number


2100 D BINDA P S, D
into an ASCII code

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the conversion result is stored

6_
Explanation

1. This instruction converts the signed decimal binary number in S into an ASCII code, and stores the conversion

result in D.

2. The instruction supports SM690 to control the ending character.

3. For 16-bit instructions, the value in S must be a binary number and between -32768 to 32767. The operand D

occupies four word devices. The instruction converts the data is converted as follows.

b15 b0 b15 b7

b8 b0

1234  16#32 16#31 D+0

16#34 16#33 D+1

16#00 16#00 D+2

If SM690 is OFF, the instruction stores the ending character 16#0000 in D+2. If SM690 is ON, the value in D+2 is

unchanged without the ending character.

6 - 7 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

If the value in S is a positive value, the instruction stores only the value but not the sign character in D. If the value in

S is a negative value, the instruction stores the “-” sign character in D (16#2D). For example, if the value in S is

-12345 and SM690 is OFF, the conversion result is as follows.

b15 b0 b15 b7

b8 b0

-1234  16#31 16#2D(-) D+0

16#33 16#32 D+1

16#00 16#34 D+2

4. For 32-bit instructions, the value in S must be a binary number between -2147483648 to 2147483647. The operand

D occupies six word devices. The data is converted as follows.

b31 b0 b15 b7

b8 b0

12345678  16#32 16#31 D+0

16#34 16#33 D+1

16#36 16#35 D+2

16#38 16#37 D+3

16#00 16#00 D+4

If SM690 is OFF, the instruction stores the ending character 16#0000 in D+4. If SM690 is ON, the value in D+4 is
unchanged without the ending character.
_6
In addition, if the value in S is a positive value, the instruction stores only the value but not the sign character in D. If

the value in S is a negative value, the instruction stores the “-“ sign character in D (16#2D). For example, if the value

in S is -12345678, and SM690 is OFF, the conversion result is as follows.

b31 b0 b15 b7

b8 b0

-12345678  16#31 16#2D D+0

16#33 16#32 D+1

16#35 16#34 D+2

16#37 16#36 D+3

16#00 16#38 D+4

6-712
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

Suppose the value in L0 is 5126 and SM690 is OFF. When the instruction executes, the values are D0=16#3135,

D1=16#3632, D2=16#0000.

D10 b15 b7

b8 b0

5126  16#31 16#35 D0

16#36 16#32 D1

16#00 16#00 D2

Example 2

Suppose the value in D10 is -3842563 and SM690 is OFF. When the instruction is executed, the values are D0=16#332D,

D1=16#3438, D2=16#3532, D3=16#3336, D4=16#0000. 6_

D10 b15 b7

b8 b0

-3842563  16#33 16#2D D0

16#34 16#38 D1

16#35 16#32 D2

16#33 16#36 D3

16#00 16#00 D4

6-713
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If value in the device D is not sufficient for the conversion, SM0 is ON, and the error code in SR0 is 16#2003.

2. For 16-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [4] of
WORD/INT.

3. For 32-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [6] of
WORD/INT.

_6

6-714
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting a binary hexadecimal number
2101 D BINHA P S, D
into a hexadecimal ASCII code

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S    
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the conversion result is stored

6_
Explanation

1. This instruction converts the hexadecimal binary number in S an ASCII code, and stores the conversion result in D.

2. The instruction supports SM690 to control the ending character.

3. For 16-bit instructions, the value in S must be between 16#0000–16#FFFF, and should be a four-digit binary number.

The operand D occupies three word devices.

If SM690 is OFF, 16#0000 is stored in D+2. If SM690 is ON, the value in D+2 is unchanged. For example, if the

value in S is 16#02A6 and SM690 is OFF, the conversion result is as follows.

b15 b0 b15 b7
b8 b0
02A6  16#32 16#30 D+0
16#36 16#41 D+1
16#00 16#00 D+2
4. For 32-bit instructions, the value in S must be between 16#00000000–16#FFFFFFFF, and should be an eight-digit

binary number. The operand D occupies five word devices.

If SM690 is OFF, 16#0000 is stored in D+4. If SM690 is ON, the value in D+4 is unchanged. For example, if the

value in S is 16#03AC625E and SM690 is OFF, the conversion result is as follows.

6-715
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b31 b0 b15 b7
b8 b0
03AC 6251  16#33 16#30 D+0
16#43 16#41 D+1
16#32 16#36 D+2
16#31 16#35 D+3
16#00 16#00 D+4

Example 1

Suppose the value in D10 is 16#9C06 and SM690 is OFF. When the instruction executes, the values are D0=16#4339,

D1=16#3630, D2=16#0000.

D10 b15 b7

b8 b0

16#9C06  16#43 16#39 D0


_6 16#36 16#30 D1

16#00 16#00 D2

Example 2

Suppose the value in D10 is 16#7B3C581F and SM690 is OFF. When the instruction executes, the values are

D0=16#4237, D1=16#4333, D2=16#3835, D3=16#4631, D4=16#0000.

6-716
C ha pt er 6 A p pl i e d In s tr uc t io ns

D10 b15 b7

b8 b0

16#7B3C 581F  16#42 16#37 D0

16#43 16#33 D1

16#38 16#35 D2

16#46 16#31 D3

16#00 16#00 D4

Additional remarks

1. For 16-bit instructions, if D+2 exceeds the device range, SM0 is ON, and the error code in SR0 is 16#2003.

2. For 32-bit instructions, if D+4 exceeds the device range, SM0 is ON, and the error code in SR0 is 16#2003.

3. For 16-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of
WORD/INT.

4. For 32-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [5] of
WORD/INT.

6_

6-717
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Converting a binary-coded decimal number
2102 D BCDDA P S, D
into an ASCII code

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S         
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S    
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the conversion result is stored

Explanation

_6 1. This instruction converts a binary-coded decimal number in S into an ASCII code, and stores the conversion result

in D.

2. The instruction supports SM690 to control the ending character.

3. The binary-coded decimal value in S used in the 16-bit instruction must be between 0–9999, and should be a

four-digit binary-coded decimal value. The operand D occupies three word devices. The data is converted as

follows.

b15-12 b11-8 b7-4 b3-0 b15 b7


b8 b0
0 8 7 6  16#38 16#30 D+0
Thousands 16#36 16#37 D+1
Hundreds Tens Units
16#00 16#00 D+2
If SM690 is OFF, the instruction stores the ending character 16#0000 in D+2. If SM690 is ON, the value in D+2 is

unchanged without the ending character.

4. For 32-bit instructions, the binary-coded decimal value in S must be between 0–99999999, and should be an

eight-digit binary-coded decimal value. The operand D occupies five word devices. The data is converted as follows.

6-718
C ha pt er 6 A p pl i e d In s tr uc t io ns

b31 b0 b15 b7
b8 b0
0876 5432  16#38 16#30 D+0
16#36 16#37 D+1
16#34 16#35 D+2
16#32 16#33 D+3
16#00 16#00 D+4
5. If SM690 is OFF, the instruction stores the ending character 16#0000 in D+5. If SM690 is ON, the value in D+5 is

unchanged without the ending character.

6. Even if the first digit of binary-coded decimal value in S is 0, the instruction converts it into an ASCII code 0 (16#30).

Example 1

Suppose the binary-coded decimal value in D10 is 1295 and SM690 is OFF. When the instruction executes, the values

are D0=16#3231, D1=16#3539, D2=16#0000.

D10 b15 b7
b8 b0
1295  16#32 16#31 D0 6_
16#35 16#39 D1
16#00 16#00 D2

Example 2

Suppose the binary-coded decimal value in D10 is 00578352 and SM690 is OFF. When the instruction executes, the

values are D0=16#3030, D1=16#3735, D2=16#3338, D3=16#3235, D4=16#0000.

D10 b15 b7
b8 b0
0057 8352  16#30 16#30 D0
16#37 16#35 D1
16#33 16#38 D2
16#32 16#35 D3
16#00 16#00 D4

6-719
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. For 16-bit instructions, if the value in S is not between 0–9999, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal number, but one

of digits is not within the range between 0 and 9.

2. For 32-bit instructions, if the value in S is not between 0–99999999, the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal number, but

one of digits is not within the range between 0 and 9.

3. For 16-bit instructions, if D+2 exceeds the device range, SM0 is ON, and the error code in SR0 is 16#2003.

4. For 32-bit instructions, if D+4 exceeds the device range, SM0 is ON, and the error code in SR0 is 16#2003.

5. For 16-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [3] of

WORD/INT.

6. For 32-bit instructions, if you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [5] of

WORD/INT.

_6

6-720
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting a signed decimal ASCII code
2103 D DABIN P S, D
into a signed decimal binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the conversion result is stored

Explanation

1. This instruction converts the signed decimal ASCII code in S into a signed decimal binary number, and stores the 6_
conversion result in D.

2. For 16-bit instructions, the operand S occupies three word devices, and the decimal ASCII code in S must be
between -32768 to 32767. If the value in S is a string and does not include the ending character 16#00, the

conversion can be up to 5 digits (excluding the sign).

b15 b7 b15
b8 b0 b0
S+0 “2“ “1“  1234 D
S+1 “4“ “3“
S+2 16#00 16#00

3. If the first character is “ ” (a space), the sign is a positive sign. If the first character is “-”, the sign is a negative sign.
Take the string “2345” for example.

b15 b7 b15
b8 b0 b0
S+0 “2“ “-“  -2345 D
S+1 “4“ “3“
S+2 16#00 “5“

6-721
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. For 32-bit instructions, the operand S occupies six word devices, and the decimal ASCII code in S must be between
-2147483648 to 2147483647. If the value in S is a string and does not include the ending character 16#00, the

conversion can be up to 10 digits (sign excluded).

b15 b7 b31
b8 b0 b0
S+0 “2“ “1“  1234567890 D
S+1 “4“ “3“
S+2 “6“ “5“
S+3 “8“ “7“
S+4 “0“ “9“
S+5 16#00 16#00
5. If the first character is “ ” (a space), the sign is a positive sign. If the first character is “-”, the sign is a negative sign.
Take the string “-234567890” for example.

b15 b7 b31

b8 b0 b0

S+0 ‘2‘ ‘-’  -234567890 D

S+1 ‘4‘ ‘3‘

S+2 ‘6’ ‘5‘

S+3 ‘8‘ ‘7‘

S+4 ‘0’ ‘9‘

S+5 16#00 16#00

6.
_6 If the first digit of the string in the device S is blank (16#20) + sign (16#2B), the value in S is processed as 0. For the
second digit, if the number is not 0–9, the instruction treats it as the end of a string and no error message will be

shown. For example if the word order is 16#2016#3116#3216#2B, the conversion result is 12.

7. For 16-bit instructions, the string range in the device S is 1–6 (positive or negative signs included) and for 32-bit
instruction the range is 1–11 (positive negative signs included).

8. Only the 32-bit instructions can use the 32-bit counter, but not the device E.

Example 1

Suppose the values are D20=16#302D, D21=16#3433, D22=16#0035. When the instruction executes, the value is

D0=-345.

6-722
C ha pt er 6 A p pl i e d In s tr uc t io ns

b15 b7 b15
b8 b0 b0
D20 16#30 16#2D  -345 D0
D21 16#34 16#33
D22 16#00 16#35

Example 2

Suppose the values are D20=16#322D, D21=16#3433, D22=16#3635, D23=16#2037, D24=16#0000, D25=16#0000.

When the instruction executes, the value is D0=-234567.

b15 b7 b31

b8 b0 b0

D20 16#32 16#2D  -234567 D0

D21 16#34 16#33

D22 16#36 16#35

D23 16#20 16#37 6_


D24 16#00 16#00

D25 16#00 16#00

Example 3

Suppose the string value in S is 12. When the instruction executes, the value is D0=12.

6-723
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the value of the first word in S is an ending character (16#00), the value is processed as 0 (16#30).

2. If the value of the first digit in S is 16#20 (blank) or 16#2B (+) or 16#2D (-) and the second digit is 16#00, the value in

S is processed as 0 (16#30).

3. Even if the first digit of binary-coded decimal value in S is 0, it is converted into the ASCII code 0 (16#30).

4. The value of the first digit in S only supports ASCII codes, 16#30–16#39 (0–9), 16#200 (blank), 16#2D (negative

sign), 16#2B (positive sign), 16#00 (ending character). If the value of the first digit in S is not ASCII code, the

instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

5. Except the first digit, if the value of other digits in S are not ASCII codes, 16#30–16#39 or 16#00, the value in S is

processed as 16#00.

6. If the value in S exceeds the device range, SM0 is ON, and the error code in SR0 is 16#2003. The instruction is not

executed.

7. For 16-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [3] of

WORD/INT.

8. For 32-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [6] of

WORD/INT.

_6

6-724
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting a hexadecimal ASCII code into a
2104 D HABIN P S, D
hexadecimal binary number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

D : Device where the conversion result is stored

Explanation
6_

1. This instruction converts a hexadecimal ASCII code in S into a hexadecimal binary number, and stores the
conversion result in D.

2. For 16-bit instructions, the operand S occupies two word devices. If the value in S is a string and does not include

the ending character 16#00, the conversion can be up to 4 digits (sign excluded). The hexadecimal ASCII code in S

must be between 0000–FFFF. If S is a string, the string must be between “0”–“FFFF”.

b15 b7 b15

b8 b0 b0

S+0 “A“ “5“  16#5A8D D

S+1 “D“ “8“

3. For 32-bit instructions, the operand S occupies four word devices. If the value in S is a string and does not include

the ending character 16#00, the conversion can be up to 8 digits (sign excluded). The hexadecimal ASCII code in S

must be between 00000000–FFFFFFFF. If S is a string, the string must be between “0”–“FFFFFFFF”.

6-725
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b7 b31

b8 b0 b0

S+0 “C” “5“  16#5CB8 07E1 D

S+1 “8“ “B“

S+2 “7“ “0“

S+3 “1“ “E“

4. The valid string range in the device S for 16-bit instruction is 1–4 and for 32-bit instruction it is 1–8.

Example 1

Suppose the values are D20=16#3641, D21=16#4633 (ASCII 16#A63F). When the instruction executes, the value is

D0=-22977.

b15 b7 b15

b8 b0 b0
_6
D20 16#36 16#41  16#A63F D0

D21 16#46 16#33

Example 2

Suppose the values are D20=16#4634, D21=16#3244, D22=16#3738, D23=16#3035 (ASCII 16#4FD28750). When the

instruction executes, the value is (D1, D0)=16#4FD28750.

6-726
C ha pt er 6 A p pl i e d In s tr uc t io ns

b15 b7 b31

b8 b0 b0

D20 16#46 16#34  16#4FD2 8750 D0

D21 16#32 16#44

D22 16#37 16#38

D23 16#30 16#35

Example 3

Suppose the string value in S is A. When the instruction executes, the value is D20=16#A=10.

Example 4

Suppose the values are D20=16#3641, D21=16#4600 (ASCII 16#00A6). When the instruction executes, the value is 6_
D0=166.

b15 b7 b15

b8 b0 b0

D20 16#36 16#41  16#00A6 D0

D21 16#46 16#00

6-727
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the ASCII code in S is not between 16#30–16#39 (“0”–”9”), or between 16#41–16#46 (“A”–”F”), the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2003.

2. For 16-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [2] of

WORD/INT.

3. For 32-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [4] of

WORD/INT.

_6

6-728
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting an ASCII code into a
2105 D DABCD P S, D
binary-coded decimal number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D    

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S : Source value

Device where the conversion


D:
result is stored

Explanation

1. This instruction converts the ASCII code in S into a binary-coded decimal number, and stores the conversion result 6_
in D.

2. For 16-bit instructions, the operand S occupies two word devices, and the ASCII code in S must be between

0000–9999. If S is a string, the string must be between “0”–“9999”.

b15 b7 b15-b12 b11-b8 b7-b4 b3-b0

b8 b0

S+0 “8“ “9“  9 8 7 6 D

S+1 “6“ “7“ Thousands Hundreds Tens Units

3. For 32-bit instructions, the operand S occupies four word devices, and the ASCII code in S must be between

0000000–99999999. If S is a string, the string must be between “0”–“99999999”.

6-729
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b7 b15-b12 b11-b8 b7-b4

b8 b0 b3-b0

S+0 “8“ “9“  5 4 3 2 D

S+1 “6“ “7“ 9 8 7 6 D+1

S+2 “4“ “5“

S+3 “2“ “3“

4. If the value in S is 16#20 the value is processed as 16#30. If the value in S is 16#00, the value is processed as an

ending character.

5. For 16-bit instructions, if S is a string, the number of characters contained in the string must be between 1–4. For

32-bit instructions, if S is a string, the number of characters contained in the string must be between 1–8.

Example 1

Suppose the values are D20=16#3820, D21=16#3637 (ASCII 876). When the instruction executes, the instruction

converts the value into Y0=16#876.

_6

b15 b7 b15-b12 b11-b8 b7-b4

b8 b0 b3-b0

D20 16#38 16#20  0 8 7 6 Y0

D21 16#36 16#37

6-730
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 2

Suppose the values are D20=16#3738, D21=16#3536, D22=16#3334, D23=16#3132 (ASCII 87654321). When the

instruction executes, the value is (D11, D10)= 16#87654321.

b15 b7 b31

b8 b0 b0

D20 16#37 16#38  8765 4321 D0

D21 16#35 16#36

D22 16#33 16#34

D23 16#31 16#32

Example 3
6_
Suppose the string value in S is 1. When the instruction executes, the value is D20=16#0001.

Example 4

Suppose the string value in S is 1234. When the instruction executes, the value is (D21, D20)= 16#00001234.

6-731
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. If the ASCII code in S is not ASCII codes 16#30–16#39, 16#20, or 16#00, the instruction is not executed, SM0 is ON,

and the error code in SR0 is 16#2003.

2. If S is a string and the number of characters contained in the string exceeds the range, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. For 16-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [2] of

WORD/INT.

4. For 32-bit instructions, if you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [4] of

WORD/INT.

_6

6-732
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2106 $LEN P S, D Calculating the length of a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : String

D : Length of the string

Explanation

1. This instruction calculates the length of the string in S, exclusive of the ending character (16#00), and stores the

length of the string in D.

2. The value stored in D must be between 0–32767. If it exceeds this range, the value in D is processed as 32767. 6_
b15 b8 b7 b0
S Second character Fir st character
S+1 Fourth character Third char acter b15 b0
S+2 Sixth character Fifth char acter n D

16#00 Length of the string


n char acter
th
S+n (Ending charact er)

If the data in S-S+4 is ABCDEFGHI, the calculation result is as follows.

b15 b8 b7 b0
S 16#42( B) 16#41(A)
S+1 16# 44(D) 16#43(C) AB CDEF GHI b15 b0
S+2 16# 46(F ) 16#45(E) 9 D
S+3 16#48(H) 16# 47( G)
S+4 16#00 16#49(I)
( E nd in g ch ar acte r)

6-733
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

1. Declare two symbols Test String and Len.

2. When M0 switches from OFF to ON, the instruction $LEN counts and stores the string length into the value in Len.

Example 2

Suppose the data in D0–D2 is as follows. When the instruction executes, the value in L0 is 5.

D0 16#45 (E) 16#44 (D)


_6
D1 16#54 (T) 16#4C (L)

D2 16#00 (Ending character) 16#41 (A)

Additional remarks

1. If the string does not end with 16#00, the instruction executes to the maximum length of 32767.

2. If the length of the value exceeds the device range, the last character is processed as the ending character.

6-734
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting a floating-point number into a
2109 $FSTR P S1, S2, D
string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2    
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : Source value

S2 : First device where the format is stored


First device where the conversion result is
D :
stored

Explanation 6_
1. This instruction converts the floating-point number in S1 into a string in accordance with the format setting value in
S2, and stores the conversion result in D.

2. This instruction converts the floating-point number in S1 into a string and appends the ending character 16#00 to the
end of the string, and then stores the conversion result in D.

High byte Low byte

D Second ASCII code First ASCII code

(S1+1,S1) D+1 Fourth ASCII code Third ASCII code

 D+2 Sixth ASCII code Fifth ASCII code

Floating-point number …… ……

D +n-1 mth ASCII code m-1th ASCII code

D +n 16#00 ending character

Floating-point string

3. The conversion result varies with the setting of S2.

6-735
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. The value in S2+1 must be between 2≦S2+1≦20; the sign (+,-) and the digits in an integer or decimal number are

included but the decimal point in a decimal number and the exponent number are not included.

Operand Description

0: Decimal format
S2
1: Exponential

S2+1 Number of character

5. If the value in S1 is a positive number, the first ASCII code can be stored in D; if the value in S1 is a negative number,
the sign 16#2D (-) is stored first and then the second ASCII is stored.

6. Decimal format (S2=0)

After con ve rsio n,


the fl oa ting -p oin t string
in th e device D.
Sign Integ er . De ci ma l

 The value in S2+1 must be between 2≦S2+1≦20; the sign (+,-) and the digits in an integer or decimal

number are included but the decimal point in a decimal number and the exponent number are not included.

 Example 1

Suppose the number of characters is eight. Two floating-point numbers examples are -1.2345678 and 123456.

The calculation is as follows.

_6 D Floating-point number Floating-point number

number -1.2345678 123456

High byte Low byte High byte Low byte

D 16#31 (1) 16#2D (-) 16#32 (2) 16#31 (1)

D+1 16#32 (2) 16#2E (.) 16#34 (4) 16#33 (3)

D+2 16#34 (4) 16#33 (3) 16#36 (6) 16#35 (5)

16#00
D+3 16#36 (6) 16#35 (5)
ending character

16#00
D+4 16#38 (8)
ending character
After the conversion, if the floating-point number is stored in S2+1 but if the length exceeds the value in S2+1,

the instruction rounds off the digits in the decimal number. The floating-point string does not have to fill all of

S2+1.

6-736
C ha pt er 6 A p pl i e d In s tr uc t io ns

 Example 2

After the conversion, if the floating-point number is stored in S2+1, the instruction uses the exponential format

to convert. For example, the number of characters is five digits and the floating-point number is 1234567, the

conversion result is1.2346E+06.

Floating-point number
D number
1234567

D 16#2E (.) 16#31 (1)

D+1 16#33 (3) 16#32 (2)

D+2 16#36 (6) 16#34 (4)

D+3 16#2B (+) 16#45 (E)

D+4 16#32 (6) 16#30 (0)

16#0000
D+5
ending character

 Example 3

After the conversion, if the floating-point number is stored in S2+1, the instruction uses the exponential format

to convert. For example, the number of characters is two digits and the floating-point number is 0.00012345,

the conversion result is1.2E-04.


6_

Floating-point number
D number
0.00012345

D 16#2E (.) 16#31 (1)

D+1 16#45 (E) 16#32 (2)

D+2 16#30 (0) 16#2D (-)

16#00
D+3 16#34 (4)
ending character

 Example 4

After the conversion, if the absolute value of the floating-point number is <=10-5, the instruction uses the

exponential format to convert. For example, the number of characters is four digits and the floating-point

number is 0.00001234, the conversion result is1.234E-05.

6-737
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Floating-point number
D number
0.00001234

D 16#2E (.) 16#31 (1)

D+1 16#33 (3) 16#32 (2)

D+2 16#45 (E) 16#34 (4)

D+3 16#30 (0) 16#2D (-)

16#00
D+4 16#35 (5)
ending character

7. Exponential format (S2=1)

After con ve rsio n,


the fl oa ting -p oin t string
Si gn In tege r . De ci ma l Exponential

in th e device D.

 The value in S2+1 must be between 2≦S2+1≦20; the sign (+,-) and the digits in an integer and decimal

number are included but the decimal point in the decimal number and the exponent number are not included.

After calculation, the length adds the exponents (four digits) and the decimal point of the decimal number.

 The number of character in the area for the integer is one digit.

_6  The number of character in the area for the exponent is four characters.

If the exponent is a positive number, the instruction adds 16#2B (+) in the area for exponent in D. If the

exponent is a negative number, the instruction adds 16#2D (-) in the area for exponent in D. The number of

character in the area for the exponent is two digits. If there is only one digit in the conversion result, the

instruction adds 16#30 (0) as the first digit of the area for the exponent.

 Example

Suppose the number of characters is eight. Two floating-point numbers examples are -123.456789 and

123456. The calculation is as follows.

Floating-point number Floating-point number


D number
-123.456789 12345

High byte Low byte High byte Low byte

D 16#31 (1) 16#2D (-) 16#2E (.) 16#31 (1)

D+1 16#32 (2) 16#2E (.) 16#33 (3) 16#32 (2)

D+2 16#34 (4) 16#33 (3) 16#35 (5) 16#34 (4)

6-738
C ha pt er 6 A p pl i e d In s tr uc t io ns

D+3 16#36 (6) 16#35 (5) 16#2B (+) 16#45 (E)

D+4 16#45 (E) 16#38 (8) 16#34 (4) 16#30 (0)

16#00
D+5 16#30 (0) 16#2B (+)
ending character

16#00
D+6 16#32 (2)
ending character
After the conversion, if the floating-point number is stored in S2+1, and the instruction rounds off the extra

digits.

The conversion result of the string length for the floating number -123.456789 in eight characters is 13 (the

ending character excluded).

The conversion result of the string length for the floating number 12345 in eight characters is 10 (the ending

character excluded).

The floating-point string does not have to fill all the characters.

Example 1

The floating-point number in (D1, D0= 12.3456) is converted into the decimal format in a string (D4=0, D5=8).

6_

D10 16#32(2) 16#31(1)

D11 16#33(3) 16#2E(.)

D12 16#35(5) 16#34(4)

16#00
D13 16#36(6)
ending character

6-739
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

The floating-point number in (D1, D0 = 0.0012345678) is converted into the exponential format in a string (D4=1, D5=8).

D10 16#2E (.) 16#31 (1)

D11 16#33 (3) 16#30 (2)

D12 16#35 (5) 16#34 (4)

D13 16#37 (7) 16#36 (6)

D14 16#45 (E) 16#38 (8)

D15 16#30 (0) 16#2D (-)

16#00
D16 16#33 (3)
ending character

Additional remarks

_6 1. If the value in S1 exceeds the range of values that can be represented by floating-point numbers, the instruction is

not executed, SM0 is ON, and the error code in SR0 is 16#2013.

2. If the value in S2 is neither 0 nor 1, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

3. If the value in S2+1 is not in between 2≦S2+1≦20, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

4. If you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6-740
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Converting a string into a floating-point
2110 $FVAL P S, D
number

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Source value

D : Device where the conversion result is stored

Explanation

1. This instruction converts a string in S into a floating-point number, and stores the conversion result in D.

High byte Low byte

S Second ASCII code First ASCII code


6_
S+1 Fourth ASCII code Third ASCII code (D+1,D)

S+2 Sixth ASCII code Fifth ASCII code 

…… …… Floating-point number

S +n-1 mth ASCII code m-1th ASCII code

16#00
S +n
ending character

Floating-point string

 Refer to the following sections for the ASCII code usage.

 For decimal or exponential formats, the maximum length for the floating-point string (m) is 24 characters

(excluding the ending character 16#00) and the maximum length of n is 13 characters.

2. The format of the value in S can be decimal or exponential. The instruction automatically determines the format

according to the value in S.

 Decimal format: the length for the floating-point string is nine; the ending character 16#00 is not included.

6-741
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

High byte Low byte

S 16#31 (1) 16#32 (2)

S+1 16#32 (2) 16#2E (.) D

S+2 16#34 (4) 16#33 (3)  21.234567

S+3 16#36 (6) 16#35 (5)

16#00
S+4 16#37 (7)
ending character

OR

High byte Low byte

S 16#31 (1) 16#2D (-)

S+1 16#32 (2) 16#2E (.) D

S+2 16#34 (4) 16#33 (3)  -1.234568

S+3 16#36 (6) 16#35 (5)

16#00
S+4 16#38 (8)
ending character
 Exponential format: the length for the floating-point string is 9; the ending character 16#00 is not included.

High byte Low byte

_6 S 16#31 (1) 16#2D (-)

S+1 16#32 (2) 16#2E (.) D

S+2 16#45 (E) 16#33 (3)  -1230

S+3 16#30 (0) 16#2B (+)

16#00
S+4 16#32 (3)
ending character
3. If the sign code in S is 16#20, 16#30, or 16#2B, then the conversion result is a positive value. If the sign code in S1

is 16#2D, then the conversion result is a negative value.

Example 1

6-742
C ha pt er 6 A p pl i e d In s tr uc t io ns

D0 16#31 (1) 16#32 (2)

D1 16#32 (2) 16#2E (.) (D11,D10)

D2 16#34 (4) 16#33 (3)  21.234567

D3 16#36 (6) 16#35 (5)

16#00
D4 16#37 (7)
ending character

Example 2

D0 16#31 (1) 16#2D (-)

D1 16#32 (2) 16#2E (.) (D101,D100)

D2 16#45 (E) 16#33 (3)  -1230


6_
D3 16#30 (0) 16#2B (+)

16#00
D4 16#32 (3)
ending character

Additional remarks

1. If the length of the string in S exceeds 25 bytes and does not end with 16#00, SM0 is ON, and the error code in SR0

is 16#2003.

2. There are some rules for the value in S. if the value in S does not follow the rules, the instruction is not executed,

SM0 is ON and the error code in SR0 is 16#2003.

The first ASCII code: signs16#2B(+), 16#2D(-), blank16#20, and numbers 16#30(0)–16#39(9) are allowed.

If the first ASCII code is a sign or a blank, the second ASCII code must be a number.

The second ASCII code can be in either decimal or exponential format.

6-743
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Decimal format:

Integ er OR In tege r . D ecimal


The decimal point “,” (16#2E), can only occur once and there must be numbers before and after the decimal point.

 Exponential format:

Inte ger Exp one nt OR In tege r . De ci ma l Exp one nt


The decimal point “,” (16#2E), can only occur once and there must be numbers before and after the decimal point.

There must be a number before the exponent.

Integers: only numbers “0” (16#30)–“9” (16#39) are allowed.

Decimals: only numbers “0” (16#30)–“9” (16#39) are allowed.

Exponents: The format for a four digit ASCII code is as below.

Fi rst Second
E OR e +OR- n umber
nu mb er

There must be an “E” (16#45) or ”e” (16#65) and it can only occur once.
_6
There must be a sign “+”(16#2B) or “-” (16#2D) and it can only occur once.

There must be two digits; numbers “0” (16#30)–“9”(16#39).

3. If the string in S is out of range, the instruction is not executed, SM is ON, and the error code in SR0 is 16#2003.

 If the first character in the string is a number ”0”–”9” (16#30–16#39), the valid range for a floating-point string

is 1–24. The minimum length for the string is one.

 If the first character in the string is a blank (16#20) or a sign (“+”(16#2B) or “-” (16#2D)), the valid range for a

floating-point string is 2–24. The minimum length for the string is two (“+1”).

4. If the conversion result exceeds the range of values that can be represented by floating-point numbers, the

instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013.

6-744
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Retrieving characters from a string
2111 $RIGHT P S, n, D
beginning from the right.

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
n        
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : String

n : Number of characters to be retrieved

D : Device where the characters retrieved are stored

Explanation

1. This instruction retrieves n characters from the string in S from the right, and stores the retrieved characters in D. 6_
When the data type of S (source value) is string, the maximum length for the value in S is 31 characters. When the

data type of S (source value) is not string, the maximum length for the value in S is 255 characters.

2. If n is 0, the value in D is 0. The maximum length for n is 255 characters. .

b15 b8 b7 b0
S Second ASCI I code First ASCI I code
S +1 Fourth ASCI I code Third ASCII code
. .. . .. . .. .. . .. . .. .. . .

n-1 ASCII code from the last n ASCII code from the last
th th

n-3 ASCII code from the last


th
n-2 ASCII code from the last
th
~

Second ASCI I code f rom the last Third AS CII code from the last
16#00 First ASCI I code from the last

D n-1 ASCI I code from the last n ASCII code from the last
th th

D +1 n-3 ASCII code from the last


th
n-2 ASCII code from the last
th
.....................

Second A SCII code from the last Third ASCII code from the last
16#00 First ASCI I code from the last

6-745
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

If the data in S is ABCDEF12345 and n is 5, the instruction retrieves five characters in the string in S from the right.

The conversion result is as follows.

b15 b8 b7 b0 b15 b8 b7 b0
S 16# 42(B) 16# 41(A) 16# 32(2) 16#31(1) D
S +1 16# 44(D) 16# 43(C) 16# 34(4) 16# 33(3) D +1
ABCDEF12345 S +2 16# 46(F) 16# 45(E) 16# 00 16# 35(5) D +2
S +3 16# 32(2) 16# 31(1)
S +4 16# 34(4) 16# 33(3) The fifth character from the last
S +5 16# 00 16# 35(5)

Example

b15 b8 b7 b0 b15 b8 b7 b0
D0 16#42(B) 16#41( A) 16# 46(F) 16# 45(E) D10
D1 16# 44(D) 16#43(C) 16# 48(H) 16# 47(G) D11
D2 16# 46( F) 16# 45( E) 16# 00 D12
D3 16# 48(H) 16# 47(G) The four th character from the last
D4 16# 00

_6
Additional remarks

1. If the operand S is not a string ($) but a device with a string, the string in S can be up to 256 characters (16#00

ending character included). If the string in S does not end with 16#00, SM0 is ON, and the error code in SR0 is

16#200E.

2. If n is less than 0, it is processed as 0. If n is greater than the length of the string in S, it is processed as the length of

the string is S.

3. If D is not sufficient to contain n characters, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

6-746
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Retrieving characters from a string
2112 $LEFT P S, n, D
beginning from the left.

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S     
n        
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S   
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : String

n : Number of characters to retrieve

D : Device where the characters retrieved are stored

Explanation

1. This instruction retrieves n characters from the string in S starting from the left, and stores the retrieved characters 6_
in D. When S is a string device, the maximum length for the value in S is 31 characters; when the S is not a string

device, the maximum length for the value in S is 255 characters.

2. If n is 0, the value in D is 0.

b15 b8 b7 b0 b15 b8 b7 b0
S Second ASCII c ode First ASCII code Sec ond ASCII c ode First ASCII code D
S +1 Fourth ASCII code Third ASCII c ode Fourth ASCII code Third ASC II code D +1
. .. ... ... .. ... ... ... .

... ... .. ...


~

n-1 ASCII code from the last


th
n-1th ASCII code from the l ast n-2 ASCII code from the l ast
th th
n-2 ASCII code from the last
n+1 thASCII code from the last n thASC II code from the last 16#00 n ASCII c ode from the las t
th
~

16#00 Las t ASCII code

If the data in S is ABCDEF12345 and n is 7, the instruction retrieves seven characters in the string in S from the left.

The conversion result is as follows.

6-747
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b8 b7 b0 b15 b8 b7 b0
S 16# 42(B) 16# 41(A) 16# 42(B) 16# 41(A) D
S +1 16# 44(D) 16# 43(C) 16# 44(D) 16# 43(C) D +1
ABCDEF12345 S +2 16# 46(F) 16# 45(E) 16# 46(F) 16# 45(E) D +2
S +3 16# 32(2) 16# 31(1) 16# 00 16# 31(1) D +3
S +4 16# 34(4) 16# 33(3) Seventh character
S +5 16# 00 16# 35(5)

Example

When M0 is ON, the instruction retrieves the six characters starting from the character in D100, and stores them in D10.

b15 b8 b7 b0 b15 b8 b7 b0
D0 6 D100 16# 42(B) 16#41(A) 16# 42(B) 16# 41(A) D10
D101 16# 44(D) 16# 43(C) 16# 44(D) 16# 43(C) D11
D102 16# 46(F) 16# 45(E) 16# 46(F) 16# 45(E) D12
Sixth character D103 16# 48(H) 16#47(G) 16# 00 D13
D104 16# 00

Additional remarks
_6
1. If the operand S is not a string ($) but a device with a string, the string in S can be up to 256 characters(16#00

ending character included). If the string in S does not end with 16#00, SM0 is ON, and the error code in SR0 is

16#200E.

2. If n is less than 0, it is processed as 0. If n is greater than the length of the string in S, it is processed as the length of

the string is S.

3. If D is not sufficient to contain n characters, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

6-748
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2113 $MIDR P S1, S2, D Retrieving a part of a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
D DWORD   

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1   
S2  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String

S2 : Part of the string to be retrieved

D : Device where the characters retrieved are stored

Explanation

1. Suppose the values in S2 and S2+1 are n and m respectively. This instruction retrieves m characters starting from 6_
the nth character in the string in S1, and stores them in D.

b1 5 b8 b7 b0 b1 5 b8 b7 b0

S1 S eco nd AS C II cod e F irst A SC I I co de th


n+ 1 AS C II co de f rom t he la st nthA SC I I co de f rom t he la st D
th
S1+ 1 F ourt h AS C II co de T h ird A S CI I co de n+ 3 AS C II co de f rom t he la st n +2 thA SC I I co de f ro m th e las t D +1
. .... .... .... ..... ...

.. .. .. .. .. .
~

th
n+ 1 AS C II cod e from t he l ast th
n A S CI I co de f rom t he la st n+ m-2 thA SC I I cod e fro m th e last th
n +m -3 AS C I I co de f rom t h e la st
th
n+ 3 AS C II cod e from t he l ast
th
n +2 A SC I I cod e fro m th e last 16 #0 0 n+ m-1 thA SC I I cod e fro m th e last
~

th th
n+ m AS C II cod e from t he la st n +m -1 AS C II c ode f rom t he la st
~

16 #0 0 L ast A SC I I co de

2. If the data in S1 is ABCDEFGHIJK, the value in S2 is 3, and the value in S2+1 is 7, the instruction retrieves the seven

characters starting from the third characters in the string from the left. The conversion result is as follows.

6-749
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b8 b7 b0 b15 b8 b7 b0
S1 16# 42(B) 16# 41( A) 16# 44(D) 16# 43(C) D
S1 +1 16# 44(D) 16# 43(C) 16# 46(F ) 16# 45( E) D+1
S2
S1 +2 16# 46(F) 16# 45(E) 16# 48(H) 16# 47(G) D+2
Th ird c har acter
S1+3 16# 48(H) 16# 47(G) 16# 00 16# 49(I) D+3

S1 +4 16# 4A(J) 16# 49(I)


16# 4B(K) Seven th char acter
S1+5 16# 00

3. If the value of S2 is S2<=0, S2+1<-1or S2+1=0, the instruction is not executed.

4. If the value in S2+1 is -1, the instruction retrieves the characters in S1 starting from the character indicated by the

value in S2 to the last character in S1.

5. If the data in S1 is ABCDEFGHIJK, the value in S2 is 5, and the value in S2+1 is -1, the conversion result is as

follows.

b15 b8 b7 b0 b15 b8 b7 b0
S1 16# 42(B) 16# 41(A) 16# 46(F) 16#45(E) D
S1 +1 16# 44(D) 16# 43(C) 16# 48(H) 16# 47(G) D +1
S1+2 16# 46(F) 16# 45( E) 16# 4A(J) 16# 49( I) D +2
S1+3 16# 48(H) 16# 47(G) Fift h charact er 16# 00 16# 4B(K)
S1+4 16# 4A(J) 16# 49(I)
S1+5 16# 00 16# 4B(K)

Example
_6

b15 b8 b7 b0 b15 b8 b7 b0
D10 16#32(2) 16#31( 1) 16# 34(4) 16#33( 3) D0
D11 16# 34(4) 16# 33(3) 16# 36(6) 16# 35(5) D1
D12 16#36( 6) 16# 35(5) 16# 00 D2
D13 16# 00 16# 37(7)

D20 3
D21 4

6-750
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. If the operand S1 is not a string ($) but a device with a string, the string in S1 can be up to 256 characters (16#00

ending character included). If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is

16#200E.

2. If the value of S2 is S2<=0 or S2+1<-1, SM0 is ON, and the error code in SR0 is 16#2003.

3. If the value in S2 or S2 + S2+1 is larger than the length of the string in S1, SM0 is ON, and the error code in SR0 is

16#2003.

4. If the value in S2+1 is larger than the number of characters that can be retrieved from the string in S1, SM0 is ON,

and the error code in SR0 is 16#2003.

5. If D is not sufficient to contain S2+1 characters, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

6. if you declare the operand S2 in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6_

6-751
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2115 $SER P S1, S2, n, D Searching a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
n        
D     
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1   
S2   
n  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String to be searched

S2 : String to be searched for

n : nth character in S2 where the search begins

_6 D : Search result

Explanation

1. This instruction searches the string in S2 from the nth character for the string in S1, and stores the search result in D.

2. When the nth character exceeds the length of the string in S2, or S1>S2, D is 0.

3. Suppose the string in S2 is “ABCDEFGHIJK”, the string in S1 is “EFGH”, and n is 3. The search begins from the third

character in S2, and the value in D is 5.

b 15 b8 b7 b0 b1 5 b 8 b7 b0
S1 16 #4 6( F) 1 6 #4 5( E) 1 6# 42 (B) 16 # 41( A) S2
S1 +1 16 #4 8( H) 1 6 #4 7( G) 1 6# 44 (D) 16 # 43 (C) S2 +1
Se arc h in g th e str in g fro m the th ir d cha r acte r
S1 +2 © ²¤ o r e d
Ign¿ 1 6# 00 1 6 #4 6( F) 1 6 #4 5( E ) S2 +2 Ma tch in g cha r acte r
1 6 #4 8( H) 1 6 #4 7(G ) S2 +3
1 6# 4A (J) 1 6 #4 9( I) S2 +4
1 6# 0 0 1 6# 4B (K) S2 +5

A fte r the i nstru ctio n is ex e cu te d

5 D

6-752
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

b15 b8 b7 b0
16# 32(2) 16# 31(1) D0
AB 16# 44(D) 16# 43(C) D1
Searching the string from the third char acter
16# 42(B) 16# 41(A) D2
Matching character
16# 48(H) 16# 47( G) D3

Ignored 00

After the instruction is executed

5 D100

Additional remarks

1. If the operand S1 is not a string ($) but a device with a string, the string in S1 can be up to 256 characters(16#00

ending character included). If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 6_
16#200E.

2. If the operand S1 is not a string ($) but a device with a string, the string in S2 can be up to 256 characters(16#00

ending character included). If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is

16#200E.

3. If n is less than or equal to 0, SM0 is ON, and the error code in SR0 is 16#2003.

6-753
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2116 $RPLC P S1, S2, S3, S4, D Replacing the characters in a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
S3        
S4        
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1   
S2   
S3  
S4  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol
String to be searched and matching
S1 :
characters replaced
S2 : New string
_6 S3 : Number of characters in S1 to be replaced
The string S2 replaces the characters in S1 starting from the
S4 :
character indicated by the value in S4.
D : Device where the result is stored

Explanation

1. This instruction replaces the characters in S1 with the characters in S2, starting from the character in S1 that

matches the character in S4. The number of characters that are replaced is indicated by the value in S3, and the

instruction stores the result in D.

2. For example, the instruction replaces the four characters starting from the sixth character in the string “1234567890”

with “MN”, and the result is “12345MN0”.

6-754
C ha pt er 6 A p pl i e d In s tr uc t io ns

b15 b8 b7 b0 b15 b8 b7 b0
S1 16#32(2) 16# 31(1) 16# 32(2) 16# 31(1) D
S1+1 16# 34(4) 1 6# 33(3) 16# 34(4) 16# 33(3) D+1
S1+2 16# 36(6) 16# 35(5) 16 # 4D(M) 16# 35(5) D+2
S1+3 16# 38 (8 ) 16 # 37(7) Afte r the ins truc tion 16# 30(0) 16# 4E(N) D+3
S1+4 16# 30(0) 16# 39(9 ) is ex ec uted 16# 0000 D+4
S1+5 I gnored 16# 00

S2 16# 4E(N) 16 #4 D(M)


S2+1 I gnored 16# 00

4 Number of c haract ers whic h are replac ed


S3

S4 6 Ch aract er whic h is replace d

3. If the string in S2 is 16#00, the instruction deletes the matching characters.

4. If the value in S3 is larger than the number of characters that the instruction can replace in the string in S1, the

instruction replaces the characters in S1 starting from the character indicated by the value in S4 to the last character

in S1.

5. If the value in S3 is equal to 0, the instruction is not executed.

Example

When M0 is ON, the data in D0–D7 is “1234ABAB1234AB”, and the data in D10–D11 is “CDEF”. When the $RPLC

instruction executes, the instruction replaces the characters in D0–D7 starting from the character indicated by the value in 6_
D51 with the characters in D10–D11. The number of characters to replace is indicated by the value in D50, and the

instruction stores the result in D20–D27.

6-755
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

If the values in D50 and D51 are 3 and 4 respectively, the execution result is as follows.

b 15 b8 b7 b0
b15 b8 b7 b0
D0 1 6# 32(2 ) 1 6#3 1( 1)
16 #32 (2) 16# 31 (1) D20
D1 1 6# 34(4 ) 1 6# 33( 3) Af te r t he instru ction 16 #43 (C) 16 #33 (3 ) D21
D2 1 6# 42(B ) 16 #41 (A ) is e xecut ed.
1 6#4 5 (E) 1 6 #44( D) D22
D3 1 6 #42 (B ) 16 #41 (A )
° õ
¦ æ
«á 16 # 41(A ) 1 6# 46( F) D2 3
D4 16 #32 (2 ) 1 6# 31( 1)
1 6# 31( 1) 16 #42 (B ) D24
D5 16 #34 (4 ) 1 6# 33( 3)
1 6# 33( 3) 16 #32 (2 ) D25
D6 16 #42 (B ) 1 6# 41( A)
1 6# 41(A ) 16 #34 (4 ) D26
D7 ©n¤
Ig ²o r e d
¿ 16 #00 1 6 #00 16 #42 (B ) D27

D 10 16 # 44(D) 1 6# 43( C)
D 11 16 # 45(F) 1 6# 45( E)
D 12 © n¤
Ig ²o r e d
¿ 16 #00

D 50 3 ¨N uú
¥mN
¼bÆ
¶qe r o f c h a r a c te r s w h i c h a r e r e p l a c e d

D51 4 ¶ h}©a l̈r aú


C ¥c te
ª rº¦ wì̧mh ic h i s r e p l a c e d
N

If the values in D50 and D51 are 4 and 4 respectively, the execution result is as follows.

b1 5 b8 b7 b0 b1 5 b8 b7 b0
D0 16 #3 2( 2 ) 1 6# 3 1 (1 ) 16# 3 2( 2) 1 6# 3 1 (1 ) D2 0
D1 16 # 34 ( 4) 16# 33 (3 ) 16# 4 3( C) 16# 33 (3 ) D2 1
D2 1 6# 4 2( B) 16 # 41 (A ) 16 # 45( E) 16 # 44( D) D22
D3 16# 42 (B ) 16 # 41( A) 16 # 42( B) 16 # 46( F) D2 3
A fte r th e instr ucti on
D4 16 # 32( 2) 16# 31 (1 ) 1 6# 32 (2 ) 16 # 31 (1 ) D24
is execu ted
D5 16 # 34( 4) 16# 33 (3 ) 16# 34 (4 ) 16# 33 (3 ) D25
D6 16# 42 ( B) 1 6 # 41 (A ) 16 # 42 (B ) 16 # 41 (A ) D26
D7 Ign or ed 16 # 0 0 1 6# 0 0 00 D27

_6
D1 0 16 # 44( D) 16# 43 (C )
D11 16 # 45( F) 1 6# 45 (E )
D12 Igno re d 16 # 00

D5 0 4 Numb er of cha ra cter s whi ch ar e rep la ced

D51 4 Ch ar acte r wh ich i s re pl ace d

6-756
C ha pt er 6 A p pl i e d In s tr uc t io ns

If the values in D50 and D51 are 20 and 4 respectively, the execution result is as follows.

b1 5 b8 b7 b0 b 15 b8 b7 b0
D0 1 6# 32( 2) 16# 31 (1) 1 6# 32 (2) 1 6# 31(1) D20
D1 1 6# 34( 4) 16# 3 3(3) 1 6# 43 (C) 1 6# 33( 3) D21
D2 1 6# 42( B) 1 6# 41 (A) 1 6# 45 (E) 16# 4 4(D) D22
D3 16# 42 (B) 1 6# 41( A) Afte r the instru ctio n 1 6# 00 1 6# 4 6(F) D23
D4 16# 3 2(2) 1 6# 3 1(1) i s e xe cu te d
D5 16# 3 4(4) 1 6# 3 3(3)
D6 1 6# 4 2(B) 16# 4 1(A)
D7 Ignor ed 1 6# 00

D1 0 16 # 44(D) 16# 4 3(C)


D11 16 # 45(F) 16# 4 5(E)
D1 2 Ignor ed 1 6# 00

D5 0 20 Number o f ch aracters w hich are r epl aced

D51 4 Character whi ch i s r epl ace d

If the values in D50, D51, and D10 are 3, 4, and 16#00 respectively, the execution result is as follows. The three

characters in D0-D7 starting from the fourth character are deleted.

b15 b8 b7 b0 b15 b8 b7 b0
D0 16#32(2) 16#31(1) 16# 32(2) 16#31(1) D 20
D1 16# 34(4) 16# 3 3(3) 16# 41(A) 16# 3 3(3) D 21
D2 16# 42(B) 16# 41(A) 1 6# 3 1(1) 16# 42(B) D22
D3 1 6# 4 2(B) 16# 41(A) After the i ns truc tion 16# 33(3) 16# 32(2) D23
D4 16# 3 2(2) 16# 31(1) is exec uted 16# 41(A) 16# 34(4) D24
D5 16# 34(4) 16# 33(3) 1 6# 0 0 16#42(B) D25
D6 16# 4 2(B) 1 6# 4 1(A)
D7 16# 0 0

6_
D10 1 6# 0 0

D50 3 Num ber of c haracters whic h are r epl ac ed

D51 4 C har ac ter whic h is r eplac ed

Additional remarks

1. If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

2. If the string in S2 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

3. If the value in S3 <0 or S4<=0 or the value in S4 is larger than the length of the string in S1, SM0 is ON, and the error

code in SR0 is 16#2003.

4. If the value in the string (16#00 the ending character included) in S1 after the replacement is larger than 256, the

instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

6-757
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2117 $DEL P S1, S2, S3, D Deleting the characters in a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2        
S3        
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1   
S2  
S3  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String

S2 : Number of characters to be deleted


Characters in S1 are deleted starting from the character
S3 :
indicated by the value in S3.
D : Device where the execution result is stored
_6
Explanation

1. This instruction deletes the characters in S1 starting from the character indicated by the value in S3. The number of

characters that are deleted is indicated by the value in S2, and the instruction stores the result in D.

2. For example, the instruction deletes the four characters starting from the third character in the string “1234567890”

in S1, and stores the result “127890”in D.

b15 b8 b7 b0 b15 b8 b7 b0
S1 16#32(2 ) 16 # 31(1) 16# 32(2) 16# 31 (1 ) D
S1 +1 16 # 34(4 ) 16 # 33(3 ) 16# 38(8) 16# 37(7) D +1
S1 +2 16 # 36 (6 ) 16# 35(5) 16# 30(0) 16# 39(9) D +2
S1+3 16# 38(8) 16# 37(7) Af ter t he in st ruct ion 16 # 000 0 D +2

S1 +4 16# 30(0) 16# 39(9) is ex ecu ted

S1 +5 Ign ored 16# 00

S2 4

S3 3

6-758
C ha pt er 6 A p pl i e d In s tr uc t io ns

3. If the value in S2 is larger than the number of characters which can be deleted in the string in S1, the instruction

deletes the characters in S1 starting from the character indicated by the value in S3 to the last character in S1, and

stores 16#00 in D.

b15 b8 b7 b0
S1 16#32(2) 16#31(1)
S1+1 16# 34(4) 16# 33(3) b15 b8 b7 b0
S1+2 16# 32(2) 16#31(1) D
16# 36(6) 16# 35(5)
16# 0000 D +1
S1+3 16# 38(8) 16# 37(7) After the instruction
is ex ecuted
S1+4 16# 30(0) 16# 39(9)
S1+5 Ignored 16# 00

Larger than the number of characters


10
S2 which can be deleted in the string in S1
S3 3

4. If the value in S2 is equal to 0, the instruction is not executed.

Example

When M0 is ON, the data in D0–D3 is “1234567”. When the $DEL instruction executes, it deletes the characters in D0–D3

starting from the character indicated by the value in D11. The number of characters to delete is indicated by the value in

D10, and the instruction stores the result in D20–D23.

6_

If the values in D10 and D11 are 3 and 4 respectively, the execution result is as follows.

b15 b8 b7 b0
D0 16# 32(2) 16# 31(1) b15 b8 b7 b0
D1 16# 34(4) 16# 33(3) 16# 32(2) 16# 31(1) D20
D2 16# 36(6) 16# 35(5) 16# 37(7) 16# 33(3) D21
D3 16# 00 16# 37(7) 16# 00 D22
After the instruction
is executed
D10 3

D11 4

If the values in D10 and D11 are 5 and 4 respectively, the execution result is as follows. Note that the number of

characters to delete exceeds the range, the instruction deletes the characters in D0–D3 starting from the fourth character

to the last character.

6-759
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b8 b7 b0
D0 16# 32(2) 16#31(1)
b15 b8 b7 b0
D1 16# 34(4) 16# 33(3)
16# 32(2) 16# 31(1) D20
D2 16#36(6) 16# 35(5)
16# 00 16# 33(3) D21
Aft er the instruc tion
D3 16# 00 16# 37(7)
is ex ecut ed

D10 5 Exc eeding t he range

D11 4

If the values in D10 and D11 are 5 and 1 respectively, the execution result is as follows.

b15 b8 b7 b0
D0 16# 32(2) 16# 31(1)
b15 b8 b7 b0
D1 16# 34(4) 16# 33(3)
16# 37(7) 16#36(6) D20
D2 16# 36(6) 16# 35(5)
16# 00 D21
D3 16# 00 16# 37(7) After the instruction
is executed
D10 5

D11 1

Additional remarks

1. If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

2. If the value in S2 is less than 0, the value in S3 is less than or equal to 0, or the value in S3 is larger than the length of

_6 the string in S1, SM0 is ON, and the error code in SR0 is 16#2003.

6-760
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2118 $CLR P S Clearing a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : String to be cleared

Explanation

1. This instruction clears the string in S. If the string in S does not end with 16#00, the instruction clears up to 255

characters.

b15 b8 b7 b0
S 16#31(1) 16# 2D(-) S 16# 0000
S +1 16# 33(3) 16# 32(2) S +1 16# 0000
S +2 16# 34( 4) 16# 35(5) S +2 16# 0000 6_
S +3 16# 36(6) 16# 2E(.) S +3 16# 0000
S +4 16# 38( 8) 16# 37(7) After the instruction S +4 16# 0000
is executed 16# 0000
S +5 16# 00 S +5

Example

The instruction clears the string in D0 as illustrated below.

6-761
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

b15 b8 b7 b0
D0 16# 32(2) 16# 31(1) 16# 0000 D0
D1 16# 34(4) 16# 33(3) 16# 0000 D1
D2 16# 36(6) 16# 35(5) 16# 0000 D2
D3 16# 00 16# 37(7) After the instruction 16# 0000 D3
is executed

_6

6-762
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2119 $INS P S1, S2, S3, D Inserting a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1     
S2     
S3        
D   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1   
S2   
S3  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String

S2 : String to be inserted
The string S2 is inserted into S1 after the character indicated
S3 :
by the value in S3.
D : Device in which the execution result is stored
6_
Explanation

1. This instruction inserts the string in S2 into the string in S1 after the character indicated by the value in S3, and stores

the result in D.

2. If the string in either S1 or S2 is a null string, the instruction stores the other string (S1 or S2) that is not a null string in

D.

3. If the strings in S1 and S2 are null strings, the instruction stores 16#0000 in D.

b15 b8 b7 b0 b15 b8 b7 b0
S1 16# 32(2) 16# 31(1) 16# 32(2) 16# 31(1) D
S 1+1 16# 34(4) 16# 33(3) 16# 34(4) 16# 33(3) D +1
S 1+2 16# 36(6) 16# 35(5) 16# 36(6) 16# 35(5) D +2
S 1+3 16# 38(8) 16# 37(7) 16# 4E(N) 16# 4D(M) D +3
After the inst ruction
S 1+4 16# 30(0) 16# 39(9) 16# 38(8) 16# 37(7) D +4
is ex ec uted
S 1+5 16# 00 16# 30(0) 16# 39(9) D +5
00 D +6
S2 16# 4E(N) 16# 4D(M)
S 2+1 16# 00

S3 6

6-763
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

When M0 is ON, the data in D0–D3 is “1234567”, and the data in D10 is “AB”. When the $INS instruction executes, it

inserts “AB” into the string in D0–D3 after the character indicated by the value in D30, and stores the result in D20–D24.

If the value in D30 is 1, the execution result is as follows.

b15 b8 b7 b0 b15 b8 b7 b0
D0 16#32(2) 16# 31(1) 16# 41(A) 16#31(1) D20
D1 16# 34(4) 16# 33(3) 16# 32(2) 16# 42(B) D21
D2 16# 36(6) 16# 35(5) 16# 34(4) 16# 33(3) D22
_6 D3 16# 00 16# 37(7) Af ter the instruct ion 16# 36(6) 16# 35(5) D23
is execut ed 16# 0 0 16# 3 7(7) D24
D10 16# 42(B) 16# 4 1(A)

D11 Ignored 16# 00

D30 1

If the value in D30 is 0, the execution result is as follows.

b15 b8 b7 b0 b15 b8 b7 b0
D0 16#32(2) 16#31(1) 16#42(B) 16 #41(A) D20
D1 16#34(4) 16#33(3) 16#32(2 ) 16 #31(1) D21
D2 16#36(6) 16#35(5) Af ter 16#34(4) 16 #33(3) D22
execution 16# 36(6)
D3 16#00 16#37(7) 16 #35(5) D23
16#00 16 #37(7) D24
D10 16#42(B) 16#41(A)
D11 I gnored 16#00

D30 0

6-764
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

2. If the string in S2 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

3. If the value in S3 is less than 0, or if the value in S3 is larger than the length of the string in S1, SM0 is ON, and the

error code in SR0 is 16#2003.

4. If the inserted value in the string (16#00 the ending character included) in S1 is larger than 256, the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6_

6-765
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2122 SPLIT P S1,S2,S3,S4,D1,D2 Splitting a string

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1  
S2    
S3    
S4   
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2   
S3   
S4  
D1  
D2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String
_6 S2 : Splitter

S3 : Designated ending character of a splitter

S4 : Storing Length for a string after a splitter

D1 : Device in which the string after a splitter is stored

D2 : Device in which the quantity of split strings is stored

Explanation

1. S1 is the string source. For characters in a string, only the characters before an ending character or the value in S3

will be used as a valid string.

2. S2 is the splitter that separates strings. S3 is a designated ending character of a splitter. Only values in the lower

8-byte are valid for S2 and S3. However, if you input a value other than the value in the lower 8-byte, PLC does not

send any error message. When S2 and S3 use D devices to store values, only use lower 8-byte for values in ASCII

format. Values in S2 and S3 can be a constant number, an ASCII or a string.

3. S4 is the storing length for a string after a splitter; unit: WORD. The ending characters, such as 16#00 and 16#0000
should be included in the length. The maximum WORDs a string can contain is S4 and a WORD equals to 2 bytes.

An ending character 16#00 takes a byte. For example, if S4 is 2, the maximum WORDs a string can contain is 2

6-766
C ha pt er 6 A p pl i e d In s tr uc t io ns

WORDs and 2 WORDs equals to 4 bytes. And that means a string can contain 3 characters and 1 ending

character (16#00). The setting range for S4 is 1-100. (If the input value is out of the range, the value will be seen as

the minimum or the maximum during operation and PLC does not send any error message.)

4. D2 is the sum of all the split strings.

5. The result of D1~ D1+ S4 *D2 –1 is the D devices that are occupied.

For example, if D2 is 3, that means the 1st string will be stored from D1+0 and the 2nd string will be stored in D1+ S4

and the 3rd string will be stored in D1+ S4 x2.

6. The instruction looks for a string for a length defined in S4 (WORD) till there is an ending character or a splitter. Add

1 to the value in D2. Whenever one string is found,

7. Up to 256 characters can be stored in S1 and up to 20 sets of strings can be stored in D2. When any of the limitation

is reached even when there is no ending character, the splitting stops.

Example

Use “,” as a splitter to split a string “abcd,1234,5.67,8910;ef” and use “;” as an ending character that stored in D0-D11. And

store the results in the register starting from D100 in a unit of 10 WORDs.

Note: the string to be split does not include the characters “”.
6_

Explanation

1. The results of this example D0~D11=“abcd,1234,5.67,89103;edf”.

Device Value String

D0 16#6261 “ba”

D1 16#6463 “dc”

D2 16#312C “1,”

D3 16#3332 32

D4 16#2C34 “,4”

D5 16#2E35 “.5”

6-767
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Device Value String

D6 16#3736 “76”

D7 16#382C “8,”

D8 16#3139 “19”

D9 16#3330 “30”

D10 16#453B “e;”

D11 16#4644 “fd”

2. Starting contact is M0

3. The quantity of split strings D200=4

4. The split strings are as below

1st set: D100~D109 are occupied; D100-D101=“abcd”

Device D100 D101 D102 D103 D104 D105 D106 D107 D108 D109

HEX 6261 6463 0000 0000 0000 0000 0000 0000 0000 0000

String “ba” “dc” 16#0000 - - - - - - -

2nd set: D110~D119 are occupied; D110~D111=“1234”

Device D110 D111 D112 D113 D114 D115 D116 D117 D118 D119
_6 HEX 3231 3433 0000 0000 0000 0000 0000 0000 0000 0000

String “21” “43” 16#0000 - - - - - - -

3rd set: D120~D129 are occupied; D120~D121=“5.67”

Device D120 D121 D122 D123 D124 D125 D126 D127 D128 D129

HEX 2E35 3736 0000 0000 0000 0000 0000 0000 0000 0000

String “.5” “76” 16#0000 - - - - - - -

4th set: D130~D139 are occupied, D130~D131=“89103”

Device D130 D131 D132 D133 D134 D135 D136 D137 D138 D139

HEX 3938 3031 0033 0000 0000 0000 0000 0000 0000 0000

Upper: 3”

String “98” “01” Lower: - - - - - - -

16#00

6-768
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. Up to 256 characters can be stored in S1 if there is no ending character (16#00) or splitter, the instruction will

execute on the 256 characters. SM0 will not be ON.

2. Ending character 16#00 or 16#0000 will be added in a string after it is split (D1). See the example above.

3. Ending character 16#00 or 16#0000 will be added in a string after it is split (D1) even when there is no string

behind the split string.

6_

6-769
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2123 MERGE P S1,S2,S3,D1,D2 Merging strings

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2   
S3    
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1   
S2   
S3   
D1  
D2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S1 : String source 1

S2 : String source 2

_6 S3 : Splitter

D1 : Device in which the merged string is stored

D2 : Device in which the quantity of merged strings is stored

Explanation

1. S1 and S2 are the string source 1 and 2 respectively. S3 is the splitter that separates strings. Only values in the
lower 8-byte are valid for S3. S1 merges S2 directly, when S3 is 0 (16#00). S1 adds the splitter and then merges S2,

when S3 is not 0.

2. D1 is where to store a merged string. The merging order is string 1 + splitter + string 2 + ending character 0 (16#00).

You can self-define an ending character. This self-defined ending character will be added before the official one, 0

(16#00).

3. If the values in S1, S2, S3 are all 0, D1 is 16#0000.

4. D2 is the sum of all the merged strings (ending character 16#00 excluded). The accumulated length for the string is

the length of string 1 or the length of string 1 + splitter + the length of string 2.

6-770
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. If the string sources for S1 and S2 are both 0 or when strings are merged, the length for the merged string is up to

255 words (ending character 16#00 excluded). For example, there are 250 words in String 1 and 100 words in

String 2. After they are merged, the length for the merged string is 250 words from String 1 + splitter *1 + first 4

words from String 2.

Example

Use “,” as a splitter to split a string and use “;” as an ending character and then merge 3 strings “abcd”, ”1234” and ”5.67”.

And store the results “abcd,1234,5.67;” D100=15, in the register starting from D0-D7.
6_
Explanation

1. Starting contact is M0

2. The 1st program: merge the 1st string “abcd” and 2nd string “1234” together and put a splitter “,” in between and then
store the result in the registers starting from D0.

The merged result: D0~D4= “abcd,1234”; the quantity of merged strings: D100=9

Device D0 D1 D2 D3 D4
HEX 6261 6463 312C 3332 0034
String “ba” “dc” “1,” “32” Upper 8-byte: 16#00 ; lower 8-byte: 4
3. The 2nd program: merge the 1st string D0=“abcd,1234” and 2nd string ”5.67” together and put a splitter “,” in between
and then store the result in the registers starting from D0.

The merged result: D0~D7= “abcd,1234,5.67”; the quantity of merged strings: D100=14

Device D0 D1 D2 D3 D4 D5 D6 D7
HEX 6261 6463 312C 3332 2C34 2E35 3736 0000
String “ba” “dc” “1,” “32” “,4” “.5” “76” 16#0000

6-771
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. The 3rd program: merge the 1st string D0=“abcd,1234,5.67” and 2nd string ”,” together and put a splitter “0” in between
(merge the string 1 and 2 directly) and then store the result in the registers starting from D0.

The merged result: D0~D7= “abcd,1234,5.67;”; the quantity of merged strings: D100=15.

Device D0 D1 D2 D3 D4 D5 D6 D7

HEX 6261 6463 312C 3332 2C34 2E35 3736 003B

Upper 8-byte: 16#00 ;


String “ba” “dc” “1,” “32” “,4” “.5” “76”
lower 8-byte: “;”

Additional remarks

1. If the string in S1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

2. If the string in S2 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

3. If D1 + (D2+1)/2 – 1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#2003.

4. Ending character 16#00 or 16#0000 will be added behind the merged string. See the examples above.

_6

6-772
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.22 Ethernet Instructions


6.22.1 List of Ethernet Instructions
The following table lists the String Processing instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

2200 SOPEN –  Opening a socket

2201 SSEND –  Sending data through a socket

2203 SCLOSE –  Closing a socket

2204 MSEND –  Sending an email

2206 INTOA –  Converting an integer IP address into a string IP address

2207 IATON –  Converting a string IP address into an integer IP address

2208 EIPRW – – Reading and writing EtherNet/IP data

2209 SCONF –  Setting the TCP/UDP Socket parameters

2210 MCONF –  Reading and writing Modbus TCP data

2211 EMCONF1 –  Setting email server parameter values

2212 EMCONF2 –  Setting email address

2213 ETHRW – – Ethernet communication


6_6

6-773
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.22.2 Explanation of Ethernet Instructions

API Instruction code Operand Function

2200 SOPEN P S1, S2, S3 Opening a socket

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
S3       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

Data

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1 : Socket protocol

S2 : Socket number

S3 : Communication mode

_6
Explanation

1. This instruction is a pulse instruction (SOPENP) here.

2. Use this instruction along with instructions SSEND and SCLOSE; you can also use it with instruction SCONF

according to your needs.

3. Before using the instruction, set the following setting in HWCONFIG in ISPSoft or in DIADesigner’s Hardware

Configuration.

 PLC Parameter Setting → Ethernet-Basic → Setting IP address and netmask address

 PLC Parameter Setting → Ethernet-Advanced → Socket →TCP/UDP Socket Connection and Setting sockets

to be used

4. Refer to the SCONF instructions (API 2209) for more on the TCP and UDP Socket parameters.

5. S1: the socket protocol.

Set S1 to 0 to open the UDP socket, and set S1 to 1 to open the TCP socket.

6. S2: the socket number.

It should correspond to the Ethernet socket number set in the advanced settings. You can also set up the

corresponding socket numbers through SCONF instruction.

6-774
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

PLC CPU V1.06 or previous versions V1.08 or later versions


ES3 1-2 1-8

PLC CPU V1.00 or later versions


EX3/SV3/SX3 1-8

7. If the setting value of S1 or S2 exceeds the setting range, error code 16#2003 will be stored in SR180.

8. S3=0-3: This is used to set the communication role (server or client) and receiving mode (single or continuous) for

TCP Socket communication. Refer to the TCP Socket Communication section below for more details. (There is no

server-client role distinction in UDP communication).

9. UDP Socket (S1=0)

 UDP communication is a high-efficiency and low-reliability communication method. Compared to TCP sockets,

it can send and receive data at a higher speed. However, it cannot detect whether the remote device still exists

or whether data has been received. Therefore, if there is a need to confirm whether the packet has arrived,

other mechanisms need to be provided or TCP sockets should be used for communication.

 There is no distinction between client and server in UDP communication, and S3 can be set to 0-3.

 For common usage, it is recommended to specify the remote IP address, remote port, and local port.

 For special applications:

When the remote IP address or remote communication port number is set to 0, it means there is no restriction

on the remote data source. But in this case, the local PLC must have received at least one UDP packet before

sending data to this IP address or this port number.


Remote
Local Port
IP Address
Remote Port Description 6_6
Specified Specified
communication For common situations
IP Address port
Specified
Communication 0  For remote devices that may have random
IP Address
port ports or when their IP addresses may
Specified change.
0.0.0.0 communication
 Local PLC must have received data before
port
sending data.
0.0.0.0 0

10. Flags for UDP Socket communication

 UDP Sockets No. 3-8 are supported by ES3 V1.08 or later versions.

UDP Socket Connection Connection


Data Received Data Sent Error Flag
Number Opened Closed

1 SM1334 SM1335 SM1336 SM1337 SM1338

2 SM1339 SM1340 SM1341 SM1342 SM1343

3 SM1344 SM1345 SM1346 SM1347 SM1348

4 SM1349 SM1350 SM1351 SM1352 SM1353

6-775
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

UDP Socket Connection Connection


Data Received Data Sent Error Flag
Number Opened Closed

5 SM1354 SM1355 SM1356 SM1357 SM1358

6 SM1359 SM1360 SM1361 SM1362 SM1363

7 SM1364 SM1365 SM1366 SM1367 SM1368

8 SM1369 SM1370 SM1371 SM1372 SM1373

 If the data transmission is complete, the system will set the flag to ON. You need to set it back to OFF.
 UDP Socket communication process:

 UDP communication description


(1) There is no connection between devices in UDP communication that is formally established or

disconnected. In fact, only states of opening and closing the local communication ports are
_6 controlled.

(2) When the SOPENP instruction is activated, the local communication port is opened and ready to

receive data, and you can use SSENDP instruction to send data to the specified remote device.

(3) After that, you can use SCLOSEP instruction to close the local communication port.

11. TCP Socket S1=1

 It is required to establish a connection for TCP communication to transmit data. The initiator of the connection is

the client, and the connection is established passively by the server. When the connection is successfully

established, both parties have the ability to send, receive data, and terminate the connection.
 If S3 is 0 or 2, the PLC functions as a server, it need be started first and then waits for a TCP connection request

from the client.

 If S3 is 1 or 3, the PLC functions as a client, the server need be started first and then the PLC sends a request

for TCP connection to the server.

 If S3 is 0 or 1, this is a single receiving mode. Each received data will overwrite the previously received data in

the data storage area, and the length of the currently received data will not be recorded.

 If S3 is 2 or 3, this is a receiving continuously mode. PLC will use the actual received length to determine

whether the data has been received completely. Here is a setting example: the starting address to receive data

is D100, and D100 will store the received data length. The received data will be stored in the devices starting

6-776
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

from D101. When new data is received, the old data will be retained and placed sequentially behind. When the

value of the first position (data length) is written as 0 or the total data amount exceeds the allowed maximum

received data length, the new data will be stored again starting from the second position.
S3 Communication role Receiving mode
0 Server
Single
1 Client
2 Server
Continuous
3 Client

 Settings in S3, the remote IP address, remote and local communication ports
Remote Remote
Communication
Local port IP communication Description
role (S3)
address port
Use any local communication
0
Specified port
Specified
Specified communication
IP Use a specified local
Client mode communication port
Address communication port
(1 or 3) port
 The number of a local communication port can be set between 0 to 65535.
 Remote IP address can NOT be set to 0.0.0.0.
 The number of the remote communication port can NOT be set to 0.
Any remote IP device is
0.0.0.0 0 allowed to establish a
connection.

Specified Establishing a connection is


0 allowed, only if the remote IP
IP
address is correct.
Specified Address
communication Specified Establishing a connection is 6_6
port 0.0.0.0 communication allowed, only if the remote IP
Server mode port address is correct.
(0 or 2) Establishing a connection is

Specified Specified allowed, only if the remote IP


communication address and the number of the
IP
port remote communication port are
Address
correct.
 The number of the local communication port can NOT be set to 0.
 For common applications, you can set the remote IP address to 0.0.0.0 and
the number of the communication port to 0.
 If there is a security concern, you need to specify the remote IP address and
the number of the remote communication port for the connection.

12. Flags for TCP Socket communication


TCP Sockets No. 3-8 are supported by ES3 V1.08 or later versions.
TCP Data
Connected Data Sent Connecting Disconnected Error Flag
Socket Received
1 SM1270 SM1271 SM1272 SM1273 SM1274 SM1277
2 SM1278 SM1279 SM1280 SM1281 SM1282 SM1285
3 SM1286 SM1287 SM1288 SM1289 SM1290 SM1293
4 SM1294 SM1295 SM1296 SM1297 SM1298 SM1301

6-777
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

TCP Data
Connected Data Sent Connecting Disconnected Error Flag
Socket Received
5 SM1302 SM1303 SM1304 SM1305 SM1306 SM1309
6 SM1310 SM1311 SM1312 SM1313 SM1314 SM1317

7 SM1318 SM1319 SM1320 SM1321 SM1322 SM1325

8 SM1326 SM1327 SM1328 SM1329 SM1330 SM1333

1. The communication status of TCP Socket #6 and RTU-EN01 use the same flag for indication. If RTU-EN01 is

used as a remote module, it is suggested NOT to use TCP Socket #6 at the same time.

2. If the data transmission is complete, the system will set the flag to ON. You need to set it back to OFF.

3. TCP Socket communication process:

 When the PLC functions as a Client for TCP connection:

(1) Connection NOT established: [Connected, Connecting, Disconnected] = [OFF, OFF, ON]
_6
Before executing the SOPENP instruction, the local PLC must be in a disconnected state, and the

remote server must be in the “waiting for connection” state. When the instruction is executed, a

connection request will be sent to the server. [SYN]

(2) Waiting for connection: [Connected, Connecting, Disconnected] = [OFF, ON, OFF]

Waiting for the connection confirmation response from the server. [SYN/ACK]。

(3) Connection established: [Connected, Connecting, Disconnected] = [ON, OFF, OFF]

After receiving the connection confirmation response from the server, a confirmation packet [ACK]

is sent out, which means the connection is established. At this point, data can be received through

the local port and you can also use the SSENDP instruction to send data to the specified remote

device.

(4) Connection disconnected: [Connected, Connecting, Disconnected] = [OFF, OFF, ON]

When the SCLOSEP instruction is executed, a connection termination packet [FIN/ACK] will be

sent to the server. The connection will be terminated when a connection termination packet

[FIN/ACK] is received from the server in response.

6-778
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

 When the PLC functions as a Server for TCP connection:

(1) Connection NOT established: [Connected, Connecting, Disconnected] = [OFF, OFF, ON]

After executing the SOPENP instruction, it will enter the waiting-for-connection state, waiting for a

connection request [SYN] from the client.

(2) Waiting for connection: [Connected, Connecting, Disconnected] = [OFF, ON, OFF]

Waiting for the connection request from the client. Once the request is received, a connection

confirmation response [SYN/ACK] will be sent out.

(3) Connection established: [Connected, Connecting, Disconnected] = [ON, OFF, OFF]

After receiving the connection confirmation response packet [ACK] from the client, the connection

is established. At this point, data can be received through the local port and you can use the

SSENDP instruction to send data to the specified remote device.

(4) Connection disconnected: [Connected, Connecting, Disconnected] = [OFF, OFF, ON]

When the SCLOSEP instruction is executed, a connection termination packet [FIN/ACK] will be

sent to the client. The connection will be terminated when a connection termination packet

[FIN/ACK] is received from the client in response.

 Illustration of the connection packets for TCP communication

6_6

 Illustration of the disconnection packets for TCP communication

13. The following port numbers are already in use. Do NOT use these port numbers as the setting values for the local

ports.

Socket Communication port The communication protocol in use

TCP 80 HTTP

TCP 502 MODBUS TCP

6-779
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Socket Communication port The communication protocol in use

TCP 44818 EtherNet/IP

UDP 68 DHCP/BOOTP

UDP 2222 EtherNet/IP

UDP 44818 EtherNet/IP

UDP 20006 Delta-defined communication

14. TCP connection errors:

Error Code
Error Flag Description Solution
(SR180)

The value in S1, S2 or S3

16#2003 SM0 exceeds the setting Edit the setting value in S1, S2 or S3.

range.

Refer to the table shown above to avoid


The port number has
16#600C SM1109 using the port numbers that are already
been used.
in use.

Ethernet network not Make sure the Ethernet cable and


16#600D SM1100
connected network are functioning.

Illegal TCP socket IP Make sure the remote IP address is


16#6200 TCP socket error flag
address correct.

Illegal TCP Socket Make sure that the remote IP address


_6
16#6201 TCP socket error flag communication mode and the local and remote communication

setting port numbers are set correctly.

Illegal TCP Socket mode


16#6202 TCP socket error flag
setting

Illegal address for sending


16#6203 TCP socket error flag
data

Length of sent data


16#6204 TCP socket error flag
exceeds the range
Before using the SCONF instruction to
Source data device set the parameters, it is recommended to
16#6205 TCP socket error flag
exceeds the range check the valid range on the
Illegal address for communication parameter setting page.
16#6206 TCP socket error flag
receiving data

Length of received data


16#6207 TCP socket error flag
exceeds the range

Target data device


16#6208 TCP socket error flag
exceeds the range

6-780
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Error Code
Error Flag Description Solution
(SR180)

1. Connection has never been

established: The local PLC cannot

find the remote device. Check if the

network status of the remote device

is normal and if the IP address is the

same as the set value.

TCP Socket 2. Connection has been established


16#6212 TCP socket error flag
communication timeout before: This is a disconnection

behavior initiated by the local PLC.

Check if the communication idle time

has exceeded the setting value of


the connection keep-alive time in the

local communication parameter

setting page.

Check if the amount of data transmitted

from the remote device is less than the


Size of data received
16#6213 TCP socket error flag value of the data length (unit: 1 byte) set
larger than set data size
in the local communication parameter
6_6
setting page.

1. Connection has never been

established: The local PLC cannot

find the remote device. Check if the

network status of the remote device

is normal and if the IP address is the

same as the set value.


TCP Socket connection
2. Connection has been established
16#6214 TCP socket error flag rejected or closed by
before: This is a disconnection
remote device
behavior initiated by the local PLC.

Check if the communication idle time

has exceeded the setting value of


the connection keep-alive time in the

local communication parameter

setting page.

6-781
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Error Code
Error Flag Description Solution
(SR180)

Do NOT use the SSEND or SCLOSE


TCP Socket not
16#6215 TCP socket error flag instruction before the connection is
connected
successfully established.

TCP Socket connection Use the SOPEN instruction as a pulse


16#6217 TCP socket error flag
triggered more than once. instruction.

Sending data through


Use the SSEND instruction as a pulse
16#6218 TCP socket error flag TCP Socket triggered
instruction.
more than once.

Disabling TCP Socket


Use the SCLOSE instruction as a pulse
16#621A TCP socket error flag connection triggered more
instruction.
than once.

15. UDP connection errors

Error Code Error Flag Description Solution


(SR180)
The value in S1, S2 or

16#2003 SM0 S3 exceeds the setting Edit the setting value in S1, S2 or S3.

range.

Refer to the table shown above to avoid


_6 The port number has
16#600C SM1109 using the port numbers that are already
been used.
in use.

Ethernet network not Make sure the Ethernet cable and


16#600D SM1100
connected network are functioning.

Make sure the remote IP address is


16#6209 UDP socket error flag Illegal IP address
correct.

Illegal UDP Socket


Make sure the local communication port
16#620A UDP socket error flag communication mode
is not set to 0.
setting

Illegal address for


16#620C UDP socket error flag
sending data
Length of sent data Before using the SCONF instruction to
16#620D UDP socket error flag
exceeds the range
set the parameters, it is recommended to
Source data device
16#620E UDP socket error flag check the valid range on the
exceeds the range
communication parameter setting page.
Illegal address for
16#620F UDP socket error flag
receiving data

6-782
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Error Code Error Flag Description Solution


(SR180)
Length of received data
16#6210 UDP socket error flag
exceeds the range

Target data device


16#6211 UDP socket error flag
exceeds the range

Check if the amount of data transmitted

Size of data received from the remote device is less than the

16#6213 UDP socket error flag larger than set data value of the data length (unit: 1 byte) set

size in the local communication parameter

setting page.

Do NOT use the SSEND or SCLOSE


UDP Socket not
16#6215 UDP socket error flag instruction before the connection is
connected
successfully established.

UDP Socket
Use the SOPEN instruction as a pulse
16#6217 UDP socket error flag connection triggered
instruction.
more than once

Sending data through


Use the SSEND instruction as a pulse
16#6218 UDP socket error flag UDP Socket triggered
instruction.
more than once.

Disabling UDP Socket 6_6


Use the SCLOSE instruction as a pulse
16#621A UDP socket error flag connection triggered
instruction.
more than once.

Example 1 (S1 = 0, UDP communication mode, take ES3 as an example here.)

1. This example illustrates how to establish an UDP communication between a PLC and a computer.

2. You need to activate UDP function through settings or tools on the computer and check whether the firewall or

antivirus software will limit the use of communication ports.

3. ISPSoft → HWCONFIG / DIADesigner→ Hardware Configuration (Ethernet-Basic)


Network Settings
IP address mode Static
IP address 192.168.1.111
Subnet mask 255.255.255.0
Port IP address 192.168.1.1

4. ISPSoft → HWCONFIG / DIADesigner→ Hardware Configuration (Ethernet-Advanced → Socket → 1st UDP)


1st UDP Settings
Remote IP address 192.168.1.110

6-783
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

1st UDP Settings


Remote communication port 0 (not specified)
Local communication port 3200
Device that stores data to be sent D1000
Specified length of sending data #1 200
Device that stores received data D2000
Maximum length of received data #1 200
Connection keep-alive time 10 (sec.)

Note #1: This data length is defined by settings in SCONF instruction; for V1.06.20 or previous versions: 512 bytes

are available and for V1.06.30 or later versions: 4,096 bytes are available.

5. Flags for UDP Socket 1

UDP Socket Connection Connection


Data Received Data Sent Error Flag
Number Opened Closed

1 SM1334 SM1335 SM1336 SM1337 SM1338

6. Activate a communication: When M0 is ON, the system checks if the socket is closed (SM1337 = ON) and then the

system starts the procedure of establishing a connection. Once the socket is connected (SM1334 = ON), M0 is

switched to OFF.

_6

7. Receiving data: Checks if the socket has been connected and the flag (SM1335) for data receiving is ON. If so, the

data has already been received. But that does NOT necessarily mean it has received all the data (a great amount of

data may be split into several packets), you need to determine if all the data has been received. After all the data

has been received, you need to switch SM1335 to OFF.

6-784
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

8. Sending data: Checks if M1 is ON, the socket has been connected and the flag (SM1334) for data sending is ON.

Then sending data can be started, and after data is sent, you can switch M1 to OFF.

9. Closing a connection: When M2 is ON, the system checks if the socket to be closed has been connected (SM1334
6_6
= ON); if so, the system is going to close the connection. If the socket has not been connected, this instruction is

NOT executed. After the connection is closed, you can switch M2 to OFF.

Example 2 (S1 = 1, S3 = 1, TCP communication mode, take ES3 as an example here.)

1. This example illustrates how to establish a TCP communication between a PLC (acting as a Client) and a computer

(acting as a Server).

2. You need to activate TCP function through settings or tools on the computer and check whether the firewall or

antivirus software will limit the use of communication ports and then specify port 3201 as the communication port.

6-785
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. ISPSoft → HWCONFIG /DIADesigner → Hardware Configuration (Ethernet-Basic)


Network Settings
IP address mode Static
IP address 192.168.1.111
Subnet mask 255.255.255.0
Port IP address 192.168.1.1

4. ISPSoft → HWCONFIG /DIADesigner → Hardware Configuration (Ethernet-Advanced → Socket → 1st TCP)


1st TCP Settings
Remote IP address 192.168.1.110
Remote communication port 3201
Local communication port 3200
Device that stores data to be sent D1000
Specified length of sending data #1 200
Device that stores received data D2000
Maximum length of received data #1 200
Connection keep-alive time 10 (sec.)

Note #1: The data length is defined by settings in SCONF instruction; for V1.06.20 or previous versions: 512 bytes

are available and for V1.06.30 or later versions: 4096 bytes are available.

5. Flags for TCP Socket 1

TCP
Connection Data Connection
_6 Socket Data Sent Connecting Error Flag
Opened Received Closed
Number

1 SM1270 SM1271 SM1272 SM1273 SM1274 SM1277

6. Activate a connection: When M0 is ON, the system checks if the socket is closed (SM1274 = ON) and then a

connection request [SYN] will be sent to the Server if the condition is met. Once the socket is connected (SM1270 =

ON), M0 is switched to OFF.

6-786
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

7. Sending data: Checks if M1 is ON, the socket has been connected and the flag (SM1270) for data sending is ON.

Then sending data can be started, and after data is sent, you can switch M1 to OFF.

8. Receiving data: Checks if the socket has been connected and the flag (SM1271) for data receiving is ON. If so, the

data has already been received. But that does NOT necessarily mean it has received all the data (a great amount of

data may be split into several packets), you need to determine if all the data has been received. After all the data

has been received, you need to switch SM1271 to OFF.

6_6

9. Closing a connection: When M2 is ON, the system checks if the socket to be closed has been connected (SM1270

= ON); if so, a closing connection request [FIN/ACK] will be sent to the Server and the system is going to close the

connection. If the socket has not been connected, this instruction is NOT executed. After the connection is closed,

you can switch M2 to OFF.

6-787
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 3 (S1 = 1, S3 = 2, TCP communication mode, receiving continuously mode, take ES3 for example here.)

1. This example illustrates how to establish a TCP communication between a PLC (acting as a Server) and a computer

(acting as a Client).

2. You need to activate TCP function on the PLC through a PLC program and enter the state of waiting for connection

and then establish a connection with a PLC by using the software on a computer.

3. ISPSoft → HWCONFIG / DIADesigner→ Hardware Configuration (Ethernet-Basic)


Network Settings
IP address mode Static
IP address 192.168.1.111
Subnet mask 255.255.255.0
Port IP address 192.168.1.1

4. Use the following configurations in SCONF; refer to SCONF for more information.
Parameters in SCONF
Protocol (S1) 0 (TCP)
Number (S2) 1
Remote IP address (S3) 192.168.1.106
Remote communication port (S4) 0 (not specified)
Local communication port (S5) 2020
Device that stores data to be sent (S6) 10000 (D10000)
Specified length of sending data #1 (S7) 4096
Device that stores received data (S8) 15000 (D15000)

_6 Maximum length of received data #1 (S9) 4096


Connection keep-alive time (S10) 30 (sec.)

Note #1: This data length is defined by settings in SCONF instruction.

5. Execute SCONF instruction to set up the parameters when the PLC switches from STOP to RUN.

6-788
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6. Activate a connection: When M0 is ON, the system checks if the socket is closed (SM1274 = ON), and the system

performs the connection procedure if the condition is valid. Once the socket is connected (SM1270 = ON), M0 is

switched to OFF.

7. Open the software in the remote Client to connect with the PLC (IP = 192.168.1.110; communication port 2020),

and send 2000#2 bytes of data.

8. This is a receiving continuously mode. Open the Monitor Table and start monitoring the device (D15000) where the

data length of the received data is stored. You can see if 2000 bytes of data are already received.

#2 Note:

If 2000 bytes of data have been received and you need to start another data transmission, set the value in D15000
6_6
to 0 to start another data transmission.

6-789
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2201 SSEND P S1, S2 Sending data through a socket

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

Data

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol

S1 : Socket protocol

S2 : Socket number

Explanation
1. This instruction is a pulse instruction (SSENDP) here.
2. Before using this instruction, make sure you’ve used SOPENP instruction to open the socket. When the connection
_6 established flag for TCP or communication enabled flag for UDP is ON, you can use this instruction for data
transmission or this instruction will NOT be executed and error code 16#6215 will be stored in SR180.
3. S1: the socket protocol.
Set S1 to 0 to use the UDP socket, and set S1 to 1 to use the TCP socket.
4. S2: the socket number. It should correspond to the Ethernet socket number set in the advanced settings. You can
also set up the corresponding socket numbers through SCONF instruction.

PLC CPU V1.06 or previous versions V1.08 or later versions


ES3 1-2 1-8

PLC CPU V1.00 or later versions


EX3/SV3/SX3 1-8

5. If the setting value of S1 or S2 exceeds the setting range, error code 16#2003 will be stored in SR180.
6. Refer to SOPEN instructions (API 2200) for more descriptions on communication flags and error codes.

6-790
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

2203 SCLOSE P S1, S2 Closing a socket

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2       
DWORD

STRING
LWORD

LREAL
WORD
BOOL

Data

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol

S1 : Socket protocol

S2 : Socket number

Explanation
1. This instruction is a pulse instruction (SCLOSEP) here.
2. Before using this instruction, make sure the socket is connected, or this instruction will NOT be executed and error
code 16#6215 will be stored in SR180.
3. S1: the socket protocol.
Set S1 to 0 to close the UDP socket, and set S1 to 1 to close the TCP socket. 6_6
4. S2: the socket number. It should correspond to the Ethernet socket number set in the advanced settings. You can
also set up the corresponding socket numbers through SCONF instruction.

PLC CPU V1.06 or previous versions V1.08 or later versions


ES3 1-2 1-8

PLC CPU V1.00 or later versions


EX3/SV3/SX3 1-8

5. If the setting value of S1 or S2 exceeds the setting range, error code 16#2003 will be stored in SR180.
6. Refer to SOPEN instructions (API 2200) for more descriptions on communication flags and error codes.

6-791
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2204 MSEND P S1, S2, S3, D Sending an email

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1       
S2    
S3    
D     
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1 : Remote email number

S2 : Email subject

S3 : Email body

D : Completion of the instruction


_6

Explanation

1. This instruction creates and sends an email by setting S1, S2, and S3.

2. Before using the instruction, set the following values in ISPSoft/DIADesigner.

 PLC Parameter Setting → Ethernet-Basic → Setting IP address and netmask address

 PLC Parameter Setting → Ethernet-Advanced → Email → Setting SMTP server, port, local email address,
and SMTP subject

 PLC Parameter Setting → Ethernet-Advanced → Email and Trigger Configuration → Setting email address

 If account identification is required: PLC Parameter Setting → Ethernet-Advanced → Email → Setting user
name and password

6-792
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

3. The email is set as follows.

Operand Description Setting Range

Use Bit 0–bit 3 in ISPSoft/DIADesigner to represent the remote email

addresses. You can set up to four email addresses in

Remote email ISPSoft/DIADesigner. Bit 0 corresponds to email 1, bit 1 corresponds to


S1
number email 2, and so on.

If you want to send an email, you must set the corresponding bit in

ISPSoft/DIADesigner.

S2 Email subject Size of email subject: up to 16 words

S3 Email body Size of email body: up to 64 words

Completion of the After the execution of the instruction is complete, the bit is ON. If the
D
instruction execution of the instruction is abnormal, the next bit (D+1) is ON.

4. In general, the MSENDP pulse instruction is used.

Example

Suppose the value in D0 is 00000101. When M0 is ON, the email is sent to email numbers 1 and 3. After the

communication with the SMTP sever is complete, M20 is ON. If no error occurs during the communication, M21 is OFF

and M50 is ON.

6_6

6-793
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks

1. For the length of the string in S2 or S3, the system captures the data with the end of 16#00. If the length of the string
_6 is larger than the maximum value (with 16#00 as the end), the length of the string in S2 or S3 is processed as the

maximum value.

2. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

3. Reserve one word between S2 and S3 for the interrupt character.

4. The following table explains errors in the execution of the email instruction.

Error Code Error Flag Description

1. D+1 exceeds device range


16#2003 SM0
2. S1<1 or S1>15

16#600D SM1100 Ethernet network not connected

16#6100 D+1 Communication conflicts

16#6107 D+1 Email communication timeout

16#6108 D+1 Error in password authentication of SMTP server account

16#6111 D+1 Invalid remote email address

6-794
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function


Converting an integer IP address into a
2206 INTOA P S, D
string IP address

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
D 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S : Source value

D : Conversion result

Explanation

1. This instruction converts the IP address in S and S+1 into a string IP address, and stores the conversion result in D.

2. The operand D occupies eight consecutive devices.

Example 6_6

D 10 "9 " "1 "


D 11 ". " "2 "
D 12 "6 " "1 "
Afte r th e in struction
D0 16 #C0( 192) 16#A8(16 8) is exe cu ted D1 3 ". " "8 "
D1 " 192.168.0.1"
16#00 ( 0) 16 #01 (1) D 14 "0 " "0 "
D 15 ". " "0 "
D 16 "0 " "0 "
D1 7 16#00 "1 "

Additional remarks

1. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

2. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [8] of WORD/INT.

6-795
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function


Converting a string IP address into an
2207 IATON P S, D
integer IP address

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S   
D  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S : Source value

D : Conversion result

Explanation

1. This instruction converts the string IP address in S into an integer IP address, and stores the conversion result in D

and D+1.
_6
2. The operand S occupies eight consecutive devices.

"192 .16 8. 0.1 "

S+ 0 "9 " "1 "


S+ 1 ". " "2 "
S+2 "6 " "1 " Af ter t he inst ruct ion
S+ 3 "8 " is e xecut ed D +0 16 #C 0(19 2) 16# A8(168 )
". "
S+ 4 "0 " "0 " D+1 1 6# 00 (0) 1 6#0 1 (0 1)
S+ 5 ". " "0 "
S+6 "0 " "0 "
S+ 7 1 6# 00 "1 "

3. There are 1–3 characters in every section of the string IP address in S. These sections are separated by “.” (16#2E).

For example, you can enter “192.168.0.1” instead of “192.168.000.001”.

4. The value of each section of the string IP address in S must be between 0–255.

6-796
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 1

" 19 2. 16 8 .0 .1 "

D10 "9 " "1 "


D 11 "2 "
". "
D 12 "6 " "1 "
Aft er t he instructio n
D1 3 ". " "8 " is e xe cute d D0 1 6# C 0(1 92 ) 16 #A 8(16 8 )
D14 D1 1 6 #0 0 (0 ) 16 #0 1 (1 )
"0 " "0 "
D15 ". " "0 "
D 16 "0 " " 0"
D1 7 1 6# 00 " 1"

Example 2

Af ter t he instruct ion


is e xecut ed
D0 1 6 #C0 (1 92 ) 16 #A 8(1 68 )
"1 92 .16 8.0 .1"
D1 16 #0 0( 0) 1 6# 01( 1) 6_6
Additional remarks

1. If the string in S does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E.

2. In the string in S, except for the code representing the decimal point, the binary codes must be between

16#30–16#39 or the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.

3. If there are not three decimal points “.” in the string in S, the instruction is not executed, SM0 is ON, and the error

code in SR0 is 16#2003.

4. If the value of any section of the string IP address in S is not between 0–255, the instruction is not executed, SM0 is

ON, and the error code in SR0 is 16#2003.

5. The number of characters in any section of the string IP address in S must be between 1–3 or the instruction is not

executed, SM0 is ON, and the error code in SR0 is 16#2003.

6. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [8] of WORD/INT.

7. If you declare the operand D in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD/INT.

6-797
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2208 EIPRW S1-S7, n, S, D1, D2 Reading and writing EtherNet/IP data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1  
S2    
S3    
S4    
S5    
S6    
S7    
n    
S 
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1-D2 Refer to Explanation in the instruction.

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
Symbol
S1-S7, n, S : See Explanation below.

_6 D1-D2 : See Explanation below.

6-798
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Explanation
1. This instruction reads and writes EtherNet/IP data. The following table lists the names and explanations of S1–S7, n,

S and D1–D2.

Operand Name Description Data Type Remarks

The first two sections of the IP address

occupy the first word and the remaining Occupies

two sections of the IP address occupy the two


S1 IP address WORD[2]
second word. For example, if the IP consecutive

address is 192.168.1.5, S1=16#C0A8 and words

S1+1=16#0105.

S2 Connection mode 0: UCMM WORD

Range: 16#0000–00FF. If the function


Function code
S3 code exceeds the range, the instruction is WORD
(Service code)
not executed.

S4 Class ID Refer to EtherNet/IP protocol. WORD

S5 Instance ID Refer to EtherNet/IP protocol. WORD

ON: Enable;
S6 Attribute ID switch BOOL
OFF: Disable
6_6
S7 Attribute ID Refer to EtherNet/IP protocol. WORD

Length of read and write Size of the data to be written or read;


n WORD
data unit: byte; maximum: 200 bytes

Register for the Source register for the sent data or where
S WORD[n]
read/write data the received data is stored

0: Communication not triggered

1: Communication in process

2: Communication completed without


D1 Communication status WORD
errors

3: Communication error

4: Error in parameter setting

Occupies

two
D2 Error code Major error code and extended error code WORD[2]
consecutive

words

6-799
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

2. When you enable this instruction for the first time, it sends the communication command. If the number of

connected slaves reaches the upper limit, the communication status value in D1 is 3, and the communication

command is not sent. The error code shows16#6306 in D2[1].

3. When the parameter exceeds the range, the instruction is not executed and the communication status value in D1 is

4.

4. This instruction should work with rising-edge trigger. If it is repeatedly triggered, the error code shows16#02 in D2[0].

Wait till the execution of the instruction is complete before starting another instruction.

Example 1

The instruction reads the vendor code of the device at 192.168.1.5 and stores the value in D100. It sets the EtherNet/IP

Object parameters as shown below.

(1) Class ID = 1

(2) Instance ID = 1

(3) Attribute ID = 1

_6

6-800
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Example 2

The maximum frequency (01-00) of the AC motor drive (at 192.168.1.6) is set to 60.00Hz. The EtherNet/IP Object

parameters are set as shown below.

(1) Class ID = 16#0300

(2) Instance ID = 16#0001

(3) Attribute ID = 16#0000

6_6

Additional remarks

1. If you declare the operand S1 in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD.

2. If you declare the operand S in ISPSoft/DIADesigner, the data type is ARRAY [n] of WORD, where n is the size of

the read/written data.

3. If you declare the operand D2 in ISPSoft/DIADesigner, the data type is ARRAY [2] of WORD.

6-801
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. The following table explains the major error codes in D2 [0].

Error Code Description Solution

16#00 Connection successful

16#01 Connection error Ensure the EDS file of the slave is correct.

1. Ensure the number of devices connected to the master does not

exceed the limit.

Connected devices 2. Ensure the number of devices connected to the slave does not
16#02
unavailable exceed the limit.

3. The instruction is triggered repeatedly. Wait till the execution of

the instruction is complete before starting another instruction.

16#03 Error in parameter Ensure the read/written data in S is correct.

Ensure the settings are correct for Class ID (S4), Instance ID (S5),
16#04 Path error
and Attribute ID (S7).

Destination path does not Ensure the settings are correct for Class ID (S4), Instance ID (S5),
16#05
exist and Attribute ID (S7).

1. Ensure the Ethernet port of the slave device is connected

properly.
16#07 Connection broken
2. Ensure the keep alive timer setting is correct for the slave
_6 device.

Service code not


16#08 Ensure the function code (S3) is correct.
supported

Ensure both the registers involved in reading/writing data and their


16#09 Invalid attribute value
contents are correct.

Ensure the slave device object attribute allows PLC to perform the
16#0A Error in attribute list
Get_Attribute_List and Set_Attribute_List functions.

16#0B Transmission conflicts Ensure the service setting is repeated.

16#0C Object status conflicts Ensure the Owner IO connection is established.

Ensure the slave supports the defined object. The service does not
16#0D Object existed
need to execute if the defined object is supported.

16#0E Attribute not writable Ensure the object attribute supports the write function.

No privilege to perform
16#0F Ensure the slave device is allowed to perform the service code.
service code

6-802
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Error Code Description Solution

Device cannot currently


16#10 Ensure the Owner IO connection is established.
perform service

Size of response data too Ensure the length of data in the object attribute does not exceed the
16#11
large limit (100 words).

Data access sequence

16#12 error when tag is Ensure the data length and the data type are correct.

accessed

16#13 Transmitted data too short Ensure the length (n) of read/written data is correct.

Attribute value
16#14 Ensure the Attribute ID switch (S6) and Attribute ID (S7) are correct.
unsupported

Transmitted data are too


16#15 Ensure the read/written data length (n) is correct.
long

16#16 Object does not exist Ensure the Class ID (S4) is correct.

Data access sequence


1. Ensure the Ethernet network connection is correct.
16#17 error when tag is
2. Ensure no packets are lost in the Ethernet communication.
accessed

16#18 Attribute value not stored Ensure no slave device state error is occurring.

Attribute value storage 6_6


16#19 Ensure no slave device hardware error is occurring.
error

Router error: length of


Ensure the read/written data length (n) does not exceed the limit of
16#1A request packet exceeds
the router.
limit

Router error: length of


Ensure the read/written data length (n) does not exceed the limit of
16#1B response packet exceeds
the router.
limit

User-defined object
16#1F Refer to the definition of the slave device error.
access error

16#20 Illegal parameter value Ensure the read/written value in S is correct.

6-803
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. The following table explains the extended error codes in D2 [0].

Error Code Error Flag Description

1. Value in S1, S2, S3, or S6 exceeds the range


16#2003 SM0 / D1
2. S+n out of range of the device address

16#200B SM0 Operand n out of range

16#600D SM1100 Ethernet network not connected

16#6301 D1 Connection with remote device broken

16#6302 D1 Remote device response timeout

16#6303 D1 Illegal IP address

16#6304 D1 Error in response command service code

16#6305 D1 Error in response command length

16#6306 D1 Communication conflicts

_6

6-804
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

2209 SCONF P S1-S10 Setting the TCP/UDP Socket parameters

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
S5    
S6    
S7    
S8    
S9    
S10    
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1-S10 Refer to Explanation in the instruction.

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol
S1-S10 : See Explanation below

6_6

Explanation

1. This instruction sets the TCP/UDP Socket parameters. The following table lists the names and explanations of

S1–S10.

Operand Name Description Data Type Remarks

S1 TCP/UDP selection 0: TCP, 1: UDP WORD

6-805
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Operand Name Description Data Type Remarks

Setting range:

S2 Socket number EX3/SV3/SX3:1-8 WORD


ES3: FW V1.06 or previous versions: 1-2;
FW V1.08 or later versions: 1-8
The first two sections of the IP address occupy
Occupies
the first word and the remaining two sections of
two
S3 Remote IP address the IP address occupy the second word. For WORD[2]
consecutive
example, if the IP address is 192.168.1.5,
words
S3=16#C0A8 and S3+1=16#0105.

S4 Remote port Range: 0–65535; 0 indicates any port WORD

S5 Local port Range: 0–65535; 0 indicates any port WORD

Specifies the number of a D device. Range:

0–29999. Example: The setting value 100 means


Register where sent
S6 S7 bytes of data are sent from the registers WORD
data comes from
starting at D100 (from the low byte to the high

byte).

S7 Size of sent data Maximum: 4096 bytes WORD

Specifies the number of a D device. Range:

0–29999. Example: The setting value 200 means


_6 Register where
S8 S9 bytes of data are received and stored in the WORD
received data is stored
registers starting at D200 (from the low byte to

the high byte).

S9 Size of received data Maximum: 4096 bytes WORD

Applicable
Range: 1–30000, unit: second
S10 Connection time WORD to TCP
(0 indicates not to disconnect proactively.)
mode only

2. In general, the SCONFP pulse instruction is used.

3. The Socket parameters uses the setting values in HWCONFIG by default. Use the SCONFP instruction when the

parameters need to be changed during communication.

4. If you set the parameters while the socket is communicating, the settings do not take effect until the communication

is complete. The setting should be changed after the socket is no longer in use.

5. The communication status of TCP Socket #6 and RTU-EN01 use the same flag for indication. If RTU-EN01 is used

as a remote module, it is suggested NOT to use TCP Socket #6 at the same time.

6. If any one of the parameters is out of range, the instruction is not executed, SM0 is ON, and the error code in SR0 is

16#2003.

6-806
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

2210 MCONF P S1-S11 Reading/Writing Modbus TCP data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2  
S3    
S4    
S5    
S6    
S7  
S8    
S9    
S10    
S11  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1-S11 Refer to Explanation in the instruction.

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -
Symbol
S1-S11 : See Explanation below

6_6

6-807
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. This instruction reads and writes Modbus TCP data. The following table lists the names and explanations of S1–S11.

Operand Name Description Data Type Remarks

Modbus TCP data exchange table


S1 Data Exchange Table No. WORD
number, range: 1–32

The first two sections of the IP address

occupy the first word and the


Occupies
remaining two sections of the IP
two
S2 Remote IP address address occupy the second word. For WORD[2]
consecutive
example, if the IP address is
words
192.168.1.5, S2=16#C0A8 and

S2+1=16#0105.

Range: 0–255. If the setting exceeds


Station address of remote
S3 the range, the value in the low byte is WORD
slave
used automatically.

Range: 16#01, 02, 03, 04, and 17.

If the function code is out of range,


S4 Read function code incoming parameters, including WORD

address and data length, are not


_6
modified.

Read remote communication


S5 16#0000–16#FFFF WORD
address

Function code 16#01, 02 for reading

Bit device, ranging from 1 to 256 for

ES3 FW V1.06 or previous versions;

ranging from 1 to 1600 for ES3 FW

V1.08 or later and EX3/SV3/SX3 FW

V1.00.00 or later.

S6 Read data length Function code 16#03, 04 for reading WORD

Word device, ranging from 1 to 100

When the setting value is 0 or less

than 0, this function is not enabled. If

the setting value is bigger than the

maximum value, it will be seen as the

maximum value.

6-808
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Operand Name Description Data Type Remarks

Function code for reading data in Bit

Local register where device; M device only BOOL


S7
received data is stored Function code for reading data in Word WORD

device; D device only

Range: 16#05, 06, 0F, and 10.

If the function code is out of range,


S8 Write function code outgoing parameters, including WORD

address and data length, are not

modified.

Write remote communication


S9 Range:16#0000–16#FFFF WORD
address

Function code 16#0F for writing Bit

device, ranging from 1 to 256 for ES3

FW V1.06 or previous versions;

ranging from 1 to 1600 for ES3 FW

V1.08 or later and EX3/SV3/SX3 FW

V1.00.00 or later; the value in function

code 16#05 can only be 1 or 0.

S10 Write data length


Function code 16#10 for writing Word
WORD
6_6
device, ranging from 1 to 100; the

value in function code 16#06 can only

be 1 or 0.

When the setting value is 0 or less

than 0, this function is not enabled. If

the setting value is bigger than the

maximum value, it will be seen as the

maximum value.

Function code for writing data in Bit

Local register where remote device; M device only BOOL


S11
data is written Function code for writing data in Word WORD

device; D device only

2. In general, use the MCONFP pulse instruction.

3. The following points explain the Modbus communication function codes in S4 and S8.

6-809
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

When the ES3/EX3/SV3/SX3 Series PLC reads the data from multiple bit devices (not discrete input devices), the

function code sent is 1 (16#01).

When ES3/EX3/SV3/SX3 Series PLC reads the data from multiple bit devices (only discrete input devices), the

function code sent is 2 (16#02).

When the ES3/EX3/SV3/SX3 Series PLC reads the data from multiple word devices (not input registers), the

function code sent is 3 (16#03).

When the ES3/EX3/SV3/SX3 Series PLC reads the data from multiple word devices (only input registers), the

function code sent is 4 (16#04).

When the ES3/EX3/SV3/SX3 Series PLC writes the status to one bit device, the function code sent is 5 (16#05).

When the ES3/EX3/SV3/SX3 Series PLC writes the data to one word device, the function code sent is 6 (16#06).

When the ES3/EX3/SV3/SX3 Series PLC writes the status to multiple bit devices, the function code sent is 15

(16#0F).

When the ES3/EX3/SV3/SX3 Series PLC writes the data to multiple word devices, the function code sent is 16

(16#10).

When the ES3/EX3/SV3/SX3 Series PLC writes the data to multiple word devices, the function code sent is 23

(16#17).

_6 At present, the ES3/EX3/SV3/SX3 Series PLC only supports the function codes listed above.

4. The parameters in the instruction are valid only while PLC is running. When PLC is powered back on after being

powered off, it takes the settings from the data exchange table by default. If you need to change some parameters

during data exchange, this instruction modifies those parameters.

5. If the specified socket is already communicating, the new parameters become effective after the current

communication is complete.

6. When any parameter is not within the valid range, the instruction is not executed, SM0 is ON, and the error code in

SR0 is 16#200B.

7. The ES3/EX3 Series PLC does not support the Modbus TCP communication instruction or anything similar to the

instruction ETHRW DVP series PLC. If you use the PLC program for Ethernet Modbus TCP communication control,

enable “Program control” mode in the data exchange table first and use the SM numbers from the following table.

SM Number Attribute Explanation of Ethernet Data Exchange Parameters

SM1167 R/W Flag to enable data exchange

SM1168–SM1199 R/W Flag to enable data exchange connections 1–32

6-810
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

SM Number Attribute Explanation of Ethernet Data Exchange Parameters

SM1200–SM1231 R Success flag for data exchange connections 1–32

SM1232–SM1263 R Error flag for data exchange connections 1–32

When data is received successfully, the success flag is ON. When there is an error receiving data, the error flag is

ON. The success flag and the error flag of any one connection socket are never switched to ON at the same time.

8. The following table explains the (read-only) SR numbers used in data exchange.

SR Number Explanation

SR1120–SR1151 Indicates the actual communication times for connections 1–32.

SR1152–SR1183 Indicate the communication error codes for connections 1–32.

The following table defines the error codes in SR1152–SR1183.

Error Code Explanation

16#00XX Remote device response error

16#F000 Ethernet network not connected

16#F001 Remote device response timeout

16#F003 TCP connection timeout

16#F007 Response command error

16#F009 Connection with remote device disconnected 6_6

6 - 8 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


2211 EMCONF1 P Server ~ Passw Setting email server parameter values

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Server   
Port    
LMail   
Sub   
Verify    
User   
Passw   
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

Refer to following instruction explanation

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

Server~Passw : Refer to following explanation

_6

6-812
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

Explanation

1. See the operand name, use explanation and data type in the following table.

Operand Name Explanation Data type Remark


Server +0: Data length, unit: bytes (0 or 4;

0: no modification)
Refer to Server
Server +1~ Server +2: data (Data are +0 for address
occupation.
placed from the lower 8 bits.) WORD[N]
3 consecutive
For example: 192.168.0.1,
words at most
Server Email server D0 = 16#0004, D1= 16#0001, D2= can be occupied.

16#C0A8;

Up to 15 words can be used in one string;

every section in one string can contain 1-3


String
words, and use a dot “.” to separate each

string, for example 192.168.0.1

Communication Range: 1~65535,


Port WORD
port 0: no modification

LMail +0: data length, unit: bytes (range:

0~63, 0: no modification.)

LMail +1~ LMail +32: data (Data are


Refer to LMail
placed from the lower 8 bits.)
+0 for address
For example: [email protected] WORD[N] occupation. 6_6
Local email
LMail 33 consecutive
address D0 = 16#000E, D1 = 16#7865, words at most
can be occupied.
D2 = 16#6440, D3 = 16#6C65,

D4 = 16#6174, D5 = 16#7777,

D6 = 16#632E, D7 = 16#6D6F

Up to 63 words can be used in one string String

Sub +0: data length, unit: bytes (range:

0~31, 0: no modification.)
Refer to Sub +0
Sub +1~ Sub +16: data content (Data are
for address
placed from the lower 8 bits.) WORD[N] occupation.
Sub Email subject 17 consecutive
For example: Sub words at most
can be occupied.
0 = 16#0003, D1 = 16#7553,

D2 = 16#0062

Up to 31 words can be used in one string String

Enable/ disable 0: no modification, 1: Disable verification,


Verify WORD
verification 2: Enable verification

6-813
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Operand Name Explanation Data type Remark


User +0: data length, unit: bytes (range:

0~31, 0: no modification.)
Refer to User +0
User +1~ User +16: data content (Data are
for address
placed from the lower 8 bits.) WORD[N] occupation.
User User name 17 consecutive
For example: User words at most
can be occupied.
D0 = 16#0004, D1 = 16#7355,

D2 = 16#7265

Up to 31 words can be used in one string String

Passw +0: data length, unit: bytes (range:

0~20, 0: no modification.)
Refer to Passw
Passw +1~ Passw +10: data content (Data +0 for address
occupation.
are placed from the lower 8 bits.) WORD[N]
Passw Password 11 consecutive
For example: Passw
words at most
D0 = 16#0005, D1 = 16#5061, can be occupied.

D2 = 16#7373, D3 = 16#0077

Up to 20 words can be used in one string String

You can set up the email server related settings in ISPSoft > HWCONFIG > Setting > Options > Email. And from

here you can also check the parameters which are set through instrucitons. But only the settings that are set in

_6 ISPSoft are retainable after power-off.

6-814
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description


2212 EMCONF2 P Index, Mail Setting email address

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Index    
Mail   
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

Refer to following instruction explanation

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

Index, Mail : Refer to following explanation

Explanation

1. See the operand name, use explanation and data type in the following table.

Operand Name Explanation Data type Remark 6_6


Index: The mail address number to be
Mail address
Index modified (Range: 0~4, 0: Not modify the WORD
number
mail address.)

Mail +0: the data length of Index value with

the unit of bytes (range: 0~63, 0: Not

modify the mail address.)

Mail +1~ Mail +32: The data content of


Refer to Mail +0
Index (Data are placed from the lower 8
for address
bits.) WORD[N] occupation.
Mail Mail address 33 consecutive
For example: [email protected] words at most
can be occupied.
D0 = 16#000E, D1 = 16#7865,

D2 = 16#6440, D3 = 16#6C65,

D4 = 16#6174, D5 = 16#7777,

D6 = 16#632E, D7 = 16#6D6F

Up to 63 words can be used in one string String

6-815
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

You can set up the email server related settings in ISPSoft > HWCONFIG > Setting > Options > Email. And from

here you can also check the parameters which are set through instrucitons. But only the settings that are set in

ISPSoft are retainable after power-off.

_6

6-816
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction Operand Description

2213 ETHRW S1,S2,D,n Ethernet communication

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2    
D 
n   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1   
S2   
D   
n   

Pulse Instruction 16-bit instruction 32-bit instruction


- SV3/SX3 -

Symbol
IP address, communication port number,
S1 :
and read/write mode
S2 : Device address
Start device for storing source/destination
D :
data
n : Data length
6_6

Explanation

1. This instruction is available for SV3/SX3 series PLC only.

2. S1: Ethernet IP address, communication port number, and read/write mode.

The operand S1 occupies five consecutive data (D) registers. The functions are as follows.

Operand Name Explanation

IP addressIP3.IP2.IP1.IP0192.168.0.2

If S1 is D100, the values in D100 and D101 are 16#0002 and 16#C0A8
respectively.

D100(S1+0) D101(S1+1)
S1, S1+1 IP address
High Low High Low

IP1 IP0 IP3 IP2

0 2 192 168

16#0002 16#C0A8

6-817
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Operand Name Explanation

The number of the Ethernet port built in SV3/SX3 is K108.

The communication ports on the left-side Ethernet modules connected


Communicatio
S1+2 to a CPU module are numbered according to their distances from the
n port number
CPU module. The one closest to the CPU is the first unit. The numbers

start from K100 (1st unit) to K107 (8th unit).

Station
S1+3 The station address of a slave
address

Read/Write The definition is the same as Modbus. The function codes supported
S1+4
mode are 16#01, 16#02, 16#03, 16#04, 16#05, 16#06, 16#0F and 16#10.

3. S2: Device address

The definition is the same as Modbus.

4. The operand D specifies the start device for the source data or destination data. If the operand D specifies D100,

and two pieces of communication data are read by means of the function code H’03, the communication data will be

stored in D100 and D101.

5. When the function code is H’05, the value 0 in D is for the Reset bit function and any other value in D is for the Set

bit function.

6. n: Length of data

The setting range is K1-K96 if the unit is “word”, and the range is K1-K256 if “bit” is take as the unit. If n exceeds the

range, the instruction will be executed with the maximum value or the minimum value.
_6
7. Whenever the instruction is executed, the communication command sending is started. You do not need to enable a

special flag to start sending the communication command.

8. There is no limitation to the number of times this instruction is used. However, if an ETHRW instruction specifies a

module, other ETHRW instructions cannot send any communication commands to the module. The next

communication command cannot be sent until the reception is complete or the module replies that an error occurs.

9. If a communication command is being received, the reception stops when the instruction is forced to stop, but

reception-completed and error flags are not ON.

10. The communication timeout is stored in SR1593. The default timeout is 3000 milliseconds. The setting range is

1-32767. If the communication timeout exceeds the range, the instruction takes the default 3000 milliseconds as the

timeout.

11. SR1594 is the flag for storing the reception-completed state. The values of bit0-bit8 in SR1594 indicate which

module’s port has received a command. Bit 0-bit 7 stand for the 1st to 8th modules on the left-side of the CPU. Bit8

represents the Ethernet port built in the CPU module.

12. SR1595 is the flag for storing the reception error state. The values of bit0-bit8 in SR1595 indicate which module

does not receive a command correctly. For example, if a reception error occurs in the first left-side module

DVP-EN01, bit0 is set to 1.

6-818
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

13. When the instruction is executed, using the online editing function is not allowed. Otherwise, the data received

might not be stored correctly.

Example (Using SV3’s built-in Ethernet port for transmission and reception.)

In the devices, D100 to D104 are the IP address 192.168.0.2, the communication port number K100, the station address

K1, and the function code H03. The device address is H1000, and two pieces of data are to be read. When M0 is ON,

ETHRW is executed to send the read command. After receiving the communication command is complete, bit8 in SR1594

is ON, and the data received are stored in D110 and D111.

6_6

6-819
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.23 Memory Card / File Register Instructions


6.23.1 List of Memory Card / File Register Instructions
The following table lists the Memory Card / File Register instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

2300 MWRIT –  Writing data from the PLC into the memory card

2301 MREAD –  Reading data from the memory card into the PLC

2302 MTWRIT –  Writing a string into the memory card

2303 MEMW –  Writing data into the file register

2304 MDEL –  Deleting files on the memory card

_6

6-820
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.23.2 Explanation of Memory Card / File Register Instructions

API Instruction code Operand Function

2300 MWRIT P C, S, S1, S2, S3, S4 Writing data from the PLC into the memory card

Device X Y M S T C HC D FR SM SR E K 16# “$” F


C    
S  
S1    
S2    
S3   
S4    
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

C 
S 
S1 
S2 
S3 
S4 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol 6_
C : Control parameter

S : Data source

S1 : Data length

S2 : Line advance

S3 : File name

S4 : Data address in the file

Explanation

1. This instruction writes data from the PLC to the memory card. The operands are described as follows.

 C: The control parameter

6-821
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Item Code Description

Binary value

Default value
0
The file name extension is .dmd.

The unit of the value is a word.

The values are separated by a comma.

The unit of the value is a word.

1 The file name extension is .cvs.

Use ASCII codes..

The value that is stored is a hexadecimal format.

The values are separated by a comma.

The unit of the value is a double word.

2 The file name extension is .cvs.

Use ASCII codes.

The value that is stored is a hexadecimal format.

The values are separated by a tab.


File format
The unit of the value is a word.
_6
3 The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal format.

The values are separated by a tab.

The unit of the value is a double word.

4 The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal format.

The values are not separated by any mark.

The unit of the value is a word.

5 The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal format.

6 The values are not separated by any mark.

6-822
C ha pt er 6 A p pl i e d In s tr uc t io ns

Item Code Description

The unit of the value is a double word.

The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal format.

The values are separated by a comma.

The unit of the value is a Word.

7 The file name extension is.csv.

Use ASCII codes.

The value that is stored is a decimal format.

Appending

The data that is written into the memory card is appended after the last

0 value in the file.

This is the default value

Function option If the file does not exist, it is created automatically.

Overwriting

The data that is written into the memory card replaces the values in the file
1
starting from the value indicated by the value in S4. 6_
If the file does not exist, it is created automatically.

Reserved - The values of bit 8–bit 15 are 0.

 S: The data source

 S1: The length of the data that the instruction writes into the file

If the value in S1 is 0, the instruction does not write any data into the file.

Item Description

If the file format is 0, 1, 3, 5, or 7, the unit of the value is a word. If the file format is
Value unit
2, 4, or 6, the unit of the value is a double word.

Parameter unit Double word

The devices where the instruction stores the data cannot exceed the device

Length of the data range, and the size of the data that the instruction writes into the file cannot be

more than four gigabytes. Refer to Chapter 2 for more information about devices.

6-823
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 S2: The line advance; the value in S2 must be between 0–256.

 Using strings is allowed in the file name S3. ES3/EX3 FW V1.02.00 or previous versions support up to 9

characters. ES3/EX3 FW V1.04.00 or later and SV3/SX3 FW V1.00.00 or later support up to 199 characters.

 S3: S3 occupies consecutive devices. Up to 200 characters can be set in the file name and the ending

character 16#00 is also counted. If the string does not end with 16#00, an error occurs. When the instruction

reads the ending character, it stops reading, and checks if the file name is legal. The characters in the file

name can be A–Z, a–z, and 0–9. The file name extension depends on the file format. The file that the

instruction creates is in the default folder. If the file name is “Test1”, the instruction writes the characters into

the devices as follows.

 The default folder path:

Model name Folder path

ES3 Series PLC CARD\ES3\UserProg

EX3 Series SDCard\PLC CARD\EX3\UserProg

_6 SV3 Series SDCard\PLC CARD\SV3\UserProg

SX3 Series SDCard\PLC CARD\SX3\UserProg

 S4: The value in the file that the instruction overwrites is indicated by the value in S4.

Item Description

If the file format is 0, 1, 3, 5 or 7, the unit of the value is a word. If the file format is 2, 4, or
Value unit
6, the unit of the value is a double word.

Parameter unit Double word.

If the function option is 0, S4 is not used.

If the function option is 1, the instruction replaces the values in the file with the data to be

written into the memory card starting from the value indicated by the value in S4.
Usage
The value in S4 must indicate a value in the file.

If the value in S4 is 0, the instruction overwrites the data in the file starting at the first

value in the file.

6-824
C ha pt er 6 A p pl i e d In s tr uc t io ns

2. Instruction flags:

Flag Description

SM450 ON: the memory card is in the CPU module.

State of the write protection switch on the memory card

SM451 ON: the memory card is write protected.

OFF: the memory card is not write protected.

The data is being written from the PLC to the memory card, or the data is being read
SM452
from the memory card to the PLC.

ON: an error occurs during the operation of the memory card. If the flag is ON, you must
SM453
reset it to OFF. The error code is stored in SR453.

3. Related error codes (SR453):

Error code Description

16#005E An error occurs when the memory card is initialized.

16#005F The path is incorrect, or the file does not exist.

16#0060 The default folder cannot be created.

16#0061 The memory space is insufficient.


6_
16#0062 The memory card is write protected.

16#0063 An error occurs when the data is written into the file.

16#0064 The data cannot be read from the memory card.

16#0065 The file is a read-only file.

4. If the format of the target file on the memory card is 0, the format of the source file in the PLC must also be 0.

Otherwise, the instruction cannot read the data, and SM453 is ON. The same applies to the other file formats.

Example

SM450 is ON when you insert the memory card into the CPU module; SM452 is ON when the MWRIT instruction

executes; SM452 is OFF when the MWRIT instruction completes. You cannot use MWRITP (the pulse instruction)

continuously. Executing this pulse instruction to write data into the memory card continuously may exceed the writing

limitation and may lead to memory card damage.

6-825
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Operand Setting value Description

The file into which the data is written

The file format:

The values are separated by a comma.


D0 16#0011
The unit of the value is a word.

The file name extension is .cvs.

Use ASCII codes.

D1 - The data that is written into the file

D10, D11 16#00000030 The size of the data that is written into the file is 48 words.

D300 16#000A Ten values are written into every line.

D20=16#6554

D20 D21=16#7473 The file name is “Test1”.


_6
D22=16#0031

The data that is written into the memory card replaces the values in the file
D30, D31 16#00000000
starting from the first value.

Additional remarks

1. If the value in C exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. If the value in S1 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

3. If the value in S2 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

4. If the value in S3 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

6-826
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function


Reading data from the memory card into
2301 MREAD P C, S, S1, S2, S3, D
the PLC

Device X Y M S T C HC D FR SM SR E K 16# “$” F


C    
S   
S1    
S2    
S3    
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

C 
S 
S1 
S2 
S3 
D 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

C : Control parameter
6_
S : File name

S1 : Data address in the file

S2 : Reserved

S3 : Data length

D : Data destination

Explanation

1. This instruction reads data from the memory card into the PLC. The operands are described as follows.

 C: The control parameter

6-827
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Item Code Description

Binary value

The default value is 0.


0
The file name extension is .dmd.

The unit of the value is a word.

The values are separated by a comma.

The unit of the value is a word.

1 The file name extension is .cvs.

Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are separated by a comma.

The unit of the value is a double word.

2 The file name extension is .cvs.

Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are separated by a tab.

File format The unit of the value is a word.

3 The file name extension is .txt.


_6
Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are separated by a tab.

The unit of the value is a double word.

4 The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are not separated by any mark.

The unit of the value is a word.

5 The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are not separated by any mark.


6
The unit of the value is a double word.

6-828
C ha pt er 6 A p pl i e d In s tr uc t io ns

Item Code Description

The file name extension is .txt.

Use ASCII codes.

The value that is stored is a hexadecimal value.

The values are separated by a comma.

The unit of the value is a Word.

7 The file name extension is.csv.

Use ASCII codes.

The value that is stored is a decimal format.

Read data (default: 0)


0
The values in the file starting from the value indicated by the value in S1 are read.

Read data length in the file and the values is stored in D and D+1.
Function option
Only data length will be read, not the contents.
1
If the file format is 0, 1, 3, or 5, the unit of the value is a word. If the file format is 2, 4,

or 6, the unit of the value is a double word.

others Seen as 0

Reserved - Seen as 0

 Using strings is allowed in the file name S. ES3/EX3 FW V1.02.00 or previous versions support up to 9 6_
characters. ES3/EX3 FW V1.04.00 or later and SV3/SX3 FW V1.00.00 or later support up to 199 characters.

 S: S occupies consecutive devices. Up to 200 characters can be set in the file name and the ending character

16#00 is also counted. If the string does not end with 16#00, an error occurs. When the instruction reads

the ending character, the instruction stops reading characters, and checks if the file name is legal. The

characters in a file name can be A–Z, a–z, and 0–9. The file name extension depends on the file format.

The file that the instruction creates is in the default folder. If the file name is “Test1”, the instruction writes

the characters into the devices as follows.

 The default folder path:

Model name Folder path

ES3 Series PLC CARD\ES3\UserProg

6-829
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Model name Folder path

EX3 Series PLC CARD\EX3\UserProg

SV3 Series PLC CARD\SV3\UserProg

SX3 Series PLC CARD\SX3\UserProg

 S1: The value in the file that the instruction reads is indicated by the value in S1.

Item Description

Refer to operand C for its file format. If the file format is 0, 1, 3, 5 or 7, the unit of

Value unit the value is a word. If the file format is 2, 4, or 6, the unit of the value is a double

word.

Parameter unit The parameter unit is a double word.

The value in S1 must indicate a value in the file.


Usage
If the value in S1 is 0, the instruction reads from the first value in the file.

 S3: The length of the data that the instruction reads from the file

The devices in which the instruction stores the data cannot exceed the device range. If the value in S3 is

larger than the number of values in the file, the length of the data read from the file is the number of values

in the file. The unit S3 is a double word.

 D: The initial device where the data is stored.


_6
2. Instruction flags:

Flag Description

SM450 ON: the memory card is in the CPU module

The write protection switch on the memory card

SM451 ON: the memory card is write protected.

OFF: the memory card is not write protected.

The data is being written from the PLC to the memory card, or the data is being read from the
SM452
memory card into the PLC.

ON: an error occurs during the operation of the memory card. If the flag is ON, you must reset it
SM453
to OFF. The error code is stored in SR453.

3. Related error codes (SR453):

Error code Description

16#005E An error occurs when the memory card is initialized.

6-830
C ha pt er 6 A p pl i e d In s tr uc t io ns

Error code Description

16#005F The path is incorrect, or the file does not exist.

16#0060 The default folder cannot be created.

16#0061 The memory space is insufficient.

16#0062 The memory card is write protected.

16#0063 An error occurs when the data is written into the file.

16#0064 The data cannot be read from the memory card.

4. If the format of the target file into which the instruction writes data is 0, the format of the file from which the

instruction reads data must also be 0. Otherwise, the instruction cannot read the data, and SM453 is ON. The same

applies to the other file formats.

Example

SM450 is ON when the memory card is inserted into the CPU module; SM452 is ON when the MREAD instruction

executes; SM452 is OFF when the MREAD instruction completes.

6_

When M0 is ON, ES3 PLC CPU reads data from the SD card and stores the data in D20.

Operand Setting value Description

Read data from SD card.

The file format:

The values are separated by a comma.


D0 16#0001
The unit of the value is a word.

The file name extension is .csv.

Use ASCII codes.

D300=16#6554

D300 D301=16#7473 The file name is “Test1”.

D302=16#0031

D10, D11 16#00000000 The values in the file starting from the first value are read.

D1 16#000A Ten values are read from every line.

6-831
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Operand Setting value Description

D30, D31 16#00000020 The size of the data that is read from the file is 32 words.

D20 - The data that is read is stored in D20.

When M0 is ON and D0 is 16#0011, ES3 PLC CPU reads the data length in the SD card and stores the value of

data length in D20.

Operand Setting value Description

Read data length in the file and the values is stored in D and D+1.
D0 16#0011
Only data length will be read, not the contents.

D20 - The data that is read is stored in D20.

Additional remarks

1. If the value in C exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. If the value in S2 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the
error code in SR0 is 16#2003.

3. If the value in S3 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the
_6 error code in SR0 is 16#2003.

4. If the value in D exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

6-832
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2302 MTWRIT P C, S, S1, S2, S3 Writing a string into the memory card

Device X Y M S T C HC D FR SM SR E K 16# “$” F


C    
S  
S1    
S2    
S3   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

C 
S 
S1 
S2 
S3 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

C : Control parameter

S : Data source 6_
S1 : Data length

S2 : Separation mark

S3 : File name

Explanation

1. This instruction writes a string into the memory card. The operands are described as follows.

 C: The control parameter

Parameter
Description
value

If the file exists, the data that is written into the memory card is appended after the last byte
0
in the file.
(Appending)
If the file does not exist, it is created automatically.

6-833
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Parameter
Description
value

If the file exists, the new data that is written to the memory card replaces the old data in the
1
file. The size of the file is the size of the new data.
(Overwriting)
If the file does not exist, it is created automatically.

 S: The data source

If the string that the instruction writes into the file is “12345”, the instruction stores the characters in the

devices as follows. The basic unit is a byte, and so the instruction stores the first character in the low byte

in D300. The instruction stores the second character in the high byte in D300. The same applies to other

characters. The instruction stores “16#00” in the high byte in D300+2, and indicates the end of the string.

S300 S300+1 S300+2


byte 2 byte 1 byte 4 byte 3 byte 6 byte 5
16#32 16#31 16#34 16#33 16#00 16#35
 S1: The length of the data that is written into the memory card.

The basic unit is a byte. The devices where the instruction stores the data cannot exceed the device

range, and the length of the data that the instruction writes into the memory card cannot be more than 255

bytes.

 S2: The separation mark

_6
If the value in S1 is N, the instruction writes the value in S2 into the memory card as follows.

S2Operand
Description
High byte Low byte

16#00 or not
16#00 The N-byte data is written into the file.
16#00

The N+1-byte data is written into the file. The value in the high byte in S2 is the
Not 16#00 16#00
value in the N+1st byte.

The N+2-byte data is written into the file. The value in the high byte in S2 is the

Not 16#00 Not 16#00 value in the seventh byte, and the value in low byte in S2 is the value in the N+2th

byte.

 Using strings is allowed in the file name S3. ES3/EX3 FW V1.02.00 or previous versions support up to 9

characters. ES3/EX3 FW V1.04.00 or later and SV3/SX3 FW V1.00.00 or later support up to 199 characters.

 S3: S3 occupies consecutive devices. Up to 200 characters can be set in the file name and the ending

character 16#00 is also counted. If the string does not end with 16#00, an error occurs. When the

instruction reads the ending character, the instruction stops reading characters, and checks if the file

6-834
C ha pt er 6 A p pl i e d In s tr uc t io ns

name is legal. The characters in the file name can be A–Z, a–z, and 0–9. The file name extension

depends on the file format. The file that the instruction creates is in the default folder. If the file name is

“Test1”, the instruction writes characters into the devices as follows.

S3 'e ' 'T' S3 1 6# 6 5 16 # 54


A S CII代碼
S 3 +1 't' ' s' S3 +1 1 6 #7 4 16 # 73
S3 +2 NUL '1 ' S 3+2 1 6 #0 0 16 # 31

 The default folder path:

Model name Folder path

ES3 Series PLC CARD\ES3\UserProg

EX3 Series PLC CARD\EX3\UserProg

SV3 Series PLC CARD\SV3\UserProg

SX3 Series PLC CARD\SX3\UserProg

2. Instruction flags

Flag Description

SM450 ON: the memory card is in the CPU module.

The write protection switch on the memory card 6_


SM451 ON: the memory card is write protected.

OFF: the memory card is not write protected.

The data is being written from the PLC into the memory card, or the data is being read
SM452
from the memory card into the PLC.

ON: an error occurs during the operation of the memory card. If the flag is ON, you must
SM453
reset it to OFF. The error code is stored in SR453.

3. Related error codes (SR453):

Error code Description

16#005E An error occurs when the memory card is initialized.

16#005F The path is incorrect, or the file does not exist.

16#0060 The default folder cannot be created.

16#0061 The memory space is insufficient.

6-835
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Error code Description

16#0062 The memory card is write protected.

16#0063 An error occurs when the data is written into the file.

16#0064 The data cannot be read from the memory card.

16#0065 The file is a read-only file.

Example

SM450 is ON when the memory card is inserted into the CPU module; SM452 is ON when the MTWRIT instruction

executes; SM452 is OFF when the MTWRIT instruction completes.

Operand Setting value Description


_6 The file into which the data is written

The file format:

The unit of the character is a byte.


D0 16#0001
The file name extension is .txt.

Use ASCII codes.

The data in D300 is written to the file.

D300 - The data that is written to the file

D10 16#000A The size of the string that is written to the file is 10 bytes.

After the data is written to the file, the separation mark is appended after the last
D1 16#0A00
byte in the file.

D30=16#6554

D30 D31=16#7473 The file name is “Test1”.

D32=16#0031

6-836
C ha pt er 6 A p pl i e d In s tr uc t io ns

Additional remarks

1. If the value in C exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. If the value in S1 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

3. If the value in S3 exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

6_

6-837
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction code Operand Function

2303 MEMW P S, D, n Writing data into the file register

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S   
D 
n      
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S 
D 
n 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : The first address of the data source

D : The first address where the data is stored

n : Data length

_6
Explanation

1. This instruction writes data into the file register. The description of the operands is as follows.

• S: The initial address of the data source; it is suggested that you declare an array type variable.

• D: The initial address where the instruction stores data. It is suggested that you assign an address for the file
register and declare an array type variable.

• n: The length of the data that the instruction writes into the file register, between 1–2048. If the value exceeds
the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.

• If the device S or D exceeds the allowed range, SM0 is ON, and the error code in SR0 is 16#2003.

2. Since it takes 60–120 ms for the instruction to write the data, it is suggested that you use this instruction when the

PLC is idle. For example, when there is no external interrupt task, no high-speed output, or any immediate events

for the PLC to process.

3. The instruction writes only when the contact switches from OFF to ON and writes only once.

NOTE: You can write into this file register a maximum of 100,000 times.

6-838
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction code Operand Function

2304 MDEL P ctrl, fname Deleting files on the memory card

Device X Y M S T C HC D FR SM SR E K 16# “$” F


ctrl   
fname   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

ctrl  
fname 

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

ctrl : Control parameter

fname : Data source

Explanation

1. This instruction writes data from the PLC to the memory card. The operands are described as follows.

ctrl: The control parameter



6_

Item Code Description

0 The file name extension is .dmd.

File format 1, 2, 7 The file name extension is .cvs.

3, 4, 5, 6 The file name extension is .txt.

Reserved - The values of bit 8–bit 15 are 0.

 You can use strings in the in fname (file name). ES3/EX3 FW V1.02.00 or previous versions support up to 9

characters. ES3/EX3 FW V1.04.00 or later and SV3/SX3 FW V1.00.00 or later support up to 199 characters.

 fname occupies consecutive devices. Up to 200 characters can be set in the file name and the ending

character 16#00 is also counted. If the string does not end with 16#00, an error occurs. When the instruction

reads the ending character, it stops reading, and checks if the file name is legal. The characters in the file

6-839
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

name can be A–Z, a–z, and 0–9. The file name extension depends on the file format. The file that the

instruction creates is in the default folder. If the file name is “Test1”, the instruction writes the characters into

the devices as follows.

 The default folder path:

Model name Folder path

ES3 Series PLC CARD\ES3\UserProg

EX3 Series PLC CARD\EX3\UserProg

SV3 Series PLC CARD\SV3\UserProg

SX3 Series PLC CARD\SX3\UserProg

2. Instruction flags:

Flag Description

_6 SM450 ON: the memory card is in the CPU module.

State of the write protection switch on the memory card

SM451 ON: the memory card is write protected.

OFF: the memory card is not write protected.

The data is being written from the PLC to the memory card, or the data is being read
SM452
from the memory card to the PLC.

ON: an error occurs during the operation of the memory card. If the flag is ON, you must
SM453
reset it to OFF. The error code is stored in SR453.

3. Related error codes (SR453):

Error code Description

16#005E An error occurs when the memory card is initialized.

16#005F The path is incorrect, or the file does not exist.

16#0060 The default folder cannot be created.

6-840
C ha pt er 6 A p pl i e d In s tr uc t io ns

Error code Description

16#0061 The memory space is insufficient.

16#0062 The memory card is write protected.

16#0063 An error occurs when the data is written into the file.

Example

SM450 is ON when you insert the memory card into the CPU module; SM452 is ON when this instruction executes;

SM452 is OFF when this instruction completes.

Operand Setting value Description

D0 16#0001 The file name extension is .cvs.


6_
D20=16#6554

D20 D21=16#7473 The file name is “Test1”.

D22=16#0031

Additional remarks

1. If the value in ctrl exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and the

error code in SR0 is 16#2003.

2. If the value in fname exceeds the range, an operation error occurs, the instruction is not executed, SM0 is ON, and

the error code in SR0 is 16#2003.

6-841
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6.24 Task Control Instructions


6.24.1 List of Task Control Instructions
The following table lists the Task Control instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

2400 TKON –  Enabling a cyclic task

2401 TKOFF –  Disabling a cyclic task

_6

6-842
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

6.24.2 Explanation of Task Control Instructions

API Instruction code Operand Function

2400 TKON P S Enabling a cyclic task

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S DWORD     

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Task number

Explanation

1. This instruction enables the cyclic task specified by S.

2. When the PLC runs, the execution of the cyclic tasks depends on the setting of the cyclic tasks in

ISPSoft/DIADesigner.
6_

3. The operand S must be between 0-31.

4. Refer to the ISPSoft/DIADesigner User Manual for more information about creating and enabling tasks.

Example

When the PLC runs, cyclic task (0) is enabled. When the TKON instruction in cyclic task (0) executes, it enables cyclic

task (1), and M10 is ON.

You create cyclic tasks in ISPSoft/DIADesigner, and you define their default enabled/disabled state in

ISPSoft/DIADesigner. Cyclic task (0) is enabled when the PLC runs, and cyclic task (1) is not enabled when the PLC runs.

6-843
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Cyclic task (1) is enabled by the TKON instruction in cyclic task (0).

Cyclic task (1) is executed.

Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on tasks.

_6

6-844
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons

API Instruction code Operand Function

2401 TKOFF P S Disabling a cyclic task

Device
X Y M S T C HC D FR SM SR E K 16# “$” F
S     

DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S  

Pulse instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3 -

Symbol

S : Task number

Explanation

1. This instruction disables the cyclic task specified by S.

2. When the PLC runs, the execution of the cyclic tasks depends on the setting of the cyclic tasks in

ISPSoft/DIADesigner.

6_
3. The operand S must be between 0-31.

4. Refer to the ISPSoft/DIADesigner User Manual for more information about creating and enabling tasks.

Example

When the PLC runs, cyclic task (0) and cyclic task (1) are enabled. When the TKOFF instruction in cyclic task (0) executes,

it disables cyclic task (1), and M10 is OFF.

You create cyclic tasks in ISPSoft/DIADesigner and you define their default enabled/disabled state in ISPSoft/DIADesigner.

Cyclic task (0) and cyclic task (1) are enabled when the PLC runs, and cyclic task (1) is disabled when the TKOFF

instruction in cyclic task (0) executes. Cyclic task (1) is disabled by the execution of the TKOFF instruction in cyclic task

(0).

6-845
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Cyclic task (1) is not executed.

Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on tasks.

_6

6-846
Chapter 6 Applied Instructions

6.25 SFC Instructions


6.25.1 List of SFC Instructions
The following table lists the SFC (Sequential Function chart) instructions covered in this section.

Instruction code Pulse


API Function
16-bit 32-bit instruction

2500 SFCRUN – – SFC Run

2501 SFCPSE – – SFC Pause

2502 SFCSTP – – SFC Stop

6_

6-847
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

6.25.2 Explanation of Task Control Instructions

API Instruction code Operand Function

2500 SFCRUN S1, S2, S3 SFC Run

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1
S2   
S3
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1
S2  
S3

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Name of the SFC POU

S2 : Function code
S3 : Device address
_6

Explanation

1. This instruction runs the SFC (Sequential Function Chart) program specified by S1 according to the function code in

S2.

2. The instruction runs the SFC POU (Program Organization Unit) specified by S1 only when the PLC is scanning the

SFC POU.

3. The operands are described as follows.

 S1 defines the name of the SFC POU.

 When the designated SFC POU of S1 executes, the instruction clears the parameters (such as

SFC/STEP/ACTION/TRANSITION) for the SFC program when S2=0 or 1, and the SFC execution starts

according to the value specified in S2.

 IF S2=0, the system executes the SFC POU from the initial step.

 IF S2=1, the system executes the SFC POU from the designated step in S3.

6-848
Chapter 6 Applied Instructions

 If S2=2, the instruction does NOT clear the status and the parameters (such as

SFC/STEP/ACTION/TRANSITION) for the SFC and the system starts executing from where it paused.

 S3 designates where to start (which step) in the SFC program in S1.

4. The range of S2 is between 0–2. If it is out of range, it is evaluated as 0.

5. When the state of the SFC POU is RUN, executing this instruction is invalid.

Example

Set up one LD (ladder) POU and specify its POU name as “Main”, and then set up two SFC POUs with the names of

“TestSFC1” and “TestSFC2”.

1. When the PLC executes the Main program (RUN), TestSFC1 and TestSFC2 execute the SFCSTP instruction (API

2502), and the two SFC POUs stop executing.

2. When M0 switches from OFF to ON, TestSFC1/ TestSFC2 POU execute the SFCRUN* instruction. See below for the

contents of the TestSFC1 and TestSFC2 for execution details. When S2=0, the SFC status and parameters are

cleared and begin to execute from STEP 1. When S2=1, the SFC status and parameters are cleared and begin to

execute from the designated STEP in S3.

3. When M1 switches from OFF to ON, TestSFC1 POU pauses. When S2=1, all the SFC executing actions and outputs

are cleared, and the system runs the final scan. 6_


4. When M2 switches from OFF to ON, TestSFC1 POU executes. When S2=1, the SFT status and parameters are

cleared, and the system begins to execute from STEP 2.

5. When M3 switches from OFF to ON, TestSFC2 POU pauses. When S2=0, all the SFC executing actions and outputs

are kept, and the system does not run the final scan.

6. When M4 switches from OFF to ON, TestSFC1 POU executes. When S2=2, the SFC status and parameters are kept

and the SFC begins to execute from where it paused.

*SFCRUN activates the SPC POU at the next scan.

6-849
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

Main POU

_6

6-850
Chapter 6 Applied Instructions

TestSFC1 POU

TestSFC2 POU 6_

Additional remarks
Refer to the ISPSoft/DIADesigner User Manual for more information on Sequential Function Charts.

6-851
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

API Instruction code Operand Function

2501 SFCPSE S1,S2 SFC Pause

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1
S2   
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S1 : Name of the SFC POU

S2 : Function code

Explanation

1. This instruction pauses the SFC POU specified by S1 according to the function code in S2.
_6
2. The instruction can pause the SFC POU specified by S1 only when the PLC is scanning the SFC POU.

3. When paused, the SFC status and parameters (such as SFC/STEP/ACTION/TRANSITION) are stored.

4. The operands are described as follows.

 S1 defines the name of the SFC POU.

 When S2=0, the instruction preserves all the executing actions of the SFC and the outputs, and the system

does not run the final scan.

 When S2=1, the instruction clears all the executing actions and the outputs of the SFC POU, and the system

runs the final scan.

5. The range of S2 is 0–1. When it is out of range, it is processed as 0.

6. When the state of the SFC POU is PAUSE/STOP, executing this instruction is invalid.

6-852
Chapter 6 Applied Instructions

Example

Refer to the SFCRUN (API 2500) programming example for more information.

Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on SFCs.

6_

6-853
DVP-ES3/EX3/SV3/SX3 Series Programming Manual

API Instruction code Operand Function

2502 SFCSTP S SFC Stop

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data

UINT

DINT

LINT

TMR

CNT
INT
type

S1

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : Name of the SFC POU

Explanation

1. This instruction stops the SFC POU specified by S.

_6 2. This instruction stops the SFC POU specified by S1 only when the PLC is scanning the SFC POU.

3. When stopping, the instruction clears the SFC status and parameters, and the system runs the final scan.

4. When the state of the SFC POU is STOP, executing this instruction is invalid.

Example

Refer to the SFCRUN (API 2500) programming example for more information.

Additional remarks

Refer to the ISPSoft/DIADesigner User Manual for more information on SFCs.

6-854
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.26 High-speed Output Instructions


6.26.1 List of High-speed Output Instructions

The following table lists the High-speed Output instructions covered in this section.

Instruction code Pulse

numbered

numbered
instruct

Even-
axis*1

axis*2

Odd-
API Function
16-bit 32-bit ion

2700 – DPLSY – High-speed pulse output (without ramp-up/down process) V V

2701 – DPLSR – High-speed pulse output (with ramp-up/down process) V V

2702 PWM DPWM – Pulse width modulation V V

2703 JOG DJOG – JOG output V V

2704 – DZRN – Zero return V –

2705 – DPLSV – Adjustable pulse output V V

2706 – DDRVI – Relative position control V V

2707 – DDRVA – Absolute position control V V

2708 CSFO – – Catch speed and proportional output V –

2709 – DDRVM – Mark alignment positioning V –


6_
2710 – DPPMR – 2-Axis relative-coordinate point-to-point synchronized motion V –

2711 – DPPMA – 2-Axis absolute-coordinate point-to-point synchronized motion V –

2712 – DCICR – 2-Axis relative-position clockwise arc interpolation V –

2713 – DCICA – 2-Axis absolute-position clockwise arc interpolation V –

2714 – DCICCR – 2-Axis relative-position counterclockwise arc interpolation V –

2715 – DCICCA – 2-Axis absolute-position counterclockwise arc interpolation V –

2716 – DCCMR – Relative-position circle drawing V –

2717 – DCCMA – Absolute-position circle drawing V –

2718 TPO – – Position planning table controls the output V –

 Setting single-axis output parameters in the position planning


2719 – DTPWS V –
table

–  Setting linear interpolation parameters in the position planning


2720 DTPWL V –
table

2721 – DTPWC  Setting arc interpolation parameters in the position planning table V –

6-855
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Instruction code Pulse

numbered

numbered
instruct

Even-
axis*1

axis*2

Odd-
API Function
16-bit 32-bit ion

2723 – DPPGB – Point to point go back and forth V –

2724 – DZRN2 – Zero return 2 (directional output can be defined) V V

NOTE:

*1: Even-numbered axes include Y0, Y2, Y4, and Y6.

*2: Odd-numbered axes include Y1, Y3, Y5, and Y7.

_6

6-856
C ha pt er 6 A p pl i e d In s tr uc t io ns

6.26.2 Explanation of High-speed Output Instructions

API Instruction Operand Description

High-speed pulse output (without


2700 D PLSY S1,S2,D
ramp-up/down process)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Pulse output frequency

S2 : Number of pulses to output

D : Pulse output device


6_
Explanation

1. This instruction specifies the pulse output (S1, S2) for the device specified in D with no ramp up or ramp down when
the frequency changes. S1 specifies the pulse output frequency range: for open collector output models, the range is

between 0 Hz–200 kHz. The unit of the output frequency is 1 Hz. The error rate for 200 kHz is about 0.02% and for

100 kHz it is about 0.01%. The error rate decreases with decreasing frequency. For example, if the output frequency

setting is 199990 Hz, the actual output is 199960 Hz. If the output frequency setting is 99999 Hz, the actual output is

99990 Hz. If the output frequency is out of the valid range, the PLC automatically processes it as the maximum or

minimum pulse output frequency.

2. You can change the output frequency specified by S1 during the execution of the instruction without using the ramp

up/down process. The time to change the frequency is when the PLC is scanning the instruction and the instruction

has completed output of a full pulse.

3. S2 specified the number of output pulses. The range is between 0–2,147,483,647. When you set the number of

output pulses to 0, then the number of pulses is not restricted and pulses are output constantly until the instruction is

disabled. When the number of output pulses is set to less than 0, no pulses are output.

4. After the instruction starts to output pulses, the number of output pulses specified by S2 cannot be changed.

6-857
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

5. D only allows Y0–Y7 as the output devices. After the instruction is executed, its output function becomes the

high-speed output, and the basic instruction output point control is invalid. It is suggested that you do not use the

general output function after using the high-speed output function in the program.

6. The ratio of Duty-OFF Time and Duty-ON Time for the pulse output is 1:1.

7. There is no limit to how many times you can use the instruction a program. But only one output instruction that uses

the same output point can be executed in the same scan cycle. When several high-speed pulse output instructions

start the same output point in the program, the PLC first performs the output based on the instruction that is

executed first.

8. After every high-speed output instruction for every output point is executed, other instruction occupying the same

output point can not start until the high-speed output instruction in execution is disabled.

9. When the high-speed output instruction is executed in an interrupt program or is not in the main process, it is

suggested that you use the instruction with the auto-reset function when output is completed and the PLC updates

the output state in the END instruction.

10. After the stop flag is set, the PLC stops the output and clears the busy flag only after executing the start instruction a

second time and outputting a full pulse. The PLC continues to output pulses when the stop flag is reset and the

previously stopped pulse output is not finished. You set and reset the stop flag is set in the program.

11. The high-speed output points and corresponding SM/SR are listed in the following table.

_6 Output point number Attribute#2 Y0 Y1 Y2 Y3 Y4 Y5

Busy flag R SM460 SM472 SM480 SM492 SM500 SM512

Completion flag#3 R/W SM461 SM473 SM481 SM493 SM501 SM513

Stop flag R/W SM463 SM474 SM483 SM494 SM503 SM514

Output completion
R/W SM470 SM475 SM490 SM495 SM510 SM515
auto-reset#4

Present output
SR460 SR474 SR480 SR494 SR500 SR514
position#1 R/W
SR461 SR475 SR481 SR495 SR501 SR515
(32-bit)

Output point number Attribute #2 Y6 Y7

Busy flag R SM520 SM532

Completion flag #3 R/W SM521 SM533

Stop flag R/W SM523 SM534

6-858
C ha pt er 6 A p pl i e d In s tr uc t io ns

Output point number Attribute#2 Y0 Y1 Y2 Y3 Y4 Y5

Output completion
R/W SM530 SM535 SM550 SM555 SM570 SM575
auto-reset #4

Present output position


SR520 SR534 SR540 SR554 SR560 SR574
#1
R/W
SR521 SR535 SR541 SR555 SR561 SR575
(32-bit)

Notes:

#1: All present output positions are latched when power is off.

#2: R means Read-only registers, and the data in the registers cannot be modified. R/W means the data in the

registers can be read and written.

#3: It is suggested that you clear the completion flag. If the completion flag is not cleared, it is cleared automatically
when the high-speed output instruction is executed the next time.

#4: You set the output completion auto-reset flag. The PLC clears the flag automatically after the output is

completed.

Example 1

1. When M0 is ON, Y0 outputs 200 pulses at 1kHz. SM461 is ON when the pulse output is completed and then M12 is 6_
ON.

2. When M0 is OFF, Y0 stops the output. It restarts the pulse output when M0 switches to ON again.

0.5ms

輸出 Y0 2 3 200
Output point Y0

1ms

6-859
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

External interrupt input X0

External interrupt input X1

_6

Explanation

1. Y0 outputs 1000 pulses when X0 receives one external interrupt signal. Y2 outputs 1000 pulses when X1
receives one external interrupt signal.

2. When the external interrupt input X triggers the pulse output from Y, the interval time between the Y pulse
output completion and the next external interrupt input X trigger must be one or more PLC scan cycles.

Example 3 (ST program)

6-860
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. When M0 is ON, Y0 outputs 1000 pulses at 1kHz. When M1 is ON, it indicates Y0 is used for high-speed pulse
output.

2. When the pulse output is completed, SM461 is ON. And if M1 is also ON, it triggers SM470 (output completion
auto-reset for Y0) to be ON and Y0 is free and ready to be used again.

3. When M0 switches from OFF to ON, the pulse output is restarted.

4. When there are more than two high-speed output instructions in a program, do not use the variable name, M1,
repeatedly.

5. It is suggested not to use ST language in a program if there is any chance the outputting needed to be stopped.

6_

6-861
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

High-speed pulse output


2701 D PLSR S1,S2,S3,D
(with ramp-up/down process)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
D 
DWORD

STRING
LWORD

LREAL
WORD
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Target output frequency

S2 : Number of output pulses

_6 S3 : Ramp-up/ down time

D : Pulse output device

Explanation

1. This instruction specifies the pulse output (S1, S2) for the device specified in D with ramp up or ramp down in the

frequency change. S1 specifies the pulse output frequency between 0 Hz–200 kHz for the open collector output

models. The unit of the output frequency is 1 Hz. The tolerable error rate for 200 kHz is about 0.02% and for 100

kHz it is about 0.01%. The error rate decreases with decreasing frequency. For example, if the output frequency

setting is 199990 Hz, the actual output is 199960 Hz. If the output frequency setting is 99999 Hz, the actual output is

99990 Hz. If the output frequency is out of the valid range, the PLC automatically processes it as the maximum or

minimum pulse output frequency.

2. After the instruction is executed, you can change the target output frequency specified by S1 and the PLC performs

the ramp up or ramp down process according to the ramp up or ramp down time setting S3. The time to change the

frequency is when the PLC is scanning the instruction and the instruction has completed output of a full pulse.

3. S2 is the number of output pulses. The range is between 0–2,147,483,647. When you set the number of pulses to 0,

then the number of pulses is not restricted and pulses are output continuously until the instruction is disabled. When

6-862
C ha pt er 6 A p pl i e d In s tr uc t io ns

the output frequency setting for S2 is lower than the start/stop frequency, the PLC will automatically restrict it at the

start/stop frequency.

4. After the instruction starts to output pulses, the number of output pulses that S2 specifies cannot be changed.

5. S3 sets the ramp-up or ramp down time with the unit of 1ms. The value is effective when the instruction is executed

for the first time. If the target frequency specified by S1 is modified in the ramp-up process, the ramp up or ramp

down time is reloaded for execution. But if the target frequency is modified when the output enters the ramp-down

process, the instruction ignores the change.

6. D only allows Y0–Y7 as the pulse output devices. After the instruction is executed, its output function becomes the

high-speed output, and the general instruction output point control is invalid. It is suggested that you do not use the

general output function after using the high-speed output function in the program.

7. The target output frequency S1, number of output pulses S2 and ramp up/down time S3 are illustrated in the

following graphic.

6_

8. The ratio of Duty-OFF Time and Duty-ON Time for the pulse output is 1:1.

9. There is no limit to how many times you can use the instruction a program. But only one output instruction that uses

the same output point can be executed in the same scan cycle. When several high-speed pulse output instructions

start the same output point in the program, the PLC first performs the output based on the instruction that is

executed first.

10. After the high-speed output instruction for one output point is enabled, other instructions that occupy the same

output point can not start until the high-speed output instruction in execution is disabled.

11. When the high-speed output instruction is executed in an interrupt program or is not in the main program, it is

suggested that you use the instruction with the auto-reset function when the output is completed and the PLC

updates the output state in the END instruction.

12. After the stop flag is set, PLC performs the ramp-down stop; or it immediately stops the output only after the start

instruction is executed a second time and outputs a full pulse.

6-863
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

13. Refer to the PLSY instruction (API 2700) for an explanation of the high-speed output points and corresponding

SM/SR.

14. Refer to Example 3 from the PLSY instruction (API 2700) for programming in ST language.

15. When the target output frequency is reached, you can change the set target output frequency. The frequencies for

ramp up and ramp down are already set, if you change the set target output frequency during the instruction

execution, the frequency goes either ramping up or ramping down. If more than one target output frequencies are

set, it is suggested to set the last new target frequency the same as the original target frequency to avoid abrupt

change when it needs to come to a stop.

See the example below. The blue line indicates the original target frequency and the red line indicates new target

frequency.

 Situation A: ramping up

Freq. 
 

Time

_6  

 Number of output pulses


 Ramp up time
 The first target frequency
 Position to change to the new target frequency
 New target frequency

 Situation B: ramping down

6-864
C ha pt er 6 A p pl i e d In s tr uc t io ns

Freq.
  

Time


 

 Number of output pulses


 Ramp up time
 The first target frequency
 Position to change to the new target frequency
 New target frequency
 Ramp down time

 Suggested design: it is suggested to set the last new target frequency the same as the original target

frequency to avoid abrupt change when it needs to come to a stop.

 
Freq.
  6_

Time

    

 Number of output pulses


 Ramp up time
 The first target frequency
 Position to change to the first new target frequency
 Position to change to the second new target frequency
 Ramp down time
 Position to change to the third new target frequency
 Position to change to the original set target frequency and then start ramping down to stop.

6-865
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2702 D PWM S1,S2,D Pulse width modulation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1          
S2          
D 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Pulse output width

S2 : Pulse output cycle

D : Pulse output device

Explanation
_6
1. This instruction specifies the pulse output width. The 16-bit instruction uses 100 us as the output unit, while the

32-bit instruction uses 1 us as the output unit.

Output instruction PWM DPWM

Range of pulse output width S1 0–30000 0–60000

Range of pulse output cycle S2 0–30000 0–60000

2. S1 (pulse output width--Duty ON) is defined as t, S2 (pulse output cycle time--Cycle time) is T as shown below. It is
recommended that S1≦S2.

3. D only allows Y0–Y7 as the pulse output device.

6-866
C ha pt er 6 A p pl i e d In s tr uc t io ns

4. There is no limit to how many times you can use the instruction a program. But only one output instruction that uses

the same output point can be executed in the same scan cycle. When several high-speed pulse output instructions

start the same output point in the program, the PLC first performs the output based on the instruction that is

executed first.

5. If S1≦0 or S2≦0, it is processed as 0 (the pulse output is OFF). If S1>S2, it is processed as S1=S2. When S1=S2

and S2 is not 0, the pulse output is always ON.

6. You can modify the pulse output width S1 and pulse output cycle S2 when the PWM instruction is executed.

7. The relevant special registers SR are listed in the following table.

Output point number Attribute Y0 Y1 Y2 Y3 Y4 Y5

Present output
SR460 SR474 SR480 SR494 SR500 SR514
position#1 R/W
SR461 SR475 SR481 SR495 SR501 SR515
(32-bit)

Output point number Attribute Y6 Y7

Present output position


SR520 SR534
#1
R/W
SR521 SR535
(32-bit)

#1: All present output positions are latched when power is off.

8. Refer to Example 3 from the DJOG instruction (API 2703) for programming in ST language. 6_

Example

When M0 is ON, Y1 outputs the following pulses. When M0 switches to OFF, Y1 output changes to OFF.

t=1000ms

Output Y1
Output Y1

T=2000ms

6-867
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2703 D JOG S1,S2,S3,D1,D2 JOG output

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1        
S2        
S3        
D1 
D2  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1    
S2    
S3    
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Ramp-up time
_6
S2 : Target output frequency

S3 : Ramp-down time

D1 : Pulse output device

D2 : Auxiliary output device

Explanation

1. This instruction specifies the JOG output (S1, S2, S3) for the devices specified in D1 and D2. S1 is the ramp-up time
with the unit of 10 ms. For Example , the value 10 means the ramp-up time is 100 ms. After the instruction is

executed, the output frequency can be divided by ten, and it speeds up once every 10ms. It reaches the JOG target

frequency specified by S2 at the ramp-up time S1.

2. When the instruction is disabled, its output frequency ramps down once every 10ms based on the ramp-down time

in S3. The output does not stop until reaching the ramp-down time. If you set the ramp-down time to 0, the output

stops immediately.

3. The range of the ramp-up time S1 and the ramp-down time S3 is between 0–3000 (0–30 seconds). If the setting

value is out of range, the PLC processes it as the minimum or maximum output value. The ramp-up time and

6-868
C ha pt er 6 A p pl i e d In s tr uc t io ns

ramp-down time are affected by the scan time. If you require accurate ramp-up or ramp-down time, it is

recommended that you use an output instruction with specified ramp up or ramp down time such as the DDRVI

instruction (API 2706).

4. The range of the target output frequency S2 is between -200 kHz to 200 kHz. If the setting value is out of the range,

the PLC processes it as the minimum or maximum output value. A positive number for the output frequency

indicates forward output. A negative number for the output frequency indicates reverse output.

5. D1 allows only Y0–Y7 for the output point. For the auxiliary output point specified by D2, refer to the output points in

the following table. If you choose other output points or the M device, the value in SR indicating the output mode is

invalid and the Pulse+direction mode is valid by default. D2 is a direction output point.

D1 selects the even output point number.

Output point for D1 Y0 Y2 Y4 Y6#1

Direction output point for D2 Y1 Y3 Y5 Y7#1

Busy flag SM460 SM480 SM500 SM520

Output mode SR462 SR482 SR502 SR522

SR460 SR480 SR500 SR520


Present output position
SR461 SR481 SR501 SR521

Backlash compensation SR478 SR498 SR518 SR538

6_
D1 selects the odd output point number.

Output point for D1 Y1 Y3 Y5 Y7#1

Direction output point


Y20 or above or any M device (BOOL)
for D2

Busy flag SM472 SM492 SM512 SM532

Present output SR474 SR494 SR514 SR534

position SR475 SR495 SR515 SR535

Backlash
SR479 SR499 SR519 SR539
compensation

Note: The backlash compensation is available for ES3/EX3 firmware V1.04.00 or later and SV3/SX3 firmware

V1.00.00 or later.

Note #1: These output points are not supported by SX3 series CPU.

6-869
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. If SR=0, it indicates the Pulse+direction output mode. If SR=1, it indicates the A/B phase output mode. Note: you

can select the output mode only when D1 uses an even output point and D2 uses a recommended direction output

point.

7. When the direction outputs are not using the default outputs to output, you can refer to the table below for setting up

the outputting time that pulse outputting goes first before direction outputting does. So that you can be sure the

outputting only happens when switching to the direction outputs. The unit for SR is millisecond and the range is

0-20 ms. Default is 0, indicating inactive.

Output point for D1 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7

SR number SR640 SR641 SR642 SR643 SR644 SR645 SR646 SR647

Note: the time source here is from PLC scan time.

8. When the output begins, the Busy flag SM is ON. When the output is completed, the Busy flag is automatically reset

to OFF and the Completion flag is not ON.

9. The following graph shows the output timing diagram. For the Busy flag in the following graph, refer to the Busy flag

axis.

Jog_in
_6
Busy flag
S2 > 0
S1 S3
D1
0 Time
S1 S3
S2 < 0

10. You can modify the target output frequency during instruction execution but you can NOT change the ramp-up or

ramp-down time. When the new target frequency is greater than the previous one, the instruction uses the ramp-up

slope. When the new frequency is less than the previous one, the instruction uses the ramp-down slope.

11. The instruction sets the ramp-up/down slope through conversion of the set time and target frequency when the

instruction is executed. The slope does not change with the changing target frequency in the output process. For

example, the original target output frequency is 1 kHz and then it is modified to 2 kHz. The actual ramp-down time

is different from the original time. The dotted line is the ramp-up and ramp down timing diagram after the target

frequency is modified.

6-870
C ha pt er 6 A p pl i e d In s tr uc t io ns

Jog_in
Change S2

S2
D1
Time

S1 S3

12. If there is any change on the frequency during ramp up or ramp down, the change can only be carried out after the

original frequency completes outputting. For example, if the new target frequency is 100 Hz and the ramp-up timing

is set at 100 (1 second), after the original frequency completes outputting, the new target frequency 100 Hz will be

outputted next. (Even though the target frequency changes every 10 ms but if the pulse does NOT complete

outputting, the change can NOT be applied.)

Example (ST program):

It is suggested to use ladder diagrams as the programming language in this instruction. If you need to use structured texts,

you need to use the output completion auto-reset flag as well for the PLC to know the output point is free and ready to be

used again when the output completes. Taking Y0 as the output point, the program should be written as below. See the

following example. 6_

6-871
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2704 D ZRN S1,S2,S3,S4,D Zero return

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
S4 
D 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S4 
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Target frequency for zero return


_6
S2 : JOG frequency for DOG

S3 : Zero return mode

S4 : Input device for DOG

D : Pulse output device

Explanation

1. This instruction causes the machine to return to the zero point. The range of the target frequency for zero return S1
is between 1 Hz–200 kHz. The JOG frequency S2 should be less than the target frequency S1. The JOG frequency

S2 is the start frequency. If S1 is less than S2, S1 is automatically revised processed as equal to S2.

2. The input point for S4 and output point for D must match. Do not change them during instruction execution. The

input point for S4 is suggested to use the 16 high-speed input points X0–X7 and X10–X17. They will not be affected

by PLC instruction scan time. If you use X20 successive input points or M devices, they will be affected by the PLC

instruction scan time. Refer to the following table for the selection of D output point and direction output point. If D is

not the preset Pulse+direction output (default: 0), change the mode to A/B phase output by setting SR to 1.

6-872
C ha pt er 6 A p pl i e d In s tr uc t io ns

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1


Can be any one of the input points X0–X7 and X10–X17. But the same input
Input point for S4 point cannot be selected for different axis output. If the DOG point shakes or
the switch bounces, set the input point filter time in HWCONFIG.
Output point for D Y0 Y2 Y4 Y6#1
Direction output point Y1 Y3 Y5 Y7#1
Output mode SR462 SR482 SR502 SR522
Busy flag SM460 SM480 SM500 SM520
Completion flag SM461 SM481 SM501 SM521
SR460 SR480 SR500 SR520
Present output position
SR461 SR481 SR501 SR521
Note#1: Axis 4 is not supported by SX3 series CPU.

3. Use S3 to select the zero return mode. The function code is set by the two high and low16-bit parameters. See the
following table for details.

S3: select the zero return mode


High 16-bit Low 16-bit
b31~b16 b15~b6 b5 b4 b3~b0

Number of pulses for motion Direction setting Setting DOG signal


Mode setting
reserved 0: in the negative direction 0: contact A
Number of Z phases 0~15 (F)
1: in the positive direction 1: contact B

See the diagram below for mode setting.


6_
Execute DZRN (b5) DOG signal received Move away from DOG signal (b3-b0)

0: stops immediately
2: moves a number of pulses and then stops
Moves in the
3: searches for a number of Z phases and then stop
negative 4: outputs the clear signal
Searches for
direction 6: moves a number of pulses and outputs the
the zero point clear signal
in the 7: searches for a number of Z phases and outputs the
clear signal
direction of
Moves in the
negative or
positive direction
positive 1, 8, 9: stops immediately
10: moves a number of pulses and then stops
11: searches for a number of Z phases and then stop
5, 12, 13: outputs the clear signal
14: moves a number of pulses and outputs the clear
signal
15: searches for a number of Z phases and outputs
the clear signal

6-873
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

4. Use S3 to select the zero return mode. The function code is set by the two high and low16-bit parameters. See the

following table for details.

Code
Functions High Low Explanation
16-bit 16-bit
When the instruction is executed, the search for the
zero point is in the negative direction with the target
Leaves the zero point in the frequency. When the zero point is ON (the zero
negative direction and then point signal changes from OFF to ON), the
0 0
stops frequency is decreased to the JOG speed and the
(Mode 0) motion in the negative direction continues, and
does not stop until the zero point signal changes
from ON to OFF.
When the instruction is executed, the search for the
zero point is in the negative direction with the target
Leaves the zero point in the frequency. When the zero point is ON (the zero
positive direction and then point signal changes from OFF to ON), the
0 1
stops frequency decreases to 0 immediately, and then
(Mode 1) the motion is in the positive direction at the JOG
speed, and does not stop until the zero point signal
changes from ON to OFF.
Returning to the zero point is the same as that for
the low 16-bit code. After the zero point is ON, the
Number motion continues according to the number of
Mode 0 Moves again after
of pulses 2 specified pulses. When the high 16-bit code is a
returning to the zero point
for motion positive number, the search is in the positive
direction. A negative value means that the search
_6 is in the negative direction.
Returning to the zero point is the same as that for
the low 16-bit code. After returning to the zero
point, the motion continues according to the
Mode 0 Searches Z phase number of Z phases. When the high 16-bit code is
after returning to the zero Number a positive number, the search is in the positive
point of Z 3 direction. A negative value indicates that the
(Z phase input point is set in phases search is in the negative direction. Suppose you
HWCONFIG ) specified that the rising-edge trigger of X0 as the
condition for the Z phase input in HWCONFIG.
The counting is performed once whenever the
rising-edge trigger for X0 occurs.
Choosing a value between 4–7 means selecting
Number 4+0=4 the functions codes 0–3 respectively, and the
Mode 0 Outputs the clear
of pulses 4+1=5 specified output point sends an ON signal that is
signal after returning to the
for motion 4+2=6 about 20ms wide when the function execution
zero point.
or number 4+3=7 completes. The range of the output point is
(Output clear point is set in
of Z (bit Y14–Y17 and Y20–Y27. For example, if you
HWCONFIG )
phases 2=ON) specify Y22 as the output point in HWCONFIG, it
indicates Y22 is for the output of clear signals.
Leaves the zero point in the 8+0=8
positive direction and then 8+1=9 The operation for zero point return is the same as
0
stops (bit that for code 1 (mode 1).
(Mode 1) 3=ON)

6-874
C ha pt er 6 A p pl i e d In s tr uc t io ns

Code
Functions High Low Explanation
16-bit 16-bit
The operation for zero point return is the same as
that for low 16-bit code 1.

8+2=10 After returning to the zero point, the motion


Mode 1 outputs the number Number
continues in accordance with the number of
of pulses after returning to of pulses (bit
specified pulses. When the value of the high 16-bit
the zero point for motion 3=ON)
code is a positive number, the motion is in the
positive direction. A negative number indicates that
the motion is in the negative direction.
The operation for zero point return is the same as
that for low 16-bit code 1.
After returning to the zero point, the motion
Mode 1 Searches for Z continues in accordance with the number of Z
phase after returning to the Number 8+3=11 phases to seek. When the value of the high 16-bit
zero point of Z (bit code is a positive number, the motion is in the
(Z phase input point is set in phases 3=ON) positive direction. A negative number indicates that
HWCONFIG ) the motion is in the negative direction.
If the rising edge trigger for X1 is the condition for Z
phase input, counting is performed once when the
rising-edge trigger for X1 occurs.
Mode 1 Outputs the clear 0 or 12–15
signal after returning to the number of
(bit 3=bit After returning to the zero point in mode 1, the
zero point pulses or
2 20ms-width clear signal is output.
(Output clear point is set in number of
Z phases =ON)
HWCONFIG )
When in the low 16-bit code, bit 4 is ON, it means
+16
the zero point is ON as the DOG point changes 6_
DOG point is B point (bit
from ON to OFF and the zero point is left as the
4=ON)
DOG point changes from OFF to ON.
Moves in the positive +32 When in the low 16-bit code, bit 5 is ON, it means
direction after the DZRN searching for the zero point is performed in the
(bit5=ON)
instruction is executed. positive direction after DZRN is started.
5. The execution sequence is based on the value of the low 16-bit code in the table above, and described below.

The direction of DOG signal is determined by the value of bit 5.

 The DOG signal is determined by the value of bit 4.

 Mode 0 or mode 1 for the zero point return, selected according to the value of bit 3.

 The operation of the zero point return is performed according to the values of bit 1 and bit 0.

 The operation of the clear signal specified by bit 2 is performed.

6. Set the input point and the rising/falling edge trigger condition in HWCONFIG, when the position control system

needs positive and negative limit input points. Note that the limit input points must not be the same as the zero point

or Z phase input points.

For ES3/EX3 series CPU with firmware V1.04.00 or earlier, with the limit point check function enabled, the alarm

flag will not be set to ON once the limit signal is received in the course of returning to the zero point. For ES3/EX3

series CPU with firmware V1.06.00 or later and SV3/SX3 series CPU with firmware V1.00.00 or later, the alarm flag

6-875
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

will be set to ON if the limit signal is received, and you can decide the next operation actions according to the alarm

flag state. (Note: After the alarm flag is set to ON, you must reset it by yourself.)

7. The Completion flag is set to ON after the instruction finishes performing the specified function. For example, for

function code 6, the PLC sets the Completion flag to ON only when the Z phase seeking completes.

8. After the DZRN instruction is executed, an interrupt service program is not executed till the DZRN instruction is

disabled, if the specified input point for the zero point is the same as that for the external input interrupt in the

program.

9. When the limit switch is specified in HWCONFIG, and there is an external input interrupt service program, the

interrupt program will be executed at the same time.

10. It is not suggested you use this instruction in the ST programming language, interrupt tasks or function block which

is called only once. ES3/EX3 CPU firmware V1.06.00 or later and SV3/SX3 CPU firmware V1.00.00 or later support

this instruction edited in the ST language. Please refer to the example explanation for more.

11. The steps for performing the functions are as below


Function code 0:

 The DZRN function is executed and the search for the zero point is in the negative direction with the target

frequency.

 After the DOG signal is received, the output frequency decreases to the JOG frequency. The output continues in
_6 the negative direction and does not stop until the zero point signal changes from ON to OFF.

 The output stops when the signal changes from ON to OFF and the axis moves away from the DOG signal.

Negative direction

Completion flag ON

DOG signal ON

Frequen cy

Target frequency

JOG frequency
Time
1 2 3

Function code 1:

 The DZRN function is executed and the search for the zero point is in the negative direction with the target

frequency.

 After the DOG signal is received, the output is in the positive direction with the JOG frequency after the output

6-876
C ha pt er 6 A p pl i e d In s tr uc t io ns

frequency decreases, and the motion direction reverses. The output does not stop until the zero point signal

changes from ON to OFF.

 The axis moves away from the DOG signal and PLC stops when the signal changes from ON to OFF.

P ositive
Negative direction direction

Completion flag ON

DOG signal ON
F requency

Target frequency

JOG frequency
Time
1 2 3 4

Function code 2:

 The DZRN function is executed and the search for the zero point is in the negative direction with the target

frequency.

 After the DOG signal is received, the output decreases the frequency to the JOG frequency and continues in the

negative direction.

6_
 When the DOG signal is left and the signal changes from ON to OFF, the specified number of pulses are output.

 The first pulse output starts.

 When the 100th pulse output completes, the PLC stops and the Completion flag is ON.

Completion flag ON

DOG signal ON

Output Y

Frequency

Target frequency

JOG frequency
Time

1 2 3 4 5

6-877
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Function code 3:

 DZRN function is executed and the search for the zero point is in the negative direction with the target frequency.

 After the DOG signal is received, the output frequency decreases to the JOG frequency and the motion

continues in the negative direction.

 The motion goes on according to the number of Z phases when the signal changes from ON to OFF after the

axis moves away from the DOG signal.

 The first Z phase pulse

 The motion stops after the 2nd Z phase completes and the Completion flag is ON.

Completion flag ON

DOG signal ON

Z phase pulse

Frequency

Target frequency

JOG frequency
Time

1 2 3 4 5
_6 Function code 4:

 DZRN function is executed and the search for the zero point is in the negative direction with the target frequency.

 After the DOG signal is received, the output frequency decreases to the JOG frequency and continues in the

negative direction. The output does not stop until the zero point signal changes from ON to OFF.

 After the axis moves away from the DOG signal, the output stops when the signal changes from ON to OFF and

the clear signal is be ON for about 20 milliseconds.

Negative direction

Completion flag ON

Clear signal ON

DOG signal ON
Frequency

Target frequency

JOG frequency
Time
1 2 3

6-878
C ha pt er 6 A p pl i e d In s tr uc t io ns

Function code 0+ the negative limit function enabling:

You set the negative limit input point in HWCONFIG, and then download the setting to the PLC. The PLC

automatically calculates the negative limit function when the instruction is executed.

 DZRN function is executed and the search for the zero point is in the negative direction with the target frequency.

 After the negative limit switch is ON, the motion stops and then goes in the positive direction after reversing

direction.

 The motion continues in the positive direction after leaving the negative limit switch.

 The output frequency ramps down after receiving the DOG signal. The reverse output is performed with the JOG

frequency after reversing direction.

 The output stops when the signal changes from ON to OFF after the axis moves away from the DOG signal.

Positive Negative
Negative direction direction direction

Completion flag ON

DOG signal

Negative limit switch ON

Frequency

Target frequency

JOG frequency
6_
Time

1 2 3 4 5

Example 1

When M0 is ON, outputting the pulse from Y0 with a frequency of 20 kHz to search for the zero point in the negative

direction. When the DOG signal is received and X4 is ON, it keeps moving in the negative direction with the JOG

frequency of 1 kHz. The output stops immediately after X4 changes from ON to OFF.

6-879
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

S3 is set to 0.

High 16-bit [0000] is to disable the function to move a number of pulses or to search for Z phases.

Low 16-bit [0000] is Mode 0; when the DOG signal is received, the axis moves in the negative direction; after the axis
moves away from the DOG signal, it stops immediately.

Example 2

When M0 is ON, outputting the pulse from Y0 with a frequency of 20 kHz to search for the zero point in the negative

direction. When the DOG signal is received and X4 is ON, the PLC decreases the frequency to the JOG frequency of 1

kHz and keeps moving in the positive direction with the JOG frequency of 1 kHz. When X4 is OFF, the PLC starts to seek

the Z phase pulse in the positive direction. When X5 receives two pulses, the PLC stops and Y14 outputs a 20ms-width

pulse.

_6

Explanation

1. If you specify the rising-edge trigger at X5 as the condition for Z phase input in HWCONFIG, the count is

incremented once whenever the rising-edge trigger at X5 occurs.

2. Y14 is specified as the output point for outputting the clear signal in HWCONFIG.

3. S3 is set as 16#00020007.
High 16-bit [0002] is to search for the Z phase twice, once the axis moves away from the DOG signal.

Low 16-bit [0007] is Mode 7; when the DOG signal is received, the axis moves in the negative direction; after the
axis moves away from the DOG signal, and found the Z phase, a clear signal is outputted (20ms).

6-880
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 3

When M0 is ON, outputting the pulse from Y0 with a frequency of 20 kHz to search for the zero point in the negative

direction. When the DOG signal is received and X4 is ON, the PLC decreases the frequency to the JOG frequency of 1

kHz and keeps moving in the positive direction with the JOG frequency of 1 kHz. When X4 is OFF, the axis starts to move

after 500 pulse output completes in the negative direction. Y14 outputs a 20ms-width pulse and then stops outputting.

Explanation

1. Y14 is specified as the output point for outputting the clear signal in HWCONFIG.

2. S3 is set as 16#FE0C000E.
High 16-bit [FE0C=-500] once the axis moves away from the DOG signal. The axis starts to move after 500 pulse 6_
output completes in the negative direction.

Low 16-bit [000E] is Mode 14; when the DOG signal is received, the axis moves in the positive direction; after the
axis moves away from the DOG signal, a clear signal is outputted (20ms).

Example 4 (Edited in the ST programming language)

When the DZRN instruction is used, the ladder diagram (LD) language is highly recommended for the program editing. If

this instruction is edited in the ST language, which is supported by ES3/EX3 CPU firmware V1.06.00 or later and

SV3/SX3 CPU firmware V1.00.00 or later, you must wait until the return to the zero point is completed (SM461 flag is ON),

and then disable the instruction, using the auto-reset flag to notify the PLC to return the high-speed output control right.

The programming example using Y0 output is shown in the following figure.

6-881
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2705 D PLSV S,D1,D2 Adjustable pulse output

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S      
D1 
D2  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S : Pulse output frequency

D1 : Pulse output device

D2 : Pulse direction output device

Explanation
_6
1. This instruction adjusts the pulse output frequency and direction (S) for the devices specified in D and D2. S
specifies the pulse output frequency: for open collector output models, the range is between -200 kHz to +200 kHz.
The minus sign and plus sign indicate the positive direction and negative pulse direction. You can change the pulse

output frequency during the pulse output; but if the new frequency is different from the previous frequency in

direction, the instruction stops the output, and one cycle later it outputs the target frequency again in a new direction.

2. Refer to the table below for pulse output devices for D1 and D2. When the output mode for D1 and D2 is not the

default Pulse+direction output (0 is the default value), set SR to 1, which changes the mode to A/B phase output.

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1

Output point for D1 Y0 Y2 Y4 Y6#1

Direction output point for D2 Y1 Y3 Y5 Y7#1

Output mode SR462 SR482 SR502 SR522

Busy flag SM460 SM480 SM500 SM520

SR460 SR480 SR500 SR520


Output present register
SR461 SR481 SR501 SR521

6-882
C ha pt er 6 A p pl i e d In s tr uc t io ns

Note#1: Axis 4 is not supported by SX3 series CPU.

3. The output point for the pulse direction output device D2 is affected by the scan cycle if it is not the recommended

output point in the table above.

4. The pulse direction output device D2 changes its own state according to the minus or plus sign in S. D2 is OFF if S

is plus (+) and D2 is ON if S is minus (-).

5. There is no ramp-up or ramp-down setting in the instruction. The instruction does not perform a ramp-up operation

at the beginning or ramp-down at stopping. If you want the ramp-up and ramp-down function, use the DRAMP

instruction (API 0703) for increasing and decreasing the pulse output frequency.

6. While the instruction is executing the pulse output, the output immediately stops if the drive condition changes to

OFF.

7. When the direction outputs are not using the default outputs to output, you can refer to the table below for setting up

the time for directional outputting goes first before pulse outputting. So that you can be sure the outputting only

happens when switching to the direction outputs. The unit for SR is millisecond and the range is 0-20 ms. Default is

0, indicating inactive.

Output point for D1 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7

SR number SR640 SR641 SR642 SR643 SR644 SR645 SR646 SR647

Note: the time source here is from PLC scan time.


6_
8. Refer to Example 3 from the DJOG instruction (API 2703) for programming in ST language.

Example

When M0 is ON, Y0 outputs the pulse at 20 kHz. Y1 = OFF means the positive direction for the pulse output.

6-883
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2706 D DRVI S1,S2,D1,D2 Relative Position control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D1 
D2  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Number of output pulses (relative positioning)

S2 : Pulse output frequency

D1 : Pulse output device


_6
D2 : Pulse direction output device

Explanation

1. This instruction specifies the output pulse setting for relative positioning. S1 is the number of output pulses (relative
positioning). The range is between -2,147,483,648 to +2,147,483,647, and the +/- signs indicate the positive and

negative pulse directions. When the instruction is executed and S1 is 0, it indicates not outputting and output

completion flag not be set to ON. If 0 is a possible output number in your program, it is suggested to add more

conditions in your program to rule out this possibility.

2. S2 is the pulse output frequency, and the range is between 0 Hz–200 kHz for open collector output models. If the

value in S2 is less than the Start/end frequency (Hz) set in SR (refer to the SR table below for more details), PLC

operates according to the values set in SR.

3. Refer to the following table for the selection of pulse output devices for D1 and D2. When the output mode for D1 and

D2 is not the default Pulse+direction output (0 is the default value), modify the mode by setting SR to 1, which

changes the mode into A/B phase output.

6-884
C ha pt er 6 A p pl i e d In s tr uc t io ns

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1

Output point for D1 Y0 Y2 Y4 Y6#1

Direction output point for D2 Y1 Y3 Y5 Y7#1

SR number SR462 SR482 SR502 SR522

DDRVI and DDRVA support the output devices for D1 which can be the odd points as shown in the following table.

Only the Pulse+direction output mode is supported. It is not recommended that you use the input points Y0,

Y2–Y10 as the high-speed output points.

Axis number Axis 7 Axis 8 Axis 9 Axis 10#1

Output point for D1 Y1 Y3 Y5 Y7#1

Direction output point for D2 Y120 or above or any M device (BOOL)

Note#1: Axis 4 is not supported by SX3 series CPU.

4. The output point for the pulse direction output device D2 is affected by the scan cycle if it is not the recommended
output point in the table above.

5. When D2 uses the output mode Pulse+direction and S1 has a minus sign, D2 is ON. When S1 has a plus sign, D2 is

OFF. D2 is not OFF immediately after the pulse output in the negative direction is completed. D2 switches to OFF

when the contact for the execution of the instruction is OFF.

6. For the instruction execution, you must use the parameters such as the start/end frequency and ramp-up/down time.

Refer to the following table for SM/SR corresponding to the axes. 6_


The following table applies when D1 selects the even output points as the output devices.

Output point for D1 Y0 Y2 Y4 Y6

Busy flag SM460 SM480 SM500 SM520

Completion flag SM461 SM481 SM501 SM521

Reversing the output direction SM462 SM482 SM502 SM522

Stop flag SM463 SM483 SM503 SM523

Enabling fixed slope ramp-up/down SM469 SM489 SM509 SM529

Output completion auto-reset SM470 SM490 SM510 SM530

Executing an interrupt program when


SM471 SM491 SM511 SM531
pulse output ends

Corresponding interrupt I number I500 I501 I502 I503

The output immediately stops when the


SM476 SM496 SM516 SM536
instruction is disabled or stops

6-885
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

SR460 SR480 SR500 SR520


Present output position
SR461 SR481 SR501 SR521

Start/end frequency (Hz) SR463 SR483 SR503 SR523

Ramp-up time (ms) SR464 SR484 SR504 SR524

Ramp-down time (ms) SR465 SR485 SR505 SR525

SR472 SR492 SR512 SR532


Target frequency of the fixed slope
SR473 SR493 SR513 SR533

SR610 SR612 SR614 SR616


Present output frequency
SR611 SR613 SR615 SR617

The following table applies when D1 selects the odd output points as the output devices.

Output point for D1 Y1 Y3 Y5 Y7

Busy flag SM472 SM492 SM512 SM532

Completion flag SM473 SM493 SM513 SM533

Output stop flag SM474 SM494 SM514 SM534

Output completion auto-reset SM475 SM495 SM515 SM535

The output immediately stops when the


SM477 SM497 SM517 SM537
instruction is disabled or stops

_6 SR474 SR494 SR514 SR534


Present output position
SR475 SR495 SR515 SR535

Start/end frequency(Hz) SR476 SR496 SR516 SR536

Ramp-up/down time (ms) SR477 SR497 SR517 SR537

Some flags, such as fixed slope ramp-up/down, and executing an interrupt program when pulse output ends, are

not supported by the odd output points.

If the output is ongoing, the preset output is the ramp-down stop when the instruction is disabled or stops

temporarily. If the output must be stopped immediately, set the immediately stop flag to ON.

7. Added new SR652, SR653 for displaying number of pulse in ramp-up area and new SR654, SR655 for displaying

number of pulse in ramp-down area.

Refer to the following table for Attribute, Factory default and latched values of SM/SR corresponding to the axes.

Factory
Item Attribute StopRun RunStop Power ON Latched
default

Busy flag R OFF OFF OFF OFF N

6-886
C ha pt er 6 A p pl i e d In s tr uc t io ns

Completion flag R/W OFF OFF OFF OFF N

Stop flag R/W OFF OFF OFF OFF N

Output completion N
R/W OFF OFF OFF OFF
auto-reset

Enabling fixed slope N


R/W OFF OFF OFF OFF
ramp-up/down

Executing an interrupt N

program when pulse R/W OFF OFF OFF OFF

output ends

The output N

immediately stops
R/W OFF OFF OFF OFF
when the instruction is
disabled or stops

Present output
R / Wd No change No change No change 0 Y
position

Start/end Y
R / Wd No change No change No change 200
frequency(Hz)

Ramp-up time (ms) R / Wd No change No change No change 200 Y

Ramp-down time (ms) R / Wd No change No change No change 200 Y


6_
Target frequency of R / Wd Y
No change No change No change 0
the fixed slope

Present output
R 0 0 0 0 N
frequency

Note: R mean the device is readable. W means the device is writable. Wd means the device is writable any time

except when performing the high-speed output.

8. After output completion auto-reset is enabled, the flag is automatically reset to OFF when the output completes.

You must set the flag to ON again if the auto-reset function is needed for the next output operation. It is suggested

that you use the rising-edge or falling-edge to trigger the flag every time. The function is usually used when the

output DDRVI instruction cannot be scanned and executed by PLC program after DDRVI is executed. For example,

when the instruction is executed in an interrupt program.

9. If you use the Completion flag to set the I interrupt function, the flag is automatically reset to OFF when the output

completes and the interrupt program starts. You must set the flag to ON again for the next output in which the

interrupt occurs. It is suggested that you use the rising-edge or falling-edge to trigger the flag every time.

6-887
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

10. When the direction outputs are not using the default outputs to output, you can refer to the table below for setting up

the time for directional outputting goes first before pulse outputting. So that you can be sure the outputting only

happens when switching to the direction outputs. The unit for SR is millisecond and the range is 0-20 ms. Default is

0, indicating being inactive.

Output point for D1 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7

SR number SR640 SR641 SR642 SR643 SR644 SR645 SR646 SR647

Note: the time source here is from PLC scan time.

Example 1

When M10 is ON, Y0 outputs 20,000 pulses at 2 kHz (relative positioning). Y1 = OFF means the positive direction.

Additional remarks

1. The following graph explains the relative positioning by specifying the travel distance from the current position with

the +/- signs.

_6 F requency

+ 3, 000 pulse
Target frequency

S tart/end frequency

Current position

-3, 000 pulse

2. Setting the ramp up/down and the items for relative positioning

a) Y0 output curve diagram

6-888
C ha pt er 6 A p pl i e d In s tr uc t io ns

F requency
Number of
S1:: output pulses

Slope ramp-up
S2
S tart/end frequency
SR463
Time

Ramp-up time Ramp-down time


SR464 SR465
b) You can create several DRVI instructions using the same output point in the program. The PLC can start
only one DRVI instruction when executing the program. For example, when one instruction starts Y0 for

output, then other instructions that also use Y0 for output are not executed. The instruction that starts the

output point first uses the point first.

c) After the instruction is executed, any modification of the parameters is not accepted until the instruction is
disabled.

3. Ramp-up and ramp-down for fixed slopes

a) The following graph shows the Y0 output curve diagram.

F requency

Fixed slope
Target frequency
6_
Target frequency

Original slope

S tart/end frequency
Time

Ramp-up time Ramp-down time


b) Start the fixed slope flag SM469 and write the target frequency of the fixed slope into SR472.

c) The new slope takes the place of the original slope and the DDRVI instruction performs the positioning as
shown above.

d) The general slope is determined by the start/end frequency, target frequency, and ramp up and down time.

The fixed slope is determined by the start/end frequency, target frequency of the fixed slope, and ramp up

and down time.

e) When the target frequency of the fixed slope is less than the target frequency, the fixed slope function is not
started.

4. Stop flag and immediately stop flag

6-889
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

a) The following graphic shows the output diagram based on example 1.

Ramp-down stop Immediately stop

b) Ramp-down stop
 When M10 is ON, the DDRVI instruction is executed and starts to output pulses, and SM460, the Busy

flag is ON.

 When the instruction is disabled (M10 is OFF) or the stop flag SM463 is ON, the state of the immediately
stop flag SM476 is confirmed.

 If the immediately stop flag SM476 is OFF, the output ramps down to stop and then the Busy flag SM460

is OFF.
_6
 If M10 is not OFF and the stop flag SM463 is not ON after the instruction is executed, Y0 stops the output

after 20,000 pulses.

c) Immediately stop
 When M10 is ON, the DDRVI instruction is executed and starts to output pulses, and SM460, the Busy

flag is ON.

 If the instruction is disabled (M10 is OFF) or the stop flag SM463 is ON, the state of the immediately stop
flag SM476 is confirmed.

 If the immediately stop flag SM476 is ON, the output stops immediately and the Busy flag SM460 is OFF.

6-890
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. Hardware limit function

a) The following graphic shows the output curve diagram of axis 1 (Y0/Y1).

Positive limit function Negative limit function

b) Operation of the positive limit


 Positive limit input point X6 is set in HWCONFIG and downloaded to the PLC. When SM464 is set to ON,

the positive limit function starts.

 DDRVI outputs 20,000 pulses in the positive direction. Note: the instruction does not output in the
positive direction if the positive limit point is ON when the function starts. 6_
 When the limit input point X6 is triggered by the external mechanism and is ON, the condition for the

hardware positive limit function is met.

 DDRVI instruction stops the output immediately and the positive limit alarm SM465 is ON.

 If the condition for the hardware limit function is not met, Y0 stops the output after 20,000 pulses.

c) Operation of the negative limit


 Negative limit input point X7 is set in HWCONFIG and is downloaded to PLC. When SM466 is set to ON,

the negative limit function starts.

 DDRVI outputs 20,000 pulses in the negative direction. Note: the instruction does not output in the

negative direction if the negative limit point is ON when the function starts.

 When the limit input point X7 is triggered by the external mechanism and is ON, the condition for the

hardware negative limit function is met.

 DDRVI instruction stops the output immediately and the negative limit alarm SM467 is ON.

 If the condition for the hardware limit function is not met, Y0 stops the output after -20,000 pulses.

6-891
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

d) SM flags related to the limit function

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1

Enabling the hardware positive limit SM464 SM484 SM504 SM524

Positive limit alarm flag SM465 SM485 SM505 SM525

Enabling the hardware negative limit SM466 SM486 SM506 SM526

Negative limit alarm flag SM467 SM487 SM507 SM527

Note: The limit point alarm flag is read-only and is set or reset automatically by the PLC according to the state of

the start flag.

Note#1: Not supported by SX3 series CPU.

6. Software limit function

a) The following diagram shows the output curve diagram of axis 1 (Y0/Y1).

Positive limit function Negative limit function

_6

b) Operation of the positive limit


 Positive software limit position is set in HWCONFIG (by setting SR580=11,000 for example). After

downloading the setting to the PLC, it means the positive limit function starts.

 DDRVI starts to output 20,000 pulses in the positive direction. Note: the instruction does not output in the

positive direction if the positive limit is exceeded when the function starts.

 When the current position SR460 > the limit position SR580, it means that the condition for the software limit

function is met.

 DDRVI instruction stops the output immediately and the positive limit alarm SM465 is ON.

 If the condition for the limit function is not met, Y0 stops the output after 20,000 pulses.

6-892
C ha pt er 6 A p pl i e d In s tr uc t io ns

c) Operation of the negative limit


 Negative software limit position is set in HWCONFIG (by setting SR582 = –11,000 for example). After

downloading the setting to the PLC, the negative limit function starts.

 DDRVI starts to output 20,000 pulses in the negative direction. Note: the instruction does not output in the

negative direction if the negative limit is exceeded when the function starts.

 When the current position SR460 < the limit position SR582, the condition for the software negative limit

function is met.

 DDRVI instruction stops the output immediately and the negative limit alarm SM467 is ON.

 If the condition for the software limit function is not met, Y0 stops the output after -20,000 pulses.

d) Rising-edge trigger 6_
Limit function Contact A Contact B
Types Rising-edge trigger Falling-edgetrigger

Descriptions
When started: from low to When started: from high to
high and maintains at high low and maintains at low

e) SR related to the limit function

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1

SR580 SR584 SR588 SR592


Positive software limit position
SR581 SR585 SR589 SR593

SR582 SR586 SR590 SR594


Negative software limit position
SR583 SR587 SR591 SR595

Note#1: Not supported by SX3 series CPU.

6-893
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Positive output limit: the output stops immediately if the current position is greater than the positive limit

position.

Negative output limit: the output stops immediately if the current position is less than the negative limit position.

When the positive and negative limits are both 0, the software limit function cannot start. Since the software limit

function checks the output position when the output instruction is scanned, stopping the output is affected by

the PLC scan. To quickly stop the output in real time, use the external input point as the limit point.

7. ST Example

Explanation

7.1 When M0 is ON, Y0 outputs 1000 pulses at 1 kHz.

7.2 When the pulse output completes, SM461 is ON and SM470=ON is triggered.

7.3 The pulse output restarts when M0 changes from OFF to ON again
_6
7.4 When there are more than two high-speed output instructions in a program, do not use the variable name, M1,

repeatedly.

7.5 It is suggested not to use ST language in a program if there is any chance the outputting needed to be stopped.

8. Function block example

Main program

6-894
C ha pt er 6 A p pl i e d In s tr uc t io ns

Function block 1

Function block 2

Explanation

When M0 is ON, Y0 outputs 10000 pulse at 1kHz. Y1 = OFF means the pulse output direction is positive.

9. Be sure to refer to PLSR instruction (API2701) for more details on changing target frequency during outputting.
Remember if there is any change on the target frequency, the change can only be carried out after the original
target frequency completes outputting.
10. Changing the target position during outputting:
10.1 You cannot change outputting direction 6_
even after the target position is changed. For example, if the original output target position is in the positive

direction, after the target positon is changed, it still outputs in the positive positive.

10.2 After you set the change flag, the changing happens when the instruction is being scanned. And after it is

changed, the change flag is cleared off. But if the target position is set incorrectly, the change flag keeps ON.

10.3 Refer to the following table for the corresponding outputs and change flag SM.

Output point Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7

SR number SM478 SM479 SM498 SM499 SM518 SM519 SM538 SM539

10.4 This changing target posiiton funciton is available for DDRVI and DDRVA insturcitos. When the instruction

DDRVI is used and a change flag is set, the change will be executed. Even if the output number is 0, the

operation will be carried out and stop outputting. When the instruction DDRVA is used, if the changed target

position is the same as the previous one, this change will not be performed.

10.5 Three situations may occur, when changing target position during output.

6-895
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Situation A: changing timing occurs during outputting in the ramp-down area.


 oringinal target position when started (blue)
 new number of output pulse >= remaining number of output pulse, its outputting curve (red).
 new number of output pulse < remaining number of output pulse, its outputting curve (green).
PLC change & clear
User set

Change SM

Freq.

Pulse no.



Situation B: changing timing occurs during outputting in the target frequency area.
 oringinal target position during initial start (blue)
 new number of output pulse >= number of output pulse in ramp-down area, its outputting curve (red).
 new number of output pulse < number of output pulse in ramp-down area, its outputting curve(green)
PLC change & clear
User set

Change SM

_6
Freq.

Pulse no.


Situation C: changing timing occurs during outputting in the ramp-up area.


 oringinal target position during initial start (blue)
 new number of output pulse >= number of output pulse in ramp-down area, its outputting curve (red).
 new number of output pulse < number of output pulse in ramp-down area, its outputting curve(green)

6-896
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

2707 D DRVA S1,S2,D1,D2 Absolute position control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
D1 
D2  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Number of output pulses (absolute positioning)

S2 : Pulse output frequency

D1 : Pulse output device 6_


D2 : Pulse direction output device

Explanation

1. This instruction specifies the output pulse setting for absolute positioning. S1 is the number of output pulses
(absolute positioning). The range is between -2,147,483,648 to +2,147,483,647, and +/- signs indicate the positive

and negative pulse directions. When the instruction is executed, it checks the current position with S1. If S1 is 0, it

indicates not outputting and output completion flag not be set to ON. If 0 is a possible output number in your

program, it is suggested to add more conditions in your program to rule out this possibility.

2. S2 is the pulse output frequency and the range is 0 Hz–200 kHz for the open collector output models. If the value in

S2 is less than the Start/end frequency (Hz) set in SR (refer to the SR table of DRVI instruction for more details),

PLC operates according to the values set in SR.

3. Absolute positioning means that the instruction outputs pulses to move from current position until the specified

target position is reached. For example, the number of output pulses at current position is 100 and the number of

pulses at the target position S1 is set to 1000. So the number of the actual output pulses is 1000-100=900.

4. Refer to the DDRVI instruction (API 2706) for more explanation.

6-897
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

If the value of the present output position SR460 (32-bit) is 100 and M10 is ON, then the DDRVA instruction causes Y0 to

output pulses at 2 kHz until the value in SR460 becomes 20,000 (absolute positioning). Y1 = OFF means the positive

direction.

Additional remarks

1. The following graph shows absolute positioning: the way of specifying the distance from the center (zero point).

F requency

+ 3, 000 pulse
Target frequency

S tart/end frequency
_6
Zero point

0 pulse

6-898
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

2708 CSFO S1,S2,S3,S4,S5,D1,D2 Catch speed and proportional output

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
S3 
S4 
S5 
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1 
S2  
S3  
S4 
S5 
D1 
D2  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 -
6_

Symbol

S1 : Signal input device

S2 : Number of input pulses

S3 : Pulse input frequency


Denominator (output frequency) for the proportion of the input
S4 :
frequency and output frequency

S5 : Numerator (input frequency) for the proportion of the input


frequency and output frequency
D1 : Pulse output device

D2 : Pulse output frequency

Explanation

1. This instruction specifies the catch speed and proportional output. S1 can only specify X0, X2, X4, X6, X10#1 and
X12#1 as the input points, and the operand occupies two consecutive input points. You cannot execute the

instruction if the input points are the points specified for S1 above. After you select the input points, the high-speed

counter is automatically specified. If there is a DCNT instruction (API 1004) with the same high-speed counter in the

6-899
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

program, the PLC first executes the instruction that starts the counter first. The input points and corresponding

high-speed counters are shown in the following table.

Group number 1 2 3 4 5#1 6#1

S1+0 input point


X0 X2 X4 X6 X10 X12
(Phase A)

S1+1 input point


X1 X3 X5 X7 X11 X13
(Phase B)

High-speed counter
HC202 HC206 HC210 HC214 HC218 HC222
number

Flag for reversing


SM270 SM271 SM272 SM273 SM274 SM275
input direction

Note#1: Not supported by SX3 series CPU.

2. If the high-speed counters for the instruction can use only the phase A/B input mode, set the flag for reversing the

input direction to ON when MPG is connected but has not rotated yet, and the PLC input point is ON. Set the

function to detect the state of PLC run cycle to OFF.

3. S2 is the number of input pulses. Use a 32-bit variable to declare the parameter.

4. S3 is the frequency of input pulses. Use a 32-bit variable to declare the parameter with the unit of 1 Hz.

_6
5. S4 is the denominator (output frequency) for the proportion of the input frequency and output frequency. S5 is the

numerator (input frequency) for the proportion of the input frequency and output frequency. The range of S4 and S5

is between 1–255. If the setting value exceeds the range, the instruction is processed as the maximum or minimum

value. For example, if input frequency: output frequency= 5:3, the denominator output frequency is K3 and the

numerator input frequency is K5. If the input frequency: output frequency=1:2, the denominator output frequency is

K2 and the numerator input frequency is K1.

6. D1 can only specify Y0, Y2, Y4, and Y6 as the output points and occupies two consecutive output points.

The output points and corresponding output mode SR are shown in the following table.

Output axis number 1 2 3 4#1

D1+0 output point Y0 Y2 Y4 Y6#1

D1+1 output point Y1 Y3 Y5 Y7#1

Output mode SR462 SR482 SR502 SR522

Note#1: Not supported by SX3 series CPU.

7. D2 is the frequency of the output pulses. Use a 32-bit variable to declare the parameter with the unit of 1 Hz.

6-900
C ha pt er 6 A p pl i e d In s tr uc t io ns

8. There is no limit to the number of times you can use this instruction; but the high-speed input and output points

cannot be used by other instructions when this instruction is executed. Otherwise, the instruction cannot be

executed.

9. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

Notes

1. The PLC calculates the input pulse frequency based on the input pulse width (ON) in the positive half cycle. If the

proportion of the pulse width for ON: pulse width for OFF is not 1:1, the PLC takes the ON width as the standard for

conversion by default.

2. The input pulse=ON means the input point LED is on. When using the MPG but it has not rotated yet, you can check

if the input point LED is OFF and the flag for reversing the input direction is activated.

3. The minimum pulse frequency for input and output is 50 Hz. If the actual input pulse is 10 Hz and the value in S3

shows 10 Hz. But since the minimum pulse frequency for output is 50 Hz, the instruction uses 50 Hz instead of 10 Hz

to calculate. For the ratio 1:2, after conversion, the output pulse is 100 Hz. For the ratio 2:1, after conversion, the

output pulse is 50 Hz instead of 25 or 5 Hz.

4. You can modify values in S4 or S5 during the execution of this instruction. But you need to re-execute this instruction

to actualize this modification. Otherwise the value in S2 is not accurate enough to be used for calculating the current 6_
output position of SR.

5. After conversion, if the output pulse frequency exceeds the maximum limit, the error code is recorded as 16#2030 in

Error Log File in the software and SM29 is ON. SR29 is the axis number.

6. If the input pulse is 0 Hz and lasts for more than 2 seconds, PLC stops outputting automatically and the error code is

recorded as 16#2031 in Error Log File in the software and SM29 is ON. SR29 is the axis number.

Example 1

X0/X1 input pulses for detecting the MPG. When M0 is ON, the setting values of S4 and S5 are both 1 (D4=1 and D5=1).

When the input frequency is 500 Hz (D2, D3=500) and the number of pulses is 2500 (D0, D1=2500), the output axis

(Y0/Y1) outputs 2500 pulses (SR460, SR461=2500) at 500Hz (D10, D11=500).

6-901
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 2

When M0 is ON, the setting values of S4 and S5 are 3 and 5 (D4=3, D5=5) respectively. When the input frequency of the

MPG is 500 Hz (D2, D3=500) and the number of pulses is 2500 (D0, D1=2500), the output axis (Y0/Y1) outputs 1500

pulses (SR460, SR461=1500) at 300 Hz (D10, D11=300).


_6

6-902
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

2709 D DRVM S1,S2,S3,S4,S5,S6,D1,D2 Mark alignment positioning

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3  
S4    
S5    
S6    
D1 
D2  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3 
S4  
S5  
S6  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction 6_


- - ES3/EX3/SV3/SX3

Symbol

S1 : Target number of output pulses

S2 : Target output frequency

S3 : Input point number for receiving the external interrupt signal

S4 : The number of output pulses at the end for the fore mask section

S5 : The number of output pulses at the beginning for the rear mask section
The number of output pulses in the ramp-down process after the
S6 :
interrupt signal is received
D1 : Pulse output device

D2 : Direction pulse output device

Explanation

1. This instruction performs mark alignment positioning. When the value of S1 is 0, it indicates the output is a maximum
32-bit value (with a sign) and the output does not perform the ramp-down stop until receiving the mark signal.

6-903
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

If the value of S1 is not 0 and the external interrupt does not occur, the target number output pulses are output. The

range of S1 is between -2,147,483,648 to +2,147,483,647, and the +/- sign means the positive or negative direction.

2. When the value of S2 is less than or equal to 0, the output is not enabled. If the output frequency is greater than the

maximum frequency, the PLC processes it as the maximum output frequency.

3. S3 can specify the X0~X7 and X10~X17 device as the input point. The input source signal is affected by the scan

cycle if the selected input point is not in M0–X15 in the PLC.

4. You must use the instruction by combining the input point number and the external interrupt program to achieve the

real-time ramp-down output. For the rising-edge or falling-edge trigger for the external interrupt, select the triggers in

the external interrupt program in the software.

A. Using the external interrupt (e.g. I0xx, I1xx): when the external interrupt occurs, the ramp-down stop is

performed after the mark signal is received. No operation is performed if the external interrupt is not enabled.

B. Without using the external interrupt (I0xx, I1xx): When the instruction is executed, the ramp-down stop is

performed after the mark signal is received if the rising edge occurs at X point or M device. It is affected by the

scan time.

5. The number of output pulses in the fore mask section is between 1–S4. When the setting value for S4 is 0, it means

the fore- mask section function is disabled. When the number of pulses to be masked exceeds the value of S1, the

instruction takes the target number of output pulses S1 as the number to be masked. If the external input trigger

occurs within the number of output pulses to be masked, the external input interrupt is automatically invalid.
_6
6. The number of output pulses in the rear mask section is between S5 and S1. When S5 =0 or S5 >=S1, the rear mask

section function is disabled. When the external input trigger occurs in the masked sections, the external input

interrupt is automatically invalid. When S4 >S5, it indicates the external input interrupt is invalid in the output process.

7. If the fore and rear mask sections are both set and S4 < S5, the valid input interrupt occurs in the section between

S4+1 and S5-1.

8.

S6: the number of output pulses in the ramp-down Description

the ramp-down stop is performed based on the


If S6 is set to 0 after the mark signal is received
ramp-down time

If S6 =-1 or < 0 after the mark signal is received the output immediately stops

The instruction limits the target frequency and performs


If the setting value of S6 is not enough to achieve the
the ramp-down stop in accordance with the set
ramp-down stop within the ramp-down time,
ramp-down time

6-904
C ha pt er 6 A p pl i e d In s tr uc t io ns

S6: the number of output pulses in the ramp-down Description

The instruction outputs the number of redundant pulses


If S6 is greater than the number of pulses output within
with the same output frequency when the interrupt is
the ramp-down time,
triggered, and then performs the ramp-down process

9. If S6 is set to 0 after the mark signal is received, it means that the ramp-down stop is performed based on the

ramp-down time. If S6 is set to -1 after the mark signal is received, it means that the output immediately stops. If S6 is

set to >0 after the mark signal is received and if the setting value of S6 is not enough to achieve the ramp-down stop

within the ramp-down time, the instruction limits the target frequency and performs the ramp-down stop in

accordance with the set ramp-down time. If S6 is greater than the number of pulses output within the ramp-down

time, the instruction outputs the number of redundant pulses with the same output frequency when the interrupt is

triggered, and then performs the ramp-down process.

S6: the number of output pulses in the ramp-down Description

If S6 = > 0 after the mark signal is received The instruction limits the target frequency and performs

the ramp-down stop in accordance with the set


If the setting value of S6 is not enough to achieve the
ramp-down time
ramp-down stop within the ramp-down time,

If S6 = > 0 after the mark signal is received The instruction outputs the number of redundant pulses

If S6 is greater than the number of pulses output within


with the same output frequency when the interrupt is 6_
triggered, and then performs the ramp-down process
the ramp-down time,

The ramp-down stop is performed based on the


If S6 is set to 0 after the mark signal is received
ramp-down time

If S6 =-1 after the mark signal is received The output immediately stops

If S6 =< -1 after the mark signal is received


The instruction does NOT limit the target frequency and

If the setting value of S6 is not enough to achieve the after outputting the number of output pulses, the output

ramp-down stop within the ramp-down time, stops immediately

If S6 =< -1 after the mark signal is received


The instruction outputs the number of redundant pulses

If S6 is greater than the number of pulses output within with the same output frequency when the interrupt is

the ramp-down time, triggered, and then performs the ramp-down process

 Added new SR652, SR653 for displaying number of pulse in ramp-up area and new SR654, SR655 for

displaying number of pulse in ramp-down area.

6-905
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

10. If the output has entered the ramp-down process when the external input interrupt trigger occurs, the instruction

completes the output of the number of pulses specified by S6.

See the following timing diagram about the output, interrupt trigger, mask and relevant flags. For the completion flag,

refer to the Completion flag SM for the axes in DDRVI instruction (API 2706).

EN
S4 S5

S3

finish flag
S2

D1
Time
0
Pulse No.
S6
S1

11. The target frequency S2 of the instruction can be modified in the process of the pulse output. Since the number of
output pulses in the ramp-down section has been set when the instruction is executed, the timing diagram for

changing the frequency is shown as the following dashed line.

_6

S3

Change S2

S2
D1
Time
Pulse No.
S6

12. Refer to the DDRVI instruction (API 2706) for the selection of pulse output devices for D1 and D2. The output points
for D1 can only be even-numberd such as Y0, Y2 or Y6. If the output points are not the recommended ones, the

direction output D2 is affected by the scan cycle.

13. The SM441 flag for the two-speed function is supported. ES3 CPU with firmware V1.08.00 or later works with

ISPSoft V3.17 or later/ DIADesigner V1.30 or later, and ES300TEC/EX3/SV3/SX3 CPU with firmware V1.00.00 or

later works with DIADesigner V1.30 or later.

6-906
C ha pt er 6 A p pl i e d In s tr uc t io ns

A. You set the SM441 flag to ON. The two-speed function is activated when the instruction is executed and

then the system automatically resets SM441 to OFF.

B. When the two-speed function is enabled, changing the target speed is not supported during instruction

execution.

C. The methods of setting the target output pulse numbers (target positions) for the first and second speeds

and setting the first and second target output speeds are as follows:

S1 is the target output pulse number (target position) of the first speed (P1), Device: D0.

S1+1 is the target output pulse number (target position) of the second speed (P2), Device: D2;

S2 is the first target output speed (V1), Device: D100.

S2+1 is the second target output speed (V2), Device: D102.

Taking the positive or negative sign of the target output pulse number of the first speed (P1) as the output

direction, the total target output pulse number is the sum of both absolute values of the target output

pulse numbers of the first and second speeds, that is, ABS(P1)+ABS(P2).

V1 >= V2

6_

Vbase T1 T2+T3 P(1) V(1) P(2) V(2)


Initial Acceleration Deceleration Position of the Position of the
First speed Second speed
frequency time time first speed second speed

6-907
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

V1 < V2
Speed
(Hz) V(2)

V(1)

Acc e lera tio n Full spe ed area A cc ele ra tion Fu ll spe e d are a Dec e lera tio n
are a are a area
P(1) P(2)
Vbase Vbase

Time(ms)
T1 T2 T3

Vbase T1+T2 T3 P(1) V(1) P(2) V(2)


Initial Acceleration Deceleration Position of the Position of the Second
First speed
frequency time time first speed second speed speed

14. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

_6

6-908
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 1

X4 external interrupt program

6_
Notes

1. When M0 changes from OFF to ON, Y0 starts to output pulses. After outputting more than 30,000 pulses, the

external interrupt is detected on X4. The value in D0 increases by 1 and the pulse output stops after 15,000 pulses
(S6 = 15,000). If the interrupt does not occur, the output does not stop until 100,000 pulses are output.

2. If the number of output pulses is between 1–30,000, they are in the fore mask section. The external interrupt occurs

at X4 at the moment and the instruction does not perform the ramp-down stop operation.

3. If the number of output pulses is between 70,000–100,000, they are in the rear mask section. The external interrupt

occurs at X4 at the moment and the instruction still does not perform the ramp-down stop operation.

4. When the pulse output completes, SM461 is ON and M0 is reset.

6-909
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Additional remarks
1. The alignment mark function and mask function:
 When DDRVM is executed, the pulse output starts.
 When the interrupt occurs for the mark alignment, the ramp-down process starts and the output stops after the
number of the pulses specified by S6.
 When the interrupt for the mark alignment does not occur or has no effect, DDRVM stops outputting the pulses
after the target number of pulses specified by S1.
S4: The number of output pulses in the fore mask section. If the interrupt occurs in this section, the interrupt is
ineffective for the mark alignment.
S5: The number of output pulses in the rear mask section. If the interrupt occurs in this section, the interrupt is
ineffective for the mark alignment.
S2: The target output frequency

_6 2. The mark alignment function is enabled in the ramp-up and target frequency and ramp-down sections.
When the mark alignment function is not enabled, set S1 = 100,000; the output stops after 100,000 pulses.
 Green line: signal of mark alignment
 Blue line: the actual output speed

Case 1: when the mark alignment occurs in the ramp-up section


 Green line: signal of mark alignment
 Blue line: the actual output speed
The operation of the mark alignment (green line: OFF -> ON) begins when the number of pulses is 3000. The target
frequency of 10 kHz cannot be reached even if S6 is 15,000.

6-910
C ha pt er 6 A p pl i e d In s tr uc t io ns

Case 2: when the mark alignment occurs in the ramp-up section


 Green line: signal of mark alignment
 Blue line: the actual output speed
The operation of the mark alignment (green line: OFF -> ON) begins when the number of pulses is 6000. The target
frequency of 10 kHz can be reached if S6 is 15,000.

6_
When the mark alignment occurs in the target frequency section
 Green line: signal of mark alignment
 Blue line: the actual output speed
The operation of the mark alignment (green line: OFF -> ON) begins when the number of pulses is 50,000. Set S6 =
15,000; the output stops after 15,000 pulses.

Case 1: when the mark alignment occurs in the ramp-down section


 Green line: signal of mark alignment
 Blue line: the actual output speed
The operation of the mark alignment (green line: OFF -> ON) begins when the number of pulses is 95,000.
Set S6 = 15,000; the output stops after 15,000 pulses at the current speed.

6 - 9 11
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Case 2: when the mark alignment occurs in the ramp-down section


 Green line: signal of mark alignment
 Blue line: the actual output speed
The operation of the mark alignment (green line: OFF -> ON) begins when the number of pulses is 95,000. After the mark
alignment, set S6 to -1, the output stops immediately.

_6

6-912
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description


2-Axis relative-coordinate
2710 D PPMR S1,S2,S3, D1,D2
point-to-point synchronized motion

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Number of output pulses for the X axis


6_
S2 : Number of output pulses for the Y axis

S3 : Maximum point-to-point output frequency

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. This instruction performs 2-axis relative-coordinate point-to-point synchronized motion. S1 and S2 specify the

number of output pulses (relative positioning) for the X and Y axes. The range is between: -2,147,483,648 to

+2,147,483,647, and the +/- sign indicates the positive/negative direction.

2. S3 specifies the maximum point to point output frequency. The range is between 1 Hz–200 kHz.

3. For ES3 CPU firmware V1.04.00 or later and EX3/SV3/SX3 CPU firmware V1.00.00 or later, you can change the

target frequency during execution of the instruction. After the original target frequency completes outputting, new

target frequency can be used. And the ramp up and ramp down time from the original target frequency to the new

target frequency is calculated according to the interval frequency and interval time since the instruction is enabled.

6-913
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Refer to DPLSR instruction for the details on the actual movement in the ramp down section that is between the new

target frequency and the next target frequency.

4. D1 and D2 are the output devices for the X and Y axes respectively. You can designate the following four axes for

output but you cannot change the fixed direction output points. The direction signal: OFF means in positive direction

and ON is in negative direction. If you do not use the preset Pulse+direction output mode (default: 0), change the

output mode by setting SR to 1.

Axis number Axis 1 Axis 2 Axis 3 Axis 4#1

Output point for D1 Y0 Y2 Y4 Y6#1

Direction output point for D2 Y1 Y3 Y5 Y7#1

SR number SR462 SR482 SR502 SR522

Note#1: Not supported by SX3 series CPU.

5. The PLC assigns the value of S3 to the X or Y axis depending on which outputs the largest number of pulses. If the

numbers of pulses output for the two axes are excessively different, so that no proper output frequency can be

calculated through the numbers of their output pulses, the PLC automatically decreases the maximum point to point

frequency and without any error message appearing.

6. The instruction uses the parameters such as the start and end frequencies and ramp-up and ramp-down times for

the axes the instruction executes. Instead of the originally configured parameters for the axes, the X axis

parameters are taken as the reference source. For example, when the X axis selects axis 1 and the Y axis selects
_6
axis 3 for the output, axis 1 parameters become the parameter sources for the start frequency and ramp up and

ramp-down time.

7. The following table shows the flags for the axes and the corresponding SM/SR.

Axis number Axis 1 Axis 2 Axis 3 Axis 4

Busy flag SM460 SM480 SM500 SM520

Completion flag SM461 SM481 SM501 SM521

SR460 SR480 SR500 SR520


Present output position
SR461 SR481 SR501 SR521

Start/end frequency SR463 SR483 SR503 SR523

Ramp-up time SR464 SR484 SR504 SR524

Ramp-down time SR465 SR485 SR505 SR525

8. There is no limit to how many times you can use the instruction in a program. But during the execution of the

instruction, it cannot execute the output (if the Y axis output is being used) until the Y axis completes its output and

is released.

6-914
C ha pt er 6 A p pl i e d In s tr uc t io ns

9. When the 2-axis synchronized pulse output completes, the corresponding Completion flags for the two axes is set.

Since the same timing for the completion of the 2-axis synchronized pulse output cannot be ensured every time, the

program should check the Completion flags of both axes before executing the next user program.

Example 1 (Ladder diagrams)

1. Draw a rhombus as shown below.

Y軸

(0, 0)
X軸

(-2 7000, -270 00) (27 000, -27000 )

(0,-5 5000)
2. Steps:

 Set the coordinates of four points (0, 0), (-27000, -27000), (0, -55000), (27000, -27000) as in the figure
above. Calculate the relative coordinates of the four points and obtain (-27000, -27000),

(27000, -28000), (27000, 28000), and (-27000, 27000). Place them in the 32-bit registers (D200, D202), (D204,

D206), (D208, D210), (D212, D214). 6_


 RUN the program in the PLC. Set M0 to ON to start the 2-axis line drawing.

6-915
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

3. Operation:

When PLC runs the program and M0 is ON, the PLC starts the first point-to-point motion at 100 kHz. D0 increments by 1

whenever a point-to-point motion is completed and the second point-to-point motion starts to execute automatically. The

operation pattern repeats until the fourth point-to-point motion completes.

Example 2 (ST program)

6-916
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. When M0 is ON, Y0 and Y2 outputs 1000 pulses at 1kHz simultaneously. When M1 is ON, it indicates Y0 and Y2
are used for high-speed pulse output.

2. When the Y0 pulse output is completed, SM461 is ON. When the Y2 pulse output is completed, SM481 is ON. And
if M1 is also ON, it triggers SM470 (output completion auto-reset for Y0) and SM490 (output completion auto-reset

for Y2) to be ON. Y0 and Y2 are free and ready to be used again and M1 is cleared to OFF.

3. When M0 switches from OFF to ON, the pulse output is restarted.

4. When there are more than two high-speed output instructions in a program, do not use the variable name, M1,
repeatedly.

5. It is suggested not to use ST language in a program if there is any chance the outputting needed to be stopped.

6_

6-917
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


2-Axis absolute-coordinate
2711 D PPMA S1,S2,S3, D1,D2
point-to-point synchronized motion

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

S1 : Number of output pulses for the X axis

_6 S2 : Number of output pulses for the Y axis

S3 : Maximum point-to-point output frequency

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. This instruction performs 2-axis absolute-coordinate point-to-point synchronized motion. S1 and S2 specify the

number of output pulses (absolute positioning) for the X and Y axes.

2. For more information, refer to the DPPMR instruction (API 2710).

6-918
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example

1. Draw a rhombus as in the figure below.

A xis Y

(0,0)
Axis X

(-27,000, -27,000) (27,000, -27,000)

(0, -55,000)

2. Steps:

 Set the four coordinates (-27000, -27000), (0, -55000), (27000, -27000) and (0, 0) as in the
figure above. Place them in the 32-bit registers (D200, D202), (D204, D206), (D208, D210),

(D212, D214).

 RUN the program in the PLC. Set M0 to ON to start the 2-axis line drawing.

6_

6-919
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

3. Operation:

When PLC runs the program and M0 is ON, the PLC starts the first point-to-point motion at 100 kHz. D0 increments by 1

whenever a point-to-point motion completes and the second point-to-point motion starts to execute automatically. The

operation pattern repeats until the fourth point-to-point motion completes.

6-920
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description


2-Axis relative-position clockwise arc
2712 D CICR S1,S2,S3,S4,S5,D1,D2
interpolation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3       
S4      
S5      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3   
S4  
S5  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
6_
Symbol

S1 : X axis target coordinate (relative positioning)

S2 : Y axis target coordinate (relative positioning)

S3 : The shift of the center or the central angle

S4 : Target reference frequency

S5 : Function selection

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. S1, S2 and S3 respectively designate the X axis target coordinate, Y axis target coordinate (relative position) and the
shift of the center or a central angle of a circle. Refer to the following clockwise arc operation for details.

2. D1 and D2 are the pulse output devices for the X and Y axes respectively. Refer to the DPPMR instruction (API 2710)

for the selection of output points and output modes for the axes.

6-921
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

3. S4 sets the target frequency for the reference. The target reference frequency is used for the prior calculation when

the PLC plans the travel path for the arc after the instruction is executed. But if the estimated calculation process

cannot achieve the arc travel path, the output frequency is automatically decreased to fulfill the synchronized arc

drawing function.

4. S5 is the setting value for function selection. See the descriptions below.

Setting value in S5 S3 : The shift of the center or central angle Description


The arc resolution uses a 10° arc as the basic
0 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 5° arc as the basic
1 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 1° arc as the basic
2 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 10° arc as the basic
10 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 5° arc as the basic
11 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 1° arc as the basic
12 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 10° arc as the basic
angle for motion to create a 90 degree arc of
an ellipse and to end at a point where X and Y
20 Invalid
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
The arc resolution uses a 5° arc as the basic
angle for motion to create a 90 degree arc of
_6 21 Invalid
an ellipse and to end at a point where X and Y
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
The arc resolution uses a 1° arc as the basic
angle for motion to create a 90 degree arc of
an ellipse and to end at a point where X and Y
22 Invalid
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
Seen as setting value in S5 is 0
Other Shift of the center (32-bit integer type) The arc resolution uses a 10° arc as the basic
angle for motion.

5. Refer to Example 2 of the DPPMR instruction for more details on ST language programming.

6-922
C ha pt er 6 A p pl i e d In s tr uc t io ns

Drawing a clockwise arc (for Setting values 0~12 in S5)

1. Define the four quadrants (QI, QII, QIII and QIV) of a coordinate system as in the graph below. Point A indicates the
current coordinates on the X and Y axes.

II I
X
A
III IV

2. Point B is the target coordinates specified by S1 and S2. Point O is the center of a circle enclosing both point A and
point B.
3. S3 is the distance to shift the center point O. S3 can also be the distance to shift the center point or central angle, if it
is defined as the central angle, it is the included angle of AOB. Setting range: 0.0 < S3 <360.0 (unit: degree)
4. The point A represents the origin of the axes X and Y in a plane. The target point B can be in Quadrant I, II, III, IV of
the plane. Use the target point B to connect to the point A to draw a line and then use the setting values (shift the
center point or central angle) in S3 to define an arc travel path.
The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant I and IV with
different setting values in S3 (shift the center point). (r: radius)
B

S3 >= 0
O 6_
S3 < 0 B
A
r O
r

S3>= 0 S3< 0

5. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant I and IV with
different setting values in S3 (shift the central angle). (r: radius)

S3<= 180.0 S3> 180.0

6-923
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant II and III with
different setting values in S3 (shift the center point). (r: radius)
A

S3 < 0
O
S3 >= 0 A B O
r
r

S3>= 0 S3< 0

7. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant II and III with
different setting values in S3 (shift the central angle). (r: radius)

_6 S3<= 180.0 S3> 180.0

8. When the point B is at a point where the value in X axis is 0 and the value is >= in Y axis, the point B is in Quadrant I.
While if the point B is at a point where the value in X axis is 0 and the value is < 0 in Y axis, the point B is in
Quandrant III.

Drawing a 90 degree clockwise arc (for Setting values 20~22 in S5)

1. Define the four quadrants (QI, QII, QIII and QIV) of a coordinate system as in the graph below. Note that you need

use ES3/EX3 with FW V1.04.30 or later, or SV3/SX3 with FW V1.00.00 or later for this function.

II I
X
III IV

6-924
C ha pt er 6 A p pl i e d In s tr uc t io ns

2. Use the values in S1 (X axis target coordinate) and in S2 (Y axis target coordinate) to identify the target position in

one of the following four quadrants.

Y ax is

QI I QI
X ax is
QII I QI V

3. Since the distances bewteen the starting positions and the target positions in the X and Y axes are not the same,
and the travel path will be formed by a 90 degree arc of an ellipse. This function is useful for applications that draw
elliptical arcs.

Example

1. Draw a DELTA LOGO as the figure below.

6_

2. Steps: divide the logo into three parts.

 For an ellipse: use the DCICR instruction for the relative-position clockwise arc interpolation.

 The absolute coordinates of the ellipse: P1 (39930, -9982), P2 (-9982, 39930), P3 (73206, 123119) and P4 (123119,
73206).

6-925
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

 Taking (39930,-9982) as the starting point, yields these relative coordinates: (-49912, 49912), (83188, 83189),

(49913, -49913) and (-83189, -83188).

_6

6-926
C ha pt er 6 A p pl i e d In s tr uc t io ns

When the PLC runs the program and M1 is ON, the PLC starts drawing the first segment of the arc. D1

increments by one when a segment of arc is completed and the second segment of the arc starts to

automatically execute. This operation pattern repeats until the fourth segment of arc is completed.

When D1=1, using DCICR, the PLC draws the first-segment arc from P1 to P2 with the shift of the center of the circle:

18825 and arc resolution: 5.

When D1=2, using DCICR, the PLC draws the second-segment arc from P2 to P3 with the shift of the center of the

circle: 110295 and arc resolution: 5.

When D1=3, using DCICR, the PLC draws the third-segment arc from P3 to P4 with the shift of the center of the 6_
circle: 18825 and arc resolution: 5.

When D1=4, using DCICR, PLC draws the fourth-segment arc from P4 to P1 with the shift of the center of the circle:

110295 and arc resolution: 5.

 For a circle = use DCCMR instruction (API 2716) for the relative-position circle drawing.

 The absolute coordinates of the circle: P5 (86213,15435) and P6 (103048,37425) . Taking (86213,15435) as

the starting point, yields the relative coordinates for the center of the circle as (16835,21990) .

6-927
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

When the PLC runs the program and M2 is ON, the PLC starts to draw the relative-position circle with the target

reference frequency of 20 kHz.

 For a delta, use DPPMA (API 2711) for the absolute-position 2-axis synchronized motion.

 Absolute coordinates of the delta= starting point P7 (-80360,23641), P8 (208552,-23641) and P9 (62096,206884).

_6

6-928
C ha pt er 6 A p pl i e d In s tr uc t io ns

When the PLC runs the program and M0 is ON, the PLC starts drawing the first segment of the 2-axis synchronized

motion at 50 kHz. D1 increments by one when a segment of the 2-axis synchronized motion completes and the

second segment of 2-axis synchronized motion starts to automatically execute. The operation pattern repeats until

the third segment of 2-axis synchronized motion completes.

When D1=1, the PLC starts to draw the line from P7 to P8 with the DPPMA instruction.

When D1=2, the PLC starts to draw the line from P8 to P9 with the DPPMA instruction.

When D1=3, the PLC starts to draw the line from P9 to P7 with the DPPMA instruction.

6_

6-929
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


2-Axis absolute-
2713 D CICA S1,S2,S3,S4,S5,D1,D2 position clockwise arc
interpolation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3       
S4      
S5      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3   
S4  
S5  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
_6
Symbol

S1 : X axis target coordinate (absolute positioning)

S2 : Y axis target coordinate (absolute positioning)

S3 : The shift of the center or the central angle

S4 : Target reference frequency

S5 : Function

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. This instruction performs 2-axis absolute-position clockwise arc interpolation. S1 and S2 respectively
designate the X- and Y-axis target coordinates. For more explanation, refer to DCICR instruction (API
2712).

2. Refer to Example 2 from the DPPMR instruction (API 2710) for programming in ST language.

6-930
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description


2-Axis relative-
2714 D CICCR S1,S2,S3,S4,S5,D1,D2 position counterclockwise arc
interpolation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3       
S4      
S5      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3   
S4  
S5  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
6_
Symbol

S1 : X axis target coordinate (relative positioning)

S2 : Y axis target coordinate (relative positioning)

S3 : The shift of the center or the central angle

S4 : Target reference frequency

S5 : Function

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

6-931
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. This instruction performs 2-axis relative-position clockwise arc interpolation. S1, S2 and S3 respectively designate the

target coordinate on X axis, target coordinate on Y axis, and the shift of the center of a circle. Refer to the following

operation for drawing the counterclockwise arc for details.

2. D1 and D2 are the output devices for the X and Y axes respectively. Refer to the DPPMR instruction (API 2710) for

the selection of output points and output mode for the axes.

3. S4 sets the target frequency for the reference. The target reference frequency is used for the prior calculation when

the PLC plans the travel path for the arc, after the instruction is executed. If the estimated calculation process

cannot achieve the planned arc travel path, the output frequency is automatically decreased so as to fulfill the

synchronized arc drawing function.

4. S5 is the setting value for function selection. See the descriptions below.

Setting value in S5 S3 : The shift of the center or central angle Description


The arc resolution uses a 10° arc as the basic
0 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 5° arc as the basic
1 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 1° arc as the basic
2 Shift of the center (32-bit integer type)
angle for motion.
The arc resolution uses a 10° arc as the basic
10 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 5° arc as the basic
11 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 1° arc as the basic
_6 12 Shift of central angle (floating point type)
angle for motion.
The arc resolution uses a 10° arc as the basic
angle for motion to create a 90 degree arc of
an ellipse and to end at a point where X and Y
20 Invalid
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
The arc resolution uses a 5° arc as the basic
angle for motion to create a 90 degree arc of
an ellipse and to end at a point where X and Y
21 Invalid
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
The arc resolution uses a 1° arc as the basic
angle for motion to create a 90 degree arc of
an ellipse and to end at a point where X and Y
22 Invalid
axes target coordinates specified.
(ES3/EX3 firmware: V1.04.30 or later,
SV3/SX3 firmware: V1.00.00 or later)
Other Shift of the center (32-bit integer type) Seen as the setting value in S5 of 0.

6-932
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. Refer to Example 2 from the DPPMR instruction (API 2710) for programming in ST language.

Drawing the counterclockwise arc (for Setting values 0~12 in S5)


1. Define the four quadrants (QI, QII, QIII and QIV) of a coordinate system as below. Point A indicates the current
coordinates on X and Y axes.

II I
X
A
III IV

2. Point B is the target coordinates specified by S1 and S2. Point O is the center of a circle containing points A and B.
3. S3 is the distance to shift the center point O. S3 can also be the distance to shift the center point or central angle, if it
is defined as the central angle, it is the included angle of AOB. Setting range: 0.0 < S3 < 360.0 (unit: degree)
4. The point A represents the origin of the axes X and Y in a plane. The target point B can be in Quadrant I, II, III, IV of
the plane. Use the target point B to connect to the point A to draw a line and then use the setting values (shift the
center point or the central angle) in S3 to define an arc travel path.
The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant I and IV with
different setting values in S3 (shift the center point). (r: radius)
B

S3 < 0
O 6_
S3 >= 0 B
A
r O
r

S3>= 0 S3< 0

5. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant I and IV with
different setting values in S3 (shift the central angle). (r: radius)

S3<= 180.0 S3> 180.0

6-933
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant II and III with
different setting values in S3 (shift the center point). (r: radius)
A

S3 >= 0
O
S3 < 0 A
B
r O
r

S3>= 0 S3< 0

7. The figures below show 2 arc-travel path examples (solid lines) when the point B is in Quadrant II and III with
different setting values in S3 (shift the central angle). (r: radius)

_6 S3<= 180.0 S3> 180.0

8. When the X axis coordinate = 0 and the Y axis coordinate >= 0 for target point B, then point B is defined as the point
staying in QI of point A. Whereas, if Y axis coordinate < 0 for target point B, then point B is defined as the point
staying in QIII of point A.

Drawing a 90 degree counterclockwise arc (for Setting values 20~22 in S5)

1. Define the four quadrants (QI, QII, QIII and QIV) of a coordinate system as in the graph below. Note that you need

to use ES3/EX3 with firmware V1.04.30 or later and SV3/SX3 with firmware V1.00.00 or later for this function.

2. Use the values in S1 (X axis target coordinate) and in S2 (Y axis target coordinate) to identify the target position in

one of the following four quadrants.

6-934
C ha pt er 6 A p pl i e d In s tr uc t io ns

Y ax is

QI I QI
X ax is
QII I QI V

3. Since the distances bewteen the starting positions and the target positions in the X and Y axes are not the same,
and the travel path will be formed by a 90 degree arc of an ellipse. This function is useful for applications that draw
elliptical arcs.
Example

1. Draw a DELTA LOGO as the figure below.

6_

2. Steps: divide the logo into three parts.

 For an ellipse: use the DCICR instruction (API 2712) for the relative-position counterclockwise arc interpolation.

 The absolute coordinates of the ellipse: P1(39930, -9982), P4 (123119, 73206), P3 (73206,123119) and P2 (-9982,

39930)

 Taking (39930, -9982) as the start point, the obtained relative coordinates: (83189, 83188), (-49913, 49913), (-83188,
-83189) and (49912, -49912).

6-935
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

_6

When the PLC runs the program and M1 is ON, the PLC starts drawing the first segment of the clockwise arc at
50kHz. D1 increments by 1 when a segment of arc is completed and the second segment of arc starts to

6-936
C ha pt er 6 A p pl i e d In s tr uc t io ns

automatically execute. The operation pattern repeats until the fourth segment of arc is completed.

When D1=1, using DCICCR, the PLC draws the first-segment arc from P1 to P4 with the shift of the center of the
circle: -110295 and arc resolution: 5.

When D1=2, using DCICCR, the PLC draws the second-segment arc from P4 to P3 with the shift of the center of the
circle: -18825 and arc resolution: 5.

When D1=3, using DCICCR, the PLC draws the third-segment arc from P3 to P2 with the shift of the center of the
circle: -110295 and arc resolution: 5.

When D1=4, using DCICCR, the PLC draws the fourth-segment arc from P2 to P1 with the shift of the center of the
circle: -18825 and arc resolution: 5.

 A circle = use DCCMR instruction (API 2716) for the relative-position circle drawing. Refer to the example in API
2712 DCICR for detailed operation.

 A delta = use DPPMA (APIU 2711) for the absolute-position 2-axis synchronized motion. Refer to the example in
DCICR (API 2712 ) for more information.

6_

6-937
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


2-Axis absolute-
2715 D CICCA S1,S2,S3,S4,S5,D1,D2 position counterclockwise arc
interpolation

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3       
S4      
S5      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3   
S4  
S5  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


_6 - - ES3/EX3/SV3/SX3

Symbol

S1 : X axis target coordinate (absolute positioning)

S2 : Y axis target coordinate (absolute positioning)

S3 : The shift of the center or the central angle

S4 : Target reference frequency

S5 : Function

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. S1 and S2 respectively designate the target coordinate on the X axis and the target coordinate on the Y axis. For an
explanation of the instruction, refer to DCICCR instruction (API 2714).

2. Refer to Example 2 from the DPPMR instruction (API 2710) for programming in ST language.

6-938
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

2716 D CCMR S1,S2,S3,S4,D1,D2 Relative-position circle drawing

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
S4      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
S4  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol
6_
S1 : X axis coordinate of the center (relative positioning)

S2 : Y axis coordinate of the center (elative positioning)

S3 : Function selection

S4 : Target reference frequency

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

6-939
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. This instruction draws a circle based on relative positioning. S1 and S2 are respectively the X and Y axis coordinates

of the center of a circle (relative position).

2. S3 is the setting value for function selection. See the descriptions below.

S3 : Function Selection Descriptions

0 The arc resolution uses a 10° arc as the basic angle for clockwise motion.

1 The arc resolution uses a 5° arc as the basic angle for clockwise motion.

2 The arc resolution uses a 10° arc as the basic angle for counterclockwise motion.

3 The arc resolution uses a 5° arc as the basic angle for counterclockwise motion.

4 The arc resolution uses a 1° arc as the basic angle for clockwise motion.

5 The arc resolution uses a 1° arc as the basic angle for counterclockwise motion.

Seen as setting value in S5 is 0


Other
The arc resolution uses a 1° arc as the basic angle for clockwise motion.

_6 3. D1 and D2 are the pulse output devices for the X and Y axes respectively. Refer to DPPMR instruction (API 2710) for

the selection of output points and output mode for the axes.

4. S4 sets the target frequency for the reference. The target reference frequency is used for the prior calculation when

the PLC plans the travel path for the arc after the instruction is executed. But if the calculation process which is

estimated cannot achieve the planned arc travel path, the output frequency is automatically decreased to fulfill the

synchronized arc drawing function.

5. When the X axis coordinate of the center point O=0, point O is defined as the point staying in QI of point A if Y axis

target coordinate >= 0. Whereas, if Y axis target coordinate < 0, point B is defined as the point staying in QIII of point

A.

6. Refer to Example 2 from the DPPMR instruction (API 2710) for programming in ST language.

6-940
C ha pt er 6 A p pl i e d In s tr uc t io ns

The clockwise circle drawing:

Point A is the present position and point O is the target center, r is the radius of the circle as the figures below.

O O
r

A
Center O in QI and QIV Center O in QII and QIII

The counterclockwise circle drawing:

O O
r

6_
A

Center O in QI and QIV Center O in QII and QIII

6-941
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. Taking (40000, 50000) as the center O and (10000, 10000) as point A, draw a circle as shown below.

O (4 0000, 50000)
O

A (10000, 10000)
A

2. Steps:

 The calculated relative coordinates of point O: (30000, 40000)

 The coordinates of point A is the present position; SR460=10000 and SR480=10000

 S3=1 and the clockwise circle drawing is performed with a 5° as the basic motion angle.

 When the PLC runs the program and M0 is set to ON, the relative-position circle drawing starts.

_6

3. Operation:

 When the PLC runs the program and M0 is ON, the PLC starts to draw the circle in the clockwise direction at 100
kHz.

 When the circle drawing completes, SM461 and SM481 are ON.

6-942
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description

2717 D CCMA S1,S2,S3,S4,D1,D2 The absolute-position circle drawing

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1      
S2      
S3      
S4      
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
S4  
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol
6_
S1 : X axis coordinate of the center (absolute positioning)

S2 : Y axis coordinate of the center (absolute positioning)

S3 : Function selection

S4 : Target frequency

D1 : Pulse output device for the X axis

D2 : Pulse output device for the Y axis

Explanation

1. S1 and S2 are respectively the X and Y axis coordinates of the center of a circle (absolute positioning). For more
information, refer to the DCCMR instruction (API 2716).

2. Refer to Example 2 from the DPPMR instruction (API 2710) for programming in ST language.

6-943
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example

1. Taking (40000, 50000) as the center O and (10000, 10000) as point A, draw a circle as shown below.

O (4 0000, 50000)
O

A (10000, 10000)
A

3. Steps:

 Set the absolute X coordinate and Y coordinate (40000, 50000) in the instruction

 Point A is the present position, SR460=10000 and SR480=10000

 S3 is 1 and the clockwise circle is drawn with 5° as the basic motion angle.

 When the PLC runs the program and M0 is ON, the absolute-position circle drawing starts.

_6

4. Operation:

 When the PLC runs the program and M0 is ON, the PLC starts to draw the circle in the clockwise direction at 100
kHz.

 When the circle drawing completes, SM461 and SM481 are ON.

6-944
C ha pt er 6 A p pl i e d In s tr uc t io ns

API Instruction Operand Description


Position planning table controls the
2718 TPO S,D1,D2
output

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S    
D1 
D2   DWORD  

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S  
D1  
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S : The first output number in the position planning table

D1 : The output number that is being output

D2 : Switch flag at the end of the consecutive-number output

6_
Explanation:

1. This instruction uses the position planning table to control the output. S is the number listed in the position planning
table. If the number does not exist in the table, the instruction is not executed, SM0 is ON and the error code is

SR0=16#2027.

2. S is the first output number when PLC runs. Refer to the value in D1 if there are consecutive-number outputs during
the output.

3. When one single number or the first one of consecutive numbers is output, the switch flag D2 is set to OFF. When the

consecutive-number output reaches the output number to be switched to, D2 is ON for a scan cycle and then is ON

again until the last number output is completed.

6-945
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

The example and timing diagram for the flag state switching are shown below.

M0
TPO
M0 EN D1 D100 D100 1 2 3
1 S D2 M100
M100

4. The switch flag D2 is affected by the PLC scan time. If the time for switching to the next output number is shorter than
the scan time, the flag for switching to the output number may not reset to OFF.

5. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called only

once.

6. If using the function Single-axis multi-segment motion, you can use the stop flag during output to stop the output. If

you use the stop flag and this instruction, it will stop output after this segment is done outputting. For example,

supposing the segments are 1, 2 and 3 for output in a consecutive order and you use the stop flag while outputting

segment 2. The system will complete outputting segment 2 and then after you switch the stop flag to OFF, the

execution of this instruction will resume in the segment 3.

7. If using the function Single-axis point-to-pint motion to output, and using the stop flag during the output, this

instruction will stop execution and resume execution and output the remainings after the stop flag is OFF.

8. If using the function 2-axis arc interpolation, and using the stop flag during the output, this instruction will stop
_6
execution after one basic unit of arc interpolation (1 degree) and this instruction resumes execution after the stop flag

is OFF, and output the remainings.

9. ES3 CPU firmware V1.08.00 or later works with ISPSoft V3.17 or later/ DIADesigner V1.30 or later, and

ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later works with DIADesigner V1.30 or later. For the CPU

firmware, it is supported to stop the ongoing output sequency and execute a new number of position planning table

during the execution of TPO instruction; this execution should work with the following SM/SR. When the relevant SM

changes to ON, the PLC CPU will act according to the settings in the relevant SR to output the segment of a specific

number or the next segment on the positioning table. Two scenarios:

A. If the relevant SM changes to ON and the value in SR1291-SR1294 is valid, the PLC CPU will act accordingly

to output the segment of a specific number on the positioning table. After that, the PLC CPU clears the relevant

SM and SR.

B. If the relevant SM changes to ON but the value in SR1291-SR1294 is 0 or an invalid value (the positioning table

does NOT exist), the PLC CPU will stop outputting. After you clear the relevant SM, the PLC CPU will continue

outputting the next segment on the positioning table.

6-946
C ha pt er 6 A p pl i e d In s tr uc t io ns

The corresponding axis, SM and SR numbers


Flag to stop the ongoing output
Axis for output Specific number of segment
sequency
Axis 1 (Y0/Y1) SM591 SR1291
Axis 2 (Y2/Y3) SM592 SR1292
Axis 3 (Y4/Y5) SM593 SR1293
Axis 4 (Y6/Y7) #1 SM594 SR1294
Note#1: Not supported by SX3 series CPU.

10. ES3 CPU firmware V1.08.00 or later works with ISPSoft V3.17 or later/ DIADesigner V1.30 or later, and

ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later works with DIADesigner V1.30 or later. For the CPU

firmware, it is supported to stop the ongoing output sequency at a specified X point and switch to execute a specific

position planning table during the execution of TPO instruction; this execution should work with the following SM/SR.

SM / SR Function

SM588 ON: enable to stop the ongoing output sequency at a specified X point

Define the triggering methods for the X point

1: Falling-edge triggered
SR1297 high byte
2: Rising-edge triggered and falling-edge triggered

Other numbers: rising-edge triggered

SR1297 low byte Define the number of the positon planning table

When executing the TPO instruction for the first time, if you set the SM588 flag to ON and the number of the position

planning table specified by SR1297 is legal, the system will clear SM588 to OFF automatically, once the validity of the 6_
execution is confirmed. PLC will then operate according to the designated output devices from the position planning

table specified by the operand S, and then execute interrupts on the specified X points. If the number of the positon

planning table specified by SR1297 is legal, the system will clear SR1297 to OFF automatically. The invalid SR1297

includes the following scenarios:

A. The specified number of positon planning table does NOT exist.

B. The output mode from the specified number of positon planning table is inconsistent with the output mode from

the original number of position planning table.

C. The output devices from the specified number of positon planning table is inconsistent with the output devices

from original number of position planning table.

Works with the mask function:

You can use SR1298 (low word) & SR1299 (high word) to set up numbers of pulses to be masked to keep a certain

segments of output unaffected by the interrupts. A setting value of 0 means there is no mask function. Any number

other than zero (a positive / negative value) indicates the mask function is activated.

For example:

A. If the current position of the output axis is 10000 (number of output pulses), the setting value of SR1298 &

6-947
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

SR1299 is 5000 (number of output pulses); it means number of pulses from 10000 to 15000 is masked.

B. If the current position of the output axis is 10000 (number of output pulses), the setting value of SR1298 &

SR1299 is -5000 (number of output pulses); it means number of pulses 10000 to 5000 is masked.

The correspondings between output axes and input points are fixed as shown below.

Axis for output Input point (X) for interrupt

Axis 1 (Y0/Y1) X0

Axis 2 (Y2/Y3) X2

Axis 3 (Y4/Y5) X4

Axis 4 (Y6/Y7) X6

For examples:

Single-axis multi-segment motion: Y4 corresponds to X4

2-axis linear interpolation: Y0 / Y6 correspond to X0 / X6

Example 1:

1. Enable the mechanical unit conversion function

_6
2. Set the position planning table and download the parameters

The target position is 2000 (Unit:mm). After converting in the position planing table, 400,000 output pulses

are downloaded and saved in the PLC.

3. When M0 is ON, Y0 outputs 400,000 pulses at 100kHz. After the output completes, M100 is ON.

6-948
C ha pt er 6 A p pl i e d In s tr uc t io ns

Example 2:

Use global symbol or D device in Target Position

1. Use D device in Target Position of the position planning table and download the parameters.

The unit for D60 in PLC is pulse by default. If you need to use D devices in Target position and in the

mechanical unit, you need to convert the mechanical unit to pulse.

2. When M0 is ON, and D60 is 400,000. Y0 outputs 400,000 pulses at 100kHz. After the output completes,

M100 is ON.

Note: the unit is pulse, when you use global symbols, D devices, or instructions including DTPWS, DTPWL,
and DTPWC to input values in in Target Postion.

3. If global symbols are used in Target Position 6_


A. You need to assign an address for the global symbol.

B. Use global symbols in Target Position of the planning table.

6-949
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 3:

Use abort symbol and completion flag

1. Set up the positioning planning table as shown below.

2. Abort symbol: When No. 3 stops the outputting abruptly, M100 is ON and the system starts to output No. 4

immediately.

The abort symbol is applicable for the following conditionss: external interrupts, high-speed comparision

interrupts and M devices (M0~8191).

3. Completion flag: When No. 4 completes the outputting, M777 is ON. When the execution of this positioning

planning table is complete, the system calls for an interrupt or starts a M device.

You can use the interupt numbers I510~519 and M device (M0~M8191) in the positioning planning table.

Note: If you use interrupts instead of M devices, PLC scan cycle is not affected.

Example 4: Single-axis multi-segment motion

1. Set up the positioning planning table as shown below.

_6

2. When M0 is ON, Y0.0 outputs No.1 to No. 3 consecutively. After the output is done, M100 is ON.

3. Stop flag and immediately stop flag

a) The following graphic shows the output diagram based on example 4.

6-950
C ha pt er 6 A p pl i e d In s tr uc t io ns

Ramp-down stop Immediately stop

b) Ramp-down stop
 When M0 is ON, the TPO instruction is executed and starts to output No. 1 segment.

 When the stop flag SM463 is ON during the output of No.2 segment, the state of the immediately

stop flag SM476 is confirmed.

 If the immediately stop flag SM476 is OFF, the output ramps down to stop, according to the SR465 ramp-

down time in axis 1, till the it drops to the lowest 1000 Hz frequency.

 Output at the lowest 100Hz frequency and till the No. 2 output is complete and stopped. (pulse = 600 K) 6_
⑤ After the stop flag SM463 switches to OFF, the execution of TPO instruction starts outputting No.3
segment till the output is complete. (pulse = 1200 K)

c) Immediately stop
 When M0 is ON, the TPO instruction is executed and starts to output No. 1 segment.

 When the stop flag SM463 is ON during the output of No.2 segment, the state of the immediately

stop flag SM476 is confirmed.

 If the immediately stop flag SM476 is ON, the output stops after the No. 2 output is complete.

(pulse = 600 K).

 After the stop flag SM463 switches to OFF, the execution of TPO instruction starts outputting No.3

segment till the output is complete. (pulse = 1200 K)

6-951
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


Setting single-axis output
2719 D TPWS P S1,S2,S3 parameters in the position planning
table

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : A number listed in the position planning table

S2 : Target position

S3 : Target speed

_6 Explanation

1. This instruction sets the single-axis output parameters in the position planning table. S1 is the number listed in the
position planning table. If the number does not exist in the table, or the number is not under Single-axis point-to-point

motion, or under Single-axis multi-segment motion, the instruction is not executed, SM0 is ON and the error code is

SR0=16#2027.

2. S2 is the target position (must be a 32-bit integer). If you use the mechanical unit conversion when editing the position

planning table in the software, use the conversion instruction for modification first.

3. S3 is the target speed. The range is between 1–200,000Hz.

4. When the instruction is executed to modify the parameters for the single axis which is outputting pulses, the modified

parameters are kept in the table and are not effective until the next output starts.

6-952
C ha pt er 6 A p pl i e d In s tr uc t io ns

5. The parameters modified by the instruction can only be modified while the PLC is running. The last written parameter

is not saved when the power turns OFF. The table that you edit in the software and download to the PLC is processed

as the default position planning table when the power is ON.

6. This instruction does NOT modify the acceleration or deceleration time. If you need to modify the time for

acceleration or deceleration, you can set SM585 flag to ON, and the system refers to the acceleration and

deceleration time set in SR to change the acceleration time in single-axis point-to-point motion and single-axis

multi-segment motion or the deceleration time in single-axis point-to-point motion. Re-execute this instruction to

actualize this modification.

7. While the TPO instruction is being executed, please pay attention to the timing of modifying parameters with this

instruction. Do not modify those for the numbers in the position planning table which are performing the output or are

about to perform the output.

Example 1: Change the parameters of Axis 3 of Number 5 during execution in Single-axis point-to-point motion.

1) Use DMOV instruction to define new target position and target speed.

2) Use MOV instruction to define the start/end frequency in SR503, acceleration time in SR504 and deceleration

time in SR505 for Axis 3. After that the relative parameters in single-axis point-to-point motion are updated.

3) Set the flag SM585 to ON. 6_


4) Re-execute DTPWS instruction to actualize the modification.

5) After that, SM585 switches to OFF automatically.

Example 2: Change the parameters of Axis 3 of Number 2 during execution in Single-axis multi-segment motion.

1) Use DMOV instruction to define new target position and target speed.

2) Use MOV instruction to define the acceleration time in SR504. After that the relative parameters in single-axis

multi-segment motion are updated.

3) Set the flag SM585 to ON.

4) Re-execute DTPWS instruction to actualize the modification.

5) After that, SM585 switches to OFF automatically.

6-953
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


Setting linear interpolation
2720 D TPWL P S1,S2,S3,S4 parameters in the position planning
table

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2  
S3  
S4  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : A number listed in the position planning table

S2 : Target position of the X axis


_6
S3 : Target position of the Y axis

S4 : Target speed

Explanation

1. This instruction sets the 2-axis linear interpolation parameters in the position planning table. S1 is the number listed in
the position planning table. If the number does not exist in the table or the output of the number does not belong to

the 2-axis linear interpolation, the instruction is not executed, SM0 is ON and the error code is SR0=16#2027.

2. S2 and S3 are respectively the target positions of the X and Y axes, which can only be 32-bit integers. If you use the

mechanical unit conversion when editing the position planning table in the software, use the conversion instruction

for modification first.

6-954
C ha pt er 6 A p pl i e d In s tr uc t io ns

3. S4 is the target speed. The range is between 1–200,000Hz.

4. When the instruction executes the linear interpolation, the target frequency S4 automatically corresponds to the

output of the axis which is farthest from its target position. If X axis and Y axis cannot simultaneous reach the target

positions, the PLC automatically decelerates the frequency to make the two axes reach the target positions

simultaneously.

5. When the instruction is executed to modify parameters for the two axes (either of which is outputting), the modified

parameters of the two axes are kept in the table and are not effective until the next 2-axis output starts.

6. The parameters modified by the instruction can be modified only while the PLC is running. The last written parameter

is not saved when the power turns OFF. The table that you edit in the software and download to the PLC is processed

as the default position planning table when the power is ON.

7. To modify the ACC/DEC time, first modify the acceleration time in SR of the specified output axis of X-axis, then set

the SM585 flag to ON. After starting this instruction and changing relevant parameters is complete, SM585 will

automatically reset to OFF.

For example, if the Y0 output axis is the specified axis of X-axis, modify the value in SR464 (acceleration time for Y0

output) to modify the ACC/DEC time. Please refer to Example 1 in API 2719 TPWS for detailed steps.

Note: The ACC/DEC time here is for reference only for PLC calculation of 2-axis synchronized output. If

synchronized output cannot be reached after calculation, the PLC will automatically execute the instruction with the
most suitable time without any error information generated. It is available for ES3/EX3 firmware V1.06.00 or later,
6_
and SV3/SX3 firmware V1.00.00 or later.

8. While the TPO instruction is being executed, please pay attention to the timing of modifying parameters with this

instruction. Do not modify those for the numbers in the position planning table which are performing the output or are

about to perform the output.

6-955
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


Setting arc interpolation parameters
2721 D TPWC P S1,S2,S3,S4,S5
in the position planning table

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1    
S2    
S3    
S4    
S5    
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S4  
S5  

Pulse Instruction 16-bit instruction 32-bit instruction


ES3/EX3/SV3/SX3 - ES3/EX3/SV3/SX3

Symbol

S1 : A number listed in the position planning table


_6
S2 : X axis target position

S3 : Y axis target position

S4 : The shift of the center

S5 : Target speed

Explanation

1. This instruction sets the 2-axis arc interpolation parameters in the position planning table. S1 is the number listed in
the position planning table. If the number does not exist in the table, or the output of the number does not belong to

the 2-axis arc interpolation, the instruction is not executed, SM0 is ON and the error code is SR0=16#2027.

6-956
C ha pt er 6 A p pl i e d In s tr uc t io ns

2. S2 and S3 are respectively the target positon on the X and Y axes. S4 is the distance to shift the center. The three

parameters can only be 32-bit integers. If you use the mechanical unit conversion when editing the position planning

table in the software, use the conversion instruction for modification first.

3. S5 is the target speed. The range is between 1–200,000 Hz. It is the reference speed for the actual output. The PLC

automatically decelerates the speed if the 2-axis synchronized output cannot be achieved.

4. When the instruction is executed to modify parameters for the two axes (either of which is outputting), the modified

parameters of the two axes are kept in the table and are not effective until the next 2-axis output starts.

5. The parameters modified by the instruction can be modified only while the PLC is running. The last written parameter

is not saved when the power turns OFF. The table that you edit in the software and downloaded to the PLC is

processed as the default position planning table when the power is ON.

6. This instruction does not support changing the clockwise or counterclockwise motion direction. For direction change,

add or modify the output parameters for arc interpolation in the position planning table in the software.

7. While the TPO instruction is being executed, please pay attention to the timing of modifying parameters with this

instruction. Do not modify those for the numbers in the position planning table which are performing the output or are

about to perform the output.

6_

6-957
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description

2723 D PPGB S1,S2,S3,S4,D1,D2 Point-to-point go back and forth

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1 
S2 
S3 
S4 
D1 
D2 
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

S1  
S2  
S3  
S4 
D1 
D2 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol
_6
S1 : Relative target position A

S2 : Relative target position B

S3 : Target speed
Target speed ratio adjusted value
S4 :
(floating point value)
D1 : Pulse output device

D2 : Target speed can change indicator

Explanation

1. This high speed output instruction specifies a movement going back and forth between two target positions that are
converted from the two relative target positions specified by S1 and S2. This instruction is applicable for machines

such as warping machines in the textile industry, and winding & binding machines in the cable industry.

2. When the instruction starts the output, the relative positions S1 and S2 must be specified first so that the instruction

can make the calculation for switching to the next output. After the instruction is executed, you can modify the target

positions to execute, but you cannot change the outputting target positions.

6-958
C ha pt er 6 A p pl i e d In s tr uc t io ns

 DPPGB instruction is executed. When S1 is 30,000 and S2 is -30,000, the motion goes toward the target position

A1=30,000.

 If the pulse position>15,000, the relative positions are modified into S1:20,000 and S2:-20,000, and the target

position is momentarily A1=30,000. The target positions obtained through calculation are B1=10,000(A1+ S2) and

A2=30,000(B1+ S1), since the outputting target positions cannot be modified.

3. S3 is the target speed (must be a 32-bit integer), and S4 is the target speed ratio adjusted value (must be a floating

point number). The actual speed is the result of multiplying the values in S3 and S4 and then rounding down the

calculation result to a 32-bit integer. The acceptable input speed range is 1–200 kHz. When values are out of range,

the PLC automatically processes the value as the minimum or the maximum of the operation range. The ratio
6_
formula for the actual target speed is S3 x S4. For instance, if target speed is 1 kHz, the adjusted floating point is

1.2345 and the actual value is 1234 Hz.

4. When the instruction is outputting, the target speed and the adjusted ratio can be modified, and the result is

updated to the actual output speed once the instruction is scanned. But it is suggested that you do not change the

target speed too much in case the calculated deceleration is affected.

5. The output points for D1 can only be Y0, Y2, Y4, and Y6, and it occupies 2 consecutive output points. The output

sets and the output special register modes are listed in the following table.

Output axis number 1 2 3 4#1

D1+0 output point Y0 Y2 Y4 Y6#1

D1+1 output point Y1 Y3 Y5 Y7#1

Output mode SR462 SR482 SR502 SR522

Note#1: Not supported by SX3 series CPU.

6-959
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

6. D2 is the flag indicating the target speed and the adjusted ratio that you can change. When this flag is ON, the

executing target speed can be modified. When the flag switches from ON to OFF, it is now decelerating and the

current target speed will be processes as the target speed for the next output.

7. There is no limit on the number of times you can execute this instruction, but during execution, the designated high

speed axis cannot be occupied by any other instruction, and the other instruction is not executed.

The following graphic shows the output timing diagram.

Speed
D2 = OFF
D2 = ON

S3 x S4
D1 +1 = OFF
S1

S2 Position

D1 +1 = ON
S3 x S4

_6 D2 = OFF
D2 = ON

Example

When M0 is ON, the DPPGB instruction starts to move back and forth between the target positions that are calculated

from the two relative target positions specified by S1 and S2, at the actual target speed of 8500 Hz (5000*1.7). Y0 is the

output point. Y1=OFF means the positive direction.

6-960
C ha pt er 6 A p pl i e d In s tr uc t io ns

6_

6-961
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Explanation

1. After the instruction starts the output, modify the relative target positions A for S1 and B for S2.

a) The Y0 output graph:

b) Explanation:
 When S1:30,000, S2:-30,000 and M0 enables the DPPGB instruction, the motion goes toward the position
A1=30,000.

 When D0=1 and the position: number of pulses in SR460 >15,000, the relative positions are changed to

S1:26,000 and S2:-28,000.

At the moment, the target position is A1=30,000 since the outputting target position cannot be modified. The
_6 calculated target positions are B1=2,000(A1-28,000), A2=28,000(B1+26,000).

 When D0=2 and the position: number of pulses in SR460 >15,000, the relative positions are changed to
S1:22,000 and S2:-24,000.

At this time, the target position is A2=28,000 since the outputting target position cannot be modified.

The calculated target positions are B2=4,000(A2-24,000), A3=26,000(B2+22,000).

 When D0=3 and the position: number of pulses in SR460 >15,000, the relative positions are changed to

S1:18,000 and S2:-20,000.

The calculated target positions are B3=6,000(A3-20,000),A4=24,000(B3+18,000).

 When D0=4 and the position: number of pulses in SR460 >15,000, the relative positions are changed to

S1:30,000 and S2:-24,000.

The calculated target positions are B4=0(A4-24,000) and A1=30,000(B4+30,000).

6-962
C ha pt er 6 A p pl i e d In s tr uc t io ns

Step S1: Relative position S2: Relative position Target position B Target position A

 30,000 -30,000 - A1=30,000

 26,000 -28,000 B1=2,000 A2=28,000

 22,000 -24,000 B2=4,000 A3=26,000

 18,000 -20,000 B3=6,000 A4=24,000

 30,000 -24,000 B4=0 A1=30,000

6_

6-963
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

API Instruction Operand Description


Zero return 2
2724 D ZRN2 TFreq, JFreq, Mode, DOG, NL, Pulse, Dir
(directional output can be defined)

Device X Y M S T C HC D FR SM SR E K 16# “$” F


TFreq      
JFreq      
Mode      
DOG  
NL  
Pulse 
Dir  
DWORD

STRING
LWORD

LREAL
WORD

Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

type

TFreq  
JFreq  
Mode  
DOG 
NL 
Pulse 
Dir 

Pulse Instruction 16-bit instruction 32-bit instruction

_6 - - ES3/EX3/SV3/SX3

Symbol

TFreq : Target frequency for zero return

JFreq : JOG frequency for DOG

Mode : Zero return mode

DOG : Input device for DOG

NL : Input device for Negative Limit point

Pulse : Pulse output device

Dir : Output direction device

6-964
C ha pt er 6 A p pl i e d In s tr uc t io ns

Explanation

1. This instruction causes the machine to return to the zero point. The range of the target frequency (TFreq) for zero

return is between 1 Hz–200 kHz. The JOG frequency (JFreq) should be less than the target frequency (TFreq). The

JOG frequency (JFreq) is the start frequency. If the target frequency (TFreq) is less than (JFreq), the target

frequency (TFreq) is automatically revised processed as equal to (JFreq).

2. Do not change the operands DOG, NL, Pulse, or Dir during instruction execution. The input point for DOG and NL

is suggested to use the 16 high-speed input points X0–X7 and X10–X17. They will not be affected by PLC

instruction scan time. If you use X20 successive input points or M devices, they will be affected by the PLC

instruction scan time.

3. See the below descriptions for DOG, NL and Dir.

You can use X or M device but do NOT choose the same input point for different axis.

DOG point When the DOG point uses X0–X7 and X10–X17 for inputs, go to HWCONFIG to set up

the filtering time for the inputs if the switch starts to rattle.

NL point You can use X or M device but do NOT choose the same input point for different axis.

Dir contact You can use Y or M device.

For ES3 series CPU with firmware V1.04.00 or earlier, with the limit point check function enabled, the alarm flag will

not be set to ON once the limit signal is received in the course of returning to the zero point.

ES3 series CPU with firmware V1.06.00 or later works with ISPSoft V3.16 or later/DIADesigner V1.30.
6_
ES300TEC/EX3/SV3/SX3 series CPU with firmware V1.00.00 or later works with DIADesigner V1.30. For these

CPU mentioned here, the alarm flag will be set to ON once the limit signal is received, and then you can decide the

next operation actions according to the alarm flag state. (Note: After the alarm flag is set to ON, you must reset it to

OFF by yourself.)

DZRN2 does not support the positive limit function.

4. See the below SR and SM table for pulse outputting.

Pulse output points Y0 Y2 Y4 Y6#1

Setting up the time for directional outputting


SR640 SR642 SR644 SR646
goes first before pulse outputting (unit: 1 ms)

Busy flag SM460 SM480 SM500 SM520

Completion flag SM461 SM481 SM501 SM521

SR460 SR480 SR500 SR520


Present output position
SR461 SR481 SR501 SR521

6-965
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Pulse output points Y1 Y3 Y5 Y7#1

Setting up the time for directional outputting


SR641 SR643 SR645 SR647
goes first before pulse outputting (unit: 1 ms)

Busy flag SM472 SM492 SM512 SM532

Completion flag SM473 SM493 SM513 SM533

SR474 SR494 SR514 SR534


Present output position
SR475 SR495 SR515 SR535
Note#1: Not supported by SX3 series CPU.

5. Mode: Select the zero return mode. The function code is set by the two high and low16-bit parameters. See the

following table for details.

Mode: Select the zero return mode


High 16-bit Low 16-bit
b31~b16 b15~b7 b6 b5 b4 b3~b0

DOG mask Setting NL Setting DOG


Mode setting
Number of pulses function signal signal
reserved 0~2;
for motion 0: Disable 0: contact A 0: contact A
8~10
1: Enable 1: contact B 1: contact B

6. The function code is set by the two high and low 16-bit parameters. See the following table for details.
_6
Code
Functions High Low Description
16-bit 16-bit
When the instruction is executed, the search for the
zero point is in the negative direction with the target
Leaves the zero point in frequency. When the zero point is ON (the zero
the negative direction point signal changes from OFF to ON), the
0 0
and then stops frequency is decreased to the JOG speed and the
(Mode 0) motion in the negative direction continues, and does
not stop until the zero point signal changes from ON
to OFF.
When the instruction is executed, the search for
the zero point is in the negative direction with the
Leaves the zero point in target frequency. When the zero point is ON (the
the positive direction and zero point signal changes from OFF to ON), the
0 1
then stops frequency decreases to 0 immediately, and then
(Mode 1) the motion is in the positive direction at the JOG
speed, and does not stop until the zero point signal
changes from ON to OFF.
Mode 0 Moves again Number of Returning to the zero point is the same as that for
after returning to the zero pulses for 2 the low 16-bit code. After the zero point is ON, the
point motion motion continues according to the number of

6-966
C ha pt er 6 A p pl i e d In s tr uc t io ns

Code
Functions High Low Description
16-bit 16-bit
specified pulses. When the high 16-bit code is a
positive number, the search is in the positive
direction. A negative value means that the search
is in the negative direction.
Leaves the zero point in
8+0=8
the positive direction and Refer to mode 1. The operation for zero point
0 8+1=9
then stops return is the same as that for code 1 (mode 1).
(bit3=ON)
(Mode 1)
The operation for zero point return is the same as
that for low 16-bit code 1.
After returning to the zero point, the motion
Mode 1 outputs the Number of
8+2=10 continues in accordance with the number of
number of pulses after pulses for
(bit3=ON) specified pulses. When the value of the high 16-bit
returning to the zero point motion
code is a positive number, the motion is in the
positive direction. A negative number indicates
that the motion is in the negative direction.
When in the low 16-bit code, bit 4 is ON, it means
+16 the zero point is ON as the DOG point changes
DOG point is B point
(bit4=ON) from ON to OFF and the zero point is left as the
DOG point changes from OFF to ON.
When in the low 16-bit code, bit 5 is ON, it means
+32 the zero point is ON as the NL point changes from
NL point is B point
(bit5=ON) ON to OFF and the zero point is left as the DOG
point changes from OFF to ON.
When in the low 16-bit code, bit 6 is ON, set the
+64 number of pulses to be masked for DOG point
6_
DOG mask function
(bit6=ON) according to the setting in Mode+1, and enable the
mask function.

7. The execution sequence is based on the value of the low 16-bit code in the table above, and described below.

 The NL negative limit and DOG signal are determined by the value of bit 5 and bit 4.

 Mode 0 or mode 1 for the zero point return, selected according to the value of bit 3.

 The operation of the zero point return is performed according to the values of bit 1 and bit 0.

8. DOG mask function setting: For this function, ES3 CPU firmware V1.06.00 or later works with ISPSoft V3.16 or

later/ DIADesigner V1.30 or later, and ES300TEC/EX3/SV3/SX3 CPU firmware V1.00.00 or later works with

DIADesigner V1.30 or later.

When the mask function is enabled (bit6 is set to 1), Mode+1 stores the number of pulses to be masked for DOG

point. If the value in Mode+1 is less than or equal to 0, the mask function of DOG point is regarded as disabled. The

already output pulse number (regardless directions positive or negative) after DZRN2 is started is seen as the basis

for judging the mask section. For this instruction is to search for the zero point, the start position for searching of the

6-967
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

zero point may be different each time, and the zero point may be missed due to the set mask section. You should

set the negative limit or not according to your application.

Example:

Set Mode to D0=64 (bit 6 is set to 1) and D2=120,000 (number of pulses to be mask). After DZRN2 is started, the

DOG signals of output pulse number under 120,000 will be masked (invalid).

9. The Completion flag is set to ON after the instruction finishes performing the specified function. For example, for

function code 2, the PLC sets the Completion flag to ON only when the number of specified pulses completes

outputting.

10. After the DZRN2 instruction is executed, an interrupt service program is not executed till the DZRN2 instruction is

disabled, if the specified input point for the zero point is the same as that for the external input interrupt in the

program.

11. It is not suggested you use this instruction in the ST programming language, interrupt tasks or function block which

is called only once. ES3/EX3 CPU firmware V1.06.00 or later and SV3/SX3 CPU firmware V1.00.00 or later support
this instruction edited in the ST language. Please refer to the example explanation for more.

The steps for performing the functions are as below

Function code 0:

 The DZRN2 function is executed and the search for the zero point is in the negative direction with the target

_6 frequency (TFreq).

 After the DOG signal is received, the output frequency decreases to the JOG frequency (JFreq). The output

continues in the negative direction and does not stop until the zero point signal changes from ON to OFF.

 The output stops when the signal changes from ON to OFF and the axis moves away from the DOG signal.

Negative direction

Completion flag ON

DOG signal ON

Frequen cy

Target frequency

JOG frequency
Time
1 2 3

Function code 1:

 The DZRN2 function is executed and the search for the zero point is in the negative direction with the target

6-968
C ha pt er 6 A p pl i e d In s tr uc t io ns

frequency (TFreq).

 After the DOG signal is received, the output is in the positive direction with the JOG frequency (JFreq) after the

output frequency decreases, and the motion direction reverses. The output does not stop until the zero point

signal changes from ON to OFF.

 The axis moves away from the DOG signal and PLC stops when the signal changes from ON to OFF.

P ositive
Negative direction direction

Completion flag ON

DOG signal ON
F requency

Target frequency

JOG frequency
Time
1 2 3 4

Function code 2:

 The DZRN2 function is executed and the search for the zero point is in the negative direction with the target

frequency (TFreq).
6_
 After the DOG signal is received, the output decreases the frequency to the JOG frequency (JFreq) and

continues in the negative direction.

 When the DOG signal is left and the signal changes from ON to OFF, the specified number of pulses are output.

 The first pulse output starts.

 When the 100th pulse output completes, the PLC stops and the Completion flag is ON.

Completion flag ON

DOG signal ON

Output Y

Frequency

Target frequency

JOG frequency
Time

1 2 3 4 5

6-969
DV P- E S 3/ EX 3/ S V 3/ SX 3 S er ies Pr ogr am m ing M a nu a l

Example 1

When M0 is ON, outputting the pulse from Y0 with a frequency of 20 kHz to search for the zero point in the negative

direction. When the DOG signal is received and X4 is ON, it keeps moving in the negative direction with the JOG

frequency of 1 kHz. The output stops immediately after X4 changes from ON to OFF.

Explanation

Mode is set to 0.

High 16-bit [0000] is to disable the function to move a number of pulses..

Low 16-bit [0000] is Mode 0; when the DOG signal is received, the axis moves in the negative direction; after the axis
_6 moves away from the DOG signal, it stops immediately.

Example 2 (Edited in the ST programming language)

When the DZRN2 instruction is used, the ladder diagram (LD) language is highly recommended for the program editing. If
this instruction is edited in the ST language, which is supported by ES3/EX3 CPU firmware V1.06.00 or later and
SV3/SX3 CPU firmware V1.00.00 or later, you must wait until the return to the zero point is completed (SM461 flag is ON),
and then disable the instruction, using the auto-reset flag to notify the PLC to release the high-speed output control right.

The programming example using Y0 output is shown in the following figure.

6-970
Ch ap te r 6 Ap pl ie d Instruc ti ons

6.27 Delta CANopen and EtherCAT Communication Instructions

6.27.1 List of Communication Instructions


The following table lists the High-speed Output instructions covered in this section.

Instruction code Pulse CANopen EtherCAT


API Function
16-bit 32-bit instruction Servo Inverter Servo Inverter
Initializing the drives for CANopen
2800 INITC – – V V – –
communication
2801 ASDON – – Drive ON and OFF V V V V
Setting the acceleration time and
2802 CASD – – V V V V
deceleration time for a drive
2803 – DDRVIC – Servo relative position control V – V –
2804 – DDRVAC – Servo absolute position control V – V –
2805 – DPLSVC – Drive speed control V V V V
2806 ZRNC – – Servo homing V – V –
Reading and writing CANopen
2807 COPRW – – V V – –
communication data
Writing multiple CANopen
2808 COPWL DCOPWL – V V – –
parameter values
2809 RSTD – – Sending Reset or NMT command V V V V
Setting the homing mode for Delta
2810 ZRNM – – V – V –
servo
2811 EMER – – Reading Emergency message V V V V
Controlling the tracking function of
2812 – DCSFOC –
a servo via communication
V – V –
6_
Downloading E-CAM chart to the
2813 ECAMD – – V – – –
Slave
E-CAM parameter setting and
2814 – DECAMS – V – – –
planning
Activating E-CAM control and
2815 ECAMA – – V – – –
displaying the status
Modifying the starting address for
2816 ECAMC – – E-CAM chart and the E-CAM V – – –
chart length in the servo
2817 – DTQC – Torque control V V V –
2818 – DTQLC – Speed of torque control V V V –
Initializing the slaves for EtherCAT – –
2820 INITEC – – V V
communication
Reading and writing EtherCAT – –
2821 ECATRW – – V V
SDO data
Reading Motion state of a – –
2822 MOTST – – V V
specified axis in EtherCAT
Reading the communication state – –
2823 ECATST – – V V
of an EtherCAT slave
Note: for supported firmware versions and servo models, please refer to INITC or INITEC instructions explanation.

6-971
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

6.27.2 Explanation of CANopen and EtherCAT Instructions

API Instruction Operand Description

Initializing the drives for


2800 INITC S
CANopen communication

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S  
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

S: Node IDs of axes for initialization

Explanation

_6 1. Before executing the instruction, be sure to set up CANopen Communication settings, including work mode: Delta

Special Driver or Delta Special Driver & CANopen DS 301 and bit rate.

A. Work Mode: Go to HWCONFIG -> Settings -> Options -> Built-in CAN Communication -> CAN port work

mode: Delta Special Driver / Delta Special Driver & CANopen DS 301.

B. Bit rate: Go to HWCONFIG -> Settings -> Options -> Built-in CAN Communication -> CAN bit rate -> 10K to

1000K. (PLC, servo and inverter should use the same bit rate.)

2. The servo range of S is 1–8. When the input value is greater than 8, PLC automatically processes 8 as value of S

for the initialization. The node ID must start at 1 and the following ones cannot be skipped or reserved.

3. S ranging from 21 to 28 is added for inverters. For the input value that is not in the range of 21 to 28, this

instruction will not be executed. Same rule applies to the servo; the node ID must start at 21 and the following ones

should be in consecutive order.

4. When setting the number of station to be initialized to 5, this instruction initializes node ID from 1 to 5. And when

setting the number of station to be initialized to 23, this instruction initializes node ID from 21 to 23. When there are

5 servo systems and 3 inverters that need to be initialized, you need to execute this instruction twice. One is INITC

5 for 5 servo systems and the other is INITC 23 for 3 inverters.

6-972
Ch ap te r 6 Ap pl ie d Instruc ti ons

5. When you execute this instruction (SM1686 = OFF) on servos (S is 1–8), SM1681 is set to OFF and the states of

servo 1 to 8 are reset to uninitialized. SM1681 is set to ON when the initializations on servo 1 to 8 are complete.

SM1683 is set to OFF and S is 21–28, the states of servo 21 to 28 are reset to uninitialized. SM1683 is set to ON

when the initializations on servo 21 to 28 are complete.

Note: The initialization flags are used for notifying if the initialization is done or not. After that if you use parameters

in this instruction, these two flags are used as completion flags for the execution of the instruction.

6. SM1682 is set to ON when an error occurs during communication. In addition, SR658 retains the number of the

axis in which the error occurs and SR659 retains the error code. (The flag and code here are especially for Delta

CANOpen Communication Instructions.)

7. A new functional SM1686 is added for initializing only one specified slave. For example if you set SM1686 to OFF

and execute INITC 3 indicates the slaves 1, 2 and 3 will be initialized. After that if you set SM1686 to ON, execute

INITC 6 indicates only the slave 6 will be initialized. And then together you will have slaves 1, 2, 3, and 6 initialized.

You need to initialize the slaves before setting up the slave corresponding parameters.

8. If you need to initialize multiple slaves and single slave, you need to set SM1686 to OFF first to have multiple

slaves initialized and then set SM1686 to ON for single initializations, but not the other way around.

9. If a heartbeat error (SR0 = 0x1900 to 0x191C; last 2 codes are the slave ID) occurs after the initialization is

complete and the SM1684 is OFF (default, indicating when one goes down, all the servos are OFF), the

initialization complete flags SM1681 & SM1683 will be cleared to OFF and related actions on other slaves will also

be paused. After all the troubles are cleared, you need to initialize every slave to restart the operation. PLC will turn
6_
the error LED off after PLC confirms the initialization is complete. This error will be recorded in the error log.

10. If the axes are working independently and the communication is working properly, you can set the SM1684 to ON
(indicating when one goes down, only the defective servo is OFF) to notify PLC to record the specific error on the

error log and other slaves can keep working.

11. You need to set the node ID and speed of the servos manually and then turn the servos off and then on again to

activate the new parameters.

12. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-973
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Initialization and operation process chart

HWCO NF IG
CA N Port Work Mode
PL CRun

P LC sending
initialization
No
I nit ia lization Se t up er ro r r eco rd
complete e x: Se rv o, V F D di sco nn ecte d

S e t u p in iti al iza tio n co mp le te PL CRun


fla gs M1 68 1 & M1 6 83
Cl ea r ini ti al iza tio n co mp le te Wait for
flag s M16 8 1 & M1 68 3 the P LC to run
PL CStop
Determine if the heartbeat Abnormal
works normally S top he a rtb ea t fu ncti on
and sto p se rvo & V FD
Norma l

St ill Run E xecu te th e co mmu ni cati on PL C Stop Cl ea r ini tia l iza tio n co mpl e te
i nstr ucti on s for po si tio ni ng flag s M16 8 1 & M1 68 3

Example 1: Communication with Delta Servo ASDA-A2-M

1. Before executing the instruction, be sure to set up CANopen Communication settings, including work mode: Delta
_6 Special Driver or Delta Special Driver & CANopen DS 301 and bit rate.

A. Work Mode: Go to HWCONFIG -> Settings -> Options -> Built-in CAN Communication -> CAN port work

mode: Delta Special Driver / Delta Special Driver & CANopen DS 301.

6-974
Ch ap te r 6 Ap pl ie d Instruc ti ons

B. Bit rate: Go to HWCONFIG -> Settings -> Options -> Built-in CAN Communication -> CAN bit rate -> 1000K.

(PLC, servo and inverter should use the same bit rate.)

2. Connect the ES3 Series PLC to an ASDA series with a CANopen communication cable as shown in the figure

below.

6_

3. Follow the steps below for the basic settings on the panel of the ASDA-A2.

a. Set the servo parameter P2-08 to 10 to restore the factory settings.

b. Power the servo off and back on again.

c. Set P1-01 to 0001 (PR mode).

d. Set P3-01 to 0400 and the baud rate of the servo for CANopen communication to 1.0 Mbps. The baud rate must

be the same as that of the PLC.

e. Set a node ID for every servo, based on the number of servos. Set P3-00 of each servo to 1, 2, and 3 in order.

You can set a maximum of eight servos.

f. Power the servo off and back on again.

g. Begin operation after the basic setting is complete.

6-975
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

4. Download the sample program and set M0 to ON and SM1686 is OFF by default. The instruction initializes the

servos at node ID 1–3. When SM1681 is ON, the initialization is complete. When the servo enters CANopen mode

successfully, Co-Ld information is displayed.

Ladder diagram:

Structured Text:

5. The following list shows the settings to initialize a servo drive in the ES3 Series (built-in CAN communication port)

a. Set P2-30 (auxiliary function) to 5 to indicate that the servo does not need to store the settings in EEPROM

permanently. This can prolong the servo life span.

b. Reset P6-02 (PATH#1) to 0 and P6-06 (PATH#3) to 0. This indicates that PATH#1 & #3 in PR mode are both
_6
cleared.

c. Set P3-06 (SDI source) to 16#0100. This indicates that DI1–DI8 are controlled by the hardware, EDI9 is

controlled by the software, and EDI10–EDI14 are controlled by the hardware.

d. Reset P4-07 (SDI status controlled manually) to 0.

e. Set P2-36 (EDI9) to 16#0101. This indicates that the function of EDI9 is set to Servo ON.

f. Set P0-17 (CM1A) to 1. This indicates that the mapping parameter is the pulse command output register CMD_O.

g. Set P0-18 (CM2A) to 64. This indicates that the mapping parameter is the pulse command register CMD_E.

h. Set P5-20–P5-35 (acceleration time) to 1. This indicates that the acceleration time is 1 ms.

i. Set P5-60–P5-75 (target speed) to 1. This indicates that the target speed is 0.1 rpm.

j. Set PDO1 to correspond to P5-07 (PR command), P0-01 (Fault code), P0-46 (state of DO point) and P4-07

(state of DI point)

k. Set PDO2 to correspond to P0-09 (CM1 state: CMD_O) and P0-10 (CM2 state: CMD_E).

6-976
Ch ap te r 6 Ap pl ie d Instruc ti ons

l. Set PDO3 to correspond to P0-11 (CM3 state: state of current torque)

m. Set time for the heartbeat and the PLC scan overtime to 200 ms (default). When a communication overtime

occurs, PLC will send error message (error LED flashing slowly; refer to error code for more details) and the

servo turns off automatically.

n. If SM1685 is ON, PDO3 reads self-defined parameters from servo drive P0-12 and stores the data in SR791-

SR806. You need to set up the P0-20 (CM4A) before executing. 2 SRs are reserved for every servo drive axis

and you can define their data types.

6. Do not use the COPRW instruction (API 2807) to modify the servo parameters of the eight items A, B, F, G, J, K

and N above after initialization.

7. When you use an absolute-type servo, use the COPRW communication instruction to write 16#0100 to P3-12,

which writes the relevant absolute-type servo parameters to EEPROM at the moment the servo powers off.

8. Set the relevant DI signal configuration parameters manually or with the COPRW instruction to modify the

hardware DI signal setting of ASDA-A2. Use COPRW to modify the configuration after execution of the INITC

instruction is complete and before the servo is enabled.

9. When the initialization is complete, the servo is in the PR mode. Do not make any communication control on servo

P5-18.

10. For more details on the servo parameters, refer to the Delta Servo Operation manual.
6_

Example 2: Communication with Delta Inverter

1. Manually set the inverter parameter P09-36 (ranging from 21 to 28), P09-37 (communication baud rate default is

1 MHz) and P09-40 to standard CANopen protocol (default).

2. Manually set the source of frequency command P00-20 to 6 and source of the operation command P00-21 to 3,

and have them controlled by CANopen communication.

3. The following list shows the settings to initialize an inverter in the ES3 Series.

A. Set PDO mapping area: the operation frequencies, current state, and states of torque and DI point correspond

to PLC SRs.

B. Set time for the heartbeat and the PLC scan overtime to 200 ms (default). When a communication overtime

occurs, PLC will send error message (error LED flashing slowly; refer to error code for more details) and the

inverter turns off automatically.

4. For more details on the inverter parameters, refer to the Delta Inverter Operation manual.

6-977
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the inverter at node ID 21. When

SM1683 is ON, it indicates the initialization is complete.

Additional Remarks:

The following table shows special flags (SM) and registers (SR) related to initialization.

Flag R/W ID. 1 ID. 2 ID. 3 ID. 4 ID. 5 ID. 6 ID. 7 ID. 8
Enable specific function R/W The flag in HWCONFIG is set to ON when the PLC is from Stop to Run.
Initialization and communication
R SM1681
complete (INITC and CASD)
CANopen communication error R SM1682
SM1686 = OFF (default; multiple slaves initialization)
Single slave initialization R/W
SM1686 = ON (single slave initialization)
Number of the axis with a
R SR658
_6 communication error
Communication error code R SR659
Note1: After the axis starts to output, PLC clears the corresponding completion flag.

The following table shows the Delta special drier CANopen error codes. (error code in SR659)

Error Code Cause


0x0002 The slave does not respond to the SDO message.
An error occurs in the message received by the slave. This error often occurs when the settings of
0x0003
the COPRW instruction are invalid causing the slave not to receive the complete message.
0x0006 One of the stations is being used when the INITC instruction is executed.
0x0007 Slave node ID exceeds acceptable range of the instruction INITC
A slave cannot be reset; check if the communication cable is connected and if the communication of
0x0008
the slave is working properly.
0x000B The specified slave has never been initialized.
0x000C The specified slave is executing the initialization instructions (INITC/INITEC/RSTD).

6-978
Ch ap te r 6 Ap pl ie d Instruc ti ons

When you use Delta Special Driver & AS Remote mode / Delta Special Driver & CANopen DS301 and execute INITC

instruction, the refreshing time of PDO data exchange among stations 1 to 15 and 21 to 28 is shown below. For example,

when the baud rate is 1M, PDO data exchange refreshing time is 10 ms X 5 times = 50 ms.

Baud rate (bps) 1M 500K 250K 125K 50K


Preset time to synchronize (ms)#1 10 15 30 60 80
Preset number of synchronization times #2 5 5 5 5 5
#1: If you use Delta Special Driver & CANopen DS301 mode, you can use CANopen Builder software to edit the time to

synchronize for the slaves. But the edited time can only be greater than the time shown in the table above. If you set the

time lesser than the time shown above, the system ignores the editing and runs according to the time shown above.

#2: If you use Delta Special Driver & CANopen DS301 mode, you can use CANopen Builder software to edit the number

of synchronization times for the preset number of synchronization times in the table of DS301. For the preset number of

synchronization times, it is not editable.

When you use Delta Special Driver & AS Remote mode / Delta Special Driver & CANopen DS301 and execute

COPPRW instruction (SDO communication), the communication timeout is shown below.

Baud rate (bps) 1M 500K 250K 125K 50K


Communication timeout (ms)#1 100 100 200 400 500

6_

6-979
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2801 ASDON S1,S2 Drive ON and OFF

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1          
S2  
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Node ID of a drive (CAN) /


S1 :
Axis No. (ECAT)
S2 : Servo ON and Servo OFF

Explanation

_6 1. This instruction changes the state of the servo at the address in S1. For CAN communication, the INITC instruction
must be complete before this instruction is executed. For ECAT communication, the INITEC instruction must be

complete before this instruction is executed.

2. For CAN communication, the range of S1 is 1-8 (for servo) and 21-28 (for inverter). There will be no execution when

the input value is out of the range. For ECAT communication, the range of S1 is 1-16. There will be no execution

when the input value is out of the range. Use INITEC instruction to set up the ID number and device type.

3. The range of S1 (for servo) is 1-8 (for CAN communication) and 1-16 (for ECAT communication) and S2 is a non-

zero value, the servo is enabled (Servo-ON). If S2 is 0, the servo is disabled (Servo-OFF).

4. The range of S1 (for inverter) is 21-28 (for CAN communication) and 1-16 (for ECAT communication). When S2 is 1,
it indicates it is in inverter speed mode. When S2 is 2, it indicates it is in inverter torque mode. When S2 is 0, it

indicates it stops operating. Since control modes (speed mode and torque mode) for inverters can be switched

directly, the operation can keep going. Before switching control modes, make sure all the inverter parameters are set.

6-980
Ch ap te r 6 Ap pl ie d Instruc ti ons

5. Table of the last 2 points:

Drive type Range of S1 Descriptions of S2


1-8 (CAN) 1 = SERVO-ON
Servo
1-16 (ECAT) 0 = SERVO-OFF
0 = Stop operating
21-28 (CAN)
Inverter 1 = Speed mode
1-16 (ECAT)
2 = Torque mode
6. For CAN communication, every servo (1-8) has a flag (SM1651-SM1658) for displaying its state. For ECAT

communication, every axis of servo (1-16) has a flag (SM1651-SM1658, SM1621-SM1628) for displaying its state.

You can read the actual servo state from the flag. When the flag is ON, the servo is ON. When the flag is OFF, the

servo is OFF.

7. For CAN communication, every inverter (21-28) has a flag (SM1621-SM1628) for displaying its state. For ECAT
communication, every axis of inverter (1-16) has a flag (SM1651-SM1658, SM1621-SM1628) for displaying its state.

You can read the actual inverter state from the flag. When the flag is ON, the inverter is ON. When the flag is OFF,

the inverter is OFF.

8. SM1682 is ON if an error occurs during communication. In addition, SR658 retains the axis number in which the

error occurs and SR659 retains the error code.

Example 1 (Ladder diagram)

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at node ID 1–3, until SM1681
6_
is ON.

2. When M1 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 2. When SM1652

is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the ASDON instruction starts to disable the servo at node ID 2. When SM1652

is OFF, it indicates Servo-OFF.

6-981
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2 (Structured Text)

_6

1. When M1 changes from OFF to ON, this instruction starts to enable the servo at node ID 2. When SM1652 is ON, it

indicates Servo-ON.

2. Make sure M1 and SM1652 are both ON and then set the auto return communication control right flag SM1582 to

ON for node ID 2. This will free the communication control right and the node ID 2 can receive and execute other

communication instructions.

3. When M2 changes from OFF to ON, this instruction starts to disable the servo at node ID 2. When SM1652 is OFF, it

indicates Servo-OFF.

4. Make sure M2 is ON and SM1652 is OFF and then set the auto return communication control right flag SM1582 to

ON for node ID 2. This will free the communication control right and the node ID 2 can receive and execute other

communication instructions.

6-982
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3: Communication with Delta inverters

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the node ID 21. When SM1683 is ON, it

indicates the initialization is complete.

2. When M2 changes from OFF to ON, the ASDON instruction starts to set the control mode at the node ID 21. When

SM1621 is ON, it indicates the inverter is in operation.

6_

6-983
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 4: EtherCAT communication with Delta servo ASDA-A2-E (Ladder diagram)

1. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the servos of axis numbers 1-3, until

M100 is ON.

2. When M1 changes from OFF to ON, the ASDON instruction starts to enable the servo of axis numbers 2. When

SM1652 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the ASDON instruction starts to disable the servo of axis numbers 2. When

SM1652 is OFF, it indicates Servo-OFF.

_6

6-984
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 5: EtherCAT communication with Delta Inverters C2000, which works with CMC-EC01

1. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the axis number 1. When M100 is ON,
it indicates the initialization is complete.

2. When M2 changes from OFF to ON, the instruction starts to set the control mode at the axis number 1. When
SM1621 is ON, it indicates the inverter is in operation.

6_

6-985
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

Setting the acceleration time and


2802 CASD S1, S2, S3
deceleration time for a drive

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1          
S2          
S3          
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Node ID of the servo (CAN) /


S1 :
Axis No. (ECAT)
S2 : Acceleration time (ms)

S3 : Deceleration time (ms)


_6
Explanation

1. This instruction sets the servo acceleration and deceleration time for the servo at the address in S1. For CAN

communication, the INITC instruction must be complete before this instruction is executed. For ECAT

communication, the INITEC instruction must be complete before this instruction is executed.

2. For CAN communication, the range of S1 is 1–8 (for servo) and 21-28 (for inverter). There will be no execution when

the input value is out of the range. For ECAT communication, the range of S1 is 1–16. There will be no execution

when the input value is out of the range. Use INITEC instruction to set up the axis number and device type.

6-986
Ch ap te r 6 Ap pl ie d Instruc ti ons

3. Table to describe S2 and S3

Drive
Range of S1 Range of S2 and S3 Descriptions of S2 and S3
type

S2: Acceleration time is the period of time during


1-8 (CAN) which the servo spins up from 0 to 3000.0 rpm.
Servo 1-32767 (ms)
1-16 (ECAT) S3: Deceleration time is the period of time during
which the servo spins down from 3000.0 rpm to 0.

S2: Acceleration time is the period of time during


100-32700 (ms) which the inverter spins up from 0.0Hz to the
21-28 (CAN communication) The input value highest operation frequency.
Inverter
1-16 (ECAT communication) should be multiplied S3: Deceleration time is the period of time during
by 100. which the servo spins down from the highest
operation frequency to 0.
4. For CAN communication, when you execute this instruction and the range of S1 is 1–8 (for servo), SM1681 is set to

OFF (parameters are being editing). When the servo responds to the received command, SM1681 is ON

(parameters are set successfully). When you execute this instruction and the range of S1 is 21–28 (for inverter),

SM1683 is set to OFF (parameters are being editing). When the inverter responds to the received command,

SM1683 is ON (parameters are set successfully).

5. For ECAT communication, when you execute this instruction and the range of S1 is 1–16, SM1681 is set to OFF

(parameters are being editing). When the servo / inverter responds to the received command, SM1681 is ON

(parameters are set successfully).

6. SM1682 is set to ON when an error occurs during communication. In addition, SR658 retains the number of the axis 6_
in which the error occurs and SR659 retains the error code.

7. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example 1: CAN communication with Delta ASDA-A2M

1. When M0 changes from OFF to ON, the INITC instruction initializes the servos at node IDs 1–3, until SM1681 is ON.

2. When M1 changes from OFF to ON and the target speed of the servo at node ID 2 is 3000 rpm, the CASD
instruction sets the acceleration time of servo 2 to 3000 ms and the deceleration time to 9000 ms.

3. If the target speed of servo 2 is 1000 rpm, the acceleration time and deceleration time are shown below.

Acceleration time: [3000 ms / 3000 rpm] × 1000 rpm = 1000 ms

Deceleration time: [9000 ms / 3000 rpm] × 1000 rpm = 3000 ms

6-987
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2: CAN communication with Delta inverters

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the node ID 21. When SM1683 is ON, it

indicates the initialization is complete.

2. When M1 changes from OFF to ON, the CASD instruction starts to set the acceleration time to 2000 ms and

deceleration time to 3000 ms at the node ID 21.


_6

6-988
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3 EtherCAT communication with Delta ASDA-A2-E

1. When M0 changes from OFF to ON, the INITC instruction initializes the servos at node IDs 1–3, until M100 is ON.

2. When M1 changes from OFF to ON and the target speed of the servo at node ID 2 is 3000 rpm, the CASD
instruction sets the acceleration time of servo 2 to 3000 ms and the deceleration time to 9000 ms.

3. If the target speed of servo 2 is 1000 rpm, the acceleration time and deceleration time are shown below.

Acceleration time: [3000 ms / 3000 rpm] × 1000 rpm = 1000 ms

Deceleration time: [9000 ms / 3000 rpm] × 1000 rpm = 3000 ms

6_

6-989
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2803 D DRVIC S1, S2, S3 Servo relative position control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2    
S3    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Node ID of servo (CAN)


S1 :
/ Axis No. (ECAT)
S2 : Relative target position

S3 : Target speed
_6
Explanation

1. For CAN communication, the INITC and ASDON (servo ON) instructions must be complete before this instruction is
executed. For ECAT communication, the INITEC and ASDON (servo ON) instructions must be complete before this

instruction is executed.

2. For CAN communication, the range of S1 is 1–8. There will be no execution when the input value is out of the range.

For ECAT communication, the range of S1 is 1–16. There will be no execution when the input value is out of the

range or if the device of the assigned ID or axis No. is not a servo.

3. The range of S2 is -2147483648 to +2147483647. The +/- sign indicates the forward / reverse direction. The target

position is a relative position.

4. The unit of the value of S3 is 0.1 rpm. If the servo motor is a rotary one, its setting range is 1–60000, which indicates

0.1–6000.0 rpm. If the servo motor is a liner one, its setting range is 1-15999999, which indicates (1-15999999) *

10-6 m/s. The definition of acceleration and deceleration for third-party drivers, please refer to driver operation

manual for more details.

6-990
Ch ap te r 6 Ap pl ie d Instruc ti ons

5. When the target position is reached, the corresponding completion flags of axes SM1631–SM1638 for CAN node ID

1-8 and the corresponding completion flags of axes SM1631–SM1638, SM1921-SM1928 for ECAT node ID 1-16 are

ON. After the axis starts to output, PLC clears the corresponding completion flag. If the positioning is required for

several times on the same output axis, you need to clear the corresponding completion flags by yourself. If you do

not clear the servo positioning completion flag and then use the positioning instruction again and again, it is possible

that before the next positioning instruction is executed, a servo positioning completion flag is detected and then the

execution of positioning instruction will be stopped.

6. Refer to the following table for the corresponding SM and SR of the axes.

7. SM1682 is ON when an error occurs during communication. In addition, SR658 retains the number of the axis in

which the error occurs and SR659 retains the error code.

8. This instruction uses SDO (Service Data Object) of CANopen protocol to communicate. Since only one SDO

communication can be sent for a time, do NOT use this instruction for outputting positioning in various axis

synchronized motion.

9. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

10. For ES3 Series, the following function is available for the PLC CPU with firmware V1.06.10 or later, and ISPSoft

V3.16 or later / DIADesigner V1.30 or later. For ES300TEC/EX3/SV3/SX3 Series, the following function is available

for the PLC CPU with firmware V1.00.00 or later, and DIADesigner V1.30 or later.
6_
The function supports to modify the target speed and the target position during instruction execution.

Target speed modification:

The servo will act according to the acceleration and deceleration time. If the new target speed is 0, the servo will go

decelerating and then to a stop. If the new target speed is changed from 0 to any number other than 0, the servo will

resume whatever the movement was.

Target position modification:

For the movement in a negative direction, the target position is not allowed to change.

For the relative positioning, when the new target position is 0, the servo will go decelerating and then to a stop

immediately and the positioning is seen as achieved.

6-991
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

11. For ES3 Series, the following function is available for the PLC CPU with firmware V1.08.00 or later, and ISPSoft

V3.17 or later / DIADesigner V1.30 or later. For ES300TEC/EX3/SV3/SX3 Series, the following function is available

for the PLC CPU with firmware V1.00.00 or later, and DIADesigner V1.30 or later.

a. You set the SM441 flag to ON. The two-speed function is activated when the instruction is executed and then

the system automatically resets SM441 to OFF.

b. When the two-speed function is enabled, changing the target speed and the target position is not supported

during instruction execution.

c. When the two-speed function is enabled, DDRVAC does not support the SM1661 flag for enabling the go-

back/go-forth function.

d. When the two-speed function is enabled, the two instructions support the SM1641 flag for temporarily stopping

the output. After a pause, the output is resumed and is performed at the second target speed V2.

e. The methods of setting the target positions for the first and second speeds and setting the two target output

speeds are as follows:

S2 is the target position of the first speed (P1), ex: D0;

S2+1 is the target position of the second speed (P2), ex: D2;

S3 is the first target speed (V1), ex: D100;

_6 S3+1 is the second target speed (V2), ex: D102.

For relative positioning, the positive / negative sign of the target position of the first speed (P1) is taken as the

output direction and the total target position is the sum of both absolute values of the target positions of the first
and second speeds, that is, ABS(P1) + ABS(P2).

For absolute positioning, the servo current position (cur_pos), target position of the first speed (P1) and target

position of the second speed (P2) must meet following conditions:

Forward action: cur_pos < P1 < P2; Reverse action: cur_pos > P1 > P2.

f. Servo PR commands for the first speed and the second speed are superimposed and the actual output actions

are illustrated in the following figure:

6-992
Ch ap te r 6 Ap pl ie d Instruc ti ons

12. To set the positioning completion flag of Delta servo: when the position of the specified servo CMD_O has reached

the specified target position, the positioning completion flag will be ON. You can also use (SR811-SR818) to set the

allowable range to determine the positioning completion, allowing the error range for the target position. For example:

if the allowable error range is set to 10, it means that there is a positive/negative error of 10 PUU to be considered

reaching the target position.

Example 1: CAN communication with Delta servo ASDA-A2-M (Ladder diagram)

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at node IDs 1–3, until

SM1681 is ON.

2. When M1 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 2. When SM1652

is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, servo 2 moves to the relative position 100000 PUU at 100.0 rpm.

The finish flag SM1632 is ON when the target position is reached.

6_

6-993
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2: Communication with Delta servo ASDA-A2-M (Structured Text)

1. When M2 changes from OFF to ON, servo 2 moves to the relative position 100000 PUU at 100.0 rpm.
The finish flag SM1632 is ON when the target position is reached.
2. Make sure M2 and SM1632 are both ON and then set the auto return communication control right flag SM1582 to
ON for node ID 2. This will free the communication control right and the node ID 2 can receive and execute other
communication instructions.

Example 3: EtherCAT communication with Delta servo ASDA-A2-E (Ladder diagram)

1. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the axis number 1–3 of the servos,

until M100 is ON.

2. When M1 changes from OFF to ON, the instruction ASDON starts to enable the axis number 2 of the servo. When

SM1652 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the axis number 2 moves to the relative position 100000 PUU at 100.0 rpm.

_6 The finish flag SM1632 is ON when the target position is reached.

6-994
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 4: EtherCAT communication with Delta servo ASDA-W3

1. Example: 3 servos with a total of 5 axes.

Servo #1 Servo #2 Servo #3


Slaves
(ASDA-A2-E) (ASDA-W3-E with 3 axes) (ASDA-A2-E)

Axis number 1 2, 3, 4 5
6_
Stype D0 D1 D2
Set value 1 202 1

2. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the servos at node IDs 1–3, until M100

is ON.

3. When M1 changes from OFF to ON, the ASDON instruction starts to enable the axis number 2 of the servo. When

SM1652 is ON, it indicates Servo-ON.

4. When M2 changes from OFF to ON, the axis number 2 of the servo moves to the relative position 100000 PUU at

60.0 rpm. The finish flag SM1632 is ON when the target position is reached.

5. DDRVIC and DDRVAC set the parameter S3 in the object Speed command (puu/s) in the servo ASDA-W3, and the

actual motor output speed is calculated in rpm as follows:

The number of pulses per revolution is fixed at 134217728. Suppose that the servo e-gear ratio P1-44/P1-45 is

134217728/1000, which means that 1000 pulses are required per revolution for the servo. At present, S3 is 1000 Hz

(1000 pulses per second), and thus the number of pulses per minute is 1000*60 - that is, the servo motor speed is

1000*60/1000=60 rpm.

6-995
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-996
Ch ap te r 6 Ap pl ie d Instruc ti ons

A. Explanation of special flags (SM) and registers (SR) for Delta special CAN communication instructions

The following table shows special flags (SM) and registers (SR) related to Delta special CAN communication.

Flag R/W ID. 1 ID. 2 ID. 3 ID. 4 ID. 5 ID. 6 ID. 7 ID. 8
The flag in HWCONFIG is set to ON when the PLC changes from Stop to
Enable specific function R/W
Run.
Initialization and communication
R SM1681
complete (INITC and CASD)
Communication error R SM1682
SM1686 = OFF (default; multiple slaves initialization)
Single slave initialization R/W
SM1686 = ON (single slave initialization)
Positioning complete R/W#1 SM1631 SM1632 SM1633 SM1634 SM1635 SM1636 SM1637 SM1638
Stop R/W SM1641 SM1642 SM1643 SM1644 SM1645 SM1646 SM1647 SM1648
Servo-ON R SM1651 SM1652 SM1653 SM1654 SM1655 SM1656 SM1657 SM1658
Go-back/go-forth enabled
R/W SM1661 SM1662 SM1663 SM1664 SM1665 SM1666 SM1667 SM1668
(Only supported by DRVAC).
Go-back/go-forth direction indicator
R SM1671 SM1672 SM1673 SM1674 SM1675 SM1676 SM1677 SM1678
(Only supported by DRVAC).
Auto return communication control
R/W SM1581 SM1582 SM1583 SM1584 SM1585 SM1586 SM1587 SM1588
right
Heartbeat error code R SM1691 SM1692 SM1693 SM1694 SM1695 SM1696 SM1697 SM1698
SM1684 = OFF (default; when one goes down, all the servos are OFF.)
Heartbeat error handling R/W
SM1684 = ON (when one goes down, only the defective servo is OFF.)
Number of the axis with a
R SR658
communication error
6_
Communication error code R SR659

Note1: After the axis starts to output, PLC clears the corresponding completion flag. If the positioning is required for

several times on the same output axis, you need to clear the corresponding completion flags by yourself. If you do not

clear the servo positioning completion flag and then use the positioning instruction again and again, it is possible that

before the next positioning instruction is executed, a servo positioning completion flag is detected and then the execution

of positioning instruction will be stopped.

6-997
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

The following table shows how Delta servo parameters of axes correspond to special flags and registers in the CANopen

communication.

Servo Parameter Name (Number) R/W ID. 1 ID. 2 ID. 3 ID. 4 ID. 5 ID. 6 ID. 7 ID. 8
PR command (P5-07) R SR661 SR662 SR663 SR664 SR665 SR666 SR667 SR668
Alarm code (P0-01) (hexadecimal) R SR671 SR672 SR673 SR674 SR675 SR676 SR677 SR678
DO state (P0-46) R SR681 SR682 SR683 SR684 SR685 SR686 SR687 SR688
SR691 SR693 SR695 SR697 SR699 SR701 SR703 SR705
Servo command position CMD_O (P0-09) R
SR692 SR694 SR696 SR698 SR700 SR702 SR704 SR706
SR711 SR713 SR715 SR717 SR719 SR721 SR723 SR725
Servo target position CMD_E (P0-10) R
SR712 SR714 SR716 SR718 SR720 SR722 SR724 SR726
DI state (P4-07) R SR731 SR732 SR733 SR734 SR735 SR736 SR737 SR738

Current torque (P0-11) (unit: 0.1%) R SR741 SR742 SR743 SR744 SR745 SR746 SR747 SR748

Self-defined (P0-12) * SR791 SR793 SR795 SR797 SR799 SR801 SR803 SR805
R
Work with SM1685 Enable/Disable SR792 SR794 SR796 SR798 SR800 SR802 SR804 SR806

Positioning completion range setting R/W SR811 SR812 SR813 SR814 SR815 SR816 SR817 SR818

The following table shows how Delta inverter parameters of axes correspond to special flags and registers in the

CANopen communication.

Description ID. 21 ID. 22 ID. 23 ID. 24 ID. 25 ID. 26 ID. 27 ID. 28


Initialization complete flag R SM1683
_6 R SM1621 SM1622 SM1623 SM1624 SM1625 SM1626 SM1627 SM1628
Inverter starting up flag
Inverter Heartbeat error flag R SM1611 SM1612 SM1613 SM1614 SM1615 SM1616 SM1617 SM1618

Auto return communication R/W SM1601 SM1602 SM1603 SM1604 SM1605 SM1606 SM1607 SM1608
control right
Inverter status (Index 6041H-00H) R SR751 SR752 SR753 SR754 SR755 SR756 SR757 SR758
*1

Inverter current velocity


R SR761 SR762 SR763 SR764 SR765 SR766 SR767 SR768
(Index 6043H-00H) *1
Inverter current torque
(unit: 0.1%) R SR771 SR772 SR773 SR774 SR775 SR776 SR777 SR778
(Index 2021H-0CH) *1
Inverter digital input status
R SR781 SR782 SR783 SR784 SR785 SR786 SR787 SR788
(Index 2022H-11H) *1

*1. This index is the parameter communication address defined by CANopen DS301 Standard. For more details, please

refer to Delta inverters operation manual.

6-998
Ch ap te r 6 Ap pl ie d Instruc ti ons

The following table shows the Delta special driver CANopen error codes. (error code in SR659)

Error Code Cause


0x0002 The slave does not respond to the SDO message.
An error occurs in the message received by the slave. This error often occurs when the settings of the
0x0003
COPRW instruction are invalid causing the slave not to receive the complete message.
0x0004 The slave PDO message is not received.
0x0005 An error occurs while using the instruction operand.
0x0006 One of the stations is being used when the INITC instruction is executed.
0x0007 Slave node ID exceeds acceptable range of the instruction INITC
A slave cannot be reset; check if the communication cable is connected and if the communication of
0x0008
the slave is working properly.
0x000B The specified slave has never been initialized.
0x000C The specified slave is executing the initialization instructions (INITC/INITEC/RSTD).

B. Explanation of special flags (SM) and registers (SR) for Delta special EtherCAT communication instructions
(one slave with one axis)

The following table shows special flags (SM) and registers (SR) related to Delta special EtherCAT communication.

Flag R/W ID. 1 to ID. 8


CASD communication complete R/W SM1681
EtherCAT communication error R/W SM1682
SM1684 = OFF (default; when one goes down, all the servos are OFF.)
Connection loss handling R/W
SM1684 = ON (when one goes down, only the defective servo is OFF.) 6_
SR656
ECAT SDO abort code (32-bit) R/W
SR657
ID number with a communication
R/W SR658
error
Communication error code R/W SR659

Function R/W ID. 1 ID. 2 ID. 3 ID. 4 ID. 5 ID. 6 ID. 7 ID. 8
Servo positioning complete*2 R/W SM1631 SM1632 SM1633 SM1634 SM1635 SM1636 SM1637 SM1638
Servo stop R/W SM1641 SM1642 SM1643 SM1644 SM1645 SM1646 SM1647 SM1648
Servo-ON, inverter-ON R SM1651 SM1652 SM1653 SM1654 SM1655 SM1656 SM1657 SM1658
Go-back/go-forth enabled
R/W SM1661 SM1662 SM1663 SM1664 SM1665 SM1666 SM1667 SM1668
(Only supported by DRVAC)
Go-back/go-forth direction indicator
R SM1671 SM1672 SM1673 SM1674 SM1675 SM1676 SM1677 SM1678
(Only supported by DRVAC)
Auto return communication control
R/W SM1581 SM1582 SM1583 SM1584 SM1585 SM1586 SM1587 SM1588
right
Connection loss error code*1 R/W SM1691 SM1692 SM1693 SM1694 SM1695 SM1696 SM1697 SM1698

6-999
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Function R/W ID. 9 ID. 10 ID. 11 ID. 12 ID. 13 ID. 14 ID. 15 ID. 16
Servo positioning complete*2 R/W SM1921 SM1922 SM1923 SM1924 SM1925 SM1926 SM1927 SM1928
Servo stop R/W SM1931 SM1932 SM1933 SM1934 SM1935 SM1936 SM1937 SM1938
Servo-ON, inverter-ON R SM1621 SM1622 SM1623 SM1624 SM1625 SM1626 SM1627 SM1628
Go-back/go-forth enabled
R/W SM1941 SM1942 SM1943 SM1944 SM1945 SM1946 SM1947 SM1948
(Only supported by DRVAC)
Go-back/go-forth direction indicator
R SM1951 SM1952 SM1953 SM1954 SM1955 SM1956 SM1957 SM1958
(Only supported by DRVAC)
Auto return communication control
R/W SM1601 SM1602 SM1603 SM1604 SM1605 SM1606 SM1607 SM1608
right.
Connection loss error code#1 R/W SM1611 SM1612 SM1613 SM1614 SM1615 SM1616 SM1617 SM1618

*1. Since the heartbeat is not available for ECAT communication, working counter (WKC) is used to determine whether

the connection of a slave is lost or not.

*2. The timing for the servo positioning completion flag to be cleared to off automatically is when the outputting of the

axis is enabled. If you need to use positioning instructions on a certain axis for several times in a row, you need to

clear the servo positioning completion flag by yourself. If you do not clear the servo positioning completion flag and

then use the positioning instruction again and again, it is possible that before the next positioning instruction is

executed, a servo positioning completion flag is detected and then the execution of positioning instruction will be

stopped.

The following table shows special registers (SR) related to Servo ECAT communications (one slave with one axis).

_6 Parameter Name (Number) R/W ID. 1 ID. 2 ID. 3 ID. 4 ID. 5 ID. 6 ID. 7 ID. 8
Servo PR command (P5-07) /
R SR661 SR662 SR663 SR664 SR665 SR666 SR667 SR668
Inverter status (index 6041H-00H)
Servo Alarm code (P0-01) R SR671 SR672 SR673 SR674 SR675 SR676 SR677 SR678
Servo DO state (P0-46) R SR681 SR682 SR683 SR684 SR685 SR686 SR687 SR688
Servo command position CMD_O SR691 SR693 SR695 SR697 SR699 SR701 SR703 SR705
R
(P0-09) SR692 SR694 SR696 SR698 SR700 SR702 SR704 SR706
Servo target position CMD_E SR711 SR713 SR715 SR717 SR719 SR721 SR723 SR725
R
(P0-10) SR712 SR714 SR716 SR718 SR720 SR722 SR724 SR726
Servo DI state (P4-07) R SR731 SR732 SR733 SR734 SR735 SR736 SR737 SR738
Current torque (P0-11) R SR741 SR742 SR743 SR744 SR745 SR746 SR747 SR748
SR791 SR793 SR795 SR797 SR799 SR801 SR803 SR805
Servo Self-defined (P0-12) R
SR792 SR794 SR796 SR798 SR800 SR802 SR804 SR806
Positioning completion range setting R/W SR811 SR812 SR813 SR814 SR815 SR816 SR817 SR818

6-1000
Ch ap te r 6 Ap pl ie d Instruc ti ons

Parameter Name (Number) R/W ID. 9 ID. 10 ID. 11 ID. 12 ID. 13 ID. 14 ID. 15 ID. 16
Servo PR command (P5-07) /
R SR751 SR752 SR753 SR754 SR755 SR756 SR757 SR758
Inverter status (index 6041H-00H)
Servo Alarm code (P0-01) R SR761 SR762 SR763 SR764 SR765 SR766 SR767 SR768
Servo DO state (P0-46) R SR1191 SR1192 SR1193 SR1194 SR1195 SR1196 SR1197 SR1198
Servo command position CMD_O SR1201 SR1203 SR1205 SR1207 SR1209 SR1211 SR1213 SR1215
R
(P0-09) SR1202 SR1204 SR1206 SR1208 SR1210 SR1212 SR1214 SR1216
Servo target position CMD_E SR1221 SR1223 SR1225 SR1227 SR1229 SR1231 SR1233 SR1235
R
(P0-10) SR1222 SR1224 SR1226 SR1228 SR1230 SR1232 SR1234 SR1236
Servo DI state (P4-07) R SR781 SR782 SR783 SR784 SR785 SR786 SR787 SR788
Current torque (P0-11) R SR771 SR772 SR773 SR774 SR775 SR776 SR777 SR778
SR1241 SR1243 SR1245 SR1247 SR1249 SR1251 SR1253 SR1255
Servo Self-defined (P0-12) R
SR1242 SR1244 SR1246 SR1248 SR1250 SR1252 SR1254 SR1256
Positioning completion range R/W SR1261 SR1262 SR1263 SR1264 SR1265 SR1266 SR1267 SR1268

The following table shows the ECAT communication error codes of Delta servos and inverters (one slave with one axis).
in SR659.

Error code Cause


0x0002 The slave does not respond to the SDO message.
An error occurs in the message received by the slave. This error often occurs when the settings of
0x0003
the COPRW instruction are invalid causing the slave not to receive the complete message.
0x0004 The slave PDO message is not received.
0x0005 An error occurs while using the instruction operand.
0x0006 One of the stations is being used when the INITC instruction is executed.
6_
0x0007 Slave node ID exceeds acceptable range of the instruction INITC
A slave cannot be reset; check if the communication cable is connected and if the communication of
0x0008
the slave is working properly.
0x0009 Error occurs in the operation of ECAT interface
0x000A More than four slaves are managed by DCSFOC instruction simultaneously.
0x000B The specified slave has never been initialized.
0x000C The specified slave is executing the initialization instructions (INITC/INITEC/RSTD).
0x000D The specified ECAT RTU does not exist.
0x000E The slave responds with the AL State Machine Code Error.
0x000F The slave responds with AL Status Error.
0x0010 The number of slaves actually connected is less than the setting in INITEC
0x0011 No physical connection between the built-in ECAT models and the slaves
Initialization timeout occurs when the built-in ECAT models initializes the slaves.
0x0012
(Some slaves on the EtherCAT topology are not in Operational state.)
0x0013 The firmware version of the built-in ECAT models does not support the ECAT ENI file for initialization.
The firmware version of the built-in ECAT models does not support the slave type configured in the
0x0014
ECAT ENI file

6-1001
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

C. Explanation of special flags (SM) and registers (SR) for Delta special EtherCAT communication instructions

(one slave with multiple axes)

The following table shows special flags (SM) and registers (SR) related to Delta special EtherCAT communication.

Function R/W Axis No. 1 to Axis No. 16


CASD communication complete R SM1681
Communication error R SM1682
SM1684 = OFF (default; when one goes down, all the drives are OFF.)
Heartbeat error handling R/W
SM1684 = ON (when one goes down, only the defective drive is OFF.)
SR656
ECAT SDO abort code (32-bit) R
SR657
ID number with a communication
R SR658
error
Communication error code R SR659

Axis No. Axis No. Axis No. Axis No. Axis No. Axis No. Axis No. Axis No.
Function R/W
1 2 3 4 5 6 7 8
R/W*
Servo positioning complete 1 SM1631 SM1632 SM1633 SM1634 SM1635 SM1636 SM1637 SM1638

Servo stop R/W SM1641 SM1642 SM1643 SM1644 SM1645 SM1646 SM1647 SM1648
Servo-ON, inverter-ON R SM1651 SM1652 SM1653 SM1654 SM1655 SM1656 SM1657 SM1658

Go-back/go-forth enabled R/W SM1661 SM1662 SM1663 SM1664 SM1665 SM1666 SM1667 SM1668
(Only supported by DRVAC)
Go-back/go-forth direction
indicator R SM1671 SM1672 SM1673 SM1674 SM1675 SM1676 SM1677 SM1678
(Only supported by DRVAC)
_6 Auto return communication
R/W SM1581 SM1582 SM1583 SM1584 SM1585 SM1586 SM1587 SM1588
control right
Heartbeat error code R SM1691 SM1692 SM1693 SM1694 SM1695 SM1696 SM1697 SM1698

6-1002
Ch ap te r 6 Ap pl ie d Instruc ti ons

Axis Axis Axis Axis Axis Axis Axis Axis


Function R/W
No.9 No.10 No.11 No.12 No.13 No.14 No.15 No.16
R/W
Servo positioning complete *1
SM1921 SM1922 SM1923 SM1924 SM1925 SM1926 SM1927 SM1928

Servo stop R/W SM1931 SM1932 SM1933 SM1934 SM1935 SM1936 SM1937 SM1938
Servo-ON, inverter-ON R SM1621 SM1622 SM1623 SM1624 SM1625 SM1626 SM1627 SM1628
Go-back/go-forth enabled
R/W SM1941 SM1942 SM1943 SM1944 SM1945 SM1946 SM1947 SM1948
(Only supported by DRVAC)
Go-back/go-forth direction
indicator R SM1951 SM1952 SM1953 SM1954 SM1955 SM1956 SM1957 SM1958
(Only supported by DRVAC)
Auto return
R/W SM1601 SM1602 SM1603 SM1604 SM1605 SM1606 SM1607 SM1608
communication control right
Heartbeat error R SM1611 SM1612 SM1613 SM1614 SM1615 SM1616 SM1617 SM1618
*1. The timing for the servo positioning completion flag to be cleared to off automatically is when the outputting of the

axis is enabled. If you need to use positioning instructions on a certain axis for several times in a row, you need to

clear the servo positioning completion flag by yourself. If you do not clear the servo positioning completion flag and

then use the positioning instruction again and again, it is possible that before the next positioning instruction is

executed, a servo positioning completion flag is detected and then the execution of positioning instruction will be

stopped.

The following table shows special registers (SR) related to Servo ECAT communications (one slave with multiple axes).
6_
Axis No. Axis No. Axis No. Axis No. Axis No. Axis No. Axis No. Axis No.
Parameter Name (Number) R/W
1 2 3 4 5 6 7 8
Status word (OD 6041h) R SR661 SR662 SR663 SR664 SR665 SR666 SR667 SR668
Error Code (OD 603Fh) R SR671 SR672 SR673 SR674 SR675 SR676 SR677 SR678
Modes of operation display
R SR681 SR682 SR683 SR684 SR685 SR686 SR687 SR688
(OD 6061h)
Position demand value SR691 SR693 SR695 SR697 SR699 SR701 SR703 SR705
R
(OD 6062h) SR692 SR694 SR696 SR698 SR700 SR702 SR704 SR706
Velocity demand value SR711 SR713 SR715 SR717 SR719 SR721 SR723 SR725
R
(OD 606Bh) SR712 SR714 SR716 SR718 SR720 SR722 SR724 SR726
Torque demand value
R SR741 SR742 SR743 SR744 SR745 SR746 SR747 SR748
(OD 6074h)
SR791 SR793 SR795 SR797 SR799 SR801 SR803 SR805
Digital inputs (OD 60FDh) R
SR792 SR794 SR796 SR798 SR800 SR802 SR804 SR806
Positioning completion
R/W SR811 SR812 SR813 SR814 SR815 SR816 SR817 SR818
range setting

6-1003
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Axis Axis Axis Axis Axis Axis Axis Axis


Parameter Name (Number) R/W
No. 9 No. 10 No. 11 No. 12 No. 13 No. 14 No. 15 No. 16
Status word (OD 6041h) R SR751 SR752 SR753 SR754 SR755 SR756 SR757 SR758
Error Code (OD 603Fh) R SR761 SR762 SR763 SR764 SR765 SR766 SR767 SR768
Modes of operation display
R SR1191 SR1192 SR1193 SR1194 SR1195 SR1196 SR1197 SR1198
(OD 6061h)
Position demand value SR1201 SR1203 SR1205 SR1207 SR1209 SR1211 SR1213 SR1215
R
(OD 6062h) SR1202 SR1204 SR1206 SR1208 SR1210 SR1212 SR1214 SR1216
Velocity demand value SR1221 SR1223 SR1225 SR1227 SR1229 SR1231 SR1233 SR1235
R
(OD 606Bh) SR1222 SR1224 SR1226 SR1228 SR1230 SR1232 SR1234 SR1236
Torque demand value
R SR771 SR772 SR773 SR774 SR775 SR776 S R777 SR778
(OD 6074h)
SR1241 SR1243 SR1245 SR1247 SR1249 SR1251 SR1253 SR1255
Digital inputs (OD 60FDh) R
SR1242 SR1244 SR1246 SR1248 SR1250 SR1252 SR1254 SR1256
Positioning completion
R/W SR1261 SR1262 SR1263 SR1264 SR1265 SR1266 SR1267 SR1268
range setting

The following table shows the ECAT communication error codes of Delta servos and inverters (one slave with multiple
axes) in SR659.

Error code Cause


0x0002 The slave does not respond to the SDO message.
An error occurs in the message received by the slave. This error often occurs when the settings of the
0x0003
COPRW instruction are invalid causing the slave not to receive the complete message.
0x0004 The slave PDO message is not received.
0x0005 An error occurs while using the instruction operand.
0x0006 One of the stations is being used when the INITC instruction is executed.
_6 0x0007 Slave node ID exceeds acceptable range of the instruction INITC.
A slave cannot be reset; check if the communication cable is connected and if the communication of
0x0008
the slave is working properly.
0x0009 Error occurs in the operation of ECAT interface
0x000A More than four slaves are managed by DCSFOC instruction simultaneously.
0x000B The specified slave has never been initialized.
0x000C The specified slave is executing the initialization instructions (INITC/INITEC/RSTD).
0x000D The specified ECAT RTU does not exist.
0x000E The slave responds with the AL State Machine Code Error.
0x000F The slave responds with AL Status Error.
0x0010 The number of slaves actually connected is less than the setting in INITEC.
0x0011 No physical connection between the built-in ECAT models and the slaves
Initialization timeout occurs when the built-in ECAT models initializes the EtherCAT slaves.
0x0012
(Some slaves on the EtherCAT topology are not in Operational state.)
0x0013 The firmware version of the built-in ECAT models does not support the ECAT ENI file for initialization.
The firmware version of the built-in ECAT models does not support the slave type configured in the
0x0014
ECAT ENI files.

6-1004
Ch ap te r 6 Ap pl ie d Instruc ti ons

D. Explanation of instructions speed operand and device setting parameters, the following table takes ASDA-
A2 and ASDA-W3 as examples:

ASDA-A2 ASDA-W3
Instruction Speed
Parameters parameters Speed unit
unit
Options:
P6-03 OD 60FFH 1. 0.1rpm (P3.018.X = 0)
DPLSVC 0.1rpm
(PR#1 Speed Control) (Profile Velocity Mode) 2. Pulse/sec (P3.018.X = 1)
3. PUU/sec (P3.018.X = 2)
DDRVIC/ P5-60 OD 6081H
0.1rpm PUU/sec
DDRVAC (PR#1 Position Control) (Profile Position Mode)
Homing Speed: Options:
Homing speed P5-05 OD 6099-01H 1. 0.1rpm (P3.062 = 0)
ZRNC/DZRNC JOG Speed P5-06 0.1rpm JOG Speed: 2. Pulse/sec (P3.062 = 1 or 2)
(PR#0 Homing Mode) OD 6099-02H
(Homing Mode)
INITEC instruction explanation: For ASDA-W3, set P3.062 = 0, P3.018 X and C = 0, which indicates the speed unit is 0.1

rpm. If the default velocity unit does not meet your needs, please manually modify the related parameters of the servo

using ECATRW instructions after completing the initialization process with the INITEC instructions.

6_

6-1005
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2804 D DRVAC S1, S2, S3 Servo absolute position control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2    
S3    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Node ID of servo (CAN)


S1 :
/ Axis No. (ECAT)
S2 : Absolute target position

S3 : Target speed
_6
Explanation

1. For CAN communication, the INITC and ASDON (servo ON) instructions must be complete before this instruction is
executed. For ECAT communication, the INITEC and ASDON (servo ON) instructions must be complete before this

instruction is executed.

2. For CAN communication, the range of S1 is 1–8. There will be no execution when the input value is out of the range.

For ECAT communication, the range of S1 is 1–16. There will be no execution when the input value is out of the

range or if the device of the assigned ID or axis No. is not a servo.

3. The range of S2 is -2147483648 to +2147483647. The +/ - sign indicates the forward / reverse direction. The target

position is an absolute position.

4. Refer to the DRVIC instruction (API 2803) for additional information and examples.

5. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-1006
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 1 (CAN)

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at node IDs 1–3, until

SM1681 is ON.

2. When M1 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 2. When SM1652

is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, servo 2 moves from the current position to the absolute position 100,000 PUU

at 100.0 rpm.

The finish flag SM1632 is ON when the target position is reached.

6_

6-1007
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2

1. Add one line to the program in Example 1. When the PLC runs and SM1662 is ON, the function is enabled for servo

2 to go back and forth.

2. As the figure shows below, the servo moves from its current position (20,000) to the absolute target position
(100,000) after M2 is ON. After that, it goes back and forth between the absolute position 100,000 and 0.
The direction indication flag SM1672 is ON when the servo goes toward the target position for the first time after
Servo-ON. After that, the flag repeats the state, changing from ON to OFF.
3. You can modify the target position at any time in the motion, but the new target position is only valid for the next
back and forth cycle.

_6

Example 3: EtherCAT communication with Delta servo ASDA-A2-E

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the axis number 1–3 of the servos, until

M100 is ON.

2. When M1 changes from OFF to ON, the ASON instruction starts to enable the axis number 2 of the servo. When

SM1652 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the axis number 2 of the servo moves to the absolute position 100,000 PUU at

100.0 rpm. The finish flag SM1632 is ON when the target position is reached.

6-1008
Ch ap te r 6 Ap pl ie d Instruc ti ons

6_

6-1009
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2805 D PLSVC S1, S2 Drive speed control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  

Pulse instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Node ID of a servo (CAN)


S1 :
/ Axis No. (ECAT)
S2 Target speed

Explanation

_6 1. For CAN communication, the INITC and ASDON (servo ON) instructions must be complete before this instruction is

executed. For ECAT communication, the INITEC and ASDON (servo ON) instructions must be complete before this

instruction is executed.

2. For CAN communication, the range of S1 is 1–8 (for servo) and 21-28 (for inverter). There will be no execution when
the input value is out of the range. For ECAT communication, the range of S1 is 1–16. There will be no execution

when the input value is out of the range.

3. Table to describe S2

Servo type Range of S1 Range of S2 Descriptions of S2

1-8 (CAN) The +/- sign indicates the forward / reverse direction. For
Servo -60000 to 60000
1-16 (ECAT) (0.1 rpm) example, when inputting 6005 in S2, the value is 600.5 rpm.

21-28 (CAN) -32768 to 32767 The +/- sign indicates the forward / reverse direction. For
Inverter
1-16 (ECAT) (1 rpm) example, when inputting 605 in S2, the value is 605 rpm.

4. For corresponding SM and SR of the axes, refer to the DRVIC instruction (API 2803).

5. SM1682 is set to ON when an error occurs during communication. In addition, SR658 retains the number of the axis

in which the error occurs and SR659 retains the error code.

6-1010
Ch ap te r 6 Ap pl ie d Instruc ti ons

6. For ES3 Series, this function is available for the PLC CPU with firmware V1.08.00 or later, and ISPSoft V3.17 or

later / DIADesigner V1.30 or later. For ES300TEC/EX3/SV3/SX3 Series, this function is available for the PLC CPU

with firmware V1.00.00 or later, and DIADesigner V1.30 or later. These versions support temporarily stopping flag

(ex: SM1641).

Example 1: CAN communication with Delta servo system

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at node IDs 1–3, until

SM1681 is ON.

2. When M1 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 2. When SM1652

is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, servo 2 moves at 100.0 rpm until M2 is OFF.

6_

6 - 1 0 11
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2: CAN communication with Delta inverter

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the node ID 21. When SM1683 is ON, it

indicates the initialization is complete.

2. When M1 changes from OFF to ON, the CASD instruction starts to set the acceleration time and deceleration time at

the node ID 21.

3. When M2 changes from OFF to ON, the ASDON instruction starts to set the control mode at the node ID 21.

4. When M3 changes from OFF to ON, the inverter moves at 2500rpm until M3 goes OFF.

_6

6-1012
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3: EtherCAT communication with Delta servo ASDA-A2-E

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the axis number 1–3 of the servos, until

M100 is ON.

2. When M1 changes from OFF to ON, the ASON instruction starts to enable the axis number 2 of the servo. When

SM1652 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the axis number 2 of the servo moves at 100.0 rpm, until M2 is OFF.

6_

6-1013
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 4: EtherCAT communication with Delta Inverters C2000, which works with CMC-EC01

1. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the axis number 1 of the inverter. When

M100 is ON, it indicates the initialization is complete.

2. When M1 changes from OFF to ON, the CASD instruction starts to write the acceleration/deceleration time to the

axis number 1 of the inverter.

3. When M2 changes from OFF to ON, the ASDON instruction starts to set the control mode at the axis number 1 of

the inverters.

4. When M3 changes from OFF to ON, the inverter moves at 2500 rpm, until M3 is OFF.

_6

6-1014
Ch ap te r 6 Ap pl ie d Instruc ti ons

6_

6-1015
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2806 D ZRNC S1, S2, S3 Servo homing

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2    
S3    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2   
S3   

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

Node ID of servo (CAN) / Axis


S1 :
No. (ECAT)
S2 : The 1st - segment speed

S3 : The 2nd - segment speed


_6
Explanation

1. For CAN communication, the INITC and ASDON (servo ON) instructions must be complete before this instruction is

executed. For ECAT communication, the INITEC and ASDON (servo ON) instructions must be complete before this

instruction is executed. It is suggested to use ZRNM (API 2810) to set all the axes of servo to the homing mode.

2. The range of S1 is 1–8 (for servo). There will be no execution when the input value is out of the range. For ECAT

communication, the range of S1 is 1–16. There will be no execution when the input value is out of the range or if the

device of the assigned ID and axis No. is not a servo.

3. The range of S2 is 1–20000. Unit: 0.1 rpm (servo drive parameter P5-05); if you need to use linear motor drive and
the first section exceeds 32767, you need to use DZRNC instruction instead.

4. The range of S3 is 1–5000. Unit: 0.1 rpm (servo drive parameter P5-06)

5. When the servo returns to the home position, the corresponding finish flags of the axes are ON. Refer to the DRVIC

instruction (API 2803) for explanations of special flags (SM) and registers (SR).

6-1016
Ch ap te r 6 Ap pl ie d Instruc ti ons

6. SM1682 is set to ON when an error occurs during communication. In addition, SR658 retains the number of the axis

in which the error occurs and SR659 retains the error code.

7. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example 1 (CAN)

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize servo 1, until SM1681 is ON.

2. When M1 changes from OFF to ON, the acceleration time (10000) and deceleration time (20000) of servo 1 are set

by using the CASD instruction (API 2802). When SM1651 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON,

2-byte data is written to P5-04 in servo 1. When D100 = 5 and the data is written, M100 is ON.

4-byte data is written to P6-00 in servo 1. When D102 = 0 and the data is written, M101 is ON.

4-byte data is written to P6-01 in servo 1. When D104 = 0 and the data is written, M102 is ON.

P5-04 sets the homing mode.

P6-00 and P6-01 are the homing definitions.


6_
4. When M3 changes from OFF to ON, the homing function is enabled for servo 1.

6-1017
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-1018
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 2 EtherCAT communication with Delta Servo ASDA-A2-E

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the axis number 1 of the servo, until
SM1681 is ON

2. When M1 changes from OFF to ON, the acceleration time (10000) and deceleration time (20000) of the axis number
1 of the servo are set by using the CASD instruction (API 2802). When SM1651 is ON, it indicates Servo-ON.

3. When M2 changes from OFF to ON, the sequency goes as follows:


2-byte data is written to P5-04 in the axis number 1 of the servo. When D100 = 5.

4-byte data is written to P6-00 in the axis number 1 of the servo. When D102 = 0.

4-byte data is written to P6-01 in the axis number 1 of the servo. When D104 = 0.

P5-04 sets the homing mode.

P6-00 and P6-01 are the homing definitions.

4. When M3 changes from OFF to ON, the homing function is enabled for the axis number 1 of the servo.

6_

6-1019
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-1020
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

Reading and writing CANopen


2807 COPRW S1, S2, S3, S4, S5, D communication data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2    
S3    
S4    
S5 
D    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

S1  
S2  
S3  
S4  
S5  
D 

Pulse instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol 6_
S1 : Node ID of a drive or slave

S2 : Request code

S3 : Index

S4 : Sub-index

S5 : Read/write device

D : Communication completion flag

Explanation

1. This instruction reads and writes CANopen communication data to the servo at the address specified in S1. The
range of S1 is 1–127. If the value is out of range (<1 or >127), the minimum or maximum value is automatically

processed by the instruction as the value of S1.

2. S2 can only specify four types of request codes, as shown in the following table. If you set the request code wrong, it

does NOT execute; SM1682 is ON and SR659 is 16#0005.

6-1021
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

S2
(only available for Description
values of lower 8-bit)
16#0023 Writing the 4-byte data; Expedited SDO
16#002B Writing the 2-byte data; Expedited SDO
16#002F Writing the 1-byte data; Expedited SDO
Reading the data. The data length is contained in the SDO response message;
16#0040
Expedited SDO
16#0021 Data and its length are specified by S5; Normal SDO
16#0041 Reading the data and store the read data and its length in S5; Normal SDO

3. For S3 and S4, refer to the object dictionary in the Delta servo / inverter operation manual or the object dictionary

from a third-party device that complies with CANopen DS301.

4. You should execute the COPRW instruction only after the INITC instruction is complete in case the parameters are

overwritten by the INITC instruction. Use the COPRW instruction for CANopen SDO communication. If the node ID

of a slave exceeds the range 1–8 or 21-28, you can use the COPRW instruction to set, read, and write slave-related

parameters.

When you use Delta Special Driver & AS Remote mode / Delta Special Driver & CANopen DS301 and execute

COPPRW instruction (SDO communication), the communication timeout is shown below.

Baud rate (bps) 1M 500K 250K 125K 50K


Communication timeout (ms)#1 100 100 200 400 500

_6 When the mode is CANopen DS301, you can set the time of the COPRW timeout in the CANopen communication

setting option from HWCONFIG; default timeout is 100 ms.

5. SM1682 is set to ON when an error occurs during communication. In addition, SR658 retains the number of the axis

in which the error occurs and SR659 retains the error code. Refer to DRVIC instruction for details.

Note: When you use the COPRW instruction, you must edit the process for dealing with communication errors to

avoid invalid communication occurring as a result of unexpected communication errors.

6. The diagram below shows the timing of the COPRW instruction.

 When you enable the COPRW instruction for the first time, the instruction sends the command code immediately

if no other CANopen communication is using it.

 The instruction sends the command code.

 The code has been sent and the finish flag is set to ON.

 You modify the next data to be sent out. The next command code is sent out immediately after the finish flag is

set to OFF.

The code has been sent and the COPRW instruction is disabled.

6-1022
Ch ap te r 6 Ap pl ie d Instruc ti ons

7. The COPRW instruction supports all CAN port work modes.

8. Most of the parameters in Delta ASDA-A2 are displayed in the decimal format. You can convert the parameters into

index addresses (hexadecimal), see the example below. 0 is a fixed value for the sub index address.

Example: The index address of PX-YY=0x2000 + (X*256) + YY

P2-10 = 0x2000 + (0x0002 *256) + 0x000A = 0x220A

P5-04 = 0x2000 + (0x0005 *256) + 0x0004 = 0x2504 6_


P1-44 = 0x2000 + (0x0001 *256) + 0x002C = 0x212C

9. Most of the parameters in Delta inverter are also displayed in the decimal format. Use the following formula to

convert the parameters.

Example: The index address of PXX-YY=0x2000 + XX (hexadecimal);

The sub index address is YY+1 (hexadecimal)

The index address of P10-15 = 0x2000 + 0x000A = 0x200A

The sub index address is 0x0F+1= 0x10

10. Since this instruction uses SDO (Service Data Objects) and the communication mode is one transmission (one

sending/one receiving) at a time, and the communication right is shared with the high-speed output instructions.

When writing PLC programs, bear the followings in mind.

* It is suggested NOT to use 2 COPRW instructions or communication at a time in one scan cycle.

* It is suggested NOT to use this instruction in a function block. Because when this instruction is written in a function

block, there will be 2 POU in the PLC program and when the function block is called, 2 instructions will be enabled

at the same time.

6-1023
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

11. When the request code is 16#0021, S5 is the data length (“n” byte) to write into the slave. S5+1- S5+((n+1) / 2) is the

data to write into the slave. For example, if S5 is specified as D100 and the value in S5 is 16. This instruction sends

data in D101 - D108 to the slave in the following order, lower 8-bit in D101, upper 8-bit in D101, lower 8-bit in D102,

upper 8-bit in D102 and so forth.

12. When the request code is 16#0041, when received responses from the slave, this instruction stores the data length

(“n” byte) in S5 and data in S5+1- S5+((n+1) / 2). For example, if received 15 bytes of data length, D100 is 15 and

store the data Byte[0], Byte[1].. Byte[14] in the following order, lower 8-bit in D101, upper 8-bit in D101, lower 8-bit in

D102, upper 8-bit in D102 and so forth.

13. The maximum data length is 255 bytes. To prevent too many Normal SDO transmissions, if the data length exceeds

255 bytes, PLC only sends or receives 255 bytes.

14. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

Example (using Expedited SDO)

1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at node IDs 1–3, until

SM1681 is ON.
_6
2. When M1 changes from OFF to ON, the PLC writes the 2-byte data (S2=16#002B) in D100 to P5-04 (S3=16#2504)

of servo 3, using the COPRW instruction. When the writing is complete, M100 is ON.

3. When M2 changes from OFF to ON, the PLC reads the value of P4-07 (S3=16#2407) of servo 3 and stores the

value( S2=16#0040) in D106. When the reading is complete, M106 is ON.

6-1024
Ch ap te r 6 Ap pl ie d Instruc ti ons

6_

6-1025
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description


Writing multiple CANopen parameter
2808 D COPWL S1,S2,S3,D
values

Device X Y M S T C HC D FR SM SR E K 16# “$” F


S1   
S2  
S3   
D    
DWORD

STRING
LWORD
WORD

LREAL
Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
type INT

S1  
S2    
S3  
D 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 ES3/EX3/SV3/SX3

Symbol

S1 : Node ID (Mac ID)


Starting source device where written
S2 :
data are stored
Number of messages to
S3 :
_6 consecutively write data
D : Communication completion flag

Explanation

1. S1 sets the node ID within the range of 1-127. If the setting value exceeds the range (< 1 or >127), the instruction will

automatically send data at the minimum or maximum value respectively.

2. S2 is the starting source device where written data are stored and S3 is the number of messages to consecutively

write data. E.g., S2 specifies D10 as the starting device and the number of messages to consecutively write data is 3.

Here is the detailed explanation in the following table.

Instruction name Message No. Index address Subindex address Written source data
1 D10 D11 D12
COPWL
2 D13 D14 D15
(Writes 16-bit values)
3 D16 D17 D18
1 D10 D11 D12, D13
DCOPWL
2 D14 D15 D16, D17
(Writes 32-bit values)
3 D18 D19 D20, D21

The value of S3 is in the range of 1 to 100.

6-1026
Ch ap te r 6 Ap pl ie d Instruc ti ons

3. For the index addresses and subindex addresses of Delta servo and AC motor drive, refer to the explanation of the

COPRW instruction. In principle, the parameter values of Delta servo and AC motor drive are both16-bit or 32-bit

values including floating point numbers. If you need write an 8-bit value, use the COPRW instruction.

4. D is the communication completion flag. D will turn on after the sending of multiple communication messages is

complete.

See the detailed sending process and sequence diagram below.

 The COPWL instruction is enabled and starts to send data.

 After the COPWL instruction sends one piece of message, the next PLC instruction continues to execute.

 As the COPWL instruction is scanned once again and the prior message has been received by the slave, the

COPWL instruction sends the next message.

 When the last written-data sending is done, the instruction will set the completion flag to ON.

 When the completion flag turns on, the COPWL instruction need be disabled by manual so that the subsequent

COPWL or COPRW instruction can continue to work.

Note: When you disable the instruction, the completion flag will be automatically cleared accordingly.

enable enable

COPWL disable disable 6_


    

S2 1 2 3 1

Note: The sequence diagram above shows the sending of 3 pieces of written data.

5. After the instruction is enabled, wait until the writing is complete and then disable the instruction. If there is a

communication error in the execution, shoot the trouble and then re-enable the instruction to write all data.

6. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

6-1027
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

7. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example

1. When M1 = OFF → ON, data are written in D device.

Subindex
Instruction name Data No. Index address Written data source
address
D50 = 16#212C
1 (E-gear ratio D51 = 0 D52, D53 = 77777777
DCOPWL numerator)
(Writes 32-bit values) D54 = 16#212D
2 (E-gear ratio D55 = 0 D56, D57 = 88888888
denominator)

2. When M1 = OFF → ON, the instruction writes a 32-bit value for P1-44 of the servo whose node ID is 2 and the

written value 77777777 is stored in D52. The instruction writes a 32-bit value for P1-45 and the written value

88888888 is stored in D56. As the writing is complete, M201 turns on.

_6

6-1028
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

2809 RSTD Node,Para,Ok,Err Sending Reset or NMT command

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Node   
Para   
Ok   
Err   
DWORD

STRING
LWORD
WORD

LREAL
Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

Node 
Para 
Ok 
Err 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Node ID which is reset (CAN)


Node : / Axis No. (ECAT)

Para : Setting value of the parameter


6_
Ok : The reset completion flag

Err : The reset error flag

Explanation

1. Before the RSTD instruction is used in Delta special instruction mode, make sure that all Delta drives have been

initialized via the INITC instruction and they once worked normally.

2. For CAN communication, when used in CANopen DS301 mode, the RSTD instruction works as the NMT

communication function and can switch network states via the Para parameter.

3. For ECAT communication, before the RSTD instruction is used, make sure that all Delta servos / inverters have

been initialized via the INITEC instruction and they once worked normally.

4. For CAN communication, when CAN communication port is specified to work in Delta special driver mode, the

value of Node can be 0 (for the broadcast function) and 1-8 which are for servo node ID only and 21-28 for node

ID of AC motor drives only. When the node ID exceeds the range, the PLC will not perform the reset action and the

Err flag turns on. (Refer to the explanation of SR659 for error codes)

6-1029
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

5. For CAN communication, when CAN communication port is specified to work in CANopen DS301 mode, the value

of Node is in the range of 1-64 and 0 (for the broadcast function). When the value exceeds the range, the PLC will

not perform the NMT communication and the Err flag turns on. (Refer to the explanation of SR659 for error codes)

6. For ECAT communication, the value of Node can be 0 (for the broadcast function) and 1-16 which are for servo /

inverter node ID. When the node ID exceeds the range, the PLC will not perform the reset action and the Err flag

turns on. (Refer to the explanation of SR659 for error codes)

7. The setting value of Para is NOT applicable to Delta special driver mode. The settings for Para (NMT service code)

are listed in the following table. If the setting value is not one of the values in the table, the Err flag turns on.

NMT service code 16#01 16#02 16#80 16#81 16#82


Enter the Reset the
Reset the
Function Start the slave Stop the slave pre-operational application
communication
state layer

8. The RSTD instruction can implement the command action on only one drive or slave every time. If multiple RSTD

instructions are enabled simultaneously, the PLC will automatically take priority to perform the instruction which is

enabled earlier.

9. The RSTD instruction is executed to send the command when it is enabled. If the instruction is disabled before the

Ok flag is on, the PLC will not set the Ok flag to ON.

10. Apart from notifying the specified drive to clear the error state, the instruction would also re-check if relevant

_6 communication parameter values are correct and re-set correct communication parameter values.

For example, due to the disconnection of the slave of node ID 2, the entire system stops running. After the trouble

is solved, the slave of node ID 2 can return to the state of being controllable by using the RSTD instruction to reset

the slave of node ID 2 only. So the time of re-initializing all drives are saved.

11. If the slave responds by sending back any communication command fault to the PLC during the communication,

the RSTD instruction will turn the Err flag on and stop the upcoming actions. (Refer to explanation of SR659 for

error codes.)

6-1030
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description


Setting the homing mode for Delta
2810 ZRNM Node,Mode,Ok,Err
servo

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Node   
Mode   
Ok   
Err   
DWORD

STRING
LWORD
WORD

LREAL
Data
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
type

Node 
Mode 
Ok 
Err 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Specified node ID (CAN)


Node :
/ Axis No. (ECAT)
Mode : Homing mode code
6_
Ok : Completion flag

Err : Error flag

Explanation

1. Make sure that all Delta drives have been initialized before executing the reset instruction.

2. For CAN communication, the value of Node is in the range of 1-8 (exclusive for servo node IDs) or in the range of

1-16 for ECAT communication. If the setting value exceeds the range or if the device of the assigned ID/axis

number is not a servo, the PLC will not perform the action of the homing mode and set the Err flag to ON. (Refer to

explanation of SR659 for error codes.)

3. The ZRNM instruction can set the homing mode of only one drive every time. If multiple instructions are enabled

simultaneously, the PLC will take priority to perform the instruction which is enabled earlier.

4. The ZRNM instruction is executed to send the command when it is enabled. If the instruction is disabled or will

NOT be scanned again before the Ok flag is on, the PLC will NOT be able to set the Ok flag or Err flag to ON.

5. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

6-1031
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

6. Mode sets a homing mode. If the setting value exceeds the range, the PLC will still send the command and the

server itself will decide whether to receive the command or not. The setting mode is the homing mode that ASDA

servo parameter P5-04 corresponds to.

The setting value of Delta servo homing mode is a hex value. The value is defined as the format of 0xWZYX. See

the explanation of respective codes as below.

Homing
Range Function and code description Remark
mode code
Select the final position where the servo stops.
0 = The servo leaves the original point, decelerates and stops and
W 0 to 1 then automatically returns to the real original point.
1 = After leaving the original point, decelerating, and stopping, the
servo will not perform any action anymore.
Handling mechanism when the limit is encountered.
Z 0 to 1 0 = Output stops.
1 = Output is conducted in the reverse direction.
Z pulse signal setting (used for X code 0 to 8)
0 =Look for Z pulse when coming back. Do not look for Z phase when
going forward.
1 =Go forward to Z pulse. Do not look for Z pulse when coming back.
Y 0 to 2
2 =Do not look for Z pulse.
Z pulse signal handling method (applicable to X code: 9 to A)
_6 0 =Look for Z pulse when coming back.
1 =Do not look for Z pulse both when coming back and going forward.
Homing method: 0 to 8
0 = Homing in the forward direction; PL is the original point
1 = Homing in the reverse direction; NL is the original point.
2 = Homing in the forward direction; ORGP: OFF > ON, as the original
point.
3 = Homing in the reverse direction; ORGP: OFF > ON, as the original
point.
4 = Homing in the forward direction; look for Z pulse and regard it as
the original point.
5 = Homing in the reverse direction; look for Z pulse and regard it as
X 0 to A the original point.
6 = Homing in the forward direction; ORGP: ON > OFF, as the original
point.
7 = Homing in the reverse direction; ORGP: ON > OFF, as the original
point.
8 = Current position is the original point.
Homing method: 9 to A
9 = Homing in the forward direction; the collision point is the original
point.
A = Homing in the reverse direction; the collision point is the original
point.

6-1032
Ch ap te r 6 Ap pl ie d Instruc ti ons

7. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

8. Before communicating with Delta ASDA-W3 servo, please refer to OD 6098 in ASDA-W3 Series User Manual for

how to set the homing mode.

6_

6-1033
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2811 EMER Node,Dest,Len,Ok,Err Reading Emergency message

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Node   
Dest 
Len 
Ok   
Err   
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

Node 
Dest 
Len 
Ok 
Err 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

Symbol

Specified node ID (CAN)


Node :
/ Axis No. (ECAT)

_6 Dest : Target device for storing data

Len : Total number of 4 words of data which have been read

Ok : Completion flag

Err : Error flag

Explanation

1. The EMER instruction is applicable to CANOpen DS301 mode and Delta special mode.

2. After receiving the Emergency message from the slave Node, the PLC will automatically store the data in the

specified storage device and set the Ok flag to ON.

3. It is recommended that the Node value should be specified from the slave node IDs which have already existed. If

the value is not one existing node ID / axis number or the slave has been disconnected, the PLC will not be able to

receive any message, set the Err flag to ON and show error code of communication timeout. (Refer to explanation

of SR659 for error codes.)

4. The way the EMER instruction reads Emergency messages is the same as Emergency communication method in

ES3/EX3/SV3/SX3 operation manual. Please just select one communication method from them when reading

Emergency messages.

6-1034
Ch ap te r 6 Ap pl ie d Instruc ti ons

5. The EMER instruction can read 5 Emergency messages at most. Every time the reading is successful, the Ok flag

turns on and Len displays the total number of messages which are read. You can judge how many consecutive

words are occupied by Dest based on the length. Every message uses 4 words. The data are stored in the order

from lower 8 bits to higher 8 bits. The storage format is shown as below. (E.g. Dest is D10, Len is 2 which is the

number of messages stored in D5.)

D device no. Value


D5 2

D device no. Higher 8 bits Lower 8 bits


D10 The second byte in the first message The first byte in the first message
D11 The forth byte in the first message The third byte in the first message
D12 The sixth byte in the first message The fifth byte in the first message
D13 The eighth byte in the first message The seventh byte in the first message
D14 The second byte in the second message The first byte in the second message
D15 The fourth byte in the second message The third byte in the second message
D16 The sixth byte in the second message The fifth byte in the second message
D17 The eighth byte in the second message The seventh byte in the second message

6. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.
6_
7. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-1035
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

CSFOC From Xno to OutSpd Controlling the tracking function of a


2812 D
servo via communication

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Xno 
InCnt 
InSpd 
Gear  
Axis   
OutCnt 
OutSpd 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

Xno 
InCnt  
InSpd  
Gear 
Axis 
OutCnt  
OutSpd  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3
_6
Symbol

Xno : Signal input device

InCnt : Number of input pulses

InSpd : Pulse input frequency

Gear Proportion of the input frequency and output frequency


:
(floating-point value)

Axis : CANopen communication node ID of Delta servo

OutCnt Number of output pulses (unit: per user unit (PUU))

OutSpd Pulse output frequency

6-1036
Ch ap te r 6 Ap pl ie d Instruc ti ons

Explanation

1. For CAN communication, the INITC and ASDON (servo ON) instructions must be complete before this instruction

is executed. For ECAT communication, the INITEC and ASDON (servo ON) instructions must be complete before

this instruction is executed.

2. Xno can only specify X0, X2, X4, X6, X10 and X12 as the input points, and the operand occupies two consecutive

input points. You cannot execute the instruction if the input points are not the points specified for Xno above. After

you select the input points, the high-speed counter is automatically specified. If there is a DCNT instruction (API

1004) or CSFO instruction (API 2708) with the same high-speed counter in the program, the PLC first executes the

instruction that starts the counter first. The input points and corresponding high-speed counters are shown in the

following table.

Group number 1 2 3 4 5 6

Xno+0 input point


X0 X2 X4 X6 X10 X12
(Phase A)

Xno+1 input point


X1 X3 X5 X7 X11 X13
(Phase B)
High-speed counter
number HC202 HC206 HC210 HC214 HC218 HC222

Flag for reversing input


direction SM270 SM271 SM272 SM273 SM274 SM275

Note: refer to instruction DCNT for more information on the maximum input bandwidth of X0-X13. 6_
3. If the high-speed counters for the instruction can use only the phase A/B input mode, set the flag for reversing the

input direction to ON when MPG is connected but has not rotated yet, and the PLC input point is ON. Set the

function to detect the state of PLC run cycle to OFF.

4. InCnt is the number of input pulses. Use a 32-bit variable to declare the parameter.

5. InSpd is the frequency of input pulses. Use a 32-bit variable to declare the parameter with the unit of 1 Hz.

6. Gear is the proportion of the input frequency and output frequency (floating-point value). The formula is that output

frequency equals to the result of input frequency multiplying Gear. For instance, if Gear is 2.5 and the input

frequency is 50, the output is 125 (50*2.5). Note: the output count and the output frequency are rounded down to

the nearest whole digit when outputting.

7. Axis is the node ID, ranging from 1 to 8 for CAN communication and it should be within the range of node ID that is

initiated by the INITC instruction. For ECAT communication, the node ID ranges from 1 to 16 and it should be

within the range of node ID that is initiated by the INITEC instruction, and the device type of the assigned ID should

be the servo.

6-1037
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

8. OutCnt is the number of output pulses. Use a 32-bit variable to declare the parameter with the unit of PUU.

9. OutSpd is the frequency of the output pulses. Use a 32-bit variable to declare the parameter with the unit of 1 Hz.

The output result is an output value got through the ratio conversion of the input frequency, rather than the actual

frequency sent to the drive for operation (unit: rpm). For the actual command frequency sent to the drive, please

refer to the 4th point in the following Note.

10. There is no limit to the number of times you can use this instruction. Several instructions can use one group of

input points as its source of input count. But you need to clear the value in the input counter before execution of

this instruction; especially when you are using one input and several outputs. And this instruction executes

according to the axis number to record information about its input and output. The same axis can be used for

several times, but you must not output the same axis at the same time. If you use the same axis to output for

several times, PLC outputs the first starting one and then the second one. For ECAT communication, up to four

slaves can be controlled simultaneously. If exceeding the limit, this instruction is NOT executed and SM0 is ON,

the error code stores in SR0 is 16#2003.

11. For ES3 Series, the following function is available for the PLC CPU with firmware V1.08.00 or later, and ISPSoft

V3.17 or later / DIADesigner V1.30 or later. For ES300TEC/EX3/SV3/SX3 Series, the following function is available

for the PLC CPU with firmware V1.00.00 or later, and DIADesigner V1.30 or later.

This function supports SR425 for setting up the determining time for the pulse input to stop; the setting range is

from 0 to 1100; unit: 1ms; 0 indicates this function is disabled.

_6 For actual applications, the time difference may occur when there is an acceleration/deceleration time so that the

servo may delay the stop time. If you need the servo to stop the pulse input immediately or need the direction to be

reversed, you can use SR425. The time you set in SR425 is for the PLC CPU to determine if the pulse input has

been stopped or the direction is reversed. If so, then the servo will receive an emergency-stop command from PLC

CPU to stop immediately.

12. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called

only once.

13. The third-party drives and Delta ASDA-W3 are not supported.

Note

1. The PLC calculates the input pulse frequency based on the input pulse width (ON) in the positive half cycle. If the

proportion of the pulse width for ON: pulse width for OFF is not 1:1, the PLC takes the ON width as the standard for

conversion by default.

2. The input pulse=ON means the input point LED is on. When using the MPG but it has not rotated yet, you can check

if the input point LED is OFF and the flag for reversing the input direction is activated.

6-1038
Ch ap te r 6 Ap pl ie d Instruc ti ons

3. There might be a delay of 20 ms (for CAN) / 50 ms (for EtherCAT) in CANopen / EtherCAT communication when

this instruction is executed. If this cannot meet your requirement, use CSFO instruction instead, controlling the servo

by the pulse output.

4. Convert the output frequency specified by OutSpd in Hz to the servo speed in rpm (basic unit: 0.1 rpm). Take ASDA-

A2 as an example, it generates 128000 pulses per revolution. If the servo electronic gear ratio P1-44/P1-45 is

128/10, it means for the servo, 100000 (1280000*10/128 = 100000) pulses are generated per revolution. And if the

output speed is 5000 Hz (5000 pulses per second), it means 300000 (5000*60) pulses per minute. The servo speed

in rpm would be 5000*60/100000 = 3 rpm.

Example 1 (CAN)

 When M0 switches from OFF to ON, PLC starts to execute INITC to initialize servo at node IDs 1 and 2 until

SM1681 is ON.

 When M1 switches from OFF to ON, PLC starts to execute ASDON to start servo at node ID 1 and when the servo

is started, SM1651 is ON, meaning Servo-ON.

 When M2 switches from OFF to ON, PLC starts to execute ASDON to enable servo at node 1 and when the servo

is started, SM1652 is ON, meaning Servo-ON.

 When M3 switches from OFF to ON, input points X0 and X1 connect to the MPG to control 2 servos. The

proportions for the 1st servo is 1 and for the 2nd servo is 2.
6_

6-1039
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

Example 2: Communication with ASDA A2-E

When M0 switches from OFF to ON, the INITEC instruction starts to execute this instruction to initialize servo axis

number 1 and 2 until M100 is ON.

When M1 switches from OFF to ON, the ASDON instruction starts to execute this instruction to enable servo axis

number 1 and when the servo is started, SM1651 is ON, meaning Servo-ON.

When M2 switches from OFF to ON, the ASDON instruction starts to execute this instruction to enable servo axis

number 1 and when the servo is started, SM1652 is ON, meaning Servo-ON.

6-1040
Ch ap te r 6 Ap pl ie d Instruc ti ons

When M3 switches from OFF to ON, input points X0 and X1 connect to the MPG to control 2 servos. The proportions for

the 1st servo is 1 and for the 2nd servo is 2.

6_

6-1041
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-1042
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

ECAMD Downloading E-CAM chart to the


2813 From Slave to ErrCode
Slave

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   

Source    

Len   
CAddr   
Done   
Err   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

Slave  
Source  
Len  
CAddr  
Done 
Err 
ErrCode  
6_
Pulse Instruction 16-bit instruction 32-bit instruction
- ES3/EX3/SV3/SX3 -

Symbol

Node ID of a servo (slave


Slave :
axis)
Source : From which E-CAM chart to start downloading

Len : The length of the E-CAM chart

CAddr : From which address to start storing E-CAM chart in the


servo
Done : Downloading complete flag

Err : Error flag

ErrCode : Error code

Explanation

1. For execution of this instruction, you need to use ISPSoft V3.07 or later.

6-1043
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

2. Slave is where you store the downloaded E-CAM chart; the supported slave station ranges from 1 to 8. After the

downloading is complete, the DONE flag is ON. If the slave node ID you are using is out of the supported range, the

instruction is NOT executed. And the Err (error) flag is ON.

3. Source is where you specify from which E-CAM chart to start downloading; the supported E-CAM chart length is

from 1 to 16. If the E-CAM chart number you are using is out of the supported length, the instruction is NOT

executed. And the Err (error) flag is ON. You can also use the PLC data register number to specify from which E-

CAM chart to start downloading to the servo and it takes Len+1 as its downloading length. After the setting is done,

the system starts to read from the specified data register number (device number) to a length of Len +1 (32-bit)

consecutively to the servo. If the Source is D10 and the Len is 10, the system starts to read from D10 to a length of

10+1, starting from D10/D11, D12/D13 to D30/D31 to the servo.

4. Len is the E-CAM chart length for downloading; its setting range is from 1 to 720. If the length you are using is out of

the supported range, the instruction is NOT executed. And the Err (error) flag is ON. The servo supports up to 800; if

the Len+1 exceeds 800, PLC stops downloading and the Err (error) flag is ON.

5. CAddr is the starting address where to store the E-CAM chart in the servo; the supported setting range is from 0 to

798. If the starting address you are using is out of the supported range, the instruction is NOT executed. And the Err

(error) flag is ON.

6. If the supported 16 E-CAM charts are not sufficient, you can choose to download the E-CAM charts to the PLC file

register while editing in the E-CAM Editor.

_6 7. You can make use of the 1st -800th storage in the servo. When creating E-CAM charts with not so many points (less
than 800), you can download the E-CAM charts altogether at one time to save communication time. For example, if

you use points 1-200 in chart A and 201-400 in chart B, the points in chart A plus the points in chart B are 400 (less
than 800), you can download these two charts at one go.

8. Once this instruction is executed, it clears the Done flag first and then sends the E-CAM chart. Once the

transmission is complete, the Done flag is ON. If any error occurs from the slaves, the Err (error) flag is ON. If you

need to resend the E-CAM chart, you need to wait for one scan time before executing this instruction again.

6-1044
Ch ap te r 6 Ap pl ie d Instruc ti ons

9. If the Err (error) flag is ON, refer to the definitions below.

ErrCode Description

0000 No error occurs.

0001 The specified node ID for the servo (slave axis) is NOT in the supported range.

0002 This E-CAM chart number is NOT in the supported range.

0003 This CAddr. Address or length is NOT in the supported range.

0004 No response from the slave axis.

0005 Error message sent from the slave while downloading or setting up.

The PLC is NOT in the Delta Special Driver & AS Remote Mode nor in the Delta Special
0006
Driver & CANopen DS301 Mode.

10. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

11. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6_

6-1045
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

E-CAM parameter setting and


2814 D ECAMS From Slave to ErrCode
planning

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
Smode   
CAddr   
CLen   
Rpuu   
Cmode   
WbPuu   
OutT   
CaPuu   
CwPuu   
Orate   
Done   
Err   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL

Data
UINT

DINT

LINT

TMR

CNT
INT

type

Slave  
Smode  
CAddr  
_6 CLen  
RPuu  
Cmode  
WbPuu  
OutT  
CaPuu  
CwPuu  
ORate  
Done 
Err 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

6-1046
Ch ap te r 6 Ap pl ie d Instruc ti ons

Symbol

Slave : Node ID of a slave axis

Command source for encoder of the master


Smode :
axis
From which address to start storing E-CAM
CAddr :
chart in the servo

CLen : Specified E-CAM chart length for executing

Number of pulses for the master’s E-CAM to


RPuu :
rotate a full 360 cycle

Cmode : Engaging condition

Number of pulses for E-CAM to wait before


WbPuu :
engaging for the first time (32-bit value)

OutT : Disengaging condition

Number of pulses for E-CAM to wait before


CaPuu :
disengaging (32-bit value)
Number of pulses for E-CAM to wait before
CwPuu :
engaging again (32-bit value)

ORate : Output ratio for E-CAM chart (32-bit value)

Done : Downloading complete flag

Err : Error flag

ErrCode : Error code

Explanation
6_
1. This instruction is for setting up the E-CAM related parameters for the first time or setting up the E-CAM chart before

the first engagement. If you need to modify the E-CAM chart during engaging, you need to use instruction ECAMC
(API2816) instead.

2. Slave is the servo slave station, ranging from 1 to 8. If the slave station number you are using is out of the supported

range, the instruction is NOT executed. And the Err (error) flag is ON. After modifying and the specified servo slave

station responds correctly, the DONE flag is ON.

3. Smode is where you can set the command source for encoder of the master axis; the options are as shown below.

Command Source of Master Axis Description


0 CAP axis (defined by CAP function)

1 Auxiliary encoder (P5-17)

2 Pulse command (A/B phase pulse) (P5-18)


PR command: the value of absolute coordinate from position
3
command
4 Time axis (1ms)
5 Synchronous capture axis (P5-77)

6-1047
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

6 Analog channel 1 (virtual axis; unit: 10 V corresponds to 1 M pulse/S)


12 Pulse command (CW/CCW pulse) (P5-18)
22 Pulse command (Pulse/Dir pulse) (P5-18)
Other numbers Treated as option 2: Pulse command (A/B phase pulse) (P5-18)
4. PLC sets up the servo parameter P5-88.Y according to the command source of the master axis. When the

command source is Pulse Command, you need to set up the pulse type via the servo parameter P1-00 while the

servo is OFF.

5. CAddr is the starting address where to store the E-CAM chart in the servo; the supported setting range is from 0 to

794. If the starting address you are using is out of the supported range, the instruction is NOT executed. And the Err

(error) flag is ON. PLC sets the servo parameter P5-81 (start address of data array).

6. CLen is the specified E-CAM chart length for executing; its setting range is from 5 to 720. E-CAM chart is divided

into CLen and the chart should include CLen +1 data. The servo supports 1st - 800th space; if the starting address is

501 and set the CLen to 400, this arrangement takes 902 (501+401) space which exceeds the 800th space, the

instruction is NOT executed and the Err (error) flag is ON. PLC sets the servo parameter P5-82. Write this

parameter when E-CAM stops (P5-88, X=0).

7. RPuu is where you set the number of pulses for the master’s E-CAM to rotate a full 360 cycle; servo unit: PUU (per

user unit). The value in RPuu should be 32-bit and ranges from 10 to 1073741823. When the value exceeds the

upper or lower limit, it will be seen as the maximum vlaue or the minimum value. PLC sets the servo parameter P5-

83 and P5-84. Write the parameters when E-CAM stops (P5-88, X0=0).

_6 8. Cmode is where you can set the engaging condition; the options are as shown below.

Mode Description
0 Engage immediately
1 DI: CAM ON
2 Any one of the Capture
Other numbers Treated as Mode 0, to engage immediately

9. PLC sets the servo parameter P5-88.Z (engaging time).

10. WbPuu is where you set the number of pulses for E-CAM to wait before engaging for the first time. The value in

WbPuu should be 32-bit and ranges from -1073741824 to +1073741823. When the value exceeds the upper or

lower limit, it will be seen as the maximum vlaue or the minimum value. When the value is 0, it means no waiting

before the first engagement. PLC sets the servo parameter P5-87.

6-1048
Ch ap te r 6 Ap pl ie d Instruc ti ons

11. OutT is where you can set the disengaging condition; the options are as shown below. Option 2, 4 and 6 cannot be

selected at the same time.

Mode Description After disengaged


0 Never disengaged -
1 DI: CAM OFF In STOP status
Master axis receives the pulse number which is
2 In STOP status
set by CaPuu (P5-89).
Master axis exceeds the setting value in CaPuu Back to the pre-engaged status.
4
(P5-89). The pre-engaged pulse is CwPuu (P5-92).
Same as 2; master axis receives the pulse number
which is set by CaPuu (P5-89) but here E-CAM
keeps its velocity while disengaging. Master axis
6 In STOP status
exceeds the setting value in CaPuu (P5-89) a little
bit. Suitable for the application of using the PR
position command right after disengaged.
Work with option 1, 2 or 6; disable E-CAM after it
Set the servo parameter P5-88.X0 to 0.
is disengaged.
8
Work with option 4, to avoid jittering when it
-
returns to pre-engaging status
Other
Treated as Mode 0, to engage immediately
numbers

12. PLC sets the servo parameter P5-88.U (disengaging time).

13. CaPuu is where you set the number of pulses for E-CAM to wait before disengaging. The value in CaPuu should be

32-bit and ranges from -1073741824 to +1073741823. When the value exceeds the upper or lower limit, it will be

seen as the maximum vlaue or the minimum value. When the value is 0, it means no waiting before disengaging.
6_
PLC sets the servo parameter P5-89.

14. CwPuu is where you set the number of pulses for E-CAM to wait before engaging again. The value in CwPuu

should be 32-bit and ranges from -2147483648 to +2147483647. When the value is 0, it means no waiting before

engaging again. PLC sets the servo parameter P5-92.

15. ORate is where you set the output ratio for the E-CAM chart. The value in ORate should be a 32-bit integer and

ranges from -2147000000 to +2147000000. When the value exceeds the upper or lower limit, it will be seen as the

maximum vlaue or the minimum value. PLC sets the servo parameter P5-19. For example, set ORate to 123000 and

123000 will be divided by 1000000 by the servo. And you will have 0.123 as the output ratio. Set ORate to 1500000

and 1500000 will be divided by 1000000 by the servo. And you will have 1.5 as the output ratio.

16. Once executing this instruction, it clears the Done flag first and then sends a request of setting E-CAM parameters.

If the transmission works correctly, the DONE flag is ON. If any error occurs from the slaves, the Err (error) flag is

ON. If you need to modify the E-CAM parameters, you need to wait for one scan time before executing this

instruction again.

6-1049
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

17. If the Err (error) flag is ON, refer to the definitions below.

ErrCode Description

0001 The specified node ID for the servo (slave axis) is NOT in the supported range.

0003 This downloading address (CAddr) or length (CLen) is NOT in the supported range.

0004 No response from the slave axis.

0005 Error message sent from the slave while downloading or setting up.

The PLC is NOT in the Delta Special Driver & AS Remote Mode nor in the Delta Special
0006
Driver & CANopen DS301 Mode.

18. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus, it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

19. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

_6

6-1050
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

Activating E-CAM control and


2815 ECAMA From Slave to ErrCode
displaying the status

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
CAMEn    
CAMSt 
MIPuu 
SOPuu 
Err   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

Slave  
CAMEn 
CAMSt  
MIPuu  
SOPuu  
Err 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -
6_
Symbol

Slave : Node ID of a servo (slave axis)

CAMEn : Activate E-CAM control

CAMSt Display E-CAM status


Number of pulses inputted by the Master axis
MIPuu :
(unit: PUU)
Number of pulses outputted by the specified
SOPuu :
Slave axis (unit: PUU)
Err : Error flag

ErrCode : Error code

6-1051
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Explanation

1. For execution of this instruction, you need to use ISPSoft V3.07 or later.

2. The INITC and ASDON (Servo-ON) instructions must be complete before this instruction is executed.

3. Slave is the node ID of a servo drive (slave axis) which you specify to receive commands; the supported slave ID

ranges from 1 to 8. If the slave ID you are using is out of the supported range, the instruction is NOT executed and

the Err (error) flag is ON. If the specified servo slave cannot communicate, the Err (error) flag is also ON.

4. CAMEn is where you can activate the E-CAM control. When the BOOL value in CAMEn is ON, it indicates E-CAM

control is activated. When the BOOL value in CAMEn is OFF, it indicates E-CAM control is NOT activated. PLC sets

the servo parameter P5-88, X=0 according to the status in CAMEn.

5. CAMSt is where you can find the E-CAM status in the servo according to the servo parameter P5-88.

S: Shows the engage status (Read-only, the setting is invalid)

0: Stop

1: Engage status

2: Pre-engage status

_6

6. Status Description:

 Stop: It is the initial status of the E-CAM. The E-CAM does not operate with the master pulse. When E-CAM

function is disabled (P5-88, X0=0), it returns to this status.

 Pre-engage: When the engaged condition (path 1) is established, it enters this status. The E-CAM still does

not operate with the master pulse.

 Engage: When it reaches pre-engaged status (path 3), it enters this status. The E-CAM starts to operate with

the master pulse.

7. Path Description:

 Path 1: When the engaged condition is established (P5-88.Z), the status is Stop → Pre-engaged.

The lead pulse is determined by P5-87.

 Path 2: When the E-CAM function is disabled (P5-88.X0=0), it returns to Stop status.

6-1052
Ch ap te r 6 Ap pl ie d Instruc ti ons

 Path 3: When it is in pre-engaged status, the status is Pre-engaged → Engaged.

 Path 4: When the disengaged condition is established (P5-88, U=4), the status is Engaged → Pre-engaged.
The lead pulse is determined by P5-92.

 Path 5: When the disengaged condition is established (P5-88, U=1, 2, 6) or the E-CAM function is disabled

(P5-88, X0=0), the status is Engaged → Stop.

8. MIPuu is wherer you can find the number of pulses received by the specified Slave from the Master. The unit is per

user unit (PUU) of the servo. This value is shown accoridng to the servo parameter P5-86. When the instruction

stops, this value does NOT refreshed either.

9. SOPuu is wherer you can find the number of pulses outputted by the specified Slave. The unit is per user unit (PUU)

of the servo. This value is shown accoridng to the servo parameter CMD_O. When the instruction stops, this value

does NOT refreshed either.

10. If the Err (error) flag is ON, refer to the definitions below.

ErrCode Description

0000 No error occurs.

0001 The specified node ID for the servo (slave axis) is NOT in the supported range.

0004 No response from the slave axis.

0005 Error message sent from the slave while downloading or setting up.

The PLC is NOT in the Delta Special Driver & AS Remote Mode nor in the Delta Special
0006
Driver & CANopen DS301 Mode.

0007 The slave axis is not initialized.


6_
11. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus it is recommended to use the ladder diagram (LD) language to edit the instruction. When
edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

12. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-1053
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description


Modifying the starting address for E-
2816 ECAMC From Slave to ErrCode CAM chart and the E-CAM chart
length in the servo

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
CAddr   
CLen   
Done   
Err   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT

type

Slave  
CAddr  
CLen  
Done 
Err 
ErrCode  

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3/EX3/SV3/SX3 -

_6 Symbol

Slave : Node ID of a servo (slave axis)


From which address to start storing E-CAM chart
CAddr :
in the servo
CLen : Specified E-CAM chart length for executing

Done : Modification complete flag

Err : Error flag

ErrCode : Error code

Explanation
1. This instruction is for modifying E-CAM chart settings. You need to download the E-CAM chart to the specified servo

before using this instruction.

2. Slave is the node ID of a servo drive (slave axis) which you specify to receive commands; the supported slave ID

ranges from 1 to 8. If the slave ID you are using is out of the supported range, the instruction is NOT executed. And

the Err (error) flag is ON. If the specified servo slave cannot communicate, the Err (error) flag is also ON. After

modifying the E-CAM parameters and the specified servo slave responds correctly, the DONE flag is ON.

6-1054
Ch ap te r 6 Ap pl ie d Instruc ti ons

3. CAddr is the starting address where to store the E-CAM chart in the servo; the supported setting range is from 0 to

794. If the starting address you are using is out of the supported range, the instruction is NOT executed. And the Err

(error) flag is ON. PLC sets the servo parameter P5-81 (start address of data array).

4. CLen is the specified E-CAM chart length for executing; its setting range is from 5 to 720. E-CAM chart is divided

into CLen and the chart should include CLen +1 data. The servo supports 1st - 800th space; if the starting address is

501 and set the CLen to 400, this arrangement takes 902 (501+401) space which exceeds the 800th space, the

instruction is NOT executed and the Err (error) flag is ON. PLC sets the servo parameter P5-82. Write this

parameter when E-CAM stops (P5-88, X0=0).

5. Once executing this instruction, it clears the Done flag first and then sends the modification request. After modifying

the E-CAM parameters and the specified servo slave responds correctly, the DONE flag is ON. If any error occurs

from the slaves, the Err (error) flag is ON. If you need to modify the E-CAM starting address and length, you need to

wait for one scan time before executing this instruction again.

6. If the Err (error) flag is ON, refer to the definitions below.

ErrCode Description

0000 No error occurs.

0001 The specified node ID for the servo (slave axis) is NOT in the supported range.

0002 This E-CAM chart number is NOT in the supported range.

0003 This downloading address (CAddr) or length (CLen) is NOT in the supported range.

0004 No response from the slave axis.


6_
0005 Error message sent from the slave while downloading or setting up.

The PLC is NOT in the Delta Special Driver & AS Remote Mode nor in the Delta Special
0006
Driver & CANopen DS301 Mode.

7. The communication transmission is executed only once when the conditional contact En of this instruction changes

from OFF to ON. Thus it is recommended to use the ladder diagram (LD) language to edit the instruction. When

edited in the SFC or ST language, the instruction is only triggered once and then communication data cannot be

sent again if the conditional contact En of the instruction cannot change from ON to OFF.

8. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-1055
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

2817 D TQC Node, TarTQ, …, Err Torque control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Node   
TarTQ   
LSpeed   
CurTQ 
Reach    
Err    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

Node  
TarTQ  
LSpeed  
CurTQ  
Reach 
Err 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

_6 Node : Node ID of a drive (CAN)/ Axis No. (ECAT)

TarTQ : Specified target torque

LSpeed : Maximum speed limit

CurTQ : Current torque value

Reach : Target torque is reached

Err : Communication error flag

Explanation
1. Make sure that all Delta drives have been initialized before executing this instruction.

2. For execution of this instruction, you need to use ISPSoft V3.07 or later.

3. For Delta servo, set P1-01 to 3 (T: Torque Control mode). (However, for ASDA-W3, set P1-01 to C.) The setting

in P1-01 is not effective until you repower on the drive.

For Delta AC motor drive (inverter), use ASDON instruction to set Torque Control mode and then set P11-33

(Torque command source) to 3 (CANopen). For a 3rd–party drive, additional setting is not required.

6-1056
Ch ap te r 6 Ap pl ie d Instruc ti ons

4. Node:. for CAN communication, the node IDs of Delta Servos and Inverters range from 1 to 8 (Delta Servos) and

21 to 28 (Delta Inverters). If the setting is out of the range, Err flag will be ON. For ECAT communication, the axis

No. ranges from 1 to 16, and the device type of the assigned axis No. should be servo. If the setting is out of the

range, Err flag will be ON.

5. TarTQ: specified target torque; it is suggested to check the manuals of Delta Servo Drives and AC Motor Drives

before setting up. You can modify the settings during the execution of this instruction.

Node ID /
Drive
Axis No, TarTQ
Type
Range
 Control in PR mode
1. The value in TarTQ is written to parameter P1-12 (Internal Torque Command 1).
With the valid range: -300 to +300 and unit: 1%, the value exceeding the
upper/lower limit is treated as the upper/lower limit value.
2. For PLC CPU FW V1.08.40 or later, ASDA-A3/B3’s high-resolution torque mode
is supported. In the high-resolution torque mode, with the valid range: -3000 to
+3000 and unit: 0.1%, the value exceeding the upper/lower limit is processed as
the upper/lower limit value. The +/- sign indicates the forward / reverse
1-8 (CAN)
Servo direction.
Drive 3. The servo runs according to parameter P1-01 (torque output direction); set
1-16 (ECAT) servo DI to TCM0 = ON and TCM1 = OFF to select Internal Torque Command
1.
4. Since the default value of P1-12 is NOT 0%, it will start running once it is Servo-
ON. We suggest you use COPRW / ECATRW instruction to clear the value in
servo parameter P1-12 before Servo-On.
 Communicate with Delta Servo ASDA-W3
The unit of the value in TarTQ is 0.1% when ASDA-W3 is controlled by a third-party 6_
device.
Setting the AC motor drive parameter P11-27 (maximum torque command);
AC
index 6071-00 (targeting torque) and index 6072-00 (largest output torque);
Motor 21-28 (CAN)
Drive valid range: -500 to +500; unit: 1%; value exceeding the upper/lower limit will be
treated as the upper/lower limit value.

6. LSpeed: maximum speed limit; this is used to prevent exceeding the speed limit, if the drives cannot complete the

specified torque commands. You can modify the settings during the execution of this instruction.

Node ID /
Drive
Axis No. LSpeed
Type
Range
Servo 1-8 (CAN) Setting the servo parameter P1-55 (maximum speed limit); valid range 10 to
Drive 1-16 (ECAT) maximum speed of the servo motor; unit: 1 r/min.
Setting the AC motor drive parameters
1. P01-00 = LSpeed (max. output frequency); valid range: 0 to 59900;
unit: 0.01 Hz; value exceeding the upper/lower limit will be treated as the
AC
upper/lower limit value
Motor 21-28 (CAN)
2. P11-37=100% (forward speed limit)
Drive
3. P11-38=100% (reverse speed limit)
You need to set parameter P11-36 (speed limit selection) to 0 and when parameter
P11-36 is set to 0, the speed limit is determined by the settings in P11-37 and P11-38.

6-1057
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

7. CurTQ: current torque value; unit: 0.1%; the value here is the same as the value shown in its corresponding SR.

Refer to API 2803 DRVIC instruction for more details on the corresponding SR.

8. Reach is the result of the comparison between CurTQ and TarTQ, shown in 0.1% as its unit. When CurTQ >=

TarTQ, the Reach flag is ON. When CurTQ < (TarTQ – 5), the Reach flag is OFF. The delay response value is 5.

9. If the nodes of the drives respond with error messages or do not respond, PLC will set Err flag to ON. For more

details on error codes, refer to SR658 and SR659 from API 2803 DRVIC instruction.

10. Since the values in the command of torque and speed may vary. It is suggested to check the manuals of Delta

Servo Drives and AC Motor Drives before setting up. This instruction does NOT examine or restrict if there is any

invalid value.

11. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example 1: Communication with Delta servo ASDA-A2-M

1. Set up ASDA-A2

A. Set the parameter P1-01 to 0003 (T: Torque Control mode).

B. Set servo DI: TCM0 = ON and TCM1 = OFF to select internal torque command 1.

If the value in DI is default, you can set DI3 to ON and then the torque command is set by DI3 and DI4.

_6 2. When M1 changes from OFF to ON, the INITC instruction starts to initialize the servo at node ID 1. When SM1681

changes to ON, the initialization is complete.

3. When M2 changes from OFF to ON, set the servo parameter P1-12 to 0. Use COPRW instruction to write the value

in D100 into P1-12 (S3=16#210B). Remember to clear the value in servo parameter P1-12 before Power-On. Since

the default value of P1-12 is NOT 0%, it will start running once it is Servo ON.

4. When M3 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 1. When SM1651

changes to ON, it indicates Servo-ON.

5. When M4 changes from OFF to ON, servo parameter P1-12 = 12% (torque command), the servo at node ID 2 starts

to move with the maximum speed limit of 1000 rpm until M4 changes to OFF.

6-1058
Ch ap te r 6 Ap pl ie d Instruc ti ons

6_

6-1059
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Example 2: Communication with Delta inverter

1. Set up VFD-C2000 manually

A. Set the parameter P09-36 (CANopen slave address) to range 21-28 and P09-37 (CANopen speed) to 0 (1

MHz) and P09-40 (CANopen decoding method) to 1 (Enable CANopen DS402 standard protocol).

B. Set the parameter P00-20 (source of master frequency command (AUTO)) to 6 (CANopen communication

card), P00-21 (operation command source) to 3 (CANopen communication card).

C. Set parameter P11-36 (speed limit selection) to 0 and when parameter P11-36 is set to 0, the speed limit is

determined by the settings in P11-37 and P11-38.

2. When M1 changes from OFF to ON, the INITC instruction starts to initialize the AC motor drive at node ID 21. When

SM1683 changes to ON, the initialization is complete.

3. When M2 changes from OFF to ON, the ASDON instruction enable the torque control mode of the AC motor drive at

node ID 21.

4. When M3 changes from OFF to ON, the target torque of AC motor drive is set at 10%, and the AC motor drive

starts to move with the maximum output frequency of 60.00 Hz until M3 changes to OFF.

_6

6-1060
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3: EtherCAT communication with Delta servo ASDA-A2-E

1. Set up ASDA-A2-E

A. Set the parameter P1-01 to 0003 (T: Torque Control Mode)

B. Set servo DI: TCM0 = ON and TCM1 = OFF to select internal torque command 1.

If the value in DI is default, you can set DI3 to ON and then the torque command is set by DI3 and DI4.

2. When M1 changes from OFF to ON, the INITC instruction starts to initialize the servo axis number 1. When M100

changes to ON, the initialization is complete.

3. When M2 changes from OFF to ON, set the servo parameter P1-12 to 0.

Use ECATRW instruction to write the value in D100 into P1-12 (S3=16#210B). Remember to clear the value in servo

parameter P1-12 before Power-On. Since the default value of P1-12 is NOT 0%, the servo will start running once it

is Servo-ON.

4. When M3 changes from OFF to ON, the ASDON instruction starts to enable the servo axis number 1. When

SM1651 changes to ON, it indicates Servo-ON.

5. When M4 changes from OFF to ON, servo parameter P1-12 = 12% (torque command), the servo starts to move with

the maximum speed limit of 1000 rpm until M4 changes to OFF.

6_

6-1061
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-1062
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

2818 D TQLC Node, TarSpd, …,Err Speed of torque control

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Node   
TarSpd   
LimitTQ   
CurTQ 
Reach    
Err    
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT
Data type

Node  
TarSpd  
LimitTQ  
CurTQ  
Reach 
Err 

Pulse Instruction 16-bit instruction 32-bit instruction


- - ES3/EX3/SV3/SX3

Symbol

Node :
Node ID of a drive (CAN) / Axis No. 6_
(ECAT)
TarSpd : Specified target speed

LimitTQ : Maximum torque

CurTQ : Current torque value

Reach : Target torque is reached

Err : Communication error flag

Explanation

1. Make sure that all Delta drives have been initialized before executing this instruction.

2. For Delta Servo Drives: set the parameter P1-01 to 3 (T: Torque Control mode) and turn the power off and on

again for the setting to be effective.

For Delta Vector Control Drives: use ASDON instruction to set Torque Control mode and set the parameter P00-20

(source of master frequency command (AUTO)) to 6 (CANopen communication card) on Delta AC Motor Drives

that supports torque control mode.

3. Node: for CAN communication, the node IDs of Delta Servos and Inverters range from 1 to 8 (Delta Servos) and

21 to 28 (Delta Inverters). If the setting is out of the range, Err flag will be ON. For ECAT communication, the axis

6-1063
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

No. ranges from 1 to 16, and the device type of the assigned axis No. should be the servo. If the setting is out of

the range, Err flag will be ON.

4. TarSpd: specified target speed, which can be modified when the torque value has not reached the target torque.

Drive Range of Range of TarSpd


TarSpd
Type Node
1-8 (CAN) -60000 to 60000 (0.1 rpm)
Servo Drive
1-16 (ECAT) Example: input 6005 indicating 600.5 rpm The +/- sign indicates the forward /
AC Motor -32768 to 32767 (1 rpm) reverse direction.
21-28 (CAN)
Drive Example: input 605 indicating 605 rpm

5. LimitTQ: maximum torque value; once the instruction is started, the setting applies to the servo drive. You can

NOT modify the settings during the execution of this instruction.

Setting the servo parameter P1-12 (Internal Torque Limit 1) ASDA-A3/B3 high resolution torque mode is supported;

valid range: -3000 to +3000, unit: 0.1%, value exceeding the upper/lower limit will be treated as the upper/lower

limit value. Set P1-02 (speed and torque (force) limit) to enable the torque limit; Set servo DI to TCM0 = ON and

TCM1 = OFF to select internal torque command 1. For example, input a value of 30 in P1-12 and you will have the

followings as shown in the table:

Allowable torque (force) range Forward torque (force) limit Reverse torque (force) limit
-30 to +30% 30% -30%

Setting the AC motor drive parameter P11-17 (forward motor torque limit Quadrant I) and P11-19 (reverse motor

_6 torque limit Quadrant III), valid range: 0 to +500, unit: 1%; value exceeding the upper/lower limit will be treated as

the upper/lower limit value. Supposing input a value of 30 in P11-17 and P11-19 and you will have the followings as

shown in the table:

Allowable torque Forward torque Reverse torque


Value in P11-17 Value in P11-19
(force) range (force) limit (force) limit
+30 +30 -30 to +30% 30% -30%

6. CurTQ: current torque value; unit: 0.1%; the value here is the same as the value shown in corresponding SR for

the specified slave/axis. Refer to API 2803 DRVIC instruction for more details on the corresponding SR.

7. Reach is the result of the comparison between CurTQ and TarTQ, shown in 0.1% as its unit. When CurTQ >=

TarTQ, the Reach flag is ON. When CurTQ < (TarTQ – 5), the Reach flag is OFF. The delay response value is 5.

8. If the nodes of the drives respond with error messages or do not respond, PLC will set Err flag to ON. For more

details on error codes, refer to SR658 and SR659 from API 2803 DRVIC instruction.

9. Since the values in the command of torque and speed may vary. It is suggested to check the manuals of Delta

Servo Drives and AC Motor Drives before setting up. This instruction does NOT examine or make any restrictions if

there is invalid setting or value.

6-1064
Ch ap te r 6 Ap pl ie d Instruc ti ons

10. When the instruction is disabled, the command of restoring the torque limit value to 100% is issued automatically,

so that the drive can execute other positioning commands.

11. The third-party drives and ASDA-W3 are not supported.

12. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example 1: CAN communication with Delta servo ASDA-A2-M

1. Set up ASDA-A2-M

A. Set the parameter P1-01 to 0001 (position control mode)

B. Set the parameter P1-02 to 0010 (torque limit is enabled) or use COPRW instruction to set this parameter.

C. Set servo DI: TCM0 = ON and TCM1 = OFF to select internal torque command 1.

If the value in DI is default, you can set DI3 to ON and then the torque command is set by DI3 and DI4.

2. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servo at node ID 1. When SM1681

changes to ON, the initialization is complete.

SM1681 is ON.

3. When M1 changes from OFF to ON, use COPRW instruction to set the servo parameter P1-02 to 0010. (Torque

limit is enabled.). 6_
4. When M2 changes from OFF to ON, the ASDON instruction starts to enable the servo at node ID 1. WhenSM1651

changes to ON, it indicates Servo-ON.

5. When M3 changes from OFF to ON, servo parameter P1-12 = 10% (maximum torque limit), the servo at node ID 1

starts to move at 1000 rpm until M3 is OFF.

6-1065
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

Example 2 (CAN communication with Delta inverter)

1. Set up VFD-C2000 manually

A. Set CANopen slave ID P09-36 (within the range 21-28), and CANopen speed P09-37 (default: 1 MHz), and

P09-40 (default: CANopen standard protocol).

B. Set the parameter P00-20 (source of master frequency command) to 6 (CANopen communication card),

P00-21 (operation command source) to 3 (CANopen communication card).

2. When M1 changes from OFF to ON, the INITC instruction starts to initialize the AC motor drive at node ID 21, until

SM1683 is ON.

3. When M2 changes from OFF to ON, the torque control of the AC motor drive is enabled at node ID 21.

4. When M3 changes from OFF to ON, the torque limit of AC motor drive is set to 10% and the AC motor drive at

node ID 21 moves at 1000 rpm until M3 is OFF.

6-1066
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3 EtherCAT communication with Delta servo ASDA-A2-E


6_
1. Set up ASDA-A2-E

A. Set parameter P1-01 to 0001 (Position Control mode).

B. Set parameter P1-02 to 0010 (Torque limit is enabled) or use ECATRW to set the parameter.

C. Set servo DI: TCM0 = ON and TCM1 = OFF in order to select internal torque command 1.

If the value in DI is default, you must set DI3 to ON and then the torque command is set by DI3 and DI4.

2. When M0 changes from OFF to ON, the INITEC instruction starts to initialize the servo axis number 1. When M100

changes to ON, the initialization is complete.

3. When M1 changes from OFF to ON, parameter P1-02 is set to 0010 with ECATRW. (torque limit is enabled)

4. When M2 changes from OFF to ON, the ASDON instruction starts to enable the servo of axis number 1. When

SM1651 changes to ON, it indicates SERVO-ON

5. When M3 changes from OFF to ON, the servo starts to move at 1000 rpm, with the maximum torque limit of 10%

until M3 changes to OFF.

6-1067
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

_6

6-1068
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

Initializing the slaves for EtherCAT


2820 INITEC SlaveNo, SType, Done, Error, ErrCode
communication

Device X Y M S T C HC D FR SM SR E K 16# “$” F


SlaveNo   
SType  
Done    
Error    
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data UINT

DINT

LINT

TMR

CNT
INT
type

SlaveNo  
SType  
Done 
Error 
ErrCode 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3 -

Symbol

SlaveNo : Number of slaves to be initialized

SType : Slave type 6_


Done : Completion flag

Error : Error flag

ErrCode : Error code

Explanation

1. This instruction is used for initializing the slaves for EtherCAT communication, only available for DVP32ES300TEC

series.

2. When using Delta servo for position control, please set servo parameter P1-001 in advance, and refer to the

following explanations and examples for details.

3. SlaveNo should specify a value in the range of 1 to 16. (A maximum of 16 EtherCAT slaves are supported by

DVP32ES300TEC.) or -1 (using ECAT ENI file). If the setting value exceeds this range, the PLC will consider it as

an initialization error.

Note: The IDs of slaves are determined by the EtherCAT wiring sequence of slaves. The setting value in SlaveNo

6-1069
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

should be consistent with the quantity of slaves actually connected.

4. SType is the type of slaves, and it is a 16-Word Array variable, e.g. if SlaveNo is set to 8, SType must be set to an

Array[16] variable.

Type codes of Delta drives are listed in the following table.

Type
1 2 3 101-110 200-211 Others
code
C2000
A3-E C2000+
Drive Third-party W3-E
A2-E B3-E CH2000 Reserved
Model devices 1-12 axes
E3-E MH300
MS300
Servo
01 01 N/A N/A 0C N/A
P1-001

Note: When the type code does not match the actual connected drive, the PLC will set the error flag to ON and an

error code will be shown.

 Third-party devices and ASDA-W3-E are supported only while DVP32ES300TEC PLC (firmware V1.08.20 or

later) works with EtherCAT port (firmware V1.02.26 or later).

 When Delta inverters MH300 and MS300 are used (along with an EtherCAT communication card), please

use the EtherCAT Configuration function in DIADesigner to do the topology setting for the entire EtherCAT

_6 network system, delete the INITEC instruction or set the number of slaves to be initialized to -1.

For the ASDA-W3-E servo, it is of the “one slave with multiple axes” type, for other drives, they are of the “one

slave with one axis” type. When you use ASDA-W3-E, the number of its axes must be specified by the type code

so as to calculate corresponding axis numbers. Type codes 200-211 respectively represent the axes 1-12 used by

ASDA-W3-E.

Example:

Stype[1] Stype[3]
Stype[0] Stype[2]
Slave Drive #2 Drive #4
Drive #1 Drive #3 Stype[4 to 15]
configuration (ASDA-W3-E (ASDA-W3-E
(ASDA-A2-E) (VFD-C2000)
with 12 axes) with 2 axes)
Axis No. 1 2, 3, 4-13 14 15, 16 N/A
Input type
1 211 3 201 0
code

NOTE:

1. When the type code does not match the drive actually connected, the PLC will set the error flag to ON and

the error code will be displayed.

6-1070
Ch ap te r 6 Ap pl ie d Instruc ti ons

2. The number of axes for the entire configuration is up to 16. For one ASDA-W3 servo, there are 12 axes

available at most.

3. The supported firmware versions for inverters and EtherCAT function cards are as follows:

Type Drive firmware CMC-EC firmware


V2.05-2.06 V1.0X
C2000
V2.07 V3.0X
V2.05-2.06 V1.0X
CH2000
V2.07 V3.0X
V3.05-3.06 V1.0X
C2000+
V3.07 V3.0X

5. Done is the initialization complete flag. It is suggested that you start the subsequent position control after the

initialization is completed.

6. Error is the initialization error flag, and ErrCode is the error code.

See the error codes and causes in the following table.

Error Code Cause


16#0000 No error
16#0001 The number of slaves is out of range.
16#0003 Slave type code setting error
16#0004 Operation error in EtherCAT port
16#0005 The slave SDO is being used by another instruction. 6_
16#0006 This model does not support the EtherCAT communication.
16#0007 The slave responds with AL State Machine Code Error
16#0008 The slave responds with AL STATUS Error
16#0009 The number of slaves actually connected is less than the setting in INITEC.
16#000A No physical connection between the EtherCAT port and the slaves
Initialization timeout of slaves through the EtherCAT port.
16#000B
(Some slaves in the EtherCAT topology are not in Operational state.)
16#000C The EtherCAT port is updating the ENI file.
16#000D The EtherCAT port does not support the EtherCAT ENI file for initialization.
The EtherCAT port does not support the slave types configured in the
16#000E
EtherCAT ENI file.
16#000F Multiple INITEC/ RSTD instructions are executed simultaneously.
16#0010 The number of axes in EtherCAT exceeds the range of 1-16.

7. When the connection-loss problem (SR0 = 0x1901 to 0x1910, the last two codes represent the slave ID) occurs

after the initialization is completed, SM1684 is OFF (default, indicating when one goes down, all slaves are OFF)

and the relevant actions of other slaves will also be paused. After the trouble is cleared, you need to initialize all

slaves to restart the operation. The PLC will automatically turn off the flashing error LED after confirming the

initialization is completed, and the error will be recorded in the error log.

6-1071
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

8. If slaves need to work independently without being affected by the failure of any slave else when the

communication cable is properly connected, you need to set the SM1684 to ON after initialization is done to notify

the PLC to record the error and set the corresponding error flag to ON, without needing to stop other slaves

working.

9. Please refer to point 5 in Example 1 of Communication with Delta Servo ASDA-A2-M in API 2800 INITC for the

basic settings of the ASD-A2 in the ES3 initialization process.

10. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example 1: Communication with Delta Servos ASDA-A2-E

1. Set P1-01 to 0001 (PR mode) on the panels of the ASDA-A2 servos.

2. Write 1 in D0 -D7, which represents the ASDA-A2-E servos.

3. If M0 is set to ON, initialization settings will be automatically issued to the 1st to 8th slaves (servos) via this instruction.
When M100 is ON, it indicates that initialization is completed (As SlaveNo is set to 8, the number of slaves actually

connected must be 8 as well.)

_6

Example 2: Communication with Delta Inverters C2000, which works with CMC-EC01.

1. On each inverter’s panel, set the frequency command source P00-20 to 8 (controlled by the communication card)

and the operation command source P00-21 to 5 (controlled by the communication card)

2. Write 3 in D0-D3, which represents the C2000 inverters.

3. If M0 is set to ON, initialization settings will be automatically issued to the 1st to 4th slaves (inverters) via this

instruction. When M100 is ON, it indicates that initialization is completed.

6-1072
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 3: Communication with Delta Servo Drive ASDA-W3

1. Set P1.001 for each axis to C (EtherCAT communication mode).

2. Set P3.062 for each axis to 0 (The W3 parameter setting is for reference only. For the latest information, please refer

to ASDA-W3 Series User Manual).

a. Indicates that the unit of speed of homing is 0.1 rpm.

b. Indicates that the unit of acceleration/deceleration time of homing is ms.

3. Set P3.018.X and P3.018.C for each axis to 0 (The W3 parameter setting is for reference only. For the latest 6_
information, please refer to ASDA-W3 Series User Manual).

a. P3.018.X = target speed OD, 0x60FF and speed feedback OD, 0x606C and the unit of 0.1 rpm.

b. P3.018.C = maximum speed command OD, 0x607F and maximum motor speed OD, 0x6080 and the unit of

0.1 rpm.

4. Take the following configuration of 4 drives with a total of 7 axes as an example:

Drive #2 Drive #4
Number of Drive #1 Drive #3
(ASDA-W3-E (ASDA-W3-E
slaves (ASDA-A2-E) (VFD-C2000)
with 3 axes) with 2 axes)
Axis No. 1 2, 3, 4 5 6, 7

SlaveNo is set to 4 (number of slaves), and the setting for Stype are shown in the following table.

Stype D0 D1 D2 D3 D4-D15
Setting value 1 202 3 201 0

6-1073
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

5. When M1=ON, the ASDON instruction enables the servo of axis number 2 (the 1st axis of drive #2). When SM1652
changes to ON, it indicates SERVO-ON.

_6

6-1074
Ch ap te r 6 Ap pl ie d Instruc ti ons

API Instruction Operand Description

Reading and writing EtherCAT


2821 ECATRW Slave, RWCode, … ErrCode
SDO data

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
RWCode   
Index 
SubIndex 
Length   
Data 
Done   
Error   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Slave  
RWCode  
Index  
SubIndex  
Length  
Data    
Done 
Error 
ErrCode  6_

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3 -

Symbol

Slave : Slave ID

RWCode : Function code

Index : Index

SubIndex Sub-index

Length : Size of data

Destination register for the data to be read or


Data :
Source register for the data to be written
Done : Completion flag

Error : Error flag

ErrCode : Error Code

6-1075
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

Explanation

1. This instruction is used to read and write parameter values of a slave on the EtherCAT network through SDO

communication; The INITEC instruction must have been completed before you execute this instruction

2. This instruction is available for DVP32ES300TEC series.

3. Slave specifies a value in the range of 1-24. (A maximum number of 24 EtherCAT slaves are supported by

DVP32ES300TEC.) If the value exceeds the setting range for initialization, the PLC will consider it as a setting

error.

4. RWCode specifies the function code for reading or writing data. See the read/write function codes in the table as

follows.

Function code 16#0000 16#0001 16#1000 16#1001


Read one single Read multiple Write one single Write multiple
Description EtherCAT EtherCAT EtherCAT EtherCAT
parameter value parameter values parameter value parameter values

Note: If you set RWCode to a function code which is not defined in the table above, the PLC will treat it as an error.

When the function codes for reading and writing one single parameter value are used, the Length parameter of the

instruction is invalid. When the function codes for reading and writing multiple parameter values are used, the

instruction is executed according to Length parameter setting.

5. Index and SubIndex are the index and sub-index for the SDO communication. Length is the size of the multiple

_6 parameter values to be read or written and the setting range is 1-50. If the setting value exceeds the range, it will

be automatically adjusted to the upper limit or lower limit. If you are to read and write multiple parameter values,

the variables of Index and SubInex must be declared as Array type.

A. Most Delta ASDA-A2 servo parameters are decimal values. You can convert a parameter to the index

according to the following formula. For the subindex, fill in the fixed value, 0.

Index of PX-YY= 0x2000+(X*256)+YY

Example: Index of P5-04=0x2000+(0x0005*256)+0x0004=0x2504

B. Delta inverter parameters are also decimal values. The conversion of a parameter to the index / subindix is

made in the following formula:

Index of PXX-YY=0x3000+XX (hexadecimal), subindex =YY+1 (hexadecimal)

Example: For P10-15, its index= 0x3000+0x000A=0x300A, and subindex= 0x0F+1=0x10

C. During communication with Delta ASDA-W3, you can only read / write OD (objects). Reading / writing

parameters like PX-XX is not supported. Please refer to ASDA-W3 Series User Manual for more information.

6-1076
Ch ap te r 6 Ap pl ie d Instruc ti ons

6. Data is the destination device for storing the data to read or the source device where the data to write is. To read

and write multiple parameter values, it should be noted that the data type of Data must be declared as Array. Each

read or written parameter value occupies 2 words.

7. Done is the reading or writing completion flag. During performing the read operation, you should wait for the

completion flag to be ON before using the read data.

8. Error is the communication error flag, and ErrCode is the error code.

See the error codes and causes in the following table.

Error Code Cause


16#0000 No error
16#0001 The slave ID is out of range or the specified slave is not initialized.
16#0002 No response from the slave
16#0003 The read and write function code setting is incorrect.
According to the set length of the data to read and write, the data in Index /
16#0004
SubIndex device is out of the range.
According to the set length of the data to read and write, the data in Data
16#0005
device is out of the range.
16#0006 This model does not support the EtherCAT communication.
An error occurs in the message received by the slave.
16#0007
Or it is a communication error in the response from the slave.
Receiving other SDO commands is not allowed while the slave is executing
16#0008
the DCSFOC instruction.
16#000D The specified EtherCAT RTU does not exist.
6_
9. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

Example: Communication with Delta Inverter C2000, which works with CMC-EC01.

1. Set M0 to ON to issue initialization settings to the 1st slave.

2. When M7 is set to ON, multiple parameter values are read from the VFD-C2000 inverter and are stored in D200–

D203.

VFD-C2000
Index Subindex Data device
parameter
01-12
D10 = 16#3001 D20 = 16#000D D200–D201
(Acceleration time)
01-28
D11 = 16#3001 D21 = 16#001D D202–D203
(Max. frequency)

Index of PXX-YY = 0x3000 + XX (hexadecimal); Subindex of PXX-YY = YY+1 (hexadecimal)

6-1077
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

3. Ladder diagram

_6

6-1078
Ch ap te r 6 Ap pl ie d Instruc ti ons

Example 2: Communication with Delta servo ASDA-W3, controlled by a third-party device.

1. Take the following configuration of 2 drives with a total of 4 axes as an example:

Drive #1 Drive #2
Number of slaves
(ASDA-A2-E) (ASDA-W3-E with 3 axes)
Axis No. 1 2,3,4

2. Use ECATRW to read the homing modes of W3 axes.

A. Slave (slave ID) is set to 2 (Drive #2: W3).

B. When M7 changes to ON, ECATRW starts to read the homing mode of the second axis of W3 (D10=6898)

and stores it in D30.

6_

C. Homing mode index for axes of W3, from its 1st to 3rd is shown below.

Index (D10) Definition


6098h Homing mode of the first axis
6898h Homing mode of the second axis
7098h Homing mode of the third axis

3. According to Delta ASDA-W3 User Manual, the communication object addresses of axes are offset by 800 in

sequence.

Communication object group Definition


6000-67FF H Communication objects for the first axis
6800-6FFF H Communication objects for the second axis
7000-77FF H Communication objects for the third axis

6-1079
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

Reading Motion state of a specified


2822 MOTST Slave, Reset, … ErrCode
axis in EtherCAT

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
Reset 
Position 
State 
Done   
Error   
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
UINT

DINT

LINT

TMR

CNT
INT

Data type

Slave  
Reset 
Position  
State  
Done 
Error 
ErrCode 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3 -
_6 Symbol

Slave : Axis No.

Reset : Reset the position control

Position : Axis position (32 bits)

State : Axis status

Done : Completion flag

Error : Error flag

ErrCode : Error code

Explanation

1. Through PDO communication method, this instruction regularly refreshes the status and position of the specified

axis. And the specified axis is scanned and its status and position are automatically updated to the variables of the

instruction. It is suggested that you execute the instruction to refresh the latest status of the axis after the

initialization is completed.

2. This instruction is available for DVP32ES300TEC series.

6-1080
Ch ap te r 6 Ap pl ie d Instruc ti ons

3. Slave specifies a value in the range of 1–16. (Up to 16 axes are supported by DVP32ES300TEC.) If the value

exceeds the setting range for initialization, the PLC will consider it as a setting error.

4. When Reset is ON, the occupied position control over the specified axis is cleared so that other position

instructions (including DDRVIC / DDRVAC / DPLSVC / ZRNC / DZRNC / DCSFOC / DTQC / DTQLC) can restart

the axis to perform the position control. After the position control is released, Reset will automatically change to

OFF.

Note: In the normal position control, the original positioning will be stopped when this Reset action is performed.

5. If the device type of the specified axis is servo, Position is the current position (32 bits) of the specified axis. If the

device type of the specified axis is the inverter (AC motor drive), the value of Position is the fixed value 0.

6. State is the current status of the specified axis.

See the definitions of bits when all bits of the status value are ON in the following table.

Bit No. Bit 15 - Bit 4 Bit 3 Bit 2 Bit 1 Bit 0


Servo: Servo On Position Position
Definition Reserved Pause
Inverter: RUN reached in output

7. Done is the status update completion flag. In normal circumstances, the flag should be ON continuously. If it is

OFF, the last updated data of the current state, position and speed of the axis will be maintained.

8. Error is the communication error flag, and ErrCode is the error code.

See the error codes and causes in the following table. 6_

Error Code Cause


16#0000 No error
16#0001 The axis No. is out of range or the specified axis is not initialized.
16#0003 This model does not support the EtherCAT communication.

Example: Communication with Delta Inverter C2000, which works with CMC-EC01.

1. The initialization setting of the inverter is complete, and then the ASDON instruction is executed successfully.

2. As M4 is set to ON, the inverter is in RUN (Bit3: ON).

6-1081
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

API Instruction Operand Description

Reading the communication state of


2823 ECATST Slave, State, Done, Error, ErrCode
an EtherCAT slave

Device X Y M S T C HC D FR SM SR E K 16# “$” F


Slave   
State 
Done    
Error    
ErrCode 
DWORD

STRING
LWORD
WORD

LREAL
BOOL

REAL
Data
UINT

DINT

LINT

TMR

CNT
INT
type

Slave  
State  
Done 
Error 
ErrCode 

Pulse Instruction 16-bit instruction 32-bit instruction


- ES3 -

Symbol

Slave : Slave ID

_6 State : Status of the EtherCAT slave

Done : Completion flag

Error : Error flag

ErrCode : Error Code

Explanation

1. The execution of the INITEC instruction should be completed before this instruction is executed.

2. This instruction is available for DVP32ES300TEC series.

3. There is no limit on the number of times the instruction can be used. However, for the same slave only one

ECATST instruction is allowed to execute at the same time.

4. Slave specifies a value in the range of 1–16. (A maximum number of 16 EtherCAT slaves are supported by

DVP32ES300TEC.) If the value exceeds the setting range or the specified slave is not initialized, the instruction will

not be executed.

6-1082
Ch ap te r 6 Ap pl ie d Instruc ti ons

5. State: Communication state of the EtherCAT slave

Bit No. Description


1: Initialization State
2: Pre-Operational State
Bit 0-3 3: Bootstrap State
4: Safe-Operational State
8: Operational State
0:The device state is consistent with the required state or cleared by a command.
Bit 4
1:The device state is inconsistent with the required state or changed by the slave.
0:Device Identification is not effective.
Bit 5
1:Device Identification is effective.
Bit 6-15 Reserved

6. Done is the status update completion flag. In normal circumstances, the flag should be ON all the time. If it is OFF,

the last updated data of the EtherCAT slave state mentioned above will be maintained.

7. Error is the communication error flag, and ErrCode is the error code.

See the error codes and causes in the following table.

Error Code Cause


16#0000 No error
16#0001 The slave ID is out of range or the specified slave is not initialized.
16#0002 No response from the slave
16#0003 This model does not support the EtherCAT communication. 6_
16#0004 Two or more ECATST instructions are started with the same slave ID.
16#000D The specified EtherCAT RTU does not exist.

8. This instruction should not be used in the Structured Texts programming language, or interrupt programs or FB

programs that only be called once.

6-1083
D VP- ES3 /EX3 /SV3 /SX3 Seri es Pro gra mm in g M an ua l

6.27.3 Frequently asked questions in Delta special CANopen


communication and Troubleshooting
Question 1: After the PLC starts the INITC instruction, the initialization completion flag SM1681 is not set to ON.

Steps:

1) Make sure that the CANopen communication mode for the built-in CAN port of ES3/EX3/SV3/SX3 series CPU

in HWCONFIG is Delta special driver or Delta special driver & CANopen DS301 mode. Then check if the

communication rate is the specified baud rate. After above settings are correct, re-download the hardware

configuration table and then re-check if the initialization works. If the initialization still does not work, proceed

with the next step.

2) Ensure that the servo initialization has been set by manual. Then re-power the servo on after power off. After

doing so, continue with step 3.

3) Ensure that the servo node ID (P3-00), baud rate and mode (P3-01) have been set by manual and

communication mode (P1-01) has been set to PR mode by manual. Then proceed with the step 4.

4) Ensure that the CAN communication cable connection is proper, the terminal resistor in ES3/EX3/SV3/SX3

series PLC is switched on and the last servo has been connected with a terminal resistor. Then move forward

to the step 5.

5) Observe whether the word: code appears temporarily on the digital display of the servo when the PLC

enables the initialization instruction. If there is no code appearing temporarily, return to step 1 or replace the
_6
servo. If there is the word code appearing temporarily, go to step 6.

6) Check if the actual states of DI0-DI7 (P2-10 to P2-17) of the servo are consistent with the function settings of

servo parameters. E.g. DI0 is the negative limit input (contact A). Check if the actual input state has been OFF

(Contact B). If DI function has been enabled, make the function disabled. If the function has not been enabled,

go on with step7.

7) The communication mode for the built-in CAN port in HWCONFIG is switched back to CANopen DS301 mode.

Use the CANopen Builder software to search the slave and observe which slave has not been scanned.

Remove the one which has not been scanned and then make the initialization again by adjusting the servo

node ID and the ID in INITC in the PLC.

6-1084
12
7
Chapter 7 Troubleshooting

Table of Contents
7.1 Troubleshooting ................................................................................ 7-2
7.1.1 Basic troubleshooting steps ............................................................. 7-2
7.1.2 Clear the Error States ..................................................................... 7-2
7.1.3 Troubleshooting SOP ...................................................................... 7-3
7.1.4 System Log and Positions of the Error Step ....................................... 7-4

7.2 Troubleshooting for CPU Modules ...................................................... 7-8


7.2.1 ERROR LED Indicators Are ON ......................................................... 7-8
7.2.2 ERROR LED Indicators Blinking Every 0.5 Seconds ............................. 7-8
7.2.3 ERROR LED Indicators Blinking Rapidly Every 0.2 Seconds .................7-10
7.2.4 ERROR LED Indicators Slow Blinking Every 3 Seconds and Lighting up for
1 Second .....................................................................................7-10
7.2.5 The LED RUN and ERROR Indicators are Blinking Simultaneously
Every 0.5 Seconds ........................................................................7-11
7.2.6 The RUN and LED Indicators are Blinking One After Another
Every 0.5 Seconds. .......................................................................7-11
7.2.7 Other Errors (Without LED Indicators) .............................................7-12

7.3 Troubleshooting for Other I/O Modules........................................... 7-18

7.4 LED Indicators and Error Codes for CPU Modules ............................ 7-19

7-1
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.1 Troubleshooting
7.1.1 Basic troubleshooting steps
This chapter includes the possible errors that can occur during operation, their causes, and corrective actions.

(1) Check the following:

 The PLC should be operated in a safe environment (consider environmental, electronic, and vibration safeties).

 Connect power supply correctly to the PLC.

 Secure the module, terminal, and cable installations.

 All LED indicators show correctly.

 Set all switches correctly.

(2) Check the following operational functions of the ES3/EX3/SV3/SX3 system:

 Switch the RUN/STOP state

 Check the settings for the ES3/EX3/SV3/SX3 Series to RUN/STOP

 Check and eliminate errors from external devices

 Use the System Log function in ISPSoft to check system operation and logs

(3) Identify possible causes:

 ES3/EX3/SV3/SX3 Series or external devices

 CPU or extension modules

 Parameters or program settings

7.1.2 Clear the Error States


Use the following methods to clear the error states. If the error source is not corrected, the system continues to show
errors.

_7 (1) Switch the CPU model state to STOP and then to RUN.

(2) Turn off the CPU and turn it on again.

(3) Use ISPSoft to clear the error logs.

(4) Reset the CPU to the default settings and download the program again.

7-2
C h a p t e r 7 Tr o u b l e s h o o t i n g

7.1.3 Troubleshooting SOP


An e rror
occurred

Basic
troubles hoot ing No Ref er t o s ec tio n 7 .1 . 1 f or
B as ic t rou bles ho otin g s te ps
st eps
done

Yes
Module
C PU mo du le e rror error 1. Ref er t o sec t ion 7.3 fo r t roub les hoo ting f or
o r mo d ul es e rror I/O mod ules

CPU module
error
1. Ref er t o s ec tio n 7.1. 4 for t he s y st em log
Yes 2. Ref er t o se ct ion 7. 4 for e rror c o des a nd
ERROR LED ON LED in dic at ors f or CP U mo dule s
3. Ref er t o se ct ion 7. 2 for t rou bles ho otin g for
CP U m odu le s

No

1. Ref er t o s ec tio n 7.1. 4 for t he s y st em log


ERROR L ED b linking Yes 2. Ref er t o se ct ion 7. 4 for e rror c o des a nd
normally LED in dic at ors f or CP U mo dule s
(every 0.5 sec.) 3. Ref er t o se ct ion 7. 2 for t rou bles ho otin g for
CP U m odu le s

No

1. Ref er t o s ec tio n 7 . 1 .4 fo r the s ys t em log


ERROR L ED b li nki ng Yes 2. Ref er t o se ct ion 7. 4 for e rror c o des a nd
fast LED in dic at ors f or CP U mo dule s
(every 0.2 sec.) 3. Ref er t o se ct ion 7. 2 for t rou bles ho otin g for
CP U m odu le s

No

1. Ref er t o s ec tio n 7.1. 4 for t he sy s te m log


ER RO R L ED b lin kin g Yes 2. Ref er t o se ct ion 7. 4 for e rror c o des a nd
slo wl y (e very 1 s e c. , LED in dic at ors f or CP U mo dule s
sto p fo r 3 s ec.) 3. Ref er t o se ct ion 7. 2 for t rou bles ho otin g for
CP U m odu le s

No

1. Ref er t o s ec tio n 7.1. 4 for t he s y st em log


Yes 2. Ref er t o se ct ion 7. 4 for e rror c o des a nd
Other LED bli nki ng LED in dic at ors f or CP U mo dule s
3. Ref er t o se ct ion 7. 2 for t rou bles ho otin g for
CP U m odu le s
7_
No

After goi ng through


troubl eshoo ti ng steps,
Yes If th e prob le m pers ist s , pleas e c ont ac t
s u ppo rt.
the i ssues are still not
resolve d.

No

The system runs normally.

7-3
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.1.4 System Log and Positions of the Error Step


If ISPSoft is connected to ES3/EX3/SV3/SX3 Series, you can view actions and errors in the ES3/EX3/SV3/SX3 Series by
clicking System Log on the PLC menu. The CPU can store up to 20 error log sets. After the 20 sets are stored, the 1st log
is replaced with the 21st if there are new logs coming in, and the old logs are replaced with the new ones sequentially.
When the memory card is installed in the CPU module, 20 sets of the old logs are backed up in the memory card and up to
1000 logs can be recorded. If the stored logs exceed 1000, the oldest 20 logs are replaced with the newest 20 logs in the
memory card.

 ISPSoft software

(1) On the PLC menu, click System Log.

(2) The System Log window appears. Click Clear Log to clear the error log in the window and the error log in the CPU
module, and reset the CPU module.

_7

 Group No.: The number 1 indicates that the error occurred in the CPU module or the right-side module 1.

 Module No.: The number 0 indicates that the error occurred in the CPU module or the remote module.

 PLC/Module name: Model names of the CPU, remote, and extension modules.

7-4
C h a p t e r 7 Tr o u b l e s h o o t i n g

 Error Code: Error codes in the error log.

 Date & Time: The date and time the error occurred. The most recently occurring error is listed on the top.
 The last column shows the descriptions for the error.

(3) If the operation or operand exceeds the allowed range (SM0 = ON, stored in SR0) or an instruction inspection
error (SM5 = ON, stored in SR4) occurs, you can use the following method to see where the problem is.

 When SM0 = ON, check the value in SR1 to see the error step. SR1: The address of the operation error (32-bit).

 When SM5 = ON, check the value in SR5 to see the error step. SR5: The address of the grammar check error
(32-bit).

 Once you know the error step number, you can go to ISPSoft -> Edit -> Step positioning. Enter the error step
number and click OK. The system takes you to the position where the step went wrong.

 DIADesigner software

1) After starting DIADesigner, double-click Device & Error Information under Controller in the project tree.

7_

2) The Error Information window appears. Press to refresh the error information display, and press to clear
the error logs in the main window and the CPU.

7-5
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

 Group number: The number of the group where an error occurred.

 Module Number: The number of the module where an error occurred.

 Module Name: The name of the module where an error occurred.

 Error code: Displays error codes.

 Date & time: Displays the date and time when an error occurred.

 Name: Brief description of errors

 Detail: Detailed information about errors.

 Troubleshooting: The troubleshooting methods for errors.

3) When an error such as a program syntax error (SM5=ON), recorded in SR4, or used devices out of the allowed range
(SM0=ON), recorded in SR0 occurs during PLC program download or execution, follow the operations below to get to
the step position where an error occurs.

 When SM0=ON, please check the 32-bit value in SR1, where the step position number of the error in the
program was recorded when the last error occurred.
_7  When SM5=ON, please check the 32-bit value in SR5, where the step position number of the error in the
program was recorded when the last error occurred.

 Once you know the step position number of an error, click on Controller > Auxiliary > Step Position in the
project tree. After you enter the step position number, the system will take you to the step position where the
error occurs in the PLC program.

7-6
C h a p t e r 7 Tr o u b l e s h o o t i n g

7_

7-7
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.2 Troubleshooting for CPU Modules


Check the LED indicators and the error codes from the CPU module and refer to the following table for troubleshooting. V
in the Log column indicates the error is recorded in the log. X in the Log column indicates the error is not recorded in the
log. H in the Log column indicates whether or not you can set recording the error in the log in HWCONFIG.
Note: Error log is also stored in SR. Refer to Chapter 2 for more information on SR.

7.2.1 ERROR LED Indicators Are ON


Error
Code Description Solution Flag Log
(16#)

1. Check the setting of the watchdog timer in HWCONFIG.


000A Scan timeout SM8 V
2. Check whether the program causes a long scan time

7.2.2 ERROR LED Indicators Blinking Every 0.5 Seconds

Error
Code Description Solution Flag Log
(16#)

The program in the PLC is


000C Download the program again. SM9 V
damaged.
The initial values in devices and the
000D PLC program are not completely Download the program again. SM9 V
downloaded.
0010 CPU memory is denied. Contact the factory. SM9 V
The execution speed of the CPU
0020 Contact the factory. SM9 V
does not reach the maximum speed.
CPU external memory access is
002E Contact the factory. SM9 V
denied.
PLC programs are not consistent
_7 002F
with the system logs.
Download the program again. SM34 V

The interrupt number exceeds the Check the program, compile the program again, and
0102 SM5 X
range. download the program again.
The MC instruction exceeds the Check the program, compile the program again, and
0202 SM5 X
range. download the program again.
The MCR instruction exceeds the Check the program, compile the program again, and
0302 SM5 X
range. download the program again.
The operands used in DHSCS are Check the program, compile the program again, and
0D03 SM5 X
not used properly. download the program again.
The operands HCXXX used in Check the program, compile the program again, and
0E05 SM5 X
DCNT are not used properly. download the program again.
1000
~ If the problem persists, contact the local authorized
System error - V
distributors.
10FF
Make sure that the total number of DI/DO module input
The total number of DI/DO module
and output points does not exceed the upper limit.
140F input and output points is out of the SM10 V
(Max. 240 points for ES3/EX3; max. 480 points for
allowed range.
SV3/SX3)

7-8
C h a p t e r 7 Tr o u b l e s h o o t i n g

Error
Code Description Solution Flag Log
(16#)
1410
~ The right-side module cannot be
The right-side module is connected properly. SM10 V
detected.
1413
Whenever power on, check if the automatic comparison
The number of modules powered is
function is enabled or disabled (SM227), and check the
1414 inconsistent with the number SM10 V
number of expansion points and the number of units set
checked.
in SR1553 to SR1555.
Initialization error on the left-side
1420 modules (number of left-side Check the number of left-side modules. SM10 V
modules exceeds 8 units.)
1421 The communication timeout occurs
~ Check if the module is correctly connected or if the
in the left-side module or the model SM10 V
module model is the same as that actually connected.
1424 name is incorrect.
Memory detection error on the
1425 Check if the module is connected properly. SM10 V
left-side module.
Check the program, compile the program again, and
200A Invalid instruction SM5 V
download the program again.
The number of MODBUS TCP SM
6010 Check the number of superior devices (maximum is 32). V
connections exceeds the range. 1092
The number of EtherNet/IP SM
6011 Check the number of connections (maximum is 16). V
connections exceeds the range. 1093
C000
Save the PLC program and hand the file to the company
- The program syntax is incorrect.
or the technicians.
CFFF

7_

7-9
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.2.3 ERROR LED Indicators Blinking Rapidly Every 0.2 Seconds


This happens when the power supply 24 VDC of the CPU module is disconnected, or the power supply is not sufficient,
not stable or abnormal.

Error
Code Description Solution Flag Log
(16#)
Check whether the external 24 V power supply to the
002A The external voltage is abnormal. SM7 V
module is normal.

7.2.4 ERROR LED Indicators Slow Blinking Every 3 Seconds and


Lighting up for 1 Second
Error
Code Description Solution Flag Log
(16#)
The converted value of the built-in
0040 AD input channel 1 exceeds the Check the actual input signal. SM27 H
range.
The converted value of the built-in
0041 AD input channel 2 exceeds the Check the actual input signal. SM27 H
range.

The converted value of the built-in


0042 AD input channel 3 exceeds the Check the actual input signal. SM27 H
range.

The converted value of the built-in


0043 AD input channel 4 exceeds the Check the actual input signal. SM27 H
range.

Current input 4~20mA mode in the


0044 built-in AD input channel 1 is Check the wiring. SM27 H
disconnected.
_7 Current input 4~20mA mode in the
0045 built-in AD input channel 2 is Check the wiring. SM27 H
disconnected.

Current input 4~20mA mode in the


0046 built-in AD input channel 3 is Check the wiring. SM27 H
disconnected.

Current input 4~20mA mode in the


0047 built-in AD input channel 4 is Check the wiring. SM27 H
disconnected.

1900 1. Check the CANopen/EtherCAT connection cable.


Heartbeat errors occurred in the
- slave in the CANopen/EtherCAT 2. Check if the specific slave is working properly. - V
Note: The last 2 digits of the error code represent the ID
191C communication mode.
number of the slave (convert hexadecimal to decimal).

7-10
C h a p t e r 7 Tr o u b l e s h o o t i n g

7.2.5 The LED RUN and ERROR Indicators are Blinking Simultaneously
Every 0.5 Seconds
This happens when the firmware of the CPU module is being upgraded. If this happens once the power is supplied to the
CPU module, it means errors occurred during the previous firmware upgrade. Users need to upgrade the firmware again
or contact your point of purchase.

7.2.6 The RUN and LED Indicators are Blinking One After Another Every
0.5 Seconds.
This happens when the CPU module memory card is backing up, restoring, or saving.

7_

7 - 11
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.2.7 Other Errors (Without LED Indicators)


Error
Code Description Solution Flag Log
(16#)
0011 The PLC ID is incorrect. Check the PLC ID. SM34 V
0012 The PLC password is incorrect. Check the PLC password. SM34 V
The PLC maximum password attempts Reset the CPU module or restore the CPU module
002D SM34 V
exceeded. to its factory settings.
1. Reset the CPU module or restore the CPU
The memories in the latched special module to its factory settings, and then download
0050 SM6 V
auxiliary relays are abnormal. the program and the parameters again.
2. If the error still occurs, contact the factory.
1. Reset the CPU module or restore the CPU
The latched special data registers are module to its factory settings, and then download
0051 SM6 V
abnormal. the program and the parameters again.
2. If the error still occurs, contact the factory.
1. Reset the CPU module or restore the CPU
The memories in the latched auxiliary module to its factory settings, and then download
0052 SM6 V
relays are abnormal. the program and the parameters again.
2. If the error still occurs, contact the factory.
1. Reset the CPU module or restore the CPU
module to its factory settings, and then download
0054 The latched counters are abnormal. SM6 V
the program and the parameters again.
2. If the error still occurs, please contact the factory.
1. Reset the CPU module or restore the CPU
The latched 32-bit counters are module to its factory settings, and then download
0055 SM6 V
abnormal. the program and the parameters again.
2. If the error still occurs, contact the factory.
1. Reset the CPU module or restore the CPU
The latched special auxiliary relay is module to its factory settings, and then download
0056 SM6 V
abnormal. the program and the parameters again.
2. If the error still occurs, contact the factory.
1. Reset the CPU module or restore the CPU
The latched data registers are module to its factory settings, and then download
0059 SM6 V
abnormal. the program and the parameters again.
_7 2. If the error still occurs, contact the factory.
The CPU module does not detect a Check that the memory card is inserted correctly
005D SM453 V
memory card. into the CPU module.
The memory card is initialized
005E Check whether the memory card is broken. SM453 V
incorrectly.
An error occurs when data is written to Check whether the file path is correct or whether
0063 SM453 V
the memory card. the memory card is malfunctioning.
A file in the memory card cannot be Check whether the file path is correct, or whether
0064 SM453 V
read. the file is damaged.
The initialization of the Delta ASD-A2 1. Check the CANopen connection cable.
control has not yet been completed, the 2. Check if the specific slave is working properly.
1950 - V
CANopen instructions cannot be 3. If nothing is wrong, initialize the Delta ASD-A2
executed. again.
Heartbeat timeout occurred in the slave
Check if the CANopen connection cable is
19B0 of the CANopen communication - V
well-connected.
module.
The data length of PDO (process data
Revise the PDO data length setting in the slave
19B1 object) in the slave mode is not matched - V
mode and download the setting again.
with the setting.

7-12
C h a p t e r 7 Tr o u b l e s h o o t i n g

Error
Code Description Solution Flag Log
(16#)
Check the value in SR830~SR893 (refer to section 2.2.14 in this manual for more details) to see which slave (1~64) is
experience an error and refer to the following error codes 19E1~19E8 to check the details.
The data length of PDO (process data
object) in the slave mode is not matched
with the setting of the scan list.
Refer to section 10.5 CANopen Revise the PDO data length setting in the slave
19E1 - V
communication related descriptions in mode and download the setting again.
AS Series Hardware and Operation
Manual for more details on the error
codes 19E1 to 19E8.
19E2 PDO in the slave mode is not received. Check if the configurations are correctly set. - V
The function of auto downloading SDO Check if the SDO contents for auto downloading
19E3 - V
fails at the first startup. are correct.
19E4 PDO configurations are set incorrectly. Make sure to set the PDO configurations correctly. - V
The main settings are not consistent Make sure the connected slaves are the ones
19E5 - V
with the connected slave. configured in ISPSoft.
The slave does NOT exist in the Make sure the power supply of slave is normal and
19E6 - V
network. slave is correctly connected to the network.
Make sure the power supply of slave is normal and
19E7 Timeout on the slave error control - V
slave is correctly connected to the network.
The node IDs of master and slave are Set the node ID of the master and slave again and
19E8 - V
duplicated. make sure their node IDs are unique.
1. Download the parameter configuration again.
19F3 Error in the configuration 2. If the problem persists, contact the local - V
authorized distributors.
1. Check if the network cable is normal and the
shielded cable is grounded.
2. Check if the start and end of the network cable
CANopen communication is in the
19F4 are both connected with a 121Ω terminal - V
BUS-OFF state.
resistor.
3. Check if all the node devices run at the same
baud rate on the network.
Revise the time to synchronize (suggested to use a
19FB The sending registers exceed the range.
longer time).
- V 7_
The receiving registers exceed the Revise the time to synchronize (suggested to use a
19FC - V
range. longer time).
1. Use the FCOMP card in the function card 2 slot
and make sure its work mode is CANopen
Not in the right mode for the ASDA-A2
communication.
2001 while using the CANopen SM0 V
2. Check the position where an error occurs and
communication instruction.
modify the program. Compile the program and
download the program again.
The device used in the program
2003 SM0 V
exceeds the device range.
The operand n or the other constant
200B SM0 V
operands K/H exceed the range. Check the position where an error occurs and
200C The operands overlap. modify the program. Compile the program and SM0 V
The binary to binary-coded decimal download the program again.
200D SM0 V
conversion is incorrect.
200E The string does not end with 00. SM0 V
2012 Incorrect division operation SM0 V

7-13
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Error
Code Description Solution Flag Log
(16#)
The value exceeds the range of values
2013 that can be represented by the SM0 V
floating-point numbers.
The task designated by the TKON or
2014 YKOFF instruction is incorrect or SM0 V
exceeds the range.
The instruction BREAK is written outside
2017 SM0 V
of the FOR-NEXT loop.
1. Check the program, compile the program again,
No such position planning table number
2027 and download the program again. SM0 V
or the format is incorrect.
2. Check the settings of the position planning table.
High speed output instruction is being
Refer to SR28 for the record of the axis number and
2028 executed. Only one instruction can be - V
rearrange the output control procedures.
executed at a time.
Set the Ethernet parameter for the CPU module in
6004 The IP address filter is set incorrectly. SM1108 X
HWCONFIG again.
600D RJ45 port is not connected. Check the connection. SM1100 X
1. Check if there are devices using the same IP
There are devices using the same IP address.
6012 SM1101 V
address. 2. Check if there is more than 1 DHCP or BOOTP
server on the network.
Retry the email connection later. This error does not
6100 The email connection is busy. cause the PLC to stop running. Solve the problem SM1113 X
by means of the related flag in the program.
Set up the trigger attachment mode in HWCONFIG
The trigger attachment mode in the > CPU Module > Device Setting > Options >
6103 SM1113 X
email is set incorrectly. Ethernet Port Advanced > Email > Trigger Setting >
Trigger Attachment Mode.
The attachment in the email does not Check whether the attachment exists in the
6104 SM1113 X
exist. memory card.
The attachment in the email is Check the size of the attachment. If the size is over
6105 SM1113 X
oversized. 2 MB, the file cannot be sent as an attachment.
Check for the correct address and set up the SMTP
_7 There is an SMTP server response server in HWCONFIG > CPU Module > Device
6106 SM1113 X
timeout. Setting > Options > Ethernet Port Advanced >
Email again.
1. Check whether the status of the SMTP server is
normal.
There is an SMTP server response 2. Retry sending of the email later. This error does
6107 SM1113 X
timeout. not cause the PLC to stop running. Solve the
problem by means of the related flag in the
program.
Check for the correct ID/Password and set up in
6108 SMTP verification failed HWCONFIG > CPU Module > Device Setting > SM1113 X
Options > Ethernet Port Advanced > Email again.
1. Check the program and the related special data
registers.
The remote communication IP address 2. Set the Ethernet parameter for the CPU module
6200 - X
set in the TCP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.

7-14
C h a p t e r 7 Tr o u b l e s h o o t i n g

Error
Code Description Solution Flag Log
(16#)
1. Check the program and the related special data
registers.
The local communication port set in the 2. Set the Ethernet parameter for the CPU module
6201 - X
TCP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.
1. Check the program and the related special data
registers.
The remote communication port set in 2. Set the Ethernet parameter for the CPU module
6202 - X
the TCP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.
1. Check the program and the related special data
registers.
The device from which the data is sent 2. Set the Ethernet parameter for the CPU module
6203 - X
in the TCP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.
1. Check the program and the related special data
registers.
The device which receives the data in 2. Set the Ethernet parameter for the CPU module
6206 - X
the TCP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.
1. Check the program and the related special data
registers.
The data received through the TCP 2. Set the Ethernet parameter for the CPU module
6208 - X
socket exceeds the device range. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > TCP
Socket.
1. Check the program and the related special data
registers.
The remote communication IP address 2. Set the Ethernet parameter for the CPU module
6209 - X
set in the UDP socket function is illegal. in HWCONFIG CPU Module > Device Setting > 7_
Options > Ethernet Port Advanced > UDP
Socket.
1. Check the program and the related special data
registers.
The local communication port set in the 2. Set the Ethernet parameter for the CPU module
620A - X
UDP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > UDP
Socket.
1. Check the program and the related special data
registers.
The device from which the data is sent 2. Set the Ethernet parameter for the CPU module
620C - X
in the UDP socket function is illegal. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > UDP
Socket.
1. Check the program and the related special data
registers.
The device which receives the data in
620F 2. Set the Ethernet parameter for the CPU module in - X
the UDP socket function is illegal.
HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > UDP Socket.

7-15
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

Error
Code Description Solution Flag Log
(16#)
1. Check the program and the related special data
registers.
The data received through the UDP 2. Set the Ethernet parameter for the CPU module
6210 - X
socket exceeds the device range. in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > UDP
Socket.
There is no response from the remote
6212 Make sure that the remote device is connected. - X
device after the timeout period.
1. Check the program and the related special data
registers.
2. Set the Ethernet parameter for the CPU module
6213 The data received exceeds the limit. - X
in HWCONFIG CPU Module > Device Setting >
Options > Ethernet Port Advanced > UDP
Socket.
The remote device refuses the
6214 Make sure the remote device operates normally. - X
connection.
6215 The socket is not opened. - X
6217 The socket is opened. - X
The data has been sent through the
6218 Check whether operational sequence in the - X
socket.
program is correct.
The data has been received through the
6219 - X
socket.
621A The socket is closed. - X
The device communication function
7011 - H
code in COM1 is incorrect.
The device communication address
7012 - H
used in COM1 is incorrect.
The device used in COM1 exceeds the
7013 - H
device range.
The device length of the communication
7014 - H
data in COM1 exceeds the limit.
The device checksum for the
_7 7017 communication serial port of COM1 is - H
incorrect.
The device communication function
7021 1. Check the communication setting in the master - H
code in COM2 is incorrect.
and the slave.
The device communication address 2. Check the communication cable.
7022 - H
used in COM2 is incorrect.
The device used in COM2 exceeds the
7023 - H
device range.
The device length of the communication
7024 - H
data in COM2 exceeds the limit.
The device checksum for the
7027 communication serial port of COM2 is - H
incorrect.
The device communication function
7031 - H
code in the Ethernet is incorrect.
The device communication address
7032 - H
used in the Ethernet is incorrect.

7-16
C h a p t e r 7 Tr o u b l e s h o o t i n g

Error
Code Description Solution Flag Log
(16#)
The device used in the Ethernet
7033 - H
exceeds the device range.
The device length of the communication
7034 - H
data in the Ethernet exceeds the limit.
The device checksum for the
7037 communication serial port of the - H
Ethernet is incorrect.
The device communication function
7041 - H
code in the USB is incorrect.
The device communication address
7042 - H
used in the USB is incorrect.
The device used in the USB exceeds
7043 - H
the device range.
The device length of the communication
7044 - H
data in the USB exceeds the limit.
The device checksum for the
7047 communication serial port of the USB is - H
incorrect.
1. Refer to the function codes defined by the
communication protocols.
2. Check if the product firmware and the software
used are the most updated versions.
7203 Invalid communication function code - H
3. Make a note of the operation procedures and
screenshots of the error windows and hand this
note to the company or the technicians from the
agents.
1. Download the program and parameters again.
2. Check the communication cable.
The contents of the program
3. Save all the projects and compress the projects
8105 downloaded are incorrect. - H
into one compressed file and then hand this file
The program syntax is incorrect.
to the company or the technicians from the
agents.
1. Download the program and parameters again.
7_
The contents of the program
2. Save all the projects and compress the projects
downloaded are incorrect.
8106 into one compressed file and then hand this file - H
The length of the execution code
to the company or the technicians from the
exceeds the limit.
agents.
1. Download the program and parameters again.
The contents of the program
2. Save all the projects and compress the projects
downloaded are incorrect.
8107 into one compressed file and then hand this file - H
The length of the source code exceeds
to the company or the technicians from the
the limit.
agents.
1. Check if the product firmware and the software
used are the most updated versions.
8000
Errors occur between software and 2. Make a note of the operation procedures and
-
PLC. screenshots of the error windows and hand this
8FFF
note to the company or the technicians from the
agents.

7-17
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

7.3 Troubleshooting for Other I/O Modules


See DVP Series Module Manual to learn details about troubleshootings for other I/O modules.

_7

7-18
C h a p t e r 7 Tr o u b l e s h o o t i n g

7.4 LED Indicators and Error Codes for CPU Modules


The error codes and LED indicators are presented in the following tables.

 Descriptions used in the table

a. Error code: If an error occurs in the system, an error code is generated.

b. Description: The description of the error


c. CPU status: If the error occurs, the CPU stops running, keeps running, or shows the status you defined for the
error.

 Stop: The CPU stops running when the error occurs.

 Continue: The CPU keeps running when the error occurs.

d. LED indicator status: If the error occurs, the LED indicator is ON, OFF, or blinks.

 ERROR: System error

 LED Indicator Description Table

There are five types of error indicator states for of the CPU module errors, including LED indicator ON, OFF, blinking
fast, blinking normally, and blinking slowly. When the LED indicator is ON, blinking fast/normally, clear the problems
first in order to run the CPU module. When the LED indicator is blinking slowly, indicating a warning type of error
codes, it does not require immediate action. Clear the problems when the module is powered off.

Module Type LED Indicator Descriptions


ON: A serious error occurs in the module.
Error Type Blinking fast (every 0.2 seconds): unstable power supply or hardware Failure.
Blinking normally (every 0.5 second): system program errors or system cannot run.
CPU Blinking slowly (every one second and off for three seconds): a warning is
triggered, but the system can still run.
Warning Type
OFF: a warning is triggered, but the system can still run. You can modify the rules of
how a warning is triggered, or use the SM/SR to show the warnings.
7_
 Error Code Description Table

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly

000A Scan timeout Stop V

000C The program in the PLC is damaged. Stop V


0010 The access to the memory in the CPU is denied. Stop V
0011 The PLC ID is incorrect. Continue V
0012 The PLC password is incorrect. Continue V
0026 RTC cannot keep track of the current time Continue V
24VDC power supply is not sufficient and then is
002A Continue V
recovered from low-voltage for less than 10 ms.
002D The PLC maximum password attempts exceeded. Continue V

7-19
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly
The access to the external memory of the CPU is
002E Stop V
denied.
PLC programs are not consistent with the system
002F Stop V
logs.
The memories in the latched special auxiliary relays
0050 Continue V
are abnormal.
0051 The latched special data registers are abnormal. Continue V
The memories in the latched auxiliary relays are
0052 Continue V
abnormal.
0054 The latched counters are abnormal. Continue V
0055 The latched 32-bit counters are abnormal. Continue V
0056 The latched special auxiliary relay is abnormal. Continue V
0059 The latched data registers are abnormal. Continue V
005D The CPU module does not detect a memory card. Continue V
005E The memory card is initialized incorrectly. Continue V
An error occurs when data is written to the memory
0063 Continue V
card.
0064 A file in the memory card cannot be read. Continue V
0102 The interrupt number exceeds the range. Stop V
0202 The MC instruction exceeds the range. Stop V
0302 The MCR instruction exceeds the range. Stop V
The operands used in DHSCS are not used
0D03 Stop V
properly.
The operands HCXXX used in DCNT are not used
0E05 Stop V
properly.
The number of DI/DO module input and output
140F Stop V
points exceeds the range.
_7 1410
~ The right-side module cannot be detected. Stop V
1413
The number of modules powered is inconsistent
1414 Stop V
with the number checked.
Initialization error on the left-side modules
1420 Stop V
(The number of left-side modules exceeds 8 units.)
1421
~ The communication timeout occurs in the left-side
Stop V
module or the model name is incorrect.
1424
1425 Memory detection error on the left-side module. Stop V
1900
Heartbeat errors occurred in the slave in the
- Continue V
CANopen/EtherCAT communication mode.
191C
The initialization of the Delta ASD-A2 control has
1950 not yet been completed, the CANopen instructions Continue V
cannot be executed.

7-20
C h a p t e r 7 Tr o u b l e s h o o t i n g

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly

19B0 Heartbeat timeout occurred in the slave mode Continue V

The data length of PDO (process data object) in the


19B1 Continue V
slave mode is not matched with the setting.

The data length of PDO (process data object) in the


slave mode is not matched with the setting of the
scan list.
19E1 Continue V
Refer to CANopen communication related
descriptions in AS Series Operation Manual for
more details on the error codes 19E1 to 19E8.

19E2 PDO in the slave mode is not received. Continue V

The function of auto downloading SDO fails at the


19E3 Continue V
first startup.

19E4 PDO configurations are set incorrectly. Continue V

The main settings are not consistent


19E5 Continue V
with the connected slave.

19E6 This slave does NOT exist in this network. Continue V

19E7 Timeout on the slave error control Continue V

19E8 The node IDs of master and slave are duplicated. Continue V

19F3 Error in the configuration Continue V

19F4 CANopen communication is in the BUS-OFF state. Continue V


7_
19FB The sending registers exceed the range. Continue V

19FC The receiving registers exceed the range. Continue V

Not in the right mode for the ASDA-A2 while using


2001 Continue V
the CANopen communication instruction.

The device used in the program exceeds the device


2003 Continue V
range.
200A Invalid instruction Stop V
The operand n or the other constant operands K/H
200B Continue V
exceed the range.
200C The operands overlap. Continue V
The binary to binary-coded decimal conversion is
200D Continue V
incorrect.
200E The string does not end with 00. Continue V
2012 Incorrect division operation Continue V

7-21
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly
The value exceeds the range of values which can
2013 Continue V
be represented by the floating-point numbers.
The task designated by the TKON or YKOFF
2014 Continue V
instruction is incorrect, or exceeds the range.
The instruction BREAK is written outside of the
2017 Continue V
FOR-NEXT loop.
No such position planning table number or the
2027 Continue V
format is incorrect.
The high speed output instruction is being
2028 executed. Only one instruction can be executed at a Continue V
time.
6004 The IP address filter is set incorrectly. Continue V
600D RJ45 port is not connected. Continue V
The number of the MODBUS TCP connections
6010 Continue V
exceeds the range.
The number of the EtherNet/IP connections
6011 Continue V
exceeds the range.
6012 There are devices using the same IP address. Continue V
6100 The email connection is busy. Continue V
The trigger attachment mode in the email is set
6103 Continue V
incorrectly.
6104 The attachment in the email does not exist. Continue V
6105 The attachment in the email is too big. Continue V
6106 There is an SMTP server response timeout. Continue V
6107 There is an SMTP server response timeout. Continue V
6108 SMTP verification failed Continue V
The remote communication IP address set in the
6200 Continue V
TCP socket function is illegal.
_7 The local communication port set in the TCP socket
6201 Continue V
function is illegal.
The remote communication port set in the TCP
6202 Continue V
socket function is illegal.
The device from which the data is sent in the TCP
6203 Continue V
socket function is illegal.
The device that receives the data in the TCP socket
6206 Continue V
function is illegal.
The data that is received through the TCP socket
6208 Continue V
exceeds the device range.
The remote communication IP address set in the
6209 Continue V
UDP socket function is illegal.
The local communication port set in the UDP socket
620A Continue V
function is illegal.
The device from which the data is sent in the UDP
620C Continue V
socket function is illegal.

7-22
C h a p t e r 7 Tr o u b l e s h o o t i n g

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly
The device that receives the data in the UDP socket
620F Continue V
function is illegal.
The data that is received through the UDP socket
6210 Continue V
exceeds the device range.
There is no response from the remote device after
6212 Continue V
the timeout period.
6213 The data received exceeds the limit. Continue V
6214 The remote device refuses the connection. Continue V
6215 The socket is not opened. Continue V
6217 The socket is opened. Continue V
6218 The data has been sent through the socket. Continue V
6219 The data has been received through the socket. Continue V
621A The socket is closed. Continue V
The device communication function code in COM1
7011 Continue V
is incorrect.
The device communication address used in COM1
7012 Continue V
is incorrect.
The device used in COM1 exceeds the device
7013 Continue V
range.
The device length of the communication data in
7014 Continue V
COM1 exceeds the limit.
The device checksum for the communication serial
7017 Continue V
port of COM1 is incorrect.
The device communication function code in COM2
7021 Continue V
is incorrect.
The device communication address used in COM2
7022 Continue V
is incorrect.
The device used in COM2 exceeds the device
7023
range.
Continue V 7_
The device length of the communication data in
7024 Continue V
COM2 exceeds the limit.
The device checksum for the communication serial
7027 Continue V
port of COM2 is incorrect.
The device communication function code in
7031 Continue V
Ethernet is incorrect.
The device communication address used in
7032 Continue V
Ethernet is incorrect.
The device used in Ethernet exceeds the device
7033 Continue V
range.
The device length of the communication data in
7034 Continue V
Ethernet exceeds the limit.
The device checksum for the communication serial
7037 Continue V
port of Ethernet is incorrect.
The device communication function code in USB is
7041 Continue V
incorrect.

7-23
D V P - E S 3 / E X3 / S V 3 / S X3 S e r i e s P r o g r a m m i n g M a n u a l

ERROR LED indicator status


Error CPU
Description
code status Blinking Blinking Blinking
ON OFF
fast normally slowly
The device communication address used in USB is
7042 Continue V
incorrect.
7043 The device used in USB exceeds the device range. Continue V
The device length of the communication data in
7044 Continue V
USB exceeds the limit.
The device checksum for the communication serial
7047 Continue V
port of USB is incorrect.
7203 Invalid communication function code Continue V
The contents of the downloaded program are
8105 incorrect. Continue V
The program syntax is incorrect.
The contents of the downloaded program are
8106 incorrect. Continue V
The length of the execution code exceeds the limit.
The contents of the downloaded program are
8107 incorrect. Continue V
The length of the source code exceeds the limit.
8000
- Errors occur between software and PLC. Continue V
8FFF
C000
- The program syntax is incorrect. Stop V
CFFF

_7

7-24
Industrial Automation Headquarters
Delta Electronics, Inc.
Taoyuan Technology Center
No.18, Xinglong Rd., Taoyuan District,
Taoyuan City 330477, Taiwan
TEL: +886-3-362-6301 / FAX: +886-3-371-6301

Asia EMEA
Delta Electronics (Shanghai) Co., Ltd. Delta Electronics (Netherlands) B.V.
No.182 Minyu Rd., Pudong Shanghai, P.R.C. Sales: [email protected]
Post code : 201209 Marketing: [email protected]
TEL: +86-21-6872-3988 / FAX: +86-21-6872-3996 Technical Support: [email protected]
Customer Service: 400-820-9595 Customer Support: [email protected]
Service: [email protected]
Delta Electronics (Japan), Inc. TEL: +31(0)40 800 3900
Industrial Automation Sales Department
2-1-14 Shibadaimon, Minato-ku Delta Electronics (Netherlands) B.V.
Tokyo, Japan 105-0012 Automotive Campus 260, 5708 JZ Helmond, The Netherlands
TEL: +81-3-5733-1155 / FAX: +81-3-5733-1255 Mail: [email protected]
TEL: +31(0)40 800 3900
Delta Electronics (Korea), Inc. Delta Electronics (Netherlands) B.V.
1511, 219, Gasan Digital 1-Ro., Geumcheon-gu,
Coesterweg 45, D-59494 Soest, Germany
Seoul, 08501 South Korea
Mail: [email protected]
TEL: +82-2-515-5305 / FAX: +82-2-515-5302
TEL: +49 2921 987 238
Delta Energy Systems (Singapore) Pte Ltd. Delta Electronics (France) S.A.
4 Kaki Bukit Avenue 1, #05-04, Singapore 417939 ZI du bois Challand 2, 15 rue des Pyrénées,
TEL: +65-6747-5155 / FAX: +65-6744-9228 Lisses, 91090 Evry Cedex, France
Mail: [email protected]
Delta Electronics (India) Pvt. Ltd. TEL: +33(0)1 69 77 82 60
Plot No.43, Sector 35, HSIIDC Gurgaon,
PIN 122001, Haryana, India Delta Electronics Solutions (Spain) S.L.U
TEL: +91-124-4874900 / FAX: +91-124-4874945 Ctra. De Villaverde a Vallecas, 265 1º Dcha Ed.
Hormigueras – P.I. de Vallecas 28031 Madrid
Delta Electronics (Thailand) PCL. TEL: +34(0)91 223 74 20
909 Soi 9, Moo 4, Bangpoo Industrial Estate (E.P.Z), Carrer Llacuna 166, 08018 Barcelona, Spain
Pattana 1 Rd., T.Phraksa, A.Muang, Mail: [email protected]
Samutprakarn 10280, Thailand
TEL: +66-2709-2800 / FAX: +66-2709-2827 Delta Electronics (Italy) S.r.l.
Via Meda 2–22060 Novedrate(CO)
Delta Electronics (Australia) Pty Ltd. Piazza Grazioli 18 00186 Roma Italy
Unit 2, Building A, 18-24 Ricketts Road, Mail: [email protected]
Mount Waverley, Victoria 3149 Australia TEL: +39 039 8900365
Mail: [email protected]
Delta Greentech Elektronik San. Ltd. Sti. (Turkey)
TEL: +61-1300-335-823 / +61-3-9543-3720
Şerifali Mah. Hendem Cad. Kule Sok. No:16-A
34775 Ümraniye – İstanbul
Americas Mail: [email protected]
TEL: + 90 216 499 9910
Delta Electronics (Americas) Ltd.
5101 Davis Drive, Research Triangle Park, NC 27709, U.S.A. Eltek Dubai (Eltek MEA DMCC)
TEL: +1-919-767-3813 OFFICE 2504, 25th Floor, Saba Tower 1,
Jumeirah Lakes Towers, Dubai, UAE
Delta Electronics Brazil Ltd. Mail: [email protected]
Estrada Velha Rio-São Paulo, 5300 Eugênio de TEL: +971(0)4 2690148
Melo - São José dos Campos CEP: 12247-004 - SP - Brazil
TEL: +55-12-3932-2300 / FAX: +55-12-3932-237

Delta Electronics International Mexico S.A. de C.V.


Gustavo Baz No. 309 Edificio E PB 103
Colonia La Loma, CP 54060
Tlalnepantla, Estado de México
TEL: +52-55-3603-9200

*We reserve the right to change the information in this manual without prior notice. DVP-0289720-06
2024/08/31

You might also like