Delta AS Series Programming Manual
Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

Industrial Automation Headquarters
Taiwan: Delta Electronics, Inc.
Taoyuan Technology Center
No.18, Xinglong Rd., Taoyuan District,
Taoyuan City 33068, Taiwan
TEL: +886-3-362-6301 / FAX: +886-3-371-6301
Asia
China: Delta Electronics ( Shanghai ) Co., Ltd.
No.182 Minyu Rd., Pudong Shanghai, P.R.C.
Post code : 201209
TEL: +86-21-6872-3988 / FAX: +86-21-6872-3996
Customer Service: 400-820-9595
Japan: Delta Electronics ( Japan ) , Inc.
Industrial Automation Sales Department
2-1-14 Shibadaimon, Minato-ku
Tokyo, Japan 105-0012
TEL: +81-3-5733-1155 / FAX: +81-3-5733-1255
Korea: Delta Electronics ( Korea ) , Inc.
1511, 219, Gasan Digital 1-Ro., Geumcheon-gu,
Seoul, 08501 South Korea
TEL: +82-2-515-5305 / FAX: +82-2-515-5302
Singapore: Delta Energy Systems ( Singapore ) Pte Ltd.
4 Kaki Bukit Avenue 1, #05-04, Singapore 417939
TEL: +65-6747-5155 / FAX: +65-6744-9228
India: Delta Electronics ( India ) Pvt. Ltd.
Plot No.43, Sector 35, HSIIDC Gurgaon,
PIN 122001, Haryana, India
TEL: +91-124-4874900 / FAX: +91-124-4874945
Thailand: Delta Electronics ( Thailand ) PCL.
909 Soi 9, Moo 4, Bangpoo Industrial Estate ( E.P.Z ) ,
Pattana 1 Rd., T.Phraksa, A.Muang,
Samutprakarn 10280, Thailand
TEL: +66-2709-2800 / FAX: +66-2709-2827
Australia: Delta Electronics ( Australia ) Pty Ltd.
Unit 20-21/45 Normanby Rd., Notting Hill Vic 3168, Australia
TEL: +61-3-9543-3720
Americas
USA: Delta Electronics ( Americas ) Ltd.
5101 Davis Drive, Research Triangle Park, NC 27709, U.S.A.
TEL: +1-919-767-3813 / FAX: +1-919-767-3969
Brazil: Delta Electronics Brazil
Rua Itapeva, 26 - 3°, andar Edificio Itapeva,
One - Bela Vista 01332-000 - São Paulo - SP - Brazil
TEL: +55-12-3932-2300 / FAX: +55-12-3932-237
Mexico: 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 catalogue without prior notice.
EMEA
EMEA Headquarters: Delta Electronics ( Netherlands ) B.V.
Sales: Sales.IA.EMEA@deltaww.com
Marketing: Marketing.IA.EMEA@deltaww.com
Technical Support: iatechnicalsupport@deltaww.com
Customer Support: Customer-Support@deltaww.com
Service: Service.IA.emea@deltaww.com
TEL: +31 ( 0 ) 40 800 3900
BENELUX: Delta Electronics ( Netherlands ) B.V.
Automotive Campus 260, 5708 JZ Helmond, The Netherlands
Mail: Sales.IA.Benelux@deltaww.com
TEL: +31 ( 0 ) 40 800 3900
DACH: Delta Electronics ( Netherlands ) B.V.
Coesterweg 45, D-59494 Soest, Germany
Mail: Sales.IA.DACH@deltaww.com
TEL: +49 ( 0 ) 2921 987 0
France: Delta Electronics ( France ) S.A.
ZI du bois Challand 2, 15 rue des Pyrénées,
Lisses, 91090 Evry Cedex, France
Mail: Sales.IA.FR@deltaww.com
TEL: +33 ( 0 ) 1 69 77 82 60
Iberia: Delta Electronics Solutions ( Spain ) S.L.U
Ctra. De Villaverde a Vallecas, 265 1º Dcha Ed.
Hormigueras – P.I. de Vallecas 28031 Madrid
TEL: +34 ( 0 ) 91 223 74 20
Carrer Llacuna 166, 08018 Barcelona, Spain
Mail: Sales.IA.Iberia@deltaww.com
Italy: Delta Electronics ( Italy ) S.r.l.
Via Meda 2–22060 Novedrate ( CO )
Piazza Grazioli 18 00186 Roma Italy
Mail: Sales.IA.Italy@deltaww.com
TEL: +39 039 8900365
Russia: Delta Energy System LLC
Vereyskaya Plaza II, office 112 Vereyskaya str.
17 121357 Moscow Russia
Mail: Sales.IA.RU@deltaww.com
TEL: +7 495 644 3240
Turkey: Delta Greentech Elektronik San. Ltd. Sti. ( Turkey )
Şerifali Mah. Hendem Cad. Kule Sok. No:16-A
34775 Ümraniye – İstanbul
Mail: Sales.IA.Turkey@deltaww.com
TEL: + 90 216 499 9910
MEA: Eltek Dubai ( Eltek MEA DMCC )
OFFICE 2504, 25th Floor, Saba Tower 1,
Jumeirah Lakes Towers, Dubai, UAE
Mail: Sales.IA.MEA@deltaww.com
TEL: +971 ( 0 ) 4 2690148
AS-0249720-08
2021/06/24
AS Series
Programming Manual
www.deltaww.com

Advertisement

Table of Contents
loading

