Navigation

  • Page 1

  • Page 2

    1-1 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 p...

  • Page 3

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-2 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 Evalu...

  • Page 4

    1. PL C C o ncep ts 1-3PLC 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 instea...

  • Page 5

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-4 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 ...

  • Page 6

    1. PL C C o ncep ts 1-51.5 Ladder Logic Symbols The following table displays list of WPLSoft symbols their description, command, and memory registers that are able to use the symbol. Ladder Diagram Structure Explanation InstructionAvailable Devices NO (Normally Open) contact / A contact LD X,...

  • Page 7

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-6 Ladder Diagram Structure Explanation InstructionAvailable Devices Multiple output branches MPS MRD MPP None Output coil OUT Y, M, S S Step ladder STL S Basic / Application instruction - Basic instructions and API ...

  • Page 8

    1. PL C C o ncep ts 1-7Execution 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 AND blockOR blockLD instructionL...

  • Page 9

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-8 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 instructionOR instructionOR instruction 1.5.7 ORP / ...

  • Page 10

    1. PL C C o ncep ts 1-9Branch instructionBranch Symbol Description MPS ┬ Start of branches. Stores current result of program evaluation. Max. 8 MPS-MPP pairs can be applied MRD ├ Reads the stored current result from previous MPS MPP └ End of branches. Pops (reads then resets) the stored ...

  • Page 11

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-10 eS0S21S22M1002initialpulseM1002SETS0SETS21SS0SETS22SS21SS22S0RET 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. eSS20RETeSS20RET ...

  • Page 12

    1. PL C C o ncep ts 1-111.6 Conversion between Ladder Diagram and Instruction List Mode Ladder Diagram X0X2X1X1M1C0Y0SETS0M2Y0M0X10Y10SETS10S0SX11Y11SETS11S10SSETS12SETS13X12Y12SETS20S11SX13S0RETS20SS12SS13SX0CNTC0K10X1M0C0X1M2RSTC0M1M2END Instruction LD X0OR X1LD X2OR ...

  • Page 13

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-12 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...

  • Page 14

    1. PL C C o ncep ts 1-13 OR operation upward is not allowed. R everse curr ent“Reverse current” exists. 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 ...

  • Page 15

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-14 “Reverse current” exists 1.8 Correcting Ladder Diagram Example 1: Connect the block to the front for omitting ANB instruction because simplified program improves processing speed Instruction List LD X0 LD X1 OR ...

  • Page 16

    1. PL C C o ncep ts 1-15Example 3: “Reverse current” existed in diagram (a) is not allowed for PLC processing principle. Instruction List LD X0 OR X1 AND X2 LD X3 AND X4 X0X1X2X3X4 (a) ORB Instruction List LD X3 AND X4 LD X1 OR X0 AND X2 X0X1X2X3X4 (b) ORB Example 4: For multiple output...

  • Page 17

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-16 Example 5: Correct the circuit of reverse current. The pointed reverse current loops are modified on the right. X0X3X6X1X4X7X2X5X10LOO P1rever se current X0X1X2X3X4X5X10X6X7X5X10LOOP1 Example 6: Correct the circuit of ...

  • Page 18

    1. PL C C o ncep ts 1-17 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 X2Y1X1Y1 Example 3 - Latched circuit of SET and RST X2Y1X1SETY1RSTStop first The...

  • Page 19

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-18 X3Y1X1Y1X4Y2X2Y2Y1Y2 X1X3X2X4Y1Y2 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 w...

  • Page 20

    1. PL C C o ncep ts 1-19The ladder diagram uses two timers to form an oscillating circuit which enables a flashing indicator or a buzzing alarm. n1 and n2 refer to the set values in T1 and T2 and T refers to timer resolution. T2TMRKn2T1X0TMRY1T2T1Kn1X0T1 Y1Tn1X0Tn2 Example 11 - Trigger Circui...

  • Page 21

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-20 . T12TMRKn2T11X0TMRY1T11Kn1T12 Timer = T11, T12 Timer resolution: T The total delay time: (n1+n2)* T. T refers to the timer resolution. X0Y1T11T12n1*n2*TT(n1+n2)* T Example 15 – Counting Range Extension Circuit C6CN...

  • Page 22

    1. PL C C o ncep ts 1-215 SecY0Y1Y2Y20Y21Y22Vertical LightRedYellowGreenHorizontal LightRedYellowGreen5 Sec25 Sec5 Sec5 Sec25 Sec SFC Figure: S0S20S21S22S0M1002T0T1T13Y0S23T2TMRT0K350Y2TMRT1K250Y2TMRT2K50M1013Y1S30S31S32T10T11S33T12Y22TMRT10K250Y21TMRT12K50Y22TMRT11K50M1013Y20TMRT13K350 ...

  • Page 23

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-22 Ladder Diagram: M1002ZRSTS0S127SETS0SETS20Y2ENDS0SS21SY1S23SY22S30ST13S23SS33SSETS30S20STMRT0SETS21T0Y0K350TMRT1SETS22T1K250Y2S22STMRT2SETS23T2K50M1013TMRT10SETS31T10K250Y22S31STMRT11SETS32T11K50M1013Y21S32STMRT12SETS33T...

  • Page 24

    1. PL C C o ncep ts 1-23WPLSoft programming (SFC mode) SFC logic Internal Ladder Logic LAD-0 S0ZRSTS127M1002S0SET Transfer condition 1 TRANS*T0 S22 Y2T2TMRK50M1013 Transfer condition 4 TRANS*T13TRANS*T13TRANS*T13TRANS*T13TRANS*T13TRANS*T13TRANS*T13 02345671LAD-0S0S20S21S22S23S30S31S32S33S0 Tra...

  • Page 25

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 1-24 MEMO

  • Page 26

    2-1 Programming Concepts DVP-ES2/EX2/SS/SA2/SX2 is a programmable logic controller spanning an I/O range of 10–256 I/O points (SS2/SA2/SX2: 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 u...

  • Page 27

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-2 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 ins...

  • Page 28

    2. Prog rammi ng Con c ep ts 2-3C235~C242, 1 phase 1 input, 8 points, (*2) Soft-ware C232~C234, 2 phase 2 input, 3 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) C245~C250, 1 phase 2 input, 6 points, (*2) 32bit high-speed count up/downHard-ware C251~C254 2 phase 2 input, 4 points, (*2) ...

  • Page 29

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-4 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 po...

  • Page 30

    2. Prog rammi ng Con c ep ts 2-52.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μsProgram language Instructio...

  • Page 31

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-6 C235~C242, 1 phase 1 input, 8 points, (*2) Soft-ware C233~C234, 2 phase 2 input, 2 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) C245~C250, 1 phase 2 input, 6 points, (*2) 32bit high-speed count up/down Hard-war...

  • Page 32

    2. Prog rammi ng Con c ep ts 2-7High-speed counter interrupt I010, I020, I030, I040, I050, I060, I070, I080, 8 points Communication interrupt I140(COM1), I150(COM2), 2 points, (*3) K Decimal K-32,768 ~ K32,767 (16-bit operation), K-2,147,483,648 ~ K2,147,483,647 (32-bit operation) Constant H He...

  • Page 33

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-8 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 instruc...

  • Page 34

    2. Prog rammi ng Con c ep ts 2-9C233~C234, 2 phase 2 input, 2 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) C245~C250, 1 phase 2 input, 6 points, (*2) speed count up/downHard-ware C251~C254 2 phase 2 input, 4 points, (*2) Initial step point S0~S9, 10 points, (*2) Zero point returnS10~S...

  • Page 35

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-10 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,4...

  • Page 36

    2. Prog rammi ng Con c ep ts 2-112.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μsProgram language Instructi...

  • Page 37

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-12 C232~C234, 2 phase 2 input, 2 points, (*2) C243~C244, 1 phase 1 input, 2 points, (*2) C245~C250, 1 phase 2 input, 6 points, (*2) speed count up/down Hard-ware C251~C254 2 phase 2 input, 4 points, (*2) Initial step point ...

  • Page 38

    2. Prog rammi ng Con c ep ts 2-13High-speed counter interrupt I010, I020, I030, I040, I050, I060, I070, I080, 8 points Communication interrupt I140(COM1), I150(COM2), 2 points, (*3) K Decimal K-32,768 ~ K32,767 (16-bit operation), K-2,147,483,648 ~ K2,147,483,647 (32-bit operation) Constant H H...

  • Page 39

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-14 2.5 Status and Allocation of Latched Memory Memory type Power OFF=>ON STOP=>RUN RUN=>STOP Clear all non-latched area (M1031=ON)Clear all latched area (M1032=ON) Factory setting When M1033=OFF, clearNon-latched C...

  • Page 40

    2. Prog rammi ng Con c ep ts 2-152.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 ...

  • Page 41

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-16 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 i...

  • Page 42

    2. Prog rammi ng Con c ep ts 2-171101 15 13 0011 D 1110 16 14 0100 E 1111 17 15 0101 F 10000 20 16 0110 10 10001 21 17 0111 11 2.8 M Relay The types and functions of special auxiliary relays (special M) are listed in the table below. Care should be taken that some devices of the same No. may be...

  • Page 43

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-18 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultM1024 COM1 monitor request ○○○○OFF- - R/W NO OFF M1025* Indicate incorrect request for communication ○○○○OFF- - R NO OFF M...

  • Page 44

    2. Prog rammi ng Con c ep ts 2-19Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOP Attrib. Latch-edDefaultM1056 Disable timer interrupts I605~I699 ○○○○OFF- - R/W NOOFFM1057 Disable time interrupts I705~I799 ○○○○OFF- - R/W NOOFFM1058 COM3 monitor request ○╳○○OF...

  • Page 45

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-20 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultWhen the comparison reaches the last bit, M1089 = ON. M1090 Indicating start of matrix comparison. When the comparison starts from the fir...

  • Page 46

    2. Prog rammi ng Con c ep ts 2-21Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOP Attrib. Latch-edDefaultM1120* Retaining the communication setting of COM2 (RS-485), modifying D1120 will be invalid when M1120 is set. ○○○○OFFOFFOFF R/W NOOFFM1121 For COM2(RS-485), data transmis...

  • Page 47

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-22 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultM1162 Switching between decimal integer and binary floating point for SCLP instruction. ON: binary floating point; OFF: decimal integer ...

  • Page 48

    2. Prog rammi ng Con c ep ts 2-23Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOP Attrib. Latch-edDefaultM1218 C218 counting mode (ON: count down) ○○○○OFF- - R/W NOOFFM1219 C219 counting mode (ON: count down) ○○○○OFF- - R/W NOOFFM1220 C220 counting mode (ON: count down...

  • Page 49

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-24 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultM1248 C248 counter monitor (ON: count down) ○○○○OFF- - R NO OFF M1249 C249 counter monitor (ON: count down) ○○○○OFF- - R N...

  • Page 50

    2. Prog rammi ng Con c ep ts 2-25Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOP Attrib. Latch-edDefaultinstruction) M1316 For COM3(RS-485), sending request (Only applicable for MODRW and RS instruction) ○╳○╳OFFOFF- R/W NOOFFM1317 For COM3(RS-485), ready for data receiving (O...

  • Page 51

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-26 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultM1370* Slave ID#11 status on EASY PLC LINK network ○○○○OFF- - R YES OFF M1371* Slave ID#12 status on EASY PLC LINK network ○○...

  • Page 52

    2. Prog rammi ng Con c ep ts 2-27Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOP Attrib. Latch-edDefaultM1397* Slave ID#6 linking error ○○○○OFF- - R NOOFFM1398* Slave ID#7 linking error ○○○○OFF- - R NOOFFM1399* Slave ID#8 linking error ○○○○OFF- - R NOOFFM1400*...

  • Page 53

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-28 Special M Function ES2EX2 SS2 SA2 SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultM1428* Indicate that writing to Slave ID#5 is completed ○○○○OFF- - R NO OFF M1429* Indicate that writing to Slave ID#6 is complete...

  • Page 54

    2. Prog rammi ng Con c ep ts 2-292.9 S Relay Initial step relay Starting instruction in Sequential Function Chart (SFC). S0~S9, total 10 points. Zero return step relay Returns to zero point when using IST instruction in program. Zero return step relays not used for IST instruction can be used a...

  • Page 55

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-30 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, c...

  • Page 56

    2. Prog rammi ng Con c ep ts 2-31 16 bits counters 32 bits counters Output contact function Ouptut Coil will be ON when counter reaches preset value. Output coil is ON when counter reaches or is above preset value. Output coil is OFF when counter is below preset value. Output coil is ON when co...

  • Page 57

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-32 M relays M1200~M1254 are used to set the up/down counting direction for C200~C254 respectively. Setting the corresponding M relay ON will set the counter to count down. Example: LD X10 OUT M1200 LD X11 RST C200 LD X12 ...

  • Page 58

    2. Prog rammi ng Con c ep ts 2-332.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 th...

  • Page 59

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-34 Applicable Hardware High Speed Counters: 1-phase input 1-phase 2-input 2-phase 2-input C X 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 ...

  • Page 60

    2. Prog rammi ng Con c ep ts 2-35X3 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 cou...

  • Page 61

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-36 OUT Y0 1. X21 drives M1235 to determine counting direction (Up/Down) of C235. 2. When X20 = ON, RST instsruction executes and the current value in C235 will be cleared. Contact C235 will be OFF 3. When X22 = ON, C235 re...

  • Page 62

    2. Prog rammi ng Con c ep ts 2-37X21012345X20676543X1count upX0count downC247presentvalueY0, 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 C251Y0X21C251K5DCNTC251RSTX20M1002K2D1022MOV 1. When X20 is ON, RST inst...

  • Page 63

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-38 012345X21X2063012345A-phase X0B-phase X1C251 present valueY0, C251 contactCounting upCounting down 2.13 Special Data Register The types and functions of special registers (special D) are listed in the table below. Care ...

  • Page 64

    2. Prog rammi ng Con c ep ts 2-39Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed Defaultphase counter (From X0, X1 input) D1023* Register for Storing detected pulse width (unit: 0.1ms) ○○○○0 - - R/W NO0 D1025* Code for communication request error ○○○○0 - ...

  • Page 65

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-40 Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultD1070 ↓ D1085 Feedback data (ASCII) of Modbus communication. When PLC’s RS-485 communication instruction receives feedback signals, the da...

  • Page 66

    2. Prog rammi ng Con c ep ts 2-41Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed DefaultD1120* COM2 (RS-485) communication protocol ○○○○H’86- - R/W NOH’86D1121* COM1(RS-232) and COM2(RS-485) PLC communication address ○○○○- - - R/W Yes1 D1122 COM2(RS-4...

  • Page 67

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-42 Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed Defaultrequest (I160) on COM3 (RS-485) D1178 VR0 value ╳╳○○0 - - R NO 0 D1179 VR1 value ╳╳○○0 - - R NO 0 D1182 Index register E1 ○...

  • Page 68

    2. Prog rammi ng Con c ep ts 2-43Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed DefaultD1244 Idle time (pulse number) setting of CH0 (Y0, Y1) The function is disabled if set value≦0.○○○○0 - - R/W NO0 D1245 Idle time (pulse number) setting of CH1 (Y2, Y3) The f...

  • Page 69

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-44 Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultD1327* ID of the 8th right side module ○╳╳╳0 - - R NO 0 D1336 PV of Y2 pulse output (Low word) ○○○○- - - R/W YES 0 D1337 PV of...

  • Page 70

    2. Prog rammi ng Con c ep ts 2-45Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed DefaultD1370* Starting reference for Master to read from Slave ID#16 ○○○○- - - R/W YESH’1064D1386 ID of the 1st left side module ╳╳○○0 - - R NO0 D1387 ID of the 2nd left s...

  • Page 71

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-46 Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultD1433* Number of slave units linked to EASY PLC LINK ○○○○0 - - R/W NO 0 D1434* Data length to be read on Slave ID#1 ○○○○- - - ...

  • Page 72

    2. Prog rammi ng Con c ep ts 2-47Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed DefaultD1355: D100) D1496* ↓ D1511* Data buffer to store the data to be written on Slave ID#1. PLC writes 16 data into the starting reference set in D1415. (Default of D1415: D200) ○○...

  • Page 73

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-48 Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOPAttrib. Latch-ed DefaultD1687* D1361: D100) D1688* ↓ D1703* Data buffer to store the data to be written on Slave ID#7. PLC writes 16 data into the starting referenc...

  • Page 74

    2. Prog rammi ng Con c ep ts 2-49Special D Content ES2EX2SS2SA2SX2OFFONSTOP RUNRUN STOP Attrib. Latch-ed DefaultD1879* D1367: D100) D1880* ↓ D1895* Data buffer to store the data to be written on Slave ID#13. PLC writes 16 data into the starting reference set in D1427. (Default of D1427: D200)...

  • Page 75

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-50 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...

  • Page 76

    2. Prog rammi ng Con c ep ts 2-51External 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 ) Timer interrupt I602/I699, I702/I799, 2 points (Timer resolut...

  • Page 77

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-52 Y0X1P2CALLX0Y1P**20P2FENDY1SRET24(subroutine P2)subroutineCall subroutine P**subroutine return Interrupt pointer I: used with application instruction API 04 EI, API 05 DI, API 03 IRET. There are four types of inte...

  • Page 78

    2. Prog rammi ng Con c ep ts 2-53communication. 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 speci...

  • Page 79

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-54 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...

  • Page 80

    2. Prog rammi ng Con c ep ts 2-55M10020MOVK300D1000Initial pulse 3. The maximum SV in the monitor timer is 32,767ms. However, care should be taken when adjusting SV. If SV in D1000 is too big, it cost much longer for operation errors to be detected. Therefore, SV is suggested to be shorter than...

  • Page 81

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-56 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: maximu...

  • Page 82

    2. Prog rammi ng Con c ep ts 2-57 Function Group M1016~M1017, D1313~D1319 Number Real Time Clock Contents: 1. Special M and special D relevant to RTC Device Name Function M1016 Year Display 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 M1...

  • Page 83

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-58 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 i...

  • Page 84

    2. Prog rammi ng Con c ep ts 2-5903: requested data exceeds the range. 07: checksum error Function Group Pulse output Mark and Mask function Number M1108, M1110, M1156, M1158, M1538, M1540, D1026, D1027, D1135, D1136, D1232, D1233, D1234, D1235, D1348, D1349 Contents: Please refer to explanati...

  • Page 85

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-60 2. When the instruction is re-executed for the next time, M1029 / M1102 will turn off first then ON again when the instruction is completed. Function Group Clear Instruction Number M1031, M1032 Contents: M1031 (clear no...

  • Page 86

    2. Prog rammi ng Con c ep ts 2-61Number PortItem COM1COM2COM3 Communication format D1036 D1120D1109 Communication setting holding M1138 M1120 M1136 ASCII/RTU mode M1139 M1143 M1320 Slave communication address D1121 D1255 Contents: COM ports (COM1: RS-...

  • Page 87

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-62 1100(HC): 115200 1101(HD): 500000 (COM2 / COM3) 1110(HE): 31250 (COM2 / COM3) 1111(HF): 921000 (COM2 / COM3) b8 Select start bit 0: None 1: D1124 b9 Select the 1st end bit 0: None 1: D1125 b10 Select the 2nd end bit 0: N...

  • Page 88

    2. Prog rammi ng Con c ep ts 2-63MOVH86D1109SETM1136M1002 Example 4: RTU mode setting of COM1、COM2、COM3 1. COM1, COM2 and COM3 support ASCII/RTU mode. COM1 is set by M1139, COM2 is set by M1143 and COM3 is set by M1320. Set the flags ON to enable RTU mode or OFF to enable ASCII mode. 2. Mod...

  • Page 89

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-64 1. Data response delay time can be set when PLC is a Slave in COM2, COM3 RS-485 communication. Unit: 0.1ms. 0~10,000 adjustable. 2. By using PLC-Link, D1038 can be set to send next communication data with delay. Unit: 1 ...

  • Page 90

    2. Prog rammi ng Con c ep ts 2-655. Default of average times in analog input channels: (K2). If set value = K1, PLC takes the present value. Device Function D1062 Average times of EX2/SX2 analog input channels (CH0~CH3): 1~20, Default = K2 D1110 Average value of EX2/SX2 analog input channel 0 (A...

  • Page 91

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-66 Function Group I/O Modules Detection Number D1140, D1142, D1143, D1145 Contents: D1140: Number of right-side modules (AIO, PT, TC, etc.), max. 8 modules can be connected. D1142: Number of input points (X) on DIO modul...

  • Page 92

    2. Prog rammi ng Con c ep ts 2-67Special D D1241, D1240 D1243, D1242 Counter C243 C246C248C252C244 C250 C254Interrupt signal X1(I100/I101)X4(I400/I401) X3(I300/I301) X5(I500/I501) 2. Function: a) When X0 (counter input) and X1 (external Interrupt) correspondingly work together with C243, and I10...

  • Page 93

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-68 DVP04AD-E2 H’0080 DVP06XA-E2 H’00C4 DVP02DA-E2 H’0041 DVP04PT-E2 H’0082 DVP04DA-E2 H’0081 DVP04TC-E2 H’0083 Function Group ID of left side modules on SA2/SX2 Number D1386~D1393 Contents: When left side modul...

  • Page 94

    2. Prog rammi ng Con c ep ts 2-69Data interchange status of Slaves. M1376 M1377 M1378 M1379 M1380 M1381 M1382 M1383 Access error flag (ON = normal; OFF = error) M1392 M1393 M1394 M1395 M1396 M1397 M1398 M1399 “Reading completed” flag (turns “Off” whenever access of a Slave is completed) ...

  • Page 95

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-70 M1432 M1433 M1434 M1435 M1436 M1437 M1438 M1439 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ Slave PLC* SLAVE ID 9 SLAVE ID 10 SLAVE ID 11 SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16Read out Write in Read out Write in...

  • Page 96

    2. Prog rammi ng Con c ep ts 2-715. Special D and special M corresponding to Slave ID9~ID16: (M1353 = ON, access available for up to 50 words) MASTER PLC SLAVE ID 9 SLAVE ID 10 SLAVE ID 11SLAVE ID 12 SLAVE ID 13 SLAVE ID 14 SLAVE ID 15 SLAVE ID 16Read out Write in Read out Write in Read out Writ...

  • Page 97

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-72 6. Explanation: a) EASY PLC LINK is based on MODBUS communication protocol b) Baud rate and communication format of all phariferal devices connected to the Slave PLC should be the same as the communication format of M...

  • Page 98

    2. Prog rammi ng Con c ep ts 2-738. The Operation of Master PLC: a) M1355 = ON indicates that Slave status is user-defined. Set the linking status of Slave manually by M1360~M1375. b) M1355 = OFF indicates that Slave status is auto-detected. Linking status of Slave can be monitored by M1360~M13...

  • Page 99

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-74 Auto mode M1351 and manual mode M1352 cannot be enabled at the same time. If M1351 is enabled after M1352 is ON, EASY PLC LINK will stop and M1350 will be reset. Communication timeout setting can be modified by D1129 ...

  • Page 100

    2. Prog rammi ng Con c ep ts 2-7510. Operation flow chart: Set starting reference of the Sread: D1355~D1370 Set data length for reading from Slave PLC: D1434~D1449(PLC will take default or previous setting as the set value if these registers are not specified)Set starting reference of the Slave...

  • Page 101

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-76 M1002MOVK17D1121H86D1120K16K16M1351ENDMOVSETM1120MOVMOVD1434D1450M1350X1K16K16MOVMOVD1435D1451Master ID#COM2 communication protocolRetain communication protocolData length to be read from Slave ID#1Data length to be writ...

  • Page 102

    2. Prog rammi ng Con c ep ts 2-77Master PLC Preset value Slave PLC Preset value D1480 ~ D1495 K5,000 D100 ~ D115 of Slave ID#1 K5,000 D1496 ~ D1511 K1,000 D200 ~ D215 of Slave ID#1 K1,000 D1512 ~ D1527 K6,000 D100 ~ D115 of Slave ID#2 K6,000 D1528 ~ D1543 K2,000 D200 ~ D215 of Slave ID#2 K2,000 ...

  • Page 103

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 2-78 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...

  • Page 104

    3-1 Instruction Set This chapter explains all of the instructions that are used with DVP-ES2/EX2/SS2/ SA2/SX2 as well as detailed information concerning the usage of the instructions. Chapter Contents 3.1 Basic Instructions (without API numbers) ................................................

  • Page 105

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-2 3.1 Basic Instructions (without API numbers) Execution speed (us) Instruction Function Operand ES2 EX2 SA2SX2SS2 StepsLD Load NO contact X, Y, M, S, T, C0.76 0.62 1~3 LDI Load NC contact X, Y, M, S, T, C0.78 0.64 1~3 AND ...

  • Page 106

    3. In str u ctio n Se t 3-33.2 Explanations to Basic Instructions Mnemonic Operands Function Program stepsLD X, Y, M, S, T, C Load NO contact 1~3 Controllers ES2/EX2 SS2 EX2 SX2 Explanations: The LD instruction is used to load NO contact which connects to left side bus line or starts a new block...

  • Page 107

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-4 Ladder diagram: X0X1Y1 Instruction: Operation: LDI X1 Load NC contact X1 AND X0 Connect NO contact X0 in series OUT Y1 Drive Y1 coil Mnemonic Operands Function Program stepsANI X, Y, M, S, T, C Connect NC contact...

  • Page 108

    3. In str u ctio n Se t 3-5Ladder diagram: X0X1Y1 Instruction: Operation: LD X0 Load NO contact X0 ORI X1 Connect NC contact X1 in parallel OUT Y1 Drive Y1 coil Mnemonic Function Program stepsANB Connect a block in series 1 Controllers ES2/EX2 SS2 EX2 SX2 Explanations: The ANB instruct...

  • Page 109

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-6 Ladder diagram: X0X2Y1X1X3ORBBlock ABlock B Instruction: 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 ORB Connect c...

  • Page 110

    3. In str u ctio n Se t 3-7Program example: Ladder diagram: X0Y1X1M0X2Y2ENDMPPMRDMPS Instruction: Operation: LD X0 Load NO contact X0 MPS Store current status AND X1 Connect NO contact X1 in series OUT Y1 Drive Y1 coil MRD Read the stored status AND X2 Connect NO contact X2 in se...

  • Page 111

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-8 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. Program exam...

  • Page 112

    3. In str u ctio n Se t 3-9Instruction type Explanation General purpose timer Present value = 0, Coil is OFF, No action on associated contact Subroutine timer Present value = 0, Coil is OFF, No action on associated contact Accumulative timer Coil is OFF, present value and contact status remains ...

  • Page 113

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-10 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. Mnemonic Function Program stepsNOP No operation 1 Controllers ES2/EX2 S...

  • Page 114

    3. In str u ctio n Se t 3-113.4 Interrupt Pointers Mnemonic Function Program stepsI Interrupt program pointer 1 Controllers ES2/EX2 SS2 EX2 SX2 Explanations: A interruption program has to start with a interruption pointer (I□□□) and ends with API 03 IRET. I instruction has to be used with ...

  • Page 115

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-12 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 mnem...

  • Page 116

    3. In str u ctio n Se t 3-13 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 r...

  • Page 117

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-14 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....

  • Page 118

    3. In str u ctio n Se t 3-151. 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-d...

  • Page 119

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-16 X0SETM0M0DSW X10Y10D0K0RSTM0M1029 When X0 = ON, DSW will be enabled. When X0 = OFF, M0 is latched. M0 will be reset only when DSW instruction is completed to activate M1029. 2. Error Operation Flags Errors occur during ...

  • Page 120

    3. In str u ctio n Se t 3-175. 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 inst...

  • Page 121

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-18 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...

  • Page 122

    3. In str u ctio n Se t 3-19DVP-PLC represents floating point value in 32 bits, following the IEEE754 standard: Sexponentmantissa8-bit23-bitb31Sign bit0: positive1: negativeb0 Equation ()127;.121=××−−BMBES Therefore, the range of 32-bit floating point value is from ±2-126 to ±2+128, i.e....

  • Page 123

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-20 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. Example: Store a decimal floating point in...

  • Page 124

    3. In str u ctio n Se t 3-21MOV K20E0 D10F0E0 = 8 F0 = 1420 + 8 = 28 10 + 14 = 24Transmission K28 D24The opposite diagram E, F index register modification refers to the content in the operand changes with thecontents in E and F. For example, E0 = 8 and K20E0 represents constan...

  • Page 125

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-22 3.6 Numerical List of Instructions Loop Control Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit00 CJ - Conditional jump 3 - 01 CALL - Call subroutine 3 - 02 SRET - - Su...

  • Page 126

    3. In str u ctio n Se t 3-23Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit23 DIV DDIV Division 7 1324 INC DINC Increment 3 5 25 DEC DDEC Decrement 3 5 26 WAND DAND Logical Word AND 7 1327 WOR DOR Logical Word OR 7 1328 WXOR DXO...

  • Page 127

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-24 High Speed Processing Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2SA2SX2 16-bit 32-bit50 REF - Refresh 5 - 51 REFF - Refresh and filter adjust 3 - 52 MTR - - Input Matrix 9 - 53 - DHSCS...

  • Page 128

    3. In str u ctio n Se t 3-25Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit74 SEGL - - 7-segment with latch 7 - 75 ARWS - - Arrow switch - 9 - 76 ASC - - ASCII code conversion - 11- 77 PR - - Print (ASCII code output) - 5 - Serial I/O M...

  • Page 129

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-26 Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit97 CNT DCNT - Counter 4 6 98 INV - - Inverse operation 1 - 99 PLF - - Falling-edge output 3 - Communication Instructions M...

  • Page 130

    3. In str u ctio n Se t 3-27Mnemonics Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit126 - DLOG Float logarithm operation - 13127 - DESQR Floating point square root - 9 128 - DPOW Floating point power operation - 13129 INT DINT Float to intege...

  • Page 131

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-28 Positioning Control Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit155 - DABSR - Absolute position read - 13 156 - DZRN - Zero return - 17 157 - DPLSV Adjustable speed p...

  • Page 132

    3. In str u ctio n Se t 3-29Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit171 GBIN DGBIN Gray Code → BIN 5 9 Matrix Operation Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit180 MAND - Matrix ...

  • Page 133

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-30 Mnemonic Applicable to STEPS API 16 bits 32 bits PULSE Function ES2EX2SS2 SA2 SX2 16-bit 32-bit226 LD< DLD< - S1 < S2 5 9 228 LD<> DLD<> - S1 ≠ S2 5 9 229 LD<= DLD<= - S1 ≦ S2 5 9 230 LD...

  • Page 134

    3. In str u ctio n Se t 3-313.7 Detailed Instruction Explanation API Mnemonic Operands Function 00 CJ P Conditional Jump Controllers ES2/EX2 SS2 EX2 SX2 OP Range Program Steps P0~P255 CJ, CJP: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2SA2SX2 ES2/EX2 SS2SA2SX2 ES2/EX2 SS2 SA2SX2Operands: S: Th...

  • Page 135

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-32 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...

  • Page 136

    3. In str u ctio n Se t 3-33M11 ON M11 ON→OFF The skipped application instruction will not be executed but API 53~59, API 157~159 keep executing. *1: Y1 is dual output. When M0 is OFF, it is controlled by M1. When M0 is ON, M12 will control Y1 *2: When timer that subroutine used (T184~T199) e...

  • Page 137

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-34 API Mnemonic Operands Function 01 CALL P Call Subroutine Controllers ES2/EX2 SS2 EX2 SX2 OP Valid Range Program Steps P0~P255 CALL, CALLP: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2SX2 ES2/EX2 SS2SA2SX2 ES2/EX2 S...

  • Page 138

    3. In str u ctio n Se t 3-35API Mnemonic Function 02 SRET Subroutine Return Controllers ES2/EX2 SS2 EX2 SX2 OP Descriptions Program Steps N/A No contact to drive the instruction is required Automatically returns program execution to the address after CALL instruction in O100. SRET: 1 step PU...

  • Page 139

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-36 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, exe...

  • Page 140

    3. In str u ctio n Se t 3-37 API Mnemonic Function 03 IRET Interrupt Return Controllers ES2/EX2 SS2 EX2 SX2 OP Descriptions Program Steps N/A No contact to drive the instruction is required. IRET ends the processing of an interrupt subroutine and returns execution back to the main program IRET...

  • Page 141

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-38 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 sa...

  • Page 142

    3. In str u ctio n Se t 3-39Program 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. I 101I 201Disabled interruptEnabled interruptEnabled in...

  • Page 143

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-40 API Mnemonic Function 06 FEND The End of The Main Program (First End) Controllers ES2/EX2 SS2 EX2 SX2 OP Descriptions Program Steps N/A No contact to drive the instruction is required. FEND: 1 step PULSE 16-bit 32-bi...

  • Page 144

    3. In str u ctio n Se t 3-41CJ Instruction Program Flow X1CALLP63P0P63CJP0I301X00The program flowwhen X0=off, X1=off Main program Main program Main program Interrupt subroutineCommand CALL subroutineEIDIFENDFENDSRETIRETENDThe program flow when X0=Onprogram jumps to P0

  • Page 145

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-42 CALL Instruction Program Flow X1CALLP63P0P63CJP0I301X00The program flowwhen X0=off, X1=off Main program Main program Main program Interrupt subroutineCommand CALL subroutineThe program flow when X0=Off, X1=On.EIDIFEN...

  • Page 146

    3. In str u ctio n Se t 3-43API Mnemonic Function 07 WDT P Watchdog Timer Refresh Controllers ES2/EX2 SS2 EX2 SX2 OP Descriptions Program Steps N/A WDT, WDTP: 1 step PULSE 16-bit 32-bit ES2/EX2 SS2SA2SX2 ES2/EX2 SS2SA2SX2 ES2/EX2 SS2 SA2SX2Explanations: 1. WDT instruction can be used to res...

  • Page 147

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-44 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...

  • Page 148

    3. In str u ctio n Se t 3-45API Mnemonic Operands Function 08 FOR Start of a FOR-NEXT Loop Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS * **** ******FOR: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2SA2SX2 ES2/EX2 SS2SA2...

  • Page 149

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-46 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...

  • Page 150

    3. In str u ctio n Se t 3-47Program 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. X0TMRT0K10P0FORK4X100X0INCD0K2X0D1K3X0D2K4X0WDTD3X1CJP0FORK5X0X0INCD4NEXTNEXTNEXTNEXTNEXTENDFORINCFORI...

  • Page 151

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-48 API Mnemonic Operands Function 10 D CMP P Compare Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * * * * ****...

  • Page 152

    3. In str u ctio n Se t 3-49API Mnemonic Operands Function 11 D ZCP P Zone Compare Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******S * **** ******D ** * ZCP, ZCPP: 9 ste...

  • Page 153

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-50 API Mnemonic Operands Function 12 D MOV P Move Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * * ******D * * ******MOV, M...

  • Page 154

    3. In str u ctio n Se t 3-51API Mnemonic Operands Function13 SMOV P Shift Move Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS *** ******m1 * * m2 * * D ** ******n * * SMOV, SMOVP: 1...

  • Page 155

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-52 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....

  • Page 156

    3. In str u ctio n Se t 3-53Program 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 t...

  • Page 157

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-54 API Mnemonic Operands Function 14 D CML P Compliment Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * * ******D * * ******...

  • Page 158

    3. In str u ctio n Se t 3-55API Mnemonic Operands Function 15 BMOV P Block Move Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS *** ****D ** ****n * * ***BMOV, BMOVP: 7 steps PULSE 16-bit 32-bit ES...

  • Page 159

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-56 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. M1000K1M0K1Y0K3M0M1M2M3M4M5M6M7M8M9M10n=3M11...

  • Page 160

    3. In str u ctio n Se t 3-57API Mnemonic Operands Function 16 D FMOV P Fill Move Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS * **** ******D ** ****n * * FMOV, FMOVP: 7 stepsDFMOV, DFMOVP: 13 steps PU...

  • Page 161

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-58 API Mnemonic Operands Function 17 D XCH P Exchange Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD1 * * ******D2 * * ******XCH,...

  • Page 162

    3. In str u ctio n Se t 3-59API Mnemonic Operands Function 18 D BCD P Convert BIN to BCD Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS *** ******D ** ******BCD, BCDP: 5 steps DBCD, DBCDP: 9 steps PULSE 16-...

  • Page 163

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-60 API Mnemonic Operands Function 19 D BIN P Convert BCD to BIN Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ******D * * *...

  • Page 164

    3. In str u ctio n Se t 3-61101100102642X37X2088810368Y37Y204-digit DIP switch in BCD format4-digit BCD valueUsing BIN instruction to store the BIN value into D100 Using BCD instruction to convert thecontent in D100 into a 4-digit BCD value.4-digit 7-segment display in BCD format

  • Page 165

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-62 API Mnemonic Operands Function 20 D ADD P Addition Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * * * * ****...

  • Page 166

    3. In str u ctio n Se t 3-631. If the operation result is “0”, the zero flag, M1020 will be ON. 2. If the operation result exceeds -2,147,483,648, the borrow flag M1021 will be ON. 3. If the operation result exceeds 2,147,483,647, the carry flag M1022 will be ON -2-10-32,768、 、 、 ...

  • Page 167

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-64 API Mnemonic Operands Function 21 D SUB P Subtraction Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * * * * *...

  • Page 168

    3. In str u ctio n Se t 3-65API Mnemonic Operands Function 22 D MUL P Multiplication Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 * **** *****D ** *****MUL, DMULP: 7 steps DMUL, DMULP:...

  • Page 169

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-66 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...

  • Page 170

    3. In str u ctio n Se t 3-67API Mnemonic Operands Function 23 D DIV P Division Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 * **** *****D ** *****DIV, DIVP: 7 steps DDIV, DDIVP: 13 ste...

  • Page 171

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-68 API Mnemonic Operands Function 24 D INC P Increment Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ******INC, INCP: 3 steps DINC, ...

  • Page 172

    3. In str u ctio n Se t 3-69API Mnemonic Operands Function 25 D DEC P Decrement Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD ** ******DEC, DECP: 3 steps DDEC, DDECP: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2...

  • Page 173

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-70 API Mnemonic Operands Function 26 WAND P Logical Word AND Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * *...

  • Page 174

    3. In str u ctio n Se t 3-71API Mnemonic Operands Function 26 DAND P Logical DWord AND Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 * **** *****D ** *****DAND, DANDP: 13 steps PULSE 1...

  • Page 175

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-72 API Mnemonic Operands Function 27 WOR P Logical Word OR Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * * *...

  • Page 176

    3. In str u ctio n Se t 3-73API Mnemonic Operands Function 27 DOR P Logical DWord OR Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 * **** *****D ** *****DOR, DORP: 13 steps PULSE 16-b...

  • Page 177

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-74 API Mnemonic Operands Function 28 WXOR P Logical Word XOR Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * *...

  • Page 178

    3. In str u ctio n Se t 3-75API Mnemonic Operands Function 28 DXOR P Logical DWord XOR Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 * **** *****D ** *****DXOR, DXORP: 13 steps PULSE 1...

  • Page 179

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-76 API Mnemonic Operands Function 29 D NEG P 2’s Complement (Negation) Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ******NEG, NE...

  • Page 180

    3. In str u ctio n Se t 3-77X0CMPD0D2M0M0SUBD0D2D4M2SUBD2D0D4M1 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...

  • Page 181

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-78 API Mnemonic Operands Function 30 D ROR P Rotation Right Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ******n * * ROR, ...

  • Page 182

    3. In str u ctio n Se t 3-79API Mnemonic Operands Function 31 D ROL P Rotate Left Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD ** ******n * * ROL, ROLP: 5 steps DROL, DROLP: 9 steps PULSE 16-bit 32-bi...

  • Page 183

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-80 API Mnemonic Operands Function 32 D RCR P Rotation Right with Carry Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ******n * ...

  • Page 184

    3. In str u ctio n Se t 3-81API Mnemonic Operands Function 33 D RCL P Rotation Left with Carry Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD ** ******n * * RCL, RCLP: 5 steps DRCL, DRCLP: 9 steps PULSE...

  • Page 185

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-82 API Mnemonic Operands Function 34 SFTR P Bit Shift Right Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * D * * * n1 ...

  • Page 186

    3. In str u ctio n Se t 3-83API Mnemonic Operands Function 35 SFTL P Bit Shift Left Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * D ** * n1 * * n2 * * SFTL, SFTLP: 9 steps PULSE 1...

  • Page 187

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-84 API Mnemonic Operands Function 36 WSFR P Word Shift RightControllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ****D * * ****n...

  • Page 188

    3. In str u ctio n Se t 3-85Program Example 2: 1. When X0 is triggered, WSFRP instruction shifts X20~X27 into data stack Y20~Y37 and Y20~Y37 also shift to the right with a group of 4 devices. 2. The figure below illustrates the right shift of the devices in one scan Y27~Y20 → carry Y37~Y30 ...

  • Page 189

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-86 API Mnemonic Operands Function 37 WSFL P Word Shift Left Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ****D * * ****n...

  • Page 190

    3. In str u ctio n Se t 3-87API Mnemonic Operands Function 38 SFWR P Shift Register Write Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * **** ******D ** ****n * * SFWR, SFWRP: 7 steps PULSE 16-bi...

  • Page 191

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-88 API Mnemonic Operands Function 39 SFRD P Shift Register ReadControllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * ****D * * ***...

  • Page 192

    3. In str u ctio n Se t 3-89API Mnemonic Operands Function 40 ZRST P Zone Reset Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD1 ** * ***D2 ** * ***ZRST, ZRSTP: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 S...

  • Page 193

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-90 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. RSTM0X0RSTT0RSTY0FMOVK0D10K5

  • Page 194

    3. In str u ctio n Se t 3-91API Mnemonic Operands Function 41 DECO P Decode Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * * * *****D ** * *****n * * DECO, DECOP: 7 steps PULSE 16-bit 32-bit ...

  • Page 195

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-92 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...

  • Page 196

    3. In str u ctio n Se t 3-93API Mnemonic Operands Function 42 ENCO P Encode Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * *****D *****n * * DECO, DECOP: 7 steps PULSE 16-bit 32-bit ES2...

  • Page 197

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-94 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...

  • Page 198

    3. In str u ctio n Se t 3-95API Mnemonic Operands Function 43 D SUM P Sum of Active bits Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * **** ******D *****SUM, DSUMP: 5 steps DSUM, DSUMP: 9 steps PULSE ...

  • Page 199

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-96 API Mnemonic Operands Function 44 D BON P Check specified bit status Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * * ******D ...

  • Page 200

    3. In str u ctio n Se t 3-97API Mnemonic Operands Function 45 D MEAN P Mean Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *** ****D ** ******n * **** ******MEAN, MEANP: 7 stepsDMEAN, DMEANP: 13 steps ...

  • Page 201

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-98 API Mnemonic Operands Function 46 ANS Timed Annunciator Set Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *m * D * ...

  • Page 202

    3. In str u ctio n Se t 3-99API Mnemonic Function 47 ANR P Annunciator Reset Controllers ES2/EX2 SS2 EX2 SX2 OP Descriptions Program Steps N/A Instruction driven by contact is necessary. ANR, ANRP: 1 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2Explana...

  • Page 203

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-100 Y0ANST0K100S912X2X4ANRPM1000M1049Y1ANST1K200S920X3X0Y0X2M1048Y2Y0X1Y1X3Y1 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, S91...

  • Page 204

    3. In str u ctio n Se t 3-101API Mnemonic Operands Function 48 D SQR P Square Root Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *SQR, SQRP: 5 steps DSQR, DSQRP: 9 steps PULSE 16-bit 32-bit ES...

  • Page 205

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-102 API Mnemonic Operands Function 49 D FLT P Floating Point Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *D *FLT, FLTP: ...

  • Page 206

    3. In str u ctio n Se t 3-103M1002RSTM1081X20FLTD0D12X21DFLTD0D20 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) = H47C350...

  • Page 207

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-104 M1000FLTD10D100BINK2X0D200FLTD200D202DEDIVK615K10DEDIVD100D202DEMULD400D300DEBCDD20D30DINTD20D40D300D400D2012345678 1. Covert D10 (BIN integer) to D101, D100 (floating point). 2. Covert the value of X7~X0 (BCD value) to...

  • Page 208

    3. In str u ctio n Se t 3-105API Mnemonic Operands Function 50 REF P Refresh Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * n * * REF, REFP: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2...

  • Page 209

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-106 Program Example 3: When X0 = ON, I/O points starting from X10 or Y4 will all be refreshed. X0REFX10K8X0REFY10K8Or Program Example 4: For DVP-EX2/SX2 only: When X0 = ON and M1180 = ON, A/D signal in D1110~D1113 will be r...

  • Page 210

    3. In str u ctio n Se t 3-107API Mnemonic Operands Function 51 REFF P Refresh and Filter Adjust Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E Fn * * REFF, REFFP: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 E...

  • Page 211

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-108 API Mnemonic Operands Function 52 MTR Input Matrix Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * D1 * D2 * * * ...

  • Page 212

    3. In str u ctio n Se t 3-109M1000MTRX40Y40M10K2 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. S/...

  • Page 213

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-110 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… et...

  • Page 214

    3. In str u ctio n Se t 3 - 111API Mnemonic Operands Function 53 D HSCS High Speed Counter Set Controllers ES2/EX2 SS2 EX2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 *D ** * DHSCS: 13 steps PULSE 16-bit...

  • Page 215

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-112 Table of settings for software counters and software comparators: Counter C232 C233 C234 C235 C236 C237 DHSCS Hi-speed interrupt I010 I050 I070 I010 I020 I030 Hi-speed compare Set / Reset C232~C242 share 6 software co...

  • Page 216

    3. In str u ctio n Se t 3-11 3 Table of settings for hardware counters and comparators: A group B group Hardware counter A1 A2 A3 A4 B1 B2 B3 B4 Counter No. C243, C245~C248, C251,C252 C244, C249, C250, C253, C254High-speed counter interrupt I010 I020I030I040I050I060 I070 I080Hi-speed compare Set...

  • Page 217

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-114 OFF, C235 counts up) When value in C235 varies from 101 to100, DHSCR instruction resets M0. (M1235 = ON, C235 counts down) Timing diagram for the comparison: CountingNo.TimeCount upCount downM01011009998101100999812 ...

  • Page 218

    3. In str u ctio n Se t 3-11 5M1000DCNTC235K100DHSCSC235K100I010EIFENDI010M1000OUTY10IRETEND When value in C235 varies from 99 to100, interrupt subroutine triggered by I010 executes immediately to set Y0 ON. Points to note: If operand D is specified as S, M or Y0~Y3 for the above high speed...

  • Page 219

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-116 C254, the count value will be moved to D1242 and D1243 when interrupt occurs and then the counter will be reset. Special D D1241, D1240 D1243, D1242 Counter C243 C246C248C252C244 C250 C254 Interrupt X1(I100/I101) X4(I40...

  • Page 220

    3. In str u ctio n Se t 3-117API Mnemonic Operands Function 54 D HSCR High Speed Counter Reset Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** *****S2 *D ** * *DHSCR: 13 steps PULSE 16-bit...

  • Page 221

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-118 API Mnemonic Operands Function 55 D HSZ High Speed Zone Compare Controllers ES2/EX2 SS2 SA2 SX2 Bit DevicesWord devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * ** *****S2 * * * *...

  • Page 222

    3. In str u ctio n Se t 3-119 There are 6 software zone comparators available exclusively for zone compare operation, hence the limit of 6 comparisons for zone compare does not include the comparisons of DHSCS and DHSCR. SS2 does not support software counter C232. 5. Explanations on hardware c...

  • Page 223

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-120 the comparison result. M1000DCNTC246K20000DHSZK1500K2000C246Y0Y0Y1Y2When current value of C246 < K1500, Y0=OnWhen K1500 < current value of C246 < K2000, Y1=OnWhen current value of C246 > K2000, Y2=On Progra...

  • Page 224

    3. In str u ctio n Se t 3-121API Mnemonic Operands Function 56 SPD Speed Detection Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * S2 * **** ******D ***SPD: 7 steps PULSE 16-bit 32-bit ES2/EX...

  • Page 225

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-122 5. D occupies 5 consecutive registers, D + 1 and D store the results of previous pulse detection; D +3 and D + 2 store the current accumulated number of pulses; D + 4 store the current time remaining (max. 32,767ms). ...

  • Page 226

    3. In str u ctio n Se t 3-123API Mnemonic Operands Function 57 D PLSY Pulse Output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******D * PLSY: 7 steps DPLSY: 13 steps PULSE...

  • Page 227

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-124 5. Four pulse output modes: D1220 D1221 Mode Output K0 K1 K2 K3 K0 K1 K2 K3# Y0 Pulse Pulse A CW Y1 Pulse Dir B Pulse Y2 Pulse PulseA CCW Y3 PulseDir B PulsePulse: Pulse A: A phase pu...

  • Page 228

    3. In str u ctio n Se t 3-1252. When X0 = OFF, pulse output Y0 will immediately stop. When X0 turns ON again, the pulse output will start from the first pulse. X0PLSYK1000K200Y0M1029Y20 123200Output Y0 0.5ms1ms Points to note: 1. Description of associated flags: M1029: M1029 = ON when Y0 pulse o...

  • Page 229

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-126 D1032: Present number of Y1 output pulses (Low word). D1033: Present number of Y1 output pulses (High word). D1336: Present number of Y2 output pulses (Low word). D1337: Present number of Y2 output pulses (High word)...

  • Page 230

    3. In str u ctio n Se t 3-127Explanations: 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 triggere...

  • Page 231

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-128 API Mnemonic Operands Function 58 PWM Pulse Width Modulation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 *...

  • Page 232

    3. In str u ctio n Se t 3-129Program Example: When X0 = ON, Y1 output the pulse as shown opposite. When X0 = OFF, output Y1 turns OFF.X0PWMK1000K2000Y1Output Y1t=1000msT=2000msNote: 1. Flag description: M1070: Switching clock pulse of Y1 for PWM instruction (ON:100 us, OFF: 1ms) M1071: Switching...

  • Page 233

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-130 API Mnemonic Operands Function 59 D PLSR Pulse Ramp Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * * * *...

  • Page 234

    3. In str u ctio n Se t 3-1317. 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). 8. When assigning Y0 and Y2 output mode as Pulse/Dir, i.e. D1220 = K1, D1221 = K1, th...

  • Page 235

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-132 16. 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 t...

  • Page 236

    3. In str u ctio n Se t 3-133Y0. 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...

  • Page 237

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-134 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 funct...

  • Page 238

    3. In str u ctio n Se t 3-135flag M1108 and pulse output will resume. 4. Operation of Mask function on Y0: FrequencyStart/end frequencyTarget speedY0 is masked from interrupts on X4Y0 is ready for interrupts from X4Pulse number if no external interrupt on X4TimeD1340Pulses to be masked,Ramp ...

  • Page 239

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-136 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 O...

  • Page 240

    3. In str u ctio n Se t 3-137API MnemonicOperands Function 60 IST Initial State Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** D1 * D2 * IST: 7 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2...

  • Page 241

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-138 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 ...

  • Page 242

    3. In str u ctio n Se t 3-139X35X36X37X20X21X22X23X24X25Step X32One cycleoperation X33Continuousoperation X34Manualoperation X30Zero return X31Power ONPower OFFZero returnAuto ONAuto OFFRight ShiftLeft shiftReleaseballsClipballsDescendAscend a) X0: ball size sensor. b) X1: left-limit of robot a...

  • Page 243

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-140 S1S10X35S11X4S12X1RSTY4RSTY1Y0RSTY2Y3SETM1043RSTS12Release ballsStop lowering robot armRaise robot arm to theupper-limit (X4 = ON)Stop shifting to rightShift to left to reach the left-limit (X1 = ON)Enable zero return...

  • Page 244

    3. In str u ctio n Se t 3-1419. Auto operation (Single step / One-cycle operation / continuous operation): a) SFC: S2S20S30S31M1044X5T0Y1SETY0S32X4X2S50Y1Y2S2X1M1041X0Y4TMRT0K30S60RSTX5Y4TMRT2K30S70T2Y0S80X4Y3X1S40S41X5T1SETY0S42X4X3Y2X0Y4TMRT1K30X3X2X4X5X4X4

  • Page 245

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-142 b) Ladder Diagram: ENDRETSETS20SETS30SETY4Y0X5S31SX4TMRT0SETS32S2SM1041 M1044S20SS30SY1X0SETS40X5 X0SETS31T0K30Y2S32SX2SETS50X2SETY4TMRT1S40SSETS41T1K30Y0S41SX4SETS42Y2S42SX3SETS50X3Y1S50SX5SETS60RSTY4TMRT2S60SSETS70T2...

  • Page 246

    3. In str u ctio n Se t 3-143Flag explanation: M1040: Disable step transition. When M1040 = ON, all motion of step points are disabled. 1. Manual operation mode: M1040 remains ON in manual mode. 2. Zero return mode/one cycle operation mode: M1040 remains ON in the interval after Auto Stop and b...

  • Page 247

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-144 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 ~ D104...

  • Page 248

    3. In str u ctio n Se t 3-145API Mnemonic Operands Function 61 D SER P Search a Data Stack Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *** ****S2 * **** ******D ** ****N * * *SER, SERP: 9 ...

  • Page 249

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-146 API Mnemonic Operands Function 62 D ABSD Absolute Drum Sequencer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * ****S2 ...

  • Page 250

    3. In str u ctio n Se t 3-1474. M10~ M13 = ON when the current value of C10 falls between lower and upper bounds. Lower-bound value Upper- bound valueCurrent 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...

  • Page 251

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-148 API Mnemonic Operands Function 63 INCD Incremental drum sequencer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * ****S2 ...

  • Page 252

    3. In str u ctio n Se t 3-1495. 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. INCDD100C10M10K5X0CNTC10K100M1013 X0M10M12M11M13M14M10291510151530304025111000234C10C11Current...

  • Page 253

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-150 API Mnemonic Operands Function 64 TTMR Teaching Timer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD *n * * TTMR: 5 step...

  • Page 254

    3. In str u ctio n Se t 3-151n 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: 1. Use TMR instruction to write in 10 groups of set time. 2. Write the set values into D100 ~ D109 in advance 3. The timer resolut...

  • Page 255

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-152 API Mnemonic Operands Function 65 STMR Special Timer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *m * * D * * * ...

  • Page 256

    3. In str u ctio n Se t 3-153X20STMRT10K50Y0Y3X20Y1Y25 sec 5 sec

  • Page 257

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-154 API Mnemonic Operands Function 66 ALT P Alternate State Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * * ALT, ALTP: 3 steps PU...

  • Page 258

    3. In str u ctio n Se t 3-155API Mnemonic Operands Function 67 D RAMP Ramp variable Value Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *D *n * * *RAMP: 9 steps DRAMP: 17 st...

  • Page 259

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-156 If X20 = ON, D10D12D11D11D12D10D10<D11D10 >D11n scansThe scan times is stored in D13n scans Points to note: The variation of the content in D12 according to ON/OFF state of M1026 (Ramp mode selection): X20M1029S...

  • Page 260

    3. In str u ctio n Se t 3-157 API Mnemonic Operands Function 68 DTM P Data Transform and Move Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *D *m * * *n * * *DTM: 9 steps PULSE 16...

  • Page 261

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-158 k2: With n = 2, transform 16-bit data (Hi-byte, Lo-byte) into 8-bit data in the following rule: Hi-byte Lo-byteHi-byte Lo-byteHi-byte Lo-byteHi-byte Lo-byte k3: With n = 2, transform 16-bit data (Lo-byte, Hi-byte)...

  • Page 262

    3. In str u ctio n Se t 3-159k6: When n = 4, transform 8-bit ASCII data (higher 4 bits, lower 4 bits) into HEX data in the following rule: (ASCII value to be transformed includes 0 ~ 9 (0x30~0x39), A ~ F (0x41~0x46), and a ~ f (0x61~0x66).) Hi-byte Lo-byteHi-byte Lo-byteHi-byte Lo-byteHi-by...

  • Page 263

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-160 2. When the total of ramp-up and ramp-down time exceeds the total time for operation, ELC will change the total time for operation (S+2) into “ramp-up time (S+3) + ramp-down time (S+4) + 1” automatically. Explanati...

  • Page 264

    3. In str u ctio n Se t 3-161K10000 K200 K50 K50 3. The optimal positioning results can be obtained as below: Optimal max frequencyOptimal start frequencyD10, D11 D12 K70000 K3334

  • Page 265

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-162 API Mnemonic Operands Function 69 D SORT Data sort Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *m1 * * m2 * * ...

  • Page 266

    3. In str u ctio n Se t 3-163Example table of data sort Columns of data: m2 Data Column 1 2 3 4 5 Column Row Students No. English Math. Physics Chemistry1 (D0)1 (D5)90 (D10)75 (D15)66 (D20)792 (D1)2 (D6)55 (D11)65 (D16)54 (D21)633 (D2)3 (D7)8...

  • Page 267

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-164 API Mnemonic Operands Function 70 D TKY Ten key input Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * D1 * * ******D2...

  • Page 268

    3. In str u ctio n Se t 3-1650 12 3 4 5 67 8 9D0103102101100number keyBCD value 1-digit BCD codeBIN valueoverflowBCD value 2. As shown in the timing diagram below, four keys connected with X35, X33, X31 and X30 are pressed in order. Therefore, the number 5,301 is generated and stored in D0. 9,99...

  • Page 269

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-166 API Mnemonic Operands Function 71 D HKY Hexadecimal key input Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * D1 * D2 ...

  • Page 270

    3. In str u ctio n Se t 3-1672. Input keys 0~9: 0 12 3 4 5 6 7 8 9D0103102101100number key1-digit BCD codeBCD valueBCD valueBIN valueoverflow 3. 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 ...

  • Page 271

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-168 6. External wiring: Y23Y22Y21Y20CX23X22X21X20S/SCDEF89AB45670123PLC(Transistor output)+24V24G Points to note: 1. When HKY instruction is executed, 8 scan cycles (matrix scan) are required for reading the input value s...

  • Page 272

    3. In str u ctio n Se t 3-169API MnemonicOperands Function 72 DSW DIP Switch Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * D1 * D2 ***n * * DSW: 9 steps PULSE 16-bit 32-bit ES2/...

  • Page 273

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-170 3. Please use transistor output for Y20 ~ Y23. Every pin 1, 2, 4, 8 shall be connected to a diode (0.1A/50V) in series before connecting to the input terminals on PLC. Wiring diagram of DIP switch: S/SX20X21X22X23X24X...

  • Page 274

    3. In str u ctio n Se t 3-171API Mnemonic Operands Function 73 SEGD P 7-segment decoder Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * **** ******D ** ******SEGD, SEGDP: 5 steps PULSE 16-bit 32-bit ES2/E...

  • Page 275

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-172 API Mnemonic Operands Function 74 SEGL 7-segment with Latch Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * * ******D * ...

  • Page 276

    3. In str u ctio n Se t 3-1732. When X20 = ON, Y24~Y27 will be scanned in circles automatically. Each circle requires 12 scan cycles. M1029 = ON for a scan cycle whenever a circle is completed. 3. When there is 1 set of 4-digit 7-segment display, n = 0 ~ 3 a) Connect the 7-segment display termi...

  • Page 277

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-174 OnPLCVCCYPull-up resistorSignal outputDrive Y 5. Positive logic (negative polarity) output of BCD code BCD value Y output (BCD code)Signal output b3 b2 b1 b08 4 2 1 A B C D 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0 1 1 1 1...

  • Page 278

    3. In str u ctio n Se t 3-175’+’: Positive logic (Negative polarity) output ‘-’: Negative logic (Positive polarity) output 9. The polarity of PLC transistor output and the polarity of the 7-segment display input can be designated by the setting of n.

  • Page 279

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-176 API Mnemonic Operands Function 75 ARWS Arrow switch Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * D1 *****D2 * ...

  • Page 280

    3. In str u ctio n Se t 3-177X0ARWSX20D20Y20K0 1248103102101100Y20Y21Y22Y23Y27Y26Y25Y24Digit indicationLEDX21X20X22X23Minus / downMove to leftMove to right7-segment display for the 4-digit set valueAdd / upThe 4 switches are used for moving the digits and modifying set values.

  • Page 281

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-178 API Mnemonic Operands Function 76 ASC ASCII code conversion Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS D ***ASC: 11...

  • Page 282

    3. In str u ctio n Se t 3-179API MnemonicOperands Function 77 PR Print (ASCII Code Output) Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ***D * PR: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 E...

  • Page 283

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-180 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 X2...

  • Page 284

    3. In str u ctio n Se t 3-181API Mnemonic Operands Function 78 D FROMP Read CR data from Special Modules Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E Fm1 * * *m2 * * *D *n * * *FROM, FROMP: ...

  • Page 285

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-182 API Mnemonic Operands Function 79 D TO P Write CR data into Special Modules Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E Fm1 * * *m...

  • Page 286

    3. In str u ctio n Se t 3-183CR #10CR #9Upper 16-bit Lower 16-bitSpecified CR number 4. n: Number of data to be written at a time. n = 2 in 16-bit instruction has the same operation results as n = 1 in 32-bit instruction. D0D1D2D3D4D5CR #5CR #6CR #7CR #8CR #9CR #10D0D1D2D3D4D5CR #5CR #6CR #7CR ...

  • Page 287

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-184 API Mnemonic Operands Function 80 RS Serial Communication Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *m * * *D ...

  • Page 288

    3. In str u ctio n Se t 3-185suggested to connect the RST M1123 instruction after the drive contact M1123. MOVD1120H86M1002SETM1120MOVD1129K100X0M1123RSTM1123RSD100K10D120K10Pulses for sending requestPulseReceivingcompletedSet up communication protocol as 9600, 7, E, 1Retain communication proto...

  • Page 289

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-186 Receiving data: (External equipment -> PLC) D120LD122LD123LD124LD125LD126LD121LRegisters for received data, starting from the lower 8 bitsof D120length = 7STXETX1ETX2 3. The STX and ETX of external equipments will be...

  • Page 290

    3. In str u ctio n Se t 3-187Program Example 3: COM2 RS-485 1. Connect PLC to VFD-B series AC motor drives (AC motor drive in ASCII Mode; PLC in 16-bit mode and M1161 = OFF). 2. Write the data to be sent into registers starting from D100 in advance in order to read 6 data starting from address ...

  • Page 291

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-188 Registers for received data (VFD-B responds with messages) Register Data Explanation D120 low ‘: ’ 3A H STX D120 high ‘0’ 30 H ADR 1 D121 low ‘1’ 31 H ADR 0 D121 high ‘0’ 30 H CMD 1 D122 low ‘3’ 33 H...

  • Page 292

    3. In str u ctio n Se t 3-1891. 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). MOVD1120H86M1...

  • Page 293

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-190 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. Co...

  • Page 294

    3. In str u ctio n Se t 3-191Receving data: (External equipment→PLC) D120LD122LD123LD124LD125LD126LD121LRegisters for rstarting fromlower 8 bits of D120eceived data, Length = 7 Program Example 6: COM3 RS-485 1. Only 8-bit mode is supported. Communication format and speed are specified by lower...

  • Page 295

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-192 Sending data: (PLC→External equipment) D100LD101LD102LD103LSource data register, starting fromlower 8 bits of D100Length = 4 Receving data: (External equipment→PLC) D120LD122LD123LD124LD125LD126LD121LRegisters for r...

  • Page 296

    3. In str u ctio n Se t 3-193Flag Function Action M1314 COM1 Data receiving completed. When data receiving of communication instructions is completed, M1314 will be ON. Users can process the received data when M1314 is ON. When data processing is completed, M1314 has to be reset by users. Suppo...

  • Page 297

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-194 Flag Function Action content in D1120 is changed. M1121 Data transmission ready. M1121 = OFF indicates that RS-485 in COM2 is transmitting System sets M1122 Sending request. Before executing communication instructions,...

  • Page 298

    3. In str u ctio n Se t 3-195Flag Function Action M1129 Receiving time out. If users set up time-out value in D1129 and the data receiving time exceeds the time-out value, M1129 will be set ON. System sets and user resets M1131 In ASCII mode, M1131 = ON only when MODRD/RDST/MODRW data is being ...

  • Page 299

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-196 Special register Function D1050~D1055 Converted data for Modbus communication data processing. PLC automatically converts the ASCII data in D1070~D1085 into Hex data and stores the 16-bit Hex data into D1050~D1055 Suppo...

  • Page 300

    3. In str u ctio n Se t 3-197Special register Function is cleared. D1130 COM2 (RS-485) Error code returning from Modbus. RS instruction is not included.. Supported communication instructions: MODRD / MODWR / FWD / REV / STOP / RDST / RSTEF / MODRW D1168 The specific end word to be detected for R...

  • Page 301

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-198 Flag Function Action M1317 Data receiving ready. When M1317 is ON, PLC is ready for data receiving. System sets M1318 COM3 data receiving completed. System sets, user resets M1319 COM3 data receiving error. M1319 wil...

  • Page 302

    3. In str u ctio n Se t 3-199 COM1 COM2 COM3 Function Description - M1121- Indicate transmission status M1312 M1122M1316Sending request - M1126- Set STX/ETX as user/system defined. (RS) - M1130- Set STX/ETX as user/system defined. (RS) - D1124 - Definition of STX (RS) - D1125 - Definition of ETX...

  • Page 303

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-200 COM1 COM2 COM3 Function Description D1250 - D1253 Communication error code - M1129 - COM2 (RS-485) receiving time out - M1140 - COM2 (RS-485) MODRD/MODWR/MODRW data receiving error - M1141 - MODRD/MODWR/MODRW parameter...

  • Page 304

    3. In str u ctio n Se t 3-201b9 (D1120)ETX1 0: None 1: D1125 b10 (D1120) ETX2 0: None 1: D1126 b11~b15 N/A 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 communic...

  • Page 305

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-202 H0002 Checksum error H0003 Exception Code exists H0004 Command code error / data error H0005 Communication data length error 9. Corresponding table between D1167~D1169 and the associated interrupt pointers. (Only lower ...

  • Page 306

    3. In str u ctio n Se t 3-203‘0’ ‘0’: Broadcasting to all drives (Broadcast) ‘0’ ‘1’: toward the drive at address 01 ‘0’ ‘F’: toward the drive at address 15 ‘1’ ‘0’: toward the drive at address 16 … and so on, max. address: 254 (‘FE’) Function code: ‘0’...

  • Page 307

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-204 Field Name Descriptions START Refer to the following explanation Address Communication address: n 8-bit binary Function Function code: n 8-bit binary DATA (n-1) ……. DATA 0 Data: n × 8-bit data CRC CHK Low CRC CH...

  • Page 308

    3. In str u ctio n Se t 3-205 Step 5: Repeat step 3 – 4 to finish all operation on all the 8 bits. Step 6: Repeat step 2 – 5 until the operation of all the messages are completed. The final value obtained in the CRC register is the CRC checksum. Care should be taken when placing t...

  • Page 309

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-206 Timing diagram: SET M1122 X0RS executes X20MODRD/RDST/MODRW data receiving/converting completedM1127Coverting data ofMODRDto hexadecimal/RDST/MODRWM1131Transmission ready M1121Sending request M1122Receiving complete...

  • Page 310

    3. In str u ctio n Se t 3-207API Mnemonic Operands Function 81 D PRUN P Parallel Run Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * D ** PRUN, PRUNP: 5 stepsDPRUN, DPRUNP: 9 steps PULSE 16-bit 32-bit...

  • Page 311

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-208 API Mnemonic Operands Function 82 ASCI P Convert Hex to ASCII Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * * ****D * ...

  • Page 312

    3. In str u ctio n Se t 3-2094. When n = 4, the bit structure will be as: 00000001001000110123D10=0123 HD20D2100110001001100000011001100110010131H030H333H232Hhigh bytelow bytehigh bytelow byte 5. When n is 6, the bit structure will be as: 00000101110 0000000 0 0 100101 1 1111 001 10 101 1 0 1001...

  • Page 313

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-210 D27 low byte D27 high byte n D K9 K10 K11 K12 K13 K14 K15 K16 D20 low byte “B” “A” “9” “8” “F” “E” “D” “C” D20 high byte “4” “B” “A” “9” “8” “F” “E” ...

  • Page 314

    3. In str u ctio n Se t 3-21100000001001000110123D10=0123 H000000011000000000110013332100010000ASCII code of "2" in D20 is 32HASCII code of "3" in D21 is 33H 5. When n is 4, the bit structure will be as: 00000101110 0000000 0 0 000000 0 0001 1000123D10 = H 0123b15b15Converted...

  • Page 315

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-212 n D K9 K10 K11 K12 K13 K14 K15 K16 D20 “B” “A” “9” “8” “F” “E” “D” “C” D21 “4” “B” “A” “9” “8” “F” “E” “D” D22 “5” “4” “B” “A” ...

  • Page 316

    3. In str u ctio n Se t 3-213 PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2Operands: S: Source device D: Destination device n: number of bytes to be converted (n = 1~256) Explanations: 1. 16-bit conversion mode: When M1161 = OFF, the instruction converts n...

  • Page 317

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-214 4. When n = 4, the bit structure will be as: 0100101110000000000011010101100 01001 111011110111CDEFD10 D20D2144H D46H F43H C45H E 5. When n = 1 ~ 16: D n D13 D12 D11 D10 1 ***C H 2 ...

  • Page 318

    3. In str u ctio n Se t 3-215S ASCII code HEX conversion S ASCII code HEX conversion D24 H 38 “8” D29 H 35 “5” D30 H 36 “6” D33 H 31 “1” D31 H 37 “7” D34 H 32 “2” D32 H 30 “0” D35 H 33 “3” 3. When n is 2, the bit structure will be as 1110000001010000000101001CDD10...

  • Page 319

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-216 API Mnemonic Operands Function 84 CCD P Check Code Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ****D * ****n * ...

  • Page 320

    3. In str u ctio n Se t 3-217Program 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. X0CCDD0D100K6M1000M1161 0000011111000010000000000001000...

  • Page 321

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-218 API Mnemonic Operands Function 85 VRRD P Volume Read Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS TC D E FS ** D * ****** *VRRD, VRRDP: 5...

  • Page 322

    3. In str u ctio n Se t 3-219API Mnemonic Operands Function 86 VRSC P Volume Scale Read Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS TC D E FS * * D ******* *VRSC, VRSCP: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 ...

  • Page 323

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-220 API Mnemonic Operands Function 87 D ABS P Absolute Value Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ******ABS, ABSP: 3 steps ...

  • Page 324

    3. In str u ctio n Se t 3-221API Mnemonic Operands Function 88 D PID PID control Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *S3 *D *PID : 9 steps DPID: 17 steps PULS...

  • Page 325

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-222 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 progra...

  • Page 326

    3. In str u ctio n Se t 3-223Device 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 valu...

  • Page 327

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-224 Device No. Function Setup Range Explanation S3+10, 11: Accumulated integral value Available range of 32-bit floating point The accumulated integral value is usually for reference. Users can clear or modify it (in 32-bit...

  • Page 328

    3. In str u ctio n Se t 3-225Device No. Function Set-point rangeExplanation S3+1: Proportional gain (KP) 0~30,000(%) The proportion for magnifying/minifying the error between SV and PV. Integration gain (KI) 0~30,000(%) The proportion for magnifying/minifying the integral value (The accumulated...

  • Page 329

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-226 Device No. Function Set-point rangeExplanation 2,147,483,647 be -1,000 when it is smaller than -1,000. S3+11, 12: Upper bound of integral value, 32-bit -2,147,483,648~ 2,147,483,647 Ex: if S3+8 is set as 1,000, the inte...

  • Page 330

    3. In str u ctio n Se t 3-227MV : Output value PK : Proprotional gain ( )tE: Error value PV (t): Present measured value SV (t): Target value DK : Derivative gain ()StPV: Derivative value of PV(t) IK : Integral gain ()StE1 : Integral value of E(t) When ()tE is smaller than 0 as the control mode ...

  • Page 331

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-228 The equation is exclusively for temperature control will be modified as: ()()() ⎥⎦⎤⎢⎣⎡+⎟⎠⎞⎜⎝⎛+=StEKStEKtEKMVDIP*111, where ()()()tPV-tSVtE= Control diagram: In diagram below, 1/KI and 1/KP re...

  • Page 332

    3. In str u ctio n Se t 3-229 Control diagram: G(s)S1/S1/TITD+++PID operation is within dotted area P+K 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 function...

  • Page 333

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-230 PIDS+MVSpeed instruction (S)Acceleration/deceleration instruction (SV)Acceleration/decelerationoutput (MV)Actual acceleration/deceleration speed(PV = S - P)AC motordriveSpeeddetectiondevice (P) Example 3: Block diagram ...

  • Page 334

    3. In str u ctio n Se t 3-231When 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. Step 3: Select KP = 10 and increase KI gradually, e.g. 1, 2, 4, 8. KI should not be bigger than KP. Then, increase KD as ...

  • Page 335

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-232 PIDMVD5SVPVD1D1110051105110V10V0rpmrpm3000D111602550V5VWave A Wave Bpressure meterPressureSV (D0)Set valueramp upMVconvertedtospeedVoltageconvertedtoSVSpeedconvertedtovoltageACmotordrive 2800028025020015010050tt...

  • Page 336

    3. In str u ctio n Se t 3-233Application 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 loo...

  • Page 337

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-234 M1MOVK0D5M3MOVD40D30M2MOVK3000D32K3000D32>MOVK0D32K0D32<ADDD30D31D32MOVD32D1116M1PIDD1D1110D10D5M1002MOVK1000D40M0MOVD0D1DIVD32K11D32MOVK255D32K255D32> Application 3: Using auto-tuning for temperature control C...

  • Page 338

    3. In str u ctio n Se t 3-235M1002MOVD20ENDK4000MOVD200K400 MOVD10K800 TOK2K0 K1K2 M1013FROMK6K0 K1D11 M0MOVD204K3RSTM0 M1PIDD11D10 D0D200 GPWMD20D0 Y0 Results of initial auto-tuning Auto tuning areaS3+4 = k3PID control areaS3+4 = k4Auto tuning areaS3+4 = k3PID control areaS3+4 = k4 Results ...

  • Page 339

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-236 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 a...

  • Page 340

    3. In str u ctio n Se t 3-237API Mnemonic Operands Function 89 PLS Rising-edge output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ** PLS: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ...

  • Page 341

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-238 API Mnemonic Operands Function 90 LDP Rising–edge detection operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * **LDP:...

  • Page 342

    3. In str u ctio n Se t 3-239API Mnemonic OperandsFunction 91 LDF Falling–edge detection operationControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * **LDF: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES...

  • Page 343

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-240 API Mnemonic Operands Function 92 ANDP Rising-edge series connection Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * **ANDP: 3 ...

  • Page 344

    3. In str u ctio n Se t 3-241API Mnemonic OperandsFunction 93 ANDF Falling-edge series connection Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * **ANDF: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2...

  • Page 345

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-242 API Mnemonic Operands Function 94 ORP Rising-edge parallel connection Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * * **ORP: 3 ...

  • Page 346

    3. In str u ctio n Se t 3-243API Mnemonic OperandsFunction 95 ORF Falling-edge parallel connection Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** * **ORF: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2...

  • Page 347

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-244 API Mnemonic Operands Function 96 TMR Timer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 * *TMR: 5 steps PULSE 1...

  • Page 348

    3. In str u ctio n Se t 3-245API Mnemonic Operands Function 97 CNT 16-bit counter Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 * *CNT: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 ...

  • Page 349

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-246 API Mnemonic Operands Function 97 DCNT 32-bit counter Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 * *DCNT: 9 ste...

  • Page 350

    3. In str u ctio n Se t 3-247API Mnemonic Operands Function 98 INV - Inverse operation Controllers ES2/EX2 SS2 SA2 SX2 OP Descriptions Program Steps N/A Invert the current result of the internal PLC operations INV: 1 step PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2...

  • Page 351

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-248 API Mnemonic Operands Function 99 PLF Falling-edge output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * PLF: 3 steps PULSE 16-...

  • Page 352

    3. In stru ctio n Set 3-249API MnemonicOperands Function 100 MODRD Read Modbus Data Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *n * * *MODRD: 7 steps PULSE 16-bit 32-bit ES2/EX2...

  • Page 353

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-250 Program Example 1: Communication between PLC and VFD-B series AC motor drives (ASCII Mode, M1143 = OFF) MOVD1120H87M1002SETM1120M1127ReceivingcompletedSet communication protocol as 9600, 8, E, 1Retain communication protocol S...

  • Page 354

    3. In stru ctio n Set 3-251Registers for received data (responding messages) Register Data Descriptions D1070 low byte ‘0’ 30 HADR 1 D1070 high byte ‘1’ 31 HADR 0 D1071 low byte ‘0’ 30 HCMD 1 D1071 high byte ‘3’ 33 HCMD 0 D1072 low byte ‘0’ 30 HD1072 high byte ‘C’ 43 HNum...

  • Page 355

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-252 Program Example 2: Communication between PLC and VFD-B series AC motor drive (RTU Mode, M1143= ON) MOVD1120H87M1002SETM1120MOVD1129K100M1127ReceivingcompletedSet communication protocol as 9600, 8, E, 1Retain communication pro...

  • Page 356

    3. In stru ctio n Set 3-253D1077 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...

  • Page 357

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-254 API Mnemonic Operands Function 101 MODWR Write Modbus Data Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *n *...

  • Page 358

    3. In stru ctio n Set 3-255Program Example 1: Communication between PLC and VFD-B series AC motor drives (ASCII Mode, M1143 = OFF) MOVD1120H87M1002SETM1120M1127RSTM1127ReceivingcompletedSet communication protocol as 9600, 8, E, 1Retain communication protocol Set receiving timeout as 100msProces...

  • Page 359

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-256 Registers for received data (responding messages) Register Data Descriptions D1070 low ‘0’ 30 H ADR 1 D1070 high ‘1’ 31 H ADR 0 D1071 low ‘0’ 30 H CMD 1 D1071 high ‘6’ 36 H CMD 0 D1072 low ‘0’ 30 H D1072 h...

  • Page 360

    3. In stru ctio n Set 3-257Registers 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 Data address D1093 low 00 H D1094 low 12 H Data content D1095 low 02 H CRC C...

  • Page 361

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-258 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...

  • Page 362

    3. In stru ctio n Set 3-259API MnemonicOperands Function 102 FWD Forward Operation of VFD Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *n * * *FWD: 7 steps PULSE 16-bit 32-bit ES2...

  • Page 363

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-260 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 op...

  • Page 364

    3. In stru ctio n Set 3-261D1089 low ‘C’ 43 H Header of control string D1090 low ‘♥’ 03 H Checksum D1091 low ‘☺’ 01 H Command acknowledgement (communication mode) D1092 low ‘0’ 30 H D1093 low ‘0’ 30 H D1094 low ‘0’ 30 H D1095 low ‘1’ 31 H Communication address D1...

  • Page 365

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-262 Program Example: COM2 (RS-485) Communication between PLC and VFD-B series inverter (ASCII Mode, M1143 = OFF), Retry when communication time-out occurs. M1002MOVH86D1120SETM1120MOVK100D1129RSTM1127M1127X0FWDK1K500K0SETM1122M11...

  • Page 366

    3. In stru ctio n Set 3-263‘1’ 31 H ‘2’ 32 H ‘0’ 30 H ‘1’ 31 H ‘F’ 46 H ‘4’ 34 H Data content 2 Operation frequency = K500Hz H01F4 ‘C’ 43 H LRC CHK 1 ‘2’ 32 H LRC CHK 0 Error checksum: LRC CHK (0,1) Received data (responding messages) Data Descriptions ‘0’ 30...

  • Page 367

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-264 API Mnemonic Operands Function 105 RDST Read VFD Status Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *n * * *RDST: 5 steps ...

  • Page 368

    3. In stru ctio n Set 3-265A D1077 low B D1078 low C D1079 low D 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. D1080 low Nn ...

  • Page 369

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-266 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 u...

  • Page 370

    3. In stru ctio n Set 3-267‘0’ 30 H‘0’ 30 H‘0’ 30 H‘5’ 35 HNumber of data (count by word) ‘D’ 44 HLRC CHK 1 ‘6’ 36 HLRC CHK 0 Error checksum: LRC CHK (0,1) Received data (responding messages) Data Descriptions ‘0’ 30 HADR 1 ‘1’ 31 HADR 0 ‘0’ 30 HCMD 1 ‘3’ ...

  • Page 371

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-268 API Mnemonic Operands Function 106 RSTEF Reset Abnormal VFD Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *n * * *RSTEF: 5 s...

  • Page 372

    3. In stru ctio n Set 3-269M1002MOVH86D1120SETM1120MOVK100D1129RSTM1127M1127X0RSTEFK1K0SETM1122M1129X0Processing received dataReceiving completedCommunication instruction setting: Device address: 1 K0: ReservedSet up communication protocol as 9600, 7, E, 1Retain communication protocolSet up co...

  • Page 373

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-270 Received data (responding messages) Data Descriptions ‘0’ 30 H ADR 1 ‘1’ 31 H ADR 0 ‘0’ 30 H CMD 1 ‘6’ 36 H CMD 0 ‘2’ 32 H ‘0’ 30 H ‘0’ 30 H ‘2’ 32 H Data address ‘0’ 30 H ‘0’ 30 H ‘0...

  • Page 374

    3. In stru ctio n Set 3-271API Mnemonic Operands Function 107 LRC P LRC checksum Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *n * * *D *LRC, LRCP: 7 steps PULSE 16-bit 32-bit ES2/EX2 SS...

  • Page 375

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-272 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 VF...

  • Page 376

    3. In stru ctio n Set 3-273and 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 ‘: ’ Start word = ‘: ’ (3AH) Address Hi ‘ 0 ’ Address Lo ‘ 1 ’ Communication: 8-bit address co...

  • Page 377

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-274 API Mnemonic Operands Function 108 CRC P CRC checksum Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *n * * *D *CRC,...

  • Page 378

    3. In stru ctio n Set 3-275Program 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. M1002MOVH86D1120SETM1120Sending request pulseWrite data to be sent in advanceSETM1122MOVK100D1129X0R...

  • Page 379

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-276 API Mnemonic Operands Function 110 D ECMP P Floating point compare Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *D *...

  • Page 380

    3. In stru ctio n Set 3-277API Mnemonic Operands Function 111 D EZCP P Floating point zone compare Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *S * * *D ** * DEZCP, DEZCPP: 17 step...

  • Page 381

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-278 API Mnemonic Operands Function 112 D MOVR P Move floating point dataControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS D ** ****DMOVR, D...

  • Page 382

    3. In stru ctio n Set 3-279API Mnemonic Operands Function 116 D RAD P Degree Radian Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DRAD, DRADP: 9 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX...

  • Page 383

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-280 API Mnemonic Operands Function 117 D DEG P Radian Degree Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DDEG, DDEGP: 9 ste...

  • Page 384

    3. In stru ctio n Set 3-281API Mnemonic OperandsFunction 118 D EBCD P Float to scientific conversion Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *D *DEBCD, DEBCDP: 9 steps PULSE 16-bit 32-bit ES2/...

  • Page 385

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-282 API Mnemonic Operands Function 119 D EBIN P Scientific to float conversion Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *D *DEB...

  • Page 386

    3. In stru ctio n Set 3-283K314MOVPX0D0D0DEBIND2K-2MOVPD1K314 D0 [D1]K-2 D1 [D0]314 x10(D1 D0) (D3 D2), , 314 x10-2BinaryFloating Point

  • Page 387

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-284 API Mnemonic Operands Function 120 D EADD P Floating point addition Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *D ...

  • Page 388

    3. In stru ctio n Set 3-285API Mnemonic Operands Function 121 D ESUB P Floating point subtraction Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *D *DESUB, DESUBP: 13 steps PULSE 16-bit 3...

  • Page 389

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-286 API Mnemonic Operands Function 122 D EMUL P Floating point multiplication Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * ...

  • Page 390

    3. In stru ctio n Set 3-287API Mnemonic Operands Function 123 D EDIV P Floating point division Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *D *DEADD, DEADDP: 13 steps PULSE 16-bit 32-b...

  • Page 391

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-288 API Mnemonic Operands Function 124 D EXP P Float exponent operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DEXP, DE...

  • Page 392

    3. In stru ctio n Set 3-289API Mnemonic OperandsFunction 125 D LN P Float natural logarithm operationControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DLN, DLNP: 9 steps PULSE 16-bit 32-bit ES2/EX2 SS2 ...

  • Page 393

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-290 API Mnemonic Operands Function 126 D LOG P Float logarithm operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *D ...

  • Page 394

    3. In stru ctio n Set 3-291API Mnemonic Operands Function 127 D ESQR P Floating point square rootControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DESQR, DESQRP: 9 steps PULSE 16-bit 32-bit ES2/EX2 SS2...

  • Page 395

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-292 API Mnemonic Operands Function 128 D POW P Floating point power operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * ...

  • Page 396

    3. In stru ctio n Set 3-293API Mnemonic Operands Function 129 D INT P Float to integer Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ***D ***INT, INTP: 5 steps DINT, DINTP: 9 steps PULSE 16-bit 32-bit ES...

  • Page 397

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-294 API Mnemonic Operands Function 130 D SIN P Sine Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DSIN, DSINP: 9 steps PULSE ...

  • Page 398

    3. In stru ctio n Set 3-295Program 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. D10FLTM1000D14K31415926 K1800000000D20D14D40K30MOVPX0D10K60X1D10D50D40DEDIVDSIND20MOVPDEMUL(K30 D10)(K60 D10)(...

  • Page 399

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-296 API Mnemonic Operands Function 131 D COS P Cosine Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DCOS, DCOSP: 9 steps PULS...

  • Page 400

    3. In stru ctio n Set 3-297Program 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.. M1002SETM1018X0DCOSD0D10 D 1D 0D 11D 10Degree...

  • Page 401

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-298 API Mnemonic Operands Function 132 D TAN P Tangent Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DTAN, DTANP: 9 steps PUL...

  • Page 402

    3. In stru ctio n Set 3-299D1D0D11D10TAN valuebinary floating pointbinary floating pointRAD value(degree x / 180)π 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 va...

  • Page 403

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-300 API Mnemonic Operands Function 133 D ASIN P Arc Sine Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DASIN, DASINP: 9 steps ...

  • Page 404

    3. In stru ctio n Set 3-301API Mnemonic Operands Function 134 D ACOS P Arc Cosine Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DACOS, DACOSP: 9 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX...

  • Page 405

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-302 API Mnemonic Operands Function 135 D ATAN P Arc Tangent Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DATAN, DATANP: 9 ste...

  • Page 406

    3. In stru ctio n Set 3-303API Mnemonic Operands Function 143 DELAY P Delay Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *DELAY, DELAYP: 3 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ES2...

  • Page 407

    DVP-ES 2/EX 2/SS2/S A2 /SX2 Operat io n Manu al - Pro g rammi ng 3-304 API Mnemonic Operands Function 144 GPWM General PWM output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *D * * * G...

  • Page 408

    3. In stru ctio n Set 3-305API Mnemonic Operands Function 147 D SWAPP Byte swap Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ** ******SWAP, SWAPP: 3 stepsDSWAP, DSWAPP: 5 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 S...

  • Page 409

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-306 API Mnemonic Operands Function 150 MODRW MODBUS Read/ WriteControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *S3 * *...

  • Page 410

    3. In str u ctio n Se t 3-3071 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. n: Data length for accessing. When S2 (MODBUS function code)...

  • Page 411

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-308 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....

  • Page 412

    3. In str u ctio n Se t 3-309D1259 High ‘0’ 30 HD1260 Low ‘0’ 30 HD1260 High ‘0’ 30 HD1261 Low ‘1’ 31 HD1261 High ‘0’ 30 HNumber of Data(count by bit) D1262 Low ‘E’ 45 HLRC CHK 1 D1262 High ‘8’ 38 HLRC CHK 0 Checksum: LRC CHK (0,1) Registers for received data (respon...

  • Page 413

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-310 D1260 Low 00 H D1261 Low 10 H Number of Data (count by word) D1262 Low 79 H CRC CHK Low D1263 Low 0A H CRC CHK High Registers for received data (responding messages) Register Data Descriptions D0 1234 H PLC stores the ...

  • Page 414

    3. In str u ctio n Se t 3-311H87MOVM1002D1109SETM1136K100MOVD1252MODRWK2K1X0H0500D0K16Connection device address: K1Function code: K2read multiple bitsData address: Y0=H0500Data storing registerData length(bit)SETX0M1316M1320 = OFF, ASCII modeRSTM1320SETM1320Set communication protocol as 9600, 8...

  • Page 415

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-312 PLC2 PLC1, PLC1 receives: “01 02 02 34 12 2F 75” PLC data receiving register: Register Data Descriptions D0 1234 H PLC converts the data in address 0500H ~ 0515H and stores the converted data automatically. Analys...

  • Page 416

    3. In str u ctio n Se t 3-3132. For ASCII or RTU mode, PLC COM2 stores the data to be sent in D1256~D1295, converts the received data in registers starting from S, and stores the converted 16-bit data in D1296 ~ D1311. 3. Take the connection between PLC (PLC COM2) and VFD-B for example, the tab...

  • Page 417

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-314 D1259 High byte ‘0’ 30 HD1260 Low byte ‘0’ 30 HD1260 High byte ‘0’ 30 HD1261 Low byte ‘0’ 30 HD1261 High byte ‘6’ 36 HNumber of data (count by word) D1262 Low byte ‘D’ 44 HLRC CHK 1 D1262 High by...

  • Page 418

    3. In str u ctio n Se t 3-315D12 low byte ‘3’33 HD12 high byte ‘6’36 Haddress H2104 PLC COM2 automatically converts ASCII codes to hex and stores the converted value in D1300 D13 low byte ‘0’30 HD13 high byte ‘0’30 HD14 low byte ‘0’30 HD14 high byte ‘0’30 HContent of add...

  • Page 419

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-316 D7 low byte 0B H D8 low byte B8 H Content of address H2102 0BB8 H PLC COM2 automatically stores the value in D1298 D9 low byte 0B H D10 low byte B8 H Content of address H2103 0BB8 H PLC COM2 automatically store the v...

  • Page 420

    3. In str u ctio n Se t 3-317H87MOVM1002D1109SETM1136K100MOVD1252MODRWK3K1X0H2100D0K6Connection deviceaddress: K1Function code:Read multiple words K3 Data address: H2100Data storing registerData length(word)SETX0M1316M1320 = OFF ASCII modeRSTM1320SETM1320Set communication protocol as 9600, 8, E,...

  • Page 421

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-318 D5 0000 H PLC converts ASCII codes in 2105 H and stores the converted data automatically. RTU mode (COM3: M1320 = ON COM1: M1139 = ON): When X0 = ON, MODRW instruction executes the function specified by Function Code ...

  • Page 422

    3. In str u ctio n Se t 3-319H87MOVM1002D1120SETM1120K100MOVD1129RSTM1127MODRWK5K1X0H0500D0K1Function Code K5: Force ON/OFF bit device ReservedForce ON status (Set FF00H)M1127SETX0M1122RSTM1143SETM1143Connection device address: K1Data address : Y0 = H0500M1143 = OFFASCII modeReset M1127Set comm...

  • Page 423

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-320 Registers for received data (responding messages) Register Data Descriptions D1070 low byte ‘0’ 30 HADR 1 D1070 high byte ‘1’ 31 HADR 0 D1071 low byte ‘0’ 30 HCMD 1 D1071 high byte ‘5’ 35HCMD 0 D1072 low...

  • Page 424

    3. In str u ctio n Se t 3-321Register Data Descriptions D1074 Low byte FF H D1075 Low byte 00 H Data content (ON = FF00H) D1076 Low byte 8C H CRC CHK Low D1077 Low byte F6 H CRC CHK High Program example 6: COM1(RS-232) / COM3(RS-485), Function Code H05 1. Function Code K5 (H05): Force ON/OFF bit...

  • Page 425

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-322 ASCII mode (COM3: M1320 = OFF, COM1: M1139 = OFF): When X0 = ON, MODRW instruction executes the function specified by Function Code 05 PLC1 PLC2, PLC sends: “01 05 0500 FF00 6F” PLC2 PLC1, PLC receives: “01 05 ...

  • Page 426

    3. In str u ctio n Se t 3-323ASCII 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 ...

  • Page 427

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-324 RTU mode (M1143 = ON) When X0 = ON, MODRW instruction executes the function specified by Function Code 06 PLC VFD-B, PLC sends: “01 06 2000 1770 8C 1E” VFD-B → PLC, PLC receives: “01 06 2000 1770 8C 1E” Regi...

  • Page 428

    3. In str u ctio n Se t 3-3256. M1318→M1314: receiving completed flag H8 7MOVM1002D1109SETM1136K1 00MOVD1 252MODRWK6K1X0H200 0D50K1Connection device address: K1Function code: K6 Write in single Word dataData address: H2000Data register: D50=H1770Data lengthSETX0M1316RSTM1320SETM1320M1320 = ONA...

  • Page 429

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-326 Set value: K4Y0=1234H Device Status Device StatusDeviceStatusDeviceStatus Y0 OFF Y1 OFF Y2 ON Y3 OFF Y4 ON Y5 ON Y6 OFF Y7 OFF Y10 OFF Y11 ON Y12 OFF Y13 OFF Y14 ON Y15 OFF Y16 OFF Y17 OFF H87MOVM1002D1120SETM1120K100MO...

  • Page 430

    3. In str u ctio n Se t 3-327D1260 下 ‘0’ 30 H D1260 上 ‘0’ 30 H D1261 下 ‘1’ 31H D1261 上 ‘0’ 30 H Number of Data (count by bit) D1262 下 ‘0’ 30 H D1262 上 ‘2’ 32 H Byte Count D1263 下 ‘3’ 33 H D1263 上 ‘4’ 46 H D1264 下 ‘1’ 33 H D1264 上 ‘2’ 46...

  • Page 431

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-328 D1259 下 00 H D1260 下 00 H D1261 下 10 H Number of Data(count by bit) D1262 下 02 H Byte Count D1263 下 34 H Data content 1 Content of D0: H34 D1264 下 12 H Data content 2 Content of D1: H12 D1265 下 21 H CRC C...

  • Page 432

    3. In str u ctio n Se t 3-329H87MOVM1002D1109SETM1136K100MOVD1252Set communication protocol as 9600, 8, E, 1Retain communication protocol Set receiving timeout as 100msMODRWK15K1X0H0500D0K16Connection deviceaddress: K1Function code: K15Write in multiple bit devicesData address: H0500Data storing...

  • Page 433

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-330 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. H87MOVM1002D1120SETM1120K100MOVD1129RSTM1127Set comm...

  • Page 434

    3. In str u ctio n Se t 3-331D1261 High byte ‘2’ 32 HD1262 Low byte ‘0’ 30 HD1262 High byte ‘4’ 34 HByte Count D1263 Low byte ‘1’ 31 HD1263 High byte ‘7’ 37 HD1264 Low byte ‘7’ 37 HD1264 High byte ‘0’ 30 HData contents 1 The content of register D50: H1770(K6000) D1265...

  • Page 435

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-332 D1258 Low byte 20 H D1259 Low byte 00 H Data Address D1260 Low byte 00 H D1261 Low byte 02 H Number of Register D1262 Low byte 04 H Byte Count D1263 Low byte 17 H D1264 Low byte 70 H Data content 1 The content of D50: H...

  • Page 436

    3. In str u ctio n Se t 3-333H87MOVM1002D1109SETM1136K100MOVD1252MODRWK16K1X0H2000D50K2Connection device address: K1Function Code: K16Write in multiple Word data Data address: H2000Datat register: D50 = H1770, D51=H12Data length: K2SETX0M1316RSTM1320SETM1320M1320 = OFFASCII modeSet communication...

  • Page 437

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-334 API Mnemonic Operands Function 154 D RAND P Random number Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ******S2 * * *...

  • Page 438

    3. In str u ctio n Se t 3-335API Mnemonic Operands Function 155 D ABSR Absolute position read Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS * ** * D1 ** * D2 ** *****DABSR: 13 steps PULSE 16-bit 32-bit E...

  • Page 439

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-336 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...

  • Page 440

    3. In str u ctio n Se t 3-3374. 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 tran...

  • Page 441

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-338 API Mnemonic Operands Function 156 D ZRN Zero return Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word Devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS TCDEFS1 * * * * * * **** S2 * * * * * * *...

  • Page 442

    3. In str u ctio n Se t 3-3397. When DZRN instruction executes, external interrupt I40x (Y0) or I60x (Y2) in program will be disabled until DZRN instruction is completed. Also. If left limit switch (X5 / X7) is enabled during instruction execution, external interrupt will be disabled as well. 8...

  • Page 443

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-340 OffOnOnOffOnLimit switch X5/X7Limit switch ONOffReverse outputEnd flag M1029/M1102DOG switch: X4/X6Freq.Target freq.JOG freq.TimeStartDOG switch ON DOG switch OFFReverse outputForward outputLimit switch OFF Program Exam...

  • Page 444

    3. In str u ctio n Se t 3-341 API Mnemonic Operands Function 157 D PLSV Adjustable Speed Pulse Output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word Devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS TCDEF S * ** * * * ***** D1 * D2 * * * PLSV: 7 steps DPL...

  • Page 445

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-342 API Mnemonic Operands Function 158 D DRVI Relative Position Control Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 * * * ** ******S2 *...

  • Page 446

    3. In str u ctio n Se t 3-34312. 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. DRVI instruction support...

  • Page 447

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-344 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, instru...

  • Page 448

    3. In str u ctio n Se t 3-345D1232 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 rec...

  • Page 449

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-346 API Mnemonic Operands Function 159 D DRVA Absolute Position Control Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 * * * ** ******S2 *...

  • Page 450

    3. In str u ctio n Se t 3-34711. 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 imme...

  • Page 451

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-348 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, instru...

  • Page 452

    3. In str u ctio n Se t 3-349API MnemonicOperands Function 160 TCMP P Time compare Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******S3 * **** ******S ***D ** * TCMP, TCMP...

  • Page 453

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-350 API Mnemonic Operands Function 161 TZCP P Time zone compare Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 ***S2 ***S ...

  • Page 454

    3. In str u ctio n Se t 3-351X0M10TZCPD0D20D10M10M11M12ON when ON when ON whenD0 Hour D1 MinuteD2 SecondD10 Hour D11 MinuteD12 SecondD10 Hour D11 MinuteD12 SecondD0 Hour D1 MinuteD2 SecondD10 Hour D11 MinuteD12 SecondD20 Hour D21 MinuteD22 SecondD20 Hour D21 MinuteD22 Second

  • Page 455

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-352 API Mnemonic Operands Function 162 TADD P Time addition Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 ***S2 ***D ...

  • Page 456

    3. In str u ctio n Se t 3-353API Mnemonic Operands Function 163 TSUB P Time subtraction Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS1 ***S2 ***D ***TSUB, TSUBP: 7 steps PULSE 16-bit 32-bit ES2/E...

  • Page 457

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-354 API Mnemonic Operands Function 166 TRD P Time read Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FD ***TRD, TRDP: 3 steps PULSE 16-bit ...

  • Page 458

    3. In str u ctio n Se t 3-3551. There are two methods to correct built-in RTC: Correcting by API167 TWR instruction Please refer to explanation of instruction TWR (API 167) Setting by peripheral device Using WPLSoft / ISPSoft (Ladder editor) 2. Display 4-digit year data: D1319 only stores the...

  • Page 459

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-356 API Mnemonic Operands Function 167 TWR P Time write Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS ***TWR, TWRP: 5 steps PULSE 16-bit...

  • Page 460

    3. In str u ctio n Se t 3-357X0MOVK04D0MOVK2D1MOVK12D2MOVK15D3MOVK15D4MOVK27D5MOVK30D6TWRD0M1017X1Year (2004)Day (Tuesday)Month (December)DayHourMinuteSecondWrite the set time into RTC30 seconds correction

  • Page 461

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-358 API Mnemonic Operands Function 168 D MVM P Mask and Combine Designated Bits Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M SK H KnX KnY KnM KnS T C D E FS1 * ** ******S2...

  • Page 462

    3. In str u ctio n Se t 3-359 API Mnemonic Operands Function 169 D HOUR Hour meter Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X YM S K H KnX KnY KnM KnS T C D E FS * **** ******D1 *D2 ** * HOUR: 7 steps DHOUR: 13 steps PULSE 16-bit 32-bit...

  • Page 463

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-360 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). Y10DHOUR K40000D0Y0X0Y10

  • Page 464

    3. In str u ctio n Se t 3-361API Mnemonic Operands Function 170 D GRY P BIN → Gray Code Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * **** ******D ** ******GRY, GRYP: 5 steps DGRY, DGRYP: 9 steps PULSE 16-bit...

  • Page 465

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-362 API Mnemonic Operands Function 171 D GBIN P Gray Code → BIN Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ** ******D ** ***...

  • Page 466

    3. In str u ctio n Se t 3-363API Mnemonic Operands Function 172 D ADDR P Floating point addition Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *D *DADDR, DADDRP: 13 steps PULSE 16-bit 32-bit...

  • Page 467

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-364 API Mnemonic Operands Function 173 D SUBR P Floating point subtraction Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 ...

  • Page 468

    3. In str u ctio n Se t 3-365API Mnemonic Operands Function 174 D MULR P Floating point multiplication Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *D *DMULR, DMULRP: 13 steps PULSE 16-bit ...

  • Page 469

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-366 API Mnemonic Operands Function 175 D DIVR P Floating point division Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 *D ...

  • Page 470

    3. In str u ctio n Se t 3-367API Mnemonic Operands Function 176 MMOVP 16-bit→32-bit ConversionControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * **** ****D ***MMOV, MMOVP: 5 steps PULSE 16-bit 32-bit ES2/EX2 S...

  • Page 471

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-368 API Mnemonic Operands Function 177 GPS GPS data receiving Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *GPS: 5 steps...

  • Page 472

    3. In str u ctio n Se t 3-369No. Content Range Format Note D + 5 North / South 0 or 1 Word 0(+) North, 1(-) SouthD + 6~7 Longitude 0 ~ 180 Float Unit: ddd.mmmmmm D + 8 East / West 0 or 1 Word 0(+) East, 1(-) WestD + 9 GPS data valid / invalid0, 1, 2 Word 0 = invalid D + 10 Day 1 ~ 31 Word D + ...

  • Page 473

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-370 2. Then enable M0 to execute GPS instruction with sentence identifier $GPGGA M0GPSK0D0SETM1312M0M1314M1315Y0Y1 3. When receiving completed, M1314 = ON. When receiving failed, M1315 = ON. The received data will be store...

  • Page 474

    3. In str u ctio n Se t 3-371 API Mnemonic Operands Function 178 D SPA Solar Cell Positioning Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * *D *DSPA: 9 steps PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SX2 ES2...

  • Page 475

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-372 No. Content Range Format Note 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 Azimuth0 ~ 2000 Word 1LSB = 0.18 degree 3. The execution tim...

  • Page 476

    3. In str u ctio n Se t 3-373 API Mnemonic Operands Function 179 D WSUM P Sum of multiple devices Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ***n * * *D ***WSUM, WSUMP: 7 stepsDWSUM, DWSUMP: 13 ...

  • Page 477

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-374 API Mnemonic Operands Function 180 MAND P Matrix AND Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * ** ****S2 * ** ****D ...

  • Page 478

    3. In str u ctio n Se t 3-375Points 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...

  • Page 479

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-376 API Mnemonic Operands Function 181 MOR P Matrix OR Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * ** ****S2 * ** ****D ...

  • Page 480

    3. In str u ctio n Se t 3-377API Mnemonic Operands Function 182 MXORP Matrix XOR Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *** ****S2 *** ****D ** ****n * * *MXOR, MXORP: 9 steps PULSE 16-bit 32...

  • Page 481

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-378 API Mnemonic Operands Function 183 MXNR P Matrix XNR Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * ** ****S2 * ** ****D ...

  • Page 482

    3. In str u ctio n Se t 3-379API Mnemonic Operands Function 184 MINV P Matrix inverse Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS *** ****D ** ****n * * *MINV, MINVP: 7 steps PULSE 16-bit 32-bit ES2/EX...

  • Page 483

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-380 API Mnemonic Operands Function 185 MCMP P Matrix compare Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * ** ****S2 * ** ****n ...

  • Page 484

    3. In str u ctio n Se t 3-381 D20 = 45, M1091 = ON, M1089 = OFF. D20 = 47, M1091 = OFF, M1089 = ON (comparison proceeds to he last bit) D20 = 1, M1091 = ON, = OFF. X0MCMPPD0D10D20K3 b010 1100010001100010001100111111111D20111000000111101010101011011010101010101010101101010101010b47MCMPb47b00011...

  • Page 485

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-382 API Mnemonic Operands Function 186 MBRD P Matrix bit read Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** ****n * * *D ...

  • Page 486

    3. In str u ctio n Se t 3-383b0D20451010101010110110101010101010101101010101010b4700101PointerD0D1D2 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 ex...

  • Page 487

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-384 API Mnemonic Operands Function 187 MBWR P Matrix bit write Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * ****n * * *...

  • Page 488

    3. In str u ctio n Se t 3-3851b0010101010101011010101010101010101101010101010b47D204511M10961010101010101011010101010101010101101010101010101b47D2045 Before Execution AfterExecutionPointerPointer(Borrow flag for matrix rotation / shift / input)D0D1D2D0D1D2 Points to note: Associated flags a...

  • Page 489

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-386 API Mnemonic Operands Function 188 MBS P Matrix bit shift Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** ****D ** ****n ...

  • Page 490

    3. In str u ctio n Se t 3-387Before executionAfter bits shift to left1b0010101010101011010101010101010101101010101010b15000M10961010101010101001010101010101010101101010101010001M1095M1095MBSM1097=0D0D1D2D0D1D2D20D21D22 Program Example 2: When X1 = ON, M1097 = ON, indicating a right matrix shift ...

  • Page 491

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-388 API Mnemonic Operands Function 189 MBR P Matrix bit rotate Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** ****D ** ****n ...

  • Page 492

    3. In str u ctio n Se t 3-389 Before executionAfter rotation to the left1B0010101010101011010101010101010101101010101010b15001010101010101011010101010101010101101010101010001M1095M1095MBRM1097=0D0D1D2D20D21D22 Program Example 2: When X1 = ON, M1097 = ON, indicating a right matrix rotation is pe...

  • Page 493

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-390 API Mnemonic Operands Function 190 MBC P Matrix bit status count Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * ** ****n * * ...

  • Page 494

    3. In str u ctio n Se t 3-391API Mnemonic Operands Function 191 D PPMR 2-Axis Relative Point to Point Motion Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *S * * *D * DPPMR: 17 steps ...

  • Page 495

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-392 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 ...

  • Page 496

    3. In str u ctio n Se t 3-393M0RST= D0 K1DPPMRD200D202K100000Y0= D0 K2DPPMRD204D206K100000Y0= D0 K3DPPMRD208D210K100000Y0= D0 K4DPPMRD212D214K100000Y0MOVD0M0INCPENDM1029D0M1029K1 3. Operation: When PLC runs and M0 = ON, PLC will start the first point-to-point motion by 100KHz. D0 will pl...

  • Page 497

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-394 API Mnemonic Operands Function 192 D PPMA 2-Axis Absolute Point to Point Motion Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 ...

  • Page 498

    3. In str u ctio n Se t 3-3952. 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...

  • Page 499

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-396 API Mnemonic Operands Function 193 D CIMR 2-Axis Relative Position Arc Interpolation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * ...

  • Page 500

    3. In str u ctio n Se t 3-3976. 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...

  • Page 501

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-398 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 time...

  • Page 502

    3. In str u ctio n Se t 3-3993. 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 f...

  • Page 503

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-400 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 automati...

  • Page 504

    3. In str u ctio n Se t 3-401API Mnemonic Operands Function 194 D CIMA 2-Axis Absolute Position Arc Interpolation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *S *D * DCIMA: 17 ste...

  • Page 505

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-402 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 ...

  • Page 506

    3. In str u ctio n Se t 3-4032. 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...

  • Page 507

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-404 API Mnemonic Operands Function 195 D PTPO Single-axis pulse output by table Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 ...

  • Page 508

    3. In str u ctio n Se t 3-4053. Current executing segment can be monitored by D301. X0D0DPTPOD300Y0END 4. Timing diagram: Frequency (Hz)tttt12....60(D1,D0)(D3,D2)(D239,D238)(D5,D4)(D237,D236)........(D7,D6)Time (S) Points to note: 1. Associated Flags: M1029 CH0 (Y0) pulse output execution comple...

  • Page 509

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-406 API Mnemonic Operands Function 197 D CLLM Close loop position control Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * *S2 * * ...

  • Page 510

    3. In str u ctio n Se t 3-407direction 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...

  • Page 511

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-408 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). When percentage va...

  • Page 512

    3. In str u ctio n Se t 3-409MOVMOVMOVK100K100K100D0M1002D1131D1343D1348SETDMOVK0D1030EIFENDIRETENDDCLLMX4K50000 K100000Y0INCM1534M0M1000I401MOVK100D1340MOVK100D1343MOVK100D1343 2. Execution results: 100kHzD1340D1343X4 = OFF --> OND1340D1348Specified number of output pulses: 50,000Actual numb...

  • Page 513

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-410 present value of output pulses (D1030, D1031) = 0.. MOVMOVMOVK100K600D0M1002D1131D1348SETDMOVK0D1030EIFENDIRETENDDCLLMC243K50000 K100000Y0INCM1534M0M1000I010K200D1340MOVD1343MOVK300D1343DMOVK0C243DCNTC243K9999DHSCSC243K...

  • Page 514

    3. In str u ctio n Se t 3-411a) The actual output number 50,600 – specified output number 50,000 = 600 b) 600 x (1/100Hz) = 6s (idle time) c) 3 seconds are too long. Therefore, increase the percentage value (D1131) to K101. 4. Obatin the results of the second execution: 100KHzD1340D1348D1343C2...

  • Page 515

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-412 is reversed. M1306 Reverse CH1 (Y2, Y3) pulse output direction. M1306 = ON, pulse output direction is reversed M1347 Auto-reset CH0 (Y0, Y1) when high speed pulse output completed. M1347 will be reset after CH0 (Y0, Y1...

  • Page 516

    3. In str u ctio n Se t 3-413API Mnemonic Operands Function 198 D VSPO Variable speed pulse output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 * * *S3 * * *D * DVSPO: 17 steps PULSE 16-b...

  • Page 517

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-414 Freq.Timet1t2t3g1g2g3S2Pulse number 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 r...

  • Page 518

    3. In str u ctio n Se t 3-415Freq.Time2kHzt2=11kHz20msg2=40ms20ms 20ms1kHz2kHzt1=6kHz 3rd shift: Assume t3 = 3kHz, gap frequency = 2kHz, gap time = 20ms Ramp-down steps of 3rd shift: Freq.TimeChange to t3 2kHzt3=3kHzt2=11kHzStart to changeg3=60ms20ms20ms 20ms 20ms For program examples please...

  • Page 519

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-416 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). P...

  • Page 520

    3. In str u ctio n Se t 3-417 API Mnemonic Operands Function 199 D ICF Immediately change frequencyControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 *S2 * * *D * DVSPO: 13 steps PULSE 16-bit 32-bit ES2/E...

  • Page 521

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Manu al - Pro g r ammi ng 3-418 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)...

  • Page 522

    3. In str u ctio n Se t 3-419MOVM0EIMOVMOVFENDDMOVP K100000 D500K1000D502K10D503DVSPOK1000000Y0D502D500MOVM1000MOVMOVIRETDMOVK50000D500K800D502K20D503DICFY0D502D500I601MOVM1000MOVMOVIRETDMOVK0D500K2000D502K100D503DICFY0D502D500I701END

  • Page 523

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-420 API Mnemonic Operands Function 202 SCAL P Proportional calculation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * ...

  • Page 524

    3. In str u ctio n Se t 3-4211. 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 X0SCALK500K168K-4D0 D10 = 500Slope=168Offset=-4Destination valueSou...

  • Page 525

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-422 API Mnemonic Operands Function 203 D SCLP P Parameter proportional calculation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S...

  • Page 526

    3. In str u ctio n Se t 3-4236. 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. desti...

  • Page 527

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-424 D0S=5001= 30= 500Source valueDestination value 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 ...

  • Page 528

    3. In str u ctio n Se t 3-425Program 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 ins...

  • Page 529

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-426 API Mnemonic Operands Function 205 CMPT P Compare table Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 ***S2 ***n ...

  • Page 530

    3. In str u ctio n Se t 3-427API MnemonicOperands Function 206 ASDRW ASDA servo drive R/W Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * *S2 * * *S *ASDRW: 7 steps PULSE 16-bit 32-bit ES2/...

  • Page 531

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-428 (3 sets) -300~+300 For A2-type only Code Function Parameter Com. Addr. Read/Write data (Settings) K16(H10) Status monitor (Read) P0-09 ~ P0-13 0012H ~ 001BH S+0 ~ S+9: Please refer to explanations in ASDA-A2 manual. K...

  • Page 532

    3. In str u ctio n Se t 3-429H87MOVM1002D1120SETM1120K100MOVD1129RSTM1127ASDRWK0K1X0D0ASDA address: K1Function Code: K0Monitor ASDA statusData RegisterM1127SETX0M1122Set up in ASCII modeRSTM1143SETM1143Reset communication completed flag M1127Set communication protocol as 9600,8,E,1Set time-out ...

  • Page 533

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-430 Points to note: Relative flags and special D registers of COM2/COM3 : COM2 COM3 Function Description M1120 M1136 Retain communication setting M1143 M1320 ASCII/RTU mode selection D1120 D1109 Communication protocol P...

  • Page 534

    3. In str u ctio n Se t 3-431 API MnemonicOperands Function 207 CSFO Catch speed and proportional output Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * S1 *D *CSFO: 7 steps PULSE 16-bit 32-bit ...

  • Page 535

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-432 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...

  • Page 536

    3. In str u ctio n Se t 3-433API Mnemonic Operands Function 215~217 D LD# Contact Type Logic OperationControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******LD#: 5 steps DLD#: 9 steps PU...

  • Page 537

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-434 API Mnemonic Operands Function 218~220 D AND# Serial Type Logic Operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * *...

  • Page 538

    3. In str u ctio n Se t 3-435API Mnemonic Operands Function 221~223 D OR# Parallel Type Logic Operation Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******OR#: 5 steps DOR#: 9 steps P...

  • Page 539

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-436 API Mnemonic Operands Function 224~230 D LD※ Contact Type Comparison Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ****...

  • Page 540

    3. In str u ctio n Se t 3-437API Mnemonic Operands Function 232~238 D AND※ Serial Type Comparison Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * **** ******S2 * **** ******AND※: 5 steps DAND※: 9 steps ...

  • Page 541

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-438 API Mnemonic Operands Function 240~246 D OR※ Parallel Type Comparison Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS1 * * * * * ***...

  • Page 542

    3. In str u ctio n Se t 3-439 API MnemonicOperands Function 266 D BOUT Output Specified Bit of a Word Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD ** ****n * **** ******BOUT: 5 steps DBOUT: 9 steps PULSE ...

  • Page 543

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-440 API Mnemonic Operands Function 267 D BSET Set ON Specified Bit of a Word Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD * * ****n ...

  • Page 544

    3. In str u ctio n Se t 3-441API MnemonicOperands Function 268 D BRST Reset Specified Bit of a Word Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FD ** ****n * **** ******BRST: 5 steps DBRST: 9 steps PULSE 16...

  • Page 545

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-442 API Mnemonic Operands Function 269 D BLD Load NO Contact by Specified BitControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * ****n ...

  • Page 546

    3. In str u ctio n Se t 3-443API MnemonicOperands Function 270 D BLDI Load NC Contact by Specified BitControllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ** ****n * **** ******BLDI: 5 steps DBLDI: 9 steps PULSE ...

  • Page 547

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-444 API Mnemonic Operands Function 271 D BAND Connect NO Contact in Series by Specified Bit Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ...

  • Page 548

    3. In str u ctio n Se t 3-445API MnemonicOperands Function 272 D BANI Connect NC Contact in Series by Specified Bit Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ** ****n * **** ******BANI: 5 steps DBANI: 9...

  • Page 549

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-446 API Mnemonic Operands Function 273 D BOR Connect NO Contact in Parallel by Specified Bit Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ...

  • Page 550

    3. In str u ctio n Se t 3-447API MnemonicOperands Function 274 D BORI Connect NC Contact in Parallel by Specified Bit Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS ** ****n * **** ******BORI: 5 steps DBORI:...

  • Page 551

    DVP-E S 2/S X 2/SS2 /S A2 /SX2 Oper a t io n Manu al – Prog rammi n g 3-448 MEMO

  • Page 552

    4-1 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 ........................................................

  • Page 553

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-2 4.1 Communication Ports DVP-ES2/EX2/SA2/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 ra...

  • Page 554

    4. C o mm u n ication s 4-34.2 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 Start bit ‘:’ (3AH) ADR 1 Communication address ADR 0 Address consists of 2 A...

  • Page 555

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-4 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 (04 H) Force ...

  • Page 556

    4. C o mm u n ication s 4-5Field name ASCII Hex Bytes Count 10 31 30 Data Hi (T20) 00 30 30 Data Lo (T20) 01 30 31 Data Hi (T21) 00 30 30 Data Lo (T21) 02 30 32 Data Hi (T22) 00 30 30 Data Lo (T22) 03 30 33 Data Hi (T23) 00 30 30 Data Lo (T23) 04 30 34 Data Hi (T24) 00 30 30 Data Lo (T24) 05 30 ...

  • Page 557

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-6 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 re...

  • Page 558

    4. C o mm u n ication s 4-7 Exception code: 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...

  • Page 559

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-8 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 addres...

  • Page 560

    4. C o mm u n ication s 4-9Data Lo (T24) 05 Data Hi (T25) 00 Data Lo (T25) 06 Data Hi (T26) 00 Data Lo (T26) 07 Data Hi (T27) 00 Data Lo (T27) 08 CRC CHK Low 72 CRC CHK High 98 END No data input ≥ 10 ms 4.3.3 CRC CHK (check sum) The CRC Check starts from “Slave Address” and ends in “The...

  • Page 561

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-10 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...

  • Page 562

    4. C o mm u n ication s 4-11Field Name Example (Hex) START No data input ≥ 10 ms Slave Address 01 Function 81 Exception Code 02 CRC CHK Low C1 CRC CHK High 91 END No data input ≥ 10 ms 4.4 PLC Device Address Effective Range Device Range ES2/EX2SS2 SA2/SX2MODBUS Address Address S 000~255 00...

  • Page 563

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-12 Effective Range Device Range ES2/EX2SS2 SA2/SX2MODBUS Address Address D 000~255 1000~10FFD 256~511 1100~11FF D 512~767 1200~12FFD 768~1023 1300~13FFD 1024~1279 404097~405376 1400~14FFD 1280~1535 1500~15FFD 1536~1791 160...

  • Page 564

    4. C o mm u n ication s 4-134.5 Command Code 4.5.1 Command Code: 01, Read Status of Contact (Input point X is not included) Number of Points (max) = 255 (Dec) = FF (Hex) Example:Read contacts T20~T56 from Slave ID#1 PC→PLC “:01 01 06 14 00 25 BF CR LF” Sent message: Field Name ASCII STX ...

  • Page 565

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-14 4.5.2 Command Code: 02, Read Status of Contact (Input point X is included) Example: Read status of contact Y024~Y070 from Slave ID#01 PC→PLC “: 01 02 05 14 00 25 BF CR LF” Sent message: Field Name ASCII STX : Slav...

  • Page 566

    4. C o mm u n ication s 4-154.5.3 Command Code: 03, Read Content of Register (T, C, D) Example: Read coils T20~T27 from Slave ID#01 PC→PLC “: 01 03 06 14 00 08 DA CR LF” Sent message: Field Name ASCII STX : Slave Address 01 Command code 03 Starting Address Hi 06 Starting Address Lo 14 Nu...

  • Page 567

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-16 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) indi...

  • Page 568

    4. C o mm u n ication s 4-17Field Name ASCII Force Data Lo 00 Error Check (LRC) F6 END 1 0D (Hex) END 0 0A (Hex) 4.5.5 Command Code: 06, Set content of single register Example: Set content of register T0: 12 34 (Hex) PC→PLC “: 01 06 06 00 12 34 AD CR LF” Sent message: Field Name ASCII S...

  • Page 569

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-18 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. PC→PLC “: 01 0F 05 00 00 0A 02 CD 01 11 CR LF...

  • Page 570

    4. C o mm u n ication s 4-19Sent message: Field Name ASCII STX : Slave Address 01 Command code 10 Starting Address Hi 06 Starting Address Lo 00 Number of Register Hi 00 Number of Register Lo 02 Byte Count 04 Data Hi 00 Data Lo 0A Data Hi 01 Data Lo 02 Error Check (LRC) D6 END 1 0D(Hex) END 0 0...

  • Page 571

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 4-20 MEMO

  • Page 572

    5-1 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) .........................

  • Page 573

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-2 5.1 Step Ladder Instruction [STL], [RET] Mnemonic Operands Function Program stepsSTL S0~S1023 Starts STL program 1 Controllers ES2/EX2 SS2 SA2 SX2 Explanation: STL Sn constructs a step point. When STL instruction appears in t...

  • Page 574

    5. Sequ ential Fu n c tion Ch ar t 5-35.2 Sequential Function Chart (SFC) In the application of automation control, a seamless combination between electrical control and mechanical control is required for completing an automation process. The sequential control of automation process can be divid...

  • Page 575

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-4 Initial step in SFC. S0 ~ S9.are applicable General step. S10 ~ S1023 are applicable. 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...

  • Page 576

    5. Sequ ential Fu n c tion Ch ar t 5-55.3 The Operation of STL Program Step ladder diagram (STL) is a programming method for users to write a program which functions similar to SFC. STL provides PLC program designers a more readable and clear programming method as drawing a flow chart. The seque...

  • Page 577

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-6 Example: SETY1Y0SETS20Y20SETS30S10SX0S20SX1SETY1Y0SETS20Y20SETS30S10SX0S20SX1When X0 = ON,S20 = ON,S10 = OFF. Explanation: When S10 = ON, Y0 and Y1 will be ON. When X0 = ON, S20 will be ON and Y20 will be ON. When S10 = OFF, Y...

  • Page 578

    5. Sequ ential Fu n c tion Ch ar t 5-7Repeated usage of timer: See the opposite diagram. Timers can only be used repeatedly in non-adjacent steps. S20S30S40X1X2TMRT1K10TMRT2K20TMRT1K30 Transfer of Step Points: SET Sn and OUT Sn instructions are used to enable (or transfer to) another step. Bec...

  • Page 579

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-8 Returning to the initial step in the same sequence. Jumping up/down to non-adjacent steps in the same sequence. SFC: Ladder diagram: S0S2 1S2 4S2 5X7X2OUTOUTS2 4S2 1SS0SS23SX2S24SS25SS0X7RETUsing OUT S2...

  • Page 580

    5. Sequ ential Fu n c tion Ch ar t 5-9Cautions for Driving Output Point: Once LD or LDI instructions are written into the second line after the step point, the bus will not be able to connect output coils directly otherwise errors will occur when compiling the ladder diagram. The following diagr...

  • Page 581

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-10 Ladder diagram: Y1SSM0Y2X2nX3X1X0MPPMRDMPSBUSLD X0 Instruction code:STL Sn LD X0 MPS AND X1 OUT Y1 MRD AND X2 OUT M0 MPP AND X3 OUT Y2 Explanation: MPS/MRD/MPP instruction cannot be used directly on the new bus. You have ...

  • Page 582

    5. Sequ ential Fu n c tion Ch ar t 5-115.4 Points to Note for Designing a Step Ladder Program 1. The first step in the SFC is called the “initial step", S0 ~ S9. Use the initial step as the start of a sequence and ends with RET instruction. 2. If no STL instruction is in use, step point ...

  • Page 583

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-12 Device Description M1040 Disabling step transition. M1041 Step transition start. Flag for IST instruction. M1042 Enabling pulse operation. Flag for IST instruction. M1043 Zero return completed. Flag for IST instruction. M1...

  • Page 584

    5. Sequ ential Fu n c tion Ch ar t 5-135.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 app...

  • Page 585

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-14 2. Step Jump a) The control power over the step is transferred to a certain step on top. S0S21S42S43OUTOUT b) The control power over the step is transferred to the step in another sequence. S0S21S41OUTOUTS1S41S43OUTS42 3. Res...

  • Page 586

    5. Sequ ential Fu n c tion Ch ar t 5-15Ladder diagram of simultaneous divergence: X0SETSETS22S21SSETS23S20SETS24 SFC diagram of simultaneous divergence: S20S21S22S23S24 2. Structure of Alternative Divergence When the individual condition at the current status is true, the step will be transferre...

  • Page 587

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-16 In simultaneous convergence, only when all sequences are completed will the transfer be allowed. Ladder diagram of simultaneous convergence: X2SETS50SS40SS41SS42 SFC diagram of simultaneous convergence: S40S50S41S42X2 4. Str...

  • Page 588

    5. Sequ ential Fu n c tion Ch ar t 5-17Example of alternative divergence & alternative convergence: Step Ladder Diagram: SFC Diagram: M1002ZRSTS0S127SETS1SETS20Y0SETS30Y1SETS40Y2ENDX0S1SS20SX1S30SX2S40SX3SETS31X4SETS32X7SETS50Y3S31SX5SETS41Y4S41SX6SETS50Y5S32SX20SETS42Y6S42SX21SETS50S50ST...

  • Page 589

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-18 Example of simultaneous divergence & simultaneous convergence: Step Ladder Diagram: SFC Diagram: M1002ZRSTS0S127SETS3SETS20Y0SETS30Y1SETS40Y2ENDX0S3SS20SX1S30SX2S40SSETS31SETS32Y3S31SX3SETS41Y4S41SY5S32SX4SETS42Y6S42S...

  • Page 590

    5. Sequ ential Fu n c tion Ch ar t 5-19Example of the simultaneous divergence & alternative convergence: Step Ladder Diagram: SFC Diagram: S127K10M1002ZRSTS0SETS4SETS20Y0SETS30Y1SETS40Y2ENDX0S4SS20SX1S30SX2S40SX3SETS31SETS32SETS50Y3S31SX4SETS41Y4S41SX5SETS50Y5S32SX6SETS42Y6S42SX7SETS50S50...

  • Page 591

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-20 Combination example 1: (Includes alternative divergence/convergence and simultaneous divergence/convergence) Step Ladder Diagram: S127M1002ZRSTS0SETS0Y1SETS30Y2SETS40Y3SX1S30SX4S31SX5SETS31SETS32SETS40Y5S40SX7SETS50Y7S50SX21S...

  • Page 592

    5. Sequ ential Fu n c tion Ch ar t 5-21SFC Diagram: S0S20S30S40S0M1002X0X1X4X27Y1Y2Y5S50X7S70Y27S51S61X22Y20Y24S52S62X23Y21Y25X21X25S60Y23Y0Y7S31Y3X5X2S32Y4X6X3S41Y6X20X26S53S63Y22Y26X24S0

  • Page 593

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-22 Combination example 2: (Includes alternative divergence/convergence and simultaneous divergence/convergence) Step Ladder Diagram: SFC Diagram: S127M1002ZRSTS0SETS0SETS30Y0SETS31Y1SETS33Y2ENDX0S0SS30SX1S31SX2S32SX3SETS32SE...

  • Page 594

    5. Sequ ential Fu n c tion Ch ar t 5-23SFC Diagram: S0S20S30S40S0M1002X0X1X11X51Y0Y1Y11S50X20S80Y41S51S71X33Y15Y33S53S73X35Y17Y35X32X44S70Y32Y14S31Y2X12X2S32Y4X15X4S41Y12X21X52S54Y20S0SETS32Y3X14X3S52S72X34Y16Y34S0SETX13S20OUTS20OUTS81X45Y42SETS34Y5X15X5S35X15X6S55S74X36X22X46Y6S36X16X7Y7Y21Y36S...

  • Page 595

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-24 5.6 IST Instruction API Mnemonic Operands Function 60 IST Initial State Controllers ES2/EX2 SS2 SA2 SX2 Bit Devices Word devices Program Steps Type OP X Y M S K H KnX KnY KnM KnS T C D E FS * * * D1 * ...

  • Page 596

    5. Sequ ential Fu n c tion Ch ar t 5-25“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...

  • Page 597

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-26 X35X36X37X20X21X22X23X24X25Step X32One cycleoperation X33Continuousoperation X34Manualoperation X30Zero return X31Power ONPower OFFZero returnAuto ONAuto OFFRight ShiftLeft shiftReleaseballsClipballsDescendAscend a) X0: ball ...

  • Page 598

    5. Sequ ential Fu n c tion Ch ar t 5-27S1S10X35S11X4S12X1RSTY4RSTY1Y0RSTY2Y3SETM1043RSTS12Release ballsStop lowering robot armRaise robot arm to theupper-limit (X4 = ON)Stop shifting to rightShift to left to reach the left-limit (X1 = ON)Enable zero return completed flagZero return completed b...

  • Page 599

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-28 9. Auto operation (Single step / One-cycle operation / continuous operation): a) SFC: S2S20S30S31M1044X5T0Y1SETY0S32X4X2S50Y1Y2S2X1M1041X0Y4TMRT0K30S60RSTX5Y4TMRT2K30S70T2Y0S80X4Y3X1S40S41X5T1SETY0S42X4X3Y2X0Y4TMRT1K30X3X2X4X...

  • Page 600

    5. Sequ ential Fu n c tion Ch ar t 5-29b) Ladder Diagram: ENDRETSETS20SETS30SETY4Y0X5S31SX4TMRT0SETS32S2SM1041 M1044S20SS30SY1X0SETS40X5 X0SETS31T0K30Y2S32SX2SETS50X2SETY4TMRT1S40SSETS41T1K30Y0S41SX4SETS42Y2S42SX3SETS50X3Y1S50SX5SETS60RSTY4TMRT2S60SSETS70T2K30Y0S70SX4SETS80Y3S80SX1X1S2X4X4X4X5En...

  • Page 601

    DVP-E S 2EX 2 /SS2 /S A2 /SX2 Operat ion Ma nua l - Pr ogramm ing 5-30 MEMO

  • Page 602

    6-1 Troubleshooting This chapter offers error code table and information for troubleshooting during PLC operation. Chapter Contents 6.1 Common Problems and Solutions.......................................................................................... 3-2 6.2 Error code Table (Hex) .......

  • Page 603

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 6-2 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 Troubleshooting and Correctiv...

  • Page 604

    6 . Tr ou b l e s ho ot i ng 6-3Symptom Troubleshooting and Corrective Actions Diagnosing Input Malfunction 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 th...

  • Page 605

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 6-4 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 c...

  • Page 606

    6 . Tr ou b l e s ho ot i ng 6-50E05 DCNT operand CXXX misuse 0E18 BCD conversion error 0E19 Division error (divisor=0) 0E1A Device use is out of range (including index registers E, F) 0E1B Negative number after radical expression 0E1C FROM/TO communication error 0F04 Operand word device D re...

  • Page 607

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 6-6 Error code Description Action 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 S...

  • Page 608

    6 . Tr ou b l e s ho ot i ng 6-76.3 Error Detection Devices Error Check Devices Description Drop LatchSTOP RUN RUN STOP M1067 Program execution error flag None Reset Latch M1068 Execution error latch flag None Latch Latch D1067 Algorithm error code None Reset Latch D1068 Step value of algorith...

  • Page 609

    DVP-E S 2/E X 2/SS2 /S A2 /SX2 Oper a t io n Ma nu al - Pro g r ammi ng 6-8 MEMO

x