DVP-ES2/EX2/SS2/SA2/SX2/SE Operation Manual Programming Publication History Issue First Edition Second Edition Description of Changes The first edition is issued. 1. C h a p t e r 2 . 8 M R e l a y : A d d M 1 0 3 7 , M 111 9 , M 11 8 2 , M1308, M1346, and M1356, and update the description of the functions of M1055~M1057and M 11 8 3 . 2. C h a p t e r 2 .
Issue Description of Changes Date Third Edition 1. SE is added in the title of the manual. 2. Chapter 2.16: The default value in D1062 is K10. 3 . A P I 1 5 i n C h a p t e r 3 : T h e c o n t e n ts a b o u t S < D a r e deleted in program example 3. 4. API 148 and API 149 are added in chapter 3. 5. The information related to DVP-SE is added. 6. The information related to DVP32ES-C is added. 7. The descriptions of the models are added in the c o n t e n ts . 8. Appendix A is added.
DVP-ES2/EX2/SS2/SA2/SX2/SE Operation Manual Programming Contents 1 PLC Concepts 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 PLC Scan Method……………………………………………………………………………... Current Flow……………………………………………………………………………………. NO Contact, NC Contact……………………………………………………………………… PLC Registers and Relays……………………………………………………………………. Ladder Logic Symbols………………………………………………………………………… 1.5.1 Creating a PLC Ladder Program…………………………………………………... 1.5.2 LD / LDI (Load NO contact / Load NC contact)…………………………………... 1.5.
3.2 3.3 3.4 3.5 3.6 3.7 3.8 Explanations to Basic Instructions…………………………………………………………... Pointers………………………………………………………………………………………… Interrupt Pointers……………………………………………………………………………… Application Programming Instructions……………………………………………………… Numerical List of Instructions (classified according to the function)…………………….. Numerical List of Instructions (in alphabetic order)……………………………………….. Detailed Instruction Explanation…………………………………………………………….. 3-3 3-12 3-12 3-14 3-24 3-33 3-42 4 Communications 4.1 4.2 4.
7.4 7.5 7.6 7.7 Sending SDO, NMT and Reading Emergency Message through the Ladder Diagram... 7.4.1 Data Structure of SDO Request Message………………………………………... 7.4.2 Data Structure of NMT Message…………………………………………………... 7.4.3 Data Structure of EMERGENCY Request Message…………………………….. 7.4.4 Example on Sending SDO through the Ladder Diagram……………………….. Indicators and Troubleshooting…………………………………………………………........ 7.5.1 Description of Indicators…………………………………………………………..... 7.5.
The DVP-ES2 series PLCs, the DVP-ES2-C series PLCs, the DVP-EX2 series PLCs, the DVP-SS2 series PLCs, the DVP-SA2 series PLCs, the DVP-SX2 s e r i e s P L C s , a n d t h e D V P - S E s e r i e s P L C s a r e l i s t e d b e l o w.
v
PLC Concepts This chapter introduces basic and advanced concepts of ladder logic, which is the mostly adopted programming language of PLC. Users familiar with the PLC concepts can move to the next chapter for further programming concepts. However, for users not familiar with the operating principles of PLC, please refer to this chapter to get a full understanding of PLC concepts. Chapter Contents 1.1 PLC Scan Method ..........................................................................................
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 1.1 PLC Scan Method PLC utilizes a standard scan method when evaluating user program. Scanning process: Scan input status Read the physical input status and store the data in internal memory. Evaluate user program Evaluate the user program with data stored in internal memory. Program scanning starts from up to down and left to right until reaching the end of the program.
1 . P L C C o n c e p ts Scan time exception PLC can process certain items faster than the scan time. Some of these items interrupts and halt the scan time to process the interrupt subroutine program. A direct I/O refresh instruction REF allows the PLC to access I/O immediately during user program evaluation instead of waiting until the next scan cycle. 1.2 Current Flow Ladder logic follows a left to right principle. In the example below, the current flows through paths started from either X0 or X3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 1.4 PLC Registers and Relays Introduction to the basic internal devices in a PLC X (Input Relay) Bit memory represents the physical input points and receives external input signals. Device indication: Indicated as X and numbered in octal, e.g. X0~X7, X10~X17…X377 Y (Output Relay) Bit memory represents the physical output points and saves the status to be refreshed to physical output devices.
1 . P L C C o n c e p ts 1.5 Ladder Logic Symbols The following table displays list of WPLSoft symbols their description, command, and memory registers that are able to use the symbol.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Ladder Diagram Structure Explanation S Instruction Available Devices Multiple output branches MPS MRD MPP None Output coil OUT Y, M, S Step ladder STL S Basic / Application instruction Basic instructions and API instructions. Please refer to chapter 3 Instruction Set - Inverse logic INV None 1.5.
1 . P L C C o n c e p ts Execution order of the sample program: 1 LD X0 2 OR M0 3 AND X1 4 LD X3 AND M1 ORB 5 LD Y1 AND X4 6 LD T0 AND M3 ORB 7 ANB 8 OUT Y1 TMR T0 K10 1.5.2 LD / LDI (Load NO contact / Load NC contact) LD or LDI starts a row or block LD instruction LD instruction AND block OR block 1.5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 1.5.6 OR / ORI (Connect NO contact in parallel / Connect NC contact in parallel) OR (ORI) instruction connects a NO (NC) in parallel with another device or block. OR instruction OR instruction OR instruction 1.5.
1 . P L C C o n c e p ts Branch instruction Branch Symbol MPS ┬ MRD ├ MPP └ Description Start of branches. Stores current result of program evaluation. Max. 8 MPS-MPP pairs can be applied Reads the stored current result from previous MPS End of branches. Pops (reads then resets) the stored result in previous MPS Note: When compiling ladder diagram with WPLSoft, MPS, MRD and MPP could be automatically added to the compiled results in instruction format.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 S0 M1002 initial pulse S21 SET S0 S0 S SET S21 S21 S SET S22 S22 e S S0 S22 RET 1.5.12 RET (Return) RET instruction has to be placed at the end of sequential control process to indicate the completion of STL flow. S20 e S RET S20 e S RET Note: Always connect RET instruction immediately after the last step point indicated as the above diagram otherwise program error may occur.
1 . P L C C o n c e p ts 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 1.7 Fuzzy Syntax Generally, the ladder diagram programming is conducted according to the “up to down and left to right” principle. However, some programming methods not following this principle still perform the same control results. Here are some examples explaining this kind of “fuzzy syntax.
1 . P L C C o n c e p ts OR operation upward is not allowed. “Reverse current” exists. R everse curr ent Output should be connected on top of the circuit.. Block combination should be made on top of the circuit.. Parallel connection with empty device is not allowed.. Parallel connection with empty device is not allowed. No device in the middle block. Devices and blocks in series should be horizontally aligned Label P0 should be at the first row of the complete network.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g “Reverse current” exists 1.
1 . P L C C o n c e p ts Example 3: “Reverse current” existed in diagram (a) is not allowed for PLC processing principle. Instruction List X0 X1 X2 X3 X4 (a) LD X0 OR X1 AND X2 LD X3 AND X4 ORB Ø X3 X4 X1 X2 Instruction List X0 (b) LD X3 AND X4 LD X1 OR X0 AND X2 ORB Example 4: For multiple outputs, connect the output without additional input devices to the top of the circuit for omitting MPS and MPP instructions.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example 5: Correct the circuit of reverse current. The pointed reverse current loops are modified on the right. X0 X1 X2 X3 X4 X5 X6 X7 X10 X0 X1 X2 X3 X4 X5 X10 Ö LOO P1 X6 X7 X5 rev er se c urrent X10 LOOP1 Example 6: Correct the circuit of reverse current. The pointed reverse current loops are modified on the right.
1 . P L C C o n c e p ts Example 2 - Start First latched circuit X1 X2 Y1 When X1 (START) = ON and X2 (STOP) = OFF, Y1 will be ON and latched. If X2 is turned ON, Y1 remains ON. This is a Start First circuit because START button has the control priority than STOP Y1 Example 3 - Latched circuit of SET and RST The diagram opposite are latched circuits consist of RST and SET instructions.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example 6- Interlock control X1 X3 Y2 Y1 Y1 X1 X3 X2 X2 X4 X4 Y1 Y2 Y1 Y2 Y2 NC contact Y1 is connected to Y2 output circuit and NC contact Y2 is connected Y1 output circuit. If Y1 is ON, Y2 will definitely be OFF and vice versa. This forms an Interlock circuit which prevents both outputs to be ON at the same time. Even if both X1 and X2 are ON, in this case only Y1 will be enabled.
1 . P L C C o n c e p ts Example 9 – Oscillating Circuit with Timer An oscillating circuit with cycle nT+ΔT X0 Y1 TMR T0 Kn X0 T0 Y1 Y1 nT T When X0 = ON, T0 starts timing (nT). Once the set time is reached, contact T0 = ON to enable Y1(ΔT). In next scan, Timer T0 is reset due to the reversed status of contact Y1. Therefore contact T0 is reset and Y1 = OFF. In next scan, T0 starts timing again. The process forms an oscillating circuit with output cycle nT+ΔT.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example 13 - Output delay circuit The output delay circuit is composed of two timers executing delay actions. No matter input X0 is ON or OFF, output Y4 will be delayed. X0 TMR T5 T5 K50 5 secs T6 Y4 T5 Y4 Y4 X0 T TMR T6 K30 T6 3 secs Example 14 - Timing extension circuit X0 TMR T11 Kn1 TMR T12 Kn2 T11 The total delay time: (n1+n2)* T. T refers to the timer resolution.
1 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Ladder Diagram: M1002 S0 S S20 S ZRST S0 SET S0 SET S20 SET S30 S127 Y0 TMR T0 SET S21 K350 T0 S21 S Y2 TMR T1 SET S22 TMR T2 K250 T1 S22 S K50 M1013 Y2 T2 SET S23 S S30 S S23 Y1 Y22 TMR T10 SET S31 TMR T11 K250 T10 S31 S K50 M1013 Y22 T11 SET S32 S S32 Y21 TMR T12 SET S33 K50 T12 S33 S Y20 TMR S23 S33 S S T13 S0 RET END 1-22 T13 K350
1 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g MEMO 1-24
Programming Concepts DVP-ES2/EX2/SS/SA2/SX2/SE is a programmable logic controller spanning an I/O range of 10–256 I/O points (SS2/SA2/SX2/SE: 512 points). PLC can control a wide variety of devices to solve your automation needs. PLC monitors inputs and modifies outputs as controlled by the user program. User program provides features such as boolean logic, counting, timing, complex math operations, and communications to other communicating products. Chapter Contents 2.1 ES2/EX2 Memory Map ................
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2.1 ES2/EX2 Memory Map Specifications Control Method Stored program, cyclic scan system I/O Processing Method Batch processing method (when END instruction is executed) Execution Speed LD instructions – 0.54μs, MOV instructions – 3.
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Specifications Timer interrupt I602~I699, I702~I799, 2 points (Timer resolution = 1ms) High-speed counter interrupt I010, I020, I030, I040, I050, I060, I070, I080,8 points Communication interrupt I140(COM1), I150(COM2), I160(COM3), 3 points, (*3) K Decimal K-32,768 ~ K32,767 (16-bit operation), K-2,147,483,648 ~ K2,147,483,647 (32-bit operation) H Hexadecimal H0000 ~ HFFFF (16-bit operation),
2 . P r o g r a m m i n g C o n c e p ts 2.2 SS2 Memory Map Specifications Control Method Stored program, cyclic scan system I/O Processing Method Batch processing method (when END instruction is executed) Execution Speed LD instructions – 0.54μs, MOV instructions – 3.4μs Program language Instruction List + Ladder + SFC Program Capacity 7920 steps Bit Contacts X External inputs X0~X377, octal number system, 256 points max. Y External outputs Y0~Y377, octal number system, 256 points max.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Specifications Software 32bit highspeed count up/down C235~C242, 1 phase 1 input, 8 points, (*2) C233~C234, 2 phase 2 input, 2 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) Hardware Total 22 points C245~C250, 1 phase 2 input, 6 points, (*2) C251~C254 2 phase 2 input, 4 points, (*2) S Step point Initial step point S0~S9, 10 points, (*2) Zero point return S10~S19, 10 points (use with
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2.3 SA2 Memory Map Specifications Control Method Stored program, cyclic scan system I/O Processing Method Batch processing method (when END instruction is executed) Execution Speed LD instructions – 0.54μs, MOV instructions – 3.4μs Program language Instruction List + Ladder + SFC Program Capacity 15872 steps Bit Contacts X External inputs X0~X377, octal number system, 256 points max.
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Specifications High-speed counter interrupt I010, I020, I030, I040, I050, I060, I070, I080, 8 points Communication interrupt I140(COM1), I150(COM2), I160(COM3), 3 points, (*3) K Decimal K-32,768 ~ K32,767 (16-bit operation), K-2,147,483,648 ~ K2,147,483,647 (32-bit operation) H Hexadecimal H0000 ~ HFFFF (16-bit operation), H00000000 ~HFFFFFFFF (32-bit operation) Constant Serial ports COM1: b
2 . P r o g r a m m i n g C o n c e p ts 2.4 SX2 Memory Map Specifications Control Method Stored program, cyclic scan system I/O Processing Method Batch processing method (when END instruction is executed) Execution Speed LD instructions – 0.54μs, MOV instructions – 3.4μs Program language Instruction List + Ladder + SFC Program Capacity 15872 steps Bit Contacts X External inputs X0~X377, octal number system, 256 points max. Y External outputs Y0~Y377, octal number system, 256 points max.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Specifications speed count up/down C232~C234, 2 phase 2 input, 2 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) Hardware C245~C250, 1 phase 2 input, 6 points, (*2) C251~C254 2 phase 2 input, 4 points, (*2) S Step point Initial step point S0~S9, 10 points, (*2) Zero point return S10~S19, 10 points (use with IST instruction), (*2) Latched S20~S127, 108 points, (*2) General S128~S911,
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2.5 Status and Allocation of Latched Memory Memory type Power STOP=>RUN OFF=>ON Nonlatched M Auxiliary relay Clear Unchanged Unchanged Initial 2-14 0 Unchanged Clear 0 Initial setting General Latched Special auxiliary relay M0~M511 M768~M999 M2000~M2047 M512~M999 M2048~M4095 M1000~M1999 Not latched Latched Some are latched and can’t be changed.
2 . P r o g r a m m i n g C o n c e p ts 2.6 PLC Bits, Nibbles, Bytes, Words, etc For different control purposes, there are five types of values inside DVP-PLC for executing the operations. Numeric Description Bit Bit is the basic unit of a binary number system. Range is 0 or 1 Nibble Consists of 4 consecutive bits, e.g. b3~b0. Range 0 ~ 9 in Decimal or 0~F in Hex Consists of 2 consecutive nibbles, e.g. b7~b0. Range 00 ~ FF in Hex Byte Consists of 2 consecutive bytes, e.g. b15~b0.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g z Constant K: Decimal value in PLC operation is attached with an “K”, e.g. K100 indicates the value 100 in Decimal format. Exception: When constant K is used with bit devices X, Y, M, S, the value specifed after K indicates the groups of 4-bit unit, which forms a digit(4-bit), byte(8 bit), word(16bit), or double word(32-bit) data, e.g. K2Y10, K4M100, representing Y10 ~ Y17 and M100~M115. 4.
2 . P r o g r a m m i n g C o n c e p ts Binary (BIN) Octal (OCT) Decimal (K) (DEC) No. of X, Y relay Costant K, No. of registers M, S, T, C, D, E, F, P, I devices 1101 15 13 0011 D 1110 16 14 0100 E 1111 17 15 0101 F 10000 20 16 0110 10 10001 21 17 0111 11 For PLC internal operation 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M Function ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M Function ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M M1086 Function Enabling password function for DVP- ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M M1109 M1110 Function ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M M1141 Function For COM2 (RS-485), MODRD / MODWR ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M Function ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M Function ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M M1274 Function C239 counting mode (ON: falling-edge ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M M1346* Function Output clear signals when ZRN is ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN ○ ○ ○ ○ OFF - - R/W NO OFF ○ ○ ○ ○ OFF - - R/W NO OFF ○ ○ ○ ○ OFF - - R/W NO OFF completed M1347 Auto-reset Y0 when high speed pulse output is completed M1348 Auto-reset Y1 when high speed pulse RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M M1378* Function Indicate Slave ID#3 data interchange ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special M ES2 SS2 SA2 SX2 EX2 Function OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special M M1437* M1438* M1439* M1524 M1525 M1534 M1535 Function Indicate that writing completed Indicate that writing completed Indicate that writing completed Auto-reset Y2 when output is completed Auto-reset Y3 when output is completed ES2 SS2 SA2 SX2 EX2 OFF Ø ON STOP Ø RUN RUN Latch Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2.9 S Relay Initial step relay Zero return step relay Latched step relay General purpose step relay Alarm step relay Starting instruction in Sequential Function Chart (SFC). S0~S9, total 10 points. Returns to zero point when using IST instruction in program. Zero return step relays not used for IST instruction can be used as general step relays. S10~S19, total 10 ponits.
2 . P r o g r a m m i n g C o n c e p ts Accumulative Timer The timer executes once when the program reaches END instruction. When TMR instruction is executed, the timer coil will be ON when the current value reaches its preset value. For accumulative timers, current value will not be cleared when timing is interrupted. Timer T250 will be driven when X0 = ON. When X0 = OFFor the power is off, timer T250 will pause and retain the current value.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 16 bits counters Ouptut Coil will be ON when counter reaches preset value. Output contact function High speed conparison Reset action - 32 bits counters Output coil is ON when counter reaches or is above preset value. Output coil is OFF when counter is below preset value. Associated devices are activated immediately when preset value is reached, i.e. independant of scan time.
2 . P r o g r a m m i n g C o n c e p ts M relays M1200~M1254 are used to set the up/down counting direction for C200~C254 respectively. Setting the corresponding M relay ON will set the counter to count down.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2.12 High-speed Counters There are two types of high speed counters provided including Software High Speed Counter (SHSC) and Hardware High Speed Counter (HHSC). The same Input point (X) can be designated with only one high speed counter. Double designation on the same input or the same counter will result in syntax error when executing DCNT instruction.
2 . P r o g r a m m i n g C o n c e p ts Applicable Hardware High Speed Counters: 1-phase C 1-phase 2-input input X 2-phase 2-input C243 C244 C245 C246 C247 C248 C249 C250 C251 C252 C253 C254 X0 U U/D U/D U U A A X1 R Dir Dir D D B B X2 U U/D U/D A A X3 R Dir Dir B B X4 R X5 U: Count up D: Count down A: B: R R Phase A input Phase B input Dir: R: R Directoin signal input Reset signal input R Note: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 7. C243 and C244 support count-up mode only and occupy the associate input points X1 and X3 as reset (“R”) function. If users do not need to apply reset function, set ON the associated special M relays (M1243 and M1244) to disable the reset function. 8. “Dir” refers to direction control function. OFF indicates counting up; ON indicates counting down. 9.
2 . P r o g r a m m i n g C o n c e p ts 1. X21 drives M1235 to determine counting direction (Up/Down) of C235. 2. When X20 = ON, RST instsruction executes and the current value in C235 will be cleared. Contact C235 will be OFF 3. When X22 = ON, C235 receives signals from X0 and counter will count up (+1) or count down (-1). 4. When counter C235 reaches K5, contact C235 will be ON. If there is still input signal input for X0, it will keep on counting.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X20 X21 X0 count up X1 count down C247 present value 7 6 6 5 5 4 4 3 3 2 1 0 Y0, C247 contact AB-phase input high-speed counter: Example: LD M1002 MOV K2 D1022 LD X20 RST C251 LD X21 DCNT C251 K5 LD C251 OUT Y0 M1002 MOV K2 RST C251 DCNT C251 D1022 X20 X21 K5 C251 Y0 1. When X20 is ON, RST instsruction executes and the current value in C251 will be cleared.
2 . P r o g r a m m i n g C o n c e p ts X20 X21 A-phase X0 B-phase X1 C251 present value 4 5 6 5 4 3 3 3 2 1 0 Counting up 2 1 Counting down 0 Y0, C251 contact 2.13 Special Data Register The types and functions of special registers (special D) are listed in the table below. Care should be taken that some registers of the same No. may bear different meanings in different series MPUs. Special M and special D marked with “*” will be further illustrated in 2.13.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special D D1023* Content Register for Storing detected pulse width (unit: 0.1ms) D1025* Code for communication request error ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special D D1070 ↓ D1085 Content Feedback data (ASCII) of Modbus communication. When PLC’s RS-485 communication instruction receives feedback signals, the data will be saved in the registers D1070~D1085. Usres can check the received data in these registers. ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special D Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special D D1253 Content COM3 (RS-485) communication error code (only applicable for MODRW/RS instruction) D1255* COM3 (RS-485) PLC communication address ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib. Default -ed ON RUN STOP ○ ╳ ○ ╳ 0 - - R/W NO 0 ○ ╳ ○ ○ 50 - - R/W YES 1 D1256 ↓ D1295 For COM2 RS-485 MODRW instruction.
2 . P r o g r a m m i n g C o n c e p ts Special D Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special D Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special D Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special D ↓ Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts Special D ↓ Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special D Content ES2 SS SA SX EX2 2 2 2 OFF STOP RUN Latch Ø Ø Ø Attrib.
2 . P r o g r a m m i n g C o n c e p ts 2.14 E, F Index Registers Index registers are used as modifiers to indicate a specified device (word, double word) by defining an offset. Devices can be modified includes byte device (KnX, KnY, KnM, KnS, T, C, D) and bit device (X, Y, M, S). E, F registers cannot be used for modifying constant (K, H) Index registers not used as a modifier can be used as general purpose register.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Pointer I For interrupt External interrupt I000/I001(X0), I100/I101(X1), I200/I201(X2), I300/I301(X3), I400/I401(X4), I500/I501(X5), I600/I601(X6), I700/I701(X7), 8 points (01, rising-edge trigger , 00, falling-edge trigger ) I602/I699, I702/I799, 2 points (Timer resolution=1ms) Timer interrupt High-speed counter interrupt Communication interrupt The location point of interrupt subroutine.
2 . P r o g r a m m i n g C o n c e p ts P** X0 20 CALL P2 Call subroutine P** X1 24 Y1 FEND P2 (subroutine P2) Y0 subroutine Y1 SRET subroutine return Interrupt pointer I: used with application instruction API 04 EI, API 05 DI, API 03 IRET. There are four types of interruption pointers. To insert an interruption, users need to combine EI (enable interruption), DI (disable interruption) and IRET (interruption return) instructions 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g communication. Set up the specific end word in D1167 and write the interruption subroutine I140. When PLC receives the end word, the program will execute I140. I150: Communication instruction RS (COM2 RS-485) can be designated to send interrupt request when specific charcters are received. Interrupt I150 and specific characters is set to low byte of D1168.
2 . P r o g r a m m i n g C o n c e p ts 2.16 Applications of Special M Relays and D Registers Function Group PLC Operation Flag Number M1000~M1003 Contents: These relays provide information of PLC operation in RUN status. M1000: NO contact for monitoring PLC status. M1000 remains “ON” when PLC is running. M1000 PLC is running Y0 Normally ON contact in PLC RUN status Keeps being ON M1001: NC contact for monitoring PLC status. M1001 remains “OFF” when PLC is running.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. The default in the monitor timer is 200ms. If the program is long or the operation is too complicated, MOV instruction can be used to modify SV. See the example below for SV = 300ms. M1002 0 MOV K300 D1000 Initial pulse 3. The maximum SV in the monitor timer is 32,767ms. However, care should be taken when adjusting SV.
2 . P r o g r a m m i n g C o n c e p ts 2. D1008 saves the STEP address where the timeout occurred Function Group Scan Time Monitor Number D1010~D1012 Contents: The present value, minimum value and maximum value of scan time are stored in D1010 ~ D1012. D1010: current scan time D1011: minimum scan time D1012: maximum scan time Function Group Internal Clock Pulse Number M1011~M1014 Contents: 1. PLC provides four different clock pulses to aid the application.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X10 M1015 Function Group M1016~M1017, D1313~D1319 Number Real Time Clock Contents: 1. Special M and special D relevant to RTC Device M1016 M1017 Name Year Display ±30 seconds correction Function OFF: display the last 2 digits of year in A.D ON: display the last 2 digits of year in A.D. plus 2,000 When triggered from “Off” to “On”, the correction is enabled.
2 . P r o g r a m m i n g C o n c e p ts Function Group Adjustment on Input Terminal Response Time Number D1020 Contents: 1. D1020 can be used for setting up the response time of receiving pulses at X0 ~X7 for ES2 series MPU. Default: 10ms, 0~20ms adjustable. 2. When the power of PLC goes from “OFF” to “ON”, the content of D1020 is set to 10 automatically. Terminal X0 response time 0ms 1ms 0 1 Set by D1020 (default: 10) X7 10ms 15ms 3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Function Group Communication Error Code Number M1025, D1025 Contents: In the connection between PLC and PC/HMI, M1025 will be ON when PLC receives illegal communication request during the data transmission process. The error code will be stored in D1025. 01: illegal instruction code 02: illegal device address. 03: requested data exceeds the range.
2 . P r o g r a m m i n g C o n c e p ts DABSR: 1. M1029= ON when instruction is completed. 2. When the instruction is re-executed for the next time, M1029 will turn off first then ON again when the instruction is completed ZRN, DRVI, DRVA: 1. M1029 will be “ON” after Y0 and Y1 pulse output is completed. M1102 will be “ON” after Y2 and Y3 pulse output is compeleted. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Function Group RUN/STOP Switch Number M1035 Contents: When M1035 = ON, PLC uses input point X7 as the switch of RUN/STOP.
2 . P r o g r a m m i n g C o n c e p ts Content b7 0100(H4): 0101(H5): 0110(H6): 0111(H7): 1000(H8): 1001(H9): 1010(HA): 1011(HB): 1100(HC): b8 Select start bit 0: None 600 1200 2400 4800 9600 19200 38400 57600 115200 500000 (COM2 / COM3) 31250 (COM2 / COM3) 921000 (COM2 / COM3) 1: D1124 b9 Select the 1st end bit 0: None 1: D1125 0: None 1: D1126 1101(HD): 1110(HE): 1111(HF): nd b10 Select the 2 end bit b11~b15 Undefined Example 1: Modifying COM1 communication format 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example 3: Modifying COM3 communication format 1. Add the below instructions on top of the program to modify the communication format of COM3. When PLC switches from STOP to RUN, the program will detect whether M1136 is ON in the first scan. If M1136 is ON, the program will modify the communication settings of COM3 according to the value set in D1109 2.
2 . P r o g r a m m i n g C o n c e p ts Note: 1. The modified communication format will not be changed when PLC state turns from RUN to STOP. 2. If the PLC is powered OFF then ON again in STOP status, the modified communication format on COM1~COM3 will be reset to default communication format (9600, 7, E, 1). Function Group Enable SPD function Number M1037, D1037 Contents: 1. M1037 and D1037 can be used to enable 8 sets of SPD instructions.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. By using PLC-Link, D1038 can be set to send next communication data with delay. Unit: 1 scan cycle. 0~10,000 adjustable Function Group Fixed scan time Number M1039, D1039 Contents: 1. When M1039 is ON, program scan time is determined by D1039. When program execution is completed, next scan will be activated only when the fixed scan time is reached.
2 . P r o g r a m m i n g C o n c e p ts 5. The analog output signals and their corresponding digital values: Model 20EX2/SX2 30EX2 -2000~+2000 -32000~+32000 +0 mA~+20 mA +0~+4000 +0~+32000 +4 mA~+20 mA +0~+4000 +0~+32000 Mode Voltage Current 6.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Analog input mode Current Temperature Upper limit value Lower limit value -20 mA~+20 mA +32384 -32384 +4 mA~+20 mA +32384 -384 PT100/PT1000 +8100 -1900 NI100/NI1000 +1800 -900 Device number D1115 Function 20EX2/SX2 analog input/output mode setting (Default=H’0) bit0~bit5: Selection between the voltage/current mode (0: Voltage; 1: Current; Default: Voltage) bit0~bit3: Analog inputs (AD0
2 . P r o g r a m m i n g C o n c e p ts Function Group Enable 2-speed output function of DDRVI instruction Number Contents: M1119 When M1119 is ON, 2-speed output function of DDRVI will be enabled. Example: Assume that D0 (D1) is the first speed and D2(D3) is the second speed. D10(D11) is the output pulse number of the first speed and D12(D13) is the output pulse number of the second speed.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Vbase T1 T2+T3 P(1) V(1) Initial frequency Ramp-up time Rampdown time Position of the first speed The first speed Function Group Program Execution Error Number M1067~M1068, D1067~D1068 P(2) Position of the second speed V(2) The second speed Contents: Latched STOP→RUN RUN→STOP Program execution error None Clear Unchanged M1068 Execution error locked None Unchanged Unchanged D1
2 . P r o g r a m m i n g C o n c e p ts D1140: Number of right-side modules (AIO, PT, TC, etc.), max. 8 modules can be connected. D1142: Number of input points (X) on DIO modules. D1143: Number of output points (Y) on DIO modules. D1145: Number of left-side modules (AIO, PT, TC, etc.), max. 8 modules can be connected. (Only applicable for SA2/SX2). Function Group Reverse Interrupt Trigger Pulse Direction Number M1280, M1284, M1286 Contents: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g a) When X0 (counter input) and X1 (external Interrupt) correspondingly work together with C243, and I100/I101, PLC will move the count value to D1241 and D1240.
2 . P r o g r a m m i n g C o n c e p ts Function Group ID of right side modules on ES2/EX2 Number D1320~ D1327 Contents: When right side modules are connected on ES2/EX2, the ID of each I/O module will be stored in D1320~D1327 in connection order.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g MASTER PLC SLAVE ID 1 SLAVE ID 2 SLAVE ID 3 SLAVE ID 4 SLAVE ID 5 SLAVE ID 6 SLAVE ID 7 SLAVE ID 8 Read out Read out Read out Read out Read out Read out Read out Read out Write in Write in Write in Write in Write in Write in Write in Write in Special D registers for storing the read/written 16 data (Auto-assigned) D1480 D1496 D1512 D1528 D1544 D1560 D1576 D1592 D1608 D1624 D1640
2 . P r o g r a m m i n g C o n c e p ts D1442 D1458 D1443 D1459 D1444 D1460 D1445 D1461 D1446 D1462 D1447 D1463 D1448 D1464 D1449 D1465 Starting reference of the Slave to be accessed* D1363 D1423 D1364 D1424 D1365 D1425 D1366 D1426 D1367 D1427 D1368 D1428 D1369 D1429 D1370 D1430 M1355 = ON, Slave status is user-defined. Set the linking status of Slave manually by M1360~M1375. M1355 = OFF, Slave status is auto-detected.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1376 M1377 M1378 M1379 M1380 M1381 M1382 M1383 M1398 M1399 Access error flag (ON = normal; OFF = error) M1392 M1393 M1394 M1395 M1396 M1397 “Reading completed” flag (turns “Off” whenever access of a Slave is completed) M1408 M1409 M1410 M1411 M1412 M1413 M1414 M1415 “Writing completed” flag (turns “Off” whenever access of a Slave is completed) M1424 M1425 M1426 M1427 M1428
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g b) c) d) e) Set up Master PLC ID by D1121 and the starting slave ID by D1399. Then, set slave ID of each slave PLC. The ID of master PLC and slave PLC cannot be the same. Set data length for accessing. (If data length is not specified, PLC will take default setting or the previous value as the set value.
2 . P r o g r a m m i n g C o n c e p ts f) g) accessible and the user can specify the starting register for storing the read/written data. For example, if the register for storing the read/written data on Slave ID1 is specified as D1480 = K500, D1496 = K800, access data length D1434 = K50, D1450 = K50, registers of Master PLC D500~D549 will store the data read from Slave ID1, and the data stored in D800~D849 will be written into Slave ID1. Master PLC conducts reading before writing.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 10. Operation flow chart: Set starting reference of the S lave PLC to be read: D1355~D1370 Set data length for reading from Slave PLC: D1434~D1449 Se t starting reference of the Slave PLC to be written: D1450~D1465 Se t data length for writing in Slave PLC (PL C will take default or previous setting as the set value if t hese registers are not specified) Enable M13 55 = ON, auto-detection disabled.
2 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g d) Master PLC Preset value Slave PLC Preset value D1480 ~ D1495 D1496 ~ D1511 D1512 ~ D1527 D1528 ~ D1543 K5,000 K1,000 K6,000 K2,000 D100 ~ D115 of Slave ID#1 D200 ~ D215 of Slave ID#1 D100 ~ D115 of Slave ID#2 D200 ~ D215 of Slave ID#2 K5,000 K1,000 K6,000 K2,000 Up to16 Slaves can be accessed through PLC LINK.
2 . P r o g r a m m i n g C o n c e p ts e) Commands of VFD can be specified by changing the value in D1496, e.g. D1496 = H12=>VFD forward operation; D1496 = H1=> VFD stops) f) Frequency of VFD can be specified by changing the value in D1497, e.g. D1497 = K5000, set VFD frequency as 50kHz. g) In addition to VFD AC motor drives, devices support MODBUS protocol such as DTA/DTB temperature controllers and ASDA servo drives can also be connected as Slaves. Up to 16 Slaves can be connected. 13.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g MEMO 2-84
Instruction Set This chapter explains all of the instructions that are used with DVP-ES2/EX2/SS2/ SA2/SX2/SE as well as detailed information concerning the usage of the instructions. Chapter Contents 3.1 Basic Instructions (without API numbers) ............................................................................. 3-2 3.2 Explanations to Basic Instructions ........................................................................................ 3-3 3.3 Pointers ..................................
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3.1 Basic Instructions (without API numbers) Instruction Function Operand Execution speed (us) ES2/EX2/SS2 SE SA2/SX2 Steps LD Load NO contact X, Y, M, S, T, C 0.76 0.64 1~3 LDI Load NC contact X, Y, M, S, T, C 0.78 0.68 1~3 AND Connect NO contact in series X, Y, M, S, T, C 0.54 0.58 1~3 ANI Connect NC contact in series X, Y, M, S, T, C 0.56 0.
3. Instruction Set execution time could be longer due to a more complicated program, e.g. program contains multiple interruptions or high speed input/output. 3.2 Explanations to Basic Instructions Mnemonic Operands LD X, Y, M, S, T, C Function Program steps Load NO contact 1~3 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanations: The LD instruction is used to load NO contact which connects to left side bus line or starts a new block of program connecting in series or parallel connection.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example: Ladder diagram: X1 Instruction: X0 Y1 Operation: LDI X1 Load NC contact X1 AND X0 Connect NO contact X0 in series OUT Y1 Drive Y1 coil Mnemonic Operands Function Program steps ANI X, Y, M, S, T, C Connect NC contact in series 1~3 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanations: The ANI instruction is used to connect NC contact in series.
3. Instruction Set Explanations: The ORI instruction is used to connect NC contact in parallel. Program example: Ladder diagram: Instruction: X0 Operation: LD X0 Load NO contact X0 ORI X1 Connect NC contact X1 in parallel OUT Y1 Drive Y1 coil Y1 X1 Mnemonic ANB Function Controllers Program steps Connect a block in series 1 ES2/EX2 SS2 SA2 SX2 SE Explanations: The ANB instruction is used to connect a circuit block to the preceding block in series.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example: Ladder diagram: X0 X1 Block A X2 X3 Instruction: Y1 ORB Block B Operation: LD X0 Load NO contact X0 ANI X1 Connect NC contact X1 in series LDI X2 Load NC contact X2 AND X3 Connect NO contact X3 in series Connect circuit block in parallel ORB OUT Y1 Drive Y1 coil Mnemonic Function Program steps MPS Start of branches.
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Operands SET Y, M, S Function Program steps Latches the ON status 1~3 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanations: When the SET instruction is driven, its designated device will be ON and latched whether the SET instruction is still driven. In this case, RST instruction can be applied to turn off the device.
3. Instruction Set between MC/MCR will operate as the following table.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Function Program steps Program End END 1 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanations: END instruction needs to be connected at the end of program. PLC will scan from address 0 to END instruction and return to address 0 to scan again.
3. Instruction Set Timing Diagram: M0 M1 A scan cycle A scan cycle Y0 Mnemonic PN Function Program steps Positive contact to Negative contact 1 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanation: When the conditions preceding PN command change from true to false, PN command (works as contact A) will be ON for a scan cycle. In the next scan cycle it turns OFF.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3.3 Pointers Mnemonic Operands Function Program steps P P0~P255 Pointer 1 Controllers ES2/EX2 SS2 SA2 SX2 SE Explanation: Pointer P is used with API 00 CJ and API 01 CALL instructions. The use of P does not need to start from P0, and the No. of P cannot be repeated; otherwise, unexpected errors may occur. For other information on P pointers, please refer to section 2.
3. Instruction Set : IRET Interruption return External interrupt: ES2 supports 8 external input interrupts: (I000/I001, X0), (I100/I101, X1), (I200/I201, X2), (I300/I301, X3), (I400/I401, X4), (I500/I501, X5), (I600/I601, X6) and (I700/I701, X7). (01, rising-edge trigger , 00, falling-edge trigger ) Timer Interrupts: ES2 supports 2 timer interrupts: I602~I699, I702~I799, (Timer resolution: 1ms) Communication Interrupts: ES2 supports 3 communication interrupts: I140, I150 and I160.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3.5 Application Programming Instructions 1. PLC instructions are provided with a unique mnemonic name to make it easy to remember instructions. In the example below the API number given to the instruction is 12, the mnemonic name is MOV and the function description is Move.
3. Instruction Set Source: if there are more than one source is required, it will be indicated as S1, S2....etc. Destination: if there are more than one destination is required, it will be indicated as D1, D2....etc. If the operand can only be constant K/H or a register, it will be represented as m, m1, m2, n, n1, n2…etc. Length of Operand (16-bit or 32-bit instruction) The length of operand can be divided into two groups: 16-bit and 32-bit for processing data of different length.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g supports index E and F. A symbol “*” is given to device which can be used for this operand Steps occupied by the 16-bit/32-bit/pulse instruction Applicable PLC models for 16-bit/32-bit/pulse execution instruction. Continuous execution vs. Pulse execution 1. There are two execution types for instructions: continuous execution instruction and pulse instruction.
3. Instruction Set 1. X, Y, M, and S are defined as bit devices which indicate ON/OFF status. 2. 16-bit (or 32-bit) devices T, C, D, and registers E, F are defined as word devices. 3. “Kn” can be placed before bit devices X, Y, M and S to make it a word device for performing word-device operations. (n = 1 refers to 4 bits. For 16-bit instruction, n = K1 ~ K4; for 32-bit instruction, n = K1 ~ K8). For example, K2M0 refers to 8 bits, M0 ~ M7.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 When X0 = ON, DSW will be SET M0 enabled. M0 DSW X10 Y10 D0 K0 M1029 When X0 = OFF, M0 is latched. M0 will be reset RST M0 only when DSW instruction is completed to activate M1029. 2. Error Operation Flags Errors occur during the execution of the instruction when the combination of application instructions is incorrect or the devices designated by the operand exceed their range.
3. Instruction Set 5. For counters C243, C245~C248, C251, C252, the total max times for using DHSCS, DHSCR and DHSZ instructions: 4. DHSZ takes up 2 times of the total available times. 6. For counters C244, C249, C250, C253, C254, the total max times for using DHSCS, DHSCR and DHSZ instructions: 4. DHSZ takes up 2 times of the total available times.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. Transmit K1M0, K2M0, K3M0 to 16-bit registers. Only the valid bit data will be transmitted and the upper bits in the 16-bit register will all be filled with 0. The same rule applies when sending K1M0, K2M0, K3M0, K4M0, K5M0, K6M0, K7M0 to 32-bit registers. 4.
3. Instruction Set Binary Floating Point DVP-PLC represents floating point value in 32 bits, following the IEEE754 standard: S 8-bit 23-bit exponent mantissa b31 b0 Sign bit 0: positive 1: negative Equation (− 1) × 2 E − B × 1.M ; B = 127 S Therefore, the range of 32-bit floating point value is from ±2-126 to ±2+128, i.e. from ±1.1755×10-38 to ±3.4028×10+38. Example 1: Represent “23” in 32-bit floating point value Step 1: Convert “23” into a binary value: 23.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g The decimal floating point is represented by 2 continuous registers. The register of smaller number is for the constant while the register of bigger number is for the exponent.
3. Instruction Set The opposite diagram E, F index register modification MOV K20E0 D10F0 refers to the content in the operand changes with the contents in E and F. E0 = 8 F0 = 14 For example, E0 = 8 and K20E0 represents constant 20 + 8 = 28 10 + 14 = 24 Transmission K28 D24 K28 (20 + 8). When the condition is true, constant K28 will be transmitted to register D24. Devices modifiable: P, X, Y, M, S, KnX, KnY, KnM, KnS, T, C, D.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3.
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g High Speed Processing Mnemonic Applicable to API Function PULSE 16 bits 32 bits ES2 EX2 SS2 SA2 SE STEPS SX2 16-bit 32-bit 50 REF - Refresh 5 - 51 REFF - Refresh and filter adjust 3 - 52 MTR - - Input Matrix 9 - 53 - DHSCS - High speed counter SET - 13 54 - DHSCR - High speed counter RESET - 13 55 - DHSZ - High speed zone compare - 17 56 SPD - - Speed
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Applicable to API 16 bits 99 Function PULSE 32 bits PLF ES2 EX2 - - SS2 SA2 SE Falling-edge output STEPS SX2 16-bit 32-bit 3 - Communication Instructions Mnemonic Applicable to API Function PULSE 16 bits 32 bits ES2 EX2 SS2 SA2 SE 2 STEPS SX2 16-bit 32-bit 100 MODRD - - Read Modbus data 7 - 101 MODWR - - Write Modbus Data 7 - 102 FWD - - Forward Operation
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Applicable to API Function PULSE 16 bits 32 bits 205 CMPT DCMPT 207 CSFO - ES2 EX2 STEPS SA SS2 SX2 SE 16-bit 32-bit 2 Compare table - Catch speed and proportional - output 9 17 7 - Positioning Control Mnemonic Applicable to API Function PULSE ES2 SA2 16 bits 32 bits 155 - DABSR - Absolute position read - 13 156 - DZRN - Zero return - 17 157 - DPLSV
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic API Applicable to Function PULSE 16 bits 223 OR^ 32 bits ES2 EX2 DOR^ - SS2 SA2 SE S1 ^ S2 STEPS SX2 16-bit 32-bit 5 9 Contact Type Comparison Mnemonic API Applicable to Function PULSE 16 bits 32 bits ES2 EX2 SS2 SA2 SE STEPS SX2 16-bit 32-bit 224 LD= DLD= - S1 = S2 5 9 225 LD> DLD> - S1 > S2 5 9 226 LD< DLD< - S1 < S2 5 9 228 LD<> DLD<> - S1 ≠ S2 5 9
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Applicable to API PULSE 16 bits 20 ADD 66 ALT Function 32 bits ES2 EX2 DADD - STEPS SS2 SA2 SX2 SE 16-bit 32-bit Addition 7 13 Alternate state 3 - 218 AND& DAND& - S1 & S2 5 9 220 AND^ DAND^ - S1 ^ S2 5 9 219 AND| DAND| - S1 | S2 5 9 234 AND< DAND< - S1 < S2 5 9 237 AND<= DAND<= - S1 ≦ S2 5 9 236 AND<> DAND<> - S1 ≠ S2 5 9 232 AND= DAND= -
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Applicable to API PULSE 16 bits Function 32 bits EX2 177 GPS - - GPS data receiving 144 GPWM - - 170 GRY 83 HEX ES2 DGRY - STEPS SS2 SA2 SX2 SE 16-bit 32-bit - 5 - General PWM output 7 - BIN → Gray Code 5 9 Convert ASCII to HEX 7 - 71 HKY DHKY - Hexadecimal key input 9 17 169 HOUR DHOUR - Hour meter 7 13 24 INC DINC Increment 3 5 Incremental drum s
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic Applicable to API PULSE 16 bits 89 PLS Function 32 bits - ES2 EX2 STEPS SS2 SA2 SX2 SE 16-bit 32-bit - Rising-edge output 3 - 59 PLSR DPLSR - Pulse ramp 9 17 57 PLSY DPLSY - Pulse output 7 13 - Print (ASCII code output) 5 - Parallel run 5 9 77 PR 81 PRUN DPRUN 58 PWM - - Pulse width modulation 7 - 67 RAMP DRAMP - Ramp variable value 9 17 154 RAND
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Mnemonic API Applicable to PULSE 16 bits Function 32 bits ES2 EX2 193 - DCIMR - 197 - DCLLM - 131 - 117 2-Axis Relative Position Arc STEPS SS2 SA2 SX2 SE 16-bit 32-bit - 17 Close loop position control - 17 DCOS Cosine - 9 - DDEG Radian → Degree - 9 175 - DDIVR Floating point division - 13 159 - DDRVA - Absolute position control - 17 158 - DDRVI - Relativ
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3.8 Detailed Instruction Explanation API Mnemonic 00 CJ Operands Function Controllers ES2/EX2 SS2 Conditional Jump P OP Range SA2 SX2 SE Program Steps P0~P255 CJ, CJP: 3 steps PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: The destination pointer P of the conditional jump. Explanations: 1.
3. Instruction Set Program example 1: When X0 = ON, the program will skip from address 0 to N (Pointer P1) automatically and keep on executing. Instructions between address 0 and N will be skipped.. When X0 = OFF, program flow will proceed with the row immediately after the CJ instruction. (CJ instruction) P*** X0 CJ 0 P1 X1 Y1 X2 Y2 N P1 Program example 2: 1. The instruction CJ between the instruction MC and the instruction MCR can be used in the five conditions below. a).
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g users. When the instruction MCR is executed, the previous state of the switch contact is popped from the top of the stack. Under the conditions listed in (b), (d), and (e) above, the number of times the items are pushed onto the stack may be different from the number of times the items are popped from the stack.
3. Instruction Set *1: Y1 is dual output. When M0 is OFF, it is controlled by M1. When M0 is ON, M12 will control Y1 *2: When timer that subroutine used (T184~T199) executes first and then CJ instruction is executed, the timer will keep counting. After the timer reaches the set value, output contact of timer will be ON. *3: When high-speed counters (C235~C254) executes first and then CJ instruction is executed, the counter will keep counting and its associated output status remains. Y1 is a dual output.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 01 CALL Operands Function Controllers ES2/EX2 SS2 Call Subroutine P OP Valid Range SA2 SX2 SE Program Steps P0~P255 CALL, CALLP: 3 steps PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: The destination pointer P of the call subroutine. Explanations: 1.
3. Instruction Set API Mnemonic 02 SRET Function Controllers ES2/EX2 SS2 Subroutine Return OP Descriptions Program Steps SRET: 1 step No contact to drive the instruction is required N/A SA2 SX2 SE Automatically returns program execution to the address after CALL instruction in O100. PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Explanations: SRET indicates the end of subroutine program.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example 2: 1. When the rising-edge of X20 is triggered, CALL P10 instruction will transfer execution to subroutine P10. 2. When X21 is ON, execute CALL P11, jump to and run subroutine P11. 3. When X22 is ON, execute CALL P12, jump to and run subroutine P12. 4. When X23 is ON, execute CALL P13, jump to and run subroutine P13. 5.
3. Instruction Set API Mnemonic 03 IRET Function Controllers ES2/EX2 SS2 Interrupt Return OP Descriptions Program Steps IRET: 1 step No contact to drive the instruction is required.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. Interrupt subroutines must be placed after the FEND instruction. 4. Other interrupts are not allowed during execution of a current interrupt routine. 5. When many interruptions occur, the priority is given to the firstly executed interruption. If several interruptions occur at the same time, the priority is given to the interruption with the smaller pointer No. 6.
3. Instruction Set execute DI instruction. After this, X0 will be reset as falling-edge when EI is executed again. Program example: During the PLC operation, the program scans the instructions between EI and DI, if X1 or X2 are ON, the subroutine A or B will be interruptted. When IRET is reached, the main program will resume.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 06 FEND OP N/A Function Controllers The End of The Main Program (First End) Descriptions SA2 SX2 SE Program Steps No contact to drive the instruction is required. PULSE SA2 ES2/EX2 SS2 SE ES2/EX2 SS2 FEND: 1 step 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Explanations: 1.
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g CALL Instruction Program Flow The program flow when X0=off, X1=off EI 0 Main program X0 CJ P0 CALL P63 X1 Main program DI FEND P0 Main program FEND P63 Command CALL subroutine SRET I301 Interrupt subroutine IRET END 3-54 The program flow when X0=Off, X1=On.
3. Instruction Set API Mnemonic 07 WDT Function P Controllers ES2/EX2 SS2 Watchdog Timer Refresh OP Descriptions SA2 SX2 SE Program Steps N/A WDT, WDTP: 1 step PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Explanations: 1. WDT instruction can be used to reset the Watch Dog Timer. If the PLC scan time (from address 0 to END or FEND instruction) is more than 200ms, the ERROR LED will flash.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example: If the program scan time is over 300ms, users can divide the program into 2 parts. Insert the WDT instruction in between, making scan time of the first half and second half of the program being less than 200ms. 300ms program END Dividing the program to two parts so that both parts scan time are less than 200ms.
3. Instruction Set API Mnemonic 08 FOR Type Operands X Y Controllers ES2/EX2 SS2 Start of a FOR-NEXT Loop Bit Devices OP Function M Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F FOR: 3 steps * * * * * * * * * * * S PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SA2 SE SX2 ES2/EX2 SS2 SX2 Operands: S: The number of times for the loop to be repeated.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example 1: After program A has been executed for 3 times, it will resume its execution after NEXT instruction. Program B will be executed for 4 times whenever program A is executed once. Therefore, program B will be executed 3 × 4 = 12 times in total. FOR K3 FOR K4 B A NEXT NEXT Program example 2: When X7 = OFF, PLC will execute the program between FOR ~ NEXT.
3. Instruction Set Program example 3: Users can adopt CJ instruction to skip a specified FOR ~ NEXT loop. When X1 = ON, CJ instruction executes to skip the most inner FOR ~ NEXT loop.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 10 D Type OP CMP Operands S1 S2 D Controllers ES2/EX2 SS2 Compare P Bit Devices X Function Y M S * * * Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F CMP, CMPP: 7 steps * * * * * * * * * * * DCMP, DCMPP: 13 steps * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Compari
3.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 3-62 X0 RST M0 RST M1 RST M2 ZRST M0 M2
3. Instruction Set API Mnemonic 12 D Type OP MOV Operands Y M Controllers ES2/EX2 SS2 Move P Bit Devices X Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F MOV, MOVP: 5 steps * * * * * * * * * * * DMOV, DMOVP: 9 steps * * * * * * * * S D PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source of data D: Destination of data Explanations: 1.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 13 SMOV Type Operands Shift Move P Bit Devices OP X Y M Function Word devices S Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SMOV, SMOVP: 11 step * * * * * * * * * * * * * * * * * * * * * * * S m1 m2 D n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device moved m1: Sta
3. Instruction Set Program example 1: 1. When M1168 = OFF (in BCD mode) and X0 = ON, the 4th (thousand) and 3rd (hundred) digit of the decimal value in D10 start to move to the 3rd (hundred) and 2nd (ten) digit of the decimal value in D20. 103 and 100 of D20 remain unchanged after this instruction is executed. 2. When the BCD value exceeds the range of 0 ~ 9,999, PLC detects an operation error and will not execute the instruction. M1067, M1068 = ON and D1067 stores the error code OE18 (hex).
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program example 3: 1. This instruction can be used to combine the DIP switches connected to the input terminals without continuous numbers. 2. Move the 2 digits of the right DIP switch (X27~X20) to the 2 digits of D2, and the 1 digit of the DIP switch (X33~X30) to the 1st digit of D1. 3.
3. Instruction Set API Mnemonic 14 D CML Type Operands Function X Y M ES2/EX2 SS2 Compliment P Bit Devices OP Controllers S S D Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F CML, CMLP: 5 steps * * * * * * * * * * * DCML, DCMLP: 9 steps * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit 32-bit SA2 SE SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source of data D: Destination device Explanations: 1.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 15 BMOV Type OP Operands Y M Controllers ES2/EX2 SS2 Block Move P Bit Devices X Function S S D n Word devices K H KnX KnY KnM KnS * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F BMOV, BMOVP: 7 steps * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Start of source devices D: Start of destinati
3. Instruction Set Program example 2: Assume the bit devices KnX, KnY, KnM and KnS are designated for moving, the number of digits of S and D has to be the same, i.e. their n has to be the same. M1000 BMOV K1M0 K1Y0 K3 Y0 M0 M1 Y1 M2 Y2 M3 Y3 M4 Y4 M5 Y5 M6 Y6 M7 Y7 M8 Y10 M9 Y11 M10 Y12 M11 Y13 n=3 Program example 3: The BMOV instruction will operate differently, automatically, to prevent errors when S and D coincide. 1.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 16 D Operands FMOV Type Function X Y M ES2/EX2 SS2 Fill Move P Bit Devices OP Controllers Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F FMOV, FMOVP: 7 steps * * * * * * * * * * * DFMOV, DFMOVP: 13 * * * * * * steps * * S D n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source of data
3. Instruction Set API Mnemonic 17 D XCH Type OP Operands Function Y M ES2/EX2 SS2 Exchange P Bit Devices X Controllers Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F XCH, XCHP: 5 steps * * * * * * * * DXCH, DXCHP: 9 steps * * * * * * * * D1 D2 PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D1: Device to be exchanged 1 D2: Device to be exchanged 2 Explanations: 1.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 18 D Type OP BCD Operands Y M S D Controllers ES2/EX2 SS2 Convert BIN to BCD P Bit Devices X Function S Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F BCD, BCDP: 5 steps * * * * * * * * * DBCD, DBCDP: 9 steps * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source of data D: Co
3. Instruction Set API Mnemonic 19 D Type OP BIN Operands Y M S D Controllers ES2/EX2 SS2 Convert BCD to BIN P Bit Devices X Function S Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F BIN, BINP: 5 steps * * * * * * * * * DBIN, DBINP: 9 steps * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source of data D: Conversion result Explanations: 1.
D V P - E S 2 / S A2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 10 3 10 6 8 2 1 6 8 8 10 10 4 2 0 4-digit DIP switch in BCD format 8 X37 X20 4-digit BCD value Using BIN instruction to store the BIN value into D100 Using BCD instruction to convert the content in D100 into a 4-digit BCD value.
3. Instruction Set API Mnemonic 20 D Type OP Operands ADD Y M Controllers ES2/EX2 SS2 Addition P Bit Devices X Function Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F ADD, ADDP: 7 steps * * * * * DADD, DADDP: 13 steps * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Summand S2: Addend D: Sum Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. If the operation result exceeds -2,147,483,648, the borrow flag M1021 will be ON. 3.
3. Instruction Set API Mnemonic 21 D Type OP Operands SUB Y M Controllers ES2/EX2 SS2 Subtraction P Bit Devices X Function Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F SUB, SUBP: 7 steps * * * * * DSUB, DSUBP: 13 steps * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Minuend S2: Subtrahend D: Remainder Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 22 D MUL Type Operands X Y M Controllers ES2/EX2 SS2 Multiplication P Bit Devices OP Function Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F MUL, DMULP: 7 steps * * * * DMUL, DMULP: 13 steps * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operand
3. Instruction Set Program Example: The 16-bit D0 is multiplied by the 16-bit D10 and brings forth a 32-bit product. The higher 16 bits are stored in D21 and the lower 16-bit are stored in D20. ON/OFF of MSB indicates the positive/negative status of the operation result.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 23 D DIV Type Operands X Y M Controllers ES2/EX2 SS2 Division P Bit Devices OP Function Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F DIV, DIVP: 7 steps * * * * DDIV, DDIVP: 13 steps * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1:
3. Instruction Set API Mnemonic 24 D Type OP INC Operands Y M Controllers ES2/EX2 SS2 Increment P Bit Devices X Function S D Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F INC, INCP: 3 steps * * * * * * * * DINC, DINCP: 5 steps PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Destination device Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 25 D Type OP DEC Operands Y M Controllers ES2/EX2 SS2 Decrement P Bit Devices X Function S D Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DEC, DECP: 3 steps * * * * * * * * DDEC, DDECP: 5 steps PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Destination device Explanation: 1.
3. Instruction Set API Mnemonic 26 WAND Type OP Operands Y M S1 S2 D Controllers Logical Word AND P Bit Devices X Function ES2/EX2 SS2 Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F WAND, WANDP: 7 steps * * * * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data device 1 S2: Source data device 2 D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 26 DAND Type OP Operands Y M Controllers Logical DWord AND P Bit Devices X Function S S1 S2 D ES2/EX2 SS2 Word devices K H KnX KnY KnM KnS * * * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F DAND, DANDP: 13 steps * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data dev
3. Instruction Set API Mnemonic 27 WOR Type OP Operands Y M S S1 S2 D Controllers Logical Word OR P Bit Devices X Function ES2/EX2 SS2 Word devices K H KnX KnY KnM KnS * * * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F WOR, WORP: 7 steps * * * * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data device 1 S2: Source data device 2 D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 27 DOR Type OP Operands Y M Controllers Logical DWord OR P Bit Devices X Function ES2/EX2 SS2 Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F DOR, DORP: 13 steps * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data devic
3. Instruction Set API Mnemonic 28 WXOR Type OP Operands Y M Controllers Logical Word XOR P Bit Devices X Function ES2/EX2 SS2 Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F WXOR, WXORP: 7 steps * * * * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data device 1 S2: Source data device 2 D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 28 DXOR Type OP Operands Y M S1 S2 D Controllers Logical DWord XOR P Bit Devices X Function S ES2/EX2 SS2 Word devices K H KnX KnY KnM KnS * * * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F DXOR, DXORP: 13 steps * * * * * * * * * * * * 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Source data dev
3. Instruction Set API Mnemonic 29 D NEG Type OP Operands Function 2’s Complement (Negation) P Bit Devices X Y M Controllers S ES2/EX2 SS2 Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F NEG, NEGP: 3 steps D * PULSE SA2 ES2/EX2 SS2 SE * * * * * * * DNEG, DNEGP: 5 steps 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Device to store the operation result of 2’s Compliment Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 CMP D0 D2 M0 SUB D0 D2 D4 SUB D2 D0 D4 M0 M1 M2 Detailed explanations on negative value and its absolute value 1. MSB = 0 indicates the value is positive while MSB = 1 indicates the value is negative. 2. NEG instruction can be applied to convert a negative value into its absolute value.
3. Instruction Set API Mnemonic 30 D ROR Type OP Operands Y M D n Controllers ES2/EX2 SS2 Rotation Right P Bit Devices X Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ROR, RORP: 5 steps * * * * * * * * DROR, DRORP: 9 steps * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Device to be rotated n: Number of bits to be rotated in 1 rotation Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 31 D Type OP ROL Operands Y M D n Controllers ES2/EX2 SS2 Rotate Left P Bit Devices X Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ROL, ROLP: 5 steps * * * * * * * * DROL, DROLP: 9 steps * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Device to be rotated n: Number of bits t
3. Instruction Set API Mnemonic 32 D Type OP RCR Operands Y M D n Controllers Rotation Right with Carry P Bit Devices X Function ES2/EX2 SS2 Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F RCR, RCRP: 5 steps * * * * * * * * DRCR, DRCRP: 9 steps * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Device to be rotated n: Number of bits to be rotated in 1 rotation Explanation: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 33 D RCL Type OP Operands Y M Controllers Rotation Left with Carry P Bit Devices X Function ES2/EX2 SS2 Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F RCL, RCLP: 5 steps * * * * * * * * DRCL, DRCLP: 9 steps * * D n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Device to be rotated n: N
3. Instruction Set API Mnemonic 34 SFTR Type Operands P X * S D n1 n2 Y * * M * * Controllers ES2/EX2 SS2 Bit Shift Right Bit Devices OP Function Word devices S * * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SFTR, SFTRP: 9 steps * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Start No. of source device shifted D: Start No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 35 SFTL Type Operands P X * S D n1 n2 Y * * M * * Controllers ES2/EX2 SS2 Bit Shift Left Bit Devices OP Function Word devices S * * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SFTL, SFTLP: 9 steps * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit 32-bit SA2 SE SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Start No.
3. Instruction Set API Mnemonic 36 WSFR Type Operands P X Y M Controllers ES2/EX2 SS2 Word Shift Right Bit Devices OP Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F WSFR, WSFRP: 9 steps * * * * * * * * * * * * * * * * * S D n1 n2 PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Start No. of source device shifted D: Start No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: 1. When X0 is triggered, WSFRP instruction shifts X20~X27 into data stack Y20~Y37 and Y20~Y37 also shift to the right with a group of 4 devices. 2. The figure below illustrates the right shift of the devices in one scan n Y27~Y20 → carry o Y37~Y30 → Y27~Y20 p X27~X20 → Y37~Y30 completed When using Kn device, the specified Kn value (digit) must be the same.
3. Instruction Set API Mnemonic 37 WSFL Type Operands P X Y M Controllers ES2/EX2 SS2 Word Shift Left Bit Devices OP Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F WSFL, WSFLP: 9 steps * * * * * * * * * * * * * * * * * S D n1 n2 PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Start No. of source device shifted D: Start No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 38 SFWR Type OP Operands Y M Controllers ES2/EX2 SS2 Shift Register Write P Bit Devices X Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SFWR, SFWRP: 7 steps * * * * * * * * * * * * * * * * * * * S D n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device D: Head address o
3. Instruction Set API Mnemonic 39 SFRD Type OP Operands Y M Controllers ES2/EX2 SS2 Shift Register Read P Bit Devices X Function Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SFRD, SFRDP: 7 steps * * * * * * * * * * * * * * * * S D n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Head address of data stack D: Destination device n: Length of data stack Explanation: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 40 ZRST Type OP Operands D1 D2 Y * * M * * Controllers ES2/EX2 SS2 Zone Reset P Bit Devices X Function Word devices S * * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ZRST, ZRSTP: 5 steps * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D1: Starting device of the reset range D2: End device of th
3. Instruction Set 2. For clearing multiple devices, API 16 FMOV instruction can be used to send K0 to word devices T, C, D or bit devices KnY, KnM, KnS.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 41 DECO Type OP Y * * Function M * * Controllers ES2/EX2 SS2 Decode P Bit Devices X * S D n Operands Word devices S * * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DECO, DECOP: 7 steps * * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device to be decoded D: Device for
3. Instruction Set Program Example 2: 1. When D is used as a word device, n = 1 ~ 4. Errors will occur if n = 0 or n > 4. 2. When n = 4, the decoded data is 24 = 16 bits. 3. When X20 goes from OFF to ON, the data in D10 (b2 to b0) will be decoded and stored in D20 (b7 to b0). The unused bits in D20 (b15 to b8) will be set to 0. 4. The lower 3 bits of D10 are decoded and stored in the lower 8 bits of D20. The higher 8 bits of D20 are all 0. 5. After the execution is completed, X20 is turned OFF.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 42 ENCO Type OP Y * Function M * Controllers ES2/EX2 SS2 Encode P Bit Devices X * S D n Operands Word devices S * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DECO, DECOP: 7 steps * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device to be encoded D: Device for storing th
3. Instruction Set Program Example 2: 1. When S is used as a word device, n = 1 ~ 4. Errors will occur if n = 0 or n > 4. 2. When n = 4, the decoded data is 24 = 16 bits data. 3. When X0 goes from OFF to ON, the 23 bits (b0 ~ b7) in D10 will be encoded and the result will be stored in the lower 3 bits of D20 (b2 to b0). The unused bits in D20 (b15 to b3) will be set to 0. 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 43 D SUM Type Operands Function X Y M ES2/EX2 SS2 Sum of Active bits P Bit Devices OP Controllers S S D Word devices Program Steps K H KnX KnY KnM KnS T C D E F SUM, DSUMP: 5 steps * * * * * * * * * * * DSUM, DSUMP: 9 steps * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 Operands: S: Source device D: Destination device for st
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 45 D MEAN Type OP Operands Y M Controllers ES2/EX2 SS2 Mean P Bit Devices X Function S S D n Word devices K H KnX KnY KnM KnS * * * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE Program Steps T C D E F MEAN, MEANP: 7 steps * * * DMEAN, DMEANP: 13 * * * * * * * * * * steps 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source d
3. Instruction Set API Mnemonic 46 ANS Type OP Operands Controllers Timed Annunciator Set Bit Devices X Function Y S m D M Word devices S ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ANS: 7 steps * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Alarm timer m: Time setting D: Alarm Explanations: 1. ANS instruction is used to drive the output alarm device in designated time. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 47 ANR Function Controllers ES2/EX2 SS2 Annunciator Reset P OP Descriptions N/A Program Steps Instruction driven by contact is necessary. PULSE SA2 ES2/EX2 SS2 SE SA2 SX2 SE ANR, ANRP: 1 steps 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Explanations: 1. ANR instruction is used to reset an alarm. 2.
3. Instruction Set M1000 M1049 Y0 Y1 X0 X2 ANS T0 K100 S912 ANS T1 K200 S920 X3 X2 Y0 Y0 X1 X3 Y1 Y1 M1048 Y2 X4 ANRP 1. M1048 and D1049 are valid only when M1049 = ON. 2. When Y0 = ON for more than 10 sec and the product fails to reach the front position X2, S912 = ON 3. When Y1 = ON for more than 10 sec and the product fails to reach the back position X3, S920= ON. 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 48 D SQR Type OP Operands Y M S D Controllers ES2/EX2 SS2 Square Root P Bit Devices X Function S Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F SQR, SQRP: 5 steps * * * DSQR, DSQRP: 9 steps * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device D: Device for storing the result Expl
3. Instruction Set API Mnemonic 49 D Type OP FLT Operands Y M S D Controllers ES2/EX2 SS2 Floating Point P Bit Devices X Function S Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F FLT, FLTP: 5 steps * DFLT, DFLTP: 9 steps * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Source device D: Device for storing the conversion result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 RST M1081 FLT D0 D12 DFLT D0 D20 X20 X21 Program Example 2: 1. When M1081 = ON, the source data is converted from floating point value to BIN integer. (Decimal ignored) 2. When X20 = ON, D1 and D0 (floating point) are converted to D12 (BIN integer). If D0 (D1) = H47C35000, the result will be 100,000 which exceeds the available range of BIN integer in 16-bit register D12.
3. Instruction Set M1000 1 FLT D10 D100 BIN K2X0 D200 FLT D200 D202 DEDIV K615 K10 D300 DEDIV D100 D202 D400 DEMUL D400 D300 D20 DEBCD D20 D30 DINT D20 D40 2 3 4 5 6 7 8 1. Covert D10 (BIN integer) to D101, D100 (floating point). 2. Covert the value of X7~X0 (BCD value) to D200 (BIN value). 3. Covert D200 (BIN integer) to D203, D202 (floating point). 4. Save the result of K615 ÷ K10 to D301, D300 (floating point). 5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 50 REF Type Operands X * D n Y * M Controllers ES2/EX2 SS2 Refresh P Bit Devices OP Function S Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F REF, REFP: 5 steps * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: D: Start device for I/O refresh n: Number of devices for I/O refresh Explanatio
3. Instruction Set X0 REF Y0 K4 Program Example 3: When X0 = ON, I/O points starting from X10 or Y4 will all be refreshed.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 51 REFF Type OP Operands Refresh and Filter Adjust P Bit Devices X Y M Controllers Function Word devices S ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F REFF, REFFP: 3 steps * * n PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: n: Response time (unit: ms) Explanation: 1.
3. Instruction Set API Mnemonic 52 MTR Type OP S D1 D2 n Operands Input Matrix Bit Devices X * Function Y M S * * * * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F MTR: 9 steps * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S: Head address of input device matrix scan D1: Head address of output device D2: Head address of n: Number of arrays in the matrix Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1000 MTR X40 Y40 M10 K2 The figure below illustrates the external wiring of the 2-array matrix input loop constructed by X40 ~ X47 and Y40 ~ Y41. The 16 switches correspond to the internal relays M10 ~ M17, M20 ~ M27. The wiring should be applied with MTR instruction. Diode 0.
3. Instruction Set Points to note: 1. Operand S must be a multiple of 10, e.g. 00, 10, 20, which means X0, X10… etc. and occupies 8 continuous devices. 2. Operand D1 should be a multiple of 10, i.e. 00, 10, 20, which means Y0, Y10… etc. and occupies n continuous devices 3. Operand D2 should be a multiple of 10, i.e. 00, 10, which means M0, M10, S0, S10… etc. 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 53 D Operands Function High Speed Counter Set HSCS Type Bit Devices OP X S1 S2 D Controllers ES2/EX2 SS2 Word devices Y M S * * * SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DHSCS: 13 steps * * * * * * * * * * * PULSE SA2 ES2/EX2 SS2 SE 16-bit SX2 ES2/EX2 SS2 32-bit SA2 SE SX2 ES2/EX2 SS2 SA2 SE SX2 Operands: S1: Comparative value S2: No.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ¾ If DCNT instruction enables C243 as high speed counter (group A) and DHSC/DHSC instruction uses C245 as high speed counter (group A) at the same time, PLC takes C243 as the source counter automatically and no syntax check error will be detected. ¾ Table of settings for the high-speed interrupts of hardware counters and comparators: (It is not applicable to DVP-SE.
3. Instruction Set ¾ 6 comparators are available for software counters while 8 comparators are available for 2 groups of hardware counters ( 4 comparators for each group) ¾ Output timing of software comparator Æ count value equals to comparative value in both counting up/down modes. ¾ Output timing of the hardware comparator with firmware version 1.xx Æ count value equals to comparative value+1 in counting-up mode; count value equals to comparative value -1 in counting-down mode.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1000 ¾ DCNT C251 K100 DHSCS K100 C251 M0 When C251 counts up and the value in C251 varies from 100 to101, DHSCS instruction sets M0 ON. ¾ When C251 counts down and the value in C251 varies from 100 to 99, DHSCR instruction resets M0. ¾ Timing diagram for the comparison: 1 2 M0 Counting No.
3. Instruction Set 9. Count value storage function of high speed interrupt: ¾ When X1, X3, X4 and X5 is applied for reset function and associated external interrupts are disabled, users can define the reset function as Rising/Falling-edge triggered by special M relays specified in the table: Applicable Software High Speed Counters. However, if external interrupts are applied, the interrupt instructions have the priority in using the input points.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 54 D Type OP Operands High Speed Counter Reset HSCR Bit Devices X S1 S2 D Function Word devices Y M S * * * Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DHSCR: 13 steps * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Comparative value S2: No.
3. Instruction Set API Mnemonic 55 D Operands Function High Speed Zone Compare HSZ Type OP Bit Devices X S1 S2 S D Y M * * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps S K H KnX KnY KnM KnS T C D E F DHSZ: 17 steps * * * * * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Lower bound of the comparison zone high speed counter S2: Upper bound of the comparison zone S: No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ¾ There are 6 software zone comparators available exclusively for zone compare operation, hence the limit of 6 comparisons for zone compare does not include the comparisons of DHSCS and DHSCR. ¾ 5. SS2/SA2/SE does not support software counter C232.
3. Instruction Set DHSZ instruction. Also, when DHSCS uses I070 or I080, comparators B3 and B4 are no longer available for DHSZ instruction. If comparators are used repeatedly, the syntax error will be detected on the instruction behind. ¾ For DVP-SE, if DHSZ instruction uses hardware comparators, two hardware comparators are used. DHSCS instruction and DHSCR instruction can not use the same hardware comparators. Program Example 1: (Applying Hardware High Speed Counter) 6.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Timing diagram Speed variable transmission device 0 X10 High speed Y10 Low speed Y11 Stop Y12 Present value of C251 0 3-134 2000 2400
3. Instruction Set API Mnemonic 56 Operands Function Speed Detection SPD Type OP Bit Devices X * S1 S2 D Y Controllers ES2/EX2 SS2 SA2 SX2 SE M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F SPD: 7 steps * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: External pulse input S2: Pulse receiving time (ms) D: Detected result (5 consecutive devices) Explanations: 10.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g SA2/SE/SX2: Max frequency 100kHz SS2: 20kHz 14. 5KHz. X1(X0/X1) of SA2/SE: 30kHz 10KHz D occupies 5 consecutive registers, D + 1 and D store the results of previous pulse detection; D +3 and D + 2 store the current accumulated number of pulses; D + 4 store the current time remaining (max. 32,767ms). 15.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 25. Four pulse output modes: (They are not applicable to DVP-SE.) D1220 Mode Output Y0 K0 Pulse Y1 Pulse D1221 K1 K2 Pulse A Dir B K3 K0 K1 K2 Pulse A Dir B K3# CW Pulse Y2 Pulse Y3 Pulse CCW Pulse Pulse: Pulse A: A phase pulse CW: Dir: B: B phase pulse CCW: Counter-clockwise Direction clockwise # Note : When D1220 is specified as K3, D1221 is invalid. 26.
3. Instruction Set 32. There is no limitation on the times of using this instruction, however the program allows only 4 instructions (PLSY, PWM, PLSR) to be executed at the same time. If Y1 is used for several high speed pulse output instructions, PLC will output according to the execution order of these instructions. Program Example: 33. When X0 = ON, 200 pulses of 1kHz are generated from output Y0, after the pulse output has been completed, M1029 = ON to set Y20. 34.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 36.
3. Instruction Set Program Example 1: EI FEND M1000 I 001 SET M1347 DPLSY K1000 K1000 Y0 K1000 Y2 IRET M1000 I 101 SET M1524 DPLSY K1000 IRET END Explanations: a) Whenever I001 is triggered, Y0 will output 1,000 pulses; whenever I101 is triggered, Y2 will output 1,000 pulses. b) When pulse output is completed, there should be an interval of at least one scan cycle before next pulse output operation is triggered. .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 58 Operands Function Pulse Width Modulation PWM Type OP Bit Devices X S1 S2 D Controllers ES2/EX2 SS2 SA2 SX2 SE Y M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F PWM: 7 steps * * * * * * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Pulse output width (ms) S2: Pulse out
3. Instruction Set 46. When M1113 = ON, the unit of Y2 output pulse is 10μs, when M1113 = OFF, the unit is 100μs. (It is not applicable to DVP-SE.) 47. When M1113 = ON, the unit of Y2 output pulse is 100μs, when M1113 = OFF, the unit is 1ms. (It is only applicable to DVP-SE.) 48. When M1071 = ON, the unit of Y3 output pulse is 100μs, when M1071 = OFF, the unit is 1ms. 49. When M1116 is ON, M1112 and M1113 do not work. The time unit of the pulse output through Y0 and Y2 is 1μs. DVP-ES2 version 3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g D1032: Low word of the present value of Y1 pulse output D1033 High word of the present value of Y1 pulse output D1336 PV of Y2 pulse output (Low word) D1337 PV of Y2 pulse output (High word) D1338: Low word of the present value of Y3 pulse output. D1339: High word of the present value of Y3 pulse output.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Y3 58. Pulse Dir When assigning Y0 and Y2 output mode as Pulse, i.e. D1220 = K0, D1221 = K0, the available range for S2 is 1~32,767 (16-bit instruction) and 1~2,147,483,647 (32-bit instruction). 59. When assigning Y0 and Y2 output mode as Pulse/Dir, i.e.
3. Instruction Set 66. There is no limitation on the times of using this instruction in the program. However, only 4 instructions can be executed at the same scan time. When several pulse output instructions (PLSY, PWM, PLSR) use Y1 as the output device in the same scan cycle, PLC will execute pulse output according to the driven order of these instructions. 67. Set value falls out of the available range of operands will be automatically corrected with the min. or max available value.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1156: Enabling the mask and alignment mark function on I400/I401(X4) corresponding to Y0. M1257: Set the ramp up/down of Y0, Y2 to be “S curve.” ON = S curve. M1158: Enabling the mask and alignment mark function on I600/I601(X6) corresponding to Y2. M1534: Enable ramp-down time setting on Y0. Has to be used with D1348 M1535: Enable ramp-down time setting on Y2. Has to be used with D1349 72.
3. Instruction Set When M1156/M1158 = ON, enable ramp-down pause (Mark function) on Y0/Y2 when X4/X6 receives interrupt signals. When Mark function is enabled, ramp down time is independent of the ramp up time. Users can set ramp up time in S3 and ramp down time in D1348/D1349. (Range: 20ms~32767ms) When Mark function is executed and the ramp-down stop pulses (DD1232/DD1234) are specified, PLC will execute ramp-down stop with specified pulses after Mark is detected.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g output will stop after 1,000,000 pulses are completed. When pulse output ramps down and stops after Mark is detected, M1538 will be ON to indicate the pause status. If users need to complete the remaining pulses, set OFF the flag M1108 and pulse output will resume. 74.
3. Instruction Set Explanations: When M0 is triggered, Y0 executes pulse output. When external interrupt is detected on X4 after 50,000 pulses, pulse output will perform ramp down process for 10,000 pulses and then stop. M1108 will be ON. If no interrupt is detected on X4, Y0 pulse output will stop after 1,000,000 pulses are completed. Interrupt triggered between 0 ~ 50,000 pulses will be invalid, i.e. no ramp-down process will be performed before 50,000 pulses are achieved. Points to note: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 60 Operands Function Initial State IST Type OP S D1 D2 Bit Devices X * Y * M * S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F IST: 7 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device for assigning pre-defined operation modes (8 consecutive devices).
3. Instruction Set 80. When S1 (zero return mode) is initialized, i.e. selected, zero return will NOT be executed if any of the state S10~S19 is ON. 81. When S2 (auto mode) is initialized, i.e. selected, auto mode will NOT be executed if M1043 = ON or any of the state between D1 to D2 I is ON. Program Example 2: Robot arm control (by IST instruction): 82. Control purpose: Select the big balls and small balls and move them to corresponding boxes. Configure the control panel for each operation. 83.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 86. Control panel Power ON Auto ON Zero return X35 Auto OFF X37 Power OFF Clip balls Ascend Right Shift X20 X22 X24 Left Release balls Descend shift X21 X23 X36 X25 Step X32 One cycle operation X33 Zero return X31 Continuous operation X34 Manual operation X30 a) X0: ball size sensor.
3. Instruction Set 89.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 90.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Flag explanation: M1040: Disable step transition. When M1040 = ON, all motion of step points are disabled. 91. Manual operation mode: M1040 remains ON in manual mode. 92. Zero return mode/one cycle operation mode: M1040 remains ON in the interval after Auto Stop and before Auto Start is pressed. 93. Step operation mode: M1040 remians ON until Auto Start is pressed. 94.
3. Instruction Set M1046: Indicates STL(Step Ladder) status. When STL operation is activate, M1046 = ON if any of the step point S is ON. If M1047 = ON, M1046 also activates to indicate ON status of step points. In addition, D1040 ~ D1047 records 8 step numbers from the current ON step to the previous 7 ON steps. M1047: Enable STL monitoring. When IST instruction executes, M1047 will be forced ON, i.e. M1047 remains ON in every scan cycle as long as IST instruction is executing.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 61 D SER Type Operands Search a Data Stack P Bit Devices OP X Function Y M Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * * S1 S2 D N Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps T C D E F SER, SERP: 9 steps * * * DSER, DSERP: 17 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operand
3. Instruction Set API Mnemonic 62 D Type OP Operands Function Absolute Drum Sequencer ABSD Bit Devices X S1 S2 D n Y M S * * * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ABSD: 9 steps * * * * * * * DABSD: 17 steps * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Start device of the data table result S2: No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 111. M10~ M13 = ON when the current value of C10 falls between lower and upper bounds. Lower-bound value Upper- bound value Current value of C10 Output D100= 40 D101 = 100 40≦C10≦100 M10 = ON D102 = 120 D103 = 210 120≦C10≦210 M11 = ON D104 = 140 D105 = 170 140≦C10≦170 M12 = ON D106 = 150 D107 = 390 150≦C10≦390 M13 = ON 112.
3. Instruction Set API Mnemonic 63 Operands INCD Type OP Bit Devices X S1 S2 D n Y M S * * * Function Controllers Incremental drum sequencer ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F INCD: 9 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Start device of the data table result S2: No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 122. When X0 turns from ON →OFF, C10 and C11 will all be reset to 0 and M10~M14 = OFF. When X0 turns ON again, this instruction will be executed again from the beginning.
3. Instruction Set API Mnemonic 64 Operands Function Teaching Timer TTMR Type OP Bit Devices X Y M D n S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F TTMR: 5 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: D: Device No. for storing the ON time of the input n: setting of multiple (n: K0~K2) Explanations: 123.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 128. If ON duration of X0 is T sec, the relation between D0, D1 and n are shown as the table below. n D0 (unit: sec) D1 (unit: 100 ms) K0 T (sec) ×1 D1 = D0×10 K1 T (sec) ×10 D1 = D0 K2 T (sec) ×100 D1 = D0/10 Program Example 2: 129. Use TMR instruction to write in 10 groups of set time. 130. Write the set values into D100 ~ D109 in advance 131. The timer resolution is 0.
3. Instruction Set API Mnemonic 65 Operands Function Special Timer STMR Type OP Bit Devices X S m D Word devices Y M S * * * Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F STMR: 7 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: No. of timer (T0~T183) m: Set value in timer (m = 1~32,767, unit: 100ms) D: Start No. of output devices (occupies 4 consecutive devices) Explanations: 136.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 143. Apply a NC contact Y3 after the drive contact X20, and Y1, Y2 will form a flashing circuit output. When X20 turns OFF, Y0, Y1 and Y3 = OFF and the content of T10 will be reset.
3. Instruction Set API Mnemonic 66 ALT Type OP Operands Function Alternate State P Bit Devices X Y * D M * S * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F ALT, ALTP: 3 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: D: Destination device Explanations: 144. The status of D is alternated every time when the ALT instruction is executed. 145.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 67 D Type OP Operands Function Ramp variable Value RAMP Bit Devices X Y M S S1 S2 D n Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F RAMP: 9 steps * DRAMP: 17 steps * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Start of ramp signal consecutive devices) S2: End of
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 68 DTM Type OP Operands Y M S D m n Controllers ES2/EX2 SS2 SA2 SX2 SE Data Transform and Move P Bit Devices X Function Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DTM: 9 steps * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Start device of the source data stack Transformation mode D: St
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g K6: When n = 4, transform 8-bit ASCII data (higher 4 bits, lower 4 bits) into HEX data in the following rule: (ASCII value to be transformed includes 0 ~ 9 (0x30~0x39), A ~ F (0x41~0x46), and a ~ f (0x61~0x66).
3. Instruction Set Points to note: 1. When the calculation results exceed the max frequency of PLC, the output frequency will be set as 0. 2. When the total of ramp-up and ramp-down time exceeds the total time for operation, PLC will change the total time for operation (S+2) into “ramp-up time (S+3) + ramp-down time (S+4) + 1” automatically.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g n: set values of multi-point areas. The range of set values is K2~K50. When the set value exceeds the range, it will not be executed. The sample curve: (n is set to be K4) D+1 D D+2 D+4 D+3 S S+1 S+2 S+3 S+4 The explanation of the sample: 1.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Points to note: 1. Operand n sets the number of total digits for the converted floating value. Max 8 digits are applicable and the value over n digit will be omitted. For example, n = K6, data string “123.45678” will be converted to “123.456”. 2.
3. Instruction Set The conversion will be performed in the following rule: Hi-byte Lo-byte n = k6 32-bit Floating value S+0 S+1 123.45678 D+0 ‘1’ D+1 ‘2’ D+2 ‘3’ D+3 ‘.’ D+4 ‘4’ D+5 ‘5’ D+6 ‘6’ D+7 0x00 Program Example 1: K2, K4 1. When M0 = ON, transform 16-bit data in D0, D1 into ASCII data in the following order: H byte L byte - H byte - Low byte, and store the results in D10 ~ D17. M0 2. 3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 153.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example table of data sort Columns of data: m2 Data Column Column 2 3 4 5 Math. Physics Chemistry 1 Students English No.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 0 1 2 3 4 5 6 7 8 9 number key BCD value 1-digit BCD code overflow 10 3 10 2 10 1 10 0 BCD value BIN value D0 160. As shown in the timing diagram below, four keys connected with X35, X33, X31 and X30 are pressed in order. Therefore, the number 5,301 is generated and stored in D0. 9,999 is the maximum value allowed for D0.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 170. Input keys 0~9: 0 2 1 3 4 5 6 7 10 3 10 2 10 9 number key 1-digit BCD code BCD value overflow 8 1 10 0 BCD value BIN value D0 171. Input keys A~F: a) When A is pressed, M0 will be ON and retained. When D is pressed next, M0 will be OFF, M3 will be ON and retained.. b) If two or more keys are pressed at the same time, only the key activated first is effective.
3. Instruction Set 174. External wiring: 24G +24V C D E F 8 9 A B 4 5 6 7 0 1 2 3 S/S X20 X21 X22 X23 C Y20 Y21 Y22 Y23 PLC(Transistor output) Points to note: 175. When HKY instruction is executed, 8 scan cycles (matrix scan) are required for reading the input value successfully. A scan cycle that is too long or too short may cause the input to be read incorrectly.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 72 Operands Function DIP Switch DSW Type OP Bit Devices X * S D1 D2 n Y M Word devices S Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DSW: 9 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: The Start of input devices value D1: The Start of output devices D2: Device
3. Instruction Set 182. Please use transistor output for Y20 ~ Y23. Every pin 1, 2, 4, 8 shall be connected to a diode (0.1A/50V) in series before connecting to the input terminals on PLC.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 73 SEGD Type OP Operands Function 7-segment decoder P Bit Devices X Y Controllers ES2/EX2 SS2 SA2 SX2 SE M S S D Word devices Program Steps K H KnX KnY KnM KnS T C D E F SEGD, SEGDP: 5 steps * * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device for decoding D: Output device
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 192. When X20 = ON, Y24~Y27 will be scanned in circles automatically. Each circle requires 12 scan cycles. M1029 = ON for a scan cycle whenever a circle is completed. 193. When there is 1 set of 4-digit 7-segment display, n = 0 ~ 3 Connect the 7-segment display terminals 1, 2, 4, 8 in parallel then connect them to Y20 ~ Y23 on PLC.
3. Instruction Set VCC Pull-up resistor Drive Y Y Signal output On PLC 199. Positive logic (negative polarity) output of BCD code BCD value Y output (BCD code) Signal output b3 b2 b1 b0 8 4 2 1 A B C D 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 200.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ’+’: Positive logic (Negative polarity) output ‘-’: Negative logic (Positive polarity) output 203. The polarity of PLC transistor output and the polarity of the 7-segment display input can be designated by the setting of n.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 ARWS X20 D20 Y20 K0 Y24 Add / up Y25 Digit indication LED Y26 X21 Y27 103 Y20 Y21 Y22 Y23 10 2 10 1 10 0 1 2 4 8 X23 X22 Move to right X20 Minus / down 7-segment display for the 4-digit set value 3-196 Move to left The 4 switches are used for moving the digits and modifying set values.
3. Instruction Set API Mnemonic 76 Operands Function ASCII code conversion ASC Type OP Bit Devices X Controllers ES2/EX2 SS2 SA2 SX2 SE Y M S Word devices Program Steps K H KnX KnY KnM KnS T C D E F ASC: 11 steps S D * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: English letters to be converted into ASCII code D: Device for storing ASCII code Explanation: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 77 Operands PR Type OP Bit Devices X S D Y M S Function Controllers Print (ASCII Code Output) ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F PR: 5 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Device for storing ASCII code (occupies 4 consecutive devices) D: External AS
3. Instruction Set X20 start signal A B C D Y20~Y27 data H T : scan time(ms) T T T Y30 scan signal Y31 being executed Program Example 2: 1. PR instruction supports ASCII data output of 8-bit data string when M1027 = OFF. When M1027 = ON, the PR instruction is able to execute an output of 1~16 bit data string. 2. When M1027 = ON and X20 = ON, this instruction will designate Y20 (lowest bit) ~ Y27 (highest bit) as the output points and Y30 as scan signals, Y31 as execution flag.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 78 D FROM Type Operands P Bit Devices OP X Y Function Read CR data from Special Modules M S m1 m2 D n Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F FROM, FROMP: 9 steps * * * DFROM, DFROMP: 17 * * * * steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: m1: No.
3. Instruction Set API Mnemonic 79 D TO Type Operands P Bit Devices OP X Function Write CR data into Special Modules Y M S m1 m2 S n Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F TO, TOP: 9 steps * * * DTO, DTOP: 17 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: m1: No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Upper 16-bit Lower 16-bit CR #10 4. CR #9 Specified CR number n: Number of data to be written at a time. n = 2 in 16-bit instruction has the same operation results as n = 1 in 32-bit instruction.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. When data receiving is completed, M1123 will automatically be ON. When data processing on the received data is completed, M1123 has to be reset (OFF) and the PLC will be ready for communication again. However, DO NOT continuously execute RST M1123, i.e. it is suggested to connect the RST M1123 instruction after the drive contact M1123.
3. Instruction Set Receiving data: (External equipment -> PLC) D120L D121L D122L D123L D124L D125L D126L ETX1 ETX2 Registers for received data, starting from the lower 8 bits of D120 STX length = 7 3. The STX and ETX of external equipments will be received by PLC in data receiving process, therefore, care should be taken on the setting of operand n (Length of data to be received). 16-bit mode: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 3: COM2 RS-485 1. Connect PLC to VFD-B series AC motor drives (AC motor drive in ASCII Mode; PLC in 16-bit mode and M1161 = OFF). 2.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 4: COM2 RS-485 1. Connect PLC to VFD-B series AC motor drives (AC motor drive in RTU Mode; PLC in 16-bit mode and M1161 = ON). 2. Write the data to be sent into registers starting from D100 in advance. Write H12 (Forward running) into H2000 (VFD-B parameter address).
3. Instruction Set 3. The forward running function of Delta’s VFD series inverter can also be set by handy instruction API 102 FWD instruction through COM2/COM3 on PLC. Program Example 5: COM1 RS-232 1. Only 8-bit mode is supported. Communication format and speed are specified by lower 8 bits of D1036. 2. STX/ETX setting function (M1126/M1130/D1124~D1126) is not supported. 3. High byte of 16-bit data is not available. Only low byte is valid for data communication. 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Receving data: (External equipment→PLC) D120L D121L D122L D123L D124L D125L D126L Registers for received data, starting from lower 8 bits of D120 Length = 7 Program Example 6: COM3 RS-485 1. Only 8-bit mode is supported. Communication format and speed are specified by lower 8 bits of D1109. 2. STX/ETX setting function (M1126/M1130/D1124~D1126) is not supported. 3.
3. Instruction Set Sending data: (PLC→External equipment) D100L D101L D102L D103L Source data register, starting from lower 8 bits of D100 Length = 4 Receving data: (External equipment→PLC) D120L D121L D122L D123L D124L D125L D126L Registers for received data, starting from lower 8 bits of D120 Length = 7 Points to note: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Flag Function Action COM1 Data receiving completed. When data receiving of communication instructions is completed, M1314 will be ON. Users M1314 can process the received data when M1314 is ON. When data processing is completed, M1314 has to be reset by users. System sets and user resets Supported communication instructions: RS / MODRW COM1 receiving error.
3. Instruction Set Flag Function Data transmission ready. M1121 = OFF indicates that RS-485 in M1121 COM2 is transmitting Action System sets Sending request. Before executing communication instructions, users need to set M1122 to ON by trigger pulse, so that the data M1122 sending and receiving will be started. When the communication is User sets, system resets completed, PLC will reset M1122 automatically. Data receiving completed.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Flag Function Action In ASCII mode, M1131 = ON only when MODRD/RDST/MODRW data is being converted to HEX.
3. Instruction Set Special register Function Feedback data (ASCII) of Modbus communication. When PLC’s RS-485 communication instruction receives feedback signals, the data D1070~D1085 will be saved in the registers D1070~D1085 and then converted into Hex in other registers. RS instruction is not supported. Sent data of Modbus communication. When PLC’s RS-485 communication instruction (MODRD) sends out data, the data will be D1089~D1099 stored in D1089~D1099.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Special register Function The specific end word to be detected for RS instruction to execute an D1168 interruption request (I150) on COM2 (RS-485). Supported communication instruction: RS For COM2 RS-485 MODRW instruction. D1256~D1295 store the sent data of MODRW instruction. When MODRW instruction sends out data, D1256~D1295 the data will be stored in D1256~D1295.
3. Instruction Set Flag M1319 Function Action COM3 data receiving error. M1319 will be set ON when errors occur and the error code will be stored in D1252 Special register System sets, user resets Function Delay time of data response when PLC is SLAVE in COM2, COM3 RS-485 communication, Range: 0~10,000. (unit: 0.1ms). D1038 By using EASY PLC LINK in COM2, D1038 can be set to send next communication data with delay. (unit: one scan cycle) COM3 (RS-485) communication protocol.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g COM1 COM2 COM3 Function Description - D1125 - Definition of ETX1 (RS) - D1126 - Definition of ETX2 (RS) D1249 D1129 D1252 - D1122 - Residual number of words of transmitting data - Store the sent data of MODRW instruction.
3. Instruction Set COM1 COM2 COM3 Function Description MODRD/MODWR/MODRW parameter error - M1141 - (Exception Code exists in received data) Exception Code is stored in D1130 5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 6. When RS instruction is applied for communication between PLC and peripheral devices on COM2 RS-485, usually STX (Start of the text) and ETX (End of the text) have to be set into communication format. In this case, b8~10 of D1120 should be set to 1, so that users can set up STX/ETX as user-defined or system-defined by using M1126, M1130, and D1124~D1126.
3. Instruction Set 9. Value Error Description H0005 Communication data length error Corresponding table between D1167~D1169 and the associated interrupt pointers. (Only lower 8 bits are valid) 10.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ‘0’ ‘F’: toward the drive at address 15 ‘1’ ‘0’: toward the drive at address 16 … and so on, max.
3. Instruction Set Field Name Descriptions Address Function DATA (n-1) …….
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Step 6: Repeat step 2 – 5 until the operation of all the messages are completed. The final value obtained in the CRC register is the CRC checksum. Care should be taken when placing the LOW byte and HIGH byte of the obtained CRC checksum. Example: Read 2 continuous data stored in the registers of the drive at address 01H (see the table below).
3. Instruction Set Timing diagram: SET M1122 X0 RS executes X20 Transmission ready M1121 Auto reset after transmitting completed Sending request M1122 User has to manually reset in program Receiving completed M1123 Receiving ready M1124 Reset the status to the initial communication ready status.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 81 D Type OP PRUN Operands Parallel Run P Bit Devices X Y M S D Function Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F PRUN, PRUNP: 5 steps * * DPRUN, DPRUNP: 9 * * steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Destination device Explanations: 1
3. Instruction Set API Mnemonic 82 Operands ASCI Type OP Function Convert Hex to ASCII P Bit Devices X Y M Controllers S S D n ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F ASCI, ASCIP: 7 steps * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Destination device n: Number of nibbles to be converted (n = 1~256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4. When n = 4, the bit structure will be as: D10=0123 H 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 0 30H 0 1 1 3 low byte low byte 1 0 0 33H 3 0 2 high byte D21 5.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4. When n is 2, the bit structure will be as: D10=0123 H 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 2 1 1 1 1 0 1 1 3 ASCII code of "2" in D20 is 32H 0 0 0 0 0 0 0 0 0 0 1 1 0 0 3 2 ASCII code of "3" in D21 is 33H 0 0 0 0 0 0 0 0 0 0 1 1 0 0 3 5.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 83 HEX Type OP Operands Function Convert ASCII to HEX P Bit Devices X Y M S S D n Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F HEX, HEXP: 7 steps * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S: Source device D: Destination device n: numbe
3. Instruction Set 4. When n = 4, the bit structure will be as: D20 0 1 0 0 0 44H D21 0 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 F 1 0 0 43H 1 C 5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. S ASCII code H 38 HEX conversion “8” D29 H 35 HEX conversion “5” D30 H 36 “6” D33 H 31 “1” D31 H 37 “7” D34 H 32 “2” D32 H 30 “0” D35 H 33 “3” S ASCII code D24 When n is 2, the bit structure will be as D20 0 1 0 0 0 43H D21 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 1 0 1 D 1 C 4.
3. Instruction Set API Mnemonic 84 CCD Type Operands Function Check Code P Bit Devices OP X Y M Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices S S D n Program Steps K H KnX KnY KnM KnS T C D E F CCD, CCDP: 7 steps * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: source data D: Destination device for storing check sum n: Number of byte (n = 1~256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: 1. M1161 = ON, 8-bit conversion. 2. When X0 = ON, 6 bytes from low byte of D0 to low byte of D5 will be summed up, and the checksum is stored in D100 while the parity bits are stored in D101.
3. Instruction Set API Mnemonic Operands Controllers ES2 SS2 SA2 SX2 SE EX2 Volume Read 85 VRRD Type Bit Devices X Y M S OP S D Function P K * Word devices H KnX KnY KnM KnS T * * * * * Program Steps C D * * E F VRRD, VRRDP: 5 steps PULSE 16-bit 32-bit ES2/ ES2/ ES2/ SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: S: Variable resistor number (0~1) D: Destination device for storing read value Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic Operands Controllers Volume Scale Read 86 VRSC Type Bit Devices X Y M S OP S D Function P K * Word devices H KnX KnY KnM KnS T * * * * * ES2 SS2 SA2 SX2 SE EX2 Program Steps C D * * E F VRSC, VRSCP: 5 steps PULSE 16-bit 32-bit ES2 ES2 ES2 SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: S: Variable resistor number (0~1) D: Destination device for stori
3. Instruction Set API Mnemonic 87 D ABS Type OP Operands Function Absolute Value P Bit Devices X Y M Controllers ES2/EX2 SS2 SA2 SX2 SE S Word devices Program Steps K H KnX KnY KnM KnS T C D E F ABS, ABSP: 3 steps D * * * * * * * * DABS, DABSP: 5 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: D: Device for absolute value operation Explanation 1. The instruct ion conducts absolute value operation on D 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 88 D Type OP Operands Function PID control PID Bit Devices X Controllers ES2/EX2 SS2 SA2 SX2 SE Y M S S1 S2 S3 D Word devices Program Steps K H KnX KnY KnM KnS T C D E F PID : 9 steps * DPID: 17 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Set value (SV) S2: Present value (PV) S3: Parameter setting (for
3. Instruction Set Points to note: 1. There is no limitation on the times of using this instruction. However, the register No. designated in S3~ S3+19 cannot be repeated. 2. For 16-bit instruction, S3 occupies 20 registers. In the program example above, the area designated in S3 is D100 ~ D119. 3. Before the execution of PID instruction, users have to transmit the parameters to the designated register area by MOV instruction.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Device No. Function Setup Range Explanation 2: Reverse control (E = PV - SV). 3: Auto-tuning of parameter exclusively for the temperature control. The device will automatically become K4 when the auto-tuning is completed and KP, KI and KD is set with appropriate value (not avaliable in the 32-bit instruction).
3. Instruction Set Device No. S3+10, 11: Function Accumulated integral value Setup Range Available range of 32-bit floating point Explanation The accumulated integral value is usually for reference. Users can clear or modify it (in 32-bit floating point) according to specific needs. The previous PV is usually for S3 +12: The previous PV -32,768~32,767 reference. Users can clear or modify it according to specific needs. S3+13 ~ For system use only.. S3+19 5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Device Function No. Set-point range Explanation The proportion for S3+1: Proportional gain (KP) 0~30,000(%) magnifying/minifying the error between SV and PV. The proportion for Integration gain (KI) 0~30,000(%) S3+2: magnifying/minifying the integral value (The accumulated error). For control mode K0~K2, K5.
3. Instruction Set Device Function No. S3+9, Lower bound of output value (MV) , 32-bit 10: Set-point range Explanation -2,147,483,648 Ex: if S3+7 is set as -1,000, MV will ~ be -1,000 when it is smaller than 2,147,483,647 -1,000. Ex: if S3+8 is set as 1,000, the integral value will be 1,000 when it S3+11, 12: Upper bound of integral value, 32-bit -2,147,483,648 is bigger than 1,000 and the ~ integration will stop.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g y PID equation for control mode k0~k2: 1 MV = K P * E (t ) + K I * E (t ) + K D * PV (t )S S where MV : Output value K P : Proprotional gain E (t ) : Error value PV (t): Present measured value SV (t): Target value K D : Derivative gain PV (t )S : Derivative value of PV(t) K I : Integral gain E (t ) y 1 : Integral value of E(t) S When E(t ) is smaller than 0 as the control mode is selected as f
3. Instruction Set 2. When control mode (S3+4) is selected as K3 and K4: y The equation is exclusively for temperature control will be modified as: MV = 1 KP ⎡ ⎤ 1 ⎛ 1⎞ ⎜ E (t ) ⎟ + K D * E (t )S ⎥ , ⎢ E (t ) + KI ⎝ S⎠ ⎣ ⎦ where E (t ) = SV (t ) - PV (t ) y Control diagram: In diagram below, 1/KI and 1/KP refer to “divided by KI” and “divided by KP”. Because this mode is exclusively for temperature control, users have to use PID instruction together with GPWM instruction.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Where E(t ) = SV (t ) - PV (t ) y Control diagram: PID operation is within dotted area 1/S 1/T I + + + KP G(s) + S TD Notes and suggestion: 1. S3 + 3 can only be the value within 0 ~ 30,000. 2. There are a lot of circumstances where PID instruction can be applied; therefore, please choose the control functions appropriately.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Step 2: When KP is 40, response overshoot occurs, so we will not select it. When KP is 20, PV response is close to SV and won’t overshoot, but transient MV will be to large due to a fast start-up. We can put it aside and observe if there are better curves. When KP is 10, PV response is close to SV and is smooth. We can consider using it. When KP is 5, the response is too slow. So we won’t use it.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Application 2: Speed control system and pressure control system work individually (use diagram of Example 2) Control purpose: After the speed control operates in open loop for a period of time, adding pressure control system (PID instruction) to perform a close loop control.
3. Instruction Set Application 3: Using auto-tuning for temperature control Control purpose: Calculating optimal parameter of PID instruction for temperature control Control properties: Users may not be familiar with a new temperature environment. In this case, selecting auto-tuning (S3+4 = K3) for an initial adjustment is suggested. After initial tuning is completed, the instruction will auto modify control mode to the mode exclusively for adjusted temperature (S3+4 = K4).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Results of initial auto-tuning Auto tuning area S3+4 = k3 PID control area S3+4 = k4 Results of using adjusted parameters generated by initial auto-tuning function.
3. Instruction Set From the figure above, we can see that the temperature control after auto-tuning is working fine and it spent only approximately 20 minutes for the control. Next, we modify the target temperature from 80°C to 100°C and obtain the result below. From the result above, we can see that when the parameter is 100°C, temperature control works fine and costs only 20 minutes same as that in 80°C.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 89 Operands PLS Type OP Bit Devices X Y * S M * S Function Controllers Rising-edge output ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F PLS: 3 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Rising pulse output device Explanations: When X0 goes from OFF to ON (Rising-edge trigger)
3. Instruction Set API Mnemonic 90 Operands Rising–edge detection operation LDP Type OP Bit Devices X * S Function Y * M * S * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F LDP: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: device to be rising-edge triggered Explanations: LDP should be connected to the left side bus line.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 91 Operands LDF Type OP Controllers Falling–edge detection operation ES2/EX2 SS2 SA2 SX2 SE Bit Devices X * S Function Y * M * S * Word devices Program Steps K H KnX KnY KnM KnS T C D E F LDF: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: device to be falling pulse triggered Explanations: LDF should be con
3. Instruction Set API Mnemonic 92 Operands Rising-edge series connection ANDP Type OP Bit Devices X * S Y * Function M * S * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F ANDP: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: rising-edge contact to be connected in series Explanations: ANDP instruction is used in the series connection of the rising-edge contact.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 93 Operands Falling-edge series connection ANDF Type OP Bit Devices X * S Y * Function M * S * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F ANDF: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: falling edge contact to be connected in series Explanations: ANDF ins
3. Instruction Set API Mnemonic 94 Operands Rising-edge parallel connection ORP Type Bit Devices OP X * S Function Y * M * S * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F ORP: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: rising-edge contact to be connected in parallel Explanations: ORP instruction is used in the parallel connection of the rising-edge contact.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 95 Operands Falling-edge parallel connection ORF Type Bit Devices OP X * S Function Y * M * S * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F ORF: 3 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: falling-edge contact to be connected in parallel Explanations: ORF i
3. Instruction Set API Mnemonic 96 Operands Timer TMR Type OP Bit Devices X Function Y M S S1 S2 Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F TMR: 5 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: No. of timer (T0~T255) S2: Set value (K0~K32,767, D0~D9,999) Explanations: When TMR instruction is executed, the specific coil of timer is ON and the timer is enabled.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 97 Operands 16-bit counter CNT Type OP Function Bit Devices X Y M S S1 S2 Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F CNT: 5 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: No. of 16-bit counter (C0~C199) S2: Set value (K0~K32,767, D0~D9,999) Explanations: 1.
3. Instruction Set API Mnemonic 97 Operands Function 32-bit counter DCNT Type OP Bit Devices X Y M S1 S2 S Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DCNT: 9 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: No. of 32-bit counter (C200~C254) S2: Set value (K-2,147,483,648~K2,147,483,647, D0~D9,999) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 98 Operands INV - OP Function Inverse operation Descriptions N/A Invert the current result of the internal PLC operations Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps INV: 1 step PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Explanations: INV instruction inverts the logical operation result.
3. Instruction Set API Mnemonic 99 Operands PLF Type OP Bit Devices X Y * S M * S Function Controllers Falling-edge output ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F PLF: 3 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Falling pulse output device Explanations: When X0 goes from ON to OFF (Falling-edge trigger), PLS instruction executes and S generates a cycle pulse for one operation cycle.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 100 Operands Read Modbus Data MODRD Type OP Bit Devices X S1 S2 n Y Function M S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F MODRD: 7 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Device address (K0~K254) S2: Data address n: Data length (K1<n≦K6
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Registers for received data (responding messages) Register 3-270 Data Descriptions D1070 low byte ‘0’ 30 H ADR 1 D1070 high byte ‘1’ 31 H ADR 0 D1071 low byte ‘0’ 30 H CMD 1 D1071 high byte ‘3’ 33 H CMD 0 D1072 low byte ‘0’ 30 H D1072 high byte ‘C’ 43 H D1073 low byte ‘0’ 30 H D1073 high byte ‘1’ 31 H Content of address PLC automatically converts D1074 low byte ‘0’ 30
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register Data Descriptions D1077 low byte FE H CRC CHK Low D1078 low byte 5C H CRC CHK High Program Example 3: 1. In the communication between PLC and VFD-B series AC motor drive (ASCII Mode, M1143 = OFF), executes Retry when communication time-out, data receiving error or parameter error occurs. 2.
3. Instruction Set API Mnemonic 101 Operands Function Write Modbus Data MODWR Type OP Bit Devices X S1 S2 n Y M S Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F MODWR: 7 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Device address (K0~K254) S2: Data address n: Data to be written Explanations: 1. MODWR instruction supports COM2 (RS-485). 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 1: Communication between PLC and VFD-B series AC motor drives (ASCII Mode, M1143 = OFF) M1002 MOV H87 SET M1120 MOV K100 SET M1122 MODWR K1 D1120 Set communication protocol as 9600, 8, E, 1 Retain communication protocol D1129 Set receiving timeout as 100ms X1 Sending request X0 H0100 M1127 Processing received data Receiving completed RST M1127 H1770 Set communication
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Registers for data to be sent (sending messages) Register Data Descriptions D1089 low 01 H Address of AC motor drive D1090 low 06 H Command code of AC motor drive D1091 low 20 H D1092 low 00 H D1093 low 00 H D1094 low 12 H D1095 low 02 H CRC CHK Low D1096 low 07 H CRC CHK High Data address Data content Registers for received data (responding messages) Register 3-276 Data Desc
3. Instruction Set Program Example 3: 1. In the communication between PLC and VFD-B series AC motor drive (ASCII Mode, M1143 = OFF), executes Retry when communication time-out, data receiving error or parameter error occurs 2. When X0 = ON, PLC will write data H1770 (K6000) into address H0100 in device 01 (VFD-B). 3. M1129 will be ON when communication time-out occurs. The program will trigger M1129 and send request for reading the data again. 4. M1140 will be ON when data receiving error occurs.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 102 Operands Forward Operation of VFD FWD Type Bit Devices OP X Function Y M Word devices S S1 S2 n Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F FWD: 7 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE API Mnemonic 103 Operands Reverse Operation of VFD REV Type Bit Device
3. Instruction Set 5. If rising-edge (LDP, ANDP, ORP) or falling-edge (LDF, ANDF, ORF) contacts are used before FWD, REV, STOP instructions, sending request flags M1122 (COM2) / M1316 (COM3) has to be enabled in advance for obtaining correct operation. 6. For detailed information of associated flags and special registers, please refer to RS instruction. 7. M1177 = OFF, only Delta VFD-A is supported and the definition of each operand is: a) S1 = Address of VFD-A.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Registers for data to be sent (sending messages) Register Data Descriptions D1089 low ‘C’ 43 H Header of control string D1090 low ‘♥’ 03 H D1091 low ‘☺’ 01 H Checksum Command acknowledgement (communication mode) D1092 low ‘0’ 30 H D1093 low ‘0’ 30 H D1094 low ‘0’ 30 H D1095 low ‘1’ 31 H D1096 low ‘0’ 30 H D1097 low ‘5’ 35 H D1098 low ‘0’ 30 H D1099 low ‘0’ 30 H Comm
3. Instruction Set In STOP instruction: operand n is reserved. d) When Forward JOG is selected in FWR instruction, set value in S2 is invalid. If users need to modify the JOG frequency, please refer to manuals of specific VFDs. Program Example: COM2 (RS-485) Communication between PLC and VFD-B series inverter (ASCII Mode, M1143 = OFF), Retry when communication time-out occurs.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ‘0’ 30 H ‘4’ 34 H ‘0’ 30H ‘0’ 30 H ‘1’ 31 H ‘2’ 32 H ‘0’ 30 H ‘1’ 31 H ‘F’ 46 H ‘4’ 34 H ‘C’ 43 H LRC CHK 1 ‘2’ 32 H LRC CHK 0 Byte Count Data content 1 H1: forward operation Operation frequency = K500Hz Data content 2 H01F4 Error checksum: LRC CHK (0,1) Received data (responding messages) Data 3-282 Descriptions ‘0’ 30 H ADR 1 ‘1’ 31 H ADR 0 ‘1’ 31 H CMD 1 ‘
3. Instruction Set API Mnemonic 105 Operands Function Read VFD Status RDST Type Bit Devices OP X S n Y M S Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F RDST: 5 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Device address n: Status content to be retrieved Explanations: 1. M1177 = OFF (Default), RDST instruction supports COM2(RS-485). 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Feedback N A B C D Explanation format. Retrieved status content. The content of ”ABCD” differs according to value 00~03 set in NN. 00 ~ 03 indicates frequency, current and operation mode respectively. Please refer to the explanations below for details. Nn = “00” Frequency command = ABC.D (Hz) Nn = “01” Output frequency = ABC.D (Hz) Nn = “02” Output current = ABC.
3. Instruction Set a) Range of S1: K1 ~ K255 b) The instruction will read VFD status at parameter address 2100H~2104H (Please refer to user manual of specific VFD for details.) and store the feedback data in D1070~D1074. However, the content in D1070~D1074 will not be updated when receiving error or timeout occurs. Therefore, please check the status of receiving completed flag before applying the received data Program Example: COM2 (RS-485) 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Data Descriptions ‘0’ 30 H ‘0’ 30 H ‘0’ 30 H ‘5’ 35 H ‘D’ 44 H LRC CHK 1 ‘6’ 36 H LRC CHK 0 Number of data (count by word) Error checksum: LRC CHK (0,1) Received data (responding messages) Data 3-286 Descriptions ‘0’ 30 H ADR 1 ‘1’ 31 H ADR 0 ‘0’ 30 H CMD 1 ‘3’ 33 H CMD 0 ‘0’ 30 H ‘A’ 41 H ‘0’ 30 H ‘0’ 30 H Content of address ASCII codes and store the ‘C’ 43 H
3. Instruction Set API Mnemonic 106 Operands Function Reset Abnormal VFD RSTEF Type Bit Devices OP X S n Y M S Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F RSTEF: 5 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Address of communication device n: Operation mode Explanations: 1. M1177 = OFF (Default), RSTEF instruction supports COM2(RS-485). 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 MOV H86 SET M1120 MOV K100 SET M1122 RSTEF K1 D1120 Set up communication protocol as 9600, 7, E, 1 Retain communication protocol D1129 Set up communication time-out: 100ms X0 Sending request M1129 X0 K0 Communication instruction setting: Device address: 1 K0: Reserved Receiving completed M1127 Processing received data RST Reset M1127.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 107 LRC Type OP Operands LRC checksum P Bit Devices X S n D Y Function M S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F LRC, LRCP: 7 steps * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Starting device for ASCII mode checksum n: Data length for LRC operation (n
3. Instruction Set Program Example: Connect PLC to VFD series AC motor drive (ASCII mode, M1143 = OFF), (8-bit mode, M1161 = ON), Write the data to be sent into registers starting from D100 in advance for reading 6 data from address H0708 on VFD.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g LRC checksum: 01 H + 03 H + 07 H + 08 H + 00 H + 06 H = 19 H. Operate 2’s complement on 19H and the result is E7H. Store ‘E’(45 H) in the low byte of D113 and ‘7’ (37 H) in the low byte of D114. Remarks: ASCII mode communication data: STX Address Hi Address Lo Function Hi Function Lo DATA (n-1) …….
3. Instruction Set API Mnemonic 108 CRC Type OP Operands CRC checksum P Bit Devices X S n D Y Function M S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F CRC, CRCP: 7 steps * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Starting device for RTU mode checksum n: Data length for CRC operation (n = K1~K256) D: Starting device for storing the operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example: Connect PLC to VFD series AC motor drive (RTU mode, M1143 = ON), (8-bit mode, M1161 = ON), Write the data to be sent (H1770) into address H0706 on VFD.
3. Instruction Set API Mnemonic 110 D Type OP ECMP Operands Floating point compare P Bit Devices X S1 S2 D Function Y M S * * * Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DECMP, DECMPP: 13 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: 1st comparison value S2: 2nd comparison value D: Comparison result, 3 consecutive devices Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 111 Operands D EZCP P Type OP Bit Devices X S1 S2 S D Function Controllers Floating point zone compare ES2/EX2 SS2 SA2 SX2 SE Word devices Y M S * * * Program Steps K H KnX KnY KnM KnS T C D E F DEZCP, DEZCPP: 17 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Lower bound of zone comparison v
3. Instruction Set API Mnemonic 112 D Type OP MOVR Operands P Bit Devices X Y S D M S Function Controllers Move floating point data ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DMOVR, DMOVRP: 9 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Destination device Explanations: 1. Directly input floating point value in S. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 116 D RAD Type OP Operands Degree P Bit Devices X Y M Function S S D Radian Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DRAD, DRADP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (degree) D: Conversion result (radian) Explanation: 1.
3. Instruction Set API Mnemonic 117 D DEG Type OP Operands P Radian Bit Devices X Y M Function S S D Degree Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DDEG, DDEGP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (radian) D: Conversion result (degree) Explanation 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 118 D EBCD Type OP Operands Function P Float to scientific conversion Bit Devices X Y M Controllers S S D Word devices ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DEBCD, DEBCDP: 9 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Conversion result Explanation 1.
3. Instruction Set API Mnemonic 119 D EBIN Type OP Operands Function P Scientific to float conversion Bit Devices X Y M S S D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DEBIN, DEBINP: 9 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Conversion result Explanation: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 MOVP K314 D0 K314 D0 [D1] D1 314 x10 [D0] -2 MOVP K-2 D1 DEBIN D0 D2 K-2 (D1, D0) 314 x10 3-302 (D3, D2) Binary Floating Point
3. Instruction Set API Mnemonic 120 D Type OP EADD Operands P Floating point addition Bit Devices X Y M Function S S1 S2 D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DEADD, DEADDP: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Augend S2: Addend D: Addition result Explanations: 1. S1 + S2 = D.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 121 D ESUB Type OP Operands P Bit Devices X Y M S1 S2 D S Function Controllers Floating point subtraction ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DESUB, DESUBP: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Minuend S2: Subtrahend D: Subtraction result
3. Instruction Set API Mnemonic 122 D EMUL Type OP Operands P Bit Devices X Y M S1 S2 D S Function Controllers Floating point multiplication ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DEMUL, DEMULP: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Multiplicand S2: Multiplicator D: Multiplication result Explanations: 1. S1 × S2 = D.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 123 D EDIV Type OP Operands P Floating point division Bit Devices X Y M Function S S1 S2 D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DEADD, DEADDP: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Dividend S2: Divisor D: Quotient and Remainder E
3. Instruction Set API Mnemonic 124 D Type OP EXP Operands P Bit Devices X Y S D M Function Controllers Float exponent operation ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DEXP, DEXPP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Exponent D: Operation result Explanations: 1. The base is e = 2.71828 and exponent is S 2. EXP [ S +1, S ] = [ D +1, D ] 3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 125 D Type OP LN Operands P Function Controllers Float natural logarithm operation ES2/EX2 SS2 SA2 SX2 SE Bit Devices X Y S D M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DLN, DLNP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Operation result Explanations: 1.
3. Instruction Set API Mnemonic 126 D Type OP LOG Operands Float logarithm operation P Bit Devices X Y M Function S S1 S2 D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DLOG, DLOGP: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Base S2: Antilogarithm D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M0 RST M1081 DFLT D0 D10 DFLT D2 D12 DLOG D10 D12 DEBCD D20 D30 M1 M2 3-310 D20
3. Instruction Set API Mnemonic 127 D ESQR Type Operands P Bit Devices OP X Y M S S D Function Controllers Floating point square root ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DESQR, DESQRP: 9 * * * steps * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 128 D Type OP POW Operands Floating point power operation P Bit Devices X Y M S1 S2 D Function S Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DPOW, DPOWP: 13 * * * steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Base S2: Exponent D: Operation result Expla
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 129 D Type OP INT Operands P Bit Devices X Y M S S D Function Controllers Float to integer ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F INT, INTP: 5 steps * * * DINT, DINTP: 9 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Operation result Explanations:
3. Instruction Set API Mnemonic 130 D SIN Type OP Operands Controllers Sine ES2/EX2 SS2 SA2 SX2 SE P Bit Devices X Function Y M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DSIN, DSINP: 9 steps * * * * S D PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (0°≦S<360°) D: Operation result Explanations: 1. SIN instruction performs sine operation on S and stores the result in D. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: M1018 = OFF, radian mode. Select the degree value from inputs X0 and X1 and convert it to RAD value for further sine operation.
3. Instruction Set API Mnemonic 131 D COS Type OP Operands P Bit Devices X Y M Function Controllers Cosine ES2/EX2 SS2 SA2 SX2 SE Word devices S S D Program Steps K H KnX KnY KnM KnS T C D E F DCOS, DCOSP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (0°≦S<360°) D: Operation result Explanations: 1. COS instruction performs cosine operation on S and stores the result in D. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: M1018 = ON, degree mode. When X0 = ON, DCOS instruction performs cosine operation on the degree value (0°≦degree<360°) in (D1, D0) and stores the COS value in (D11, D10) in binary floating format..
3. Instruction Set API Mnemonic 132 D TAN Type OP Operands Controllers Tangent ES2/EX2 SS2 SA2 SX2 SE P Bit Devices X Function Y M S S D Word devices Program Steps K H KnX KnY KnM KnS T C D E F DTAN, DTANP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (0°≦S<360°) D: Operation result Explanations: 1. TAN instruction performs tangent operation on S and stores the result in D. 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g D1 RAD value(degree x π / 180) D0 binary floating point D11 TAN value binary floating point D10 Program Example 2: M1018 = ON, degree mode. When X0 = ON, DTAN instruction performs tangent operation on the degree value (0°≦degree<360°) in (D1, D0) and stores the TAN value in (D11, D10) in binary floating format.
3. Instruction Set API Mnemonic 133 D ASIN Type OP Operands P Bit Devices X Y M S D Function Controllers Arc Sine ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DASIN, DASINP: 9 steps * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (binary floating value) D: Operation result Explanations: 1. ASIN instruction performs arc sine operation on S and stores the result in D 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3-322 D1 D0 Binary floating point D11 D10 ASIN value binary floating point
3. Instruction Set API Mnemonic 134 D ACOS Type OP Operands P Bit Devices X Y M Function Controllers Arc Cosine ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DACOS, DACOSP: 9 * * * steps * S D PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (binary floating value) D: Operation result Explanations: 1. ACOS instruction performs arc cosine operation on S and stores the result in D 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3-324 D1 D0 Binary floating point D11 D10 ACOS value binary floating point
3. Instruction Set API Mnemonic 135 D ATAN Type OP Operands P Bit Devices X Y M Function Controllers Arc Tangent ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DATAN, DATANP: 9 * * * steps * S D PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (binary floating value) D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 143 DELAY Type OP Operands Controllers Delay ES2/EX2 SS2 SA2 SX2 SE P Bit Devices X Function Y M S Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DELAY, DELAYP: 3 * * * steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Delay time, unit: 0.
3. Instruction Set API Mnemonic 144 Operands GPWM Type OP Bit Devices X S1 S2 D Y M S * * * Function Controllers General PWM output ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F GPWM: 7 steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Width of output pulse S2: Pulse output cycle (occupies 3 devices) D: Pulse output device Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 147 D Operands SWAP Type OP P Bit Devices X Y M S Function Controllers Byte swap ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F SWAP, SWAPP: 3 steps S * * * * * * * * DSWAP, DSWAPP: 5 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Device for byte swap. Explanations: 1.
3. Instruction Set API Mnemonic 148 MEMR Type OP Operands Reading the data from the file register P Bit Devices X Y Function M m D n Controllers ES2/ SS2 EX2 Word devices S SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F 7 steps * * * The 32-bit instruction and * DVP-SS2 are not * * * supported. PULSE 16-bit 32-bit ES2/ ES2/ ES2/ SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: M: File register from which the data is read (The value is between K0 and K4999.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 149 MEMW Type OP Operands Writing the data into the file register P Bit Devices X Function Y M S m n S Controllers ES2/ SS2 EX2 Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F 7 steps * The 32-bit instruction and * * * DVP-SS2 are not * * * supported.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g COM2 sends the function code of reading(K2/K3), the registers from S directly receive the data string and stored the converted data in D1296~D1311. Please refer to program example 1 and 3 for further explanation. When COM1 or COM3 sends the function code of reading(K2/K3), the registers store the converted data directly. Refer to program example 2 and 4 for further explanations. 6.
3. Instruction Set 3. In ASCII or RTU mode, when PLC’s COM2 sends out data, the data will be stored in D1256~D1295. The feedback data will be stored in registers starting with S and converted into D1296~D1311 in Hex automatically. 4. Take the connection between PLC1 (PLC COM2) and PLC2(PLC COM1) for example, the tables below explains the status when PLC1 reads Y0~Y17 of PLC2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register Data Descriptions D1260 Low ‘0’ 30 H D1260 High ‘0’ 30 H D1261 Low ‘1’ 31 H D1261 High ‘0’ 30 H D1262 Low ‘E’ 45 H LRC CHK 1 D1262 High ‘8’ 38 H LRC CHK 0 Number of Data(count by bit) Checksum: LRC CHK (0,1) Registers for received data (responding messages) Register Data Descriptions D0 Low ‘0’ 30 H ADR 1 D0 High ‘1’ 31 H ADR 0 D1 Low ‘0’ 30 H CMD 1 D1 Hi
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 MOV H87 SET M1136 MOV K100 RST M1320 SET M1316 MODRW K1 X0 Set communication protocol as 9600, 8, E,1 D1109 Retain communication setting Set receiving timeout as 100ms D1252 M1320 = OFF, SET ASCII mode M1320 M132 0 = ON RTU mode Sending request X0 K2 H0500 D0 K16 Data length ( bit) Data st oring register Data address: Y0=H0500 Function code: K2 read multiple bits Connecti
3. Instruction Set PLC data receiving register: Register Data Descriptions D0 1234 H PLC converts the data in address 0500H ~ 0515H and stores the converted data automatically. Analysis of the read status of PLC2 Y0~Y17: 1234H 5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. Take the connection between PLC (PLC COM2) and VFD-B for example, the tables below explains the status when PLC reads status of VFD-B.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register D12 low byte Data ‘3’ 33 H Descriptions address H2104 PLC COM2 automatically converts ASCII codes to hex D12 high byte ‘6’ 36 H and stores the converted value in D1300 D13 low byte ‘0’ 30 H D13 high byte ‘0’ 30 H D14 low byte ‘0’ 30 H 0000 H Content of address H2105 D14 high byte ‘0’ 30 H PLC COM2 automatically converts ASCII codes to hex and stores the converted value in
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 H87 SET M1136 MOV K100 RST M1320 M1320 = OFF ASCII mode SET M1316 Sending request MODRW K1 X0 D1109 Set communication protocol as 9600, 8, E,1 MOV Retain communication setting D1252 Set communication timeout as 100ms SET M1320 M1320 = ON RTU mode X0 K3 H2100 D0 K6 Data length(word) Data st oring register Data address: H2100 Function code: K3 Read multiple words Connection
3. Instruction Set Register D5 Data 0000 H Descriptions PLC converts ASCII codes in 2105 H and stores the converted data automatically.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g M1002 Set communication protocol as 9600,8,E,1 MOV H87 D1120 SET M1120 MOV K100 RST M1143 M1143 = OFF ASCII mode SET M1122 Sending request MODRW K1 Retain communication prot oc ol Set receiving timeout as 100ms D1129 X0 SET M1143 M1143 = ON RTU mode X0 K5 H0500 D0 K1 Force ON status (Set FF00H) Reserved Data address : Y 0 = H0500 Function Code K5: Force ON/OFF bit device Receiv
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register Data Descriptions D1074 Low byte FF H D1075 Low byte 00 H D1076 Low byte 8C H CRC CHK Low D1077 Low byte F6 H CRC CHK High Data content (ON = FF00H) Program example 6: COM1(RS-232) / COM3(RS-485), Function Code H05 1. Function Code K5 (H05): Force ON/OFF bit device. 2. PLC1 connects PLC2: (M1320 = OFF, ASCII Mode ), (M1320 = ON, RTU Mode) 3.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ASCII mode (M1143 = OFF) When X0 = ON, MODRW instruction executes the function specified by Function Code 06 PLC Ö VFD-B, PLC sends: “01 06 2000 1770 52” VFD-B Ö PLC, PLC receives: “01 06 2000 1770 52” Registers for data to be sent (sending messages) Register Data Descriptions D1256 Low byte ‘0’ 30 H ADR 1 D1256 High byte ‘1’ 31 H ADR 0 D1257 Low byte ‘0’ 30 H CMD 1 D1257 High byte ‘6’
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 5. M1316→M1312: sending request 6.
3. Instruction Set 4. Take the connection between PLC1 (PLC COM2) and PLC2 (PLC COM1) for example, the tables below explain the status when PLC1 force ON/OFF Y0~Y17 of PLC2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register Data Descriptions D1260 下 ‘0’ 30 H D1260 上 ‘0’ 30 H D1261 下 ‘1’ 31H D1261 上 ‘0’ 30 H D1262 下 ‘0’ 30 H D1262 上 ‘2’ 32 H D1263 下 ‘3’ 33 H D1263 上 ‘4’ 46 H Number of Data (count by bit) Byte Count Data contents D1264 下 ‘1’ 33 H D1264 上 ‘2’ 46 H D1265 下 ‘9’ 39 H LRC CHK 1 D1265 上 ‘3’ 33 H LRC CHK 0 1234H Content of register D0 Checksum: LRC CHK (0,1) Re
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. D1252→D1249: Set value for data receiving timeout 4. M1320→M1139: ASCII/RTU mode selection 5. M1316→M1312: sending request 6.
3. Instruction Set Program Example 11: COM2 (RS-485), Function Code H10 1. Function code K16 (H10): Write in multiple Word devices. Up to 16 Words can be written. For PLC COM2 ASCII mode, only 8 words can be written. 2. For ASCII or RTU mode, PLC COM2 stores the data to be sent in D1256~D1295, and the received data in D1070~D1085. 3. Take the connection between PLC COM2 and VFD-B AC motor drive for example, the tables below explain the status when PLC COM2 writes multiple word devices in VFD-B.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Register Data Descriptions D1258 High byte ‘0’ 30 H D1259 Low byte ‘0’ 30 H D1259 High byte ‘0’ 30 H D1260 Low byte ‘0’ 30 H D1260 High byte ‘0’ 30 H D1261 Low byte ‘0’ 30 H D1261 High byte ‘2’ 32 H D1262 Low byte ‘0’ 30 H D1262 High byte ‘4’ 34 H D1263 Low byte ‘1’ 31 H D1263 High byte ‘7’ 37 H D1264 Low byte ‘7’ 37 H D1264 High byte ‘0’ 30 H D1265 Low byte ‘0
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. M1136→M1138: retain communication setting 3. D1252→D1249: Set value for data receiving timeout 4. M1320→M1139: ASCII/RTU mode selection 5. M1316→M1312: sending request 6.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 155 D Type OP S D1 D2 Operands ABSR Bit Devices X * Y * * M * * S * * Function Controllers Absolute position read ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DABSR: 13 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Input signal from servo (occupies 3 consec
3. Instruction Set 6. Please use NO contact as the drive contact of DABSR instruction. If the drive contact is OFF during the execution of DABSR, the instruction will be stopped and errors will occur on read data. 7. If the drive contact of DABSR instruction turns OFF after the instruction is completed, the servo ON (SON) signal connected to D1 will also turn OFF and the operation will be disabled. 8.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4. When DABSR instruciton executes, servo ON (SON) and ABS data transmission mode are driven for output. 5. By “transmission ready” and “ABS request” signals, users can confirm the transmitting and receiving status of both sides as well as processing the transmission of the 32-bit ABS position data and the 6-bit check data.. 6. Data is transmitted by ABS (bit0, bit1). 7.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4. When D is specified as Y0, its direction signal output is Y1; when D is specified as Y2, its direction signal output is Y3. 5. When pulse output reaches zero point, pulse output execution completed flag M1029 (CH0), M1102 (CH1) is ON and the register indicating current position is reset to 0. 6.
3. Instruction Set Output in reverse End flag M1029/M1102 OFF ON OFF DOG switch: X4/X6 ON Freq. Target freq. JOG freq. Time Start Meet DOG switch DOG switch OFF State 2: DOG switch is ON, pulse output in reverse, limit switch disabled. Output in reverse End flag M1029/M1102 DOG switch: X4/X6 Off On On Off Freq. JOG freq. Time Start DOG switch OFF State 3: Current position at left side of zero point, pulse output in reverse, limit switch enabled.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Forward output Reverse output End flag M1029/M1102 Reverse output Off Off Limit switch X5/X7 On On Off DOG switch: X4/X6 Freq. Target freq. On JOG freq. Time Start DOG switch OFF Limit switch OFF Limit switch ON DOG switch ON State 4: Current position at right side of zero point, M1346=On. M1029 Y4 X4 On Off On Off Off On Freq.
3. Instruction Set State 5: Current position at right side of zero point, D1312=-2, M1308=Off, M1346=On. Off M1029 On On Off Y4 Off X4 On X2 Freq. Target speed Jog speed Time 2nd Z phase in Meet DOG Start Left DOG State 6: Current position at right side of zero point, D1312=-100, M1308=On. M1029 Off X4 Off On On Y0 Freq.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: When M0 = ON, Y0 pulse output executes zero return with a frequency of 20kHz. When it reaches the DOG switch, X4 = ON and the frequency changes to JOG frequency of 1kHz. When X4 = OFF, it seeks the second X2(Z-phase) pulse input (right-edge trigger signal), and Y4 stops after a pulse (the width of On is 20ms) is output from it (M1029=On).
3. Instruction Set API 157 Mnemonic Operands OP Bit Devices X S D1 D2 Controllers ES2/EX2 SS2 SA2 SX2 SE Adjustable Speed Pulse Output D PLSV Type Function Word Devices Y M S * * * * K * H KnX KnY KnM KnS T * * * * * * Program Steps C * D * E * F PLSV: 7 steps * DPLSV: 13 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Pulse output frequency D1: Pulse output device (Y0, Y2) D2: Direction signal output Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 158 D Type OP Operands Relative Position Control DRVI Bit Devices X S1 S2 D1 D2 Function Y M S * * * * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DDRVI: 17 steps * * * * * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Number of pulses
3. Instruction Set 11. Ramp-down time of CH0 and CH1 can be particularly modified by using (M1534, D1348) and (M1535, D1349). When M1534 / M1535 = ON, CH0 / CH1 ramp-down time is specified by D1348 / D1349. 12. If M1078 / M1104 = ON during instruction execution, Y0 / Y2 will pause immediately and M1538 / M1540 = ON indicates the pause status. When M1078 / M1104 = OFF, M1538 / M1540 = OFF, Y0 / Y2 will proceed to finish the remaining pulses. 13.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g z This instruction can be used many times in user program, but only one instruction will be activated at a time. For example, if Y0 is currently activated, other instructions use Y0 won’t be executed. Therefore, instructions first activated will be first executed. z After activating the instruction, all parameters cannot be modified unless instruction is OFF. 3.
3. Instruction Set D1232 Output pulse number for ramp-down stop when Y0 masking sensor receives signals. (LOW WORD) D1233 Output pulse number for ramp-down stop when Y0 masking sensor receives signals. (HIGH WORD). D1234 Output pulse number for ramp-down stop when Y2 masking sensor receives signals (LOW WORD). D1235 Output pulse number for ramp-down stop when Y2 masking sensor receives signals (HIGH WORD).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 159 D DRVA Type OP Operands Absolute Position Control Bit Devices X S1 S2 D1 D2 Function Y M S * * * * Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DRVA: 9 steps * * * * * * * * * * * DDRVA: 17 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1:
3. Instruction Set 10. M1305 and M1306 can change the output direction of CH0/CH1 set in D2. When S is “-“, D2 will be ON, however, if M1305/M1306 is set ON before instruction executes, D2 will be OFF during execution of instruction.. 11. Ramp-down time of CH0 and CH1 can be particularly modified by using (M1534, D1348) and (M1535, D1349). When M1534 / M1535 = ON, CH0 / CH1 ramp-down time is specified by D1348 / D1349. 12.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. Registers for setting ramp up/down time and start/end frequency: z Output Y0: Sample time of ramp-up Pulse output frequency Ramp-up slope End freq. Y0 (D1340) Min: 6Hz Start freq.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 161 TZCP Type OP Operands P Bit Devices X S1 S2 S D Y M S * * * Function Controllers Time zone compare ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F TZCP, TZCPP: 9 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Lower bound of the time for comparison (occupi
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 163 TSUB Type OP Operands P Bit Devices X Y M Controllers Time subtraction ES2/EX2 SS2 SA2 SX2 SE Word devices S S1 S2 D Function Program Steps K H KnX KnY KnM KnS T C D E F TSUB, TSUBP: 7 steps * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Time minuend (occupies 3 consecutive devices) consecutive d
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 166 TRD Type OP Operands P Bit Devices X Y M Function Controllers Time read ES2/EX2 SS2 SA2 SX2 SE Word devices S D Program Steps K H KnX KnY KnM KnS T C D E F TRD, TRDP: 3 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operand: D: Current time of RTC (occupies 7 consecutive devices) Explanations: 1.
3. Instruction Set Points to note: 1. There are two methods to correct built-in RTC: z Correcting by API167 TWR instruction Please refer to explanation of instruction TWR (API 167) z Setting by peripheral device Using WPLSoft / ISPSoft (Ladder editor) 2. Display 4-digit year data: z D1319 only stores the 2-digit year in A.D. If 4-digit year data is required, please insert the following instruction at the start of program.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 167 TWR Type OP Operands P Bit Devices X Y M S S Function Controllers Time write ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F TWR, TWRP: 5 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operand: S: Set value for RTC (occupies 7 consecutive devices) Explanations: 1.
3. Instruction Set 1, second data resets).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 168 D Type OP MVM Operands P Bit Devices X Y M Function Controllers Transfer Designated Bits ES2/EX2 SS2 SA2 SX2 SE Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * * S1 S2 D Program Steps T C D E F MVM, MVMP: 7 steps * * * * * DMVM,DMVMP: * * * * * * * * * * 13 steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Op
3. Instruction Set API Mnemonic 169 D Operands HOUR Type OP Bit Devices X S D1 D2 Y M S * * * Function Controllers Hour meter ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F HOUR: 7 steps * * * * * * * * * * * DHOUR: 13 steps * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Set-point value for driving the output device (Unit: hour) D1: Current time being measured D2: Output device Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Program Example 2: In 32-bit instruction, when X0 = ON, Y10 will be ON and the timing will start. When the timing reaches 40,000 hours, Y0 will be ON. D1 and D0 will record the current time measured (in hour) and D2 will record the current time less than an hour (0 ~ 3,599; unit: second).
3. Instruction Set API Mnemonic 170 D Type OP GRY Operands P Bit Devices X Y M S S D Function Controllers BIN → Gray Code ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F GRY, GRYP: 5 steps * * * * * * * * * * * DGRY, DGRYP: 9 steps * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Operation result (Gray code) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 171 D GBIN Type OP Operands P Bit Devices X Y M Controllers Gray Code → BIN ES2/EX2 SS2 SA2 SX2 SE Word devices S S D Function Program Steps K H KnX KnY KnM KnS T C D E F GBIN, GBINP: 5 steps * * * * * * * * * * * DGBIN, DGBINP: 9 * * * * * * * * steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device D: Operati
3. Instruction Set API Mnemonic 172 D Type OP ADDR Operands Floating point addition P Bit Devices X Y M Function S S1 S2 D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DADDR, DADDRP: 13 * steps * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Floating point summand S2: Floating point addend D: Sum Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 DADDR 3-392 D0 D2 D10
3. Instruction Set API Mnemonic 173 D Type OP SUBR Operands P Bit Devices X Y M S Function Controllers Floating point subtraction ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DSUBR: 13 steps S1 S2 D * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Floating point minuend S2: Floating point subtrahend D: Remainder Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g X0 DSUBR 3-394 D0 D2 D10
3. Instruction Set API Mnemonic 174 D Type OP MULR Operands P Bit Devices X Y M S Function Controllers Floating point multiplication ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DMULR, DMULRP: 13 S1 S2 D * * * steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Floating point multiplicand S2: Floating point multiplicator D: Product Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g X1 DMULR 3-396 D0 D10 D20
3. Instruction Set API Mnemonic 175 D Type OP DIVR Operands P Bit Devices X Y M S Function Controllers Floating point division ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DDIVR: 13 steps S1 S2 D * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Floating point n dividend S2: Floating point divisor D: Quotient Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 176 MMOV Type Operands P Bit Devices OP X Y M S D S Function Controllers 16-bit→32-bit Conversion ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F MMOV, MMOVP: 5 steps * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device (16-bit) D: Destination device (32-bit)
3. Instruction Set API Mnemonic 177 Operands Function GPS data receiving GPS Type Bit Devices OP X Y Controllers M S D S Word devices ES2 EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F GPS: 5 steps * * * * PULSE 16-bit 32-bit ES2 ES2 ES2 SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: S: Sentence identifier for GPS data receiving D: Destination device for feedback data Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g No. Content Range Format D+2 Second 0 ~ 59 Word D + 3~4 Latitude 0 ~ 90 Float Unit: dd.mmmmmm North / South 0 or 1 Word 0(+)ÆNorth, 1(-)ÆSouth Longitude 0 ~ 180 Float Unit: ddd.
3. Instruction Set M1002 2. D1036 Set communication protocol as 9600,8,N,1 MOV H81 SET M1138 Retain communication setting MOV K2000 D1249 Set receiving time-out as 2s Then enable M0 to execute GPS instruction with sentence identifier $GPGGA M0 SET M1312 GPS K0 M0 D0 M1314 Y0 M1315 Y1 3. When receiving completed, M1314 = ON. When receiving failed, M1315 = ON. The received data will be stored in devices starting with D0. No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 1 2 5 4 3 8 7 3-402 6
3. Instruction Set API Mnemonic 178 D Operands Function Solar Panel Positioning SPA Type OP Bit Devices X Y M S S D Controllers ES2/ EX2 SS2 Word devices SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DSPA: 9 steps * * * * PULSE 16-bit 32-bit ES2/ ES2/ ES2/ SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: S: Start device for input parameters D: Start device for output parameters Explanations: 1. Operand S occupies 208 consecutive word registers.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. Operand D occupies 8 consecutive word registers. The function of each device is as below: No. Content Range Format Note D + 0~1 Zenith 0 ~ 90 Float Horizontal=0 D + 2~3 Azimuth 0 ~ 360 Float North point=0 D + 4~5 Incidence 0 ~ 90 Float D+6 Converted DA value of Zenith 0 ~ 2000 Word 1LSB = 0.045 degree D+7 Converted DA value of Azimuth 0 ~ 2000 Word 1LSB = 0.18 degree 3.
3. Instruction Set Program example: 1. Input parameters starting from D4000: 2009/3/23/(y/m/d),10:10:30, Δt = 0, Local time zone = +8, Longitude/Latitude = +119.192345 East, +24.593456 North, Elevation = 132.2M, Pressure = 820m, MAT = 15.0℃, Slope = 0 degree, Azimuth = -10 degree. M0 M1013 DSPA 2. D4000 D5000 Output results: D5000: Zenith = F37.2394 degree; D5002: Azimuth = F124.7042 degree.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 179 D WSUM Type OP Operands Sum of multiple devices P Bit Devices X Y S n D Function M S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F WSUM, WSUMP: 7 steps * * * DWSUM, DWSUMP: 13 * * * steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Source device n: Data length to b
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g Points to note: 1. A matrix consists of more than 1 consecutive 16-bit registers. The number of registers is indicated as the matrix length (n). A matrix contains 16 × n bits (points) and the matrix instructions conduct bit operation, i.e. operation is performed bit by bit. 2. Matrix instructions designate a single bit of the 16 × n bits (b0 ~ b16n-1) for operation.
3. Instruction Set API Mnemonic 181 MOR Type OP Operands P Bit Devices X Y M Function Controllers Matrix OR ES2/EX2 SS2 SA2 SX2 SE Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * S1 S2 D n Program Steps T C D E F MOR, MORP: 9 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Matrix source device 1 S2: Matrix source device 2. D: Operation result n: Matrix length (n = K1~K256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 182 MXOR Type OP Operands P Bit Devices X Y M Function Controllers Matrix XOR ES2/EX2 SS2 SA2 SX2 SE Word devices S K H KnX KnY KnM KnS * * * * * * * * * * * * * S1 S2 D n Program Steps T C D E F MXOR, MXORP: 9 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Matrix source device 1 S2: Matrix sour
3. Instruction Set API Mnemonic 183 MXNR Type OP Operands P Bit Devices X Y M S S1 S2 D n Function Controllers Matrix XNR ES2/EX2 SS2 SA2 SX2 SE Word devices K H KnX KnY KnM KnS * * * * * * * * * * * * * Program Steps T C D E F MXNR, MXNRP: 9 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Matrix source device 1 S2: Matrix source device 2 D: Operation result n: Matrix length (K1~K256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 184 MINV Type OP Operands P Bit Devices X Y M Function Controllers Matrix inverse ES2/EX2 SS2 SA2 SX2 SE Word devices S S D n Program Steps K H KnX KnY KnM KnS T C D E F MINV, MINVP: 7 steps * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device D: Operation result n: Matrix len
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g o D20 = 45, M1091 = ON, M1089 = OFF. p D20 = 47, M1091 = OFF, M1089 = ON (comparison proceeds to he last bit) q D20 = 1, M1091 = ON, = OFF.
3. Instruction Set API Mnemonic 186 MBRD Type OP Operands P Bit Devices X Y M S n D Function Controllers Matrix bit read ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F MBRD, MBRDP: 7 steps * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device n: Matrix length (K1~K256). D: Pointer Pr (bit number) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g b0 D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b47 Pointer 45 D20 Points to note: Associated flags and registers: M1089: Indicating the end of Matrix. When the comparison reaches the last bit, M1089 = ON M1092: Indicating pointer error. When the pointer Pr exceeds the comparison range, M1092 = ON. M1093 Matrix pointer increasing flag.
3. Instruction Set API Mnemonic 187 MBWR Type OP Operands P Bit Devices X Y M S n D S Function Controllers Matrix bit write ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F MBWR, MBWRP: 7 steps * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device n: Matrix length (K1~K256) D: Pointer Pr (bit number). Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g Before Execution b0 D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b47 M1096 1 (Borrow flag for matrix rotation / shift / input) 45 After Execution D20 Pointer D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 D1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D2 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 b47 45 D20 Pointer Points to note: Associated flags and registers: M1089: Indicati
3. Instruction Set API Mnemonic 188 MBS Type OP Operands P Bit Devices X Y M Function Controllers Matrix bit shift ES2/EX2 SS2 SA2 SX2 SE Word devices S S D n Program Steps K H KnX KnY KnM KnS T C D E F MBS, MBSP: 7 steps * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device D: Operation result n: Matrix length (K1~K256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 0 b15 Before execution M1095 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D2 MBS After bits shift to left M1095 M1096 b0 1 M1097=0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D22 Program Example 2: When X1 = ON, M1097 = ON, indicating a right matrix shift is performed.
3. Instruction Set API Mnemonic 189 MBR Type OP Operands P Bit Devices X Y M Function Controllers Matrix bit rotate ES2/EX2 SS2 SA2 SX2 SE Word devices S S D n Program Steps K H KnX KnY KnM KnS T C D E F MBR, MBRP: 7 steps * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device D: Operation result n: Matrix length (K1~K256) Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g b15 Before execution M1095 B0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D2 MBR After rotation to the left 1 M1095 M1097=0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D21 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D22 Program Example 2: When X1 = ON, M1097 = ON, indicating a right matrix rotation is performed.
3. Instruction Set API Mnemonic 190 MBC Type OP Operands P Bit Devices X Y M Function Controllers Matrix bit status count ES2/EX2 SS2 SA2 SX2 SE Word devices S S n D Program Steps K H KnX KnY KnM KnS T C D E F MBC, MBCP: 7 steps * * * * * * * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Matrix source device n: Matrix length (K1~K256) D: Operation result Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 191 D Type OP Operands PPMR Bit Devices X S1 S2 S D Y M S Function Controllers 2-Axis Relative Point to Point Motion ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DPPMR: 17 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Number of output pulses on X axis S2: Number
3. Instruction Set 8. For pulse output with ramp-up/down section, if only 1 axis is specified with pulse output number, i.e. another axis is 0, the pulse output will only be performed on the axis with output pulse number. However, if the output pulse number is less than 20 in any of the 2 axes, the ramp-up/down section will be disabled and pulse output will be executed with the frequency not higher than 3kHz. 9. There is no limitation on the number of times for using the instruction.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g = D0 K1 DPPMR D200 D202 K100000 Y0 = D0 K2 DPPMR D204 D206 K100000 Y0 = D0 K3 DPPMR D208 D210 K100000 Y0 = D0 K4 DPPMR D212 D214 K100000 Y0 RST M1029 MOV K1 INCP D0 M0 M0 D0 M1029 END 3. Operation: When PLC runs and M0 = ON, PLC will start the first point-to-point motion by 100KHz.
3. Instruction Set API Mnemonic 192 D Type OP Operands PPMA Bit Devices X S1 S2 S D Y M S Function Controllers 2-Axis Absolute Point to Point Motion ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F DPPMA: 17 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Number of output pulses on X axis to point output frequency S2: Number of output pulses on Y axis S: Max.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g Y (0, 0) X (-2700 0,-27 000) (270 00,-27 000) (0, -5 5000) 2. Steps: a) Set the four coordinates (-27000, -27000), (0, -55000), (27000, -27000) and (0,0) (as the figure above). Place them in the 32-bit registers (D200, D202), (D204, D206), (D208, D210), (D212, D214). b) Design instructions as follows. c) RUN the PLC. Set ON M0 to start the 2-axis line drawing.
3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 6. Draw four 90° arcs as the figure below. When the direction signal is ON, the direction is positive(QI, QIV). When the direction signal is OFF, the direction is negative(QII, QIII). When S is set as K0, the arcs will be clockwise (see figure 3). When S is set as K, the arcs will be counterclockwise (see figure 4).
3. Instruction Set that the arc has to be a 90° arc, i.e. the numbers of output pulses in X and Y axes can be different. 13. There are no settings of start frequency and ramp-up/down time. 14. There is no limitation on the number of times for using the instruction. However, assume CH0 or CH1 output is in use, the X/Y axis synchronized output will not be performed Program Example 1: 1. Draw an ellipse as the figure below. Y ( 16 00 ,22 00 ) X ( 0,0 ) ( 32 00 ,0) (1 6 00 ,-2 20 0) 2.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 3. Operation: When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will plus 1 whenever a segment of arc is completed and the second segment of the arc will start to execute automatically. The operation pattern repeats until the fourth segment of arc is completed. Program Example 2: 1. Draw a tilted ellipse as the figure below.
3. Instruction Set 3. Operation: When PLC runs and M0 = ON, PLC will start the drawing of the first segment of the arc. D0 will plus 1 whenever a segment of arc is completed and the second segment of the arc will start to execute automatically. The operation pattern repeats until the fourth segment of arc is completed. Points to note: Description of associated flags and registers: M1029: CH0 (Y0, Y1) pulse output execution completed D1030: Present number of Y0 output pulses (HIGH WORD).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 194 D Type OP Operands Function 2-Axis Absolute Position Arc Interpolation CIMA Bit Devices X S1 S2 S D Y M S Word devices Controllers ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DCIMA: 17 steps * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Number of output pulses of X axis Parameter s
3. Instruction Set above). Place them in the 32-bit registers (D200, D202), (D204, D206), (D208, D210), (D212, D214). b) Select “draw clockwise arc” and default “motion time” (S = D100 = K0) c) RUN the PLC. Set ON M0 to start the drawing of the ellipse.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. Steps: a) Find the max. and min. coordinates on X and Y axes (0,0), (26000,26000), (34000,18000), (8000,-8000) (as the figure above). Place them respectively in the 32-bit registers (D200,D202), (D204,D206), (D208,D210) and (D212,D214). b) Select “draw clockwise arc” and default “motion time” (S = D100 = K0). c) RUN the PLC. Set ON M0 to start the drawing of a tilted ellipse.
3. Instruction Set API Mnemonic 195 D Type OP Operands PTPO Bit Devices X S1 S2 D Y M Function Controllers Single-axis pulse output by table ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F DPTPO: 13 steps * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source start device S2: Number of segments D: Pulse output device Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g K40 (40th segment) D157, D156 D159, D158 3. Current executing segment can be monitored by D301. X0 DPTPO D0 D300 Y0 END 4. Timing diagram: F r eq u e nc y (Hz ) ( D15 7,D1 56 ) .... ( D15 9,D1 58 ) .... ( D5,D4 ) ( D7,D6 ) ( D1,D0 ) ( D3,D2 ) T i me (S) t2 t1 t .. .. t 40 Points to note: 1. Associated Flags: M1029 CH0 (Y0) pulse output execution completed.
3. Instruction Set API Mnemonic 197 D Operands Function Close loop position control CLLM Type OP Bit Devices X * S1 S2 S3 D Y Controllers ES2/EX2 SS2 SA2 SX2 SE M S Word devices Program Steps K H KnX KnY KnM KnS T C D E F DCLLM: 17 steps * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Feedback source device output S2: Target number of feedbacks S3: Target frequency of D: Pulse output device Explanations: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 4. D can only designate Y0 (Direction signal output: Y1) or Y2 (Direction signal output: Y3). The direction signal output will be OFF only when the drive contact of the instruction is OFF, i.e. completion of pulse output will not reset Y1 or Y3. 5. D1340 and D1352 stores the start/end frequencies of CH0 and CH1. Min. 6Hz, default: 100Hz. 6. D1343 and D1353 stores the ramp up/down time of CH0 and CH1.
3. Instruction Set Frequency High speed counter receives target number of feedbacks or External interrupt occurs Target frequency Start/end frequency Time Pulse Number Ramp-up time High speed time Ramp-down time Idle time Number of output pulses = target number of feedbacks x D1131(D1132) / 100 3. Principles for adjusting the completion time of positioning: a) The completion time of positioning refers to the total time of “ramp up + high speed + ramp down + idle” (see the figure above).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g EI M1002 MOV K100 D1131 MOV K100 D1340 D1343 MOV K100 D1343 MOV K100 D1348 SET M1534 DMOV K0 DCLLM X4 D1030 M0 K50000 K100000 Y0 FEND M1000 INC I401 D0 IRET END 2.
3. Instruction Set EI M1002 MOV K100 D1131 MOV K200 D1340 MOV K300 D1343 MOV K600 D1348 SET M1534 DMOV K0 D1030 DMOV K0 C243 DCNT C243 K9999 M0 DHSCS K50000 DCLLM C243 C243 I010 K50000 K100000 Y0 FEND M1000 INC I010 D0 IRET END 2. Assume the first execution results are as below: Frequency 100KHz C243 =K50000 Y0 stops output D1340 Time Pulse number D1343 D1348 6s Specified number of output pulses: 50,000 Actual number of output pulses (D1030, D1031) = K50,600 3.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g Frequency C243 =K50000 Y0 output stops 100KHz D1340 Time Pulse number D1343 D1348 600ms Specified number of output pulses: 50,500 Actual number of output pulses (D1030, D1031) = K50,560 5. Observe the results of the second execution: a) The actual output number 50,560 – specified output number 50,500 = 60 b) 60 x (1/100Hz) = 600ms (idle time) c) 600ms is an appropriate value.
3. Instruction Set reset after CH0 (Y0, Y1) pulse output is completed. M1524 Auto-reset CH1 (Y2, Y3) when high speed pulse output completed. M524 will be reset after CH1 (Y2, Y3) pulse output is completed. M1534 Enable ramp-down time setting on Y0. Has to be used with D1348 M1535 Enable ramp-down time setting on Y2. Has to be used with D1349 2. Special registers: D1026: Pulse number for masking Y0 when M1156 = ON (Low word). The function is disabled when set value≦0.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 198 D Type OP Operands output Bit Devices S1 S2 S3 D Y Controllers Variable speed pulse VSPO X Function M S Word devices ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F DVSPO: 17 steps * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Target frequency of output frequency S2: Target numb
3. Instruction Set Function Explanations: Pulse output diagram: Freq. t2 t1 t3 Time Pulse number g1 g3 g2 S2 1. Definitions: t1 Æ target frequency of 1st shift t2 Æ target frequency of 2nd shift t3 Æ target frequency of 3rd shift g1 Æ ramp-up time of 1st shift g2 Æ ramp-up time of 2nd shift g3 Æ ramp-down time of 3rd shift S2 Æ total output pulses 2. Explanations on each shift: 1st shift: Assume t1 = 6kHz, gap freqency = 1kHz, gap time = 10ms Ramp-up steps of 1st shift: Freq.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 2nd shift: Assume t2 = 11kHz, internal frequency = 2kHz, gap time = 20ms Ramp-up steps of 2nd shift: Freq. t2=11kHz 1kHz 2kHz 2kHz t1=6kHz Time 20ms 20ms 20ms g2=40ms 3rd shift: Assume t3 = 3kHz, gap frequency = 2kHz, gap time = 20ms Ramp-down steps of 3rd shift: Freq.
3. Instruction Set M1540 2. Indicating pause status of Y2 Special register explanations: D1030 Low word of the present value of Y0 pulse output D1031 High word of the present value of Y0 pulse output D1336 Low word of the present value of Y2 pulse output D1337 High word of the present value of Y2 pulse output D1220 Pulse output mode setting of CH0 (Y0, Y1). Please refer to PLSY instruction. D1221 Pulse output mode setting of CH1 (Y2, Y3).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g API Mnemonic 199 D Type OP Operands ICF Function Controllers Immediately change frequency ES2/EX2 SS2 SA2 SX2 SE Bit Devices X S1 S2 D Y M S Word devices Program Steps K H KnX KnY KnM KnS T C D E F DVSPO: 13 steps * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Target frequency to be changed S2: Gap time and gap frequency D
3. Instruction Set Change target freq. Actual timing of changing Freq. Gap freq. Time Gap Gap time time Delayed by program scan cycle 2. If users change the target frequency by applying DICF instruction in insterupt subroutines, the actual changing timing will be executed immediately with only an approx. 10us delay (execution time of DICF instruction). The timing diagram is as below: Interrupt Actual timing of changing Freq. Gap freq. Gap Gap time time Time approx.10us Program Example: 1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 O p e r a t i o n M a n u a l - P r o g r a m m i n g 1000Hz 800Hz 10ms Freq.
3.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 202 Operands Function Proportional calculation SCAL P Type Bit Devices X OP Y M S S1 S2 S3 D Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F SCAL,SCLAP: 9 steps * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source value S2: Slope (unit: 0.
3. Instruction Set Program Example 1: 1. Assume S1 = 500, S2 = 168 and S3 = -4. When X0 = ON, SCAL instruction executes and the result of proportional calculation will be stored in D0. 2. Equation: D0 = (500 × 168 ) ÷ 1000 + (-4) = 80 X0 SCAL K500 K168 K-4 D0 Destination value D Offset=-4 Slope=168 Source value 0 1= 500 Program Example 2: 1. Assume S1 = 500, S2 = -168 and S3 = 534. When X0 = ON, SCAL instruction executes and the result of proportional calculation will be stored in D10.. 2.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 203 Operands Function Parameter proportional calculation D SCLP P Type Bit Devices X OP Y Controllers M S S1 S2 D ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F SCLP, SCLPP: 7 steps * * DSCLP, DSCLPP: 13 * * * steps PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source value S2: P
3. Instruction Set 6. Substitute the above parameters into y = kx + b and the operation instruction can be obtained. y = kx + b = D = k S1 + b = slope × S1 + offset = slope × S1 + min. destination value – min. source value × slope = slope × (S1 – min. source value) + min. destination value = (S1 – min. source value) × (max. destination value – min. destination value) ÷ (max. source value – min. source value) + min. destination value 7. If S1 > max. source value, S1 will be set as max. source value.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g Destination value = 500 D = 30 S 1 =500 Source value 0 Program Example 2: 1. Assume source value S1 = 500, max. source value D0 = 3000, min. source value D1 = 200, max. destination value D2 = 30, and min. destination value D3 = 500. When X0 = ON, SCLP instruction executes and the result of proportional calculation will be stored in D10. 2.
3. Instruction Set Program Example 3: 1. Assume the source value S1, D100 = F500, max. source value D0 = F3000, min. source value D2 = F200, max. destination value D4 = F500, and min. destination value D6 = F30. When X0 = ON, M1162 is set up to adopt floating point operation. DSCLP instruction executes and the result of proportional calculation will be stored in D10. 2. Equation: D10 = [(F500 – F200) × (F500 – F30)] ÷ (F3000 – F200) + F30 = F80.35. Round off the result into an integer, D10 = F80.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic CMPT 205 Type Operands X Y Controllers ES2/EX2 SS2 SA2 SX2 SE Compare table P Bit Devices OP Function M S S1 S2 n D Word devices Program Steps K H KnX KnY KnM KnS T C D E F CMPT: 9 steps * * * CMPTP: 9 steps * * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device 1 S2: Source device 2 n
3. Instruction Set 9. The 16-bit comparison values used in the 16-bit instruction are signed values. The comparison values used in the 32-bit instruction are 32-bit signed values (M1162=OFF), or floating-point numbers (M1162=ON). 10. The 16-bit data or 32-bit data is written into D. If the data length is less than 16 bits or 32 bits, the bit which does not have a corresponding value is 0. For example, if n is K8, bit0~7 have corresponding values, and bit15~31 are 0. 11.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 206 Operands Function ASDA servo drive R/W ASDRW Type OP Bit Devices X Y Controllers ES2/EX2 SS2 SA2 SX2 SE M S1 S2 S S Word devices Program Steps K H KnX KnY KnM KnS T C D E F ASDRW: 7 steps * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Address of servo drive (K0~K254) S2: Function code S: Register for
3. Instruction Set For A2-type only Code Function K16(H10) Status monitor Parameter Com. Addr. Read/Write data (Settings) P0-09 ~ P0-13 0012H ~ 001BH S+0 ~ S+9: Please refer to (Read) explanations in ASDA-A2 manual. K17(H11) Status monitor P0-17 ~ P0-21 0022H ~ 002BH S+0 ~ S+9: Please refer to selection (Write) explanations in ASDA-A2 manual. K18(H12) Mapping P0-25 ~ P0-32 0032H ~ 0041H S+0 ~ S+15: Please refer to parameter (Write) explanations in ASDA-A2 manual.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g M1002 MOV H87 SET M1120 MOV K100 RST M1143 SET M1122 ASDRW K1 X0 D1120 Set communication protocol as 9600,8,E,1 Retain communication setting D1129 Set time-out value as 100ms Set up in ASCII mode SET M1143 Sending request X0 K0 D0 Data Register Function Code: K0 Monitor ASDA status M1127 ASDA address: K1 Processing received data ASCII mode: Store the received data into specifie
3.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 207 Operands OP S S1 D Bit Devices X * Controllers Catch speed and proportional output CSFO Type Function Y M S Word devices ES2 EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F CSFO: 7 steps * * PULSE 16-bit 32-bit ES2/ ES2/ ES2/ SS2 SA2 SX2 SE SS2 SA2 SX2 SE SS2 SA2 SX2 SE EX2 EX2 EX2 Operands: S: Source device of signal input (Only X0~X3 are available) i
3. Instruction Set 6. S1 +0 specifies the sampling times. The set value of sampling times is recommended to be bigger when the input speed increases, so as to achieve a higher accuracy for speed catching. For example, set S1 +0 as K1 for the speed range 1Hz~1KHz, K10 for the speed range 10Hz~10KHz, K100 for the speed range 100Hz~10KHz. For single phase input, the max frequency is 10kHz; for 2-phase 2 inputs, the max frequency is 2kHz. 7. D occupies 3 consecutive 16-bit registers.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 215~ D 217 Type OP Operands LD# Function Controllers Contact Type Logic Operation ES2/EX2 SS2 SA2 SX2 SE Bit Devices X Y M Word devices S S1 S2 Program Steps K H KnX KnY KnM KnS T C D E F LD#: 5 steps * * * * * * * * * * * DLD#: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device
3. Instruction Set API Mnemonic 218~ D 220 Type OP Operands Function Serial Type Logic Operation AND# Bit Devices X Controllers Y M ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F AND#: 5 steps * * * * * * * * * * * DAND#: 9 steps * * * * * * * * * * * S1 S2 PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Source device 1 S2: Source device 2 Explanation: 1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g Mnemonic API 221~ D 223 Type OP Operands Function Parallel Type Logic Operation OR# Bit Devices X Y M S S1 S2 Controllers ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F OR#: 5 steps * * * * * * * * * * * DOR#: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device 1
3. Instruction Set API Mnemonic 224~ D 230 Type Function LD※ Controllers ES2/EX2 SS2 SA2 SX2 SE Contact Type Comparison Bit Devices X OP Operands Y M S S1 S2 Word devices Program Steps K H KnX KnY KnM KnS T C D E F LD※: 5 steps * * * * * * * * * * * * * * * * * * * * * DLD※: 9 steps * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Source device 1 S2: Source device 2 Explanations: 1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 232~ D 238 Type OP Operands AND※ Controllers ES2/EX2 SS2 SA2 SX2 SE Serial Type Comparison Bit Devices X Function Y M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F AND※: 5 steps * * * * * * * * * * * DAND※: 9 steps * * * * * * * * * * * S1 S2 PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device 1
3. Instruction Set API Mnemonic 240~ D 246 Operands OR※ Type X Controllers ES2/EX2 SS2 SA2 SX2 SE Parallel Type Comparison Bit Devices OP Function Y M S S1 S2 Word devices Program Steps K H KnX KnY KnM KnS T C D E F OR※: 5 steps * * * * * * * * * * * DOR※: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Source device 1 S2: Source device 2 Explanations: 1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 266 D Type OP Operands Function Output Specified Bit of a Word BOUT Bit Devices X Controllers Y M ES2/EX2 SS2 SA2 SX2 SE Word devices S Program Steps K H KnX KnY KnM KnS T C D E F BOUT: 5 steps * * * * * * DBOUT: 9 steps * * * * * * * * * * * D n PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: D: Destination output device
3. Instruction Set API Mnemonic 267 D Type OP Operands BSET Y Controllers Set ON Specified Bit of a Word Bit Devices X Function M S D n Word devices ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F BSET: 5 steps * * * * * * DBSET: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: D: Destination device to be Set ON n: Device specifying the bit to be Set ON Explanations: 1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 268 D Operands OP Bit Devices X Y Controllers Reset Specified Bit of a Word BRST Type Function M S D n ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F BRST: 5 steps * * * * * * DBRST: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: D: Destination device to be
3. Instruction Set API Mnemonic 269 D Type OP Operands BLD Function Controllers Load NO Contact by Specified Bit ES2/EX2 SS2 SA2 SX2 SE Bit Devices X Y M S S n Word devices Program Steps K H KnX KnY KnM KnS T C D E F BLD: 5 steps * * * * * * DBLD: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S: Reference source device n: Reference bit Explanations: 1. For ES2/EX2 models, only V1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 270 D Type OP Operands BLDI Bit Devices X Y M Function Controllers Load NC Contact by Specified Bit ES2/EX2 SS2 SA2 SX2 SE Word devices S S n Program Steps K H KnX KnY KnM KnS T C D E F BLDI: 5 steps * * * * * * DBLDI: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Reference source device
3. Instruction Set API Mnemonic 271 D Type OP Operands BAND Bit Devices X Y M S S n Function Controllers Connect NO Contact in Series by Specified Bit ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F BAND: 5 steps * * * * * * DBAND: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S: Reference source device n: Reference bit Explanations: 1. For ES2/EX2 models, only V1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 272 D BANI Type OP Operands Function Controllers Connect NC Contact in Series by Specified Bit ES2/EX2 SS2 SA2 SX2 SE Bit Devices X Y M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F BANI: 5 steps * * * * * * DBANI: 9 steps * * * * * * * * * * * S n PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Reference
3. Instruction Set API Mnemonic 273 D Type OP Operands Bit Devices Y Controllers ES2/EX2 SS2 SA2 SX2 SE Connect NO Contact in Parallel by Specified Bit BOR X Function M Word devices S S n Program Steps K H KnX KnY KnM KnS T C D E F BOR: 5 steps * * * * * * DBOR: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S: Reference source device n: Reference bit Explanations: 1. For ES2/EX2 models, only V1.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 274 D Type OP Operands Bit Devices Y Controllers Connect NC Contact in Parallel by Specified Bit BORI X Function M Word devices S S n ES2/EX2 SS2 SA2 SX2 SE Program Steps K H KnX KnY KnM KnS T C D E F BORI: 5 steps * * * * * * DBORI: 9 steps * * * * * * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S: Referenc
3. Instruction Set API Mnemonic 275~ 280 Operands Function Floating Point Contact Type Comparison LD※ FLD※ Type Bit Devices OP X Controllers Y M S S1 S2 ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F FLD※: 9 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device 1 S2: Source device 2 Explanations: 1. This instruction compares the content in S1 and S2.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g API Mnemonic 281~ 286 Operands Function Floating Point Contact Type Comparison AND※ FAND※ Type OP Bit Devices X Controllers ES2/EX2 SS2 SA2 SX2 SE Y M Word devices S Program Steps K H KnX KnY KnM KnS T C D E F FAND※: 9 steps * * * * * * S1 S2 PULSE 16-bit 32-bit SA2 SA2 SA2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE Operands: S1: Source device 1 S2: Source device 2 Expla
3. Instruction Set API Mnemonic 287~ 292 Operands Bit Devices OP X Controllers Floating Point Contact Type Comparison OR※ FOR※ Type Function Y M S S1 S2 ES2/EX2 SS2 SA2 SX2 SE Word devices Program Steps K H KnX KnY KnM KnS T C D E F FOR※: 9 steps * * * * * * PULSE 16-bit 32-bit SA2 SA2 SA2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE ES2/EX2 SS2 Operands: S1: Source device 1 S2: Source device 2 Explanations: 1. This instruction compares the content in S1 and S2.
D V P - E S 2 / S X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l – P r o g r a m m i n g MEMO 3-486
Communications This chapter introduces information regarding the communications ports of the PLC. Through this chapter, the user can obtain a full understanding about PLC communication ports. Chapter Contents 4.1 Communication Ports ........................................................................................................4-2 4.2 Communication Protocol ASCII mode..............................................................................4-3 4.2.1 ADR (Communication Address) ..............
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4.1 Communication Ports DVP-ES2/EX2/SA2/SE/SX2 offers 3 communication ports (COM1~COM3), and DVP-SS2 offers 2 COM ports (COM1~COM2). COM ports of the above models support DELTA Q-link communication format on HMI. Refresh rate of HMI can be increased by this function. COM1: RS-232 communication port. COM1 can be used as master or slave and is the major COM port for PLC programming.
4. Communications − − − − 4.2 7 data bits 1 stop bit Even parity Baud rate: 9600 Communication Protocol ASCII mode Communication Data Structure 9600 (Baud rate), 7 (data bits), Even (Parity), 1 (Start bit), 1 (Stop bit) Field name Content Explanation Start bit STX Communication address ADR 1 Command code Start bit ‘:’ (3AH) Address consists of 2 ASCII codes ADR 0 CMD 1 Command code consists of 2 ASCII codes CMD 0 DATA (0) DATA (1) Data Data content consist of 2n ASCII codes, n≤205 ……….
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Available setting for command code: CMD(Hex) Explanation Device 01 (01 H) Read status of contact S, Y, M, T, C 02 (02 H) Read status of contact S, X, Y, M,T, C 03 (03 H) Read content of register T, C, D 05 (05 H) Force ON/OFF single contact S, Y, M, T, C 06 (06 H) Set content of single register T, C, D 15 (0F H) Force ON/OFF multiple contacts S, Y, M, T, C 16 (10 H) Set content of
4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Exception response: The PLC is expected to return a normal response after receiving command messages from the master device. The following table depicts the conditions that either a no response or an error response is replied to the master device. 1. The PLC did not receive a valid message due to a communication error; thus the PLC has no response.
4. Communications Exception code: 4.3 Explanation: 01 Illegal command code: The command code received in the command message is invalid for PLC. 02 Illegal device address: The device address received in the command message is invalid for PLC. 03 Illegal device content: The data received in the command message is invalid for PLC. 07 1. Checksum Error - Check if the checksum is correct 2. Illegal command messages - The command message is too short. - Length command message is out of range.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4.3.2 CMD (Command code) and DATA The content of access data depends on the command code. For descriptions of available command codes, please refer to 4.2.2 in this chapter. Example: read consecutive 8 words from address 0614H~H61B (T20~T27) of PLC Slave ID#1.
4. Communications Field Name Example (Hex) Data Lo (T24) 05 Data Hi (T25) 00 Data Lo (T25) 06 Data Hi (T26) 00 Data Lo (T26) 07 Data Hi (T27) 00 Data Lo (T27) 08 CRC CHK Low 72 CRC CHK High 98 No data input ≥ 10 ms END 4.3.3 CRC CHK (check sum) The CRC Check starts from “Slave Address” and ends in “The last data content.” Calculation of CRC: Step 1: Set the 16-bit register (CRC register) = FFFFH.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g { reg_crc ^= *data++; for (j=0;j<8;j++) { If (reg_crc & 0x01) reg_crc=(reg_crc>>1) ^ 0Xa001; /* LSB(b0)=1 */ else reg_crc=reg_crc >>1; } } return reg_crc; // the value that sent back to the CRC register finally } Exception response: The PLC is expected to return a normal response after receiving command messages from the master device.
4. Communications Feedback message: Field Name Example (Hex) No data input ≥ 10 ms START Slave Address 01 Function 81 Exception Code 02 CRC CHK Low C1 CRC CHK High 91 No data input ≥ 10 ms END 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Device Range Effective Range SA2/SE ES2/EX2 SS2 SX2 200~255 D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D 4-12 000~255 256~511 512~767 768~1023 1024~1279 1280~1535 1536~1791 1792~2047 2048~2303 2304~2559 2560~2815 2816~3071 3072~3327 3328~3583 3584~3839 3840~4095 4096~4351 4352~4999 4608~4863 4864~5119 5120~5375 5376~5631 5632~5887 5888~6143 6144~6399 6400~6655 6
4. Communications 4.5 Command Code 4.5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4.5.
4. Communications 4.5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Field Name ASCII Data Hi (T26) 00 Data Lo (T26) 07 Data Hi (T27) 00 Data Lo (T27) 08 Error Check (LRC) C8 END 1 0D (Hex) END 0 0A (Hex) 4.5.4 Command Code: 05, Force ON/OFF single contact The Force data FF00 (Hex) indicates force ON the contact. The Force data 0000 (Hex) indicates force OFF the contact.
4. Communications Field Name ASCII Force Data Lo 00 Error Check (LRC) F6 END 1 0D (Hex) END 0 0A (Hex) 4.5.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4.5.6 Command Code: 15, Force ON/OFF multiple contacts Max contacts/coils available for Force ON/OFF: 255 Example: Set Coil Y007…Y000 = 1100 1101, Y011…Y010 = 01.
4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g MEMO 4-20
Sequential Function Chart This chapter provides information for programming in SFC mode. Chapter Contents 5.1 Step Ladder Instruction [STL], [RET] ...............................................................................5-2 5.2 Sequential Function Chart (SFC) ......................................................................................5-2 5.3 The Operation of STL Program .........................................................................................5-4 5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 5.1 Step Ladder Instruction [STL], [RET] Mnemonic Operands STL S0~S1023 Function Program steps Starts STL program 1 Controllers ES2/EX2 SS2 SA2 SX2 Explanation: STL Sn constructs a step point. When STL instruction appears in the program, the main program will enter a step ladder status controlled by steps. The initial STL program has to start from S0 ~ S9 as initial step points. The No.
5. Sequential Function Chart action and the transition from one step to another generally requires some transition criteria (condition). The action of the previous step finishes as long as all criteria is true. When next step begins, the action of previous step will be cleared. The step-by-step transition process is the concept for designing sequential function chart (SFC). Features: 1.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Step jump. Used for a step to jump to another non-adjacent step. (Jumping up/down to non-adjacent steps in the same sequence, returning to initial step, or jumping among different sequences.) Transition condition. The transition condition to move between each step point. Alternative divergence.
5. Sequential Function Chart Actions of Step Points: STL program is composed of many step points, and each step point represents a single task in the STL control process. To perform a sequential control result, every step point needs to do 3 actions. 1. Drive output coils 2. Designate the transition condition 3. Designate which step will take over the control from the current step Example: S10 S S10 S Y0 SET Y1 SET S20 X0 S20 S When X0 = ON, S20 = ON, S10 = OFF.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g of output coils should be avoided. The No. of output coil used by a step should also avoid being used when the step ladder diagram returns to a general ladder diagram. Repeated usage of timer: See the opposite diagram. Timers can only be used repeatedly in non-adjacent steps.
5. Sequential Function Chart c Returning to SFC: the initial OUT Ladder diagram: S0 S S21 S21 S step in the same Jump to another step of step S0 sequence. Using OUT S24 X2 S24 X2 d Jumping S23 S up/down to S24 non-adjacent steps in the S24 S S25 S OUT S25 same Return to initial step Using OUT S0 X7 X7 S0 S25 returns to the initial step S0 by using OUT. sequence. e Driving steps RET SFC: Ladder diagram: Drive the step in different sequence in different OUT sequences.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g STL diagram. However, there are restrictions on some of the instructions. Care should be taken when using the instructions listed in the table below.
5. Sequential Function Chart S10 S S10 S Y0 SET Y1 S20 SET Y1 S20 S 2. Y0 S20 S Y2 S20 Y2 As indicated in the below diagram, make sure to connect RET instruction directly after the step point rather than the NO or NC contact. S20 S X1 S0 RET S20 S X1 S0 RET 5.4 1. Points to Note for Designing a Step Ladder Program The first step in the SFC is called the “initial step", S0 ~ S9. Use the initial step as the start of a sequence and ends with RET instruction. 2.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 6. 7. 8. Restrictions on diverging sequence: Please refer to section 5.5 for examples a) Max. 8 step points could be used for single divergence sequence. b) Max. 16 step points could be used for the convergence of multiple diverted sequences. c) Users can assign a step in the sequence to jump to any step in another sequence.
5. Sequential Function Chart 5.5 Types of Sequences Single Sequence: The basic type of sequence The first step in a step ladder diagram is called initial step, ranged as S0 ~ S9. The steps following the initial step are general steps numbered as S10 ~ S1023. When IST instruction is applied, S10 ~ S19 will become the steps for zero return operation. 1. Single Sequence without Divergence and Convergence After a sequence is completed, the control power on the steps will be transferred to the initial step.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 2. Step Jump a) The control power over the step is transferred to a certain step on top. OUT S0 S21 OUT S42 S43 b) The control power over the step is transferred to the step in another sequence. OUT S0 OUT S21 S41 OUT S41 3. S1 S42 S43 Reset Sequence As the opposite diagram indicates, S50 will reset itself S0 when the transition condition is fulfilled and the sequence ends here.
5. Sequential Function Chart Ladder diagram of simultaneous divergence: S20 S X0 SET S21 SET S22 SET S23 SET S24 SFC diagram of simultaneous divergence: S20 S21 2. S22 S23 S24 Structure of Alternative Divergence When the individual condition at the current status is true, the step will be transferred to another individual step. For example, when X0 = ON, S20 will be transferred to S30; when X1 = ON, S20 will be transferred to S31; when X2 = ON, S20 will be transferred to S32.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g In simultaneous convergence, only when all sequences are completed will the transfer be allowed. Ladder diagram of simultaneous convergence: S40 S S41 S S42 S X2 SET S50 SFC diagram of simultaneous convergence: S40 S41 S42 X2 S50 4. Structure of Alternative Convergence The following ladder explains the structure of alternative convergence.
5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Example of simultaneous divergence & simultaneous convergence: Step Ladder Diagram: SFC Diagram: M1002 ZRST S0 SET S3 SET S20 S127 M1002 S3 S3 S X0 X0 S20 S S20 Y0 X1 Y0 X1 SET S30 S30 Y1 S30 S SET S31 SET S32 S40 S50 Y1 S40 S60 X6 Y2 S31 S S3 Y3 X3 SET S41 S S32 S S41 Y4 Y5 X4 SET S42 S S40 S S42 Y6 S41 S S50 S S42 S X5 SET S50 TMR T1 K10 SET S60 T1 S60
5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Combination example 1: (Includes alternative divergence/convergence and simultaneous divergence/convergence) Step Ladder Diagram: M1002 ZRST S0 S127 S51 S Y20 X22 SET S0 S Y0 X0 SET S20 S SET S0 S20 S61 S S60 S SET SET S0 S31 S32 S SET SET S32 S41 S Y2 SET Y6 S40 Y3 X5 SET S40 SET S50 SET S51 X21 Y23 S52 SET S53 Y21 X23 S62 S S53 S S60 Y22 X24 S63 S S62 S Y26 S63 X2
5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Combination example 2: (Includes alternative divergence/convergence and simultaneous divergence/convergence) Step Ladder Diagram: SFC Diagram: M1002 S0 S ZRST S0 SET S0 S127 X0 M1002 S0 X0 SET S30 S S30 Y0 S30 Y0 X1 X1 X1 SET S31 SET S32 X1 S31 S Y1 SET S33 Y2 SET Y4 X5 S36 Y6 S37 Y7 X6 S35 Y3 Y3 X4 S34 S33 Y2 X3 X3 S33 S S32 Y1 X2 S33 X2 S32 S S31 Y5 X4 S
5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 5.
5. Sequential Function Chart “manual operation mode”, S1 initiates “zero return mode” and S2 initiates “auto mode”. Thus, the three step points of initial state have to be programmed in first priority. 3. When S1 (zero return mode) is initialized, i.e. selected, zero return will NOT be executed if any of the state S10~S19 is ON. 4. When S2 (auto mode) is initialized, i.e. selected, auto mode will NOT be executed if M1043 = ON or any of the state between D1 to D2 I is ON.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 5. Control panel Power ON Auto ON Zero return X35 Auto OFF X37 Power OFF Clip balls Ascend Right Shift X20 X22 X24 Left Release balls Descend shift X21 X23 X36 X25 Step X32 One cycle operation X33 Zero return X31 Continuous operation X34 Manual operation X30 a) X0: ball size sensor.
5. Sequential Function Chart 8.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 9.
5.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g MEMO 5-28
Troubleshooting This chapter offers error code table and information for troubleshooting during PLC operation. Chapter Contents 6.1 Common Problems and Solutions.......................................................................................... 6-2 6.2 Error code Table (Hex) ............................................................................................................. 6-4 6.3 Error Detection Devices..................................................................................
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 6.1 Common Problems and Solutions The following tables list some common problems and troubleshooting procedures for the PLC system in the event of faulty operation. System Operation Symptom All LEDs are OFF Troubleshooting and Corrective Actions 1. 2. Check the power supply wiring. Check If the power supplied to the PLC control units is in the range of the rating. 3.
6 . Tr o u b l e s h o o t i n g Symptom Diagnosing Input Malfunction Troubleshooting and Corrective Actions When input indicator LEDs are OFF, 1. Check the wiring of the input devices. 2. Check that the power is properly supplied to the input terminals. 3. If the power is properly supplied to the input terminal, there is probably an abnormality in the PLC’s input circuit. Please contact your dealer. 4.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 6.2 Error code Table (Hex) After you write the program into the PLC, the illegal use of operands (devices) or incorrect syntax in the program will result in flashing of ERROR indicator and M1004 = ON. In this case, you can find out the cause of the error by checking the error code (hex) in special register D1004. The address where the error occurs is stored in the data register D1137.
6 .
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Error code 6.3 Description C40B MC / MCR does not begin from N0 or discontinuously C40C MC / MCR corresponding value N is different C40D Use I / P incorrectly C40E IRET doesn’t follow by the last FEND instruction SRET doesn’t follow by the last FEND instruction A circuit error occurs if a combination of instructions is incorrectly specified.
CANopen Function and Operation This chapter explains the functions of CANopen and the usage. Chapter Contents 7.1 The Introduction of CANopen ..............................................................................................7-2 7.1.1 The Description of the CANopen Functions ...............................................................7-2 7.1.2 The Input/Output Mapping Areas ...............................................................................7-3 7.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 7.1 The Introduction of CANopen ¾ Due to the simple wiring, immediate communication, strong debugging ability, stable communication, and low cost, the CANopen network is widely used in fields such as industrial automation, automotive industry, medical equipment industry, and building trade.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Storage 64-bit Data type LINT ULINT LREAL LWORD ¾ If the CAN port functions as a slave, it has the following functions. It supports the standard CANopen protocol DS301 V4.02. It supports the NMT (network management object) service. It supports the NMT state control. The state of DVP-ES2-C in the CANopen network is controlled by a master. It supports the NMT error control. Heartbeat is supported, but Node Guarding is not supported.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 7.2.2 The Profile 7.2.3 The CAN Interface and the Network Topology ¾ The pins of COM3 (CAN interface) Pin Description Wh i te ( CA N_ H) B l u e ( CA N_ L ) CAN+ CAN-H CAN- CAN-L SG Signal ground CA N+ CA NSG B l a ck( S G ) D+ D- Tighten it with a slotted screwdriver. ¾ The CAN signal and the data frame format The CAN signal is a differential signal.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n ¾ The CAN network endpoint and the topology structure In order to make the CAN communication more stable, the two endpoints of the CAN network are connected to 120 ohm terminal resistors. The topology structure of the CAN network is illustrated below.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 1) Users should use standard Delta cables when creating the CANopen network. These cables are the thick cable TAP-CB01, the thin cable TAP-CB02, and the thin cable TAP-CB10. The communication cables should be away from the power cables. 2) TAP-TR01. CAN+ and CAN-, which are at the endpoints of the network, should be connected to 120 ohm resistors.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Product Model Function ASD-A2-xxxx-M servo driver It is a servo driver with the built-in CANopen interface. It controls the positioning, speed, and torque. C2000/CP2000/C200 series AC motor drives It is an AC motor drive with the built-in CANopen function, and controls the positioning, speed, and torque. Before using the CANopne function of the C2000/CP2000 series AC motor drives, users need to purchase CMC-COP01.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Product Model TAP-CN03 It is the CANopen network topology distribution box which carries a 120 ohm resistor. Users can enable the resistor through the switch. TAP-CBO3 TAP-CBO5 TAP-CB10 TAP-CB20 CANopen sub cable with RJ45 connectors at both ends. TAP-CBO3: 0.3 meters TAP-CBO5:0.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Device profile CiA DSP-401 Device profile CiA DSP-404 Device profile CiA DSP-xxx OSI seventh layer Communication profile CiA DS-301 Application layer OSI second layer CAN controller CAN 2.0A Data link layer OSI first layer Physical layer + + - ISO 11898 CAN network ¾ The object dictionary CANopen uses an object-based way to define a standard device. Every device is represented by a set of objects, and can be visited by the network.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g receive PDOs are called PDO consumers. The PDO is described by means of the “producer/consumer mode”. The data is transmitted from one producer to one or many consumers. The data which can be transmitted are limited to 1-byte data to 8-byte data. After the data is transmitted by the producer, the consumer does not need to reply to the data.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n The data format for RxPDO and TxPDO is as follows. COB-ID Byte 0 Byte 1 Byte 2 Byte 3 Object identifier Byte 4 Byte 5 Byte 6 Byte 7 Data ¾ SDO (service data object) The SDO is used to build the client/server relation between two CANopen devices. The client device can read the data from the object dictionary of the server device, and write the data into the object dictionary of the server device.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Reply code (hex) Description 80 Stopping the SDO function ¾ NMT (network management object) The CANopen network management conforms to the “master/slave” mode. Only one NMT master exists in the CANopen network, and other nodes are considered slaves. NMT realized three services. They are module control services, error control services, and boot-up services.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Initialization Pre-operational Operational X X X X X EMCY Boot-up NMT Stopped X The format of the control message for the node state: COB-ID Byte 0 Byte 1 0 Command specifier (CS) Slave address (0: Broadcast) The command specifiers are listed below.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Boot-up services After the slave completes the initialization and enters the pre-operational state, it transmits the Boot-up message. ¾ Other predefined CANopen communication objects (SYNC and EMCY) SYNC Object (Synchronous object) The synchronous object is the message broadcasted periodically by the master node in the CANopen network. This object is used to realize the network clock signal.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n ¾ The corresponding object in the predefined connection set Object Function code COB-ID Emergency PDO1 (TX) PDO1 (RX) PDO2 (TX) PDO2 (RX) PDO3 (TX) PDO3 (RX) PDO4 (TX) PDO4 (RX) SDO (TX) SDO (RX) NMT Error Control 0001 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 129 (81h)–255 (FFh) 385 (181h)–511 (1FFh) 513 (201h)–639 (27Fh) 641 (281h)–767 (2FFh) 769 (301h)–895 (37Fh) 879 (381h)–1023 (3FFh) 1025 (401h)–1151 (47Fh) 1153 (481h)–1279 (4FFh) 128
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Request message PLC device High byte D6257 ~ D6281 Low byte Reserved Command: Fixed to “01”. ReqID: The request ID. Whenever an SDO request message is sent out, the message will be given a ReqID for CANopen master to identify. When reading/writing another SDO message, the original ID number must be changed. In other words, to read/write SDO is triggered by changing of the value of “ReqID”.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Type: In SDO response message, 43 (Hex) refers to reading 4 bytes of data; 4B (Hex) refers to reading 2 bytes of data; 4F (Hex) refers to reading 1 byte of data; 60 (Hex) refers to writing 1/2/4 byte(s) of data; 80 (Hex) refers to stopping SDO command. Example 1: Write 010203E8 (hex) to (Index_subindex) 2109_0 of slave of No. 3 through SDO and the data type of (Index_subindex) 2109_0 is double words (32 bits).
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Response data: Response message PLC device High byte(Hex) D6000 Low byte(Hex) ResID =01 Command =01 Reserved =0 Size =8 D6002 Type =43 Node ID =03 D6003 Main index high byte =21 Main index low byte =09 Reserved =0 Subindex =0 Datum 1=03 Datum 0=E8 Datum 3=01 Datum 2=02 Message Header D6001 D6004 Message data D6005 D6006 7.4.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n equal to1, it indicates that NMT operation fails and in the meantime, you should check if the data in NMT request message are correct. Node ID: The node address of the target equipment on CANopen network. Example 1: Stop slave of No.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Response message PLC device High byte(Hex) Low byte(Hex) D6004 Datum 1 Datum 0 D6005 Datum 3 Datum 2 D6006 Datum 5 Datum 4 D6007 Datum 7 Datum 6 D6008 ~ D6011 Emergency2 D6012 ~ D6015 Emergency3 D6016 ~ D6019 Emergency4 D6020~ D6023 Emergency5 D6024~ D6031 Reserved Command: Fixed to 01(Hex). When status code is 1, it indicates that reading Emergency message succeeds.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Emergency response data Response message PLC device High byte Low byte ReqID=01 Status code =01 Reserved =0 Size =2A (Hex) D6002 Type =04 Node ID =02 D6003 Total number of data =1 Number of data stored =1 D6004 Datum 1=54 Datum 0=42 D6005 Datum 3=15 Datum 2=20 Datum 5=0 Datum 4=0 Datum 7=0 Datum 6=0 D6004 Datum 1=54 Datum 0=43 D6005 Datum 3=14 Datum 2=20 D6006 Datum 5=0 Datum 4=0 D6007 Datum 7=0 Datum 6=0 D6000 D6
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ¾ Explanation of Request Message Devices: PLC device SDO request message mapping area Content (Hex) Explanation High byte(Hex) D6250 0101 ReqID = 01 Command = 01 D6251 0004 Reserved Size = 04 D6252 0102 Type = 01 Node ID = 02 D6253 2009 Index high byte = 20 Index low byte = 09 D6254 0000 Reserved Subindex = 00 ¾ Editing the Ladder Diagram through WPLsoft 7-22 Low byte(Hex)
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n ¾ When M0=ON, DVP-ES2-C sends out the first request message and D6000 should be 101(hex) after the response message is transmitted back successfully. In program, if the value of D6000 is judged as 101(hex), the ReqID is changed into 2 and D6250 is given a new value 201(hex) and DVP-ES2-C sends out the request message again. By dong so, the real-time reading can be realized.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g LED indicator ¾ Description How to deal with The red light flashes. There are syntax error existing in the program written to PLC or the PLC device or instruction is out of the allowed range. Judge the error cause according to the content value of the special register D1004 in PLC; find the program error position according to the content value of D1137.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n D9998 can be used for monitoring the state of nodes from 1 to 16 in the network. And the 16 bits of D9998 corresponds to 16 slaves and the corresponding relations of them are shown below.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Code E8 ¾ Set the node ID of master and slave again and ensure their node IDs are sole. Indication How to correct F1 Slave has not been added to node list of CANopen Builder software Add slave into the node list and then re-download the configured data. F2 The data are being downloaded to DVP-ES2-C Wait to finish downloading the configured data.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Code 7.6 Indication How to correct F4 BUS-OFF state is detected. Check if CANopen bus cables are properly connected and ensure that all the node devices run at the same baud rate before re-powering. FB The sending buffer in DVP-ES2-C is full. Check if the CANopen bus cable is properly connected and then re-power. FC The receiving buffer in DVP-ES2-C is full. Check if the CANopen bus cable is properly connected and then re-power.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g ¾ Parameter Setting 1-01 04 Speed mode 0-17 07 Drive displays the motor rotation speed (r/min) 2-10 101 Set DI1 as the signal for Servo On 2-12 114 Set DI3 and DI4 as the signal for speed selection Setting CANopen Baud Rate and Node ID of DVP-ES2-C DVP-ES2-C uses the default setting values: Node ID: 17 and baud rate: 1Mbps.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Item COM port Address Baud rate Explanation The serial port of computer used for communication with DVP-ES2-C.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 4) Click “Network”> “Master Parameter” and the following “Master configure…” dialog box appears.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n 5) ¾ After the steps above are finished, the download will be performed as the figure shows below. Note: The new parameters after being downloaded will be effective unless DVP-ES2-C is re-powered. Network Scanning: Scan the master and slave on the CANopen network by clicking menu “Network”>>”Online”. The scanned master and slave are displayed on the page below. For detailed operation steps, please refer to Section 11.1.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g “Auto SDO Configuration” Used for doing one write action to the slave parameter via SDO and the write action is finished when the slave enters the operational state from pre-operational state. Up to 20 SDOs can be configured by “Auto SDO configuration”. “PDO Mapping” and “Properties” Used for setting the mapping parameter and transmission type of PDO.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n PDO transmission type can be synchronous transmission and asynchronous transmission. In synchronous transmission, master will send out the SYNC message in the fixed cycle. The length of the cycle is set in master properties dialog box with the default value: 50ms. In asynchronous transmission, the message is sent out once the PDO mapping parameter is changed. PDO Transmission types in details are introduced in the following table.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g 3> After the above setting is finished, double click the master, select ASDA-A2 Drive, and click “>” to move A2 to the right list and download the configured data.
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n 7.
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Index Subindex H’03 -H’00 H’1403 H’01 H’02 H’03 -H’00 H’1404 H’01 H’02 H’03 -H’00 H’1405 H’01 H’02 H’03 -H’00 H’1406 H’01 H’02 H’03 -H’00 H’1407 H’01 H’02 H’03 H’1600 7-36 -- Object name Inhibit time RxPDO4 communication parameter Number of valid subindex COB-ID of RxPDO4 Transmission mode Inhibit time RxPDO5 communication parameter Number of valid subindex COB-ID of RxPDO5 Transmission mode Inhibi
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Index Subindex H’00 H’01 Attribute Default value Unsigned 8 bits RW 4 Unsigned 32 bits RW 0x20000110 The second mapped object Unsigned 32 bits RW 0x20000210 H’02 The third mapped object Unsigned 32 bits RW 0x20000310 H’03 The fourth mapped object Unsigned 32 bits RW 0x20000410 -- RxPDO2 mapping parameter H’00 Number of valid subindex Unsigned 8 bits RW 0 H’01 The first mapped object Unsigned 32 bits RW 0 H’01 The se
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Index Subindex H’01 H’01 H’02 H’03 -H’00 H’01 H’1605 H’01 H’02 H’03 Index Subindex -H’00 H’01 H’1606 H’01 H’02 H’03 -H’00 H’01 H’1607 H’01 H’02 H’03 H’1800 -H’00 H’01 H’02 H’03 7-38 Object name The first mapped object The second mapped object The third mapped object The fourth mapped object RxPDO6 mapping parameter Number of valid subindex The first mapped object The second mapped object The thi
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Index Subindex H’05 -H’00 H’1801 H’01 H’02 H’03 H’05 Index Subindex -H’00 H’1802 H’01 H’02 H’03 H’05 -H’00 H’1803 H’01 H’02 H’03 H’05 -H’00 H’1804 H’01 H’02 H’03 H’05 H’1805 -H’00 H’01 H’02 Object name Timer TxPDO2 communication parameter Number of valid subindex COB-ID of TxPDO2 Transmission mode Inhibit time Timer Object name TxPDO3 communication parameter Number of valid subindex COB-ID of TxPDO3 Transmission mode Inhibit time Timer Tx
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Index Subindex H’03 H’05 -H’00 H’1806 H’01 H’02 H’03 H’05 -H’00 H’1807 H’01 H’02 H’03 H’05 -H’00 H’01 H’1A00 H’02 H’03 H’04 -H’00 H’01 H’1A01 H’02 H’03 H’04 H’1A02 -H’00 H’01 H’02 7-40 Object name Inhibit time Timer TxPDO7 communication parameter Number of valid subindex COB-ID of TxPDO7 Transmission mode Inhibit time Timer TxPDO8 communication parameter Number of valid subindex COB-ID of TxPDO
7 C AN o p e n F u n c t i o n a n d O p e r a t i o n Index Subindex H’03 H’04 -H’00 H’1A03 H’01 H’02 H’03 -H’00 H’01 H’1A04 H’02 H’03 H’04 Index Subindex -H’00 H’01 H’1A05 H’02 H’03 H’04 -H’00 H’01 H’1A06 H’02 H’03 H’04 H’1A07 -- Object name The third mapped object The fourth mapped object TxPDO4 mapping parameter Number of valid subindex The first mapped object The second mapped object The third mapped object TxPDO5 mapping parameter Number of valid subindex The first mapped object The second m
D V P - E S 2 / E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Index Subindex H’00 H’01 H’02 H’03 H’04 7-42 Object name Number of valid subindex The first mapped object The second mapped object The third mapped object The fourth mapped object Data type Attribute Default value Unsigned 8 bits RW 0 Unsigned 32 bits RW 0 Unsigned 32 bits RW 0 Unsigned 32 bits RW 0 Unsigned 32 bits RW 0
Appendix An introduction of installing the USB driver in the PLC Contents A.1 Installing the USB Driver .........................................................................................................
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g A.1 Installing the USB Driver This section introduces the installation of the DELTA PLC USB driver in the computer. After the driver is installed, the USB interface can be used as the serial port (RS-232). Please use the standard USB cable. The length of the cable should be within fiver meters. Installing the driver The personal computer and the PLC are connected through the USB and the mini USB cable.
Ap p e d n d i x A After the driver is installed, users can find the Delta PLC device and the communication port assigned to it in the Device Manger window. The usage of this device is the same as that of RS-232.
D V P - E S 2 E X 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g Select Communication Setting in Options to open the Communication Setting window. Select RS232 in the Connection Setup box, select the communication port assigned by the USB in the Communication Setting box, and click OK. After the communication setting is complete, users can find that RS232 in the communication work area is checked.