Người sử dụng có thể lập trình để thực hiện một loạt trình tự các sự kiện. Các sự kiện này được kích hoạt bởi tác nhân kích thích (ngõ vào) tác động vào PLC hoặc qua các hoạt động có trễ như thời gian định thì hay các sự kiện được đếm. PLC dùng để thay thế các mạch relay (rơ le) trong thực tế. PLC hoạt động theo phương thức quét các trạng thái trên đầu ra và đầu vào. Khi có sự thay đổi ở đầu vào thì đầu ra sẽ thay đổi theo. Ngôn ngữ lập trình của PLC có thể là Ladder hay State Logic. Hiện nay có nhiều hãng sản xuất ra PLC như INVT, AllenBradley,Omron, Honeywell
5 Categories & Use of Application Instructions 5.1 List of Instructions For applicable models, ES includes ES/EX/SS; SA includes SA/SX/SC; EH includes EH2/SV/EH3/SV2 ES/EX/SS series MPU does not support pulse execution type instructions (P instruction) Data Processing Rotation & Displacement Four Arithmetic Operation Transmission Comparison Loop Control Category API Mnemonic 16-bit 32-bit P instruction 00 01 02 03 04 05 CJ CALL SRET IRET EI DI - - 06 FEND - - 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 114 115 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 WDT FOR NEXT CMP ZCP MOV SMOV CML BMOV FMOV XCH BCD BIN ADD SUB MUL DIV INC DEC WAND WOR WXOR NEG MUL16 DIV16 ROR ROL RCR RCL SFTR SFTL WSFR WSFL SFWR SFRD ZRST DECO ENCO SUM BON MEAN ANS ANR SQR FLT DCMP DZCP DMOV DCML DFMOV DXCH DBCD DBIN DADD DSUB DMUL DDIV DINC DDEC DAND DOR DXOR DNEG MUL32 DIV32 DROR DROL DRCR DRCL DSUM DBON DMEAN DSQR DFLT DVP-PLC Application Manual Function Conditional Jump Call Subroutine Subroutine Return Interrupt Return Enable Interrupts Disable Interrupts The End of The Main Program (First End) Watchdog Timer Refresh Start of a FOR-NEXT loop End of a FOR-NEXT loop Compare Zone Compare Move Shift Move Compliment Block Move Fill Move Exchange Binary Coded Decimal Binary Addition Subtraction Multiplication Division Increment Decrement Logical Word AND Logical Word OR Logical Exclusive OR 2’s Complement (Negative) 16-bit/32-bit Multiplication 16-bit/32-bit Division Rotation Right Rotation Left Rotation Right with Carry Rotation Left with Carry Bit Shift Right Bit Shift Left Word Shift Right Word Shift Left Shift Register Write Shift Register Read Zero Reset Decode Encode Sum of Active Bits Check Specified Bit Status Mean Timed Annunciator Set Annunciator Reset Square Root Floating Point ES Applicable to STEPS SA EH2 EH3 16-bit 32-bit 3 1 1 - - 11 7 5 7 7 3 7 7 5 5 9 9 7 7 7 5 13 17 9 – 13 9 13 13 13 13 5 13 13 13 13 13 9 9 13 13 9 5-1 Categories & Use of Application Instructions Communication Basic Instructions Serial I/O Display of External Settings Handy Instructions High Speed Processing Category 5-2 API Mnemonic 16-bit 32-bit P instruction - 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 REF REFF MTR SPD PLSY PWM PLSR IST SER ABSD INCD TTMR STMR ALT RAMP DTM SORT TKY HKY DSW SEGD SEGL ARWS ASC PR FROM DHSCS DHSCR DHSZ DPLSY DPLSR DSER DABSD DFROM 79 TO DTO 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 RS PRUN ASCI HEX CCD VRRD VRSC ABS PID PLS LDP LDF ANDP ANDF ORP ORF TMR CNT INV PLF MODRD MODWR FWD REV STOP RDST RSTEF DPRUN - DRAMP DSORT DTKY DHKY - - - - - - - - - - DABS DPID - DCNT - - - - - - - - - Function Refresh Refresh and Filter Adjust Input Matrix High Speed Counter Set High Speed Counter Reset High Speed Zone Compare Speed Detection Pulse Y Output Pulse Width Modulation Pulse Ramp Initial State Search a Data Stack Absolute Drum Sequencer Incremental Drum Sequencer Teaching Timer Special Timer Alternate State Ramp Variable Value Data Transform and Move Sort Tabulated Data Ten Key Input Hexadecimal Key Input Digital Switch Seven Segment Decoder Seven Segment with Latch Arrow Switch ASCII Code Conversion Print (ASCII Code Output) Read CR Data in Special Modules Write CR Data into Special Modules Serial Communication Instruction Parallel Run Converts Hex to ASCII Converts ASCII to Hex Check Code Volume Read Volume Scale Absolute Value PID Control Loop Rising-edge Output Rising-edge Detection Operation Falling-edge Detection Operation Rising-edge Series Connection Falling-edge Series Connection Rising-edge Parallel Connection Falling-edge Parallel Connection 16-bit Timer 16-bit / 32-bit Counter Inverting Operation Falling-edge Output Read Modbus Data Write Modbus Data Forward Running of VFD-A Reverse Running of VFD-A Stop VFD-A Read VFD-A Status Reset Abnormal VFD-A ES Applicable to STEPS SA EH2 EH3 16-bit 32-bit 7 9 9 9 11 9 11 13 13 17 13 17 17 17 17 - 7 5 3 3 3 4 7 7 5 - - - - 17 21 13 17 - 17 - 17 - - - - - DVP-PLC Application Manual Categories & Use of Application Instructions Others Floating Point Operation Floating Point Operation Communication Category API Mnemonic 16-bit 32-bit P instruction Function ES Applicable to STEPS SA EH2 EH3 16-bit 32-bit 107 LRC - Checksum LRC Mode - 108 CRC - Checksum CRC Mode - 113 ETHRW – – Reading/Writing through Ethernet - - - - 150 MODRW - - Read/Write Modbus Data 11 - - ASDA servo drive R/W Floating Point Compare Floating Point Zone Compare Move Floating Point Data Angle Radian Radian Angle Float to Scientific Conversion Scientific to Float Conversion Floating Point Addition Floating Point Subtraction Floating Point Multiplication Floating Point Division Exponent of Binary Floating Point Natural Logarithm of Binary Floating Point Logarithm of Binary Floating Point Floating Point Square Root Floating Point Power Operation Float to Integer Sine Cosine Tangent Arc Sine Arc Cosine Arc Tangent Hyperbolic Sine Hyperbolic Cosine Hyperbolic Tangent Addition of Floating-point Numbers Subtraction of Floating-point Numbers Multiplication of Floating-point Numbers Division of Floating-point Numbers Read Digital Switch Delay Instruction General PWM Output Fuzzy Temperature Control Valve Control Byte Swap Read File Register Write File Register Detection of Input Pulse Width Start of the Measurement of Execution Time of I Interruption End of the Measurement of the Execution Time of I Interruption Random Number Move the Designated Bit Magnify Move GPS data receiving Solar Panel Positioning - - 13 17 9 9 13 13 13 13 - - 206 ASDRW 110 111 112 116 117 118 119 120 121 122 123 124 - DECMP DEZCP DMOVR DRAD DDEG DEBCD DEBIN DEADD DESUB DEMUL DEDIV DEXP 125 - DLN - - DLOG DESQR DPOW DINT DSIN DCOS DTAN DASIN DACOS DATAN DSINH DCOSH DTANH DADDR 173 - DSUBR 174 - DMULR 126 127 128 129 130 131 132 133 134 135 136 137 138 172 INT - - - 175 109 SWRD 143 DELAY 144 GPWM 145 FTC 146 CVM 147 SWAP 148 MEMR 149 MEMW 151 PWD DDIVR - DSWAP DMEMR DMEMW - - - 152 RTMU - - 153 RTMD - - 154 168 176 177 178 RAND MVM MMOV GPS SPA DRAND DMVM DSPA DVP-PLC Application Manual - - - - - - - 13 13 9 9 9 9 9 13 - 13 - 13 - - 3 7 13 - - - - - - - - - - – - - - - - - - - - 13 13 - 13 13 5-3 Categories & Use of Application Instructions Category API 179 Mnemonic 16-bit 32-bit WSUM Others 196 HST 202 SCAL 203 SCLP 205 206 CMPT ASDRW 207 CSFO Contact Type Logic Operation Matrix Gray code Real Time Calendar Position Control 155 5-4 - DWSUM - P instruction - DCMPT - - - - DABSR - 156 157 158 159 ZRN PLSV DRVI DRVA DZRN DPLSV DDRVI DDRVA 191 - DPPMR - 192 - DPPMA - 193 - DCIMR - 194 - DCIMA - DPTPO DCLLM DVSPO DICF 195 197 198 199 160 161 162 163 166 167 169 170 171 180 181 182 183 184 185 186 187 188 189 190 215 216 217 218 219 220 221 222 223 TCMP TZCP TADD TSUB TRD TWR HOUR GRY GBIN MAND MOR MXOR MXNR MINV MCMP MBRD MBWR MBS MBR MBC LD& LD| LD^ AND& AND| AND^ OR& OR| OR^ - DHOUR DGRY DGBIN DLD& DLD| DLD^ DAND& DAND| DAND^ DOR& DOR| DOR^ - - Function Get the Sum High Speed Timer Proportional Value Calculation Parameter Proportional Value Calculation Compare table ASDA servo drive R/W Catch speed and proportional output Read the Absolute Position from a Servo Motor Zero Return Adjustable Speed Pulse Output Drive to Increment Drive to Absolute 2-Axis Relative Point to Point Motion 2-Axis Absolute Point to Point Motion 2-Axis Relative Position Arc Interpolation 2-Axis Absolute Position Arc Interpolation Single-Axis Pulse Output by Table Close Loop Position Control Variable Speed Pulse Output Immediately Change Frequency Time Compare Time Zone Compare Time Addition Time Subtraction Time Read Time Write Hour Meter BIN Gray Code Gray Code BIN Matrix ‘AND’ Operation Matrix ‘OR’ Operation Matrix ‘XOR’ Operation Matrix ‘XNR’ Operation Matrix Inverse Operation Matrix Compare Read Matrix Bit Write Matrix Bit Matrix Bit Displacement Matrix Bit Rotation Matrix Bit Status Counting S1 & S2 S1 | S2 S1 ^ S2 S1 & S2 S1 | S2 S1 ^ S2 S1 & S2 S1 | S2 S1 ^ S2 ES - Applicable to STEPS SA EH2 EH3 16-bit 32-bit - 13 - - - - - - - - - - - 13 - - - - 9 17 13 17 17 - - - 17 - - - 17 - - - 17 - - - 17 - 13 17 17 13 11 7 3 5 9 9 7 7 5 5 5 5 - - - - 13 9 9 9 9 9 DVP-PLC Application Manual Categories & Use of Application Instructions Floating-point Contact Type Comparison Instruction Floating-point Contact Type Comparison Instruction Word Device Bit Instruction Contact Type Comparison Instruction Category API Mnemonic 16-bit 32-bit P instruction 224 225 226 228 229 230 232 233 234 236 237 238 240 241 242 244 245 246 266 267 268 269 270 LD= LD> LD< LD LD= AND= AND> AND< AND AND= OR= OR> OR< OR OR= BOUT BSET BRST BLD BLDI DLD= DLD> DLD< DLD DLD= DAND= DAND> DAND< DAND DAND= DOR= DOR> DOR< DOR DOR= DBOUT DBSET DBRST DBLD DBLDI - 271 BAND DBAND - 272 BANI DBANI - 273 BOR DBOR - 274 BORI DBORI - 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 296 297 298 299 300 301 302 303 LDZ> LDZ>= LDZ< LDZ ANDZ>= FLD= FLD> FLD< FLD FLD= FAND= FAND> FAND< FAND FAND= FOR= FOR> FOR< FOR FOR= DLDZ> DLDZ>= DLDZ< DLDZ DANDZ>= - DVP-PLC Application Manual - Function S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≤ S2 S1 ≥ S2 S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≤ S2 S1 ≥ S2 S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≤ S2 S1 ≥ S2 Output Specified Bit of a Word Set ON Specified Bit of a Word Reset Specified Bit of a Word Load NO Contact by Specified Bit Load NC Contact by Specified Bit Connect NO Contact in Series by Specified Bit Connect NC Contact in Series by Specified Bit Connect NO Contact in Parallel by Specified Bit Connect NC Contact in Parallel by Specified Bit S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≦ S2 S1 ≧ S2 S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≦ S2 S1 ≧ S2 S1 = S2 S1 > S2 S1 < S2 S1 ≠ S2 S1 ≦ S2 S1 ≧ S2 | S1 - S2 | > | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | < | S3 | | S1 - S2 | ≦ | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | | S1 - S2 | > | S3 | | S1 - S2 | ≧ | S3 | ES Applicable to STEPS SA EH2 EH3 16-bit 32-bit - - - - - 5 5 5 5 5 5 5 5 5 5 5 9 9 9 9 9 9 9 9 9 9 9 - - - - - - - - 5 5 5 5 9 9 9 9 9 9 9 9 9 9 9 9 9 5-5 Application Instructions API 00-49 API Mnemonic 00 CJ Operands Function Conditional Jump P OP Range P0~P255 Program Steps CJ, CJP: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: The destination pointer of conditional jump Explanations: Operand S can designate P P can be modified by index register E, F In ES/EX/SS series models: Operand S can designate P0 ~ P63 In SA/SX/SC/EH/EH2/SV series models: Operand S can designate P0 ~ P255 When the user does not wish a particular part of PLC program in order to shorten the scan time and execute dual outputs, CJ instruction or CJP instruction can be adopted When the program designated by pointer P is prior to CJ instruction, WDT timeout will occur and PLC will stop running Please use it carefully CJ instruction can designate the same pointer P repeatedly However, CJ and CALL cannot designate the same pointer P; otherwise an error will occur Actions of all devices while conditional jumping is being executed a) Y, M and S remain their previous status before the conditional jump takes place b) Timer 10ms and 100ms that is executing stops c) Timer T192 ~ T199 that execute the subroutine program will continue and the output contact executes normally d) The high-speed counter that is executing the counting continues counting and the output contact executes normally e) The ordinary counters stop executing f) If the “reset instruction” of the timer is executed before the conditional jump, the device will still be in the reset status while conditional jumping is being executed g) Ordinary application instructions are not executed h) The application instructions that are being executed, i.e API 53 DHSCS, API 54 DHSCR, API 55 DHSZ, API 56 SPD, API 57 PLSY, API 58 PWM, API 59 PLSR, API 157 PLSV, API 158 DRVI, API 159 DRVA, continue being executed Program Example 1: When X0 = On, the program automatically jumps from address to N (the designated label P1) and keeps its execution The addresses between and N will not be executed When X0 = Off, as an ordinary program, the program keeps on executing from address CJ instruction will not be executed at this time DVP-PLC Application Manual 6-1 Application Instructions API 00-49 X0 ( CJ instruction ) CJ P*** P1 X1 Y1 X2 Y2 P1 N Program Example 2: CJ instruction can be used in the following conditions between MC and MCR instructions a) Without MC ~ MCR b) From without MC to within MC Valid in the loop P1 as shown in the figure below c) In the same level N, inside of MC~MCR d) From within MC to without MCR e) Jumping from this MC ~ MCR to another MC ~ MCR1 Actions in ES/EX/SS series models V4.7 (and below): When CJ instruction is used between MC and MCR, it can only be applied without MC ~ MCR or in the same N layer of MC ~ MCR Jumping from this MC ~ MCR to another MC ~ MCR will result in errors, i.e a) and c) as stated above can ensure correct actions; others will cause errors When MC instruction is executed, PLC will push the status of the switch contact into the self-defined stack in PLC The stack will be controlled by the PLC, and the user cannot change it When MCR instruction is executed, PLC will obtain the previous status of the switch contact from the top layer of the stack Under the conditions as stated in b), d) and e), the times of pushing-in and obtaining stack may be different In this case, the maximum stack available to be pushed in is and the obtaining of stacks cannot resume once the stack becomes empty Thus, when using CALL or CJ instructions, the user has to be aware of the pushing-in and obtaining of stacks X0 MC N0 CJ P0 CJ P1 MC N1 X2 X3 X1 M1000 Y1 P1 MCR N1 M1000 P0 Y0 MCR N0 This function is only available in ES/EX/SS series models V4.9 (and above) and SA/SX/SC/EH/EH2/SV series models 6-2 DVP-PLC Application Manual Application Instructions API 00-49 Program Example 3: The states of each device Contact state before CJ Contact state when CJ is Output coil state when CJ is Device is executed being executed M1, M2, M3 Off M1, M2, M3 OffOn Y1 , M20, S1 Off M1, M2, M3 On M1, M2, M3 OnOff * Y1 , M20, S1 On M4 Off M4 OffOn Y, M, S 10ms, 100ms Timer ES/SA/EH being executed *1 Timer T0 is not enabled Timer T0 immediately stops M4 On M4 OnOff and is latched M0 OnOff, T0 is reset as M6 Off M6 OffOn Timer T240 is not enabled Once the timer function is enabled and when met with 1ms, 10ms, 100ms *2 Timer (accumulative) SA/EH CJ instruction, all M6 On M6 OnOff accumulative timers will stop timing and stay latched M0 OnOff T240 remains unchanged M7, M10 Off M10 On/Off trigger Counter does not count Counter C0 stops counting C0 ~ C234 *3 M7 Off, M10 On/Off and stays latched After M0 M10 On/Off trigger trigger goes Off, C0 resumes its counting Application instructions are M11 Off M11 OffOn not executed The skipped application Application instruction instructions are not executed, M11 On M11 OnOff but API 53 ~ 59, API 157 ~ 159 keep being executed *1: Y1 is a dual output When M0 is Off, M1 will control Y1 When M0 is On, M12 will control Y1 *2: When the timers (T192 ~ T199, applicable in SA/EH series MPU) used by a subroutine re driven and encounter the execution of CJ instruction, the timing will resume After the timing target is reached, the output contact of the timer will be On *3: When the high-speed counters (C235 ~ C255) are driven and encounter the execution of CJ instruction, the counting will resume, as well as the action of the output points DVP-PLC Application Manual 6-3 Application Instructions API 00-49 Y1 is a dual output When M0 = Off, Y1 is controlled by M1 When M0 = On, Y1 is controlled by M12 M0 CJ P0 M1 Y1 M2 M20 M17 CJ P0 M3 S1 M4 K10 TMR T0 RST T127 TMR T127 RST C0 CNT C0 K20 MOV K3 D0 CJ P63 M5 M6 K1000 M7 M10 M11 M0 P0 M12 Y1 M13 P63 RST T127 RST C0 RST D0 END 6-4 DVP-PLC Application Manual Application Instructions API 00-49 API Mnemonic 01 CALL Operands Function Call Subroutine P OP Range P0 ~ P255 Program Steps CALL, CALLP: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: The pointer of call subroutine Explanations: Operand S can designate P P can be modified by index register E, F In ES/EX/SS series models: Operand S can designate P0 ~ P63 In SA/SX/SC/EH/EH2/SV series models: Operand S can designate P0 ~ P255 Edit the subroutine designated by the pointer after FEND instruction The number of pointer P, when used by CALL, cannot be the same as the number designated by CJ instruction If only CALL instruction is in use, it can call subroutines of the same pointer number with no limit on times Subroutine can be nested for levels including the initial CALL instruction (If entering the sixth level, the subroutine won’t be executed.) DVP-PLC Application Manual 6-5 10 Application Instructions API 202-313 API Mnemonic 267 D Operands Function Set ON Specified Bit of a Word BSET Type OP Bit Devices X Y M D n Word devices S K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BSET: steps * * DBSET: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: D: Destination device to be Set ON n: Device specifying the bit to be Set ON Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction When BSET instruction executes, the output device specified by operand n will be On and latched To reset the On state of the device, BRST instruction is required Program Example: X0 X1 BSET K4Y0 D0 Instruction: Operation: LDI X0 Load NC contact X0 AND X1 Connect NO contact X1 in series BSET K4Y0 D0 When D0 = k1, Y1 is ON and latched When D0 = k2, Y2 = ON and latched 10-22 DVP-PLC Application Manual 10 Application Instructions API 202-313 API Mnemonic 268 D Operands Function Reset Specified Bit of a Word BRST Type OP Bit Devices X Y M Word devices S D n K * H KnX KnY KnM KnS * * * * * * * * T * * Program Steps C * * D * * E F BRST: steps * * DBRST: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: D: Destination device to be reset n: Device specifying the bit to be reset Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction When BRST instruction executes, the output device specified by operand n will be reset (OFF) Program Example: X0 BRST K4Y0 D0 Instruction: Operation: LD X0 Load NO contact X0 BRST K4Y0 D0 When D0 = k1, Y1 is OFF When D0 = k2, Y2 = OFF DVP-PLC Application Manual 10-23 10 Application Instructions API 202-313 API Mnemonic 269 D Operands Function Load NO Contact by Specified Bit BLD Type OP Bit Devices X Y M S n Word devices S K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BLD: steps * * DBLD: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BLD instruction is used to load NO contact whose contact state is defined by the reference bit n in reference device D, i.e if the bit specified by n is ON, the NO contact will be ON, and vice versa Program Example: BLD D0 K3 Instruction: Operation: BLD Load NO contact X0 with bit Y0 D0 K3 Status of bit3 in D0 OUT 10-24 Y0 Device coil Y0 DVP-PLC Application Manual 10 Application Instructions API 202-313 API Mnemonic 270 D Operands Function Load NC Contact by Specified Bit BLDI Type OP Bit Devices X Y M Word devices S S n K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BLDI: steps * * DBLDI: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BLD instruction is used to load NC contact whose contact state is defined by the reference bit n in reference device D, i.e if the bit specified by n is ON, the NC contact will be ON, and vice versa Program Example: BLDI D0 K1 Instruction: Operation: BLDI Load NC contact with bit Y0 D0 K1 status of bit1 in D0 OUT DVP-PLC Application Manual Y0 Drive coil Y0 10-25 10 Application Instructions API 202-313 API Mnemonic 271 D Operands Function Connect NO Contact in Series by Specified Bit BAND Type OP Bit Devices X Y M Word devices S S n K * H KnX KnY KnM KnS * * * * * * * * T * * Program Steps C * * D * * E F BAND: steps * * DBAND: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BAND instruction is used to connect NO contact in series The current state of the contact which is connected in series is read, and then the logical AND operation is performed on the current state and the previous logical operation result The final result is stored in the accumulative register Program Example: X1 BAND D0 K0 Y0 Instruction: Operation: LDI X1 Load NC contact X1 BAND D0 K0 Connect NO contact in series, whose state is defined by bit0 of D0 OUT 10-26 Y0 Drive coil Y0 DVP-PLC Application Manual 10 Application Instructions API 202-313 API Mnemonic 272 D Operands Function Connect NC Contact in Series by Specified Bit BANI Type OP Bit Devices X Y M Word devices S S n K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BANI: steps * * DBANI: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BANI instruction is used to connect NC contact in series The current state of the contact which is connected in series is read, and then the logical AND operation is performed on the current state and the previous logical operation result The final result is stored in the accumulative register Program Example: X1 BANI D0 K0 Y0 Instruction: Operation: LDI X1 Load NC contact X1 BANI D0 K0 Connect NC contact in series, whose state is defined by bit0 of D0 OUT DVP-PLC Application Manual Y0 Drive coil Y0 10-27 10 Application Instructions API 202-313 API Mnemonic 273 D Operands Function Connect NO Contact in Parallel by Specified Bit BOR Type OP Bit Devices X Y M S n Word devices S K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BOR: steps * * DBOR: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BOR instruction is used to connect NO contact in parallel The current state of the contact which is connected in series is read, and then the logical OR operation is performed on the current state and the previous logical operation result The final result is stored in the accumulative register Program Example: X0 Instruction: Operation: LD X0 Load NO contact X0 BOR D0 K0 Connect NO contact in Y1 BOR D0 K0 parallel, whose state is defined by bit0 of D0 OUT 10-28 Y1 Drive coil Y1 DVP-PLC Application Manual 10 Application Instructions API 202-313 API Mnemonic 274 D Operands Function Connect NC Contact in Parallel by Specified Bit BORI Type OP Bit Devices X Y M Word devices S S n K * H KnX KnY KnM KnS T * * * * * * * * * * Program Steps C * * D * * E F BORI: steps * * DBORI: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S: Reference source device n: Reference bit Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction Available range for the value in operand n: K0~K15 for 16-bit instruction; K0~K31 for 32-bit instruction BORI instruction is used to connect NC contact in parallel The current state of the contact which is connected in series is read, and then the logical OR operation is performed on the current state and the previous logical operation result The final result is stored in the accumulative register Program Example: X0 Instruction: Operation: LD X0 Load NO contact X0 BORI D0 K0 Connect NC contact in Y1 BORI D0 K0 parallel, whose state is defined by bit0 of D0 OUT DVP-PLC Application Manual Y1 Drive coil Y1 10-29 10 Application Instructions API 202-313 API Mnemonic 275~ 280 FLD※ Type Operands Function Floating Point Contact Type Comparison Bit Devices OP X Y M Word devices S K S1 S2 H KnX KnY KnM KnS T * * Program Steps C * * D * * E F FLD※: steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S1: Source device S2: Source device Explanations: EH2/SV_V1.9 and versions above, and EH3/SV2 supports the function EH series does not support the dunction This instruction compares the content in S1 and S2 Take API275 (FLD=) for example, if the result is “=”, the continuity of the instruction is enabled If the result is “≠”, the continuity of the instruction is disabled The user can specify the floating point value directly into operands S1 and S2 (e.g F1.2) or store the floating point value in D registers for further operation FLD※ (※: =, >, for example If the comparison result is that the absolute value of the difference between S1 and S2 is greater than the absolute value of S3, the condition of the instruction is met If the comparison result is that the absolute value of the difference between S1 and S2 is less than or equal to the absolute value of S3, the condition of the instruction is not met The instruction can be connected to a busbar API No 296 297 298 299 300 301 16-bit instruction LDZ> LDZ>= LDZ< LDZ DLDZ>= DLDZ< DLDZ | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | < | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | < | S3 | | S1 - S2 | ≦ | S3 | | S1 - S2 | > | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | A 32-bit counter (C200~C255) must be used with the 32-bit instruction DLDZ※ If it is used with the 16-bit instruction LDZ※, a program error will occur, and the ERROR LED indicator on the PLC will blink Program Example: If the absolute value of the difference between D10 and D11 is greater than K200, Y0 will be On If the absolute value of the difference between D10 and D11 is less than or equal to K200, Y0 will be Off LDZ> D10 D11 DVP-PLC Application Manual K200 Y10 10-33 10 Application Instructions API 202-313 API Mnemonic 302~ D 307 Operands Comparing contact type absolute values ANDZ※ ANDZ※ Type OP Function Bit Devices X Y M Word devices S S1 S2 S3 K * * * H KnX KnY KnM KnS T * * * * * * * * * * * * * * * * * * Program Steps C * * * D * * * E F ANDZ※: steps DANDZ※: 13 steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S1: Source device S2: Source device S3: Source device Explanations: EH3 V1.40 and SV2 V1.20 (and above) are supported The absolute value of the difference between S1 and S2 is compared with the absolute value of S3 Take ANDZ> for example If the comparison result is that the absolute value of the difference between S1 and S2 is greater than the absolute value of S3, the condition of the instruction is met If the comparison result is that the absolute value of the difference between S1 and S2 is less than or equal to the absolute value of S3, the condition of the instruction is not met The instruction ANDZ※ is connected to a contact in series API No 302 303 304 305 306 307 16-bit instruction ANDZ> ANDZ>= ANDZ< ANDZ DANDZ>= DANDZ< DANDZ | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | < | S3 | | S1 - S2 | < | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | ≦ | S3 | | S1 - S2 | > | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | A 32-bit counter (C200~C255) must be used with the 32-bit instruction DANDZ※ If it is used with the 16-bit instruction ANDZ※, a program error will occur, and the ERROR LED indicator on the PLC will blink Program Example: If M0 is On, and the absolute value of the difference between D10 and D11 is greater than K200, Y0 will be On If the absolute value of the difference between D10 and D11 is less than or equal to K200, Y0 will be Off M0 ANDZ> 10-34 D10 D11 K200 Y10 DVP-PLC Application Manual 10 Application Instructions API 202-313 API Mnemonic 308~ D 313 Operands Function Comparing contact type absolute values ORZ※ ORZ※ Type Bit Devices OP X Y M Word devices S K * * * S1 S2 S3 H KnX KnY KnM KnS T * * * * * * * * * * * * * * * * * * Program Steps C * * * D * * * E F ORZ※: steps DORZ※: 13 steps PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 Operands: S1: Source device S2: Source device S3: Source device Explanations: EH3 V1.40 and SV2 V1.20 (and above) are supported The absolute value of the difference between S1 and S2 is compared with the absolute value of S3 Take ORZ> for example If the comparison result is that the absolute value of the difference between S1 and S2 is greater than the absolute value of S3, the condition of the instruction is met If the comparison result is that the absolute value of the difference between S1 and S2 is less than or equal to the absolute value of S3, the condition of the instruction is not met The instruction ORZ※ is connected to a contact in parallel API No 302 303 304 305 306 307 16-bit instruction ORZ> ORZ>= ORZ< ORZ DORZ>= DORZ< DORZ | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | < | S3 | | S1 - S2 | < | S3 | | S1 - S2 | ≧ | S3 | | S1 - S2 | ≦ | S3 | | S1 - S2 | > | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | | S1 - S2 | = | S3 | | S1 - S2 | ≠ | S3 | A 32-bit counter (C200~C255) must be used with the 32-bit instruction DORZ※ If it is used with the 16-bit instruction ORZ※, a program error will occur, and the ERROR LED indicator on the PLC will blink Program Example: If M0 is On, or the absolute value of the difference between D10 and D11 is greater than K200, Y0 will be On M0 Y10 ORZ> D10 DVP-PLC Application Manual D11 K200 10-35 10 Application Instructions API 202-313 MEMO 10-36 DVP-PLC Application Manual ... executed, PLC will push the status of the switch contact into the self-defined stack in PLC The stack will be controlled by the PLC, and the user cannot change it When MCR instruction is executed, PLC. .. exceeds 200ms, PLC ERROR LED will flash The user will have to turn off PLC and back On again PLC will determine RUN/STOP status by RUN/STOP switch If there is no RUN/STOP switch, PLC will return... operand The watchdog timer in DVP series PLCs is used for monitoring the operation of the PLC system WDT instruction can be used to reset Watch Dog Timer If the PLC scan time (from step to END or when