Summary of Contents for Delta AS Series

  • Page 1 5101 Davis Drive, Research Triangle Park, NC 27709, U.S.A. TEL: +7 495 644 3240 TEL: +1-919-767-3813 / FAX: +1-919-767-3969 Turkey: Delta Greentech Elektronik San. Ltd. Sti. ( Turkey ) Brazil: Delta Electronics Brazil Şerifali Mah. Hendem Cad. Kule Sok. No:16-A Rua Itapeva, 26 - 3°, andar Edificio Itapeva,...
  • Page 2 AS Series Programming Manual Revision History Ve r s i o n R e v i s i o n D a t e T h e f i r s t v e r s i o n w a s p u b l i s h e d .
  • Page 3 Ve r s i o n R e v i s i o n D a t e i n s e c t i o n 1 . 1 . 2 M o d e l D e s c r i p t i o n . 2 .
  • Page 4 1 . U p d a t e d d e s c r i p t i o n o n A S 3 0 0 , A S 2 0 0 , A S 0 2 , 0 4 P U - A i n S e c t i o n 1 .
  • Page 5 1 . A d d e d n e w p r o d u c t i n f o r m a t i o n A S - P S 0 3 C , A S - AT X B a n d u p d a t e d p r o d u c t i n f o r m a t i o n A S - F E N 0 2 , A S - F P F N 0 2 , A S - F O P C 0 2 i n C h a p t e r 1 .
  • Page 6: Table Of Contents

    AS Series Programming Manual Table of Contents Chapter 1 Introduction 1.1 Overview ....................1-2 1.1.1 Related Manuals ................1-2 1.1.2 Model Description ................. 1-2 1.2 Software ....................1-10 1.2.1 Program Editor ................1-10 1.2.2 Program Organization Units and Tasks..........1-12 Chapter 2 Devices 2.1 Introduction to Devices .................
  • Page 7 Chapter 3 Instruction Tables Types of Instructions ................ 3-2 3.1.1 Basic Instructions ................. 3-2 3.1.2 Applied Instructions ..............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 ................
  • Page 8 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-47 6.3 Data Conversion Instructions ..............
  • Page 9 6.12.2 Explanation of Shift Instructions............6-311 6.13 Data Processing Instructions............6-352 6.13.1 List of Data Processing Instructions ..........6-352 6.13.2 Explanation of Data Processing Instructions ........6-353 6.14 Structure Creation Instructions ............6-418 6.14.1 List of Structure Creation Instructions ..........6-418 6.14.2 Explanation of Structure Creation Instructions........
  • Page 10 6.27 Delta CANopen Communication Instructions ........6-992 6.27.1 List of Delta CANopen Communication Instructions......6-992 6.27.2 Explanation of Delta CANopen Communication Instructions ....6-993 6.27.3 Frequently asked questions in Delta special CANopen communication and Troubleshooting ................6-1062 Chapter 7 Troubleshooting Troubleshooting ................
  • Page 11 7.3.4 Troubleshooting for the Load Cell Module AS02LC......7-20 7.3.5 Troubleshooting for the Module AS04SIL IO-Link as a Communication Module ..................7-21 7.3.6 Troubleshooting for the Module AS00SCM as a Communication Module 7-24 7.3.7 Troubleshooting for the Module AS00SCM as a Remote Module ..7-25 7.3.8 Troubleshooting for AS01DNET Modules ..........
  • Page 12 Chapter 1 Introduction Table of Contents 1.1 Overview ....................1-2 1.1.1 Related Manuals ................1-2 1.1.2 Model Description ................. 1-2 1.2 Software ....................1-10 1.2.1 Program Editor ................1-10 1.2.2 Program Organization Units and Tasks ........... 1-12 1 - 1...
  • Page 13: Overview

     ISPSoft User Manual This introduces the ISPSoft software that you use to program the AS Series programmable logic controllers. It describes the programming languages (ladder diagrams, instruction lists, sequential function charts, function block diagrams, and structured texts), the concept of POUs, and the concept of tasks.
  • Page 14 Cha p ter 1 In tr od ucti on Classification Model Name Description Ethernet port, 2x RS-485 ports, 1x USB port, 1x Micro SD interface, 2x function cards (optional), supporting 24 I/Os (12DI+12DO) and up to 1016 I/Os. Program capacity:128K steps, high-density terminal blocks CPU module, 24VDC power input, PNP output, 1x Ethernet port , 2x RS-485 ports, 1x USB port, 1x Micro SD interface, 2x function cards...
  • Page 15 AS Ser ies Pro gra mm in g M anu al Classification Model Name Description I/Os. Program capacity: 64K steps, removable terminal blocks CPU module, 100-240 VAC power input, Relay output, 1x Ethernet port , 2x RS-485 ports, 1x USB port, 1x Micro SD interface, CAN AS132R-A communication port, supporting 32 I/Os (16DI+16DO) and up to 1024 I/Os.
  • Page 16 Cha p ter 1 In tr od ucti on Classification Model Name Description Spring-clamp terminal block 24VDC AS16AM10N-A 16 inputs Spring-clamp terminal block 5 - 30VDC 0.5A/output, 4A/COM AS16AN01P-A 16 outputs Sourcing output Spring-clamp terminal block 240VAC/24VDC 2A/output, 8A/COM AS16AN01R-A 16 outputs Relay Spring-clamp terminal block...
  • Page 17 AS Ser ies Pro gra mm in g M anu al Classification Model Name Description MIL connector 5 - 30VDC 0.1A/output, 3.2A/COM AS32AN02T-A 32 outputs Sinking output MIL connector 24VDC 3.2mA AS64AM10N-A 64 inputs MIL connector 5 - 30VDC 0.1A/output, 3.2A/COM AS64AN02T-A 64 outputs Sinking output...
  • Page 18 AS-FCOPM AS00SCM-A Remote I/O For AS-FEN02 function cards module AS-FEN02 DeviceNet remote IO slave, its right side connects with AS Series AS01DNET-A (RTU) extension modules, including digital modules, analog modules, temperature modules, etc. Function cards AS-F232 Serial communication port, RS232, functioning as master or slave...
  • Page 19 Description AS-F422 Serial communication port, RS422, functioning as master or slave AS-F485 Serial communication port, RS485, functioning as master or slave CANopen communication port, supporting DS301, AS series remote AS-FCOPM modules and Delta servo systems 2-channel analog input AS-F2AD 0-10V (12 bits), 4-20mA (11 bits)
  • Page 20 CANopen communication cable, use for AS-FCOPM series (10M) UC-CMC200-01A CANopen communication cable, use for AS-FCOPM series (20M) UC-EMC003-02A Ethernet communication cable, use for AS Series CPU modules, AS- (0.3M) FEN02 and AS-FPFN02 function cards. UC-EMC005-02A Ethernet communication cable, use for AS Series CPU modules, AS- (0.5M) FEN02 and AS-FPFN02 function cards.
  • Page 21: Software

    AS Ser ies Pro gra mm in g M anu al 1.2 Software 1.2.1 Program Editor The section describes the program editor ISPSoft.  There are four types of programming languages: structure text (ST), ladder diagram (LD), sequential function chart (SFC), and continuous function chart (CFC).
  • Page 22 Cha p ter 1 In tr od ucti on  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.  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.
  • Page 23: Program Organization Units And Tasks

    AS Ser ies Pro gra mm in g M anu al 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.
  • Page 24: Chapter 2 Devices

    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.
  • Page 25: Introduction To Devices

    1–31 characters *1: Constants are indicated by K in the device lists in Chapter 5 and Chapter 6 in the AS Series Programming Manual. For example, when “K50” appears in the AS programming manual, enter only the number 50 in ISPSoft.
  • Page 26: Basic Structure Of I/O Storage

    Cha p ter 2 De vices *3: Strings are indicated by $ in Chapter 5 and Chapter 6 in the AS Series Programming Manual, but they are represented by quotes (“ ”) in ISPSoft. For example, for the string of 1234, enter “1234” in ISPSoft.
  • Page 27: Latched Areas In The Device Range

    AS Ser ies Pro gra mm in g M anu al Device type Non-latched area Latched area Other Other Device Y File register PLC action devices devices (All non-latched areas are cleared.) SM205 is ON.* Retained Retained Retained Cleared (All latched areas are cleared.) *1: For more on setting the states, see HWCONFIG in ISPSoft.
  • Page 28: Device Functions

    Cha p ter 2 De vices 2.2. Device Functions The following flow chart shows the procedure for processing a program in the PLC.  Regenerating the input signal Before the program is executed, the state of the Input ter minal X external input signal is read into the memory location for the input signal.
  • Page 29 AS Ser ies Pro gra mm in g M anu al The PLC uses four types of values to execute the operation according to different control purposes. Binary number (BIN) The PLC uses the binary system to operate on the values. Decimal number (DEC) The PLC uses decimal numbers for: ...
  • Page 30: Floating-Point Numbers

    , and correspond to the range between ±1.1755×10 to ±3.4028×10 The AS Series PLC uses two consecutive registers for a 32-bit floating-point number. Take (D1, D0) for example. D1 (b 15 ~b 0) D0 (b 15 ~b 0) E0 A22 A21 A20...
  • Page 31: Decimal Floating-Point Numbers

    AS Ser ies Pro gra mm in g M anu al 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 01110000000000000000000 =C1B80000 2.2.2.2 Decimal Floating-point Numbers...
  • Page 32: Input Relays (X)

    Cha p ter 2 De vices The string has an odd number of characters. 16#62 (b) 16#61 (a) 16#64 (d) 16#63 (b) 0 (NULL) 16#65 (e) *1: ASCII code chart           ...
  • Page 33: Output Relays (Y)

    AS Ser ies Pro gra mm in g M anu al  Input type Inputs are classified into two types. Regenerated inputs: The PLC reads the state of a regenerated input before the program is executed; for example, LD X0.0. Direct input: The state of a direct input is read by the PLC during the execution of the instructions;...
  • Page 34: Special Auxiliary Relays (Sm)

    Cha p ter 2 De vices 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 “*”, users can refer to the additional remarks on special auxiliary relays/special data registers.
  • Page 35 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error during receiving data through Function Card ○ 1 when using the MODRW instruction or the RS SM82 – instruction. Error during receiving data through Function Card ○...
  • Page 36 Cha p ter 2 De vices STOP    Function STOP 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 – – ON: 8-bit processing mode OFF: 16-bit processing mode I200 high-speed comparison interrupt for DPLSY ○...
  • Page 37 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP I243 high-speed comparison interrupt for DPLSY ○ ○ *SM139 – to temporarily store output parameters I250 high-speed comparison interrupt for DPLSY ○ ○ *SM140 –...
  • Page 38 Cha p ter 2 De vices STOP    Function STOP Choice made by COM2 between the ASCII mode and the RTU mode ○ ○ *SM212 – – – ON: RTU mode OFF: ASCII mode ○ ○ SM215 Running state of the PLC ○...
  • Page 39 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP setting when Power On”, use this flag to activate the 10 module on the right-side of the CPU module. When selecting “Manual + Flags” in “I/O allocation setting when Power On”, use this flag to activate ○...
  • Page 40 Cha p ter 2 De vices STOP    Function STOP When selecting “Manual + Flags” in “I/O allocation setting when Power On”, use this flag to activate ○ ○ – – – Y R/W *SM251 the 22 module on the right-side of the CPU module.
  • Page 41 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP (X0.2/X0.3) Reversing the input direction for MPG 3 flag ○ ○ SM272 – (X0.4/X0.5) Reversing the input direction for MPG 4 flag ○ ○...
  • Page 42 Cha p ter 2 De vices STOP    Function STOP Setting counting mode for HC204. ○ ○ SM304 – HC204 counts down when SM304 is ON. Setting counting mode for HC205. ○ ○ SM305 – – HC205 counts down when SM305 is ON. Setting counting mode for HC206.
  • Page 43 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP HC233 counts down when SM333 is ON. Setting counting mode for HC234. ○ ○ SM334 – – HC234 counts down when SM334 is ON. Setting counting mode for HC235.
  • Page 44 Cha p ter 2 De vices STOP    Function STOP I201 high-speed comparison interrupt for DPLSY ○ ○ – *SM361 to activate output I202 high-speed comparison interrupt for DPLSY ○ ○ – *SM362 to activate output I203 high-speed comparison interrupt for DPLSY ○...
  • Page 45 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP I253 high-speed comparison interrupt for DPLSY ○ ○ – *SM383 to activate output I260 high-speed comparison interrupt for DPLSY ○ ○ – *SM384 to activate output I261 high-speed comparison interrupt for DPLSY ○...
  • Page 46 Cha p ter 2 De vices STOP    Function STOP Error during the operation of the memory card. ○ ○ ON: an error occurs. *SM453 – – OFF: no error. Enabling/disabling the data logger. ○ ○ SM454 ON: enable –...
  • Page 47 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ SM480 Outputting Y0.2/axis 2 (Y0.2/Y0.3). – ○ ○ SM481 Y0.2/axis 2 (Y0.2/Y0.3) output is complete. – ○ ○ SM482 Reversing the output direction of axis 2 (Y0.3) –...
  • Page 48 Cha p ter 2 De vices STOP    Function STOP Enabling fixed slope ramp-up/down on axis 3 ○ ○ SM509 – (Y0.4/Y0.5) Auto-reset when Y0.4/axis 3 (Y0.4/Y0.5) output is ○ ○ SM510 – complete. Executing an interrupt I502 when pulse output ○...
  • Page 49 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Output immediately stops when the instruction is ○ ○ *SM537 – disabled or stops for Y0.7. Change the target positon while outputting ○ ○...
  • Page 50 Cha p ter 2 De vices STOP    Function STOP Enabling the hardware negative limit on axis 6 ○ ○ SM566 – – – (Y0.10/Y0.11). Alarm: exceeding the negative limit on axis 6 ○ ○ SM567 – (Y0.10/Y0.11). Enabling fixed slope ramp-up/down on axis 6 ○...
  • Page 51 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP instruction. 8-bit or 16-bit working mode. ○ ○ ON: 8-bit SM606 – – OFF: 16-bit Matrix comparison flag. ○ ○ SM607 ON: Comparing equivalent values. –...
  • Page 52 Cha p ter 2 De vices STOP    Function STOP Setting counting mode for HC6. ○ ○ SM627 – – HC6 counts down when SM627 is ON. Setting counting mode for HC7. ○ ○ SM628 – – HC7 counts down when SM628 is ON. Setting counting mode for HC8.
  • Page 53 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP HC27 counts down when SM648 is ON. Setting counting mode for HC28. ○ ○ SM649 – – HC28 counts down when SM649 is ON. Setting counting mode for HC29.
  • Page 54 Cha p ter 2 De vices STOP    Function STOP Setting counting mode for HC49. ○ ○ SM670 – – HC49 counts down when SM670 is ON. Setting counting mode for HC50. ○ ○ SM671 – – HC50 counts down when SM671 is ON. Setting counting mode for HC51.
  • Page 55 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP After the execution of the DSW instruction is ○ ○ SM694 – – complete, SM694 is ON for a scan cycle. Radian/degree flag. ○...
  • Page 56 Cha p ter 2 De vices STOP    Function STOP Connection 19 for data exchange through COM1 ○ ○ *SM770 – – started Connection 20 for data exchange through COM1 ○ ○ *SM771 – – started Connection 21 for data exchange through COM1 ○...
  • Page 57 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Successful data exchange connection 10 through ○ ○ *SM793 – – COM1 Successful data exchange connection 11 through ○ ○ *SM794 – – COM1 Successful data exchange connection 12 through ○...
  • Page 58 Cha p ter 2 De vices STOP    Function STOP Error in data exchange connection 1 through ○ ○ *SM816 – – COM1 Error in data exchange connection 2 through ○ ○ *SM817 – – COM1 Error in data exchange connection 3 through ○...
  • Page 59 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 24 through ○ ○ *SM839 – – COM1 Error in data exchange connection 25 through ○ ○ *SM840 –...
  • Page 60 Cha p ter 2 De vices STOP    Function STOP Connection 13 for data exchange through COM2 ○ ○ *SM876 – – started Connection 14 for data exchange through COM2 ○ ○ *SM877 – – started Connection 15 for data exchange through COM2 ○...
  • Page 61 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Successful data exchange connection 4 through ○ ○ *SM899 – – COM2 Successful data exchange connection 5 through ○ ○ *SM900 – – COM2 Successful data exchange connection 6 through ○...
  • Page 62 Cha p ter 2 De vices STOP    Function STOP Successful data exchange connection 27 through ○ ○ *SM922 – – COM2 Successful data exchange connection 28 through ○ ○ *SM923 – – COM2 Successful data exchange connection 29 through ○...
  • Page 63 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 18 through ○ ○ *SM945 – – COM2 Error in data exchange connection 19 through ○ ○ *SM946 –...
  • Page 64 Cha p ter 2 De vices STOP    Function STOP ○ ○ SM988 AS remote module #13 connection status – – ○ ○ SM989 AS remote module #14 connection status – – ○ ○ SM990 AS remote module #15 connection status –...
  • Page 65 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP FEN02 Error in data exchange connection 4 through AS- ○ *SM1027 – – – FEN02 Error in data exchange connection 5 through AS- ○...
  • Page 66 Cha p ter 2 De vices STOP    Function STOP ON: Trigger 2 is triggered and the size of the ○ ○ – – *SM1134 attachment exceeds the limit. ON: Trigger 2 is triggered and the attachment is ○...
  • Page 67 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ *SM1166 Error in data exchange through Ethernet – – – ○ ○ *SM1167 Data exchange through Ethernet started – – Connection 1 for data exchange through Ethernet ○...
  • Page 68 Cha p ter 2 De vices STOP    Function STOP Connection 23 for data exchange through Ethernet ○ *SM1190 – – – started Connection 24 for data exchange through Ethernet ○ – – – *SM1191 started Connection 25 for data exchange through Ethernet ○...
  • Page 69 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Successful data exchange connection 14 through ○ ○ *SM1213 – – Ethernet Successful data exchange connection 15 through ○ ○ *SM1214 – – Ethernet Successful data exchange connection 16 through ○...
  • Page 70 Cha p ter 2 De vices STOP    Function STOP Error in data exchange connection 5 through ○ ○ *SM1236 – – Ethernet Error in data exchange connection 6 through ○ ○ *SM1237 – – Ethernet Error in data exchange connection 7 through ○...
  • Page 71 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 28 through ○ *SM1259 – – – Ethernet Error in data exchange connection 29 through ○ *SM1260 – –...
  • Page 72 Cha p ter 2 De vices STOP    Function STOP connected) ○ ○ SM1313 RTU-EN01 connection 2 status – – ○ ○ SM1314 RTU-EN01 connection 3 status – – ○ ○ SM1315 RTU-EN01 connection 4 status – – ○...
  • Page 73 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Connection 9 for data exchange through ○ ○ *SM1384 – – EtherNet/IP (Scanner) started Connection 10 for data exchange through ○ ○ *SM1385 –...
  • Page 74 Cha p ter 2 De vices STOP    Function STOP Connection 32 for data exchange through ○ *SM1407 – – – EtherNet/IP (Scanner) started Error in data exchange connection 1 through ○ ○ *SM1408 – – EtherNet/IP (Scanner) Error in data exchange connection 2 through ○...
  • Page 75 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 23 through ○ *SM1430 – – – EtherNet/IP (Scanner) Error in data exchange connection 24 through ○ *SM1431 –...
  • Page 76 ○ *SM1454 EtherNet/IP (Adapter) *SM1455 I/O connection 8 is established through ○ ○ EtherNet/IP (Adapter) Auto-reset the control over Delta servo axis 1 on ○ ○ – SM1581 the CAN bus. Auto-reset the control over Delta servo axis 2 on ○...
  • Page 77 ○ SM1648 Communication stops for Delta servo CAN axis 8 – ○ ○ SM1651 – Servo is ON for Delta servo CAN axis 1 ○ ○ SM1652 Servo is ON for Delta servo CAN axis 2 – ○ ○ SM1653 Servo is ON for Delta servo CAN axis 3 –...
  • Page 78 Cha p ter 2 De vices STOP    Function STOP ○ ○ SM1656 Servo is ON for Delta servo CAN axis 6 – ○ ○ SM1657 Servo is ON for Delta servo CAN axis 7 – ○ ○ SM1658 Servo is ON for Delta servo CAN axis 8 –...
  • Page 79 OFF: initialize a consecutive number of modules ○ ○ SM1686 – ON: initialize a specific module ○ ○ SM1691 Heartbeat error of Delta special CAN axis 1 – ○ ○ SM1692 Heartbeat error of Delta special CAN axis 2 – ○ ○...
  • Page 80 Cha p ter 2 De vices STOP    Function STOP Connection 6 for data exchange through Function *SM1717 ○ – – – Card 1 started Connection 7 for data exchange through Function *SM1718 ○ – – – Card 1 started Connection 8 for data exchange through Function *SM1719 ○...
  • Page 81 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Connection 29 for data exchange through Function *SM1740 ○ – – – Card 1 started Connection 30 for data exchange through Function *SM1741 ○...
  • Page 82 Cha p ter 2 De vices STOP    Function STOP Successful data exchange connection 20 through *SM1763 ○ – – – Function Card 1 Successful data exchange connection 21 through *SM1764 ○ – – – Function Card 1 Successful data exchange connection 22 through *SM1765 ○...
  • Page 83 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 11 through *SM1786 ○ – – – Function Card 1 Error in data exchange connection 12 through *SM1787 ○...
  • Page 84 Cha p ter 2 De vices STOP    Function STOP Data exchange through Function Card 2 enabled *SM1822 ○ – – by ISPSoft Connection 1 for data exchange through Function *SM1824 ○ – – – Card 2 started Connection 2 for data exchange through Function *SM1825 ○...
  • Page 85 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Connection 23 for data exchange through Function *SM1846 ○ – – – Card 2 started Connection 24 for data exchange through Function *SM1847 ○...
  • Page 86 Cha p ter 2 De vices STOP    Function STOP Successful data exchange connection 14 through *SM1869 ○ – – – Function Card 2 Successful data exchange connection 15 through *SM1870 ○ – – – Function Card 2 Successful data exchange connection 16 through *SM1871 ○...
  • Page 87 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 5 through *SM1892 ○ – – – Function Card 2 Error in data exchange connection 6 through *SM1893 ○...
  • Page 88: Refresh Time For Special Auxiliary Relays

    Cha p ter 2 De vices STOP    Function STOP Error in data exchange connection 28 through *SM1915 ○ – – – Function Card 2 Error in data exchange connection 29 through *SM1916 ○ – – – Function Card 2 Error in data exchange connection 30 through *SM1917 ○...
  • Page 89 AS Ser ies Pro gra mm in g M anu al Special auxiliary Refresh time relay to OFF automatically. You set it to ON to enable saving. ON: the system executes the communication task. After the communication task is complete, the SM76–SM77 system resets it to OFF automatically.
  • Page 90 Cha p ter 2 De vices Special auxiliary Refresh time relay OFF: the PLC stops. 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.
  • Page 91 AS Ser ies Pro gra mm in g M anu al Special auxiliary Refresh time relay 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...
  • Page 92 Cha p ter 2 De vices Special auxiliary Refresh time relay 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...
  • Page 93 AS Ser ies Pro gra mm in g M anu al Special auxiliary Refresh time relay SM486 You set the flag to ON or OFF. SM487 The system sets the flag to ON and you reset it to OFF. SM489–SM491 You set the flag to ON or OFF.
  • Page 94 Cha p ter 2 De vices Special auxiliary Refresh time relay SM569–SM569 You set the flag to ON or OFF. SM572 The system sets the flag to ON or OFF. SM573 The system sets the flag to ON and you reset it to OFF. SM574 You set the flag to ON or OFF.
  • Page 95 AS Ser ies Pro gra mm in g M anu al Special auxiliary Refresh time relay 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.
  • Page 96 Special auxiliary Refresh time relay SM1155 ON: the trigger is enabled and the attachment is not found. Retore parameters on Delta devices SM1160-SM1161 SM1166 After the data exchange parameters are downloaded, the system is refreshed. SM1167–SM1199 After the data exchange parameters are downloaded, you set the flag to ON or OFF.
  • Page 97: Timers (T)

    AS Ser ies Pro gra mm in g M anu al 2.2.10 Timers (T) This topic describes the timers available in ISPSoft. Refer to the ISPSoft User Manual for more information on timers.  100 millisecond timer: The timer specified by the TMR instruction takes 100 milliseconds as the timing unit. ...
  • Page 98 Cha p ter 2 De vices 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.
  • Page 99: Counters

    AS Ser ies Pro gra mm in g M anu al 2.2.11 Counters  Characteristics of the 16-bit counter Item 16-bit counter Type General type Number C0–C511 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.
  • Page 100 Cha p ter 2 De vices When X0.0=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. When X0.1 changes from OFF to ON, the value of the counter increments by one. 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).
  • Page 101: 32-Bit Counters (Hc)

    AS Ser ies Pro gra mm in g M anu al 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 Setting value -2,147,483,648 to +2,147,483,647...
  • Page 102 Cha p ter 2 De vices  32-bit high speed addition/subtraction counter Refer to the instruction description of API1004 DCNT in AS Series Programming Manual for more details. Example: X10.0 drives SM621 to determine the counting direction (up/down) for HC0.
  • Page 103: Data Registers (D)

    AS Ser ies Pro gra mm in g M anu al 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;...
  • Page 104: Special Data Registers (Sr)

    Cha p ter 2 De vices 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.
  • Page 105 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ *SR44 Error log 1: error code ○ ○ *SR45 Error log 1: year and the month ○ ○ *SR46 Error log 1: day and the hour ○...
  • Page 106 Cha p ter 2 De vices STOP    Function STOP ○ ○ *SR83 Error log 7: minute and the second ○ ○ *SR84 Error log 8: CPU or remote number ○ ○ *SR85 Error log 8: module ID ○...
  • Page 107 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ *SR122 Error log 14: error code ○ ○ *SR123 Error log 14: year and the month ○ ○ *SR124 Error log 14: day and the hour ○...
  • Page 108 Cha p ter 2 De vices STOP    Function STOP ○ ○ *SR161 Error log 20: minute and the second SR162 Length of time that the PLC is powered on (unit: minutes) ○ ○ (32-bit) SR163 ○ SR166 VR0 value (works with SM166) ○...
  • Page 109 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Frequency multiplication of the high speed counter ○ ○ SR193 group 4 (default: 1-time frequency) Frequency multiplication of the high speed counter ○ ○...
  • Page 110 Cha p ter 2 De vices STOP    Function STOP ○ ○ *SR233 Download log 2: action number ○ ○ *SR234 Download log 2: year and the month ○ ○ *SR235 Download log 2: day and the hour ○...
  • Page 111 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ *SR272 Download log 11: minute and the second ○ ○ *SR273 Download log 12: action number ○ ○ *SR274 Download log 12: year and the month ○...
  • Page 112 Cha p ter 2 De vices STOP    Function STOP ○ ○ *SR311 PLC status change log 1: action number ○ ○ *SR312 PLC status change log 1: year and the month ○ ○ *SR313 PLC status change log 1: day and the hour ○...
  • Page 113 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ *SR350 PLC status change log 10: minute and the second ○ ○ *SR351 PLC status change log 11: action number ○ ○...
  • Page 114 Cha p ter 2 De vices STOP    Function STOP ○ ○ *SR389 PLC status change log 20: day and the hour ○ ○ *SR390 PLC status change log 20: minute and the second ○ ○ *SR391 Real-time clock (RTC) year value: 00–99 (A.D.) ○...
  • Page 115 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ SR440 MAC address (Example: 12:34:56:78:9A:BC => SR440=16#1234, ○ ○ SR441 SR441=16#5678, SR442=16#9ABC) (Updates once, when the PLC is supplied with power) ○...
  • Page 116 Cha p ter 2 De vices STOP    Function STOP SR480 ○ ○ Y0.2/axis 2 (Y0.2/Y0.3) position (unit: number of pulse) SR481 ○ ○ SR482 Y0.2/axis 2 (Y0.2/Y0.3) output mode ○ ○ SR483 Y0.2/axis 2 (Y0.2/Y0.3) starting/ending frequency R/W 200 ○...
  • Page 117 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP SR514 ○ ○ Y0.5 position (unit: number of pulse) SR515 ○ ○ SR516 Y0.5 starting/ending frequency R/W 200 ○ ○ SR517 Y0.5 accelerating/decelerating time R/W 200 ○...
  • Page 118 Cha p ter 2 De vices STOP    Function STOP Y0.8/axis 5 (Y0.8/Y0.9) denominator value transferred ○ ○ SR549 from the machine unit SR550 Y0.8/axis 5 (Y0.8/Y0.9) position of the Machine unit ○ ○ (single-precision floating-point values) SR551 SR552 ○...
  • Page 119 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Axis 2 (Y0.2/Y0.3) positive limit in ISPSoft (unit: number of *SR585 pulse) *SR586 Axis 2 (Y0.2/Y0.3) negative limit in ISPSoft (unit: number ○ ○...
  • Page 120 Pulse number in deceleration from the latest position ○ ○ *SR655 output (higher 16 bits) The number of the Delta CANopen communication axis ○ ○ SR658 from the Delta servo which has a communication error ○ ○ SR659 Delta CANopen communication error 2 - 9 7...
  • Page 121 PR command of the Delta CANopen communication axis ○ ○ SR668 8 from the Delta servo Alarm code of the Delta CANopen communication axis 1 ○ ○ SR671 from the Delta servo Alarm code of the Delta CANopen communication axis 2 ○...
  • Page 122 Cha p ter 2 De vices STOP    Function STOP The DO state of the Delta CANopen communication axis ○ ○ SR687 7 from the Delta servo The DO state of the Delta CANopen communication axis ○ ○...
  • Page 123 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Current DI state of Delta CANopen communication ID 3 ○ ○ SR733 from the Delta servo Current DI state of Delta CANopen communication ID 4 ○...
  • Page 124 Current torque of Delta CANopen communication ID 28 ○ ○ SR778 from the Delta inverter (unit: 0.1%) Current DI state of Delta CANopen communication ID 21 ○ ○ SR781 from the Delta inverter Current DI state of Delta CANopen communication ID 22 ○...
  • Page 125 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Current DI state of Delta CANopen communication ID 27 ○ ○ SR787 from the Delta inverter Current DI state of Delta CANopen communication ID 28 ○...
  • Page 126 Cha p ter 2 De vices STOP    Function STOP axis 2 to complete positioning. The setting value for the Delta CANopen communication ○ ○ SR813 axis 3 to complete positioning. The setting value for the Delta CANopen communication ○ ○...
  • Page 127 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ ○ State of slave ID 13 in CANopen DS301 communication SR842 ○ ○ State of slave ID 14 in CANopen DS301 communication SR843 ○...
  • Page 128 Cha p ter 2 De vices STOP    Function STOP ○ ○ State of slave ID 52 in CANopen DS301 communication SR881 ○ ○ State of slave ID 53 in CANopen DS301 communication SR882 ○ ○ State of slave ID 54 in CANopen DS301 communication SR883 ○...
  • Page 129 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP ○ *SR1020 State of the EtherNet/IP connection 1 ○ ○ *SR1021 State of the EtherNet/IP connection 2 ○ ○ *SR1022 State of the EtherNet/IP connection 3 ○...
  • Page 130 Cha p ter 2 De vices STOP    Function STOP ○ ○ SR1059 Refresh time for the EtherNet/IP connection 8 ○ ○ SR1060 Refresh time for the EtherNet/IP connection 9 ○ ○ SR1061 Refresh time for the EtherNet/IP connection 10 ○...
  • Page 131 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Actual connection time for data exchange through the ○ ○ *SR1122 Ethernet connection 3 Actual connection time for data exchange through the ○ ○...
  • Page 132 Cha p ter 2 De vices STOP    Function STOP Actual connection time for data exchange through the ○ ○ *SR1144 Ethernet connection 25 Actual connection time for data exchange through the ○ ○ *SR1145 Ethernet connection 26 Actual connection time for data exchange through the ○...
  • Page 133 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP The error code for data exchange through the Ethernet ○ ○ *SR1166 connection 15 The error code for data exchange through the Ethernet ○...
  • Page 134 Cha p ter 2 De vices STOP    Function STOP Actual cycle time of connection 1–32 for data exchange ○ ○ *SR1335 through COM1 Number of the connection that is currently performing a ○ ○ *SR1336 cyclical data exchange through COM1 Error code for data exchange through the COM1 ○...
  • Page 135 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error code for data exchange through the COM1 ○ ○ *SR1360 connection 21 Error code for data exchange through the COM1 ○ ○ *SR1361 connection 22 Error code for data exchange through the COM1...
  • Page 136 Cha p ter 2 De vices STOP    Function STOP Error code for data exchange through the COM2 ○ ○ SR1388 connection 9 Error code for data exchange through the COM2 ○ ○ SR1389 connection 10 Error code for data exchange through the COM2 ○...
  • Page 137 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error code for data exchange through the COM2 ○ ○ SR1410 connection 31 Error code for data exchange through the COM2 ○ ○ SR1411 connection 32 Actual cycle time for data exchange through Function...
  • Page 138 Cha p ter 2 De vices STOP    Function STOP Error in data exchange connection 19 through Function ○ *SR1458 Card 1 Error in data exchange connection 20 through Function ○ *SR1459 Card 1 Error in data exchange connection 21 through Function ○...
  • Page 139 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Error in data exchange connection 7 through Function ○ *SR1486 Card 2 Error in data exchange connection 8 through Function ○ *SR1487 Card 2 Error in data exchange connection 9 through Function ○...
  • Page 140 Cha p ter 2 De vices STOP    Function STOP Error in data exchange connection 29 through Function ○ *SR1508 Card 2 Error in data exchange connection 30 through Function ○ *SR1509 Card 2 Error in data exchange connection 31 through Function ○...
  • Page 141 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Model code of the 1 right-side module connected to the ○ ○ *SR1561 CPU module or the remote module Model code of the 2 right-side module connected to the ○...
  • Page 142 Cha p ter 2 De vices STOP    Function STOP Model code of the 24 right-side module connected to the ○ ○ *SR1584 CPU module or the remote module Model code of the 25 right-side module connected to the ○...
  • Page 143 AS Ser ies Pro gra mm in g M anu al STOP    Function STOP Flag to define the frequency to compensate backlashes at ○ ○ *SR1700 Y0.0/Y0.1 for CSFO instruction (Hz) Flag to define the frequency to compensate backlashes at ○...
  • Page 144: Special Data Registers Refresh Conditions

    Cha p ter 2 De vices 2.2.15 Special Data Registers Refresh Conditions Special data Time to refresh register Refresh the register when there is a program execution error. SR0–SR2 Refresh the register when there is a grammar check error SR4–SR6 SR8–SR9 Refresh the register when there is a watchdog timer error.
  • Page 145 AS Ser ies Pro gra mm in g M anu al Special data Time to refresh register 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.
  • Page 146 Cha p ter 2 De vices Special data Time to refresh register SR556–SR557 Register is refreshed by you. Refresh the register whenever the high-speed output instruction is executed and the program is SR560 scanned. If the instruction is not executed, you can edit the settings. SR562–SR566 Register is refreshed by you.
  • Page 147 AS Ser ies Pro gra mm in g M anu al Special data Time to refresh register 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.
  • Page 148: Additional Remarks On Special Auxiliary Relays And Special Data Registers

    Cha p ter 2 De vices 2.2.16 Additional Remarks on Special Auxiliary Relays and Special Data Registers 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.
  • Page 149 AS Ser ies Pro gra mm in g M anu al  Analog-input error codes in SM27/SR27 When the conversion value in the analog input exceeding the allowable range or is encountered any connection lost, SM27 warning flag will be ON and the analog input error code will be stored in SR27. If the Input Warning in HWCONFIG is set to Enable, AS300 and AS200 Series CPU with FW V1.10.00 or later support this function.
  • Page 150 Cha p ter 2 De vices Function card: AS-F2AD Correponding Analog Input mode Remarks value range 1. Value > 4047 is seen as out of range Voltage: 0V ~ 10V 0 ~ 4000 2. No connection lost detection 1. Value < -24 or > 2023 is seenn as out of range Current 4mA ~ 20mA 0 ~ 2000 2.
  • Page 151 AS Ser ies Pro gra mm in g M anu al This table lists the corresponding functions and values of SR220–SR226 and SR391–SR397. Device Function Value Binary-coded Decimal decimal system system SR220 SR391 Year 00–99 (A.D.) SR221 SR392 Month 1–12 SR222 SR393 1–31...
  • Page 152 Cha p ter 2 De vices : Undefined 1010 (16#A) : Undefined 1011 (16#B) : Undefined 1100 (16#C) : Undefined 1101 (16#D) : Undefined 1110 (16#E) : 1111 (16#F) User-defined b8-b15 Undefined (reserved) *1: Refer to the HWCONFIG settings in ISPSoft for the user-defined baudrate. *2: Refer to section 6.19.3 for the use of communication flags and registers.
  • Page 153 AS Ser ies Pro gra mm in g M anu al Time when the error occurs Module Error Number Slot code Year Month Hour Minute Second SR60 SR63 High SR63 Low SR64 High SR64 Low SR65 High SR65 Low SR61 SR62 Low byte byte...
  • Page 154 Cha p ter 2 De vices 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. Number (HEX) Download action 0x0001...
  • Page 155 AS Ser ies Pro gra mm in g M anu al *Time when the download occurs Action number Year Month Hour Minute Second SR254 SR254 SR255 SR255 SR256 SR256 SR253 High byte Low byte High byte Low byte High byte Low byte SR258 SR258...
  • Page 156 Cha p ter 2 De vices The PLC status change log  SR309–SR390 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.
  • Page 157 AS Ser ies Pro gra mm in g M anu al *Time when the PLC status change occurs Action Number number Year Month Hour Minute Second High byte Low byte High byte Low byte High byte Low byte SR360 SR360 SR361 SR361 SR362...
  • Page 158 Cha p ter 2 De vices T he PLC r uns . SM400 SM401 SM402 SM403 Scan ti me 11. The initial clock pulse  SM404,SM405,SM406,SM407 The PLC provides seven types of clock pulses. When the PLC is powered on, the seven types of clock pulses act automatically.
  • Page 159 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 160 Cha p ter 2 De vices Device Function K5566 (backup) , it indicates backing up the PLC programs and parameters to the memory card. (the status and values of retainable devices are NOT included). Execute this backup when the PLC is in the Stop status.
  • Page 161 AS Ser ies Pro gra mm in g M anu al 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 CPU module with password restoring Backup file without password Not restoring...
  • Page 162  SR478, SR479, SR498, SR499, SR518, SR519, SR538, SR539, SR558, SR559, SR578, SR579 For AS series, up to 12 high-speed outputs (Y0.0-Y0.11) 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.
  • Page 163 AS Ser ies Pro gra mm in g M anu al SM/SR Function Action SR1002 For example: 255.255.255.0, SR1002 is 16#FFFF, and Ethernet netmask address (32-bit) SR1003 is FF00 SR1003 SR1004 For example: 192.168.1.1, SR1004 is 16#C0A8, and Ethernet gateway address (32-bit) SR1005 is 0101 SR1005 Unit: second;...
  • Page 164 Cha p ter 2 De vices Example: 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 Communication quality is good;...
  • Page 165 AS Ser ies Pro gra mm in g M anu al  SM1090, SM1091, SM1106-SM1109 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...
  • Page 166 Cha p ter 2 De vices 20. Flags and registers concerning data exchange  Flags for data exchange through COM1 connections Type Function SM750 Data exchange through COM1 enabled by ISPSoft. SM752–SM783 Connection 1–32 through COM1 for data exchange started. SM784–SM815 Data received through COM 1 connection 1–32 for data exchange.
  • Page 167 AS Ser ies Pro gra mm in g M anu al  Registers for data exchange through Funciton Card 1 and Funciton Card 2 (available for firmware V1.06.00 or later) Function SR1435 Actual cycle time for data exchange through Function Card 1 Number of the connection that is currently performing a cyclical data SR1436 exchange through Function Card 1...
  • Page 168 Ethernet/IP Data Exchange Description Status code of the connection 1-32 for data exchange through EtherNet/IP SR1020 - SR1051 (Scanner)  Ethernet/IP communication error codes are listed below. Refer to Chapter 9 in AS Series Operation Manual for more details. Error Code Description Solution 1.
  • Page 169 I/O applications. Two things to be noted when applying this mode: A. You need to use a bigger I/O allocation planning beforehand and store this planning in AS series PLC. B. You can simply use special flags to mark which I/O module will NOT be used to meet the actual I/O module placement.
  • Page 170 Cha p ter 2 De vices Example: Step 1: Select “Manual + Flags (I/O module of CPU & Remote module)” for the setting option “I/O module allocation setting when Power ON” in HWCONFIG. Step 2: Create an entire module allocation and download the I/O allocation table to HWCONFIG. Step 3: When 16AP, 04DA, 08AM (right-side module) and 16AP as well as 06X6 (remote module) are not needed in the application, you can set the flags SM231 (indicating 16AP), SM233 (indicating 04DA), SM235 (including 08AM), SM237 (indicating remote 16AP) and SM239 (indicating remote 06X6) to OFF to meet the actual I/O module placement.
  • Page 171 AS Ser ies Pro gra mm in g M anu al The order numbers, the model names and their corresponding device numbers in the complete I/O allocation list. Right-side modules: Order number Model AS332 16AP 16AP 04AD 04DA 06XA 08AM 08AN X1.0/ X2.0/...
  • Page 172 Cha p ter 2 De vices 22. Number of modules and the device codes Description Number of the remote modules connected to the CPU module (all right-side modules SR1559 not included) SR1560 Number of the right-side modules connected to the CPU module Model code of the 1 –...
  • Page 173 AS Ser ies Pro gra mm in g M anu al After power-on, the module allocation of the above example is as shown below. SR1559 = 2; SR1560 = 4 The order number is counted by the right-side modules connected to the CPU module and then counted by the RTU number.
  • Page 174 Cha p ter 2 De vices  List of pulse output instrucitons: Even Auto- Instruciton number number reset Auto-reset timing Remarks axis axis flag  No need to set up the PWM/DPWM number of pulses to output. JOG/DJOG  It is suggested to use DPLSV in applications that the instruction is stopped...
  • Page 175 To free the right to execute other CAN output instructions, you can use the auto-reset flags for the PLC to check if the communicaton 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.
  • Page 176 Cha p ter 2 De vices  List of CAN communicaiton instrucitons: Auto- Delta Delta Instruciton reset Auto-reset timing Remarks Servo inverter flag INITC ASDON CASD DDRVIC DDRVAC DPLSVC Auto-reset flag is ON ZRNC/DZRNC RSTD DCSFOC DTQC DTQLC ZRNM EMER...
  • Page 177 AS Ser ies Pro gra mm in g M anu al Example 2 (used in ST programming language) Explanation 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.
  • Page 178 Cha p ter 2 De vices  The procedure There are four procedures A-D, when the input counted value changes 49 -> 50 to output the pulses through Y0.0. The input counted value changes from 49 to 50. The high-speed comparison interrupt is triggered. The PLC program is interrupted and the high-speed comparison interrupt is executed.
  • Page 179 AS Ser ies Pro gra mm in g M anu al 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...
  • Page 180 Cha p ter 2 De vices  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 FW V1.08.30 or later) PLC uses the propositional conversion formula to converse the frequency and pulse numbers for inputs into what are suitable for outputs.
  • Page 181: Index Register (E)

    AS Ser ies Pro gra mm in g M anu al The illustration of using backlash compensation in CSFO. Number of pulses Black Line: Input Frequency Green Line: output The ratio of the number of input and output pulses is 1:1. The timings are shown as , , , .
  • Page 182 Instruction Tables Chapter 3 Table of Contents Types of Instructions ................. 3-2 3.1.1 Basic Instructions ................. 3-2 3.1.2 Applied Instructions ..............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) ........
  • Page 183: Types Of Instructions

    AS Ser ies Pro gra mm in g M anu al 3.1 Types of Instructions Instructions used in the AS300 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...
  • Page 184: Understanding Instruction Tables

    High-speed output and position control instructions instructions Delta special CANopen 2800-2818 CANopen communication instructions especially for Delta devices communication 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.
  • Page 185: Applied Instructions (Sorted Numerically)

    AS Ser ies Pro gra mm in g M anu al 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. 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.
  • Page 186: Applied Instructions (Sorted Alphabetically)

    Cha p ter 3 Ins tr uc tio n Tab les 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. 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...
  • Page 187: Device Tables

    AS Ser ies Pro gra mm in g M anu al 3.2.4 Device Tables This section describes the table format used in the rest of this manual to describe each instruction. 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.
  • Page 188: Lists Of Basic Instructions

    Cha p ter 3 Ins tr uc tio n Tab les ○: The hollow circle Indicates that the device cannot be modified by an index register. ●: The solid circle Indicates that the device can 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.
  • Page 189 AS Ser ies Pro gra mm in g M anu al Instruction Symbol Function Operand code Resetting the master control  Rising-edge/Falling-edge detection contact instructions Instruction code Symbol Function Operand Instruction code ANDP DX, X, Y, M, SM, S, T, C, HC, D Starting the rising- edge detection/Connecti...
  • Page 190: Lists Of Applied Instructions

    Cha p ter 3 Ins tr uc tio n Tab les  Rising-edge/Falling-edge differential output instructions Execution Instruction code Symbol Function Operand condition Rising-edge Y, M, SM, S differential output Falling-edge Y, M, SM, S differential output  Other instructions Instruction code Symbol Function...
  • Page 191 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function Instruction 16-bit 32-bit Comparing values <=S ─ ON: S 0005 LD<= DLD<= >S OFF: S Comparing values ─ =S ON: S 0006 AND= DAND= ≠S OFF: S Comparing values...
  • Page 192 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function Instruction 16-bit 32-bit Comparing floating-point numbers ─ ─ =S 0018 FLD= ON: S ≠S OFF: S Comparing floating-point numbers 1≠S ─ ─ ON: S 0019 FLD<>...
  • Page 193 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function Instruction 16-bit 32-bit Comparing floating-point numbers ≠S ─ ─ ON: S 0031 FOR<> =S OFF: S Comparing floating-point numbers >S ─ ─ ON: S 0032 FOR>...
  • Page 194 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function Instruction 16-bit 32-bit  0055 DZCP Zone comparison ─  0056 FCMP Comparing floating-point numbers ─  0057 FZCP Floating-point zone comparison ─  0058 MCMP Matrix comparison...
  • Page 195 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function Instruction 16-bit 32-bit Comparing the absolute result of the contact type ─ 0067 LDZ<> DLDZ<> ON: | S |≠| S OFF: | S |=| S Comparing the absolute result of the contact type ─...
  • Page 196 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function Instruction 16-bit 32-bit Comparing the absolute result of the contact type ─ 0077 ANDZ<= DANDZ<= ON: | S |<=| S OFF: | S |>| S Comparing the absolute result of the contact type ─...
  • Page 197 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit Multiplying binary numbers  0102 Dividing binary numbers  0103 Adding floating-point numbers ─  0104 Subtracting floating-point numbers ─  0105 Multiplying floating-point numbers ─...
  • Page 198 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit  0116 DDEC Subtracting one from a binary number Multiplying binary numbers for 16-bit  0117 MUL16 MUL32 multiplying binary numbers for 32-bit Dividing binary numbers for 16-bit ...
  • Page 199 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit  0209 GBIN DGBIN Converting a Gray code into a binary number  0210 DNEG Two’s complement of a number Reversing the sign of a 32-bit floating-point ─...
  • Page 200 Cha p ter 3 Ins tr uc tio n Tab les  Data transfer instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit Transferring data  0300 DMOV S: Data source D: Data destination ─  0302 $MOV Transferring a string ...
  • Page 201 AS Ser ies Pro gra mm in g M anu al  Jump instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  0400 Conditional jump ─ ─ 0401 Unconditional jump ─ ─ 0402 GOEND Jump to END  Program execution instructions Instruction code Pulse...
  • Page 202 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ 0703 RAMP DRAMP Cyclic ramp signal ─ ─ 0704 Matrix input ─ 0705 ABSD DABSD Absolute drum sequencer ─ ─ Incremental drum sequencer 0706 INCD...
  • Page 203 AS Ser ies Pro gra mm in g M anu al  Logic instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit  0800 WAND DAND Logical AND operation ─  0801 MAND Matrix AND operation  0802 Logical OR operation ─...
  • Page 204 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ 0814 AND^ DAND^ ─ 0815 OR& DOR& &S ─ 0816 DOR| ─ 0817 DOR^  Rotation instructions Instruction code Pulse Symbol Function instruction...
  • Page 205 AS Ser ies Pro gra mm in g M anu al  Timer and counter instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit Resetting the contact to OFF or clearing ─ 1000 DRST the value in the register ─ ─...
  • Page 206 Cha p ter 3 Ins tr uc tio n Tab les  Shift instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit Shifting the states of the devices to the ─  1100 SFTR right ─  1101 SFTL Shifting the states of the devices to the left Shifting the data in the word devices to the ...
  • Page 207 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  1109 Shifting the matrix bits Shifting the values of the bits in the  1110 DSFR registers by n bits to the right Shifting the values of the bits in the ...
  • Page 208 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  1203 ENCO Encoder ─  1204 SEGD Seven-segment decoding  1205 SORT DSORT Sorting the data ─  1206 ZRST Resetting the zone ...
  • Page 209 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  1214 Counting the bits with the value 0 or 1 ─  1215 Disuniting 16-bit data ─  1216 Uniting 16-bit data ...
  • Page 210 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  FSORT 1229 Sorting data in floating-point format  Structure creation instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─...
  • Page 211 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ ─ Reading PU module output state 1403 PUSTAT ─ ─ PU module pulse output (no acceleration) 1404 DPUPLS Relative position output of PU module ─...
  • Page 212 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ ─ PU module MPG output 1409 DPUMPG High-speed counter function of PU ─ ─ 1410 DPUCNT module ─ LC module channel calibration 1415 DLCCAL ─...
  • Page 213 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ ─ 1419 DHCCAP HC module counter value captured ─ ─ 1420 HCDO HC module digital output point HC module counter value in comparison ─...
  • Page 214 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit 1425 ADPEAK DADPEAK – Record peak data of analog input module Read the parameter from the O-Link 1426 IOLINKR – – device Write the parameter into the IO-Link 1427...
  • Page 215 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  Arctangent of a floating-point number 1505 FATAN ─  1506 FSINH Hyperbolic sine of a floating-point number Hyperbolic cosine of a floating-point ─...
  • Page 216 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  1602 Adding the time ─  1603 Subtracting the time ─ ─ 1604 HOUR Running-time meter ─  1605 TCMP Comparing the time ─...
  • Page 217 ─  1813 COMDF serial communication port Serial communication instruction, ─ ─ 1814 VFDRW exclusively for Delta AC motor drive Serial communication instruction, ─ ─ 1815 ASDRW exclusively for Delta servo drive Setting the parameters in the data ─ ...
  • Page 218 ─ ─ 1818 DNETRW communication data User-defined communication ─ ─ 1819 CANRS sending and receiving Enabling Delta DMV detection and ─ ─ 1820 DMVSH communication Execute the appointed communication ─ ─ 1821 DESO number of the data exchange table once ...
  • Page 219 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit Converting a binary hexadecimal  2101 BINHA DBINHA number into hexadecimal ASCII code Converting a binary-coded decimal  2102 BCDDA DBCDDA number into ASCII code Converting a signed decimal ASCII code ...
  • Page 220 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  2119 $INS Inserting a string ─  2122 SPLIT Splitting a string ─  2123 MERGE Merging a string ...
  • Page 221 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  MCONF 2210 Reading/Writing Modbus TCP data ─ EMCONF1 2211 Setting email server parameter values ─  EMCONF2 2212 Setting email address ...
  • Page 222 Cha p ter 3 Ins tr uc tio n Tab les  Task control instructions Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─  2400 TKON Enabling a cyclic task ─  2401 TKOFF Disabling a cyclic task  Sequential function charts (SFC) instructions Instruction code Pulse...
  • Page 223 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit Catch speed and proportional output 2708 CSFO – – Mark alignment positioning 2709 – DDRVM – 2-Axis relative-coordinate point-to-point 2710 – DPPMR –...
  • Page 224 Reading and writing CANopen 2807 COPRW – – communication data Writing multiple CANopen parameter 2808 COPWL DCOPWL – values ─ ─ 2809 RSTD Sending Reset or NMT command ─ ─ 2810 ZRNM Setting the homing mode for Delta servo 3 - 4 3...
  • Page 225 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Symbol Function instruction 16-bit 32-bit ─ ─ 2811 EMER Reading Emergency message Controlling the tracking function of a 2812 – DCSFOC – servo via communication 2813 ECAMD –...
  • Page 226: Applied Instructions (Sorted Alphabetically)

    Cha p ter 3 Ins tr uc tio n Tab les 3.4.2 Applied Instructions (Sorted Alphabetically) Instruction code Pulse Classification Function instruction 16-bit 32-bit  Linking two strings 0114 –  2118 $CLR – Clearing a string  Deleting the characters in a string 2117 $DEL –...
  • Page 227 |S1-S2|>=|S3| – Arrow key input 1703 ARWS – – Servo-ON and servo-OFF 2801 ASDON – Serial communication instruction exclusive for Delta – 1815 ASDRW – servo drive  Deadband control 1222 BAND DBAND Converting a binary number into a binary-coded ...
  • Page 228 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Classification Function instruction 16-bit 32-bit  Comparing values 0054 DCMP Comparing tables  0063 CMPT< – ON: < Comparing tables  0064 CMPT<= – ON: <= Comparing tables ...
  • Page 229 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Classification Function instruction 16-bit 32-bit – E-CAM parameter setting and planning 2814 – DECAMS 1419 – DHCCAP – HC module counter value captured 1421 – DHCCMP –...
  • Page 230 DIV32 Division of binary numbers for 32-bit – 0504 – Enabling a specific interrupt 1820 DMVSH – – Enabling Delta DMV detection and communication 1818 DNETRW – – Reading and writing DeviceNet communication data  1607 – Daylight saving time –...
  • Page 231 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Classification Function instruction 16-bit 32-bit  Reading data into the index registers 1905 EPOP –  1904 EPUSH – Storing the contents of the index registers Subtracting floating-point numbers ...
  • Page 232 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Classification Function instruction 16-bit 32-bit – S1<S2 0034 – FOR< – S1<=S2 0035 – FOR<= – S1≠S2 0031 – FOR<> – S1=S2 0030 – FOR= – S1>S2 0032 –...
  • Page 233 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Classification Function instruction 16-bit 32-bit – Initializing the servo for CANopen communication 2800 INITC – Converting a 32-bit floating-point number into a  0204 DINT binary integer Converting an IP address of the integer type into an ...
  • Page 234 Cha p ter 3 Ins tr uc tio n Tab les Instruction code Pulse Classification Function instruction 16-bit 32-bit  Matrix comparison 0058 MCMP –  2210 MCONF – Reading/Writing Modbus TCP data  1208 MEAN DMEAN Mean  Writing data into the file register 2303 MEMW –...
  • Page 235 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Classification Function instruction 16-bit 32-bit – |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>=...
  • Page 236 Writing the time 1601 –  Time zone comparison 1606 TZCP –  1216 – Uniting the 16-bit data Serial communication instruction exclusively for Delta – 1814 VFDRW – AC motor drive  Logical AND operation 0800 WAND DAND –...
  • Page 237 Controlling the zone 1223 ZONE DZONE – Servo homing 2806 ZRNC DZRNC – 2810 ZRNM – Setting the homing mode for Delta servo  Resetting the zone 1206 ZRST –  Zone setup 1228 – ZSET 3 - 5 6...
  • Page 238: Chapter 4 Instruction Structure

    Instruction Structure Chapter 4 Table of Contents Applied Instructions - API Description ..........4-2 Operand Usage Description ............... 4-4 Restrictions on the Use of Instructions ..........4-7 Index Registers ................. 4-9 Pointer Registers ................4-12 Pointer Registers of Timers ............. 4-14 Pointer Registers for 16-bit Counters ..........
  • Page 239: Applied Instructions - Api Description

    A S S er i es Pr og r am m ing M an u 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.
  • Page 240 Ch a pt er 4 Ins tr uc t i on S tr uc t ur e counter 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.
  • Page 241 A S S er i es Pr og r am m ing M an u 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).
  • Page 242: Operand Usage Description

    Ch a pt er 4 Ins tr uc t i on S tr uc t ur e 4.2 Operand Usage Description There are 2 types of operands in the AS Series: user-defined and system-defined. User-defined operands • Input relays: X0.0–X63.15 or X0–X63 •...
  • Page 243 A S S er i es Pr og r am m ing M an u 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.
  • Page 244: Restrictions On The Use Of Instructions

    Ch a pt er 4 Ins tr uc t i on S tr 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 ...
  • Page 245 A S S er i es Pr og r am m ing M an u a l  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.
  • Page 246: Index Registers

    Using the register name to modify the device: When M0 is ON, E0=10, E1=17, D1@E0=D (1+10)=D11, D11 is ON. NOTE 1: AS Series support using the register name to modify the device; for example, D0.1@E0 but does not support 2-layered modification for example, D0@E1.1@E0.
  • Page 247 A S S er i es Pr og r am m ing M an u a l Declaring the variables first, and then modifying the device:  Declare the three variables StartBit, Var1, and Var2 in ISPSoft. 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.
  • Page 248 Ch a pt er 4 Ins tr uc t i on S tr 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.0, the value in D200 accumulates the occurrences in the values in D1000 ~ D1199.
  • Page 249: Pointer Registers

    A S S er i es Pr og r am m ing M an u a l 4.5 Pointer Registers  ISPSoft 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;...
  • Page 250 Ch a pt er 4 Ins tr uc t i on S tr uc t ur e 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.
  • Page 251: Pointer Registers Of Timers

    A S S er i es Pr og r am m ing M an u a l 4.6 Pointer Registers of Timers  ISPSoft 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.
  • Page 252 Ch a pt er 4 Ins tr uc t i on S tr uc t ur e The program in the function block FB0 appears as shown below. Declare the variable in the program organization unit (POU). The data type of CVar1 should be TIMER. Call the function block FB0 in the program organization unit (POU).
  • Page 253: Pointer Registers For 16-Bit Counters

    A S S er i es Pr og r am m ing M an u a l 4.7 Pointer Registers for 16-bit Counters  ISPSoft 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.
  • Page 254 Ch a pt er 4 Ins tr uc t i on S tr uc t ur e 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.
  • Page 255: Pointer Registers For 32-Bit Counters

    A S S er i es Pr og r am m ing M an u a l 4.8 Pointer Registers for 32-bit Counters  ISPSoft 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.
  • Page 256 Ch a pt er 4 Ins tr uc t i on S tr uc t ur e 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. When VarBit1 in FB0 is ON, HCPoint1 (CVar1) is ON.
  • Page 257: File Register

    A S S er i es Pr og r am m ing M an u a l 4.9 File Register  AS 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.
  • Page 258: Chapter 5 Basic Instructions

    Basic Instructions Chapter 5 Table of Contents List of Basic Instructions ..............5-2 Basic Instructions................5-3 5 - 1...
  • Page 259: List Of Basic Instructions

    A S S er i es Pr o gr am m ing Ma n ua 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 DX, X, Y, M, SM, S, T, C, HC, D LD/AND/OR A in series/Connecting contact A in...
  • Page 260: Basic Instructions

    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 series/Connecting contact A in parallel Device      ...
  • Page 261 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function Loading contact B/Connecting contact B in LDI/ANI/ORI series/Connecting contact B in parallel Device        ...
  • Page 262 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function Driving the coil Device       Data type  Symbol D : Specified device Explanation The logical operation result prior to the application of the OUT instruction is output to the specified device. The following table describes the action of the coil contact.
  • Page 263 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function Keeping the device on Device       Data type  Symbol D : Specified device Explanation When the instruction SET is driven, the specified device is set to ON.
  • Page 264 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function MC/MCR Setting/Resetting the master control Symbol Level of the nested N : N0~N31 program structure Explanation MC sets the master control. When the MC instruction is executed, the instructions between MC and MCR are executed as usual.
  • Page 265 A S S er i es Pr o gr am m ing Ma n ua l Example 5 - 8...
  • Page 266 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 rising-edge detection in series/Connecting the rising-edge detection in parallel Device      ...
  • Page 267 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function Starting the falling-edge detection/Connecting the LDF/ANDF/ORF falling-edge detection in series/Connecting the falling-edge detection in parallel Device     ...
  • Page 268 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 ,S PED/APED/OPED edge-detection in series/Connecting the rising-edge detection in parallel Device     ...
  • Page 269 A S S er i es Pr o gr am m ing Ma n ua l Example The rising-edge detection of X0.0 starts, the rising-edge detection of X0.1 is connected in series, the rising-edge detection of X0.2 is connected in parallel, and the coil Y0.0 is driven. When both X0.0 and X0.1 switch from OFF to ON, or when X0.2 switches from OFF to ON, Y0.0 is ON for a scan cycle.
  • Page 270 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 ,S NED/ANED/ONED falling-edge detection in series/Connecting the falling-edge detection in parallel Device     ...
  • Page 271 A S S er i es Pr o gr am m ing Ma n ua l Example The falling -edge detection of X0.0 starts, the falling -edge detection of X0.1 is connected in series, the falling -edge detection of X0.2 is connected in parallel, and the coil Y0.0 is driven. When both X0.0 and X0.1 switch from OFF to ON, or when X0.2 switches from OFF to ON, Y0.0 is ON for a scan cycle.
  • Page 272 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function Rising-edge output Device      Data type  Symbol D : Specified device Explanation 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.
  • Page 273 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function Falling-edge output Device      Data type  Symbol D : Specified device Explanation 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.
  • Page 274 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function 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.
  • Page 275 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function Triggering the circuit on the rising edge. Symbol Explanation 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.
  • Page 276 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function Triggering the circuit on the falling edge. Symbol Explanation 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.
  • Page 277 A S S er i es Pr o gr am m ing Ma n ua l Instruction code Operand Function FB_NP Triggering the circuit on the rising edge. Device     Data type  Symbol S : For internal use Explanation 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.
  • Page 278 C ha pt er 5 Bas ic I ns t r uc t i ons Instruction code Operand Function FB_PN Triggering the circuit on the falling edge. Device     Data type  Symbol S : For internal use Explanation 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.
  • Page 279 A S S er i es Pr o gr am m ing Ma n ua l MEMO 5 - 2 2...
  • Page 280 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-47 6.3 Data Conversion Instructions ..............
  • Page 281 AS Ser ies Pro gra mm in g M anu al 6.11 Timer and Counter Instructions ............6-267 6.11.1 List of Timer and Counter Instructions ..........6-267 6.11.2 Explanation of Timer and Counter Instructions ........6-268 6.12 Shift Instructions ................6-310 6.12.1 List of Shift Instructions ..............
  • Page 282 6.27 Delta CANopen Communication Instructions ........6-992 6.27.1 List of Delta CANopen Communication Instructions ......6-992 6.27.2 Explanation of Delta CANopen Communication Instructions ....6-993 6.27.3 Frequently asked questions in Delta special CANopen communication and Troubleshooting ................6-1062 6 - 3...
  • Page 283: Comparison Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit 0000 LD= DLD= –...
  • Page 284 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Pulse Function instruction 16-bit 32-bit 0032 – FOR> – S1>S2 S1≧S2 0033 –...
  • Page 285 AS Ser ies Pro gra mm in g M anu al Instruction code Pulse Function instruction 16-bit 32-bit 0076 ANDZ< DANDZ< – |S1-S2|<|S3| |S1-S2|≦|S3| 0077 ANDZ<= DANDZ<= – 0078 ORZ= DORZ= – |S1-S2|=|S3| 0079 ORZ<> DORZ<> – |S1-S2|≠|S3| 0080 ORZ> DORZ>...
  • Page 286: Explanation Of Comparison Instructions

    C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s 6.1.2 Explanation of Comparison Instructions Instruction code Operand Function ,S LD※ Comparing values LD※ 0000-0005 D Device “$”...
  • Page 287 AS Ser ies Pro gra mm in g M anu al 6 - 8...
  • Page 288 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S AND※ Comparing values AND※ 0006-0011 D Device “$”  ...
  • Page 289 AS Ser ies Pro gra mm in g M anu al 6 - 1 0...
  • Page 290 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S 0012-0017 D OR※ Comparing values OR※ Device “$”  ...
  • Page 291 AS Ser ies Pro gra mm in g M anu al 6 - 1 2...
  • Page 292 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function Comparing floating-point numbers LD ,S FLD※ 0018-0023 ※ Device “$” ...
  • Page 293 AS Ser ies Pro gra mm in g M anu al Example Take the FLD= instruction for example. When the value in D0 is equal to that in D2, Y0.0 is ON. Additional remarks If the value in S or S 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.
  • Page 294 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function Comparing floating-point numbers ,S FAND※ 0024-0029 AND※ Device “$”  ...
  • Page 295 AS Ser ies Pro gra mm in g M anu al Example Take the instruction FAND= for example. When X1.0 is ON and the value in D1 is equal to that in D2, Y1.0 is ON. Additional remarks If the value in S or S 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.
  • Page 296 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function Comparing floating-point numbers ,S FOR※ 0030-0035 OR※ Device “$”  ...
  • Page 297 AS Ser ies Pro gra mm in g M anu al Example When X1.0 is ON, or when the value in D1 is equal to that in D2, Y1.0 is ON. Additional remarks If the value in S or S 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.
  • Page 298 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function 0036- ,S LD$※ Comparing strings LD$※ 0037 Device “$”  ...
  • Page 299 AS Ser ies Pro gra mm in g M anu al When the two strings are the same, the corresponding comparison results of the instructions are listed below. For example: b 15 b 8 b 7 b 15 b 8 b 7 Comparison sign 16#42(B) 16#41(A)
  • Page 300 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function 0042- ,S AND$※ Comparing strings AND$※ 0043 Device “$”  ...
  • Page 301 AS Ser ies Pro gra mm in g M anu al When two strings are the same, the corresponding comparison operation results of the instructions are listed below. For example: b 15 b 8 b 7 b 15 b 8 b 7 16#42( B) 16#41( A) 16#42( B)
  • Page 302 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S OR$※ Comparing strings OR$※ 0048-0049 Device “$”   ...
  • Page 303 AS Ser ies Pro gra mm in g M anu al When two strings are the same, the corresponding comparison operation results of the instructions are listed below. For example: b 15 b 8 b 7 b 15 b 8 b 7 16#42( B) 16#41( A) 16#42( B)
  • Page 304 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,D 0054 Comparing values Device “$”    ...
  • Page 305 AS Ser ies Pro gra mm in g M anu al If you need to clear the comparison result, use the RST or ZRST instruction. Additional remarks If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL. If D+2 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 306 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,S,D 0055 Zone comparison Device “$”    ...
  • Page 307 AS Ser ies Pro gra mm in g M anu al Example If the operand D is M0, the comparison results are stored in M0, M1 and M2, as shown below. When X0.0 is ON, the ZCP instruction is executed. M0, M1, or M2 is ON. When X0.0 is OFF, the ZCP instruction is not executed, and the state of M0, the state of M1, and the state of M2 remain unchanged.
  • Page 308 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,D 0056 FCMP Comparing floating-point numbers Device “$”  ...
  • Page 309 AS Ser ies Pro gra mm in g M anu al Additional remarks If the value in S 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. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.
  • Page 310 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,S,D 0057 FZCP Floating-point zone comparison Device “$”  ...
  • Page 311 AS Ser ies Pro gra mm in g M anu al Additional remarks If the value in S or S 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. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL.
  • Page 312 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,n,D 0058 MCMP Matrix comparison Device “$”   ...
  • Page 313 AS Ser ies Pro gra mm in g M anu al Example When X0.0 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. Suppose the current value in D20 is 2.
  • Page 314 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function ,S ,n,D CMPT※ 0059-0064 Comparing tables Device “$”   ...
  • Page 315 AS Ser ies Pro gra mm in g M anu al If the operand S is a constant between -32768 to 32767, the comparison is as shown below. Compar ison result 1111(B IN) 2222(BIN) Compar iosn sign 3333(BIN) 4444(BIN) 3333(BIN) 8888(BIN) +( N- 2) +( N- 2)
  • Page 316 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Instruction code Operand Function Checking the addresses in a pointer S,n,D 0065 CHKADR register Device “$”...
  • Page 317 AS Ser ies Pro gra mm in g M anu al Example Create a program (Prog0) and a function block (FB0) in ISPSoft. Declare two variables in the program. 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.
  • Page 318 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s 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.
  • Page 319 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Comparing contact type 0066- ,S ,S LDZ※ absolute values LDZ※ 0071 Device “$”             ...
  • Page 320 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Only the 32-bit instruction can use the 32-bit HC device, but not the device E. Continuity Discontinuity 16-bit...
  • Page 321 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Comparing contact type ,S ,S ANDZ※ 0072-0077 D absolute values ANDZ※ Device “$”             ...
  • Page 322 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Only the 32-bit instruction can use the 32-bit HC device, but not the device E. Continuity Discontinuity API number...
  • Page 323 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Comparing contact type ,S ,S ORZ※ 0078-0083 D absolute values ORZ※ Device “$”             ...
  • Page 324 C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s Only the 32-bit instruction can use the 32-bit HC device, but not the device E. Continuity Discontinuity API number...
  • Page 325: Arithmetic Instructions

    A S S er i es Pr og r am m ing M an u 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 Function instruction 16-bit 32-bit...
  • Page 326: Explanation Of Arithmetic Instructions

    Ch a pt er 6 A pp l i e d I n s tr uc t io ns 6.2.2 Explanation of Arithmetic Instructions Instruction code Operand Function ,S ,D 0100 Adding binary numbers Device “$”     ...
  • Page 327 A S S er i es Pr og r am m ing M an u a l Example 1 Adding 16-bit binary values: when X0.0 is ON, the instruction adds the addend in D10 to the augend in D0, and stores the sum in D20.
  • Page 328 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Flags For 16-bit binary values: If the operation result is zero, SM600 is ON. If the operation result exceeds 65,535, SM602 is ON. For 32-bit values: If the operation result is zero, SM600 is set to ON.
  • Page 329 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0101 Subtracting binary numbers Device “$”            ...
  • Page 330 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example 1 Subtracting 16-bit binary values: when X0.0 is ON, the instruction subtracts the subtrahend in D10 from the minuend in D0, and stores the difference in D20.
  • Page 331 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0102 Multiplying binary numbers Device “$”            ...
  • Page 332 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Multiplying 32-bit binary values: D +1 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.
  • Page 333 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0103 Dividing binary numbers Device “$”            ...
  • Page 334 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Dividing 32-bit values: Remainder Quotient 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).
  • Page 335 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0104 Adding floating-point numbers Device “$”            ...
  • Page 336 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Additional remark If the value in S or 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.
  • Page 337 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0105 Subtracting floating-point numbers Device “$”            ...
  • Page 338 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example Subtracting 32-bit single-precision floating-point numbers: when X0.0 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 S or the value in S...
  • Page 339 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0106 Multiplying floating-point numbers Device “$”            ...
  • Page 340 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example Multiplying 32-bit single-precision floating-point numbers: when X0.0 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 S or the value in S...
  • Page 341 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0107 Dividing floating-point numbers Device “$”            ...
  • Page 342 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example Dividing 32-bit single-precision floating-point numbers: when X0.0 is ON, the instruction divides the dividend in (D1, D0) by the divisor 100.7, and stores the quotient in (D11, D10). Additional remarks If the divisor is 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2012.
  • Page 343 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,n,D 0112 Adding binary values in blocks Device “$”          ...
  • Page 344 Ch a pt er 6 A pp l i e d I n s tr uc t io ns 16-bit instruction example: when the operand S is a device (not a constant or a hexadecimal value) 1+1=2 2+2=4 D +1 5+5=10 D +n-1 S +n-1...
  • Page 345 A S S er i es Pr og r am m ing M an u a l Example 2 When X0.0 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 res ult D100 D101...
  • Page 346 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function ,S ,n,D 0113 Subtracting binary values in blocks Device “$”        ...
  • Page 347 A S S er i es Pr og r am m ing M an u a l For 32-bit instructions, when the operation result is larger than 2,147,483,647, SM602 is ON. 16-bit instruction example: when the operand S is a device (not a constant or a hexadecimal value) 5-1=4 4-1=3 D +1...
  • Page 348 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example 2 When X0.0 is ON, the instruction subtracts the subtrahend 1 from the binary values in D0–D4, and stores the differences in D100–D104.
  • Page 349 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,D 0114 Linking strings Device “$”             ...
  • Page 350 Ch a pt er 6 A pp l i e d I n s tr uc t io ns a (1 6# 61 ) B (1 6# 62 ) A (1 6# 61 ) d (1 6# 62 ) B (1 6# 42 ) A (1 6# 41 ) d (1 6# 64 ) D( 16 #6 4)
  • Page 351 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function 0115 Adding one to a binary number Device “$”        Data type  ...
  • Page 352 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function 0116 Subtracting one from a binary number Device “$”        Data type ...
  • Page 353 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function MUL16 Multiplying 16-bit binary numbers ,S ,D 0117 MUL32 Multiplying 32-bit binary numbers Device “$”     ...
  • Page 354 Ch a pt er 6 A pp l i e d I n s tr uc t io ns 32-bit binary multiplication: D +1 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.
  • Page 355 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function DIV16 Dividing 16-bit binary numbers ,S ,D 0118 DIV32 Dividing 32-bit binary numbers Device “$”     ...
  • Page 356 Ch a pt er 6 A pp l i e d I n s tr uc t io ns 32-bit binary division: Quotient 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 X0.0 is ON, the instruction divides the dividend in D0 by the divisor in D10, and stores the quotient D20.
  • Page 357: Data Conversion Instructions

    A S S er i es Pr og r am m ing M an u a l 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 Function instruction...
  • Page 358: Explanation Of Data Conversion Instructions

    Ch a pt er 6 A pp l i e d I n s tr uc t io ns 6.3.2 Explanation of Data Conversion Instructions Function Instruction code Operand Converting a binary number into a 0200 S, D binary-coded decimal number Device “$”...
  • Page 359 A S S er i es Pr og r am m ing M an u a l Example When X0.0 is ON, the instruction converts a binary value in D10 into a binary-code decimal value, and stores the conversion result in D100. If D10=16#04D2=1234, the conversion result is D100=16#1234.
  • Page 360 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a binary-coded decimal S, D 0201 number into a binary number Device “$”    ...
  • Page 361 A S S er i es Pr og r am m ing M an u a l Additional remarks 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.
  • Page 362 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a binary integer into a binary S, D 0202 floating-point number Device “$”    ...
  • Page 363 A S S er i es Pr og r am m ing M an u a l Example 1 When X0.0 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). When X0.1 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).
  • Page 364 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).
  • Page 365 A S S er i es Pr og r am m ing M an u a l 6 - 8 6...
  • Page 366 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a 32-bit floating-point number 0204 S, D into a binary integer Device “$”    ...
  • Page 367 A S S er i es Pr og r am m ing M an u a l Example When X0.0 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.
  • Page 368 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a 16-bit value into a 32-bit S, D 0206 MMOV value Device “$”    ...
  • Page 369 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Converting a 32-bit value into a 16-bit S, D 0207 RMOV value Device “$”      ...
  • Page 370 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a binary number into a Gray S, D 0208 code Device “$”     ...
  • Page 371 A S S er i es Pr og r am m ing M an u a l K6513=H1971 0 0 0 1 1 0 1 1 1 0 0 0 Y1.15 Y1.0 GRAY 6513 0 0 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.
  • Page 372 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a Gray code into a binary S, D 0209 GBIN number Device “$”    ...
  • Page 373 A S S er i es Pr og r am m ing M an u a l Example When X0.0 is ON, the instruction converts the Gray code in the absolute position encoder which is connected to the inputs X0.0–X0.15 into the binary value, and stores the conversion result in D10. X0.15 X0.0 GRAY CODE 6513...
  • Page 374 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function 0210 Finding the two’s complement Device “$”        Data type  ...
  • Page 375 A S S er i es Pr og r am m ing M an u a l Example 2 Finding the two’s compliment of the negative value: When the value of the 15 bit in D0 is 1, M0 is ON, and the value in D0 is a negative value. When M0 is ON, the NEG instruction finds the two’s complement of the negative value in D0 (the corresponding positive value).
  • Page 376 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: 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.
  • Page 377 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Reversing the sign of a 32-bit floating- 0211 FNEG point number Device “$”       Data type ...
  • Page 378 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a binary floating-point number S, D 0212 FBCD into a decimal floating-point number Device “$”  ...
  • Page 379 A S S er i es Pr og r am m ing M an u a l Example When X0.0 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). Real number: 23 bits;...
  • Page 380 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting a decimal floating-point S, D 0213 FBIN number into a binary floating-point number Device “$”  ...
  • Page 381 A S S er i es Pr og r am m ing M an u a l Example 1 When X0.0 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]...
  • Page 382 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting binary numbers in blocks into S, n, D 0214 BKBCD binary-coded decimal numbers in blocks Device “$”...
  • Page 383 A S S er i es Pr og r am m ing M an u a l Additional remarks 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.
  • Page 384 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function Converting binary numbers in blocks into S, n, D 0215 BKBIN binary-coded decimal numbers in blocks Device “$”...
  • Page 385 A S S er i es Pr og r am m ing M an u a l Additional remarks If n is not between 1–256, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. 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.
  • Page 386 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction code Operand Function 0216 SCAL Finding a scaled value (point-slope) Device “$”         ...
  • Page 387 A S S er i es Pr og r am m ing M an u a l The output curve is shown below: Example 1 Suppose the values in S , and S are 500, 168, and -4 respectively. When X0.0 is ON, the SCAL instruction calculates the scaled value, and stores the scaled value in D0.
  • Page 388 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Example 2 Suppose the values in S , and S are 500, -168, and 534 respectively. When X0.0 is ON, the SCAL instruction calculates the scaled value, and stores the scaled value in D10.
  • Page 389 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,S ,D 0217 SCLP Finding a scaled value (two points) Device “$”       ...
  • Page 390 Ch a pt er 6 A pp l i e d I n s tr uc t io ns The operand S used in the 16-bit instruction is set as shown in the following table. Device number Parameter Setting range Maximum source value -32,768 to 32,767 Minimum source value...
  • Page 391 A S S er i es Pr og r am m ing M an u 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: +Offset=Slope×S +Minimum destination value–Minimum source...
  • Page 392 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Destinati on value Maximum destination value =500 Minimum des ti nation value =500 Sourc e value Maximum Minimum sourc e value sourc e value =200 =3000...
  • Page 393 A S S er i es Pr og r am m ing M an u a l Example 3 Suppose the value in S 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.
  • Page 394 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Additional remarks The value in S for 16-bit instructions must be between the minimum source value and the maximum source value; that is, between -32,768 to 32,767.
  • Page 395 A S S er i es Pr og r am m ing M an u a l The floating-point number in S 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.
  • Page 396 Ch a pt er 6 A pp l i e d I n s tr uc t io ns Instruction Operand Description ,S ,S ,S ,D 0222 SCLM Multi-point area ratio operation Device “$”       ...
  • Page 397 A S S er i es Pr og r am m ing M an u a l Explanation Only the 32-bit instruction can use HC devices but not E devices. The firmware of V1.04.00 and later for AS300 PLC supports the instruction. See the following table about data types that the operands S and S correspond to.
  • Page 398 Ch a pt er 6 A pp l i e d I n s tr uc t io ns The instruction compares areas in the order from small to large. Please design the value comparison of S area in the order from small to large as well. See the figure below for the conversion of multi-point area values.
  • Page 399 A S S er i es Pr og r am m ing M an u a l Example The comparison values of S3 for multi-point areas are given as follows. Device D100 D101 D102 D103 Content The corresponding conversion reference values of S are given as follows.
  • Page 400: Data Transfer Instructions

    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 Pulse instruction Function...
  • Page 401: Explanation Of Data Transfer Instructions

    A S S er i es Pr og r am m ing M an u a l 6.4.2 Explanation of Data Transfer Instructions Function Instruction code Operand 0300 S, D Transferring data Device “$”       ...
  • Page 402 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons For 32-bit data, use DMOV.  When X0.2 is OFF, the data in (D31, D30) and (D41, D40) is unchanged. When X0.2 is ON, the instruction transfers the current value in (D21, D20) to (D31, D30), and transfers the current value of HC0 to (D41, D40).
  • Page 403 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function 0302 $MOV S, D Transferring a string Device “$”           ...
  • Page 404 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons When 16#00 appears in the low byte, the execution of the instruction is as follows. Before the instr uction is executed: b15~b8 b7~b0 B15~b8 b7~b0...
  • Page 405 A S S er i es Pr og r am m ing M an u a l 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.
  • Page 406 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example 2 Suppose the data in S is the string “12345” (odd number of bytes). When X0.0 is enabled, the data 12345 is transferred to D0–D3 as follows.
  • Page 407 A S S er i es Pr og r am m ing M an u a l After the instruction is executed, the data in the operand D is as follows. Device High byte Low byte Note 16#31 16#30 ‘1’=16#31; ‘0’=16#30 16#33 16#32 ‘3’=16#33;...
  • Page 408 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons 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.
  • Page 409 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, D 0303 Inverting data Device “$”             ...
  • Page 410 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example 2 The circuits below can be represented with the CML instruction. 6 - 1 3 1...
  • Page 411 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, D, n 0304 BMOV Transferring data in blocks Device “$”         ...
  • Page 412 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons D 20 D 19 D 21 D 20 D 22 D 21 When the device number of S is less than the device number of D, the data is transferred in the order from  to . D 19 D 20 D 20...
  • Page 413 A S S er i es Pr og r am m ing M an u a l When the device number of S is less than the device number of D, the data is transferred in the order from  to . Additional remarks 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.
  • Page 414 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Instruction code Operand Function S, D, n 0305 NMOV Transferring data to multiple devices Device “$”       ...
  • Page 415 A S S er i es Pr og r am m ing M an u a l Example When M0 is ON, 100 is transferred to D0-D9. Additional remarks 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.
  • Page 416 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Instruction code Operand Function 0306 Exchanging data Device “$”             Data type ...
  • Page 417 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function ,S ,n 0307 BXCH Exchanging data in blocks Device “$”          ...
  • Page 418 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example When X0.0 is ON, the instruction exchanges the data in D10–D14 with the data in D100–D104. D101 D102 D103 D104 D100 After the i nstruction is executed D101 D102...
  • Page 419 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Exchanging the high byte with the low 0308 SWAP byte Device “$”        Data type ...
  • Page 420 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example 2 When X0.0 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.
  • Page 421 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, m , D, n 0309 SMOV Transferring digits in blocks Device “$”       ...
  • Page 422 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons D10 (16- bit binary number) Conversi on D10 (4- digit binary -coded deci mal) T ransferri ng the digits Unchanged Unchanged D20 ( 4- digit binary -coded deci mal Conversi on D20 (...
  • Page 423 A S S er i es Pr og r am m ing M an u a l D10 (16- bit binary number) Conversi on D10 (4- digit binary -coded deci mal) T ransferri ng the digits Unchanged Unchanged D20 ( 4- digit binary -coded deci mal Conversi on D20 (...
  • Page 424 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons 4 digit 3 digit 2 digit 1 digit D10 ( 16- bit binary number T ransferring the digits D20 ( 16- bit binary number 4 digit 3 digit 2 digit...
  • Page 425 A S S er i es Pr og r am m ing M an u a l Additional remarks Suppose the data are binary-coded decimal numbers. If the number in S is not between 0–9999, or if the number in D is not between 0–9999, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200D. If m is less than 1, or if m is larger than 4, the instruction is not executed, SM0 is ON, and the error code in SR0...
  • Page 426 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Instruction code Operand Function S, n, D 0310 MOVB Transferring bits in blocks Device “$”        ...
  • Page 427 A S S er i es Pr og r am m ing M an u a l Additional remarks 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.
  • Page 428: Jump Instructions

    Ch a pt er 6 Ap p l i ed I ns t r uc t i ons 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 Function instruction 16-bit...
  • Page 429: Explanation Of Jump Instructions

    A S S er i es Pr og r am m ing M an u a l 6.5.2 Explanation of Jump Instructions Function Instruction code Operand 0400 Conditional jump Device “$” Data type Pulse instruction 16-bit instruction 32-bit instruction - Symbol :...
  • Page 430 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons When X0.0 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 You can use the CJ instruction between the MC and the MCR instructions in the five conditions below.
  • Page 431 A S S er i es Pr og r am m ing M an u a l 6 - 1 5 2...
  • Page 432 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example 3 The states of the devices are listed below. State of the contact during the State of the output coil during the State of the contact execution of CJ execution of CJ...
  • Page 433 A S S er i es Pr og r am m ing M an u a l 6 - 1 5 4...
  • Page 434 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Additional remarks Refer to the ISPSoft User Manual for more information on the use of labels (pointers) with Jump instructions. 6 - 1 5 5...
  • Page 435 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function 0401 Unconditional jump Device “$” Data type Pulse instruction 16-bit instruction 32-bit instruction - - Symbol : Jump destination Explanation 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.
  • Page 436 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Instruction code Operand Function ─ 0402 GOEND Jumping to END Pulse instruction 16-bit instruction 32-bit instruction - - Symbol Explanation This instruction causes program execution to jump to END in the program. Function blocks and interrupt tasks do not support the GOEND instruction.
  • Page 437: Program Execution Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit 0500 –...
  • Page 438: Explanation Of Program Execution Instructions

    Ch ap te r 6 App l ied Ins tr uc ti ons 6.6.2 Explanation of Program Execution Instructions Instruction code Operand Function - 0500 Disabling the interrupt function Pulse instruction 16-bit instruction 32-bit instruction - - Symbol Explanation Refer to the EI instruction (API 0501) for more information. 6 - 1 5 9...
  • Page 439 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function - 0501 Enabling the interrupt function Pulse instruction 16-bit instruction 32-bit instruction - - Symbol Explanation Use the EI instruction to enable interrupt tasks in a program (refer to next page for more information on tasks). You can use the interrupt task between the EI instruction and the DI instruction in a program.
  • Page 440 Ch ap te r 6 App l ied Ins tr uc ti ons 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.
  • Page 441 AS Ser ies Pro gra mm in g M anu al Timer interrupts in a diagram: Execute the i ns truction D IX to dis able i nterrupt M0 =O N Ex ecute the ins truc ti on E IX to e nable i nterrupt M1 =O N SR 632=0...
  • Page 442 Ch ap te r 6 App l ied Ins tr uc ti ons COM1: I300 COM2: I302 Card 1: I304 Card 2: I306 5. Extension module interrupts (I400–I431) Each module has one interrupt. You can set up 1 interrupt service for each extension module. 6.
  • Page 443 AS Ser ies Pro gra mm in g M anu al Mask-able interrupts Interrupt Description Bit No. number I009 External interrupt: input X0.9 is falling edge triggered. I010 External interrupt: input X0.10 is falling edge triggered. I011 External interrupt: input X0.11 is falling edge triggered. I012 External interrupt: input X0.12 is falling edge triggered.
  • Page 444 Ch ap te r 6 App l ied Ins tr uc ti ons Mask-able interrupts Interrupt Description Bit No. number High-speed comparison interrupt 1 for the hardware high-speed I210 counter 2 High-speed comparison interrupt 2 for the hardware high-speed I211 counter 2 High-speed comparison interrupt 3 for the hardware high-speed I212...
  • Page 445 AS Ser ies Pro gra mm in g M anu al Mask-able interrupts Interrupt Description Bit No. number High-speed comparison interrupt 1 for the hardware high-speed I250 counter 6 High-speed comparison interrupt 2 for the hardware high-speed I251 counter 6 High-speed comparison interrupt 3 for the hardware high-speed I252 counter 6...
  • Page 446 Ch ap te r 6 App l ied Ins tr uc ti ons Mask-able interrupts Interrupt Description Bit No. number Receiving a specific word triggers communication interruption in I306 function card 2 I307 Reserved High-speed output interrupt: the 1st axis positioning instruction I500 completes High-speed output interrupt: the 2nd axis positioning instruction...
  • Page 447 AS Ser ies Pro gra mm in g M anu al Mask-able interrupts Interrupt Description Bit No. number High-speed output interrupt 10: the position planning table I519 instruction completes I601 Timer interrupts 1 (unit 1ms) I602 Timer interrupts 1 (unit 1ms) SR632 I603 Timer interrupts 1 (unit 1ms)
  • Page 448 I500 interrupt. Refer to the interrupt number list in the explanation of the EI instruction. The default for interrupt tasks in the AS Series is enabled. If you use the DIX instruction to disable the interrupts, you must use the EIX instruction to enable the interrupts.
  • Page 449 I500 interrupt. Refer to the interrupt number list in the explanation of the EI instruction. The default for interrupt tasks in the AS Series is enabled. Use the DIX instruction to disable the interrupts. You can use this instruction to disable the interrupt tasks in SR623–SR634.
  • Page 450: Io Refreshing Instructions

    Ch a pt er 6 Ap p l i ed I ns t r uc t i ons 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 Function...
  • Page 451: Explanation Of Io Refreshing Instructions

    AS Series Programming Manual 6.7.2 Explanation of I/O Refreshing Instructions Function Instruction code Operand 0600 D, n Refreshing the I/O Device “$”         Data type    Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 452 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons the PLC sets the output completion 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. Value in n D device Action Descriptions...
  • Page 453 AS Series Programming Manual Additional remarks 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 During the execution of this instruction, if the external interrupt input is received through X0.0...
  • Page 454 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Instruction Operand Description Immediate refresh of a high-speed 0601 HSRF S,S comparative value Device “$”   Data type    Pulse Instruction 16-bit instruction 32-bit instruction...
  • Page 455 AS Series Programming Manual Example As PLC runs, the comparative value in DHSCS instruction is 5000. When the X0.0 external interrupt occurs, the comparative value in DHSCS is set to 8000 immediately. Main program: X0.0 external interrupt program: Assign the new comparative value to the same variable (E.g. D10 in the example) first and then execute DHSRF instruction for the update.
  • Page 456 Filter : Filtering time to refresh (unit: µs) Explanation This instruction works only with AS series (FWV1.06.00) and ISPSoft V3.06 or later versions. Xno is the starting input number to refresh. Length is the length to refresh. If the X point is the built-in input point of a CPU, when Xno is X0.3, the value of Length is 3, after executing the REFF instruction, the input filtering time of...
  • Page 457 AS Series Programming Manual the extension module, the filtering time unit is ms. 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.
  • Page 458: Miscellaneous Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 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 Function instruction 16-Bit 32-Bit  Alternating between ON and OFF 0700 –...
  • Page 459 AS Ser ies Pro gra mm in g M anu al 6.8.2 Explanation of Miscellaneous Instructions Instruction code Operand Function 0700 Alternating between ON and OFF Device “$”       Data type  Pulse instruction 16-Bit instruction 32-Bit instruction -...
  • Page 460 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 2 In the beginning, M0 is OFF; therefore, Y0.0 is ON, and Y0.1 is OFF. When X0.0 switches from OFF to ON for the first time, M0 is ON; therefore, Y0.0 is OFF, and Y0.1 is ON. When X0.0 switches from OFF to ON for the second time, M0 is OFF;...
  • Page 461 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0701 TTMR D, n Teach mode timer Device “$”           Data type     Pulse instruction 16-Bit instruction 32-Bit instruction...
  • Page 462 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 1 The instruction multiplies the time for which the button switch X0.0 has been turned ON by n, and stores the product in D0. You can use the button switch (ON) to record the time. When X0.0 is switched OFF, the value in D0 is unchanged.
  • Page 463 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0702 STMR S, m, D Special timer Device “$”              Data type  ...
  • Page 464 Ch ap te r 6 Ap pl ie d Instruc ti ons Example When X0.0 is ON, the instruction specifies the timer T0, and the setting value of T0 is five seconds. Y0.0 is the off-delay contact. When X0.0 switches to ON, Y0.0 is ON. Five seconds after X0.0 switches to OFF, Y0.0 is OFF.
  • Page 465 AS Ser ies Pro gra mm in g M anu al Additional remarks If D+3 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 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. If you declare the operand D in ISPSoft, the data type is ARRAY [4] of BOOL.
  • Page 466 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0703 RAMP , D, n Cyclic ramp signal Device “$”               ...
  • Page 467 AS Ser ies Pro gra mm in g M anu al Only the 32-bit instructions can use the 32-bit counter, but not the device E. 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.
  • Page 468 Ch ap te r 6 Ap pl ie d Instruc ti ons SM686=O N SM686=O FF X0.0 X0.0 T he signal is enabled. T he signal is enabled. SM687 SM687 Additional remarks If D+1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 469 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0704 S, D Matrix input Device “$”               Data type   ...
  • Page 470 Ch ap te r 6 Ap pl ie d Instruc ti ons Additional remarks, below. In general, the conditional contact used in the instruction is SM400: the flag is always ON when CPU runs. The value in n must be between 2–8. Example 1 When M0 is ON, the MTR instruction is executed.
  • Page 471 AS Ser ies Pro gra mm in g M anu al T he first row of i nput s ignals ar e r ead. Y0.0 T he second r ow of input s ignal s ar e read. Y0.1 Additional remarks 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.
  • Page 472 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0705 ABSD , D, n Absolute drum sequencer Device “$”               ...
  • Page 473 AS Ser ies Pro gra mm in g M anu al 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...
  • Page 474 Ch ap te r 6 Ap pl ie d Instruc ti ons Additional remarks 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. 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.
  • Page 475 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0706 INCD , n, D Incremental drum sequencer Device “$”                ...
  • Page 476 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 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. The instruction compares the current values in C10 with the setting values in D100–D104.
  • Page 477 AS Ser ies Pro gra mm in g M anu al X0.0 Current v alue Current v alue SM688 Additional remarks If S +1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 478 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function As shown in the following table 0708 PIDE PID algorithm Device “$”      PID_RUN       ...
  • Page 479 AS Ser ies Pro gra mm in g M anu al Symbol : Enable/Disable the instruction : Enable the PID algorithm PID_RUN : Target value (SV) : Process value (PV) : PID control mode PID_MODE : PID Auto/Manual mode PID_MAN :...
  • Page 480 Ch ap te r 6 Ap pl ie d Instruc ti ons Operand Data type Function Setting range Description 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...
  • Page 481 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description automatic algorithm. If the MV exceeds the limits of MV_MAX or MV_MIN, I_MV use the formula to calculate the correct value and adjust its value accordingly.
  • Page 482 Ch ap te r 6 Ap pl ie d Instruc ti ons Operand Data type Function Setting range Description sampling time automatically. If T less than 1, it is counted as 1. If T larger than 40,000, it is counted as 40,000. When using the PID instruction in an interval interrupt task,...
  • Page 483 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description Range of If the calculated positive coefficient D is less single- than 0, Td_Kd is 0. If Derivative coefficient (Td or Kd, Ti_Ki is 0, it is not precision Td_Kd...
  • Page 484 Ch ap te r 6 Ap pl ie d Instruc ti ons Operand Data type Function Setting range Description module checks whether the present error is less than the absolute value of ERR_DBW, and checks whether the present error meets the cross status condition.
  • Page 485 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description single- set to -1,000. When the MV is less than - precision 1,000, -1,000 is the floating- output. point numbers Range of When set to PID single- Manual, the MV value...
  • Page 486 Ch ap te r 6 Ap pl ie d Instruc ti ons Operand Data type Function Setting range Description (Automatic control, including I_MV): When PID_MAN switches from TRUE to FALSE, the MV value is invoke the output value (MV) in the automatic algorithm.
  • Page 487 AS Ser ies Pro gra mm in g M anu al The diagram of switching to PID_MAN / MOUT_AUTO: PID_MAN FALSE Calculation Manual input TRUE MOUT TRUE FALSE MOUT_AUTO 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.
  • Page 488 Ch ap te r 6 Ap pl ie d Instruc ti ons interval between the timed interrupt tasks. The PID algorithm is applied according to the interval between the timed interrupt tasks. 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.
  • Page 489 AS Ser ies Pro gra mm in g M anu al   ∫ E = SV – PV − BIAS       ∫ E = PV – SV BIAS     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.
  • Page 490 Ch ap te r 6 Ap pl ie d Instruc ti ons PID Block Diagram (Dependent) PID_D IR PID-P DEAD BAND REVERSE X(-1) Kc_Kp Kc_Kp ERR_DBW >0 <=0 PID_MAN BIAS MV_LIMIT Ti_Ki PID-I >0 MV_MAX, M V_MIN <=0 Ti_Ki MOUT_AUTO MOUT MOUT Td_Kd...
  • Page 491 AS Ser ies Pro gra mm in g M anu al Example 2: Tuning the parameters used with the PID instruction Suppose that the transfer function of the plant is the first-order function , the SV is 1, the sampling time Ts is 10 milliseconds.
  • Page 492 Ch ap te r 6 Ap pl ie d Instruc ti 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).
  • Page 493 AS Ser ies Pro gra mm in g M anu al The following graph shows the result of using the automatically tuned parameters to control the temperature. 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.
  • Page 494 Ch ap te r 6 Ap pl ie d Instruc ti ons 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.
  • Page 495 AS Ser ies Pro gra mm in g M anu al NOTE: The 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. 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.) Set the time interrupt to 1000 ms in HWCONFIG.
  • Page 496 Ch ap te r 6 Ap pl ie d Instruc ti ons Time interrupt program I601 and the setting parameters 6 - 2 1 7...
  • Page 497 Explanation This instruction is only available for AS Series PLCs with firmware version 1.04.00 or higher. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called only once.
  • Page 498 Ch ap te r 6 Ap pl ie d Instruc ti ons 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;...
  • Page 499 AS Ser ies Pro gra mm in g M anu al ‧‧‧ Function Work station 1 Work station 2 Work station n ‧‧‧ Value of the head index (16-bit) D+(n-1) ‧‧‧ Value of the tail index (16-bit) D+(n+1) D+(2xn-1) ‧‧‧ Compared stack area 1 for the D+2xn D+2xn+2...
  • Page 500 Ch ap te r 6 Ap pl ie d Instruc ti ons ⑤ Record the counter value to the compared stack area for the leaving-work-station ones, when the signal is stable. For PLC with FW V1.06.00 (V1.06.00 included) or higher versions: The following timing diagram shows executing the high-speed counter and filter (reading from right to left).
  • Page 501 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 502 Explanation This instruction is only available for AS Series PLCs with firmware version 1.04.00 or higher. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called only once. 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.
  • Page 503 AS Ser ies Pro gra mm in g M anu al There is no limit on the number of times you can execute the instruction but only one execution can be done at a time. 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 (S D is only for the outputs of Y and M devices;...
  • Page 504 Ch ap te r 6 Ap pl ie d Instruc ti ons Step 2: edit the register to set up the reference values, and the observational error when entering and leaving. Device D D500 D502 D504 Reference value for comparison (32-bit) K2000 K3000 K4000...
  • Page 505 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 506 Ch ap te r 6 Ap pl ie d Instruc ti ons Compared stack area 3 for the entering -work- station ones (32-bit) Device D number D2036 D2038 D2040 Compared stack area 3 for the 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.0 Y0.1...
  • Page 507 AS Ser ies Pro gra mm in g M anu al The following table shows the state of the output point Y when the high-speed counter HC202 reaching 6800. Output point Y number Y0.0 Y0.1 Y0.2 16-bit value Device D number D2000 D2001 D2002...
  • Page 508 Ch ap te r 6 Ap pl ie d Instruc ti 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.0 Y0.1 Y0.2 Output state Device D number D2000 D2001 D2002...
  • Page 509 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0711 SUNRS Longi ~ SSec Sunrise and sunset times Device “$”   Longi   Lati   TimeZ      ...
  • Page 510 Explanation The instruction works with the AS series PLC firmware V1.04.50 or later. 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.
  • Page 511 AS Ser ies Pro gra mm in g M anu al 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 - 2 3 2...
  • Page 512: Logic Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 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 Function instruction 16-bit 32-bit  Logical AND operation 0800 WAND DAND...
  • Page 513: Explanation Of Logic Instructions

    AS Ser ies Pro gra mm in g M anu al 6.9.2 Explanation of Logic Instructions Instruction code Operand Function 0800 WAND Logical AND operation Device “$”              ...
  • Page 514 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 2 When X0.0 is ON, the instruction performs the logical operation AND on each pair of corresponding bits in the 32-bit device (Y11, Y10) and the 32-bit device (Y21, Y20). It stores the result in (Y41, Y40). Before the instruction Y11 Y1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1...
  • Page 515 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 0801 MAND , D, n Matrix AND operation Device “$”                ...
  • Page 516 Ch ap te r 6 Ap pl ie d Instruc ti ons 1 1 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 1 1 1 1 1 1 1 1 0 0 0 0 1 1 Before the instruction is executed...
  • Page 517 AS Ser ies Pro gra mm in g M anu al Right Left Width: 16 bits 1 1 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 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0...
  • Page 518 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0802 Logical OR operation Device “$”                   ...
  • Page 519 AS Ser ies Pro gra mm in g M anu al Example 1 When X0.0 is ON, This instruction performs the logical inclusive operation OR on each pair of corresponding bits in the 16-bit device Y0 and the 16-bit device Y2. It stores the operation result in Y4. 011 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Before the instruction is executed...
  • Page 520 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0803 , D, n Matrix OR operation Device “$”                ...
  • Page 521 AS Ser ies Pro gra mm in g M anu al Example When X0.0 is ON, the instruction performs the matrix operation OR on each pair of corresponding bits in the 16-bit devices Y0–Y2 and the data in 16-bit devices Y10–Y12. It stores the operation result in the 16-bit devices Y20–Y22. 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 After the 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1...
  • Page 522 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0804 WXOR Logical exclusive OR operation Device “$”                 ...
  • Page 523 AS Ser ies Pro gra mm in g M anu al Example 1 When X0.0 is ON, the instruction performs the exclusive operation OR on each pair of corresponding bits in the 16-bit device Y0 and the 16-bit device Y2. It stores the operation result in Y4. 011 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Before the instruction is executed...
  • Page 524 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0805 MXOR , D, n Matrix exclusive OR operation Device “$”              ...
  • Page 525 AS Ser ies Pro gra mm in g M anu al Example When X0.0 is ON, the instruction performs the matrix exclusive operation OR on each pair of corresponding bits in the 16-bit devices Y0–Y2 and the data in 16-bit devices Y10–Y12. It stores the operation result in the 16-bit devices Y20– Y22.
  • Page 526 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0808 WINV S, D Logical reversed INV operation Device “$”               ...
  • Page 527 AS Ser ies Pro gra mm in g M anu al Example 2 When X0.0 is ON, the instruction performs the INV operation on each pair of corresponding bits in the 32-bit devices Y11–Y10. It stores the operation result in the 32-bit device Y41–Y40. 6 - 2 4 8...
  • Page 528 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0809- 0811 D LD# Contact type of logical operation LD# Device “$”             ...
  • Page 529 AS Ser ies Pro gra mm in g M anu al Example 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, Y1.0 is ON. 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 X1.0 is ON, Y1.1 is ON.
  • Page 530 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0812- 0814 D AND# Contact type of logical operation AND# Device “$”             ...
  • Page 531 AS Ser ies Pro gra mm in g M anu al Example When X0.0 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, Y1.0 is ON. When X0.1 is OFF, the instruction performs the logical operation OR on each pair of corresponding bits in D10 and D0.
  • Page 532 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 0815- 0817 D OR# Contact type of logical operation OR# Device “$”             ...
  • Page 533 AS Ser ies Pro gra mm in g M anu al Example When X0.1 is ON, Y0.0 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, Y0.0 is ON. When X0.2 and X0.3 are ON, Y0.1 is ON.
  • Page 534: Rotation Instructions

    Ch a pt er 6 Ap p l i ed I ns t r uc t i ons 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 Function instruction 16-bit...
  • Page 535: Explanation Of Rotation Instructions

    A S S er i es Pr og r am m ing M an u a l 6.10.2 Explanation of Rotation Instructions Function Instruction code Operand 0900 D, n Rotating bits in a group to the right Device “$”  ...
  • Page 536 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example When X0.0 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.
  • Page 537 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Rotating bits in a group to the right with 0901 D, n the carry flag Device “$”   ...
  • Page 538 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example When X0.0 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.
  • Page 539 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function 0902 D, n Rotating bits in a group to the left Device “$”       ...
  • Page 540 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example When X0.0 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.
  • Page 541 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Rotating bits in a group to the left with the 0903 D, n carry flag Device “$”   ...
  • Page 542 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example When X0.0 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.
  • Page 543 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Rotating bits in a group to the right or the 0904 S, D, n left in a matrix Device “$”...
  • Page 544 Ch a pt er 6 Ap p l i ed I ns t r uc t i ons Example 1: When X0.0 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.
  • Page 545 A S S er i es Pr og r am m ing M an u a l Before the rotation Carry flag is executed ※ 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 SM614 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...
  • Page 546: Timer And Counter Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 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 Function instruction 16-bit...
  • Page 547: Explanation Of Timer And Counter Instructions

    AS Ser ies Pro gra mm in g M anu al 6.11.2 Explanation of Timer and Counter Instructions Instruction code Operand Function Resetting a contact or clearing a 1000 register Device “$”         ...
  • Page 548 Ch ap te r 6 Ap pl ie d Instruc ti ons Example When X0.0 is ON, the instruction sets Y0.5 to OFF. The instruction clears the 32-bit D1 and D0 to zero when X0.0 is ON. 6 - 2 6 9...
  • Page 549 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1001 16-bit timer (100ms) Device “$”      Data type    Pulse instruction 16-bit instruction 32-bit instruction - - Symbol :...
  • Page 550 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1002 TMRH 16-bit timer (1ms) Device “$”      Data type    Pulse instruction 16-bit instruction 32-bit instruction - -...
  • Page 551 AS Ser ies Pro gra mm in g M anu al 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. The general timers compare the timing values when the TMR instruction is scanned.
  • Page 552 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 4 (using accumulative type of counter; counts for 1 ms time window) When X0.0 is ON, the instruction loads the setting value 1000 to the timer T5. When the value of T5 is 500 and X0.0 switches from OFF to ON, T5 counts up from 500 to 1000, and the contact of T5 is ON (accumulative).
  • Page 553 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1003 16-bit counter Device “$”      Data type    Pulse instruction 16-bit instruction 32-bit instruction - - Symbol : Counter number :...
  • Page 554 Ch ap te r 6 Ap pl ie d Instruc ti ons 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.
  • Page 555 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1004 DCNT 32-bit counter Device “$”     Data type   Pulse instruction 16-bit instruction 32-bit instruction - Symbol : Counter value :...
  • Page 556 Ch ap te r 6 Ap pl ie d Instruc ti ons Since AS Series PLC is with various built-in input types, different maximum input frequency are suggested. See the table below for reference. It is possible that the maximum input frequency cannot be reached for the sinking and souring type.
  • Page 557 AS Ser ies Pro gra mm in g M anu al Additional remarks 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 time frequency (mode setting should be set before executing the DCNT instruction).
  • Page 558 Explanation of the high-speed counter: AS Series high-speed counters can be divided into hardware counters (up to a maximum of 200KHz input, and for differential input points up to 4MHz) and software counters (up to a maximum of 10KHz). Refer to hardware specification for more details on the input limit.
  • Page 559 AS Ser ies Pro gra mm in g M anu al Note 1: P: single-phase pulse input, D: Direction signal input, A and B: two phase two input, R: Reset signal input. Only one out of four input modes can be used in PLC programing. For example, if HC200 is edited, the HC20-HC203 can no longer be edited.
  • Page 560 Ch ap te r 6 Ap pl ie d Instruc ti ons HC249 HC250 HC251 HC252 HC253 Note 5: UP: single phase count-up input (same as CW), DN: single phase count-down input (same as CCW) 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.
  • Page 561 AS Ser ies Pro gra mm in g M anu al Starting the Reversing the Counting Count-up/count-down function Reset function direction mode HC No. SM No. Attribute Explanation SM No. SM No. SR No. HC244 SM344 Show/ set edge – triggered HC245 SM345...
  • Page 562 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1005 HSCS Setting high-speed comparison Device “$”         Data type     Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 563 AS Ser ies Pro gra mm in g M anu al Type Range of counter High-speed comparator High-speed interrupt numbers 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...
  • Page 564 Ch ap te r 6 Ap pl ie d Instruc ti ons 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, Y0.10 is ON, which outputs to the external output terminal Y0.10 in real time, and remains ON.
  • Page 565 AS Ser ies Pro gra mm in g M anu al 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 Y0.10 is ON.
  • Page 566 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1006 HSCR Resetting high-speed input comparison Device “$”          Data type     Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 567 AS Ser ies Pro gra mm in g M anu al Example 1 When M0 is ON and HC200 changes its current value from 99 to 100 or from 101 to 100, Y0.10 is reset to OFF. 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.
  • Page 568 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1007 High-speed input zone comparison Device “$”            Data type     ...
  • Page 569 AS Ser ies Pro gra mm in g M anu al If S specifies a hardware counter and the value of the specified counter reaches the lower bound (S or the upper bound (S ), 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.
  • Page 570 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1008 Detecting speed Device “$”       Data type      Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 571 AS Ser ies Pro gra mm in g M anu al Example You can use the DSPD instruction for speed detection where there is an input pulse signal at X0.0. 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 X0.0 is 15kHz (7500/500ms).
  • Page 572 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1009 Detecting pulse width Device “$”          Data type       Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 573 AS Ser ies Pro gra mm in g M anu al The instruction stores the pulse width detection time (32-bit value) in D 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.
  • Page 574 Ch ap te r 6 Ap pl ie d Instruc ti ons 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.
  • Page 575 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Capturing the high-speed count value in the 1010 external input interrupt Device “$”    Data type     Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 576 Ch ap te r 6 Ap pl ie d Instruc ti ons enable disable disable DCAP     1000 2000 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.
  • Page 577 AS Ser ies Pro gra mm in g M anu al External interrupt is triggered by the rising edge at X0.7. External interrupt is triggered by the falling edge at X0.7. 6 - 2 9 8...
  • Page 578 Ch ap te r 6 Ap pl ie d Instruc ti ons Additional remarks When M0 is ON, the DCAP instruction is enabled. When an external interrupt occurs at X0.7, the instruction captures the value in HC200 and stores it in (32-bit) D0. 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.
  • Page 579 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1011 TMRM 16-bit timer (10ms) Device “$”      Data type    Pulse instruction 16-bit instruction 32-bit instruction - - Symbol :...
  • Page 580 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction Operand Description The start of the instruction execution time 1012 IETS measurement Device “$”  Data type   Pulse Instruction 16-bit instruction 32-bit instruction - Symbol The time measurement result Explanation The IETS instruction need be used with the API1013 IETE instruction together in order to measure the time for the...
  • Page 581 AS Ser ies Pro gra mm in g M anu al 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 - 3 0 2...
  • Page 582 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction Operand Description The end of the instruction execution time ─ 1013 IETE measurement Device “$” Data type Pulse Instruction 16-bit instruction 32-bit instruction - 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.
  • Page 583 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1014 HSCY HCno ~ CurNo Cyclic counting, comparing and outputting Device “$”  HCno    CmpLen    CmpS   Action  ...
  • Page 584 Ch ap te r 6 Ap pl ie d Instruc ti ons 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 (Current Group (The source value of data in 32-...
  • Page 585 AS Ser ies Pro gra mm in g M anu al   When the current counter value reaches 4500, CurNo = 4 and Y0.4 is OFF.   When the current counter value reaches 5500, CurNo = 5 and Y0.5 is OFF. ...
  • Page 586 Ch ap te r 6 Ap pl ie d Instruc ti ons Example: Define the following parameters as below. CurNo CmpS Action (Action to be taken when (Current Group (The source value of data in 32- (The number of the comparison is made.) Number) bit to be compared) Y output point)
  • Page 587 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description Detecting the time difference between two 1015 PPDT HCno ~ CurNo phases Device “$”  XnoA  XnoB  PhaseT    Data type  XnoA ...
  • Page 588 Ch ap te r 6 Ap pl ie d Instruc ti ons See the example in chronological illustration below. XnoA XnoB PhaseT 3000 2900        Whenever this instruction is firstly activated, it clears the value in PhaseT and sets the Exe flag to OFF. ...
  • Page 589: Shift Instructions

    A S S er i es Pr og r am m ing M an u a l 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 Function instruction 16-bit...
  • Page 590: Explanation Of Shift Instructions

    C ha pt er 6 A p pl i e d In s tr uc t io ns 6.12.2 Explanation of Shift Instructions Function Instruction code Operand Shifting the states of devices to the 1100 SFTR S, D, n right Device “$”...
  • Page 591 A S S er i es Pr og r am m ing M an u a l → Being carried  M3-M0 → M3-M0  M7-M4 → M7-M4  M11-M8 → M11-M8  M15-M12 → M15-M12  X0.3-X0.0 F our bits as a group ar e shifted to the r ight. X 0.3 X 0.2 X 0.1 X 0.0 M1 5 M1 4 M1 3 M1 2 M11 M1 0 M9 Example 2...
  • Page 592 C ha pt er 6 A p pl i e d In s tr uc t io ns F ive bits as a group is s hifted to the right. X 0.3 X 0.2 X 0.1 X 0.0 X 0.4 M1 5 M1 4 M1 3 M1 2 M11 M1 0 M9 Additional remarks If S+n...
  • Page 593 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, D, n 1101 SFTL Shifting the states of devices to the left Device “$”     ...
  • Page 594 C ha pt er 6 A p pl i e d In s tr uc t io ns → Being carried  M15-M12 → M15-M12  M11-M8 → M11-M8  M7-M4 → M7-M4  M3-M0 → M3-M0  X0.3-X0.0 F our bits as a group ar e shifted to the left X 0.3 X 0.2 X 0.1 X 0.0 Being c arri ed M1 5 M1 4 M1 3 M1 2...
  • Page 595 A S S er i es Pr og r am m ing M an u a l F ive bits as a group ar e shifted to the left. X 0.4 X 0.3 X 0.2 X 0.1 X 0.0 Being c arri ed M1 5 M1 4 M1 3 M1 2 M11 M1 0 M9 Additional remarks...
  • Page 596 C ha pt er 6 A p pl i e d In s tr uc t io ns Instruction code Operand Function Shifting the data in word devices to the S, D, n 1102 WSFR right Device “$”   ...
  • Page 597 A S S er i es Pr og r am m ing M an u a l Example 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. The shift of the data in the word devices to the right during a scan (M0 switches from OFF to ON) is shown below.
  • Page 598 C ha pt er 6 A p pl i e d In s tr uc t io ns F ive re gi sters as a group are shifter to the ri ght. Fiv e regis ters as a g roup a re s hifted to t he r ight. D 1 4 D 1 3 D 1 2...
  • Page 599 A S S er i es Pr og r am m ing M an u a l Two 32-bit registers as a group are shifted to the right. Being carried D 26 Additional remarks 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.
  • Page 600 C ha pt er 6 A p pl i e d In s tr uc t io ns Instruction code Operand Function S, D, n 1103 WSFL Shifting the data in word devices to the left Device “$”   ...
  • Page 601 A S S er i es Pr og r am m ing M an u a l Example 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. The shift of the data in the word devices to the left during a scan (M0 switches from OFF to ON) is shown below.
  • Page 602 C ha pt er 6 A p pl i e d In s tr uc t io ns F ive r egi sters as a group ar e shifted to the left. D1 4 D1 3 D1 2 D1 0 Being c arri ed D3 5 D3 4 D3 3 D3 2 D3 1 D3 0 D2 9...
  • Page 603 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Shifting the data and writing it into a word S, D, n 1104 SFWR device Device “$”   ...
  • Page 604 C ha pt er 6 A p pl i e d In s tr uc t io ns Example 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.
  • Page 605 A S S er i es Pr og r am m ing M an u a l Example 2 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/D21 into D2/D3, and increments the value in D0/D1 to 1.
  • Page 606 C ha pt er 6 A p pl i e d In s tr uc t io ns Instruction code Operand Function Shifting the data and reading it from a S, D, n 1105 SFRD word device Device “$”  ...
  • Page 607 A S S er i es Pr og r am m ing M an u a l Example 1 Supposedly the value in D20 is 10, when M0 switches from OFF to ON, the instruction writes the data in D21 into D0, shifts the data in D29–D22 one place to the right, leaves the data in D29 unchanged, and the decrements the value in D20 by one.
  • Page 608 C ha pt er 6 A p pl i e d In s tr uc t io ns Pointer D 28 The data is read. Additional remarks 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. 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.
  • Page 609 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, D 1106 SFPO Reading the latest data from a data list Device “$”      ...
  • Page 610 C ha pt er 6 A p pl i e d In s tr uc t io ns Example 1 Supposedly the value in D0 is 7, when 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.
  • Page 611 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function S, D, n 1107 SFDEL Deleting data from a data list Device “$”       ...
  • Page 612 C ha pt er 6 A p pl i e d In s tr uc t io ns Example 1 Supposedly the value in D0 is 9, and n is 4. When M0 is ON, the instruction stores the data in D4 to D20. And then the instruction deletes the data in D4.
  • Page 613 A S S er i es Pr og r am m ing M an u a l Additional remarks 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. If S+n exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 614 C ha pt er 6 A p pl i e d In s tr uc t io ns Instruction code Operand Function S, D, n 1108 SFINS Inserting data into a data list Device “$”      ...
  • Page 615 A S S er i es Pr og r am m ing M an u a l Example 1 Supposedly 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.
  • Page 616 C ha pt er 6 A p pl i e d In s tr uc t io ns Instruction code Operand Function S, D, n Shifting matrix bits 1109 Device “$”          ...
  • Page 617 A S S er i es Pr og r am m ing M an u a l Borr ow flag b 15 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 Carry flag 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 After the s hift...
  • Page 618 C ha pt er 6 A p pl i e d In s tr uc t io ns Additional remarks 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.
  • Page 619 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Shifting the values of the bits in registers D, n 1110 by n bits to the right Device “$” ...
  • Page 620 C ha pt er 6 A p pl i e d In s tr uc t io ns Carry flag ※ b 15 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 After the shift Carry flag b 15 0 0 0...
  • Page 621 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Shifting the values of the bits in registers D, n 1111 by n bits to the left Device “$” ...
  • Page 622 C ha pt er 6 A p pl i e d In s tr uc t io ns Carry flag ※ b 15 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 After the s hift Carry flag b 15 1 1 0...
  • Page 623 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Shifting the states of n bit devices by one bit to the D, n 1112 BSFR right Device “$” ...
  • Page 624 C ha pt er 6 A p pl i e d In s tr uc t io ns Carry flag After the shift Carry flag Being c leared to 0 Additional remarks 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.
  • Page 625 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function Shifting the states of n bit devices by one D, n 1113 BSFL bit to the left Device “$” ...
  • Page 626 C ha pt er 6 A p pl i e d In s tr uc t io ns Carry flag After the s hift Carry flag Being c leared to 0 Additional remarks 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.
  • Page 627 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function D, n Shifting n registers to the right 1114 NSFR Device “$”        ...
  • Page 628 C ha pt er 6 A p pl i e d In s tr uc t io ns 9578 2235 After the shift 9578 2235 Being cleared to 0 Example 2 When M0 is ON, When M0 switches from OFF to ON, the instruction shifts the 7 pieces of 32-bit data in D0–D13 one place to the right, and clears the data in D12 to 0.
  • Page 629 A S S er i es Pr og r am m ing M an u a l Instruction code Operand Function D, n Shifting n registers to the left 1115 NSFL Device “$”        ...
  • Page 630 C ha pt er 6 A p pl i e d In s tr uc t io ns 9578 2235 After the shift 9578 2235 Being c leared to 0 Additional remarks 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.
  • Page 631: Data Processing Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit ...
  • Page 632 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Pulse Function instruction 16-bit 32-bit  1229 – FSORT Sorting data in floating-point format 6 - 3 5 3...
  • Page 633: Explanation Of Data Processing Instructions

    AS Ser ies Pro gra mm in g M anu al 6.13.2 Explanation of Data Processing Instructions Instruction code Operand Function 1200 Searching the data , D, n Device “$”           ...
  • Page 634 Ch ap te r 6 Ap pl ie d Instruc ti ons Device Description Number of equal values Data number of the first equal value Data number of the last equal value Data number of the minimum value Data number of the maximum value The operand n must be between 1–256.
  • Page 635 AS Ser ies Pro gra mm in g M anu al Compared Data Value Result Value Description data number Number of equal values Data number of the first Equal equal value Data number of the last equal value Data number of the minimum value Data number of the D0=100...
  • Page 636 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function Finding the number of bits whose states 1201 S, D are ON Device “$”           ...
  • Page 637 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1202 DECO S, D, n Decoding bits Device “$”                 ...
  • Page 638 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 1 When Y0.0 switches from OFF to ON, the DECO instruction decodes the values of the 3 bits in X0.0–X0.2 as the values of the 8 bits in M100–M107. The instruction adds the values of the 3 bits in X0.0–X0.2 to get the value 3.
  • Page 639 AS Ser ies Pro gra mm in g M anu al T he values of b15~b8 in D10 bec ome 0. Additional remarks 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.
  • Page 640 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1203 ENCO S, D, n Encoding bits Device “$”                ...
  • Page 641 AS Ser ies Pro gra mm in g M anu al values of the lower 3 bits in D0, and sets the values of b15–b3 in D0 to 0. After the ENCO instruction is executed and X0.0 switches to OFF, the data in D is unchanged. T he values of b15~b3 in D0 become 0.
  • Page 642 Ch ap te r 6 Ap pl ie d Instruc ti ons and the error code in SR0 is 16#2003. 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.
  • Page 643 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1204 SEGD S, D Seven-segment decoding Device “$”                 Data type ...
  • Page 644 Ch ap te r 6 Ap pl ie d Instruc ti ons The following table shows the relation between the seven-segment data and the bit pattern of source data. Segment s tate Bi t Assi gnment Dis play pattern of s egments B0(a) B1(b) B2(c) B3(d) B4(e)
  • Page 645 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1205 SORT S, m , D, n Sorting data Device “$”            Data type  ...
  • Page 646 Ch ap te r 6 Ap pl ie d Instruc ti ons Example Suppose SM604 is OFF. When X0.0 switches from OFF to ON, the instruction sorts the data in ascending order. The data which to be sorted is as in the following table. columns of data Column Column...
  • Page 647 AS Ser ies Pro gra mm in g M anu al When the value in D100 is 3, the data is sorted as in the following table. columns of data Column Column Student Chinese English Math Physics number (D50) 4 (D55) 70 (D60) 60 (D65) 99...
  • Page 648 Ch ap te r 6 Ap pl ie d Instruc ti ons 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. If m , or n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.
  • Page 649 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1206 ZRST Resetting a zone Device “$”                   ...
  • Page 650 Ch ap te r 6 Ap pl ie d Instruc ti ons Additional remarks If D and D are different types of devices, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2007. If D and D contain different data formats, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2007.
  • Page 651 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1207 S, D, n Checking the state of a bit Device “$”              ...
  • Page 652 Ch ap te r 6 Ap pl ie d Instruc ti ons 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 Y0.1=OFF 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 Y0.1=ON Additional remarks If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.
  • Page 653 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1208 MEAN S, D, n Finding the mean Device “$”                ...
  • Page 654 Ch ap te r 6 Ap pl ie d Instruc ti ons (D0+D1+D2)/3 After the instruction is executed T he quotient 2 is left out. Additional remarks 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.
  • Page 655 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1209 S, D, n Finding the sum check Device “$”                ...
  • Page 656 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 1 When SM606 is OFF, the instruction uses the 16-bit conversion mode. When X0.0 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.
  • Page 657 AS Ser ies Pro gra mm in g M anu al 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...
  • Page 658 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1210 Finding the absolute value Device “$”        Data type     Pulse instruction 16-bit instruction 32-bit instruction Symbol D :...
  • Page 659 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1211 MINV S, D, n Inverting matrix bits Device “$”                ...
  • Page 660 Ch ap te r 6 Ap pl ie d Instruc ti ons 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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 After the i nstruction is executed 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0...
  • Page 661 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1212 MBRD S, n, D Reading a matrix bit Device “$”               ...
  • Page 662 Ch ap te r 6 Ap pl ie d Instruc ti ons  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. ...
  • Page 663 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1213 MBWR S, n, D Writing a matrix bit Device “$”               ...
  • Page 664 Ch ap te r 6 Ap pl ie d Instruc ti ons b1 5 SM 6 15 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 D 20 D 20...
  • Page 665 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Counting the bits with the value zero or 1214 S, n, D Device “$”            ...
  • Page 666 Ch ap te r 6 Ap pl ie d Instruc ti ons 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 SM 617 1 1 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 SM 617 Additional remarks...
  • Page 667 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1215 S, n, D Disuniting 16-bit data Device “$”                 ...
  • Page 668 Ch ap te r 6 Ap pl ie d Instruc ti ons D1 0 D1 2 D1 3 T he positions in whcih All becomes 0. the data is stored. Additional remarks 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.
  • Page 669 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1216 S, n, D Uniting 16-bit data Device “$”                 ...
  • Page 670 Ch ap te r 6 Ap pl ie d Instruc ti ons D1 0 Additional remarks 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. If n not between 1–4, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B.
  • Page 671 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1217 WSUM S, n, D Getting the sum Device “$”                ...
  • Page 672 Ch ap te r 6 Ap pl ie d Instruc ti ons For 16-bit instructions, the value in n must be between 1–256. For 32-bit instructions, the value in n must be between 1–128. 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.
  • Page 673 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1221 LIMIT Confining a value within bounds Device “$”                 ...
  • Page 674 Ch ap te r 6 Ap pl ie d Instruc ti ons If the minimum output value in S is larger than the maximum output value in S , the instruction is not executed. Only the 32-bit instructions can use the 32-bit counter, but not the device E. Example ...
  • Page 675 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1222 BAND Deadband control Device “$”                    ...
  • Page 676 Ch ap te r 6 Ap pl ie d Instruc ti ons If the minimum value of the deadband in S is larger than the maximum value of the deadband in S , the instruction is not executed. Only the 32-bit instructions can use the 32-bit counter, but not the device E. The following graphs show how this instruction uses the deadband.
  • Page 677 AS Ser ies Pro gra mm in g M anu al Example 1 When X0.0 is ON, the instruction subtracts -1000 or 1000 from the binary-coded decimal value in X1, and stores the difference in D1. The following table shows the execution results. Minimum value Maximum Input value in...
  • Page 678 Ch ap te r 6 Ap pl ie d Instruc ti ons The following table shows the execution results. Minimum value Maximum Input value in Output value in of the value of the Function (D11, D10) (D1, D0) deadband deadband (D1,D0)<-10000 -12000 -2000...
  • Page 679 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1223 ZONE Controlling the zone Device “$”                   ...
  • Page 680 Ch ap te r 6 Ap pl ie d Instruc ti ons The following graphs show how this instruction uses the zone: Z ONE is not ex ec uted. Z ONE is exec uted. Output value Output value Positiv e deviation Input value Input value Negativ e deviation...
  • Page 681 AS Ser ies Pro gra mm in g M anu al The following table shows the execution results. Negative Positive Input value in Output value in D10 Function deviation deviation D0<0=>D10=(-10)+(-100) -110 -100 D0=0=>D10=0 D0>0=>D10=50+100 Example 2 When X0.0 is ON, the instruction adds -10000 or 10000 to the binary-coded decimal value in (X2, X1), and stores the sum in (D11, D10).
  • Page 682 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1224 FMEAN S, D, n Finding the mean of floating point numbers Device “$”          Data type ...
  • Page 683 AS Ser ies Pro gra mm in g M anu al [(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...
  • Page 684 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1225 FSUM S, n, D Finding the sum of floating point numbers Device “$”          Data type ...
  • Page 685 AS Ser ies Pro gra mm in g M anu al F lo at ing p oi nt nu mb ers F l oatin g po int n umbers 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).
  • Page 686 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction Operand Description 1226 S,D,m,n Data conversion and move Device “$”                Data type ...
  • Page 687 AS Ser ies Pro gra mm in g M anu al Parameter Description 8-bit data converted into 16-bit data (high 8 bits, low 8 bits) 8-bit data converted into 16-bit data (low 8 bits, high 8 bits) 16-bit data (high 8 bits, low 8 bits) converted into 8-bit data 16-bit data (low 8 bits, high 8 bits) converted into 8-bit data 8-bit hex data (high 4 bits, low 4 bits) converted into ASCII data 8-bit hex data (low 4 bits, high 4 bits) converted into ASCII data.
  • Page 688 Ch ap te r 6 Ap pl ie d Instruc ti ons  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 ...
  • Page 689 AS Ser ies Pro gra mm in g M anu al  When m=4: If n=3, the 8-bit hex data (high 4-bits, low 4-bits) is converted into the ASCII data and the conversion is as the following figure shows. Hi-byte Lo-byte Hi-byte Lo-byte H H...
  • Page 690 Ch ap te r 6 Ap pl ie d Instruc ti ons  When m=7: If n=4, the 8-bit ASCII 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 ...
  • Page 691 AS Ser ies Pro gra mm in g M anu al  When m=19: Convert the floating-point value in source device S (Lo-byte) into a string value (operand n; decimal point excluded) and store this value in device D. Note: The setting value in operand n should be less than 8.
  • Page 692 Ch ap te r 6 Ap pl ie d Instruc ti ons  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;...
  • Page 693 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1228 ZSET SBit, EBit Zone setup Device “$”      SBit      EBit Data type  SBit  EBit Pulse Instruction 16-bit instruction 32-bit instruction...
  • Page 694 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1229 SORT src ~ ref Sorting data in floating-point format Device “$”     group    column    ...
  • Page 695 AS Ser ies Pro gra mm in g M anu al When SM604 is OFF, the instruction sorts the data in ascending order. When SM604 is ON, the instruction sorts the data in descending order. It is suggested that you use the pulse type instruction, FSORTP, instead of sorting repeatedly. Example Suppose SM604 is OFF.
  • Page 696 Ch ap te r 6 Ap pl ie d Instruc ti ons 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 Student Chinese English...
  • Page 697: Structure Creation Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit 1300 –...
  • Page 698: Explanation Of Structure Creation Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 6.14.2 Explanation of Structure Creation Instructions Instruction code Operand Function 1300 Starting a nested loop Device “$”          Data type ...
  • Page 699 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function - 1301 NEXT Ending a nested loop Pulse instruction 16-bit instruction 32-bit instruction - - Symbol Explanation 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).
  • Page 700 Ch ap te r 6 Ap pl ie d Instruc ti 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 X0.0 is OFF, the program between FOR and NEXT is executed.
  • Page 701 AS Ser ies Pro gra mm in g M anu al Example 3 If the program between FOR and NEXT is not to be executed, you can skip it with the CJ instruction. When X0.1 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.
  • Page 702 Ch ap te r 6 Ap pl ie d Instruc ti ons 6 - 4 2 3...
  • Page 703 AS Ser ies Pro gra mm in g M anu al Additional remarks Refer to the ISPSoft User Manual for more information on using labels. 6 - 4 2 4...
  • Page 704 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1302 BREAK Terminating the FOR-NEXT loop Device “$”       Data type   Pulse instruction 16-bit instruction 32-bit instruction -...
  • Page 705 AS Ser ies Pro gra mm in g M anu al Additional remarks 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. Refer to the ISPSoft User Manual for more information on using labels.
  • Page 706: Module Instructions

    Cha p ter 6 A pp l ied Ins truc tio 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 Function instruction 16-bit 32-bit  1400 FROM DFROM Reading data from the control register in an extension module...
  • Page 707: Explanation Of Module Instructions

    AS Ser ies Pro gra mm in g M anu al 6.15.2 Explanation of Module Instructions Instruction code Operand Function Reading data from the control 1400 FROM register in an extension module Device “$”       ...
  • Page 708 Explanation This instruction reads data from the control register in an extension module. All registers are listed and detailed in the AS Series Module Manual. The value in m must be between 0–16. Zero represents the CPU module, and 1–16 represent the extension modules.
  • Page 709 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 710 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function Writing data into the control register in an 1401 extension module Device “$”             ...
  • Page 711 Explanation This instruction writes data to the control register in an extension module. All registers are listed and detailed in the AS Series Module Manual. The value in m must be between 0–16. Zero represents the CPU module, and 1–16 represent the extension modules.
  • Page 712 Cha p ter 6 App l ied Ins truc tio ns Additional remarks If the values in m and m exceed their range, an operation error occurs, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. If D +n-1 exceed the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 713 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description Setting output control parameters of 1402 PUCONF Module ~ Error, ErrCode PU module Device “$”    Module    Axis    Mode ...
  • Page 714 Cha p ter 6 App l ied Ins truc tio 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 home position...
  • Page 715 AS Ser ies Pro gra mm in g M anu al (An odd-number point) direction. Y0.1: ON, negative direction; Y0.1: OFF, positive direction CW (An even-number point) + CCW (An E.g. Y0.0 is for CW (positive direction) and odd-number point) Y0.1 is for CCW (negative direction) E.g.
  • Page 716 Cha p ter 6 App l ied Ins truc tio ns 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.
  • Page 717 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1403 PUSTAT Module ~ ErrCode Reading PU module output state Device “$”    Module    Axis      ZeroS ...
  • Page 718 Cha p ter 6 App l ied Ins truc tio ns Explanation This instruction is available for PLC with FW V1.08.00 or later. For ISPSoft, we recommend using software version 3.12 and above. The En setting must be set to ON so as to update the status of the selected axes continuously. Module sets the serial number of modules at the right of the PLC.
  • Page 719 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description PU module output pulse 1404 PUPLS Module ~ ErrCode (no acceleration) Device “$”    Module    Axis    TarPulse  ...
  • Page 720 Cha p ter 6 App l ied Ins truc tio ns The instruction is exclusive to the PU modules at the right of the PLC and 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. Axis sets the output axis number for the specified PU module.
  • Page 721 AS Ser ies Pro gra mm in g M anu al Error code Description 16#1400 The module does not support the function. 16#1401 The value stored in the module is illegal or exceeds the allowed range. 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.
  • Page 722 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description Relative position output of PU module 1405 PUDRI Module ~ ErrCode (with acceleration and deceleration) Device “$”    Module    Axis  ...
  • Page 723 AS Ser ies Pro gra mm in g M anu al Axis sets the output axis number for the specified PU module. The setting values 1~4 represent the axis1~axis4 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.
  • Page 724 Cha p ter 6 App l ied Ins truc tio ns 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.
  • Page 725 AS Ser ies Pro gra mm in g M anu al When M10 is set to ON, DPUCONF instruction would be executed for axis1 to change the output setting to 1 (Pulse Y0.0+ Direction Y0.1) in Mode. Set SSpeed (the speed for starting) to 200Hz, Atime (acceleration time) to 200 ms, Dtime (deceleration time) to 200ms, MSpeed (maximum output frequency) to 100kHz, Z_NO (Number of Z phases to look for after returning to the home position) to 1, offset (the number of outputs after returning to the home position) to -100, and set M11 to ON when the Done flag changes to ON.
  • Page 726 Cha p ter 6 App l ied Ins truc tio ns 6-447...
  • Page 727 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description Absolute addressing output of PU 1406 PUDRA Module ~ ErrCode module (with acceleration and deceleration) Device “$”    Module    Axis  ...
  • Page 728 Cha p ter 6 App l ied Ins truc tio ns Explanation This instruction is available for PLC with FW V1.08.00 or later. For ISPSoft, we recommend using software version 3.12 and above. When En setting is set to ON, this instruction would be effective. Once the setting changes to OFF, Output pulse would decelerate until it stops.
  • Page 729 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1407 PUZRN Module ~ ErrCode PU module homing Device “$”    Module    Axis    Mode    TarSpeed ...
  • Page 730 Cha p ter 6 App l ied Ins truc tio ns 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 32. The instruction is exclusive to the PU modules at the right of the PLC and is not applicable to the PU modules at the right of the remote module.
  • Page 731 AS Ser ies Pro gra mm in g M anu al Note 1: The specified homing behavior may not be realized if the input points for the selected mode are not used together with the settings in HWCONFIG. Note 2: Mode 1~4 FW V1.02.00: after the execution of this instruction, the current output position of the axis will not be cleared to zero.
  • Page 732 Cha p ter 6 App l ied Ins truc tio ns 16#1403 There is no such output axis number in the PU module. 16#1404 The output frequency of the PU module is illegal. The output axis specified by the PU module is outputting data. It is not allowed to 16#1405 specify the output repeatedly.
  • Page 733 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1408 PUJOG Module - ErrCode PU module jog output Device “$”    Module    Axis    JogSpeed    ...
  • Page 734 Cha p ter 6 App l ied Ins truc tio ns Axis sets the output axis number for the specified PU module. The setting values 1~4 represent the axis1~axis4 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.
  • Page 735 AS Ser ies Pro gra mm in g M anu al Programming Example Configure parameters of AS02PU module in HWCONFIG. Set “Pulse Y0.0+ Direction 0.1” for the output point. Parameters of axis 1 are set as default. When M0=ON, execute DPUJOG on axis 1 to perform jog outputs. Pulses would be output from Y0.0 at 1kHz frequency.
  • Page 736 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description 1409 PUMPG Module ~ ErrCode PU module MPG output Device “$”    Module    Axis    InMode  InPulse  InSpeed ...
  • Page 737 AS Ser ies Pro gra mm in g M anu al 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)
  • Page 738 Cha p ter 6 App l ied Ins truc tio ns 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.
  • Page 739 AS Ser ies Pro gra mm in g M anu al 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#1401 The data stored in the module is illegal or exceeds the allowed range. 16#1402 There is no response from the module;...
  • Page 740 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description High-speed counter function of PU 1410 PUCNT Module ~ ErrCode module Device “$”    Module    InMode    Period  ...
  • Page 741 AS Ser ies Pro gra mm in g M anu al Explanation This instruction is available for PLC with FW V1.08.00 or later. For ISPSoft, we recommend using software version 3.12 and above. The DPUCNT instruction supports AS02PU module only. When En setting is set to ON, this instruction would be effective.
  • Page 742 Cha p ter 6 App l ied Ins truc tio ns 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. InSpeed displays the counting value for every Period time, which is a signed 32-bit value.
  • Page 743 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1415 LCCAL Group, Module ~ ErrCode LC module channel calibration Device “$”    Group    Module    ChNo   ...
  • Page 744 Cha p ter 6 App l ied Ins truc tio ns Symbol Group : Group number Module : Module number ChNo Channel number Trigger : Trigger the calibration TPoint : Number of all calibration points TWeight : Calibration weight value Number of the point for which the calibration has CPoint : been completed.
  • Page 745 AS Ser ies Pro gra mm in g M anu al (High Word). Once the execution of this instruction started, the value of TWeight is sent to the LC module for calibration. You cannot change the value of TWeight after the instruction is executed. the value of the first point for calibration weight should be 0 (zero correction).
  • Page 746 Cha p ter 6 App l ied Ins truc tio ns Explanation of the timing points in the above sequence diagram:   The LCCAL instruction is enabled and the CPoint value and the flags Trigger, Done, ADone and Error are all cleared automatically.
  • Page 747 AS Ser ies Pro gra mm in g M anu al 6-468...
  • Page 748 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description 1416 LCWEI Group, Module ~ ErrCode Reading weight value via LC module Device “$”    Group    Module    ChNo ...
  • Page 749 This instruction is available for PLC with FW V1.06.00 or later and ISPSoft V3.08 or later. The LCWEI instruction supports AS series LC module only. Before the instruction is used, you should get to know the configuration position of current module from HWCONFIG.
  • Page 750 Cha p ter 6 App l ied Ins truc tio ns Status is a commonly used status code for the instruction to integrate LC module. See the explanation of status values in the following table. Value Module Hardware Weight Weight number error Weight is fault/...
  • Page 751 AS Ser ies Pro gra mm in g M anu al The error codes that ErrCode shows are listed in the following table. Error code Description 16#1410 Error in the LC group number or module number 16#1411 The LC module has no such channel number 16#1414 Error in data-writing or communication timeout on LC module Example...
  • Page 752 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description 1417 MPID Group, Module ~ Error PID algorithm for RTD/TC module Device “$”    GROUP    MODULE      ...
  • Page 753 AS Ser ies Pro gra mm in g M anu al Symbol GROUP : Group number MODULE : Module number : Channel number UPDATE : Update PID parameters PID_RUN : Enable the PID algorithm : Target value (SV) PID_MODE : PID control mode PID_MAN : PID Auto/Manual mode MOUT_AUTO : Manual/Auto output value...
  • Page 754 Cha p ter 6 App l ied Ins truc tio ns Explanation This instruction is available for PLC with FW V1.06.00 or later and can only support the right-side modules. For PLC with FW V1.08.00 or later, it can support remote right-side modules (AS00SCM-A with FW V2.06 or later) as well. This instruction is available for AS04RTD-A (V1.04 or later), AS06RTD-A (V1.00 or later), AS04TC-A (V1.04 or later), and AS08TC-A (V1.00 or later).
  • Page 755 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description 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. DWORD/DINT Target value -32768~32767...
  • Page 756 Cha p ter 6 App l ied Ins truc tio ns Operand Data type Function Setting range Description SV is in the range of± dead band width If the P coefficient Range of is less than 0, the Calculated proportional positive single- Kc_Kp is 0.
  • Page 757 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description FALSE: independent formula TRUE: use the variations in the PV to calculate the control value of the derivative (Derivative of the PV). The calculation of the PID PID_DE BOOL...
  • Page 758 Cha p ter 6 App l ied Ins truc tio ns Operand Data type Function Setting range Description error is less than the absolute value of ERR_DBW, and meets the cross status condition, the present error is counted as 0, and the PLC applies the PID algorithm ;...
  • Page 759 AS Ser ies Pro gra mm in g M anu al Operand Data type Function Setting range Description feed forward. When the instruction is scanned, use the 1~1000 PID algorithm DWORD/DINT Sampling time (T CYCLE (unit: 100 ms) according to the sampling time, and refresh MV.
  • Page 760 Cha p ter 6 App l ied Ins truc tio ns Example You need to set up the parameters before executing DMPID. Switch the operand EN from False to True to execute this instruction and once the instruction is enabled, the parameters are applied to the modules. If you need to change parameters during execution, you can use the UPDATE flag to update the parameters (including PID_RUN ~ CYCLE).
  • Page 761 AS Ser ies Pro gra mm in g M anu al PID formula: 1. When the PID_MODE is set to 0, the mode is set to auto:  Independent Formula & Derivative of E(PID_EQ=False & PID_DE=False) ∫ BIAS (E = SV – PV or E = PV – SV) ...
  • Page 762 Cha p ter 6 App l ied Ins truc tio ns  Dependent Formula & Derivative of PV(PID_EQ=True & PID_DE=True)   ∫ (E = SV – PV) BIAS −       ∫ (E = PV – SV) BIAS ...
  • Page 763 AS Ser ies Pro gra mm in g M anu al ERR_DBW When the PV (present 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 (present value) goes beyond the SV (target value).
  • Page 764 Cha p ter 6 App l ied Ins truc tio ns Formula of the output cycle: Set the output cycle according to the environment. If the environmental temperature changes not so aggressively, you can set a bigger output cycle.  Output pulse width = MV (%) x output cycle Execute the general pulse with modulation instruction (GPWM) to set Output pulse width and output cycle sampling time to manage the cycle.
  • Page 765 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1418 HCCNT Module ~ ErrCode HC module counter Device “$”    Module    ChNo     Update    Action ...
  • Page 766 Cha p ter 6 App l ied Ins truc tio ns Symbol Module : Module number ChNo Channel number Update : Parameter updating flag Action : Actions for the counter to act : New counting value / offset value Value CurCnt :...
  • Page 767 AS Ser ies Pro gra mm in g M anu al Action Function Description Mode the encoder counter value + the value in Value. Note: ≦ Value<2 (MT+ST Length-1) (MT+ST Range of the value in Value: -2 Length-1) . If the value is set out of the range, it is invalid. If you are using SSI (serial synchronous interface) encoder and the setting of counter type is Ring Counter, the Action mode here is invalid.
  • Page 768 Cha p ter 6 App l ied Ins truc tio ns Action Function Description Mode first value to be compared in the table, the comparison stops. If this happens, you can use the Update flag (ON) from the DHCCMPT instruction to perform comparison again. Clear the flags of Match1 and Match2 from DHCCMPT instruction.
  • Page 769 AS Ser ies Pro gra mm in g M anu al Bit number Status Description Remarks In HWCONFIG you can set the option to detect or not to detect. 0: normal − 1) or underflow Ring counter - (default: detection disabled) Overflow 1: abnormal Cause of the error: when either overflow (>2...
  • Page 770 Cha p ter 6 App l ied Ins truc tio ns Example 1: Setting / changing the current setting (Action = 1) Set M0=ON, the counter starts counting. In DHCCNT instruction, set the value in Action to 1 and the value in Value to 10000. When the Update flag M1 is ON, the value in CurCnt is updated to 10000.
  • Page 771 AS Ser ies Pro gra mm in g M anu al Example 2: Set the offset value in SSI encoder as the value in Value (Action = 2) In HWCONFIG, set the channel 1 as SSI input and set the counter mode to absolute position. Set M0=ON, the counter starts counting.
  • Page 772 Cha p ter 6 App l ied Ins truc tio ns Example 3: Set / change the absolute position value of the SSI encoder (Action = 3) In HWCONFIG, set the channel 1 as SSI input and set the counter mode to absolute position. Set M0=ON, the counter starts counting.
  • Page 773 AS Ser ies Pro gra mm in g M anu al Example 4: Reset / preset the current counter value (Action = 4, 6) Set M0=ON, the counter starts counting. In DHCCNT instruction, set the value in Action to 4. When the Update flag M1 is ON, the value in CurCnt is reset to 0.
  • Page 774 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description 1419 HCCAP Module ~ ErrCode HC module counter value captured Device “$”    Module    ChNo    TrgSel   Capt1 ...
  • Page 775 AS Ser ies Pro gra mm in g M anu al Explanation This instruction is for AS02HC-A only. You can start, stop the counter as well as set up and edit the counter value. This instruction is available for PLC with FW V1.08.or later and ISPSoft V3.10 or later. Use this instruction with DHCCNT instruction.
  • Page 776 Cha p ter 6 App l ied Ins truc tio ns Flags of Cmplt1 and Cmplt2 are indicators to see if the captures in Capt1 and Capt2 are complete. When Cmplt1/Cmplt2 is OFF  ON , it indicates the values in Cmplt1/Cmplt2 are updated. You can clear the flag to OFF. Even if you did not clear the Cmplt flags to OFF, the captured values can still be updated.
  • Page 777 AS Ser ies Pro gra mm in g M anu al TrgSel = 0 11000 Channel 1 8500 Counter 6000 Value 1800 CH1 Z-Phase Input Capt1 1800 8500 Cmplt1 Capt2 6000 11000 Cmplt2 * 1: Cmplt 1 is not cleared to OFF, the captured value still updates in Capt 1. *2: Cmplt 2 is cleared to OFF, the captured value still updates in Capt 2.
  • Page 778 Cha p ter 6 App l ied Ins truc tio ns Example 2: Capture the counter value by executing DHCCMP instruction and when Match 1/ Match 2 is OFF  ON in the other channel. Supposing you execute DHCCAP instruction on channel 2 and set TrgSel = 1, and use channel 1 for the execution of DHCCMP.
  • Page 779 AS Ser ies Pro gra mm in g M anu al TrgSel = 1 Channel 1 8000 Counter Value 2000 MATCH 2 is OFF to ON CH2 Comp2 on channel 2. Channel 2 Counter CH2 Comp1 Value MATCH 1 is OFF to ON on channel 2.
  • Page 780 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description 1420 HCDO Module ~ ErrCode HC module digital output point Device “$”    Module     Update    DOdata  DOstat ...
  • Page 781 AS Ser ies Pro gra mm in g M anu al DOdata: setting for the action of the output points b15~b4 Action of Y0.3 Action of Y0.2 Action of Y0.1 Action of Y0.0 0:OF 1:ON DOstat: setting for the state of the output points b15~b4 State of Y0.3 State of Y0.2...
  • Page 782 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description HC module counter value in comparison 1421 HCCMP Module ~ ErrCode for output Device “$”    Module    ChNo    ...
  • Page 783 AS Ser ies Pro gra mm in g M anu al Symbol : Module number Module : Channel number ChNo : Parameter updating flag Update : Compared value 1 Comp1 : Actions to take when the Comp1 is ON Action1 :...
  • Page 784 Cha p ter 6 App l ied Ins truc tio ns When the counter type is linear, the value in Comp 1 and Comp 2 should satisfy the following condition: the smallest counter value < Comp < the largest counter value. If you are using SSI (serial synchronous interface) encoder and the setting of counter mode is in Absolute Position.
  • Page 785 AS Ser ies Pro gra mm in g M anu al clear the counter value of its clear the counter value of its channel channel Clear the counter value of its Clear the counter value of its channel channel Clear the counter value of its Clear the counter value of its channel + OFF (appointed channel + OFF (appointed...
  • Page 786 Cha p ter 6 App l ied Ins truc tio ns ErrCode Description 16#1405 Input interface not selected. Instruction stops. 16#1406 Invalid value in Action 16#1409 Invalid value in Yno One of the counting channel of the HC module is executing output. Other channels cannot 16#1413 perform the same task at the same time.
  • Page 787 AS Ser ies Pro gra mm in g M anu al H’7FFFFFFF Comp1 Channel 1 Counter Value Comp2 H’80000000 MATCH1 Y0.0 MATCH2 Y0.1 Example 2: Clear the counter value of its channel when the counter value reached the set value. Set the value in Comp 1 to 2500, the value in Action1 to 2, and the value in Yno1 to 0;...
  • Page 788 Cha p ter 6 App l ied Ins truc tio ns Comp2 Comp1 Channel One Counter Value MATCH1 Y0.0 MATCH2 Y0.1 Example 3: Update the counter value of its channel when the counter value reached the set value. Set the value in Comp 1 to 5000, the value in Action1 to 3, and the value in Yno1 to 0; set the value in Comp 2 to 10000, the value in Action2 to 3, and the value in Yno2 to 1.
  • Page 789 AS Ser ies Pro gra mm in g M anu al New Comp2 New Comp1 Comp2 Comp1 Channel 1 Counter Value Update Flag MATCH1 Y0.0 MATCH2 Y0.1 6-510...
  • Page 790 Cha p ter 6 App l ied Ins truc tio ns Example 4: Execute interrupts when the counter value reached the set value. DHCCMP instruction can be used for interrupt. Set the flags of Match 1 and Match 2 as interrupts of I400 and I401 respectively.
  • Page 791 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description HC module counter value in group 1422 HCCMPT Module ~ ErrCode comparison for output Device “$”    Module    ChNo   ...
  • Page 792 Cha p ter 6 App l ied Ins truc tio ns Symbol : Module number Module : Channel number ChNo : Parameter updating flag Update CmpLen : Data length for comparison CompS : Compared value (32-bit) : Actions to take when the Compsis ON ActionS :...
  • Page 793 AS Ser ies Pro gra mm in g M anu al 10. CompS is where you store the values (in 32-bit integer format) for comparison. It takes several space of Dword in CmpLen consecutively. You need to arrange the values (should be non-identical) in order, either ascending or descending.
  • Page 794 Cha p ter 6 App l ied Ins truc tio ns Action Description Remarks No action Toggle between ON /OFF OFF + clear the counter value of its channel ON + clear the counter value of its channel When the counter value is cleared, the value Toggle between ON /OFF + clear the counter value in CurNo is also cleared to zero.
  • Page 795 AS Ser ies Pro gra mm in g M anu al 16. Comps(supposing D100), ActionS (supposing D200), YnoS (supposing D300), and the value in CmpLen is 6. CompS ActionS YnoS InoS CurNo Source value for To take when the (output point (interrupt number) comparison (32-bit) value is met...
  • Page 796 Cha p ter 6 App l ied Ins truc tio ns Example Set up the following parameters. CompS ActionS YnoS InoS CurNo Source value for To take when the (output point (interrupt number) comparison (32-bit) value is met number) D50 = 1000 D70 = 3 (Toggle) D80 = 0 (Y0.0) D90 = 400...
  • Page 797 AS Ser ies Pro gra mm in g M anu al 10000 9000 8000 7000 6000 5000 4000 3000 2000 1000 Channel 1 Counter Value CurNo Y0.0 Y0.1 Y0.2 Y0.3 6-518...
  • Page 798 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description HC module measurements of frequency 1423 HCMEAS Module ~ ErrCode and revolution Device “$”    Module    ChNo     Update ...
  • Page 799 AS Ser ies Pro gra mm in g M anu al : Error flag Error ErrCode : Error code Explanation This instruction is for AS02HC-A only. This instruction is available for PLC with FW V1.08.or later and ISPSoft V3.10 or later. Use this instruction with DHCCNT instruction.
  • Page 800 Cha p ter 6 App l ied Ins truc tio ns Avg is the average times and in the moving average of the measurement result, ranging from 1 to 10. 10. Freq is the measurement result of the average frequency; unit: Hz. The format is as below. CurCnt ( t + ����������������...
  • Page 801 AS Ser ies Pro gra mm in g M anu al Programming Example 1: Incremental encoder The motor speed can be monitored by executing DHCMEAS instruction as the following procedure shown. The resolution of the encoder in this example is set to 1000 PPR. Encoder Motor Set the input interface of the channel 1 to pulse input or SSI input in HWCONFIG.
  • Page 802 Cha p ter 6 App l ied Ins truc tio ns Programming Example2: Absolute SSI Encoder (27-bit) Continued with the previous example, now if changing the incremental encoder to the 13-bit absolute SSI encoder, the setting steps for DHCMEAS parameters are shown as follows. Set the input interface of the channel 1 to SSI input in HWCONFIG Set the value in Cnt/Rev to 8192, the value in Smpl to 1000 and the value in Avg to 10.
  • Page 803 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1424 ADLOG Listed as follows Data log of analog input modules Device “$”    Group    Module    ChNo  ...
  • Page 804 Cha p ter 6 App l ied Ins truc tio ns : The total number of all records Points : The number of records after being triggered PostTrg : The device to store data logs Datalog : The number of the accumulated log points CurNo :...
  • Page 805 AS Ser ies Pro gra mm in g M anu al Mode: Record mode. Modes supported by the corresponding models are listed as follows. Models Mode Mode name Description AS04AD-A Fixed period Perform recording periodically. AS06XA-A Fixed period Perform recording periodically. Wait for trigger signal detected at external input Fixed period + Trigger start points.
  • Page 806 Cha p ter 6 App l ied Ins truc tio ns Record The signal source corresponding to the external input points Channel (Set the timing for external input trigger in HWCONFIG) X0.0 rising-edge or falling-edge triggered Channel 1 Channel 2 X0.1 rising-edge or falling-edge triggered Example: Set Points = 2000, the trigger timing for the external input point is set to rising-edge triggered.
  • Page 807 AS Ser ies Pro gra mm in g M anu al Point Logging mode: Set Mode=2, turn the instruction EN to ON before the recording starts. One log point would be recorded for each triggering at external input point until it reaches the pre-defined point number, Cmplt flag would set to High automatically.
  • Page 808 Cha p ter 6 App l ied Ins truc tio ns Example Set Mode=3, Points = 2000, and PostTrg = 1500 so the position of point 501 (Points – PostTrg)would be the first record after an external trigger signal is detected. The number of all records(Points):2000 The number of all records(Points):2000 The number of records after...
  • Page 809 AS Ser ies Pro gra mm in g M anu al Example Set Points = 1000 and PostTrg = 700, and then there would be 1000 logs, including 300 pieces of data before triggering and 700 pieces of data after triggering. The number of all records(Points):1000 Th e number of record s after being triggered(PostTrg):700...
  • Page 810 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description Record peak values of analog input 1425 ADPEAK Listed as follows modules. Device “$”    Group    Module    ChNo ...
  • Page 811 AS Ser ies Pro gra mm in g M anu al Explanation ADPEAK is dedicated for analog input modules (AS04AD-A, AS08AD-B, AS08AD-C, AS06XA-A, AS02ADH-A) to enable and disable the recording of peak values. This instruction is available for PLC with FW V1.10.00 or later and ISPSoft V3.13 or later.
  • Page 812 Cha p ter 6 A pp l ied Ins truc tio ns Instruction Operand Description Read the parameter from the O-Link 1426 IOLINKR Execute ~ DataRead device Device “$”    Group    Module    Port ...
  • Page 813 AS Ser ies Pro gra mm in g M anu al Symbol Group : Group number : Module number Module : Communication port number Port : Index number of the parameter Index SubIndex : Subindex number of the parameter DataType : Data type ReadLen :...
  • Page 814 Cha p ter 6 App l ied Ins truc tio ns If the setting value exceeds the setting range, the Error flag switches to ON. Error Code Data Type Description Boolean; data length: 1 byte 0x0000 BooleanT 0x0001 UIntegerT Unsigned integer; data length: 1, 2, 4, 8 byte 0x0002 IntegerT Signed integer;...
  • Page 815 AS Ser ies Pro gra mm in g M anu al 0x8034 The parameter length underrun 0x8035 The function is NOT available. 0x8036 The function is currently NOT available. 0x8040 Invalid parameters set 0x8041 Inconsistent parameters set 0x8082 Application is NOT ready for use. 0x8101 The IO-Link device is NOT in IO-Link mode.
  • Page 816 Cha p ter 6 App l ied Ins truc tio ns 17. Sequences of the EN, Done, and Error flags: when an error occurs during communication (scenario 1) and when the communication is compete (scenario 1). Example 1: Read the parameter of Application Specific Tag on the first device of the first communication port. Check HWCONFIG to learn the setting value in Application Specific Tag is “ABCDEFGH”.
  • Page 817 AS Ser ies Pro gra mm in g M anu al Example 2: Read the parameter of gain trim green channel on the first device of the second communication port. Check HWCONFIG to learn the setting value in gain trim green channel is “-63”. AS04SIL is the first module that installed on the right side of the PLC CPU.
  • Page 818 Cha p ter 6 App l ied Ins truc tio ns Example 3: Read the parameter of gain trim green channel on the first device of the second communication port. Check HWCONFIG to learn the setting value in Ambient temperature is 28.60551. AS04SIL is the first module that installed on the right side of the PLC CPU.
  • Page 819 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description Write the parameter into the IO-Link 1427 IOLINKW Execute ~ ErrCode device Device “$”    Group    Module    Port ...
  • Page 820 Cha p ter 6 App l ied Ins truc tio ns Symbol Group : Group number : Module number Module : Communication port number Port : Index number of the parameter Index SubIndex : Subindex number of the parameter DataType : Data type WriteLen :...
  • Page 821 AS Ser ies Pro gra mm in g M anu al SubIndex is the parameter sub-index number that is intended to write into the IO-Link device. The sub-index number can be set from 0 to 255. If the value exceeds the setting range, the Error flag switches to ON. 10.
  • Page 822 Cha p ter 6 App l ied Ins truc tio ns Example 1: Write the parameter of Application Specific Tag into the first device of the first communication port. Check HWCONFIG to learn the setting value in Application Specific Tag is “ABCDEFGH”. AS04SIL is the first module that installed on the right side of the PLC CPU.
  • Page 823 AS Ser ies Pro gra mm in g M anu al Check HWCONFIG to learn the setting value in Application Specific Tag is updated to “IO-Link”. Example 2: Write the parameter of gain trim green channel into the first device of the second communication port.
  • Page 824 Cha p ter 6 App l ied Ins truc tio ns Check HWCONFIG to learn the setting value in gain trim green channel is updated to “-30”. 6-545...
  • Page 825: Floating-Point Number Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit  1500 –...
  • Page 826: Explanation Of Floating-Point Number Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 6.16.2 Explanation of Floating-point Number Instructions Instruction code Operand Function 1500 FSIN Sine of a floating-point number S, D Device “$”        ...
  • Page 827 AS Ser ies Pro gra mm in g M anu al Example When X0.0 is ON, the BIN instruction converts the binary-coded decimal value in X1.15–X1.0 into the binary value, and stores the conversion result in D0. The FLT instruction converts the binary value in D0 into a floating-point number, and stores the conversion result in (D11, D10).
  • Page 828 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1501 FCOS S, D Cosine of a floating-point number Device “$”              ...
  • Page 829 AS Ser ies Pro gra mm in g M anu al Example When X0.0 is ON, the BIN instruction converts the binary-coded decimal value in X1.15–X1.0 into the binary value, and stores the conversion result in D0. The FLT instruction converts the binary value in D0 into a floating-point number, and stores the conversion result in (D11, D10).
  • Page 830 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1502 FTAN S, D Tangent of a floating-point number Device “$”              ...
  • Page 831 AS Ser ies Pro gra mm in g M anu al Example When X0.0 is ON, the BIN instruction converts the binary-coded decimal value in X1.15–X1.0 into the binary value, and stores the conversion result in D0. The FLT instruction converts the binary value in D0 into the floating-point number, and stores the conversion result in (D11, D10).
  • Page 832 Ch ap te r 6 Ap pl ie d Instruc ti 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. 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.
  • Page 833 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1503 FASIN S, D Arcsine of a floating-point number Device “$”               ...
  • Page 834 Ch ap te r 6 Ap pl ie d Instruc ti ons Example When X0.0 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).
  • Page 835 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1504 FACOS S, D Arccosine of a floating-point number Device “$”               ...
  • Page 836 Ch ap te r 6 Ap pl ie d Instruc ti ons Example When X0.0 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).
  • Page 837 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1505 FATAN S, D Arctangent of a floating-point number Device “$”               ...
  • Page 838 Ch ap te r 6 Ap pl ie d Instruc ti ons Example When X0.0 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).
  • Page 839 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1506 FSINH S, D Hyperbolic sine of a floating-point number Device “$”              ...
  • Page 840 Ch ap te r 6 Ap pl ie d Instruc ti ons Single-pr ecision floati ng- poi nt number Hyperbolic sine value If the absolute value of the conversion result is larger than the value that can be represented by floating-point numbers, SM602 is ON.
  • Page 841 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Hyperbolic cosine of a floating-point 1507 FCOSH S, D number Device “$”              ...
  • Page 842 Ch ap te r 6 Ap pl ie d Instruc ti ons Single-pr ecision floati ng- point number Hyperbolic cosi ne value If the absolute value of the conversion result is larger than the value that can be represented by floating-point numbers, SM602 is ON.
  • Page 843 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Hyperbolic tangent of a floating-point 1508 FTANH S, D number Device “$”              ...
  • Page 844 Ch ap te r 6 Ap pl ie d Instruc ti 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 - 5 6 5...
  • Page 845 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1509 FRAD S, D Converting degrees to radians Device “$”                Data type ...
  • Page 846 Ch ap te r 6 Ap pl ie d Instruc ti 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 - 5 6 7...
  • Page 847 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1510 FDEG S, D Converting radians to degrees Device “$”                Data type ...
  • Page 848 Ch ap te r 6 Ap pl ie d Instruc ti ons Radian Fl oating-point number Degree ( Radian ×180 π Fl oating-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.
  • Page 849 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1511 S, D Square root of a binary number Device “$”               ...
  • Page 850 Ch ap te r 6 Ap pl ie d Instruc ti 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 - 5 7 1...
  • Page 851 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1512 FSQR S, D Square root of a floating-point number Device “$”              ...
  • Page 852 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1513 FEXP S, D Exponentiation of a floating-point number Device “$”              ...
  • Page 853 AS Ser ies Pro gra mm in g M anu al 6 - 5 7 4...
  • Page 854 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1514 FLOG Logarithm of a floating-point number Device “$”                ...
  • Page 855 AS Ser ies Pro gra mm in g M anu al respect to the floating-point number in (D11, D10), and stores the operation result in (D21, D20). Additional remarks If the value in S is less than or equal to 1, or if the value in S is less or equal to 0, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003.
  • Page 856 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function Natural logarithm of a binary floating-point 1515 S, D number Device “$”             ...
  • Page 857 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 858 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1516 FPOW Power of a floating-point number Device “$”                ...
  • Page 859 AS Ser ies Pro gra mm in g M anu al Example When X0.0 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. When X0.1 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).
  • Page 860 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1517 RAND Generating a random number Device “$”                 ...
  • Page 861: Real-Time Clock Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit ...
  • Page 862: Explanation Of Real-Time Clock Instructions

    Ch ap te r 6 Ap pl ie d Instruc ti ons 6.17.2 Explanation of Real-time Clock Instructions Instruction code Operand Function 1600 Reading the time Device “$”    Data type   Pulse instruction 16-bit instruction 32-bit instruction Symbol D :...
  • Page 863 AS Ser ies Pro gra mm in g M anu al Special data General data Item Value Item register register SR391 Year (A.D.) 00-99 Year (A.D.) SR392 Month 1-12 Month SR393 1-31 SR394 Hour 0-23 Hour SR395 Minute 0-59 Minute SR396 Second 0-59...
  • Page 864 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1601 Writing the time Device “$”     Data type   Pulse instruction 16-bit instruction 32-bit instruction Symbol S : Data source Explanation 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.
  • Page 865 AS Ser ies Pro gra mm in g M anu al General data Special data Item Value Item register register Year (A.D.) 00-99 SR391 Year (A.D.) Month 1-12 SR392 Month 1-31 SR393 Hour 0-23 SR394 Hour Minute 0-59 SR395 Minute Second 0-59 SR396...
  • Page 866 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1602 Adding the time Device “$”              Data type    ...
  • Page 867 AS Ser ies Pro gra mm in g M anu al 8 ( Hour ) Hour Hour 14 ( Minute 10 ( Minute) Minute 40 ( 50 ( 20 ( Second) Second Second 26 ( 8 hour 10 minute 20 second 6 hour 40 minute 6 second 14 hour 50 minute 26 second Additional remarks If the value in S or S...
  • Page 868 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1603 Subtracting the time Device “$”              Data type    ...
  • Page 869 AS Ser ies Pro gra mm in g M anu al If the difference is a negative, SM601 is ON. Hour 5 ( Hour ) Hour 10 ( 19 ( 20 ( Minute) Minute Minute 11 ( Second 30 ( Second) Second 15 ( 15 (...
  • Page 870 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1604 HOUR S, D Running-time meter Device “$”               Data type ...
  • Page 871 AS Ser ies Pro gra mm in g M anu al When using on-line editing, reset the conditional contact to initialize the instruction. Example 1 When X0.0 is ON, the instruction timer starts to count. When the time for which X0.0 has been ON reaches 100 hours, Y0.0 is ON.
  • Page 872 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1605 TCMP , S, D Comparing the time Device “$”               ...
  • Page 873 AS Ser ies Pro gra mm in g M anu al If the setting time in S is equal to the current time in S, D is OFF, D+1 is ON, and D+2 is OFF. If the setting time in S is less than the current time in S, D is OFF, D+1 is OFF, and D+2 is ON.
  • Page 874 Ch ap te r 6 Ap pl ie d Instruc ti ons If you declare the operand S in ISPSoft, the data type is ARRAY [3] of WORD. If you declare the operand D in ISPSoft, the data type is ARRAY [3] of BOOL. 6 - 5 9 5...
  • Page 875 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function ,S ,S,D 1606 TZCP Time zone comparison Device “$”                Data type ...
  • Page 876 Ch ap te r 6 Ap pl ie d Instruc ti ons the TZCP instruction to compare the time. If the current time in the device specified by S is less than the lower limit time in the device specified by S , and is less than the upper limit time in the device specified by S , D is ON.
  • Page 877 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1607 S, S Daylight saving time Device “$”                  ...
  • Page 878 Ch ap te r 6 Ap pl ie d Instruc ti ons Explanation Operands used in this instruction are described below: S: Daylight saving time function codes Firmware version before V1.04 (V1.04 excluded) supports the following function codes: Function codes Description Disable daylight saving time Enable daylight saving time mode 1...
  • Page 879 AS Ser ies Pro gra mm in g M anu al S=3 (daylight saving time mode 2 enabled), S settings for the week to end daylight saving time, S +1: on which weekday of S : settings for the change due to daylight saving time; unit: minute D: stores the state of the daylight saving time;...
  • Page 880 Ch ap te r 6 Ap pl ie d Instruc ti ons Mode 1 (S=1): enabled by month and date (refer to example 2) Operand Description The month to start daylight saving time Range: 1-12 The date to start daylight saving time Range: 1-31 The month to end daylight saving time Range: 1-12...
  • Page 881 AS Ser ies Pro gra mm in g M anu al Note 1: If this function is enabled, the value in D is ON. Note 2: The setting range for S and S is 1— 4 or -1— -4. The value -1 indicates the last week of the month and -2 indicates the last 2 week.
  • Page 882 Ch ap te r 6 Ap pl ie d Instruc ti ons Operand Description 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 Function code is 7, indicating the DST state is ON and in mode 2. The month to start daylight saving time : settings for the week to start daylight saving time +1: on which weekday of the S...
  • Page 883 AS Ser ies Pro gra mm in g M anu al Example 1 Disable DST function and read the DST state. Setting values and descriptions: Device Setting Value Description Disable DST function Invalid operand Invalid operand Invalid operand Invalid operand Invalid operand Enable contact M0 Y0.0=OFF, indicating DST function is disabled.
  • Page 884 Ch ap te r 6 Ap pl ie d Instruc ti ons D112 Invalid operand D120 Invalid operand Y0.1 Node state is OFF. Example 2 Enable DST function and read the DST state. Set the DST to start on 1 April and to end on 3 September and the duration is 60 minutes.
  • Page 885 AS Ser ies Pro gra mm in g M anu al D100=K2, indicating DST state is being read. Enable contact M1 Setting values and descriptions: Setting Device Description Value Before firmware V1.04 (V1.04 excluded), function code is fixed to 2, indicating the DST state is being read.
  • Page 886 Ch ap te r 6 Ap pl ie d Instruc ti ons Example 3 Enable DST function and in mode 2. Set the DST to start from the 2 Wednesday of May and to end on 3 Friday of September and the duration is 60 minutes.
  • Page 887 AS Ser ies Pro gra mm in g M anu al D100=K2, indicating DST state is being read. Enable contact M1 Setting values and descriptions: Setting Device Description Value Before firmware V1.04 (V1.04 excluded), function code is fixed to 2, indicating the DST state is being read.
  • Page 888 Ch ap te r 6 Ap pl ie d Instruc ti ons Instruction code Operand Function 1608 WWON Setting up weekly working time Device “$”        Data type       ...
  • Page 889 AS Ser ies Pro gra mm in g M anu al Friday / Saturday respectively. This operand occupies 7 consecutive devices. You can use the variables in an ARRAY to declare the operands. When the hour value in S is larger than the value set in S , it means the time to stop working is the next day.
  • Page 890 Ch ap te r 6 Ap pl ie d Instruc ti 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 Start...
  • Page 891 AS Ser ies Pro gra mm in g M anu al The following table lists the settings for the device D. Start working time Stop working time Start Hour Start Minute Stop Hour Stop Minute Sunday Monday Tuesday Wednesday Thursday Friday Saturday When M0 is ON, Y0.0 is ON from 18:00 to 8:00 the next day from Monday to Friday and for other times the Y0.0 is OFF.
  • Page 892 Ch ap te r 6 Ap pl ie d Instruc ti ons The following table lists the settings in the morning for the device D. Start working time Stop working time Start Hour Start Minute Stop Hour Stop Minute Sunday Monday Tuesday Wednesday...
  • Page 893: Peripheral Instructions

    AS Ser ies Pro gra mm in g M anu al 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 Function instruction 16-bit 32-bit 1700 DTKY – Ten-key keypad 1701 DHKY...
  • Page 894: Explanation Of Peripheral Instructions

    Cha p ter 6 App l ied Ins truc tio ns 6.18.2 Explanation of Peripheral Instructions Instruction code Operand Function 1700 Ten-key keypad S, D Device “$”          Data type   ...
  • Page 895 AS Ser ies Pro gra mm in g M anu al Example The ten external inputs starting from X0.0 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.
  • Page 896 Cha p ter 6 App l ied Ins truc tio ns When a key connected to the input within the range between X0.0 and X0.9 is pressed, the corresponding output within the range between M10 and M19 is ON. When one of the keys is pressed, M20 is ON. When the conditional contact M0 is switched OFF, the value stored in D0 is unchanged;...
  • Page 897 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1701 Sixteen-key keypad Device “$”            Data type        ...
  • Page 898 Cha p ter 6 App l ied Ins truc tio ns You can use the 32-bit counter only when D uses 32-bit instructions. Example The four external inputs X0.0–X0.3 are connected to the four external outputs Y0.0–Y0.3 to form a 16-key keypad. When X1.0 is ON, the instruction stores the value that you enter as a binary value in D0, and stores the output signals in M0–M7.
  • Page 899 AS Ser ies Pro gra mm in g M anu al  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. Output signals: ...
  • Page 900 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function 1702 DIP switch Device “$”               Data type     ...
  • Page 901 AS Ser ies Pro gra mm in g M anu al When using on-line editing, please reset the conditional contact to initialize the instruction. Example X0.0–X0.3 are connected to Y0.0–Y0.3 to form the first DIP switch, and X0.4–X0.7 are connected to Y0.0–Y0.3 to form the second DIP switch.
  • Page 902 Cha p ter 6 App l ied Ins truc tio ns Additional remarks If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. If you declare the operand D in ISPSoft, the data type is ARRAY [4] of BOOL.
  • Page 903 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1703 ARWS Arrow keys Device “$”               Data type    ...
  • Page 904 Cha p ter 6 App l ied Ins truc tio ns Example The instruction defines X0.0 as the down arrow, X0.1 as the up arrow, X0.2 as the right arrow, and X0.3 as the left arrow. The instruction stores the setting value in D20, and the setting value must be between 0–9,999. When X1.0 is ON, the digit in the place 10 is selected.
  • Page 905 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1704 SEGL , D, n Seven-segment display with latches Device “$”               ...
  • Page 906 Cha p ter 6 App l ied Ins truc tio ns 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. After the execution of the instruction is complete, SM693 is ON for a scan cycle.
  • Page 907 AS Ser ies Pro gra mm in g M anu al The wiring: Y0.0 Y0.1 Y0.2 Y0.3 Y0.4 Y0.5 Y0.6 Y0.7 Y0.8 Y0.9 Y0.10 Y0.11 24VDC Second 7-segment display First 7-segment display Note: The transistor output module AH16AN01T-5A is used in this example. Additional remarks ...
  • Page 908 Cha p ter 6 App l ied Ins truc tio ns  The following table shows the positive logic. Output Binary-coded (Binary-coded Signal decimal value decimal code)  The following table shows the latch. Positive logic Negative logic Latch Signal Latch Signal ...
  • Page 909 AS Ser ies Pro gra mm in g M anu al  The following graphic shows the connection of the common-anode four-digit seven-segment display with IC 7447. 5VDC IC7447 6 - 6 3 0...
  • Page 910: Communication Instructions

    – Sending and receiving communication data Setting the communication format for a serial communication  1813 COMDF – port Serial communication instruction exclusively for Delta AC VFDRW – – 1814 motor drives Serial communication instruction exclusively for Delta servo 1815 ASDRW –...
  • Page 911: Explanation Of Communication Instructions

    AS Ser ies Pro gra mm in g M anu al 6.19.2 Explanation of Communication Instructions Instruction code Operand Function 1806 S, n, D Longitudinal parity check Device “$”        Data type   ...
  • Page 912 Cha p ter 6 App l ied Ins truc tio ns Example 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.
  • Page 913 AS Ser ies Pro gra mm in g M anu al 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 The following table lists the format of the communication data in the ASCII mode.
  • Page 914 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function 1807 S, n, D Cyclic Redundancy Check Device “$”        Data type       Pulse instruction 16-bit instruction 32-bit instruction Symbol...
  • Page 915 AS Ser ies Pro gra mm in g M anu al Example The PLC is connected to the VFD-S series AC motor drive (RTU modeSM210 is ON; 16-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.
  • Page 916 Cha p ter 6 App l ied Ins truc tio ns Additional remarks 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)...
  • Page 917 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function 1808 MODRW , S, n Reading and Writing Modbus data Device “$”              ...
  • Page 918 Cha p ter 6 App l ied Ins truc tio ns Function Data Description Devices that support devices for slaves code length PLC reads the data from several word 16#04 1-100 devices. 16#05 PLC writes the state into a bit device. Y, M, SM, S, T, C, HC 16#06 PLC writes the data into a word device.
  • Page 919 AS Ser ies Pro gra mm in g M anu al Function code 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...
  • Page 920 Cha p ter 6 App l ied Ins truc tio ns The communication setup for this example is RS485 ASCII, 9600, 8, E, 1 (SR209=16#0025). Set the communication timeout to 3000ms (SR210=3000). Set the communication mode to ASCII mode (SM210=OFF). Enable the communication protocol (SM209=ON).
  • Page 921 AS Series CPU module is connected to the DVP-ES2 Series PLC. When SM96 and X0.0 are on, the AS Series CPU sends and receives the Y0–Y17 commands from the DVP-ES2. When the address of Y0 is 16#0500, the states of Y0–Y17 in DVP-ES2 are listed in the following table.
  • Page 922 Cha p ter 6 App l ied Ins truc tio ns ASCII mode You do not need to convert the ASCII codes and they are all expressed in 16# values.  AS sends the communication command: “:01 01 05 00 00 10 E9 CR LF”. ...
  • Page 923 AS Series CPU module is connected to the DVP-ES2 Series PLC. When SM96 and X0.0 are on, the AS Series CPU module sends and receives D32–D39 from the DVP-ES2. When the address of D32 is 16#1020, the values of D32–D39 in DVP-ES2 are listed in the following table.
  • Page 924 Cha p ter 6 App l ied Ins truc tio ns ASCII mode You do not need to convert the ASCII codes, and they are all expressed in 16# values.  AS sends the communication command: “:01 03 10 20 00 08 C4 CR LF”. ...
  • Page 925 Function code 05 (16#05): the PLC writes the state into a bit device. The device is set to ON in this example. The AS 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.
  • Page 926 Cha p ter 6 App l ied Ins truc tio ns RTU mode  AS sends the communication command: “01 05 05 00 FF 00 8C F6”  AS receives the communication command: “01 05 05 00 FF 00 8C F6” If the format is correct, SM100 is ON.
  • Page 927 Example 4 Function code 06 (16#06): the PLC writes the state into a word device. AS Series CPU module is connected to the DVP-ES2 series PLC. Suppose D10 is 16#55AA (waiting to write data to the device T0 of the DVP-ES2).
  • Page 928 Cha p ter 6 App l ied Ins truc tio ns ASCII mode You do not need to convert the ASCII codes, and they are all expressed in 16# values.  AS sends the communication command: “:01 06 06 00 55 AA F4 CR LF” ...
  • Page 929 AS Ser ies Pro gra mm in g M anu al Example 5 Function code 0F (16#0F): the PLC writes the states into several bit devices. AS 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) Device D10.7...
  • Page 930 Cha p ter 6 App l ied Ins truc tio ns The following table lists the operands for the MODRW instruction. Operand Description Device Unit address Function code 16#000F Device address of Y0 16#0500 Registers Y0–Y17 for reading and writing the data D10.0 Data length ASCII mode...
  • Page 931 Function code 10 (16#10): the PLC writes the states into several word devices. AS Series CPU module is connected to the DVP-ES2 series PLC. Suppose the values for D20–27 are listed in the following table (waiting to write data to the devices T0–7 of the DVP-ES2).
  • Page 932 Cha p ter 6 App l ied Ins truc tio ns ASCII mode You do not need to convert the ASCII codes, and they are all expressed in 16# values.  AS sends the communication command: “:01 10 0600 00 08 10 1234 5678 1122 3344 5566 7788 99AA BBCC 8F CR LF”...
  • Page 933 AS Ser ies Pro gra mm in g M anu al 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. The MODRW instruction is not executed if the sending flags SM96 and SM97 are not ON. If a communication timeout occurs, the timeout flags SM104 and SM105 are ON, and the receiving flags SM98 and SM99 are OFF.
  • Page 934 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function 1812 COMRS Sending and receiving communication data “$” Device             Data type   ...
  • Page 935 AS Ser ies Pro gra mm in g M anu al If S is D100 and S is 10, the instruction sends the values in the low bytes in D100–D109 through the communication port specified by S No strings are sent if the setting value in S is 0.
  • Page 936 Cha p ter 6 App l ied Ins truc tio ns is received exceeds the time +1. The time set in the low set in D +1, the receiving of byte in D +1 is in the range of data is complete. 5–255 milliseconds.
  • Page 937 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 938 Cha p ter 6 App l ied Ins truc tio 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...
  • Page 939 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 940 Cha p ter 6 App l ied Ins truc tio ns The following examples use COM1 (RS485). Example 1 The mode in D is 0 (not receiving communication data) and you set the mode for sending and receiving data to 8-bit mode (SM106=ON).
  • Page 941 AS Ser ies Pro gra mm in g M anu al Example 2 The mode in D 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). The length for the data to be sent: D20=4.
  • Page 942 Cha p ter 6 App l ied Ins truc tio ns Example 3 The mode in D 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). Set the length of the data to be sent: D20=0, meaning the PLC will not send data but only receives data.
  • Page 943 AS Ser ies Pro gra mm in g M anu al Example 4 The mode in D 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.
  • Page 944 Cha p ter 6 App l ied Ins truc tio ns Example 5 The mode in D 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). The length for the data to be sent: D20=4.
  • Page 945 AS Ser ies Pro gra mm in g M anu al Example 6 The mode in D 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.
  • Page 946 Cha p ter 6 App l ied Ins truc tio ns Example 7 The mode in D is 6 (the received data length) and you set the mode of sending and receiving data to 8-bit mode (SM106=ON). The length for the data to be sent: D20=4. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034.
  • Page 947 AS Ser ies Pro gra mm in g M anu al Example 8 The mode in D 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: Clear the interrupt: D30=0.
  • Page 948 Cha p ter 6 App l ied Ins truc tio ns Example 9 The mode in D 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: Clear the interrupt: D30=0 The length for the data to be sent: D20=4.
  • Page 949 AS Ser ies Pro gra mm in g M anu al Example 10 The mode in D 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). The length for the data to be sent: D20=4.
  • Page 950 Cha p ter 6 App l ied Ins truc tio ns Additional remarks 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.
  • Page 951 AS Ser ies Pro gra mm in g M anu al Instruction code Operand Function Setting the communication format for a serial 1813 COMDF communication port Device “$”             Data type Pulse instruction...
  • Page 952 Cha p ter 6 App l ied Ins truc tio ns 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. sets the number of end bits.
  • Page 953 AS Ser ies Pro gra mm in g M anu al Mobdus format selection ASCII Communication port number PLC COM1 6 - 6 7 4...
  • Page 954 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function Serial communication instruction exclusive for 1814 VFDRW Delta AC motor drive Device “$”            ...
  • Page 955 AS Ser ies Pro gra mm in g M anu al is the communication function code, and S is the source or received data as explained in the following table. function function name S source and received data Remark code Reset due to abnormality Unused Any value can be stored in S.
  • Page 956 ASCII, 115200, 7, N, 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.
  • Page 957 AS Ser ies Pro gra mm in g M anu al 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. Connect AS COU to VFD.
  • Page 958 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. The reception completion flag SM100 is ON, and the values of M1–M5 are cleared to avoid interfering with the next communication command.
  • Page 959 0–254. The instruction is not executed if the value is out of the valid range. Refer to Delta Servo Operation manual for details on servo parameters. is the communication function code, and S is the source or received data as explained in the following table.
  • Page 960 Cha p ter 6 App l ied Ins truc tio ns and S operands for the A, AB, A+, B Series function Remark function name S source or received data code Reading the state value from Occupies 5 consecutive devices Reading the servo state value S–S+4 P0-04–P0-08...
  • Page 961 AS Ser ies Pro gra mm in g M anu al counterclockwise, 4999 (run clockwise) stop 4998 (run counterclockwise) 0 (stop) Servo ON/OFF 1: Servo On Writing the data into the registers P2-30 Any other value: Servo OFF Velocity command Occupies 6 consecutive devices Writing data into the registers with the valid setting value...
  • Page 962 Set the PLC COM1 (RS485) port in HWCONFIG with these values: ASCII, 115200, 8, E, 1 Set the servo parameters using the panel on the Delta ASDA-A2 servo according to the following steps. Set P2-08 to 10 to restore the factory settings.
  • Page 963 AS Ser ies Pro gra mm in g M anu al 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 8 4...
  • Page 964 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...
  • Page 965 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...
  • Page 966 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function Setting the parameters in the data 1816 CCONF exchange table for a communication port Device “$”          ...
  • Page 967 AS Ser ies Pro gra mm in g M anu al Explanation The following table lists the names and descriptions of S –S Device Name Description Data type Remark 1=COM1, 2=COM2. 11=Function card 1, 12=Function card 2. PLC with FW V1.06.00 Communication port or later supports function card 1 and 2.
  • Page 968 Cha p ter 6 App l ied Ins truc tio ns Device Name Description Data type Remark Supports 16#05, 06, 0F, 10. Function code for writing WORD If the value is out of the range, the instruction data does not modify the operand. Writing the remote 16#0000–16#FFFF WORD...
  • Page 969 AS Ser ies Pro gra mm in g M anu al (including communication address, length and the start register), and the instruction executes the data exchange function based on the original communication parameter settings. When you select 16#17 (for reading and writing synchronously) in S (the function code for reading), the operand (the function code for writing) is processed as invalid and 16#17 is automatically processed for writing data.
  • Page 970 Cha p ter 6 App l ied Ins truc tio ns SM No. Attribute Explanation for Function Card 1 data exchange parameters SM1710 Enables data exchange SM1712 ~ SM1743 Enables data exchange connections 1–32 SM1744 ~ SM1775 Reading success for data exchange connections 1–32 SM1776 ~ SM1807 Error flags for data exchange connections 1–32 SM No.
  • Page 971 D device. An input error occurs if the selection is not D. Example: AS COM1 (RS485) For the data exchange between the AS Series CPU and the DVP-ES2 CPU, the following table shows the COM1 data exchange table in HWConfig in ISPSoft.
  • Page 972 The data exchange between the AS Series CPU and the DVP-ES2 CPU starts when X0.1 is ON. After data exchange starts, the corresponding data between the AS Series CPU and the DVP-ES2 CPU change as shown in the following table.
  • Page 973 AS Ser ies Pro gra mm in g M anu al When X0.0 is ON, the COM1 data exchange table parameters in the AS Series CPU are modified as shown in the following table. Item Remote station Remote Function How to...
  • Page 974 Cha p ter 6 App l ied Ins truc tio ns Instruction code Operand Function Reading and writing Modbus data without using any 1817 MODRWE , S, n, D flags Device “$”         ...
  • Page 975 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 Value (16#) 1234 5678 1122 3344 5566 7788 99AA BBCC The AS Series PLC reads the content values from D20–D27 in the DVP-ES2 CPU through communication. 6 - 6 9 6...
  • Page 976 First register for storing the data read Reading the data length The communication response between the AS 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.
  • Page 977 16#1020 First register for storing the data read Reading the data length Flag for completion of reading and writing data The communication response between the AS series CPU and the DVP-ES2 depends on the mode. 6 - 6 9 8...
  • Page 978 Cha p ter 6 App l ied Ins truc tio ns ASCII mode: You do not need to convert the ASCII codes, and they are expressed in 16# values.  AS sends the communication command: “01 03 10 20 00 08 C4 CR LF” ...
  • Page 979 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description ,S ,S ,S ,S ,S ,S ,S ,S , Reading and writing DeviceNet 1818 DNETRW communication data ,D ,D ,D ,D ,D Device “$”   ...
  • Page 980 Cha p ter 6 App l ied Ins truc tio ns Symbol Number of the module sending the DeviceNet communication DeviceNet MAC ID Service Code Class ID Instance ID Attribute ID Written-data length Device for storing written data Communication timeout time Number of times of retransmission Completion flag Error flag...
  • Page 981 AS Ser ies Pro gra mm in g M anu al is the length of written data with the unit of byte. is the starting address of the devices where written data are stored in the order from low bit to high bit. is the communication timeout time.
  • Page 982 Cha p ter 6 App l ied Ins truc tio ns 13. The instruction cannot be used in the ST programming language, interrupt tasks or function block which is called only once. 6 - 7 0 3...
  • Page 983 Communication error flag Explanation The CANRS instruction is applicable to AS series PLC with the firmware of V1.04.00 and later. Before the CANRS instruction is executed, please ensure that HWCONFIG for the hardware configuration has selected CANopen DS301 as the mode of function card 2.
  • Page 984 Cha p ter 6 App l ied Ins truc tio ns sets the communication mode. See the following modes that the instruction supports. If the setting value is incorrect, the error flag D changes to On and the error code SR659 is set to 1. Communication Setting code...
  • Page 985 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 986 Cha p ter 6 App l ied Ins truc tio ns Selecting 2.0B mode: (Here is the introduction of receiving data from 2 slaves. For other data, increase the number of D Response Data from the second Data from the first slave sequence slave D104 ~ D111...
  • Page 987 AS Ser ies Pro gra mm in g M anu al See CANRS communication sequence diagram and explanation. :The CANRS instruction is enabled. If no other CANRS instruction occupies the control right, the flags D are cleared and then the data are sent out right away. :The data sending is completed and meanwhile the data receiving starts.
  • Page 988 Cha p ter 6 App l ied Ins truc tio ns 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 As M1 is on, set the MsgID of the sent message to 1 and MsgID of the received message to 2.
  • Page 989 AS Ser ies Pro gra mm in g M anu al 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.
  • Page 990 Cha p ter 6 App l ied Ins truc tio ns Slave programming example 6 - 7 11...
  • Page 991 AS Ser ies Pro gra mm in g M anu al Instruction Operand Description 1820 DMVSH Mode ~ ErrCode Enabling Delta DMV detection and communication Device “$”    Mode     Start1    ...
  • Page 992 Communication error code Explanation The DMVSH instruction is applicable to AS series PLC with the firmware of V1.06.00 and later. 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 Please refer to following example explanation for the function of Start1, Start2, Ready, Shoot1, Shoot2, RdData and Ok and the process of detection triggering.
  • Page 993 AS Ser ies Pro gra mm in g M anu al 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. See the explanation of the values of ErrCode in the table below.
  • Page 994 Cha p ter 6 App l ied Ins truc tio ns  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.
  • Page 995 AS Ser ies Pro gra mm in g M anu al  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.
  • Page 996 Cha p ter 6 App l ied Ins truc tio ns Instruction Operand Description Execute the appointed communication number of 1821 DESO ComNo ~ ErrCode the data exchange table once Device “$”    ComNo    ListNo ...
  • Page 997 AS Ser ies Pro gra mm in g M anu al 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 reponses 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.
  • Page 998: Descriptions On The Communication-Related Flags And Registers

    Cha p ter 6 App l ied Ins truc tio ns 6.19.3 Descriptions of the Communication-related Flags and Registers Communication-related flags (SM) Flag Description Action COM1 COM2 Card 1 Card 2 Data sending request flag If you want to use the instruction to send and You set the flag to ON, and receive data, you must use the pulse instruction to SM96...
  • Page 999 AS Ser ies Pro gra mm in g M anu al Flag Description Action COM1 COM2 Card 1 Card 2 Communication mode ON: RTU mode You set the flag to ON and SM210 SM212 OFF: ASCII mode reset it to OFF. You can set this value in HWCONFIG in ISPSoft.
  • Page 1000 Cha p ter 6 App l ied Ins truc tio ns Communication-related registers (SR) Special data register Description COM1 COM2 Card 1 Card 2 SR201 SR202 SR176 SR178 Communication port address Communication protocol SR209 SR212 SR177 SR179 For details, please refer to the following table to set up the communication format for a serial communication port.

Table of Contents