Home
IVC Series Small PLC Programming Manual
Contents
1. After the machine is started the object tray will be conveyed to the entrance of the machine at the left side and trigger the Tray in limit switch If no other tray is occupying the machine the Baffle plate will lower down to let the object tray enter the machine When the tray is completely into the lift when it triggers the In lift 1 limit switch the lift will raise the tray until the Height OK limit switch is triggered The rollers will then act to convey the tray to the lift on the right side until the In lift 2 limit switch is triggered The lift will then lower to put the tray to the conveying belt on the right When the Convey complete limit switch is reset a complete lift and convey process is over and the machine is ready for the next round The input and output points are listed in the following table Monitored object Monitored object 1 f xo Tray in limit switch 8 YO Cylinder solenoid valve for the baffle plate SL xt In lift 1 limit switch 9 Y1 Cylinder solenoid valve for the left lift 3 X2 Height OK limit switch 10 2 Cylinder solenoid valve for the right lift 4 f Xs In lift 2 limit switch Roller motor contactor 5 X4 Convey complete Motor contactor for the left conveying belt 6 X5 Start switch Motor contactor for the right conveying belt r e Aula signal
2. 16 bits 16 bits Figure 3 4 C element Classification Two types 16 bit counter and 32 bit counter Elements numbered in Decimal starting with O Data type Boolean word or double word Data Register Element mnemonic D Function As a data element the D elements are used in many calculation and control instructions as the operands Elements numbered in Decimal starting with O Data type Every D element is a 16 bit register that can store data like an 16 bit integer Two D elements can form a double word and store a 32 bit data such as the long integer data or floating point data Sign bit i MoB Dn element n 0 7999 Single word D T LSB element 16 bits Dn 1 element LSB n O 7998 Sign bit MSB Dn element n 0 7998 Double word D element 16 bits 16 bits The data range of single word D element 32 168 32 767 The data range of double word D element 2 147 483 648 2 147 483 647 Figure 3 5 D element Chapter 3 Element And Data 55 Available forms The instructions that may use the C elements are classified into 4 types CTU CTR DCNT and the high speed counter instructions See Chapter 5 Basic Instructions
3. Operand S2 gt 0 D10 measured D the storage register for the counted pulse number D11 current g SE E which will cause overflow when bigger than 65535 a ES wv Function description To detect the number of pulses input through XO X5 Toe o in the specified period of time ms and store the result in the designated storage register Note 1 SPD and HCNT are contradictory in their occupation D12 elapsed time of hardware For details see Chapter 8 Using High Speed I O Input XO 2 The SPD instruction supports only input points XO X5 3 Maximum pulse input frequency 10kHz Detection may be faulty when frequency is higher than 10kHz N fpn Proximity switch n pulse round 1 When MO is ON count the pulses input through X0 within 1000ms and store the counting result in D10 4 The input frequency of SPD must be subject to the limit of system total pulse frequency Example D11 is the present counting value within the 1000ms ak TEE E s a while D12 is the elapsed time within the 1000ms MO Op 10000 2 D10 is in positive proportion to the rotary speed of SFI xO 1000 nid i e the plate in the preceding figure LD SMO 3 D10 counts whenever X0 changes from OFF to ON PLSY 10000 O YO and the counting value within the last 1000ms will be LD MO stored in D
4. 220Vac HC MFS13 L N QF KM Note 9 3 S U 220Vac L2 Y y Sen L3 W W L11 PE E PLC L21 PE JE PG connecting Absoluate x 1 a return CN2 SE Ke X2 J Forwardjogging GE Ge Servo X3 Reversejogging E T K amplifier X4 a Forward position control X5 Reverse position control X6 a Proximity signal X7 Systemstart COM Eegen CN1B 24V COM COM SG Shielded cable CN1A YO A Instruction pulse pl PP COM LU sc EN EE SD OM ee Shielded cable Seas Y2 i Clearing signal i CR Y3 H SG A SD Y4 Instruction direction signal NP COM2 1 SG EE Peeing E LSD COM OPC CN1B X10 DO1 Note 1 ONIE X11 ZSP Note2 EMG T Emergency stop button X12 TLC Notes RES E Se ALM LSP Forward limit swtich X14 RD LSN i Reverse limit switch COM SG ES Y10 SON note 4 Y11 ABSM note 5 Y12 ABSR note6 COM3 IVC1 1614MAT ue MR 325 104 Note 1 ABSM serves as the ABS bit 1 transmission cable when set ON or as the locating complete signal when set OFF Note 2 ABSM serves as the ABS bit 2 transmission cable when set ON or as the zero speed signal when set OFF Note 3 ABSM serves as the data transmission ready signal when set ON or as the torque being limited when set OFF Note 4 Servo enabling signal It must be set before the ABS instruction is executed Note 5 The ABS transmission mode signal Note 6 The ABS transmission request signal Note 7 It must be a PLC basic module
5. ECbus Protocol PLC communication port 1 setting No protocol O Freeport protocol O Modbus Protocol ECbus Protocol IVC Series Small PLC Programming Manual 246 Chapter 10 Using Communication Function The parameter setting of free port is as follows Freeport Protocol PLC serial port setting Baud rate 2600 v Parity Data bit e Y Stop bit Yalid byte Lowbyte ei C Allow start character detection C Allow end character detection d Intercharacter timeout Interframe timeout Configurable items are listed in the following table Sang Doum E 1200 Defaut 9600 Depp Lang ANN Parity None default o een CS Sr Stop bit 7 mpate Allow start Check to allow Default not allowed character detection Start receiving after the designated start character is detected 0 to 255 corresponding to 00 to FF Save the received characters including the start character to the designated BFM Allow end character Check to allow Default not allowed detection End character Stop receiving after the preset end character is received and O to 255 corresponding to 00 to FF detection setting l p g save the end character to the BFM Intercharacter Check to enable Default disabled timeout enabling Intercharacter Stop receiving if the interval between two received characters is j 0 to 65535ms timeout setting longer than the timeou
6. IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 259 Distribution of D element on N N bus multiple layer network layer 0 Distribution of D element in 0 LH D Gemm restores D77OStOD77O7 IP D77OStOD7709 INACIO IS O omom IP Oo maoo O O omeo ID D Sefm O R O maoona In O AA Explanation HO 1 2 3 4 5 6 T 8 9 12 14 0 1 2 3 4 5 6 7 In mode 6 D7700 and D7701 are distributed to the sending area by O station layer 0 They can be written by the PLC of 0 station and directly read by the other stations 1 15 Distribution of D element on N N bus multiple layer network layer 1 sending area 0 1 12 14 0 1 2 3 7 Explanation In mode 10 D7732 and D7733 are distributed to the sending area by O station layer 0 They can be written by the PLC of 0 station and directly read by the other stations 1 15 IVC Series Small PLC Programming Manual 260 Chapter 10 Using Communication Function Distribution of M element on N N bus multiple layer network layer 0 Distribution of M element in Mode 6 sending area M1400 to M1415 M1416 to M1431 M1432 to M1447 M1448 to M1463 M1464 to M1479 M1480 to M1495 M1496 to M1511 M1512 to M1527 M1528 to M1543 M1544 to M1559 12 14 M11560 to M1575 M11576 to MIO M1592 to M1607 use M1623 e weem m f M11640 10 M1655 Explanation 0 1
7. 11 1 Operand description S1 the starting D element S2 output section number Range 0 255 D1 high speed pulse output point Range YO Y1 Function description 1 Use the ConstrolStar instruction wizzard to generate the PLS instruction which can be called like subprograms When the power flow is ON the system will output corresponding pulses according to the configuration You can control ON or OFF of the PG and set frequency 4 pulse number 2 There is no output when the section number is 0 3 SM80 and SM81 can be used to stop the high speed pulse output Other flag bits are the same as other high speed UO instructions 4 The subprogram PLS_SET generated by the AutoStation is as follows n D element addr M total section number LD SMO DMOV section 1 step frequency Dn DMOV section 1 step pulse number Dn 2 DMOV section 2 step frequency Dn 4 DMOV section 2 step pulse number Dn 6 DMOV section 3 step frequency Dn 8 DMOV section 3 step pulse number Dn 10 DMOV section M step frequency Dn 4M 4 DMOV section M step pulse number Dn 4M 2 DMOV max speed Dn 4M MOV min speed Dn 4M 2 MOV acceleration time Dn 4M 3 MOV deceleration time Dn 4M 4 Note 1 It is recommended to use the PTO instruction wizard to generate PLS instruction If you write the PLS instruction manually note that the pulse number of the steps must not be too small With set acceleration the pulse number of
8. LU Note 1 Setting of enable control elements cannot affect the exection of the timed interrupts in the interrupt request queue 2 The timing for a re enabled interrupt will start from zero To change the interval of the timed interrupt when the program is running it is recommended to follow the following procedures 1 Disable the timed interrupt 2 Change the interval 3 Enable the time interrupt Example This example uses timed interrupt 0 to flip the YO output once a second which makes YO flashe 1 Compile an interrupt program for the interrupt event IVC Series Small PLC Programming Manual 238 Chapter 9 Using Interrupts Project Manager AX MAIN INT_1 ai b x E Si 9 3 1 Variable addr Variable Name Variable Type Data Type Comments Program block TEMP BOOL E MAIN 4 e SBR_1 INT_1 A E Global variable table Y F lip TOF gt Datablock la System block YO YO Ss Cross reference table R Element monitoring table ei EMT_1 Ha Comm equipment connecti Refresh YO immediately Configuration table i E SMO 5 HL REF w 8 e ProieCt Man SN Instruction lt gt 2 Specify an interrupt event number for the interrupt program Project Manager TX 7 MAIN INT_1 ls El MY 9 3 1 Variable addr ds zi Program block y E MAIN 2 mer Program dr SBR_1 Se ENT i Author A INT_1 Flip YO eren timing interrupt O Interrupt no 26 E Global
9. PLC system functions system states time square wave interrupts and communication etc EA Output image registers N Y discrete output point hardware circuit SES Executing amp displaying devices Figure 3 1 Types and functions of PLC elements In this manual the elements are named according to their types For example e Input point X or X element for short Oo Output point Y or Y element for short Auxiliary relay M or M element for short Oo Data register D or D element for short o State relay S or S element for short IVC Series Small PLC Programming Manual Chapter 3 Element And Data 33 3 1 2 Element List The elements of IVC series PLC are classified according to their functions and are easily accessible The elements are listed in the following table Table 3 1 IVC series PLC elements IVC1 series IVC2 series 1281 1280 Input XO X177 2561 2560 Input XO X377 Sen Output YO Y 177 News Output YO Y377 Note 1 Local daa register 64 v0 V63 data register 256 SDO SD255 256 SDO SD255 Notes 1 The X and Y elements are addressed in octal system and X10 represents the 8 input point The I O point number here is the system capacity while the actual system I O point number is determined by the actual system configuration including extension modules and po
10. SS 3 C244 contact Note 1 Counter input point XO 2 High speed counters when used in instructions DHSCS DHSCR DHSZ DHSP and DHST can trigger operations free from the scan cycle IVC Series Small PLC Programming Manual Chapter 8 Using High Speed UC 229 1 phase bi directional input high speed counter The 1 phase bi directional input high speed counter starts to count only when the pulse input changes from OFF to ON The two input points determines its counting direction which is monitored by its corresponding SM element Example W250 Wi H NI C250 gt 0 OFF HH er Cep The time sequence chart of the contacts action in the program is shown in the following figure X10 is ON C250 is cleared regardless of X11 and X7 X11 8 X7 ON C250 starts to count X3 changes from OFF to ON C250 counts up SM250 is not being driven C250 value reaches 3 C250 contact changes X11 amp X7 ON If X5 is ON C250 is _X4 changes from OFF to ON C250 cleared and the contact is reset counts down SM250 is being driven C250 contact
11. 3 DHSCR DHSCI DHSCS DHSZ DHSP DHST can be used repeatedly However at most the first six such instructions can be driven at the same time 4 The maximum frequency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O Example LD SM255 110 gt OUT Y10 N LD M1 Ee EH HCNT C255 1000 aa LD C255 OUT Y20 OFF DHSCR 2000 C255 OI LD Me DHSCR 2000 C255 Y1 1 When M1 and X7 are both ON C255 counts the phase difference of X3 and X4 in the interrupt mode When C255 changes from 999 to 1000 C255 contact will be set and reset when C255 changes from 1001 to 1000 When C255 contact drives Y20 the execution of Y20 will be determined by the user program scan cycle 2 When M2 is ON and the DHSCR instruction meets the requirements stated in the preceding Note Y1 will be output immediately when C255 reaches 2000 regardless of the the scan cycle 3 When the X3 pulse input is ahead of X4 SM255 is ON When the X4 pulse input is ahead of X3 SM255 is OFF 4 When X7 the startup signal of C255 is OFF C255 will not count 5 When M1 and X7 are all ON if X5 is ON C255 will be cleared and C255 auxiliary contact will be reset IVC Series Small PLC Programming Manual 146 Chapter 6 Application Instructions 6 10 5 DHSZ High speed Counting Zone Compare Instruction Applicable to IVC2 IVC1 Offset
12. Selection merge J the last step will end and the next step will start Connected after a step the parallel branches share the same transfer conditions Parallel branch i When the transfer conditions are met the parallel branches are validated and executed at the same time A merge of parallel branches The next step will start only after all the parallel steps Parallel merge _ Si are finished and the transfer conditions are met Ladder chart The LAD block presents LAD instructions for operations besides the SFC flow such block as Starting the initial step and other general operations Usage Of Programming Symbols 1 The initial step can be used alone If you connect it with other symbols you must use it at the start of you SFC program and use a transfer condition symbol after it However you cannot connet the LAD step with other symbols You must connect an normal stepwith transfer condition symbols for the ordinary steps cannot be used alone The reset and jump should both be preceded by a transfer and followed by nothing Coe de SN Neither the transfer nor the jump can exist alone in a program 7 1 5 SFC Program Structure The structure of a SFC program is classified into three types simple sequential structure selection branch structure and parallel structure Besides the jump structure is also a special form of the selection branch structure Simple sequential structure Figure 7 1 shows a simple structured SFC program
13. The data to be sent 01 FF 00 01 02 The data to be received Save the received data to D elements starting with D10 Each byte occupies one D element as shown below 1 Change the setting of communication port in the system block to free port communication and set the related parameters 2 When the power flow of SM1 is valid save the to be sent data to the communication BFM starting with DO Send data with XMT instruction and reset SM122 transmission complete flag bit before the sending 3 Set SM122 after the transmission and begin to receive data upon the rising edge The maximum length for the received characters is 6 4 Set SM123 after the data is received and perform the corresponding operation based on the receiving completion information register SD125 H Inc 5 Use X5 as the enable bit for interrupting the sending and receiving MOY LGS MOY 16 FFO1 MOV EMO MOY a Different from Example 1 when sending the high amp low bytes of a word element the element must be divided into high amp low byte parts For instance if you want to send the content of D2 you EST can store its high byte and low byte separately in D3 and D4 and then send D3 and D4 You can also store the data in a K4MX such as K4MO of in this example element Take K2MO as high byte and K2M8 as low i byte nid H IE MOY AMT IVC Series Small PLC Programming Manual 248 10 4 10 4 1 10 4 2 10 4 3
14. You can download the documents of IVC series small PLC at www invt com cn If you need the paper copy of the document please contact your agent 1 4 1 Model Selection Instruction IVC1 Model Selection Manual IVC2 Technical Manual 1 4 2 Basic Module User Manual IVC1 series IVC2 series IVC1 Series PLC Quick Start User Manual IVC2 Basic Module Quick Start Manual IVC1 Series PLC User Manual IVC2 Series PLC User Manual 1 4 3 Programming Manual IVC Series Small PLC Programming Manual 1 4 4 Programming Software User Manual AutoStation Programming Software User Manual 1 4 5 1 0 Extension Module User Manual IVC1 Series PLC Passive I O Extension Module User IVC2 Series PLC Passive I O Extension Module User Manual Manual IVC2 Series PLC Active I O Extension Module User Manual 1 4 6 Special Module User Manual IVC2 4AD Analog Signal Module User Manual IVC2 4AM Analog Signal Input Output Module User IVC1 5AM Analog Input Output Module User Manual IVC2 4PT RTD Module User Manual IVC2 4TC Thermocouple Module User Manual IVC2 8AD Analog Input Module User Manual IVC2 8TC Thermocouple Module User Manual IVC2 series IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description Chapter 2 PLC Function Description This chapter introduces the programming resources theories and system configuration of IVC series PLC as well as how to set PLC running and operation modes The system commissioning funct
15. dlrlsl FS ST j zl APDS Variable addr Variable Name Variable Type Data Type Comments 6 1 Program block TEMP BOOL 3 a MAIN lt gt ce SBR_1 E Global variable table y Datablock aj System block Cross reference table Invoke Subprogram Element monitoring ta ei EMT_1 z a Comm equipment conne Subprogram SBR_1 PS Configuration tabl IN INT IN INT OUT INT SI Instruction Project Ma Figure 4 12 Calling subprogram Step 4 Compile download and run the user program and check the correctness of the SBR logic Execution result When MO is ON SBR_1 will be called Values 2 and 3 are transferred to the operands IN1 and IN2 to carry out the calculation operation The result 5 is then returned to the main program and in the end DO is 5 General Information Of Instructions Instruction Operands The instruction operands can be classified into the following two types e Source operands or S or S4 S2 S3 when there are more than one of them in the same instruction The instruction reads values from source operands for calculation e Destination operands or D or D1 D2 D3 when there are more than one of them in the same instruction The instruction controls or outputs values to the destination operands The operands could be bit elements word elements double word elements or constants See the specific instruction description in Chapter 5 or Chapter 6 for details
16. operation on the M3 M AND M4 power flow values of two power _ ORB flow blocks and then assign the OUT YO value to the current power flow When both M1 and M2 are ON or both M3 and M4 are ON YO outputs ON 5 1 10 MPS Output Power Flow Input Stack Applicable to IVC2 IVC1 Influenced flag bit IL MPS Program steps FS Function description Note Push the current power flow value It is prohibited to use the MPS instruction consecutively for over 8 times in a LAD program with no MPP instruction in between into the stack for storage so that it g 9 otherwise the power flow output stack may overflow can be used in the power flow calculation for the subsequent output branches IVC Series Small PLC Programming Manual 60 Chapter 5 Basic Instructions 5 1 11 MRD Read Output Power Flow Stack Top Value Applicable to IVC2 IVC1 Influenced flag bit Program steps 4 OoOO Function description Assign the top value of the power flow output stack to the current power flow 5 1 12 MPP Output Power Flow Stack Pop Off Applicable to IVC2 IVC1 Influenced flag bit Program steps 4 oooO Function description Example Pop the power flow output stack and LD MO MPS ed popped value to the current MO Mi YO pela ge power flow gt SUr YO M2 Ti MRD e AND M2 e i OUT Y1 y MPP AND M3 OUT Y2 5 1 13 EU Power flow Rising Edge Detection Applicable to IVC2 IVC1 Ce Program steps 2 Fu
17. 2 400 101 1 200 110 57 600 111 115 200 0 1 stop bit 1 2 stop bits Data bit of every character 0 8 bits 1 7 bits SEN AA RARA E D D E j il SD113 Word overtime setting Default Oms word overtime omitted 32767ms D D j R SD114 Frame overtime setting Default Oms frame overtime omitted 32767ms SD115 SD116 Characters currently received SD117 Total number of currently received characters SD118 Characters currently sent Receiving completion message code Bit 0 set when receiving ends Bit 1 set when specified end character is received Bit 2 set when max character number is received Bit 3 set upon word overtime Bit 4 set upon frame overtime Bit 5 set upon parity check error Bits 6 15 reserved ME Ed Sc IVC Series Small PLC Programming Manual 274 Appendix 2 Special Data Register 11 Freeport Reception Control And State Port 1 b2 b1 bO 000 38 400 001 19 200 SD120 0 SD120 2 E po Port baud rat Ra RS 100 2 400 101 1 200 110 57 600 111 115 200 O 1 stop bit D120 3 st t S ES EES 1 2 stop bits l O even parity D120 4 ty check penes 1 odd parity SD120 5 parity check 0 disabled enabling 1 enabled Data bit of every character SD120 6 data bit of SD120 ia HOH OFENSTY 0 8 bit character y y 1 7 bit character D120 7 free port S E Geet 1 start character specified receiving start character o 0 start character unspecified mode
18. 3 8 Preset reset Multiple Registers 0x10 Hex At most 120 registers 0x78 can be written 1 Request frame Function Starting Number of Number Written element Written element Address code address elements of bytes value No 1 value No N Ge a E CRC or LRC AAA TE Y IVC Series Small PLC Programming Manual 3 9 3 10 Appendix 7 Modbus Communication Protocol IVC Series 287 2 Response frame Starting Address Function code 0x10H address Number of elements Check code CRC or LRC Faulty Response Frame 0x80 function code Response Frame Check code Function code refers to the function code of the captured request frame 0x80 Points To Note 1 Refer to the address classification of elements the elements read each time shall be of the same type For example elements X and Y cannot be read in one frame 2 The address and data range of the element shall be within the range specified by the protocol For example For Y element the protocol address range is 0000 0255 Y0 Y377 O f the read starting address is 1 and 256 elements are read address error will be returned error code 02 because there are only 255 Y elements that start with 1 O f the read starting address is 0 and 257 elements are read data error will be returned error code 03 because the actual defined number of Y elements is only 256 O f the read starting address is O and 256 elements are read the status of 256 elements will
19. 6 3 nteger Math INSTRUCTIONS E 89 0 3 ADD Add Integer INSUUCHIOM pricipal 89 6 392 UB Sublracl integer INS UMUC ON EE 89 6 3 3 MUL MUMIpIY Integer IMSIMLICTION iii eins veins evinces nae eden eA oe nie ea Aa 90 6 3 4 DIVE Bel eh On Cu He den WE 90 6 3 5 SQT Square Root Integer Instructions aa 91 6 3 6 INC Increment Integer INSUUCTION E 91 6 9 7 DEC Decrement Integer INSTUCI N 0 A A geed A A E 92 6 3 8 VABS Integer Absolute Value Instruchon AE 92 6 3 9 NEG Negative Integer INSIUICIION wisest a o oo S E 93 6 3 10 DADD Add Double Integer Instruction nic A A Aeon 93 6 3 11 DSUB Subtract Double Integer Instruchon 94 6 3 12 DMUL Multiply Double Integer Instruchon uk 94 6 3 13 DDIV Divide Double Integer Instruction kk 95 6 3 14 DSQT Square Root Double Integer InsStructiON cocooocccccoccnnonoconccnncnnononnnnnnnnononnncnnnnonnnnonaninnnnarononnnnnnos 95 6 3 15 DINC Increment Double Integer Instruction ccccooccncocccnncnoncnnnnnnoncnnncnnnnnnnnnonnnonnnnnnnnonnnrnnonnnrnnnnrnncnnnnnnss 96 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 71 6 3 16 DDEC Decrement Double Integer Instruction cccecccccseeeeeseeeeeeeeeeeecaeeeeeseeeeeeseeeeesaaeeeesaaeeeesaeeessanseesaees 96 6 3 17 DVABS Double Integer Absolute Value InstructiON ooooccccconnononoccnccnnconononcnnnnnnnnnnnronononcnnnnnnrnnonaninnonos 97 6 3 18 DNEG Negative Double Integer Instruchon 97
20. D Program steps Offset addressing s1 DWORD Constant Knx Kny knM_KnS KnLM knsmM D sp c vw y s2 DWORD Constant Knx Kny knM_KnS KnLM knsmM D sp c vw y D bwormo _ ny kn kns knem D lel Iv y Operand description Example S1 Source operand 1 M OT 2002 STBGSTTAT s4i09Tes4 LD SU tae 2 ES l DWAND DO D2D10 S2 Source operand 2 When XO is ON DO D1 2 10110010101001101110011001010010 D destination operand 2997282386 and D2 D3 2 00111010001110110011000100110011 Function description 976957747 will conduct the logic AND operation and the result Whenthe nowerilowisvalid 2 00110010001000100010000000010010 841097234 is assigned to D10 S1 and S2 will conduct logic D11 AND operation and the result is assigned to D IVC Series Small PLC Programming Manual 118 Chapter 6 Application Instructions 6 6 6 DWOR OR Double Word Instruction LAD Applicable to IVC2 WC DWOR SI S2 D mmie a Influenced flag bit IL DWOR S1 S2 D Program steps Operand T Applicable element ISA eran e cable elements j E ER addressing S1 DWORD Constant Knx KnY KnM knS KniM Knsm D sp c vw y s2 DWORD Constant Knx KnY KnM Kns KnLM knsM D sp c v y D bworo _ kny knm kos kam D lel v y Operand description Example x0 2097262386 9TEISTTAT 3133142899 LD XO S1 Source operand 1 ge S Se OR a be Bi S2 So
21. D120 8 free port O erte 1 end character specified receiving end character 0 end character unspecified mode SD120 9 free port word 1 word overtime enabled overtime enabling 0 word overtime disabled SD120 10 free port frame 1 frame overtime enabled overtime enabling O frame overtime disabled SE ist lid at LSB o ems oe EE ee eee beyla 1 word register valid at both the 9 y most and LSBs SD12013 0120 18 ap Endcharacter O O Default Oms word overtime Ha W rti tti R W y Default Oms frame overtime 0 F rti tti R W Bit 0 set when receiving ends Bit 1 set when specified end character is received Bit 2 set when max character SD125 Receiving completion message code number is received Bit 3 set upon word overtime Bit 4 set upon frame overtime Bit 5 set upon parity check error Bits 6 15 reserved WS NS SD126 Characters currently recived SE Total number of currently received E characters SD128 Characters currently sent VS IVC Series Small PLC Programming Manual Appendix 2 Special Data Register 275 12 Modbus N N bus Setting Range MOD 1 32 ls at SCT SL See E E ER pre receiving INN bus extra ce PORT 0 PORT 0 retry times ss a times RW ee Ia N N bus network update mode itn eee eee 0 RW E 13 MOD 1 Be SD135 Local station No Port 1 Max timeout time of Port 1 post sending and pre receiving SD136 N N bus extra delay SD137 Po
22. Elimination success Transfer conditions the parallel merge 26 530 32 X10 X11 X12 S gt e 3 1 EA AMA Capping rodLabeling roEliminating back d back rod back Transfer d d Ml state to labeling qualified state M2 Transfer labeling qualified state M2 to elimination of disqualified success state M3 M2 M3 7 Elimination success M2 Labeling qu alified M2 j gu Capping lified IVC Series Small PLC Programming Manual 226 Chapter 8 Using High Speed UC Chapter 8 Using High Speed UO This chapter presents the usage and notes about the high speed counters external pulse and PLS envelope 9 Dhl mI glee el EEN o E 227 9 1 COMICIOS ot 227 8 1 2 High Speed Counter And SM Auxiliary Relay Relationship ccocooccoccccccncnoncnnonocononnnnonnnnncnnononononnnnononnnons 228 91 3 Usage e De ne Ee K ee TEE 228 8 1 4 Points To Note About High Speed CGounters 230 8 2 External Pulse Capture Funchon cece eeeseeeeseeeeseecesseeeeseeeeseeessacessaeeesaecessueesaeessueeeseeeseas 231 8 3 High Speed Pulse Output 231 8 3 1 High Speed Pulse Output Funchon cece cccccceececeeeeceeeeeceeeeceecesseeeeseueeceacessacessaeeeseeessasessaeeeseeeseneessaees 231 8 3 2 Points To Note About High Speed Pulse Output 231 8 4 Configuring PLS Envelope Instruchon rrr nnrrren nren 232 8 5 Notes On High Speed l O Application coooccccocnccccnnccccnccnonoconnnonncnnnncnnoncnonnnnonnnn
23. Figure 2 2 Setting saving range LU Note The power loss data saving function in IVC2 series PLC relies on the support of the backup battery If batteries fail all the saved elements will have uncertain values after power loss For IVC1 series PLC the values of its saved elements are stored in the permanent memory Permanent Storage Of D Device Data You can use the EROMWR instruction in the user program to write the D device values D6000 D6999 to the permanent memory EEPROM in IVC1 series PLC The EEPROM operation will make the scan cycle 2ms 5ms longer The written data will overwrite the existing data in EEPROM LJ Note The EEPROM can be over written for a limited number of times usually one million Do not overwrite EEPROM unless it is necessary otherwise EEPROM could fail soon and lead to CPU fault Digital Filtering Of Input Terminals The input terminals XO X17 of IVC2 series PLC and X0 X7 of IVC1 series PLC use digital filtering to filter the noise at the terminal You can set the filter constant in the Input Filter tab of System block The filter constant setting ranges are IVC2 0 60ms Default 10ms IVC1 0 8 16 32 and 64ms Default 8ms No Battery Mode The IVC2 series basic module can work without battery When you select the No battery mode in the Advanced Settings tab of System block the system will not report system errors caused by lack of battery Battery backed data lost Forced table lost an
24. ISS O lt d i v Project IE gt Comments TE Allow the request of enabled interrupt to join the request queue Get 5M54 ON to enable the port 1 frame sending interrupt Oo is Instruct For the detailed example of serial port interrupt please refer to Chapter 10 Using Communication Function IVC Series Small PLC Programming Manual 244 Chapter 10 Using Communication Function Chapter 10 Using Communication Function This chapter introduces the communication function of IVC series small PLC including the communication resources and communication protocols and uses examples to illustrate 1 Os COMMUMICATOM ee 245 10 2 Programming POTRO TOC sici n A dior iia 245 10 Free POr Communication Prol dios 245 103 Me Lt deel ION a a a a a nace a a ee 245 10 3 2 Parameter Seting OM Free POI sis da 245 10 3 S Free POM INSTUCION EE 246 104 Modbus Communication Protocol vi ioe ee eo es eee ee S 248 ADA Mie e elteren EE 248 E CharaCteriSuics Ol EMAKS si IE 248 VOAS RTU Transiter Mo LE 248 RE ASGIE Transier MOC EE 248 10 4 5 Supported Modbus Function Code ic cords ac dnch atic ete en ac te ie a 248 10 4 6 Addressing Mode Of PLC Element 249 TOES MOC DUS Save ct o es ath he La ad hs e ohh aes da rel ah ld aha o ate 249 10 48 Reading amp Writing El Mens IS AAA AAA A RAS 250 10 4 9 Handle ai ele ee EE 250 10 4 10 Handle O LON LE E E 251 104211 RTE teilen E ees
25. The block comment global variable table and local variable table can be compiled and downloaded to the IVC2 series PLC To store such information battery backup is needed However although battery failure may cause information loss comment upload failure and user information file error report the user program can still run normally IVC Series Small PLC Programming Manual 50 4 4 4 4 1 4 4 2 4 4 3 Chapter 4 Programming Concepts Subprogram Concept Being an optional part of the user program a subprogram SBR is an independent Program Organization Unit POU that can be called by the main program or other SBRs You can use SBRs in your user program to 1 Reduce the size of the user program You can write a repeated program section as a SBR and call it whenever necessary 2 Clarify the program structure particularly the structure of the main program 3 Make the user program more transplantable Points To Note For Using SBRs Note the following when writing or calling a SBR 1 The PLC supports up to 6 levels of SBR nesting The following is an fine example of 6 level of SBR nesting MAIN gt SBR1 gt SBR2 gt SBR3 gt SBR4 gt SBR5 gt SBR6 where the gt represents calling with the CALL instruction 2 The PLC does not support recursive calling and cyclic calling of SBRs The following two examples show two illegal SBR callings eo MAIN SBRO SBRO recursive calling illegal e M
26. X6 input rising edge interrupt X7 input rising edge interrupt ee Ne ME E WE D D XO input falling edge interrupt X1 input falling edge interrupt Processing Interrupt Event 1 2 3 4 5 T 10 11 12 13 14 15 16 17 18 9 number SM High speed counter interrupt 3 High speed counter interrupt 5 Setting SD66 Enabling SM66 Setting SD67 Enablin SM67 Setting Timed interrupt 1 SD68 Enabling 28 Timed interrupt 2 SM68 Timed interrupt O Power failure interrupt SM56 h t ing int t of Charac Er sending interrupt o SMA48 communication port O h t iving int tof Charac a elle interrupt o SM49 communication port O F ding int tof rame sen Ing interrupt o SM50 communication port O F iving int t of rame ii interrupt o SM51 communication port O h t ing int tof Charac er Sending interrupt o SM52 communication port 1 Ch t iving int t of arac E ong interrupt o SM53 communication port 1 F ing int tof rame ER interrupt o SM54 communication port 1 F iving int tof rame ead interrupt o SM55 communication port 1 1 When a certain interrupt event occurs if it is enabled its corresponding event number will be added to the interrupt request queue which is 8 record long and FIFO 2 Processing of the interrupt request by system IVC Series Small PLC Programming Manual 9 3 Chapter 9 Using Interrupts 237 1 If the system detects that any request in the interrupt queue it will stop the n
27. f vye ooN Divide doube integer instruction o CT YP BEC Decrement neperstuston 3 a DT Double integer to oatng point numberinstract n 7 f x pv 07 Drum Fi data block double word instruction 9 TP DEROM Read double wore from special module buffer 10 E d 130 register instruction DGBIN _ 32 bit gray code to double word instruction E E E a a E DGRY Double word to 32 bit gray code instruction use High speed counting compare interrupt trigger instruction DHSCR_ High speed counting compare reset instruction DHSCS_ High speed counting compare set instruction wl el MAM NINININI A NIN tt N High speed counting table compare pulse output r y DHSP instruction SN APA EE MEL N LEE AA pa OMUL Mapy double megerto AO DNEG Negative double integer instruction 7 f vvo DROL 82i cary creutar shift Tef rege 1 9 f cw III DRCR S2 btcany circular shitrghtinstucton 9 f cew V y 28 DROL zbi sireva shif Tef instrutor 9 f cw III BROR 828i creularshitrghtinstucton 9 f cew v DRVA Control absolute positon msu 127 f f fv DRU Contofreative poston instruction n f f fe os fiskets TCP E E DER E Zero C ue Jegen o ar ero Garry DUO Borrow SUM _ Sum double integer instruction e EEREERECR Read double word from special module buffer 132 register instruction Double Double integer absolute value instruction absolute value instruction et ie tae EAN AND coa vea ton ROA BEER WoR OR double werdins
28. 0 9 19 SUM Sum Integer nee OM WEE 98 6 3 20 DSUM Sum Double Integer Instruction ooccccococoncconconocononcnnononononcnnoconcnnononnnonnnronononcnnonannnconaraninnns 99 6 4 Floating Point Number Math INSUR aida 99 6 4 1 RADD Add Floating Point Number INStruction ooocccoccnconcnccncncnoncncnncncnncnnnnocnnoncnnoncnnoncnnnnnnnnnnrnnonrnconannnnaos 99 6 4 2 RSUB Subtract Floating Point Number JInstruchon 100 6 4 3 RMUL Multiply Floating Point Number Instruchon 100 6 4 4 RDIV Divide Floating Point Number Instruction cooocccoccncoccncnnocnconcncnncnonncnnnnocnnnncnnoncnnonrnnonannnnnrnnnncnnnns 101 6 4 5 RSQT Square Root Floating Point Number InStructiON ccccoooccncconcnncconcnnonoconononcnnnnnncnnnnnccnnnnarononnnnnnnnos 101 6 4 6 RVABS Floating Point Number Absolute Value Instruction nnnannnnsnnnnsnnnesnnnesnrnesrrnrsrrrrsrrrrsrrrrsrrrrsrrrrene 102 6 4 7 RNEG Negative Floating Point Number Instruction oocccccoccnccccccnncnncnnononcnnnnnnonnnnncnnnnnnrnnonnnnnnnnncnnnnnncnnnnos 102 6 4 8 SIN Floating Point Number Sin INStTUCION a ee ee 103 6 4 9 COS Floating Point Number COS Instruction occccooococcconcncococonoconcnnoconnnnonarononnncnnonnnnnnnnranononnnnonanannnnos 103 6 4 10 TAN Floating Point Number TAN Instruchon uk 104 6 4 11 POWER Floating Point Number Exponentiation Instruchon 104 6 4 12 LN Floating Point Number LN Instruction 105 64
29. 1 When the power flow is valid the value of the stack head with D1 as the stack bottom is assigned to D2 and at the same time the value of D1 subtracts 1 2 When D1 is 0 it indicates that the stack is empty the zero flag SM180 will be set 1 Note 1 When the stack is illegal for example when the stack size lt 0 the number of elements in the stack lt 0 or when the stack size is beyond the limit the system will report Definition error of stack operated 2 The stack size does not include the stack bottom element the element designated by D7 3 S indicates the stack size Range 2 0 Example MO q 10000 e LIFO up D 10 LD MO LIFO D100 DO 10 Stack pointer lt a 1 When MO is ON the content of D110 is assigned to DO the content of units D101 D110 remain unchanged 2 Before the execution DO 0 D100 10 D101 1000 D102 2000 D109 9000 D110 10000 3 After the execution DO 10000 D100 9 D101 1000 D102 2000 D109 9000 D110 10000 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 87 6 2 13 WSFR Shift Right Word Instruction LAD Applicable to IVC2 IVC1 H mem eu D 52 53 IL WSFR S1 D S82 S3 Operand Type Applicable elements addressing Sr m pe e e e OT oe TT Vv MEC 52107 Constant ox Kny Kaw eg Ten A DA E es en RI II Pt pv E ERC EE Ss INT Constant krx Kn Kaw
30. 2 3 4 5 6 7 In mode 6 the M elements distributed to the sending area by 0 station layer 0 range from M1400 to M1415 The elements can be written by the PLC of 0 station and directly read by other stations 1 15 Distribution of M element on N N bus multiple layer network layer 1 M1706 to M1719 M1720 to M1735 M1736 lo M1757 M1752 to M1767 M1768 to M1783 M1784 to M1799 M1800 to M1815 12 14 EE al M element Mode 10 Mode 11 Mode 12 Mode 13 in sending area M1656 to M1671 M1672 to M1687 H0 0 e mn 2 M1876 to M7837 M1832 to M1847 7 M1848 to M1863 M1864 to M1879 re M7880 to M7895 A EISEN Explanation 0 1 2 3 4 5 6 7 In mode 10 the M elements distributed to the sending area by O station layer 1 range from M1656 to M1671 The elements can be written by the PLC of 0 station and directly read by other stations 1 15 LJ Note Once PLC is configured with N N bus communication protocol D7700 D7763 and M1400 M1911 will become the public resource for data exchange on the network Please pay attention to these elements when using them in the program IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 261 10 5 4 NN bus Parameter Setting Select Communication Port in the System block dialogue box and select NN bus protocol in the port 0 or port 1 setting area to enable the N N bus setting button as follows System block Special Modul
31. 2 or other bit elements D2 the current value 32 bit read from servo The current value occupies two word elements D2 MSB and D2 1 LSB Because the read current value must be written into SD80 or SD82 32 bit signed interger you can directly specify SD80 or SD82 as D2 IVC Series Small PLC Programming Manual 200 Chapter 6 Application Instructions Function description 1 You should power on the PLC and servo amplifier at the same time or power on the servo amplifier first in order to make sure that the servo amplifier is ON before the PLC enters the RUN state 2 The read current value D2 can be stored in any word element but the current value must be eventually stored in SD80 or SD82 3 The power flow of the ABS instruction should be ON after the current value is read otherwise the servo amplifier will turn OFF 4 SM82 and SM83 are the output monitors of YO and Y1 The monitors will turn OFF after the output is complete 5 When the power flow is valid and the servo is ON the ABS instruction will send the transmission mode signal 6 When the data transmission ready signal and the ABS request signal coincide with each other the 32 6 bit data communication will start 7 The data are tranmitted through the ABS 2 bit bitO amp bit1 loop 8 The system error code for ABS Data Read Timeout is 79 for ABS Data Read and Check Error 80 9 The wire connection for the I O signals of the ABS instruction is as
32. 3 If you want to refresh I O immediately during the interrupt use the REF instruction Note that the execution time of REF is related to the number of the I Os to be refreshed 4 An interrupt event can generate an interrupt request only when the corresponding interrupt event is enabled which requires setting the corresponding SM element ON and the global interrupt enable flag shall be on 5 When an interrupt request with no corresponding interrupt program in the user program is generated the request will be responded to but the response is empty Timed Interrupt Description The timed interrupt is the interrupt event generated by the system from time to time based on the user setting The timed interrupt program is applicable to the situation that requires timed and immediate processing by the system such as the timed sampling of analogue signals and timed updating analogue output according to certain waveform You can set the intervals unit ms for the timed interrupts by setting the corresponding SD elements The system will generate the interrupt eventwhen the set time interval is reached recommended minimum interval gt 4ms The ON OFF status of certain SM elements can enable disable the corresponding timed interrupts The system provides 3 kinds of timed interrupt resources Table 9 1 Timed interrupt resource list Timed interrupt ee event number Intervals of timed interrupt SD Enable control SM SM66 SD67 SM67
33. 3 Q Ia m CO In m ct a D D a DO in l H H Ww co bo bho 3 Sp H H bo bo p un un ti ti H H un 1 bo A Wu bo Lol LL Open ingredient A valve to add minor ingredient A S DO 2500 H SET 24 N 7 e J in Di A an 3 un m Le un EA Di LJ Start the mixer Mix for 20 minutes V A TON T2 12000 7 _ SET 525 evacuation valve to evacuate finished product left material is less than 20kg and half minute has passed enter the next step Y4 N10 D lt D 20 H TON T3 300 T3 HI SET S26 7 6 N MOV D2 D1 am a SP o zl IVC Series Small PLC Programming Manual 222 Chapter 7 SFC Tutor 7 5 3 Parallel Branch Structure The next example is a bottle packager The packager seals the bottles and sticks labels to them Meanwhile it will examine the bottle cap and label so that the flawed products will be eliminated in the third procedure while the qualified products will continue to the next work flow If no bottle is sent from the last work flow the packager will not conduct any sealing or labelling The three procedures are carried out at the same time and each bottle moves from one position to another each time the rotary plate rotates See the following figure for the illustration of the packager Capping Labelling Eliminating cylinder Y1 cylinder Y2 cylinder Y3 Capping cylinder Labelling cylinder Eliminating cylinde
34. D 83 Influenced flag bity IL DFROM S1 S23 D S3 Program steps lu O O d T Applicable el t a eran e icable elements a ue ER addressing st int Constant s2 int constant bp font to v s3 int Constant S3 The number of consecutive buffer registers double word to be read Range 1 32767 If the target register does not exist the system will report BFM unit of accessed special module exceeds range JON pt v Lf Operand description S1 SN of the special module to be read or the target module Function description Range 0 7 If the target Read consecutively S3 registers starting with S2 register in the BFM of the module does not exist the target module SN S7 and put them into the S3 double word elements starting system will report target with D module address invalid Note S2 The starting address in the BFM of the target The execution time of the DFROM instruction is relatively long and closely related to S3 module Range 0 32767 If the BEM Example address is invalid the system mp 16580857 LD MO will report BFM unit of ane i EE IDFROM 0 3 D200 1 accessed special module When MO is ON read 1 double word from register 3 in the BFM of the target exceeds range module number 0 and put it into the double word element D200 D201 D The D element where the data read from
35. D Offset addressing 8 ONT Constant Kx Kn Kaw Ra enes o o ST WO o om Kav e eas e Pe PPT Operand Type Operand description S Source operand D Destination operand Function description 1 When the power flow is valid S is extracted and the operation result is assigned to D 2 When the operation result D is O the zero flag bit SM180 will be set When the operation result rounds off the decimal fraction the borrow flag bit SM182 will be set Note S 2 0 otherwise the system will report operand error and the instruction will not be executed Example on 83000 288 LD XO ISAT D0 D10 DSQTDO D10 When XO is ON extract the value 83000 of DO D1 and assign the result to D10 D11 D10 D11 288 IVC Series Small PLC Programming Manual 96 Chapter 6 Application Instructions 6 3 15 DINC Increment Double Integer Instruction LAD Applicable to IVC2 IVC1 Crime o enced Nag bt IL DINC D Program steps Operand Type Applicable elements QUES E St ai addressing o m Rav Rew Res RMT o eT vy Operand description Note D Destination operand 1 This instruction is a cyclic increase instruction Range 2147483648 2147483647 Function description l 2 The supported range of C element C200 C255 When the power flow is valid D increases 1 Example mm 100001 LD XO Bt m DINC DO When XO is ON the value 100000 of DO D1 increases 1 After the executio
36. Function word Data field Check code Address Function code 0x08H Functionword Ox00H OTH CRC or LRO Listen only mode of slave station 0x04 Slave station enters Listen Only mode None of the instructions will be executed or responded The slave station can only recognize the restart communication option instruction and enters the online mode after receiving the instruction Broadcast frame is supported IVC Series Small PLC Programming Manual Appendix 7 Modbus Communication Protocol IVC Series 285 1 Request frame Function word Data field Check code Function code 0x08H OXx00H 0x04H Ox00H Ox00H CRC or LRC Address 2 Response frame No return Clear counter and diagnostic register 0x0A Clear all counters Broadcast frame is supported 1 Request frame Functi d Data fiel heck Address Function code 0x08H ata field Check code Ox00H OxOAH Ox00H Ox00H CRC or LRC 2 Response frame Address elle Data field Check code code 0x08 0x00H Ox0AH Ox00H Ox00H CRC or LRC Return bus message count 0x0B Record the total number of the messages to all master stations from the slave stations since the last starting clearing and power on of counter which excludes the message of CRC error 1 Request frame Functi d Data fiel SR Address Function code 0x08H ata field Check code Ox00H OxOBH Ox00H Ox00H CRC or LRC 2 Response frame Function word Data field Check code Address
37. High speed pulse output YO Y1 ER p p y Digital filtering terminals XO X7 all the other terminals use hardware filtering Analog potentiometer Maximum number 64 Maximum nesting levels 6 Local variables and variable alias Subprogram l are supported Each subprogram can provide up to 16 parameter transfer Upload password 3 kinds of password Not longer than 8 letters or Download password 2 l numbers Case sensitive User program protection Monitor password Subprogram password Not longer than 16 letters or numbers Case sensitive Other protections Formatting and uploading ban enabled AutoStation programmin Programming mode Toi a S J IBM PC or compatible computer is required software Built in 100h of working time after power failure the basic module must have worked Real time clock for more than 2mins before the power failure Table 2 2 IVC2 programming resources Specification and remarks IVC Series Small PLC Programming Manual Special function 10 Chapter 2 PLC Function Description Name Specification and remarks 1 0 Max I O points 512 256 1 256 O Externsion module configuration lt 8 sum of I O extension modules and special modules User file Program capacity 12k steps Capacity Data block capacity 8000 D elements instruction Basic instruction 0 09usfnstructon Application instruction 5us instruction 280us instruction instruction 32 number Application inst
38. Meaning of error code illegal function code illegal register address Tegal dt In addition if the slave station receives data under the following situations no message will be returned 1 Error in broadcast frame e g data error address error 2 Characters overrun e g RTU frame over 256 bytes 3 Under RTU transfer mode interval between two characters time out which is the same as receiving error frame and no message will be returned 4 Listen only mode of slave station 5 The slave station received ASCII error frame including frame tail error character range error LJ Note Read station is equipped with compulsory element What is read 1s the value run by the program which may be inconsistent with the compulsory value IVC Series Small PLC Programming Manual 252 Chapter 10 Using Communication Function 10 4 13 Modbus Parameter Setting Set communication port in system block There are two serial ports serial port O and 1 on the communication port interface Communication port O only supports Modbus slave station while communication port 1 supports both master and slave stations Set Modbus communication parameters There is a button of default value on Modbus operand interface The default value is the communication setting recommended by Modbus communication protocol For the parameter setting items refer to Table XX It can be set to master or slave station communication port 1 can be set to master s
39. Note 1 Counter input points X3 amp X4 2 High speed counters when used in instructions DHSCS DHSCR DHSZ DHSP and DHST can trigger operations free from the scan cycle 2 phase input high speed counter The 2 phase input high speed counter starts to count only when the pulse input changes from OFF to ON The phase difference of the two pulse inputs determines the counting direction which is monitored by the corresponding SM element Example IVC Series Small PLC Programming Manual 230 Chapter 8 Using High Speed UC The time sequence chart of the contacts action in the program is shown in the following figure X10 is ON C254 is cleared regardless of X11 amp X6 X11 ON If X6 is ON C254 starts to count XO is ON and X11 changes from OFF to ON X254 counts up SM254 is not being driven C254 values reaches 3 C254 contact changes X11 amp X6 ON X2 changes ON C254 _X0 ON X1 changes from ON to OFF is cleared and the contact is reset C254 counts down SM254 is being driven C254 contact Note 1 Counter input points
40. R 2 RCV area R 2 RCV area R 3 RCV area R 3 RCV area R 4 RCV area R 4 RCV area R 3 RCV area R 4H RCV area R 3 RCV area R 4 RCV area R 5 RCV area R 5 RCV area R 5 RCV area R 5 RCV area R Note SND area sending area RCV area receiving area END W W write R read As shown in the above figure each PLC with N N bus connected has a writable sending area in the Elements Sharing Area N N bus will automatically send the information values of designated elements D and M of the writable sending area to other PLCs receive the information from other PLCs and save it to the read only sending area The element number in the Elements Sharing Area is fixed 64 D elements and 512 M elements can be shared and these elements are distributed to more than one PLC Therefore the less PLCs are connected to the network the more elements can be distributed to each PLC The relationship is defined by N N bus refresh mode GH RCV area R 64 RCV area R 7 RCV area R 7 RCV area R 6 RCV area R 7 RCV area R 6 RCV area R IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 257 Distribution of D element on N N bus single layer network Distribution of D element D
41. SM236 is not driven and the C236 counter counts up IVC Series Small PLC Programming Manual 144 Chapter 6 Application Instructions 6 10 3 DHSCI High speed Counting Compare Interrupt Trigger Instruction Applicable to IVC2 IVC1 Program steps LAD H HH DST 6p IL DHSCI S1 S3 Operand Type A ee ee E 52 53 Applicable elements Offset addressing ae WE Jet o 1 TEA LJ 35 foo corsa Pf O SR Operand description S1 a 32 bit DINT data the one with which the high speed counter will compare Range 2147483648 2147483647 S2 high speed counter Range C236 C255 S3 interrupt SN Range 20 25 Function description A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON When the counter counts to 7 the S3 interrupt will start You can write the interrupt according to your actual needs Note 1 The DHSCI instruction must work together with the HCNT instruction because DHSCI is only applicable to the high speed counters that is driven by HCNT 2 The DHSCI instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV 3 DHSCI DHSCS DHSCR DHSZ DHSP DHST can be used repeatedly However at most the first six such instructions can be driven at the same time 4 The maximum fr
42. Select All Ctrl 4 Insert Row Ctrl I Delete Row Ctri L Insert Block Comment Ctrl B Switch Insert Overwrite Mode Insert E lw lt Figure 4 4 Adding block comment Input your comment into the Block Comment dialogue box that pops out and click the OK button Block Comment Labeling procedures Figure 4 5 Block comment dialogue box The comment will appear in the empty row as shown below MAIN 4 p x Variable addr Variable Name Variable Type Data Type Comments TEMP POOL E TEMP POOL iw L SL abel ing procedures E s H SET 324 m2 320 x 324 K i 3 gt x6 HH ET 3825 325 X3 S RST Mz X11 tH SET 320 A iw L Figure 4 6 The block comment A block comment occupies a whole row You cannot add a block comment to an occupied row nor can a row occupied by a comment be used for other purposes 4 3 2 Variable Comment You can define variables in the Local variable table and Global variable table See 2 2 3 Global Variable Table and 4 4 3 SBR Local Variable Table and use them in the LAD programming language A variable can stand for a certain address to make the program more sensible Figure 4 7 shows some variables defined in a global variable table o MAIN E Global variable table 4 p x Variable Name Variable addr Comments A 1l Forward jogging Xx2 Forward jog button A 2 Power on SM1 a Servo faulty X13 Servo ampl faulty 4 Stop button xo Sto
43. Type Physical element Protocol address Supported function code YO Y377 Output status element 0000 0255 01 05 15 octal code 256 points in total code YO toY7 Y10 toY17 Input status it supports AU X377 1200 to01455 01 05 15 two kinds of address the octal code 256 points in total 0000 to0255 element code is same as MO M1999 2000 3999 01 05 15 LA SMO SM255 4400 4655 01 05 15 RE B B i S0 S991 6000 6991 1 05 15 101253 01 05 15 CO C255 01 05 15 Status of C element D0 7889 08 08 6 SEENEN SD0 50253 03 08 6 SS 20 218 0806 7 od 101253 03 08 18 i et O k it it it it t t O E S s s s 2 am Oli Oli Oo O gm lU a li ra T aial Ql a current value of C element Word CO C199 9500 9699 03 06 16 EN R Lee WORD C200 C255 9700 9811 03 16 current value of C element word WORD The protocol address is the address used on data transfer and corresponds with the logic address of Modicon data The protocol address starts from O and the logic address of Modicon data begins with 1 that is protocol address 1 logic address of Modicon data For example if MO protocol address is 2000 and its corresponding logic address of Modicon data will be 0 2001 In practice the read and write of MO is completed through the protocol address e g read MO element frame sent from the master station Y X M SM S T C SD Z T C C Note Ol Ol 07 DO OO Ol FD 47 C
44. When SMO is ON the 10 elements M10 M10 M11 M12 M19 will be with D completely cleared 6 14 2 ZSET Set Batch Bit Instruction Applicable to IVC2 IVC1 part er o Influenced flag bit O O IL ZSET D S Program steps Offset Operand Type Applicable elements addressing vs pm er Operand description Example ati CMC ON LD SMO D destination operand Bee NIG e Seer O Ae S source operand l l l When SMO is ON the 10 units M10 M10 M11 M12 M19 will all be set Function description to 1 When the power flow is valid set S bit elements starting with D IVC Series Small PLC Programming Manual 178 Chapter 6 Application Instructions 6 143 DECO Decode Instruction Applicable to IVC2 IVC1 A IL DECO rs AN Operand T Applicable element SES eran e ICcable elements i ue ER addressing SWORD Constant Ier Rn Kat es OT SOT CTT V Zz NT EIA fr fv zp Operand description Note S source operand 1 Range of S 0 to 15 2 If S is outside the range of 0 15 D will not be changed when the power flow is valid Instead the system will report operand error D destination operand Function description When the power flow is valid Example set bit S in word element D to sMo DE d LD SMO 1 and clear other bits DECO 2 D9 When the power flow is valid bit 2 in D9 will be set as 1 other bits will be cleared 6 14 4 ENCO Encode Instruction Applicable to IVC2 IVC1 S Influ
45. When XO is ON the value 2000 5 of D2 D3 is subtracted from the value 10000 2 of DO D1 and the result 12000 7 is assigned to D10 D11 Applicable to IVC2 IVC1 Program steps Applicable elements A H PA Pt Vv Example xO 10000 2 2000 500 2000540 RAUL D0 D Di0 LD XO RMUL DO D2 D10 When XO is ON the value 10000 2 of DO D1 multiplies the value 2000 5 of D2 D3 and the result 20005400 0 is assigned to D10 D11 actually the product is 20005400 1 but is rounded off to the calculation precision Programming Manual 6 4 4 6 4 5 Chapter 6 Application Instructions 101 RDIV Divide Floating Point Number Instruction LAD A Kt RDIV GD IL RDIV SN S3 D Applicable to IVC2 IVC1 52 D Type Applicable elements Offset addressing pr Rue TT A TAL TAE TATTOO TE PA AAA AAA AAA ee RBD TEO TL LE EST TT E AY ESA Operand description S1 Source operand 1 S2 Source operand 2 Note S2 0 or the system will report Divided by 0 error and the RDIV instruction will not be executed D Destination operand Example Function description xO 10000 2 2000 500 4 998850 a ET DO pz Tid 1 When the power flow is valid 7 is divided by S2 ID XO and the operation result is assigned to D which includes 4 units with the first two storing the quotient the other two storing the remainder RDIV DO D2 D10 When X0 is ON the val
46. addressing LAD I 4 HH DHSZ s1 IL DHSZ S1 S2 S3 Operand Type 52 53 D Influenced flag bit D Program steps Applicable elements 51 BINT Constant Rox Kav Ke RS KUM RSM DT SO TST TV Y Ei C ee ae ee eee EE EE PR E ET CES Operand description S1 a 32 bit DINT data one of the two numbers with which the high speed counter will compare Range 2147483648 2147483647 S2 a 32 bit DINT data one of the two numbers with which the high speed counter will compare Range 2147483648 2147483647 S3 high speed counter Range C236 C255 D target bit element The action on Y Mor S will be valid immediately regardless of the scan cycle Function description 1 A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON 2 When the counter value is smaller than S7 the D element will be set In addition the D 1 and D 2 elements will be reset 3 When the counter value is 251 and lt S2 the D and D 2 elements will be reset while the D 1 element will be set 4 When the counter value is bigger than S2 the D and D 1 elements will be reset while D 2 element will be set 5 If Dis a Y element it will be output immediately regardless of the scan cycle Note 1 The DHSZ instruction must work together with the HCNT instruction because DHSZ is only applicable to the high s
47. amp V Elements 41 A 42 ee OAL NO 42 3 3 2 Correlation Between Elements And Data Tvpes 42 A a a a a a e 43 IVC Series Small PLC Programming Manual ER Chapter 3 Element And Data 3 1 Element Type And Function 3 1 1 What Is A PLC Element The PLC elements are virtual elements configured in PLC system design in order to replace the actual relays in the relay control circuits PLC uses the elements to calculate and configure system function Due to their virtual nature the elements can be used repeatedly in the program their number is in theory unlimited only related to program capacity and have no mechanical or electric problems like their actual counterparts Such features make the PLC much more reliable than relay control circuits In addition it is easier to program and modify the logic The types and functions of IVC series PLC elements are shown in the following figure Buttons contacts etc X discrete input point hardware circuit SW Input image registers AZZ Input point X IW Auxiliary relay M State relay S Data register D Timer T Counter C Local auxiliary relay LM Offset addressing register Z Local data register V AZ Elements User program LA Special auxiliary relay SM 4 gt Special data register SD Output point Y ES
48. and ERR indicator turns on I2C error System error To remove this fault power off the PLC and y check the hardware External setting error 20 23 User program stops and ERR indicator turns on Serious local I O error System error To remove this fault power off the PLC and y check the hardware i ERR indicator blinks This alarm is cleared Serious extension I O error System error automatically upon the removal of the fault I ERR indicator blinks This alarm is cleared Serious special module error System error automatically upon the removal of the fault Updat f real ti lock iio ana eeD ERR indicator blinks This alarm is cleared 23 incorrect time is read during system System error automatically upon the removal of the fault update E Ss 2 L ERR indicator blinks This alarm is cleared EEPROM write read operation error System error automatically upon the removal of the fault ERR indicator blinks This alarm is cleared Local analog signal error System error i automatically upon the removal of the fault System special module configuration ERR indicator blinks This alarm is cleared System error y error automatically upon the removal of the fault Storage error 40 45 User program stops and ERR indicator turns on 40 User program file error System error To remove this fault download new program or User program stops and ERR indicator turns on 41 System configuration file error System error T
49. and assign the result to D10 D11 D10 D11 100000 6 3 18 DNEG Negative Double Integer Instruction Applicable to IVC2 IVC1 S 7 Offset Applicable elements addressing HO BINT Constant E UA SOT ST E E v o om Rowe eas en Pe PP Operand description S Source operand D Destination operand Function description When the power flow is valid get the negative value of S and assign the result to D Note The range of S shall be 2147483647 2147483647 When the value of S is 2147483648 the system will report operand error and the instruction will not be executed Example AU 100000 DNEG D When X0 is ON get the negative value 100000 of DO D1 and assign the result to D10 D11 D10 D11 100000 LD X0 DNEG DO D10 100000 Tid IVC Series Small PLC Programming Manual 98 Chapter 6 Application Instructions 6 3 19 SUM Sum Integer Instruction LAD Applicable to IVC2 IVC1 IHF au Gei 52 Influenced flag bit IL SUM S1 S2 D Program steps ee t Operand Type Applicable elements addressing V Z SiN e Ra Rew RS RMR OT SOT ST TT VT Zz Vv Ka SU o soe rp Vv zi ov_ Operand description Example S1 Source operand starting SMO LOGO Moy 1000 DO unit of summing e LD SMO S2 Source operand number mow 2000 DI MOV 1000 DO of units to be summed up 3000 MOV 2000 D1 We gee ue MOV 3000 D2 D ESAS tion operand a es 4000 MON GOR D summi
50. ccccccseeeeeeeeeeeeeeeeeeeaees 171 6 12 11 XMT Free Port Sending XMT lInstruchon cece cccecceeceeeeeeeeeeeeeeeeeeeseeeeeeaeeeeesaeeeeeseeeeesaaeeeseaeeeeaaeeeesaees 172 6 12 12 RCV Free Port Receiving RCV Instruction cccooococcconnocococonoconcnnocononconronononcnnononononnncnnononcnnnnanannnnns 173 6 13 Data Check ASTUCIA A ia 174 SE TCCT Ene cost bod Ieee meme ene meen ne te ek ae ae nee ee o 174 6 13 2 CRC16 Check er ier le 175 0139 RIRC GMO e Ei Eet LN 176 6 14 JE AMANCEG BIL FOCSS SING INS CUCU O EN 177 671421 ZRSi Balch Bi RESeU INS IMIGHON a tecr ic eet wes e do els 177 6 142 EN Set Batch Bit IMASTUCION ara Ee ia EE EEEE Aoi 177 6143 DECO Decod Ce tee EE 178 6 14 4 ENCO Encode Instruction EE 178 6 14 5 BITS Counting ON Bit In Word Instruction EE 179 6 14 6 DBITS Counting ON Bit In Double Word Instruction oooccccocccncocncnnccnccnnnnnccnnnnncnnononnnnnnnronnnnncnnnnnncnnnnos 179 619 Word Contactor INSUUICU OM DEER 180 6 15 1 BLD Word Bit Contactor LD Instruchon 180 6 15 2 BLDI Word Bit Contactor LDI InstructiON occccoccccoccnccnnnccocnononnncnnnncnncnnnnononnnnnnnnnnonnnonnnnnnnnnnnnnnnnncnnons 180 6 15 3 BAND Word Bit Contactor AND Instruchon 181 6 15 4 BANI Word Bit Contactor AND Instruction coooccccoccncoccncoccncconnncnnnncnnnnnnncnnnnnnnnnnnnnonnnnnnnnnnnnnnnnnnncnncnnnns 181 6215 5 BOR Word Bit Contactor le E ett EE 182 6 15 6 BORI Word Bit Contactor ORI Inst
51. flag bit 2 For a up counter when the counting value is larger than or equal to the preset point S the counting coil ON will be set ON Switch to down counting 3 For a down counter when the counting value is less than or equal to the preset point S the counting coil will be set OFF lt LOF 4 When the counting value is 2147483647 it will change to 2147483648 if the counter counts up ON ON ON ON ON C235 once more counting coil 5 When the counting value is 2147483648 it will _ 10235 2 C235 counting Ce A change to 2147483647 if the counter counts down Sege Gas once more C235 0 C235 1 Note The address of the C element D shall be within C200 C235 IVC Series Small PLC Programming Manual 70 Chapter 6 Application Instructions Chapter 6 Application Instructions This chapter introduces the application instructions of IVC series small PLC including the formats operands influenced flag bit functions examples and time sequence charts of the instructions 621 Program Ge COO INSU ed E 15 Otol POR ee Ee Ce 75 EEN eege eege 75 6 15 CEBE Jump Label Rtl re EE 76 oa ec in fete Ba alo 1116 ra BO 6 Dato obrando Dor ee ein obren cadetes 77 6 1 5 CFEND Conditional End From User Main Program 77 6 1 6 WDT User Program Watchdog Res t TE 78 Ose ai Wi leie lei n Ed et EE 78 6 19 DI Disable INIerruptINS UCTION RE 78 6 1 9 CIRET Conditional Return From User Interrupt Gubporo
52. get the TAN value of DO D1 1 57 and assign the result Function description i p 1255 848398 to D10 D11 1 When the power flow is valid get the TAN value of S unit radian and assign the result to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set POWER Floating Point Number Exponentiation Instruction LAD Applicable to IVC2 IVC1 I k PoR en Do POWER eu 63 0 Program steps 7 Offset addressing Operand Type Applicable elements WEN E TT ES AA ee ER ECH eee fps SS TE E CTA ee ee EE a eS AP EA Operand description Example S1 Source operand 1 xo 55 000000 3 000000 Iessen LD XO PONER D0 le nid S2 Source operand 2 POWER DO D2 D10 D Destination operand When X0 is ON get the D2 D3 th power of DO D1 i e 55 0 and Function description assign the result 166375 0 to D10 D11 1 When the power flow is Note valid get the S2th power of 1 When S1 0 and S2 lt 0 the system will report operand error and the S1 and assign the result to D instruction will not be executed 2 When the operation result 2 When S1 lt 0 and the mantissa of S2 is not 0 the system will report D is not within operand error and the instruction will not be executed 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set 3 When the operation r
53. in every scan cycle When nitialize registers upon the first scan cycle after D10 D1 2000 MO will be ON In the next scan cycle if pe X0 keeps ON D10 DO 0 and MO is OFF the next LD SM1 hackle wave will start If the power flow falls the output MOV 0 DO state D2 will be OFF but the output value D1 will keep its MOV 2000 D1 current value until the next rising edge when D7 will be Execute HACKLE instruction when X0 is ON initialized as 81 and a new hackle wave starts LD xo 2 You can use an external special module to convert the HACKLE DO D1 D10 1000 MO data into analog waveform 6 11 4 TRIANGLE Triangle Wave Signal Output Instruction LAD Applicable to IVC2 IVC1 H A TRIANGLE ei 52 D1 53 D2 f i Influenced flag bit IL TRIANGLE S1 S2 D1 S3 D2 Program steps Applicable elements WI f O O OS e IP f sio po Operand description ON In the next scan cycle if the power flow keeps ON the state output D2 will be set OFF and the next triangle will be generated If the power flow falls the output state D2 will be OFF the output value D1 will S1 starting value S2 end value D1 output value keep its current value until the power flow rises again S3 step number S3 gt 0 or system will report operand when D1 will be initialized as S7 and a new triangle error and do not execute the calculation wave will start See the following figure D2 output state Function description In each sca
54. lt S2 lt 255 or the system will report operand error Example em 100000 LD SMO DIMOY 100000 DO es DMOV 100000 DO DDE SHO g i DMOV 200000 D2 300000 D 300000 m DMOV 300000 D4 mg aai SCT DMOV 400000 D6 500000 DMOV 500000 D8 MOY soggop Tle ZU 100000 15500000 LD AU DS UN DO 5 p100 DSUM DO 5 D100 When XO is ON the double integers of 5 x 2 units starting with DO will be summed up and the result is assigned to D100 D101 Floating Point Number Math Instruction RADD Add Floating Point Number Instruction LAD HH RAD IL RADD ST S2 SD D Applicable to IVC2 IVC1 Program steps 7 Offset addressing 52 D Applicable elements A RC LL ee eee MECH NEE E 2 RA 1 TT TEE e PE NA ERRE ETT EEE Te LL AL Operand description S1 Source operand 1 S2 Source operand 2 D Destination operand Function description 1 When the power flow is valid add 7 and S2 and assign the operation result to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is O the zero flag bit SM180 will be set Example LD XO nO 10000 2 2000 500 7999 70 SS pO iz Hro RADD DO D2 D10 When X0 is ON add the value 10000 2 of DO D1 and the value 2000 5 of D2 D3 and the result 7999 7 is assigned to D10 D11 IVC Series Small PLC Programming Manual 100 6 4 2
55. protocol is used IVC Series Small PLC Programming Manual 56 Chapter 3 Element And Data 3 1 9 Special Auxiliary Relay 3 1 10 Element mnemonic SM Function The SM elements are closely related to the PLC system function They reflect PLC system function and system state For details see Appendix 1 Special Auxiliary Relay Classification The frequently used SM elements include SMO PLC operation monitor bit It is ON when the PLC is in RUN state o M initial operation pulse bit It is ON in the first scan cycle of PLC operation eo SM3 system error It is ON if any system error is detected after PLC is powered on or when PLC changes from STOP to RUN eo SM10 SM12 respetively the clock square wave cycled at 10ms 100ms and 1s flipping over twice in a cycle In addition you can use control or change the PLC system function by adjusting certain SM elements Such elements include Special Data Register Element mnemonic SD Function The SD elements are closely related to the PLC system function They reflect PLC system function parameters state code and instruction execution data See Appendix 2 Special Data Register for details Classification The frequently used SD elements include e SD3 system error code e D50 SD57 high speed pulse output monitor e D100 SD106 real time clock data In addition you can change PLC system function parameters by changing certain SD
56. starting with O Data type Boolean word Available forms The timing and action mode of T elements are determined by the timing instruction that uses them There are four timing instructions TON TOF TONR and TMON See Chapter 5 Basic Instructions for details Value assignment 1 Through instructions 2 Write or force during system debugging Battery backed features T elements in the State saving range for IVC2 only Clear T elements outside the saving range Power loss R RUN gt STOP Remain unchanged Remain unchanged STOP RUN Remain unchanged Note The saving range is set through the system block See 2 2 1 System Block LU Note The maximum timing value of T element is 32767 The preset value is 32768 32767 Because T elements act only when the counted value reaches or exceeds the preset value it is pointless setting the preset value as a negative number IVC Series Small PLC Programming Manual 3 1 7 Counter 3 1 8 Element mnemonic G Function The C element contains a bit element and a word or a double word element The word elements can record 16 bit or 32 bit counted numbers and is used as a value in the program The bit element represents the state of the counter coil and is applied to logic control 1 state bit C bit element Sign bits M 16 bit counter 16 bits M Sign bin 4 32 bit counter
57. 01 00 00 01 00 3D 9A 01 address 01 function code 00 00 starting address 01 00 number of elements to read 3D 9A check Response of slave station provide correct response 2 XMT from master station 01 01 00 00 01 01 FC 5A The starting address for the reading of master station is 0000 01 01 257 elements are read which is beyond the defined number of elements Y Response of slave station 01 81 03 00 51 The data from the slave station response is illegal because 257 gt 256 and 256 is the allowed maximum number of elements Y 3 XMT from master station 01 01 00 64 00 AO 7D AD The starting address for the reading of master station 0064 decimal 100 Number of elements read 00 AO decimal 160 Slave station response 01 81 02 C1 91 The slave station responds with illegal data address because there are only 156 elements Y starting with the protocol address 100 but 160 gt 156 160 is illegal 4 XMT from master station 01 04 00 02 00 OA D1 CD The frame of XMT function code 04 of master station Response of slave station 01 84 01 82 CO The slave station responds with illegal function code 04 is not supported by IVCZ2 LU Note 1 Element X does not support write operation that is the write of element X is invalid For the writable properties of elements SM and SD refer to Appendix 1 Special Auxiliary Relay and Appendix 2 Special Data Register if the element is un writable the write operation is invalid 2
58. 10 4 4 Chapter 10 Using Communication Function Modbus Communication Protocol Introduction For the serial port communication of IVC series small PLC Modbus communication protocol is available Two communication modes ASCII and RTU IVC1 only supports RTU mode are supported The PLC can be set as the master or slave station Characteristics Of Links 1 Physical layer RS 232 RS 485 2 Link layer asynchronous transfer mode 1 Data bit 7 bits ASCII or 8 bits RTU 2 Transfer rate 1200 2400 4800 9600 19200 38400 3 Check method even check odd check or no check 4 Stop bit 1 or 2 stop bits 3 Networking configuration up to 31 sets of equipment Address range 1 to 31 Broadcast is supported RTU Transfer Mode 1 Hexadecimal data 2 The interval between two characters shall not be less than the time of 1 5 characters 3 There is no frame head or tail and the interval between two frames is at least the time of 3 5 characters 4 Use CRC16 check 5 The maximum length of RTU frame is 256 bytes and the frame structure is as follows Structure of frame fumes T E 6 Calculation of interval among characters If the communication baud rate is 19200 the interval of 1 5 characters is 1 19200x11x1 5x1000 0 86ms The interval of 3 5 characters is 1 19200x11x3 5x1000 2ms ASCII Transfer Mode 1 Use ASCII data communication 2 The frame takes 3A as the head and CRLF 0D OA as the tail 3 The allowed
59. 13 EXP Floating Point Number EXP ISICON E 105 6 4 14 RSUM Sum Floating Point Number Instruction cooocccccoccncccnccnccnncnnonononnnnnnononnncnnononnnnnnnrnnnnnnrnnnnnnnnnnnos 106 6 0 Datla CONVERING IASUUCIOM DEE 106 6 5 1 DTI Double Integer To Integer Instruction EEN 106 6 5 2 ITD Integer To Double Integer Instruction AEN 107 6 5 3 FLT Integer To Floating Point Number INStruction oocccocccconcncnnocnconcnnoncnnnncnnnnocnnnncnnoncnnonrnnnnnnnonarnnnncnnnns 107 6 5 4 DFLT Double Integer To Floating Point Number Instruction ooocccoccncoccnconcnnnnccncnncnconcnnnncnnonannnnncnnoncnnnns 107 6 5 5 INT Floating Point Number To Integer Instruchon sees eeesaeeeseesesesesaaeeeseeeesenseneas 108 6 5 6 DINT Floating Point Number To Double Integer Instruction cocoocccoocncoccncnnocnconcnconcnconcnnonacononcncnncnnons 108 6 5 7 BCD Word TO 16 BIt BCD IMS TUCIO Ns diia 109 6 5 8 DBCD Double Word To 32 Bit BCD INStructiOn circaiani aa aaa aaa 109 00 9 BIN 16 BIEBCD TO Word MStruUctiO sra sl 110 6 5 10 DBIN 32 Bit BCD To Double Word Instruction ooocccccoccnccooccncconcnncnnnnnnononononnncnnnnnnnnnnnnnnnononcnnnnnncnnonos 110 6 6 11 GRY Word To 16 bit Gray Code ASTUCIA EE 111 6 5 12 DGRY Double Word To 32 Bit Gray Code Instruction oooccccooccncccocnncnoncnnnnonononnncnnononnnonnnrnnnnnncnnnnnnnnnnnos 111 6 5 13 GBIN 16 Bit Gray Code To Word INStruction cccoooc
60. 9 6 PTO Output Completion Interrupt ccc cccccsececeseecceseeceneeceeecseeeceneeseasecsaeeeseeeeseacessaeessaseeseueesseessueessueeesaageeaaees 241 9 7 Power Failure Interunpt sorna nn RR RR nn Rmn nn nnnnrnnrnnanenaninaninns 242 E mice tess ate sa an san euashccees E etcecaeRccszeuaa 242 IVC Series Small PLC Programming Manual 236 9 1 9 2 Chapter 9 Using Interrupts Interrupt Program When an interrupt event occurs the normal scan cycle will be interrupted and the interrupt program will be executed which is called the interrupt mechanism For the event triggered control tasks that requires priority you often need to use this special mechanism The system provides many kinds of programmable interrupt resources Each kind of interrupt resource can trigger a type of interrupt events and each type of interrupt event are independently numbered In order to deal with a certain interrupt event you must compile a processing program that is an interrupt program which is an independent POU in the user program An event number must be designated for each interrupt program in order to link the interrupt program with the interrupt event designated with the event SN When responding to the interrupt request of the interrupt event the system will call the corresponding interrupt program based on the interrupt event number The following are the interrupt resources provided by IVC series small PLC Ee Interrupt event EAS number P SM
61. Applicable elements F cia ues ER addressing o m ay Ke ens Tne tv zy Y gt Operand description Example D Destination operand XO 399 LD XO DEC D0 Function description DEC DO When the power flow is valid When X0 is ON DO 1000 decreases 1 After the execution D0 999 D decreases 1 Note This instruction is a cyclic decrease instruction with the range of 32768 32767 VABS Integer Absolute Value Instruction LAD Applicable to IVC2 IVC1 IL VABS S D Program steps Offset Operand Type Applicable elements addressing SINT one vol Kay KoM Kns KotM K5SM D SOT eT TT VI ZT Y gt eee oe eS se aT Operand description Example S Source operand 0 1000 1000 LD XO D Destination operand S 26 3 SS VABS DO D10 Function description When XO is ON get the absolute value of DO 1000 and assign the result When the power flow is valid to D10 D10 1000 get the absolute value of S and assign it to D Note The range of S shall be 32767 32767 When S is 32 768 the system will report operand error and the instruction will not be executed IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 93 6 3 9 NEG Negative Integer Instruction LAD Applicable to IVC2 IVC1 IL NEG S D Program steps Offset Operand Type Applicable elements addressing SINT Constant vo Kny KaM J KoS kaim RSMO erer IN Ee SO ee SEN N 2 Operand description Example
62. Applicable to IVC2 IVC1 BRST 0 Influenced flag bit O O O IL BRST D S Program steps Offset Operand Type Applicable elements addressing o po w Ra s en o er Vz SL INT Constant ax Kny Kaw Rng Kato Ras O So ce ft fv a Operand description Example D destination operand XO oe Gg LD X0 S2 designated bit 0 lt S2 lt 15 or BRST DO 8 When the power flow is valid reset BIT8 of element DO 1000 S 2 0000001111101000 After the execution DO 744 Function description 2 0000001011101000 Reset bit S of element D system will report operand error IVC Series Small PLC Programming Manual 184 Chapter 6 Application Instructions 6 16 Compare Contactor Instrucitons 6 16 1 Compare Integer LD lt gt lt gt gt lt Instrucitons Applicable to IVC2 IVC1 Influenced flag bit Program steps l Offset Operand Type Applicable elements addressing Sr 17 Constant KX Knv eg ROS KLM ROM OT SOT CT TT Vv TZ 52 INT Constant nx Rn km ee Rom ksm o so ce 7 fv Zz ov Operand description Example S1 comparison parameter 1 LD DI 1000 2000 YO OUT YO S2 comparison parameter 2 DO Di S pe DODI Function description z oe T e s gt OUT Y1 Conduct BIN comparison on TE g peo aie gt En elements S1 and S2 and use 1000 2000 13 LD lt gt DOD1 the comparison result to drive ES ZS e E OUT Y3 the following operation en Se SP Lu s LD gt DO
63. CRC check address check and instruction check and set the communication completion flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVSTOP FREQUENCY CONVERTER Stop Instruction LAD LY HH IVSTOP 6p 52 53 IL IVSTOP S1 S2 S3 Operand Type ee ee ee ee EE ee ee 2Y o ee ee ee ee ae a ae a S2 WORD Constant Applicable elements Applicable to IVC1 Offset addressing Influenced flag bit Program steps E R ER Tr ee ee ee BE Operand description S1 designated communication channel channel 1 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 S3 drive stop mode There are three stop modes stop mode 0 stop stop mode 1 free stop stop mode 2 JOG stop Function description 1 Set the serial port and drive address and control the drive jog reverse running through communication in the Modbus protocol 2 This instruction is executed upon the rising edge Example Mi _ LY IVSTOF 1 1 T LD M1 IVSTOP 1 1 0 1 Set the serial port 1 drive address 1 and the drive stop mode 0 stop according to the set deceleration time and control the drive stop through communication in the Modbus protocol 2 After the drive receives the data it will conduct CRC check address check and instruction check and set the communication completi
64. Chapter 2 PLC Function Description 15 System block Input Point l Advanced Settings Communication Port Saving Range Output Table Set Time Input Filter Default value Group 1 Element Starting position for Number of type saving Element Elements saved M 1100 1100 Ey Clear 500 492 Clear 500 Clear 1500 Heek 100 100 Clear SES ler ler ies 4 gt ler lt gt 14 gt 1246 10 Clear Group 2 z Element Starting position for Number of tune saving Element Elements saved M 300 Dm 8 Clear 500 492 Clear 500 1500 Clear 1220 E Clear 246 10 Clear gt 14 gt geg E dled er ie leo The config parameters must be downloaded before they become effective Not all types of PLC support each system block option View the system block option supported by the PLC by pressing F1 Figure 2 3 Setting element saving range LU Note The element range and group number of the saving range are different for different PLC models By default the D M S T and C elements in a certain range will be saved You can change the defaults as you need By clicking the Clear button on the right will set the corresponding number to zero For IVC2 series PLC you can set two groups that form a union For IVC1 series PLC you can set only one group LU Note The T elements cannot be set in the saving range for IVC1 series PLC System operation upon power loss PLC will save the elements in the saving range t
65. Chapter 6 Application Instructions 6 2 14 WSFL Shift Left Word Instruction LAD Applicable to IVC2 IVC1 Le eu om 52 vert 1 Influenced flag bit wert en mm S3 S3 Offset O d T Applicable el t m pee e es en o SOT ST TT Vy ESERG o CL wewesen o efr v O Sz INT Constant Kn Kn Kom Kas Komjen o 50 0 r v a vy 53 NT Constant nx Knv Kom Kas Roum knsw o 50 e TV Operand description Example ST source operand 0 100 100 LD XO D destination operand E oe E nee 5 WSFL DO D100 10 3 starting unit of word string S2 size of destination word queue Lae EEES S3 number of words filled for right forward MA MAA DE REES SERESD 1 When XO is ON the contents of 10 units starting with D100 will move leftward When the power flow is valid 3 words The leftmost units D109 D107 will be discarded At the same time the contents of 2 units the contents of the 3 units starting with DO will be filled into the right end of the starting with D unit will move word string leftward S3 words The 2 Before the execution DO 100 D1 200 D2 300 D109 10000 D108 9000 EE D107 8000 D106 7000 D105 6000 D104 5000 D103 4000 D102 3000 discarded At the same time D101 2000 D100 1000 the contents of S3 units starting with 7 will be filled into the right end of the word string Note 3 After the execution DO D2 remain unchanged D2 300 D1 200 DO 100 D109 7000 D108 6000 D10
66. Chapter 6 Application Instructions 77 6 1 4 CJ Conditional Jump influenced fi Se a MR A A IL CJ Program steps Operand Type Applicable elements E j H PR A s mr constant Operand description Example S label SN MO LD MO MERY k CJ 0 Function description SMO Se 200 LD SMO 1 When the power flow is valid the program ZE MOV 100 DO will jump to execute the instruction numbered Jump to LBL 0 CFEND e EE Es LBL 0 ae Mi 200 LD Mi 2 If the power flow is invalid the program will Wm 200 DO MOV 200 DO Ge jump but execute the instruction following 1 Initial conditions MO OFF M1 ON The CJ instruction is not be executed and DO is 100 After executing CFEND the current Note cycle of the main program ends in advance and the following LD 1 The jumping label S 0 lt S lt 127 for the CJ and MOV instructions are not executed instruction shall be a legal and defined label 2 When MO is ON M1 ON the program will execute the CJ Otherwise the user program cannot pass the instruction skip over the MOV 100 200 and CFEND compiling instructions and jump to LBL 0 and execute MOV 200 DO 2 It is not allowed to use the CJ instruction to instruction DO is 200 then jump into a FOR NEXT structure 3 It is allowable to use the CJ instruction to jump out of or into the MC MCR structure or SFC status However such operation will damage the logic of the MC MCR structure or SFC status and make the pr
67. D10 The final bit will be stored in the carry flag bit SM181 is OFF IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 121 6 7 3 RCR 16 Bit Carry Circular Shift Right Instruction LAD Applicable to IVC2 WC EE Influenced flag bit IL ROR S D en Program steps Operand Applicable elements Operand description Example S1 Source operand 1 Pi mm Se Ss a LD MO D destination operand Rotate with the carry 2 Source operand 2 flag 5 bits leftward Function description When the power flow is valid S1 data and the carry flag SM181 will together rotate rightward for S2 bits and the Ga LSB result is assigned to D Note 1 220 2 When S1 uses Kn When MO is ON DO 2 1100110110010101 52629 and the carry SM181 OFF addressing Kn must be equal will rotate rightward for 5 bits and the result 2 0101011001101100 22124 is to 4 assigned to D10 SM181 ON IVC Series Small PLC Programming Manual ER Chapter pG Application Instructions 6 7 4 RCL 16 Bit Carry Circular Shift Left Instruction 6 7 5 Operand Type Applicable to IVC2 IVC1 Ke S2 1 tnfiuenced fiag bit i RCL S D S3 Program steps Applicable elements Offset addressing st WORD Constant KnX KnY KnM kKnS knim Knsm D so c tT viz y y ECJES kn km kns kam b oc T viz Yo S2 NT Constant Knx KnY KnM kns KniM knsm b sp c tT v izi Vv Operand
68. D100 D101 D109 DO 500 LD XO FMOV DO D100 10 DFMOV Fill Data Block Double Word Instruction LAD HT DE rei IL DFMOV S D S2 Operand Type D 52 Applicable to IVC2 IVC1 Program steps Offset Applicable elements addressing ST ONT Constant Kx Ky Kn eg pemes o o CT Vy v Keeser o CA IAN fe 52 17 Gonstant ox Koy km Krs enm esn o o e r v a Operand description ST Source operand D Destination operand starting element of data block S2 size of data block Function description When the power flow is valid the contents of 7 will be filled into S2 elements starting with D and the content of 7 remains unchanged Note 1 When ST D and S2 use C element the legal range is C200 to C255 2 S2 is larger than or equal to 0 3 When S7 and D are both Kn addressing Kn shall be the same Example LD XO x0 100000 100000 DEMOY DO pio 10 l DFMOV DO D10 10 When XO is ON the content of DO D1 will be filled into 10 x 2 units starting with D10 D10 D11 D12 D13 D28 D29 DO D1 100000 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 83 6 2 7 SWAP Swap Bytes LAD Applicable to IVC2 IVC1 ae o O IL SWAP D Program steps Offset O d T Applicable el t ont Ra Re Res RT o Jerv z v Operand description Example D Destination operand the x0 10000 LD XO SWAP 10 word element whose high low
69. DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O Programming Manual 150 Chapter 6 Application Instructions Example The table for comparison is shown below Comparison data Output data to SD180 amp SD181 Operation flow Most significant bit Least significant bit Most significant bit Least significant bit D100 0 D101 100 D102 0 D103 1 4 D112 0 D113 300 D114 0 D115 4 Return to 1 The following is the user program 100 DO 100 1100 Wm og ie ER Ge DMOV 100 D100 Moy i 1103 MOV O D102 200 MOV 1 D103 DO 200 1104 MOV Sue DIDA Hoy O n108 MOV 0 D106 Wm 2 LOT wae 2 ee en DMOV 300 D108 Dm 200 1108 MOV 0 D110 0 MOV 3 D111 ES de DMOV 100 D112 Moy 3 S MOV 0 D114 100 MOV 4 D115 DO 100 DIS LD MO Moy O Dd HCNT C244 1000 4 LD M1 SSL te DHSP D100 4 C244 em ou mm O LD M2 100 o OUT SM244 DEE D100 4 Ce44 LD C244 ia OUT Y10 10 LD M3 PLSY SD180 0 YO 1 OFF FLSY STN0 0 YO 1 In the first user program scan cycle assign elements D100 D115 with values to generate the table for comparison 2 When MO and X6 are both ON C244 will count when XO changes from OFF to ON for the input frequency see Chapter 8 Using High Speed I O When C244 changes from 999 to 1000 the C244 contact will be set when C244 changes from 1001 to 1000 the C244 contact will be reset When the C244 contact drives Y10 the execution of Y10 will be determi
70. DI 1000 2000 Y5 OUT Y4 e DO Di HA 2 LD lt DO D1 OUT Y5 Conduct BIN comparison on the data of DO and D1 and the comparison result is used to determine the output status of the following element IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 185 6 16 2 Compare Integer AND lt gt lt gt gt lt Instruction Applicable to IVC2 IVC1 Influenced flag bit Program steps Offset Operand Type Applicable elements addressing Si INT Constant kx Rav ve RS RLM RST OT SOT CTT V Z Vv sr INT Constant eeler Kom Kns Rom Rom o so ce tT v yz ov Operand description Example S1 comparison parameter 1 LD X0 AND DO D1 S2 comparison parameter 2 OUT YO Function description s 2 a LD X1 Conduct BIN comparison on O Di e AND AA 10000 2000 Yi SEH v elements S1 and S2 and use SE ai ER 5 LD X2 the comparison result in serial 0000 2000 yo AND gt DO D1 connection with other nodes m ut FA E out Y2 to drive the following E ES mi pg Msg LD X3 operation 10000 2000 Y4 AN CELDA Ze D Di gt OUT Y3 10000 2000 Y5 LD X4 E g pS E 2 AND gt DODI OUT Y4 LD X5 AND lt DO D1 OUT YS Conduct BIN comparison on the data of D1 and D2 and use the comparison result in serial connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual 186 Chapter 6 Application Instructions 6 16 3 Compar
71. Disable input point is not checked in the basic module system block the corresponding input terminal must be ON or the system will not enter the RUN state after reset 2 Setting mode selection switch When the PLC is in STOP state setting the mode selection switch to ON will change the PLC to RUN state 3 Powering the designated input terminal If the Disable input point is not checked in the basic module system block feeding power to the designated input terminal will change the PLC from STOP state to RUN state LU Note The mode selection switch must be set to ON for the input terminal startup mode to be valid How to change from RUN to STOP 1 Resetting the PLC If the mode selection switch is set to OFF or TM resetting the system including power on reset will change the PLC to STOP state LU Note Even when the mode selection switch is ON the system will also enter the STOP state after reset if the Disable input point is not checked in the basic module system block and the designated input point is OFF 2 Setting mode selection switch The system will change from RUN to STOP when you set the mode selection switch from ON or TM to OFF 3 Using the STOP command The system will enter the STOP state after executing the STOP command in the user program 4 Auto stop upon faults The system will stop executing the user program when a serious fault like user program error or user program execution overtime is detected
72. Elements istnatarals e EE ET aden eed ae ese desde a 276 Appendix 4 Modbus Communication Error Code 277 Appendix 5 Inverter Instruction Error Code 278 Appendix 6 System Emor EE ae ee ees 279 Appendix 7 Modbus Communication Protocol IVC Gees 281 APpendoes ASCII OX ea EF E 290 Leier elt le ee dein Wee E E 291 Appendix 10 Classified Instruction Index 296 Chapter 1 Product Overview Chapter 1 Product Overview This chapter presents the product makeup plaftform of the programming software and network configuration of the IVC series small PLC Bucear a ae A e E a A Ba Wb Giele te eer le e EE RE WEE Outline OFiIw Cr Series Basic e Lal EE 121 3 Outline of 1VC2 Series Basic le e HE TZ AMO Station PrOgraMininG SOMWANC E 1 2 1 Basic CONAGUA lO ainia id od ae AAA A 1 2 3 AUto station Operation Ntra nd o ia t24 Programming Cables a oi EECHER 15621 elle DECH Protocol NetWork EE 1 92 AN N DUS Protocol NGIWO EE PES F ROC FON e Lee We 1 4 Makeup Of Document System Of IVC Series Small PLCS oocccccoccccoconnnccnocnnncnnnnnonononconaconononcnnonononcnnnrnnononencnnanancnnas 14 1 Model Selection IMSUMIGUON EE 1 4 2 Basic Module User Tal E VAS PIO ram Manual E 1 4 4 Programming Software User Manual 1 4 5 I O Extension Module User Manual 1 4 6 Special Module User Manual IVC Series Small PLC Programming Manual 1 1 1 1 1 Chapter 1 Product Overview Product Introduction The IVC series small PLC
73. Flag Bit The instruction result may affect three kinds of flag Zero flag SM180 The zero flag is set when the instruction operation result is zero Carry flag SM181 The carry flag is set when the instruction operation result is a carry Borrow flag SM182 The borrow flag is set when the instruction operation result is a borrow IVC Series Small PLC Programming Manual Chapter 4 Programming Concepts 53 4 5 3 Limits To Instruction Usage There are some limits to the usage of certain instructions For details see the description of the specific instruction Exclusive hardware resources Some instructions requires hardware resources When a specific hardware is being used by a certain instruction the access to the hardware will be denied to other instructions because the occupation of the resource is exclusive Take the high speed I O instructions and SPD instruction for example Any of these instructions occupies a input point among XO X7 The limited resources will make it impossible to exeucte these instructions at the same time Exclusive time The execution of certain instructions may take some time During such period the system will be too busy to execute other instructions Take the XMT instruction for example Because of the time limit in communication only one XMT instruction can be executed once In the same way the free port can execute only one RCV instruction once Everytime when a Modbus instruction is being executed th
74. Function code 0x08H Functionword moo Tomm ORC or LRC CRC error count 0x0C Record the number of CRC errors received by slave station since the last starting clearing and power on of counter 1 Request frame Functi d Data fiel SECH Address Function code 0x08H ata field Check code 0x00H Ox0CH 0x00H Ox00H CRC or LRC 2 Response frame Functi d Data fiel ES Address Function code 0x08H ata field Check code 0x00H 0x0CH L CRC or LRC Return Slave Exception Error Count 0x0D Record the number of the exception error that detected by slave station since the last starting clearing and power on of counter which includes the error detected in the broadcast message 1 Request frame Functi d Data fiel Boek Address Function code 0x08H ata field Check code 0x00H OXODH Ox00H Ox00H CRC or LRC 2 Response frame Function word Data field Check code Address Function code Ox08H Functionword 0005 rann CRC or LRC Return Slave Message Count 0x0E Record the number of the addressing messages received by the slave station since the last starting clearing and power on of counter IVC Series Small PLC Programming Manual 286 Appendix 7 Modbus Communication Protocol IVC series 1 Request frame Functi d Data fiel heck Address Function code 0x08H ata field Check code Ox00H OxOEH Ox00H Ox00H CRC or LRC 2 Response frame Function word Data field Check code Address Fu
75. HCNT instruction because DHSCS is only applicable to the high speed counters that is driven by HCNT 2 The DHSCS instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV 3 DHSCS DHSCI DHSCR DHSZ DHSP DHST can be used repeatedly However at most the first six such instructions can be driven at the same time 4 The maximum frequency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O Example mi SEH LD M1 i OUT SM236 GE HCHT SE 1000 eis MO HCNT C236 1000 Me o OFF LD M2 HK mecs 2000 C236 i0 Coap Yil DHSCS 2000 C236 Y10 gt LD C236 OUT Y11 1 When M1 is ON C236 will count in the interrupt mode when X0 changes from OFF to ON see Chapter 8 Using High Speed I O for the description of the XO input frequency When C236 changes from 999 to 1000 the C236 contact will be set When C236 changes from 1001 to 1000 the C236 contact will be reset When the C236 contact drives Y11 the execution of Y11 is determined by the user program scan cycle 2 When M2 is ON and the DHSCS instruction meets the requirements stated in the preceding Note Y10 will output immediately if C236 reaches 2000 regardless of the the scan cycle 3 When MO is ON SM236 is driven and the C236 counter counts down When MO is OFF
76. IL ANI S Program steps L oe Operand Type Applicable el t KEE Operand description Example S Source operand MO mi vO LD MO Function description AH 2 os EN OUT YO After reversing the ON OFF status of the designated contact S conduct and operation on the reversed result and the current power flow and then assign the value to the current power flow When MO is ON and M1 is OFF YO outputs ON IVC Series Small PLC Programming Manual Chapter bh Basic Instructions 57 5 1 5 OR NO Contact Power Flow Or Applicable to IVC2 IVC1 Influenced flag bit IL OR S Program steps ffset Operand Type Applicable elements K Se addressing eRe Re Eee ee ee E ee A Operand description Example S Source operand MO YO Wi WW Function description LD MO Mi OR M1 After conducting OR operation on the ON OFF status of the designated contact S and the current power flow assign the value to the current power flow OUT YO When MO or M1 is ON YO is ON 5 1 6 ORI NC Contact Power Flow Or Influenced flag bit EA Applicable elements addressing MES ESCANEO A ES Ee EC A E A ee eee Operand description Example S Source operand mi YO N KR LD MO Function description ORI M2 After reversing the ON OFF status of the ZS OUT YO designated contact S conduct OR operation on the reversed result and the current power flow and When M1 is ON or M2 is OFF YO is ON then assign the value to th
77. Kns Rniw kasm o SO 0 tT Vv Zz Operand description S1 Source operand D Destination operand starting unit of word string S2 size of destination word queue S3 number of words filled rightward Function description When the power flow is valid the contents of S2 units starting with D unit will move rightward S3 words The rightmost S3 units will be discarded At the same time the contents of S3 units starting with 7 will be filled into the left end of the word string Note 1 The elements with smaller SN are at the right and the elements with larger SN are at the left 2 220 S320 S22 S3 3 When S1 and D both use Kn addressing Kn shall be the same wm o so oft fv Z Example ien mm i LD XO WSFR DO D100 10 3 DES ff x DEES EDERT M CS 7 1 When MO is ON the contents of 10 units starting with D100 unit will move rightward 3 words The rightmost units D102 D100 will be discarded At the same time the contents of the 3 units starting with DO will be filled into the left end of the word string 2 Before the execution D2 300 D1 200 DO 100 D109 10000 D108 9000 D107 8000 D106 7000 D105 6000 D104 5000 D103 4000 D102 3000 D101 2000 D100 1000 3 After the execution DO D2 remain unchanged D2 300 D1 200 DO 100 D109 300 D108 200 D107 100 D106 10000 D105 9000 D104 8000 D103 7000 D102 6000 D101 5000 D100 4000 IVC Series Small PLC Programming Manual 88
78. LAD Applicable to IVC2 IVC1 H DROL SI D S2 7 1 inmuencediftagbit cary IL DRCL S1 D S2 Program steps Offset O d T Applicable el t 57 DWORD consan Kx Kav eg ers ren esn o o CT TV v op fe v II WORD rie ege 52 Iesele ver eg es nt esn o t So ce ft fv zp iv Operand description Note S1 Source operand 1 1 8220 D destination operand 2 When S1 uses Kn addressing Kn must be equal to 8 S2 Source operand 2 Example Function description Mo 3013123244 1488165020 LD MO e DRL mp nid 25 When the power flow is valid DRCL DO D10 25 the S1 data and the carry 1 When MO is ON DO D1 2 10110011100110001001110010101100 SM181 will together rotate 3013123244 and the carry SM181 OFF will rotate leftward for 25 bits and leftward for S2 bits and the the result 2 001011000101100111001100010011100 1488165020 is result is assigned to D assigned to D10 D11 SM181 ON 2 Please refer to the RCL instruction illustration 6 7 9 SHR 16 Bit Shift Right Word Instruction LAD Applicable to IVC2 WC me O R ei O GI 1 eenegen OO O o o L am S m S3 Program steps Offset Operand Type Applicable elements addressing st wORD Constant KnX kny KnM Kns KniM knsm D sp c TI v z_ y worD __ Kny KnM kns kam b oc T v z y S2 INT Constant Knx kny km kns knLm knsm _D sp c tT vi zi y Operand description Example S1 Source operand 1 eRe S
79. LD X4 E ORD gt DO D2 100000 20000 Hz Do pz OUT Y4 x5 Ys LD X5 d ORD lt DOD2 100000 20000 OUT Y5 D DO Iz Compare DO D1 and D2 D3 and use the comparison result in parallel connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual 190 Chapter 6 Application Instructions 6 16 7 Compare Floating Point Number LDR Instruction e MM MM CA te EE A AL O A AA SR EA ESE LESA LEE Operand Type Applicable elements Operand description Example S1 comparison parameter 1 LDR DO D2 O ni E YO e OUT YO i k w IZ S2 comparison parameter 2 n Tai S LDR lt DO D2 Function description EZ mp IG agree as NS OUT Y1 d LDR gt DO D2 1000 200 1000 209 12 Compare elements S1 ano EE e gt 3 En OUT Yo S2 and use the comparison 1000 200 1000299 13 LDR lt gt DO D2 result to drive the following ES gt DO be es E OUT Y3 i 1000 200 1000 299 14 z operation i E SG 3 3 LDR gt DO D2 OUT Y4 1000 200 1000 299 15 RE D0 Te LR LDR lt D D2 OUT Y5 Compare DO D1 and D2 D3 and use the comparison result determine the output status of the following element IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 191 6 16 8 Compare Floating Point Number ANDR Instruction Applicable to IVC2 IVC1 Influenced flag bit ANDR ANDR lt ANDR gt ANDR lt gt ANDR gt ANDR lt Program
80. O A E Operand description S Source operand D Destination operand Function description 1 When the power flow is valid S will be converted from floating point number to double integer and the result is assigned to D 2 When the conversion result is O the zero flag will be set When the result rounds off the decimal fraction the Applicable elements LP addressing A A E borrow flag will be set When the result exceeds the range of the double integer the carry overflow flag will be set Note When S gt 2147483647 D 2147483647 When S lt 2147483648 D 2147483648 and at the same time the carry overflow flag will be set Example AU 100000 5 100000 E DINT mo mp DINT DO D10 When XO is ON DO D1 100000 5 will be converted from floating point number to double integer and the result 100000 is assigned to D10 D11 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 109 6 5 7 BCD Word To 16 Bit BCD Instruction 6 5 8 LAD Applicable to IVC2 IVC1 BCD O Program steps 5 Offset O d T Applicable el t 5 WORD Constant Kx K Km Kns rem ens OT SOT 0 TV v_ Hoen Rav Kam es e E O O E Operand description Note S Source operand S lt 9999 When S gt 9999 the system will report operand error and will not execute D Destination operand the instruction and D will not change Function description Example When the power flow is val
81. PLC is powered off the data of the high speed counter and the contact status is set by the user in the system block through the AutoStation software IVC Series Small PLC Programming Manual LAD e DHSCS 1 IL DHSCS S1 S2 Operand Type sr BINT Constant Kx Kay Kawi ee Teen OT SOT CT VT Operand description S1 a 32 bit DINT data the one with which the high speed counter will compare Range 2147483648 2147483647 S2 high speed counter Range C236 C255 D target bit element including Y M and S elements They will be set or output immediately regardless of the scan cycle Function description 1 A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON When high speed counter counts to 7 in the DHSCS instruction the bit element D will be set immediately or in the case of a Y element the Y element will output immediately 2 This instruction can be used when you want to set and output for Y elements a certain bit element by comparing the counter value with a preset value Chapter 6 Application Instructions 143 6 10 2 DHSCS High speed Counting Compare Set Instruction 52 D Applicable to IVC2 IVC1 Program steps Applicable elements addressing MER e MEN AA AE TEA E eS ASA EE T a ee ee ee ee ee ee ee ee Note 1 The DHSCS instruction must work together with the
82. SDO9 Setting the input points for operation control Decimal X0 is displayed as 0 X10 8 Maximum 15 Configurable through system block I O points The least significant byte output S01 pease topom eessen O module I O points The least significant byte output leegen Taiestsgnian recone 1777 analog I O points The least significant byte output 2 Operation Error Code FIFO Area SD20 Reserved operation error code 0 In the order of arrival the latest SD21 Reserved operation error code 1 five operation error codes are SD22 Reserved operation error code 2 l reserved SD20 always stores SD23 Reserved operation error code 3 l the latest error codes SD24 Reserved operation error code 4 3 FROM TO Error SD25 Special modules nbmbenng is wrong starting with 0 when using y y Initial value 255 FROM TO instruction SD26 The I O chips numbering is wrong starting with 0 when refreshing UO MAA Initial value 255 IVC Series Small PLC Programming Manual 4 5 6 Appendix 2 Special Data Register 271 Scan Time Addr Action and function R W IVC2 IVC1 Range SD30 Current scan time unit ms SD31 Min scan time uint ms SD32 Max scan time Max scan time unit ms Default Oms Unit ims When the constant scan time is longer than the user monitoring overtime setting user program overtime alarm will be raised When a scan cycle of user program is longer than the constant Const
83. SM1 o Hoy oO DO 2000 MOY 2000 Di xO 0 2000 1050 OFF TRIANGLE 10 Di D10 1000 MO xi 1050 HI T D 1 D10 1 1 When XO is ON D10 in the first cycle D10 DO 0 will increase by 2 2000 1000 in every scan cycle When D10 D1 2000 the rising half of the triangle is complete and D10 will decrease by 2 in every scan cycle that follows When D10 DO 0 a complete triangle is complete and MO is ON In the next scan cycle if XO keeps ON and MO is OFF the next triangle wave will start If the power flow falls the output state D2 will be OFF but the output value D7 will keep its current value until the next rising edge when D7 will be initialized as S17 and a new triangle wave starts 2 You can use an external special module to convert the data into analog waveform IVC Series Small PLC Programming Manual 164 Chapter 6 Application Instructions 6 12 Communication Instruction 6 12 1 Modbus Modbus Master Station Communication Instruction LAD H HH MODBUS ei 52 IL Modbus S1 S2 S3 wien O V Operand description S1 designated communication channel S2 starting address of the data to be transmitted S3 starting address for storing the received data Function description 1 When being a master station when the input conditions are met the system will transmit the data stored in the unit starting with S2 and then receive the data and save it to the unit starting with S3 2 When being a
84. SM240 C240 SM241 C241 SM242 C242 SM243 C243 SM244 C244 SM245 C245 SM246 C246 SM247 C247 M24 24 When the single phase bi directional counter and SM249 2 phase counter C2 _ _ is in the down counting mode the corresponding SM2 _ _ becomes high level when in up counting mode the corresponding SM2 _ _ becomes low level counting down up of the counter respectively SM251 C251 SM254 C254 IVC Series Small PLC Programming Manual R R R R R R R R R R R R W W W W W W W W W W W W R W R R R R R R W W W W W W R W y 270 Appendix 2 Special Data Register Appendix 2 Special Data Register EJ Note 1 All special data registers except SD50 SD55 will be initialized when the PLC changes from STOP to RUN 2 The reserved SD and SM elements are not listed in the table The reserved SD elements are by default read only 1 PLC Work State Data EE en SDOO PLC type 20 means IVC2 SDO1 For example 100 means V1 00 SDO2 Capacity of user program For example 8 means an 8k step program SDO03 System error code Store the code of occured system error SD04 Battery voltage For example 36 means 3 6V Configurable only through system block Any Sett f AC SDO5 SA E setting smaller than 10ms or bigger than 100ms fail tecti te cele ena will be regarded as 10ms or 100ms respectively SD07 Number of extension I O module N f ial SDO8 umber of specia module
85. SWAP DO bytes are swapped When XO is ON the high low bytes in DO 0x1027 4135 will be swapped E and saved DO is then 0x2710 10000 Function description When the power flow is valid the D element whose high low bytes has been swapped will be saved 6 2 8 XCH Exchange Word LAD Applicable to IVC2 IVC1 ee o A DG Com DA mm Program steps SS Offset addressing or m Teen eg enw Jo Jefry Y gt oz INT Ra RMS ka o ery y gt Operand Type Applicable elements Operand description Note D1 destination operand 1 When using the Kn addressing mode the Kn in D1 and D2 shall be the same D2 destination operand 2 Example Function description x0 1000 5000 LD X0 ACH DO nid When the power flow is valid oer dE D1 and D2 will exchange their When XO is ON DO and D10 will exchange their values Before the execution values DO is 5000 and D10 is 1000 After the execution DO is 1000 and D10 is 5000 IVC Series Small PLC Programming Manual 84 Chapter 6 Application Instructions 6 2 9 DXCH Exchange Double Word Instruction LAD Applicable to IVC2 IVCA iom oo o a Soe IL DXCH D1 D2 Program steps 7 Offset Operand Type Applicable elements addressing m PONT Kav Kot ns Rie TT Vz y gt D POINT av Ko kas ent ev ep y gt Operand description Note D1 destination operand 1 When using the Kn addressing mode the Kn in D1 and D2 shall be the D2 destination operand 2 same Function
86. The SFC of IVC series PLC can also support up to 20 independent procedures The independent procedures can run independently that is to say the steps within different independent procedures are scanned and executed separately However jumping among independent procedures is enabled Basic Concepts Of SFC The SFC has the following two basic concepts step and transfer Other concepts like jump branch and multiple independent procedures all evolve from the two basic concepts Steps 1 Definition A step is actually a program section representing a work state or move in the sequence control process Putting multiple steps together in a organic way can form a complete SFC program 2 Execution of steps In a SFC program each step is represented by a fixed S element A step is valid when it is being executed For a valid step its corresponding S element is ON and the PLC will scan and execute its instructions While a step not being executed is invalid For a invalid step its corresponding S element is OFF and the PLC will not scan and execute its instructions Transfer The sequence control process is actually a series of step transfers A PLC executing a certain step will if certain logic conditions are met leave the current step to enter and execute a new step That transition is called the step transfer The logic condition that triggers the transfer is called the transfer condition Programming Symbols And Their Usage Progra
87. Tu RRE 251 OR Ze As APA abwsivan died aap nd AN A castes aA aE E EEE EEEE IEEE 251 10 4 13 Modbus Parameter Geng 252 10 4 14 Modbus als aU 61 0 0 Rene 252 10 5 N N bus Communication Protocol ccccccccccsecccececeeeeeeeeeeeeeeece ceca eeeeeeeeseeeesecessueesseeeeseeeeseeesseeeseeesaecesneessaes 255 A A 255 105 2 NN DUS Eer Structure ri A Een 256 10 5 CR HOS Refresh le EE 256 1 0 5 4 N N bus Parameter Se WING EE 261 OIM dal dolo al di ll a dl cd 262 IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 245 10 1 Communication Resource The baud rates applicable to IVC series small PLC are listed in the following table Communication port Supported baud rates for different protocols Communication port 0 115200 57600 38400 19200 9600 4800 2400 1200 Communication port 1 115200 57600 38400 19200 9600 4800 2400 1200 The communication protocols that IVC series small PLC supports are listed in the following table Basic Communication Ee Supported protocol module port S id i Port 0 RS 232 Programming port protocol free port protocol Modbus communication protocol slave station N N bus communication protocol master station slave station Free port protocol Modbus communication protocol master station slave station RS 485 N N bus communication protocol master station slave station Port 0 RS 232 Programming port protocol free port protocol Modbus communication protoc
88. X7 MS A HA AY A A MA Stop buttonForward jogReverse jogForward locRev tt ating IVC Series Small PLC Programming Manual Chapter 6 Application Instructions MO SM8 2 M20 RST MO Zero teturn Ze state s MO LI ER 5000 1000 ze YO Zero teturn Proximity s state tate r s j Itant j d oq LZ XO X1 X3 x4 X5 X7 MS Forward Stop buttonZero returnReverse jogForward locReverse locabsolute poLocating button button buttonn ating ating sition tal oO Q Aa PS Forward jog Fo state 3 M1 X2 m DRVI 100000 5000 Yo Y4 7 Forward jogForw state but mm f og X3 XO X1 X2 x4 x5 X7 MS rrr rr ee es OS Y dl Reverse jog Stop buttonZero returnForward jogForward locReverse locabsolute poLocating buttonn button button ating ating sition 5000 YO Yi D d LI IVC Series Small PLC Programming Manual 1 iw tj Y in 1 un w ri M20 ma RS RST un IW el M21 DO in 3 un m e M22 Mil Forward com plete Mil 7 Forward cor piete Leg Vi D LI Forward jog state Mil 7 Forward com plete 203 Chapter 6 Application Instructions Forward locating operation x4 XO X1 X2 X3 X5 X7 M5 gt D in Le IS LI d orward loc Stop buttonZero returnForward jogReverse jogReverse locabsolute poLocating Forw ting UTtTON button buttonn ating sition p in IM ae Kom i LI Forward loc ate state M23 00000 000 Y
89. XO amp X1 2 High speed counters when used in instructions DHSCS DHSCR DHSZ DHSP and DHST can trigger operations free from the scan cycle 8 1 4 Points To Note About High Speed Counters Classification of high speed counters C236 C237 C246 and C251 can be used as both hardware counters and software counters depending on the modes in which they are used All the other high speed counters are software counters Maximum combined frequency 1 The maximum combined frequency or the sum of frequencies of all signals input at any time should not exceed 80kHz on the following two occasions e When multiple high speed counters hardware counting mode are used simultaneously e When the high speed counters hardware counting mode and the SPD instruction are used at the same time 2 The maximum combined frequency when multiple software high speed counters or when high speed counters and the SPD instruction are used at the same time is shown in the following table Scenario Maximum combined frequency Instructions DHSCS DHSCR DHSCI DHSZ DHSP and DHST are not used 80kHz Instructions DHSCS DHSCR DHSCI DHSP or DHST are used 30kHz Instruction DHSZ is used 20kHz Maximum frequency of hardware counter Counters C236 C237 C246 and C251 are the only four potential hardware counters Among which e C236 C237 and C246 are 1 phase counters Their maximum counting frequency is 50kHz e C251 is a 2 phase counter lts maximum cou
90. a D mark in the front that means the D register address of the corresponding main module Figure 2 11 Setting special module property In the dialogue box as shown in Figure 2 11 you can configure the channel for the special module including Mode signal features Digital value at zero Upper limit of digital value and Average sampling value Refer to the user manual of the specific special module for the meanings and configuration methods of the various parameters IVC Series Small PLC Programming Manual 2 2 2 2 2 3 Chapter 2 PLC Function Description 21 Advanced Settings The advanced settings include Datablock enabled Element value retained No battery mode and Formatting is prohibited System block Saving Range Output Table Set Time Input Filter Input Point Special Module Configuration Priority Level Of Interruption Advanced Settings Communication Port Default value The PLC initializes the D registers with the datablock in the process of switching from STOP status to RUN status The datablock valid and element value retained are both valid and the datablock valid is in priority During the setting the element value will be saved Element value as image in the process of switching from STOP O retained status to RUN status it cannot be initialized except for elements that defined in saving range When setting the bit the PLC formatting cannot be au implemented Ol et 3 Be careful in
91. a window asking you to enter the password will pop up before the download can start Uploading You can upload the system block data block and user program from a PLC to your PC and save them in a new project If the battery backed data are valid the user auxiliary information files will be uploaded together See Figure 2 15 Upload project Location C Documents and Settings PLE type Default editor description Figure 2 15 Upload dialogue box If you have set a upload password and have not entered it after starting the AutoStation this time a window asking you to enter the password will pop up before the upload can start During the download you can select to disable the upload function which means no PC can upload the program from the PLC To enable the upload function you must re download the program and check to enable the upload function during the downloading process Error Reporting Mechanism The system can detect and report two types of errors system error and user program execution error A system error is caused by abnormal system operation While a user program execution error is caused by the abnormal execution of the user program Every error is assigned with a code See Appendix 6 System Error Code System error When system error occurs the system will set the special relay SM3 and write the error code into the special data register SD3 You can obtain the system error information by accessing th
92. and application instructions which is similar to the control current output by the driving coil and executed by the execution unit in electric control diagram In LAD the coils or application instructions must be preceded with power flow because the coils can output and instructions can be executed only when the power flow is ON The following figure demonstrates the power flow in LAD and the how the power flow drives coils or function blocks Power flow No 1 E TO mR Power flow No 1 Power flow No 2 AO Ma Power flow No 3 o Three power flows DU Figure 4 2 Power flow and its driving function IVC Series Small PLC Programming Manual 46 Chapter 4 Programming Concepts 4 1 2 IL The IL or the instruction list composed by users is a text programming language The user program stored in the PLC basic module is actually the instruction list recognizable to the basic module The system realizes the control function by executing the instructions in the list one by one The following is an example of equivalent LAD and IL 4 1 3 SFC The SFC is a diagram programming language usually used to realize sequence control which is a control process that can be divided into multiple procedures and proceed according to certain working sequence The user program designed with SFC is direct and clear because it has a structure similar to the actual sequence control process See the following figure for a simple example of S
93. anywhere in the project and using them is in effect using the corresponding device The global variable The global variable table includes three columns Variable Name Variable addr and Comments IVC Series Small PLC Programming Manual 22 Chapter 2 PLC Function Description The variable name can be made up of letters case insensitive numbers underline or their mixture but no spaces The name cannot start with a number nor be completely made up of numbers Length not longer than 8 bytes The format of device type number is illegal No keywords shall be used The keywords include basic data type instructions and the operators in the IL programming language The number of global variables shall not exceed 500 See Figure 2 13 MAIN Global variable table 4 p x Variable Name Variable addr Comments A aL Stop button xO 2 Zero return Xl 3 3 Forward jogging x2 4 Reverse jogging x3 5 Forward locating x4 6 Reverse locating x5 7 Close point x6 8 System start el i Figure 2 13 Global variable table 2 2 4 Setting BFM For IVC2 Serie Special Module 2 3 There is no need to set the addresses for IVC2 series special modules for the basic module can detect and address them automatically upon power on Among the special modules the analog extension module includes the analog input module and analog output module The parameters of these two special modules such as the channel characteristics zero po
94. code Number of elements to read Starting address The decimal value of 07D0 is 2000 Function code Station No Abnormal response description Rononnal code Illegal function code Illegal register address Tegal daia Note the following 1 Elements X and Y use octal system There are 256 points in total from XO to X377 256 points from YO to Y377 with the combinations of YO Y7 Y10 Y17 and Y20 Y27 etc 2 Two addressing methods are available for Element X One is the protocol address of 1200 1455 with corresponding function codes of 01 05 and 15 the other is the protocol address of 0 255 with function code 02 3 Processing of double word element C element is a counter It has status and current value C200 C255 are 32 bit elements but each C element in the range will get two protocol addresses during the protocol address compiling For example The protocol address of C200 is 9700 9701 When reading the elements though Modbus both the starting protocol address and the number of the read elements shall be even number 4 For most SM SD elements the real value cannot be written through Modbus but PLC salve station will still return OK to indicate the completion of write operation which is allowable 5 In addition the Modbus communication protocol of IVC2 supports the read and write of double word element LONG INT variable and floating point number In the PLC of IVC2 32 bit data are stored with high bits at
95. comprising the IVC1 mini scale series and IVC2 small series is a high performance product suitable for modern industrial control The IVC series PLC products have integrated structure built in high performance microprocessor operation control system integrated I O and extension bus The series also include I O modules and special modules The basic module has 2 integrated communication ports and the sytem can connect to the profibus network through a profibus extension module The basic module I O is capable of high speed counting and high speed output that can be used for exact locating The powerful AutoStation programming software provides 3 standard programming languages and commissioning amp monitoring functions and boasts complete user program protection mechanism Product Specification Table 1 1 PLC basic module 10 input 6 output 14 input 10 output 10 input 6 output 14 input 10 output Digital UO points 20 input 12 output 24 input 16 output 16 input 14 output 24 input 16 output 32 input 32 output 40 input 40 output 36 input 24 output Total HS of supported 512 128 I O points Max number of special a modules UC High speed pulse output 2X 100kHz for transistor output only Single ph ti E 6 2 50kHz 4 10kHz channel AB phase counting channel 2 1 30kHz 1 5kHz Max total f f lax otal frequency o SOUS 60kHz high speed counter XO X7 SENN AU X17 ae Digital filtering are Input filter
96. counter C200 C235 32 bit L speed counter C236 C255 Elements Yes Real time clock power failure memory hold time gt 1 power failure memory hold time 100 year hs Analog potentiometer 2 precision 8 bit 2 precision 8 bit PORTO RS 232 Ports SE PORT1 RS 232 RS 485 Communication Programming port and user Sue fommali o enabling program 200 000 hs ground fixed minimum mechanical stress and temp humidity control MTBF 100 000 hs ground fixed minimum mechanical stress amp no temp humidity control 300 000 hs ground fixed minimum mechanical stress and temp humidity control 150 000 hs minimum mechanical stress and no temp humidity control Life span of 220Vac 15VA inductive 1s ON 1s OFF 3 200 000 times Upload disabling Transistor output output relay 220Vac 30VA inductive 1s ON 1s OFF 1 200 000 times contacts 220VacI7AVA inductive Note See IVC1 Series PLC User Manual for the speicifcation installation instruction operation and maintenance of IVC1 series PLCs See IVC2 Series PLC User Manual for the speicifcation installation instruction operation and maintenance of IVC2 series PLCs IVC Series Small PLC Programming Manual 4 Chapter 1 Product Overview 1 1 2 Outline Of IVC1 Series Basic Module The outline and structure of the IVC1 series basic module are shown in the following figure example IVC1 1614MAR Power supply terminals 8 Input terminals Mo
97. current value of Y1 output locating Highest frequency of executing of 2 The SD84 basic frequency must be SD86 instructions ZRN DRVI and DRVA R W LSB smaller than 1 10 of SD85 highest Acceleration or deceleration time of SD87 executing of instructions ZRN DRVI R W and DRVA frequency or SD84 will be set automatically 6 17 7 ZRN Regress To Origin Instruction as 1 10 of highest frequency When the 1000 frequency in a locating instruction is smaller than the basic frequency or higher than the highest frequency no pulse will be output Applicable to IVC2 IVC1 E E influenced flag bit IL ZRN S1 S2 S3 D Program steps Offset Operand Type Applicable elements addressing St INT corsen Rox IA SOT ST TV Tf en eee ee R E E AT NEE EECHER E MAA IS IR A EE output through Y2 and Y3 respectively When SM85 o is set the CLR signals will be output to the servo S71 zero return speed specifying the zero return amplifier through Y2 and Y3 start speed 32 bit instruction 10 100 000 Hz S2 crawling speed specifying the relatively low speed when the proximity signal is ON Operand description Note 1 Because the ZRN instruction is incapable of searching the proximity signal automatically the zero return operation must start earlier than where S3 Proximity signal specifying the X point for the proximity sensor is located inputting proximity signal 2 During the return to zero process t
98. description Example When the power flow is valid op mmm egen LD X0 D1 and D2 will exchange their re ee a DXCH DO D10 values When XO is ON DO and D10 will exchange their values Before the execution and DO D1 is 5000000 D10 D11 is 1000000 After the execution DO D1 is 1000000 and D10 D11 is 5000000 6 2 10 PUSH Push Instruction LAD Applicable to IVC2 IVC1 HH PUH 6ND D 52 Influenced flag bit ah Cam e pm e 7 Operand Type Applicable elements nee E E PR addressing Si INT Constant Rox Ka Kew eg TRAM TRAST o SOT CTT VT Zz 7 DEN O IS IS O O II IS IS O IS 52 INT Constant Kax KoY KoM Kns KMKM DT Soe pt Pv pz vw Operand description Note S1 push value 1 When the stack is illegal for example when the stack size lt 0 the D the number of elements in number of elements in the stack lt 0 or when the stack size is beyond the the stack It is also the limit the system will report Definition error of stack operated element at the stack bottom 2 The stack size does not include the stack bottom element the element S2 stack size designated by D Function description 3 S2 indicates the stack size Range 2 0 Example 1 When the power flow is valid the value of S1 will be MO 1000 g LD MO pushed onto the top of the CS SES stack with D element as the bottom and D will increase by Stack 1 At this time the address of pointer propres wo oror orod Hs
99. each step must be bigger than the min pulse number required by frequency transfer 2 Use P to stand for the pulse number that a certain step outputs F frequency of section N Fa the maximum speed E the maximum speed 7 the acceleration time T the deceleration time down 1 When the speed of step N is bigger than that of step N 1 the pulse number of step N must meet the following condition S Fy Py x Fy EE 2000 x F max EEN 2 When the speed of step N is smaller than that of step N 1 the pulse number of step N must meet the following condition s Pv t EA Rail eeng 2000 x FP Fanin 3 In particular 1 when N 1 the frequency of step N 1 is used instead of F in the above format 2 when all the step number is 1 that is to say only one section the pulse number must meet the following condition F Frain x Fy Fain X Lay Ton P gt min min 2000 x F i E 3 The pulse number of the last step must meet the following format p gt En En 1 X Fy Fy x Lip Taom 2000 x E F 4 the frequency set in every step must be within the range of maximum speed and minimum speed 5 The maximum total pulse number of all steps is 999 999 4 Use the transistor output During the high speed pulse output the output current must comply with the related regulations The waveform at output points YO amp Port 0 Y1 amp Port 1 is related to the load so l
100. elements Such elements include SD66 SD68 cycle of timed interrupt SD80 SD89 locating instruction parameters SM40 SM68 interrupt control flag bit Setting these SM elements will enable the corresponding interrupts SM80 81 YO Y1 high speed pulse output stop instruction SM110 SM114 monitor bit of free port 0 SM135 136 Modbus communication flag bit SM172 SM178 integrated analog channel enabling flag valid only for IWC1 1614MAR1 Elements numbered in Decimal starting with O Data type Boolean Available forms NO and NC contacts Value assignment 1 Through instructions 2 Write or force during system debugging SD100 SD106 real time clock data Elements numbered in Decimal starting with O Data type Word integer Available forms Storage and calculation of integers Value assignment 1 Through instructions 2 Write or force during system debugging LU Note You cannot assign values to the read only SD elements IVC Series Small PLC Programming Manual 3 1 11 3 1 12 3 1 13 Offset Addressing Register Element mnemonic Z Function The Z elements are 16 bit registers that can store signed integers For detailed offset addressing information see 3 2 2 Z Addressing Mode Offset Addressing Mode Elements numbered in Decimal starting with O Local Auxiliary Relay Element mnemonic LM Function The LM elements are local variants and can be used in the main progr
101. elements starting with D100 3 After receiving data through Modbus the system will conduct CRC check address check and instruction check If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 The communication error codes are shown below Illegal instruction llegal register address Wrong number of data 0x10 Communication timeout The communication exceeds the preset communication time limit Error in receiving data frame Operand error Operand mode or master slave setting error Error occurs because t he local station SN is the same as that set by the instruction For the detailed application methods see Chapter 10 Using Communication Function IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 165 6 12 2 IVFWD FREQUENCY CONVERTER Forward Rotation Instruction Applicable to IVC1 51 52 Influenced flag bit Program steps Operandi T Applicable element ER eran e icapie elements i a ER addressing A e AAA MEA eo EEE RE IA A O A A Operand description the communication completion flag SM135 after the communication lf there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 The error codes in FREQUENCY CONVERTER Function description instruction communication are listed below 1 Control the drive forward running through communicat
102. flow is valid and the communication conditions are met limited amount of data will be received through the designated channel to the designated registers Example SMi HH EY i neo 5 SIE INC D00 LD SM1 RCV 1 D20 5 LD SM123 INC D100 1 The instruction will be valid continuously as long as the power flow is valid If you want to receive data only once you can use a rising edge or special registers that are effective only once such as SM1 to trigger the instruction 2 For detailed application examples refer to Chapter 10 Using Communication Function Note Size of communication frame depending on the element type D or V of the communication frame the ending character of the frame does not exceed D7999 or V63 The receiving stops upon shutdown The value range of S1 0 and 1 Applicable elements addressing E EE EE EE TEO 2 INT Constant Kax Kav Kom Kos Kaen 0 so o T v z Special register SM111 SM121 Receiving enabled flag It will be set when the RCV instruction is used and cleared when the sending is completed When it is reset the current receiving stops SM113 SM123 receiving completed flag When the receiving is completed the receiving completed flag will be set SM114 SM124 Idle flag When the serial port has no communication task it will be set and it can be used as the checking bit for communication SD111 SD121 Starting character which can be set in the
103. from ON to OFF the output elements of the corresponding step will be cleared or reset For details see 5 3 1 STL SFC State Load Instruction LU Note 1 The SFC program of IVC series PLC usually contains LAD program blocks that are used to handle operations besides the flow including starting the SFC The LAD program blocks are not controlled by the S elements and will be executed in every scan cycle 2 Because the state change of the S element will affect the embedded instructions of the corresponding step and the switch over between two steps takes some time it is necessary to observe certain rules during the SFC programming For details see 7 4 Points To Note In SFC Programming Relationship Between SFC Program And LAD Program A SFC program can take the form of a LAD program which can help understanding the SFC program structure In the LAD program the SFC symbols are replaced with various SFC instructions while the procedures are represented by various structures STL Instruction And Steps All SFC steps are represented by S elements In a LAD program a step is started by a STL instruction Shown in the following left figure is the LAD program of a simple sequential structure and the right figure is its corresponding SFC program IVC Series Small PLC Programming Manual 212 7 2 2 7 2 3 7 2 4 7 2 5 7 3 Chapter 7 SFC Tutor Se 5 TOH T100 10 T100 SET Sed S29 sMO el SEI 528 S26 sMO ER S
104. id Influenced flag bit Determined by th IL CALL SBRname PARAM1 PARAM2 Program steps cd aet subprogram parameters Function description When the power flow is valid the system will call the designated subprogram execute it and then return to the main program to execute the instructions following the CALL instruction Note 1 The subprogram called by the CALL instruction must be defined in advance in the user program or the program cannot pass the compiling 2 The operand element type in the CALL instruction must match the Data Type defined in the local variable table of the subprogram or the program cannot pass the compiling The following examples demonstrates some illegal matches Example 1 In the local variable table of subprogram SBR1 the data type of Operand 1 is DINT DWORD The following usages are illegal e CALL SBR1 ZO The data type of Z element cannot be DINT DWORD e CALL SBR1 C199 The data type of elements CO to C199 cannot be DINT DWORD e CALL SBR1 K2X0 Kn addressing 1 lt n lt 3 the data type cannot be DINT DWORD Example 2 In the local variable table of the SBR1 subprogram the data type of Operand 1 is INTAWORD the following usages are illegal e CALL SBR1 C200 The data type of element C200 to C255 cannot be INTAVORD e CALL SBR1 K2X0 Kn addressing 4 lt n lt 8 the data type cannot be INT WORD 3 The operand element type in the CALL instruction must match the Variable Type defined
105. in the popped out shortcut menu insert the password and confirm it To cancel the password just go through the same process and input the correct password LU Note If you fail to input the correct password for continuously ten times you will be banned from inputting password for the next 5 minutes 2 2 System Configuration 2 2 1 System Block The PLC configuration information or system block file is configured through the system block and is an important part of the PLC user file Before using the PLC you need to compile and download the system block file The system block configuration includes configuring the following items e Saving Range element saving range e Input Point Startup mode of the input point e Communication Port Communication port and protocol Priority Level Of Interruption setting e Special Module Configuration e Input Filter e Advanced Settings data block element e Output Table value retain no battery mode and formatting e Set Time set watchdog time and constant scanning time ban After setting the system block you can select PLC gt Compile All to compile the system block file and be ready for download Saving Range Upon power loss the IVC1 and IVC2 series PLCs can save the data of elements in the preset saving range to SRAM so as to use them after the power on You can set the saving range in the Saving Range tab as shown in Figure 2 3 IVC Series Small PLC Programming Manual
106. low byte of each D element will store 1 ASCII code data Note 1 When S7 and D use Kn addressing Kn 4 2 When S2 is not within 1 256 the system will report operand error and will not execute the instruction and D will not change 3 If S1 is a constant S2 will be regarded as 4 by default when S2 gt 4 and the system will not report operand error Example MO 14393 ITA 16 99T6 IZ D Source data 0x9876 LD MO ITA 16 9876 D20 6 When MO is ON execute ITA conversion the data will be stored in two modes eo If SM186 OFF the execution result is D20 0x3839 D21 0x3637 o If SM186 ON the execution result is D20 0x39 D21 0x38 D22 0x37 D23 0x36 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 115 6 5 18 ATI ASCIl Hexadecimal Integer Conversion Instruction LAD Applicable to IVC2 IVC1 IL ATI S1 D S2 Program steps 7 Offset O d T Applicable el t Si WORD Constant Kox Kry Kaw eg Teen O SOT CTT V2 vy o Won nv Rowe EG en OT Te PT Pv Tz Soso a Ter eu eg Teen o So fe rT vy zi ov Operand description report operand error and will not execute the instruction and D will not change S1 conversion source ASCII code data 0x30 lt S1 9 lt 0x39 or 0x41 lt S1 lt 0x46 when SM186 is OFF 3 1fSTisa consiant Se will be a as 2 by the high byte and low byte of S1 shall both be within EE OPP ANG SARA OTAS WAEN this range SM186 is ON and S22 1
107. of emergen ste ff This is a simple sequential flow The procedures are linear without any selection or parallel procedures Writing the program with SFC would be faster and clearer than the conventional logic design method See the following figure for the SFC program and its LAD counterpart Start 8 stop control program section Initial empty step Use X0 as the transfer condition and S20 S23 as the limit to prevent the next tray from entering before the current operation ends Lower the baffle plate to let the tray in lift 1 Delay 1s Delay 1s time is up and start the next step Lifting cylinders Y1 Y2 act till Hight OK switch X2 acts Delay 0 8s Delay 0 8s time is up and start the next step Start roller motor Y3 In lift 2 limit switch X3 acts to enter the next step The left 8 right lifts lower and the roller stops X4 is reset to start a new round IVC Series Small PLC Programming Manual 218 program section TON Chapter 7 SFC Tutor iw w J i pu J iw In TON un IM te i IN tj qn on on uN bo wo Start stop control program section IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 219 7 5 2 Selection Branch Structure The following example is a material mixing flow Through this flow two kinds of products namely A and B are produced See the following figure for the illustration of the manufacturing device A minor ing
108. out IVC Series Small PLC Programming Manual 160 Chapter 6 Application Instructions 6 Setting bit 2 and bit 5 of S3 7 ON at the same time 9 The PID operands must be initialized before the PID will be regarded as invalid essentially the same as instruction is executed the first time If the operands setting bit 2 and bit 5 OFF and there will be no limit remain the same during the operation and the related nor output value alarm operand elements will not be covered by other 7 When the PID control operands S3 S3 6 are programs you can initialize the PID operands only set outside their ranges the system will report operand once However if the data in the transit data registers error and no PID calculation will be carried out are changed during the PID calculation the calculation 8 When the sampling time is smaller than the scan result will be incorrect cycle if there is data overflow or result overflow during the calculation there will be no alarm and the PID calculation continues 6 11 2 RAMP Ramp Wave Signal Output Instruction Applicable to IVC2 IVC1 Si 52 DI S3 IL RAMP S e mm e e Program steps Im Offset Operand Type Applicable elements addressing ST INT Constant e eg eo RaS eanes o o CTT Vy 2 S2 INT Constant Knx Kn eg Kns knim ksm o so 0 r Vv 2 a fet f TTT TI fet e vp S3 INT Constant Kak eer Ratt egen o SBC T Vv Z oz poa 0 0 E E O O IS CI O IO Operan
109. port O can only be used for programming communication 2 Free port protocol The free port protocol supports customized data file format either ASCII or binary code Only in the RUN state cana PLC use the free port communication which cannot be used to communicate with the programming device In the STOP state port O can only be used for programming communication The configurable parameters include Baud rate Data bit Valid bit Parity Stop bit Allow start character detection Allow end character detection Intercharacter timeout and Interframe timeout 3 Modbus protocol The Modbus communication equipment include a master and a slave The master can communicate with the slave including inverters and send control frames to the slave and the slave will respond to the master s requests Communication port 0 can be set as a slave while communication port 1 can be set as a slave or a master The configurable parameters include Baud rate Data bit Parity check Stop bit master slave mode Station no Transmission mode Timeout time of the main mode and Retry times 4 NN bus protocol N N bus is an Invt developed communication protocol that supports N to N communication in a small PLC network The PLCs in a N N bus network can automatically exchange part of their D and M elements Both port 0 and port 1 can use N N bus protocol LU Note For the detailed information of communication protocols see Chapter 10 Using Communication Functi
110. preceeding instructions are in effect equal to LD MO 1 SFTR X6 MO 8 2 The addressing process is as follows Z1 6 X0Z1 X 0 Z1 X6 Points to note Chapter 3 Element And Data 55 2 Word element offset addressing example LD MO 1 MOV 30 Z20 MOV D100Z20 DO The preceeding instructions are in effect equal to LD MO 1 MOV D130 DO The addressing process is as follows Z20 30 D100 220 D 100 Z20 D130 1 The Z elements store the offset for the offset addressing They support signed integers which means minus offset is supported For example MOV 30 2Z20 MOV D100Z20 DO The preceeding instructions are equal to the following one in effect MOV D70 DO 2 The SM elements and SD elements do not support the Z addressing mode 3 Pay attention to the address range when using the Z addressing mode For example D7999Z0 ZO 9 is outside the address range of the D elements which is not bigger than D7999 3 2 3 Kn Addressing In Combination With Z Addressing The Kn addressing mode can be used in combination with the Z addressing mode For example K1X0Z10 In this mode the starting element address is found throught the Z addressing mode then the Kn addressing mode is used to determine the length of the bit string For example LD M1 MOV 3 210 MOV K1X0Z10 DO The preceeding instructions are in effect equal to LD Mi MOV K1X3 DO The addressing process is as follows Z10 3 K1X0Z10 K1X 0 210 K
111. shown in the following figure PLC Servo amplifier PLC Servo amplifier IVC1 1614MAT MR H A IVC1 1614MAT MR J2 A A 0 ABS bit0 PF 24 xo ABS bt0 D01 4 X 1 ABS bit 1 ZSP 23 Xx 1 ABS bit1 ZSP 19 Data transmission Data transmission X 2 e TLC 25 X 2 ready TLC 6 COM SG 16 COM SG 10 M Servo ON Servo ON d ABS transmission l ABS transmission mode E mode ABS request ABS request Time sequence chart ON Power suppl Ge OFF Servo ON signal SON Note 1 ABS transmission ON mode ABSM Note 1 ABS transmission request ABSR Note 1 Data transmission ON ready TLC Note 2 OFF lt PQS Send ABS data ON DO1 ZSP main circuit Ready Note 2 do RD eady for Note 3 peration Note 1 the signal PLC sends to servo amplifier Note 3 Note 2 the signal servo amplifier sends Note 3 system data transmission over ready for normal operation After RD is set ABSM signal will not be accepted Note 4 Here the SON signal is set before ABSM signal Despite that the main circuit will not be ON until ABSM is set ON If transmission mod
112. slave station the system needs no instruction control for transceiving data 3 This instruction is executed upon the rising edge Note 1 Sending data through Modbus whether the data is in RTU mode or ASCII mode you only need to store the RTU mode data into the unit starting with S2 You do not need to store the starting character ending character and checksum because they will be added to the data automatically in the sending process 2 You do not need to set the length for the data to be sent The system will set the length automatically based on the instruction Slave address Function code Data 1 S2 N 1 3 The data when received through Modbus will be stored in RTU mode regardless of whether you set it in RTU mode or ASCII mode That is when you set the data to ASCII mode the system will automatically convert them to hexadecimal remove the starting character and ending character and save them in the data area starting with S3 4 The sent and received data are stored in the low bytes of the word element High bytes are not used Applicable to IVC2 IVC1 Program steps Applicable elements MOY 3 np MOY D Moy 0 D2 Moy 10 113 Moy 5 D SIE HEY MODBUS 1 DO 0100 LD SM1 MOV 3 DO MOV 1 Di MOV 0 D2 MOV 10 D3 MOV 5 D4 AND SM124 Modbus 1 DO D100 1 Store the data sent through Modbus into the element starting with DO 2 Store the data received in the
113. system block SD112 SD122 Ending character which can be set in the system block SD113 SD123 Character time out time i e the maximum receiving interval between the two characters which can be set in the system block SD114 SD124 Frame time out time the time starting with the power flow and stops at the end of the receiving which can be set in the system block SD115 SD125 receiving completion code The definition of the data bit is shown as follows Frame character reception check time out time out flag flag characters received flag Bits 6 SD116 SD126 The characters currently received SD117 SD127 The character received previously IVC Series Small PLC Programming Manual 174 Chapter 6 Application Instructions 6 13 Data Check Instruction 6 13 1 CCITT Check Instruction Applicable to IVC2 IVC1 S1 52 D Ml influan ed flag bit e o Program steps Operand T Applicable element SES ICcable elements ma He ER addressing St WoR D NI Y Coen Kr RASH OS OPT pv pe JD woby Ee YY Operand description Example S1 the starting element of the data to Si we Ae da be checked i7 S2 the number of the data to be mae R da l LD SM1 checked S2 gt 0 or the system will wn 16400 cd aed aie 8 report operand error 51 e was F j MOV 16 22 D2 D check result ts MOV 16 33 D3 Function description Me eg i MOV 16 44 D4 SR MOV 16 55 D5 1 Conduct CCITT chec
114. the destination operands of instructions OUT TON TOF PWM HCNT PLSY PLSR DHSCS SPD DHSCI DHSCR DHSZ DHST DHSP and BOUT in the structure will be cleared Example MO HH NM 0 LD MO SMO YO MC 0 emm e 2 LD SMO OUT YO MR 0 MCR 0 When MO ON the instructions in the MC 0 MCR O structure will be executed and YO ON When MO OFF the instructions in the MC O MCR O structure will not be executed and the bit element YO designated by the designation operand of the OUT instruction in the structure will be cleared YO OFF Note 1 In LAD program the MCR instruction must directly connect to the left power flow bus 2 In LAD program the MCR instruction cannot connect to other instructions 3 Several MC MCR structures of different SNs can be used through the nest structure but the number of nest levels cannot exceed 7 The MC MCR structures with the same SN cannot be used in the nest structure 4 Crossing of two MC MCR structures is not allowed The following is an illegal example Note It cannot be used in SFC programming IVC Series Small PLC Programming Manual 64 Chapter5 Basic Instructions 5 3 SFC Instructions 9 3 1 9 3 2 9 3 3 STL SFC State Load Instruction LAD 7 L lt s gt Applicable to IVC2 IVC1 IL STL S Program steps Operand Type Applicable elements ter FR Wa ER ESPE ETA Operand description S Source operand Function description 1 I
115. the steps under certain conditions you can use the jump function you can recycle a part of the steps if you jump to a previous normal step or all the step if you jump to the initial step Shown in the following figure is a program that can realize the above two recycles with LAD on the left and SFC on the right IVC Series Small PLC Programming Manual 210 Chapter 7 SFC Tutor In the SFC when step S22 is valid the program may jump to step S21 to recycle S21 and S22 or jump to the initial step SO to recycle all the steps Which recycle will be selected is determined by a selection branch structure While in the LAD the two kinds of jumps are realized in row N3 where you can see the OUT coil 3 Jumping to another independent procedure The SFC of IVC series PLC supports multiple independent procedures and jumping among these procedures is allowed You can set certain transfer conditions in an independent procedure for jumping to a random step initial or normal of another independent procedure LJ Note Jumping among multiple independent procedures complicates the program Use it with prudence Shown in the following figure is a jump from one independent procedure to another with LAD on the left and SFC on the right In the SFC when the SO in the first procedure is valid the program can jump to step S23 in the second procedure under certain conditions while in the second procedure the program can also jump to step S2
116. this example when YO is ON if X1 is ON and the S33 is validated Y1 will be also ON within the same scan cycle with YO everse ope ration Stop button 53d SMO il HE IVC Series Small PLC Programming Manual 1 4 2 Chapter 7 SFC Tutor 215 Therefore you need to add an interlock to the program by adding a YO NC contact before the Y1 output coil as shown in the following figure Reverse ope ration 6 Confusing jumps with transfers Jumps are used between different procedures or non neighboring steps while transfers are used between neighboring steps It is prohibited to change an output coil into a SET instruction where a jump should be used or change a output coil into a SET instruction where a transfer should be used 7 Using parllel merge for selection branches In a selection branch structure only one selection is valid However when it is mixed with a parallel branch structure the selection branch structure may never end As shown in the following figure In the left part when flow 1 runs to step S41 it meets the transfer condition of a parallel merge But the system will never run flow 2 Therefore the transfer will never occur making flow 1 unable to end Modify The same operation Empty step F Flow 1 cannot end due to the stl parallel structure As shown in the right part to correct it you need to add a step 842 whose function is the same as 841 Then add an empty step S43 tha
117. to double integer and the result Ox5F5EOFF 99999999 is assigned to D10 D11 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 111 6 5 11 GRY Word To 16 bit Gray Code Instruction LAD Applicable to IVC2 IVC1 aan influenced fiag bit Cen O O Program sleps 17 Operand Type Applicable elements eset j W ER addressing Kaw Ros pemes OT SOT CTT CR D W s E DA Kam ens e OTT eh PT PV Pe Operand description Example S Source operand xo Le 43690 E5535 LD XO GRY D0 Du D Destination operand Ser iy A When X0 is ON DO OxAAAA 43690 will be converted form integer to 16 bit Gray code and the result OxFFFF 65535 is assigned to D10 Function description When the power flow is valid S will be converted from integer to 16 bit Gray code and the result is assigned to D 6 5 12 DGRY Double Word To 32 Bit Gray Code Instruction LAD Applicable to IVC2 IVC1 LC wer influenced fag bit IL DGRY S D Program steps 7 Operand Type Applicable elements Offset addressing SS Operand description Example S Source operand xo 2290649224 3435973038 LD XO e IGEY D0 D10 D Destination operand DGRY DO D10 Function description When XO is ON DO D1 0x88888888 2290649224 will be converted from double integer to 32 bit Gray code and the result OxXCCCCCCCC When the power flow is valid 3435973836 is assigned to D10 D11 S will be converted from integer to 32 bit G
118. with D Example Function description MO 2005 LD MO Sea TRD D10 Read the system time and store the value in the storage elements designated by D When MO is ON send the system time to the 7 elements starting with D10 The execution result of the instruction is as follows Element Item Clock data Item 0700 2000 to 2088 S070 en Special data register SD102 1 to 31 Day for real time clock SD103 0 to 23 D13 Soros 01059 SDi05 nen IVC Series Small PLC Programming Manual 136 Chapter 6 Application Instructions 6 9 2 TWR Write Real Time Clock Instruction LAD Applicable to IVC2 IVC1 HA TWR Influenced flag bit L TWR Program steps 1 Operand Type Applicablesolom te elieet eran P ER ER EE EC ee IN E Operand description S the element where the system time is to be written Clock da 2000 to 2088 0700 en SOTO D12 D 1 to 31 SD102 D Data for clock setting ay 2 ay 073 01023 SD0 01059 Soros D15 O to 59 SD105 Second o SD106 Function description Example When the system time is Changing the system time with the TWR instruction is shown in the following different from the real time figure 110 2004 you can use the TWR 4 TE SO e ep instruction to correct the is Se m time Wm if 111 OS 7 MOV 2004 D10 Note Hoy 7 ns MOV 12 D11 1 The time must use the E MOV 7 D12 Wm o Di MOV 9 D13 SS Gel or the EE 53 l MOV 53 Pi instruction will not be 8 MOV 30 D15 executed MOV 20 J1
119. 0 De mE e OUT Y2 following operation 50000 50000 D LD X3 n gt 00 D2 E LDD lt gt DO D2 50000 50000 14 D 1 12 e mo OUT Y3 50000 50000 15 LD X4 D Dz 2 LDD gt DO D2 OUT Y4 LD X5 LDD lt DO D2 OUT YS Compare DO D1 and D2 D3 and use the comparison result in serial connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 189 gt lt gt Se 6 16 6 Compare Double Integer ORD LAD Za we i DP SD 52 re Applicable to IVC2 IVC1 D lt SD 52 SD 52 SD 52 p SI 52 lt Instruction SD 52 ORD S S3 ORD lt S1 S2 ORD gt S1 S2 ORD lt gt en S3 ORD gt S1 S3 ORD lt O as S2 Program steps o o Operand Type O Applebees elements Sr ONT consen Kx K Km Kns eames o o CT V v 52 ONT Constant el Kny Kati KnS enm esn o so e o Y Operand description Offset addressing TU S1 comparison parameter 1 E LD XO S2 comparison parameter 2 e ae VD ORD DO D2 SC OUT YO Function description 11 LD X1 Compare elements S1 and 100000 20000 ORD lt DO D2 S2 and use the comparison fe oR E OUT Y1 result in parallel connection gt LD X2 with other nodes to drive the ge SE SE G be PS following operation y3 13 LD x3 100000 0000 ORD gt DO D2 n gt DO ne OUT Y3 X4 Y4
120. 0 in the first procedure under certain conditions As shown in the preceding figure the jump is based on a selection branch structure When the program jumps to another procedure all the steps in the original procedure will become invalid As the example shows if the program jumps to step S23 in the second procedure from step S20 in the first procedure step S20 and all the other steps in the first procedure will become invalid IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 211 7 1 6 Execution Of SFC Program 7 2 7 2 1 The similarity between the execution of a SFC program and that of a LAD program is that they both carry out cyclic scanning from up to down and from left to right On the other hand their difference lies in that in a SFC program the steps validity will change according to certain conditions and only valid steps can be executed While in a LAD main program the whole program will be scanned and executed in each scan cycle As shown in the following figure the program on the right is the LAD counterpart of the SFC program on the left When step S20 is valid the T2 timer will be scanned and start timing Steps S21 and S22 will not be executed before T2 counter reaches the preset value and 23 will not be executed when M13 is OFF The S elements state will switch between ON and OFF according to the transfer conditions thus making the program transfer from one step to another When a S element changes
121. 000 10000 YO a Pulses gt IL a Frequency 1000 a Pulses I LI m Frequency 1000 1 When M1 is ON 10 000 pulses will output through YO and Y1 at the frequency of 1000Hz Then the pulse output will stop until MO changes from OFF to ON when the next round of output will start When MO is OFF there will be no output 2 The duty cycle of the pulses is 50 The output is handled in the interrupt mode free from the scan cycle For high frequency output the output duty cycle at Y points is related to the load The waveform at output points YO amp Port 0 Y1 amp Port 1 is related to the load so long as the current does not exceed IVC Series Small PLC Programming Manual the rated load current the smaller the load is the closer the output wave form is to the set operand 3 SM80 amp SM81 controls the ON OFF of the output at YO and Y1 respectively When SM80 or SM81 is 1 the output is ON 4 SM82 amp SM83 are the output monitors of YO amp Y1 respectively SM82 or SM83 will be OFF after the output is complete 5 SD50 the MSB of the output pulse number at YO for PLSY and PLSR instructions SD51 the LSB of the output pulse number at YO for PLSY and PLSR instructions LAD HH AR 6p 52 53 IL PLSR S1 S2 S3 D Operand description S1 maximum frequency Range 10 20 000 Hz When 1 is specified indirectly and i
122. 0010101 52629 rotates rightward for 3 bits SM181 and the result 2 1011100110110010 47538 is assigned to D10 The highest bit Note of the 3 bits is stored into the carry flag SM181 is ON 1 220 2 When S1 uses Kn addressing Kn must be equal to 4 IVC Series Small PLC Programming Manual 120 Chapter 6 Application Instructions 6 7 2 ROL 16 Bit Circular Shift Left Instruction LAD m HH RL S1 IL ROL S D 82 Operand Type st WORD Constant KnX KnY KnM Kns KnLM KnsM D so c Tt v sz int Constant KnX kny KnM kns knim knsm D so c T Operand description S1 Source operand 1 D destination operand S2 Source operand 2 Function description When the power flow is valid the data of S1 will rotate leftward for S2 bits and the result is assigned to D At the same time the lowest bit of the S2 bits will be stored into the carry flag SM181 Note 1 220 2 When S1 uses Kn addressing Kn must be equal to 4 Applicable to IVC2 IVC1 S2 SE Influenced flag bit Cary Program steps Offset addressing Applicable elements Example MO 52629 59082 HH EL D0 Di0 15 Before Rotate leftward 15 bits MSB dn LD MO ROL DOD10 15 Www LSB Aolo olol olele LSB MSB alilijojoj1l1joj1 1 00 1 0 14 0k l When MO is ON DO 2 1100110110010101 52629 rotates leftward for 15 bits and the result 2 1110011011001010 59082 is assigned to
123. 1 MOY 5000 D3000 Moy 1000 D3002 Moy 6000 D3004 ES 2 M Project ll Instruct lt gt IVC Series Small PLC Programming Manual 242 Chapter 9 Using Interrupts 9 7 Power Failure Interrupt When the enable flag of SM56 is set and the main module has detected the power failure the power failure interrupt will be triggered and the user can carry out the relevant processing in the interrupt sub program This function is applicable only to IVC1 series PLC As the power failure interrupt subprogram is executed when the system has no external power supply the execution duration of power failure interrupt subprogram shall not be over 5ms Otherwise the power failure retention component cannot be completely saved 9 8 Serial Port Interrupt Description Serial port interrupt Under the free port protocol mode of serial port the system will generate interrupt event based on the sending or receiving events of serial port For each serial port the system supports 4 interrupt resources for the user The interrupt program of serial port is mainly used when special processing is required for the receiving and sending of character frame at the serial port and timely processing is requested It is able to respond to the processing of completing character frame XMT RCV without being influenced by scanning time Set the ON OFF status of SM component and the serial port interrupt can be enabled or disabled When the serial port inter
124. 1 6 16 9 Compare Floating Point Number ORR Instruction oocccccoccccconccncccncnncnoncnnnnononononcnnnnnnnnnnnnnonnnnncnnnnnncnnonos 192 EE Locating WIS URUICU OMS E 193 6 17 1 Setting Up An Absolute Position System AAA 193 6 17 2 Overview Of Locating Instructions For IVC Series PC 193 6 17 3 Mechanical Diagram Of Absolute Position SySteM oooccccooncnccccccnccnncnnonnncnnononononnncnnononcnnnnnrnnnnnnrnnnnnnnnnnnos 194 6 17 4 Points To Note For Using Locating instructions ZRN PLSV DRVI And DRAN 194 6 17 5 Notes On Servo En e 195 6 17 6 Special Elements Related To Locating instructions ooccccooncnnccoccnccnnnnnnnnnnnnnnnnnnonnncnnnnnnrnnonnronnnnnrnnnnnncnnnnos 195 6 17 7 ZRN Regress To Origin Instruction cccccsecccccsseecceesceccesseeceeceeceueeecseueeecseueeesseeessauseessuseessueeessensessaaes 196 IVC Series Small PLC Programming Manual 74 Chapter 6 Application Instructions 6 17 8 PLSV Variable Speed Pulse Output Instruction ccoccccoccncconnnccnnnconcnononnnononnnonnnonncncnnnnnnonnnnnnnnonnnnnnons 197 6 17 9 DRVI Relative Position Control Instruchon 198 6 17 10 DRVA Control Absolute Position Instruction ooccccoccncconncoccnononnnconnnononnnonnnnconnnonnnnnononononnnnnnnnonnnnnnnnos 199 6 17 11 ABS Read Current Value IASTUCUO DE 199 SC Re Kei edel ane 201 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 15 6 1 Program Flow Control Instruc
125. 1 Source operand 1 Example LD x0 S2 Source operand 2 10 48739 37678 37378 DEE WAND DO Di Di0 WAND D destination operand DO D1 D10 Function description When X0 is ON DO 2 1011011010010011 46739 and D1 When the power flow is valid 2 1001001100101110 37678 will conduct logic AND operation and the result S1 and S2 will conduct logic 2 1001001000000010 37378 is assigned to D10 IVC Series Small PLC Programming Manual 116 Chapter 6 Application Instructions 6 6 2 WOR OR Word Instruction LAD Applicable to IVC2 IVC1 WOR SI S2 D me A Influenced flag bit O IL WOR S1 S2 D Program steps 7 Offset Operand Type Applicable elements addressing S1__ WORD Constant _Knx_ KnY S2 WORD Constant Knx KnY D worp Tel Operand description Example S1 Source operand 1 x0 48739 37878 47039 e WOR DO Di Dio j WOR DO Di S2 Source operand 2 D10 D destination operand When XO is ON DO 2 1011011010010011 46739 and D1 Function description 2 1001001100101110 37678 will conduct logic OR operation and the result When the power flow is valid 2 1011011110111111 47039 is assigned to D10 ST and S2 will conduct logic OR operation and the result is assigned to D 6 6 3 WXOR Exclusive OR Word Instruction LAD Applicable to IVC2 WC HH WR 1 52 re inftuencedfiagbit OOO IL WXOR S1 S2 D Program steps Offset Operand Type Applicable elements addressing KnY KoM Kns KnLM kn
126. 1 and 10000 50 ORR lt DO D2 S2 and use the comparison i OUT Y1 12 Y2 result in parallel connection E LD X2 with other nodes to drive the mm 10000 50 E 50 ORR gt DO D2 following operation em m OUT ve y LD X3 10000 50 ORR lt gt DO D2 RO 1 OUT Y3 X4 Y4 LD X4 E ORR gt DO D2 10000 50 10000 50 Ro OUT Y4 x5 15 LD X5 go 5 e ORR lt DOD2 10000 50 10000 50 Ri DU IG OUT YS Compare DO D1 and D2 D3 and use the comparison result in parallel connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 193 6 17 Locating Instructions 6 17 1 Setting Up An Absolute Position System The absolute position system obtains the absolute position data of the servo motor by detecting the the current position and the total cycle number of the motor PG In this way we can set up an absolute coordinates system of the mechanical position The following figure is a schematic diagram of an absolute position system Servo amplifier Instruction pulse output H Other I O p g Instruction direction output Program scan Clearing pulse output Absolute position communication Zero point data a Servo motor control Backup battery Storing absolute 8 p Absolute position position data detect
127. 10 SPD XO 1000 D10 The time sequence chart of the example program is shown below IVC Series Small PLC Programming Manual 152 Chapter 6 Application Instructions 6 10 9 PLSY Count Pulse Output Instruction LAD J C PLSY Si 52 D IL PLSY S1 S2 D S2 BINT Constant Kox Kny Krm Kns Teen D 807 peor SSES EES ES Operand description S1 specified frequency Hz Range 1 100 000 Hz When 1 is outside this range the system will report instruction operand error and no hardware resources will be occupied Change 1 during the execution of the instruction will change the output frequency in real time S2 output pulse number PLS Range 0 2147483647 When S2 is outside this range the system will report instruction operand error output no pulse and no hardware resources will be occupied When S2 is 0 the pulse will output so long as the instruction is valid If you change S2 during the execution of the instruction the change will be take effect in the next round D high speed pulse output point Range YO Y1 Function description To output specified amount of high speed pulses at the specified frequency For that purpose the load current on the PLC output transistor should be big but below the rated load current Note 1 The PLC must use the transistor output mode 2 When the PLC outputs high frequency pulses the following load current for the PLC output transistor must be
128. 1X3 3 2 4 Storing amp Addressing 32 Bit Data In D amp V Elements Storing 32 bit data in D and V elements The DINT DWORD and REAL data are all 32 bit while the D and V elements are both 16 bit Two consecutive D or V elements are needed to store the 32 bit data The IVC2 series PLC stores the 32 bit data in the Big Endian mode which means the elements with smaller addresses are used to store the higher bits while the elements with bigger addresses are used to store the lower bits For example the signless integer 16 FEA8_67DA is stored in the element DO D1 The actual storing format is TI mem IVC Series Small PLC Programming Manual 56 3 3 3 3 1 3 3 2 Chapter 3 Element And Data Addressing 32 bit data in D and V elements You can use a D or V element to locate a 16 bit data such as an INT or WORD data or a 32 bit data such as a DINT or DWORD data lf a D or V element address is used in an instruction the operand data type determines whethther the data is 16 bit or 32 bit For example In the instruction MOV 16 34 DO the address DO stands for a single DO element because operand 2 of the MOV instruction is of the WORD data type In the instruction DMOV 16 FEA867DA DO the address DO stands for two consecutive words DO and D1 becase operand 2 of the DMOV instruction is of the DWORD data type Data Data Type All instruction operands are of a certain data type There are altog
129. 2 int Constant Knx kny knM kns knim Iesel b so c tT v z y Operand description Example S1 Source operand 1 MO 1939381420 1314258944 LD MO D destination operand HH ISL DO DUU 15 DSHL DO D10 15 1 When MO is ON DO D1 2 01110011100110001001110010101100 1939381420 shifts leftward for 15 bits and the result 2 01001110010101100000000000000000 1314258944 is assigned to D10 When the power flow is valid D11 the data of 7 will shift 2 Please refer to SHL instruction illustration leftward for S2 bits and the result is assigned to D S2 Source operand 2 Function description Note 1 220 2 When S7 uses Kn addressing Kn must be equal to 8 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 127 6 7 13 SFTR Shift Right Byte Instruction LAD Applicable to IVC2 IVC1 IL SFTR S1 D S2 S3 Program steps Offset Operand Type Applicable elements addressing si soa x yim s mim clt y Dp Jeoal jy m stm Tei v 2 INT Constant Knx kny KnM Kns KnLM knsM D sp c t v zi y s3 INT Constant Knx kny knm kns knLM knsm _D so c t v zi y Operand description Example S1 Source operand 1 MO ON OFF LD MO SFTR xO mio 10 3 D destination operand SFTR X0 M10 10 3 S2 Source operand 2 S3 Source operand 3 Function description LI ar Se When the power flow is valid S2 elements starting
130. 2 3 3 Setting Output In STOP State You can set the state of output terminals Y when the PLC is stopped The three optional settings include 1 Disable When the PLC is stopped all output terminals will be OFF 2 Freeze When the PLC is stopped all the output terminals will be frozen at the last status 3 Configure You can decide which output will be ON and which will be OFF when the PLS is stopped according to the actual need IVC Series Small PLC Programming Manual 24 Chapter 2 PLC Function Description You can find the above settings in the Output Table tab of the System block See the Output Table in 2 2 1 System Block 2 4 System Debugging 2 4 1 2 4 2 Uploading amp Downloading Program Downloading The system block data block and user program edited in AutoStation can be downloaded to the PLC through a serial port Note that the PLC should be in the STOP state when downloading If you change a compiled program and want to download it the system will ask you to compile it again as shown in Figure 2 14 ControlStar gt Whether recompilation is needed before the download e without compilation all the previously compiled files will be downloaded Figure 2 14 Re compile prompt LJ Note If you select No the program compiled last time will be downloaded to the PLC which means the changes are invalid If you have set a download password and have not entered it after starting the AutoStation this time
131. 2 data starting with 7 119 LD XO MOY part DT and assign the result to D gt EE MOV 0 D100 unit MOY 0 D100 CRC16 DO 8 D100 i 0 57708 2 The expression for CRC16 ae 5 Ce check algorithm is XM6 X015 X02 1 When X0 is ON conduct CRC16 check on the 8 data starting with DO and Note the result is assigned to D100 1 For the system will bring value of D into the operation each time the instruction is executed make sure to clear D before executing the CRC16 instruction 2 The standard Modbus CRC check requires that the D element checksum be initialized as 16 FFFF and the high low byes 8 high 8 low shall be swapped 3 The data within the checking data zone starting with S2 are stored in byte mode by default That is the high bytes will be taken as 0 and the check result has 16 bits IVC Series Small PLC Programming Manual 176 Chapter 6 Application Instructions 6 13 3 LRC Check Instruction Applicable to IVC2 IVC1 LRC S1 52 D geen flag bit e o Program steps Offset addressing Operand Applicable elements S1 WORD E o m Operand description Example S1 the starting element of the ge MOY en e data to be checked iT S2 the number of the data to TE BANA LD SM1 be checked 2 gt 0 or the GE MOV 16 00 DO system will report operand 51 Mo Se Snor wu 16433 05 MOV 16 22 D2 ie MOV 16 33 D3 D check result MOY 16 44 D4 MOV 16 44 D4 Function description as MOV 16 55
132. 2 port with RS 232 3 line system as the physical interface 2 Supportive of RTU mode and ASCII mode but not of the change of the ASCII ending character 3 Being the Modbus slave station the addresses range from 1 to 31 4 Supportive of broadcast mode The broadcast is effective for write and sub function codes of diagnosis 5 Suppoting baud rates including 38 400 bps 19 200 bps 9 600 bps 4 800 bps 2 400 bps and 1 200 bps Default 19200 8 bits 1 stop bit even check 6 Supportive of data field 2 x 252 bytes ASII mode or 252 bytes RTU mode Supported Modbus Function Code and Element Addressing The slave station supports function codes 01 02 03 05 06 08 15 16 decimal Pay attention to the following points during the reading Relationship between read write element function code and the element YXM SMS TC 06 write single register 4x DZT Word Note 1 O means coil 2 1 means discrete input 3 4 means register 4 xxxx means range 1 9999 Each type has an independent logic address range of 1 to 9999 protocol address starts from 0 5 0 1 and 4 do not have the physical meaning and are not involved in actual addressing 6 Users shall not write X element with function codes 05 and 15 otherwise the system will not feed back the error information if the written operand and data are correct but the system will not perform any operation on the write instruction Relations
133. 23 23 23 LD SM181 D time result storage unit The OUT Y10 result of the time adding LD SM180 operation is stored in the 3 OUT Y11 storage elements designated by D The result will affect the 1 When X10 is ON send the time data to the 3 storage elements starting with carry flag SM181 and the zero D10 D10 D12 and the 3 storage elements starting with D20 D20 D22 flag SM180 2 When MO is ON add the data in D10 D12 and the data in D20 D22 and Function description store the result in the 3 storage elements starting with D30 Add two timetomatdata The 3 The carry flag SM181 will be set to ON and the zero flag SM180 will be operation rules follow the time set to OFF format Note The time data for the operation must meet the time setting range requirements Hour 0 23 Minute 0 59 e Second 0 59 IVC Series Small PLC Programming Manual 138 Chapter 6 Application Instructions 6 9 4 TSUB Subtract Clock Instruction Applicable to IVC2 IVC1 SU ee ED influenced flag bit IL TSUB S1 S2 D Program steps 7 Operand T Applicable element EE eran e ICcable elements P Wa ER addressing a RE ee BEE WE EEGEN RE ee Eee ESA ME ee SE TL E E LALA MRE ESA EA EA AE EAT Operand description psi S1 clock data1 The 3 ERE storage elements designated en St ee DS 29 000 23 hour by S1 are used to store the 59 minute 59 minute Da ssec me IE CS time data If the data is not compliant wit
134. 3244 will rotate leftward for 30 bits and the result 2 00101100111001100010011100101011 753280811 is assigned to D10 D11 The final bit is stored into the carry flag bit SM181 ON 2 Please refer to the ROL instruction illustration DRCR 32 Bit Carry Circular Shift Right Instruction LAD I 4 HH RR 6p IL DRCR S1 D Operand Type Applicable to IVC2 IVC1 Program steps Offset addressing s1 DWORD Constant Knx kny KnM kns vu seul D sp c vw y Applicable elements el y y s2 INT Constant Knx kny KnM kns knLM knsm b so c t v zi v Operand description S1 Source operand 1 D destination operand S2 Source operand 2 Function description When the power flow is valid S1 data and the carry SM181 will together rotate rightward for S2 bits and the result is assigned to D Note 1 S2 gt 0 2 When S1 uses Kn addressing Kn must be equal to 8 Example LD MO MO 30151253244 71220915539 Ly IRR mp D10 11 DRCR DO D10 11 1 When MO is ON DO D1 2 10110011100110001001110010101100 3013123244 and the carry SM181 OFF will rotate rightward for 11 bits and the result 24 00101011000101100111001100010011 722891539 is assigned to D10 D11 SM181 ON 2 Please refer to the RCR instruction illustration IVC Series Small PLC Programming Manual 124 Chapter 6 Application Instructions 6 7 8 DRCL 32 Bit Carry Circular Shift Left Instruction
135. 5 7 Free Port Port 0 Action and function IVC2 IVC1 AAA A 2 This bit is set when XMT instruction is used and is cleared Port 0 transmission after the transmission is over You can manually clear this bit RW J y enabling flag bit to halt the current transmission at Port 0 The transmission can resume when power flow is on again This bit is set when RCV instruction is used and is cleared Port O reception after the transmission is over You can manually clear this bit RW y y enabling flag bit to halt the current transmission at Port 0 The transmission can resume when power flow is on again Port Ot issi SM112 i H This bit is set after the transmission is over R W y y complete flag bit Port 0 ti SM113 ele This bit is set after the reception is over complete flag bit SM114 Port O idle flag bit This bit is set when the port is idle LU Note SM112 SM114 are the flags for the reception complete and idle states in all communication protocols that are supported by PORT 0 For example the PORT 0 of IVC1 PLC supports N N bus Modbus and Freeport No matter which protocol is used the functions of SM112 SM114 remain the same 8 Free Port Port 1 This bit is set when XMT instruction is used and is cleared after Port 1 transmission the transmission is over You can manually clear this bit to halt RW y y enabling flag bit the current transmission at Port 1 The transmission can resume when power flow is on again This bit is
136. 5 MOV 2 D16 2 It is recommended to use o LD X11 the edge to trigger the der me EU execution of the instruction ae D THR So Weg ger Ge SE TRD D20 TED ep 1 Upon the rising edge of X10 write the time setting into the 7 consecutive units starting with D10 D10 D16 2 Upon the rising edge of X11 write the values of elements D10 D16 into the system time 3 When MO is On read the system time and save it into D20 D26 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 137 6 9 3 TADD Add Clock Instruction LAD Applicable to IVC2 WC SE Influenced flag bit IL TADD S1 S2 D Program steps 7 Offset Operand Type Applicable elements addressing A BR RE E AA APRA Ss PLE A EE ee ee WEE E E EE E ER AE EE NEE EC NEE Operand description Ce S1 clock data1 The 3 storage elements designated by S1 are _ T ue 23 Pe 23 hour used to store the time data If D21 58 EL 58 minute the data fs not compliant wit 032 57teecon the time format the system will SS report Illegal instruction 23 DI i LD X10 operano vate 59 nt MOV 23 D10 S2 clock data2 The 3 storage 59 MOV 59 D11 elements designated by S2 are SN Wee MOV 59 D12 used to store another time data 93 Se MOV 23 D20 If the data is not compliant with En MOV 58 D21 the time format the system will Se ge MOV wo DAA report Illegal instruction Ca eg REN TADD DO D20 D30 operand value
137. 6 Application Instructions 133 Applicable to IVC2 IVC1 IL REFF Program steps Operand Type s worn consan ROX K Kom Res kum ks OT SOT CTT Vv Tz Operand description S Input filtering constant o JVC Range 0 64ms Any setting bigger than 64 will be regarded as 64 o WC Range 0 8 16 32 64 Any setting between any two values will be regarded as the smaller value For example a setting between 8 and 16 will be regarded as 8 Any setting bigger than 64 will be regarded as 64 REF Instant Refresh I O Instruction LAD I 4 H REF D 5 Applicable elements Offset addressing Function description Set the input filtering constant of XO X17 Note The input filtering constant is valid only for non high speed input points Example mo LD MO m REF 30 REFF 30 When X10 is ON set the input filtering constant to 30ms Applicable to IVC2 IVC1 IL REF D S Program steps Operand Type Operand description D the starting X or Y element to be refreshed The specified starting element address should always be a multiple of 8 in octal system For example X0 X10 X20 or YO Y10 Y20 S the number of inputs and outputs to be refreshed It should always be a multiple of 8 for example 8 16 256 and so on Function description Generally the PLC will not refresh its inputs or outputs before the user program ends However if you want to refresh the inputs or out
138. 7 GE EE DMOV 300 D108 D r 300 Go MOV 2 D110 g MOV 1 D111 Hoy 2 1110 DMOV 100 D112 WY 1 D111 MOV 3 D114 mov 100 T MOV 1 D115 S LD MO ES DAA HCNT C244 1000 MOY 1 D115 LD M1 0 DHST D100 4 C244 HECHT C244 1000 LD M2 DHST ER 4 ae OUT SM244 SE LD C244 OUT Y10 1 In the first user program scan cycle assign elements D100 D115 with values to generate the table for comparison 2 When MO and X6 are both ON the C244 will count when XO changes from OFF to ON for the input frequency see Chapter 8 Using High Speed I O When C244 changes from 999 to 1000 the C244 contact will be set when C244 changes from 1001 to 1000 the C244 contact will be reset When the C244 contact drives Y10 the execution of Y10 will be determined by the user program scan cycle 3 When M1 is ON and the DHST instruction meets the requirements in the preceding Note the compare will start with the first record The compare with the second record will not start until the first compare is over and the corresponding Y element has been output After the compare with the last record is over the compare with the first record will start again and SM185 will be set SD184 is the SN of the present record and SD182 amp SD183 are the present data for comparison The corresponding output will be immediate regardless of the scan cycle 4 When M2 is ON SM244 is ON and C244 will count down If M2 is OFF SM244 is OFF and C244 will count up 5 When
139. 7 5000 D106 4000 D105 3000 D104 2000 D103 1000 D102 300 D101 200 D100 100 1 The elements with smaller SN are at the right and the elements with larger SN are at the left 2 220 S320 S22 S3 3 When S7 and D both use Kn addressing Kn shall be the same IVC Series Small PLC Programming Manual 6 3 6 3 1 6 3 2 Chapter 6 Application Instructions 89 Integer Math Instructions ADD Add Integer Instruction LAD Applicable to IVC2 IVC1 L emm aD SI S2 D Influenced flag bit Zero carry borrow Can e 5310 7 Operand Type Applicable elements ONSE 8 ek ai addressing Si INT Constant Kox Kry Rai Ros Rn RSM OT SOT CTT V Zz vy HIRT mes em RT II E o Operand description Example S1 Source operand 1 xO 1000 2000 3000 ADD no m1 110 S2 Source operand 2 D Destination operand LD XO ADD DO D1 D10 When X0 is ON add DO 1000 and D1 2000 and assign the result to D10 D10 3000 Function description 1 When the power flow is valid add 7 and S2 and assign the operation result to D 2 When the operation result D is larger than 32767 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set When the operation result is less than 32768 the borrow flag bit SM182 will be set SUB Subtract Integer Instruction LAD Applicable to IVC2 IVC1 m ees SI 52 D Influenced flag bit Zero carry
140. 7704 to D7705 2 D7710 to D7711 5 6 PT E a orzo m orama m D7730 to D7731 IS D asps ree el Drawa Po D7740 to D7741 20 a 22 a D7746 to D7747 23 412 14 D7758 to D7759 29 E a Explanation 1 In mode 1 the D elements distributed to the sending area by 0 station are D7700 and D7701 D7700 and D7701 can be written by the PLC of 0 station and directly read by other stations 1 31 2 In mode 2 the D elements distributed to the sending area by 0 station are D7700 D7701 D7701 and D7703 The elements can be written by the PLC of 04 station and directly read by other stations 1 15 13 IVC Series Small PLC Programming Manual 258 Chapter 10 Using Communication Function Distribution of M element on N N bus single layer network in sending area M1400 to M1415 0 M1416 to M1431 1 2 3 4 5 0 1 siem emr el O menm el e M1624 to M1639 14 47 M1672 to M1687 17 e 9 M1720 to M1735 20 10 M1736 to M1751 M1752 to M1767 iyi M1768 to M1783 M1816 to M1831 Explanation 1 In mode 1 the M elements distributed to the sending area by 0 station range from M1400 to M1415 The elements can be written by the PLC of 04 station and directly read by other stations 1 31 2 In mode 2 the M elements distributed to the sending area by 0 station range from M1400 to M1431 The elements can be written by the PLC of O station and directly read by other stations 1 31
141. AA ARA AAA AAA 217 7 5 1 Simple Sequential Giruchure ccc ceccccccccsccccsececeececeeeeseeeeeseeeeceeeseeeesseeeeseeeeseeessacesseeeeseeeeseueessaeesseeeeseeeeees 217 7 5 2 Selection Branch Structure ccccccccccecceeceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeseeeeeeseeeeeseeeeesseaeeeeseeeeesaeeeeeseeeeesegs 219 729 3 Parallel Branch Structure ii clas Seeerei eege ek ee Eege 222 IVC Series Small PLC Programming Manual 206 1 1 7 1 1 Chapter 7 SFC Tutor Introduction To SFC What Is SFC The Sequential Function Chart or SFC is a programming language developed and got popular in recent years SFC can turn a PLC program into a structured flow chart By using standard programming symbols and grammar compliant with 1EC61131 3 the SFC can divide a complicated operation process into sequential procedures that are linked together with conditioned transfers so as to realize sequence control The SFC edited programs are direct and sequential Each procedure and transfer condition are relatively simple program sections ideal for the sequential control application These advantages explain why it is finding wider application What Is SFC Of IVC Series PLC The SFC of IVC series PLC is a programming language used by Invt IVC series PLCs Besides standard SFC functions the SFC of IVC series PLC can provide multiple nested LAD program blocks The program edited with SFC of IVC series PLC can be converted into LAD or IL program
142. AIN SBRO SBR1 SBRO cyclic calling illegal 3 You can define up to 64 SBRs in a user program 4 You can define up to 16 bit variables and 16 word variables in the local variable table of a SBR 5 When calling a SBR the operand type of the CALL instruction must match the variable type defined in the SBR local variable table The compiler will check the match 6 The interrupts are not allowed to call SBRs SBR Local Variable Table Concept The SBR local variable table displays all SBR interface parameters and local variables both are called variables and stipulates their properties SBR variable properties The SBR variables including interface parameters and local variables have the following properties 1 Variable address Based on the variable data type the software will automatically assign a fixed LM or V element address to each SBR variable in sequence 2 Variable name You can give each SBR variable a name alias You can use a variable in the program by quoting its name 3 Variable type The SBR variables are classified into the following four types IN The IN type variables can transfer the inputs of SBR when the SBR is being called OUT The OUT type variables can transfer the SBR execution result to the main program when a SBR calling ends e IN OUT The IN type variables can transfer the inputs of SBR when the SBR is being called or transfer the the SBR execution result to the main program when
143. AU 20 ZU OFF 24 hour time format or the SEN E lo LD XO system will report operand E z pen TCMP DO D10 MO error TCMPZ D Dig mi TCMP lt DO D10 M1 D comparison status output T o Ne Mn oe Dd ee NW at th put TCHE gt DO Dip M2 TCMP lt gt DO D10 M3 en the data meet the 20 20 ON Z WM TCHP lt gt DO Dio M3 TCMP gt DO D10 M4 comparison condition D is set W e e TCMP lt DO D10 M5 ON otherwise it is set OFF TCMP gt Dd Dip Ma e aja 20 20 OFF Function description TCHP lt D0 Di0 dE EE BIN comparison on Conduct BIN comparison on the time data stored in the elements starting with the time data stored in the DO and D10 and assign the comparison result to MO elements starting with S1 and S2 and assign the comparison result to D IVC Series Small PLC Programming Manual 142 6 10 6 10 1 Chapter 6 Application Instructions High speed I O Instruction HCNT High speed Counter Drive Instruction Applicable to IVC2 IVC1 HCNT Co influenced fag bit OOOO lL HCNT Program steps 17 Offset LR POr _ 3 21 TT TE TE TE EH DINT Constant Kox Kay KaM Kns KaLM KkoSM D e vf Y Operand description Example D Counte
144. Applicable elements addressing 5 TN Constant ex er Ten eg remens OT SOT CTT y a vy o m wms em RI II a Operand description S Source operand D Destination operand Function description 1 When the power flow is valid S is extracted and the operation result is assigned to D 2 When the operation result D is O the zero flag bit SM180 will be set When the operation result rounds off the decimal fraction the borrow flag bit SM182 will be set INC Increment Integer Instruction IL INC D Operand Type ER A ee T a T Note Operand description D Destination operand Function description When the power flow is valid D increases by 1 Note S 2 0 otherwise the system will report operand error and the instruction will not be executed Example AU 1000 31 LD XO Si E SS l SQT DO D10 When XO is ON extract DO 1000 and assign the result to D10 D10 31 Applicable to IVC2 IVC1 Program steps Offset Applicable elements addressing pe Ss E 1 This instruction is a cyclic increase instruction Range 32768 32767 2 The supported range of C element CO C199 Example 0 1001 LD XO IHC DO INC DO When XO is ON DO 1000 is increased by 1 After the execution DO is 1001 IVC Series Small PLC Programming Manual 92 Chapter6 Application Instructions 6 3 7 DEC Decrement Integer Instruction 6 3 8 LAD Him ow o DEC 0 MAA e Operand T
145. C Series Small PLC Programming Manual Chapter 6 Application Instructions 119 6 6 8 DWINV NOT Double Word Instruction LAD Applicable to IVC2 WC EH Influencedfiagbit OOOO IL DWINV 8 mm Program steps l Offset Operand Type Applicable elements addressing a KnS kam el b so c v y D bwormo knYikmmikss kam o lel v y Operand description Example S Source operand x0 2997262396 1207604909 LD XO Se SE 8 Se DWINV DO D10 D destination operand l l l l When XO is ON logic NOT operation will be conducted on DO D1 Function description 2 10110010101001101110011001010010 2997282386 and the result When the power flow is valid 2 01001101010110010001100110101101 1297684909 is assigned to D10 logic NOT operation will be D11 conducted on S and the result is assigned to D 6 7 Shift Rotate Instruction 6 7 1 ROR 16 Bit Circular Shift Right Instruction LAD Applicable to IVC2 IVC1 H ROR SI D S2 Ge Si SS Influenced flag bit Carry flag SM181 L ROR S D S2 Operand description Example LD MO MO 52629 47536 S1 Source operand 1 Kt ROR DO Did 3 ROR DO D10 3 D destination operand S2 Source operand 2 Function description When the power flow is valid the data of S1 will rotate rightward for S2 bits and the result is assigned to D At the same time the highest bit of the S2 bits will be stored into the carry flag When MO is ON DO 2 110011011
146. C output must be transistor output 6 If the corresponding high speed pulse output control D2 rotating direction signal output starting address SM80 or SM81 is ON the contact driven by the Its state is determined by S7 instruction will not be driven by the instruction again e When S1 is positive D2 is ON after the contact turns OFF eo When S1 is negative D2 is OFF Note Function description 1 Pay attention to the configuration of SD84 SD87 1 S1 is stored in the following registers when using this instruction e YO output SD80 SD81 32 bit 2 When the instruction input frequency is smaller than SD84 there will be no high speed output at YO or Y1 When the instruction input frequency is higher than SD85 or SD86 the output will be abnormal O Y1 output SD82 SD83 32 bit 2 When D2 is OFF the value of the current value register will decrease 3 The rotating direction is determined by the positive or negative nature of 7 6 17 11 ABS Read Current Value Instruction LAD Applicable to IVC2 IVC1 ee Ee A EY influenced flag bit IL ABS S D1 D2 Program steps Gperand Type Applicable Glements Ge p P ER addressing eee LOA E ee eee E ee ee ee ee ee eee EENEG APA EL ALA Operand description S the input point from servo The input points occupies three consecutive Xs S S 1 and S 2 or other bit elements D1 output points to servo The output points occupies three consecutive Ys D1 D1 1 and D1
147. CME lt Di Dio NS Function description Conduct BIN comparison on the date data stored in the elements starting with Conduct BIN comparison on DO and D10 and assign the comparison result to MO the date data stored in the elements starting with S7 and S2 and assign the comparison result to D IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 141 6 9 7 TCMP Compare Time lt gt lt gt gt lt Instruction Applicable to IVC2 IVC1 Influenced flag bit S1 S2 TCMP lt S1 S2 TCMP gt S1 S2 TCMP lt gt S1 S2 TCMP gt S1 S2 TCMP lt S1 S2 S Try pp pp eS y y pS Nr D sb y Y D BOL LNS UNI SITTI Program steps Operand description Note S1 starting word element for The time data stored in the elements starting with 7 and S2 must comply with date comparison data 1 the 24 hour system or the system will report operand error For example 24 which occupies the 3 word 10 31 and 13 59 60 are both illegal elements following 7 The Example data must comply with the TE z 24 hour time format or the mow 20 DO system will report operand ga g eg error i LD SMO S2 starting word element for o g d MON 20 ER date comparison data 2 2 DE p Wm 20 ie MOV 1 D2 which OCCUPIES nG 3 word go g ae e MOV 20 D10 elements following S2 The e MOV 30 D11 data must comply with the WI 59 D12 MOV 59 D12 j
148. Chapter 6 Application Instructions 139 6 9 5 HOUR Timing List Instruction Applicable to IVC2 IVC1 E DI D2 5 D1 D2 Influenced flag bit L HOUR S 0 02 EE Offset Operand Type Applicable elements addressing s Nr ensen Knx Kav em KaS es o o e TT Vv Tz oym PT E e dT e e e oa pa v msm e IS IS E Operand description Note S the hour comparison data 1 To sustain the current data after power off set D1 within the element Saving Range 0 32767 Range see 2 2 1 System Block Otherwise the current data will be cleared D1 time storage starting upon PLC power off or when PLC changes from RUN to STOP element D1 hour D1 1 2 The timing still continues even when the alarm output D2 is ON second 3 The hour data in this instruction is a 16 bit integer It will restart from O after D2 alarm output address 32767 When D1 2 S the alarm point Example changes to ON and generates output Mo 1000 LD MO Hm 1000 D100 MOV 1000 D100 Function description mi 1000 o OFF LD Mi HOUR DIOU D200 Mi Make judgment on the time M10 110 IS ie E nee hen the input contact is ON d E on p OUT Y10 unit hour 1 When MO is ON set the comparison data of HOUR instruction 2 When M1 is ON accumulate the time for the input contact 3 M10 will be ON when the accumulated time 2 1000 IVC Series Small PLC Programming Manual 140 Chapter 6 Application Instructions 6 9 6 DCMP Compare Date lt gt lt g
149. D104 914 Hoa oror 0100 EMS D n100 10 PUSH DO D100 10 the stack top unit is the address of D plus the value of D 2 When the value of D reaches S2 one more push instruction will set the operation carry flag SM181 to 1 and the push operation will not be executed 1 When MO is ON push DO into the stack with D100 as the stack bottom 2 Before the execution DO is 1000 D100 is 8 and D109 is O 3 After the execution DO is 1000 D100 is 9 and D109 is 1000 IVC Series Small PLC Programming Manual 6 2 11 FIFO First In First Out Instruction LAD HH FIFO bu IL FIFO D1 D S Chapter 6 Application Instructions 85 Applicable to IVC2 IVC1 Program steps 7 Applicable elements Offset addressing AREA AE WS E We E NEE A WI Tree RI ICI SP INT Constant el Koy Kew Kas mjes o SOT eC fT vz vy Operand description D1 the number of elements in the stack Its element address plus 1 is the address of the stack head D2 storage register for popped value S queue size Function description 1 When the power flow is valid the value of the stack head the element immediately following D1 with D1 as the queue head is assigned to D2 At the same time the value of D1 subtracts 1 the contents of the S units after D1 will move forward and the last unit is filled with O 2 When D1 is O it indicates that the stack is empty the zero flag SM180 will be set 1 Note 1
150. D3 according to high bits and low bits TE 4 The number of registers to be read is 4 Save to D4 D5 according to high bits and low bits EST ele 5 The received data is saved to D100 6 If the receiving is completed set SM135 add 1 to EST SM135 D200 STE 7 If the communication fails set SM136 add 1 to m MODEVS i D201 and save the error code to D202 8 SM124 is the idle flag of the communication port SM13535 H IHL D200 SEI INC D201 MOY 50139 Dee 10 5 N N bus Communication Protocol 10 5 1 Introduction N N bus is a small PLC network developed by Invt Auto Control Technology Co Ltd The physical layer of N N bus uses RS 485 so the PLC can be directly connected through communication port 1 or connected through communication port 0 by RS 232 RS 485 converter The connected PLC of N N bus can automatically exchange the values between D elements and M elements which makes the access to the other PLC elements on the network as convenient as accessing its own element In N N bus the data access between PLCs is completely equivalent N N communication network It is convenient to configure N N bus Most parameters of N N bus only need to be configured on No 0 PLC In addition N N bus supports online modification of the network parameters and is able to detect the newly added PLC automatically If any PLC is disconnected from the network the other PLCs will continue to exchange the data It is also able to monitor the co
151. D5 Mow JD DS MOV 16 66 D Conduct LRC check on the om MOV 16477 D7 S2 data starting with the S7 WS Ze pe LD MO j 119 and assign the result to D wo ENN e MOV 0 D100 Note e LRC DO 8D100 WON 1100 1 For the system will bring s e value of D into the operation LEC D0 a D100 each time the instruction is executed make sure to clear D before executing the LRC instruction 2 The data within the checking data zone starting with S2 are stored in byte mode by default That is the high bytes are taken as 0 and the check result has 8 bits and is stored in the low bytes of D When X0 is ON conduct LRC check on the 8 data starting with DO and the result is assigned to D100 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 177 6 14 Enhanced Bit Processing Instruction 6 14 1 ZRST Batch Bit Reset Instruction Applicable to IVC2 IVC1 ZRST D m e a Influenced fiag bit L ZRST Program steps 5 Offset Operand Type Applicable elements addressing gt pa YT spy er fT s Nr fensa k Ray km es kn esn o o 0 ft a 3 Operand description Note 1 When a C element is reset the counting value in it will also be cleared 2 When a T element is reset the timing value in it will also be cleared D destination operand S source operand Function description Example i SMO OFF LD SMO When the power flow is valid EE a SE dae ae reset S bit elements starting
152. DO hexadecimal save to D2 D3 according to high bits and low bits 4 The number of registers to be read is 18 Save to D4 D5 according to high bits and low bits 5 The received data is saved to D100 6 If the receive is completed set SM135 add 1 EST SR to D200 15 EST SKS 29124 7 If the communication fails set SM136 add 1 A MODEUS 1 to D201 and save the error code to D202 8 SM124 is the idle flag of the communication INC D200 port THC D201 MOY 50133 D202 IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 255 Example 3 IVC2 is the Modbus master station as well as the slave station Read the status of the bit element with the protocol address ranging from 40 to 43 of No 5 station The read data are as follows The received frame starts from D100 D100 is for saving address D101 is for saving function code D102 is for saving the number of registers Units beginning with D103 are for saving the read value of bit element 40 element 40 element 41 element 41 element 42 element 42 element 43 element 43 element high bits low bits high bits low bits high bits low bits high bits LSB D103 D104 D105 D106 D107 D108 D109 D110 SMi MOY HOY mon 1 The program has designated 5 as the address of MOV the slave station to be accessed save to DO 2 The program has designated 3 as function code MOV save to D1 3 The starting address of the register to be read is 40 save to D2
153. DSUB Subtract double integer instruction Borrow Increment Increment integer instruction instruction e E ee ee onto o CA IA CA E DEE double DDEC Decrement double iniegerinsiucion 21 v_ v 6 integer math E E E E E a EE DoW Divide double integer nsr 21 Ill VAS integer abslue value nstuaion 8 pue Double niger absolute value sici n 7 NES reae meann PP a DNES Negative double ntegerinsueion 7 v_ v_ 97 Sar Sauarerootinigerinsivcions 5 vvo DSQT Square root dorbi integer instruction 7 ___ Y Y SUM Suminiegerinsiuaion e z Ill EE RADO Ad ating point rumberinsivcion 10 zeg v v o zap Subretfoaing point number instucion 10 Zero Cany Y v 100 mt Maty foaire pont romber nsrueion 10 Ze Cary Y IO E Floating point number absolute value instruction Floating point number absolute value RNEG J P T 102 Floating point E JP Square root floating point number number math Zero i instruction instruction EC EE EE 005 Fisting point number COS nietos 7 es EE IRAN etaman na II S eco S a y e Floating point number EXP instruction point number EXP instruction Ge 108 EE oint number exponentiation instruction RSUM Sum floating point number instruction E aen ME E el IVC Series Small PLC Programming Manual d les NI ol ai N H 298 Appendix 10 Classified Instruction Index Program EE fla WAND AND word instruction WEEK E EEN WOR
154. FC Validate step 50 in the first scan cycle of the user program Figure 4 3 Example of SFC IVC Series Small PLC Programming Manual 4 2 4 2 1 4 2 2 4 2 3 4 3 4 3 1 Chapter 4 Programming Concepts 47 Program Components The program components include user program system block and data block You can change these components by programming User Program A user program is the program code composed by users It must be compiled into executable instruction list downloaded to the PLC and executed to realize the control function The user program comprises three Program Organization Units POU main program MAIN subprogram SBR and interrupt INT Main program The main program is the main body and framework of the user program When the system is in RUN state the main program will be executed cyclically One user program has only one main program Subprogram A subprogram is a program independent in structure and function It can be called by other POUs Subprograms generally have call operand interface and are executed only when being called A user program can have random number of subprograms or no subprogram at all Interrupt An interrupt is a program section handling a specific interrupt event A specific interrupt event always corresponds to a specific interrupt Upon the occurance of an interrupt event a ordinary scan cycle will be interrupted The system will run the corresponding interrupt un
155. HCNT the PWM instruction must meet the system s requests on high speed I O Example Ad OFF Fun 40 200 YO OFF Ful 40 200 1 LD MO PWM 40 200 YO PWM 40 200 Y1 Where t is the pulse width and TO is the pulse cycle 1 When MO is ON YO and Y1 output PWM pulses with the width of 40ms and cycle of 200ms When MO is OFF the output will stop The output state is not affected by the scan cycle 2 SM80 and SM81 control the output ON OFF of YO and Y1 respectively When SM80 and SM81 are ON the output will stop 3 SM82 and SM83 monitor the output of YO and Y1 respectively When MO is OFF SM82 and SM83 are OFF IVC Series Small PLC Programming Manual 6 11 Control Calculation Instruction 6 11 1 PID PID Instruction LAD m PID en 52 53 Chapter 6 Application Instructions 157 Applicable to IVC2 IVC1 P influenced flag bit Oooo l PD sy e em EE Offset Operand Type Applicable elements addressing Operand description D calculation result output after the program is executed MV S1 preset value SV S2 current value PV S3 sampling time Ts Range 1 32767 ms It must be set bigger than the calculation time S3 1 action alarm and thresholds setting Value and meaning Process Value alarm disabled Output value alarm Output value alarm disabled enabled Reserved Output threshold Output threshold setting s
156. I HH DSUB Si 52 D IL DSUB S S2 D Operand Type Applicable elements Offset S1 ONT Gonstant Kax Kny Ka Kns Komes D s9 0 VW fv Kox Kny kom Kns KniM KasM o 50 e v gt E ow Aa a E ETE A A Operand description Example S1 Source operand 1 GN 100000 200000 100000 S2 Source operand 2 ele Ga SR D Destination operand LD XO DSUB DO D2 D10 When XO is ON the value 100000 of DO D1 subtracts the value 200000 of D2 D3 and the result 100000 is assigned to D10 D11 Function description 1 When the power flow is valid S1 subtracts S2 and the operation result is assigned to D 2 When the operation result D gt 2147483647 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set When the operation result lt 2147483648 the borrow flag bit SM182 will be set 6 3 12 DMUL Multiply Double Integer Instruction LAD Applicable to IVC2 IVC1 Influenced flag bit Zero carry borrow HH m SD 52 D IL DMUL S S3 D Program steps Applicable elements Offset Si DINT consan KX Knv Km eg pemk BD 80 0 VW v 52 DNT Constant Kox Ky Kom Kns knim ksm o f 80 0 VW fv ES met Aer TAE TEST IE ESAS Operand Type Operand description S1 Source operand 1 S2 Source operand 2 D Destination operand Function description When the power flow is valid 7 multiplies S2 a
157. IVC Series Small PLC Programming Manual Version V1 0 Revision date Nov 26 2011 Invt Auto Control Technology provides customers with technical support Users may contact the nearest Invt local sales office or service center Copyright 2011 by Invt Auto Control Technology Co Ltd All rights reserved The contents in this document are subject to change without notice Invt Auto Control Technology Co Ltd Address 4 INVT Building Gaofa Industrial Park Longjing Nanshan District Shenzhen China 518055 Homepage www Invt com cn E mail ethan Invt com cn Prologue Target reader This book is suitable for the automation personnel who need to master the PLC programming system design and commissioning This book can also serve as a reference for anyone who are interested in futhering their PLC programming knowledge Content of this book This book details the principles hardware resources programming languages and instructions of the IVC series small PLC A variety of application illustrations are used to help you understand the rich functions of the PLC Features of this book The chapters in this book develops from general to details each having its independent topic You can either read thoroughly to gain overall knowledge of the IVC series small PLC or consult in some of the chapters for technical reference Reading instructions 1 For readers unfamiliar with PLC It is recommended to start with chapters 1 4 to learn
158. Instruction LAD Applicable to IVC2 WC HH DSR GI D 62 PTO TO ienai IL DSHR S1 D S2 Program steps Offset Operand Type Applicable elements addressing S1 DWORD Constant Knx kny knm Kns knLM Knsm D so c v y D pword _ kny knm kns knim Jo c viii s2 int _ Constant knx kny Kam kns knLm knsm D sp c t v z v Operand description Note S1 Source operand 1 1 2 20 D destination operand 2 When S7 uses Kn addressing Kn must be equal to 8 S2 Source operand 2 Example Function description MO 1939381420 1893927 LD MO E 2 He ds DSHR DO D10 10 When the power flow is valid the data of 7 will shift rightward for S2 bits and the result is assigned to D 1 When MO is ON DO D1 2 01110011100110001001110010101100 1939381420 shifts rightward for 10 bits and the result 2 00000000000111001110011000100111 1893927 is assigned to D10 D11 2 Please refer to the SHR instruction illustration IVC Series Small PLC Programming Manual 126 Chapter 6 Application Instructions 6 7 12 DSHL 32 Bit Shift Left Instruction LAD Applicable to IVC2 IVC1 DSHL Kr D S2 os oy AI wnftuenceatagbit O O IL DSHL S1 D S2 Program steps Operand T Applicable element isel eran e icapie elements j EE ER addressing S1__ DWORD Constant KnX kny knM kns knim knsm D so c v y b oword kny km kas knim pl co viii S
159. MO or MOV 137 K2MO After executing the instruction the result is peen O OO O O TL Points to note If the destination operand uses the Kn addressing mode while the data to be stored is longer than the length of the destination operand the system will keep the lower bits and discard the higher bits For example Execute instruction DBITS 16 FFFFFFFO K1MO After executing the instruction the operand 2 K1M0 should store the calculation result 16 1c 28 However the K1M0 is only 4 bits wide which is not enough for 16 1c By discarding the higher bits the actual operand 2 is K1MO 16 c 12 Z Addressing Mode Offset Addressing Mode Concept The IVC2 series PLC provides the Z addressing mode or offset addressing mode You can use the Z elements offset addressing register to get indirect access to the targe elements Z addressing method Targe address Basic element address Address offset stored in Z element For example In the offset addressing mode for DOZO ZO 3 the target address is D3 because DO is the basic address and the offset address is stored in element ZO which in this case is 3 Therefore when ZO 3 the instruction MOV 45 DOZO is equal to MOV 45 D3 in effect because in both cases the D3 is set as 45 by the instruction IVC Series Small PLC Programming Manual Offset addressing example 1 Bit element offset addressing example LD M01 MOV 6 Z1 SFTR X0Z1 MO 8 2 The
160. MP Compare date lt gt msructon 7 IL Teme Compare time instrueion TT TOMP gt _ Compare times instruction TTT w ee BEES instruction ones compares TO TEMPS Compare times instruction OT TY A NI ll Ny zl IVC Series Small PLC Programming Manual
161. Manual 198 Chapter 6 Application Instructions 6 17 9 DRVI Relative Position Control Instruction LAD HU mi Gu 52 D1 D2 IL DRVI S1 S2 D1 D2 Operand Type sr BINT Constant Rox kv em ns enes o o e TV 2 ONT Constant o eom Kos kamen o 50 0 v KE EW E KEE Operand description S1 output pulse number relatively specified 32 bit instruction 999999 999999 S2 output pulse frequency Hz 32 bit instruction 10 100000 Hz D1 high speed pulse output starting address YO or Y1 D2 rotating direction signal output starting address Its state is determined by S1 e When S1 is positive D2 is ON e When S1 is negative D2 is OFF Function description 1 S1 is stored in the following current registers e YO output SD80 SD81 32 bit O Y1 output SD82 SD83 32 bit 2 When D2 is OFF the value of the current value register will decrease 3 The rotating direction is determined by the positive or negative nature of 7 Applicable elements y y E AAA EA Applicable to IVC2 IVC1 Influenced flag bit Zero Carry Borrow Program steps Offset addressing 4 Changing the operands during the execution of the instruction will not take effect until the next cycle when the instruction is executed again 5 During the execution of the instruction the output will decelerate to stop when the driven contact turns OFF The exection completion flag SM will not act then 6 If th
162. Manual Chapter 6 Application Instructions 169 6 12 8 IVWRT FREQUENCY CONVERTER Write Single Register Value Instruction LAD Applicable to IVC1 FA t tery ei ei wgsegeentgenl IL IVWRT S1 S2 S3 S4 Operand Type Applicable elements Ge d K ER addressing pet E EEN AA E E ON ES Mero ear NEE E ESE E A A Pa EE TE E ee a a Operand description Example S1 designated communication channel channel 1 dE noy j DO S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 IVWET i 1 m0 S3 register address LD M S4 register value MOV 4 DO Function description IVWRT 1 1D10 1 1 Set the serial port and drive address input the 1 Set the serial port 1 and drive address 1 input the register address and register value and the register address 1 digital frequency control and corresponding register will be assigned with the set register value 1 disable frequency saving upon value through communication in the Modbus protocol power off and write the value into the corresponding 2 This instruction is executed upon the rising edge register through communication in the Modbus mode 2 After the drive receives the data it will conduct CRC check address check and instruction check and set the communication completion flag SM135 after the communication lf there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 I
163. Name Variable Type Data Type TEMP BOOL Comment ii Program block f K io MAIN lt a pj ZAutotzo 2 o XAutoSet Al INT 1 Record the high speed interrupt completion times E Global variable table Datablock SHO la System block EE INC D17 E 3 Cross reference table Element monitoring table ei EMT_1 EI 3 Comm equipment connecti P Configuration table i INT 1 Author Interrupt PTO YO Output complete interrpution Inte A event E 2 Program name Program description w E gt Project Man i Instruction lt 2 Code function in main program Enable the global interrupt of the system and the enable flag SM63 of PTO output interrupt Use PLS instruction Project Manager AX 3 MAIN i Y INT 1 d Altlsl a 4 9 6 ame Bib b FA Ze ep TEMP BOOL LD ly XAutoGo i TEMP BOOL IO XAutoSet TEMP BOOL v io INT 1 Global variable Datablock System block Cross reference Ip Element monitor ERT 1 Ea Comm equipment B Configuratio Variable addr Variable Name Variable Type Data Type Comments SMO A OEI Set SM63 ON to enable the high speed output completion interrupt SMO DIER ememr gt Note Make sure the parameters haye been initialized before using the PLS instruction Ml H PLS 3000 3 YO Wote Use it once upon power on If the envelope parameters are change it should be used again SM
164. O Y4 Pe ho DI bo DI a ta b i DO bet 4 e un gt Rei bei Kal in tJ Mil rse jogForward locabsolute poLocating Forward com everse loc Stop buttonZero returnForward jogReve tin uttonn ating sition plete g button button b un m Wel Lod Ka LI M24 Y n gt KN LJ un D 1 fod E Pp bo Lo LJ DRVA 200000 5000 YO Y4 IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 205 Chapter 7 SFC Tutor This chapter introduces the basic concepts and programming methods of Sequential Function Chart SFC In addition the points to note during the programming is also introduced e VOC OR WW e EE 206 CATE a EA E E 206 71 2 Wha tls gt F6 Ol IVG Semmes PLE A a O E E 206 A A 206 71 4 Programming symbols ele Ther Usage a A dai 206 TLO SOFC Program Kr ler Te 207 10 EXeCullon O ESF Progra E 211 7 2 Relationship Between SFC Program And LAD Program 211 E ER Ee Ee Bee e D et 211 T 2A E VIASTUCUON EE 212 1 2 3 RET Instruction And SEC Program SECOM aid ii A A eed AS 212 2 OUT Instruction And RST IMSMUCUOM EE 212 7 2 5 SFC Selection Branch Parallel Branch And Merge aannnannnannnnnnnnnnnnnnnnnnnnnrnnrrsnrrsrrrsnrrnnrrsrrnenrnenrnenrnerreenns 212 TOW LOTO AMAS dd e do la lo ol dl a e e ON 212 TA Fons To Noten SEC Program a dol o e la dl dd 213 TAT GOMmmMOn PIOGramminG EMOS asii A A AS 213 AZ Progamm CKS ia Aa 215 To EXamples OF SFE ee el e le e iS AAA AAA
165. ORwordinstucton Te Mora o TOR daa vos 2 struction WEE Exclusive OR wordinstruction 17 instruction DWXOR Exclusive OR double wordinstruction 10 YN Y e WN NOT word instruction Ter Dwn NoT double word Instruction TT e ROR t6 bitoicularshftightimstucti n 7 Camy Y Y m DROR 32 bitoicular shiftightimstucti n 9 Camy Y Y 2 ROL Droe teacher 7 Camy Y Y a DROL_ 32 bitoicular teacher 9 Camy Y Y 13 ROR Denter circular shittrightinstruction 7 Camy Y Y wr DROR 32 bitcany ocular shiftightinstruction 9 Camy Y Y 128 Shift rotate ROL 16 bit cary croular shitet instruction 7 Cay Y Y 22 SAR Fe itshiftrigntwordinstruction TS DSHR S2 bitshiftrigntinstucton Te SAL etsem Te Den s2cbitshiftietinstucton Tee ST Shiftlettbyteinstwuoton II a SFTR Smtrorbyemsuton 9 O AY 7 DECO Decode mstruetion TST A Y a E E Enhanced bit oe logic Counting ON bit in double word DBITS instruction instruction ZRST Batch bit reset instruction bit reset instruction EA 17 ZSET Set batch bit instruction ee ES HCNT High speed counter drive instruction DHSCS High speed counting compare set instruction High ti t DHSC ig bere counting compare rese 40 145 instruction DHSCI migi Speg counting compare interrupt 10 d y 444 trigger instruction DHSZ EE counting zone compare 13 y y 146 instruction SCH SE DHST ER counting table compare 40 y y 147 I O instruction instruction DHSP H
166. Operand description Example S Source operand x0 20000 3 10000 20 EVAES D0 nid D Destination operand LD XO Function description RVABS DO D10 When the power flow is valid get the absolute value When X0 is ON get the absolute value 10000 2 of ofS and assign ine value to 1D DO D1 and assign the result to D10 D11 RNEG Negative Floating Point Number Instruction LAD Applicable to IVC2 IVC1 at meso rn z arr IL RNEG S D Program steps 7 Offset addressing pS RE AA O pe pere TE ACTI IST E LAA AAA Operand Type Applicable elements Operand description Example EES x0 10000 20 10000 2 D Destination operand ENRG 00 Dio Function description LD XO When the power flow is valid get the negative value RNEG DO D10 of S and assign the result to D When XO is ON get the negative value 10000 2 of DO D1 and assign the result to D10 D11 IVC Series Small PLC Programming Manual 6 4 8 SIN Floating Point Number Sin Instruction 6 4 9 LAD SIN O IL SIN S D Chapter 6 Application Instructions 103 Applicable to IVC2 IVC1 Program steps 7 Offset addressing Applicable elements ES pere TT TITS LL APOLO ES rr Pl OE E LAI LCAYT 1 73 Operand description S Source operand D Destination operand Function description 1 When the power flow is valid get the SIN value of S unit radian and assign the result to D 2 When the oper
167. PLC state information through the AutoStation including the system error and user program execution error In the main interface of AutoStation click PLC gt PLC Info to check the PLC information as shown below PLC Info Version CPU type Version number Scan rate as Current Maxinimum value Minimum value Run error information Sytem error no 0 System error description No system error Execution error no 0 Execution error description No execution error Program capacity Program capacity 12K steps Battery voltage Voltage 3 0 Running status indication Status indication Module no Module type Input Output Version Figure 2 17 PLC information The System error no is the No of the system errors stored in SD3 and Execution error no is the No of the execution error stored in SD20 The error description is for your reference IVC Series Small PLC Programming Manual 26 Chapter 2 PLC Function Description 2 4 3 Editing User Program Online You can use the online edit function when you want to change the user program without stopping the PLC LJ Warning On occasions when casualties or property loss may occur the online program editing function should be used by professionals with sufficient protection measures Method After making sure that the PC PLC communication has been setup and the PLC is in RUN state click Debug gt Online Edit in the AutoStation main interface to ente
168. RC check code Number of elements to read Starting address The decimal value of 07D0 is 2000 Function code Station No 10 4 7 Modbus Slave Modbus slave responds to the master station according to the received message of local address rather than sending out message actively The slave only supports Modbus function codes 01 02 03 05 06 08 15 and 16 The other codes are illegal function codes except broadcast frame IVC Series Small PLC Programming Manual 250 Chapter 10 Using Communication Function 10 4 8 Reading amp Writing Elements All the function codes supported by IVC2 except 08 are used for read and write of the element In principle in one frame there are 2000 bits and 125 words for reading 1968 bits and 120 words for writing at most However the actual protocol addresses for elements of different types are different and discontinuous e g Y377 s protocol address is 255 X0O s protocol address is 1200 Therefore when reading or writing an element the element read for one time can only be the same type and the maximum number of the read elements depends on the elements of this type that are actually defined For example when reading element Y YO Y377 256 points in total the protocol address ranges from 0 to 255 the corresponding logic address of Modicon data is from 1 to 256 and the maximum number of elements Y that can be read is 256 The examples are as follows 1 XMT from master station 01
169. RSUB Subtract Floating Point Number Instruction 6 4 3 Chapter 6 Application Instructions LAD e RSB eil 52 IL RSUB ST S3 D Operand Type Applicable to IVC2 IVC1 Influenced flag bit Zero carry borrow Program steps Offset addressing Applicable elements Es Pret AA ES Pet TE OIL CO PO per er Tr LL EI E TA Y APS Operand description S1 Source operand 1 S2 Source operand 2 D Destination operand Function description 1 When the power flow is valid S2 is subtracted from ST and the operation result is assigned to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is O the zero flag bit SM180 will be set RMUL Multiply Floating Point Number Instruction LAD I HH RML 52 IL RMUL em S2 Sr REAL corse SS REAL Constant o pa E Operand description ST Source operand 1 S2 Source operand 2 D Destination operand Function description 1 When the power flow is valid 7 multiplies S2 and the operation result is assigned to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set IVC Series Small PLC O po Example 0 10000 2 2000 500 12000 7 RSUE D0 UE Dio LD XO RSUB DO D2 D10
170. S Source operand O 1000 1000 LD XO D Destination operand LS HEG 1 my NEG DO D10 Function description When X0 is ON get the negative value of DO 1000 and assign the result to When the power flow is valid get D10 D10 1000 the negative value of S and assign the result to D Note The range of S shall be 32767 32767 When S is 32768 the system will report operand error and the instruction will not be executed 6 3 10 DADD Add Double Integer Instruction CAD AI 9 o 1 EC CDD e e m Program steps mn ER Sr ONT forsan K R SIESS E A e Drees er AA Operand description Example x0 100000 200000 300000 LD XO S1 Source operand 1 a e Ge DADD DO D2 D10 2 Source operand 2 When X0 I ON add the value 100000 of DO D1 and the value 200000 D destination operand of D2 D3 and assign the result to D10 D11 D10 D11 300000 Function description 1 When the power flow is valid add S1 and S2 and assign the operation result to D 2 When the operation result D gt 2147483647 the carry flag bit SM181 will be set When the operation result is O the zero flag bit SM180 will be set When the operation result lt 2147483648 the borrow flag bit SM182 will be set IVC Series Small PLC Programming Manual 94 Chapter 6 Application Instructions 6 3 11 DSUB Subtract Double Integer Instruction LAD Applicable to IVC2 IVC1 Influenced flag bit Zero carry borrow Program steps
171. SB RS232 converter Invt dedicated PLC programming cable 1 2 2 AutoStation Installation The AutoStation installation package issued by Invt Auto Control Technology Co Ltd for short Invt is an executable program Double click it to start the installation and follow the prompts step by step You can select an installation path according to your actual need After the installation the Invt Auto Control Technology program group will be added to the start menu A AutoStation shortcut icon will also be added to the desktop You can uninstall the AutoStation software through the Windows Control Panel To install a new version AutoStation you have to uninstall the present version first 1 2 3 AutoStation Operation Interface The main interfaces include 7 sections Menu Tool bar Project Manager window Instruction Tree window Information window Status bar and Operation area C Auto Station MAIN File Edit View Ladder PLC Debug Tool Window Help 10 de vi AA aalan 4e m e HE Ha t A HARRY eH SO 0 0 mR gt be Project Manager DS MAIN EE Sn d g 11 A Variable addr Variable Name Variable Type Data Type Comments Ei Program block CR TEMP BOOL e GH TEMP BOOL E INT_1 E Global variable c Datablock E a System block Cross reference lq Element monitor Operation area e EMT_1 Va Comm equipment Configuratio Instruction tree Output Window Information window alali Compite K Communicati
172. Source operand Function description 1 When the power flow changes from ON to OFF trailing edge the designated timer T D will start timing 2 When the power flow is OFF if the designated timer T has started timing it will keep timing until the timing value reaches the preset value S The timing coil output of the T element will be OFF and the timing value will maintain at the preset value 3 When the power flow input is OFF if the timing has not started the timing will not start 4 When the power flow is ON the timing will stop the timing value will be cleared and the timing coil output is ON Example MO e LD MO e TOF TI 5 TOF T1 5 Ti YO LD T1 Eeer OUT YO Sequence chart of example T1 timing coil T1 timing value T1 0 IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 67 5 4 4 TMON Monostable Timing Instruction 9 0 9 9 1 LAD Applicable to IVC2 IVC1 Co Program steps 8 Operand Type Applicable elements Glen j W ER addressing E lr po pr pp Or ms emie zial er vi 2 7 Operand description Example D Destination operand MO OFF LD MO S Source operand pee i TMON T1 5 Ve We LD T1 er Lt 3 Function description OUT YO 1 When the input power flow changes from OFF to ON Sequence chart of example rising edge and the timing has not started the designated timer T D will start timing based on the current value In the timing status whose length is determi
173. T ESET SE T A ee eee 8 Floating point number absolute value instruction A ow SFC state shift Shift left byte instruction ala Ou O NO N N Wu ech ech NO N 6 bit shift right word instruction loating point number SIN instruction Zero z O oO MEN al SQT Square root integer instructions STL STOP SFC state load instruction User program stop Zero Carry SUB Subtract integer instruction A Borrow SUM Sum integer instruction Zero SWAP Swap bytes TADD Add clock instruction TAN Floating point number TAN instruction TCMP lt TCMP lt TCMP lt gt TCMP TCMP gt TCMP gt TMON Cal o Oo Go j A Zero Carry O Zero Carry Compare time lt instruction Compare time gt instruction gt gt Compare time lt gt instruction gt Compare time instruction Compare time gt instruction gt gt Compare time gt instruction Monostable timing instruction 2 N Read word from special module buffer register instruction ay oO A TOF ON TONR TRD TRIANGLE TSUB TWR ABS RRD WAND DT WINV WOR WSFL WSFR WXOR XCH Exchange word instruction XMT Free port sending XMT instruction ZRN ZRST ZSET Off delay timing instruction On delay timing instruction On delay remember timing instruction Read real time clock instruction ala O Or CA Triangle wave signal output instruc
174. The address of the slave station is 01 the last two bytes are CRC check code and the second byte 1s function code 10 4 9 Handle Of Double Word The current count value of C element is word or double word The value from C200 to C255 are double words which are read and written through the function code 03 16 of the register Every two registers correspond to a C double word Only the pair can be read and written from into register upon reading or writing For example read the RTU frame of three C double word elements from C200 to C202 01 03 25 E4 00 06 SE F3 o CRC check code Number of elements to read 6 Starting address 9700 Function code Station No In the returned data 9700 and 9701 are two addresses for the content of C200 9700 is the high 16 bits and 9701 is the low 16 bits When reading the double word if the starting address read is not even number then the system will respond with error code of illegal address if the read number of registers is not an even number the system will respond with error code of illegal data For example IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 251 XTM from master station 01 03 25 E5 00 04 5E F2 The starting address for the reading of master station 4 word elements of 25 E5 decimal 9701 Response of slave station 01 83 02 CO Ei Response of slave station illegal data address XTM from slave station 01 03 25 E4 00 05 CE F2 The starting a
175. This bit is reset automatically when the system error is removed General module bus error flag bit 1 This bit is set and the system raises an alarm when a special module bus operation error occurs 2 This bit is reset automatically when the system error is removed Special module bus error flag bit 15 Real Time Clock Error Flag Addr This bit is set upon real time clock error R W of real time clock error This bit is automatically cleared if system fault is y y removed 16 EEPROM Flag SM196 EEPROM write OK flag This bit is set wnen EEPROM is not being written OOR Am 3 IVC Series Small PLC Programming Manual 268 Appendix 1 Special Auxiliary Relay 17 Counting Direction Of Bi directional Counters Counter adr vez p ve C200 RW C203 RW C206 RW C208 RW RW ER RW When SM2 _ _ is of high level the corresponding y C2__ becomes a down counter R C218 When SM2 _ is of low level the corresponding C2__ becomes a up counter z z W W W W W W W W W RW W W W W W W W W RI ses RI w IVC Series Small PLC Programming Manual 18 Counting Direction And Monitoring Of High Speed Counter Type Single phase single point counting input Single phase bidirect ional counting input AB phase counting input Appendix 1 Special Auxiliary Relay 269 SM236 C236 SM237 C237 SM238 C238 SM239 C239 SM239 C239 The high amp low level of SM2 _ _ corresponds to the
176. VC Series Small PLC Programming Manual 170 6 12 9 Chapter 6 Application Instructions IVRDST FREQUENCY CONVERTER Read Status Instruction Applicable to IVC2 IVC1 Program steps Jm Offset addressing LAD k H IVRDST Gi 52 53 D1 IL IVRDST S1 S2 S3 D1 Operand Type ca li era EA gt TP o LL ee Applicable elements RER KH EE ee WEE EE HE ee ee ee ECH E AAA LEE STE EEE OEA Operand description ST designated communication channel channel 1 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 S3 status information selection 0 Running status word Output voltage Actual operation value 5 Running speed in the current main setting Operation fault 2 Drive model p n Output current D1 storage address of the returned status information Function description 1 Read the FREQUENCY CONVERTER status information through communication in the Modbus protocol 2 This instruction is executed upon the rising edge Example Mi e IVEDST 1 1 1 D LD Mi IVRDST 1 1 1 DO 1 Set the serial port 1 drive address 1 read status information selection 1 actual running value in the current main setting and set DO as the storage register for the returned status information Read FREQUENCY CONVERTER status information through communication in the the Modbus protocol 2 After the drive receives the data it will conduct CRC check address check and inst
177. VC1 and IVC2 series PLCs You can download it at www invt com cn A The AutoStation software is a Windows based diagram programming tool operated through the mouse and keyboard Three programming languages are available ladder diagram LAD instruction list IL and Sequential Function Chart SFC To connect the AutoStation programming platform to your PLC you can use directly the serial port programming cable or the Modbus network through serial port conversion or the Internet through a modem Refer to the AutoStation Programming Software User Manual for the Modbus programming and remote monitoring 1 2 1 Basic Configuration AutoStation programming software requires an IBM PC and Microsoft Windows series OS The compatible OSs include Windows 98 Windows Me NT 4 0 Windows 2000 and Windows XP IVC Series Small PLC Programming Manual Chapter 1 Product Overview 5 The minimum and recommended configuration of the PC are listed below Table 1 2 Computer requirements CPU Intel Pentium 233 equivalent or above Intel Pentium 1G equivalent or above E Display card Supportive of 640 x 480 resolution and 256 colors Supportive of 800 x 600 resolution and 65535 colors Communication port A RS 232 serial port with DB9 socket or a USB port and a U
178. When the stack is illegal for example when the stack size lt 0 the number of elements in the stack lt 0 or when the stack size is beyond the limit the system will report Definition error of stack operated 2 The stack size does not include the stack bottom element the element designated by D7 3 S indicates the stack size Range 2 0 pv 24 y Example MO g 1000 LI FIFO pigo DO 10 LD MO FIFO D100 DO 10 Stack pointer SoZ PY P UP YY UL VY Wa UNO gt 1 When MO is ON the content of D101 is filled into DO and at the same time the contents of D101 D110 move forward and the D110 is filled with 0 2 Before the execution DO 0 D100 10 D101 1000 D102 2000 D109 9000 D110 10000 3 After the execution DO 1000 D100 9 D101 2000 D102 3000 D109 10000 D110 0 IVC Series Small PLC Programming Manual Chapter pG Application Instructions 6 2 12 LIFO Last In First Out Instruction LAD LO up p D2 S IL LIFO D D S Operand Type le ee Applicable elements p p O 7 Ray Kaw ks en f o Applicable to IVC2 IVC1 Program steps 7 Offset addressing KE E PS E E eee 5 Nr Constant el ver eu Krs Rot ROM o j SO fe Tt vf z Operand description D1 the number of elements in the queue Its element address plus 1 is the address of the queue s head D2 storage register for popped value S queue size Function description
179. X0 ON to determine the status of YO in element S1 and use it in parallel in the following operation connection with other nodes to drive the operation of the following segment IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 183 6 15 7 BOUT Word Bit Coil Output Instruction LAD Applicable to IVC2 IVC1 BOUT D mmie e Influenced flag bit OO IL BOUT D S Program steps Operand Applicable elements WORD Operand description Example SI source operand AU 1016 LD X0 Ge g 4 BOUT DO 4 S2 designated bit O lt S2 lt 15 or system will report operand error Assign the current power flow status X0 ON to BIT4 ofelement WW DO 1000 2 0000001111101000 After the execution DO 1016 Pune ton GESCMPHON 2 0000001111111000 Assign the current power flow status to bit S of element D 6 15 8 BSET Word Bit Coil Set Instruction LAD Applicable to IVC2 IVC1 L BSET D 5 Influenced flag bit IL BSET D S Program steps Operand Type Applicable elements o p S Operand description Example D destination operand 0 33768 LD XO BSET D0 15 S2 designated bit O lt S2 lt 15 or l BSET DO 8 When the power flow is valid set BIT15 of element DO 1000 Function description 2 0000001111101000 After the execution DO 33768 2 1000001111101000 Set bit S of element D system will report operand error 6 15 9 BRST Word Bit Coil Reset Instruction LAD
180. X6 is OFF C244 is invalid 6 When MO and X6 are both ON if X2 is ON C244 will be cleared and C244 auxiliary contact will be reset IVC Series Small PLC Programming Manual LAD Lt mp 6p 52 53 IL DHSP S1 S3 83 Operand Type CA WG ETT Chapter6 Application Instructions 149 6 10 7 DHSP High speed Counting Table Compare Pulse Output Instruction Applicable to IVC2 IVC1 Influenced flag bit Program steps Applicable elements Ap Bl op pe esta TE EE EA EEE E eee poo po pe y ES AE Operand description S1 the starting D element for table comparison The following three D elements are the comparison data and the data to output to SD180 SD181 These four D elements form a record S2 the number of records to be compared Range 1 128 S3 high speed counter Range C236 C255 Function description 1 A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON 2 When the counter value equates the comparison data of the present record the output data of the present record will become the values of SD180 amp SD181 3 You can use the DHSP instruction when you want to control the high speed output or assign values to certain parameters according to a table For example you can set the SD180 8 SD181 double word as the output frequency of the PLSY instruction and the PLSY output frequency will b
181. a SBR calling ends TEMP The TEMP variables are local variables that are valid only within the SBR 4 Data type The variable data type specifies the range of the data The variable data types are listed in the following table IVC Series Small PLC Programming Manual Chapter 4 Programming Concepts 51 Table 4 1 Variable data types Data pe Deeg element address BOOL Bit type One LM element address Signed integer type One V element address 4 4 4 SBR Parameter Transfer 4 4 5 If local input or output variables are defined in a SBR when the main program calls the SBR you should input the corresponding variable values global variables or temporary variables into the SBR interface parameters Note that the global variable should be of the same data type with the local variable Example What follows is an example of how to write and call a SBR Function of this example SBR Call SBR_1 in the main program to complete a adding calculation of two integer constants 3 and 2 and assign the result 5 to DO Operation procedures Step 1 Insert a SBR into the project and name it as SBR_1 Step 2 Write SBR_1 1 Set the SBR calling interface through the SBR_1 variable table 1 Variable 1 Name it as IN1 variable type IN Set the data type as INT The software will assign it with a V element address of VO 2 Variable 2 Name it as IN2 variable type IN Set the data type as INT The software will assign it with a V element a
182. alid 7 multiplies S2 and the operation result is assigned to D DIV Divide Integer Instruction LAD HL DIV 5D IL DIV S S3 D Operand Type Applicable elements Note The operation result of MUL instruction is a 32 bit data Example AU 1000 2000 000000 MUL D mi Dio LD XO MUL DO D1 D10 When X0 is ON DO 1000 multiplies D1 2000 and the result 2000000 is assigned to D10 D11 Applicable to IVC2 IVC1 Program steps eee addressing Si INT Constant nx Kav Kew eg emes o SOT SC TTT VT Zz Y 2 INT Constant pl Kn Kom Kas kamfen SO fT vy Zz vy o m Rav ewe as o Pe PT pve Operand description S1 Source operand 1 S2 Source operand 2 D Destination operand Function description When the power flow is valid 7 is divided by S2 and the operation result is assigned to D D includes 2 units one storing the quotient the other storing the remainder Note S2 0 otherwise the system will report Divided by O error and the instruction will not be executed Example AU 500 1000 E DIIY DU DI DIU LD XO DIVDO D1D10 When XO is ON DO 2500 is divided by D1 1000 the result is assigned to D10 D11 D10 2 D11 500 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 91 6 3 5 SQT Square Root Integer Instructions 6 3 6 IL SQT S D Operand Type Applicable to IVC2 IVC1 Program steps Offset
183. alue of S and assign the result to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is O the zero flag bit SM180 will be set IVC Series Small PLC Programming Manual 106 Chapter 6 Application Instructions 6 4 14 RSUM Sum Floating Point Number Instruction 6 5 6 5 1 LAD H H RSM 6p IL RSUM S S2 D Applicable to IVC2 IVC1 52 D Applicable elements Offset addressing AP EOL TA SL AE AAA 52 NT Constant Knx wn KaM Krs Kim ksm o W Y a ae SETE TT ETE TRE E EL AE LES Note Operand description S1 Source operand starting unit of summing 1 0 lt S2 lt 255 or the system will report operand error 2 When overflow occurs the summing operation will stop S2 Source operand number Example of units to be summed up a SMO 10000 09 LD SMO D Destination operand EW 10000 1 DO summing result die de RMOV 10000 1 DO Kr OE 5 RMOV 20000 2 D2 Function description 30000 30 EW 30000 3 M RMOV 30000 3 D4 ies the GEN valid wee et 40000 38 4 RMOV 40000 4 D6 the contents o x 2 units starting with S1 will be See eer pues Eek Ee P opp D LD XO summed up and the floating x0 1000 09 150001 5 point number summing result Eme A RIRN RSUM DO 5 D100 is assigned to the D unit When XO is ON the floating point numbers of the 5 x 2 units s
184. am and subprograms But being local variants they are valid only in a certain program Different programs cannot share the same LM element directly When the system jumps from one program to another the system will redefine the LM element When the system returns to the main program or calls a subprogram the redefined LM element will be cleared or be set by the interface parameter transfer The LM elements can be used to define the interface parameters of subprograms to realize interface parameter transfer For details see 4 4 Subprogram Local Data Register Element mnemonic V Function The V elements are local variants and can be used in the main program and subprograms But being local variants they are valid only in a certain program Different programs cannot share the same V element directly When the system jumps from one program to another the system will redefine the V element When the system returns to the main program or calls a subprogram the redefined V element will be cleared or be set by the interface parameter transfer The V elements can be used to define the interface parameters of subprograms to realize interface parameter transfer For details see 4 4 Subprogram Chapter 3 Element And Data 55 Data type Word Available forms The Z elements are used for offset addressing You need to write the addressing offset to the Z elements before you can use them Value assignment 1 Through instructions 2 W
185. ame Variable Type Data Type Comments la TEMP EDOL TEMP EDOL D gt x14 on E teH Ser o b ES a OFF ZEST m1 2 DN EST Ki DEE ZEST 320 1 L Figure 2 22 Lock signs under forced elements IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description 29 Unforce You can unforce any forced elements when forcing them becomes unnecessary To unforce an element select the target element right click and select Unforce to pop up a dialog box as shown in Figure 2 23 All the forced elements among the selected elements are listed in the dialog box You can select to unforce any elements and click the OK button to confirm The forced value will be deleted from the PLC so is the lock mark Unforce address data type yes no x14 E Cancel Figure 2 23 Unforce Element monitoring table The element monitoring table EMT is responsible for monitoring the element value during the debugging the program input and output elements can be added to the EMT so that they can be tracked after the program is downloaded to the PLC The EMT monitors the element value during the debugging You can input the input amp output elements registers and word elements into the EMT during the debugging so that those elements can be monitored after the program is downloaded to PLC The EMT works in two modes editing mode and monitoring mode In the editing mode no monitoring function can be carried out In t
186. ame element in neighboring steps The PLC scans instructions by their display order The scanning of the current step and that of the next step are closely joined together Therefore after a STL instruction is executed although certain elements of the instruction will be reset see 5 3 1 STL SFC State Load Instruction the reset will not be carried out until the next scan cycle That means at the moment of the transfer the elements of the last step retains their states and values until the step is scanned in the next cycle As shown in the following figure the two neighboring steps use the same timer T2 When the SO S20 transfer occurs the T2 will retain its value and state rendering the step S20 unable to perform as it is designed The program will jump directly to S21 and S22 Therefore it should be noted that although reusing elements in a program is not prohibited you should avoid reusing them in neighboring steps or accidents may occur 5 Failing to inter lock elements During SFC programming certain elements may become contradictary to each other under some special transfer conditions Inter locking is then necessary Take the following forward backward operation program as an example where YO and Y1 are respectively forward and backward output XO is forward operation X1 is backward operation and X2 the is stop button YO and Y1 should be inter locked that is to say they should not be ON at the same time However in
187. ame of the subprogram o co Exe gg to be executed is Mote The subprogram name cannot be the same with the name of the existing subprogram in the project After naming the subprograms click the Next Step button to enter the window as shown in the following figure IVC Series Small PLC Programming Manual 234 Chapter 8 Using High Speed I O Output Wazard of Envelop The envelop wizard of ControlStar will generate the project files for the configuration you select and the code can be used by ControlStar The configuration required by you includes the following items please check and confirm Execute Subprogram PLS EE Parameter Setting Subprogram PLS GET The above subprogram will become part of the project To enable the configuration in the program place the instruction sentence that will calls the envelop wizard in the main program The above subprogram will become part of the project To enable the configuration in the program place the instruction sentence that will calls the envelop Previous Finish Click the Finish button to complete the PTO configuration 8 5 Notes On High Speed I O Application The input points XO X7 can input signals for functions including high speed counter SPD pulse capture and external interrupt However such functions cannot be used at the same time for the chances are that several functions could require the same input point s Therefore during the PLC programming only o
188. and Type Applicable elements addressing SC woo Teak eN krs PRT o f o e Tv e S2 INT Constant KnX KnY KnM KnS KnLM KnSM T V Z 2 Y Example 1000 YO BLDI DO5 ELDI Operand description S1 source operand S2 designated bit O lt S2 lt 15 or system will report operand error D 5 HH A OUT YO Use the logic NOT of the status of BIT5 ON in DO 1000 2 0000001111101000 which is OFF to Function description determine the status of YO in the following operation Use the logic NOT of the status of bit S2 in element Si to drive the following operation IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 181 6 15 3 BAND Word Bit Contactor AND Instruction LAD BLD 51 52 gt Applicable to IVC2 WC Note because the logic relationship is visualized in the diagram the BAND instruction is displayed in LAD as BLD Influenced flag bit L BAND S1 eg Program steps 5 0O Offset Applicable elements addressing sr won Kax nV Katt RnS n es o SOT CTT Vz KoS Kou RnsM so e vz vy Operand description Example S1 source operand om ue og SH pa 5 BLD D 5 E S2 designated bit O lt S2 lt OUT YO tapers sven WILTEPOR Take the status of BITS ON in element DO 1000 2 0000001111101000 operand error and use it in serial connection with other nodes X0 ON to determine the Function description status of YO in the following operation Take the status o
189. and Chapter 6 Application Instructions for details The classification of C elements is shown below C elements Applicable to 16 bit up counter CTU CTR 0 C199 2 bit bi directi C200 C235 32 bit bi directiona DENT counter 2 bit high High C236 C255 32 bit high speed ng Se JO counter instructions Value assignment 1 Through instructions 2 Write or force during system debugging Battery backed features ape C elements inthe C elements outside saving range the saving range Power loss Remain unchanged RUN gt STOP Remain unchanged Remain unchanged STOP gt RUN Remain unchanged Note The saving range is set through the system block See 2 2 1 System Block EJ Note In a double word D element the higher 16 bit is in the first D element and the lower 16 bit is in the second D element Available forms The D elements are used in many calculation and control instructions as the operands Value assignment 1 Through initialization 2 Through instructions 3 Write or force during system debugging Battery backed features State D elements in the D elements outside saving range the saving range Remain unchanged RUN gt STOP Remain unchanged Remain unchanged STOP RUN Remain unchanged Note The saving range is set through the system block See 2 2 1 System Block LU Note Some D elements may be reserved for internal tasks when the FREQUENCY CONVERTER instructions or N N bus
190. and its LAD counterpart Figure 7 1 A simple structured SFC program and its LAD counterpart IVC Series Small PLC Programming Manual 208 Chapter 7 SFC Tutor In a simple structured SFC program when the step transfer conditions are met the program will run from the current step to the next step in a linear flow At the last step when the transfer conditions are met the SFC program section will either end or transfer to the initial step 1 Ladder chart block The ladder chart block is used to start SFC program section To be specific to set the S element of the initial step to ON In the preceding figure the program uses the power on startup mode The ladder chart block can also be used as other general program sections besides the SFC program 2 Initial step As shown in Figure 7 1 the initial step is started by a ladder chart block The range of S elements for initial step is O 19 3 Normal step The normal step is the main component of the program The range of S elements for normal step is 20 991 for IVC2 or 20 1023 for IVC1 4 Transfer or reset The program shown in Figure 7 1 is ended with a jump which leads the program to the initial step This is a cyclic program However the program can also be ended with a reset which can reset the status of the last step end a program and wait for the next round of execution Selection branch structure The selection branch structure is shown in the followin
191. and the system will not report operand error D destination operand E P S2 Number of ASCII codes 1 lt S2 lt 256 example Function description ATI MD 130 4 When the power flow is valid the S2 ASCII code LD MO data starting with 7 element will be converted to hexadecimal data and the result will be stored in the elements starting with D in every 4 bits When SM186 is OFF the high low byte of each D element will store two ASCII code data When SM186 is ON the low byte of each D element will store 1 ASCII code data Note 1 When 1 is not within 0x30 0x39 or 0x41 0x46 or S2 is not within 1 256 the system will ATI D10 D30 4 Source data D10 0x3938 D11 0x3736 D12 0x3534 D13 0x3332 When MO is ON the ATI conversion will be executed According to the data storing mode the results are as follows O if SM186 is OFF the result is D30 0x8967 O If SM186 is ON the result is D30 0x8642 6 6 Word Logic Operation 6 6 1 WAND AND Word Instruction LAD Applicable to IVC2 WC mome w ei e influenced fiag bit OOOO IL WAND S1 S2 D Program steps l Offset Operand Type Applicable elements addressing S1 WORD Constant Knx KnY von Kns KnimM Knsm p so C Tv z v 2 WORD Constant KnX KnY van knS KnLM knsM D sp c T vo z_ v D woro kn km kms kam b c t v Zz v Operand description AND operation and the result is assigned to D S
192. angle Wave Signal Output JInstruchon cc cccceseceeeceeeeeeeeeeeeeseeeeeeaeeeeesaeeeesseeeeesaaeeeesaaeees 162 6 12 COMMUNICATION Instruchon ccc ccceecccceececeeeeeaeeeeeeeeeeeeeeeeeeeeaeeeeseeeeseeeeseeeesseeeeeeeeeseecesseeesseeeeseeceseeesseeetseeesaeeeeaes 164 6 12 1 Modbus Modbus Master Station Communication Instruction ooocccconccncnoncnnononnncnnannnononcnnnnnnonnnnnnononnnons 164 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 13 6 12 2 IVFWD FREQUENCY CONVERTER Forward Rotation Instruchon 165 6 12 3 IVREV FREQUENCY CONVERTER Reverse Rotation Instruction cooooccccococcccnoccnccnononononcnnnnnncnnnnos 166 6 12 4 IVDFWD FREQUENCY CONVERTER Touch Forward Rotation Instruction oooooccccooccnccooccnnnononcnnos 166 6 12 5 IVDREV FREQUENCY CONVERTER Touch Reverse Rotation Instruchon 167 6 12 6 IVSTOP FREQUENCY CONVERTER Stop INStruction coooccccoccccoccnccoccnconcncconnncnnnnconononnnnnnnnnonnnnncnnnnnnns 167 6 12 7 IVFRQ FREQUENCY CONVERTER Set Frequency INStruction oooccccooccncccocnnononcncnnnconcnoncnnnnanononnos 168 6 12 8 IVWWRT FREQUENCY CONVERTER Write Single Register Value Instruction ooccccoocccccconcccnoncnnnnos 169 6 12 9 IVRDST FREQUENCY CONVERTER Read Status Instruction aannnaannneanennnnnesrreesrrresrrrrsrrrrsrrrrsrrrrenne 170 6 12 10 IVRD FREQUENCY CONVERTER Read Single Register Value Instruction
193. ant scan time 7 Gleis J S e scan time the cycle constant scan mode is invalid automatically and no alarm will be raised SD33 is regarded as 1000ms when it is set bigger than 1000ms configurable only through the system block Default 100ms Unit ims Any setting smaller than SD34 User program 100 or bigger than 1000 will be regarded as 100 or overtime 1000 respectively Configurable only through system block LU Note 100 1 The error tolerance of SD30 SD31 and SD32 is 1ms 2 It is recommended to set the user program overtime SD34 at least Sms bigger than the constant scan time SD33 Otherwise due to the influence of system operation and user program the system is apt to report user program overtime error Input Filtering Constant Setting ion an Tao ve Wet SD35 Input filtering constant Configurable only through system block a ee 1 eo High speed Pulse Output Monitoring 5 SD50 SD54 the MSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions SD55 the LSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions Ac Name R SD50 Output pulse number at YO for PLSY and PLSR instructions MSB SD51 Output pulse number at YO for PLSY and PLSR instructions LSB SD52 Output pulse number at Y1 for PLSY and PLSR instructions MSB SD53 Output pulse number at Y1 for PLSY and PLSR instructions LSB SD55 Total output pulse number at YO and Y1 for PLSY an
194. arameters must be downloaded before they become effective Not all types of PLC support each system block option View the system block option supported by the PLC by pressing Fl Figure 2 6 Setting output table The output table is used to set the PLC output state when the PLC is stopped The output states include 1 Disable When the PLC is stopped all the outputs will be disabled 2 Freeze When the PLC is stopped all the outputs will be frozen at the last status 3 Configure When the PLC is stopped the marked outputs will be set as ON Set Time See Figure 2 7 IVC Series Small PLC Programming Manual 17 Chapter 2 PLC Function Description System block Special Module Configuration Priority Level Of Interruption Advanced Settings Communication Port _ Saving Range Output LL Set Time Filter Input pes Default value Watchdog time setting 200 E ms Constant scanning time 0 al ms setting Note The constant scanning time setting cannot be larger than the watchdog time Figure 2 7 Setting time 1 Watchdog time setting The watchdog time is the maximum user program execution time When the actual program execution time exceeds the watchdog time PLC will stop the execution the ERR indicator red will turn on and the system will output according to the system configuration The watchdog time setting range is Oms 1000ms Default 200 ms 2 Constant scanning time setting Wi
195. ation result D is O the zero flag bit SM180 will be set COS Floating Point Number COS Instruction LAD H gt H os e D Example AD 1 570000 1 OD0000 SIH DO mo LD XO SIN DO D10 When XO is ON get the SIN value of DO D1 1 57 and assign the value 1 to D10 D11 Applicable to IVC2 IVC1 Influenced flag bit Zero carry borrow Coos 5 0 Program steps Operand Type Applicable elements Offset addressing e Pe E ETA ETS CP BAU EE SOS EL OIT 1 PO IYT 1 Operand description S Source operand D Destination operand Function description 1 When the power flow is valid get the COS value of S unit radian and assign the result to D 2 When the operation result D is O the zero flag bit SM180 will be set Example XO 3140000 0 939999 cos Do nid LD XO COS DO D10 When XO is ON get the COS value of DO D1 3 14 and assign the result 0 999999 to D10 D11 IVC Series Small PLC Programming Manual 104 Chapter 6 Application Instructions 6 4 10 TAN Floating Point Number TAN Instruction LAD Applicable to IVC2 IVC1 ae wo eens ta zaro o Boe 6 4 11 IL TAN S D Program steps 7 Offset Operand Type Applicable elements addressing ES CR E NEEN E WEE RE eee eee eee a ee ee ee ee ee ee ee ee Operand description Example S Source operand mp 1 570000 1255 848 LD XO W s H Ya Hey TAN DO D10 D Destination operand When XO is ON
196. be returned In other words the read number of the elements must be within the actually defined range It is true for read write of bit word elements Example Of Modbus Communication Control Rather than transmitting any message actively the Modbus slave station only decides whether to respond to the message from the master station based on the specific situation after receiving the message for the local station The slave station only supports Modbus function codes 01 02 03 05 06 08 15 and 16 The rest will be responded with illegal function code except broadcast frame Read and write of element Except function code 08 the other supported function codes can read and write element In principle one frame can read up to 2000 bit elements 125 word elements and write 1968 bit elements and 120 word elements at most However the real protocol addresses are separate and discontinuous for different elements therefore when reading or writing an element the elements read at one time can only be the same type and the maximum number of the read or written elements is related to the actually defined number of the elements For example when reading Y element YO Y377 the protocol address ranges from O to 255 the logic address of the corresponding Modicon data is 1 256 and the maximum number of elements can be read is 256 See the following examples Note The address of the slave station is 01 the last two bytes are CRC check code and the se
197. bit Station no Max number of sites Additional delay time Retry times Refresh mode Cancel The Max number of sites refers to the total number of PLCs used in the network If 6 PLCs are used in total the value shall be set to 6 and the station number of the 6 PLCs ranges from 0 to 5 If you want to add another two PLCs to the network later without any interruption of the network you can set the Max number of sites to 8 The numbers of the newly added PLCs are 6 and 7 When 6 and 7 are connected to the network they will be automatically detected by NN bus within one second and included into the data exchange with O 5 Example There are 5 PLCs in total and the station numbers range from 0 to 4 Select 3 for the refresh mode If you want to save the sum of D100 in 0 PLC and D305 in 2 PLC to the D500 of 4 PLC you can program as follows Programming 04 MOV D100 D7700 Programming 2 MOV D305 D7716 Programming 4 ADD D7700 D7716 D500 Explanation The example shows the N N bus single layer network There are 5 PLC stations on the network and the refresh mode is set to 3 Each station can be distributed with 8 D elements and 64 M elements The D elements distributed to 0 station range from D7700 to D7707 the ones to 2 station range from D7716 to D7723 and the ones to 4 station range from D7732 to D7739 Save the D100 value of 0 station to the public area D7700 distributed by the network D305 value
198. bit Enable when setas1 RW V vo Sas COM 0 character transmission Interrupt ening ag B Enable when setest RW v COM 0 character reception interrupt enabling flag bit COM 0 frame transmission interrupt enabling flag bit Enable when set as RW yv amer COM frame recepton interrupt enabling fag Bt Enable when setast RW COM 1 character transmission interrupt enabling flag bit COM 1 character reception interrupt enabling flag bit Enable when set as RW yv Susa CONT frame transmission interupt enabling fag BE Enable when setest RW v COM 1 frame reception interrupt enabling flag bit SMB6 Powerfaiurenierupt T sgewesae mi Y mer YO ouput nish rierupt erable tegt Enable when setas RW v PTO Y1 output finish interrupt enable flag bit High speed counter interrupt enabling flag bit Enable when set as RW Y x SES Times intemuptO erabing agb Enable when setast RW v v SM67 Timed interrupt 1 enabling flag bit Enable when set as 1 SM68 Timed interrupt 2 enabling flag bit Enable when set as 1 RW Nyy 5 High Speed Pulse Output Control SMe0_ YO high speed pulse output control YO high speed pulse output stopinstructon RW Y Y SMe Yi high speed pulse ouput control YT high speed pulse outputstopinstructon RW v v M82 Y0 high speed pulse output monitor_ YO Figh speed pulse output mointor ON busy OFF ready R V V SMe3_ YT high speed pulse output monitor YY hig
199. borrow Cap 57 e m 7 Operand Type Applicable elements Oise j Ki ER addressing Si INT Constant Kox Kry Ro Kns Rn RSM OT SOT CTT V z vy 2 INT Constant Kox Kry Krm Kns Teen o SD eft fv zy o m mesem o efr pv pep Operand description Example S1 Source operand 1 0 1000 2000 1000 SUB DO m mo S2 Source operand 2 D Destination operand LD XO SUB DO D1 D10 When X0 is ON DO 1000 subtracts D1 2000 and the result 1000 is assigned to D10 Function description 1 When the power flow is valid S1 subtracts S2 and the operation result is assigned to D 2 When the operation result D is larger than 32767 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set When the operation result is less than 32768 the borrow flag will be set bit SM182 IVC Series Small PLC Programming Manual 90 6 3 3 6 3 4 Chapter 6 Application Instructions MUL Multiply Integer Instruction LAD Lara ww eu IL MUL en S3 D Operand Type Applicable elements Applicable to IVC2 IVC1 Program steps Offset addressing Si INT Constant es Kav Te eg RLM RSM OD TSO CT TV Y 2 INT Constant nx Kn Kom Kas Know KASM SO e T viz vy H pm E IA Kew kas e Pe PP TT Operand description S1 Source operand 1 S2 Source operand 2 D Destination operand Function description When the power flow is v
200. bus with right bus omitted 2 All control output elements coils and functional blocks application instructions share the same power flow inlet The electric control diagram and LAD are equivalent to a certain degree as shown in the following figure Figure 4 1 The equivalence between electric control diagram and LAD LAD basic programming components According to the principles in electric control diagram several basic programming components are abstracted for the LAD 1 Left bus Corresponding to the control bus in electric control diagram it provides power for the control circuit 2 Connecting line 1 Corresponding to the electric connection in electric control diagram it connects different components 3 Contact F Corresponding to the input contact in electric diagram it controls the ON OFF and direction of control currents The parallel and serial connection of contacts stands for the logic calculation of inputs determining the transfer of power flow 4 Coil 2 It corresponds to the relay output in electric control diagram 5 Function block Or application instruction Corresponding to the execution unit or functional device that provides special functions in electric control diagram it can accomplish specific control function or control calculation function like data transmission data calculation timer and counter Power flow Being an important concept in LAD the power flow is used to drive coils
201. bytes read Read data Read data Check code A e Si 02H n No 1 Noin CRC or LRC B7 B6 B B4 B3 B2 B1 BO 3 3 Read Holding Registers 0x03 It refers to reading the value of data word register at the slave station with the maximum number of registers of 125 read each time It does not support broadcast 1 Request frame Address Function Code 03H Starting address Number of elements Check code CRC or LRC 2 Response frame Read data No 1 Read data No n Check code CRC or LRC Address Function code 03H Number of bytes read n 3 4 Force Write Single Coil 0x05 Force Write single coil writes bit element value to the slave station and supports broadcast i e writing the same element to all slave stations It supports 1 bit element at most 1 Request frame Address Function Code 05H Starting address Written element value Check code CRC or LRC Note The written value of the element is OxFFOO ON 1 or 0x0000 OFF 0 2 Response frame Response frame is the repeat of request frame Address Function code 05H Starting address Written element value Check code EE IVC Series Small PLC Programming Manual 284 Appendix 7 Modbus Communication Protocol IVC series 3 5 Preset write Single Register 0x06 Preset Write single register writes word element value to the slave station and supports broadcast i e writing the same
202. cation that is if there are two Modbus XMT instructions in one user program the first communication fails and has error code it will not influence the data sending of the second Modbus instruction Thus in the example we placed the error code of SD139 in D202 which can be observed through D202 3 For the message sending of the slave station if the master station is in listen only mode there will be no data to be returned and the system will display error flag Therefore when using Modbus of IVC2 if IVC2 is the master station the user shall clearly know which PLC slave station is under listen only mode so as to ensure that the failure of the communication is not caused by the listen only mode of the slave station IVC Series Small PLC Programming Manual 254 Chapter 10 Using Communication Function Example 2 VC2 is the Modbus master station the slave station is also an IVC2 basic module Read the status of bit elements protocol address 2000 2017 in No 5 station The read data are as follows O The received frame starts from D100 e D100 is for saving address e D101 is for saving function code O D102 is for saving the number of registers O Units beginning with D103 are for saving the read value of bit element 1 The program has designated 5 as the address of the slave station to be accessed save to DO 2 The program has designated 1 as function code save to D1 3 The starting address of the register to be read is 07
203. cleared the PLC will not initialize element D according to the presetting of the datablock PLC Format The PLC Format function can format all PLC data including clearing the user program restoring the defaults and clearing the datablock when PLC is in STOP state Think it twice before using the formatting function because this operation will clear all the downloads and settings in the PLC IVC Series Small PLC Programming Manual 2 4 5 Chapter 2 PLC Function Description Checking PLC Information Online PLC Info The PLC Info function can obtain and display various PLC running information as shown in Figure 2 18 PLC Info Yersion CPU type Version number Scan rate as Current Oms Maxinimum value Minimum value Oms Run error information Sytem error no 0 System error description No system error Execution error no 0 Execution error description No execution error Program capacity Program capacity 12K steps Battery voltage Voltage 3 0 Running status indication Status indication Module type Input Output Version Figure 2 18 PLC current operation information PLC Clock The PLC Clock function can be used to display and set PLC present time as shown in Figure 2 19 Time setting Date setting Hours Years 2001 Minutes Months 2 Seconds Days 14 r bh Figure 2 19 Setting PLC clock 2 Displayed in the PLC Clock window is the present date and ti
204. cond byte is function code 1 XMT from master station 01 01 00 00 01 00 3D 9A 01 address 01 function code 00 00 starting address 01 00 number of read elements 3D 9A check Slave station response return correct response 2 XMT from master station 041 01 00 00 01 01 FC 5A The master station reads 01 01 elements 257 which is over the defined range of Y elements Slave station response 01 81 03 00 51 The response of the slave station is illegal data because 257 gt 256 256 is the allowed maximum number of Y elements 3 XMT from master station 01 01 00 64 00 AO 7D AD IVC Series Small PLC Programming Manual 288 Appendix 7 Modbus Communication Protocol IVC series 00 64 decimal 100 is the starting address for master station to read 00 AO decimal 160 is the number of the elements Slave station response 01 81 02 C1 91 The response of the slave station is illegal address because there are only 156 Y elements which are defined to start from 100 and 160 Y elements have exceeded the number 4 XMT from master station 01 01 01 2C 00 OA 7C 38 The master station reads 10 bit elements of 01 2C decimal 300 Slave station response 01 81 02 C1 91 The response of the slave station is illegal address because protocol address 300 has no definition of bit element 5 XMT from master station 01 04 00 02 00 OA DI CD The mater station sends the frame of function code 04 Slave station response 01 84 01 82 CO The response of the sla
205. d PLSR instructions LSB SD56 Current section of the PLS instruction that outputs YO SD57 Current section of the PLS instruction that outputs Y 1 ERE ESAS in EA E eS Total output pulse number at YO and Y1 for PLSY and PLSR instructions MSB ORW y IV COTE pS E a E EA IVC Series Small PLC Programming Manual 212 Appendix 2 Special Data Register 7 Timed Interrupt Cycle Nme Register content RW GE interrupt will not occur when the value is not SD66 Cycle of timed interrupt O within 1 32767 Si IEK 3276 ms The interrupt will not occur when the value is not D67 le oft t t1 Cycle of timed interrup within 1 32767 BEN 1 32767ms The interrupt will not occur when the value is not D le of ti int t2 R W 1 32767 Note An error of 1ms may occur when the system processes a user timed interrupt To ensure the normal operation of the interrupt it is recommended to set the cycle of timed interrupts to be bigger or equal to 5ms 8 Locating Instruction The current value of YO output locating instruction MSB R W deele S87 The curent valve of 0 utputiocaing instruction 58 RW via v 5082 The curent valve of Y1 etputiocaing stucen WSB _ RW via v 5083 The curent valve oF V otputiocaing instruction 58 RW via v SD84 Basic frequency of executing of instructions ZRN DRVI RIW V1 29 y and DRVA SDRE o of executing of instructions ZRN DRVI w hoe BS Highest f f ti f instructi ZRN DRVI We
206. d User information file error See the notice for the No battery mode in the Advanced Settings tab of Data block LJ Note IVC series PLC has no battery therefore it does not support no battery mode IVC Series Small PLC Programming Manual 14 Chapter 2 PLC Function Description 2 1 11 User Program Protection The IVC1 and IVC2 series PLCs provide mutiple levels of passwords and other protection measures Table 2 4 User program protection Protection measures Description After downloading system block to the PLC and checking the Formatting is prohibited option in the Advanced Settings tab in System block the PLC internal user program system block and data block are Formatting ban protected against formatting To lift the formatting ban you need to re download the system block and uncheck the Formatting is prohibited option Download password Download limit If you select to disable the upload function during downloading process it will be prohibited to upload the Upload ban program from PLC to PC To enable the upload function you must re download the program and check to enable the upload function during the downloading process Upload password Upload limit Monitor password Monitor limit The programmer can set passwords to protect the program subprogram and interrupt subprogram against aunthrorized accessing and editing in AutoStation Program password Password setting method Right click the program and select Encrypt Decrypt
207. d description Analysis of the execution process of the ramp instruction is shown in the following figure S3 5 S1 starting value S2 end value D1 output value S3 step number S3 gt 0 or system will report operand error and do not execute the calculation D2 output state 0 Function description In each scan cycle when the power flow is ON this instruction can determine the increment and current output value D7 according to the ramp wave height and step number When the output value D1 reaches mote S2 it will keep stable and the output state D2 will be 1 If the result is not divisible when calculating the set ON If the power flow falls the output state D2 will program steps round off to the nearest whole number be set OFF but the output value D7 will not change 2 The instruction will generate one ramp data upon until the power flow rises again when D7 will be every rising edge initialized as 1 and continue to conduct the next 3 When S1 S2 D1 S2 D2 ON ramp calculation 4 The total number of RAMP HACKLE and See the following figure TRIANGLE instructions in a program should not exceed 100 Example nitialize registers upon the first scan cycle after the power on LD SM1 MOV 0 DO pf state of the power flow MOV 2000 D1 Execute RAMP instruction when X0 is ON IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 161 LD AU 1 When XO is ON D10 in the first cyc
208. ddress for master station read 5 word elements of 25 E5 Response of slave station 01 83 03 01 31 The data sent back from slave station is illegal 10 4 10 Handle Of LONG INT A LONG INT data can be saved in two D elements For example if a LONG INT data is saved in D3 and D4 of IVC series PLC the high 16 bits will be stored in D3 and the low 16 bits will be stored in D4 This is also true when the master station reads LONG INT data through Modbus and reorganize the data into 32 bits The storage principle for FLOAT is the same as the storage principle for LONG INT data 10 4 11 Diagnostic Function Code Diagnostic function code is used for test the communication between the master station and slave station or the internal error of the slave station The supported diagnostic sub function codes are as follows Functi Sub functi Function Sub function SE SE Name of sub function code SE SE Name of sub function code code code code code Return bus communication error count rr RSC e EE r Restart communication option 04 Forced listen Forced listen only mode mode e carte comer EU ARES E eee bus message count 10 4 12 Error Code For the XMT of master station the slave station returns data or statistic value in the data field under the normal response status But in the abnormal response status the server will return error code in the data field Refer to the following table for error codes
209. ddress of V1 3 Variable 3 Name it as OUT1 variable type OUT Set the data type as INT The software will assign it with a V element address of V2 2 Write the SBR_1 as LD SMO ADD IN1 IN2 FOUT1 The above program is shown in the following figure Project Manager AX 5 MAIN IS SBR_1 4l bix io Ga AAA AO EE EE TANTA Par H y AFDS Variable addr Variable Name Variable Type Data Type Comments 3E P block CECR it AS vo INL IN INT MAIN SBRI vi IN2 IN INT S Global variable table IN DUT ANT Datablock V2 OUT1 OUT INT Ke a System block lt gt R Cross reference table E Element monitoring table ES EMT 1 ADD INL IN OUTL Ea Comm equipment connection FE Configuration table of MDI Figure 4 11 Writing SBR_1 Step 3 Write the main program and call the SBR Use the CALL instruction in the main program to call SBR_1 The corresponding main program is as shown below LD MO CALL SBR 1 3 2 DO IVC Series Small PLC Programming Manual 52 4 5 4 5 1 4 5 2 Chapter 4 Programming Concepts You can use the parameter transfer relationship table as shown in the following figure to set the parameters transferred to the subprogram and specify the element for storing the result of the subprogram Parameter IN1 is used to transfer constant integer 3 Parameter IN2 is used to transfer constant integer 2 e The result OUT1 is stored in DO Project Manager DS MAIN SBR_1
210. ddressing sr een ps nV Row RS Temieenut OT SOT CTT vp zy Y gt Si INT Constant Knx nv eu ee kum ksm o so ce fr vp 2 vy Operand description Example S1 source operand a ez LD X0 S2 designated bit O lt S2 lt 15 or 1600 BOR DO 5 BDO DO 5 OUT YO system will report operand error E tion d Take the status of BIT5 ON in element DO 1000 ds 2 0000001111101000 and use it in parallel connection with other Take the status of bit S2 in element S1 nodes X0 ON to determine the status of YO in the following and use it in parallel connection with operation other nodes to drive the operation of the following instruction 6 15 6 BORI Word Bit Contactor ORI Instruction Applicable to IVC2 IVC1 BLDI 1 52 Note because the logic relationship is visualized in the diagram the Influenced flag bit BORI instruction is displayed in LAD as BLDI vr Program steps 15 Offset Applicable elements addressing ST WORD Iecieriew ee Temieent gaer Y Sr 187 Constant Kax Rav eu ve komes o sD c Tt v Z v_ Operand description Example S1 source operand pi g LD XO S2 designated bit 0 lt 2 lt 15 or 1000 BORI DO 5 ELDI D0 5 OUT YO system will report operand error Function d inti Take the logic NOT of the status of BITS ON in element DO 1000 id 2 0000001111101000 which is OFF and use it in parallel Take the logic NOT of the status of bit S2 connection with other nodes
211. de Selection H PORT 0 Input status indicators switch an i Ieieieielel eaten leleleis BEER System status S5 Extension port ils A es indicators Output status indicators y d H A ll el le lee CHE se B scht G 4 EN DE O i i H Ser Variable analog Output terminals potentiometer Figure 1 1 Outline and structure of IVC1 series basic module As shown in Figure 2 1 PORTO and PORT1 are for communication PORTO is RS232 and use socket Mini DIN8 while PORT1 is RS485 or RS232 The bus socket is for connecting extension modules The mode selector switch can be set to ON TM or OFF 1 1 3 Outline of IVC2 Series Basic Module The outline and structure of IVC2 series basic module is shown in the following figure example 64 point basic module Power supply System status LEDs Output terminals Figure 1 2 Outline and structure of IVC2 series basic module The battery socket is designed for the CR2032 button lithium battery The bus socket is for connecting extension modules The communication port PORTO is RS 232 and uses socket Mini DIN8 while the communication port PORT1 is RS 485 or RS 232 The mode selector switch can be set to ON TM or OFF 1 2 AutoStation Programming Software AutoStation is a programming software specialized for
212. description S1 Source operand 1 D destination operand S2 Source operand 2 Function description When the power flow is valid S1 data and the carry SM181 will together rotate leftward for S2 bits and the result is assigned to D Note 1 220 2 When S1 uses Kn addressing Kn must be equal to 4 Example mo 52629 59082 LD MO EH RL mp 110 16 RCL DOD10 16 Rotate with the carry flag leftward 16 bits MSB 1 14111 0 0 1411440 1 11 0 0 141 0 1 0 When MO is ON DO 2 1100110110010101 52629 and the carry SM181 ON will rotate leftward for 16 bits and the result 2 1110011011001010 59082 is assigned to D10 SM181 ON DROR 32 Bit Circular Shift Right Instruction LAD LZ DRR 52 IL DROR S1 D S Operand Type S1 DWORD Constant KnX KnY KnM Kns KniM KnsM _D so c v kny km kns kam D Lei v sz INT Constant knx Kny van Kns KnLM knsm _D sp c Tt v z_ Operand description S1 Source operand 1 D destination operand S2 Source operand 2 Function description When the power flow is valid the data of 7 will rotate rightward for S2 bits and the result is assigned to D At the same time the highest bit of the S2 bits will be stored into the carry flag bit SM181 D 52 Influenced flag bit Carry Applicable to IVC2 IVC1 Program steps Offset addressing REH Applicable elements y Note 1 220 2 W
213. dule Configuration You can set the Module Type and Module Property in the Special Module Configuration tab as shown in Figure 2 10 System block Advanced Settings Communication Port Saving Range Output Table Set Time Input Filter Input Point Special Module Configuration Priority Level Of Interruption Module Type Module Property EC10 4AD w Set gt 0 1 2 3 After selecting the module type double click the mouse or click the right button to set the detail info of the module Figure 2 10 Setting special module 1 Module Type As shown in Figure 2 10 you can set the module type for No 0 No 3 special modules Module Property After selecting the Module Type the corresponding Module Property will be activated Open the dialogue box as shown below EC10 4ADConfiguration speed Modify settings Automatic v Error status D Module ID D Module version D Use time high Use timetlow word word o L__ o AD conversion RP v initialization Automatic v Input channel_1 Average sampling time Digital value Upper limit of at zero L digital value Mode Close v Average D Current sampling value sampling value Output channel Mode Channel output value Digital value Upper limit of at zero digital value Note 1 IF you need to use the default value in the module please set the corresponding item to null or Auto 2 If there is
214. e adjusted by the table compare result Note 1 The DHSP instruction must be used together with the HCNT instruction because the DHST instruction cannot be executed unless the related high speed counter is driven by the HCNT instruction 2 When the DHSP instruction is used together with the PLSY instruction the values assigned to SD180 IVC Series Small PLC and SD181 must meet the frequency output requirement of the PLSY instruction For details see the description of the PLSY instruction 3 To stop the comparison at the last record set the last output data of the table as 0 Under this situation other DHST and DHSP instructions will be invalid But at this time the DHSP instruction is not regarded as a high speed instruction when it comes to the number limit of high speed instructions 4 The DHSP instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV 5 DHSP DHSCI DHSCS DHSCR DHST DHSZ can be used repeatedly However at most the first six such instructions can be driven at the same time 6 In a user program the DHSP and DHST instructions cannot be valid at the same time That means a valid DHSP or DHST instruction will make the following DHST or DHSP instructions invalid 7 The maximum frequency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR
215. e Configuration Priority Level Of Interruption Saving Range Output Table Set Time Input Filter Input Point Advanced Settings Communication Port PLC communication port 0 setting Program port protocol Free port setting Modbus protocol ECbus Protocol PLC communication port 1 setting No protocol O Freeport protocol O Modbus Protocol ECbus Protocol ECBus Protocol PLC serial port setting Baud rate 38400 vw Parity check Even Data bit Stop bit Station no Max number of sites Additional delay time Retry times Single layer Mode Double layerflayer 0 Refresh mode 3 Double layerflayer 1 As shown in the preceding figure the N N bus parameters are set through the system block The Station no shall begin with 0 Several PLCs cannot share the same station number 0 station is used for starting and setting the whole network The setting of Max number of sites Additional delay time Retry times and Mode can be realized through 0 station For the stations with other station numbers except that the Baud rate and Parity check shall be consistent with those of 0 station they only need to set their own Station no as shown in the following figure IVC Series Small PLC Programming Manual 262 10 5 5 Chapter 10 Using Communication Function ECBus Protocol Default Value PLC serial port setting Baud rate 38400 Parity check Even Data bit Stop
216. e Integer OR lt gt lt gt gt lt Instruction Applicable to IVC2 IVC1 Influenced flag bit SI Program steps Offset Applicable elements addressing Sr NT Consan Kox Kav ROM Ko RAM esn OT SOT C TTT VT Z Vv Si INT Constant Knx Koy eg Kn kum ksm o so ce tp vz ov Operand Type Operand description Example ST comparison parameter 1 10 LD AU s2 l ir OR DODI comparison parameter OUT YO 11 LD X1 Function description Compare elements S1 and S2 and use the comparison E OR lt DODI 1000 1000 z DO Di OUT Y1 X2 YZ LD X2 result in parallel connection B OR lt gt DO D1 with other nodes to drive the OUT Y2 following operation Es LD X3 OR gt DO D2 OUT Y3 e LD x4 1000 1000 OR gt DO D1 pS DO 11 og o OUT Y4 pe a WW LD X5 a y rop OR lt DO D1 OUT Y5 Compare elements DO and D1 and use the comparison result in parallel connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 187 6 16 4 Compare Double Integer LDD lt gt lt gt gt lt Instruction Applicable to IVC2 IVC1 Influenced flag bit Operand Applicable elements sr BINT Constant Kx Rr Ko KS RLM RSM OT SO CT Vv Si BINT Constant nx Kav eu ee kin ksm o so 0 vi addressing EN ER Operand description Example S1 comparison pa
217. e communication channel will be unavailable to other instructions for a while The same is true to other instructions such as high speed output instruction locating instructions and FREQUENCY CONVERTER instructions Application limit Some instructions cannot be used in certain situations due to their limited application scope For example instruction pair MC MCR cannot be used in the steps of SFC IVC Series Small PLC Programming Manual 54 Chapter 5 Basic Instructions Chapter 5 Basic Instructions This chapter details the basic instruction of IVC1 and IVC 20 including the instruction format form operand influenced flag bit function example and sequence chart Oe COMtact WOGIG INSTUCUIONS ia A A ir 55 5 1 1 LD NO Contact Power Flow Loading 000 Asada A A A A A 55 5 1 2 EE Contact PowerFlow LoadNg EE 55 5 1 3 AND NO Contact Power Flow And 56 5 1 4 ANI NC Contact Power Flow And 56 5 1 5 OR NO Contact Power Flow Or 57 5 1 6 ORENG Contact Power FlOW TEE 57 E TOUT POWer PIOW UU e eos de 58 DILO ANB ROWer FlOW Boek ANG rocoso iden 58 Bl ORB FowerFlIow BIOck OF ut AS A AAA A A 59 52110 MPS Output Powelr Flow Input ei E 59 5 1 11 MRD Read Output Power Flow Stack Top Value nnaannnnnnnnnnnnnnnnnnnninnnnnsnnnsnrrsnrrsnrrerrrerrrerrnerrrenrrerrnerrnenee 60 5 112 MPP Output PowerFlow Stack e RE 60 5 1 13 EU gt Power flow Rising Edge Detection unica eE a E a a ar a 60 5 1 14 ED Power flow Falling edge UDetec
218. e corresponding high speed pulse output control SM80 or SM81 is ON the contact driven by the instruction will not be driven by the instruction again after the contact turns OFF Note 1 Pay attention to the configuration of SD84 SD87 when using this instruction 2 When the instruction input frequency is smaller than SD84 there will be no high speed output at YO or Y1 When the instruction input frequency is bigger than SD85 or SD86 the output will be abnormal IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 199 6 17 10 DRVA Control Absolute Position Instruction LAD Applicable to IVC2 WC FH E mm eu e DT influenced fag D IL DRVA S1 S2 D1 D2 Program steps Operand Type Applicable elements sr omr corsen kox er em Kes romes o SDT CT Tv 2 omr Constant Kox et enee kom ees o SDC v a ee IO RUI o PY LL LI E addressing LL NU NEE gt ee AAA TA We 4 Changing the operands during the execution of the instruction will not take effect until the next cycle when the instruction is executed again Operand description S1 targe position absolutely specified EE sae 5 During the execution of the instruction the output S2 output pulse frequency Hz will decelerate to stop when the driven contact turns 32 bit instruction 10 100000 Hz OFF The exection completion flag SM will not act D1 high speed pulse output starting address YO or then Y1 The PL
219. e current power flow IVC Series Small PLC Programming Manual 58 Chapter 5 Basic Instructions 5 1 7 OUT Power Flow Output Applicable to IVC2 IVC1 Influenced flag bit IL OUT S Program steps re t Operand Type Applicable elements addressing ESPA AA AS LT Ae Ir E TA Operand description Example S Source operand Mi YO LD M1 Function description j elt OUT YO Assi h f th fl h SS eva He of the current power flow to the When M1 is ON YO is ON designated coil D 5 1 8 ANB Power Flow Block And Applicable to IVC2 IVC1 pol Influenced flag bit Power flow Power flow block 1 block 2 IL ANB S Program steps Breil t Applicable elements Se Breil ES Porres TL Peter TE 7 Operand description Example S Source operand LD MO Er M Mz TO OR M1 Function description or Wie Conduct and OR M3 operation on the power ANB flow values of two OUT YO power flow blocks and When MO or M1 is on and M2 or M3 is ON YO is ON then assign the value to the current power flow IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 59 5 1 9 ORB Power Flow Block Or Power flow block 1 Influenced flag bit Power flow block 2 IL ORB S Program steps Operand Type Applicable elements Glen P yP PP addressing CAPA Pra perry y 1 e PT gt Operand description Example S Source operand LD M1 Function description de 1 2 s AnD E LD M3 Conduct or
220. e e LD MO SHR DO D10 5 D destination operand S2 Source operand 2 Be N LSB Function description 01414111 4 0 1 tojn f1 lo 4 41 41010 When the power flow is valid After the data of S1 will shift MSB LSB oToToTororo Itt Tort or 414 10 rightward for S2 bits and the HIH OO ALATA U1 Ot TO 114 10 result is assigned to D When MO is ON DO 2 0111101011011100 31452 shifts rightward for 5 Note bits and the result 240000001111010110 982 is assigned to D10 1 8220 2 When S1 uses Kn addressing Kn must be equal to 4 IVC Series Small PLC Programming Manual 6 7 10 6 7 11 Chapter 6 Application Instructions 125 SHL 16 Bit Shift Left Instruction LAD Applicable to IVC2 WC HH SH 51 D 62 Eines O O OO L SHL S D 63 Operand Applicable elements Operand description Example S1 Source operand 1 mo 31452 28180 LD MO e Sa he ds SHL DO D10 7 D destination operand S2 Source operand 2 Before Rotate leftward 7 bits 1 Function description LSB R 01100 110 1 11 0 0 When the power flow is valid After the data of S1 will shift MSB LSB leftward for S2 bits and the 011111011111110 01 01010 lo o olol result is assigned to D 9 When MO is ON DO 2 0111101011011100 31452 shifts leftward for 7 bits Note and the result 2 0110111000000000 28160 is assigned to D10 1 S220 2 When S7 uses Kn addressing Kn must be equal to 4 DSHR 32 Bit Shift Right
221. e eee e Pint constant PPP IS E IS E E IS Operand description S1 SN of the special module to be read or the target module Range 0 7 If the target module does not exist the system will report target module address invalid S2 The starting address in the BFM of the target module Range 0 32767 If the BFM address is invalid the system will report BFM unit of accessed special module exceeds range D The D element where the data read from the target module will be stored LL LL LL LL ll pv yv AAA S3 The number of consecutive buffer registers single word to be read Range 1 32767 If the target register does not exist the system will report BFM unit of accessed special module exceeds range Function description Read consecutively S3 registers starting with S2 register in the BFM of the target module SN S7 and put them into the S3 word elements starting with D Note The execution time of the FROM instruction is relatively long and closely related to S3 Example MO 997 LD MO NE E aioe 2 FROM 03 D100 2 When MO is ON read consecutively 2 registers starting with register 3 in the BFM of the target module number 0 and put them into the word elements D100 and D101 IVC Series Small PLC Programming Manual 130 Chapter 6 Application Instructions 6 8 2 DFROM Read Double Word Form Special Module Buffer Register Instruction LAD Applicable to IVC2 k DFROM 60 GV
222. e error code stored in SD3 IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description 25 If multiple system errors occur at the same time the system will only write the code of the worst error into SD3 When serious system errors occur the user program will halt and the ERR indicator on the basic module will turn on User program execution error When user program execution error occurs the system will set the special relay SM20 and write the error code into the special data register SD20 If the next application instruction is correctly executed the SM20 will be reset while SD20 will still keep the error code The system keeps the codes of the lastest five errors in special data registers SD20 SD24 and form a stack If the code of the current error is different from the code in SD20 the error stack will be pushed down as shown in Figure 2 16 New user program eror J Error record 0 Error record 1 Error record 2 Error record 3 Error record 4 WW Discard Figure 2 16 Push operation of the error stack Only when serious user program execution error occurs will the user program halt and the ERR indicator on the basic module turn on In less serious cases the ERR indicator on the basic module will not turn on Checing the error information on line Connect the PLC with your PC through the serial port and you can read various
223. e is interrupted with ABSM being set OFF during the ABS trasmission the servo amplifier will report overtime alarm AL E5 Note 5 These signal ons definitions will change upon ABSM set reset See the related Mitsubishi product information IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 201 Note The ABS instruction supports the Mitsubishi MR J2 and MR J2S servo amplifiers and use its specialized data transmission protocol to read the current value of absolute position The ABS instruction is a dedicated 32 bit instruction For the servo amplifiers of other brands reading the current value of absolute position requires communication or other designated methods When the ABS instruction is executed the related I O points will be processed accordingly Therefore the ABS instruction is applicable only to Mitsubishi servo amplifiers 6 17 12 Application Examples Mechanical diagram Refer to Figure 6 2 and see the following example of an absolute coordinate system based on a single screw rod System wiring diagram 0418
224. e locating instructions of IVC series small PLC is shown in the following figure Zero return spee Crawling speed Position Return start point Cc pam 0 xX Reverse direction Proximity detection front Forward limit Forward direction e o Proximity signal Zero point back detection device Return limit switch Workbench Forward limit switch O O O O o of l E O O Servo motor Screw rod A N Proximity signal state S e Workbench position Figure 6 2 Absolute position system based on locating instructions of IVC series small PLC In this system the servo motor drives the screw rod which in turn drives the workbench The location of the workbench in the stroke is detected by an absolute PG During the zero return the servo motor will decelerate to the crowling speed when the proximity sensor detects the fore end of the workbench When the proximity sensor detects the rear end of the workbench it sends the zero returned signal to the PLC to stop high speed pulse output Note that the forward limit switch and backward limit switch are a must Because the zero return instruction ZRN is incapable of auto searching the proximity signal the zero return operation must star
225. e output instructions PLSY PLSR or PLS at the same time do write a PLC program so that registers SD80 SD83 can be updated correctly IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 195 Limits on the actual output frequency of locating instructions The minimum frequency of the actual output pulse upon the execution of locating instructions is limited by the following formula Pax X500 mun acc T Where ee is the highest frequency set in SD85 or SD86 T is the acceleration or deceleration time unit ms set in SD87 and the result E is the minimum output frequency If the output frequency specified in the locating instruction is F the possible three output frequencies are O No output when F is smaller than the minimum frequency or bigger than y s bad when F lt deene ae eo F when e n EFS GO 6 17 5 Notes On Servo Amplifiers Set the pulse input mode of the servo amplifier or stepping drivers like this O Pulse train input mode instruction pulse instruction direction O Pulse string logic negative logic effective on the trailing edge 6 17 6 Special Elements Related To Locating instructions Monitors of high speed ne output channels OLIPU control instruction can disable the high speed pulse output control instruction SM80 amp SM81 enables the function YO high speed pulse YO high speed pulse output a aa SS a we amt Y1 high Spec pulse Y1 ngn speed pulse output y y GEET ou
226. e saving range will be set to zero If the battery backed files are lost or incorrect the system will set all elements to zero Setting saving range You can set the device range in the Saving Range tab of System block See Figure 2 2 and the following example IVC1 series PLC supports only one group of saving range IVC2 series PLC supports two saving groups that form a union Example IVC2 Set M100 M200 as the saving range in Group 1 Set M300 M400 as the saving range in Group 2 In effect both M100 M200 and M300 M400 are set as the saving range IVC Series Small PLC Programming Manual 2 1 8 2 1 9 2 1 10 Chapter 2 PLC Function Description 13 System block Input Point Advanced Settings Communication Port Saving Range Output Table Set Time Input Filter Default value Group 1 Element Starting position for Number of type saving Element Elements saved M 1100 100 2 Clear 500 492 Clear 500 1500 Clear Heek 100 100 Clear 49 er lied ler es 4 gt ler lt gt eo ele E 246 10 Clear Group 2 z Element Starting position for Number of tune saving Element Elements saved M 300 100 8 Clear 500 492 Clear 500 1500 Clear 220 ei E Clear ele liar iaa gog ag E 10 w Clear The config parameters must be downloaded before they become effective Not all types of PLC support each system block option View the system block option supported by the PLC by pressing F1
227. eared and the timing coil output will be OFF T1 timing value 4 When the system executes the instruction for the first time it will reset the timing coil of the designated T element and clear the timing value IVC Series Small PLC Programming Manual 66 9 4 2 9 4 3 Chapter5 Basic Instructions TONR On Delay Remember Timing Instruction LAD LY HL TOR IL TONR D S Operand Type 2 Wer Operand description D Destination operand S Source operand Function description 1 When the power flow is valid and the timing value lt 32 767 the designated T element D start timing the value will increase with the lapse of time When the timing value reaches 32 767 it will maintain at 32 767 2 When the timing value 2 the preset value S the timing coil output of the designated T element will be ON 3 When the power flow is OFF the timing will stop the timing coil and the timing value will maintain the current value TOF Off Delay Timing Instruction LAD HH TF ui 5 Applicable elements lp poo po T II Applicable to IVC2 IVC1 Program steps Offset addressing Example MO 32787 LD MO TOHR Ti 5 TONR T1 5 Ti YO LD T1 OUT YO Time sequence chart T1 timing value Applicable to IVC2 IVC1 IL TOF D S Program steps MON Ee Applicable elements Offset addressing EEE TO ee ee ee ee Operand description D destination operand S
228. ed to D10 D11 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 113 6 5 15 SEGI Word To 7 Segment Encode LAD Applicable to IVC2 WC IL SEG S D Program steps l Offset Applicable elements ae 0 WORD Constant knX Kay KoM KoS KolM KsSM OT SOT ery y CERN E Operand description Note S Source operand S lt 15 When S gt 15 the system reports illegal operand and will not execute the D Destination operand instruction and D will not change Function description Example When the power flow is valid x 15 113 LD ai SEG 10 D10 SEG DO D10 S will be converted from integer to 7 segment code and the result is assigned to D When X0 is ON DO Ox0F 15 will be converted from integer to 7 segment code and the result 0x71 113 is assigned to D10 6 5 16 ASC ASCII Code Conversion Instruction CAD a ie nm Cer e o Program steps 9 OOOO l Offset Applicable elements deso ST WORD Constant 52 WORD Constant ER Constant si WORD Constant 55 WORD Constant S7 Constant 58 WORD Constant Operand description Example S1 S8 Source operand If the number is less than 8 MO wae E SCT the remaining elements shall be filled with 0 Only characters with ASCII code of 0x21 Ox7E are LD MO supported input through keyboard if the number is ASC 12345678 DO less than 8 fill in with 0X00 When MO is ON execute the ASCII conversion and D destination ope
229. eeeeeeeeeeeeesaeeeeeseeeeeeseeeeeseaeeeesaaeeeeseeseesaneeeesaaeees 120 6 7 3 RCR 16 Bit Carry Circular Shift Right Instruchon 121 6 7 4 RCL 16 Bit Carry Circular Shift Left Instruchon 122 6 7 5 DROR 32 Bit Circular Shift Right Instruchon 122 6 7 6 DROL 32 Bit Circular Shift Left Instruchon sorena E a a a aE aaa raae 123 6 7 7 DRCR 32 Bit Carry Circular Shift Right Instruction ccocooccncccoccncconcnnnnoncnnononononnncnnnonncnnnnnnnnnnnnnnnonnnoos 123 6 7 8 DRCL 32 Bit Carry Circular Shift Left INStruction nasies innia enade a aariaa eaaa aira aE Ranai 124 6 79 SHR 16 BitSNERONECNOrA E Teen WE 124 6 7 1 0 SHL2 TOBC Smite BE Ee Ed ee ds 125 6 77 11 DSHR 32 Bit Shit RAS ee ee 125 6 712 DSL 62 Bil nh Wem le Ed Le E 126 6 TAS OF ER SNR RONE Byte VS UIC HOM EE 127 6 14 SF TL S ift Left Byte IMSWUCUON EE 128 6 9 EXtemal Equipment AStTUCION A A A A eee oe 129 6 8 1 FROM Read Word Form Special Module Buffer Register Instruction ccccseecceeeeeeeeceeeeeeseeeeesaeeeeesaaeees 129 6 8 2 DFROM Read Double Word Form Special Module Buffer Register Instruction ccccecceesseeeeeeeeeeesaeeees 130 6 8 3 TO Write Word To Special Module Buffer Register Instruction cccccccseeeeeeeeeeeeeeeeeeeeeeeeseeeeesaeeeeesaaeees 131 6 8 4 DTO Write Double Word To Special Module Buffer Register Instruction ccccccseceeeeeeeeeeeeeeeeseeeeeeeneeees 132 6 8 5 VRRD Read Analog Potentiom
230. een mL gt RET O As shown in the LAD program the S2 step starts with a STL instruction and the following TON instruction is the internal instruction of S2 A step can be made up of multiple instructions A SFC step is actually a relatively complete program section almost consistent with the LAD counterpart The difference between a initial step and an normal stepis that they use different S elements For detailed information about the STL instruction see 5 3 1 STL SFC State Load Instruction Note that when the step changes from ON to OFF the destination operands of its internal instructions will be cleared Such instructions include OUT TON TOF PWM HCNT PLSY PLSR DHSCS SPD DHSCI DHSCR DHSZ DHST DHSP and BOUT LU Note Because the PLC runs in continuous scan cycles after a step transition the instructions of the original step will not be affected by the change of ON to OFF until the next scan cycle See 7 4 1 Common Programming Errors SET Instruction As shown in the preceding figure the transfer symbols in the SFC program on the right are realized through the SET instructions in the LAD program on the left The transfer conditions consist of the NO contacts before the SET instruction The NO contacts are controlled by internal instructions or through external operation When the power flow of the SET instruction is valid the specified step becomes valid and the current valid step is invalidated A step transfer i
231. eeter __ o e BOUT Word bit coil Word bit coil output instruction instruction E a e eae E eg master station communication Modbus instruction XMT Free port sending Free port sending XMT instruction instruction ea du MAN E port Free port receiving RCV instruction Poona ante ROT src instruction K VEWD FREQUENCY CONVERTER forward rotation instruction NVERTER IVREV FREQUENCY GEN reverse 166 rotation instruction FRE ENCY CONVERTER t h IVDFWD Ge Sen Ke y 166 forward rotation instruction Communicati FRE ENCY CONVERTER t h IVDREV Ge SE E d 167 on instruction reverse rotation instruction FREQUENCY CONVERTER st istop REQU SR y 167 instruction FREQUENCY CONVERTER set IVFRQ E S y 168 frequency instruction FRE ENCY CONVERTER write singl IVWRT ENS Ce 10 y 169 register value instruction FREQUENCY CONVERTER d stat ivapst REQU ek 10 y 170 instruction FRE ENCY CONVERTER d singl VRD T C read single 10 J 474 register value instruction IVC Series Small PLC Programming Manual 302 Appendix 10 Classified Instruction Index Program Infl SC fla CCITT CCITT check instruction WK E eg CRC16 CRC16 check instruction 175 struction ere Ga aa nn a Se LRC LRC check instruction 176 if N ERC checkinsiucion DOMP Compare date instue on r CT compare _POMP gt Compare date gt mron 17 IT Im ate SONAS Compare dates Ce NI zl Dome emae een EES DO
232. egister address in the BFM of the target The execution time of the DTO instruction is relatively long and closely related to S4 module Range 0 32767 If the BFM Example address is invalid the system SMa LD SMO will BFM unit of accessed ll SC IDTO 0 8 16711935 1 special module exceeds range When PLC runs write a double word data 16711935 to buffer registers 8 and S3 The data to be written into 9 which forms a double word element in the BFM of target module number the target module 0 S4 The number of consecutive buffer registers double word to be written 6 8 5 VRRD Read Analog Potentiometer Value Instruction Applicable to IVC2 IVC1 IL VRRD S D Program steps Offset Operand Type Applicable elements addressing ls woRD Constat pb woro lb ivi y Operand description Function description S The specified potentiometer SN Range 0 Read the value of the specified analog potentiometer and store 255 If S is set outside this range the it into the specified element system will report operand error Example D The element where the read analog MO Ta LD MO potentiometer value will be stored Range 0 m ee ug VRRD 0 D10 290 When MO is ON read the value of analog potentiometer 0 and put the reading into D10 IVC Series Small PLC Programming Manual 6 8 6 REFF Set Input Filtering Constant Instruction 6 8 7 LAD H EF e Chapter
233. elay timing instruction dT P TMON Monostabie imingimstucton 5 III E e a a O a ERE N we 16 bit counter loop cycle counting instruction anotan EE CECR RER Dependent CALL Calling a subprogram on the y y 79 program CSRET Conditional return from user subprogram et CFEND_ Conditional end from user main program Conditional return from user interrupt ee MECA Rete fr gt 9 EE WOT User program watchdogreset o y YO STOP Userprogamstop AAA EN Enable interuptinstucton dT PY DI Bisabie interuptinstucton dT CP e StL SFe stete eed insun dT IR EE PCC AAA RST SI SFC stato reset OA mr SrCprogramend AA EN Mm IVC Series Small PLC Programming Manual Appendix 10 Classified Instruction Index 297 Program Infl Ge fla MOV Move word data transmission instruction word data transmission instruction a ve de OO GC word data transmission instruction transmission instruction BMOV Move data block transmission instruction data block transmission instruction a ee ee ee a a EC XCR een ene ea r e pa Fi ata bocken 17 oe EAEE ck dob wor ER E nstrcton _WSFR_ Shittrghtwordinsirucfon CT CT P instruction wer shite wordinstuaion o v as PUSH Pushinsincion 17 ew PY GER zo IO IN IN Zero Carry Borrow Zero Carry DADD Add double integer instruction 10 y y 93 Borrow Zero Carry SUB Subtract integer instruction 7 y y Borrow Zero Carry
234. element to all slave stations It supports 1 bit element at most 1 Request frame Address Function code 06H Starting address Written element value Check code ORC OER 2 Response frame Response frame is the repeat of Request frame Address Function code 06H Starting address Written element value Check code CRS 3 6 Return Diagnostic Check 0 x 08 Diagnostic register and communication error information can be obtained through returning diagnostic check Diagnostic code Description 0x00 Return Request frame 0x 01 Restart Comm Option 0x 04 Listen Only Mode of Slave Station Ox0a Clear Ctrs and Diagnostic Reg Ox0b Return Bus Message Count OxOc Return Bus CRC Error Count Ox0Od Return Bus Exception Error Cnt Ox0e Return Slave Message Count OxOf Return Slave No Response Cnt 0x12 Return Bus Char Overrun Cnt The frame description of sub function code is as follows Return request frame 0x00 1 Request frame Function word Any character Check code doe A Ee OOH f o CRC or LRC 2 Response frame Return request frame intact i Function word Any character Check code hades Jee le A sc Ooo f o CRC or LRC Restart communication option 0x01 After receiving the frame PLC will exit from Listen Only mode Broadcast frame is supported 1 Request frame The normal Data field is 0x00 00 or Oxff 00 Address Function code 0x08H Data field Check code 0x00H 0x01H CRC or LRC 2 Response frame
235. eleration Deceleration Output Instruction Applicable to IVC2 IVC1 Influenced flag bit Program steps Applicable elements operand error and the acceleration or deceleration time will be uncertain LU Note For IVC1 the acceleration deceleration time must not be smaller than 50ms The speed change is evenly divided into 10 steps during the acceration or deceleration each step being S1 10 D high speed pulse output point Range YO Y1 Function description The PLSR instruction is a high speed pulse output instruction with acceleration deceleration function It is used for locating Targeting at the specified maximum frequency the pulse output will accelerate evenly After the output pulse number reaches the preset value the pulse output will decelerate evenly Programming Manual 154 Chapter 6 Application Instructions The operation process is shown in the following figure S1 highest frequency 10 2000Hz A Output YO or Y1 S1 total output pulse number 110 2 147 483 647pls W gt Speed change in one step is at most 1 10 of S1 S9 acceleration time Note 1 The output frequency of this instruction is 10 20 000Hz When the acceleration deceleration rate exceeds that range it will be automatically adjusted according to that range This instruction is free from t
236. ement and the following figure S3 5 current output value D1 according to the hackle wave height and step number When the output value reaches S2 it will be initialized as S7 and the state output D2 will be set ON If the power flow in the next scan cycle is still ON D2 will be set OFF to produce the next hackle wave If the power flow falls the output state D2 will be OFF and the output value D7 will keep its current value until the next rising edge when the output value D1 will be initialized as S17 and the next hackle wave will be created as shown in the following figure IVC Series Small PLC Programming Manual 162 Chapter 6 Application Instructions Note When X1 is ON output the result of ramp function to external DA module to generate hackle waveform 1 If the result is not divisible when calculating the LD X1 program steps round off to the nearest whole TO 01D10 1 number l l The LAD for the preceding instruction is shown in the 2 The instruction will generate a series of eg following figure continuous hackle wave data so long as the SMI 0 power flow keep ON Wm o DO 3 When S1 S2 D1 S2 D2 ON no counting 2000 MOV 2000 DI pulse xO a 2000 1554 OFF 4 The total number of RAMP HACKLE and HACELE DO Di Dio 1000 MO TRIANGLE instructions in a program should not Ger i exceed 100 1 When XO is ON D10 in the first cycle D10 DO 0 Example BS will increase by 2 2000 1000
237. enced flag bit L ENCO Program steps 5 Operand T Applicable element SE eran e icapie elements j SE dl addressing E EIA EIA IA A o m Rav Rn ns e soe pr Pv zp Operand description Note When the value of multiple bits in S is 1 the smallest bit number will be written D destination operand into D as shown in the following figure SE MO 2 Function description LB ENCO 1100 Td When the power flow is valid S source operand assign the number of the bit Example whose value is 1 in word e EH e LD MO element S to D ENCO 2 0010 DO When the power flow is valid operand 1 is 240010 bit 1 is 1 hence 1 is written into DO IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 179 6 14 5 BITS Counting ON Bit In Word Instruction Applicable to IVC2 IVC1 S Influenced flag bit OO L BITS Program steps 5 O Offset Operand Type Applicable elements i addressing Operand description Example E SE B LD SMO 4 Seen aparana Bu Safe ost oh BITS 16 FOFO D1 D destination operand DE l When the power flow is valid it is counted that there are 8 bits whose value Function description is 1 ON status in constant 16 FOFO so 8 is stored into D1 When the power flow is valid count how many bits in operand S is 1 and store the result into D 6 14 6 DBITS Counting ON Bit In Double Word Instruction Applicable to IVC2 IVC1 5 Influenced flag bit IL DBITS S Program ste
238. ents are reserved Avoid using those elements in the user program For details see Appendix 3 Reserved Elements 2 1 2 System Running Mechanism Scan Cycle Model IVC series PLC basic module runs according to the scan cycle model The system cyclically executes the following four tasks one by one user program execution communication internal tasks and UO update Each round is called a scan cycle Execute user program Refresh UO Communication Internal tasks Figure 2 1 PLC operation mechanism User program execution The system will execute user program instructions one by one from the beginning till the main program ending instruction Communication Communicate with the programming software to receive and respond to the instructions such as download run and stop Internal tasks Processing various system internal tasks such as refreshing panel indicators updating software timer refreshing special auxiliary relays and special data registers UO update The I O update includes two stages input update and output update Output update open or close the output terminal based on the value of the corresponding Y device ON or OFF Input update convert the ON or OFF state of input terminals to the value of the corresponding X device ON or OFF 2 1 3 Watchdog Function For User Program Execution The watchdog function enables the system to monitor the user program execut
239. ents in the preceding table IVC Series Small PLC Programming Manual Appendix 4 Modbus Communication Error Code 217 Appendix 4 Modbus Communication Error Code Error codes Description Illegal functional code Illegal register address 0x03 Data number error Data number eo OS S SOS ro IVC Series Small PLC Programming Manual 278 Appendix5 Inverter Instruction Error Code Appendix 5 Inverter Instruction Error Code Error code Description Illegal functional code Illegal register address 0x3 Data error data outside the range Slave operation failure including the error due to invalid data although the data is in the range 0120 IVC Series Small PLC Programming Manual Appendix 6 System Error Code 279 Appendix 6 System Error Code Eror ype ver 102 CON CCT AS IN E mo eme A O MEAN System hardware error User program stops and ERR indicator turns on 10 SRAM error System error To remove this fault power off the PLC and y check the hardware User program stops and ERR indicator turns on 11 FLASH error System error To remove this fault power off the PLC and y check the hardware User program stops and ERR indicator turns on 12 Communication port error System error To remove this fault power off the PLC and y check the hardware User program stops and ERR indicator turns on Real time clock error System error To remove this fault power off the PLC and y check the hardware User program stops
240. epts Chapter 4 Programming Concepts This chapter details the programming of IVC series small PLC including the programming language program components data type addressing mode and annotating function The programming and usage of subprograms are also introduced and finally the general explanation of instructions eal A OLS tama Language A NTN 45 AA MAD e a o e e id e e o o de ee 45 A A AS oa 46 a Fase Dion E ATS 46 42 Program Components sc A AAA 47 A EE Die ar rl A O aca 47 4 2 2 SY CALA Eeer ee eege ee 47 A ele EE 47 4 3 Block Comment And Variable Comment 47 MO VN IBIOCK COMNEN EE 47 4 32 Vanale COMME A A 48 SE A aeia 26 sees aue eae tet seat neas meses dal seas era EA A ae teeeecueantas cape toacee EAE A 50 Ee rie EE 50 A 4 2 Points FO Note FOr USINO OBRAS sunno 50 44 5 SBR Local Vatiable Table e doi da ina 50 4AA SBR Parameter Mansion dci odiado aii 51 AA EXA a A ee ee eee ee ae ee et eee eee eae ee 51 4 5 General Information DETNASIUCUONS tios 52 ol INSUUCHON Opera Sd o 52 ES EE 52 AD IMIS Ke Si Er ie ei E SAC tana rca dl ici 53 IVC Series Small PLC Programming Manual 4 1 4 1 1 Chapter 4 Programming Concepts 45 Programming Language Three programming languages are provided ladder diagram LAD instruction list IL and Sequential Function Chart SFC LAD Concepts The LAD is a widely used diagram programming language similar to the electric relay control diagram It features 1 Left
241. equency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O Example Main user program Mi SMZ36 Lt F LD M1 mo D OUT SM236 HCHT C236 1000 LD MO Mz Gs Gen m DHSCI 2000 C236 20 DHECI 3 l ip C236 C236 Y11 gt OUT Y11 Interrupt No 20 mio ar LD M10 m eu OUT Y20 DO 100 gt LD gt DO 100 0 OUT Y12 Hoy 8 0 D MOV 0 DO 1 When M1 is ON C236 will count in the interrupt mode when X0 changes from OFF to ON see Chapter 8 Using High Speed I O for the description of the XO input frequency When C236 changes from 999 to 1000 the C236 contact will be set When C236 changes from 1001 to 1000 the C236 contact will be reset When C236 contact drives Y11 the execution of Y11 will be determined by the user program scan cycle 2 When M2 is ON and the DHSCI instruction meets the requirements stated in the preceding Note interrupt No 20 will be executed immediately when C236 reaches 2000 regardless of the the scan cycle 3 When MO is ON SM236 is driven and the C236 counter counts down When MO is OFF SM236 is not driven and the C236 counter counts up 4 With pulse input interrupt No 20 will be executed when C236 reaches 2000 and Y20 will be driven when M10 is ON But the output of Y20 is related to the scan cycle Meanwhile Y12 will be driven and DO will be cleared when DO is detected to be large
242. equential structure Multiple objects with different parameters to be processed asynchronously needs a selection branch structure While a cooperation of multiple independent mechanical elements may need a parallel branch structure IVC Series Small PLC Programming Manual 7 4 1 4 1 Chapter 7 SFC Tutor 213 2 Determine the major procedures and transfer conditions to draw a draft flow chart After determining the strucuture you need to figure out the major procedures and transfer conditions By deviding the work flow into smaller operation stages you can get the procedures End each procedure with a transfer condition and you can get the draft of the work flow 3 Make a SFC program according to the draft flow chart Use the SFC programming language in AutoStation to make a SFC program out of the draft flow chart By now you have got an executable PLC program but you still need to refine it 4 Make a list of input and output points and determine the objects of each procedure and the transfer conditions Generally the input points are transfer conditions while the output points are the operation objects In addition with the list you can further modify the SFC 5 Input the steps and transfer conditions In the SFC program you just made right click a SFC symbol and select Embedded Ladder Chart in the shortcut menu You are then able to edit the step or transfer condition through the LAD programming language 6 Add functional
243. er 2 PLC Function Description 9 2 1 Programming Resources And Theories 2 1 1 Programming Resources Table 2 1 IVC1 Programming resources Specification and remarks 1 0 Max UO points 128 theoretical Externsion module E configuration lt 4 sum of I O extension modules and special modules User file Program capacity 12k steps capacity Data block capacity 8000 D elements Instruction 0 3us instruction speed Application instruction Several us per instruction several hundred us per instruction Instruction 32 number Application instruction Device 1024 SO S1023 coe ielon 256 TO 1255 00 256 CO C255 Data register 8000 DO D7999 Local data register 64 VO V63 Offset addressing register 16 ZO Z15 Special data register 256 SDO SD255 16 triggering edge is user configurable corresponding to the rising and falling edge s External input interrupt ee Igu ponding ising g edg of terminals XO X7 High speed counter interrupt Interrupt configuration i PTO output complete gt interrupt Power aie neu UN 2 asynchronous serial communication ports Port 0 RS 232 Port 1 RS 232 or RS 485 Communicatio Modbus Freeport N N bus Invt dedicated protocol 1 to N or N to N communication n function Protocol SEI l XO X1 Single input 50kHz Total frequency XO X5 lt 80kHz High speed counter i i X2 X5 Single input 10kHz 100kHz 2 independent outputs and only for transistor
244. er program protection Download password Gs _ numbers Case sensitive Monitor password AutoStation programmin Programming mode Toi A one 3 IBM PC or compatible computer is required Real time clock Built in powered by backup battery Notes Note 1 The X and Y elements are addressed in octal system For example X10 stands for the eighth input point Note 2 Based on the timing precision the T device addresses fall into three categories 1 100ms TO T209 2 10ms T210 T251 3 1ms T252 T255 Note 3 Based on the width and function of count value the C device addresses fall into three categories 1 16 bit up counter CO C199 2 32 bit up and down counter C200 C235 3 32 bit high speed counter C236 C255 IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description 11 Note 4 The analog potentiometer is an instrument that you can use to set the PLC device value You can use a Philips screw driver to wind the potentiometer clockwise to the maximum angle of 270 and the device value will be set from 0 to 255 Note that the potentiometer could be damaged if you wind it clockwise more than 270 Note 5 The element values can be forcedly set to facilitate commissioning and analyzing user program and streamline the commissioning You can force up to 128 bit elements and 16 word elements at the same time Note 6 The user program can be modified online Note 7 Partial PLC elem
245. error code of illegal address will be returned For example XMT from master station 01 03 25 E5 00 04 5E F2 The starting address for the reading sent by the master is 25 E5 four word elements decimal 9701 Slave station response 01 83 02 CO Ei Slave station response illegal data address 3 If the number of the read elements is not an even number the error code of illegal data will be returned For example XMT from master station 01 03 25 E4 00 05 CE F2 25 E4 The starting address for master station reading 5 word elements Slave response 01 83 03 01 31 Slave station returns illegal data IVC Series Small PLC Programming Manual Appendix 7 Modbus Communication Protocol IVC Series 289 Processing of LONG INT data Based on the storage method of PLC in GCM one LONG INT data can be saved in two D elements For example Store one LONG INT data in D3 and D4 D3 is used for storing high 16 bits D4 is used for storing low 16 bits in Invt PLC If master station reads LONG INT data through Modbus the 32 bit data shall be regrouped based on the LONG INT storage principle of INVT PLC after reading the data Storage principle of FLOAT is the same as the storage principle of LONG INT Description Of Broadcast The slave station supports broadcast but not all the function codes The slave station supports function codes 01 02 03 05 06 08 15 and 16 decimal Wherein 01 02 and 03 can read element but do not support broadcast n
246. esult is O the zero flag bit SM180 will be set IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 105 6 4 12 LN Floating Point Number LN Instruction LAD Fatt WN e inte zoro co boron IL LN S D Operand T Applicable element Gg peran ype ppiicable elements addressing S REAL Constant TI RI CITT ESTE TE E LE E LB E AL IR ES Operand description Example S Source operand x0 1000 000 907755 LD XO W Z P 2 Hd LN DO D10 D Destination operand Function description When X0 is ON get the LN value of DO D1 1000 0 and assign the result 6 907755 to D10 D11 1 When the power flow is valid get the LN value of S1 and assign the result to D 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is O the zero flag bit SM180 will be set 6 4 13 EXP Floating Point Number EXP Instruction CAD Gm e tered nag mi 2 coros IL EXP S D Program steps 7 Offset Type Applicable elements addressing A A AEREAS AAA E 2 RE TL SET ECT Y TY PEL ES Operand description Example S Source operand 0 10 000000 22028 Ap LD XO l EXF 0 DI EXP DO D10 D Destination operand Function description When XO is ON get the EXP value of DO D1 10 0 and assign the result 22026 464844 to D10 D11 1 When the power flow is valid get the EXP v
247. et if D is T element the corresponding timing value will be reset Applicable to IVC2 IVC1 IL NOP Program steps 4 o oooO Function description This instruction does not enable any action 5 2 Main Control Instruction 5 2 1 MC Main Contorl LAD Litt me S2 Note In LAD program this instruction cannot directly connect to the left power flow bus Applicable to IVC2 IVC1 IL MC S Program steps E Operand Type Applicable elements preso s Bas TT Operand description S Source operand IVC Series Small PLC Programming Manual 5 2 2 MCR Main Control Remove LAD Applicable to IVC2 IVC1 i MCR S Influenced flag bit IL MCR S Chapter 5 Basic Instructions 63 Program steps Operand Type Applicable elements Glen p Je PP addressing INT constat fT TI Operand description S Source operand Function description 1 MC and MCR form a MC MCR structure The MC instruction indicates the beginning a MC MCR structure and its operand S is the SN of the MC MCR structure The value of S is a constant ranging from 0 to 7 MCR indicates the end of the MC MCR structure 2 When the power flow before the MC instruction is valid the instructions in the MC MCR structure will be executed 3 When the power flow before the MC instruction is invalid the program will skip over the instructions in the MC MCR structure and execute the instructions after the structure Besides
248. eter Value Instruction cccccceccccseeeeseeeeceeeeeeeeeeseeeeseeeeseaeeeseeeeseeeseeessaees 132 6 8 6 REFF Set Input Filtering Constant InStrucCtiON ccocooccncococnncconcnnononnncnnncnnnnnnnnnnnnnnnnnnnrnnnnnnrnnnnnnrnnnnnrnnnnnaros 133 6 6 7 REF Instant Refresh O ASTUCIA i SE ERS 133 6 8 8 EROMWR EEPROM Write Instruchon 134 6 9 Real Time Clock Instruction a aia lla Ana opa tii io aiii diana 135 6 9 1 TRD Read Real Time Clock Instruction oooccccooncncccoccncnnnnnnnnnncnnonononononcnnonnnrnnnnnnnnnnnnrnnnnnnrnnnnnnrnnnnnrnnnnnneos 135 6 9 2 TWR Write Real Time Clock Instruction oooccccconcnccconcncnoocnnononcnonnnnonononcnnnnnncnnonnnrnnnnnnnnnnnnrnnnnnnrnnnnnnnnnnnnnos 136 6 9 3 TADD Add Glock ASTUCIA a A ai ad 137 6 9 4 TSUB Subtract Clock Instruchon 138 6 35 HOUR Timing LISt MSUUCH OM DEE 139 6 9 6 DCMP Compare Date lt gt lt gt gt lt Instruction oocccoccccooccccccnnconcnononnnonnnnnonnnonncnonnnnononnnonnnnnnnnnnnnnos 140 6 9 7 TCMP Compare Time lt gt lt gt gt lt Instruction occconccccocnccccnnncncnccnnnncnnnnnnannnnncnonnnnononnnonannnnnnnnnnnos 141 610 Fidi speed VO ISIC TOM D 142 6 10 1 HCNT High speed Counter Drive Instruction ccccccssecccceeececeeeecceeececseseecseseeseseecseeeesseeeeessuseessaeees 142 6 10 2 DHSCS High speed Counting Compare Set Instruction occccooccncccccnncnonnnnonononononnnnnn
249. ether six data types as listed in the following table Table 3 2 Operand data types Data type Type description Data width Range BOOL ON OFF 1 0 32768 32767 16 32 2147483648 2147483647 Signedinteger 16 DINT SE double integer WORD Word e emeng DWORD Double word 0 4294967295 16 0 16 FFFFFFFF REAL Floating point 1 175494E 38 3 402823E 38 Correlation Between Elements And Data Types The elements used as instruction operands must have suitable data types The correlations are listed in the following table Table 3 3 Elements and data type correlations Elements soor ae EEN eee Ie A HE x Moi y pop y o a O A A LL LL LL II II mr NET Et EEE O ee NEE ee ee ee eee eee A ee ERC ee A AE Eo ee ee ee ee ee ee ee ee eee ee ee joworo A eS ELE ESE ELSA ee EE ee ee ee EN AO WEE E 00 OO OS O 0 A ok OSO AE E lO e A E If an instruction uses an operand with unsuitable data type the instruction will be deemed illegal For example instruction MOV 10 XO is illegal because operand 2 of the MOV instruction is of signed integer data type while the X0 element can store only Boolean data LJ Note 1 When the operand is of INT or WORD type the applicable elements include KnX KnY KnM KnS KnLM and KnSM where Ilsns4 2 When the operand is of DINT or DWORD type the applicable elements include KnX KnY KnM KnS KnLM and KnSM where 5S nS 8 3 When the operand is of INT or WORD type the appl
250. etting disabled enabled S3 2 input filter constant a Range 0 99 Zero means no input filtering function S3 3 proportional gain Kp Range 1 32767 S3 4 integral time constant Tl Range 0 32767 x100ms Zero means limit or no integral S3 5 differential gain KD Range 0 100 Zero means no differential gain S3 6 differential time TD Range 0 32767 x10ms Zero means no differential processing S3 7 S3 14 internal data register for PID operation S3 15 PID process value positive change alarm point Range 0 32767 when bit 1 of S3 7 is 1 S3 16 PID process value negative change alarm point 0 32767 when bit 1 of S3 1 is 1 S3 17 PID output value positive change alarm point 0 32767 when bit 2 amp bit 5 of S3 1 are 1 8 0 respectively Output upper limit 32768 32767 when bit 2 amp bit 5 of S3 1 are 0 amp 1 respectively S3 18 PID output value negative change alarm point Range 0 32767 when bit 2 amp bit 5 of S3 7 are 1 8 O respectively Output lower limit 32768 32767 when bit 2 amp bit 5 of S3 1 are 0 amp 1 respectively S3 19 PID alarm output Bit 0 process value positive change overflows O Bit 1 process value negative change overflows Bit 2 output value positive change overflows O Bit 3 output value negative change overflows Where S3 S3 6 are the mandatory user set operands while S3 15 S3 19 are optional user
251. external interrupt is executed we en en la System block ES Cross reference table EH 2 E Element monitoring table ei EMT_1 2 Refresh the output immediately E a Comm equipment connecti c Configuration table SMO HH REF YO 8 Program a name ENT y Author Interrupt op input rising edge interrupt Interrupt no event Program description le e J Project Man Instruction lt 2 Write El instruction in the main program and set SM40 the interrupt enabling flag of XO input rising edge interrupt valid Project Manager aX 5 MAIN HANT 1 H j 9 4 Variable addr Variable Name Variable Type Data Type Comments Gi Program block TEMP BOOL MAIN SBR1 Bi INT_1 EN Global variable table y Datablock y System block ES eS Cross reference table H Element monitoring table ei EMT_1 Ea Comm equipment connection B Configuration table of MD Rllow the request of enabled interrupt to join the request queue SMO eH EI lt gt xg Project Manager e Instruction Tree lt gt IVC Series Small PLC Programming Manual 240 Chapter 9 Using Interrupts 9 5 High speed Counter Interrupt Description The high speed counter interrupt must be used together with the HCNT instruction or DHSCI instruction and generates high speed counter interrupt based on the value of the high speed counter You can compile programs related to external pulse input in t
252. f bit S2 in element S7 and use it in serial connection with other nodes to drive the operation of the following operation 6 15 4 BANI Word Bit Contactor AND Instruction LAD EY BLD 6p 52 E gt Applicable to IVC2 WC Note because the logic relationship is visualized in the diagram the BANI instruction is displayed in LAD as BLDI Influenced flag bit IL BANI en S2 Program steps 5 2 OO O Offset Applicable elements addressing Sr wo aX Ka Kat e Ral RaSM o SOT CT TV Tz Kew Ros Kot ksn bso or vz gt Operand description Example SI source operand a SS a Se des S2 designated bit 0 lt S2 lt E P SS S GER va EE Take the logic NOT of the status of BITS ON in element DO 1000 epon cG 2 0000001111101000 which is OFF and use it in serial connection with Function description other nodes X0 ON to determine the status of YO in the following Take the logic NOT of the operation status of bit S2 in element Si and use it in serial connection with other nodes to drive the operation of the following instruction IVC Series Small PLC Programming Manual 182 Chapter 6 Application Instructions 6 15 5 BOR Word Bit Contactor OR Instruction LAD 1 T Applicable to IVC2 WC BLD SI 52 Note because the logic relationship is visualized in the diagram the Influenced flag bit BOR instruction is displayed in LAD as BLD eem een IS Program steps 5 ooo Offset Applicable elements ge a
253. f period is y d O when the user program starts SM15 Scan cycle This bit reverses once every scan cycle The first period is O when the user program y y oscillation bit starts 3 User Program Execution Error Action and funcion veuve M20 Instruction execution This bit is set upon instruction execution error Ths corresponding error type error code is written into SD20 This bit is cleared after the execution succeeds S Instruction register e s This bit is set upon instruction execution error The corresponding error type M21 number subscript overflow SM22 Instruction parameter This bit is set upon instruction execution error The corresponding error type illegal code is written into SD20 This bit is cleared after the execution succeeds IVC Series Small PLC Programming Manual code is written into SD20 264 Appendix 1 Special Auxiliary Relay 4 Interrupt Control XO input rising falling edge interrupt enabling flag bit X1 input rising falling edge interrupt enabling flag bit Enable when setas1 RW V vo errereen edge Interrupt enabling Tag bt Enable when setesT RW v v X3 input rising falling edge interrupt enabling flag bit X4 input rising falling edge interrupt enabling flag bit Enable when sel as RW Vv vo Sas XS input sinalng edge Interrupt enabling Tag Et Enable when setest RW v v X6 input rising falling edge interrupt enabling flag bit X7 input rising falling edge interrupt enabling flag
254. f the specified value is outside this setting range it will be regarded as 10 or 20 000 depending on which limit it breaks In that case the system will report operand illegal and the high speed pulse output will be based on the default 10Hz or 20 000Hz S2 total output pulse number PLS Range 110 2147483647 When S2 is outside this range the system will report instruction operand error output no pulse and no hardware resources will be occupied S3 acceleration or deceleration time ms If S7 x S3 lt 100 000 S3 will be regarded as 100000 S7 Meanwhile the system will report instruction operand error and the acceleration or deceleration time will be uncertain If S71 x S3 gt S2 x 909 S3 will be regarded as S2 x 909 S1 Meanwhile the system will report instruction IVC Series Small PLC Chapter 6 Application Instructions 153 SD52 the MSB of the output pulse number at Y1 for PLSY and PLSR instructions SD53 the LSB of the output pulse number at Y1 for PLSY and PLSR instructions SD54 the MSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions SD55 the LSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions 6 SD50 SD55 can be changed with the instruction DMOV or MOV or through the ConstrolStar software 7 Refer to the DHSP instruction if you want to use the input pulse number to control the PLSY output pulse frequency 6 10 10 PLSR Count Pulse With Acc
255. fied or the elimination will be conducted otherwise In both cases M3 will be reset in S32 to prepare for the next procedure Start amp stop control program section Initial empty step When a XO nising edge is EE The labelling procedures The eliminating procedures The capping procedures M3 qualification Transfer conditions Oe l ben Jump when Jump upon Jump upon Capping operation no bottle is disqualified qualified i in position product product Elimination operation Mark the qualified l l Mark the qualified l Reset the M3 product M1 _ product M2 disqualification flag Parallel merge Transfer the qualification flag states from M1 to M2 and from M2 to M3 Maa Start amp stop control program section SEC program section Initial step Transfer condition rising edge of X0 indicating rotary plate in position IVC Series Small PLC Programming Manual 224 Chapter 7 SFC Tutor SET 20 J SET 523 J SET 526 J Bottle in p osition in bo Labeling abeling qu lified Labeling qu alified wn in bo gt un Il 1 in bo on LJ wn in bo RST M2 7 Labeling qu alified Elimination Elimination success IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 225 liminating cylinder VE dsw Eliminating rod out 1 X12 SSS HIP Eliminating rod back Sp AST
256. flow is valid the content of S is assigned to D and the value of S remains unchanged Note 1 The MOV instruction supports signed and unsigned integers If the two operands are both elements the data type is signed integer If the source operand is a signed integer for example 10 100 the destination operand is also a signed integer If the source operand is an unsigned double integer for example 100 or 45535 the destination operand will also be an unsigned integer 2 The corresponding element C only supports CO to C199 Example Xo 500 500 LD ai Wm 0 m0 MOV DO D10 When XO is ON the content of DO is assigned to D10 D10 500 DMOV Move Double Word Data Transmission Instruction LAD HL mm ei IL DMOV S D Operand Type Applicable to IVC2 IVC1 Program steps Offset Applicable elements ds addressing SU o EI e E EC vy o fm EA EEE o soe Pv Operand description S Source operand D Destination operand Function description When the power flow is valid the content of S is assigned to D and the value of S remains unchanged Note 1 The DMOV instruction supports signed and unsigned double integers If the two operands of the instruction are elements the data types are signed integers If the source operand of the instruction is a signed double integer for example 10 100 the destination operand will also be signed integer If the source operand is the unsigned doub
257. g figure with LAD on the left and SFC on the right 1 Selection branch A branch step is validated when its corresponding transfer conditions are met You must ensure that the transfer conditions of different branches are all exclusive so as to make sure that each time only one branch will be selected As shown in the preceding figure steps S27 and S28 in row N12 of LAD program are transferred from conditions M20 and M21 respectively The conditions M20 and M21 must not be met at the same time in order to ensure that S27 and 28 will not be selected at the same time 2 Selection merge The selection merge is the structure where all selection branches merge to the same step The transfer conditions are set respectively As shown in the preceding figure the transfer condition in the branch of S27 is that time is up for T12 while that for the branch of S28 is that time is up for T13 However the results are the same step S29 starts IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 209 Parallel branch structure The parallel branch structure is shown in the following figure with LAD on the left and SFC on the right 1 Parallel branch When the transfer conditions are met for the parallel branches all branch steps will be validated at the same time This enables the PLC to process multiple procedures at the same time a quite usual sequential control process As shown in the preceding figure in program row N5 the ste
258. gram 78 6 110 STOR User Program oops a A lod 78 BACALL Calling ASubprodra M eanna o a e a a io a dd 79 6 1 12 CSRET Conditional Return From User Gubporogram nne 79 0 2 Data FFANSIMISSION as tU acido das 80 6 2 1 MOV Move Word Data Transmission Instruction ooccccconnnccnoccnnononnncnnncnnnnnnnnnnnnnnnnnoncnnnnnncnnonnnnnnnnnrnnnnnncnnos 80 6 2 2 DMOV Move Double Word Data Transmission Instruction oocccconccncccccnncnonnnnononononnncnnonononnnnanononnnrnnonnncnnos 80 6 2 3 RMOV Move Floating Point Number Data Transmission ccccooccncccoccnccnncnncnonnnccnnncnnnnnnnnnnonnnnnnanonnnnnrnnnnncnnos 81 6 2 4 BMOV Move Data Block Transmission Instruction ococoonccccnoccnnononnncnoncnnnnnnnnnnnnnononnncnnnnonnnnnnnrnnnnnarinnnnnnnnss 81 6 2 5 FMOV Fill Data Block Instruction oooccccooccncconcnncnoncnnnnnnononnnnnnononnnnnnnronnnnnrnnnnnnrnronnnnnnnnnrnnnnnnrnrrnnrrnnnnnnnnss 82 6 2 6 DFMOV Fill Data Block Double Word Instruchon 82 OZ SWAP Swap DOS ii A ia 83 a a A ceguacneestantd tants eadansectat cueaecasic yanks i 83 6 2 9 DXCH Exchange Double Word Instruction oooccccconccncccccnccnoccnnonononcnnncnnnnonnnnonnnononnnnnnonnnnnnnnnnrnnnnnrnnnnnncnns 84 6210 PUSH PUSO TAS TUCU od oe 84 02 1 FIFO e E ele MS CON aia tai tddi ida ld 85 02 12 LIPO LAS EIM First OUtIN S TUCU avril 86 6 2 13 WSOP SNRA RIONE WV Ord INStUCIO BEEN 87 6 2 AAV SPE Shit Leth Word InStTUCUON rs lili eli bie 88
259. h speed pulse output mointor ON busy OFF ready R v V SMBS Reset function vaid Ouiput of CER signal for ZRN instruction enabled RW V 6 Pulse Capture Monitoring Bit Capture rising edge pulse at input XO RW Vv amer Input X pulse capture monitoring Bit Capture ising edge pulse atina XI RW 4 v awe input pulse capture monitoring Bit Capture ising edge pulse at input zg mei Capture rising edge pulse at input X3 BW Vv ams input pulse capture mentoring bi Capture rising edge eegene al ae Input XS pulse capture monitoring Bi Capture ising edge pulse atinput X5 mei v Capture rising edge pulse at input X6 RW y amer input pulse capture monitoring bit Capture ising edge pulse input X7 RW v v Note 1 All the elements in this table are cleared when the PLC changes from STOP to RUN The pulse capture will fail wnen the HSNT or SPD instruction is being executed at the same input point For details see 6 70 8 SPD Pulse Detection Instruction and 6 10 1 HCNT High speed Counter Drive Instruction 2 For hardware counters the total pulse frequency input through XO X7 using pulse capture SPD instruction or HCNT instructions but not high speed compare instructions is lt 80k For software counters that frequency using instructions DHSCS DHSCI DHSZ DHSP or DHST for driven high speed counters is lt 30k IVC Series Small PLC Programming Manual Appendix 1 Special Auxiliary Relay 26
260. h the time format the system will report Illegal i ane instruction operand value Sp e e i MON Sen SE MOV 23 D10 S2 clock data2 The 3 58 MOV 59 D11 MOY Se D12 storage elements designated MOV 58 D12 23 by S2 are used to store nm 23 non MOV 23 D20 another time data If the data 59 MOV 59 D21 is not compliant with the time GG Del MOV 59 D22 format the system will report Moy eg SC E MO TSUB D10 D20 D30 Illegal instruction operand 27 23 23 value TSWE Di D20 130 LD SM182 in OUT Y10 D time result storage unit E LD SM180 The result of the time 111 OUT Y11 subtracting operation is stored in the 3 storage elements designated by D The result will affect the carry flag SM181 and the Zero flag SM180 1 When X10 is ON send the time data to the 3 storage elements starting with D10 D10 D12 and the 3 storage elements starting with D20 D20 D22 2 When MO is ON subtract the data in D20 D22 from the data in D10 D12 and store the result in the 3 storage elements starting with D30 3 The carry flag SM182 will be set to ON and the zero flag SM180 will be Function description eel io OBE Conduct subtract operation on the time format data with the operation rules following the time format Note The time data for the operation must meet the time setting range requirements Hour 0 23 Minute 0 59 e Second 0 59 IVC Series Small PLC Programming Manual
261. he influence of the scan cycle 2 Use the transistor output During the high speed pulse output the output current must comply with the related regulations The waveform at output points YO Port O Y1 8 Port 1 is related to the load so long as the current does not exceed the rated load current the smaller the load is the closer the output waveform is to the set operand 3 During the execution of the high speed instruction so long as the power flow is not OFF no other instructions can use the same port unless the high speed pulse output instruction is invalid 4 Using two PLSR instructions can output two independent pulses at YO and Y1 You can also use PLSR and the PWM or PLSY instruction to get independent pulse outputs at different output ports YO Y1 5 When multiple PWM PLSY or PLSR instructions work on the same output point the first valid instruction will control the state of the output point and others will not affect the output point state 6 Just like other high speed instructions DHSCS DHSCR DHSZ DHSP DHST and HCNT the PLSR instruction must meet the system s requests on high speed IO IVC Series Small PLC Program gt S5 deceleration time Time sec Example MO OFF Gei FLER 10 110 1000 Y1 OFF FLSE 10 110 1000 Yo LD MO PLSR 10 110 1000 Y1 PLSR 10 110 1000 YO 1 When MO is ON YO and Y1 output 110 pulses respectively at set frequencies When MO changes from OFF to ON p
262. he high speed interrupt program The high speed counter interrupts 20 25 are valid only when the El instruction and corresponding interrupt enable flag are valid Example This example uses the high speed counter function of XO to call the interrupt program number 20 when the external counter C236 reaches the value specified through the DHSCI instruction 1 Compile interrupt program choose an interrupt number for each interrupt subprogram See the following figure for the specific operation Project Manager AX MAIN INT_1 Al gt x EZ wi 9 5 A SE Variable addr Variable Name Variable Type Data Ty ER rogram bloc y e TEM BOOL y MAIN E y SBR lt A INT_1 z Global variable table cj Datablock Drive M800 in the interrupt la System block HES Cross reference table z Element monitoring table EMT_1 cl Ea Comm equipment connection la Configuration table of MD Program INT 1 Sege INT Author Interrupt high speed counter interrupt O Interrupt no Ka event Program description gt Project Manager S Instruction Tree lt gt 2 Write El instruction in the main program and set SM65 the interrupt enabling flag of high speed counter interrupt valid Drive the high speed counter C236 and high speed counter interrupt instruction Project Manager AX 7 MAIN INT_1 altlsl Go call o e H Wy os Variable addr Variable Name Variable T
263. he monitoring mode both the monitoring and editing functions are available In the monitoring mode the displayed elements values are updated automatically The EMT provides functions including editing sequencing searching auto updating of the current value written value forced value of the specified element or variant and unforce See Figure 2 24 for the illustration of an EMT i MAIN ai EMT_1 alrls Element Name data type display formal current value new value 1 ORD Decimal a WORD Decimal 3 WORD Decimal 4 WORD Decimal a WORD Decimal Figure 2 24 Element monitoring table 2 4 7 Generating Datablock From RAM This function can continuously read and display the value of up to 500 D registers in the PLC The results can merge into the datablock or overwrite the original datablock Select PLC gt Generate Datablock From RAM to pop up a window as shown in Figure 2 25 IVC Series Small PLC Programming Manual 30 Chapter 2 PLC Function Description Read The Data Register Value Input the data register address range lo Sab o A max of 500 address values can be read at one time display type Read from RAM Merge to datablock Overwrite datablock Figure 2 25 Reading data register value Enter the range of the datablock to be read click the Read from RAM button and the data will be read into the list after the instruction is correctly executed You can select hex decimal or octal or binary syste
264. he value of the If a non X element is specified the position offset of current value register will decrease the zero point will increase due to the influence of the PLC calculation cycle D starting address YO or Y1 of the high speed pulse output 3 Pay attention to the configuration of SD84 SD87 when using this instruction 4 When the instruction input frequency is smaller than SD84 there will be no high speed output at YO or Y1 When the instruction input frequency is When SM85 clearing function is enabled the CLR bigger than SD85 or SD86 the output will be signals for high speed pulse outputs YO and Y1 are abnormal Function description IVC Series Small PLC Programming Manual Time sequence chart Frequency Pulse output Chapter 6 Application Instructions 197 S1 Zero return speed S2 Crawling speed e Position Zero return starting point e Position Note 1 OFF Clearing signal Width 20ms scan cyclek gt lt gt Within 1ms ON Note 2 OFF ye Position Monitoring of pulse output Note 1 When SM85 is set the clearing function is valid Note 2 SM82 amp SM83 are the monitors of YO amp Y1 pulse outputs respectively 6 17 8 PLSV Variable Speed Pulse Output Instruction LAD IH e PLSV S Operand Type or pont GG oz sor Uwe Operand description S D1 D2 IL PLSV D1 D2 S output pulse frequency Hz 32 b
265. hen S1 uses Kn addressing Kn must be equal to 8 Example MO 3013123244 1499935033 LD MO HL IRE oo Dio T DROR DO D10 7 1 When MO is ON DO D1 2 10110011100110001001110010101100 3013123244 will rotate rightward for 7 bits and the result 2 01011001011001110011000100111001 1499935033 is assigned to D10 D11 The final bit is stored into the carry flag bit SM181 OFF 2 Please refer to the ROR instruction illustration IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 123 6 7 6 DROL 32 Bit Circular Shift Left Instruction 6 7 7 LAD LZ DROL 52 Applicable to IVC2 IVC1 S2 Influenced flag bit Carry L DROL S m 82 Operand Type Applicable elements Offset addressing s1 DWORD Constant Knx KnY Knm Kns KnLM knsM D so c v y b te v y 2 INT Constant Knx KnY KnM kns KnLM knsm _D so c T v zi y Operand description S1 Source operand 1 D destination operand S2 Source operand 2 Function description When the power flow is valid the data of S1 will rotate leftward for S2 bits and the result is assigned to D At the same time the lowest bit of the S2 bits will be stored into the carry flag bit SM181 Note 1 220 2 When S1 uses Kn addressing Kn must be equal to 8 Example MO 3013123244 753280811 LD MO FS Oe D Be a l DROL DO D10 30 1 When MO is ON DO D1 2 10110011100110001001110010101100 301312
266. high address For example a 32 bit data is stored in two D elements D3 and D4 with 16 high bits in D3 and 16 low bits in D4 as shown in the following figure Refer to the description for the specific example High High Low gt 16 bit 16 bit 16 bit ma LOW 16 bit 32 bit data 3 Modbus Function Code Description 3 1 Read coil status 0x01 Up to 256 bit element can be read in IVC series PLC 1 Request frame l Initial address Number of elements Check code Address Function code 01H DES 2 Response frame If the read address is not the times of 8 the remaining bits will be filled with O starting with the high bits IVC Series Small PLC Programming Manual Appendix 7 Modbus Communication Protocol IVC Series 283 Function code Number of bytes read Read data Read data Check code o eg oaan GE 01H n No 1 No n CRC or LRC B B6 BS B4 B3 B2 B1 BO 3 2 Read discrete input status 0x02 In the PLC of GCM series it specially refers to X element The function code only supports the read function of X element with the maximum read number of 256 1 Request frame starting address Number of elements Check code Address Function code 02H EE 2 Response frame If the read address is not the times of 8 the remaining bits will be filled with O starting with the high bits Function code Number of
267. hip between PLC Element and Modbus Communication Protocol Address Protocol Supported T Ph el N Element ysical element Rates EE otes YO to Y377 output status element Y bit 0000 0255 01 05 15 ANEN octal code 256 points in total code YO Y7 Y10 Y17 input status it supports two X bit AU to X377 1200 01455 01 05 15 kinds of address the octal code 256 points in total 0000 0255 element code is same as a O nss f nas 01 05 18 9200 9455 07 05 15 o wa os oo e 50 woa S00 0255 feos e Cz v ozo eo e IVC Series Small PLC Programming Manual 282 Appendix 7 Modbus Communication Protocol IVC series Protocol Supported Element T Ph el t N TO T255 9000 9255 03 06 16 current value of T element C word CO C199 9500 9699 03 06 16 current value of C element SE WORD t value of C element Double word C200 C255 9700 9811 03 16 cron SEN The protocol address is the address used on data transfer and corresponds with the logic address of Modicon data The protocol address starts from O and the logic address of Modicon data begins with 1 that is protocol address 1 logic address of Modicon data For example if MO protocol address is 2000 and its corresponding logic address of Modicon data will be 0 2001 In practice the read and write of MO is completed through the protocol address for example read MO element frame sent from the master Ol Ol 07 DO OO Ol FD 47 oD CRC check
268. hon nnii iiaa aa a aE ea en 61 SKIS INV POWEI FIOW BIOCK INVE EE 61 9 OSEA A a E N 62 OAT IRS TRES a ee ee ios 62 o FTS NOR NO A a a a 62 52 Mall COnMmol ASTUCIA AA AAA A AA 62 21 ME Man Cont ti EE 62 0 222 MGR Mal CONTO REMOVE ds ace 63 o ican eee ae en eee eos 64 SSA SIL SFC Sate Load at elen EE 64 PAS OFE E 64 OD Slate JUM Dexa ee se te ee A hae A 64 5 34 RS TOO SFC State ROS EE 65 0 0 0 md ice EG earen EN WEE 65 Ae DIMI e Ee e RE 65 5 4 1 TON On Delay Timing Instruchon ntre rreren 65 5 4 2 TONR On Delay Remember Timing Instruchon nn 66 5 4 3 TOF Off Delay Timing Instruction cccccceccccssececceeeecceeececceececseeeessuscecseueeesseuseessesecsaueeesseeeeseessesseneeesegs 66 5 4 4 TMON Monostable Timing Instruchon rreren 67 O20 COUMEN INS EE HEEL 67 5 5 1 CTU 16 Bit Counter Counting Up Instruction cocooccnccoccnncnoncnnnnnnoncnnncnnnnonnnnonnronnnnncnnnnnnnnnnnnnnnnnnnrnnnnnnnnnss 67 5 5 2 CTR 16 Bit Counter Loop Cycle Counting Instruchon 68 333 DCN SZ BiP COUNTING INS IUGHOM ii 69 IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 55 5 1 Contact Logic Instructions 5 1 1 LD NO Contact Power Flow Loading Applicable to IVC2 IVC1 IL LD Program steps Beete t Operand Type Applicable elements SS GEN KEE PES PE TEE Operand description Example S Source operand MO 8 gt LD MO bg OUT YO Function description When MO is ON YO is ON Connected
269. icable C elements are CO C199 4 When the operand is of DINT or DWORD type the applicable C elements are C200 C255 IVC Series Small PLC Programming Manual Chapter 3 Element And Data 55 3 3 3 Constant You can use constants as the instruction operands IVC2 series PLC supports input of multiple types of constants The usual constant types are listed in the following table Table 3 4 Constant types Constant pe Valid range EES constant 16 bit signed 8949 32768 32767 integer Decimal tant 16 bit unsi ecimal constant 16 bit unsigned 65326 0 65535 integer EE constant 32 bit signed 2147483646 2147483648 2147483647 integer integer Hex constant 16 bit 16 1FE9 16 0 164 F FFF The hex octal or binary constants are Hex constant 32 bit 16 FD1EAFE9 16 0 16 FFFFFFFF e i veb neither positive nor n iv Octal constant 16 bit 8 7173 SHO 84177777 O themselves When used as operands the Octal constant 32 bit 8471732 8H0 8437777777777 S l Bi 16 bi 2 10111001 2 0 2 1111111111111111 AON ee ace A nary constant T6 bi E a by the data 2 1011100111 2 0 241111111111111111 Binary constant 32 bit EEN type of the operand 3 1415E 16 Compliant with IEEE 754 Th i ft displ Single precision floating point 3 1415E 3 11175404E 30 EE EE 0 016 and input floating point constants with 7 bit of operational accuracy IVC Series Small PLC Programming Manual 56 Chapter 4 Programming Conc
270. icable elements addressing WE E ASAS SS E RE TEO ELO EEE ee E Operand description Example S1 designated communication channel channel 1 Mi LD M1 LG IER 1 1 S2 drive address Broadcast mode Broadcast IVREV 1 1 address 00 Slave address range 1 247 1 Set the serial port 1 drive address 1 and control the drive reverse running through communication in Function description the Modbus protocol 1 Control the drive reverse running through 2 After the drive receives the data it will conduct CRC communication in the Modbus protocol check address check and instruction check and set 2 This instruction is executed upon the rising edge the communication completion flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVDFWD FREQUENCY CONVERTER Touch Forward Rotation Instruction LAD Applicable to IVC1 I H IVDFWD 6p 52 Influenced flag bit IL IVDFWD S1 S2 Program steps Offset Applicable elements addressing A AE Te ES aero EE ELO EE LE EE Operand description Example S1 designated communication channel channel 1 j ara A A LD Mi VDFWD 1 S2 drive address Broadcast mode Broadcast om SEENEN M e address 00 Slave address range 1 247 et the serial port 1 ana drive address 1 and contro the drive jog forward running through communication Function desc
271. id pu 3333 13107 LD XO s ECH DO nid S will be converted from BCD DO D10 When X0 is ON DO 0x0DO5 3333 will be converted from integer to 16 bit BCD code and the result 0x3333 13107 is assigned to D10 integer to 16 bit BCD code and the result is assigned to D DBCD Double Word To 32 Bit BCD Instruction LAD Applicable to IVC2 IVC1 IL DBCD S Program steps 7 Offset addressing kim RSM OT SOT eT vw Y pO WORE TIA en ae Operand Type Applicable elements Operand description Note S Source operand S lt When S gt 99999999 the system will report operand error and will not 99999999 execute the instruction and D will not change D Destination operand Example Function description xO 66665665 1717986918 LD XO When the power flow is valid a D e DBCD DO D10 S will be converted from When XO is ON DO D1 0x3F940AA 66666666 will be converted from integer to 32 bit BCD code double integer to 32 bit BCD code and the result Ox66666666 and the result is assigned to 1717986918 is assigned to D10 D11 D IVC Series Small PLC Programming Manual 110 6 5 9 BIN 16 Bit BCD To Word Instruction Chapter 6 Application Instructions LAD k BIN 5 IL BIN S D Operand Type Applicable to IVC2 IVC1 Program steps Offset Applicable elements AS addressing 5 _WORD Constant es Ka eu eg RM RSM o SOT 0 TV Y o W s DA Kew kas Row TO e PT PV Tz a Operand descripti
272. igh speed counting table compare pulse output instruction SPD Pulse detection instruction GE Wetz PLSY Count pulse output instruction WE SE MN a Count pulse with PLSR acceleration deceleration output instruction We Control RAMP Ramp wave signal output instruction a FY 160 SE TRIANGLE Tri p S t instructi 12 162 HACKLE Hackle wave signal output instruction SE A oe ee ee ST IVC Series Small PLC Programming Manual Appendix 10 Classified Instruction Index 299 Program Influenced fla Instruction Instruction function g S g IVC2 IVC1 Page steps bit FROM Ree SE rom special module buffer d y 429 register instruction DEROM Read EE wore nom special module 40 y y 130 buffer register instruction Write word to special module buffer TO Dee y y 131 External register instruction equipment DTO Write combs wore to GEES module 40 y y 130 instruction buffer register instruction Read analog potentiometer value instruction REFF Set input Set input filtering constant instruction constant instruction 133 Cer O S EE E EL EROMWR Write EEPROM instruction r ll BEER un ZR regreso ornato at o y ORV Cont relative pesten rsru HO Control absolute position instruction Pt Y 199 BEER EECH at TWR Wie ratte cockinstucion 121 en TADO Add doek neruse 7 er Gary_ Var FOUR Timing istinswuaion AUT A E O EI A e Compare floating point number LDR instruction Compare interger LD gt instruc
273. ighest frequency of executing of instructions SD86 V1 29 EEN or deceleration time of executing of D87 V1 2 S088 Envelope rising time ms VEZ e SD89 Envelope falling time ms VI 209 H 100 9 Real Time Clock soo Ver Ferme R Y Y 200 2088 soor Mon Forreartimeciook R V V mme soo oy _Forreattimeciook R V v raes o soo mc Forreartimeciook R V raoe ge Forteahime dock R V NO its Soros Forrealime dock R 1717 __0 89 seconds SD106 For real time clock Sek AE ae 0 Sunday 6 Saturday Note You can set these elements only with the TWR instruction or through the host computer IVC Series Small PLC Programming Manual Appendix 2 Special Data Register 273 10 Reception Control And State Of Free Port Port 0 SD110 SD111 Start character SD112 End character SD110 0 SD110 2 port baud rate SD110 6 Character data bit SD110 3 Stop bit 0 even parity D110 4 ty check S ER 1 odd parity 0 no check D110 ity check li V y SD110 7 1 start character specified SD110 8 free port receiving end 1 end character specified SD110 9 1 word overtime enabled SD110 10 free port frame overtime 1 frame overtime enabled enabling 0 frame overtime disabled 0 word register valid at LSB byte valid 1 word register valid at both MSB and LSB SD110 12 the most least significant b2 b1 bO 000 38 400 001 19 200 010 9 600 011 4 800 100
274. igure 2 8 Setting input point Priority Level Of Interruption The Priority Level Of Interruption is shown in Figure 2 9 The PLC built in interrupts can be set as high priority or low priority System block Advanced Settings Saving Range Output Table Special Module Configuration input rising Communication Port Set Time Interruptic Interruption Type Input Filter Input Point Priority Level Of Interruption edge interrupt Priority Le A Default value Low input rising edge interrupt input rising input rising input rising input rising input rising input rising edge interrupt edze interrupt edge interrupt edge interrupt edge interrupt edge interrupt Low Low Low Low input trailing edge interrupt Low input trailinz edze input trailing edge input trailing edge input trailing edge input trailing edge input trailing edge interrupt interrupt interrupt interrupt interrupt interrupt Low Low Low Low t XT input trailing edge PTO YO Output complete interrpul PTO Y1 Output complete interrput high speed counter interrupt 0 high speed counter interrupt 1 interrupt buch speed counter interruvt 2 Low Low Low Low Low Low Low Low High High Low Figure 2 9 Setting interrupt priority IVC Series Small PLC Programming Manual 19 20 Chapter 2 PLC Function Description Special Mo
275. ill be converted from integer to floating S will be converted from point number and the result 100000 0 is assigned to D10 D11 double integer to floating IVC Series Small PLC Programming Manual 108 6 5 5 6 5 6 Chapter 6 Application Instructions INT Floating Point Number To Integer Instruction LAD pt IL INT S D Operand Type Es ia To TT NEE ACI O A LI e A EA E Operand description S Source operand D Destination operand Function description 1 When the power flow is valid S will be converted from floating point number to integer and the result is assigned to D 2 This instruction affects the zero flag and borrow flag When the conversion result is O the zero flag will be set When the result rounds off the decimal fraction the borrow flag will be set the carry overflow flag will be set Applicable to IVC2 IVC1 Program steps Offset Applicable elements addressing Note When S gt 32767 D 32767 When S lt 32768 D 32768 and at the same time the carry overflow flag bit will be set Example LD XO 0 10000 50 10000 SS INT 00 Din INT DO D10 When XO is ON DO D1 10000 5 will be converted from floating point number to integer and the result 10000 is assigned to D10 DINT Floating Point Number To Double Integer Instruction LAD I 4 Gs DIT 5 Applicable to IVC2 IVC1 IL DINT Program steps Operand Type Spee TT TT OT TT o E Ra EEE
276. ill compare the current value with the preset value in S3 15 S3 78 If the current value is bigger than the preset value PID will report alarm and the corresponding bits in S3 19 will be set In this way you can monitor the input change and output change See the following figures e bad Output change Positive change gt AO Positive change gt Sampling times Sampling times Negative change gt Negative change gt Alarm flag Alarm flag S3 19 S3 19 DIED bit 2 S3 19 bit 1 S3 19 bit 3 9 Basic PID equations EV a EV ant EN ot Dal TI EVn PVnr I SV Forward Tp D ap Tp PVar Der 2 2 Der lu Dn 1 Ts ap Tp Ts ap Tp EV a EV an EN ot Dal TI EV SV Dar Reverse Tp D ap Tp 2 PVat 1 PVnr PVnr 2 Dn 1 Ts ap Tp Ts ap Tp MV 3 AMV Operand description The previsou Process Value The Integral Time Constant The second previous Process Value The Differential Time The change in the output Manipulation Values pap The Differential gain Ee WEE BEE IVC Series Small PLC Programming Manual Example Chapter 6 Application Instructions 159 PID initialization If the control operands are the same you can initialize the operands only once Range 1 32767 ms It must be bigger than the Input filtering constant a Range 0 99 Zero mea
277. in the local variable table in the subprogram or the program will not pass the compiling The following examples demonstrates some illegal matches Example In the local variable table of subprogram SBR1 the operand type of Operand 1 is OUT or IN_OUT the following usages are illegal e CALL SBR1 321 constants cannot be changed therefore it does not match OUT or IN OUT e CALL SBR1 K4X0 K4X0 is read only therefore it does not match OUT or IN OUT e CALL SBR1 SDO SDO is read only therefore it does not match OUT or IN OUT 4 The number of the operands in the CALL instruction must match the local variable table of the subprogram or the program will not pass the compiling 6 1 12 CSRET Conditional Return From User Subprogram LAD Li CSRET Program steps 4 oooO Function description When the power flow is valid the program will quit the current subprogram and return to the upper level subprogram IVC Series Small PLC Programming Manual 80 Chapter 6 Application Instructions 6 2 Data Transmission Instruction 6 2 1 MOV Move Word Data Transmission Instruction 6 2 2 LAD L HL Mov Ss IL MOV S D Operand Type Applicable to IVC2 IVC1 Program steps Offset Applicable elements ER addressing SPIN Constant nx Kav Kaw Kas RLM TRAST OT SOT SC TTT VT Zz vy oer mws soe PT pV zy Operand description S Source operand D Destination operand Function description When the power
278. ine Define Data Step Specify the target speed and location and click New Step or Update Step current step null Speed Target Speed S000 100000 pulse second moving distance d Pulse General movement of all the steps Pulse Position Delete Step lt lt Last Step Next Step gt gt New Step Update Step Input the Target Speed and moving distance of the first step and click the New Step button Then input the Target Speed and moving distance again and click the New Step button again Repeat this operation until no more steps are needed Then you can click the OK button to enter the Output Wizard of Envelop as shown in the following figure where you can save the configuration into D elements Output Wizard of Envelop Allocate element for the configuration The envelop configuration needs 13 0 elements please input the initial D element number below 03000 to D3012 Default value The wizard will generate two subprograms one for setting the parameters the other for executing the PLS instruction as shown in the following figure During the programming do not call the execution subprogram before the parameter setting subprogram has been called and executed to assigned values to D elements Output Wizard of Envelop The envelop wizard will create two subprograms please enter the name Enter the name of the generated subprogram The name of the parameter setting subbrogaram is The n
279. ing constant 0 8 16 32 Input filtering constant O 60ms 64ms 2A 1 piont Max relay Resistive load 8A 4 point group common terminal output 8A 8 point group common terminal current Inductive load 220Vac 80VA Illumination 220Vac 100W YO Y1 0 3A 1 point Es Resistive load Others 0 3A 1 point 0 8A 4 points 1 6A 8 points output For each point above 8 point the total current raises 0 1A See Inductive load YO Y1 7 2W 24Vdc Others 12W 24Vdc Illumination YO Y1 0 9W 24Vdc Others 1 5W 24Vdc 12k steps 24KByis Memory hold ry hold upon power Yes failure Registor Max Max number of memo ae S User set up to 200 C elements 320 bit elements or 180 word elements hold elements Hardware support and Backup battery Life span 1 year EEPROM Permanent sustainable period IVC Series Small PLC Programming Manual Chapter 1 Product Overview 3 IVC2 IVC1 Local data register VO V63 Offset addressing register Z0 Z15 Special data register Local auxiliary relay Special auxiliary relay SMO SM255 State relay SO S991 GU 1023 imemaltimedintemupt 1 A CI High speed counter interrupt Interrupt Serial Serial port interrupt interrupt GE output complete gt interrupt Basic instruction processing time General MES A ee eee 100ms precision TO T209 Timer 10ms precision T210 T251 1ms precision T252 T255 16 bit up counter CO C199 Counter 32 bit bi directional
280. ing two PLSY PWM or PLSR instructions at the same time can output two independent high speed pulses at YO and Y1 Points To Note About High Speed Pulse Output During the execution of the high speed instruction so long as the power flow is not OFF no other instructions can use the same port unless the high speed pulse output instruction is invalid If multiple PWM PLSY or PLSR instructions uses the same output point the output point will be available only to the first valid instruction IVC Series Small PLC Programming Manual 232 Chapter 8 Using High Speed UC 8 4 Configuring PLS Envelope Instruction You can use the PTO instruction wizard to generate a PLS envelope instruction In the AutoStation main interface select Tool gt Instruction Wizard to open the dialogue box as shown in the following figure Instruction Fizard The instruction wizard will guide you For quick creation of complex instruction and provide necessary options you need You only need to Fill in the necessary parameters and the wizard will create the instructions For the configuration selected The instruction Formula lists supported by the wizard are as Follows Select the instruction Formula to be configured please PID The selected item is the PTO instruction wizard Select PTO and click the Next button to enter the Output Wizard of Envelop as shown in the following figure Output Wizard of Envelop This wizard will configure the en
281. input and 0 for voltage input CINE SM175 A O 1 for current input and 0 for voltage input R W y flag of AD channel 1 j SET IVC1 Enabling fl f DA SM178 Se SN Output at DA channel 0 is enabled when this bit is set to 1 min IVC Series Small PLC Programming Manual Appendix 1 Special Auxiliary Relay 267 12 Operation Flag Bit Ration and function SEE Aas eee bit is set when the related calculation result is zero You SM180 Zero flag bit can clear or set this bit manually This bit is set when the result of the related calculation is a SM181 Carry overflow flag bit carry You can clear or set this bit manually This bit is set when the result of the related calculation is a SM182 borrow flag bit ican borrow You can clear or set this bit manually SM185 Table comparison flag This bit is set when the whole table is completed iat aa ee 13 ASCII Code Conversion Instruction Flag Action and function 0 the most and least significant bytes of every word are stored with one ASCII code 1 the least significant byte of every word is stored with one ASCII code ASC instruction storing mode flag 14 System Bus Error Flag The bit when set 1 would stop the system You can reset this bit by Basic module 1 Powering on the PLC again bus error flag bit 2 Changing PLC status from STOP to RUN 3 Downloading a new program 1 This bit is set and the system raises an alarm when a general module bus operation error occurs 2
282. int and maximum digital signal are by default applicable directly However when necessary you can change the parameters in order to cater for your actual needs IVC2 analog input module IVC2 analog input module exchanges information with its basic module through the BFM area When a user program runs on the basic module the TO instruction will write data to the related registers in the BFM area of IVC2 special module and change the default settings The configuration data that can be changed includes zero digital signal maximum digital signal input channel signal characteristic input channel ready flag and so on The basic module uses the FROM instruction to read the data from the BFM area of IVC2 analog input module The data may include the analog digital conversion result and other information IVC2 analog output module IVC2 analog output module exchanges information with its basic module through the BFM area When a user program runs on the basic module the TO instruction will write data to the related registers in the BFM area of IVC2 special module and change the default settings The configuration data that can be changed includes zero digital signal maximum digital signal output channel signal characteristic output channel ready flag and so on The basic module uses the FROM instruction to read the data from and uses the TO instruction to write the digital signal to be convertered to the BFM area of IVC2 analog output modu
283. interval among characters is 1s 4 Use LRC check 5 The frame of ASCII is longer than that of RTU It is required two character codes for transferring one byte HEX in ASCII mode The maximum length for data field 2x252 of ASCII is twice of RTU data field 252 The maximum length of ASCII frame is 513 characters and the structure of frame is as follows Structure of frame 10 4 5 Supported Modbus Function Code Supported modbus function codes include 01 02 03 05 06 08 15 and 16 IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 249 10 4 6 Addressing Mode Of PLC Element 1 Relationship between read write element function code and the element 06 write single register status Ax DSD ZTC ege it Itipl ist 16 lao dd E 4 XXXX D SD Z T C Word write status Note 1 O means coil 2 1 means discrete input 3 4 means register 4 xxxx means range 1 9999 Each type has an independent logic address range of 1 to 9999 protocol address starts from 0 5 0 1 and 4 do not have the physical meaning and are not involved in actual addressing 6 Users shall not write X element with function codes 05 and 15 otherwise the system will not feed back the error information if the written operand and data are correct but the system will not perform any operation on the write instruction 2 Relationship between PLC Element and Modbus Communication Protocol Address
284. ion A _ Position data Sustain m 8 total cycle number Servo motor Figure 6 1 Absolute position system As shown in the figure the PG of an absolute position system is special because it is battery backed which protects its position data and total cycle number upon power failure That means even after a power failure the servo amplifier can obtain the current absolute position data after power on After power on the PLC can obtain absolute position data from the servo amplifier through communication PLC can then use its locating instructions to control the servo amplifier and motor to realize precision positioning over mechanical parts and automatically refreshes its absolute position data In this way a positioning system based on absolute position coordinates can be set up 6 17 2 Overview Of Locating Instructions For IVC Series PLC The IVC series small PLC provides locating instructions including ZRN PLSV DRVI DRVA and ABS to control various servo amplifiers and servo motors in the absolute position system The absolute locating data is available through the corresponding servo amplifier IVC Series Small PLC Programming Manual 194 Chapter 6 Application Instructions 6 17 3 Mechanical Diagram Of Absolute Position System The mechanical diagram of the absolute position system that is based on th
285. ion branches will achieve the same The original two level transfer conditions become one level transfer condition Mergeable conditions Merge the mergeable conditions 3 Making use of battery backup function The S elements can be saved upon power failure by the battery In this way the program can resume from the step when the power failure occurred IVC Series Small PLC Programming Manual ES 7 5 1 Chapter 7 SFC Tutor 217 Examples Of SFC Programming The examples in this section are just illustrations of SFC programming with simplified operations and conditions The equipment configuration is conceptual and for study only Do not apply the example programs to actual use Simple Sequential Structure The following example is an object lifting and conveying machine This machine uses cylinder lifting devices and rollers to convey the object tray from one conveying belt to another The following figure is a top view of the machine Conveying Conveying belt belt Baffle plate Convey complete Height OK In lift 2 Left side lift cylinde Sg Limit switch In lift 1 Rollers Lift Right side lift cylinder O Cylinder solenoid valve
286. ion in the Modbus protocol code Illegal instruction Illegal register address 3 5 Ierger oi 0 0 0 0 S1 designated communication channel channel 1 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 2 This instruction is executed upon the rising edge Note The total number of the instructions for the Modbus communication between PLC and drive does not Slave operation failure including the error caused by invalid data within the data range X x4 Ee d 128 Instruction valid processing It is used to store GER 0 data to EEPROM Example p Slave busy please try again later It is used to M1 store data to EEPROM IP 1 1 ep Information frame error including the information LD M1 length error and check error The parameter cannot be modified IVFWD 14 1 The parameter cannot be modified in the RUN Set serial port 1 drive address 1 and control the Geng state only EV3100 supports this function drive forward running through communication in the The parameter is protected by password Modbus protocol After the drive receives the data it will conduct CRC check address check and instruction check and set IVC Series Small PLC Programming Manual 166 6 12 3 6 12 4 Chapter 6 Application Instructions IVREV FREQUENCY CONVERTER Reverse Rotation Instruction LAD Applicable to IVC1 I 4 H IVREV 6p 52 IL IVREV S1 S2 Program steps Offset Appl
287. ion time during every scan cycle and stop the user program if the running time exceeds the preset limit You can set the watchdog time in the Set Time tab after double clicking the System block in AutoStation main interface 2 1 4 Constant Scan Mode In the constant scan mode every scan cycle takes the same time You can set the constant scanning time in the Set Time tab after double clicking the System block in AutoStation main interface By default the Constant scanning time setting is zero which means no constant scan The actual scan cycle will prevail when the actual scan cycle is bigger than the constant scan cycle LJ Note The Constant scanning time setting must not be set bigger than the Watchdog time setting IVC Series Small PLC Programming Manual 12 Chapter 2 PLC Function Description 2 1 5 User File Download And Storage You can download a user file to the basic module to control the basic module The user file include user program data block system block and auxiliary user information The auxiliary user information include the user program variable list and the source file of user data You can select to download the user program data block or system block Whatever you select the corresponding auxiliary user information will always be downloaded For IVC2 series PLC the downloaded user program data block and system block will be stored permanently in the basic module EEPROM area while the downloaded auxiliary user i
288. ions and commissioning software are also introduced 2 1 Programming Resources And He Ce tnt ave E A tle elated ela anata aaah 9 Gm SR elei ln Le Re le 9 2 1 2 System Running Mechanism Scan Cycle Model 11 2 1 3 Watchdog Function For User Program Exvecuton teene 11 2154 Constant oca Mode EE 11 2 1 5 User File Download And Giorage cccccccccseeceeceeeeeseeeeeeeeeeeeeeeeeeeeeeeeeseaeeeeseeeeessaneeesaeeeeeseeeeesseneeesaeeesseeeeesaees 12 2 AA 12 2 1 7 Saving Data On Power Loss ttrt nn eee dade rn RR RR nn RR rn RR nro nnnnrnnrnnnrnrrnnarnrrrrnannnnninns 12 2 1 8 Permanent Storage Of D Device Data 13 2 1 9 Digital Filtering Of Input Termmmals 13 2 Eh e Bate dee 13 EN A id AA PO 14 A en janes uacteb aide idateuitas a O mua tnans vane eeeS eh uetaeactaudeseaaagenss 14 AS A 14 A A no A o ae eee 21 2258 Ee e Ee Table a a 21 2 2 4 Setting BFM For IVC2 Serie Special Module AA 22 2 9 Running Mode And State CONTO A ie 22 2 3 1 System RUN And System STOP States 000 e a RENE 23 20 2 RUN STOP State Change sienn a a leds 23 2 3 9 SENNO Ru el BC EE 23 ZAvSyStem RE Ee Le Un Le EE 24 2 4 1 Uploading amp Downloading Program EE 24 E Eror Ee due MechaniS EE 24 2 49 Editing User Program ONIS A EE 26 2AA Clearing And Formatting asss dd td o a 26 2 4 5 Checking PEC Information ONNE e da e aa 27 2 4 6 Write Force And Element Monitoring Table 28 24 7 Generating Datablock From RAM ae 29 IVC Series Small PLC Programming Manual Chapt
289. is over DO reaches 100 3 You can use the Conditional Jump CJ instruction to jump out of the structure and end the loop in advance as shown in the following ladder diagram IVC Series Small PLC Programming Manual 76 Chapter6 Application Instructions 4 It is prohibited to use the CJ instruction to jump into 5 The crossing of the structures MC MCR and a loop The LAD program shown in the following figure FOR NEXT is prohibited LAD program shown in the cannot pass the compiling following figure cannot pass the compiling LU Note The execution of the FOR NEXT structure is time consuming The bigger the cycle times is or the more instructions are contained in the loop the longer it will take To prevent the operation overtime error use the WDT instruction in a time consuming loop LBL Jump Label Definition LAD Applicable to IVC2 IVC1 IL LBL Program steps CA O d T Applicable el t peran pplicable elements er INC o e Operand description Example of error program S label number Range 0 lt S lt 127 Function description 1 A label numbered is defined 2 It is used to mark a specific jumping position for the CJ instruction Note Repeated label No Take care not to mark two labels with the same No in one POU or the program cannot pass the compiling However you can do so in different POUs for example different sub programs IVC Series Small PLC Programming Manual
290. ison data the Y elements specified in a certain table Note 1 The DHST instruction must work together with the HCNT instruction because DHST is only applicable to the high speed counters that is driven by HCNT 2 The DHST instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV 3 DHST DHSCI DHSCS DHSCR DHSP DHSZ can be used repeatedly However at most six such instructions can be driven at the same time 4 In a user program the DHSP and DHST instructions cannot be valid at the same time That means a valid DHST or DHSP instruction will make the following DHSP or DHST instructions invalid 5 The maximum frequency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O IVC Series Small PLC Programming Manual 148 Chapter 6 Application Instructions Example The table for comparison is shown below C i dat Y element Set Reset Operation flow Most significant bit Least significant bit D100 0 D101 100 D102 0 D104 0 D105 200 D106 1 D108 0 D109 300 D110 2 D112 0 D113 300 D114 3 The following is the user program 100 DoY 100 1100 LD SM1 Wu oO pioz DMOV 100 D100 l MOV O D102 moy 1 D103 Se MOV 1 D103 moy 200 D104 DMOV 200 D104 SIE Se MOV 1 D106 A MOV 0 D10
291. it instruction 10 100 000 Hz 1 100 000 Hz D1 high speed pulse output starting address YO or Y1 D2 rotating direction signal output starting address Its state is determined by S eo When Sis positive D2 is ON e When S is negative D2 is OFF Function description 1 You can change S even in the state of outputing high speed pulses 2 Because there will be no acceleration or deceleration during the start amp stop if buffer is needed during the start or stop it is recommended to use the RAMP instruction to change the value of pulse frequency Applicable elements Applicable to IVC2 IVC1 Influenced flag bit Zero Carry Borrow Program steps Offset addressing vf NC a a MS pp 3 In the process of high speed pulse output when the power flow driven by the instruction turns OFF the output will stop without deceleration et AE oo pop 4 If the corresponding high speed pulse output monitor SM82 or SM83 is ON the power flow driven by the instruction will not be driven by the instruction again after the power flow turns OFF 5 The direction is determined by the positive or negative nature of S Note 1 Pay attention to the instruction driven time 2 The high speed I O instructions PLS instruction and locating instructions can use YO or Y1 to output high speed pulses However take care not to use more than one such instructions on YO or Y1 at one time IVC Series Small PLC Programming
292. k on the S2 MOY 15433 DS MOV 16 66 D6 data starting with S1 and assign the ie see e i MOV 16 77 D7 result to D nE LD XO 2 The expression for CCITT check ce EERI Si MOV 0 D100 algorithm is X 16 X 12 X 5 1 a a Se a ne o 28097 Note CCITT 0 B D100 1 For the system will bring value of D When X0 is ON conduct CCITT check on the 8 data starting with into the operation each time the DO and the result is assigned to D100 instruction is executed make sure to clear D before executing the CCITT instruction 2 The data within the checking data zone starting with S2 are stored in byte mode by default That is the high bytes are taken as 0 and the check result has 16 bits IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 175 6 13 2 CRC16 Check Instruction LAD Applicable to IVC2 WC L HH OR 51 52 D Influenced flag bit IL CRCIS_ S S 0 Program steps E Offset Operand Type Applicable elements addressing 52 INT Constan ewei T Operand description Example S1 the starting element of the rigs MOYO 16200 a data to be checked 17 MOY 16414 D S2 the number of the data to s l LD SM1 be checked S2 2 0 or the HOY 18422 D2 geg ege e i 51 system will report operand gar E A i MOV 16422 D2 SS 68 MOV 1633 D3 D check result W ES pe MOV 16 44 D4 a5 Function description WON 16455 15 de a E ae MOV 16 66 D6 1 Conduct CRC16 check on HOY 16468 DE MOV 16 77 D7 the S
293. lave station Modbus master slave ae communiation port 0 can only be set to slave station Select RTU mode or ASCII mode main mode timeout The time for waiting the slave response by master is over the set value Note After the operand is set and downloaded in the system block it will be valid only after one operation Stop bit set to 1 or 2 set to 1 for odd or even check set to 2 for no check status 10 4 14 Modbus Instruction When PLC is used as Modbus master station the Modbus data frame can be sent received through Modbus instruction provided by system For the detailed use of Modbus instruction refer to 6 12 1 Modbus Modbus Master Station Communication Instruction If PLC is set to master station there is a timeout item in main mode when setting Modbus parameter in the system block To ensure the correctness of the received data the timeout period shall be longer than a scan cycle of Modbus slave station and with reasonable margin For example if IVC2 is the slave station and a scan cycle of IVC2 is 300ms the main mode timeout of the master station shall be over 300ms It is proper to set the timeout to 350ms IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 253 Application program Example 1 When IVC2 PLC is Modbus master station as well as slave station read bit status of No 5 station The protocol address of slave station read by master station is the bit value ranging from 11 to 39 Assu
294. le For details about the TO FROM instruction refer to Chapter 6 Application Instructions As for the information about various special modules as well as their BFM areas see the quick start manuals of the special module Running Mode And State Control You can start or stop the PLC in any of the following three ways 1 Using the mode selection switch 2 Feeding power to the designated input terminal see Input Point in 2 2 1 System Block 3 Programming software by clicking PLC gt Stop in the main interface if the mode selection switch is set as TM or ON IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description 23 2 3 1 System RUN And System STOP States 2 3 2 The basic module states include RUN state and stop state RUN When the basic module is in the RUN state the PLC will execute the user program That is to say all the four tasks in a scan cycle namely the user program execution communication internal tasks and I O update will be executed STOP When the basic module is in the STOP state the PLC will not execute the user program but will still execute the other three tasks in every scan cycle namely the communication internal tasks and I O update RUN amp STOP State Change How to change from STOP to RUN 1 Resetting the PLC If the mode selection switch is set to ON reset the PLC including power on reset and the system will enter the RUN state automatically LU Note If the
295. le D10 DO 0 RAMP DO D1 D10 1000 MO will increase by 2 2000 1000 in every scan cycle When D10 D1 2000 D10 will increase no more and MO will be ON During the generation of the ramp function if the power flow falls the output state D2 will be OFF the output value D7 will keep its current value until the next rising edge when D10 DO and a new Output the ramp function result to external DA module when X1 ON to generate ramp wave form LD X1 TO 06D101 The LAD of the preceding instructions is shown below ramp starts SM1 0 di S 2 2 You can use an external special module to convert 2000 A wm 2000 Di the data into analog waveform ZU O 2000 2000 ON RAMP DO Di D10 1000 HO X1 2000 T0 0 E D10 1 6 11 3 HACKLE Hackle Wave Signal Output Instruction LAD Applicable to IVC2 WC Offset Applicable elements addressing Si INT Constant KX Kav Ka Ks Kem RSTO TSDT CTT vyzp Y gt oym O O O O IS IS II O ESCHER 53 INT Constant ax Ky Katt Ks Kata ksa o so 0 T vw izp 7 oe poa fy O EI O IR eor Operand description S1 starting value S2 end value D1 output value S3 step number S3 gt 0 or system will report operand error and do not execute the calculation D2 output state pf state of the power flow Function description In each scan cycle when the power flow is ON The analysis of the hackle wave instruction is shown in this instruction can determine the incr
296. le integer for example 100 45535 the destination operand will also be unsigned integer 2 The corresponding element C only supports C200 to C255 Example AU SDO00 S0000 TMOY D0 nid When XO is ON the content of DO D1 is assigned to D10 D11 D10 D11 is 50000 LD X0 DMOV DO D10 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 81 6 2 3 RMOV Move Floating Point Number Data Transmission 6 2 4 S IL RMOV S D Applicable to IVC2 IVC1 Program steps 7 Influenced flag bit Applicable elements Offset addressing pS en OLOT LOA A op ANNO a UNE Ce E Operand description S Source operand D Destination operand Function description When the power flow is valid the content of S is assigned to D and the value of S remains unchanged pa y IVY Example lt a 50 50000 50 LD XO ge RMOV DO D10 When XO is ON the content of DO D1 is assigned to D10 D11 D10 D11 is 50000 5 BMOV Move Data Block Transmission Instruction LAD Ly HA BMOV IL BMOV S7 SI D Operand Type Operand description S Source operand starting element of data block D Destination operand starting element of data block S2 size of data block Function description When the power flow is valid the contents of S2 elements starting with 81 are assigned to the S2 elements starting with D and the contents of S2 elements starting wi
297. lock Inverse Applicable to IVC2 IVC1 Influenced flag bit Program steps 4 OOOO O Function description Reverse the current power flow value and then assign to the current power flow Note In LAD program the INV instruction shall be used in series rather than in parallel connection with contacts INV cannot be used as the first instruction in the input parallel branch In LAD program the INV instruction cannot directly connect to the left power flow bus The examples of improper use of INV instructions in LAD program are shown as follows IVC Series Small PLC Programming Manual 62 Chapter5 Basic Instructions 9 1 16 SET Set LAD 4 HL SET IL SET S Applicable to IVC2 IVC1 Program steps Operand T Applicable elements Ones aaa Ke PP addressing ES AB PAUSE TL eee Operand description S Source operand Function description When the power flow is valid the bit element designated by D will be set 5 1 17 RST Reset LAD LH HU mr IL RST S Example M UN LD MO SEL E SET Mi Applicable to IVC2 IVC1 Program steps steps O di T Applicable elements ora EFSER ype PP Ge KEE Operand description S Source operand Function description When the power flow is valid the designated bit element D will be reset 5 1 18 NOP No Operation LAD NP Example MO OFF LD Mu EST Mi RST M1 Note If D is C element the corresponding count value will be res
298. m Station 6 communication erg OR am Station 7 communication emorfag TE ag Station 8 communication erg TE am Station 9 communication erg fR aen Station 10 communication evorfag CT ORY Smr Station Ti communication evorflag CT ORY emez Staton 12 communication evorflag CT ORY ae Staton 13 communication evorflag CT ORT mea Staton 14 communication evorflag CT ORT sme Station 15 communication eer CT ORT ae Station 16 communication evorfag CT ORY amer Staton 17 communication TE ae Staton 18 communication evorfag CT ORY Smo Staton 19 communication evorflag CT ORT smeo Station 20 communication evorfag fR f smer Staton 21 communication evorfag CT ORY amer Staton 22 communication evorfag OR ae Staton 23 communication evorflag OR mea Staton 24 communication evorflag OR ae Staton 25 communication eer OR ae Staton 26 communication eer fR amer Staton 27 communication evorflag OR ae Staton 28 communication eer OR smeo Station 29 communication eer OR Smo Staton 31 communication evorfag OR SMart Staton 32 communication erorflag OR 11 Enabling Flag Of Integrated Analog Channel Aaa Name Enabli a f AD SM172 Ee Sampling at AD channel 0 is enabled when this bit is set to 1 R W channel 0 Enabling fl f AD SM173 ee Sampling at AD channel 1 is enabled when this bit is set to 1 R W channel 1 Voltage current enablin SM174 flag i AD chanhelo J 1 for current
299. m in the field of Display type to display the data After reading the data successfully the buttons of Merge to datablock and Overwrite datablock are enabled Clicking Merge to datablock will add the results after the current datablock Clicking Overwrite datablock will replace the contents in the datablock with the generated results After exiting the register value reading window the software will prompt that the datablock has changed and the datablock window will be opened automatically IVC Series Small PLC Programming Manual Chapter 3 Element And Data 31 Chapter 3 Element And Data This chapter details the description classification and functions of the elements of IVC series small PLC Se Element ype ANG FUNCTION seit Ae ee Ee 32 Sal Wat S APEC Eu 32 3152 Elements tana A 33 STS Ate teg l eebe el Eug e e EE 34 Ox a E Ee EE 35 SEIS lAY A A eo pon A 35 A reene e 36 Se tay COMI eege ee ee ee Ee 37 310 Dala ROS iba 37 1 9 Special AUXIN Any Rei a ido le ol ls a o oo ld o o a el ale a 38 San IR Eeer DataSet a a 38 Oe lev ONSCUAGGIESSING REIS sa 39 Sa LOCAL Auxiliary EE 39 31 19 Bee 39 32 Elements AGGIES SING MOOG sr AAA AAA 40 3 2 1 Kn Addressing Mode Combined Bit string Addressing Mode 40 3 2 2 Z Addressing Mode Offset Addressing Mode 40 3 2 3 Kn Addressing In Combination With Z Addressing occcccooccncccncnncnoncnnononononnncnnnnoncnnnnnnnnnnnnrrnnnnnnnnnnnnnnnnnannnnnnos 41 3 2 4 Storing 4 Addressing 32 Bit Data In D
300. me SM249 will be reset if XO changes from OFF to ON and the counter counts up and SM249 will be set if X1 changes from OFF to ON and the counter counts down 4 When X6 is OFF C249 stops counting 5 When MO and X6 are both ON if X2 is ON C249 will be cleared and C249 auxiliary contact will be reset IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 147 6 10 6 DHST High speed Counting Table Compare Instruction LAD Applicable to IVC2 WC IL DHST S1 S82 S3 Program steps Offset Operand Type Applicable elements addressing ee PASEA TE ee eee WE EE EE ee ee ee ee ee E E ee ESTAN ee E ee ee rre Operand description S1 the starting D element for table comparison The following three D elements are the comparison data SN of Y element and the output state These four D elements form a record S2 the number of records for comparison Range 1 128 S3 high speed counter Range C236 C255 Function description 1 A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON 2 When the counter value equates the comparison data of the present record the corresponding Y element will be output 3 The Y element specified in the present record will be output immediately regardless of the scan cycle 4 You can use the DHST instruction when you want to immediately output according to certain compar
301. me of PLC You can adjust the time setting and click the Set time button to validate it IVC Series Small PLC Programming Manual 28 Chapter 2 PLC Function Description 2 4 6 Write Force And Element Monitoring Table Write and force During the debugging some element values may need to be changed manually You can use the write or force function Difference between write and force is that written element values are one off and may change with the program operation but forced element values will be permanently recorded in the PLC hardware until being unforced To use the write or force function just select the element that needs changing right click and select Write Selected Element or Force All the element addresses used by the selected element will be listed in the dialog box Modify the address value to be written or forced click the OK button and the value will be downloaded to the PLC If these values are effective in the hardware you will see the change in later debugging process The Write element value dialogue box is shown in Figure 2 20 Frite element value address data type value 520 FOOL OM Cancel Figure 2 20 Write element value The Force element dialogue box is shown in Figure 2 21 Force element address data type value 20 FOOL ON Cancel Figure 2 21 Force element You can see a lock under the forced elements in the LAD as shown in Figure 2 22 E MAIN dltls Variable addr Variable N
302. ming that the read data are as follows the storage location for the received data starts from D100 save the address to D100 function code to D101 and number of registers in D102 Save the read bit value in the units beginning with D103 A A A ASSES AA i 00 II ICI ICI pe pepe ys D104 D103 NA A E A If the read number of the registers is not the times of 8 add 0 to the high bits In the above example it has added 0 to 3 high bits 40 41 and 42 in D106 1 Designate 5 as the address of the slave station to be accessed save to DO 2 Designate 1 as the function code save to D1 3 The address of the register to be read is 11 Save to D2 D3 according to high and low bytes 29 4 The number of registers to be read is 29 Save to D4 D5 according to high bits and low bits EST HI 35 9 The received data is saved to D100 6 If the receive is completed set SM135 add 1 to D200 7 If the communication fails set SM136 add 1 to SEN D201 and save the error code to D202 RST SE H MODBUS 1 8 SM124 is the idle flag of the communication port THC 1200 IHC D201 MOY 501139 Iziz LU Note 1 When logic address is used for addressing the bit element of IVC2 PLC the logic address 1 is the protocol address 0 In the above example reading the value of 11 39 bits protocol address in the slave station the logic address shall start from 12 2 The failure of this communication will not affect the next communi
303. mming Symbol The IVC series PLC SFC programming language consists of the following programming symbols Table 7 1 Programming symbols Symbol name Symbol initial ste si A initial step of SFC numbered as Sn The n must not repeat The execution of a p Ta SFC program must start with an initial step whose S element range is SO S19 Resto Larl A normal step numbered as Sn The n must not repeat The S element range for P the normal step is S20 S991 A transfer It can be built in with a transfer condition a embeded LAD You can compile the transfer condition so that the S element connected with this transfer will Transfer S be set when the condition is met and enter the next step The transfer must be used between steps IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 207 A jump used after the transfer It can set the specified S element to ON when the transfer conditions are met It is used to cycle or jump among steps A reset used after the transfer It can set the specified S element to OFF when the transfer conditions are met It is used to end the SFC program Multiple independent transfer conditions used after a step When the transfer Selection branch condition of one branch is met the last step will end and the next step of the corresponding branch will start After that no other parallel branch will be selected A merge of selection branches When the transfer condition of one branch is met
304. mmunication status of the whole network through the relevant SM element of any PLC in N N bus IVC Series Small PLC Programming Manual 256 10 5 2 10 5 3 Chapter 10 Using Communication Function N N bus Network Structure N N bus supports two kinds of network single layer network and multiple layer network as shown in the following figures Figure 10 2 NN bus multiple layer network In the single layer network each PLC only connects to N N bus through 1 communication port In the multiple layer network the layer to layer PLC intermediate node shall be connected and the two communication ports of PLC shall be connected to different layers The single layer network can support up to 32 PLCs while each layer of multiple layer network can support 16 PLCs at most N N bus Refresh Mode The PLCs connected to N N bus can automatically realize the exchange between parts of D elements and M elements in the network The quantity and numbering of elements D and M are fixed and the elements are called Elements Sharing Area If PLC uses N N bus the value of the Elements Sharing Area will keep refreshing automatically so as to keep the value consistency of the Elements Sharing Area for each PLC in the network mol de 24 PLC Lee O RCV area R 0 RCV area R O RCV area R 1 SND area mm 1 RCV area Ep 1 RCV area R 2 SND area W 2 RCV area R 1 RCV area
305. n DO D1 100001 6 3 16 DDEC Decrement Double Integer Instruction LAD Applicable to IVC2 IVC1 m m mr o fluenced lag bi DDEC 1D Program steps 7 Operand Type Applicable elements Ge j E ER addressing o m Ra kom ens Tet Oe Tv Y Operand description Note D Destination operand This instruction is a cyclic decrease instruction Range 2147483648 2147483647 Function description When the power flow is valid Example D decreases 1 PAE 39999 LD XO DIEC D DDEC DO When XO is ON the value 100000 of DO D1 decreases 1 After the execution DO D1 99999 IVC Series Small PLC Programming Manual LAD y HH DVABS 5 IL DVABS S D o Dm Rov Kno ens Kec er Operand description S Source operand D Destination operand Function description When the power flow is valid get the absolute value of S and assign the result to D Note The range of S shall be 2147483647 2147483647 When S is 2147483648 the system will report operand error and the instruction will not be executed LAD HH m IL DNEG S D Operand Type Chapter6 Application Instructions 97 6 3 17 DWABS Double Integer Absolute Value Instruction Applicable to IVC2 IVC1 Program steps 7 Applicable elements Offset addressing EA A S Ay EI NI Example xO 100000 100000 LD XO IVARS D0 10 DVABS DO D10 When XO is ON get the absolute value 100000 of DO D1
306. n cycle when the power flow is ON this instruction can determine the increment and current output value D1 according to the triangle wave height and step number When the output value reaches S2 the rising half of the triangle is complete the increment direction of the output value will change and generate pf state of the power flow the falling half of the triangle When the output value D1 reaches 1 again the state output D2 will be set IVC Series Small PLC Programming Manual The analysis of the execution of the triangle instruction is shown in the following figure S3 5 Note 1 If the result is not divisible when calculating the program steps round off to the nearest whole number 2 The instruction will generate a series of continuous triangle wave data so long as the power flow keep ON 3 When S17 S2 D1 S2 D2 ON no counting pulse the cycle of the triangle wave is S3 1 x 2 4 The total number of RAMP HACKLE and TRIANGLE instructions in a program should not exceed 100 Example Initialize registers upon the first scan cycle after power on LD SM1 MOV O DO MOV 2000 D1 Chapter 6 Application Instructions 163 Executie TRIANGLE instruction when X0 is ON LD XO TRIANGLE DO D1 D10 1000 MO When X1 is ON output the result of ramp function to external DA module to generate triangle waveform LD X1 TO 01D101 The LAD of the preceding instruction is shown in the following figure
307. n of steps when used in STL instruction 2 NO and NC contacts when not used in STL instruction Similar to M elements the NO and NC contacts of S elements are available during programming Value assignment 1 Through instructions 2 Write or force during system debugging Battery backed features Side S elements in the S elements outside saving range the saving range Remain unchanged RUN gt STOP Remain unchanged Remain unchanged STOP gt RUN Remain unchanged Note The saving range is set through the system block See 2 2 1 System Block IVC Series Small PLC Programming Manual 36 Chapter 3 Element And Data 3 1 6 Timer Element mnemonic T Function The T element contains a word element 2 bytes and a bit element The T word element can record a 16 bit value The T bit element represents the timer coil state and is applicable to logic control 1 state bit T bit element MS Sign bit T word mene 16 bits Figure 3 3 T element Classification According to the timing precision the T elements are classified into three types TO T209 100ms T210 1251 The T elements with the timing precision of 1ms are activated by interrupts unrelated to the PLC scan cycle Their action time is the most precise The update and action time of other T elements are related to PLC scan cycles Elements numbered in Decimal
308. nction code 0x08H Functionword GOH Teen ORC or LRC Return Slave No Response Count 0x0F Record the number of messages that have not returned to the slave station since the last starting clearing and power on of counter 1 Request frame Functi d Data fiel heck Address Function code 0x08H ata field Check code 0x00H OXOFH Ox00H Gett CRC or LRC 2 Response frame Function word Data field Check code Address Function code 0x08H Functionword OOH men CRC or LRC Return Bus Character Overrun Count 0x12 Record the number of the messages that cannot be addressed due to the character overrun since the last starting clearing and power on of counter 1 Request frame Address FUAN Data field Check code Ge 0x00H 0x12H Ox00H Ox00H CRC or LRC 2 Response frame Address EH Data field Check code eee En 0x00H 0x12H CRC or LRC 3 7 Force Write Multiple Coils OxOF Hex At most 1968 bit elements 0x07b0 can be written and the number is changeable according to the defined range 1 Request frame Function Sen EC temper at Number Written Written rere d address elements i t Check code ess code of bytes n elemen a Sement CRC or LRC OFH H L H L value No 1 value No N B7 B6 B5 B4 B3 B2 Bi BO 2 Response frame Address Function starting address Number of elements Check code code OFH CRC or LRC
309. nction description Example Compare the current power flow status with its previous status If the power flow MO ON eg E rises OFF ON the output is valid in the W A WE SET Yo current scan cycle IVC Series Small PLC Programming Manual 9 1 14 9 1 15 Chapter5 Basic Instructions 61 ED Power flow Falling edge Detection Applicable to IVC2 IVC1 ICI EC Function description Sequence chart of example Compare the current power flow status with its previous status If the power flow falls OFF ON the output is valid in the current scan cycle Example LD M2 MPS M2 Y EU a T 2 OUT Y2 Note Y3 MPP HA Ep In LAD program the rising edge contact or falling edge contact OUT Y3 instruction shall be used in series rather than in parallel connection with other contact elements In LAD program the rising edge contact and falling edge contact instruction cannot directly connect to the left power flow bus 1 In two consecutive scan cycles the status of M2 contact is OFF and ON respectively When the EU instruction detects a rising edge Y2 will output ON status with the width of a scan cycle The examples of improper use of EU ED instructions in LAD program are shown as follows 2 In two consecutive scan cycles the status of M2 contact is ON and OFF respectively when the ED instruction detects a trailing edge Y3 will output ON status with the width of a scan cycle INV Power Flow B
310. nd S Source operand Function description 1 When the power flow changes from OFF to ON rising edge the 16 bit counter C D will count 1 2 When the counting value is equal to the preset point S the counting coil will be set ON 3 After the counting value reaches the preset point S if the power flow changes from OFF to ON again rising edge the counting value will be set to 1 and the counting coil will be set OFF Note 1 When the preset counting value S is less than or equal to 0 there will be no counting 2 The address of the 16 bit counter C D shall be within CO C199 Applicable to IVC2 IVC1 Influenced fagh Program steps 5 Offset addressing Applicable elements EL EE E A E ee ICI Example mo 1 CTR co 3 LD MO CTR CO 3 Time sequence chart ON CO counting coil CO counting value IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 69 5 5 3 DCNT 32 Bit Counting Instruction LAD Applicable to IVC2 IVC1 IL DONT D S Program steps 7 Offset Operand Type Applicable elements Se addressing Eo we e E e A ee ee es ee ee ee ee eee Operand description Example D destination operand A r E LD MO S Source operand IICHT C235 DO DCNT C235 DO Function description Time sequence chart 1 When the input power flow changes from OFF to ON rising edge the 32 bit counter C D will count up or down 1 depending on the corresponding SM
311. nd the result is assigned to D Note The result of the DMUL instruction is a 32 bit data and overflow may occur Example AU e3000 ODO 1656000000 OMUL D UE m0 LD XO DMULDOD2 D10 When XO is ON the value 83000 of DO D1 multiplies the value 2000 of D2 D3 and the result 1660000000 is assigned to D10 D11 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 95 6 3 13 DDIV Divide Double Integer Instruction LAD EHH mm venu 52 D Influenced flag bit Com 5 63 W Applicable elements Offset id addressing Sr DIN Constant nx Kn Kaw Ras Row RSM O SOT ST TV vy o fm w ewe kas Rou Pe PP Operand description Note S1 Source operand 1 S2 0 otherwise the system will report Divided by 0 error and the S2 Source operand 2 instruction will not be executed D Destination operand Example XO 53000 2000 41 LD XO e ee ge D d DDIV DO D2 D10 When XO is ON the value 83000 of DO D1 is divided by the value 2000 of D2 D3 and the result is assigned to D10 D11 and D12 D13 D10 D11 41 D12 D13 1000 Function description When the power flow is valid 7 is divided by S2 and the operation result is assigned to D D includes 4 units with the first two storing the quotient the other two storing the remainder 6 3 14 DSQT Square Root Double Integer Instruction Program steps 7 Applicable elements IL DSQT S
312. ndicator 66 Subprogram stack over i keeps off The corresponding error code will be User interrupt request queue overflow prompted in SD20 68 Illegal label jump or subprogram call 69 Dive by 0 ero When stack size or stack elements are smaller Definition error of stack operated Execution error than zero or stack element number exceeds the m of stack size mo Res ooo Undefined user subprogram or interrupt eg Execution error subprogram Using FROM TO instruciton to access 73 We Execution error module not existing I O error when using FROM TO Execution error instruction 75 WO error when using REF instruction ae set real time clock time using Execution error Parameter 3 of PLSR instruction Execution error inappropriate under constant scan BFM unit of accessed special module Execution error exceeds range ABS Data Read Timeout Data Read Timeout Execution error error A o ose Ea ABS Data Read and Check Error IVC Series Small PLC Programming Manual Appendix 7 Modbus Communication Protocol IVC Series 281 Appendix 7 Modbus Communication Protocol IVC Series ds Modbus Communication Protocol Overview IVC series small PLC has two communication ports PORT 0 also the programming port which supports Modbus slave station and Port 1 which supports Modbus master station and slave station configurable through ConstrolStar Their features include 1 Using RS485 or RS23
313. nding stops MOV 16 0 D1 2 SM112 SM122 sending completed flag When it is MOV 16 1 D2 judged that the sending is completed the sending MOV 16 1 D3 completed flag will be set MOV 16 2 D4 3 SM114 SM124 Idle flag When the serial port has RST SM122 no connie avon TASK it will be E it can be XMT 1 DOS used as We checking bit for HEN LD SM122 4 For detailed examples of the application please INC D100 refer to Chapter 10 Communication Function Use In this example one data frame is sent in every 10s Instruction The following data will be sent through serial port 1 oF 00 oF oF oz 1 Set port 1 in the system block as free port and then set the baud rate parity check data bit and stop bit 2 Write the data to be sent into the transmission buffer area For IVC2 only the low bytes of the word element will be sent 3 Reset the sending completed flag SM122 before sending the data 4 When the sending is completed set the sending completed flag SM122 IVC Series Small PLC Programming Manual 6 12 12 RCV Free Port Receiving RCV Instruction LAD HL BOU Ss D 52 Chapter 6 Application Instructions 173 Applicable to IVC2 IVC1 Influenced flag bit RCV S1 D e 7 Operand Type ee E C CR Operand description S1 designated communication channel Range 0 1 D starting address for storing the received data S2 maximum number of received bytes Function description When the power
314. ne of the several functions that an input point can provide is available If XO X7 are repeatedly used in a user program the program will not pass the compiling Among the functions of high speed counter SPD pulse capture and external interrupt the function that XO X7 can provide respectively are listed in the following table Max frequency KHz Counter236 UI R A EE EE ae Im Ill METIO ff IEA Counter 240 Counter 241 A Counter 243 Counter 245 i phase e eee NEE EEN ECH MOON oe ETA AAC ee IRON EE WEE Se NEE input ad ACI E IC mode 2 Counter 251 pf EE AA dee E e to Heep La mode Counter 255 255 PhA A PhB B Reset Start keep t Foie d oe t aL t E 3 t SPD instruction dee BE en de da nee point point point point point point Input Input Input Input Input Input Input Input Pulse capture function point point point point point point point point Ext int ts SN ien oun 144 242 343 ana 545 ete 7 17 rising trailing edge Note U UP D Down IVC Series Small PLC Programming Manual Chapter 9 Using Interrupts 235 Chapter 9 Using Interrupts This chapter details the mechanism processing procedures and usage of various interrupts AA A A E E 236 9 2 FFOCESSINO lte ie EVEN sad 236 d E Amed e tg DEE 237 94 ETM An FAS VAR UD cick te Fis cacti a cscs A eege 238 9 5 High speed Counter Interupt nn nnnn nn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnrnnenininnnos 240
315. ned by S the timing coil output will maintain ON 2 In the timing status whose length is determined by S no matter how the power flow changes the timing will keep going and the timing coil output will keep ON T1 timing coil 3 When the timing value reaches the preset point the timing will stop the timing value will be cleared and the timing coil output will be set OFF T1 timing value Counter Instruction CTU 16 Bit Counter Counting Up Instruction LAD Applicable to IVC2 IVC1 aes ened el o IL CTU Program steps Operand T Applicable elements r ES ype PR addressing Co se ee ee ee ee ee ee ee eee O fersen Rox Rn Kw Kn aros o 59 eri 27 Operand description Example D destination operand MO 3 LD Mu e a 07 CTU CO 3 S Source operand Ee 2 in E Function description OUT YO 1 When the power flow changes from OFF to ON rising edge the 16 bit counter C D will count 1 2 When the counting value reaches 32 767 it will maintain that value 3 When the counting value is larger than or equal to the preset point S the counting coil will be set ON Note The address range of the 16 bit counter C D CO C199 CO counting coil CO 0 CO counting value IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 5 5 2 CTR 16 Bit Counter Loop Cycle Counting Instruction LAD I 4 HL cr O IL CTR D S E Operand description D destination opera
316. ned by the user program scan cycle 3 When M1 is ON and the DHSP instruction meets the requirements in the preceding Note the compare will start with the first record The compare with the second record will not start until the first compare is over and the output data has been output to SD180 SD181 After the compare with the last record is over the compare with the first record will start again and SM185 will be set SD184 is the SN of the present record and SD182 8 SD183 are the present data for comparison The output data will be output to SD180 8 SD181 immediately regardless of the scan cycle If you want to stop the at the last record set the output data of the last record to 0 4 When M2 is ON and SM244 is ON C244 will count down When M2 is OFF and SM244 is OFF C244 will count up 5 When X6 is OFF C244 is invalid 6 When MO and X6 are both ON if X2 is ON C244 will be cleared and the C244 contact will be reset IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 151 6 10 8 SPD Pulse Detection Instruction Applicable to IVC2 IVC1 E infiuenced fag bit OOOO S2 D Program steps Operand T Applicable elements GE eran e j K Ai addressing st poor X p EES SWORE RO RAY Wa RAL RTS ST e ef o po TT rT UE UE a O UU Operand description S1 input point Range XO X5 S2 time unit for input point detection Unit ms
317. ned to the corresponding elements and the PID calculation will be carried out The calculation result will be converted BT Y 1740 into analog signals through the external D A module HOY 16207 an the actual situation could be different and fed to the 70 controlled system WON 70 1512 100 Note WON 100 1513 Kn A Bu 1 The operand D should be a register outside of the e Saving Range Otherwise it should be cleared LD me 3 a SMO MOV 0 D in the first operation Wi 63 1516 2 The PID instructions occupies 20 consecutive Sa N Sue registers starting with S3 2000 3 The maximum error of sampling time TS is Scan WON 2000 1525 Ga cycle 1ms scan cycle When TS is small the moy 000 1526 PID effect will be affected It is recommended to use a ai E PID instruction in the timed interrupt a biin coop 4 When setting the PID output thresholds if the upper MO 631 limit is smaller than the lower limit the system will TAM E E iii E l report operand error and no PID calculation will be 1000 631 200 Gob i PID D500 Io 0510 DS02 carried out ei y S E i 5 When the process value alarm and output value The PLC will initialize the PID operands only in the first scan cycle When X2 is ON the current measured value will be read from external A D module the actual alarm are enabled S3 15 S3 18 cannot be set negative or the system will report operand error and no PID calculation will be carried
318. nformation will be stored in the battery backed RAM area For IVC1 series PLC all user files will be stored permanently in the basic module FLASH area LU Note 1 To embed the downloaded files into the basic module the basic module power supply must be maintained for more than 30s after the download 2 If the backup battery fails in IVC2 series PLC the auxiliary user information will be lost the annotation for the user program will not be uploaded and system will report User information file error But the user program will be executed after all 2 1 6 Initialization Of Elements When the PLC changes from STOP to RUN it will initialize its elements according to battery backed data EEPROM data data block and device value The priorities of various data are listed in the following table Table 2 3 PLC data initialization priorities Data type Power OFF ON STOP RUN Battery backed data EE A PEEPROM Ga Data block Precondition the Datablock enabled is checked in the aoe Device value Precondition the Element value retained is checked in e tanos senings Sto 2 1 7 Saving Data On Power Loss Preconditions Upon power loss the system will stop the user program and save the device in the specified saving range to the battery backed files Device restoration after power on If the battery backed files are correct the PLC elements will restore their saved values after power on The elements outside of th
319. ng result MOV 5000 D4 A SE 5000 Function description Wu 5000 D LD XO SUM DO 5 D100 When the power flow is valid To SUN s ch 5 See the contents of S2 units starting with the starting unit When XO is ON the integers of 5 elements starting form DO will be S1 will be summed up and summed up and the result is assigned to D100 D101 D100 D101 the summing result is DO D4 15000 assigned to the D unit Note 1 The operation result of the SUM instruction is a 32 bit data 2 0 lt S2 lt 255 or system will report operand error 3 Since Dis a 32 bit data the carry and borrow flags are constantly 0 and the zero flag is determined by the final summing result IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 99 6 3 20 DSUM Sum Double Integer Instruction 6 4 6 4 1 LAD HH Do IL DSUM S1 S2 S1 DINT SD D Applicable to IVC2 IVC1 Program steps Offset addressing Applicable elements SR i ae Kas Knit vu D eier AA 52 D Rex Rav Knit Tee enes DT SOT ST Vv E Dm DE ens Rew Oe Operand description S1 Source operand starting unit of summing S2 Source operand number of data to be summed up D destination operand summing result Function description When the power flow is valid the contents of S2 x 2 units starting with the starting unit S1 will be summed up and the summing result is assigned to the D unit Note O
320. nncnnononononnnnnnonnnons 143 6 10 3 DHSCI High speed Counting Compare Interrupt Trigger Instruction ooccccoccncoccnccocnnconnncnannnnnnnnonons 144 6 10 4 DHSCR High speed Counting Compare Reset Instruction ocooccccconccncconcnnonocnnnnnanonononcnnnnanononnnnononnnons 145 6 10 5 DHSZ High speed Counting Zone Compare INStrUCTION occcccooccncccocnncnonnnnonononcnnnnononnnnnnnnnnnnonnnnnnonnnons 146 6 10 6 DHST High speed Counting Table Compare Instruction oocccccocccncccnccncnnnnnnononnncnnanonononcnnnnnnnncnnnnononnnoos 147 6 10 7 DHSP High speed Counting Table Compare Pulse Output Insiruchon 149 6 10 5 SPD Pulse Detection TASTUCION ii A ees 151 6 10 9 PLSY Count Pulse Output INSMUCION eegent Seege a ES tee ie alee 152 6 10 10 PLSR Count Pulse With Acceleration Deceleration Output InstructioN coocccoocncconncconnnconcncnonnnnnons 153 6 10 11 PLS Pulse Output Instruction Of Envelope oooccccocccccccnccccnccncnoconnnonncnonnnononnnnonnnnonnnnnnnnnnnonnnonannnnannnnnnos 155 Se Aa GT Pde rel Cd ett EE 156 6 11 Control alCulation IMS tue dE 157 Sad AIR EN GR Ettel EE 157 6 11 2 RAMP Ramp Wave Signal Output InstructiON ooccccoccnccccnccocnnconnncnnncnnnnnnonnnnonnnonnnnnnnnnnnonnnnnnnnonnnnnnnons 160 6 11 3 HACKLE Hackle Wave Signal Output Instruction ocoooncccccoccncononcncconcnnnnnnnnnononcnonnnnonnnnncnnonannnnnnnncnnnnnons 161 6 11 4 TRIANGLE Tri
321. nnnnnnnnnnnnnnnnnnnnnnnrnnnnnnnnennnenaninons 234 IVC Series Small PLC Programming Manual Chapter 8 Using High Speed UC 227 8 1 High Speed Counter 8 1 1 Configuration The built in high speed counter for IVC series small PLCs are configured as follows Table 8 1 High speed counter configuration O UR EE ME E EE E a BE A EE ao ER AE A EA A comer Y a D EE OA FU EE ee ee EC A E pame ee RL A MA E AAA AA ERA A SE El ee EE AL E WEE RA EECH E E EE E ae a E EE EG WE gier EE RAE EES UREA ec ee BE E E E E BE GE ER SE EE EE input amal L fe fmm E mode EE Leet E LI IR IEA II PRA PRE Reset Stat In the modes listed in the preceding table the high speed counters will act according to certain input and handle high speed action according to interrupts The counting practice is unrelated to the PLC scan cycle All the high speed counters are of the 32 bit bi directional type According to their different up down switchover methods they fall into the following three categories 1 phase point input 1 phase bi directional input 2 phase input Counters C236 C245 are down Counters C246 C250 are Counter C251 C255 acts according to the input counters when SM236 SM245 either up counters or down They count up when phase A is on and phase B are ON and up counters when counters dependent on changes from OFF to ON and count down when C236 C245 are off the input phase A is ON and phase B changes from ON t
322. ns no input filtering Integral time Tl Range 0 32767 x100ms Zero means limit or no integral Differential gain KD Range 0 100 Zero means no differential gain Differential time TD Range 0 32767 x10ms Zero means no differential 8 Clearing the memory for the transit data of PID calculation Process value positive change alarm setting 0 32767 Process value negative change alarm setting 0 32767 Output value positive change alarm setting 0 32767 LD SM1 Initialization executed only once MOV 1000 D500 Setting target value MOV 500 D510 Sampling time Ts calculation time MOV T D511 Action direction MOV 70 D512 MOV 100 D513 Proportional gain Kp Range 1 32767 MOV 25 D514 MOV 0 D515 MOV 63 D516 processing FMOV 0 D517 MOV 2000 D525 MOV 2000 D526 MOV 2000 D527 MOV 2000 D528 PID instruction execution LD MO FROM O 5 D501 PID D500 D501 D510 D502 TO O 8 D502 The LAD of the above instructions is shown below SMI maY 1000 1000 500 Output value negative change alarm setting O 32767 User controlled PID calculation program 1 Input current measured value users can input measured values according to the actual situation PID instruction PID S1 S2 S3 D 1 PID calculation result is fed back to the controlled system users can handle the PID calculation result according to the actual situation situation could be different assig
323. nting frequency is 30kHz Maximum frequency of software counters The high speed counters used in instructions DHSCS DHSCR DHSCI DHSP or DHST are all in software counting mode The maximum input frequency for the 1 phase counters is 10kHz for 2 phase counters 5kHz IVC Series Small PLC Programming Manual 8 2 8 3 8 3 1 8 3 2 Chapter 8 Using High Speed I O 231 When used in the DHSZ instruction the maximum frequency for the 1 phase counters is 5kHz for 2 phase counters AkHz External Pulse Capture Function The input points that provides the external pulse capture function are X0 X7 The corresponding SM elements are listed below MO St sue LJ Note 1 When the output input point changes from OFF to ON the SM element of the corresponding terminal will be set to ON 2 SM90 SM97 will be cleared when the user program starts 3 The total pulse frequency input through X0 X7 should be smaller than 80kHz 4 If high speed counters or SPD instructions are used on the same input point the pulse capture function will become invalid after the first scan cycle regardless of the validity of the instructions High Speed Pulse Output High Speed Pulse Output Function The high speed pulse output is the pulse controllable with instructions PLSY PLSR PLS and PWM and output through YO or Y1 See 6 10 High speed I O Instruction for the usage of such instructions The pulse output is unrelated to the scan cycle Us
324. o response will be gotten after sending out the broadcast 05 06 15 and 16 can write element and support broadcast no response will be gotten after sending out the broadcast but slave station will process the received data 08 is the diagnostic function code it does not support the broadcast except its sub function codes 0x01 0x04 and Ox0A Hexadecimal IVC Series Small PLC Programming Manual 290 Appendix 8 ASCII Code Table Low 4 bit Appendix 8 ASCII Code Table HEX High 3 bit ri PE G W a TAS ER RA single e e gt MN MES JU 0 SE A A e a O C u Kb a WU soe E A EE NEE a a O SA E C pe E E a a per po taa ro Es Ss ee F i DEL or gafos for fe fo Underline NONE IVC Series Small PLC Programming Manual Appendix 9 Instruction Index 291 Appendix 9 Instruction Index Instruction function eee steps Influenced ABS Read current value instruction current value instruction Zero i ADD imteger math instructions math instructions Borrow ed es block and ee ab geet NO contact power flowand eee ES de integer AND lt instruction eae CO Wu al O al AND A A ERER 185 ee eg E ER ESE oo omar mein II EE EE EECH ANDRE Compare floating point number ANDRE instruction 7 IIIe ANDR Compare floating point namberANDR instucton 7 IIIe ANDR gt Compare floating point number ANDR gt instucton 7 IIIe ANDR gt Compare floating poin
325. o OFF Counting direction control Counting direction flag SM246 SM255 are the direction flags of C246 C255 SM element OFF counting up SM element ON counting down IVC Series Small PLC Programming Manual 228 Chapter 8 Using High Speed UC 8 1 2 High Speed Counter And SM Auxiliary Relay Relationship Special auxiliary relay for controlling counting Special auxiliary relay for monitoring counting direction direction Counter SN Up Down control Counter SN Up Down monitor C246 SM246 1 phase SM247 bi directional SM248 input SM249 1 phase 1 point SM240 C250 SM250 C252 SM252 2 phase input C253 SM253 C254 SM254 C255 SM255 8 1 3 Usage Of High Speed Counter 1 phase 1 point input high speed counter The 1 phase 1 point input high speed counter starts to count only when the pulse input changes from OFF to ON with the counting direction determined by its corresponding SM element Example The time sequence chart of the contacts action in the program is shown in the following figure X11 8 X6 are ON C244 starts to count X10 is ON C244 is cleared X12 84 SM244 are OFF C244 counts up X12 amp SM244 are ON C244 counts down C244 counts 3 and C244 contact state changes When X11 amp X6 are ON and X2 changes to ON C244 data and contact are cleared X12 SM244 X2 X11 E 4174 3 C244 0 7 3
326. o remove this fault download new system y configuration files or format the disk User program stops and ERR indicator turns on 42 Data block file error System error To remove this fault download new data block y file or format the disk User program keeps running ERR indicator 43 Battery backed data lost System error blinks To remove this fault clear the register or y o ER format the disk or reset D SE y User program keeps running ERR indicator Forced table lost System error blinks To remove this fault clear the register or y force or format the disk or reset User program keeps running ERR indicator is User information file error System error off To remove this fault download new program y and data block files or format the disk em ee AAA O EE IVC Series Small PLC Programming Manual 280 Appendix 6 System Error Code Eror ype ver 102 Instruction execution error 60 75 Sd User program compilation error User program stops and ERR indicator turns on KLS A 61 User program operation overtime error User program stops and ERR indicator turns on ee illegal user program instruction execution S Ee ge Execution error User program stops and ERR indicator turns on EJER Illegal element type of instruciton aperand Execution error User program stops and ERR indicator turns on 64 Illegal instruction operand value ee Outside instruction element range l SE User program keeps running ERR i
327. o the battery backed files System operation upon power on PLC will check the data in SRAM If the data saved in SRAM is correct it will remain unchanged If the data is incorrect PLC will clear all the elements in SRAM Communication Port You can set the two PLC communication ports in the Communication Port tab of the System block as shown in Figure 2 4 The items include protocol selection and setting the specific protocol parameters IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description System block Special Module Configuration Priority Level Of Interruption Saving Range Output Table Set Time Input Filter Input Point Advanced Settings Communication Port PLC communication port 0 setting O Program port protocol Freeport protocol O Modbus protocol ECbus setting PLC communication port 1 setting No protocol Freeport protocol Modbus Protocol ECbus Protocol Figure 2 4 Setting communication ports By default the communication port O uses program port protocol while the communication port 1 uses no protocol You can set as you need 1 Program port protocol By default the communication port O uses the program port protocol the dedicated protocol for the communication of IVC series PLC programming software Under this protocol you can set the communication baud rate between PC and port O through the serial port configuration tool of AutoStation In the TM state
328. occconnncccoconoconcncocononcnnnconononcnnononnnonnnranononcncnnananonnns 112 6 5 14 DGBIN 32 Bit Gray Code To Double Word INStruction o ccccocccncccnncncnoncnncnnncnononnnnononnnnonnnonnnnncnnonannnnnnos 112 60 19 SEGL Word 1o 7 Segiment e E 113 6 5 16 ASC ASCII Code Conversion INStruction cnar a a S aa Aa aaeei 113 6 5 17 ITA Hexadecimal Integer ASCII Conversion Instruction ccccooccncccocnncconcnnnnncnnnnnncnnononnnonnnnnnnonarnnnnnnnnnnnos 114 6 5 18 ATI ASCIl Hexadecimal Integer Conversion Instruchon 115 6 6 Word Logic Opera OA EE 115 00 1 WAND AND VV Ord ASTUCIA aaa 115 60 6 2 WOR Ee e BET EE 116 6 6 3 WXOR Exclusive OR Word MA A A 116 604 WINY NOT Word Wl Cd Leen a dl o e a os o ad ld 117 6 6 5 DWAND AND Double Word Instruchon uk 117 0 0 0 DW OR OR Double Word INSTUCION iia adds 118 6 6 7 DWXOR Exclusive OR Double Word INStruction ccooooccnccoccnconocnncconcnnnnncnnnnnnonononcnnnnonnnnnnnnnnnnnnrnnnnnnnnnnnos 118 6 6 8 DWINV NOT Double Word Instruction cccccccccseeeeeceeeeeeeeeeeeeeeeeeesaeeeeeeeeeeeeseeeeseeeeeesaeeeesaaeeeesaeeeeaeeeeesaees 119 6 7 SAt Rotate E dee EE 119 6 7 1 ROR 16 Bit Circular Shift Right Instruction oooccccconncncoocnnnononononnncnnonononnonnononnnnnnonnnnnnnnnnnnnnnnrnnnnnnnnnonos 119 IVC Series Small PLC Programming Manual 12 Chapter6 Application Instructions 6 7 2 ROL 16 Bit Circular Shift Left Instruction 2 0 0 ee ccceecceeceeeeee
329. of 2 station to the public area D7716 distributed by the network Execute sum operation of D7700 and D7716 in 4 PLC and save the sum to the local element D500 IVC Series Small PLC Programming Manual Appendix 1 Special Auxiliary Relay 263 Appendix 1 Special Auxiliary Relay All the special auxiliary relays are initialized when the PLC changes from STOP to RUN Those that have been set in system setting will be set to the preset value after that initialization LU Note The reserved SD and SM elements are not listed in the table The reserved SM elements are by default read only R 1 PLC Work State Flag Action and function IVC2 IVC1 Monitoring run bit This bit is high in the RUN state and low in the STOP state PARE A a russia eg high when PLC changes form STOP to RUN and set low after a MEMES Power on flag bit This bit is set high after system power on and set low after a scan cycle OREN SE This bit is set when system error occurs after power on or after PLC changes from SM3 System error y y am system error STOP to RUN or reset if no system error occurs pe iv fy SM4 Battery voltage This bit is set when the battery voltage is too low or reset if the battery voltage is y low detected higher than 2 4V y SM5 AC power failure This bit is set when PLC detects AC power off detecting time 40ms If the power y detection bit is on after the delay of power off detecting time set in SDO5 the bit will be reset SM6 24Vdc powe
330. ogram complex It is not recommended to do this 6 1 5 CFEND Conditional End From User Main Program CAD IL 4 HA CFEND IL CFEND Function description Example 1 When the power flow of the instruction is The current scan eycle ends valid the current scan cycle of the main ee e mo CFEND program ends immediately and the following CFEHD LD SM12 instructions in the main program will not be SE YO e OUT YO executed 2 When the power flow of the instruction is invalid the instruction enables no action and the instruction after it will be executed in order Note The CFEND must be used in the main program or the program cannot pass the compiling When the program is running if MO OFF the CFEND instruction will not enable any action The following instructions LD and OUT will be executed When MO is ON the CFEND instruction will be executed the main program will end the current scan cycle immediately and the following instructions will not be executed IVC Series Small PLC Programming Manual 78 6 1 6 6 1 7 Chapter6 Application Instructions WDT User Program Watchdog Reset LAD Applicable to IVC2 IVC1 SE influenced ag i WOT Program steps 4 ooo Function description When the power flow is valid the instruction will clear the user program watchdog and the watchdog will restart timing El Enable Interrupt Instruction Applicable to IVC2 IVC1 Program steps 17 Function descripti
331. ol slave station N N bus communication protocol master station slave station Port 1 RS 232 or Free port protocol Modbus communication protocol master station slave station RS 485 N N bus communication protocol master station slave station You can also set the mode selection switch of IVC series PLC to TM to to transfer port O to programming port protocol IVC2 IVC1 10 2 Programming Port Protocol The programming port protocol is an internal protocol dedicated to the communication between the host and the PLC 10 3 Free Port Communication Protocol 10 3 1 Introduction The free port protocol is a communication mode with user defined data file format It supports two data formats ASCII and binary The free port protocol realizes data communication through instructions and can only be used when PLC is in the RUN state The free port communication instructions include XMT sending instruction and RCV receive instruction 10 3 2 Parameter Setting of Free Port Select Communication Port in the System block dialogue box and select Freeport protocol in port 0 or port 1 setting area to enable the Freeport setting button as follows System block Special Module Configuration Priority Level Of Interruption Saving Range Output Table Set Time Input Filter Input Point Advanced Settings Communication Port PLC communication port 0 setting Program port protocol Free port setting Modbus protocol
332. on Input Filter In the Input Filter tab you can set the filter constant for a PLC input terminal The digital filter can eliminate the noise at the input terminal Only input terminals XO X17 for IVC1 series XO X7 use digital filter while other digital input terminal use hardware filter See Figure 2 5 IVC Series Small PLC Programming Manual Chapter 2 PLC Function Description System block Special Module Configuration Priority Level Of Interruption Advanced Settings Communication Port Saving Range Output Table Set Time Input Filter Input Point Default value CS Filter constant of the input point a Y ms The config parameters must be downloaded before they become effective Not all types of PLC support each system block option View the system block option supported by the PLC by oressina F1 Figure 2 5 Setting input filter IVC2 setting range Oms 60ms Default 10ms IVC1 setting range Oms 8ms 16ms 32ms 64ms Default 8ms Output Table In the Output Table tab you can set the state of output points when the PLC is in STOP state See Figure 2 6 System block Special Module Configuration Priority Level Of Interruption Advanced Settings Communication Port Saving Range Output Table Set Time Input Filter Input Point O Freeze config Os 2 EACH DES H 13209 42556 Y When the PLC is switched from RUN mode to STOP mode all the outputs will be disabled The config p
333. on 1 When the power flow of the El instruction is valid the interrupts in the current scan cycle will be enabled 2 When the El instruction is valid the interrupt requests will be allowed to join the interrupt request queue to wait for system response DI Disable Interrupt Instruction LAD Applicable to IVC2 IVC1 se aa MEA influenced ag BIE Co Program steps 17 Function description 1 When the power flow is valid the global interrupt enable flag is inactive that is the global interrupt will be off 2 When the global interrupt enable flag is inactive the interrupt events will not generate any interrupt request Note When the DI instruction is valid the system will still respond to the unprocessed interrupt requests in the request queue but new interrupt events cannot generate interrupt requests CIRET Conditional Return From User Interrupt Subprogram ES to IVC2 IVC1 C CIRET Program steps nl Function description When the power flow is valid the system will quit the current interrupt program immediately 6 1 10 STOP User Program Stop LAD Applicable to IVC2 IVC1 pp influenced fag BE iL STOP Program steps T oooO i Function description When the power flow is valid the system will immediately stop the execution of the user program IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 79 6 1 11 CALL Calling A Subprogram CAD HH CALL SBR_NAME PARAMI PARAM
334. on S Source operand the data format of S must match the BCD code format D Destination operand Function description When the power flow is valid S will be converted from 16 bit BCD code to integer and the result is assigned to D Note When the data format of S does not match the BCD code format the system will reports illegal operand and will not execute the instruction and D will not change Example xO 21845 5555 LD XO BIH D nid BIN DO D10 kb When XO is ON DO 0x5555 21845 will be converted from 16 bit BCD code to integer and the result 0x15B3 5555 is assigned to D10 6 5 10 DBIN 32 Bit BCD To Double Word Instruction LAD HA DBIN ei IL DBIN S D Operand Type Applicable to IVC2 IVC1 Program steps Applicable elements Offset addressing MT OTST ST Vvy v_ o mme element OTT eC PUP VT Operand description S Source operand D Destination operand Function description 1 When the power flow is valid S will be converted from 16 bit BCD code to double integer and the result is assigned to D 2 The data format of S must match the BCD code format Note When the data format of S does not match the BCD code format the system will report operand error and will not execute the instruction and D will not change Example xO STOIGOSTT 999399399 LD XO pe Bar td DBIN DO D10 When XO is ON DO D1 0x99999999 2576980377 will be converted from 32 bit BCD code
335. on you can save the intermediate aE Ze o mmm soe 2 AND SM196 data into EEPROM with the EROMWR instruction eae EROMWR D6016 2 2 This instruction is executed upon the rising edge e Wm Cer ge 3 Two EROMWR instructions cannot be executed at e A EE UD M1001 the same time When SM196 the EEPROM write OK OF AND SM196 flag is ON it indicates that EEPROM is okay for write EROMWR D6032 16 operation When SM196 is OFF it indicates that an RST M1001 In the preceding example two sets of D elements are stored in the EEPROM 1 SM1 and M1 makes M1000 generate a rising edge during the second scan cycle and triggers the execution of the first EROMWR instruction 2 M1001 and SM196 makes the second rising edge triggering the execution of the second EROMWR instruction EROMWR instruction is being executed Note An EROMWR instruction will make the scan cycle 2 5ms longer It is recommended to set the S7 to 6000 plus an integer multiple of 16 like D6000 D6016 and D6032 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 135 6 9 Real Time Clock Instruction 6 9 1 TRD Read Real Time Clock Instruction Applicable to IVC2 IVC1 D Program steps Offset Applicable elements addressing EO REE TEASER ee ee ee Operand description Note D the starting storage element for the system time The TRD instruction will fail upon system clock which occupies the 7 consecutive elements starting setting error
336. on A Convertion Ad 3 For help press EL OVR Row 1 Col 1 Status bar Figure 1 3 AutoStation main interface For the usage of AutoStation programming software refer to the AutoStation Programming Software User Manual 1 2 4 Programming Cable You can use the Invt dedicated programming cable to program and debug the PLC Note that there are two kinds of cables one being optically isolated and hot swappable the other being non isolated and not hot swappable Neither of them requires setting jumpers See the following figure for the connection of the programming cable IVC Series Small PLC Programming Manual 6 1 3 1 3 1 1 3 2 1 3 3 Chapter 1 Product Overview Figure 1 4 Connection of programming cable Communication Function Each IVC series PLC basic module has two integrated serial ports PORT 0 and Port 1 The Profibus and Canbus extension modules are also available for the communication in a fieldbus network The two serial ports of the basic module are compatible with Modbus N N bus and user defined free port protocols Modbus Protocol Network The basic module can set up a RS 485 Modbus network with multiple inverters PLCs and other intelligent devices through the RS 485 on Port 1 or through Port 0 and a RS 232 485 converter The maximum communication distance is 1200 meters and maximum baud rate is 38400bit s RTU and ASCII transmission modes are optional The basic module can communicate one to one
337. on flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVC Series Small PLC Programming Manual 168 6 12 7 Chapter 6 Application Instructions IVFRQ FREQUENCY CONVERTER Set Frequency Instruction LAD H IFR 6p 52 53 Applicable to IVC1 IL IVFRQ S1 S2 S3 Operand Type CS E HS o Tp ee ee TP D Operand description ST designated communication channel channel 1 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 S3 frequency of the drive Function description 1 Set the serial port and drive address and control the drive operation frequency through communication in the Modbus protocol 2 This instruction is executed upon the rising edge Applicable elements addressing Co EE EE a ee ee HEEN ee ee E E KEE ETE E ee ee ee es Example Ml m IFA 1 1 50 LD M1 IVFRQ 1 1 50 1 Set the serial port 1 and drive address 1 and control the drive operation frequency through communication in the Modbus protocol 2 After the drive receives the data it will conduct CRC check address check and instruction check and set the communication completion flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVC Series Small PLC Programming
338. ong as the current does not exceed the rated load current the smaller the load is the closer the output waveform is to the set operand 5 During the execution of the high speed instruction so long as the power flow is not OFF no other instructions can use the same port unless the high speed pulse output instruction is invalid IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 6 The PLSY PLSR PLS and locating instructions can output high speed pulses through YO and Y1 Note 6 10 12 PWM Pulse Output Instruction SD 52 D IL PWM S1 S3 D sr NT operand Kax Kny RM Kn frm rsm o f so g e 52 107 Operan Kox Kny Knit Kns Temleen Geier o poa yj 1 IS Operand description S1 pulse width ms Range 0 32767 ms When 7 is bigger than 32767 the system will report illegal instruction operand and no hardware resources will be occupied You can change the output pulses in real time by changing 7 during the execution of the instruction S2 pulse cycle ms Range 1 32767 When S2 is outside the range the system will report illegal instruction operand no pulse will be output and no system resources will be occupied You can change the output pulses in real time by changing S2 during the execution of the instruction S2 must be bigger than ST or the system will report illegal instruction operand no pulse will be output and no system resources will be occu
339. operand xO 1000 1000 LD XO Function description o SS ITD DO D10 When the power flow is valid When XO is ON DO 1000 will be converted from integer to double integer S will be converted from and the result 1000 is assigned to D10 D11 FLT Integer To Floating Point Number Instruction LAD Applicable to IVC2 IVC1 a e nr o teres aa Senge IL FLT S D Program steps Offset addressing SINT Constant KnX kay Kam e kimk D s ery Co RAT TE ETE ST A eT P TY Y Type Applicable elements Operand description Example S Source operand x0 10005 19005 00 LD D Destination operand PI 0 tke XO Function description Ge When the power flow is valid D10 S will be converted from integer to floating point number and the result is assigned to D When XO is ON DO 10005 will be converted from integer to floating point number and the result 10005 0 is assigned to D10 D11 DFLT Double Integer To Floating Point Number Instruction LAD Applicable to IVC2 IVC1 a Hr nunca fag bi IL DELT S D Program steps 7 Operand Type Applicable elements S INT Gottes Kn Kew Ras enes o SOT CT PY ore TT dT UT UT O IS II II O IS ESSESERG Offset addressing Operand description point number and the result is assigned to D S Source operand Example D Destination operand op 100000 000000 LD XO Function description gege DFLT DO D10 When the power flow is valid When XO is ON DO D1 100000 w
340. operand 1 MO ON ON LD MO D destination operand E E E dis S E l SFTLXOM10 103 S2 Source operand 2 S3 Source operand 3 DIT ORAR When the power flow is valid Ne S2 elements starting with D will more leftward for S3 units 1 When MO is ON the contents of 10 elements starting with M10 will move and the S3 elements at the leftward for 3 bits and the leftmost elements M17 M19 will be discarded At the leftmost side will be same time the contents of the 3 elements starting with XO will be filled into the discarded At the same time right end of the string the contents of S3 elements 2 Before the execution XO 1 X1 0 X2 1 M10 0 M11 1 M12 1 M13 starting with 7 will be filled 0 M14 0 M15 1 M16 0 M17 0 M18 0 M19 1 into the right end of the 3 After the execution the contents of XO X2 remain unchanged M10 1 M11 string 0 M12 1 M13 0 M14 1 M15 1 M16 0 M17 0 M18 1 M19 0 Note 1 The elements with smaller SN are at the right and the elements with larger SN are at the left 2 220 3 320 IVC Series Small PLC Programming Manual LAD H FROM 32 Chapter6 Application Instructions 129 6 8 External Equipment Instruction 6 8 1 FROM Read Word Form Special Module Buffer Register Instruction dis pa eee eg lL FROM eu _ 52 Sa Applicable elements Offset addressing s1 NT Constant S2 Constant Db IN S ee ee e
341. ormal execution of user program 2 The system will read in the request queue the head record which is the number of the first interrupt event The interrupt program corresponding to the event number will be called and executed 3 When the interrupt program is finished the corresponding head record of the request queue will be deleted and all the following records will take one step foward 4 The system will repeat these procedures until the queue is empty 5 When the interrupt request queue is null the system will continue to execute the interrupted main program 3 The system can handle only one interrupt request at one time When the system is processing an interrupt request a new interrupt event will be added to the interrupt request queue rather than being responded immediately The system will process it after all the requests ahead of it in the queue are processed 4 When there are 8 records in the interrupt request queue the system will automatically mask the new interrupt event so that no new requests will be added to the queue The mask will not be cancelled until all the requests in the queue are processed and the interrupted main program is executed EJ Note 1 The interrupts should be brief or abnormalities may occur including the mask of other interrupt events missing of interrupt requests system scan overtime and low execution efficiency of main program 2 It is prohibited to call other subprograms in the interrupt program
342. p button Mi Figure 4 7 Variables defined in the global variable table IVC Series Small PLC Programming Manual Chapter 4 Programming Concepts 49 Symbol Addressing When the defined variables are used you can select View gt Symbole Addressing to display their names instead of their addresses in the LAD or IL program The following figure shows the LAD program when the Symbol Addressing is not checked MAIN 4 p gt x Comments Variable addr Variable Name Variable Type Data Type e A iv Figure 4 8 When symbole addressing is unchecked The following figure shows the LAD program when the Symbol Addressing is checked MAIN 4 gt x Variable addr Variable Name Variable Type Data Type Comments 5 Saal lt gt Waterpress 4larmindic A ure Timing ator Open the valve to the pool Startl Stopl SET Valve Start lv lt lt Figure 4 9 When symbole addressing is checked Element comment You can select View gt Element Comment to display the element comments in the LAD program as shown in Figure 4 10 y MAIN 4 gt x Variable addr Variable Name Variable Type Data Type Comments F gt ss Waterpress Alarmindic A ure Timing ator atk of wat 0mins Water wolum er pressu e alarm Open the valwe to the pool Startl Stopl SET Valve Control Val ve StartzZ L lt gt Figure 4 10 The LAD program displaying element comments LU Note
343. peed counters that is driven by HCNT 2 The DHSZ instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV 3 DHSZ DHSCI DHSCS DHSCR DHSP DHST can be used repeatedly However at most the first six such instructions can be driven at the same time 4 The maximum frequency supported by the PLC high speed counters will be seriously affected by instructions like DHSCS DHSCI DHSCR DHSZ DHSP and DHST For details see Chapter 8 Using High Speed I O Example LD MO U Wm C249 1000 HCNT C249 1000 0 OFF LD M1 ER SES Ge no l DHSZ 1500 2000 C249 Y10 ar LD SM249 YE OUT Y12 g LD C249 OUT Y6 1 When MO and X6 are both ON C249 will count up when SU changes from OFF to ON or count down when X1 changes from OFF to ON When C249 changes from 999 to 1000 the C249 contact will be set wnen C249 changes from 1001 to 1000 the C249 contact will be reset When C249 contact drives Y6 the execution of Y6 will be determined by the user program scan cycle 2 When M1 is ON the DHSZ instruction meets the requirements stated in the preceding Note the states of elements Y10 Y12 are as follows 1 C249 lt 1000 Y10 ON Y11 8 Y12 OFF 2 1000 lt C249 lt 2000 Y10 Y12 OFF Y11 ON 3 C249 gt 2000 Y10 Y11 OFF Y12 ON The outputs of Y10 Y11 and Y12 are immediate regardless of the scan cycle 3 When MO and X6 are ON at the same ti
344. pied D high speed pulse output point YO or Y1 Function description Output PWM pulses with the width of 7 and cycle of S2 at the port designated by D Note 1 When S7 is 0 YO or Y1 output is OFF When S1 is equates S2 YO or Y1 output is ON 2 The waveform at output points YO amp Port 0 Y1 4 Port 1 is related to the load so long as the current does not exceed the rated load current the smaller the load is the closer the output waveform is to the set operand Therefore in order to output high speed pulses the load current at the PLC output transistor must be big but smaller than the rated load current 3 During the execution of the high speed instruction so long as the power flow is not OFF no other instructions can use the same port unless the high speed pulse output instruction is invalid 4 Using two PWM instructions can output two independent pulses at YO and Y1 You can also use Applicable elements that only one instruction can use one output port at one time Applicable to IVC2 IVC1 Offset addressing Program steps the PLSY and PLSR instructions to get independent pulse outputs at different output ports YO Y1 5 When multiple PWM PLSY or PLSR instructions work on the same output point the first valid instruction will control the state of the output point and others will not affect the output point state 6 Just like other high speed instructions DHSCS DHSCR DHSZ DHSP DHST and
345. program sections to the program Do remember to add program sections that provide general functions such as start stop and alarm functions Such program sections should all be put in LAD blocks LU Note The start and stop operations are crucial for personal and equipment safety Considering the special features of SFC program make sure that all outputs that should be stopped are shut down when the PLC is stopped Points To Note In SFC Programming The STL instruction has some special characteristics and the PLC scans instructions cyclically by their display order Because of these reasons there are some points to note during SFC programming Common Programming Errors 1 Reusing steps In the same PLC program each step corresponds to a unique S element and cannot be reused Note this when editing a SFC program using the LAD editor 2 Setting branches after a transfer condition Setting conditioned branches after a transfer condition is prohibited in SFC programming as shown in the left figure below Instead you should change it into the right figure below 3 Connecting output coils to internal bus after a NC or NO contact instruction Connecting output coils to the internal bus after a NO or NC contact instruction in a branch is prohibited as shown in the left figure below In stead you should change it into the right figure below IVC Series Small PLC Programming Manual 214 Chapter 7 SFC Tutor 4 Reusing the s
346. ps Offset Operand Type Applicable elements addressing Kav Ko Kns emenn DT SDT CT y o m meme Rn Ras Of so fe ft fv zt Operand description Example m0 iB LD SMO 7 cane ne ce ARU DBITS 16 FFOFF D10 D destination operand l ae la When the power flow is valid it is counted that there are 16 bits whose Function description value is 1 ON status in constant 16 FFOFF so 16 is stored into D10 When the power flow is valid count how many bits in double word S is 1 and store the result into D IVC Series Small PLC Programming Manual 180 Chapter 6 Application Instructions 6 15 Word Contactor Instruction 6 15 1 BLD Word Bit Contactor LD Instruction LAD Applicable to IVC2 IVC1 ERE RA IL BLD S1 S2 Program steps Offset Applicable elements addressing sr WORD eriw ROS emie OT SOTO TT TV y 52 Nr Constant RX Kv vg kns kum ksm oeren Operand description Example S1 source operand 1000 10 BLD DOS ELD D0 5 e E OUT YO S2 designated bit O lt S2 lt 15 or system will report l Use the status of BIT5 ON in DO 1000 operand error l 2 0000001111101000 to determine the status of YO in Function description the following operation Use the status of bit S2 in element S7 to drive the following operation 6 15 2 BLDI Word Bit Contactor LDI Instruction LAD Applicable to IVC2 IVC1 n BLDI sp 52 PC Influenced flag bit IL BLDI S1 S2 Program steps Offset Oper
347. ps S30 and S31 will be validated at the same time when condition M30 is met 2 Parallel merge The parallel merge is the structure where all parallel branches merge to the same step by invalidating all branch steps at the same time As shown in the preceding figure in program row N6 when the program is running both S30 and S31 at the same time if condition M31 is met the program will start S32 and end S30 amp S31 The sequential control behind the parallel merge structure is that no next step can be executed unless all the parallel steps are finished Jump structure The applications of jumps include to omit certain steps to recycle by returning to the initial step or a normal step and to jump to another independent procedure 1 Omitting certain steps In a procedure when certain steps are unnecessary under certain conditions the program can jump directly to the needed step and omit the unnecessary steps as shown in the following figure with LAD on and left and SFC on the right In the SFC program shown in the preceding figure S21 is used as the jump while step S20 is omitted The jump is actually a selection branch While in the LAD counterpart the second branch in row NO is the jump instruction which uses the OUT coil instead of the SET instruction in the transfer When step SO is valid and if M1 is ON the program will jump to step S21 2 Recycling In a procedure when it is necessary to recycle a part or all of
348. puts when the user program is still running you can use this instruction Applicable elements Offset D BOOL SI S INT Constat O Note Generally the REF instruction is used to refresh I O immediately between the FOR NEXT instruction and the CJ instruction You can also use the REF instruction to obtain the latest input and output the operation result without delay during the execution of the interrupts with I Os To refresh a relay output you need to consider the response time Example Mo OFF UD MO REF YO 5 i REF YO 8 When MO is ON the stats at YO Y7 will be output immediately regardless of the scan cycle IVC Series Small PLC Programming Manual 134 Chapter 6 Application Instructions 6 8 8 EROMWR EEPROM Write Instruction LAD Applicable to IVC2 IVC1 EROMIR Kei 51 Influenced flag bit L EROMWR S1 eg Program steps 1 Applicable elements Operand Type ar mee II Offset addressing 52 NT Constant Kox Rav Katt Kns Ktm Rom o So eft fv zp vy Operand description Example S1 starting address of the elements to be stored LD M1 Range D6000 D6999 ee see GE geg S2 number of the elements to be stored S2 lt 16 ser om MOV 16 D6016 S1 S2 lt D7000 Mov 16 16016 MOV 32 D6032 Function description Mov 32 ez o ge SMi OFF 1 Partial PLC data are battery backed However z LD M1000 during the calculati
349. r rod BACK X10 ue BACK X11 rod BACK X12 9 Capping cylinder ein o si OUT X7 Labelling cylinder Eliminating cylinder rod OUT X6 rod OUT X5 ES Rotary plate of E packing magine e 2 ep TI Running direction Bottle Bottle Bottle of rotary plate Exit of rotary plate Entrance of l Rotary plate step rotary plate limit switch XO Rotatary plate Cap in position motor YO detection switch X2 Labelling Exit of disqualified cylinder Y2 products Bottle in position detection switch X During the operation the rotary plate rotates one step each time which is detected by the XO limit switch The rotary plate will stay at each step long enough for all the three procedures driven by cylinders are finished The cylinder rod OUT signal and cylinder rod BACK signal are monitored respectively The input and output points arel isted in the following table SN Monitored object Monitored object Rotary plate step limit switch BI X10 Capping cylinder rod BACK 10 11 13 14 X2 Cap in position detection switch MOT X2 Eliminatiing cylinder rod BACK Label detection switch A Rotary plate motor X1 Bottle in position detection switch Labelling cylinder rod BACK Capping cylinder oni 5 Etminaing inder od OUT Labelling cylinde
350. r SN Range C236 ee S LD X10 C255 Li gt OUT SM236 S Comparison constant a m e e ec y p ie vag ON a SS S RST C236 signe bit data Range e Ae r LD X12 2147483648 2147483647 HCNT C236 5 Function description soi Rising eg Rising Drive the specified hardware ae Bastin i high speed counter All high l Startup input speed counter must be driven EECH to perform high speed X000 counting Meanwhile the NO Counting input contact action of the counter will be judged based on the S Current value o 0 value SE Output situation 1 ce Note The HCNT instruction SPD instruction external input interrupt and pulse capture may have contradictory hardware demands Pay attention to the preconditions of all system high speed I Os and refer to the instruction description in actual practice C235 output contact 1 When X12 changes from OFF to ON the hardware counter C236 will be initialized XO is the pulse input point for C236 which counts the pulse input through X0 When X12 is OFF X0 is a common input point and C236 cannot count the external pulse of XO 2 Contact actions when the current value of the counter C236 increases from 6 to 5 the contact of C236 will be set When the counter C236 decreases from 5 to 6 the contact of C236 will be reset 3 When X11 is ON the RST instruction will be executed C236 will be cleared and the C236 contact will be disconnected 4 When
351. r This bit is set when PLC detects the 24Vdc power failure detecting time 50ms If g y failure within the following 50ms the power is detected to be back this bit will be reset If this bit is set as 1 fi ly th h syst lock the Battery back bata is bit is set as 1 configurable only through system block the Ba tery backed SM7 mode data lost error code 43 and the Forced table lost error code 44 will not be y reported upon system battery failure SM8 Constant scan Set this bit and the scan time will be constant configurable only through system y y mode block SMO Input point startup Set this bit and the PLC can change from STOP to ON when the designated X g y mode input point is ON configurable only through system block 2 Clock Running Bit Name Action and function IVC2 IVC SM10 10ms clock Crystal oscillation period 10ms Reverse every half period The first half period is d 4 O when the user program starts SM11 100ms clock esta oscillation period 100ms Reverse every half period The first half period J J is O when the user program starts M Crystal oscillation period 1s Reverse every half period The first half period is O SM12 1s clock J P e D k J ov when the user program starts 8M13 1min clock Crystal oscillation period 1min Reverse every half period The first half period is O g y when the user program starts Gegen ageet Crystal oscillation period 1 hour Reverse every half period The first hal
352. r rod OUT fe i we 7 Labelling cylinder 7 gt r an einer OUT ICO ACI Eliminating cylinder IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 223 It is obvious that this is a parallel branch structured flow With every step that the rotary plate makes all the tree procedures are carried out at the same time Then when the three procedures are finished the rotary plate will rotate one step again See the following figure for the corresponding SFC program and its LAD counterpart In the program M1 M3 are the qualification flags for the procedures of capping labeling and eliminating respectively When the capping procedure runs to S22 X2 will check whether the capping is qualified or not If yes the corresponding qualification flag M1 will be set When the labelling procedure runs to S25 X3 will check whether the labelling is qualified or not If not M2 will be reset After all the procedures are complete at step S29 the M2 state will be transferred to M3 and M1 state will be transferred to M2 The capping procedure will act according to X1 state If X1 indicates no bottle is in position the capping will not proceed The labelling procedure will act according to M2 state If M2 is OFF it indicates that the bottle in position is disqualified and the labelling will not proceed The eliminating procedure will act according to M3 The elimination will not be conducted when M3 is ON which indicates that the bottle is quali
353. r than 100 IVC Series Small PLC Programming Manual LAD I 4 H DHSCR Gu IL DHSCR S1 S3 Operand Type Chapter 6 Application Instructions 145 6 10 4 DHSCR High speed Counting Compare Reset Instruction Applicable to IVC2 IVC1 52 ee influenced fag bit OOOO Offset addressing Program steps Applicable elements EE EE EE EE Operand description S1 a 32 bit DINT data the one with which the high speed counter will compare Range 2147483648 2147483647 S2 high speed counter Range C236 C255 D target bit element The action on Y M S or C will be valid immediately regardless of the scan cycle If Dis a C element it must be S2 Function description A high speed counter will count in the interrupt mode only when it is driven by the HCNT instruction and the counting input changes from OFF to ON When the counter counts to 7 the D element will be reset and output for Y elements immediately You can use this instruction when you want to reset and output for Y elements a certain bit element by comparing the counter value with a preset value Note 1 The DHSCR instruction must work together with the HCNT instruction because DHSCR is only applicable to the high speed counters that is driven by HCNT 2 The DHSCR instruction will be validated only by pulse input You cannot validate the instruction by changing the counter value with instructions such as DMOV or MOV
354. r the online edit state In the online edit state you can edit the main program subprograms and interrupts as usual After the edit click PLC gt Download and the edited program will be compiled and downloaded to the PLC automatically When the download completes the PLC will execute the new program Limits 1 In the online edit state you cannot change the global variable table or any local variable table nor add or delete any subprogram and interrupt 2 AutoStation will quit the online edit state if the PLC is stopped 2 4 4 Clearing And Formatting You can use the clearing operation to clear PLC element value PLC program and PLC datablock While through formatting you can clear all PLC internal data and program PLC Element Value Clear The PLC Element Value Clear function can clear all element values when the PLC is in STOP state Think it twice before using the clearing function because clearing PLC element values may cause PLC operation error or loss of working data PLC Program Clear The PLC Program Clear function can clear the PLC user program when the PLC is in STOP state Think it twice before using the clearing function because after the PLC user program is cleared the PLC will have no program to execute PLC Datablock Clear The PLC Datablock Clear function can clear all the PLC datablocks when the PLC is in STOP state Think it twice before using the clearing function because after the PLC datablock is
355. rameter 1 lis i l D Do D2 S2 comparison parameter 2 i LD lt DOD2 100000 200000 a Function description D po D2 m TE OUT Y1 c Sd and 100000 200000 12 LD lt gt DO D2 ompare elements S1 an Ds mm re E 5 OUT Y S2 and use the comparison 100000 200000 13 LD gt DO D2 result to drive the following ae m ue A E gt OUT Y3 100000 200000 Y4 _ operation me m De E 3 LD gt DO D2 100000 200000 15 SE YA Ie DO Dz m E LD lt D0 D2 OUT Y5 Compare DO D1 and D2 D3 and use the comparison result to determine the output status of the following element IVC Series Small PLC Programming Manual 188 Chapter 6 Application Instructions 6 16 5 Compare Double Integer ANDD lt gt lt gt gt Instruction Applicable to IVC2 IVC1 Influenced flag bit ANDD S1 S2 ANDD lt S1 S2 ANDD gt S1 S2 ANDD lt gt S1 S2 Program steps ANDD gt S1 S2 ANDD lt S1 S2 sr Dr Constant KX er Row ee rom RSM OT SOT CT TV Ty 52 BINT Constant ax Ky eu ee kum ksm o f so ce fv Operand Applicable elements Operand description Example S1 comparison parameter 1 LD XO ei ter 2 LDD DO D2 comparison parameter OUT YO Function description LD X1 sogon 50000 10 LDD lt DO D2 Compare elements S1 and D D0 De HA E gt our vi i 50000 50000 Yi S2 ana ek the EOmparson ge To Se pa y LD X2 result in serial connection with dd SE e LDD lt gt DOD2 other nodes to drive the D gt 0
356. rand the data will be stored in two modes Function description e When SM186 is OFF the execution result is DO 0x3231 D1 0x3433 D2 0x3635 When the power flow is valid the string 7 S8 will be converted to ASCII code and the result is assigned to the elements starting with D When SM186 isOFF the high low byte of each D element will store two ASCII code data When SM186 is ON the low byte of each D element will store 1 ASCII code data D3 0x3837 e When SM186 is ON the execution result is DO 0x31 D1 0x32 D2 0x33 D3 0x34 D4 0x35 D5 0x36 D6 0x37 D7 0x38 IVC Series Small PLC Programming Manual Chapter pG Application Instructions ITA Hexadecimal Integer ASCII Conversion Instruction LAD HA 51 D 52 Applicable to IVC2 IVC1 IL ITA S1 S2 Program steps Operand Type Applicable elements aci addressing Si WORD Constan Kx Ky Kaw eg Teen OT SOT 0 TI Y o Won mes en fe PT AA 2 WORD Constant Knx Kn Kaw Kas kmen o so CT Tv pz fv Operand description S1 Conversion source hexadecimal data D destination operand S2 number of ASCII codes 1 lt S2 lt 256 Function description When the power flow is valid the hexadecimal data starting with 7 element will be converted to S2 ASCII codes and the result is assigned to the elements starting with D When SM186 is OFF the high low byte of each D element will store two ASCII code data When SM186 is ON the
357. ray code and the result is assigned to D IVC Series Small PLC Programming Manual Chapter pG Application Instructions LAD HU en ei 6 5 13 GBIN 16 Bit Gray Code To Word Instruction Applicable to IVC2 IVC1 D IL GBIN S D Program steps Operand Type kn Operand description S Source operand D Destination operand Function description When the power flow is valid S will be converted from 16 bit Gray code to integer and the result is assigned to D LAD LEI DGBIN 5 IL DGBIN S D Operand Type Operand description S Source operand D Destination operand Function description When the power flow is valid S will be converted from 32 bit Gray code to double integer and the result is assigned to D Offset Applicable elements BESSER addressing DEE E E pin Ter Ter rar Example AU bono 45690 G IN D nid When X0 is ON DO OxFFFF 65535 will be converted from 16 bit Gray code to integer and the result OxAAAA 43690 is assigned to D10 LD X0 GBIN DO D10 6 5 14 DGBIN 32 Bit Gray Code To Double Word Instruction Applicable to IVC2 IVC1 influenced flag bit Program steps Offset Applicable elements addressing KnSM LD X0 X0 3435973836 2290649224 mp DGBIN DO D10 DEIN D When XO is ON DO D1 OxCCCCCCCC 3435973836 will be converted from 32 bit Gray code to double integer and the result 0x88888888 2290649224 is assign
358. re oating point number gt F y 192 instruction IVC Series Small PLC Programming Manual Appendix 10 Classified Instruction Index 301 Program deer fla ae Integer to double integer instruction 107 Double Double integer to integer instruction to integer instruction Integer to tds e o point number instruction Double int to floating point number instruction Floating point number to integer Zero Carry we gp g ry d y 108 instruction Borrow Floating point number to double integer Zero Carry instruction ES BCD Word to 16 bit Word to 16 bit BCD instruction instruction MITA pct Tosseng SS O Double word to 32 bit BCD instruction te 09 Data DN 16 bit BCD to word instruction bit BCD to word instruction Se ee 110 10 convening DBIN 32 bit BCD to doubl d instructi 110 Word to 16 bit gray code instruction to 16 bit Word to 16 bit gray code instruction code instruction WEA Double word to 32 bit gray code instruction GBIN 16 bit gray code to word instruction DGBIN 32 bit gray code to double word instruction SE Word to 7 Word to 7 segmentencode encode MES ee cin Code conversion instruction a hexadecimal integer ASCIl conversion 0 ASCIll hexadecimal integer conversion anengen BLD Word bit contactor LD instruction bit contactor LD instruction 180 am Weoo Lekt BAND Word contactor AND nsueion le Word BAR Wort BR contr ANI 8 J ESET Word tea se nse Ps BRST Tw
359. redient pipe Deionized B minor ingredient pipe Major ingredient pipe water Ba S ER YO valve Y2 valve Y1 Major ingredient valve Y3 valve E m Mixing pot Rinsing nozzle Gi Rinsing nozzle Stirring paddle Y4 evacuation valve To start the operation the operator should select through the touch screen the product type A or B for the next batch of product As the second step the major ingredient wil be added until the added ingredient reaches 2000kg As the third step minor ingredient A for type A product or B for type B product will be added until the added minor ingredient reaches 500kg As the forth step the ingredients will be mixed round for 20 minutes As the fifth step the material will be evacuated until the left material is less than 20kg and the delay is over Then the machine is ready for the next round If the machine is brand new or the product type produced last time is different from what is going to be produced you need to open the deionized water valve and evacuation valve to rinse the machine for 5 minutes before the operation The input and output points are listed in the following table Il Xo Deionized water valve open water valve open MES Evac
360. ription in the Modbus protocol Set the serial port and drive address and control the 2 After the drive receives the data it will conduct CRC drive jog forward running through communication in check address check and instruction check and set the Modbus protocol the communication completion flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVC Series Small PLC Programming Manual 1 6 12 5 6 12 6 Chapter 6 Application Instructions 167 IVDREV FREQUENCY CONVERTER Touch Reverse Rotation Instruction LAD H HH IVDREV 6p 52 IL IVDREV S1 S2 Operand Type Sl Wi EE Applicable elements Applicable to IVC1 Offset addressing Influenced flag bit Program steps 2 R LO LO E LEE ee ee Operand description S1 designated communication channel channel 1 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 Function description 1 Set the serial port and drive address and control the drive jog reverse running through communication in the Modbus protocol 2 This instruction is executed upon the rising edge Example LD M1 Mi HH IVDREY 1 l IVDREV 11 1 Set the serial port 1 and drive address 1 and control the drive jog reverse running through communication in the Modbus protocol 2 After the drive receives the data it will conduct
361. rite or force during system debugging Elements numbered in Decimal starting with O Data type Boolean Available forms NO and NC contact Value assignment 1 Through instructions 2 Write or force during system debugging Elements numbered in Decimal starting with O Data type Boolean Available forms Word for numeric information Value assignment 1 Through instructions 2 Write or force during system debugging IVC Series Small PLC Programming Manual 56 3 2 3 2 1 3 2 2 Chapter 3 Element And Data Elements Addressing Mode Kn Addressing Mode Combined Bit string Addressing Mode Concept The Kn addressing mode or combined bit string addressing mode realizes addressing by combining bit elements into words or double words Kn addressing method The format is K n U where the n is an integer from one to eight standing for the length of the bit string n x 4 The U stands for the address of the starting element For example 1 K1X0 stands for a word made up of XO X1 X2 X3 2 K3Y0 stands for a word made up of YO YO1 YO2 YO3 Y04 YO5 YO6 YO7 Y10 Y11 Y12 Y13 3 K4MO stands for a word made up of MO M1 M2 M3 M15 4 K8MO stands for a word made up of MO M1 M2 M3 M31 Data storage using Kn addressing mode The following is an example of how a specific data can be stored using the Kn addressing mode MOV 210001001 K2MO which is equal to MOV 16489 K2
362. ro Carry Borrow y zech al a Oj N ol Co ail o NINININI AI El EI Ei AIS 00 N 00 N SL Ehl zl aAa o o o OO S o A O O D gt N 294 Appendix 9 Instruction Index e D Lem c O O 5 lt N VC N lt L L E k CO Wei sis gt oO Instruction function Compare floating point number LDR gt instruction Program steps Influenced flag bit 0 D Q OD LDR gt LIFO LN Floating point number LN instruction LRC LRC check instruction MC MCR Modbus MOV Move word data transmission instruction MPP MPS Output power flow input stack O Last in first output instruction Zero O Wu Zero Carry o Main control OO O EE Main control remove O D gt Modbus master station communication instruction Output power flow stack pop off MRD Read output power flow stack top value MUL NEG NEXT NOP Multiply integer instruction Negative integer instruction Return from cycle No operation O1 O N O al NI N O Val NO contact power flow or CO O OR lt Compare integer OR lt instruction OR lt OR lt gt Compare integer OR lt instruction ala CO Ou O Compare integer OR lt gt instruction CO O Compare integer OR instruction OR gt OR gt Compare integer OR gt instruction ORB Power flow block or ORD lt ORD l
363. rt 1 Port 1 retry times e a times e 0 10 O AS E II a SD139 Eror code of Modbus master Por T ATACA 13 Setting amp Reading Of Integrated Analog Signal Channel WE E SD172 Average sample value of AD CHO SD173 Sampling times of AD CHO SD174 Average sample value of AD CH1 SD175 Sampling times of AD CH1 Sampling mes gn JP soms Output value DA CHO ROO 14 Usage Of DHSP And DHST Instructions MSB of DHSP table comparison output data ERW A A Pe ap Ieper abe comparison ouputdaia RW pS MSB of DHST or DHSP table comparison data BW Vv fo Vf LSB of DHST or DHSP table comparison data ORW yy m Record No ofthe table being execuled Jm v vp ooo 15 Error Flag Addr Name Action and Z Actionandfunction SD191 No GE the module where bus No E the module where bus operation error error occured occurred SD192 No of the special module No of the special module where bus where bus error occured operation error occured IVC Series Small PLC Programming Manual 276 Appendix 3 Reserved Elements Appendix 3 Reserved Elements Start addr End addr Remark D7940 D7969 Buffer area for transmission of inverter instructions D7970 D7999 Buffer area for reception of inverter instructions D7700 D7763 N N bus network shared area M1400 M1911 N N bus network shared area D6000 D6999 EROMVVR instruction operation area LU Note See the related instruction and function description for the usage of the elem
364. ruction I O points 256 1 256 O Input XO X377 Output YO Y377 Ne Auxiliary relay 2000 MO M1999 Local auxiliary relay 64 LMO LM63 Special auxiliary relay 256 SMO SM255 State relay 992 SO S991 Device Note 2 Ge 256 10 1255 configuration var St ee Data register 8000 DO D7999 Local data register 64 VO V63 Offset add i register Special data register 256 SD0 SD255 16 triggering edge is user configurable corresponding to the rising amp falling edge s of External input interrupt Ee oe J P I g Ge terminals XO X7 Interrupt High speed counter configuration interrupt Internal timer interrupt Communication 2 asynchronous serial communication ports Port 0 RS 232 Port 1 RS 232 or RS 485 function Protocol Modbus Freeport 1 to N communication enabled XO X1 Single input 50kHz Total frequency X0 X5 lt 80kHz High speed counter XO XI S g E H A vA X2 X5 Single input 10kHz 100kKHz 2 independent outputs and only for transistor High speed pulse output YO Y1 Gees p P y Digital filtering terminals XO X17 all the other terminals use hardware filtering Analog potentiometer 4 2 Special i l Maximum number 64 Maximum nesting levels 6 Local variables and variable alias function Calling of subprograms are supported Each subprogram can provide up to 16 parameter transfer Upload password E 3 kinds of password Not longer than 8 letters or Us
365. ruction check and set the communication completion flag SM135 after the communication If there is any error the error flag SM136 will be set and the error details will be recorded in the special register SD139 IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 171 6 12 10 IVRD FREQUENCY CONVERTER Read Single Register Value Instruction LAD Applicable to IVC1 Pt eo D DOO Tegsegeetgenl i IL IVRD S1 S2 S3 D1 Operand T Applicable clemente Gu eran e d K ER addressing pet Wes ee EEN A A ANA RER ESSE A E PEE E E TE EA TAN Operand description Example S1 designated communication channel channel 1 E my gt 10 S2 drive address Broadcast mode Broadcast address 00 Slave address range 1 247 IVED 1 1 110 Den S3 address of the register to read LD Mi D1 storage address of the returned value MOV 2 D10 Function description IVRD 1 1 D10 D20 1 Read a single FREQUENCY CONVERTER register 1 Set the serial port 1 drive address 1 read register through communication in the Modbus protocol address 2 initially set frequency of the drive and set D20 as the storage register for the returned value Read a single FREQUENCY CONVERTER register through communication in the Modbus protocol 2 After the drive receives the data it will conduct CRC check address check and instruction check and set the communication completion flag SM135 after the communication If there is an
366. ruction seccion corrida it 182 6 15 7 BOUT Word Bit Coil Output Instruction EE 183 015 9 BSET Word Bit Col Set INSUCUON reederi olla 183 6 15 9 BRST Word Bit Coll Reset ln Eur Ee EE 183 6 1 0 Compare Contactor IMS er re 184 6 16 1 Compare Integer LD lt gt lt gt gt lt InstrucitonSs ooccccocnccocnncccnnnoncnnnonncnnnnnonnnnonnnnnnnnnnnnnnnonannnnannnnns 184 6 16 2 Compare Integer AND lt gt lt gt gt lt Instruction oooccccccccccnnoconcnconnnconcnnononnnnnnnonnnnonnnnnnnnnnnnnnncnncnnnns 185 6 16 3 Compare Integer OR lt gt lt gt gt lt Instruction oooccccccnccccnncccnnnoncnononnnonnnnonnnnonannnnnnnnonnnnnnnnnonacinnns 186 6 16 4 Compare Double Integer LDD lt gt lt gt gt lt Instruction ococooncccccocnnnonoconononcnnonnnnnnonnnononnnrnnonancnnnnos 187 6 16 5 Compare Double Integer ANDD lt gt lt gt gt lt INStrUCtION oocccoccncocccccccnnconcncnnnnononnnnnanoconcncnananons 188 6 16 6 Compare Double Integer ORD lt gt lt gt gt lt Instruction ooonccccooncnnonocnnnnoncnnononnncnnnnonononcnnnnanonnnnos 189 6 16 7 Compare Floating Point Number LDR Instruction ooocccccoccnccccccncconcnnononcnnonnnonononcnnononcnnnnncnnnnnnrnnnnnnnnnnnos 190 6 16 8 Compare Floating Point Number ANDR Instruction occccooccccccoccnccnncnncnoncnnnnnccnnnnncnnnnoncnnnnrononnncnnnnnannnnnos 19
367. rupt is disabled the ones that have been added to the interrupt queue will continue to be executed Do not call the XMT instruction of serial port in the processing subprogram of character sending interrupt when the power flow is normally on Otherwise it may lead to interrupt subprogram nesting which blocks the execution of user program Interrupt of frame receiving and sending refers to the interrupt event that is delivered after the XMT and RCV instructions of the serial port are executed Serial port interrupt resource list IVC Series Small PLC Programming Manual Chapter 9 Using Interrupts 243 Example In the example with the sending interrupt function of serial port frame the system will flip Y3 output once when a frame is sent out and generate flashing effect based on the frequency of the character sending frame 1 Compile interrupt program and the processing code when the serial port sending frame is completed and the interrupt is triggered Project Manager AX 5 MAIN IS Ev880start IS COM1 SENDD Al g das variable addr Variable Name oi Program block l MAIN E 6sO0start ReadFrequency Start Flip Y3 XAutoGO KAutoSet 3 Y3 COM1 RCY P 3 y COM1 RCVY COM1 SEHD COM1 SENDD Refresh immediately HOH POWER PTO A SMO TIME INT HA REF YO 3 X2 INT E Global variable t MO 5 Datablock All sl Moy 5D125 D2020 lt me gt Project i Instruct 2 Specify interrupt event n
368. s thus complete RET Instruction And SFC Program Section As shown in the preceding figure the SFC program on the right starts with a S2 initial step symbol and returns to S2 after two ordinary steps While in the LAD program the SFC program section must end with the RET instruction The RET instruction can be only used in a main program OUT Instruction And RST Instruction As shown in the preceding figure the jump to S2 is realized in LAD program by the N3 row which uses an OUT instruction The destination operand of the OUT instruction jump can be in any independent procedure If the reset S26 is used line N3 in the LAD program will be a RST instruction which can reset the last step S26 SFC Selection Branch Parallel Branch And Merge See Selection branch structure in 7 1 5 SFC Program Structure for the LAD counterpart of SFC selection branches See Parallel branch structure in 7 1 5 SFC Program Structure for the LAD counterpart of SFC parallel branches How To Program With SFC 1 Analyse the work flow and determine the program structure The structure of a SFC program is classified into three types simple sequential structure selection branch structure and parallel branch structure Besides the jump structure is also a special form of the selection branch structure To program with SFC the first thing to do is to determine the structure of the flow For example a single object passing through a sequential flow is a simple s
369. sM D sd c tT v z v S2 WORD Constant Knx knY km Kns knim Kknsm D so C tT v zi Y Do worp IL kny km ks kam b co t viztov Operand description Example S1 Source operand 1 35 T39 31878 0681 LD XO P m na de E WXOR DO D1 D10 S2 Source operand 2 Sege F When X0 is ON DO 2 1011011010010011 46739 and D1 EES Se 2 1001001100101110 37678 will conduct logic exclusive OR operation and Function description the result 2 0010010110111101 9661 is assigned to D10 When the power flow is valid ST and S2 will conduct logic exclusive OR operation and the result is assigned to D IVC Series Small PLC Programming Manual Chapter 6 Application Instructions 117 6 6 4 WINV NOT Word Instruction LAD Applicable to IVC2 IVC1 WINV ki D a le ESOS Influenced flag bit S IL WINV S D Program steps Offset Applicable elements addressing Knsm b so c t vi zi y D worp ny knm kns num o co dv tT Pv Zz y Operand description Example S Source operand XO 46739 18796 LD vn D destination operand E ee E e WINV DO D1 D10 Function description When XO is ON conduct logic NOT operation on DO 46739 and assign the When the power flow is valid result 18796 to D10 conduct logic NOT operation on S and assign the result to D 6 6 5 DWAND AND Double Word Instruction LAD Applicable to IVC2 WC DWAND SI S2 mie e Influenced teg IL DWAND S71 S1
370. selecting this option If the function and the download password are set at the same time and if you forget the password you cannot use the PLC Figure 2 12 Advanced settings Datablock enabled Check the Datablock enabled and the datablock will be used to initialize the D elements when the PLC changes from STOP to RUN Element value retained Check the Element value retained and the elements will not be initialized but saved when the PLC changes from STOP to RUN LU Note When the Datablock enabled and Element value retained are both checked the Datablock enabled prevails See 2 6 Initialization Of Elements No battery mode Check this option and the system will not report the battery backup data lost error and forced table lost error upon battery failure Datablock The datablock is used to set the defaults for D elements If you download the compiled datablock settings to the PLC the PLC will use the datablock to initialize the related D elements upon PLC startup The datablock editor enables you to assign initial data to the D register data memory You can assign data to words or double words but not to bytes You can also add comments by inputting to the front of a character string See AutoStation Programming Software User Manual for detailed datablock instruction Global Variable Table The global variables table enables you to give meaningful names for certain PLC addresses The names are accessible
371. set operands You can set the operands through the PID instruction wizard of the AutoStation Function description 1 PID calculation will be carried out when the power flow is ON and it is the sampling time 2 Multiple PID instructions can be executed simultaneously no limit on the loop number However note that the elements used as S1 S2 S3 or D should be different 3 The PID instruction is applicable to timed interrupt subprograms ordinary subprograms and the main program Note that before using the PID instruction confirm the operand settings and clear the internal data registers S3 7 S3 14 first 4 The input filtering constant can smooth the change of measured value 5 The differential gain can smooth the change of output value 6 Action direction bit O of S3 7 is used to set the forward positive reactioin and reverse negative reaction of the system IVC Series Small PLC Programming Manual 158 Chapter 6 Application Instructions 7 Output thresholds when the output threshold setting is enabled bit 5 4 bit 2 of S3 1 are 1 and O respectively the integral of PID can be controlled from becoming too big The output value is shown as below Output value Without output limits S3 17 N Upper limit gt No output S3 18 Lower limit gt With output limits 8 Alarm setting when the output thresholds are set valid in S3 1 bit 1 is 1 BIT2 is 1 and bit 5 is 0 the PID instruction w
372. set when RCV instruction is used and is cleared after Port 1 reception the transmission is over You can manually clear this bit to halt RW y y enabling flag bit the current transmission at Port 1 The transmission can resume when power flow is on again Port 1t issi SM122 S EH This bit is set after the transmission is over R W y y complete flag bit Port 1 reception A SEAN SM123 i This bit is set after the reception is over R W y y complete flag bit SM124 Port 1 idle flag bit This bit is set when the port is idle MS ae a LU Note SM122 SM124 are the flags for the reception complete and idle states in all communication protocols that are supported by Port 1 For example the Port 1 of IVC1 PLC supports N N bus Modbus and Freeport No matter which protocol is used the functions of SM122 SM124 remain the same 9 Modbus Communication Addr Name O Action and function H IVC2 IVC1 ee communication SM135 This bit is set after the communication is over complete SM136 Modbus communication error This bit is set upon communication error he a ae IVC Series Small PLC Programming Manual 266 Appendix 1 Special Auxiliary Relay 10 N N bus Communication smo Station O communication emorfiag oT RTT Sma Station Y communication emorfag CORY am Station Z communication erg CT ORY am Station Scommunicaton erg fR f ag Station 4 communication emorfag CT ORY ams Station 5 communication emorfag OR s
373. steps Operand Type Applicable elements Offset St REAL Constant 2 f f Jy y 2 REAL Constant DY IL Jy Y Operand description Example S1 comparison parameter 1 LD XO Sj e ANDR DOD2 comparison parameter OUT y Function description 10000 01 1000 28 YO LD X1 w de mE a ANDR lt DOD2 Compare elements 1 and 10000 01 1000 29 Y OUT wi S2 and use the comparison BS 10 D2 k a LD X2 result in serial connection with 10000 01 1000 25 12 R Do 12 Le ANDRE CORE other nodes to drive the OUT Y2 10000 p A0 nm following operation RO D0 Ie KY 3 LD X3 10000 01 1000 29 YA ANDR lt gt Y3 D 12 Y LD X4 10000 01 1000 29 5 ANDR gt DO D2 Re 60 D2 He OUT Y4 LD X5 ANDR lt DO D2 OUT Y5 Compare DO D1 and D2 D3 and use the comparison result in serial connection with other nodes to determine the output status of the following element IVC Series Small PLC Programming Manual 192 Chapter 6 Application Instructions 6 16 9 Compare Floating Point Number ORR Instruction Applicable to IVC2 IVC1 Influenced flag bit Program steps Offset addressing E E NEE eee ee eee O Lo AE KE Example Operand Type Applicable elements Operand description YO S1 comparison parameter 1 LD XO S2 comparison parameter 2 SS SC r ORR DO D2 Function description Xl Yi Giel E gt LD X1 Compare elements S
374. t ORD lt gt Compare integer OR gt instruction Compare double integer ORD lt instruction gt gt al gt el X 09 oO Ou O Compare double integer ORD lt instruction CO Compare double integer ORD lt gt instruction Compare double integer ORD instruction ala OI Oj ORD gt ORD gt Compare double integer ORD gt instruction Compare double integer ORD gt instruction NC contact power flow or al alg ORR lt ORR lt ORR lt gt Compare floating point number ORR lt instruction Ce N Compare floating point number ORR lt instruction Compare floating point number ORR lt gt instruction ala Oo N N Compare floating point number ORR instruction ORR gt ORR gt OUT OUT Sxx oO N Compare floating point number ORR gt instruction Compare floating point number ORR gt instruction Power flow output SFC state jumb PID instruction Ou O1 an O11 EI el PLS Pulse Output Instruction of Envelop Count pulse with acceleration deceleration output PLSR instruction al oO PLSV PLSY POWER PUSH Push instruction PWM PWM pulse output instruction RADD RAMP RCL 16 bit carry circular shift left instruction RCR RCV ree port receiving RCV instruction RDIV REF REFF Set input filtering constant instruction RET SFC program end Move floating point number data transmission instruction N Variable speed p
375. t gt lt Instruction PY to IVC2 IVC1 Influenced flag bit DCMP S1 S2 DCMP lt S1 S2 DCMP gt S1 S2 Program steps DCMP lt gt S1 S3 DCMP gt S1 S3 DCMP lt S1 S3 Offset Operand Type Applicable elements addressing Operand description Note S1 starting word element for The date data stored in the elements starting with S1 and S2 must comply with date comparison data 1 the solar calendar format or the system will report operand error For example which occupies the 3 word 2004 9 31 and 2003 2 29 are both illegal elements following 1 The Example data must comply with the ane SE solar calendar format or the ee ens ag 10 system will report operand Wm 10 Di LD SMO Sa error Wi BE eg MOV 2004 DO S2 starting word element for 2004 MOV 10 D1 date comparison data 2 TS SG du l MOV 25 D2 which occupies the 3 word mow 10 DI g t ENEE 24 elements following S2 The We Ge nie MOV 24 D12 data must comply with the x0 2004 2004 OFF LD xO DCMP DO nid MO solar calendar format or the oon geen oe DCMP DO D10 MO system will report operand DCMES DO oe Be DCMP lt DO D10 M1 error wg DD mo w DCMP gt DO D10 M2 D Comparison status output 2004 2004 ON DCMP lt gt DO D10 Ms DCMP lt gt DO nid Ma DCMP gt D0 D10 M4 When the data meet the 2004 2004 ON PES Ou OTON D Sur D lt comparison condition Dis set TS 2 Se dl a 2004 2004 OFF ON otherwise it is set OFF D
376. t Compare floating point number ANDR gt instruction AND Compare integer AND lt instruction integer AND lt instruction ANDD lt SSA a double integer ANDD lt instruction ANDR lt Compare floating point number ANDR lt instruction AND lt Compare integer AND lt instruction ee instruction instruction contactor S sn aR instruction ANDR lt ompare floating point number instruction AND lt gt Compare integer AND lt gt instruction integer AND lt gt instruction ANDD lt gt e ee double integer ANDD lt gt instruction ANDR lt gt Compare floating point number ANDR lt gt instruction Op O Compare integer OR instruction a instruction Compare floating point number ORR E pp GES Compare integer OR gt instruction Compare double integer ORD gt instruction ORR gt Compare floating point number ORR gt instruction Compare integer OR gt instruction C double int ORD gt instruction instruction a Compare integer OR lt instruction Compare double integer ORD lt instruction Compare Compare floating point number ORR lt EA instruction contactor SES Compare integer OR lt instruction instuction Compare double integer ORD lt e instruction E a ORR lt Compare floating point number ORR lt RES instruction Compare integer OR lt gt instruction ORD lt gt Ge double integer ORD lt gt 7 189 instruction C floati int ber ORR lt gt ORR lt gt oompa
377. t earlier than where the proximity sensor is located You can jog adjust the position of the workbench through designing and programming 6 17 4 Points To Note For Using Locating instructions ZRN PLSV DRVI And DRVA Transistor output IVC series small PLC with transistor output must be used Requirements of locating instructions during programming The locating instructions can be used repeatedly in the program However note that 1 One high speed pulse output point YO or Y1 can be driven only by one locating instruction or high speed instruction at any time 2 After the power flow of one locating instruction turns OFF it cannot turn ON before the next PLC scan cycle Notes on using instructions PLSY PLSR and PLS at the same time From the functional perspective it is recommended to use DRVI in stead of high speed pulse output instructions PLSY PLSR and PLS because the DRVI instruction can update the absolute position registers SD80 SD83 automatically The registers SD80 SD83 can be used to store the present absolute position after the locating instruction is used Their values are based on the change of registers SD50 SD53 and the control signal direction when the locating instruction is executed In this way SD80 SD83 and SD50 SD53 are inter related Do not write SD50 SD53 when locating instructions are being executed or SD80 SD83 will be messed up If it is necessary to use locating instructions and high speed puls
378. t indicates the beginning of a step S 2 If a step is valid ON its embedded instructions will be executed 3 If a step changes from ON to OFF trailing edge the embedded instructions will not be executed and the destination operands of the embedded instructions such as OUT TON TOF PWM HCNT PLSY PLSR DHSCS SPD DHSCI DHSCR DHSZ DHST DHSP and BOUT will be cleared 4 If a step is invalid OFF the embedded instructions will not be executed 5 Consecutive STL instructions serial connection of S elements define a parallel merge structure The STL instructions can be used up to 16 times in a row the maximum number of branches of a parallel branch structure is 16 SET Sxx SFC State Shift LAD Applicable to IVC2 IVC1 ssm HH E W e i IL SET D Program steps O di T Applicable elements tee ES SE ER E pe er TE Operand description Function description When the power flow is valid the designated step D will be set valid and the current valid step will be set invalid to complete the step transition D Destination operand OUT Sxx SFC State Jump LAD Applicable to IVC2 IVC1 IL OUT D Program steps Operand Type Applicable elements E ES a A poa IS I Operand description Function description When the power flow is valid the designated step D will be set valid and the current valid step will be set invalid to complete the step jump D Destina
379. t number ANDR gt instruction 7 IIIe A NC cotton anf ASC ASCI Code conversion neon ee T IA TT a a JE SH son BOUT BRST Word bit coil reset instruction BSET Word bit coil set instruction ala O Oj N CO O 00 O ala OO CO GA N 00 CO EG er on the parameter CFEND Se een Ce 16 bit counter counting up instruction 2 2 Al Al li CN alho N 00 Zero N Wu CALL Calling a subprogram en sa ol CCITT CCITT check instruction C O oO O Y Y Val IVC Series Small PLC Programming Manual 292 10 DHST High speed counting table compare instruction ke EA DHSZ High speed counting zone compare instruction B Y N 146 or sabi werten AAA A DINC Increment double integer instruction a A SEARS Z Carry DINT Floating point number to double integer instruction a aa Appendix 9 Instruction Index Instruction function Program steps Influenced flag bit IVC2 IVC1 Zero C Borrow men Doubiewordto 3251800 ista O Fey S2 bRBCDt0 double wordinstucton 7 f TO Dens Counting ON bitin double word instruction 6 f PO Dome Compare date lt instucton TP mm DOMP _ Compare date instruction mm Dec Compare date gt instruction OO Dome Compare date nstucton OO Dome Compare date gt instucton OO Dome Compare date gt instruction OO DONT S2 bitcountinginstucton TT AA DDEC Decrement double integer instruction
380. t serves as a structural block without actual function Design the transfer conditions for S38 841 and S43 according to the actual situation Programming Tricks 1 Making use of empty steps You may need empty steps to deal with the branches with grammatical problems The empty steps do not provide actual operation but a necessary node in structure before the next transfer See the following example In the left figure below the selection merge is connected immediately with another selection branch structure That is prohibited You can change it as the right figure shows add an empty step IVC Series Small PLC Programming Manual 216 Chapter 7 SFC Tutor Modify Inexecutable parallel structure Add a empty step In the left figure below the selection merge is connected immediately with a parallel branch structure That is prohibited too You can also change it as the right figure shows add an empty step Inexecutable parallel structure You can address other tricky structures such as parallel merge connected with parallel branches or parallel branches connected with selection branches by adding an empty step 2 Merging branches and transfer conditions Some seemingly complicated branches are the result of bad design You can simplify them by merging some branches As shown below the designer set a selection branch first following it by two selection branches However simply four select
381. t setting When the power flow is valid and the communication conditions are met that is the timing for the receiving is started when the Check to enabling Default disabled communication serial port has not been taken up if the receiving of one frame has not been finished when the time is up terminate the RCV When the RCV power flow is valid and the communication Interframe timeout conditions are met the timing will start as soon as the 0 to 65535 ms P l l setting communication serial port starts to receive If a frame is not received completely when the set time is up the reception ends 10 3 3 Free Port Instruction Start character detection setting Interframe timeout enabling Points to note The free port instructions XMT and RCV can be used to send receive data to from the designated communication port For the usage of the free port instruction refer to 6 12 11 XMT Free Port Sending XMT Instruction and 6 12 12 RCV Free Port Receiving RCV Instruction Note that to use free port instruction on a certain port you need to set the free port protocol and communication parameter for the communication port through the system block of AutoStation In addition you need to download the system setting to the PLC and restart it IVC Series Small PLC Programming Manual Chapter 10 Using Communication Function 247 Example Example 1 Send a 5 byte data and then receive a 6 byte data through communication port 1
382. tarting with DO will be summed up and the result is assigned to D100 D101 D100 D101 DO D1 D8 D9 150001 5 Data Converting Instruction DTI Double Integer To Integer Instruction LAD kt Dm IL DT S D Applicable to IVC2 IVC1 Program steps Offset addressing Applicable elements DT Geet Kox Kn eau Kas Rod KkSM BD SOT CT VW Y o m RR Mk ka o e r v Note 5 Operand description S Source operand When S is not within 32768 32767 the system will report operand error D Destination operand and will not execute the conversion D will not change Function description Example When the power flow is valid e n ae TE 5 LD XO S will be converted from DTI DO D10 double integer to integer and the result is assigned to D When XO is ON DO D1 10000 will be converted from double integer to integer and the result 10000 is assigned to D10 IVC Series Small PLC Programming Manual 6 5 2 6 5 3 6 5 4 Chapter 6 Application Instructions 107 ITD Integer To Double Integer Instruction LAD Applicable to IVC2 IVCA art mo ners ta zomea oror IL ITD S D Program steps Offset addressing 8 LN Constant vo Kay KoM Tee KnM RSM OT SOT ST TT VT ZT vy O CL ee EES E A ee a Operand Type Applicable elements Operand description integer to double integer and the result is assigned to D S Source operand Example D Destination
383. th 7 remain unchanged S2 Applicable to IVC2 IVC1 Program steps 7 Offset addressing Applicable elements ESA pS Y D Example PO When XO is ON the contents of 10 elements starting with DO are assigned to 10 elements starting with D100 D100 DO D101 D1 D109 DY LD X0 pigg 10 BMOV DO D100 10 IVC Series Small PLC Programming Manual 82 6 2 5 6 2 6 Chapter 6 Application Instructions FMOV Fill Data Block Instruction LAD Applicable to IVC2 IVC1 1 EU mm ei D 52 Influenced flag bit E Com S O e Program steps Offset addressing Applicable elements Si NT Constant knX Kay Kom Kns KntM RSM DT SOT CTT VT Zz y o m av Kn ns nt ev y gt 82 INT Constant vol Kay KoM Kns KntM eu D so eT Vv zp y gt Operand Type Operand description S1 Source operand starting element of data block D Destination operand starting element of data block S2 size of data block Function description When the power flow is valid the contents of S1 will be filled into S2 elements starting with D element and the content of S1 remains unchanged Note 1 When S7 D and S2 use C element the legal range is CO to C199 2 S2 is larger than or equal to 0 3 When S7 and D both use Kn addressing Kn shall be the same Example AD 900 200 FMOWY DU m00 10 When XO is ON the content of DO will be filled into 10 elements starting with D100
384. th the constant scanning time set system will scan the registers within a constant duration Setting range Oms 1000ms Default Oms 3 Power loss detection time setting for IVC2 only When the duration of power loss exceeds the power loss detection time the PLC will change to STOP The system will save the values of elements in the Saving Range Setting range Oms 100ms Default Oms Input Point The Input Point setting tab is shown in Figure 2 8 In this tab you can set the following parameters 1 Disable input point Check the Disable input point to disable the input point startup function 2 Input point When the Disable input point is not checked you can designate an input terminal among X0 X17 as a means of external RUN control When the designated input terminal is ON the PLC will be turned from STOP state to RUN state IVC Series Small PLC Programming Manual System block Advanced Settings Special Module Configuration I Saving Range Dutput Table Set Time Input Filter Input Point Startup mode of the input point Input point system enters into RUN status Chapter 2 PLC Function Description Communication Port Default value Select an input point from lt 0 to 17 as the forced input point When the DIP switch Is set at ON position and the system is in STOP status if the status change of the input point from OFF to ON is detected the _ Priority Level Of Interruption F
385. the basic PLC knowledge including PLC function description programming languages elements amp data addressing modes program annotating function main program and subprograms Afterwards you can read other chapters to cater for your needs 2 For readers familiar with PLC You can jump directly to Chapter 5 Basic Instructions and Chapter 6 Application Instructions which provide complete and detailed explanation for the instructions of Invt IVC series PLC In addition the Appendix 9 Instruction Index and Appendix 10 Classified Instruction Index provide tools for locating the instructions in the orders of alphabet and classification respectively Related documents You can refer to the following books while reading this book eo VC17 Series PLC User Manual o VC2 Series PLC User Manual e AutoStation Programming Software User Manual Contents Chapter Product OVER anda 1 Chapter 2 GR E FUNCION DESCHDUON dd 8 Chapter 3 Element And Dat EE 31 Chapter A Programa CONCE a E ca ell ed ee eae 44 Chapter o Basie ASTUCIA Ee eege ee eege 54 Chapter 6 Application Instructions ill ii iia 70 Chapier i OFO E Lee 205 Chapters Using Migh Speed O e eL end uan aaa nace 226 Chapter 9 Using Interupts cece eeeseeeeceeeseeeeeaaeeeeeeeeseeeeseaeeeseeeeseeeseaeessaeessaeeeseeeseaeessaeeesseeesnsessaes 235 Chapter 10 Using Communication FUNCION 000 dd Eed a Re 244 Appendix 1 Special Auxiliary Relay ss ei 263 Appendix 2 Special Data EE 270 Appendix 3 Reserved
386. the target module will be stored IVC Series Small PLC Programming Manual LAD E Ha TO 85D 82 83 84 IL TO S1 S3 83 Operand Type si INT Constant fF IA AO ee ee ee CT lp Doo J Sv f v INT Chapter6 Application Instructions 131 6 8 3 TO Write Word To Special Module Buffer Register Instruction Applicable to IVC2 s4 Program steps 9 Offset addressing Applicable elements Lo s int Constant II III Operand description S1 The SN of the special module to be written or the target module Range 0 7 If the target module does not exist the system will report Using FROM TO instruciton to access module not existing S2 The starting register address in the BFM of the target module Range 0 32767 If the BFM address is invalid the system will report BFM unit of accessed special module exceeds range S3 The data to be written into the target module S4 The number of consecutive buffer registers single word to be written Range 1 32767 If the target register does not exist the system will report BFM unit of accessed special module exceeds range Function description 1 Write data from consecutive S4 registers starting with S3 to the consecutive S4 buffer registers starting with S2 in the BFM of the target module SN 7 2 If S3 is a constant write it consecutively into the S4 word elements starting
387. til the interrupt is finished when the system will return to the ordinary scan cycle A user program can have random number of interrupts or no interrupts at all system Block The system block contains multiple system configuration parameters You can modify compile and download the system block to configure the operation mode of the basic module For details see 2 2 1 System Block or the related description in AutoStation Programming Software User Manual Data Block The data block contains the values of D elements By downloading the data block to the PLC you can set a batch of designated D elements If the Datablock enabled is checked in the Advanced Settings tab of System block the D elements will be initialized by the data block before the PLC executes the user program Block Comment And Variable Comment Block Comment You can add comments to the program Occupying a whole row each piece of comment can be used to explain the function of the following program block In the program right click and select Insert Row to insert a row above the current row You can use a empty row to separate two program sections To make a block comment just select an empty row right click and select Insert Block Comment IVC Series Small PLC Programming Manual 48 Chapter 4 Programming Concepts MAIN Altls Variable addr Variable Name Variable Type Data Type Comments TEMP BOOL E TEMP BOOL v A lw Ctrl Z2
388. tion OO 00 Subtract clock instruction Zero Borrow Write real time clock instruction ol gt OO EE lt Integer absolute value instruction MEN CA N Read analog potentiometer value instruction AND word instruction sl Wu lt 4 User program watchdog reset ech zech N NOT word instruction OR word instruction Shift left word instruction Shift right word instruction Exclusive OR word instruction l co oi 2 Bl NI Ol 5 N N Regress to origin instruction Al E N O NIO Batch bit reset instruction N N Set batch bit instruction N IVC Series Small PLC Programming Manual 296 Appendix 10 Classified Instruction Index Appendix 10 Classified Instruction Index Program Infl Se fla Basic instruction Program control instruction SFC instruction a E EE AND NO contact powerffowand O dT CP e ANT NCcontactpowerfowand 7 dT OP e OR NO contactpowerfowor dT OT r ORT_ NCcontactpowerfowor dT OP o r OUT Teenager OA OA SE OO A rst pe OA AA ANS Powerfowbockand TT AA ORB Powerffowbiockor tT dT OP e INV Powerffowbiockiverse tT dT CP A A NOP No operation TTC OP E We Output powerfowinputstack JA OA MRD Read output powerfiowstacktopvawe 1 II 8 MPP Output powerfow stackpopof AA E CU a AI A LI MCR Mancon OA OA CECR ED Powerfow ali edge detection 121 R TON Or delay timing instruction dT P TOF Ofrd
389. tion 6 1 1 FOR Cycle Instruction LAD Applicable to IVC2 IVC1 a rt een O A Applicable elements 8 LW Constant Knx Kn Tea Krs Teen BT SOT tT Tv 2 v Operand description IL FOR S Operand Type S Source operand 6 1 2 NEXT Return From Cycle LAD Applicable to IVC2 IVC1 IL NEXT Program steps Function description Note 1 Instructions FOR and NEXT form a FOR NEXT 1 The FOR NEXT instruction must be used in pairs in structure a POU or the program cannot pass the compiling 2 When the power flow before FOR is valid and the cycle times S is larger than O the instructions in the FOR NEXT structure will be cyclically executed S times After that the instructions after the FOR NEXT 2 Nesting of several FOR NEXT structures is supported IVC2 series PLC supports up to 8 levels of nesting The figure below shows a 3 level nesting of FOR NEXT structure structure will be executed 3 If the power flow before FOR is invalid or the cycle times S is less than or equal to 0 the program will skip over the instructions in the FOR NEXT structure and execute the following instructions Example LD SM1 y MOVO DO LD M2 100 EU FOR 100 LD SMO INC D100 NEXT The initial conditions for the operation are DO 0 M2 OFF When M2 changes from OFF to ON the instructions in the FOR NEXT structure will be consecutively executed for 100 times DO will increase one for each cycle When the cycle
390. tion 184 Compare double integer LDD gt A a LDR gt Compare floating point number LDR gt instruction Compare integer LD gt instruction LDD gt Compare double integer LDD gt e instruction LDR gt Compare floating point number LDR gt instruction FEB Compare integer LD lt instruction 184 L Compare double integer LDD lt instruction double integer LDD lt instruction 7 ae Compare LDR lt EA a floating point number LDR lt contactor instruction instruction Compare integer LD lt instruction LDD lt Compare double integer LDD lt e instruction LDR lt Compare floating point number LDR lt instruction Compare integer LD lt gt instruction LDD lt gt Combate double integer LDD lt gt instruction LDR lt gt Compare floating point number LDR lt gt instruction Compare integer AND instruction ANDD E double integer ANDD 7 188 instruction ANDR Compare floating point number ANDR instruction Compare integer AND gt instruction NI Ny Go IVC Series Small PLC Programming Manual 300 Appendix 10 Classified Instruction Index P Infi d fi Instruction Instruction function rogram n uence Se ee Se steps bit i gt ANDD gt pompare double integer ANDD instruction ANDR gt Compare floating point number ANDR gt instruction AND gt Compare integer AND gt instruction integer AND gt instruction ANDD gt E li A double integer ANDD gt instruction ANDR g
391. tion operand IVC Series Small PLC Programming Manual Chapter5 Basic Instructions 65 5 3 4 RST Sxx SFC State Reset EH to IVC2 IVC1 IL RST PILERST D e Escalada steps O d Type Applicable elements DER ran ESS S ER addressing CL ft OU CET LC Operand description Function description D Destination operand When the current power flow is valid the designated step D will be set invalid 5 3 5 RET SFC Program End aba to IVC2 IVC1 RET Program steps Weess nn Function description Note It indicates the end of a SFC program section It can only be used in the main program 5 4 Timer Instruction 5 4 1 TON On Delay Timing Instruction LAD Applicable to IVC2 IVC1 HH TON D Influenced flag bit o IL TON D S Program steps Operand Type Applicable elements Z ran RES H ER addressing GE a E E E Operand description Example D Destination operand MO SACH LD Mu E l TON T4 4 S Source operand 11 ep LD T1 A mm WW Function description OUT YO 1 When the power flow is valid and the timing value lt 32 767 the designated T element D will start timing the value will increase with the lapse of time When the timing value reaches 32 767 it will maintain at 32 767 2 When the timing value gt the preset value S the timing coil output of the designated T element will be ON T1 timing coil 3 When the power flow is OFF the timing will stop the timing value will be cl
392. to the left bus to connect status ON or disconnect status Note OFF the power flow For the contact logic instructions of IVC1 series when the operands are M1536 M2047 the actual program steps will be the instruction program steps plus 1 Applicable to IVC2 IVC1 5 1 2 LDI NC Contact Power Flow Loading IL LDI Program steps A n t Operand Type Applicable elements Se E A RAE SA EA Operand description Example S Source operand m 10 MN gt LDI MO Function description OUT YO Connected to the left bus to connect When MO is OFF YO is ON status OFF or disconnect status Note ON the power flow For the contact logic instructions of IVC1 series when the operands are M1536 M2047 the actual program steps will be the instruction program steps plus 1 IVC Series Small PLC Programming Manual 56 Chapter 5 Basic Instructions 5 1 3 AND NO Contact Power Flow And Applicable to IVC2 IVC1 Influenced flag bit IL AND er Program steps ege t Operand Type Applicable elements Se ECH EE M E ELO erre E Operand description Example S Source operand MO M1 YO LD MO Function description E AA OUT YO After conducting the and operation on the ON OFF status of the designated contact S and the current power flow assign the value to the current power flow When MO is ON and M1 is ON YO is ON 5 1 4 ANI NC Contact Power Flow And Applicable to IVC2 IVC1 Influenced flag bit
393. tput monitor monitor ON busy OFF ready When SM85 is set the CLR signals SM85 Clearing function Output of CLR signal for ZRN RW y for high speed outputs YO and Y 1 enabled instruction enabled are output through Y2 and Y3 respectively LU Note If SM85 is set when the ZRN instruction is executed Y2 or Y3 will output a CLR pulse with the width of 20ms longer than the scan cycle If Y2 or Y3 is used for other purposes you should reset SM85 to disable that function IVC Series Small PLC Programming Manual 196 Chapter 6 Application Instructions Special data registers for locating instructions value Current value of YO output locating SD80 SD83 are used to store and instruction MSB calculate the absolute position Their values The current value of YO output locating EJEM are based on SD50 SD53 and the control R W V1 29 EE l instruction LSB signal direction when the locating The current value of Y1 output locating DIES instruction is executed Whenever the PLC instruction MSB is ON and the absolute position data is read from the servo amplifier put the position instruction LSB A EE EX data 32 bit integer into SD80 or SD82 sasi meQHency of executing of 1 You can change SD84 SD85 SD86 and A A EM SD87 according to the actual need Highest Eege of executing of However do not make the change during instructions ZRN DRVI and DRVA H the execution of locating instruction or the MSB 100000 instruction may fail The
394. tput or instructions nor be set during system debugging 2 You can assign values to Y elements with the OUT instruction or set the state value of Y elements or even force or write Y element values during system debugging 3 Through the system block you can set the output states of Y elements in the STOP state IVC Series Small PLC Programming Manual 3 1 4 Auxiliary Relays Element mnemonic M Function The M state elements of discrete type are similar to the transfer relays in the actual electrical control circuits You can use them to save various transit states in the user program Elements numbered in Decimal starting with 0 Data type Boolean Available forms NO and NC contacts 3 1 5 State Relays Elemenet mnemonic S Alias Step flag Function As the step flag the S elements are used in the Sequential Function Chart SFC See Chapter 7 SFC Tutor Classification SO S19 initial step flag Others normal step flag Elements numbered in Decimal starting with O Data type Boolean Chapter 3 Element And Data 35 Value assignment 1 Through instructions 2 Write or force during system debugging Battery backed features saving range the saving rang STOP RUN Remain unchanged Note The saving range is set through the system block See 2 2 1 System Block LU Note When using the N N bus protocol some M elements will be used by the system Available forms 1 Representatio
395. tuaion 1 e o e DWOR Exclusive OR double word instan o o oe men Exchange double wodinsiucion 17 o e IVC Series Small PLC Programming Manual Appendix 9 Instruction Index 293 Instruction function Program steps Influenced flag bit a Power flow falling edge detection Enable interrupt instruction ENCO Encode instruction EROMWR EEPROM write instruction Power flow Power flow rising edge detection Power flow rising edge detection detection FREQUENCY CONVERTER touch forward rotation IVDFWD instruction IVDREV END CONVERTER touch reverse rotation instruction IVERQ EE CONVERTER set frequency instruction IVEWD FREQUENCY CONVERTER forward rotation instruction FREQUENCY CONVERTER read single register value instruction IVRDST FREQUENCY CONVERTER read status instruction IVREV FREQUENCY CONVERTER reverse rotation instruction IVSTOP FREQUENCY CONVERTER stop instruction IVWRT FREQUENCY CONVERTER write single register value instruction FIFO FOV Read word from special module buffer register instruction en JACKE HCNT HOUR Floating point number to integer instruction IVC Series Small PLC Programming Manual VC2 IVC1 Pag 00 N O OD ala OI N gt JE O y 1 d 1 O N a O 00 1 1 DD Wu wech oO O N N 0 O MEN O Zero Carry O Wu zero N 00 N al b i O a O OO Ze
396. uation valve open S s e Maor ingredient vave open A xe Majringecient valve closed 5 a Minor ingredient vale open 6 e Minor ingredient valve ciosed 75 WinoringrecientB vave open A nto OE EE AAA Obviously this is a selection branch structured flow You can select only one type of product A or B in a round Meanwhile the flow has a selection and jump structure the rinsing procedure X7 Minor ingredient B valve closed EE o xo Wining motorrunning The following figures are the corresponding SFC program and its LAD counterpart IVC Series Small PLC Programming Manual 220 Chapter 7 SFC Tutor LADO Start amp stop control program section Initial empty step To process product different from To process the same product as last time enter the rinsing step the last time enter next step Sal Rinsing time 5min is up Add major ingredient Branch for product A Branch for product B The mixing step Time 20min is up The evacuation step Evacuation complete Mark the product type this time for the next round Enter the next round stands for 2 stands fo startup MOV ow Y Product selection operation M 1 is operation bit of HMI M2 means the two adjacent products are different IVC Series Small PLC Programming Manual Chapter 7 SFC Tutor 221 Y4 2 TON TO 3000 SET S21 jor ingredient fu vae ta AA G to aaa m O In H
397. ue 10000 2 of DO D1 is divided by the value 2000 5 of D2 D3 and the result 4 998850 is assigned to D10 D11 2 When the operation result D is not within 1 701412e 038 1 701412e 038 the carry flag bit SM181 will be set When the operation result is 0 the zero flag bit SM180 will be set RSQT Square Root Floating Point Number Instruction Applicable to IVC2 IVC1 LAD E L RSAT IL RSQT S D 5 D Program steps 7 Offset Applicable elements addressing pS preteen PAPA ESTRES ESPARTA ES ree EI OL ELA E E AE ERAS Note Operand Type Operand description S Source operand S gt 0 or the system will report operand error and D Destination operand the instruction will not be executed Function description Example 1 When the power flow is valid S is extracted and mp 10000 20 OT RSQT DO D10 the operation result is assigned to D LD XO 2 When the operation result D is O the zero flag bit SM180 will be set RSQT DO D10 When XO is ON extract the value 10000 2 of DO D1 and assign the result 100 000999 to D10 D11 IVC Series Small PLC Programming Manual 102 6 4 6 6 4 7 Chapter 6 Application Instructions RVABS Floating Point Number Absolute Value Instruction LAD Applicable to IVC2 IVC1 RVABS 5 D Zero carry borrow CRS 5 1D Program steps Offset O d T Applicable el t a ee ee ee ee ee AS Er ree ee ee O O ee a
398. ulse output instruction Wu N Count pulse output instruction Floating point number exponentiation instruction 10 Zero Carry Carry N l O EE al O Add floating point number instruction Zero Carry O O Ramp wave signal output instruction NO N Carry 6 bit carry circular shift right instruction Carry NO ch wesch Ol N 0 Divide floating point number instruction Zero Carry Set input filtering constant instruction CA LA OO oO RMOV IVC Series Small PLC Programming Manual al Appendix 9 Instruction Index 29 VC NO L L a eas gt Instruction function ultiply floating point number instruction Instruction RMUL RNEG ROL Program steps Influenced flag bit Zero Carry E D Q OD O O Z CH N egative floating point number instruction 6 bit circular shift left instruction Carry Carry Zero N O 6 bit circular shift right instruction RSQT RST RST Sxx RSUB RSUM RVABS SEG Word to 7 segment encode SET SET Sxx SFTL SFTR Shift right byte instruction SHL 16 bit shift left instruction SHR SIN SPD Pulse detection instruction 102 O quare root floating point number instruction Reset SFC state delete Subtract floating point number instruction OO O ale MEN O O Zero Carry Sum floating point number instruction CH O CH N
399. ulses will be output again When MO is OFF the output will stop 2 The operand change during the execution of the instruction will not be valid until the next time this instruction is executed 3 SM80 amp SM81 controls the ON OFF of the output at YO and Y1 respectively When SM80 or SM81 is 1 the output is ON 4 SM82 amp SM83 are the output monitors of YO amp Y1 respectively SM82 amp SM83 will be ON when the output is going on or OFF when the output is over 5 SD50 the MSB of the output pulse number at YO for PLSY and PLSR instructions SD51 the LSB of the output pulse number at YO for PLSY and PLSR instructions SD52 the MSB of the output pulse number at Y1 for PLSY and PLSR instructions SD53 the LSB of the output pulse number at Y1 for PLSY and PLSR instructions SD54 the MSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions SD55 the LSB of the total output pulse number at YO and Y1 for PLSY and PLSR instructions 6 SD50 SD55 can be changed with the instruction DMOV or MOV or through the AutoStation software ming Manual 6 10 11 PLS Pulse Output Instruction of Envelope LAD LA HH as 51 52 D1 S1 S2 D1 Operand Type Chapter 6 Application Instructions 155 Applicable to IVC2 IVC1 Program steps Applicable elements sr WORD Constant Kox Kav Katt KS RLM RnsMy DT SOT CTT TV 52 DINT Constant Knx Kay Knit eg RatM Ras SDC v por pa yt
400. umber for the interrupt program Variable Type Data Type TEMP BOOL lt mM Eu Eu Eu Eu E Ei Ei Ei E i G i l i A Project Manager X 5 MAIN Ev880start COM1 SENDD Aris Pe Variable addr Variable Name Variable Type Data Type ld Program block os MAIN i TEMP BOOL w EV850start ReadFrequency A Start XAutoGO Flip 3 KAutoSet COM1 RCY Y3 Y3 COM1 RCVY eg wg 3 COM1 SEND COM1 SENDD NON POWER PTO TIME INT E X2 INT EI Global variable tabl lolo Datablock Refresh immediately SMO REF YO 8 sMO HH Wm D128 D2020 EMANAN Lola System block i E Cross reference tabl p IES Element monitoring t EMT_1 Is Eg Comm equipment conn P Configuration Lab CON1 SERDD Program earen name L j Author Interrupt COMI Frame Send Interruption Interrupt me event Program description Project 1 Instruct 3 Compile the code of the sending frame interrupt of enable serial port in the main program Project Manager aX 5 MAIN Evesostart COM1 SENDD Alb x See i la 9 8 l variable addr Variable Name Variable Type Data Type 4 El P block gt A EZ TE Pr A S TEMP BOOL MAIN EV88O start _ A TEMP BOOL ReadFrequency Start XAutoG0 KAutoSet SC on COM1 SEND et COM1 SENDD HON POWER PTO TIME INT SML X2 INT all HH SET 5m54
401. urce operand 2 l When XO is ON DO D1 2 10110010101001101110011001010010 2997282386 D destination operand and D2 D3 2 00111010001110110011000100110011 976957747 will conduct Function description logic OR operation and the result 2 10111010101111111111011101110011 When the power flow is 3133142899 IS assigned to D10 D11 valid 7 and S2 will conduct logic OR operation and the result is assigned to D 6 6 7 DWXOR Exclusive OR Double Word Instruction LAD Applicable to IVC2 WC HH WOR Gei 2 D S S E Influenced flag bit IL DWXOR S1 S2 D Program steps Operand T Applicable element le eran e cable elements j SE ER addressing S1 DWORD Constant KnX KnY KnM Kns KniM Knsm D so c vo y s2 DWORD Constant Knx KnY KnM KnS KnLM knsM D sp c v y D bworo KknYiknm kns kam b el v y Operand description Example 8 LD X0 S1 Source operand 1 HO SOOT 208 ATA TTAT 22392045665 DWXOR DO D2 S2 Source operand 2 Wi peek 0 m my 5d D destination operand When XO is ON DO D1 2 10110010101001101110011001010010 Function description 2997282386 and D2 D3 2 00111010001110110011000100110011 976957747 will conduct logic exclusive OR operation and the result 2 10001000100111011101011101100001 2292045665 is assigned to D10 D11 When the power flow is valid ST and S2 will conduct logic exclusive OR operation and the result is assigned to D IV
402. used 3 The output loop transistor for PLSY PWM and PLSR is shown as follows External Load resistance power supply 4 With large load the transistor off time is relatively longer The PWM PLSY and PLSR instructions require that the transistor output terminal be connected to their corresponding loads When the output waveform does not conform to the instruction operand increase the load current of the transistor the transistor load current lt 100mA Applicable elements Applicable to IVC2 IVC1 Influenced flag bit Program steps Offset addressing 5 During or after the execution of the high speed instruction no other instructions can use the same port unless the high speed pulse output instruction is invalid 6 Using two PLSY instructions can output two independent pulses at YO and Y1 You can also use PLSY and the PWM or PLSR instructions to get independent pulse outputs at different output ports YO Y1 7 When multiple PWM PLSY or PLSR instructions work on the same output point the first valid instruction will control the state of the output point and others will not affect the output point state 8 Just like other high speed instructions DHSCS DHSCR DHSZ DHSP DHST and HCNT the PLSY instruction must meet the system s requests on high speed IO Example Mi OFF FISY 1000 10000 Yi OFF FISY 1000 10000 YO LD M1 PLSY 1000 10000 Y1 PLSR 1
403. variable table gt Datablock la System block 3 Cross reference table Element monitoring table ei EMT_1 E Do Comm equipment connecti SS Configuration table ls gt v Project Man W Instruction YO Program description Refresh YO 3 Set the interval for the timed interrupt and enable the timed interrupt in the main program Project Manager aX 5 MAIN E INT_1 Altls a B a a Variable addr Variable Name Variable Type Data Type Comments Program block me Se a EA MP 00L E MAIN E 3 SBRI Si TEMP BOOL a A INT lt gt E7 Global variable table Datablock la System block Set the interval of timed interrupt to ls 1000ms fe Cross reference table Ve Element monitoring table Y f m Moy 1000 SD66 EMT_1 Ha Comm equipment connecti LS Configuration tabje Zoet SM66 ON to enable the timed interrupt SM1 _ SET SM66 Allow the request of enabled interrupt to join the request queue SMO HAL lt gt w Project Man SI Instruction s gt 9 4 External Interrupt Description The external interrupt is related to the actual PLC input points It is classified into input rising edge interrupt and input falling edge interrupt In the user program add the actions related to external event to the external interrupt program The highest response frequency of the system to the external event is 1K The external events over 1K ma
404. ve station is illegal function code 6 XMT from master station 01 02 00 00 00 OA F8 0D Master station reads input element X element 10 X0 X9 from the starting address 00 00 Slave station response 01 02 02 00 00 B9 B8 The slave station responds with correct information which has 02 bytes and the content is 00 00 7 XMT from master station 01 01 04 BO 00 OA BC DA Master station reads 10 bit elements X0 X9 starting with 04 BO decimal 1200 Slave station response 01 01 02 00 00 B9 FC LU Note 1 The slave station responds with 02 bytes and the content is 00 00 2 X element does not support write Processing of double word elements 1 The current value of C element is word element or double word element The values from C200 to C255 are double word elements which are read and written through the function codes 03 16 of read write register The address of every two registers corresponds to one C double word element and the registers can only be read or written in pair For example read the RTU fame of three C double word elements C200 C202 01 03 25 E4 00 06 8E F3 ES CRC check code Number of elements to read 6 Starting address 9700 Function code Station No In the returned data 9700 and 9701 are the two addresses representing the content of C200 9700 is the high 16 bits and 9701 is the low 16 bits 2 When reading the double word element if the starting address for the reading is not an even number the
405. velop high speed pulse output function and will define a motion outline for your application out configuration will generate an instruction automatically and store relevant positions in SD and D elements High speed output port setting Provide you 2 high speed output ports and the wm el port you wish to configure is vo RS Motor Speed Setting Maximum motor speed in application 1100000 Hz Minimum motor speed in application 5000 Hz Acc Dec Time Setting Time taken to accelerate from the lowest speed to the highest speed Time taken to decelerate from the highest speed to the lowest speed All the sections of the envelope have the same acceleration and deceleration For example according to the configuration shown in the preceding figure the time it takes for the motor to accelerate from 20000Hz to 50000H is 1000 x 50000 20000 100000 5000 316 ms 0 316 s During the acceleration the total pulse number can be figured out with the trapezoid area calculation method 20000 50000 0 3162 11060 pulse number Therefore if a certain accerleration deceleration time or pulse number is required you should do the math before setting the maximum speed minimum speed and acc dec time Click the Next Step button in the preceding figure to enter the Motion Outline Define window as shown in the following figure IVC Series Small PLC Programming Manual Chapter 8 Using High Speed I O 233 Xotion Outl
406. wer supply 2 The T elements are addressed according to the timing precision O 100ms TO T209 o 10ms T210 T251 e 1ms T252 T255 3 The C elements are addressed according to the counter types and functions o 16bit up counter CO C199 0 32bit bi directional counter C200 C235 O 32bit high speed counter C236 C255 4 Part of PLC elements are reserved for internal tasks Avoid using those elements in the user program See Appendix 3 Reserved Elements 5 These two elements are local variants that cannot be defined in the global variant table When the user program calls subprograms or returns to the main program they will be cleared or be set through interface parameter transfer UO IVC Series Small PLC Programming Manual 34 3 1 3 Chapter 3 Element And Data Input And Output Points Element mnemonic e X discrete input point O Y discrete output point Function The X and Y elements represent respectively the input state of hardware X terminal and output state of hardware Y terminal The state of X elements is obtained through the input image register while the state of Y elements is output through the output circuit driven by the output image register The two operations are carried out in the I O Update stage of PLC scan cycle as shown in Figure 3 2 For details see 2 1 2 System Running Mechanism Scan Cycle Model It is obvious that there is a brief delay in PLC s response to the I O The dela
407. with D will move rightward for S3 units and the S3 elements at the rightmost side will be discarded At the same time the contents of S3 elements starting with 7 will be filled into the left end of the string Note 1 When MO is ON the contents of 10 elements starting with M10 will move rightward for 3 bits and rightmost three elements M10 M12 will be discarded At the same time the contents of the 3 elements starting with XO will be filled into the left end of the string 2 Before the execution XO 1 X1 0 X2 1 M10 0 M11 1 M12 1 M13 0 M14 0 M15 1 M16 0 M17 0 M18 0 M19 1 3 After the execution the contents of XO to X2 remain unchanged M10 0 M11 0 M12 1 M13 0 M14 0 m15 0 m16 0 m17 1 m18 0 m19 1 The elements with smaller 4 SN are at the right and the elements with larger SN are at the left 2 220 3 320 IVC Series Small PLC Programming Manual 128 Chapter 6 Application Instructions 6 7 14 SFTL Shift Left Byte Instruction LAD Applicable to n IVC1 HA SIL SI D me e Influenced flag bit IL SEIL S1 D S2 S3 Program steps Operand Type Applicable elements si_ poo Lsixlvlsiuwlawl ec rt Dolo v m s Jim el ri Fn ont ae en oa os knew nse o so e 1 v 2 s3 INT Constant KnX KnY KnM Kns knLm knsm D so c tT v z_ Offset SC Operand description Example S1 Source
408. with S2 in the BFM of special module 7 Note The execution time of the TO instruction is relatively long and closely related to S4 Example CMD LD SMO To 0 8 1000 2 TO 0 8 1000 2 When PLC runs write 1000 respectively to buffer registers 8 and 9 in the BFM of target module number 0 IVC Series Small PLC Programming Manual 132 Chapter 6 Application Instructions 6 8 4 DTO Write Double Word To Special Module Buffer Register Instruction LAD Applicable to IVC2 IL DTO S S S eg Program steps Im Offset Operand Type Applicable elements addressing a int Constant 2 NT Constant fF II aa ont fb f twit y ss int constant Range 1 32767 If the target register does not exist the system will report BFM unit of accessed special module exceeds range Operand description S1 The SN of the special module to be written or the Function description target module 1 Write data from consecutive 4 registers starting with S3 to the Range 0 7 If the target consecutive S4 buffer registers starting with S2 in the BFM of the target module does not exist the module SN 7 system will report Using 2 If S3 is a constant write it consecutively into the S4 double word elements FROM TO instruciton to access starting with S2 in the BFM of special module 7 module not existing Note S2 The starting r
409. with inverters PLCs touch screens and meters through the RS 232 port on PORT 0 or Port 1 The maximum communication distance is 15 meters and maximum baud rate is 38400bit s For details about the Modbus network see Chapter 10 Using Communication Function and Appendix 7 Modbus Communication Protocol IVC Series N N bus Protocol Network The IVC1 series PLC is embedded with Invt developed N N bus communication protocol capable of setting up an N N communication network through the Port 1 RS 485 port or through PORT 0 and a RS 232 485 converter The N N bus communication protocol allows single double layer networking and data exchange among 2 32 PLCs with the maximum baud rate of 115200bps For details about the N N bus network see Chapter 10 Using Communication Function Free Port Protocol Network The free port protocol allows communication with customized data format It supports ASCII and binary system In this communication mode the PLC can communicate with various equipment with customized formats such as inverter bar code scanner instrument and other intelligent devices PLC can communicate with a single device in the RS 232 or RS 485 mode or form a RS 485 network when there are multiple devices For details about the free port protocol communication see Chapter 10 Using Communication Function IVC Series Small PLC Programming Manual Chapter 1 Product Overview 7 1 4 Makeup Of Document System Of IVC Series Small PLCs
410. with transistor output Note 8 Install the servo amplifier according to the related instruction manual Note that many plugs looks the same do not get confused Note 9 You need to control KM through the program to cut off the power upon alarms or emergencies Note 10 The PLC uses sink input in this example Short the 24V and the S S terminals here Figure 6 3 System wiring diagram IVC Series Small PLC Programming Manual 202 Chapter 6 Application Instructions Program example The aimed functions of the program are O When the PLC enters the RUN state read the absolute position data from the servo amplifier through the ABS instruction or through communication note that in this case the servo amplifier must be powered on with the PLC at least at the same time O SM85 is set after PLC enters the RUN state to set the output clearing function and Y2 will output a clearing pulse whenever zero return occurs e Press the JOG button to jog forward e Press the JOG button to jog backward Oo When the workbench is away from the zero point farther than the proximity detection point press the Zero Return button to make it return to the zero point Press the STOP button and a running workbench will stop immediately Use the Forward Reverse Positioning control buttons to locate the workbench Power on initialization Zero teturn state ServoamplifSystem r Ex er r fault y signal X1 X0 X2 X3 x4 X5
411. y is related to the input filter communication internal tasks and scan cycle Execution of user program Input filtering Communication Internal tasks o 0 Sd O D C O o o C O a Update I O Figure 3 2 Schematic diagram of I O update Classification AU X17 have digital filters whose filtering time can be set at the system block Others use hardware filter XO X5 can be used as the counting input point for high speed counters Besides X0 X7 can also be used for inputting external interrupts pulse tracking and SPD frequency detecting instruction YO and Y1 can be used for high speed output Others are ordinary output points Elements numbered in Octal starting with 0 The X and Y elements of both the basic module and the I O modules are numbered continuously like O 7 10 17 20 27 and so on Data type Boolean both X and Y Available forms NO and NC contacts dependent on which instruction uses it The NO and NC contacts have opposite state values They are sometimes referred to as a contact and b contact You can use NO and NC contacts of the Y element during programming Value assignment 1 The X elements accepts only hardware input state value and forced operation state value In the user program they cannot be changed through ou
412. y be lost The rising edge interrupt and falling edge interrupt cannot be used on the same port simultaneously All the external interrupts are only valid when the global interrupt control El and corresponding enabling SM are valid The detailed relationship is as follows Interrupt number Enabling element Interrupt number Enabling element SR SEH I Su su Su su su IVC Series Small PLC Programming Manual Chapter 9 Using Interrupts 239 The external interrupts are numbered as follows Interrupt number Interrupt source Interrupt number Interrupt source 0 XO input sing edge meme neat sing edge nieri C z input sing edge nieri 7 input sing edge ntewupt C a nput sing edge nieri 5X input sing edge ntewupt 8X input sing edge ntewupt 8 Reeve The single input impulse frequency of XO X7 is less than 200Hz P L Example In the example the system upsets the output of YO based on the corresponding external interrupt O function and rising edge input event of XO 1 Compile the interrupt program to flip YO status once upon every interrupt and output immediately To use an interrupt you should select its corresponding interrupt number See the following figure for the specific operation Project Manager SS MAIN INT a x lj 9 4 Variable addr Variable Name Variable Type Data Type Comments a z Program block AO RANT Lo MAIN lt gt H SBR_1 3 Fa Ii Ej a mee a EES A ih y YO flips each time the
413. y error the error flag SM136 will be set and the error details will be recorded in the special register SD139 2 This instruction is executed upon the rising edge IVC Series Small PLC Programming Manual 172 Chapter 6 Application Instructions 6 12 11 XMT Free Port Sending XMT Instruction Applicable to IVC2 IVC1 XMT SI 52 53 SY GI DI Minttuencedftagbit oo IL XMT en S23 83 St INT Constant Se WORD DB Y ff jf 3 INT Constant KnX KnY KnM KnS KniM D SD T VY z2 Operand description Example ST designated communication channel Range 0 1 ch EE mes S2 starting address of the data to be sent TO e EST TO S3 number of bytes to be sent Hoy 16 1 mo Function description i MOV 16 UN When the power flow is valid and the communication conditions are met the designated data will be sent dee SS through the designated channel MOY 16 l D3 Note Wu 1642 D 1 Size of communication frame depending on the RST 3m22 element type D or V of the communication frame the AMT 1 no ending character of the frame does not exceed D7999 E or V63 HK In mog 2 In case of shutdown the sending will stop LD SMO Special register TON TO 100 1 SM110 SM120 Sending enabled flag It will be set ei as when the XMT instruction is used and cleared when RST TO the sending is completed When it is reset the current MOV 16 1 DO se
414. ype Data Type Comments d Program block Oo w PS MAIN gt La o SBR_1 e GEAR Set 3M65 ON to enable the interrupt upon XO rising edge E Global variable table lo Datablock SMO M65 la System block HL 5 Cross reference table ix Element monitoring table ei EMT_1 Allow the request of enabled interrupt to join the request queue E Ce Comm equipment connecti FB Configuration table MO HL E j Drive the C236 high speed counter corresponding to x0 7 SMO HCNT C236 20000 Use C236 in the interrupt SMO _ DHSCcI 1000 C236 20 gt v Project Man gt IVC Series Small PLC Programming Manual Chapter 9 Using Interrupts 241 9 6 PTO Output Completion Interrupt Description The PTO output completion interrupt is triggered when enable flag SM63 or SM64 is set and the high speed pulse output at YO or Y1 is finished You can carry out the relevant processing in the interrupt sub program This function is applicable only to IVC1 series PLC Example This example uses the high speed pulse output of YO to call the interrupt program number 18 after YO high speed pulse output is finished 1 Code function in interrupt program INT_1 Compile program for the interrupt code to realize the control Choose the corresponding interrupt number for each interrupt See INT_1 for the specific operation T ect Manager BS 3 MAIN E INT 1 a gt x Variable addr Variable
Download Pdf Manuals
Related Search
Related Contents
Mañana comienza el plazo para notificar a los miembros de las Samsung E1230 Manual de Usuario Pelco HS6000 User's Manual TV 1001 Navigator - Ideal Vacuum Products, LLC Avanti BCA4562SS User's Manual La permaculture : mode l`emploi Manuale di istruzioni EXZ50 Copyright © All rights reserved.
Failed to retrieve file