Home

1 Program Summary

image

Contents

1. M8002 DMOV K1000 DO DMOV K2000 D2 DMOV K200 D4 DMOV K3000 D6 DMOV K3000 D DMOV K9000 D10 DMOV K800 D12 DMOV K10600 D14 DMOV K100 Di6 DMOV K11400 DIS DMOV K1200 D20 DMOV Kl4400 D22 FMOV KO D24 K4 DMOV K100 D50 Mo DPLSA DO D50 YO M8170 f is 1 Instruction Summary Generate absolute position pulse with the specified frequency acceleration deceleration time and pulse direction Absolute position multi segment pulse control PLSA 16 bits 32 bits Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC condition Models Hardware Software requirement requirement 2 Operands Specify the soft component s number to output the pulse 16 32bit BIN parameters Specify the acceleration deceleration time or soft component s 16 32 bit BIN number S1 Specify the pulse output port Specify the pulse direction port 3 suitable soft components constant module operands D m ID CD DX DY DM DS KH ID E exe qe cag p peu eyegqc e operands DI 16 bit instruction form PLSA DO D100 YO RST MO 32 bit instruction form En DPLSA DO D100
2. MO PLSR DO D100 YO Y1 FEND 10000 a xs M8000 i PLSMV KO YO IRET origin signal X2 working table T ES SS forwar d oe When the working table is moving backward it gets the origin signal X2 execute the external interruption PLSMV command run immediately not effected by the scan cycle Refresh the pulse number from YO and send to D8170 This instruction is used to clear the accumulation difference caused in pulse control PLSMYV instruction is only for PLSR and DPLSR g 6 2 7 Back to the Origin ZRN E 1 Instruction Summary Back to the Origin Back to the Origin ZRN 16 bits ZRN 32 bits DZRN Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC condition p ia Hardware Software 2 Operands Specify the backward speed or soft components ID 16 32bit BIN Specify the creeping speed or soft components ID 16 32 bit BIN Specify the soft components ID of the close point s signal Bit Specify the pulse output port Bit 3 suitable soft components 16 bit instruction form T GO 9 ZRN K1000 K100 X3 YO 32 bit instruction form T G9 DZRN D100 D200 X3 YO origin returning one scanning creeping speed 51 period speed 2 Pulse output YO closed point signal AS Pulse si
3. 11s When therising edge of initial positive pulse coil M8002 comes i e Each scan cycle starts HSC C630 reset and clear the count value When set coil M8000 ON C630 starts to count the count value is set to be K8888888 If the count value is greater than KO but smaller than K100 the output coil YO set ON If the count value is greater thanK 100 but smaller than K200 the output coil Y1 set ON If the count value is greater thanK200 the output coil Y2 set ON 5 10 HSC Interruption To XC series PLC each HSC channels has 24 segments 32 bit pre set value When the HSC difference value equals the correspond 24 segment pre set value then interruption occures according to the interruption tag To use this function please use hardware V3 1c or above 5 10 1 Instruction Description for the program about interruption please refer chapter 5 10 4 MO C600 K20000 D4000 MI C600 f R J LD MO HSC activate condition MO interruption count condition OUT C600 K20000 D4000 HSC value and set the start ID of 24 segment LDP MI lactivate condition reset RST C600 HSC and 24 segment reset interruption reset As shown in the above graph data register D4000 is the start ID of 24 segment pre set value area Behind it save each pre set value in DWORD form Please pay attention when using HSC If certain pre set value is O it means count interruption stops at thi
4. E m A DO D10 K3 MEAN DO DI D2 3 gt DIO 4 applied instructions The value of all the devices within the source range is summed and then divided by the number of devices summed i e n This generates an integer mean value which is stored in the destination device D The remainder of the calculated mean is 1gnored Ifthe value of n is specified outside the stated range 1 to 64 an error is generated 1 Summary Do logic AND OR XOR for numbers Logic AND WAND 16 bits WAND DWAND Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Models Hardware Software requirement S requirement Logic OR WOR 16 bits WOR 32 bits DWOR 32bits Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 32bits 0 Logic Exclusive OR WXOR 16 bits WXOR 32 bits DWXOR Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Models Hardware Software requirement requirement 2 Operands SI The soft element address 16bit 32bit BIN S2 The soft element address 16bit 32bit BIN The result address 16bit 32bit BIN 4 applied instructions 3 Suitable soft components gt e pw e ww ww v en o lo s 11411111 L1 MN XL Ie peer 1r p IJI BEREC eN J 1 lt Execute logic AND operation with each bit gt xo 9
5. D51 D50 ACOS gt D61 D60 RAD Binary Floating Binary Floating Calculate the arcos value radian save the result in the target address s Cosi TCOS value Binary Floating SS sf D l D RAD value angle 7 180 Assign the binary floating value 4 applied instructions 4 9 13 ATAN ATAN 1 Summary ATAN ATAN Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware V3 0 and above Software 2 Operands Soft element address need to do arctan 32 bit BIN Do Result address 32 bit BIN 3 Suitable soft components D x e 4 ATAN D50 D60 D51 D50 ATAN gt D61 D60 RAD Binary Floating Binary Floating Calculate the arctan value radian save the result in the target address Cs ATAN value Binary Floating Der Do RAD value angle 7 180 Assign the binary floating value 4 applied instructions 4 10 RTC Instructions Clock data read 4 10 1 WR Clock data write 4 10 2 gt lt 1 To use the instructions The Model should be equipped with RTC function 4 applied instructions 4 10 1 Read the clock data TRD 1 Instruction Summary Read the clock data Read the clock data TRD Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware V2 5 and above Software 2 Operands gt Register to save clock data 16 bits BIN 3 Suitable Soft Components p m m
6. DIV DO D2 D4 Dividend Divisor Result Remainder BIN BIN BIN BIN DO ES D2 gt D4 D5 16 bits 16 bits 16 bits 16 bits d SU appoints the device s content be the dividend s2 appoints the device s content be the divisor D appoints the device and the next one to store the result and the remainder In the above example if input XO is ON devision operation is executed every scan cycle lt 32 bits operation gt D Go GO 9 DDIV DO D2 D4 Dividend Divisor Result Remainder BIN BIN BIN BIN D1 D0 D3 D2 D5 D4 D7 D6 32 bits 32 bits 32 bits 32 bits The dividend is composed by the device appointed by s1 and the next one The divisor is composed by the device appointed by szand the next one The result and the remainder are stored in the four sequential devices the first one is appointed by If the value of the divisor is 0 then an operation error is executed and the operation of the DIV instruction 1s cancelled e The highest bit of the result and remainder is the symbol bit positive 0 negative 1 When any of the dividend or the divisor is negative then the result will be negative When the dividend is negative then the remainder will be negative 4 applied instructions 4 6 5 Increment INC amp Decrement DEC 1 Summary Increase or decrease the number Increment 1 INC Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XC
7. DPLSY DO I2 Yo L_ 1000 20000 OFF J RST MO Note DO is pulse frequency D2 is pulse quantity DO 1000 D2 20000 If the control object is stepping servo motor we recommend users not use this instruction to avoid the motor losing synchronism PLSR is available 6 2 2 Variable Pulse Output PLSF K PLSF has 4 control modes Mode 1 changeable frequency continuous pulse output PLSF 1 Instruction Summary Instruction to generate continuous pulse in the form of variable frequency Variable Pulse Output PLSF 16 bits PLSF 32 bits DPLSF Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC ae D Hardware Software requirement requirement 2 Operands Specify the frequency or register ID 16 bits 32 bits BIN ID Specify pulse output port bit 3 suitable soft components constant module rM 16 bit instruction form a PLSF DO YO Frequency range 5Hz 32767Hz when the set frequency is lower than 5Hz output 5Hz Pulse can only be output at YO or Y1 With the changing of setting frequency in DO the output pulse frequency changes at YO Accumulate pulse number in register D8170 DWord When pulse frequency is 0 the pulse output end There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency unt
8. Ladder chart M8002 M8050 CSS X0 if SBLOCK Sequence blockii DPLSR DO D2 D4 YO Instruction list M DPLSR D100 D102 DI04 YO SBLOCKE M8000 MOV K1000 DO MOV K20000 D2 MOV KO DA MOV K100 D100 MOV K300 D102 MOV K20 D104 I0000 M8000 E STOP YO M8050 S IRET The instruction list content RST M8050 Notes M8050 prohibit the exterior interruption PLC power on prohibit the exterior interruption BLOCK starts Output the pulses and move some distance Reset M8050 open the exterior interruption Output the pulses at low speed BLOCK ends The first pulse frequency The first pulse numbers Accelerate decelerate time for the first pulse The second pulse frequency The second pulse numbers Accelerate decelerate time for the second pulse The interruption starts Stop outputting the pulse Close the interruption The interruption ends Example 2 One PLC master station no 1 communicates with 3 PLCs slave station no 2 3 4 via serial port 2 RS485 Master PLC needs to read the DO value of 3 PLCs Then store the value in master PLC D100 D102 Ma ite 0 SBLOCK read slave value REGR K2 KO K1 D100 K2 REGR K3 KO KI D101 K2 REGR K4 KO K1 D102 K2 SBLOCKE Communicate with slave station 2 Communicate with slave station 3 Communicate with slave station 4 M8000 is normal ON coil the mast
9. MI Y1 M2 M3 DPLSR DO D2 D4 YO DPLSR DO D2 D4 Y1 M5 Inverter config SBLOCKE M4 Explanation A When M2 is ON block 1 is running B All the instructions run in sequence in the block C M3 M4 M5 are the sign of SKIP when they are ON this instruction will not run D When MG is OFF if no other instructions use this YO pulse DPLSR DO D2 D4 YO will run if not the DPLSR DO D2 D4 YO will run after it is released by other instructions E After DPLSR DO D2 D4 YO is over check M4 If M4 is OFF check DPLSR DO D2 D4 Y1 if M4 is ON check M5 If M5 is OFF inverter config will run R 10 5 BLOCK instruction editing rules In the BLOCK the instruction editing should accord with some standards 1 Do not use the same pulse output terminal in different BLOCK YES 4 SBLOCK Sequence block1 SBLOCK Sequence blockl DPLSR DO D2 D4 YO DPLSR DO D2 D4 YO SBLOCKE SBLOCKE SBLOCK Sequence block2 SBLOCK Sequence block2 DPLSR D10 D12 D14 YO DPLSR D10 D12 D14 Y1 SBLOCKE SBLOCKE 2 Do not use the same pulse output terminal in BLOCK and main program YES 4 DPLSR DO D2 D4 YO DPLSR DO D2 D4 Y1 SBLOCK Sequence block SBLOCK Sequence block DPLSR D10 D12 D14 YO SBLOCKE SBLOCK Sequence block1 DPLSR DO D2 D4 YO
10. PSTOP YO K1 This instruction is used to stop PTO pulse instruction 352 Stop mode urgent stop slow stop S2 K1 MO is ON pulses urgent stop S2 K0 MOis ON pulses slow stop with the slope of PTO instruction parameter S1 6 If S1 6 0 it is urgent stop mode Frequency y MO When MO is ON the solid line is urgent stop K1 dotted line is slow stop 6 2 14 Variable frequency single section pulse PTF 1 Summary To produce the variable frequency pulses as set parameters Variable frequency single section pulse output PTF 16 bits 32 bits PTF FR NNI RN Execution Normally ON OFF coil suitable XC3 XC5 XCM XCC e M Baes Hardware V3 3 and higher vision Software V3 3 and higher vision requirement requirement 2 Operands Specify the soft component start ID of the pulse 32 bits BIN parameters Specify the pulse output direction port 3 Suitable soft components gt mlm mo ox Tw ow s xn o Ss HI dI dddd Li operands System 32 bits instruction Without directions MO e PTF DO YO With directions a PTF DO YO Y1 The parameters are shown as below the parameters is 32 bits two bytes 3Sl Pulse frequency S1 2 Rising and falling frequency of pulse which is increasing decreasing frequency per second Pulse quantity in current section
11. Y0 master modbus address COLW K3 H4800 YO K2 K2 serial port 2 SBLOCKE M8000 is always ON coil the master will keep on writing the YO state to slave YO Please refer to chapter 10 for BLOCK function Method 3 use broadcast function S PLCI IN COLW KO H4800 YO K2 YO TP Broadcast station 1s 0 all the slaves will response but not reply Broadcast cannot read When master YO state changes it broadcasts the state to all the slave The synchronization is better than method 1 and 2 7 3 FREE FORMAT COMMUNICATION i Free format communication transfer data in the form of data block each block can transfer 128 bytes at most Free format communication mode Free format is free protocol communication Now many devices support RS232 or RS485 but the communication protocol is different For example XINJE PLC is Modbus protocol some temperature controllers use special protocol If PLC needs to read temperature it can send data according to the temperature controller protocol Note Portl Port2 or Port3 can support free format communication but free format usually needs to change the serial port parameters Port 1 parameter cannot be changed so it is not recommended to use port 1 In free format mode FD8220 port 2 or FD8230 port 3 should set to be 255 FF Baud Rate 300bps 115 2Kbps Data Format Data Bit 7bits 8bits P
12. SBLOCKE Note when the trigger condition of BLOCK is normal ON coil the BLOCK will execute one by one from up to down circular until the condition is OFE When the trigger condition of BLOCK is rising edge the BLOCK will execute once from up to down 10 2 Call the BLOCK In one program file it can call many BLOCK the following is the method to add BLOCK in the program 10 2 1 Add the BLOCK t Open XCPpro software right click the sequence block in the project bar Project ria Project ey PLC aD Code Te Ladder beu E Free Monitor thas Er Naka MnniFar F Insert You can edit the program in this window Upwards and downwards are used to change the position of the instruction in the block There is a Insert choice on the bottom left of the window when selecting it the add button will become insert Edit Sequence Block 1 Comment Sequence Blackl The difference between insert and add Add is to add instructions in the end of the block insert can add instruction in any place in the block Click add button you will see the instructions can be added in the block Edit Sequence Block 1 Comment Sequence Blackl Common Item Pulse Item Modbus Item Frequency Inverter Item Free Format Communication Item Wait Item For example add a pulse item in the program lx Pulse Config Skip Comment P
13. ox by m os ku p TRD DO The current time and date of the real time clock are read and stored in the 7 data devices specified by the head address D Read PLC s real time clock according to the following format The reading source is the special data register D8013 D8019 which save clock data Unit Item Clock data D8018 Year 0 99 DO Year a4 MM oj a Pe X9o o oui Col 10 191s1891 jep eroodg 4 applied instructions 4 10 2 Write Clock Data TWR 1 Instruction Summary Write the clock data Write clock data TRD Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware V2 5 and above Software 2 Operands Write the clock data to the register 16 bits BIN 3 Suitable Soft Components p m m m px by m os km Dw BE del ee E 1 m Cs The 7 data devices specified with the head TWR DO address S are used to set a new current value of the real time clock Write the set clock data into PLC s real time clock In order to write real time clock the 7 data devices specified with the head address S should be pre set Unit Item Clock data Year 0 99 3oo o oum Cn usa Cos seme e TETTE Z o e 5 e O ER C T n oO ct Ee 5 ga Col 10 191s1891 Vep eroodg 4 applied instructions After executing TWR instruction the time in
14. p m m m ox by m os kar Dw Gg wel 13g eS 3 xo B m TAN D50 D60 D51 D50 RAD gt D61 D60 TAN Binary Floating Binary Floating This instruction performs the mathematical TAN operation on the floating point value in S The result is stored in D RAD value angle X x 180 Cs Assign the binary floating value TAN value Binary Floatin Der Do 4 applied instructions 4 9 11 ASIN ASIN 1 Summary ASIN ASIN Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware V3 0 and above version Software 2 Operands Soft element address need to do arcsin 32 bits BIN Do Result address 32 bits BIN 3 Suitable soft components D x e 4 ASIN D50 D60 D51 D50 ASIN gt D61 D60 RAD Binary Floating Binary Floating This instruction performs the mathematical ASIN operation on the floating point value in S The result 1s stored in D c Binary Floating RAD value angle X 7 180 Dar T 59 cH Assign the binary floating value 4 applied instructions 4 9 12 ACOS ACOS 1 Summary ACOS ACOS Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware V3 0 and above Software 2 Operands Soft element address need to do arccos 32 bits BIN Do Result address 32 bits BIN 3 Suitable soft components D x e m ACOS D50 D60
15. SILE SIL S2 4 applied instructions 4 applied instructions 4 3 4 FOR and NEXT Summary Loop execute the program between FOR and NEXT with the specified times Loop starts FOR Execution Rising Falling edge Suitable XC1 XC2 XC3 XC5 XCM Hardware Software Loop ends NEXT Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM Hardware Software 2 Operands Program s loop times between FOR NEXT 16 bits BIN 3 Suitable Soft Components p m m n px o m os ku p sS il A a ee 1 FOR NEXT instructions must be programmed as a pair Nesting is allowed and the nesting level is 8 Between FOR NEXT LDP LDF instructions are effective for one time Every time when MO turns from OFF to ON and MI turns from OFF to ON A loop is executed 6 times Every time if MO turns from OFF to ON and M3 is ON B loop is executed 5 X 7 35 times If there are many loop times the scan cycle will be prolonged Monitor timer error may occur please note this If NEXT is before FOR or no NEXT or NEXT is behind FENG END or FOR and NEXT number is not equal an error will occur Between FOR NEXT CJ nesting is not allowed also in one STL FOR NEXT must be programmed as a pair 4 applied instructions MO it FOR K5 M1 it FOR K6 INC DO A NEXT M3 C FOR K7 I
16. m el weise si ede 1 E qup o pgqepepmwper 4 applied instructions SUB D10 D12 D14 DIO D12 gt D14 SU appoint the soft unit s content subtract the soft unit s content appointed by 2 in the format of algebra The result will be stored in the soft unit appointed by D 5 8 13 The action of each flag the appointment method of 32 bits operation s soft units are both the same with the preceding ADD instruction The importance is in the preceding program if X0 is ON SUB operation will be executed every scan cycle The relationship of the flag s action and vale s positive negative is shown below Bera fla Bera flaz Taro flag z Un Lu ds ls 0 xZ 768 ale qu d 3a Tor 0 1 2 E NI ru 3 Borrow flaz Data s EN Tata Carry flaz highest T fo Wii bit is 1 bit is Tero flag lero lag M MOS wal Sls 1 Z 147 de Als t in l d 147 de bff Ix J emu 0 288 Borrow laz Carry flag H 4 6 3 Multiplication MUL 1 Summary Multiply two numbers store the result Multiplication MUL 16 bits MUL DMUL Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM Hardware Software 2 Operands Sl The number address 16 bits 32bits BIN S2 The number address 16 bits 32bits BIN The result address 16 bits 32bits BIN 3 Suitable soft component 4 applied instructions p m m m n px oy m os ka
17. When X0 is ON FROM will test 20 pulse from X3 every scan cycle Calculate the frequency s value and save into D100 Test repeat If the tested frequency s value is smaller than the test range then return the test value is 0 The pulse output to X number 14 16 24 32 48 60 m x 11 3 Precise Time 1 Instruction List Read and stop precise time when execute precise time precise time STR 16 bits 32 bits STR instruction execution edge activation suitable XC2 XC3 XC5 XCM XCC read precise time STRR hardware software requirement requirements 16 bits 32 bits STRR instruction instruction execution edge activation suitable XC2 XC3 XC5 XCM XCC hardware V3 0e and above software stop precise time STRS 16 bits 32 bits STRS instruction execution edge activation suitable XC2 XC3 XC5 XCM XCC condition _ models hardware V3 0e and above software requirement Da requirements 2 Operands Operands Function Type Timer Number bit Timer Number bit specify timer s value or soft component s ID 16 bits BIN number 3 Suitable Soft Components gt gt gt gt o x ow m w v o m tl fri tli 1 NO operands system oo system ooo 5 j l ekl 1 1 lel Precise Time li STR T600 K100 T600 C veo gt RST T600 DI Timer s number Range T600 T618 T
18. B origin A CX0 gt B X1 p C X2 The object needs to move from A to B to C The speed of the three segments is different The position of A B and C is uncertain We can use DPLSR and PLSNEXT to make this program We can use proximity switch in position A B C Connect the proximity to PLC terminal X1 X2 X3 Pulse frequency terminal is YO pulse direction terminal is Y2 Name Pulse frequency Hz Acceleration Frequency Pulse quantity Pulse quantity address address Dword Dword Segment origin A 1000 D1 DO 999999999 D3 D2 Segment A B 3000 D5 DA 999999999 D7 D6 Segment B C 2000 D9 D8 999999999 D11 D10 30ms D31 D30 deceleration time Note the pulse quantity should be set to a large value to ensure it can reach the proximity switch Please clear the 4 registers behind segment 3 D15 D14 D13 D12 MS M 2 DMOV K1000 DO DMOV K99999999 D2 DMOV K3000 D4 DMOV K999999999 D6 DMOV K2000 DS DMOV K999999999 DIO FMOV KO DI K4 DMOV K30 D30 M0 DPLSR DO D30 YO Y2 CRO X0 PLSNEXT YO X1 X2 Diagram MO 3000Hz 2000Hz 1000Hz in A X0 B X1 C 6 2 5 Pulse Stop STOP a 1 Instruction Summary Stop pulse output immediately Pulse stop STOP 16 bits STOP 32 bi
19. temperature CR enter end Two methods to making the program A Normal method MO N MOV H3A DO DO ascii 9 code MOV H52 DI Dl R ascii code MOM H54 D2 D2 T ascii code MOV HOD D3 DI CR ascii 0 code SEND DO K4 K2 DO ascii 0 code M RCV DIO K4 K2 0 D10 receive start If it needs to use STL please refer to Modbus example program Switch the STL by serial port communication sign bit B use BLOCK to make the program Send data Free Format Communication Config 11 1111111 2 Add Edit Delete Upwards Downwards SerialPort Config Send Recv First Address DU COMI COM2 COMI Bbi 16bit ce Posey TU ee Const Ot Reg DO Receive data Free Format Communication Config Add Edit Delete Upwards Downwards SerialPort Config Send Recv First Address D10 COMI COM2 COM3 bt 16bit Const Data Length 5 H D10 Program M3000 SBLOCK read temperature SEND gt RCV SBLOCKE M8000 is always ON coil PLC will keep on reading the temperature When the PLC communicate with other device please use serial port debug tool to monitor the data Then make the free format protocol as the dat
20. In the form on flow this can make the program s structure much clear and easy to modify Forcommon use After shut off the PLC power this type of relays will be OFF status For Power Off Retentive Use y The status relays for power off retentive usage even the PLC is OFF they can keep the ON OFF status before power OFF y Power off retentive zone can be modified by the user The status relays also have countless normally ON OFF contactors So users can use them freely in the program 2 Timer T XC series PLC s timers T are addressed in form of decimal each Address L ist subfamily s ID are listed below SERIES NAME RANGE FOR COMMON USE POINTS TO T23 100ms not accumulation T100 T115 100ms accumulation T200 T223 10ms not accumulation T400 T403 1ms not accumulation T500 T503 1ms accumulation T300 T307 10ms accumulation m TO T99 100ms not accumulation T100 T199 100ms accumulation T 640 T600 T639 1ms with precise time The timers accumulate the 1 ms 10ms 10ms clock pulse the output contactor Function activates when the accumulation reaches the set value We use OUT or TMR instruction to time for the normal timers We use constant K to set the value or use data register D to indirect point the set value XQ T200 K200 N T200 yo EE moment to run the instruction one scan cycle odA Jew oN O 8 If XO is ON th
21. interruption return tag interruption tag of segment 4 M8000 is normally ON coil output coil Y3 reset back running stop output coil Y4 reset low speed run stop output coil Y2 set run forward interruption return tag PULSE OUTPUT In this chapter we tell the pulse function of XC series PLC The content includes pulse output instructions input output wiring notes and relate coils and registers etc 6 1 Functions Summary 6 2 Pulse Output Types and Instructions 6 3 Output Wiring 6 4 Notes 6 5 Sample Programs 6 6 Coils and Registers Relate To Pulse Output Pulse Output Instructions List Circuit And Soft Device Chapter PULSE OUTPUT Unidirectional ration pulse DRVI Relative Position rm Control Absolute Position e Control Absolute Position multi section 6 2 10 pulse control Relative DRVA PLSA PLSY uan 6 2 1 without ACC DEC time change Variable PLSF frequency 6 2 2 pulse output Ration pulse output with ae ACC DEC speed PLSNEXT du Section i PISNT s 6 2 4 PLSNT Switch STOP Pulse Stop f sToP s Refresh Pulse PLSMV Nr S D 6 2 6 immediately Original ZRN I 4 ZRN S1 52 S3 D 62227 zen ecm E oat mt in pwa v position PTO 6 2
22. 4 applied instructions g D nl nz 82 p wart vo pio xis xt ne words left shift e cue ee s CREE e amp 4 7 7 Word shift right WSFR 1 Summary Word shift right Word shift right WSFR Execution rising falling edge Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Operands Function Source soft element head address Target soft element head address Source data quantity Shift right times 3 Suitable soft components mI e pw e w w mw xn o The instruction copies n2 source devices to a word stack of length nl For each addition of n2 words the existing data within the word stack is shifted n2 words to the right Any word data moving to a position exceeding the nl limit is diverted to an overflow area 4 applied instructions Inevery scan cycle loop shift right action will be executed p 1 2 D DI3 DI10 Overflow o CG C m 1 3 D21 D18 gt D17 D14 D25 D22 D21 D18 D3 D2 D1 Do n2 words right 5 D 3 D 0 D25 D22 NOA NO NOA 4 2 W il 4 8 Data Convert double word integer point point point MEX fasci comenson asr 4 applied instructions 1 Summary Single word integer converts to double word integer WTD 16 bits WTD Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands Source soft element addres
23. 1 Summary Float Zone Compare EZCP fists mw Ec Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware software mo Jmm 2 Operands S1 Soft element address need compare Upper limit of compare data S33 Lower limit of compare data Do The compare result soft element address bit 3 Suitable soft components p m m m ox by m os ka p Am re ee ee 01 0 Jj Ce eee ee ae ee ee ee TERELT 4 applied instructions Compare a float range with a float value ENDE E o X0 EZCP D10 D20 DO M3 M3 DLDO lt DILDIO ON Binary Floating Binary Floating M4 CANNE D11 D10 lt D1 D0 lt D21 D20 ON Binary Floating Binary Floating Binary Floating pu D1 D0 gt D21 D20 ON T Binary Floating Binary Floating The status of the destination device will be kept even if the EZCP instruction is deactivated The data of SI is compared to the data of S2 The result 1s indicated by 3 bit devices specified with the head address entered as D Jfa constant K or H used as source data the value is converted to floating point before the addition operation XO 1 JBZCP K10 K2800 DS MO K10 D6 D5 K2800 MO MI M2 Binary converts Binary Floating Binary converts to Floating to Floating Please set S1 lt S2 when S2 gt S1 see S2 as the same with S1 and compare them 4 applied i
24. LD M8002 SET M8285 SET Y2 M8002 is initial positive pulse coil special auxiliary relay set ON to enable C630 continuous loop set output coil Y2 i e Start run forth LDPY2 J knit weaving machine back forth times counter s activate condition Y2 forth rising edge activate OUT C340 K1000000 LD M8000 DMOV K75000 D4000 DMOV K15000 D4002 DMOV K 75000 D4004 DMOV_ K 15000 D4006 LD M8000 OUT C630 K30000000 D4000 LD M8000 HSCR C630 D200 FEND 12501 LD M8000 SET Y4 IRET 2502 LD M8000 RST Y4 RST Y2 SET Y3 IRET 2503 LD M8000 SET Y4 IRET 2504 LD M8000 RST Y3 RST Y4 SET Y2 IRET counter C340 starts to count M8000 is normally ON coil set segment 1 ID D4000 to be K75000 set segment 2 D4002 to be K15000 set segment 3 D4004 to be K 75000 set segment 4 D4004 to be K 15000 M8000 is normally ON coil HSC and start ID of 24 segment M8000 is normally ON coil read the HSC value of C630 to D200 main program end linterruption tag of segment 1 M8000 is normally ON coil output coil Y4 set low speed run with speed 1 Ainterruption return tag hnterruption tag of segment 2 M8000 is normally ON coil output coil Y4 reset low speed run stop output coil Y2 reset run forward stops output coil Y3 set back running interruption return tag hnterruption tag of segment 3 M8000 is normally ON coil output coil Y4 set low speed run with speed 1
25. M8350 M8370 TO T23 100ms not accumulation T100 T115 100ms accumulation T200 T223 10ms not accumulation Tq Timer T300 T307 10ms accumulation T400 T403 1ms not accumulation T500 T503 1ms accumulation CO C23 16 bits forward counter C300 C315 32 bits forward backward counter C Counter C600 C603 single phase HSC C620 C621 C630 C63 1 D0 D99 D100 D149 1 For Special Usage D8000 D8029 For Special Usage D8060 D8079 Data Register For Special Usage D8120 D8179 For Special Usage D8240 D8249 For Special Usage D8306 D8313 For Special Usage D8460 D8469 FD FlashROM FDO FD411 412 Internal Relay 9 N oo Un 0 138 Register P For Special Usage FD8000 FD8011 For Special Usage FD8202 FD8229 For Special Usage FD8306 FD83 15 For Special Usage FD8323 FD8335 For Special Usage FD8350 FD8384 XC2 Series Mnemonic Name 14 16 24 32 48 60 I4 I O 16l O 24 32YO 48 60 I O I O O TO I O Input X0 XI15 X0 X33 l X0 X7 X0 X7 14 18 28 36 I O Points Points X0 X21 X0 X43 i Output YO Yl YO0 Y23 YO Y5 YO Y7 10 14 20 24 Points YO Y15 YO Y27 x2 Internal X X0 X1037 544 Relay x3 Internal bid YO Y 1037 544 Relay M0 M2999 O M3000 M7999 For Special Usage M8000 M8767 S0 S511 512 S1023 TO T99 100ms not accumulation T100 T199 100ms accumulation Timer Internal Relay S Flow 1 CO C299 16 bits forward counter C300 C599 32 bit
26. Positive Movement Negative Movement Along with the increase of the measures definite value FY outputvalue MV will also reduce It s usually used in heat up control Positive Movement Along with the increase of the measures definite value PV outputvalue MV will also increase It s usually used in cool control Hold Mem Register Can t Read Paramter Range D4000 D4043 a ee es mnm amm For the details of panel configuration please refer XC series PLC user manual software partl Soft Component s Function In chapter 1 we briefly tell the program language of XC series PLC However the most important element to a program is the operands These elements relate to the relays and registers inside the controller In this chapter we will describe the functions and using methods of these relays and registers 2 Summary of the Soft Components 2 2 Structure of the Soft Components 2 3 List of the Soft Components 2 A Input output Relays X Y 2 5 Auxiliary Relays M 2 6 Status Relays S 2 7 Timers T 2 8 Counters C 2 9 Data Registers D 2 10 Constant K H 2 11 Pointer P D 2 12 Program Principle fi 2 10 Summary of the Soft Components There are many relays timers and counters inside PLC They all have countless NO Normally ON and NC Normally Closed contactors Connect these contactors with the coils will make a sequential control circuit Below we wil
27. number Specify the pulse output port Bit 3 suitable soft components system module x a LeeL LiL Ll 16 bit instruction form 2 m en PLSA DO D100 YO M8170 i RST MO 32 bit instruction form 2 DPLSA DO D100 YO M8170 i RST MO The parameters address is a section starts from Dn or FDn In the above example DO set the first segment pulse s highest frequency D1 set the first segment s absolute position D2 set the second segment pulse s highest frequency D3 set the second segment s absolute position if the set value in Dn Dn 1 is 0 this represents the end of segment we can set 24 segments in total For 32 bits instruction DPLSA DO D1 set the first segment pulse highest frequency D2 D3 set the first segment pulse quantity D4 D5 set the second segment pulse highest frequency D6 D7 set the second segment pulse quantity If the setting value of Dn Dn 1 Dn 2 Dn 3 are 0 it means the end of the segment It can set 24 segments in total Acceleration deceleration time is the time from the start to the first segment s highest frequency Meantime it defines the slope of all segment s frequency to time In this way the following acceleration deceleration will perform according to this slope Pulse can be output at only YO or Y1 XC5 series is YO Y3 3 axis is YO Y2 10 axis
28. p m px pv m s x Tw operands 32 bits instruction form Without direction Er 51 A PTOA DO YO With direction EC st A PTOA DO YO Y1 The parameters address and functions are shown as below the parameter is 32 bits two bytes e Sil Total section N range is 1 255 S142 reserved S1 4 The direction 0 is positive is negative of unlimited pulse section zero pulse section S1 6 Pulse descending slope decreasing frequency per second 0 means urgent stop S1 8 Start pulse frequency of section 1 S1 10 End pulse frequency of section 1 1412 Absolute pulse position of section 1 S1 4 14 Start pulse frequency of section 2 e S1 16 End pulse frequency of section 2 S1 18 Absolute pulse position of section 2 1420 Start pulse frequency of section 3 351422 End pulse frequency of section 3 51424 Absolute pulse position of section 3 e The pulse parameters address of section N can be known by this discipline The pulse direction of section 1 is decided by current pulse quantity and cumulative pulse quantity other section directions are decided by current pulse quantity and last section pulse quantity Occupied registers size N 3 4 N 34 4 N 4 5 2 The toggle condition to execute the pulse is rising edge if the signal is closed signal the pulse will execute repeatedly T
29. p m m m x by m rs x m dep legpelegjenm en 21 E Jer djepepeleg pepe y DIO D20 ON MI D10 D20 ON M2 D10 lt D20 ON Even X000 OFF to stop ZCP instruction MO M2 will keep the original status Compare data S1 and CS output the three points ON OFF status start with according to the value 4 applied instructions e D 1 2 the three point s on off output according to the valve 4 5 2 Data zone compare ZCP 1 Summary Compare the two specify Data with the current data output the result Data Zone compare ZCP 16 bits ZCP DZCP Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands SI Specify the down limit Data of the compare 16 bit BIN Ma E ON S Specify the Up limit Data of the compare stand 16 bit BIN IE Cor S Specify the current data or soft component s 16 bit BIN IM T EE Specify the compare results data or soft bit component s address code 3 Suitable soft components p m m m ox by m ps ku D Ca mer eee ee v E Za mel ee eee E ee ee 4 applied instructions T ZCP D20 D30 DO MO MO C L 33X 1 oe MO ON MI L L L E LX LIB wow M2 a gt GE 2 oN Even X000 OFF stop ZCP instruction MO M2 will keep the original status Compare CS data with e
30. will be executed repeatedly Continuous output 9 sections of pulses the pulse output terminal is YO pulse direction terminal is Y2 the start frequency and end frequency please see the following table Section Start frequency End frequency Relative pulse Hz Hz quantity 1000 1500 3000 2 1500 3200 3200 Frequency A Hz Section 5 8000 Section 6 Section 4 6000 f Section 7 Section 3 3200 Section 2 1500 1000 Section 9 0 T1 T2 I3 T4 T5 To T7 T I9 t Ladder chart MO T PIO D4000 YO Y2 LL Set the parameters Set the parameters through PTO config Please find it in XCPpro software PTO Config Instruction PTO With Direction Reg Block Addr D4000 Output YO Direction Y2 Decreasing Frequence 0 il Pulse unlimit Direction Add Edit Delete Upwards Downwards Start Frequence End Frequence Pulse Count 1 L000 1500 8 Note 1 PTO parameters will occupy the registers of D4000 D4205 please don t use these registers for other purpose 2 Click Write to PLC OK Then click stop run D 32 bits instruction Mo oo Xon Pp PTO DO X1 YO Parameter distribution the parameter is 32 bits 2 bytes SI section quantity N range 1 255 3 Sl42 reserved S144 pulse direction the section of 0 pulses O is positive direction
31. BIT E 10 i Li int i j m n 12 unsigned int reg crc xfffrf k i13 14 fori i 0 i lt W U i is 1 16 reg crc W i rl 17 for j 0 j8 j lg 1 19 if reg crc amp xuil 20 reg crc ireg cre gt gt 1 Oxa00l al else B reg crc reg crc 1 ad ad aa 6 6 m W O 1 ot n W 0 2 28 k reg crc amp xrtf n a W m k a3 30 W n reg crcs xtt 31 Edit PLC ladder program DO Parity data byte number D1 D5 Parity data s content see graph below M8002 km mov H5 DO MOV H12 DI MOV H34 D2 MOV H56 D3 MOV H78 D4 MOV H90 D5 M8002 L 4 CRC CHECK DO MO e Download to PLC then RUN PLC set MO via Free Monitor we can find that values in D6 and D7 are the highest and lowest bit of CRC parity value 9 7 Application Points When upload the PLC program in which there are some Func Blocks the Func Blocks can t be uploaded there will be an error say There is an unknown instruction In one Func Block file you can write many functions they can be call each other Each Func Block files is independent they can t call each other Func Block files can call C language library functions in form of floating arithmetic like sin cos tan etc XCPpro software v3 3 and later version add C function library In this function block user can call the C
32. CSEND K100 D4000 K4 PLC station 2 Receive data package ID100 and save in address starts from D4000 4 bytes MO CRECV DO D4000 D20 D30 M8000 MOV K4 D20 MOV K100 DO PID Control Function In this chapter we mainly introduce the applications of PID instructions for XC series PLC basic units including call the instructions set the parameters items to notice sample programs etc 8 1 Brief Introduction of The Functions 8 2 Instruction Formats 8 3 Parameter Setting 8 4 Auto Tune Mode 8 5 Advanced Mode 8 6 Application Outlines 8 7 Sample Programs i 8 1 Brief Introductions of The Functions PID instruction and auto tune function are added into XC series PLC basic units Version 3 0 and above Via auto tune method users can get the best sampling time and PID parameters and improve the control precision The previous versions can not support PID function on basic units unless they extend analog module or BD cards PID instruction has brought many facilities to the users 1 The output can be data form D and on off quantity Y user can choose them freely when program 2 Via auto tune users can get the best sampling time and PID parameters and improve the control precision 3 User can choose positive or negative action via software setting The former is used to heating control the later is used to cooling control 4 PI
33. FDn m Serial connection of PR Rising edge pulse SUN i XLI YUMLU SUTU CLU Dn m FDn m ANDF Serial connection of EM AND Falling trailing edge pulse C a Falling pulse XLI YUMLU SUTU CLU Dn m FDn m Parallel connection of i Rising edge pulse eere a XI YE MU S TL Cl Dn m FDn m ORF Parallel connection of C i OR Falling trailing edge pulse Falling pulse Operands X YU MLI SUTUCL Dn m FDn m Statements LDP ANDP JORP are active for one program scan after the associated devices switch from X5 X6 M13 M8000 X7 OFF to ON LDF ANDF JORF are active for one program scan after the associated devices switch from ON to OFF X5 LDP M13 Program i ORP M8000 X7 ll M15 OUT LD ANDP OUT M15 3 60 LDD LDDI ANDD ANDDI ORD ORDI OUTD Mnemonic and Function Mnemonic Function Read the status from the contact directly Read the normally closed contact directly Read the status from the contact directly Read the normally closed contact directly Read the status from the contact directly Format and Operands HIM Devices X Li Devices X PHI Devices X Li Devices X the normally closed contact directly Devices X Output to the contact directly Devices Y Statements The function of LDD ANDD ORD instructions are similar with LD AND
34. Instruction M8056 Mos Mis hae 66k 3k 99 interruption s time range lum from 1 to 99 unit is ms em hm he ee ooo represents time Normally time interruption is in allow status With EI DI can set interruption s allow or forbidden area As in the above graph all time interruptions are forbidden between DI EI and allowed beyond DI EI Cc gt Interruption Allowed DI Interruption Forbidden EI a Interruption Allowed FEND 14010 f ON Interruption Program IRET EI The first 3CH interruptions are equipped Interruption with special relays M8056 M8059 to M8056 Allowed forbid interrupt Ud UL In the left example program if use MO to 14020 enable M8056 ON the forbid OCH s time interruption Interruption Program IRET END Application Program Samples In this chapter we make some samples about pulse output instruction Modbus communication instructions and free format communication instructions etc 12 1 Pulse Output Sample 12 2 Modbus Communication Sample 12 3 Free Format Communication Sample 12 1 Pulse Output Application Example send high frequency and low frequency of pulse Parameters Stepping motor parameters step angle 1 8 degrees step scale 40 p
35. N N I 1 I I I I 1 1 I Pai i I L I P La N N N N N N N NIST 7 7 7 na 4 7 7 N k t N e a ca N a T 5 s Ed Ed D P 4 Pa f 1 P4 V4 wv xternal signal lt 4 d 3 PA a Ld Fi yt yd ya z Pa Fd Pd n d 7 PA a K 7 7 N N 1 N kt N M 7 N N x N N AY N X IR N N N W S l XN N N 3 N N N N N N N N N N N N iN k N N N N N N N v S v s ES N r r l i I r 1 1 7 Yr i I Vv l i 1 r I i E J Ed d d K 7 E p j 4 E E E p r y F 2 4 7 H 3 7 l 7i E if n 1 E 7 d ri 7 T AC O e X4 x4 N N N N A NI N N N N NON S NON v 3 NON iN NOON N 3 N N MONON N v k N s Y N E N S N x ji y iS NON M ON s CC HE TN N VM N The external interruption signal is produced in the non zero pulse section The rest pulses Ss is smaller than falling section pulses Sn When encountering the external interruption signal it runs the falling section with the slope K When Ss S6 S7 it stops outputting the pulses Ss is the pulses of rest section S6 is the pulses of section 6 S7 1s the pulses of section 7 Sn is the pulses of falling section when encountering the exte
36. OR LDDI ANDDI ORDI instructions are similar with LDI ANDI ORI but if the operand is X the LDD ANDD ORD commands read the signal from the terminals directly this is the only difference OUTD and OUT are output instructions But if use OUTD output immediately if the condition comes true needn t wait the next scan cycle X0 X2 YO LDD XO Program D Jr C D J LDDI X2 jin ORD x2 ANB OUTD YO i 3 70 ORB Mnemonic and Function Mnemonic Function Format and Devices ORB Parallel connection OR Block of multiply parallel circuits Devices none Statements The serial connection with two or more contacts is called serial block If parallel connect the serial block use LD LDI at the branch start place use ORB at the stop place As the ANB instruction an ORB instruction is an independent instruction and is not associated with any device number There are no limitations to the number of parallel circuits when using an ORB instruction in the sequential processing configuration Program AU xl W Seri al connect the block Recommended good Non preferred batch programming method programming method LD XO LD XO AND Xl AND XI LD X2 LD X2 AND X3 AND X3 ORB LD X4 LD X4 AND X5 AND X5 ORB ORB ORB 3 8 ANB Mnemonic and Function Mnemonic Function Format and Devices Serial connection of multiply Devices
37. Restart after HSC interruption ends This mode is especially suitable for the following application 1 continous back forth movement 2 Generate cycle interruption according to the defined pulse Via setting he special auxiliary relays users can set the HSC interruption to be unicycle mode or continous loop mode The loop mode is only suitable with the relative count The detailed assignment is show below HSC ID Setting 24 segments HSC interruption loop C600 OFF unicycle mode 24 segments HSC interruption loop C602 ON continous loop mode 24 segments HSC interruption loop C604 24 segments HSC interruption loop C606 24 segments HSC interruption loop C608 24 segments HSC interruption loop C610 24 segments HSC interruption loop C612 24 segments HSC interruption loop C614 24 segments HSC interruption loop C616 24 segments HSC interruption loop C618 24 segments HSC interruption loop C620 24 segments HSC interruption loop C622 24 segments HSC interruption loop C624 24 segments HSC interruption loop C626 24 segments HSC interruption loop C628 24 segments HSC interruption loop C630 24 segments HSC interruption loop C632 24 segments HSC interruption loop C634 5 10 4 Example of HSC Interruption E g 2 Application on knit weaving machine continous loop mode The system theory is shown as below Control the inverter
38. Sampling Time 0 ms D 5 Prapartion Gain KP zx A095 Integration Time T 0 hms Differential Time TD 0 i ms 3 PID Computation Scope T Direction Config PID Control Death Band n z i Negative Movement CO Positive Movement x Negative Movement Along with the increase of the measures definite value PV outputvalue MV will also E reduce It s usually used in heat up control Overshoot Config Positive Movement Along with the increase of the measures definite value PV outputvalue MV will amp Enable Overshoot Disable Overshoot also increase It s usually used in cool control 15 Hold Mem Register Cant Read Paramter Range D4000 D4043 Suggestion value Read From PLC Write To PLC Cancel Auto tune mode PID Instruction Parameter Config hl E eee l Target Value SV DO Measure Value P V D10 Parameter D4000 Output YU Parameter Config Mae Config l Common Mode Advanced Mode 3 Manual i Auto sampling Time 0 E ms J at 495 ca PID Computation Scope ca k Direction Config PID Control Death Band n Negative Movement C Positive Movement L Negative Movement Along with the increase of the measures definite value PV outputvalue MV will also Self Study Periodic Value 0 Sa reduce Es usually used in heat up control Self Study Method L Positive Mavement Alang with the increase of the Self Study PID Control Mogae er measures
39. YO Y3 RST MO The parameters address is a section starts from Dn or FDn In the above example DO set the first segment pulse s highest frequency D1 set the first segment s absolute position D2 set the second segment pulse s highest frequency D3 set the second segment s absolute position if the set value in Dn Dn 1 is 0 this represents the end of segment we can set 24 segments in total For 32 bits instruction DPLSA The parameters address is a section starts from Dn or FDn In the above example D0 D1 set the first segment pulse s highest frequency D2 D3 set the first segment s absolute position D4 D5 set the second segment pulse s highest frequency D6 D7 set the second segment s absolute position if the set value in Dn Dn 1 Dn 2 Dn 3 is 0 this represents the end of segment we can set 24 segments in total Acceleration deceleration time is the time from the start to the first segment s highest frequency Meantime it defines the slope of all segment s frequency to time In this way the following acceleration deceleration will perform according to this slope Pulse can be output at only YO or Y1 XC5 series is YO Y3 3 axis is YO Y2 10 axis is YO Y11 Frequency range 0 32767Hz 16 bits instruction 0 200KHz 32 bits instruction Pulse number range KO K32 767 16 bits instruction KO K2 147 483 647 32 bits instruction Confirm the value
40. change When n if encode instruction s Cs is bit unit it s point number is 2 8 256 4 applied instructions 4 9 Floating Operation SUB 4 applied instructions 4 9 1 Float Compare ECMP 1 Summary Float Compare ECMP Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft element address need compare Soft element address need compare D Compare result bit 3 Suitable soft components p m m m x oy pu rs ku p m Ce ee DL so jejej i fe fe fe fe fe CC E SE S E D11 D10 D21 D20 MO0 M1 M2 Binary Floating Binary Floating ECMP DIO D20 MO MO D11 D10 gt D21 lt D20 s Binary Floating Binary Floating MI DILDIO D21 lt D20 Binary Floating Binary Floating D11 D10 D21 lt D20 F Binary Floating Binary Floating The status of the destination device will be kept even if the ECMP instruction is deactivated 4 applied instructions The binary float data of S1 is compared to S2 The result is indicated by 3 bit devices specified with the head address entered as D Ifa constant K or H used as source data the value is converted to floating point before the addition operation X0 I ECMP K500 D100 MIO K500 D101 D100 M10 M11 M12 Binary converts Binary floating to floating 4 9 2 Float Zone Compare EZCP
41. o je g 4 7 4 Bit shift left SFTL y 1 Summary Bit shift left Bit shift left SFTL Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software requirement VENE requirement 2 Operands Source soft element head address bit ID Target soft element head address bit 4 applied instructions Source data quantity 16 bits 32 bits BIN Shift left times 16 bits 32 bits BIN 3 Suitable soft components p m m m ox by m os ku D um ANV eee ee gp eee ee le eee Yd Operands The instruction copies n2 source devices to a bit stack of length nl For every new addition of n2 bits the existing data within the bit stack is shifted n2 bits to the left right Any bit data moving to the position exceeding the nl limit is diverted to an overflow area In every scan cycle loop shift left action will be executed M15 M12 Overflow M11 M 8 M15 M 12 M 7 M 4 MI11 MS8 M 3 M 0 M7 MA X 3 X 0 M3 MO0 9 9 CO a Oo 4 2 His D wo a Te ls 4 7 5 Bitshift right SFTR B 1 Summary Bit shift right Bit shift right SFTR rising falling edge XC2 XC3 XC5 XCM 4 applied instructions Hardware Software requirement requirement 2 Operands Source soft element head address bit m Target soft element head address bit ys 3 Suitable soft components Tw gt m o ww ww v en o ao Lll dliililli Ll m peee e ee m eis We quee ep
42. operation Falling trailing edge pulse Serial connection of NO normally open contacts Read the status from the contact directly Serial connection of NC normally closed contacts Read the normally closed x contact directly H c ANDF AND Falling pulse ORI OR Inverse ORF OR Falling pulse Serial connection of rising edge pulse Serial connection of falling trailing edge pulse Parallel connection of NO normally open contacts Read the status from the contact directly Parallel connection of NC normally closed contacts Read the normally closed contact directly Parallel connection of rising edge pulse Parallel connection of falling trailing edge pulse Serial connection of multiply parallel circuits Parallel connection of multiply parallel circuits Final logic operation type coil drive gt e Xl YU MI SE TU CU Dn m FDn m Xl YU MI SE TU CU Dn m FDn m MO YU M SU TU CU Dn m N i P x0 YO MO SO TO CO Dn m FD N 4 n m OUTD Output to the contact directly SET Set a bit device SET permanently ON RST Reset a bit device ReSeT permanently OFF PLS Rising edge pulse PuLSe LF P Falling trailing edge pulse PuLse Falling MCS Conn
43. 0 f S 4 STL S0 SO 6 DMOV K1000 D4000 DMOV K3000 D4002 FMOV KO D4004 K8 DMOV K100 D4030 TO Kl 27 S MI M8170 MI 31 R S1 S 39L STLE STL S1 S1 35 DMOV K1000 D4000 EM DMOV K 3000 D4002 pud FMOV KO D4000 K8 DMOV K100 D4030 TO Kl TO MI 63 f S MI M8170 MI 67 R S1 R 65L STLE MI is DPLSR D4000 D4030 YO Y2 Method3 use sequence block BLOCK can support multi instruction sequential working Please refer to chapter 10 6 5 Sample Programs E g 1 Stop at certain length With instruction PLSR and PLSNEXT make stop at certain length function Take the sample program as the example set MO two segments pulse output in DO DI and D2 MI D3 with the same frequency value In second segment pulse output set pulse number D3 as the output pulse number after receive MI signal This will realize stop at certain length function See graph by the left side segment 1 segment Z M8170 Program MO 0 _ PLSR DO D30 YO Y2 MI 7 PLSNEXT YO M8170 MO 11 R Note register DO D1 D2 D3 set the frequency and pulse quantity of segment 1 and 2 D30 set the acceleration deceleration time reset register D4 D5 E g 2 follow function In this sample the pulse frequency from YO equals with the frequency tested from X003 If the frequency tested from X0
44. 0 is correct M8213 Neglect the alarm or not When flag is 1 stop sending alarm Pulse alarm flag frequency M8214 PULSE_3 change suddenly 1 is alarm 0 is correct 8215 Neglect the alarm or not When flag is 1 stop sending alarm Pulse alarm flag frequency M8216 PULSE 4 change suddenly 1 is alarm 0 is correct 8217 Neglect the alarm or not When flag is 1 stop sending alarm Pulse alarm flag frequency M8218 PULSE_5 change suddenly 1 is alarm 0 is correct 8219 i Neglect the alarm or not When flag is 1 stop sending alarm Some special registers of pulse output are listed below ID D8 170 D8171 D8172 D8173 D8174 D8175 D8176 D8177 D8178 D8179 D8180 D8181 D8190 D8191 D8192 D8193 D8194 D8195 D8196 D8197 D8210 D8212 D8214 D8216 Pulse ID PULSE_1 PULSE_2 PULSE_3 PULSE_4 PULSE_1 PULSE_2 PULSE_3 PULSE_4 PULSE_1 PULSE_2 PULSE_3 PULSE_4 Function The low 16 bits of accumulated pulse number The high 16 bits of accumulated pulse number The current segment means segment n The low 16 bits of accumulated pulse number The high 16 bits of accumulated pulse number The current segment means segment n The low 16 bits of accumulated pulse number The high 16 bits of accumulated pulse number The current segment means segment n The low 16 bits of accumulated pulse number The high 16 bits of accumulated pulse number The curr
45. 1 is negative direction o S146 pulse falling slope decreasing frequency per second O is urgent stop S1 8 start frequency of section 1 S1 10 end frequency of section 1 3 SlI 12 pulse quantity of section 1 1414 start frequency of section 2 e S1 16 end frequency of section 2 Sl 18 pulse quantity of section 2 S1 420 start frequency of section 3 1422 end frequency of section 3 1424 pulse quantity of section 3 T 7 N N N A S ws Ns ca pes cy esp vs WOT NTO P Ed Pa n i l P4 P r i d 7 5 L P N d a w Ed 4 r i 7 7 7 r rd 4 n E 7 4 7 d 7 7 7 e E P4 d E 7 I rd i xtenar signal e Pf s 7 a 7 a P Z z Z r Pa a P d Pd r H F JS 2 E i s D i T 7 s F F i t ea N N N are N L3 Rm X A eee eer N r d Cd a 4 E 7 7 E Pa p 7 a a P N w N N N N N N N N N SE NOM x v N eon N No N 3 v sags te oa nn RENS V A v QU If user has not set the O pulse section the instruction will not be executed N EY Y s N N N W N N If the external signal is produced in zero pulse section it will switch to the next section if there is no next section stop the pulse output If the exter
46. 485 wiring method A twisted pair cable B B Connect all the terminal A connect all the terminal B A is RS485 B is RS485 Application One XC series PLC connects 3 XC series PLCs 3 slave PLCs follow the master s action Master PLC YO ON slave YO ON Master PLC YO OFF slave PLC YO OFF But the action of 3 slave PLCs cannot be very synchronous Method 1 program PLCI YO T S0 COLW K1 H4800 YO K2 M8138 li ZRST M8137 M8138 M8137 S1 STLE STL S1 COLW K2 H4800 YO K2 ZRST M8137 M8138 STLE STL S2 S2 M M8138 COLW K3 H4800 YO K2 N ZRST M8137 M8138 M8137 S2 STLE There are 3 STL in the program Every STL is communication program of one slave If one STL communication is successful it jumps to the next STL If not it tries twice If three times all fail M8137 is ON and jump to the next STL This program uses serial port 2 if it is other serial port please see appendix 1 for communication flag bit Method 2 use BLOCK to make the program PLCI M amp 000 SBLOCK 1 master 3 slaves CLOW coil write COLW Kl H4800 YO K2 KI K2 K3 is PLC station no COLW K2 H4800 YO K2 H4800 slave YO modbus address
47. 6 4 7 Ed I 4 d al 1 2 E P 5 2 B H 4 i v a i a 4 Ed d P d i 7 i 7 Ly 4 le A Ed 7 Rd wo amm l i d pa 7 a i 7 P4 5 Z 1 i 1 Pa 4 a Pd t P I s E S d i 1 2 a A 1 T 7 E i l a P Ed t F Ed i Pi t dd j p Pd i H a pE e i a d 4 e i I a a d d i P 1 Dd d d di dii d i r zi a E d r i LT 7 l i d SAO ly b d Pd Pd 1 HE e E P4 l H ta 5 aie E I Pad dg 5 4 b t yz L Pod P P d a wood 7 I P Pad a i Pd Pal D em z b P 7 41 7 E Ear P L Vd 7 l 2 L p Ve J lt i Pd S yt H e 7 7 Ld 4 0 i 2 xd 32h d d d i gt i a a 7 Lk 7 Ld af wt 0 4 7 7 wot z External interruption signal is produced in non zero pulse section rest pulses Ss is larger than falling pulses Sn When encountering the external interruption signal it runs the smooth section with the current frequency Sm Ss Sn then the falling section Sn Ss is pulses of rest section Sn is pulses of frequency falling section when encountering external interruption signal Sm is pulses of smooth section when encountering the external interruption signal S6 is the pulses of section 6 S7 1s the pulses of section 7 S8 is the pulses of section 8 N N N s X a S b Pd N N s s s s N N N ES s N R N N N N N N N N
48. Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency continuous pulse output Continuous pulse output b Set frequency oo Set frequency 3 Note T1 and T3 is pulse start time T2 and T4 is pulse end time Mode3 changeable frequency limited quantity pulse output PLSF 1 Instruction Summary Instruction to generate changeable frequency limited quantity pulse Variable frequency limited quantity pulse output PLSF 16 bits PLSF 32 bits DPLSF fein i a Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC ee ae ee Hardware V3 3 and above Software V3 3 and above somal eee ooo 2 Operands Specify the frequency or register ID 16 bits 32 bits BIN Specify pulse quantity or register ID 16 bits 32 bits BIN 3 suitable soft components 5 Tw gt w e wx ww ww e xm o operands system 16 bit instruction form ONONO DO D2 PLSF YO U RST MO Frequency range 5Hz 32767Hz when the set frequency is lower than 5Hz output 5Hz Pulse quantity range KO K32767 Pulse can only be output at YO or Y1 With the changing
49. C630 is O the first preset value is 10000 the preset value in segment 2 is 5000 the preset value in segment 3 is 20000 When start to count the counter s current value is 10000 generate first interruption 12501 When start to count the counter s current value is 5000 generate first interruption I2502 When start to count the counter s current value is 25000 generate first interruption 12503 See graph below K10000 K 5000 K20000 I2501 C600 K0 K 10000 K 10000 2502 C600 K10000 K 5000 K5000 2503 C600 K5000 K20000 K25000 E g 2 the current value is C630 is 10000 the first preset value is 10000 the preset value in segment 2 is 5000 the preset value in segment 3 is 20000 When start to count the counter s current value is 20000 generate first interruption I2501 When start to count the counter s current value is 25000 generate first interruption I2502 When start to count the counter s current value is 45000 generate first interruption 12503 See graph below K10000 K10000 K5000 K20000 12501 C600 K10000 K 100002K 20000 C600 K20000 K5000 K25000 2503 C600 K25000 K20000 K45000 2502 5 10 3 Loop mode of HSC Interruption M ode 1 Unicycle normal mode Not happen after HSC interruption ends The conditions below can re start the interruption 1 reset the HSC 2 Reboot the HSC activate condition M ode 2 Continuous loop
50. CAN Sending CSEND 16bits CSEND 32bits instruction instruction Executing Normally ON OFF Rising edge Suitable XC5 XCC Condition Models Hardware Software Requirement Requirement 2 Operands specify the ID of sending data package 16bits BIN S2 specify the local sending data or soft component 16bits BIN locally specify the byte number of sent data 16bits BIN 3 Suitable soft components gt fm m wm o ox or ww w ow s Il dllldid m dene qgegsel p px p gp p j He ees Wei Jg e y il CSEND K100 DO K4 Instruction for data sending send data at every rising edge of MO ID number of sending data package is 100 4 bytes data the first ID is in DO 8 bits data transfer the transferred data is DOL DIL D2L D3L DOL means the low byte of DO 16 bits data transfer the transferred data is DOL DOH DIL DIH DOH means the high byte of DO il CSEND D10 DO D20 The ID of sending data package is specified by DIO the data number is specified by D20 the first ID is in DO 8 bits data transfer the transferred data is DOL DIL D2L D3L DOL means the low byte of DO 16 bits data transfer the transferred data is DOL DOH D1L D1H DOH means the high byte of DO Standard Frame the valid bits of the data package ID number that is specified by DIO is the low 11 bits the left bits are invalid The expan
51. Char 3 Reply 300 MA Module ls Contain Send i 10 4 Running form of the BLOCK 1 If there are many blocks they run as the normal program The block is running when the condition is ON A The condition is normal ON normal OFF coil MI SBLOCK Sequence block 1 SBLOCK Sequence block 2 5 m U SBLOCK Sequence block 3 Scanning period 1 Scanning period 2 Scanning period 3 LM uc ucc IN Block1 Block1 Block2 Block1 Block2 Block3 B the condition is rising or falling edge of pulse MI M2 f SBLOCK Sequence block 2f M3 SBLOCK Sequence block 3 When M1 M2 M3 is from OFF to ON all these blocks will run once 2 The instructions in the block run in sequence according to the scanning time They run one after another when the condition is ON A Without SKIP condition i m MI Y 4 SBLOCK Sequence blockl DPLSR D 0 D2 D4 YO DPLSR D 0 D2 D4 Y1 Inverter Config SBLOCKE n The instructions running sequence in block is shown as below Scanning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5 can ee BLOCK condition is OFF and al the sequence instructions are finished running B With SKIP condition MO YO
52. Coil Count Local Coil Address M100 Remote Station Hum u Select the modbus instructions set the address and com port then software will build an instruction 3 SBLOCK Sequence Black COL Ki KO KA MIOO KZ sBLOCKE AME oou wem O There are two modes to wait A flag bit Wait Config X Skip Comment Wait Contig C E TTE Time lie scil B timer wait Wait Config Skip Comment fait Config CO Wait Coil Flag D 9 Wait T Timer TI Time E100 The ladder chart is as the following BLOCK Sequence Block SBLOCKE 10 3 5 Frequency inverter item a Users only have to set the parameters in below window the PLC will communicate with the frequency inverter Interver Config E E okip Comment pone Confiz Inverter Station Mum i com come cons Control Inverter Action Inverter Status Read Into I User Define C trite Const Value Eun Inching Run leceleratinzg Stop Farward Eun Inching Forward Run Exigent Stop Backward Run Inching Backward Run Inching Stop Error Reset C Write From Rez There are four areas in the window the following will introduce one by one A Inverter station number and serial number Set the station number of the frequency inverter and the PLC serial port Interver Config nterver Lonfig skip Comment Inverter Station Hum
53. D20 ag STLE END Program Explanation When PLC turns from STOP to RUN M8002 gets a scan cycle SO flow open write the master s D10 D14 to slave 2 DIO D14 If the communication is successful it goes to the next flow if not it will try three times then go to the S1 flow It delays for a while then read D15 D19 of station 2 The method is similar to SO flow Then go to S2 flow If the communication is failed set ON M23 Then it goes to S3 flow S3 flow will judge the station no if the no is less than 4 the station no will plus 1 offset value plus 10 if not the station no will start again from 2 Example 2 XINJE PLC writes frequency to two inverters via Modbus Set the first inverter s station no to 1 set the second inverter s station no to 2 store the frequency in D1000 and D2000 Communicate with inverter via serial port M8000 SBLOCK write frequency REGW KI H2001 D1000 K2 REGW K2 H2001 D1000 K2 SBLOCKE Program Description Use BLOCK to make the program The two Modbus instructions will be executed from up to down la 12 3 Free Format Communication Example In this example we use DH107 DH108 series instruments 1 Interface Specifications DH107 DH108 series instruments use asynchronous serial communication interface the interface level fits RS232C or RS485 s
54. D8241 configure item number when XC CAN valid data package number sent both XC CAN and FREE modes are every second valid D8243 data package number both XC CAN and FREE modes are accepted every second valid D8242 mE correspond with M8240 CAN communication error D8244 at every CAN error M8240 will be set counter ON one time D8244 increase 1 Note when D8240 is not zero please try the follow operations 1 Check the wiring 2 Decrease baud rate or increase sending frequency Applications Example 1 instruction communication PLC station 1 and PLC station 2 communicate with each other through CAN instructions Program 1 MO is ON send D100 of PLC station 1 to D20 of PLC station 2 YO and Y2 is ON 2 M4 is ON send D4000 of PLC station 2 to DO of PLC station 1 Ladder chart PLC station 1 Set CAN baud rate 1000K sending frequency 5 CAN station no 1 master station no 1022 Write these parameters in PLC cut off and power on the power again M8002 IN MOV K5 D100 I MO M8013 d CREGWK2 K20 Kl D100 MA N CREGR K2 K4000 KI DO PLC station 2 Set CAN baud rate 1000K sending frequency 5 CAN station no 2 master station no 1022 Write these parameters in PLC and cut off and power on the PLC again M8000 MOV D20 DYO MOV K10 D4000 Example 2 Internal protocol PLC station and statio
55. DO DMOV K2000 D2 DMOV K200 D4 DMOV K3000 D6 DMOV K3000 D8 DMOV K9000 DIO DMOV K800 DI2 DMOV K10600 Dl4 DMOV K100 DI6 DMOV K11400 DIS DMOV K1200 D20 DMOV Kl4400 D22 FMOV KO D24 K4 DMOV K100 D50 MO DPLSA DO D50 YO Y2 M8170 iis y CR 6 2 11 Relative position multi section pulse control PTO 1 Summary Produce relative position multi section pulse as setting parameters Relative position multi section pulse control PTO ists dw ro Execution Edge triggering Suitable XC3 XC5 XCM XCC condition models V3 3 and higher V3 3 and higher 2 Operand Ops Row pe Soft element head address of output pulse 32 bits BIN parameters Pulse output port no Bit Pulse output direction port no Bit 3 Suitable soft element Oper System Const Module and ant SI D m m T x o m ps ka p System PTO instruction has two control modes 32 bits instruction no direction i Nm PTO DO YO with direction EL D u PTO DO YO Y1 Parameters distribution the parameters are 32 bits 2 bytes SI section quantity N range 1 255 3 Sl42 reserved S1 4 pulse direction O is positive direction 1 is negative direction Among each section only one section pulse quantity can be 0 S1 6 pulse falling slope which is decreasing frequency per second 0 m
56. E ca DA TD Cid ca ca ca ab ca qb ca qb ca qb ca QD ca QD ca ca of Port 2 485 1 RS232 Port COMI Pin Definition COM2 Pin Definition 2 PRG 4 RxD 5 TxD 6 VCC 8 GND Mini Din 8 pin female Mini Din 8 pin female Note 1 Port 1 support RS232 2 Port 2 support RS232 RS485 But RS232 and RS485 cannot be used at the same time 3 Port 3 support RS232 RS485 But RS232 and RS485 cannot be used at the same time need to expand XC COM BD 2 RS485 port About RS485 port A is signal B is signal The A B terminals RS485 on XC series PLC is the same port to Port 2 This two ports cannot be used at the same time the same to Port 3 Please use twisted pair cable for RS485 see below diagram But shielded twisted pair cable 1s better and the single ended connect to the ground 3 CAN port CAN port can be applied to CANBUS communication The pin terminals are CAN CAN For the detailed CAN communication functions please refer to chapter 7 4 CAN
57. For Power Off Retentive Use y The auxiliary relays for power off retentive usage even the PLC is OFF they can keep the ON OFF status before power OFF y Power off retentive zone can be modified by the user y Power off retentive relays are usually used to memory the status before stop the power then when power the PLC on again the status can run again ForSpecial Usage y Special relays refer some relays which are defined with special meanings or functions start from M8000 y There are two types of usages for special relays one type is used to drive the coil the other type is used to the specified execution E g M8002 is the initial pulse activates only at the moment of start M8033 is all output disabled y Special auxiliary relays can t be used as normal relay M XC series PLC s status relays S are addressed in form of decimal each Address L ist l l subfamily s ID are listed below RANGE SERIES NAME FOR COMMON USE FOR POWER OFF RETENTIVE USE RANGE SERIES NAME FOR COMMON USE FOR POWER OFF RETENTIVE USE a Ss S000 8511 512 81023 RANGE SERIES NAME FOR COMMON USE FOR POWER OFF RETENTIVE USE eran S000 8511 512 81023 RANGE SERIES NAME FOR COMMON USE FOR POWER OFF RETENTIVE USE es Ss S000 8511 512 81023 RANGE SERIES NAME FOR COMMON USE FOR POWER OFF RETENTIVE USE JXM S S000 8511 512 81023 Status relays are very import in ladder program usually use them with Pune instruction STL
58. Increment Mode Pulse Direction Mode and AB phase Mode ncrement M ode Under this mode count and input the pulse signal the count value increase at each pulse s rising edge count imput i counter s current value Pulse Direction M ode Under this mode the pulse signal and direction signal are all inputted the count value increase or decrease with the direction signal s status When the count signal is OFF the count input s rising edge carry on plus count When the count signal is ON the count input s rising edge carry on minus count Hes E a gn ia E S see eee eases count direction f counter s current value U AB Phase M ode Under this mode the HSC value increase or decrease according to two differential signal A phase and B phase According to the multiplication we have 1 time frequency and 4 time frequency two modes but the default count mode is 4 time mode time frequency and 4 time frequency modes are shown below 1 time Frequency PIECE o Horreur EST B phase imput f i current m counter s value 4 timeFrequency counter s current value L Jd 0 da BB PY i2 if al 5 3 HSC Range HSC s count range is K 2 147 483 648 K 2 147 483 647 If the count value overflows this range then up flow or down flow appears For up flow it means the count value jumps from K 2 147 483 647 to be K 2 147 483 648 then continue to count F
59. KI K1 SBGOON K1 K1 MO SBLOCK Sequence Glocki DSPLSR DO D2 D4 YO SBLOCKE SBGOON Scanning periodl Scanning period 3 Scanning period 2 Scanning period 4 Scanning period d i i When MO is from OFF ON run DSPLSR DO D2 D4 YO in the BLOCK to output the pulse when M2 is from OFF ON the BLOCK stops running pulse outputting stops at once when M4 is from OFF ON abandon the rest pulse 2 SBSTOP K1 K1 SBGOON K1 KO MO SBLOCK Sequence Block1 DSPLSR DO D2 D4 YO SBLOCKE M2 M4 SBGOON canning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5 When MO is from OFF gt ON run DSPLSR DO D2 D4 YO in the BLOCK to output the pulse when M2 is from OFF ON the BLOCK stops running the pulse outputting stops at once when M4 is from OFF ON output the rest pulses 3 SBSTOP KI KO SBGOON KI K1 MOD SBLOCK Sequence Black1 DSPLSR DO D2 D4 YO SBLOCKE M1 SBSTOP MA SBGOQON canning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5 When MO is from OFF gt ON run DSPLSR DO D2 D4 YO in the BLOCK to output the pulse when M1 is from OFF ON stop the BLOCK the pulse will stop slowly with slope when M4 is from OFF ON abandon the rest pulses 4 SBSTOP K1 K0 SBGOON K1 KO MO SBLOCK Sequence Black1 DSPLSR DO D2 D4 YO SBLOCKE SBSTOP SBGOU
60. M10 M120 Zone set unit M10 M120 e Are specified as the same type of soft units and e When py pa will not run Zone set set M8004 M8067 and D8067 2 4 applied instructions 4 5 9 Zone reset ZRST 1 Summary Reset the soft element in the certain range Multi reset ZRST Execution Normally ON OFF Suitable Hardware Software 2 Operands Start address of soft element Bit 16 bits BIN End address of soft element Bit 16 bits BIN 3 Suitable soft components pjm m m ox by m os ku D Operands ZRST M500 M559 Zone reset bits M5 00 M559 D100 ZRST DO Zone reset words DO D100 Are specified as the same type of soft units and SS e When pr gt pa only reset the soft unit specified In pr and set M8004 M8067 D8067 2 As soft unit s separate reset instruction RST instruction can be used to bit unit Y M S and word unit T C D As fill move for constant KO 0 can be written into DX DY DM DS T C D 4 applied instructions 4 5 10 Swap the high and low byte SWAP 1 Summary Swap the high and low byte High and low byte swap SWAP Dew Jwe oo mw Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition Models Hardware Software requirement requirement 2 Operands The address of the soft element 16 bits BIN 3 Suitable soft components Tw e pw e w
61. PA 7 H H 7 PA Ed i 5 I d d Ed 127 i 7 i i r E F Ed I p V ouf y E P i p bo KA E 27 7 ls E d s r 7 r 7 7 7 a i A P4 7 i 7 i P 7 1 i P P b i i 5 7 7 a a i A Cd i 7 n 1 iL 7 Pd P d d l a ad I d d 7 7 b 2 7 a y Ka Pi p A p P Pen I E Ed 7 7 rad P a i 7 d vie E 7 P4 7 P Ka 2 M p en 7 1 7 7 yr 7 a E Ed 7 f PA L P4 7 fi A P 2 2 A t i a 7 ee 2t Pd i 1 La x I 7 4 oy 1 r P P4 rd wil I Nd 7 z 4 4 V z 4 I r i 2 Ie p y r4 I 7 E 4 f d d 7 i s p b p I 44 f F i jd E B F P m 2 7 gt a4 z 4 IE e 7 7 Ed 5 6 2 12 Absolute position multi section pulse control PTOA 1 Summary Section to produce pulse instructions of absolute position according to specified parameters Absolute position multi section pulse control PTOA 16 bits 32 bits PTOA Instruction Instruction ERN Execution Edge triggering suitable XC3 XC5 XCM XCC condition Models Hardware V3 3 and higher version Software V3 3 and higher version requireme requirement nt 2 Operands S1 Specify the soft component s start ID of the output 32bits BIN pulse parameters Bit Specify the pulse output direction port Bit 3 Suitable soft components
62. PLC connects 3 inverters PLC needs to write and read the parameters of inverter The inverter station no is 1 2 3 So the remote communication station no is 1 2 3 2 Remote register coil quantity For example PLC read inverter frequency H2103 output current H2104 and bus voltage H2105 So the remote register first address is H2103 quantity is K3 3 registers 3 Local coil register address For example local coil is MO write the MO state to remote coil Local register 1s DO write the DO value to remote register 1 Instruction Summary Read the specified station s specified coil status to the local PLC Coil read COLR 16 bits COLR 32 bits FN Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC Hardware Software 2 Operands Function Type Specify the remote communication station 16bits BIN Specify the remote coil first address 16bits BIN Specify the local coil first address bit Specify the serial port no 16bits BIN Specify the coil quantity L6bits BIN 3 suitable soft components Operands Operands c CONGR L E K500 K3 MI K2 COLR Read coil instruction Modbus function code is 01H Serial Port K1 K3 Operand S3 K1 K984 the max coil quantity is 984 1 Instruction Read the specified station s specified input coils into local couls Input coil read INPR 16 bits INPR 32 bits instruction inn RN
63. SBLOCKE 4 The SKIP condition only can use M X can not use other coil or register SBLOCK Sequence block1 SBLOCK Sequence block1 DPLSR DO D2 D4 YO DPLSR DO D2 D4 YO M2 D10 DPLSR DO D2 D4 Y1 DPLSR DO D2 D4 Y1 SBLOCKE SBLOCKE 5 The output instructions can not be HSC PLSF PWM FROM YES 4 MO SBLOCK Sequence block1 HSCR C600 DO PLSF DO YO E M PWM K100 DO Y1 SBLOCKE 6 LabelKind type can not be used in the block Sign P I can not be used in block Even they can be added in block but they do not work in fact 7 BLOCK is not recommended to put in the STL Because if one STL ends but the BLOCK doesn t end big problem will happen STL SO M8000 SBLOCK read slave station SBLOCK read slave station REGR K2 KO K1 D100 K2 REGR K2 KO K1 D100 REGR K3 KO K1 D101 K2 KO K1 DIOL REGR K4 KO K1 D102 K2 REGR K4 KO KI D102 SBLOCKE SBLOCKE STL SO M100 YO M100 i 10 6 BLOCK related instructions E 10 6 1 Instruction explanation H Summarization Stop the instructions running in the block SBSTOP Condition NO NC coil and pulse edge Suitable types XCI
64. X4 32bits value X004 is ON C300 starts to count Con gt Oo NO ey un C c E C e T e C E j 0 C e lt AS C If X003 is ON reset the counter and C300 output If use retentive counter the count value will be stored in PLC 32 bits counter can be used as 32 bits register Set the count It includes 16 bits and 32 bits count value value u 16 bits counter set as constant KT set in D register X000 X001 MOV KIO DS C co D K100 X001 u 32 bits counter set as constant K set in D register X001 X000 f C300 K43 100 DMOV K43 100 DO X001 C300 DOD DI Count value C0 C299 are 16 bits linear increase counter 0 32767 when the counter value reaches 32767 it will stop count and keep the state C300 C599 are 32 bits linear increase decrease counter 2147483648 2 147483647 when the counter value reaches 2147483647 it will become 2147483648 when the counter value reaches 2147483648 it will become 2147483647 the counter state will change as the count value 2 9 Data register D XC series PLC data register D address is shown as below Address list RANGE NAME FOR COMMON FOR POWER OFF FOR SPECIAL USE USE RETENTIVE USE D8000 D8029 D8060 D8079 D8120 D8179 DO D99 D100 D149 138 D8240 D8249 D8306 D8313 D8460 D8469 XCI X
65. XC2 XC3 XC5 XCM XCC masae see SOS 2 Operand The number of the BLOCK 16 bits BIN The mode to stop the BLOCK 16 bits BIN 3 Suitable component Operand Register m a ej p pn ry j 9 1l TK f SBSTOP Kl KO e S2 is the mode to stop BLOCK operand KO K1 KO stop the BLOCK slowly if the pulse is outputting the BLOCK will stop after the pulse outputting is finished K1 stop the BLOCK immediately stop all the instructions running in the BLOCK R Execute SDSII OP frequency id Kie KO 1 Summarization This instruction is opposite to BSTOP To continue running the BLOCK SBGOON Pulse edge Suitable types XCl XC2 XC3 XC5 XCM XCC Eme The number of the BLOCK 16 bits BIN The mode to continue running the BLOCK 16 bits BIN Ji SBGOON K1 KO e S2 is the mode to continue running the BLOCK Operand KO Kl KO continue running the instructions in the BLOCK For example if pulse outputting stopped last time SBGOON will continue outputting the rest pulse K1 continue running the BLOCK but abandon the instructions have not finished last time Such as the pulse output instruction if the pulse has not finished last time SBGOON will not continue outputting this pulse but go to the next instruction in the BLOCK 10 6 2 The timing sequence of the instructions a 1 SBSTOP
66. address of ID filter codes the instruction specifies two groups of filter codes occupy D30 D37 Filter Memory Description Example Code Th e D31 D30 D30 low bytes D31 high D3020xFFFH D31 0x0000 then first bytes they compose a 32 bits the mask code is 0x0000FFFF group mask code D30 0x1234 D31 0x0000 then D33 D32 D32 low bytes D33 high filter value is 0x00001234 bytes they compose a 32 bits If ID and 0x0000FFFF equals filter value 0x00001234 the pass the first D35 D34 D34 low bytes D35 high group of filter If the ID pass any of bytes they compose a 32 bits two groups the allow the reception mask code D37 D36 D36 low bytes D37 high bytes they compose a 32 bits filter value Standard expansion frame the setting of FD8358 has no effect to reception If the data frame fulfills ID mask codes the standard frame and the expansion frames can be all received When receive the standard frame the ID bits is 11 but will still occupy the 32 bits memory combined by D1 D0 Sbits data transfer the transfer data is DOL DIL D2L D3L DOL means the low byte of DO 16 bits data transfer the transfer data is DOL DOH DIL DIH DOH means the high byte of DO 1 System FD8000 Setting 0 not usable FD8350 CAN Mode 1 XC CAN network 2 Free format FREE 0 IKBPS initial value actual is SKBPS 1 2KBPS initial value actual is SKBPS 2 SKBPS initial value 3 J
67. and cumulative pulses are not refreshed Current pulse frequency is a target for every scanning period Vi Slope K ph Slope K Slope K CA The increasing pulses are 0 in unit time S1 2 0 Pulse frequency will change as the slope K V1 V Ja B The increase frequency quantity in unit time is not O he parameter of S1 2 is not 0 1 The pulse is in a smooth section when user set a new frequency then the frequency will change to setting frequency through with the setting slope please see the following diagram V0 Target frequency VI Target frequency 0 Target frequency VO 2 The pulse is in non smooth section when user set a new frequency then the frequency will change to setting frequency with setting slope current setting frequency gt last setting frequency current setting frequency will be the target please see the following diagram GE Seek os V 2 V 2a Target frequency Vi ina EE v2 Target frequency 0 Target frequency 0 Before the frequency reaches VO user set the new target frequency V1 V1 gt V0O then the frequency will turn to V1 according to the slope 3 The pulse is in non smooth section when user set the new frequency then change to setting frequency with the setting slope Current setting frequency lt last setting frequency current setting frequency lt current frequency please see the following diagram DENIS V0 Acer
68. applied instructions Hardware Software requirement requirement 2 Operands SI Specify the Data to be compared or soft 16 32 bit BIN umi component s address code S2 Specify the comparand s value or soft 16 32 bit BIN d component s address code condition 3 suitable soft components Tw e w e ww lo oan o ao s 114114111 L1 s l ild eidelideli ll OR K100 CO M50 DOR gt D10 K68899 4 applied instructions When the source data s highest bit 16 bits b15 32 bits b31 1s 1 use the data as a negative The comparison of 32 bits counter C300 must be 32 bits instruction If assigned as a 16 bits instruction it will lead the program error or operation error 4 5 Data Move C Data zone compare 4 5 2 P P SWAP The high and low byte of the destinated devices are exchanged 4 5 10 4 applied instructions 4 5 1 Data Compare CMP 1 Summary Compare the two specified Data output the result Data compare CMP Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM condition ae a Hardware Software 2 Operands Function Data Type Specify the data to be compared or soft 16 bit BIN mersa MN Specify the comparand s value or soft 16 bit BIN component s address code Specify the compare result s address code bit 3 Suitable soft component
69. be changed to Dword The final result is stored in D22 D23 Method 2 use C language Ladder chart C program 5 void RESULT WORD W BIT B 108 4 11 long int a b c d 12 bzW 1 13 ce W 2 14 d W 3 15 a h c c b er c 3 d 18 DW 4 7a 17 I RESULT Function name DO In the function W 0 ZDO W 1 D1 If S2 D32 then W 0 ZD32 W 1 D33 MO In the function B O MO B 1 2MI If S2 M32 then B 0 2M32 B 1 2M33 Method 2 can simplify the program The C function is the same to ladder chart of method 1 The precision is not high If it needs to get the high precision please use float calculation Example 2 calculate CRC parity value via Func Block CRC calculation rules 1 Set 16 bits register CRC register FFFF H 2 XOR Exclusive OR 8 bits information with the low byte of the 16 bits CRC register 3 Right shift 1 bit of CRC register fill O in the highest bit 4 Check the right shifted value if it is O save the new value from step3 into CRC register if it is not 0 XOR the CRC register value with A001 H and save the result into the CRC register 5 Repeat step3 amp 4 until all the 8 bits have been calculated 6 Repeat step2 5 then calculate the next 8 bits information Until all the information has been calculated the result will be the CRC parity code in CRC register Edit C language Function Block program see graph below E void CRC CHECK WORD W
70. definite value PV outputvalue MV will dr GERENS nol also increase It s usually used in cool control Overshoot Config Enable Overshoot Disable Overshoot Hold Mem Register Cant Read Paramter Range D4000 D4043 1 y g Suggestion value Read From PLC Write To PLC Cancel V3 3f and higher version software can choose auto tune mode step response or critical oscillation 8 3 1 Registers and their functions T For PID control instruction s relative parameters ID please refer to the below table sampling time 32 bits without sign sampling time 32 bits without sign mode setting bitO 0 Negative action 1 positive action bitl bit not usable bit7 0 Manual PID 1 auto tune PID bit8 1 auto tune successful flag bit9 bit10 auto tune method 00 step response 01 critical oscillation Bitll bit12 not use Bit13 bit14 auto tune PID mode valid in critical oscillation mode 00 PID control 01 PI control 10 P control bit15 0 regular mode 1 advanced mode 343 Proportion Gain Kp Range 1 32767 S344 Integration time TI 0 32767 100ms 0 1s taken as no integral 345 Differential time TD 0 32767 10ms S346 PID operation zone 0 327671 S347 control death zone O 32767 PID value keeps constant in death zone S348 PID auto tune cycle full scale AD value 0 3 1 340 PID auto tune 0 enable overshoot valid when using step 0 1s taken as no differ
71. element address need to subtract Soft element address need to subtract 3 Suitable soft components p m m m ox by pu ms ku p m a ee 21 m m dg gj Dele peglweie a j E II Egg ee 4 o GO k ESUB D10 D20 D50 D11 D10 D21 D20 gt D51 D50 Binary Floating Binary Floating Binary Floating The floating point value of S2 is subtracted from the floating point value of S1 and the result stored in destination device D Jfa constant K or H used as source data the value is converted to floating point before the addition operation XI k ESUB K1234 D100 D110 K1234 D101 D100 D111 D110 Binary converts to Floating Binary Floating Binary Floating The same device may be used as a source and as the destination If this is the case then on continuous operation of the EADD instruction the result of the previous operation will be used as a new source value and a new result calculated This will happen every program scan unless the pulse modifier or an interlock program is used 4 applied instructions 4 9 5 Float Mul EMUL 1 Summary Float Multiply EMUL Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands p Resuitaddress SS XB 3 Suitable soft components o GO EMUL D10 D20 D50 DII DIO X D21 D20 gt D51 D50 Bi
72. flow program bus line management could only be used in the same flow When end some flow it must go back to the main bus line XI x2 LD Xl Program MCS Bus line starts MI M3 I I C YDH LD X2 M2 OUT YO i Cv 0 LD MI MCS Bus line nest LD M3 OUT Y1 LD M2 OUT Y2 MCR MCR Bus line back Mnemonic and Function Mnemonic Function Format and Devices ALT The status of the Alternate assigned devices status inverted on every operation of the Devices YO MU SO TO CO Dn m instruction The status of the destination device is alternated on every operation of the Statements ALT instruction p MN ALT MO a e rogram i ALT M0 MO x C XU oe OUT YO Lan m OUT YI i 3 11 PLS PLF M nemonic and Function Mnemonic Function Format and Devices PLS Rising Pulse pulse PLF Falling trailing Pulse edge pulse Falling Devices YU MI SU TU CL Dn m Statements When a PLS instruction is executed object devices Y and M operate for one operation cycle after the drive input signal has turned ON When a PLF instruction is executed object devices Y and M operate for one operation cycle after the drive input signal has turned OFF LD XO T PLS MO Program den S SET YO me SET YO E E RTL PTUS eee ae eS PLF MI LD Xl
73. frequency testing precise time PID control position control etc for interruption high speed counter HSC C Language Function Block XC series PLC support C language function block users can call the edited function block freely This function reduces the program quantity greatly Stop when power ON Function XC series PLC support Stop when power on PLC function With this function when there is a serious problem during PLC running use this method to stop all output immediately Besides with this method connect PLC when parameters are set wrongly Communication Function XC series PLC support many communication formats like basic Modbus communication CABBUS communication free format communication Besides via special network module connect to Ether net GPRS net 1 2 Program Language E XC series PLC support two types of program language Instruction List Instruction list inputs in the form of LD AND OUT etc This is the basic input form of the programs but it s hard to read and understand E g Step Instruction Soft Components 0 LD X000 1 OR Y005 2 ANI X002 3 OUT Y005 Ladder With sequential control signal and soft components draw the sequential control graph on program interface this method is called Ladder This method use coil signs etc to represent sequential circuit so it s easier to understand the program Meantime monitor PLC with the circuit s st
74. function directly Calculation area of a circle TEC Circumference calculation TCRC CRC Check TDSL Input data short from big to small order TDSS Input data short from small to large order TECA Calculation area of a circle TECC Circumference calculation TEEX Exponentiation calculation TEL1U Matural logarithm TELO Matural logarithm TEPTH Known two right angle sides and the hypotenuse demanded TEPTR Known one right angle side and hypotenuse need to demand the other right angle side TEQE Quadratic equation float TESUM Sum of memory 32 bit floating data TETP The product of memory data float TEUE Quadratic equation float TEX Exponentiation calculation TFA Factorial solving THF Inverse trigonometric functions TQE Quadratic equation short TSUM Sum of memory 32 bit integer data TETEE ip TTP The product of memory data short TUE Quadratic equation short For example click TEL10 the function name will show on the project bar Project i3 Project Ha mci E Li Code zu Ladder i Instruction List P ii Config Block bee A Sequence Block User can call it in the ladder chart editing window i 9 8 Function Table The default function library _LOG2 _PI _LOG2 double 0 693147180559945309417232121458 Logarithm of 2 LOGIO double 2 3025850929940459010936137929093 Logarithm of 10 double 1 41421356237309504880168872421 Radical of 2 _PI_ double 3 1415926535897932384626433832795 P double
75. i Target frequency V2 Target frequency Target fr i aaa Vee V Target frequency Before the frequency reaches VO user set the new target frequency VI VI VO V current frequency it will go to the decreasing section until V1 the slope is the same to the increasing section a 6 3 Output Wiring YO YI Y2 COMO COMI COM2 QO Output port YO Pulse output port 0 single phase Output port Y 1 Pulse output port 1 single phase Below is the graph to show the output terminals and stepping driver wiring PLC side Stepping driver side Yo i A A CONO i 24 I PU S E Yl t s A A Dr fa con I HAV amp V 1 Concept of Step Frequency output YU or Y1 N steps speed each step Sms During ACC DEC each step time is 5ms this time is fixed and not changeable The minimum step frequency each step s rising falling time is 10Hz If the frequency is lower than 10Hz calculate as 10Hz the maxi
76. i WSFR D nm WSFR Word shift right 4 7 7 Data Convert Single word integer converts WTD ihi LA H wD S D 4 8 1 to double word integer 16 bits integer converts to FLT Ps een FT SD 4 8 2 float point 32 bits integer converts to DFLT Ga Der 28 LD 4 8 2 float point 64 bits integer converts to FLTD BS i FLTD S D 4 8 2 float point Float point converts to integer INT S D 4 8 3 BCD converts to binary 4 BIN S D 4 8 4 Binary converts to BCD I BCD S D 4 8 5 Hex converts to ASCII ASCI S D n 4 8 6 ASCII converts to Hex HEX xS D n 4 8 7 High bit coding IX ENCO S D n 4 8 9 ENCOL Low bit coding ma ENCOL QU UO 5 4 8 10 Float Point Operation ECMP EZCP Float compare Float Zone compare ECMP S1 S2 EZCP S1 S2 D1 D2 4 9 1 4 9 2 4 applied instructions woe m omm CNNITTM wo Float division C me Clock Operation Read RTC data Write RTC data 4 applied instructions 4 2 Reading Method of Applied Instructions In this manual the applied instructions are described in the following manner Su
77. in current position registers D8171 D8170 YO D8174 D8173 Y1 The Y port to output the pulse direction can be set freely Note when PLSA and DPLSA has several segments the direction of these segments must be the same M0 segment 1 segment 2 segment 3 absolute absolute position D3 absolute position D1 position D5 frequency DO frequency D4 frequency D2 M8170 Output 6 segments of pulse through instruction DPLSA The pulse terminal is YO direction terminal is Y2 Frequency Hz Absolution position Use 32 bits instruction DPLSA Name Frequency Frequency address Absolution Absolution position Hz Dword position Dword 1000 D1 DO 2000 D3 D2 200 D5 D4 3000 D7 D6 3000 D9 D8 9000 D11 DIO 800 D13 D12 10600 D15 D14 100 D17 D16 11400 D19 D18 1200 D21 D20 14400 D23 D22 Acceleration 100ms D51 DO deceleration time Note the 4 registers after segment 6 must be 0 D27 D26 D25 D24 It means the pulse output end For 16 bits instruction PLSA the 2 registers after segment 6 must be 0 F Hz 3000 1200 1000 f 800 200 100 i gt 0 2000 3000 9000 10600 11400 14400 Program Ms 002 DMOV K1000
78. instruction 2 11 PROGRAM PRINCIPLE TagP I Tag P I are used in branch division and interruption Tag for branch P is used in condition jump or subroutine s jump target Tag for interruption I is used to specify the e input interruption time interruption The tags P I are both in decimal form each coding principle is listed below SERIES NAME RANGE XC10 XC20 XC30 xcs XCM P P0 P9999 RANGE FOR EXTERNAL INTERRUPTION SERIES NAME Falling For time interruption 10000 10001 There are 10 channels time interruption XC2 I 10100 10101 the represent method is 40 49 represents interruption time the unit 10200 10201 is mm RAN P RANGE FOR EXTERNAL INTERRUPTI SERIESINAME I O 3 URMON l Falling For time interruption Input terminals a x woo mor TIEGEI There are 10 channels time interruption the represent method is 40 49 m Ex represents interruption time the PETET A be RANGE FOR EXTERNAL SERIESINAME I O ERRU ON Falling For time interruption Input terminals X2 1000 10001 a 5 mm 10101 32 I0200 I0201 There are 10 channels time interruption X11 10300 10301 the represent method is 40 I49 xcs Xu 10900 10301 the rep represents interruption time the unit is mm i Falling For time interruption Input terminals RANGE FOR EXTERNAL INTERRUPTION SERIESINAME I O XCM I 24 10000 10001 There are 10 ch
79. is YO Y1l e Frequency range 0 32767Hz 16 bits instruction 0 200KHz 32 bits instruction Pulse number range K0 K32 767 16 bits instruction KO K2 147 483 647 32 bits instruction Confirm the D8173 Y1 value in current position registers D8171 DS8170 YO D8174 Note if the segment quantity is n the address of the segments must be continuous and the pulse frequency and quantity of n l segment must be 0 It means the pulse output end The address of acceleration deceleration time cannot follow the segment n Output 6 segments of pulse through instruction DPLSA YO is pulse output terminal IEEE Absolutionipostnon Segment 3 Segment 4 Segment 5 Segment 6 Use 32 bits instruction DPLSA Name Frequency Absolution Hz address Dword position D1 DO Frequency Absolution position address Dword Segment 1 D3 D2 Segment 2 D5 D4 D7 D6 Segment 3 D9 D D11 DIO Segment 4 D13 D12 D15 D14 Segment 5 D17 D16 D19 D18 Segment 6 D21 D20 D23 D22 Acceleration deceleration time Note the 4 registers after segment 6 must be 0 D27 D26 D25 D24 It means the pulse output end For 16 bits instruction PLSA 2 registers after segment 6 must be 0 F Hz 3000 1200 1000 f 800 200 100 A 0 2000 3000 11400 14400 Program
80. is editable b Not editable don t export the source code if import the file it s not editable 2 Import Function Import the exist Func Block file to use in the PLC program E Project 23 PL1 ESL Code L5 Ladder Id Instruction List Func I Add New Func Block L Confi E Reg Comal Import Fune Block From Disk E Free Monitor EX Data Monitor al Set Reg Init Value B d PLC Config sx Password Serial Port Bo BD caN CAN yn Save Hold Memory O00 Module re 1 0 9 PLC Information Q5 PLC CPU Information i BD Information foo Expansion Information gt Scan Cycle ud Instruction Class ud Project Choose the Func Block right click Import Func Block From Disk choose the correct file then click OK li 9 5 Edit the Func Blocks Example Add DO and D1 in PLC s registers then assign the value to D2 1 In Project toolbar new create a Func Block here we name the Func Block as ADD 2 then edit C language program 2 Click compile after edition PLC1 Ladder FmncBlock AnDnD 1 Information Export Compile qe ELE e FunctionBlockHame ADD 1 3 Version ae ss Cl 4 Author 5 UpdateTime 2Q08 6 6 8 86 36 6 Comment 7 WwW E2 wWw Eo 7 Ei g8 WOWch ch ch ch ch A oW M Ach ch ch ck NON Nh ho e CN NC hh e CN ch c e e NON ON a e e CN ON ON a d e CN CN C e CN A e A e e e J void ADD 1 WORD W BIT E iB i 11 W 2 wW 0 W 1 12 i ia lt Information paee
81. none parallel circuits To declare the starting point of the circuit block use a LD or LDI Statements instruction After completing the parallel circuit block connect it to the preceding block in series using the ANB instruction It is possible to use as many ANB instructions as necessary to connect a number of parallel circuit blocks to the preceding block in series Program circuit bk instruction before AHB OR instruction after ANB LD OR LD AND LDI AND ORB OR ANB OR OUT XO XI X2 Start of a branch X3 X4 X5 mi End of a parallel circuit block X6 X7 Serial connect with the preceding circuit Y20 3 97 IMCS MCR M nemonic and Function Mnemonic Function Format and Devices MCS Denotes the Master start of a control master control block MCR Denotes the Master end of a master control control block Reset Devices None After the execution of an MCS instruction the bus lin LD LDI shifts Statements to a point after the MCS instruction An MCR instruction returns this to the original bus line MCS MCR instructions should use in pair The bus line could be used nesting Between the matched MCS MCR instructions use matched MCS MCR instructions The nest level increase with the using of MCS instruction The max nest level is 10 When executing MCR instruction go back to the upper bus line When use
82. the default value is 1 The set value s unit is ms represents send every ms Configured sending if set to be O it means send every cycle the default value is frequency 5ms Read bit number Read word number write bit number write word number Remote station address Remote object address l The item 1 configuration Local object address Quantity Remote node s ID Remote node s object ID Local object s ID Number The item 256 configuration CAN self check Set 1 if error set O if M8240 error flag correct Error flag of CAN Set 1 if error set O if M8241 configure correct Automatically recover the control after CAN bus error FD8351 Baud Rate value M 100K If set to be 1 then recover after error happens If set to be 1 then CAN stops working after error happens The default value 1s 1 this flag is not power off retentive 0 no error 2 initialize error CAN error information 30 bus error 31 error alarm 32 data overflow Show the first number of error The configure item no which has error configure item Data package quantity sent every second Data package quantity received every second 7 4 6 CAN Free Format Communication I Please set FD8350 to 2 for CAN free format communication 1 Instructions Summary Write the specified data from the unit to a specified address data transfer in one unit
83. the pulse output end for 16 bits instruction D25 D24 must be 0 M8002 DMOV K1000 DO DMOV K2000 D2 DMOV K200 D4 DMOV K1000 D6 DMOV K3000 D8 DMOV K6000 D10 DMOV K800 D12 DMOV K1600 D14 DMOV K100 D16 DMOV K800 DIS DMOV K1200 D20 DMOV K3000 D22 FMOV KO D23 K4 DMOV K100 D50 MO DPLSR DO D50 YO Y2 M8170 iG i CR 2 1 Instruction Summary Enter the next segment of pulse output Pulse segment switch PLSNEXT PLSNT 16 bits PLSNEXT PLSNT 32 bits Execution Rising falling edge suitable XC2 XC3 XC5 XCM XCC Hardware Software requirement requirement 2 Operands Operands Function Type Specify the pulse output port Bit 3 suitable soft components operands 16 bit instruction form PLSR DO D100 YO M1 AC li PLSNEXT YO If the pulse output reaches the highest frequency at the current segment and output steadily at this frequency when M1 changes from OFF to ON then enter the next pulse output with the acceleration deceleration time this instruction is suitable for multi segment pulse output e Run the instruction within the acceleration deceleration time is invalid Instruction PLSNT is the same to PLSNEXT
84. user again System s Soft SET R etentive FUNCTION default components AREA A Zone D FD8202 Start tag of D power off retentive zone D100 D149 Start tag of M power off retentive M FD8203 200 M200 M319 XCl zone Series D F0s202 Str tag of D power off retentive zone 4000 DA000 D4999 Start tag of M power off retentive M FD8203 3000 M3000 M7999 XC2 zone L p rbso Sar tag of power off retentive zone 4000 D4000 D7005 Start tag of M power off retentive M FD8203 3000 M3000 M7999 zone XC3 FD8204 Start tag of T power off retentive zone Series FD8205 Start tag of C power off retentive zone C320 C639 FD8206 Start tag of S power off retentive zone S 512 S1023 Start tag of ED power off retentive ED FD8207 EDO ED 16383 zone D FD8202 Start tag of D power off retentive zone 4000 D4000 D7999 Start tag of M power off retentive M FD8203 4000 M4000 M7999 zone XC5 FD8204 Start tag of T power off retentive zone Series FD8205 Start tag of C power off retentive zone C320 C639 FD8206 Start tag of S power off retentive zone 512 S1023 Start tag of ED power off retentive ED FD8207 EDO ED36863 zone XCM D FD8202 Start tag of D power off retentive zone 4000 D4000 D4999 Series Start tag of M power off retentive M FD8203 3000 M3000 M7999 zone FD8204 Start tag of T power off retentive zone FD8205 Start tag of C power off retentive zone C320 C639 p FD8206 Start tag of S power off ret
85. via PLC thereby control the motor Meantime via the feedback signal from encoder control the knit weaving machine and realize the precise position AB phase HSC input PLC forward backward control speed 1 control ee signal V5 series inverter control Knit weaving machine C630 K15000 K15000 12503 C630 K90000 K75000 C630 K75000 K15000 12501 C630 K0 K75000 high speed IUN tow speed high speed run low speed pulse forward run forward backward dice frequency f F i forward backward Below is PLC program Y2 represents forward output signal Y3 represents backward output signal Y4 represents output signal of speed 1 C340 Back forth times accumulation counter C630 AB phase HSC M8000 M8285 S Y2 S Y2 f OUT C340 K1000000 M8000 DMOV K75000 D4000 DMOV K15000 D4002 DMOV K 75000 D4004 DMOV K 15000 D4006 M8000 OUT C630 K30000000 D4000 M8000 T HSCR C630 D200 FEND 12501 M8000 Y4 S IRET 12502 M8000 Y4 R Y2 R Y3 S IRET 12503 M8000 Y4 S IRET 12504 M8000 Y3 R Y4 R 4 Y2 S IRET Instruction List Form
86. 0 0 1 0 0 1 1 0 0 0 0 41H A 30H 0 D201 0 1 0 0 0 0 1 1 0 1 0 1 0 0 1 0 43H C 42H B D100 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 ww qd dp 3 4 4 8 8 Coding DECO l Summary Transform the ASCII code to Hex numbers Coding DECO Execution Normally ON OFF Suitable condition rising falling edge Hardware Software 2 Operands S Source soft element address ASCII Target soft element address 2 bits HEX The coding soft element quantity I6bits BIN 2 Suitable soft components 4 applied instructions Meee eee ere s p eE eee LI OO e LI Operands chen 9 situate 16 oxi e n DECO DXO0 MIO K3 X002 X001 X000 0 1 4 2 QD NL pz 7 6 5 4 2 l 0 0 0 0 0 I 0 0 0 M17 Ml6 MI5 M14 M13 M12 Mil MIO The source address is 1 2 3 so starts from MIO the number 3 bit M13 is 1 If the source are all 0 M10 is 1 When n 0 no operation beyond n 0 16 don t execute the instruction When n 16 if coding command is soft unit it s point is 2 16 65536 When drive input is OFF instructions are not executed the activate coding output keep on activate C n DO DI K3 X0 DECO bls DO hi il 0j0j0 0 0 0 0 0j0 0 0 0 0 0 1 1 4 Qe All turns to be zero nn a G 6 WS 4 Sk 1 d o0
87. 0 100000 it means assignment to the double word W 10 WTI11 Floating Operation Support the definition of floating variable in the function and execute floating operation Function Library In Func Block users can use the Functions and Variables in function library directly For the Functions and Variables in function library see the list in Appendix The other data type supported BOOL BOOL Quantity INTSU 8 bits unsigned integral INTSS 8 bits signed integral INT16U 16 bits unsigned integral INT16S 8 bits signed integral INT32U 32 bits unsigned integral INT32S 32 bits signed integral EP32 Single precision Floating FP64 Doubleprecision Floating Predefined Marco define true l define false 0 define TRUE l define FALSE 0 9 4 Import and Export the Functions 1 Export 1 Function export the function as the file then other PLC program can import to use i Project Ha PLCI B J Code LEJ Ladder ld Instruction List z S Fune Black L ali Remove Func Block From Project grum Edit Func Block Name FUNCi Version 1 0 0 ER Free Monitor Data Monitor zl Set Reg Init value Lg PLC Config jee Password f Serial Port BD BD pi CAN yn Save Hold Memory Dp Module Author Date 2009 6A 6A 2 Export Format a Editable export the source codes out and save as a file If import again the file
88. 03 changes the pulse frequency from YO changes FRQM K20 DO KI X003 PLSF DO YO i 6 6 Relative coils and registers of pulse output Some flags of pulse output are listed below Pulse TD M8170 PULSE_1 sending pulse flag Being ON when sending the pulse overflow flag of 32 bits pulse M8171 A When overflow Flag is on sending ID mE 1 is positive direction the correspond nue Erasure direction port is on M8173 PULSE_2 sending pulse flag Being ON when sending the pulse overflow flag of 32 bits pulse dk When overflow Flag is on sending E 1 is positive direction the correspond M8175 Direction flag direction port is on M8174 M8176 PULSE_3 sending pulse flag Being ON when sending the pulse overflow flag of 32 bits pulse P When overflow Flag is on sending mE is positive direction the correspond M8178 Direction flag Te direction port is on M8179 PULSE 4 sending pulse flag Being ON when sending the pulse overflow flag of 32 bits pulse M8180 TUM When overflow Flag is on sending is positive direction the correspond M8177 M8181 Direction flag direction port is on Pulse alarm flag frequency M8210 PULSE_1 change suddenly 1 is alarm 0 is correct M8211 Neglect the alarm or not When flag is 1 stop sending alarm Pulse alarm flag frequency M8212 PULSE_2 change suddenly 1 is alarm
89. 0j0 0 0 0 0 0j0 0 0 0 1 0 0 Q Di hi bls Low n bits n4 of source address is decoded to target address nS3 the high bit of target address all become 0 When n 0 no operation beyond n 0 14 don t execute the instruction 4 applied instructions 4 8 9 High bit coding ENCO 1 Summary Transform the ASCII code to hex numbers High bit coding ENCO Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands data address need coding D Coding result address soft element quantity to save result 3 Suitable soft components mw e ml ox www an loo 5 a a LI 5 Ptptept tte fr s Ce 1d When 5 is bit device gt nx 16 i O GO os ENCO M10 D10 K3 M17 Ml6 MI5 M14 M13 M12 Mil MIO 0 0 0 0 1 0 1 0 j 6 5 4 2 1 0 b15 D10 4 7070 ololololo ololo o ololo ololil b0 All be 0 4 applied instructions lt When is word device gt n lt 4 a O GG s DO ENCO DI K3 0 0 0 0 0 0 0 0 0 0 0 0 0 All be 0 If many bits in the source ID are 1 ignore the low bits If source ID are all 0 don t execute the instructions When drive inp
90. 1 com G come coms Control Inverter Action Inver ter Status Read Into User Define B Control inverter action There are two modes to set parameters First one is write constant value Control Inverter Action Inverter Status Read Into User Define Write Const Value Q Run Inching Run O lecelerating Stop Forward Run Inching Forward Run Exigent Stop Q Backward Run Ey Inching Backward Run Q Inching Stop Q Error Reset Second one is to set the parameters in register Write From Reg C Inverter status read into To read the status from the frequency inverter to the PLC register Control Inverter Aetion lnverter Status Read Into User Define Error Code 7 Output Voltage Motor s Rotate Speed setting Frequency Module s Temperature Output Frequency Ir34 VI Analog Input Output Current O CI Analog Input Bus Yoltagze EE software Version D User define To write or read the frequency inverter address flexible Status Reg Humber Comment For example add a writing inverter instruction User Define Comment write to inverter O Read Inverter e Write Inverter Interver Address HEX 2000 OQ Write Const Value i Si ee Write From Register D100 Add a reading inverter instruction User Define bd Comment read brror code Oo Read Inverter Q Write Inverter Interv
91. 1 5707963267948966 1923132169 163975 P2 double 4 71238898038468985769396507491925 PI 3 2 Return the first c position among n void memchr const void s int c size_t n ud words before s position Compare the first n words of position int memcemp const void s1 const void s2 size t n 212 sl ands Copy n words from position s2 to void memcpy void sl const void s2 size t n sland return s1 Replace the n words start from s void memset void s int c size t n position with word c and return position s char strcat char s1 const char s2 Connect string ct behind string s Return the first word c position in char strchr const char s int c string S int strcmp const char s1 const char s2 Compare string s1 and s2 char strcpy char s1 const char s2 Copy string s1 to string s2 Double precision math Single precision math Pte Description function function double acos double x float acosf float x double asin double x float asinf float x double atan double x float atanf float x double atan2 double y double Inverse tangent value of float atan2f float y float x X parameter y x Return the smallest double double ceil double x float ceilf float x integral which is greater or equal with parameter x double cos double x float cosf float x Hyperbolic cosine function double cosh double x float coshf float x cosh x e x e x 2 double exp double x float
92. 11 multi section pulse control Absol aa PTOA DO YO Y1 amm section am control Pulse stop Variable frequency single section pulse output 6 1 Functions Summary Generally XC3 and XC5 series PLC are equipped with 2CH pulse output function Via different instructions users can realize unidirectional pulse output without ACC DEC speed unidirectional pulse output with ACC DEC speed multi segments positive negative output etc the output frequency can reach 200K Hz Stepping Motore Drivere X1 To use pulse output please choose PLC with transistor output like XC3 14T E or XC3 60RT E etc X2 XC5 series 32I O PLC has ACH YO Y1 Y2 Y3 pulse output function X3 XCM series 32 24 have 4 CH pulse output XCC series has 5 CH pulse output XCM 60 has 10 CH pulse output X4 Pulse output terminal Y 1 cannot be used together with expansion BD ii 6 2 Pulse Output Types and Instructions 1 Instruction Summary Instruction to generate ration pulse with the specified frequency Unidirectional ration pulse output without ACC DEC time change PLS Y 16 bits PLSY 32 bits DPLSY vel o lumi e Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC cae T mak Hardwarere Software mm b 5 2 Operands Function Type Specify the frequency s value or register ID Specify the pulse number
93. 11 YO Y23 Output Points 10 14 20 24 YO Y15 YO Y27 Internal Relay YO Y 1037 MO0 M3999 Internal Relay M4000 M7999 4 For Special Usage M8000 M8767 S0 S511 512 S1023 C0 C299 16 bits forward counter C300 C599 32 bits forward backward counter COUNTER C600 C619 single phase HSC C620 C629 double phase HSC C630 C639 AB phase HSC D0 D3999 DATA D4000 D79991 REGISTER For Special Usage D8000 D9023 FlashROM FDO FD5119 TO T99 100ms not accumulation T100 T199 100ms accumulation T200 T299 10ms not accumulation T TIMER T300 T399 10ms accumulation T400 T499 1ms not accumulation T500 T599 1ms accumulation T600 T639 1ms precise time 6 mE REGISTER For Special Usage gt FD8000 FD9023 1024 EXPANSION S INTERNAL EDO ED36863 36864 REGISTER XCM Series 24 32 I O 48 I O 24 32 I O 48 I O X0 X15 X0 X33 14 18 X0 X21 i YO Y11 Y0 Y23 10 14 Output Points Y0 Y15 Internal Relay X0 X1037 Internal Relay YO Y 1037 M0 M2999 Internal Relay M3000 M7999 X4 For Special Usage M8000 M8767 S0 S511 512 S1023 CO C299 16 bits forward counter C300 C599 32 bits forward backward counter COUNTER C600 C619 single phase HSC C620 C629 double phase HSC C630 C639 AB phase HSC D0 D2999 D4000 D4999 For MA 3 Usage D8000 D9023 FlashROM EDO FD63 DATA REGISTER T0 T99 100ms not accumulation T100 T199 100ms accumulation 1200 T299 10m
94. 134 receive a C X1 If you require PLC to receive but not send or receive before send you need to set the communication timeout to Oms 1 Summary Release the serial port Receive data RCVST 16 bits RCVST 32 bits FN Execution Normally ON OFF rising Suitable XC2 XC3 XC5 XCM XCC Hardware Software 2 Operands Function Type Specify the serial port no I6bits BIN 3 Suitable soft components Operands module D m w ox by DM bs KH ID K li RCVST K2 e RCVST instruction it executes once at the rising edge of MO Serial port K2 K3 When releasing the serial port set OFF M8134 port 2 receiving sign bit set ON M8135 port 2 receive uncompleted sign bit In free format communication mode if there is no timeout or the timeout time is too long please use RCVST to release the serial port MO M8134 M8135 Receive E 7 3 4 Free format communication application B Here we use the example in chapter 7 3 2 XINJE PLC and temperature controller to explain the application Operation 1 Connect all the hardware wires 2 Set the PLC serial port parameters as the controller communication parameters PLC station no is 255 in free format communication Please restart the PLC after setting the parameters 3 Make the program as the protocol in chapter 7 3 2 Read temperature send data R T CR Start R read T
95. 2 0 amp 0 0 0 amp 1 0 WAND DIO D12 D14 1 amp 0 0 1 amp 1 1 lt Execute logic OR operation with each bit gt xo spy qu 0or0 0 QOorl l WOR DIO D12 D14 l or 0 1 lorl l lt Execute logic Exclusive OR operation with each bit gt m GO O WXOR D10 D12 D14 0 xor 0 0 0 xor 1 1 1 xor 0 1 1 xor 1 0 If use this instruction along with CML instruction XOR NOT operation could also be executed a GO GO WXOR DIO D12 D14 CML D14 D14 4 applied instructions 4 6 8 Converse CML 1 Summary Converse the phase of the numbers Converse CML Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM Hardware Software 2 Operands Source number address 16 bits 32 bits BIN Result address 16 bits 32 bits BIN 3 Suitable soft components gt gt m o ww www wn o o s lldiilili lLl D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 01 1 Sign O positive bit 1 negative 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 Y17 Y7 Y6 Y5 Y4 Fach data bit in the source device is inverted 1 0 0 1 and sent to the destination device If use constant K in the source device it can be auto convert to be binary It s available when you want to inv
96. 2 changes to be 30 it means the assignment is successful Neh xX ABASZITSae Ce SHE RES rH Mb ik HIE lt gt lt gt lt gt 1 30 Ins sIns Del sel sFo sFB sFB sF F11 Free Monitor 9 6 Program Example If PLC needs to do complicated calculation including plus and minus calculation the calculation will be used for many times C language function is easy to use Example 1 Calculation a b c b c c 3 d Method 1 use ladder chart Get the result of c 3 Get the result of three multiplication equations Get the sum Ladder chart only support two original operands it needs many steps to get the result 8 SUB D2 K3 DIO 5 7 D2 C D10 C 3 MUL DIO D3 DI2 l 3 3 D10 C 3 D3 D D12 C 3 D MUL D1 D2 DI4 4 2 8 DIB D2C D14 B C DIV Dl D2 Dl6 DEB 4 2 2 D2 C D16 B C WTD Dl6 DIS 5 D16 B C D18 make B C result to Dword DADD DI2 Dl4 D2 a 9 3 D12 C 3 D D14 B C DADD D20 DI8 D22 D18 make B C restilt to Dword D22 A Note 1 The result of MUL is Dword the result is stored in D14 D15 2 The result of DIV has quotient D16 and remainder D17 If D17 has value the calculation precision will decrease Please use float format to ensure the precision 3 D16 quotient is word value in plus calculation all the data should
97. 4 bit is Modbus station number Communication format Baud rate data bit stop bit parity Unit ms if set to be O it means no Communication mode ASC timeout judgment time M timeout waiting Unit ms if set to be O it means no Reply timeout judgment time as timeout waiting Start symbol High 8 bits invalid End symbol High 8 bits invalid 8 16 bits cushion Free format setting with without start bit with without stop bit X1 The PLC will be Off line after changing the communication parameters use stop when reboot function to keep PLC online 7X2 After modifying the data with special FLASH data registers the new data will get into effect after reboot FD8211 COM1 FD8221 COM2 FD8231 COM3 slr ji 2 n 10 9 s 7 6 5s 4 3 2 h jo Eo JE LLL LLL LLL Baud rate 0 No parity 1 Odd parity 2 Even parity Please see below table 0 2 stop bits 2 lstop bit 0 8bits data 1 7bits data bit0 bit3 baud rate XC2 XCM XCC Loses xcs xc o Do 11s2kbps xcs xc XC2 XCM XCC B 256Kbps XC2 XCM XCC CEE 5 9600 bps D 384Kbps XC3 XC5 XC2 XCM XCC E 512Kbps XC2 XCM XCC F 576Kbps XC3 XCS FD8216 COM1 FD8226 COM2 FD8236 COM3 us n m m2 mn g0 9 8 7 6 5 4 3 2 1 0 po HN Reserved 0 8 bits communication 1 16 bits communication 0 without start symbol 1 with start symbol 0 without end symbol 1 wi
98. 56 K8 WAND D56 HFF D17 M10 1 SEND D10 K8 K2 M11 M8132 n RCV D20 K10 K2 M8134 T BMOV D20 D100 K10 ROL D101 K8 WOR D101 D100 D200 ROL D103 K8 WOR D102 D103 D201 Write code H43 into D32 Clear registers D40 D56 D30 station Nr add H80 save the result in D40 Move D40 to D10 Move D40 to D11 Move D32 write code H43 to D12 Move D33 para code to D13 Move D34 temp set to D42 Logic and D42 with HFF save data in D14 Move D34 temp set to D44 D44 right shift 8 bits Logic and D44 with HFF save data in D15 Below is to calculate CRC parity D33 para code multiply K256 save result in D46 D46 add K67 save data in D48 D48 add D34 save data in D50 D50 add D30 save data in D52 Move D52 to D54 Logic and D54 with HFF save result in D16 Move D52 to D56 Right shift 8 bits with D56 Logic and D56 with HFF save result in D17 Send data D10 D17 out Read the returned data and save in D20 D29 Move the returned data to D100 109 Left shift 8 bits with D101 Logic OR D101 with D100 save result in D200 Left shift 8 bits with D103 Logic OR D102 with D103 save result in D201 Program Description The above program is written according to DH instrument s communication protocol the soft component s functions are listed below of sent data I and cm Read Address Address Read Parameters code code code Write A
99. 56 MV para value ADDR for details please refer to AIBUS communication description 3 Write the program After power on the PLC the PLC read the current temperature every 40ms During this period the user can write the set temperature Data zone definition buffer area of sending data DIO D19 buffer area of accepting data D20 D29 instruction s station number D30 read command s value D31 52 H write command s value D32 43 H parameter s code D33 temperature setting D34 CRC parity code D36 Temperature display D200 D201 The send data form 81H 81H 43H 00H c8H 00H OcH 01H current temperature display Communication parameters setting baud rate 9600 8 data bits 2 stop bits no parity Set FD8220 255 FD8221 5 the hardware and software must be V2 4 or above Ladder Write instrument s station Nr K1 in to D30 Time 40ms Output M10 Write the read code 52H into D31 Clear registers D40 D56 D30 add H80 to get value 81H move D40 81H to D10 move D40 81H to D11 move D31 read code 52H to D12 move D33 para code to D13 write zero to D14 write zero to D15 below is to calculate CRC parity D33 multiply K256 the result is saved in D42 D42 add K 2 the r
100. 600 T602 T604 T618 the number should be even D2 Time Value The precise timer works in form of 1ms The precise timer is 32 bits the count range is 0 2 147 483 647 When executing STR the timer will be reset before start timing When XO turns from OFF to ON timer T600 starts to time when time accumulation reaches 100ms set T600 if XO again turns from OFF to ON timer T600 turns from ON to OFF restart to time when time accumulation reaches 100ms T600 reset again See graph below AM X0 T600 gt i 100ms 100ms wo read the precise time stop precise time 25 ln STRR T600 When XO changes from OFF to ON move the current precise time value into TD600 immediately it will not be affected by the scan cycle e When MO changes from OFF to ON execute STRS STRS T600 instruction immediately stop precise time and refresh the count value in TD600 It will not be affected by the scan cycle When XO changes from OFF to ON T600 starts timing When time accumulates to 100ms set ON T600 meantime generate an interruption the program jumps to interruption When the precise time reaches the count value it will generate an interruption tag interruption subprogram will be executed Start the precise time in precise time interruption Every precise timer has its own interruption tag see table be
101. A I d I dPEeIMI lI Q a I ASCI D100 D200 K4 Convert each bit of source s S Hex format data to be ASCII code move separately to the high 8 bits and low 8 bits of destination D The convert alphanumeric number is assigned with n Dis low 8 bits high 8 bits store ASCII data The convert result is this A 4 applied instructions C B Assign start device D204 down C D100 0ABCH D101 1234H D102 5678H 30H 1 31H 5 35H A 41H 32H 6 36H B 42H 3 33H 37H C 43H 34H 8 38H 4 8 7 ASCII convert to Hex HEX 1 Summary ASCII converts to Hex HEX Normally ON OFF Suitable rising falling edge Software BEEN Function Date type Operands Source soft element address ASCII Target soft element address 2 bits HEX Character quantity 16 bits BIN 3 Suitable soft components p m m m x o pu rs ka p E xg plerepem cp y ue 1T LLLI gg 34 p G a HEX D200 D100 K4 Convert the high and low 8 bits in source CS to HEX data Move 4 bits every time to destination The convert alphanumeric number is assigned by n 4 applied instructions The convert of the upward program is the following n D D102 D101 D100 Not change to ASCII D200 down D200 up 4lH A oa D201 down 42H D201 up D202 down sw xn 4 n k4 D200 0 1 0 0 0
102. C1 Ladder ria Project AP ey PLCI a O Code pai Ladder 1 id Instruction List 8 Func Block Re Config Black e Sequence Black oo Sequence Blog s5 Comment Editor E t Free Monitor Delet e Sequence Block EA Maks Miamikar Add To Lad B 10 2 4 Modify the BLOCK There are two methods to modify the block A double click the start or end instruction to modify all the instructions in the block m30 BLOCK Sequence Black H B DSPLSR DD D2 D4 Y SBLOCKE Edit Sequence Block 1 Skip Insert B double click one instruction in the block to modify it Mg0 Pulse Config C Skip Comment Pulse Config Single O 24 Segment Opposite O Absolute SBLOCK Sequence Block1 Frequency DO Pulse Number D2 Accelerate And Decelerate Time D4 Output Pulse Y Num YO Config Value Accelerate And Decelersms Time 0 si 1 Frequency S 1 Pulse Mun 0 s Read From PLC Write To PLC OK Cancel 10 3 Edit the instruction inside the BLOCK 10 3 1 Common item Use command to edit the program Open the block editing window click add common item equence EL Comment Sequence Blockl Add Edit Delete Upwards Dowrwards d cman Ooo Pulse Item Modbus Item Frequency Inverter Item Free Format Communication Item Wait Item It will show the editing window Instruction List b
103. C2 D8000 D 8511 D0 D999 D4000 D4999 6 D8630 D8729 D0 D3999 D4000 D7999 D8000 D9023 1024 DO0 D2999 D3000 D4999 D8000 D9023 1024 Structure Data register is soft element which used to store data it includes 16 bits and 32 bits 32 bits contains two registers the highest bit is sign bit XC3 XC5 XCM 16 bits register range is 32 768 32 767 D0 16 bits 0100001001100000 bl I bO O Oo Sign bit it O positive 1 negative Use the applied instruction to read and write the register data Or use other devices such as HMI 32 bits value is consisted of two registers The range is 2147483648 2147483647 High D1 16 bits X DO 16 bits gt Pos M ww OF 100001001 100000010000 1001 10000 0 yg C bO EM Be u Sign bit O positive 1 negative When appoint the 32bits register if set DO the PLC will connect the next register D1 as the high bits Generally we often appoint even address register Function Normal type y When write a new value in the register the former value will be covered y When PLC from RUN to STOP or STOP to RUN the value in the register will be cleared Retentive type y When PLC from RUN to STOP or power off the value in the register will be retained y The retentive register range can be set by user g Specia
104. D m wr wpxl ge ee o el pepeide pw pe wg e 0 jj p qr roger jenes 1 16 bits Operation p NP X0 DO X D D5 D4 MUL DO D2 D4 16 bits 16 bits 32 bits The contents of the two source devices are multiplied together and the result 1s stored at the destination device in the format of 32 bits As in the upward chart when D0 8 D2 9 D5 D4 72 The result s highest bit is the symbol bit positive 0 negative 1 When be bit unit it can carry on the bit appointment of K1 K8 When appoint K4 only the result s low 16 bits can be obtained lt 32 bits Operation gt P GO OO m BIN BIN E DMUL DO D2 D4 DI DO X D3 D2 gt D7 D6 D5 D4 32 bits 32 bits 64 bits When use 2 bits Operation the result is stored at the destination device in the format of 64 bits Even use word device 64 bits results can t be monitored at once E 4 6 4 Division DIV 1 Summary Divide two numbers and store the result Division DIV 16 bits DIV DDIV Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands SI The number address 16 bits 32 bits BIN S2 The number address 16 bits 32 bits BIN 4 applied instructions Dp 8 The result address 16 bits 32 bits BIN 3 Suitable soft components lt 16 bits operation gt m GO
105. D activates if SI 2 S2 duds OR OR activates if SI S2 OR S1 S2 4 4 3 OR gt OR activates if SI gt S2 n T PMOV D5 D10 K3 4 4 3 OR OR activates if SI S2 OR lt S1 S2 4 4 3 OR activates if SI S2 OR lt gt S1 S2 4 4 3 OR activates if S1 lt S2 Oo ne OR activates if SI S2 E OR gt S1 S2 4 4 3 Data Move Exchange two values 4 applied instructions 4 5 1 EMOV Float move 4 5 12 Data Operation e m a h mo emm h e CCNEE NC o eme F e e gt h i Negative NEG D 4 6 9 Data Shift 4 applied instructions SaS SFIL S D m n2 SFTL Bit shift left a SFIR S D n n2 SFTR Bit shift right 4 7 5 iwsrt s b m rm WSFL Word shift left pa
106. D control separates the basic units with the expansions this improves the flexibility of this function 5 Anew PID algorithm critical oscillation is added in v3 3 and higher version of PLC For temperature control object Step response method the PID auto tune will start when current temperature of object is equal to ambient temperature Critical oscillation method the PID auto tune will start at any temperature ii 8 2 Instruction Forms Brief Introductions of the Instructions Execute PID control instructions with the data in specified registers 16 bits PID 32 bits eS a es Executing Normally ON normally closed Suitable XC2 XC3 XC5 XCM XCC coil activates Hardware V3 0 or above Software V3 0 or above Condition V3 3a and above critical Condition V3 3f and above critical oscillation oscillation 2 Operands set the address of the target value SV 16bits BIN set the address of the tested value PV 16 bits BIN 3 set the start address of the control parameters 16 bits BIN ID the address of the operation result MV or output port 16 bits BIN bit 3 Suitable soft components Cs G G XO PID DIO D4000 D100 x Cr C G8 PID DO DIO D4000 YO S3 S34 43 will be occupied by this instruction so please don t use them as the common data registers This instruction executes when each sampling
107. D2 D4 denotes two 16 bits data adds DADD D10 DI2 D14 denotes two 32 bits data adds X1 Flag after executing the instruction Instructions without the direct flag will not display X2 CS Source operand its content won t change after executing the instruction X3 Destinate operand its content changes with the execution of the instruction X4 Tell the instruction s basic action using way applied example extend function note items 4 3 Program Flow Instructions 4 applied instructions 4 3 1 Condition Jump CJ Summary As used to run a part of program CJ shorten the operation cycle and using the dual coil Condition Jump CJ Execution Normally ON OFF coil Suitable XCI XC2 XC3 XC5 XCM condition Hardware Software requirement SEEN requirement 2 Operands Operands Pn Jump to the target with pointer Nr P PO P9999 3 Suitable Soft Components n In the below graph if X000 is ON jump from the first step to the next step behind P6 tag If X000 OFF do not execute the jump construction 4 applied instructions XO CJ P6 In the left graph YOOO becomes to be P C vo dual coil output but when X000 OFF X001 activates when X2 X000 ON X005 activates RST T246 CJ can t jump from one STL to X3 another STL T24 KI d C T246 gt oey After dr
108. E Execution Normally ON OFF rising Suitable XC2 XC3 XC5 XCM XCC Hardware Software 2 Operands Specify the start address of local sending data 16bits BIN Specify the send character quantity or soft component 16bits BIN address Specify the serial port no 16bits BIN 3 Suitable soft components gt Tw gt w e x we ow s xm oo s 11d ddl gj fete jj ji 1l s l 1 1 1 IK G G n il SEND D10 D100 K2 Data send instruction send data on the rising edge of MO Serial port K2 K3 When sending data set sending flag M8132 COM2 ON MO Lit a 1 Summary Write the specified station s data to the local specified ID Receive data RCV 16 bits RCV 32 bits mee Execution Normally ON OFF rising Suitable XC2 XC3 XC5 XCM XCC Hardware Software Requirement Requirement 2 Operands Operands Function Type Specify the start address of local receiving data I6bits BIN S2 Specify the receive characters quantity or soft component 16bits BIN address Specify the serial port no 16bit BIN BIN 3 Suitable soft components D m m m ox by m bs KH D pot il RCV D20 D200 K2 Data receive instruction receive data on the rising edge of MO Serial port K2 K3 When receiving data set receiving flag M8134 COM2 ON MI M5
109. Execution Normally ON OFF rising edge Suitable Models XC2 XC3 XC5 XCM Hardware Software 2 Operands Specify the remote communication station 16bits BIN Specify the remote coil first address 16bits BIN Specify the local coil first address Specify the coil quantity Specify the serial port no 3 Suitable Soft Components Operands Operands System Loo System o CE E S ru D K500 K3 MI K2 INPR Instruction to read the input coil Modbus function code is 02H Serial port K1 K3 Operand S3 K1 K984 the max coil quantity is 984 When XO is ON execute COLR or INPR instruction set communication flag after execution the instruction when XO is OFF no operation If error happens during communication resend automatically If the errors reach 3 times set the communication error flag The user can check the relative registers to judge the error 1 summary Write the local coil status to the specified station s specified coil Single coil write COLW 16 bits COLW 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable Models XC2 XC3 XC5 XCM Hardware Software Requirement Requirement 2 Operands Specify the remote communication station 16bits BIN Specify the local coil first address Specify the serial port no 16bits BIN 3 suitable soft components lm gt w e x wr ow s xm oo Specify the remote co
110. GR 16 bits CREGR 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable Models XC5 XCC Condition Hardware Software Requirement Requirement 2 Operands DI Specify remote communication station no or soft component s 16bits BIN number D2 Specify the remote register s start address or soft component s 16bits BIN number Specify the register quantity or soft component s number 16bits BIN Specify the local receive coil s start address 16bits BIN 3 Suitable soft components System constant module il CREGR K2 K20 K4 D20 Execute CREGR instruction when X0 changes from OFF to ON read the remote station no 2 coil s start address K20 4 coils to the local D20 D23 1 Summary Write the specified local input register to the specified station s specified register Write the register CREGW 16 bits CREGW 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable XC5 XCC Condition me Hm ee Hardware Software 2 Operands D1 Specify remote communication station no or soft 16bits BIN i component s number J D2 Specify the remote register s start address or soft 16bits BIN component s number Specify the register quantity or soft component s 16bits BIN ae lS Specify the local receive coil s start address 16bit BIN sd BIN 3 Suitable soft components Oper
111. M condition rising falling edge Models Hardware Software requirement requirement Increment 1 DEC 16 bits DEC DDEC Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands The number address 16 bits 32bits BIN 3 Suitable soft components Tw e we ww ww wn o lo lt Increment INC E iI INC DO DO 4 1 DO On every execution of the instruction the device specified as the destination has its current value incremented increased by a value of 1 In 16 bits operation when 32 767 1s reached the next increment will write 32 767 to the destination device In this case there s no additional flag to identify this change in the counted value lt Decrement DEC 4 applied instructions je DEC DO D0 1 DO E On every execution of the instruction the device specified as the destination has its current value decremented decreased by a value of 1 When 32 768 or 2 147 483 648 is reached the next decrement will write 32 767 or 2 147 483 647 to the destination device 4 6 6 Mean MEAN 1 Summary Get the mean value of numbers Mean MEAN Execution Normally ON OFF Suitable condition rising falling edge Hardware Software 2 Operands The head address of the numbers gt The mean result address 3 Suitable soft components
112. MI PLF Ml RST YO LD MI RST YO 3 12 SET RST Mnemonic and Function Mnemonic Function Format and Devices SETH Set Set a bit device permanently RST Reset Reset a device permanently OFF Devices YO M SO TO C Dn m Statements Program Turning ON X010 causes YOOO to turn ON YOOO remains ON even after X010 turns OFF Turning ON X011 causes YOOO to turn OFF YOOO remains OFF even after X011 turns OFF It s the same with M S SET and RST instructions can be used for the same device as many times as necessary However the last instruction activated determines the current status Besides it S also possible to use RST instruction to reset the current contents of timer counter and contacts When use SET RST commands avoid to use the same ID with OUT command X10 SET YO XII RST YO XD SET M50 X13 RST M50 X14 SET SO X15 RST SO X10 K10 cus RST X10 X11 LD SET LD RST LD SET LD RST LD SET LD RST LD OUT LD RST X10 YO XII YO XI2 M50 X13 M50 X14 SO X15 SO X10 T250 X17 T250 K10 3 13 OUT O RSTQ for the counters M nemonic and Function Mnemonic Function Format and Devices Final logic operation type coil drive n pus Reset a bit device permanently OFF Program
113. N 3 Suitable soft components p m m m ox o m os x p Gg wel 134g e eee 3 L x B p SIN D50 D60 D51 D50 gt D61 D60 SIN Binary Floating Binary Floating This instruction performs the mathematical SIN operation on the floating point value in S angle RAD The result is stored in D Cs RAD value angle X 1 180 Assign the binary floating value i w j panj 8e Binary Floating 4 applied instructions 4 9 9 Cosine SIN 1 Summary Float Cosine COS Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft element address need to do cos 32 bits BIN Do Result address 32 bits BIN 3 Suitable soft components p m m m ox o m os x p 2 el ee e eee 32 xo B I COS D50 D60 D51 D50 RAD gt D61 D60 COS Binary Floating Binary Floating This instruction performs the mathematical COS operation on the floating point value in S angle RAD The result is stored in D Cs RAD value angle X 1 180 Assign the binary floating value Dei D6 COS value Binary Floating 4 applied instructions 4 9 10 TAN TAN 1 Summary TAN TAN Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft element address need to do tan 32bit BIN Do Result address 32bit BIN 3 Suitable soft components
114. NC D1 B NEXT NEXT FEND and END Summary FEND means the main program ends while END means program ends main program ends FEND Execution condition SuiableModels XCI XC2 XC3 XC5 XCM a M program ends END Execution condition Se Suitable Models XCI XC2 XC3 XC5 XCM Co mamem mm 0000 Hardware requirement Hardware requirement 2 Operands 3 Suitable Soft Components None Even though FEND instruction represents the end of the main program if execute this instruction the function is same with END Execute the output input disposal monitor the refresh of the timer return to the Oth step 4 applied instructions 2 Main program 1 OFF x11 42 4 OH ee am 10 ow m mero a Main program s a a i OL u oT main program B If program the tag of CALL instruction behind FEND instruction there must be SRET instruction If the interrupt pointer program behind FEND instruction there must be IRET instruction After executing CALL instruction and before executing SRET instruction if execute F20 ia P21 zIUAOH L1 1100 FEND instruction or execute FEND instruction after executing FOR instruction and before executing NEXT then an error will occur In the condition of using many FEND instruction please compile routine or subroutine betwee
115. OKBPS initial value 4 20KBPS initial value 5 40KBPS initial value FD8351 CAN baud rate 6 5OKBPS initial value 7 SOKBPS initial value 8 IOOKBPS initial value 9 150KBPS initial value 10 200KBPS initial value 11 250KBPS initial value 12 300KBPS initial value 13 400KBPS initial value 14 SOOKBPS initial value 15 600KBPS initial value 16 800KBPS initial value 17 1000KBPS initial value low 8 bits O standard frame CAN free format low 8 bits l expansion frame mode high 8 bits 0 8 bits data store high 8 bits 1 16 bits data store CAN accept FD8359 for free format using unit ms timeout time CAN send timeout fixed to be 5ms time 2 System M8000 flag ON error happens OFF normal M8240 CAN error flag if set M8242 as ON and manually set M8240 as ON this will enable CAN reset XC CAN mode valid CAN node dropped off M8241 ON certain node nodes are dropped off i OFF Normal ON CAN reset automatically when error do reset or not if CAN M8242 happens error happens OFF take no operation when error happens FREE mode valid M3943 CAN send accept finished ON receive accept finish flag reset ON automatically when starting to send accept FREE mode valid M 244 CAN send accept timeout ON send accept timeout flag Set OFF automatically when starting to send accept 3 System D8000 0 no error 2 initializing error CAN error information 30 CAN bus error 31 error alarm 32 data overflow
116. ON canning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5 When MO is from OFF gt ON run DSPLSR DO D2 D4 YO in the BLOCK to output the pulse when MI is from OFF gt ON stop running the BLOCK the pulse will stop slowly with slope when M3 is from OFF ON output the rest pulses Please note that though the SBSTOP stops the pulse with slope there maybe still some pulses in this case if run SBGOON Kl KI again it will output the rest of the pulses f 10 7 BLOCK flag bit and register 1 BLOCK flag bit M8631 BLOCKI running flag 1 running 0 not running M8729 BLOCK99 running flag 2 BLOCK flag register D8630 D 8631 BLOCKI current running instruction D8632 BLOCK2 current running instruction D8729 BLOCK99 current running instruction BLOCK use this value when monitoring 10 8 Program example Example 1 This example is used in the tracking system The process 1s like this Output some pulses and prohibit the exterior interruption Continue outputting the pulse but at low speed and open the exterior interruption When checked the exterior cursor signal stop the pulse outputting and machine running
117. ON eee the specified flow not close the local flow ST hw s p 1 Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM Hardware Software sel Jmm Flow starts STL Dew sn xw T 4 applied instructions Execution Suitable XC1 XC2 XC3 XC5 XCM condition IEEE Bauen Hardware Software Flow ends STLE Execution Suitable XCI XC2 XC3 XC5 XCM Hardware Software 2 operands Jump to the target flow S Flow ID 3 Suitable Soft Components Ce Pte rt STL and STLE should be used in pairs STL represents the start of a flow STLE represents the end of a flow After executing of SET Sxxx instruction the flow specified by these instructions is ON After executing RST Sxxx instruction the specified flow is OFF In flow S0 SET SI close the current flow SO open flow S1 In flow S0 ST S2 open the flow S2 but don t close flow SO When flow turns from ON to be OFF reset OUT PLS PLF not accumulate timer etc which belongs to the flow ST instruction is usually used when a program needs to run more flows at the same time After executing of SET Sxxx instruction the pulse instructions will be closed including one segment multi segment relative or absolute return to the origin SET S0 SIL SO C 12 SET sl ST S2 STLE SIL SI
118. Program Summary XC series PLC as the controllers accept the signal and execute the program in the controller to fulfill the requirements from the users In this chapter we start with the program forms introduce the main features the supported two program languages etc 1 1 Programmer Controller s Features 1 2 Program Language 1 3 Program Format 1 1 Program Controller s Features Program L anguage XC series PLC support two kinds of program languages instruction list and ladder the two languages can convert to the other Security of the Program To avoid the stolen or wrong modifying of user program we encrypt the program When uploading the encrypted program it will check in the form of password This can maintain the user s copyright meantime it limits the download to avoid the modification with the program spitefully Program s comments When the user program is too long adding comments to the program and its soft components is necessary Offset Function Add offset appendix like X3 D100 MIO D100 DO D100 behind coils data registers can realize indirect addressing For example when D100 9 X3 D100 X14 M10 D100 M19 DO D100 D9 Rich Basic Functions XC series PLC offers enough basic instructions can fulfill basic sequential control data moving and comparing arithmetic operation logic control data loop and shift etc XC series PLC also support special compare high speed pulse
119. SHL After once execution the high bit is same with the bit before shifting the final bit 1s stored in carry flag LSR and SHR is different LSR add 0 in high bit when moving SHR all bits are moved lt Logic shift left gt lt Logic shift right gt 197 n XI Da B XO M8022 n7 7 j LL 7 T l once High xong pay Te High Execution Left 111511 1 0 0 0 0 0 0 0 0 0 0 0 0 i l Lo i J802 4 7 3 Rotation shift left ROL Rotation shift right ROR 1 Summary Continue and cycle shift left or right Rotation shift left ROL Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software m ems Rotation shift right ROR Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Models Hardware Software requirement requirement 2 Operands 4 applied instructions Source data address 16 bits 32 bits BIN Shift right or left times 16 bits 32 bits BIN 3 Suitable soft components p m m m ox by m os ku p l li eee eee eee The bit format of the destination device is rotated n bit places to the left on every operation of the instruction lt Rotation shift left gt lt Rotation shift right gt Pee Tx X om oT Te Right HIgh Rotation Low M8022 pa Jlar er epy After once E 1 Hi sh execution Left Lulli fofofofofofofo for jijali e i e 1 M8022 M8022
120. Skip Comment Instruction List IMOY DO Di MUL D5 nio nen User can add instructions 1n this window SKIP condition can control the stop and running of the instructions When select skip and enter coil in it if the coil is ON the instructions will stop Comment can modify the note for this instruction Comment calculation puces i aa MOV DO Di MUL I5 D10 D20 After setting the block will be changed as the following BLOCK Sequence Block M20 SELOGKE 2 rice M Open the pulse item window Pulse Config C Skip Comment gm Single O 24 Segment Opposite O Absolute Frequency DO Pulse Number D2 Accelerate And Decelerate Time D4 Output Pulse Y Num YO Config Value Accelerate And Decelersms Time si 1 Frequency 0 2 1 Pulse Num 0 bid Read From PLC Write To PLC OK J Cancel Set the pulse output frequency numbers output terminals accelerate decelerate time and so on Then add the pulse instruction in the block SBLOCK Sequence Block DSPESE SBLOCKE X1 The pulse output instructions are all 32bits 10 33 Modbusitem o O Open the modbus item window Modbus Config Skip EE Comment f Conf mn Ixkruzeeeremlenpuxc nexium 00 wmm select Instruction Coil Read COLE Coil Read COLR El COM Hum EE Remote Coil Address EO
121. T END 4 one in main program another in STL MO PLSR DO DI10O0 YO MIO SO T Cs STL SO MI PLSR D200 D1000 YO SILE 5 one in main program another in subprogram MO PLSR DO D100 YO M10 i CALL PO FEND The correct programming method when it needs to write more than one pulse output instructions Method 1 use STL each STL only write one pulse output instruction Example MO S0 0 il S HE 8 STL SO M2 m DPLSR DO D30 YO Y2 M8170 M2 s FU R SO R 23L STLE 24 STL S1 M3 26 DPLSF D100 YO Y2 iid M3 42 ge M R Sl R 38 I STLE Note the two STL cannot work at the same time M2 and M3 cannot be ON at the same time PLSR D200 D1000 YO m Method2 if the same instruction needs to work in many places of the program user can write one instruction in the main program and put its parameter registers in STL MO 50
122. XC5 XCM XCC condition models V3 3 and higher V3 3 and higher 2 Operands Source soft element address 32 bits BIN Do Destination soft element address 32 bits BIN 3 Suitable soft element lt 32 bits instruction gt Binary floating binary floating E oF EMOV DO DIO D1 D0 D11 D10 X0 is ON send the floating number from D1 DO to D11 D10 X0 is OFF the instruction doesn t work F EMOV K500 D10 K500 gt D11 D10 Ifconstant value K H is source soft element they will be converted to floating number K500 will be converted to floating value 4 applied instructions 4 6 Data Operation Instructions Mean 466 4 applied instructions 4 6 1 Addition ADD 1 Summary Add two numbers and store the result Add ADD Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM condition ici dl rmm Hardware Software 2 Operands The number address The number address D The result address 3 Suitable soft components gt lm m m o ox or ope en o oo s eel ee eke Li s ee aaa ee eL eel e GO ADD D10 D12 D14 D10 D12 D14 The data contained within the two source devices are combined and the total is stored in the specified destination device Each data s highest bit is the sign bit O stands for positive 1 stands
123. a format in the tool This method can save time and easy to do a 7 4 CAN Bus Functions 8 7 4 1 Brief Introduction of CAN bus p XCS5 series PLC support CANbus bus function Below we will give some basic concept on CANbus Sub address 00 120R CAN bus node CAN bus node CAN bus node CAN bus node Sub address 01 Sub address 02 Sub address 03 Sub address 04 CAN Controller Area Network belongs to industrial area bus category Compared with common communication bus CAN bus data communication has performance of outstanding dependability real time ability and flexibility CAN controller works under multi master format In the network each node can send data to bus according to the bus visit priority These characters enable each node in CAN bus network to have stronger data communication real time performance and easy to construct redundant structure improve the system s dependability and flexibility In CANBUS network any node can initiatively send message at any time to any other node no master and no slave Flexibility communication it s easy to compose multi device backup system distributing format monitor control system To fulfill different real time requirement the nodes can be divided to be different priority level With non destroy bus adjudication technology when two nodes send message to the network at the same time the low level priority node initiatively stop data sending while high level priority node can c
124. agram The master station can read and write any slave stations Two slave stations cannot communicate with each other Master station communicates with slave station through Modbus instructions Slave station has no program but only response the master station wiring connect all the RS485 connect all the RS485 4 N e ae In RS232 network there is only one master and one slave Q c SCl There is dotted line in the diagram It means any PLC can be master station when all the PLC in the network don t send data But more than one PLC will send data at one time the communication will fail It is not recommended to use Note For XC series PLC RS232 only support half duplex D 7 2 2 Address For the soft component s number in PLC which corresponds with Modbus address number please see the following table Coil address Modbus ID prefix is 0x Modbus ID Bit ID ModbusID M0 M7999 0 1F3F X0 X1037 4000 421F 4800 4A1F S0 S1023 5000 53FF M8000 M8511 6000 61FF TO T618 6400 666A C0 C634 6C00 6E7A Y0 Y 1037 Hex H Register address Modbus ID prefix is 4x Word ID D0 D7999 TDO TD618 CD0 CD634 D8000 D8511 FDO FD5000 FD8000 FD85 11 ModbusID decimal K Modbus ID Hex H 0 7999 0 1F3F 12288 12906 14336 14970 3000 326A 3800 3A7A 16384 16895 4000 41 FF 18432 23432 4800 5B88 26624 27135 6800 69FF The address is used when PLC uses Modbus RTU protocol The host
125. alue in S3 8 during auto tune This value decides the auto tune performance in a general way set this value to be the AD result corresponding to one standard detected unit The default value is 10 The suggested setting range full scale AD result x 0 3 1 User doesn t need to change this value However if the system is interfered greatly by outside this value should be increased modestly to avoid wrong judgment for positive or negative movement If this value is too large the PID control period sampling time got from the auto tune process will be too long As the result do not set this value too large X1 if users have no experience please use the defaulted value 10 set PID sampling time control period to be Oms then start the auto tune PID auto tune overshooting permission setting S3 9 If set 0 overshooting is permitted the system can study the optimal PID parameters all the time But in auto tune process detected value may be lower or higher than the target value safety factor should be considered here If set 1 overshooting is not permitted For these objectives which have strict safety demand such as pressure vessel set S3 9 to be 1 to prevent from detected value seriously over the target value In this process if S3 2 bit8 changes from 0 to 1 it means the auto tune is successful and the optimal parameters are got if S3 2 is always O until S3 2 bit7 changes from 1 to O it means the auto tun
126. and eS output the three point s ON OFF status according to the zone size e Tl 2 the three point s ON OFF output according to the result E 4 5 3 MOV MOV D 1 Summary Move the specified data to the other soft components MOV MOV iw MOV DMOV Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Models Hardware Software requirement requirement 2 Operands Specify the source data or register s address code 16 bit 32 bit BIN D Specify the target soft component s address code 16 bit 32 bit BIN 3 Suitable soft component pjm m m ox by m os ku p Ce ele eee e aa le D Dp Doc Se ee e dee wg d j CS lt read the counter s or time s current value gt MOV K10 D10 The same as counter lt Move the 32bits data gt MOV TO D20 The current value of T0 D20 DMOV DO D10 DMOV C235 D20 D1 DO gt D11 D10 the current value of C235 gt D21 D20 4 applied instructions Move the source data to the target When X000 is off the data keeps same Convert constant K10 to be BIN code automatically indirectly specify the counter s time s set value gt X2 MOV K10 D20 T20 D20 K10 D10 D20 K10 Please use DMOV when the value is 32 bits such as MUL instruction high
127. and port 3 These COM ports can be RS232 and RS485 O a Y ES Ca 10 Ca TD E d by Ca duy Ca TD dU Coa dU Ca 10 5 TJD Ca Jo Ca EY Gd by d 5y JE oy IED dO d by 15 FE S db doy do doy a5 a5 do EDIE DIG N COM XI x3 X5 XT X11 X13 X15 X17 X21 X23 X25 X27 X31 X33 X35 X31 X4 X13 q L FG COM X0 X2 X4 X6 X10 X12 X14 X16 X20 X22 X24 X26 X30 X32 X34 X36 X40 X42 D Port 3 01234567 10 11 12 13 14 15 16 17 XINJE 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 40 41 42 43 Port 1 EX 7 WIR o KC3 60R E Mio RO PORTI PORT2 01234567 10 11 12 13 14 15 16 17 Port 2 232 20 21 22 23 24 25 26 27 YO Y Y2 Y3 Y4 COMS YT Y10 YI COMT Y15 YiT Y20 Y COMI Y25 Y D TY g COMO COMI COM Com COMI Y5 Y6 COME Yul Y13 yY14 Y16 COMB YN Y23 Y cd ca cd ca cd ca cd Ca ca ca cd GA cd cd cd cd GA cd ca cd
128. ands module D m m m ox by m bs kar D Gp e a a groel e ox Js wl ues ge s s Js wes m eris pr a E E m m m s CREGW K2 K20 K4 D20 Execute CREGW instruction when XO changes from OFF to ON write the local D20 D23 to the remote station no 2 coil s start address K20 i 7 4 5 Communication Form of Internal Protocol H Open close the internal protocol communication function Set the value in register FD8350 0 do not use CAN internal protocol communication use CAN internal protocol communication CAN internal protocol communication is default to open Setthe communication parameters Method 1 direct setting Stepl Add four configure items quantity separately FD8360 read the bit items FD 8361 read the word items FD8362 write the bit items FD8363 write the word items Step2 Set each configure item s communication object each item includes four parameter remote station remote object address local object address local quantity The correspond registers are FD8370 FD8373 represents item 1 FD8374 FD8377 represents item2 FD9390 FD9393 represents item256 totally we can set 256 configure items see the following table Communication setting Function Description CAN communication mode 0 represents not use 1 represents internal protocol CAN baud rate See CAN baud rate setting table Self CAN station no For CAN protocol using
129. annels time interruption 32 10100 I0101 the represent method is I40 49 10200 10201 represents interruption time the unitis mm Tag P is usually used in flow it is used with CJ condition jump CALL subroutine call etc Condition Jump CJ X0 C Pl If coil XO gets ON jump to the step behind X1 tag P1 C Yo gt If the coil XO is not ON do not execute Pa jump action but run with the original program 2 RST TO y Call the subroutine CALL za X0 CALL P10 z If XO gets ON jump to the D A C z subroutine from the main program S ie If the coil is not ON run with the FEND 5 original program P10 E q A 5 After executing the subroutine l z return to the main program C gt 5 SRET E Tag I is usually used in interruption including external interruption time interruption etc use with IRET interruption return EI enable interruption DI disable interruption External interruption y Accept the input signal from the special input terminals not effected by the scan 4 cycle Activate the input signal execute the interruption subroutine CU ss a y With external interruption PLC can dispose the signal shorter than scan cycle So it can be used as essential priority disposal in sequence control or used in short time pulse control Time interruption y Ex
130. antity of segment N 1 must be 0 Acceleration deceleration time address cannot behind segment N Segment 1 DO D1 Segment 2 D2 D3 Segment D4 D5 o l Xt 2 Ze M8170 Send 6 segments of pulse the pulse frequency and quantity please see below table Use 32 bit instruction DPLSR the address is shown as the following table Name Pulse Frequency address Pulse quantity pulse quantity frequenc y Hz Dword address Dword 1000 D1 DO 2000 D3 D2 3000 D9 D8 6000 D11 D10 1200 D21 D20 3000 D23 D22 Acceleration 100ms D51 DO deceleration time Note the 4 registers behind segment 6 must be 0 D27 D26 D25 D24 which means the pulse output end for 16 bits instruction D25 D24 must be 0 M8002 DMOV K1000 DO DMOV K2000 D2 DMOV K200 D4 DMOV K1000 Do DMOV K3000 D8 DMOV K6000 D10 DMOV K800 D12 DMOV K1600 D14 DMOV K100 D16 DMOV K800 DI8 DMOV K1200 D20 DMOV K3000 D22 FMOV KO D23 K4 MO DMOV K100 D50 M8170 DPLSR DO D50 YO Mode 2 segmented dual direction pulse output PLSR 1 Instruction Summary Generate certain pulse quantity with the specified frequency acceleration decelera
131. ardware Software 2 Operands The source data address 16bit 32bit BIN Shift left or right times 16bit 32bit BIN 3 Suitable soft components p m ep m ox by m os ka p 1l li L1 diie I After once execution the low bit 1s filled in 0 the final bit 1s stored in carry flag After once execution the high bit is same with the bit before shifting the final bit is stored in carry flag lt Arithmetic shift left gt lt Arithmetic shift right gt 4 applied instructions D j n xO Xl gg ms pesims PNE After once High execution Low i rir rjo o o o o 0 0 0 0 00 0 r 4 7 2 Logic shift left LSL Logic shift right LSR 1 Summary Do logic shift right left for the numbers Logic shift left LSL 16 bits LSL Execution Normally ON OFF Suitable condition rising falling edge Hardware Software Logic shift right LSR 16 bits LSR Execution Normally ON OFF Suitable condition rising falling edge Models Hardware Software requirement requirement 2 Operands Function Data Type ID Source data address 16 bits 32 bits BIN Arithmetic shift left right times 16 bits 32bits BIN 3 Suitable soft components pjm m m ox by m ps ku p 1l li L1 eee eee 4 applied instructions After once execution the low bit 1s filled in 0 the final bit 1s stored in carry flag ISL meaning and operation are the same as
132. arity Odd Even No Check Stop bit 1 bit 2 bits Start bit 1 bit Stop bit 1 bit User can set a start stop bit then PLC will automatically add this start stop bit when sending data remove this start stop bit when receiving data Start bit and stop bit can be seemed as header and frame end If slave station has start and stop bit they can be set in software or protocol Communication Format 8 bits 16 bits If choose 8 bits buffer format to communicate in the communication process the high bytes are invalid PLC only use the low bytes to send and receive data If choose 16 bits buffer format to communicate when PLC is sending data PLC will send low bytes before sending higher bytes i 7 3 2 Suitable condition H When can we use free format communication In the last chapter XINJE PLC communicates with temperature controller the controller use own protocol The protocol said that 4 characters should be sent when temperature read write oo o pasm NN C T PLC needs to send the ASCII code of above character to the controller The ASCII code of characters o 8A 0 0 0 0 R 8 0 O CRD PLC cannot use Modbus protocol to communicate with the controller The free format communication should be used Please see the details in the following chapter 7 3 3 Instruction form B Summary Write the local specified data to the specified station s specified ID Send data SEND 16 bits SEND 32 bits FER
133. atus E g 1 2 2 Alternation Convert the above two methods freely Ladder 1 3 Program Format Direct Input The above two program methods can input in the correspond interface separately especially in the ladder window there is a instruction hint function which improves the program efficiency greatly PLCl Ladder M8000 TO K100 Panel Configuration As in XC series PLC there are many instructions which has complicate usage and many using methods like pulse output instruction main unit PID etc XCPPro also support the configure interface for these special instructions In the correcpond configure interface input the parameters and ID according to the requirements will be ok r PID Instruction Parameter Config Measure Value FY Target Value S D0 Parameter Config Manual Sampling Time Froportion Gain KP Integration Time TI 100ms Differential Time TD x 1 ms FID Computation Scope FID Control Death Band e 12 c m d peu eeu A y 3 s T self Study Periodic Value Overshoot Config Enable vershoot Disable Overshoot Each time adjust the increase 100 Current target value resident C 110 Parameter D4000 Output Y Mode Config Common Mode O Advanced Mode Input Filter Constant Differential Increase Output Upper Limit Value 4095 Limit Value Output Lower Direction Config Negative Movement
134. bus function a 7 1 2 Communication Parameters a Modbus Station number 1 254 255 FF is free format communication Station Baud Rate 300bps 115 2Kbps Data Bit 8 bits data 7 bits data Stop Bit 2 stop bits 1 stop bit Parity Even Odd No check The default parameters of COM 1 Station number is 1 baud rate is 19200bps 8 data bit 1 stop bit Even parity Set the parameters with the COM ports on XC series PLC Function Communication mode Description 255 is free format 1 254 bit is Modbus station number Communication format Baud rate data bit stop bit parity ASC timeout judgment time Unit ms if set to be O it means no timeout waiting Reply timeout judgment time Start symbol End symbol Unit ms if set to be O it means no timeout waiting High 8 bits invalid High 8 bits invalid Free format setting Communication mode Communication format ASC timeout judgment time Reply timeout judgment time 8 16 bits cushion with without start bit with without stop bit 255 is free format 1 254 bit is Modbus station number Baud rate data bit stop bit parity Unit ms if set to be O it means no timeout waiting Unit ms if set to be O it means no timeout waiting Start symbol End symbol High 8 bits invalid High 8 bits invalid 8 16 bits cushion Free format setting with without start bit with without stop bit 255 1s free format 1 25
135. cify the source data block or soft component 16 bits BIN bit address code Specify the target soft components address code 16 bits BIN bit Specify the move data s number 16 bits BIN 3 Suitable soft components Word Operands p m m m x oy pu rs ku E we de e e e ea 01 D m eo ee e e Ee Ee og Oper system s dde ey p nr rc D leie te J Move the specifed n data to the specified n soft components in form of block Cs n Lu E PMOV D5 D10 K3 D5 DIO i D6 D11 gt n 3 D7 DI2 A 4 applied instructions The function of PMOV and BMOV is mostly the same but the PMOV has the faster speed PMOV finish in one scan cycle when executing PMOV close all the interruptions Mistake many happen if there is a repeat with source address and target address 4 5 6 Fill Move FMOV 1 Summary Move the specified data block to the other soft components Fill Move FMOV Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Hardware DFMOV need above V3 0 Software 2 Operands S Specify the source data block or soft component 16 bits BIN bit address code Bm Specify the target soft components address code 16 bits BIN bit Specify the move data s number 16 bits BIN 3 Suitable soft component p m m m ox by m o
136. connect PLC inside and input terminals The input relays have countless normally ON OFF contactors they can be used freely The input relays which are not connected with external devices can be used as fast internal relays Output Relay Y PLC s output terminals can be used to send signals to external loads Inside PLC output relay s external output contactors including relay contactors transistor s contactors connect with output terminals The output relays have countless normally ON OFF contactors they can be used freely The output relays which are not connected with external devices can be used as fast internal relays Execution Order XC series PLC CPU unit Program Dispose Area X puw ndu gary ogeu jnduq gary ogeu mdmo A PUW mdmo yndyno eusis eux T E ec CD e p Un E ga jew p a c ec Input Disposal y Before PLC executing the program read every input terminal s ON OFF status of PLC to the image area y Inthe process of executing the program even the input changed the content in the input image area will not change However in the input disposal of next scan cycle read out the change Output Disposal y Once finish executing all the instructions transfer the ON OFF status of output Y image area to the output lock memory area This will be the actual output of the PLC y The contacts used for the PLC s external output will act according
137. ddress Address Write Parameters j code code code code 42H the written written data data PV Alarm Read write Read write CRC high value status bytes aA nd So if write data string according to the communication objects protocol use SEND and RCV commands from free format communication user will get the communication with the objects
138. default to allow interruption Via program with DI instruction set interruption forbidden area Allow interruption input between EI DI If interruption forbidden is not required please program only with EI program with DI is not required i Every input interruption is equipped pus with special relay M8050 M8052 to M8050 disable interruption In the left program if use MO to set M8050 ON then disable the interruption input at channel 0 IRET interruption forbidden g 11 4 2 Time Interruption a In the condition of main program s execution cycle long if you need to handle a special program or during the sequential scanning a special program needs to be executed at every certain time time interruption function is required This function is not affected by PLC s scan cycle every Nm execute time interruption subroutine FEND 14010 M8000 INC DO IRET Time interruption is default 1n open status time interruption subroutine is similar with other interruption subroutine it should be written behind the main program starts with 140xx ends with IRET There are 1OCH time interruptions The represent method is I40 49 tese means time interruption s time unit is ms For example I4010 means run one channel time interruption every 10ms Interruption Interruption Description Forbidden
139. dress is PLC station no 2 Function code is Modbus RTU protocol read write code 3 Register address is the PLC modbus address please see chapter 7 2 2 4 Data contents is the value in D2 5 CRC CHECK Low CRC CHECK High is low bit and high bit of CRC check value If 2 piece of XINJE XC series PLC communicate with each other write K5000 to D2 MO REGW K1 H0002 K5000 K2 MO is trigger condition If the communication is failure the instruction will try twice again If the third time communication is failure the communication ends The relationship between REGW and Modbus RTU protocol other instructions are the same REGW Function code 06H H0002 Modbus address K5000 Data contents 1388H The complete communication data are 01H 06H OOH 02H 13H 88H _ system take the CRC checking automatically If monitor the serial port data by serial port debugging tool the data are 01 06 OO 02 13 88 25 5C Note the instruction doesn t distinguish decimal hex binary hex octal etc For example B10000 K16 and H10 are the same value so the following instructions are the same REGW KI B111110100 DI K2 REGW KI K500 DI K2 REGW KI HIF DI K2 i 7 2 4 Communication Instructions H Modbus instructions include coil read write register read write below we describe these instructions 1n details The operand definition in the instruction 1 Remote communication station and serial port number For example one
140. e MRGW 16 bits MRGW 32 bits PP a Od Execution Normally ON OFF rising Suitable XC2 XC3 XC5 XCM XCC Hardware Software Requirement Requirement 2 Operands Specify the remote communication station Specify the remote register first address Specify the register quantity Specify the local register first address Specify the serial port no 3 Suitable soft components Operands 16bits BIN 16bits BIN 16bits BIN 16bits BIN 16bits BIN K3 a Serial port K1 K3 Operand D3 the max register quantity is 59 MRGW KI K500 Instruction to write the multiply registers Modbus function code is 10H When XO is ON execute REGW or MRGW instruction set communication flag after execution the instruction when XO is OFF no operation If error happens during communication resend automatically If the errors reach 4 times set the communication error flag The user can check the relative registers to judge the error H C000 000 9 e Wiring method There are two wiring methods A RS232 wiring method COM2 diagram 4 RxD 5 IxD 6 GND Mini Din 8 Pins port Note 1 COM with 1 only show the RS232 pins The RS485 pins are external terminal which is not listed 2 XC series PLC RS232 cannot support full duplex it only can communicate in single direction 3 The communication distance of RS232 is not far about 13m RS485 can be further B
141. e even ID The same device may be used a source and a destination If this is the case then the result changes after every scan cycle Please note this point ON the calculate result is zero M8020 Zero OFF the calculate result is not zero ON the calculate result is over 32767 1 6bits or 2147483647 32bits M8021 Borrow OFF the calculate result is not over 32767 16bits or 2147483647 32bits ON the calculate result is over 32767 16bits or 2147483647 32bits M8022 Carry OFF the calculate result is not over 32767 16bits or 2147483647 32bits The assignment of the data The data register of XC series PLC is a single word 16 bit data register single word data only engross one data register which is assigned by single word object instruction The disposal bound is Dec 327 68 327 67 Hex 0000 FFFF single word object instruction D NUM D NUM gt gt Objectdata Double word 32 bit engrosses two data register it s composed by two consecutive data registers the first one is assigned by double word object instruction The dispose bound is Dec 214 748 364 8 214 748 364 7 Hex 00000000 FFFFFFFF 4 applied instructions Double word object instruction D NUM 1 D NUM Object data The denote way of 32 bits instruction If an instruction can not only be 16 bits but also be 32 bits then the denote method for 32 bits instruction is to add a D before 16 bits instruction E g ADD DO
142. e frequency as 72KHz then set value in S2 is 720000 When X000 is ON output PWM wave when X000 is OFF stop output PMW output doesn t have pulse accumulation In the left graph TO 1 f T T0zn 256 11 2 Frequency Testing 1 Instruction s Summary Instruction to realize frequency testing frequency testing FROM 16 bits FROM 32 bits instruction instruction execution XC2 XC3 XC5 XCM condition models requirement requirement 2 Operands Operands Function Type SI Specify the sampling pulse quantity or soft component s 32 bits BIN ID number Specify the frequency division value 32 bits BIN Specify the pulse input port bit specify the tested result s soft component s number 32 bits BIN 3 Suitable Soft Components Tm e pw e ww ww ww oo s LIII IILI s OC Eee Operands System GS s FRQM K20 D100 KI X003 Sl sampling pulse quantity the number to calculate the pulse frequency this parameter can be changed as the frequency generally the higher the frequency the larger the pulse quantity D tested result the unit is Hz S2 Frequency division choice Range K1 or K2 Whatever K1 or K2 the effect is the same Testing frequency range is 1 200KHz The testing precision will change when the frequency increasing 1 80KH z precision is 100 80 200KHZz precision is 99 5
143. e is completed but the parameters are not the best and need to be modified by users Every adjustment percent of current target value at auto tune process finishing transition stage S3 10 This parameter is effective only when S3 9 is 1 If doing PID control after auto tune small range of overshooting may be occurred It is better to decrease this parameter to control the overshooting But response delay may occur if this value is too small The defaulted value is 100 which means the parameter is not effective The recommended range is 50 80 Cutline Explanation Current target value adjustment percent is 2 3 S3 10 67 the original temperature of the system is 0 C target temperature is 100 C the current target temperature adjustment situation is shown as below Next current target value current target value final target value current target value x 2 3 So the changing sequence of current target is 66 C 88 C 96 C 98 C 99 C 100 C X 100 Target value 96 88 66 j Henne nennen nne neenieeen nnne enne nennen nennen Current target 1 Current system value t The stay times of the current target value in auto tune process finishing transition stage S3 11 This parameter is valid only when S3 9 is 1 If entering into PID control directly after auto tune small range of overshoot may occur It is good for preventing the overshoot if increasing this parameter properly But i
144. e is outputting The pulse stops output when the pulse quantity reaches the limit value And the M8170 is off MO is off Continuous pulse output 1 A I When the pulse quantity reaches the limited value i Set the pulse stop output frequency gt 0 T1 12 t M8170 Note T1 is pulse start time T2 is pulse end time Mode4 changeable frequency limited quantity pulse output PLSF with direction 1 Instruction Summary Instruction to generate changeable frequency limited quantity pulse with direction Variable frequency limited quantity pulse output with direction PLSF 16 bits PLSF 32 bits DPLSF mena tt fn Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC ee a ee Hardware V3 3 and above Software V3 3 and above Mem mo meme c 2 Operands Specify the frequency or register ID 16 bits 32 bits BIN Specify pulse quantity or register ID 16 bits 32 bits BIN Specify pulse output port bit Specify pulse direction output port bit 3 suitable soft components operands 16 bit instruction form GO GO Qu Ge DO D2 PLSF YO Y2 n RST MO Frequency range 5Hz 32767Hz when the set frequency is lower than 5Hz output 5Hz Pulse quantity range KO K32767 Pulse can only be output at YO or Y1 The negat
145. e or save in the soft 16 bits 32 bits BIN element Write in target soft element 16 bits 32 bits BIN Write in target soft element start address 16 bits 32 bits BIN Write in data quantity bit 3 Suitable soft components p m m m ox by m os ku D Cae oe ee ee a ee ret te J L1 mai i r pL epe n eie qelwege p p lt Written of a word gt X0 P DO il FWRT FDO Write value in DO into FDO lt Written of double word gt lt Written of multi word gt 9 m v2 DO FDO K3 FWRT x ww E f DFWRT DO FDO I Write value in D0 D1 into FDO FDI Write value in D0 D1 D2 into FDO FDI FD2 X1 FWRT instruction only allow to write data into FlashRom register In this storage even battery drop data could be used to store important technical parameters X2 Written of FWRT needs a long time about 150ms so frequently operate this operate this operate operation is 4 applied instructions recommended X3 The written time of Flshrom is about 1 000 000 times So we suggest using edge signal LDP LDF etc to trigger X4 Frequently written of FlashROM 4 5 8 Zone set MSET 1 Summary Set or reset the soft element in certain range Multi set MSET Normally ON OFF Suitable Models Software requirement Function Start soft element address End soft element address MSET
146. eans urgent stop S1 8 start frequency of section 1 S1 10 end frequency of section 1 3 SlI 12 pulse quantity of section 1 1414 start frequency of section 2 S1 16 end frequency of section 2 S1 18 pulse quantity of section 2 1420 start frequency of section 3 1422 end frequency of section 3 1 24 pulse quantity of section 3 and so on user can set section N parameters The parameters address starts from Dn or FDn In the above example DI DO is pulse section quantity D5 D4 is pulse direction D7 D6 is pulse falling frequency D9 D8 is start frequency of section 1 D11 D10 is end frequency of section 1 DI3 D12 is the pulse quantity of section 1 The max section quantity can be 255 Pulse output YO Y1 the pulse output terminal is different for each model If pulse quantity of section m is 0 this means the pulse quantity is unlimited If pulse quantity of section m is O the start frequency must be equal to the end frequency otherwise this section will not be executed If pulse quantity is not 0 the pulse direction is decided by the positive negative of pulse If the pulse quantity is O the pulse direction is set through S 1 4 S1 6 is the slow stop slope when executing PSTOP refer to PSTOP instruction Pulse parameters occupy the register size N 3 4 N 3 4 N 4 4 5 2 The instruction is executed at the rising edge if the signal is normally close the instruction
147. ect the public serial New bus contacts line start MCR Clear the public serial Bus line contacts return ALT The status of the assigned Alternate device is inverted on every state operation of the instruction X YU M SU TU CL Dn m END Force the current program END scan to end B GROUPE Group End il ALT 3 20 LD ILDI OUT M nemonic and Function Format and Operands LD Initial logic operation LoaD contact type NO dee a Normally Open Operands X YO M SO TO CU Dn m FDn m LDI Initial logic operation mm LoaD Inverse contact type NC C Normally Closed Devices XL YU ML SHLJ TL C Dn m FDn m Final logic operation C Yo i type drive coil Operands X YU MU SU TU CU Dn m Statement Connect the LD and LDI instructions directly to the left bus bar Or use them to define a new block of program when using ANB instruction OUT instruction is the coil drive instruction for the output relays auxiliary relays status timers counters But this instruction can t be used for the input relays Can not sequentially use parallel OUT command for many times For the timer s time coil or counter s count coil after using OUT instruction set constant K is necessary For the constant K s setting range actual timer constant program s step re
148. ecute the interruption subroutine at each specified interruption loop tine Use this interruption in the control which requires it to be different with PLC s operation cycle Action order of input output relays and response delay y Input disposal Before PLC executing the program read all the input terminal s ON OFF status of PLC to the 1mage area In the process of executing the program even the input changed the content in the input image area will not change However in the input disposal of next scan cycle read out the change y Output disposal Once finish executing all the instructions transfer the ON OFF status of output Y image area to the output lock memory area This will be the actual output of the PLC The contacts used for the PLC s exterior output will act according to the device s response delay time When use this input output format in a batch the drive time and operation cycle of input filter and output device will also appear response delay Not accept narrow input pulse signal PLC s input ON OFF time should be longer than its loop time If consider input filter s response delay 10ms loop time is 10ms then ON OFF time needs 20 ms separately So up to 1 000 204 20 225Hz input pulse can t be disposed But this condition could be improved when use PLC s special function and applied instructions Dual output Dual coils action As shown in the left map please consider Y the things o
149. ed VL with slope K and move towards origin Decelerate to 0 with slope K when touching the origin Start to delay delay time is FD8209 the unit is ms Accelerate to creep speed with slope K Stop after leaving the origin at creep speed Change the pulses D8170 to setting value Note in this mode please keep the origin limit switch ON during the process from touching the origin limit switch at speed VL to stop origin returning Mode2 Limit Origin Origin Description Move towards origin at speed VH decelerate to 0 with slope K when touching the limit signal Start to delay delay time is FD8209 the unit is ms Accelerate to speed VH with slope K after delaying Run at speed VH Decelerate to 0 with slope K when encountering the origin Accelerate to speed VL with slope K and move toward origin Decelerate to 0 with slope K when touching the origin Start to delay delay time is FD8209 the unit is ms Accelerate to creep speed with slope K after delaying Start to count Z phase signal after leaving origin at creep speed Stop origin returning when cumulative value of Z phase signal is equal to setting value Change the pulses to setting value D8170 Note in this mode please keep the origin limit switch ON during the process from touching the origin limit switch at speed VL to stop origin returni
150. en T200 accumulate 10ms clock pulse based on the current value when the accumulation value reaches the set value K200 the timer s output contact activates Le the output contact activates 2s later If XO breaks the timer resets the output contact resets Both OUT and TMR can realize the time function But if use OUT the start time is 0 if use TMR the start time is 1 scan cycle odA uone nuun2 v Specify the set value Timer Value Action Example X1 K2000 t1 L2 t1 t2 20s i Siae lt the set value Y X2 Constant K If X001 is ON then T300 accumulate 10ms clock pulse based on the current value when the accumulation value reaches the set value K2000 the timer s output contact activates Le the output contact activates 2s later Even if XO breaks continue to accumulation on re starting the timer will The accumulation time 1s 20ms If X002 1s ON the timer will be reset the output contacts reset T10 is the timer with 100ms as the unit Specify 100 as the constant then B T10 K100 0 1s 100z10s timer works Register D Write the value of indirect X0 data register in the MOV K200 D5 program or input by value X1 switch TIO DS If set as the retentive register make sure the battery voltage is enough the be unstable Or value will Timer TO T599 is 16 bits linear increment mode 0 K32767 when
151. en among 100 1000 times of PLC scan periods PID Operation Zone S3 6 PID control is entirely opened at the beginning and close to the target value with the highest speed the defaulted value is 4095 when it entered into the PID computation range parameters Kp Ti TD will be effective See graph below output value i FID operation area target value mim eke qul ee memi neminem p peni fenem demde agn ee ce uem s quu ee guxul aud PID open completely time t If the target value is 100 PID operation zone is 10 then the real PID s operation zone is from 90 to 110 Death Region S347 If the detected value changed slightly for a long time and PID control is still in working mode then it belongs to meanless control Via setting the control death region we can overcome this condition See graph below output value next value current value last value time t Suppose we set the death region value to be 10 Then in the above graph the difference is only 2 comparing the current value with the last value It will not do PID control The difference is 13 more than death region 10 comparing the current value with the next value this difference value is larger than control death region value it will do the PID control with 135 8 4 Auto Tune Mode If users do not know how to set the PID parameters they can choose auto tune mode which can find the best control parameters sampling time propo
152. ent segment means segment n The low 16 bits of the current accumulated current pulse number The high 16 bits of the current accumulated current pulse number The low 16 bits of the current accumulated current pulse number The high 16 bits of the current accumulated current pulse number The low 16 bits of the current accumulated current pulse number The high 16 bits of the current accumulated current pulse number The low 16 bits of the current accumulated current pulse number The high 16 bits of the current accumulated current pulse number The error pulse segment s position The error pulse segment s position The error pulse segment s position The error pulse segment s position Specification Only XCS5 32RT E 4PLS model has D8218 PULSE_5 The error pulse segment s position EE Absolute position relative position back to origin Rising time of the absolute relation position D8230 instruction YO PULSE 1 ER Falling time of the origin return instruction Y0 Rising time of the absolute relation position instruction Y 1 PULSE 2 Falling time of the origin return instruction Y1 Rising time of the absolute relation position instruction Y2 Bn NEN D8231 Falling time of the origin return instruction Rising time of the absolute relation position Falling time of the origin return instruction Y3 Rising time of the absolute relation position PULSE 5 instruction Falling time o
153. ential PID adjustment band width overshoot permission l not overshoot response method S34 10 current target value adjustment percent in auto tune finishing transition stage S3411 current target value resident count in auto tune finishing transition stage 3 12 34 39 occupied by PID operation s internal process Below is the ID of advanced PID mode setting S341 0 no differential gain E 8 3 2 Parameters Description i Movement Direction Positive movement the output value MV will increase with the increasing of the detected value PV usually used for cooling control gt Negative movement the output value MV will decrease with the increasing of the detected value PV usually used for heating control Mode Setting Common Mode The parameter s register zone is from S3 to 3 43 S3 to S3 11 needs to be set by users 3 12 to S3 43 12 are occupied by the system users can t use them gt Advanced Mode The parameter s register zone is from S3 to S3443 S3 to S3 11 and S3 40 to S3 43 need to be set by users S3 12 to S3 39 are occupied by the system users can t use them e Sample Time S3 The system samples the current value according to certain time interval and compare them with the output value This time interval is the sample time T There is no requirement for T during AD output T should be larger than one PLC scan period during port output T value should be chos
154. entive zone 512 S1023 Start tag of ED power off retentive ED FD8207 EDO ED36863 zone For timer T we can set not only retentive zone but also set certain timer s retentive zone Soft Set area Function R etentive Zone Components FD8323 Set the start tag of 100ms not accumulation timer s The set value T99 Paine e m m ee FD8324 Set the start tag of I00ms accumulation timer s retentive The set value T199 FD8325 Set the start tag of 10ms not accumulation timer s The set value T299 Paine e m nm tm T FD8326 Set the start tag of 10ms accumulation timer s retentive The set value T399 FD8327 Set the start tag of Ims not accumulation timer s The set value T499 Wl ER E Dee FD8328 Set the start tag of Ims accumulation timer s retentive The set value T599 zone FD8329 Set the start tag of Ims precise timer s retentive zone The set value T639 For counter C we can set not only retentive zone but also set certain counter s retentive zone Soft Set area Function R etentive Zone Components FD8330 Set the start tag of 16 bits positive counter s retentive The set value C299 FD8331 Set the start tag of 32 bits positive negative counter s The set value C599 C nd retentive zone FD8332 Set the start tag of single phase HSC s retentive zone The set value C619 FD8333 Set the start tag of dual direction HSC s retentive zone The set value C629 FD8334 Set the start tag of AB phase HSC s r
155. ents Operands CORCECNUNEC K500 K3 DI K2 INRR Instruction to read the input registers Modbus function code is 04H Serial port K1 K3 Operand S3 the max input register quantity is 61 When XO is ON execute REGR or INRR instruction set communication flag after execution the instruction when X0 is OFF no operation If error happens during communication resend automatically If the errors reach 4 times set the communication error flag The user can check the relative registers to judge the error 1 summary Instruction to write the local specified register into the specified station s specified register Single register write REGW 16 bits REGW 32 bits a a Execution Normally ON OFF rising edge Suitable XC2 XC3 XC5 XCM Hardware Software Meme emeen 2 Operands Specify the remote communication station Specify the remote register first address Specify the local register first address 16bits BIN Specify the serial port no 16bits BIN 3 Suitable soft components gt lm gt w e x we ow s xm 5 oo m 1 1 d 1 ll dl ae a NE ee ee C 9 eee eee 32 K ONCE RE REGW KI K500 DI K2 Write the single register Modbus function code is 06H Serial port K1 K3 1 Summary Instruction to write the local specified register to the specified station s specified register Multi register writ
156. equency until the condition is off It is fit for changeable frequency limited quantity pulse output When MO is ON PLSF output the pulse at YO with frequency DO Dword pulse quantity D2 Dword M8170 is ON when the pulse is outputting The pulse stops output when the pulse quantity reaches the limit value And the M8170 is off MO is off Continuous pulse output i f When the pulse quantity Set frequency reaches the limited value the pulse stop output 0 Set frequency C9 M8170 When the pulse quantity reaches the limited value the pulse stop output 6 2 3 Multi segment pulse control at relative position PLSR PLSR DPLSR instruction has two control modes Below we will introduce one by one Mode 1 segment single direction pulse output PLSR 1 Instruction Summary Generate certain pulse quantity segmented with the specified frequency and acceleration deceleration time Segmented single direction pulse output PLSR 16 bits PLSR 32 bits DPLSR e Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC Hardware Software 2 Operands Specify the soft component s start ID of the segmented 16 bit 32 bit BIN pulse parameters Specify acceleration deceleration time or soft component s 16 bit 32 bit BIN ID Specify the pulse output port 3 su
157. er Address HEX 2100 Ron ster hdd eee Dena The result after adding User Define Control Inverter Action Inverter Status Read Into Add Edit Delete Type Address X1 Frequency inverter instructions will not expand in the block g 10 3 6 Free format communication item a Add free format communication instructions in the block For example select send instruction first address set to DO serial port is 2 16 bits dd Edit Delete Upwards Downuwar ds serialFort Config 9 Send Reev First Address 00 rom come cons O Sbit 9 iBbit There are two methods to set the data Const data is to set the value directly Reg is to set the value via register Free Comm Contig Check Dut e Const Data 100 Q Rez Length Q Const Data Reg Change to check out tab select the checking mode Free Comm Contig Data Check Out Sum Start Address Du BCC C3 LEC Modbus ASCII Check Out Length 5 E 9 CRC Modbus RTI Besides it needs to set the communication parameters Click serial port config Free Format Communication Contig Skip Comment 2e Format Communication Config Add Edit Delete Upwards Downwards SerialPort Config Eig PLC Config fea Password Communication Mode PLC Serial Port om a Modbus Num Be User Protocol Overtime Set ms Module
158. er PLC can real time communicate with slave PLCs Special Function Instructions In this chapter we mainly introduce PWM pulse width modulation frequency detect precise time interruption etc 11 1 PWM Pulse Width Modulation 11 2 Frequency Detect 11 3 Precise Time 11 4 Interruption Instructions List Circuit and soft components Chapter Pulse Width Modulation Frequency Detection Output pulse with the specified occupied pS ratio and frequency Frequency Detection STR Precise Time STRR rond Precise Time Register STRS Interruption 11 1 PWM Pulse Width Modulation 1 Instruction s Summary Instruction to realize PWM pulse width modulation PWM pulse width modulation PWM 16 bits PWM 32 bits instruction instruction execution normally ON OFF coil suitable condition models hardware software requirement requirement 2 Operands Function Type Type number number bit specify the pulse output port bit PWM K100 D10 YO The occupy ratio n 1 255 Output pulse f 0 72KHz Pulse is output at YO or Y 1 Please use transistor output The output occupy empty ratio of PMW n 256X 100 PWM output use the unit of 0 1Hz so when set S2 frequency the set value is 10 times of the actual frequency i e 10f E g to set th
159. eration deceleration time is specified by D8230 single word The relative drive form means move from the origin position the position from origin to target position Confirm the value of current position registers D8171 D8170 YO D8174 D8173 Y1 The current position of X axis is 100 0 it will move to target position 3000 0 at the speed of 1000Hz pulse output terminal is YO direction terminal is Y4 The distance between origin and target position is 3000 The DRVA executing diagram is shown as below A Y start 100 0 target 3000 0 origin 0 0 rn x Absolute position 3000 Program M002 DMOV K3000 DO DMOV K1000 D2 MO DDRVA DO D2 Y0 Y4 M8170 un l CRD 6 2 10 Absolute position multi segment pulse control PLSA PLSA DPLSA has two control modes below we will introduce one by one 1 Instruction Summary Generate absolute position segmented pulse with the specified frequency acceleration deceleration time and pulse direction Absolute position multi segment pulse control PLSA 16 bits PLSA 32 bits DPLSA PH Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC Hardware Software 2 Operands Function Type S1 Specify the soft component s number to output the pulse 16 32bit BIN parameters Specify the acceleration deceleration time or soft component s 16 32 bit BIN
160. erted output the PLC s output lt Reading of inverted input gt 4 applied instructions X0 ME The sequential control instruction in the left could be denoted by the following AT CML instruction Aa M8000 CML DXO0 DMO X17 AF j 000 4 6 9 Negative NEG 1 Summary Get the negative number Negative NEG 16 bits NEG DNEG Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands m The source number address 16 bits bits BIN 3 Suitable soft components Tw e w e ww www xn o ao NEG D10 D10 1 D10 The bit format of the selected device is inverted I e any occurrence of a 1 becomes a 0 and any occurrence of 0 becomes 1 when this is complete a further binary 1 is added to the bit format The result is the total logic sigh change of the selected devices contents 4 applied instructions 4 7 Shift Instructions WSFL WSFR T 4 applied instructions 1 Summary Do arithmetic shift left right for the numbers Arithmetic shift left SHL 16 bits SHL DSHL Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software Arithmetic shift right SHR 16 bits SHR DSHR Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge H
161. esult is stored in D44 D44 add D30 instrument s station the result is saved in D52 Move D52 into D54 Logic AND D54 with HFF save the result in D16 Move D52 into D56 M8002 MOV Kl D30 1200 T200 K4 MW Er T200 MIO MIO Mil ll y MOV H52 D31 FMOV KO D40 D56 ADD D30 H80 D40 MOV D40 D10 MOV D40 D11 MOV D31 D12 MOV D33 D13 MOV KO D14 MOV KO D15 MUL D33 K256 D42 ADD D42 K82 D44 ADD D44 D30 D52 MOV D52 D54 WAND D54 HFF D16 MOV D52 D56 ROR D56 K8 WAND D56 HFF D17 Right shift 8 bits with D56 convert the high Sbits to the low 8 bits Logic AND D56 with HFE save the result in D17 M11 MIO M y MOV H43 D32 FMOV KO D40 D56 ADD D30 H80 D40 MOV D40 D10 MOV D40 D11 MOV D32 D12 MOV D33 D13 MOV D34 D42 WAND D42 HFF D14 MOV D34 D44 ROR D44 K8 WAND D44 HFF D15 MUL D33 K256 D46 ADD D46 K67 D48 ADD D48 D34 D50 ADD D50 D30 D52 MOV D52 D54 WAND D54 HFF D16 MOV D52 D56 ROR D
162. etentive zone The set value C639 X 1 if the whole power off retentive zone is smaller than the segment s retentive area then the segment s area is invalid If the total counter s set range is T200 T640 FD8324 value is 150 then the 100ms accumulate timer s retentive area T150 T1909 is invalid 2 41 Input output relays XO Y Number List XC series PLC s input output are all in octal form each series numbers are listed below Series Name 10I O 16 I O 24 I O 32 I O ue e aro aio om hi 32 I O pe e eee emer ijt pup O EACE FEDEA Series Name 48 60 14 I O 16 I O 24 32 I O 48 60 I O HS 24 32 I O X0 X15 X0 X33 X0 X7 X0 X7 14 18 28 36 X0 X21 X0 X43 YO Y11 YO Y23 YO Y5 YO Y7 10 14 20 24 YO Y15 YO Y27 Range Points Series Name 48 60 14 O 24 32 I O 48 60 T O 14 I O 124 32 I O X0 X15 X0 X33 X0 X7 14 18 28 36 X0 X21 X0 X43 YO Y 11 YO Y23 YO Y5 10 14 20 24 YO Y15 YO Y27 er1es ame 24 32 I O 48 60 I O 24 32 I O 48 60 I O X0 X15 X0 X33 14 18 28 36 XO0 X21 XO0 X43 YO Y 11 YO Y23 10 14 20 24 YO Y15 YO Y27 Range Points sete weep Le SE 24 I O 32 I O 48 I O 2417 0 32 1 0 48 I O XCM Function XC series PLC CPU unit m 3 ec T 3 e pi X jndu eusig eux A PUW yndino j1ndin eusis eux Input Relay X PLC s input terminals are used to accept the external signal input while the input relays are a type of optical relays to
163. expf float x Exponent e x of a nature data double fabs double x float fabsf float x Absolute value of parameter x double floor double x float floorf float x Return the largets dounble integral which is smaller or equals with x double fmod double x double If y is not zero return the float fmodf float x float y y reminder of floating x y Break floating data x to be double frexp double val int float frexpf float val int mantissa and exponent x _far exp _far exp m 2 exp return the mantissa of m save the logarithm into exp double ldexp double x int float ldexpf float x int X multipy the two to the power exp exp of n is x 2 n double log double x float logf float x Nature logarithm logx double logl1O double x float log10f float x logarithm log10x Break floating data X to be double modf double val float modff float val float integral part and decimal part double pd pd return the decimal part save the integral part into parameter ip double pow double x double float powf float x float y Power value of parameter y x y aes sin double x float sinf float x sine sine function Hyperbolic sine function sinh x e x e x 2 double sqrt double x float sqrtf float x Square root of parameter X double tan double x float tanf float x Hyperbolic tangent function double tanh double x float tanhf float x tanh x z e x e x e 2 e
164. f the origin return instruction Note for frequency rising time of absolution relative positioning instruction the register setting value should meet the following formula Rising time ms X max frequency Register D8230 D8232 100K For example instruction DRVA K300080 K3000 YO Y4 rising time is 100ms Then register D8230 Dword 32 100 ms X 3000 Hz 100K H2 Communication Function This chapter mainly includes basic concept of communication Modbus communication free communication and CAN bus communication 7 1 Summary 7 2 Modbus Communication 7 3 Free Communication 7 4 CAN Communication Relative Instructions Mnemonic Circuit and Soft Components Chapter MODBUS Communication COLR COLR S1 S2 S3 D1 D2 weR 1 2 3 01 COLW COLW DI D2 S1 S2 MCLW MCLW D1 D2 D3 S1 REGR REGR SL 92 4 93 Di NRR 1 2 3 Di REGW REGW 01 02 1 2 MRGW MAGW D1 02 Free Communication CAN bus Communication i 7 1 Su
165. f using the same coil Y003 at many positions Y E g X0012ON X0022OFF gs Y At first X001 is ON its image area is ON output Y004 is also ON oot When executing dual output use dual coil But as input X002 is OFF the image area the back side act in prior of Y003 is OFF So the actual output is YOO3 OFF Y004 ON Basic Program Instructions In this chapter we tell the basic instructions and their functions 3 1 Basic Instructions List 3 20 LD LDI OUT 3 3 AND ANT 3 4 OR ORI 3 50 LDP LDF ANDP ANDF ORP ORF 3 60 LDD LDDI 3 70 ORB 3 80 ANB 3 91 MCS MCR 3 10 ALT 3 11 PLS PLF 3 12 SET RST 3 13 OUT RST Aim at counter device 3 14 NOP END 3 15 GROUP GROUPE 3 16 Items to be attended when programming 3 1 Basic Instructions List All XC1 XC2 XC3 XC5 XCM series support the below instructions Initial logical operation m contact type NO normally C LD LoaD LDD LoaD Directly LDI LoaD Inverse LDF LoaD Falling Pulse ANI AND Inverse open Read the status from the contact directly Initial logical operation contact type NC normally closed Read the normally closed contact directly Initial logical operation Rising edge pulse 2 3 6 2 3 6 5 Initial logical 5 3 3 3 6 3 3 3 6 3 3 3 3
166. for negative All calculations are algebraic processed 5 8 3 Ifthe result of a calculation is 0 the 0 flag acts If the result exceeds 323 767 16 bits limit or 2 147 483 647 32 bits limit the carry flag acts refer to the next page If the result exceeds 323 768 16 bits limit or 2 147 483 648 32 bits limit the borrow flag acts Refer to the next page When carry on 32 bits operation word device s low 16 bits are assigned the device following closely the preceding device s ID will be the high bits To avoid ID repetition we recommend you assign device s ID to be even ID The same device may be used as a source and a destination If this 1s the case then the result changes after every scan cycle Please note this point 4 applied instructions Flag meaning ON the calculate result is zero M8020 Zero OFF the calculate result is not zero ON the calculate result is less than 32768 16 bit or 2147483648 32bit OFF the calculate result is over 32768 16 bit or 2147483648 32bit E 4 6 2 Subtraction SUB L M8021 Borrow 1 Summary Sub two numbers store the result Subtraction SUB Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition p D lm Hardware Software 2 Operands Operands Function S1 The number address S2 The number address The result address 3 Suitable soft component gt gt m o ww www w o lo s 114114111 LI
167. gisters to judge the error 1 Summary Read the specified station s specified register to the local register Register read REGR 16 bits REGR 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable XC2 XC3 XC5 XCM Condition Models XCC Hardware Software Requirement Requirement 2 Operands S1 Specify the remote communication station 16bits BIN S2 Specify the remote register first address 16bits BIN S3 Specify the register quantity I6bits BIN DI Specify the local register first address Specify the serial port no I6bits BIN 3 Suitable soft components Operands TCA A UL DD K500 K3 DI K2 REGR Instruction to read the REGISTERS Modbus function code is 03H Serial port K1 K3 Operand 53 the max register quantity is 61 1 Summary Read the specified station s specified input register to the local register Read Input Register INRR 16 bits INRR 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable XC2 XC3 XC5 XCM Condition Models XCC Hardware Software Requirement Requirement 2 Operands S1 Specify the remote communication station 16bits BIN S2 Specify the remote register first address 16bits BIN S3 Specify the register quantity 16bits BIN DI Specify the local register first address I6bits BIN Specify the serial port no I6bits BIN 3 Suitable soft compon
168. gn M81 70 Pulse output address YO or Yl only XC5 series is YO Y3 3 axis is YO Y2 10 axis is YO Y11 S1 and S2 direction is same and the absolute value of S1 is greater than S2 After driving the instruction move to signal X3 with origin returning speed S1 When the closed point signal turns from OFF to be ON decrease the speed to be S2 When the closed point signal X3 turns from OFF to ON accelerate from origin returning speed to creeping speed S2 When the closed point signal X3 turns from ON to be OFF after one scanning period write to registers Y0 D8171 D8170 0 Y 1 D8174 D8173 0 when stopping pulse output No acceleration deceleration time when the instruction works at the beginning the pulse frequency changes from OHz to S1 suddenly The decrease time can be specified by D8230 D8239 please refer to chapter 6 6 for details 1 Summary High precision back to the origin Back to the origin ZRN Hes xe E Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC condition models V3 3 and higher V3 3 and higher 2 Operand bit it Soft element head address of origin back data block 32 bits BIN Soft element address of limit signal Soft element address of origin auxiliary signal S32 it S3 Soft element address of origin signal external bit D o me S4 Soft element address of Z phase signal external bit IF RR it D2 S2 ID Address of pulse o
169. he pulse output terminal is YO direction terminal is Y2 The start end frequency pulse absolute position is shown in below table Name Frequency A Hz Section 5 8000 NosHonc Section 4 een 6000 Section 7 Section 3 3200 Section Section 8 1500 1000 Section 1 Section 0 T1 I2 T3 T4 T5 To T7 TS TO t Ladder chart MO T PTOA D4000 YO Y2 Set the parameters Fast configure the parameters through the PTO config function N in XCPpro software PTO Config Instruction PTOA With Direction Reg Block Addr D4000 Output TU Direction Y2 Decreasing Frequence 0 Pulseunlimit Direction Add Edit Delete Upwards Downwards Start Frequence End Frequence Pulse Count 1000 1500 3000 1500 3 00 6200 5200 e6000 5200 6000 a000 18200 hz 103 60 ms 10 3 Caution because the pulse instruction occupy the register address D4000 D5205 these register addresses can t be used for other purpose 6 2 13 Pulse Stop PSTOP u 1 Summary Pulse stop instruction execute with PTO instruction Pulse Stop PSTOP 16 bits 32 bits PSTOP Instruction Instruction Execution Normally ON OFF coil Suitable XC3 XC5 XCM XCC Hardware V3 3 and higher version Software a S e 2 Operands S1 Specify pulse stop output port bit 3 suitable soft components
170. il first address I6bits BIN TCE S D COLW KI K500 Ml K2 Write the single coil Modbus function code is 05H Serial port K1 K3 Summary Write the local multi coil status into the specified station s specified coil Multi coil write MCLW 16 bits MCLW 32 bits instruction instruction Execution Normally ON OFF rising edge Suitable Models XC2 XC3 XC5 XCM Condition XCC Hardware Software Requirement Requirement 2 Operands Operands Function DI Specify the remote communication station 16bits BIN D2 Specify the remote coil first address 16bits BIN bit D3 Specify the coil quantity 16bits BIN S1 Specify the local coil first address bit S2 Specify the serial port no 16bits BIN 3 Suitable soft components Operands module p m m m ox oy ow bs xe e esed ues me pr Ie epe Dr a pq pec S2 K Operands System Loo System oo CM AN po I E EE K3 MI K2 MCLW KI K500 Instruction to write the multiply coils Modbus function code is OFH Serial port K1 K3 Operand D3 the max coil quantity is 952 When XO is ON execute COLW or MCLW instruction set communication flag after execution the instruction when X0 is OFF no operation If error happens during communication resend automatically If the errors reach 3 times set the communication error flag The user can check the relative re
171. il the condition is off It is fit for changeable frequency continuous pulse output 32 bit instruction form MO GU MS DPLSF DO YO Frequency range 5Hz 200KHz when the set frequency is lower than 5Hz output 5Hz Pulse can only be output at YO or Y 1 With the changing of setting frequency in DO the output pulse frequency changes at YO Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency continuous pulse output Continuous pulse output i Continuous output pulse with the set frequency until stop output via the instruction MO f A set frequency Note T1 is pulse start time T2 is pulse end time Mode2 changeable frequency continuous pulse output with direction PLSF 1 Instruction Summary Instruction to generate continuous pulse in the form of variable frequency with direction Variable Pulse Output with direction PLSF 16 bits PLSF 32 bits DPLSF Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC FS ee eee Hardware V3 3 and above Software V3 3 and above requirement requirement i 2 Operands Specify the frequency or
172. inal value is replaced We suggest the users to apply high speed counter only with HSCR and HSCW not with other instructions like DMOV LD gt DMUL etc and users must run after converting HSC to be other registers 5 7 HSC Reset M ode Reset HSC via software MO C600 K2000 H i MI C600 f H R In the above graph when MO is ON C600 starts to count the input pulse on X0 when M1 changes from OFF to be ON reset C600 clear the count value 5 80 AB Phase counter multiplication setting About AB phase counter modify the frequency multiplication value via setting FLASH data register FD8241 FD8242 FD8243 If the value is 1 it is 1 time frequency if it 1s 4 it 1s 4 time frequency MN 1 time frequency FD8241 Frequency multiplication of C630 4 4 time frequency 1 time frequency FD8242 Frequency multiplication of C632 FD8243 Frequency multiplication of C634 mM l 4 time frequency poy 1uouro1oug pow Ji qp os nq 5 9 HSC Example Below we take XC3 60 PLC as the example to introduce HSC s program form MO C600 K2000 l M1 C600 R 2 When MO is ON C600 starts the HSC with the OFF ON of X000 When comes the rising edge of M1 reset HSC C600 M8000 C600 K88888888 js HSCR C600 DO MI C600 fi R DO D2 D lt YO DO D2 DO D4 D2 _D lt Y
173. instructions 4 applied instructions 4 1 Applied Instruction List Program Flow Condition jump CJ Pn 4 34 CALL Call subroutine CALL Pn 4 3 2 Subroutine return SRET 4 3 2 Open the assigned flow close the current flow es Open the assigned flow not close the current flow FOR start a FOR NEXT loop NEXT End of a FOR NEXT loop FEND Main program END Data Compare LD activates if S1 S2 LD activates if S1 gt S2 LD activates if S1 lt S2 4 3 3 4 3 3 4 3 3 4 3 4 4 3 4 4 3 5 TI Z illi 4 3 5 LD 4 4 1 LD gt 4 4 1 LD lt 4 4 1 4 4 1 LD lt gt LD activates if SI S2 ID LD activates if S1 lt S2 2 4 4 1 n LD gt LD activates if S1 S2 LD gt S1 S2 4 4 1 AND AND activates if SI S2 i AND S1 S2 4 4 2 4 applied instructions AND activates if SI gt S2 AND gt SI S2 4 4 2 AND lt AND activates if SI S2 AND lt SI S2 4 4 2 AND activates if SI S2 AND SI S2 4 4 2 AND lt AND activates if SI lt S2 AND lt SI S2 4 4 2 AND AN
174. ion 4 applied instructions 4 8 3 Float point converts to integer INT 1 Summary Float point converts to integer INT Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Source soft element address 16 bits 32 bits BIN Do Target soft element address 16 bits 32 bits BIN 3 Suitable soft components p m m m ox o m os x DL w sS dek j LL LL ll 16 bits Cs D11 D10 D20 X0 Binary Float BIN integer INT D10 D20 Give up the data after the decimal dot lt 32 bits gt s DILDIO D20 D21 X0 DINT D10 D20 Binary Float BIN integer Give up the data after the decimal dot The binary source number is converted into a BIN integer and stored at the destination device Abandon the value behind the decimal point This instruction is contrary to FLT instruction When the result is 0 the flag bit is ON When converting less than 1 and abandon it zero flag is ON The result is over below data the carry flag is ON 16 bits operation 32 768 32 767 32 bits operation 2 147 483 648 2 147 483 647 4 applied instructions 4 8 4 BCD convert to binary BIN 1 Summary BCD convert to binary BIN Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands Source soft element address BCD Target soft element address 16 bit
175. ion 3000 0 at the speed of 1000Hz pulse output terminal is YO direction terminal is Y4 The distance between current position and target position is 2900 3000 100 The DRVI executing diagram is shown as below A Y start 6 100 0 target 3000 0 0 0 ct NNNM zou Distance 2900 Program M8002 DMOV K2900 DO DMOV K1000 D2 MO DDRVI D0 D2 YO Y4 M8170 MO HI Ps V Couey 1 Instruction Summary Specify the pulse output port 3 suitable soft components Absolute position single segment pulse control Absolute position single segment pulse control DRVA 16 bits DRVA Execution Normally ON OFF coil Hardware a NN Function 32 bits DDRVA PU Suitable XC2 XC3 XC5 XCM XCC Specify the output pulse value or soft components ID Specify the pulse output direction port Software requirement 6 2 9 Absolute position single segment pulse control DRVA Specify the output pulse frequency or soft components ID 16 bit instruction form constant K30000 K3000 Y4 32 bit instruction form GD G2 D100 D200 Y4 Y0 D8171 D8170 Y 1 D8174 D8173 T30000 YU origin current position target position Pulse output ID only YO or Y1 XC5 series is YO Y3 3 axis is YO Y2 10 axis is YO Y11 Pulse output direction can specify any Y Accel
176. itable soft components operands system module RE rm s 16 bit instruction form 2 m GY PLSR DO D100 YO M8170 il RST MO 32 bit instruction form 82 DPLSR n DO D100 YO RST MO The parameters address is a section starts from Dn or FDn In the above example 16bit instruction form DO set the first segment pulse s highest frequency D1 set the first segment s pulse number D2 set the second segment pulse s highest frequency D3 set the second segment s pulse number if the set value in Dn Dn 1 is O this represents the end of segment the segment number is not limited For 32 bit instruction DPLSR DO D1 set the first segment pulse s highest frequency D2 D3 set the first segment s pulse number D4 D5 set the second segment pulse s highest frequency D6 D7 set the second segment s pulse number Acceleration deceleration time is the time from the start to the first segment s highest frequency Meantime it defines the slope of all segment s frequency to time In this way the following acceleration deceleration will perform according to this slope Pulse can be output at only YOOO or YOOI Frequency range 0 32767Hz 16 bits instruction 0 200KHz 32 bits instruction Acceleration deceleration time 0 465535 ms Note the address of pulse segment must be continuous and the pulse frequency and qu
177. itch ON during the process from touching the origin limit switch at speed VL to stop origin returning Mode2 Limit Origin mon VE Creep speed Speed 0 A E Description Move towards origin with speed VH fit encounters origin auxiliary signal S2 decelerate to speed VL with slope K Move forward at speed VL Decelerate to 0 with slope K when encountering the origin Start to delay the delay time is FD8209 unit is ms Accelerate to creep speed with the slope K Move in reverse direction at creep speed o Stop Z phase counting when leaving the origin at creep speed Stop origin returning when Z phase cumulative value is equal to setting value Change the pulses D8170 to setting value Note in this mode please keep the origin limit switch ON during the process from touching the origin limit switch at speed VL to stop origin returning B the start point is ahead the origin with limit signal Model Description Move towards origin at speed VH when touching the limit switch it decelerate to 0 with slope K Start to delay delay time is FD8209 the unit is ms Accelerate to speed VH with slope K after delaying Run at speed VH Decelerate to 0 with slope K when encountering origin Accelerate to spe
178. its HSCR iim o a Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM maior ungere m o Hardware V3 1c and above Software 2 Operands Specify HSC code 32 bits BIN ID Specify the read written register 32 bits BIN 3 Suitable Soft Components Te gt po ox or ow w v wo s JS te ll ll ll Lll m Ip Ll 1 1 1 1 1 FUNCTIONS AND ACTIONS E QD HSCR C630 D10 When the activate condition is true read the HSC value in C630 DWORD into D10 DWORD Instruction HSCR read the HSC value into the specified register improve HSC value s precision Sample Program M8000 HSCR C630 DIO M8000 HSCR C632 D20 D10 K1000 YO 1D2 L 8 3 D20 K5000 YO De LG 2S 5 6 2 Write HSC value HSC W IL Instruction Summary Write the specified register value into HSC Write HSC value HSCW 16 bits 32 bits HSCW fmm mmi Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM mae wget me o Hardware V3 1c and above Software requirement requirement 2 operands Specify HSC code 32 bits BIN Do Specify the read written register 32 bits BIN 3 suitable soft components DJe m w e x or ww s xn v S FUNCTIONS AND ACTIONS v a HSCW C630 D20 When the activate condition is true write the value in D20 DWORD into C630 DWORD the orig
179. ive positive of pulse frequency decides the pulse direction direction port output when the frequency is positi ve The direction output can control the rotation direction of motor CW CCW With the changing of setting frequency in DO the output pulse frequency changes at YO When the pulse frequency is OHz the pulse output end Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency limited quantity pulse output When MO is ON PLSF output the pulse at YO with frequency DO word pulse quantity D2 word M8170 is ON when the pulse is outputting The pulse stops output when the pulse quantity reaches the limit value And the M8170 is off MO is off 32 bit instruction form OROROORO DO D2 DPLSF YO Y2 RST MO Frequency range 5Hz 200KHz when the set frequency is lower than 5Hz output 5Hz Pulse quantity range KO K2147483647 Pulse can only be output at YO or Y1 With the changing of setting frequency in DO the output pulse frequency changes at YO When the pulse frequency is OHz the pulse output end Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable fr
180. iving time T0 T640 and HSC XA C600 C640 if execute CJ continue MON asi ee to work the output activates X0 AT CJ P7 X5 X6 RST 1246 4 3 2 Call subroutine CALL and Subroutine return SRET Summary Call the programs which need to be executed together decrease the program s steps Subroutine Call CALL Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM condition Rising Falling edge Hardware Software Execution Suitable XC1 XC2 XC3 XC5 XCM Hardware Software a a 2 Operands Pn Jump to the target with pointer Nr P PO P9999 Subroutine Return SRET requirement 3 Suitable Soft Components 4 applied instructions Others CALL PIO e If X000 ON execute the call instruction and jump to the step tagged by UIeIJgOJq UUN FEND P10 after executing the subroutine return the original step via SRET C gt D instruction Program the tag with FEND instruction will describe this instruction later ournoIqns In the subroutine 9 times call is allowed so totally there can be 10 nestings 4 3 3 Flow SET ST STL STLE 1 Summary Instructions to specify the start end open close of a flow Open the specified flow close the local flow SET Dew SET mw SS Execution Normally ON OFF Suitable XC1 XC2 XC3 XC5 XCM Hardware Software F
181. l DO D4 D gt W j When normally ON coil M8000 is ON set the value of C600 the set value is K888888888 read the HSC value DWORD into data register DO DWORD If the value in C600 is smaller than value in D2 set the output coil YO ON If the value in C600 equals or be larger than value in D2 and smaller than value in D4 set the output coil Y1 ON If the value in C600 equals or be larger than value in D4 set the output coil Y2 ON When comes the rising edge of MI reset HSC C600 and stop counting MA C620 K999999 M5 C620 e R When M4 is ON C620 starts the HSC with the OFF ON of X000 judge the count direction according to the input X001 status OFF or ON If X001 1s OFF it s increment count 1f X001 1s ON it s decrement count When comes the rising edge of M5 reset HSC C620 and stop counting opoui seyd qv M8 C630 K999999 ooo M8000 HSCR C630 DO DO K3000 D gt d M9 C630 R j When M8 is ON C630 starts to count immediately Count input via X000 B Phase X001 A Phase When the count value exceeds K3000 output coil Y2 is ON When comes the rising edge of M9 reset HSC C630 M8002 C630 R M8000 C630 K88888888 HSCR C630 DO KO DO K100 D gt ID lt YO DO K100 DO K200 _D D lt Yl DO K200 Da Y2
182. l introduce these soft components briefly Input Relay X Usage of the input relays The input relays are used to accept the external ON OFF signal we use X to state Address Specify Principle y In each basic unit specify the ID of input relay output relay in the form of X000 X007 X010 X017 Y000 Y007 YO1O Y017 octal form y The expansion module s ID obeys the principle of channel 1 starts from X100 Y100 channel 2 starts from X200 Y 200 7 expansions can be connected in total Points to pay attention when using y For the input relay s input filter we use digital filter Users can change the filter parameters via relate settings y We equip enough output relays inside PLC for the output relays beyond the input output points use them as auxiliary relays program as normal contactors coils Output R elay Y Usage of the output relays Output relays are the interface of drive external loads represent with sign Y Address Assignment Principle y In each basic unit assign the ID of output relays in the form of Y000 YOO7 Y010 Y017 this octal format y The ID of expansion obeys the principle of channel 1 starts from Y 100 channel 2 starts from Y200 7 expansions could be connected totally Auxiliary Relays M Usage of Auxiliary Relays Auxiliary relays are equipped inside PLC represent with the sign of M Address assignment principle In basic units assign the auxiliary addres
183. l run one after one according to the condition After one pulse outputting over then the next pulse will output The construction of the block is as the following SBLOCK n b BLOCK start User s program Pulse output Communication y The instructions in the BLOCK run one after one Frequency inverter Wait instruction Instruction list SBLOCKE ee ee ee ee X1 The BLOCK quantity can up to 100 for XC series PLC XC3 14 BLOCK quantity is 30 i 10 1 2 The reason to use BLOCK li To optimize the editing method of pulse and communication instruction in the process In former program XC series PLC can not support many pulse or communication instructions in one process but BLOCK can support this and the instructions will run in sequence L Unavailable x Available 4 PLSR DO D2 D4 YO PLSR DO D2 D4 YO PLSR DO D2 D4 YO Former PLSR DO D2 D4 YO SBLOCK Sequence blockl DPLSR DO D2 D4 YO DPLSR D6 D8 D10 YO SBLOCKE STL SO MO COLR KI K500 K3 MI K2 COLR K1 K500 K3 MI K2 COLR K2 K500 K3 MI R2 Former COLR K2 K500 K3 MI K2 SBLOCK communication COLR K1 K500 K3 MI K2 COLR K2 K500 K3 MI K2
184. l type Special register is used to set special data or occupied by the system Some special registers are initialized when PLC is power on y Please refer to the appendix for the special register address and function Used as offset indirect appoint Data register can be used as offset of soft element Format Dn Dm l Xn Dm Yn Dm Mn Dm Word offset DXn Dm means DX n Dm The offset value only can be set as D register MOV KO DO MOV K5 DO MOV DIO DO D100 When DO 0 D100 D10 YO is ON When M2 is from OFF2 ON DO 5 DIOO D15 Y5 is ON D10 D0 D 10 D0 YO DO Y 0 D0 y y 3 y iu M2 il M8000 Example Data storage Data register D can deal with many kinds of data and realize various controls MO j MOV K100 DO M1 DMOV K 41100 D10 Data transfer MO MOV DO D10 Read the timer and counter MO MOV C10 DO When MO is ON write 100 into DO 16 bits value When M1 is ON write 41100 into D11 D10 32bits value When MO is ON transfer the value of DIO to DO When MO is ON move the value of C10 to DO As the set value of timer and counter X0 is xi When XO is ON T10 starts to work the time is set in DO C300 D1 When X1 is ON once C300 increase 1 when C300 value D1 C300 coil outpu
185. lative to OUT instruction include the setting value See table below Timer Counter Setting Range of constant K The actual setting value 0 0011 32 767 sec 10 32 767 0 01 327 67 sec 100ms Timer 0 1 3276 7 sec 16 bits counter 1l 32 767 Same as the left 10 2 147 483 647 Same as the left Program 1x e OUT 100 H CMIX382 IDI XI OUT M1203 OUT TO K19 i Cyl gt H LD T OUT YI E 3 30 AND ANI Mnemonic and Function Mnemonic Function Format and Operands Serial connection of NO Normally Open contacts ANI Serial connection of ANd NC Normally Inverse Closed contacts Operands X YU MU SU TU CU Dn m FDn m Statements Use the AND and the ANI instruction for serial connection of contacts As many contacts as required can be connected in series They can be used for many times The output processing to a coil through writing the initial OUT instruction is called a follow on output For an example see the program below OUT M2 and OUT Y003 Follow on outputs are permitted repeatedly as long as the output order is correct There s no limit for the serial connected contacts Nr and follow on outputs number di C v 2 LD X2 Proaram Y2 X3 AND MI id e OUT Y2 i C Ys D LD Y2 ANI X3 OUT M2 AND TI OUT Y3 M nemonic and Function Format and Operands OR Parallel connection prs OR of NO Normally barcos
186. low XO i STR T600 K100 MO I RST T600 UU tag I3001 and execute the subprogram Interruption Tag correspond to the Timer f 11 4 Interruption XC series PLC are equipped with interruption function The interruption function includes external interruption and time interruption Via interruption function we can dispose some special programs This function is not affected by the scan cycle 11 4 1 External Interruption H The input terminals X can be used to input external interruption Each input terminal corresponds with one external interruption The input s rising falling edge can activate the interruption The interruption subroutine is written behind the main program behind FEND After interruption generates the main program stops running immediately turn to run the correspond subroutine After subroutine running ends continue to execute the main program Main Program Main Program lt ubpro gram Input interrupt XC3 14 PointerNo No Disable the Input Rising Falling interruption Terminal Interruption Interruption instruction 10000 10001 M8050 XC2 14 16 PointerNo No Disable the Input l Falling interruption terminal interruption interruption instruction 10000 10001 M8050 10100 10101 M8051 p XC3 24 32 42 XC5 24 32 48 60 PoiterNo No Disable the Input Rising Falling interruption Terminal Interruption In
187. machine is PLC HMI or SCADA If the host machine is PLC please write the program as Modbus RTU protocol If the host machine is HMI or SCADA there are two conditions Condition one with Xinje driver such as Xinje HMI Please write the program with PLC soft components YO MO DO Condition two without Xinje driver Please choose Modbus RTU protocol the address 1s as the above table X1 Bit soft components X Y are in Octal form others are in decimal form For example X10 modbus address is not K16394 but K16392 Y 100 modbus address is K18496 Note octal has no Y8 Y9 and Y80 Y 90 i 7 2 3 Modbus communication format H Modbus communication data format 1 RTU mode Function code 8 bit binary Data contents a e cmm DATA 0 CRC CHK Low CRC check code 16 bit CRC check code is built up by 2 8 bit CRC CHK High binary 2 Modbus address OOH all the Xinje XC series PLC broadcast slave stations don t response 01H communicate with address 01H PLC OFH communicate with address OFH PLC 10H communicate with address 10H PLC the max address is FEH 254 3 Function and DATA Now we use function code 06H to introduce the data format For example write data to register D2 address H0002 RTU mode Asking format Response format Register address Register address Data contents Data contents CRC CHECK Low CRC CHECK Low CRC CHECK High CRC CHECK High 5CH Explanation 1 Ad
188. ming of interior counter Counter used for power cut retentive Even when power is cut hold the current value and output contact s action status and reset status Programmi ng of high speed reset clrcult RST CO carries on increase count for the OFF ON of X011 When reach the set value K10 output contact CO activates Afterwards even X011 turns from OFF to ON counter s current value will not change output contact keep on activating To clear this let X010 be the activate status and reset the output contact It s necessary to assign constant K or indirect data register s ID behind OUT instruction count coil In the preceding example when MO is ON carry on positive count with OFF ON of XO Counter s current value increase when reach the set value K or D the output contact is reset When M1 is ON counter s C600 output contact is reset counter s current value turns to be 0 END 3 140 M nemonic and Function END END Force the END current program scan Devices None to end PLC repeatedly carry on input disposal program Statements l executing and output disposal If write END Input disposal instruction at the end of the program then the instructions behind END instruction won t be Step O00 executed If there s no END instruction in the program the PLC executes the end step and then repeat executing the program f
189. mmary XC2 PLC XC3 PLC XC5 PLC main units can fulfill your requirement on communication and network They not only support simple network Modbus protocol free communication protocol but also support those complicate network XC2 PLC XC3 PLC XC5 PLC offer communication access with which you can communicate with the devices such as printer instruments etc that have their own communication protocol XC2 PLC XC3 PLC XC5 PLC all support Modbus protocol free protocol these communication function XC5 PLC also have CANbus function MEM Con COM port 85 0 l There are 2 COM ports Port1 Port2 on XC3 series PLC basic units while there are 3 COM ports on XC5 series PLC main units Besides the same COM ports COMI COM2 they have also CAN COM port COM 1 Port1 is the programming port it can be used to download the program and connect with the other devices The parameters baud rate data bit etc of this COM port are fixed can t be re set Note PLC hardware version less than v3 1 port 1 parameters cannot be changed otherwise port 1 cannot connect to PC PLC hardware version higher than v3 2 port 1 parameters cannot be changed But user can stop the PLC when start then initialize the PLC COM 2 Port2 is communication port it can be used to download program and connect with other devices The parameters baud rate data bit etc of this COM port can be changed via software Via BD cards XC series PLC can exp
190. mmary ADDITION ADD Execution Normally ON OFF Rising Falling Suitable XCI XC2 XC3 XC5 XCM Hardware Software MD d o 2 Operands Specify the augend data or register Specify the summand data or register ID Specify the register to store the sum 3 Suitable Soft Components me e w e x x fm x plo s 111111400 Li Oc eee ee E a f rl flit tt Operands lt 16 bits instruction gt 0 amp X0 ADD D10 D12 D14 DIO D12 gt D14 lt 32 bits instruction gt CD se NEUP X0 DADD D10 D12 D14 D11D10 D13D12 gt D15D14 4 applied instructions The data contained within the two source devices are combined and total is stored in the specified destination device Each data s highest bit is the sign bit 0 stands for positive 1 stand for negative All calculations are algebraic processed 5 8 3 If the result of a calculations is 0 the 0 flag acts If the result exceeds 323 767 16 bits limit or 2 147 483 648 32 bits limit the carry flag acts refer to the next page If the result exceeds 323 768 16 bits limit or 2 147 483 648 32 bits limit the borrow flag acts Refer to the next page When carry on 32 bits operation word device s 16 bits are assigned the device follow closely the preceding device s ID will be the high bits To avoid ID repetition we recommend you assign device s ID to b
191. mum step frequency is 15Hz If the frequency is larger than 15Hz calculate as 15Hz Incase of frequency larger than 200Hz please make sure each segment s pulse number no less than 10 if the set value is less than 10 send as 200Hz 2 frequency jump in segment pulse output When outputting the segmented pulse if the current segment s pulse has been set out while meantime it doesn t reach the highest frequency then from the current segment to the next pulse output segment pulse jump appears see graph above To avoid frequency jump please set suitable acceleration deceleration time 3 dual pulse output is invalid In one main program users can t write two or more pulse output instructions with one output port Y Thebelow sample is wrong PLSR DO D100 YO PLSR D200 D1000 YO In the following cases dual pulse output is invalid 1 in main program MO PLSR DO D100 YO MI PLSR D200 D1000 YO 2 in STL M10 SO STL SO MO MI PLSR DO D100 YO STLE 3 in subprogram PLSR D200 D1000 YO M10 CALL PO FEND PO MO PLSR DO D100 YO MI PLSR D200 D1000 YO SRE
192. n Error List Output ieee Errortceomy J Jemp PrjiFuncB ADD 1 c line 8 parse error at near Errartecam f JEmp PrijFuncB ADD 1 c line 8 parse error at near J SER RR a EE ERE ERESERE ERE E HERE HERE HERE HERE HERE SE RE HE EE HE ERE EHE E EE EE HEC HERE SERE HE SE E E EE ERE EE EE er Ao dMmpiPrjiFuncByADD 1 c The information list According to the information shown in the output blank we can search and modify the grammar error in C language program Here we can see that in the program there is no 5 sign behind W 2 ZW 0 W 1 Compile the program again after modify the program In the information list we can corfirm that there is no grammar error in the program PLOi Ladder FmncBlaock ADD 1 Information Export Compile 1E EIIITTTTTTTRR R R 9m 9 2 FunctrionBlackName ADD 1 3 Version 1 0 0 4 Author 5 UpdateTimse 2009 6 6 10 31 47 6 Comment T W 3 W 1 W u Ci ee c c c o c o o C o S NS S v NN x v s E void ADD ii WORD W BIT B 10 ii W 2 W 1 W U 12 13 Il Error List l eh Emp yPriFuncB aOR 1 c 3 Write PLC program assign value 10 and 20 into registers DO D1 separately then call Func Block ADD 2 see graph below Mangi ADD 2 DO 4 Download program into PLC run PLC and set MO ADD 2 DO M 1 OM 5 From Free Monitor in he toolbar we can see that D
193. n 2 communicate with each other through CAN internal communication mode Program 1 send D4000 D4001 of station 2 to DO D1 of station 1 2 send MO state of station 1 to MO of station 2 show the MO state in YO of station 2 3 set on MO when station 1 power on Programming and ladder chart 1 Open XCPpro software click EHE configure station 1 send MO state of station 1 to MO of station 2 CAN Station Num Master Station Num remote Node ID remote Node Address local Object Address set on MO when station 1 power on M8002 MO N S 1 Open XCPpro software click EM configure station 2 send D4000 D4001 of station 2 to DO D1 of station 1 CAN Station Num Master Station Num 1022 Read From PLC Wite To PLC send MO state of station 1 to MO of station 2 show the MO state in YO of station 2 M8002 MO M S MOV K100 D4000 MOV K200 D4001 YO i Example 3 Free format please set FD8350 to 2 first Two Xinje PLCs communicate with each other through CAN free format mode Program 1 PLC station 1 sends the data package ID100 4 bytes starts from D4000 every 1s 2 When MO is ON PLC station 2 receives data package ID100 4 bytes ID filter code is defaulted then save the data in register starts from D4000 Ladder chart PLC station 1 Send data package ID100 4 bytes starts from D4000 MEM M8013
194. n the last FEND instruction and END instruction 4 4 Data compare function LD gt LD activates when S1 2 S2 4 4 1 AND EE 4 applied instructions OR activates when S1 S2 OR activates when S1 gt S2 OR activates when S1 lt S2 OR activates when S1 lt S2 OR activates when S1 S2 OR activates when S1 S2 4 4 1 LD Compare LD L1 1 Summary LDL is the point compare instruction connected with the generatrix LD Compare LDU Execution Suitable XC1 XC2 XC3 XC5 XCM Hardware Software 2 Operands Function Data Type Specify the Data to be compared or soft 16 32bits BIN component s address code Specify the comparand s value or soft 16 32 bits BIN component s address code buceo NN 3 Suitable soft components p m m m ox by m os ku D DE TS R E pw pne 1 1 p ele ee e eme iege 2 p Jj LD S1 S2 S1 S2 LD gt S1 S2 S1 amp S2 4 applied instructions Sp G5 55 spe cn p x Gic s S0 S Gi 2 S0 5 LD Kioo co I C xo LD gt D200 K 30 SET Yl DLD K68899 C300 M50 When the source data s highest bit 16 bits b15 32 bits b31 is 1 use the data as a negative The comparison of 32 bits counter C300 must be 32 bits instruction If assigned as a 16 bits instruction i
195. nal signal is produced in non zero pulse section it will run the rest pulses with the set slope S146 parameter if the rest pulses is larger than the pulse quantity of frequency falling section it will run a smooth section and then the falling section S1 6 is the urgent stop slope when running PSTOP instruction Cannot support absolute position instruction cannot support instruction with direction The instruction will be executed at the rising edge if it is normally close signal the instruction will be executed repeatedly The instruction execution in different conditions The external interruption signal is produced in zero pulse section The instruction will switch to the next section when encountering the external interruption signal Ss S3 S4 S5 S3 is section 3 pulse quantity S4 is section 4 pulse quantity S5 1s section 5 pulse quantity 1 1 i I i Se c I H n D H e PA 4 4 EA i ya vt l Pd d i P4 5 2T P d ar I P I 7 i i 2 i oy 1 E 7 P w i i P P4 Ea i d PA P I f d 71 I 4 r Eo l 7 i Io F r Ka E Da a Ado L rd 4 y rd 4 7 7 7 7 V E E A r 1 R4 i 1 4 d Vd i 4 7 d r I 4 1 s i bu 4 F P 4 E 7 7 7 rd ly l d 7 d 4 7 b le i 7 Pi d 7 H P4 P4 7 A 7
196. nary Floating Binary Floating Binary Floating The floating value of S1 is multiplied with the floating value point value of S2 The result of the multiplication is stored at D as a floating value Jfa constant K or H used as source data the value is converted to floating point before the addition operation XI EMUL K100 D100 D110 K100 X D101 D100 D111 D110 Binary converts to Floating Binary Floating Binary Floating 4 applied instructions 4 9 6 Float Div EDIV 1 Summary Float Divide EDIV Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft element address need to divide 32 bits BIN Soft element address need to divide 32 bits BIN D Result address 32 bits BIN 3 Suitable soft components p m m m ox by m ms x m a ee 21 m m dg gj ee ee ets p j E II Egg ee 4 o GO EDIV D10 D20 D50 DILDIO D21 D20 D51 D50 Binary Floating Binary Floating Binary Floating The floating point value of SI is divided by the floating point value of S2 The result of the division is stored in D as a floating point value No remainder is calculated Jfa constant K or H used as source data the value is converted to floating point before the addition operation XI EDIV D100 K100 D110 D101 D100 ns K100 D111 D110 Binary conver
197. ng 1 Instruction Summary Relative position single segment pulse control Relative position single segment pulse control DRVI 16 bits DRVI 32 bits DDRVI Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC condition Models Hardware Software requirement requirement 2 Operands S1 Specify the output pulse value or soft components ID 16 32bit BIN 9 9 DI Specify the pulse output port D2 Specify the pulse output direction port 3 suitable soft components gt Tw o w e wx ov ow s xn a a Ce s PE OCCO d operands system Specify the output pulse frequency or soft components ID 16 32 bit BIN 16 bit instruction form DRVI K30000 K3000 YO Y4 32 bit instruction form E Q 2 DRVI D100 D200 YO Y4 30000 Yu origin Current position target position Pulse output ID only YO or Y1 XC5 series is YO Y3 3 axis is YO Y2 10 axis is YO Y 11 Pulse output direction can specify any Y Acceleration deceleration time is specified by D8230 single word The relative drive form means move from the current position the distance from current position to target position Confirm the value of current position registers before executing the instruction D8171 D8170 Y0 D8174 D8173 Y1 The current position of X axis is 100 0 it will move to target posit
198. ng to the contacts structure General program principle is Jal write the circuit with many serial contacts on the top b write the circuit with many parallel contacts in the left 2 Program s executing sequence Handle the sequencial control program by From top to bottom and From left to right Sequencial control instructions also encode following this flow 3 Dual output dual coil s activation and the solution If carry on coil s dual output dual coil in the sequencial control program then the backward action is prior Dual output dual coil doesn t go against the input rule at the program side But as the preceding action 1s very complicate please modify the program as in the following example There are other methods E g jump instructions or step ladder However when use step ladder if the main program s output coil is programmed then the disposal method is the same with dual coil please note this 4 applied instructions Applied Instructions In this chapter we describe applied instruction s function of XC series PLC 4 1 Table of Applied Instructions 4 2 Reading Method of Applied Instructions 4 3 Flow Instructions 4 4 Contactors Compare Instructions 4 5 Move Instructions 4 6 Arithmetic and Logic Operation Instructions 4 7 Loop and Shift Instructions 4 8 Data Convert 4 9 Floating Operation 4 10 Clock Operation 4 applied
199. nstructions 4 9 3 Float Add EADD 1 Summary Float Add EADD Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft element address need to add Soft element address need to add 3 Suitable soft components p m m m ox by m ms x m a ee 21 m m d gj ee ee ets p j DT Ier LJ ebegdeJ4 4 4 SO GE e I EADD D10 D20 D50 D11 D10 F D21 D20 gt D51 D50 Binary Floating Binary Floating Binary Floating The floating point values stored in the source devices S1 and S2 are algebraically added and the result stored in the destination device D Jfa constant K or H used as source data the value is converted to floating point before the addition operation X1 I EADD D100 K1234 D110 K1234 T D101 D100 DIILDIIO Binary converts to Floating Binary Floating Binary Floating The same device may be used as a source and as the destination If this is the case then on continuous operation of the EADD instruction the result of the previous operation will be used as a new source value and a new result calculated This will happen every program scan unless the pulse modifier or an interlock program 1s used 4 applied instructions 4 9 4 Float Sub ESUB 1 Summary Float Sub ESUB Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Soft
200. o D e e s 9 The instruction copies n2 source devices to a bit stack of length nl For every new addition of n2 bits the existing data within the bit stack is shifted n2 bits to the left right Any bit data moving to the position exceeding the nl limit is diverted to an overflow area In every scan cycle loop shift right action will be executed M 3 M 0 Overflow M 7 M 4 M3 MO0 MI1 M 8 gt M7 M4 M15 M12 gt M11 M8 X 3 X 0 M15 MI2 x 5 P3 n m P ses o wo s Te D e 4 applied instructions 4 7 6 Word shift left WSFL 1 Summary Word shift left Word shift left WSFL Execution rising falling edge Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Source soft element head address Target soft element head address Source data quantity Word shift left times 3 Suitable soft components p m ep m ox by m os ku p E ur ee ee ee Ca ey oy ee ee ee 1 pL wm ee eee ce d p The instruction copies n2 source devices to a word stack of length nl For each addition of n2 words the existing data within the word stack is shifted n2 words to the left Any word data moving to a position exceeding the nl limit 1s diverted to an overflow area Inevery scan cycle loop shift left action will be executed D25 D22 Overflow D21 D18 D25 D22 D17 D14 D21 D18 D13 D10 D17 D14 D 3 D 0 D13 D10 9 amp CO n2 word shift left
201. of setting frequency in DO the output pulse frequency changes at YO When the pulse frequency is OHz the pulse output end Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency limited quantity pulse output When MO is ON PLSF output the pulse at YO with frequency DO word pulse quantity D2 word M8170 is ON when the pulse is outputting The pulse stops output when the pulse quantity reaches the limit value And the M8170 is off MO is off 32 bit instruction form Om G5 DO D2 DPLSF YO RST MO Frequency range 5Hz 200KHz when the set frequency is lower than 5Hz output 5Hz Pulse quantity range KO K2147483647 Pulse can only be output at YO or Y1 With the changing of setting frequency in DO the output pulse frequency changes at YO When the pulse frequency is OHz the pulse output end Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency limited quantity pulse output When MO is ON PLSF output the pulse at YO with frequency DO Dword pulse quantity D2 Dword M8170 is ON when the puls
202. on S3 Correspond with the start ID of word B in C language 16 bits BIN Function 3 Suitable Soft Components Dm gt w ox www ww oo rT LI ddddudui Operands System e xo NAME_C DO MO The name is composed by numbers letters and underlines the first character can t be numbers the name s length shouldn t longer than 8 ASC The name can t be same with PLC s self instructions like LD ADD SUB PLSR etc e The name can t be same with the func blocks exist in current PLC 9 3 Operation Steps I Open PLC edit tool in the left Project toolbar choose Func Block right click it and choose Add New Func Block Project ra Praject 3 3 PLCI Code Ladder Id Instruction List ack Config Bla E Reg Comment FR Free Monitor Data Monitor zd Set Reg Init value Add Hew Func Block Include Func Block From Disk s amp Password m Serial Port Bn BD CaN CAN y Save Hold Memory Din Module 1 yO 2 See graph below fill in the information of your function Func Block Info Edit Func Block Hame FUNC Ver sl on 1 0 0 a Deseription i Author Date 20094 6A 6A w d 3 After new create the Func Block you can see the edit interface as shown below Main function s name it s func
203. on 3 and 4 are similar Soft component s comments S0 write the target station DO communication station number D1 offset M92 station 2 communication error S1 read the target station S2 judge the communication status S3 offset the communication address M3 station 3 communication error Togo ccommunmeanonimerval MA station 4 communication error Tool commanicadomimnterval2 M8137 COM2 communication error end signal D20 plus one for write error times M8138 COM2 communication correct end signal D21 plus one for read error times Ladder chart M8002 MOV K2 DO MOV KO DI SO 5 M2 M22 M3 M23 T M24 STL SO SO f MOV KO D20 SO OUT T200 K2 T200 MRGW DO K10 K5 DIO DI K2 M8137 INC D20 M8138 T200 S1 TL l x S MOV KO D2l OUT T201 K2 MRGW DO K15 K5 DIS D1 K2 INC D2I S2 b 5 STL 82 3n 37 MO D0 S Uu M8138 M SLE STL 83 Uu HEN 6 I INC DO ADD DI KIO DI MOV K2 DO MOV KO DI DMOV KO
204. ontinue transferring data without any influence So there is function of node to node node to multi node bureau broadcasting sending receiving data Each frame s valid byte number is 8 so the transfer time is short the probability ratio is low 7 4 2 External Wiring B CAN Bus Communication Port CAN CAN The wiring among each node of CAN bus is shown in the following graph at the two ends add 120 ohm middle terminal resistors 7 4 3 CAN Bus Network Form n There are two forms of CAN bus network one is instructions communication format the other is internal protocol communication format These two forms can work at the same time Instructions communication format This format means in the local PLC program via CAN bus instructions execute bit or word reading writing with the specified remote PLC Internal protocol communication format This format means via setting of special register via configure table format realize allude with each other among PLC s certain soft component s space In this way PLC can share the source in CAN bus network 7 4 4 CAN bus Instructions 1 Instruction Description Function Read the specified station s specified coil status into the local specified coil Read Coil CCOLR 16 bits CCOLR 32 bits instruction instruction Normally ON OFF rising Suitable XC5 XCC Senna g Pn Software ee Specify remote communication station no or sof
205. or down flow it means the count value jumps from K 2 147 483 648 to be K 2 147 483 647 then continue to count 5 41 HSC Input Wiring For the counter s pulse input wiring things differ with different PLC model and counter model several typical input wiring are shown below take XC3 48 as the example increment mode Counter C600 Pulse Input Pulse Direction Mode C620 Pulse Input Direction Input AB phase Mode C630 A phase mput B phase Input 5 50 HSC ports assignment Each letter s Meaning U Dir A Pulse input Count Direction Judgment A phase input OFF increment ON decrement Normally XO and X1 can accept 80KHz frequency under single phase mode and AB phase mode Other terminals can accept only 10KHz under single phase mode 5KHz under AB phase mode X can use as normal input terminals when they are not used as high speed input The detailed assignment is shown as below XC2 series PLC Tm ETT ca pupaspadpappapappascesperpesoepas Dwsrpekexpeepspx px je S fe a xoa L j j jm Pf ps ILLI JL l1 px jul ILI p je pg Lg xo 1j ILI X011 ooo S Increment Pulse Dir Input AB Phase Mode Sr a SO Sppe oxi f s times F IBA E R A R OE PE DG a A D a e Count E x E D S O O A R REELS oe Lx v SS S lj Exe j
206. or register s ID ID Specify the pulse output port bit 3 Suitable soft components system module TUBE 16 bits instruction PLSY K30 DI YO ll RST MO Frequency Range 0 32767Hz Pulse Quantity Range 0 K327067 Pulse output from YOOO or YOO only When MO is ON PLSY instruction output 30Hz pulse at YO the pulse number is decided hv D1 M8170 is et ON only when cendino the pulse 32 bits instruction DPLSY K30 D1 YO li RST MO Frequency Range 0 200K Hz Pulse Quantity Range 0 K2147483647 Pulse output from YOOO or YOO only When MO is ON DPLSY instruction output 30Hz pulse at YO the pulse number is decided by D2D1 M8170 is set ON only when sending the pulse When the output pulse number reaches the set value stop sending the pulse M8170 is set to be OFF reset MO Limited pulse output continuous or limited pulse number K Set pulse number When finish sending the set pulse number stop outputting automatically MO 0 1 Pa M8170 mE Note T1 is pulse start time T2 is pulse end time Pulse frequencyz1000Hz pulse quantity 20K no acceleration deceleration and single direction pulse output M8002 DMOV K1000 DO 1000 DMOV K20000 D2 20000
207. r reference only If the self study is not available users can set the PID parameters according to practical experience Users need to modify the parameters when debugging Below are some experience values of the control system for your reference Temperature system P 96 2000 6000 I minutes 3 10 D minutes 0 5 3 Flux system P 4000 10000 I minutes 0 1 1 Pressure system P 96 3000 7000 I minutes 0 4 3 Liquid level system P 96 2000 8000 I minutes 1 5 lt 8 7 Application PID Control Program is shown below Soft component function comments D4000 7 auto tune bit D4002 8 auto tune successful sign MO normal PID control MI auto tune control M92 enter into PID control after auto tune M8000 MOV ID100 D10 M D4002 7 N Ss M2 iN MO PID DO DIO D4000 Yo H MI M2 ii M2 D4002 7 iW R j D4002 8 D4009 KO M1 C R D4002 7 D4009 Kl Wu M gt Move ID100 content into D10 convert PID mode to be auto tune at the beginning of auto tune control starts or auto tune finish start PID DO is target value D10 is detected value from D4000 the zone is PID parameters area output PID result via YO PID control finish close auto tune PID mode if auto tune is successful and overshoot is permitted clo
208. real time clock will immediately change to be the new set time So when setting the time it 1s a good idea to set the source data to a time a number of minutes ahead and then drive the instruction when the real time reaches this value 4 applied instructions HIGH SPEED COUNTER HSC In this chapter we tell high speed counter s functions including high speed count model wiring method read write HSC value reset etc 5 1 FUNCTIONS SUMMARY 5 2 HIGH SPEED COUNTER S MODE 5 3 HIGH SPEED COUNTER S RANGE 5 4 INPUT WIRING OF HIGH SPEED COUNTER 5 5 INPUT TERMINALS ASSIGNMENT FOR HSC 5 6 READ AND WRITE THE HSC VALUE 5 7 RESET MODE OF HSC 5 8 FREQUENCY MULTIPLICATION OF AB PHASE HSC 5 9 HSC EXAMPLES 5 10 HSC INTERRUPTION Instructions List for HSC MNEMONIC FUNCTION CIRCUIT AND SOFT COMPONENTS CHAPTER READ WRITE HIGH SPEED COUNTER HSCR Read HSC HSCW Write HSC HSCW Cn Kn D ee RST E BM en Spri HSC High Speed Counter 3 13 5 1 Functions Summary XC series PLC has HSC High Speed Counter function which is independent with the scan cycle Via choosing different counter test the high speed input signals with detect sensors and rotary encoders The highest testing frequency can reach S0KHz count input 5 2 HSC M ode XC series high speed counter s function has three count modes
209. register ID 16 bits 32 bits BIN 3 suitable soft components D m m m o px vy m bs ka p m EE E EN E ros p operands system T Ce jl m p Jed p qp oq lI 4 16 bit instruction form s m e YO Y2 PLSF Frequency range 5Hz 32767Hz when the set frequency is lower than 5Hz output 5Hz Pulse can only be output at YO or Y1 The negative positive of pulse frequency decides the pulse direction direction port output when the frequency is positive The direction output can control the rotation direction of motor CW CCW With the changing of setting frequency in DO the output pulse frequency changes at YO Accumulate pulse number in register D8170 DWord There is no acceleration deceleration time when the frequency changed When the condition is on it output the pulse with changeable frequency until the condition is off It is fit for changeable frequency continuous pulse output 32 bit instruction form T O DPLSF DO YO Y2 Frequency range 5Hz 200KHz when the set frequency is lower than 5Hz output 5Hz Pulse can only be output at YO or Y1 The negative positive of pulse frequency decides the pulse direction direction port output when the frequency is positi ve The direction output can control the rotation direction of motor CW CCW With the changing of setting frequency in DO the output pulse frequency changes at YO
210. rnal interruption signal A P4 i 4 7 7 7 L7 Ka 7 h F n fy 4 yf a Fi A 70 7 l 3 l s L n i l P4 ra Lo d Ld ae Lnd pil c i X r 7 LS 7 r 3 r P4 r Pd 7 Z 3 y rd 4 4 Ka N m mm apum AIDS z ze i a umma P a Pa iN 7 N E 4 j 7 7 N N a a a a a O 7 S N x ue N A N XN 5 k Aa N N N E Y i N N N Space s N N S1 6 0 the pulse will stop after running the smooth section Sm S6 S7 S8 The external interruption signal is produced in non zero pulse section rest pulses Ss is smaller than falling section pulses Sn If encountering the external interruption signal it runs the falling pulses with slope K when Ss S6 S7 it stop outputting the pulses Ss is the rest section pulses S6 is the pulses of section 6 S7 is the pulses of section 7 Sn is the falling section pulses when encountering the external interruption signal i Y iU d s a 7 re 5 0 a i Fa 4 Fi Fa a ee a a a ae ae am cee ae a a r 7 j E Vy d rd v 7 7 Kd 7 1 Zz P d Ed 4 l P4 4 E P4 10 7 P E 3 7 z Fg 3 a es a a cee ee seme oe MO I Fi N i 7 P 4 tg d 7 Z 7 7 7 i v Ka Ed PA a eee ase a ae as am V 2 P P4 F i Pa h AN P 2 Ed W i47 1 7 K 7 Ed L p
211. rom step 0 When debug insert END in each program segment to check out each program s action Then after confirm the correction of preceding block s action delete END instruction Besides the first execution of RUN begins with END instruction When executing END instruction refresh monitor timer Check if scan cycle is a long timer 3 150 GROUP GROUPE M nemonic and Function Mnemonic Function Format and Device GROUP GROUP Devices None GROUPE GROUP END GROUPE Devices None Statements GROUP and GROUPE should used in pairs GROUP and GROUPE don have practical meaning they are used to optimize the program structure So add or delete these instructions doesn t effect the program s running The using method of GROUP and GROUPE 1s similar with flow instructions enter GROUP instruction at the beginning of group part enter GROUPE instruction at the end of group part Generally GROUP and GROUPE instruction can be programmed according to GROUP MO the group s function Meantime the MOV KIC DO programmed instructions can be FOLDED or UNFOLDED To a redundant project these two instructions are quite useful MROCOO GROUPE 3 16 Items To Note W hen Programming 1 Contacts structure and step number Even in the sequencial control circuit with the same action it s also available to simple the program and save program s steps accordi
212. rs are addressed in form of decimal Points to note Even the battery powered off this area can keep the data So this area is used to store important parameters FlashROM can write in about 1 000 000 times and it takes time at every write Frequently write can cause permanent damage of FD Constant B T KIT HU In every type of data in PLC B represents Binary K represents Decimal H represents Hexadecimal They are used to set timers and counters value or operands of application instructions 2 2 Structure of Soft Components 2 2 1 Structure of M emory n In XC series PLC there are many registers Besides the common data registers D FlashROM registers we can also make registers by combining bit soft components Data Register D For common use 16 bits For common use 32 bits via combine two sequential 16 bits registers For power off retentive usage can modify the retentive zone For special usage occupied by the system can t be used as common instruction s parameters For offset usage indirect specifies y Form Dn Dm Xn Dm Yn Dm O Mn Dm etc MOV KO DO DIO D0 D100 In the above sample if DO O then D100 D10 YO is ON If M2 turns from OFF to be ON DO 5 then DIOOZDI5 Y5 is ON Therein D10 D0 D 10 D0 YO DO Y 0 D0 y The word offset combined by bit soft components DXn Dm represents DX n Dm y The
213. rtion gain Kp integral time Ti differential time TD automatically Auto tune mode is suitable for these objects temperature pressure not suitable for liquid level and flow For step response method Users can set the sampling cycle to be O at the beginning of the auto tune process then modify the value manually in terms of practical needs after the auto tune process is completed For step response method Before doing auto tune the system should be under the non control steady state Take the temperature for example the detected temperature should be the same to the environment temperature For critical oscillation method user needs to set the sampling time at the beginning of the auto tune process Reference value for slow response system 1000ms For high response system 10 100ms For critical oscillation method the system can start the auto tune at any state For temperature object the current temperature doesn t need to be same to ambient temperature Two different method and PID control diagram 1 Step response method Make sure current temperature is equal to ambient temperature output 2 Critical oscillation method The auto tune start temperature can be any value Output To enter the auto tune mode please set bit7 of S3 2 to be 1 and turn on PID working condition If bit8 of S3 2 turn to 1 it means the auto tune is successful PID auto tune period value S3 8 Set this v
214. s Open contacts Operands X YU MU SU TU CU Dn m FDn m ORI Parallel connection a S OR of NC Normally _ 2 E E Inverse Closed contacts Statements Use the OR and ORI instructions for parallel connection of contacts To connect a block 3 40 OR ORI Operands X YU MU SU TU CU Dn m FDn m that contains more than one contact connected in series to another circuit block in parallel use an ORB instruction which will be described later OR and ORI start from the instruction s step parallel connect with the LD and LDI instruction s step said before There is no limit for the parallel connect times i E gt e xz Y6 Program JE SS i d d OR M11 Y6 M4 X7 24 OUT Y6 io T Pa LDI Y6 M13 AND M4 OR M12 ANI X7 OR M13 OUT M100 Relationship with ANB The parallel connection with OR ORI instructions should connect with LD LDI instructions in principle But behind the ANB instruction it s still ok to add a LD or LDI instruction behind ANB instruction OR i behind ANB instruction 3 50 LDP LDF ANDP ANDF ORP ORF M nemonic and Function Format and Operands LDP Initial logical mu LoaD operation Rising edge C E Pulse pulse XLI YUMLU SLUTUCLU Dn m FDn m LDF Initial logical operation M LoaD Falling trailing edge pulse B Falling pulse XLI YUMLU SUTU CLU Dn m
215. s ku p A ele ie le ie Te le fe em 1 m ep p ee oe I 16 bits instruction P QQ s FMOV KO DO K10 4 applied instructions Move KO to D0 D9 copy a single data device to a range of destination device The data stored in the source device S is copied to every device within the destination range The range 1s specified by a device head address D and a quantity of consecutive elements n If the specified number of destination devices n exceeds the available space at the destination location then only the available destination devices will be written to lt 32 bits instruction gt Ome me DO X0 f D10 K3 DFMOV e Move DO D1 to D10 D11 D12 D13 D14 D15 lt 16 bits Fill Move gt lt 32 bits Fill move Ko KO DO W KO D1 n K0 4 D2 KO D3 LG D14 KO DA T KO D5 KO D6 KO D7 KO D8 ko D9 ui 4 applied instructions 4 applied instructions 4 5 7 FlashROM Write FWRT 1 Summary Write the specified data to other soft components FlashROM Write FWRT Execution rising falling edge Suitable XC1 XC2 XC3 XC5 XCM condition m ener Hardware Software 2 Operands The data write in the sourc
216. s 16 bits BIN Target soft element address 32 bits BIN Te pe pw e m ov or fm xn gt D0 D11 D10 Single Word Double WTD DO D10 0 or 1 DO A D11 D10 When single word DO is positive integer after executing this instruction the high bit of double word D10 is 0 When single word DO is negative integer after executing this instruction the high bit of double word D10 is 1 4 applied instructions 4 8 2 16 bits integer converts to float point FLT 1 Summary 16 bits integer converts to float point FLT Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands Source soft element address 16 bits 32 bits 64 bits BIN Do Target soft element address 32 bits 64 bits BIN 3 Suitable soft components p m m m ox o m os km p s een j te E lt 16 bits gt X0 to QC DIO D13 D12 FLT D10 D12 BIN integer Binary float point lt 32 bits gt X0 CS D11 D10 D13 D12 i PELI S pis BIN integer Binary float point 64 bits un D13 D12 D11 D10 gt D17 D16 D15 D14 FLTD D10 D14 BIN integer Binary float point Convert BIN integer to binary float point As the constant K H will auto convert by the float operation instruction so this FLT instruction can t be used The instruction is contrary to INT instruct
217. s 32 bits BIN 3 Suitable soft components Tw e w e ww www en o lo Es eE eee e T Convert and move instruction of Source BCD gt destination BIN r BIN D10 DO When source data is not BCD code M8067 Operation error M8004 error occurs As constant K automatically converts to binary so it s not suitable for this instruction 4 applied instructions 4 8 5 Binary convert to BCD BCD 1 Summary Binary convert to BCD BCD 16 bits BCD Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands Source soft element address 16 bits 32 bits BIN D Target soft element address BCD code 3 Suitable soft components p m m m ox o m os x DL dale e e ee e T7 j Convert and move instruction of source BIN destination BCD i BCD D10 DO This instruction can be used to output data directly to a seven segment display 4 applied instructions 4 8 6 Hex converts to ASCII ASCI 1 Summary Hex convert to ASCII ASCI Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM rising falling edge Hardware Software PNE 2 Operands Operands Function Source soft element address Target soft element address m Transform character quantity 3 Suitable soft components m e w e mw ow v an oo s 114114111 LI
218. s forward backward counter Counter C600 C619 single phase HSC C620 C629 double phase HSC C630 C639 AB phase HSC Data D0 D999 Register D4000 D4999 For Special Usage D8000 D8511 M For Special Usage D8630 D8729 Register For Special Usage FD8000 FD8383 XC3 Series Mnemonic Name 24 32 48 60 14 T O 24 32 I O 48 60 I O I O O l X0 X15 X0 X33 Input Points X0 X7 14 18 28 36 X0 X21 X0 X43 YO Y11 YO Y23 Output Points YO Y5 10 14 20 24 YO Y15 YO Y27 X0 X 1037 544 14 I O Internal Relay Internal Relay YO Y 1037 544 M0 M2999 Internal Relay O M3000 M7999 4 For Special Usage M8000 M8767 768 8000 S0 S511 a 1024 512 S1023 TO T99 100ms not accumulation T100 T199 100ms accumulation T200 T299 10ms not accumulation T TIMER T300 T399 10ms accumulation 640 T400 T499 Ims not accumulation T500 T599 1ms accumulation T600 T639 1ms precise time C0 C299 16 bits forward counter C300 C599 32 bits forward backward counter COUNTER C600 C619 single phase HSC 640 C620 C629 double phase HSC C630 C639 AB phase HSC D0 D3999 D4000 D7999 PPS REGISTER For Special Usage D8000 D9023 1024 FlashROM FDO FD1535 1536 6 IPSIS For Special Usage FD8000 FD8511 EXPANSION S INTERNAL EDO ED16383 16384 REGISTER I D RANGE POINTS Mnemonic Name 24 32 T O 48 60 I O 24 32 T O 48 60 I O X0 X15 X0 X33 Input Points 14 18 28 36 X0 X21 X0 X43 YO Y
219. s in the form of decimal Points to note y Thistype of relays are different with the input output relays they can t get external load can only use in program y Retentive relays can keep its ON OFF status in case of PLC power OFF Status R elays S Usage of status relays Used as relays in Ladder represent with S Address assignment principle In basic units assign the ID in the form of decimal Points to note If not used as operation number they can be used as auxiliary relays program as normal contactors coils Besides they can be used as signal alarms for external diagnose Usage of the timers Timers are used to calculate the time pulse like 1 ms 10ms 100ms etc when reach the set value the output contactors acts represent with T Address assignment principle In basic units assign the timer s ID in the form of decimal But divide ID into several parts according to the clock pulse accumulate or not Please refer to chapter 2 2 for details Time pulse There are three specifications for the timer s clock pulse 1 ms lOms 100ms If choose 10ms timer carry on addition operation with 1Oms time pulse Accumulation not accumulation The times are divided into two modes accumulation time means even the timer coil s driver is OFF the timer will still keep the current value while the not accumulation time means when the count value reaches the set value the output contact acts the count
220. s not accumulation 1300 T399 10ms accumulation T400 T499 1 ms not accumulation T500 T599 1 ms accumulation T600 T639 1ms precise time FD REGISTER For Special Usage FD8000 FD8349 For Special Usage FD8890 FD8999 EXPANSION S INTERNAL EDO ED36863 REGISTER X 1 I O points means the terminal number that users can use to wire the input output X 2 X means the internal input relay the X beyond Input points can be used as middle relay X 3 Y means the internal output relay the Y beyond Output points can be used as middle relay X 4 The memory zone in is power off retentive zone soft components DL M SU TL C can change the retentive area via setting Please refer to 2 3 2 for details X 5 for special use means the special registers occupied by the system can t be used for other purpose Please refer to Appendix 1 X 6 FlashROM registers needn t set the power off retentive zone when power is off no battery the data will not lose X 7 Expansion s internal register ED require PLC hardware V3 0 or above X 8 Input coils output relays are in octal form the other registers are in decimal form X 9 The I O that are not wired with external device can be used as fast internal relays X 10 for the soft components of expansion devices please refer to relate manuals 2 3 2 Power Off Retentive Zone The power off retentive area of XC series PLC are set as below this area can be set by
221. s segment Set the interruption pre set value but not write the correspond interruption program is not allowed 24 segment interruption of HSC occurs in order Le If the first segment interruption doesn t happen then the second segment interruption will not happen 24 segment pre set value can be specified to be relative value or absolute value Meantime users can specify the et value to be loop or not But the oop mode can t be used together with absolute value i 5 10 2 Interruption tags to HSC In the below table we list each counter s 24 segment pre set value to its interruption tag E e 24 segment pre set value of counter C600 correspond with the interruption pointer 11001 I1002 I1003 11024 Increment mode pulse direction mode AB phase mode C600 I1001 11024 C620 12001 12024 C630 I2501 D524 11101 11124 C622 2101 2124 12601 12624 C604 I1201 11224 C624 12201 12224 C634 12701 12724 C606 I1301 11324 C626 12301 12324 C636 12801 12824 C608 I1401 11424 C628 12401 D424 C638 12901 2924 C610 I1501 11524 C612 I1601 11624 ceo ceno I1701 11724 coe ce C616 I1801 11824 C618 I1901 11924 Definethe presetvalue HSC 24 segment pre set value is the difference value the count value equals the counters current value plus the preset value generate the interruption N interruption tags correspond with N interruptionpreset values The N41 preset value is 0 E g 1 the current value is
222. se auto tune control bit auto tune finish If auto tune turns to be manual mode and auto tune is not permitted close auto tune control bit C Language Function Block In this chapter we focus on C language function block s specifications edition instruction calling application points etc we also attach the common Function list 9 1 Functions Summary 9 2 Instrument Form 9 3 Operation Steps 9 4 Import and Export of the Functions 9 5 Edit the Function Block 9 6 Example Program 9 7 Application Points 9 8 Function List 9 1 Summary This is the new added function in XCPPro software This function enables the customers to write program via C language in XCPPo and call the C program at any necessary place This function supports most of C language functions strength the program s security As users can call the function at many places and call different functions this function increase the programmer s efficiency greatly 9 2 Instruction Format 1 Instruction Summary Call the C language Func Block at the specified place Call the C language Func Block NAME C 16 bits NAME C 32 bits Instruction Instruction Execution Normally ON OFF Suitable XCl XC2 XC3 XC5 Condition Rising Falling Edge Models XCM XCC activation Hardware V3 0C and above Software V3 0C and above Requirement Requirement 2 Operands Function name of C Func Block defined by the user String Functi
223. segment s pulse number Acceleration deceleration time is the time from the start to the first segment s highest frequency Meantime it defines the slope of all segment s frequency to time In this way the following acceleration deceleration will perform according to this slope Pulse can be output at only YO or Y1 Pulse direction output terminal Y can be specified freely E g if in S1 the first segment the pulse number is positive Y output is ON if the pulse number is negative Y output is OFF Note the pulse direction is decided by the pulse number s nature positive or negative of the first segment Frequency range 0 32767Hz 16 bits 0 200KHz 32 bits Pulse number range 0 K32 767 16 bits instruction 0 K2 147 483 647 32 bits instruction Acceleration deceleration time below 65535 ms wo 7 Segment 1 Segment 2 Segment DO D1 D2 D3 D4 D5 M8170 gt E 6 segments pulse output The pulse frequency and quantity are shown in the following table Use 32bits instruction DPLSR the address 1s shown as the following table Name Pulse frequency Frequency address Pulse quantity Pulse quantity Hz Dword address Dword 1000 D1 DO 2000 D3 D2 200 D5 D4 1000 D7 D6 3000 D9 D8 6000 D11 D10 800 1600 D15 D14 deceleration time Note the 4 registers behind segment 6 must be 0 D27 D26 D25 D24 which means
224. sion frame the valid bits of the data package ID number that is specified by D10 is the low 29 bits the left bits are invalid The maximum data bits specified by D20 is 8 if exceeds 8 the instruction will send only 8 bits 1 Instructions Summary Write the specified data in one unit to a specified address in another unit data transfers between different units CAN Receive CRECV 16 bits CRECV 32 bits p im Executing Normally ON OFF Rising Suitable XC5 XCC PP M NN Hardware Software 2 Operands S1 specify the ID number to receive the data package I6bits BIN S2 specify the local receiving soft component start ID 16bits BIN S3 specify the byte quantity of received data 16bits BIN S4 specify the soft component s start ID number of ID 16bits BIN filter code 3 Suitable soft components Operands Modul D m m m DX by DM DS xa D BEL a je get og q c gg e ee e e l i1 x sw sy pese 9 tet 1l ll i11 T li CRECV DO D10 D20 D30 The 32 bits memory combined by D1 DO DO is low byte D1 is high byte is used to stock ID number of the received data package The received data length is stored in D20 The data content is stored in registers start from D10 D30 specifies the received ID filter code if the received data doesn t fit the filter codes then it will keep the RECV status ID filter code D30 specifies the start
225. soft components with offset the offset can be represent by soft component D Timer T Counter C For common usage 16 bits represent the current value of timer counter For common usage 32 bits via combine two sequential 16 bits registers To represent them just use the letter ID method such as T10 C11 T11 DO D In the above example MOV T11 DO T11 represents word register LD T11 T11 represents bit register FlashROM Register FD For power off retentive usage 16 bits For power off retentive usage 16 bits via combine two sequential 16 bits registers For special usage occupied by the system can t be used as common instruction s parameters Expansion s internal register ED For common usage 16 bits For common usage 32 bits via combine two sequential 16 bits registers Bit soft components combined to be register For common usage 16 bits via combine two sequential 16 bits registers The soft components which can be combined to be words are X YL MLI SL TU Format add D in front of soft components like DM10 represents a 16 bits data from M10 M25 Get 16 points from DXn but not beyond the soft components range The word combined by bit soft components can t realize bit addressing E g MOV DX2 D0 DIO When MO changes from OFF to be ON the value in the word which is combined b
226. speed counter 4 applied instructions 4 5 4 Data block Move BMOV 1 Summary Move the specified data block to Data block move BMOV Execution Normally ON OFF coil Suitable Hardware Software 2 Operands Function Data Type Specify the source data block or soft component 16 bits BIN bit address code Specify the target soft components address code 16 bits BIN bit Specify the move data s number 16 bits BIN 3 Suitable soft components mw pe p w e w w w w xn 0 o 5 ekee LI 5 elle Lee Operands Move the specified n data to the specified n soft components in the form block Cs n XO BMOV D5 D10 K3 DS DG D6 D11 gt n 3 D7 D12 Mu 4 applied instructions As the following picture when the data address overlapped the instruction will do from 1 to 3 1 BMOV D10 D9 K3 BMOV D10 D11 K3 D10 gt D9 D11 D10 D12 Dll D10 9 pn D11 DI2 D D12 Di3 4 applied instructions 4 5 5 Data block Move PMOV 1 Summary Move the specified data block to the other soft components Data block mov PMOV Execution Normally ON OFF coil Suitable XCI XC2 XC3 XC5 XCM Hardware Software 2 Operands Spe
227. t component s 16bits BIN address Specify the remote coil s start address or soft component s address 16bits BIN Specify the coil quantity or soft component s address 16bits BIN Specify the local receive coil s start address bit Execute CCOLR instruction when XO changes from OFF to ON read the four coils data of remote station 2 coil s start address K20 to local coils M20 M23 Summary Write the local specified multi coils status into the specified station s specified coils Write the coil CCOLW 16 bits CCOLW 32 bits instruction instruction Normally ON OFF rising XC5 XCC Condon ewe Mess PSS Hardware Software Requirement Requirement 2 Operands DI Specify remote communication station no or soft 16 bit BIN c component s number d D2 Specify the remote coil s start address or soft 16 bit BIN ia component s number D3 Specify the coil quantity or soft component s 16 bit BIN SPee Specify the local receive coil s start address 3 Suitable soft components BD m uo XN CCOLW K2 K20 M20 Execute CCOLW instruction when X0 changes from OFF to ON write the local M20 M23 to the remote station no 2 coil s start address K20 coil quantity is 4 1 Summary Read the specified station s specified register to the local specified register Read register CRE
228. t will cause response lag if this value is too large The default value is 15 times The recommended range is from 5 to 20 8 5 Advanced Mode Users can set some parameters in advanced mode in order to get the better effect of PID control Enter into the advanced mode please set S342 bit 15 to be 1 or set it in the XCP Pro software Input Filter constant It will smooth the sampling value The default value is 0 which means no filter Differential Gain The low pass filtering process will relax the sharp change of the output value The default value is 5096 the relaxing effect will be more obviously if increasing this value Users do not need to change it Upper limit and lower limit value Users can choose the analog output range via setting this value Default value lower limit output 0 Upper limit 4095 8 6 Application Outlines Under the circumstances of continuous output the system whose effect ability will die down with the change of the feedback value can do self study such as temperature or pressure It is not suitable for flux or liquid level Under the condition of overshoot permission the system will get the optimal PID parameters from self study Under the condition of overshoot not allowed the PID parameters got from self study is up to the target value it means that different target value will produce different PID parameters which are not the optimal parameters of the system and fo
229. t will lead the program error or operation error D 4 4 2 AND Compare ANDU 9 Summary ANDLI The compare instruction to serial connect with the other contactors AND Compare ANDL1 Execution Normally ON OFF coil Suitable XCI XC2 XC3 XC5 XCM condition Models Hardware Software requirement requirement 2 Operands Operands Function SI Specify the Data to be compared or soft 16 32bit BIN component s address code Specify the comparand s value or soft 16 32bit BIN component s address code 3 suitable soft components mIe pe w e w w w w xn o 4 applied instructions 16 bits instruction Not Activate Condition AND DAND S1 S2 CSI F S2 ANDS SDE S3 AND SHE 2 AND SD 2 AND SD5 So AND gt SDZ S2 CS Cm X0 AND K100 CO C Yo D gt XI i AND gt K 30 DO SET y x2 i DAND gt K68899 D10 M50 M4 When the source data s highest bit 16 bits b15 32 bits b31 1s 1 use the data as a negative The comparison of 32 bits counter C300 must be 32 bits instruction If assigned as a 16 bits instruction it will lead the program error or operation error 4 4 3 Parallel Compare ORO E 1 Summary ORLI The compare instruction to parallel connect with the other contactors Parallel Compare ORLI 4
230. tandard The data format is 1 start bit 8 data bits no parity one two stop bit The baud rate can be 1200 19200bit s 2 Communication Instruction Format DH107 108 instruments use Hex data form to represent each instruction code and data Read write instructions Read address code 52H 82 the para to read code 0 0 CRC parity code Write address code 43H 67 the para to write code low bytes of the wrote data high bytes of the wrote data CRC parity code The read instruction s CRC parity code is the para to read code 256 82 ADDR ADDR is instrument s address para the range is 0 100 pay attention not to add 80H CRC is the remainder from the addition of the above data binary 16bits integral The reminder is 2 bytes the high byte is behind the low byte The write instruction s CRC parity code is the para to write code 256 67 the para value to write ADDR The parameter to write represents with 16 bits binary integral No matter to write or read the instrument should return data as shown below The test value PV given value SV output value MV and alarm status read write parameters value CRC parity code Among in PV SV and the read parameters are all in integral form each occupies two bytes MV occupies one byte the value range is 0 220 alarm status occupies one byte CRC parity code occupies two bytes totally 10 byes CRC parity code is the reminder from the result of PV SV alarm status 2
231. terruption Instruction 10000 10001 M8050 10100 10101 M8051 10200 10201 M8052 XC3 48 60 XC3 19AR E Input E Rising Falling interruption Terminal i i Interruption Interruption instruction 10000 10001 M8050 10100 10101 M8051 10200 10201 M8052 XCM 24 32 3 or 4 axis output Input Disable the interruption Terminal Rising Falling instruction Interruption Interruption I0000 I0001 M8050 Xl 1 0 1 10300 10301 M8053 10400 10401 M8054 10500 10501 M8055 XCM 60 Input Disable the interruption Terminal Rising Falling instruction Interruption Interruption 5 10200 10201 M8052 10300 10301 M8053 XCC 24 Pointer No Input T Disable the interruption Rising Falling i Terminal instruction Interruption Interruption XCC 32 Pointer No Input Disable the interruption i Rising Falling Terminal instruction Interruption Interruption Enable Interruption EI Disable Interruption DI Interruption Return IRET EI interruption range lt gt ERE T0000 interruption 1 IRET I0100 interruption interruption allowed interruption forbidden e If use EI instruction to allow interruption then when scanning the program if interruption input changes from OFF to be ON then execute subroutine return to the original main program Interruption pointer I should be behind FEND instruction PLC is
232. th end symbol Note user doesn t have to calculate the FD value to set the communication parameter Please set the parameters in XCPpro software Project File Edit View Online Jj ec mix a Er lial Ht HAH 4 VE Ins salnas Del sbel F5 Fb Search ria Project Ea PLCI a Code b Ladder Eg PLC Contig soe s Password Overtime Set ms Char 3 Configure Window PLC Comm Port Settings Security Settings BD Settings CAN Settings Expansion Module Settings MA Module Settings Motion Settings Operand Data List Option Keep Registers Settings Reset PLC Serial Port 1 Communication Mode Modbus Num E Fur E User Protocol Stophits Panty Baudrate 19200 BPS Bit 1Bit em rj ais ww a T fal ven T Motice configuration effective reboot PLC Read From PLC Write To PLC After changing the parameters please restart the PLC to make it effective i 7 2 MODBUS Communication H B XC series PLC support both Modbus master and Modbus slave Master mode When PLC is set to be master PLC sends request to other slave devices via Modbus instructions other devices response the master For example Xinje PLC can control the inverter through Modbus Slave mode when PLC is set to be slave it can only response with other master devices Master and slave in RS485 network there are one maser and several slaves at one time see below di
233. the timer s value reaches the max value K32767 it stops timing The timer s status keeps still output delay OFF timer T2 ae YO XO When X000 is ON output YOOO K200 XO YO 12 s When X000 from ON to OFF delay T2 20s then output YOOO is OFF glitter X0 T2 T2 5KI0 Il 124 TI 5 When X000 is ON YOOO starts to glitter T1 controls the OFF time of YOOO T2 controls the ON time of YOOO 2 8 Counter C XC series PLC counters number are all decimal please see the following Number list table for all the counter numbers SERIES AGN FOR COMMON USE C300 C315 32 bits forward backward counter i XCM i C620 C629 double phase HSC C630 C639 AB phase HSC All the counters number meaning TYPE DESCRIPTION 16 bits forward counter CO C299 32 bits forward backward C300 C599 C300 C302 C598 each occupies 2 counters HSC High Speed C600 C634 C600 C602 C634 each occupies 2 counters X 1 Please see chapter 5 for high speed counter Counter The characteristics of 16 bits and 32 bits counters characteristics 1 32 767 2 147 483 648 2 147 483 647 The assigned set Same as the left but data register must be in a Constant K or data register value couple Changing of the Change after positive count Change after positive count Loop counter current value Hold the ac
234. time interval comes To the operation result D the data registers are used to store PID output values the output points are used to output the occupy space ratio in the form of ON OFF PID control rules are shown as below Proportion M VAN Int l P ntegra qb u t Be controlled object Differential e t 2r t c t 1 1 u t 2 Kp e t 1 TiJe t dt TD de t dt 1 2 Here e t 1s warp r t is the given value c t is the actual output value u t is the control value In function 1 2 Kp is the proportion coefficient Ti is the integration time coefficient and TD is the differential time coefficient The result of the operation 1 Analog output MV digital form of u t the default range is 0 4095 2 Digital output Y T MV PID output upper limit Y is the output s activate time within the control cycle T is the control cycle equals to the sampling time PID output upper limit default value is 4095 8 3 Parameters Setting Users can call PID instruction in XCP Pro software directly and set the parameters in the window see graph below for the details please refer to XCPPro user manual Users can also write the parameters into the specified registers by MOV instructions before PID operation PID Instruction Parameter Config a Target Value SV DO Measure Value PV D10 Parameter D4000 Output YO Parameter Config Mode Config A i Common Mode Advanced Mode e Manual 3 Auto
235. tion after Hold the action after positive count reset if Output contact positive count negative count When executing RST command counter s current value is 0 output contacts Reset activates recover The current value register Function The assignment of common use counters and power off retentive counters can me changed via FD parameters from peripheral devices 16 bits binary increment counters the valid value is K1 K32 767 decimal type constant The set value KO and K1 has the same meaning 1 e the output contact works on the first count starts If cut the PLC power supply the normal counter value become zero the retentive Xl I C D K10 counter can store the value it can CO accumulate the value of last time ad oAnuojoj eurjou 19junoo S Iq QT When X001 1s ON once the counter increases 1 When the counter value is 10 its output is activated After when the X001 is ON again the counter continues increasing 1 If X000 is ON reset counter the counter value becomes zero It also can set the counter value in D register For example D10 123 is the same as K123 32 bits increase decrease count range is 2147483648 2147483647 Set the increase or decrease count mode in M8238 If M8238 1 it is decrease mode M8238 0 it is increase mode Set the count value in K or D if set in DO register DO and D1 will be seemed as one RST
236. tion block s name this name can t be changed freely and PLCI Ladder FuncBlock FUNCi Information Export Compile users should modify in the edit window JONCRCRCNCNCNCACh Ch A AONCNChCh hh T TAKA h ACA TAA AERA CA ON A 8 A EE 2 FunctionBlockName FUNC1 3 Version 1 0 0 4 Author 5 UpdateTime 2009 6 6 S246 6 Comment 7 8 UxNCRCCNCKONCA Ch h A AOKONCACh Ch h AOKONCKCh Ch A AONONCACh Ch A AONONCACh Ch h ACA NCKCh Ch h A ONONCKCh hh A WONCKCh hh A A KCK Ch ho h A 8 KCN hd f 9 void FUNC1 WORD W BIT B WORD W correspond with soft component D Edit your C language en BIT B correspond with soft component M program between Parameters transfer format if call the Func Block in ladder the transferred D and M is the start ID of W and B Take the above graph as the example start with DO and MO then W 0 is DO W 10 is D10 B LO is MO B 10 is MIO If in the ladder the used parameters are D100 M100 then W 0 is D100 B 0 is M100 So word and bit component s start address is defined in PLC program by the user Parameter W represent Word soft component use in the form of data group E g WIO z1 W 1 2W 2 W 3 in the program use according to standard C language rules Parameter B represent Bit soft component use in the form of data group Support SET and RESET E g B O 1 B 1 0 And assignment for example B 0 B 1 Double word operation add D in front of W e g DW 1
237. tion time and pulse direction C MO R Segmented dual directional pulse output PLSR 16 bits Instruction Execution condition Hardware requirement PLSR Normally ON OFF coil Suitable Models Software requirement XC2 XC3 XC5 XCM XCC 2 Operands Specify the soft component s start ID of the segmented pulse 16 bit 32 bit parameters S1 S2 2 BIN Specify acceleration deceleration time or soft component s ID 16 bit 32 bit BIN Specify the pulse output port Bit Specify the pulse output direction s port 3 suitable soft components operands constant module p m m m rx py bs ku io 16 bit instruction form C D p2 PLSR D100 YO Y3 i RST MO The parameters address is a section starts from Dn or FDn In the above example DO set the first segment pulse s highest frequency D1 set the first segment s pulse number D2 set the second segment pulse s highest frequency D3 set the second segment s pulse number if the set value in Dn Dn 1 is 0 this represents the end of segment the segment number is not limited For 32 bit instruction DPLSR DO D1 set the first segment pulse s highest frequency D2 D3 set the first segment s pulse number D4 D5 set the second segment pulse s highest frequency D6 D7 set the second
238. to the device s response delay time 2 2 M Number L ist The auxiliary relays M in XC series PLC are all in decimal form please refer the details from tables below RANGE SERIES NAME FOR COMMON FOR POWER OFF FOR SPECIAL USE M USE RETENTIVE USE M 8000 M 8079 M8120 M8139 MO000 M199 M200 M319 M8170 M8172 M8238 M8242 M8350 M8370 XCI RANGE SERIES NAME FOR COMMON FOR POWER OFF FOR SPECIAL USE USE RETENTIVE USE MO000 M2999 M3000 M7999 M8 amp 000 M8767 RANGE SERIES NAME FOR COMMON FOR POWER OFF FOR SPECIAL USE USE RETENTIVE USE MO000 M2999 M3000 M7999 M8000 M8767 SERIES NAME RANGE FOR COMMON FOR POWER OFF FOR SPECIAL USE USE RETENTIVE USE MO000 M3999 M4000 M7999 M8 amp 000 M8767 RANGE SERIES NAME FOR COMMON FOR POWER OFF FOR SPECIAL USE USE RETENTIVE USE M M000 M2999 M3000 M7999 M8 amp 000 M8767 Function In PLC auxiliary relays M are used frequently This type of relay s coil is same with the output relay They are driven by soft components in PLC auxiliary relays M have countless normally ON OFF contactors They can be used freely but this type of contactors can t drive the external loads For common use y This type of auxiliary relays can be used only as normal auxiliary relays Le if power supply suddenly stop during the running the relays will disconnect y Common usage relays can t be used for power off retentive but the zone can be modified
239. ts 2 10 Constant XC series PLC use the following 5 number systems Data process DEC DECIMAL NUMBER y The preset number of counter and timer constant K y The number of Auxiliary relay M timer T counter C state S y Setas the operand value and action of applied instruction constant K HEX HEXADECIMAL NUMBER y Set as the operand value and action of applied instruction constant K BIN BINARY NUMBER y Inside the PLC all the numbers will be processed by binary But when monitoring on the device all the binary will be transformed into HEX or DEC OCT OCTAL NUMBER y XC series PLC I O relays are addressed in OCT Such as 0 7 10 17 70 77 100 107 BCD BINARY CODE DECIMAL y BCD uses 4 bits binary number to display decimal number 0 9 BCD can be used in 7 segments LED and BCD output digital switch Other numbers float number XC series PLC can calculate high precision float numbers It is calculated by binary numbers and display by decimal numbers Display PLC program should use K H to process values K means decimal numbers H means hex numbers Please note the PLC input output relay use octal address Constant K K is used to display decimal numbers K10 means decimal number 10 It is used to set timer and counter value operand value of applied instruction Constant H H is used to display hex numbers H10 means hex number 10 It is used to set operand value of applied
240. ts Instruction Instruction Execution Rising falling edge Suitable XC2 XC3 XC5 XCM XCC condition Models Hardware Software requirement requirement 2 Operands Function Type iD 1 Specify the port to stop pulse output Bit 3 suitable soft components operands 16 bit instruction form MO PLSR DO D100 YO CP li STOP YO M8170 i RST MO When MO changes from OFF to be ON PLSR output pulse at YO DO specify the frequency D1 specify the pulse number D100 specify the acceleration deceleration time when the output pulse number reaches the set value stop outputting the pulse on the rising edge of MI STOP instruction stops outputting the pulse at YO When STOP works the pulse will stop at once even the MO is not off Set frequency Dr t MO MI M8170 if 6 2 6 Refresh the pulse number at the port PLSMV i 1 Instruction Summary Refresh the pulse number at the port Refresh the pulse number at the port PLSMV 16 bits 32 bits PLSMV Instruction Instruction Execution Normally ON OFF coil Suitable XC2 XC3 XC5 XCM XCC condition Models Hardware Software requirement requirement 2 Operands Specify the pulse number or soft components ID 32bit BIN 3 suitable soft components system module 32 bit instruction form
241. ts to Floating Binary Floating Binary Floating If S2 is 0 the calculate is error the instruction can not work 4 applied instructions 4 9 7 Float Square Root ESQR 1 Summary Float Square Root ESQR Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM Hardware Software 2 Operands The soft element address need to do square root 32 bits BIN Do The result address 32 bits BIN 3 Suitable soft components p m m m ox o m os x DL w eeta e eeke E CE X0 DILDIO D21 D20 1 ESQR D10 D20 Binary Floating Binary Floating A square root is performed on the floating point value in S the result is stored in D Jfa constant K or H used as source data the value is converted to floating point before the addition operation XI ESQR K1024 D110 K1024 gt D111 D110 Binary converts to Floating Binary Floating When the result is zero zero flag activates Only when the source data is positive will the operation be effective If S 1s negative then an error occurs and error flag M8067 is set ON the instruction can t be executed 4 applied instructions id 4 9 8 Sine SIN 1 Summary Float Sine SIN Execution Normally ON OFF Suitable XC2 XC3 XC5 XCM condition rising falling edge Hardware Software 2 Operands The soft element address need to do sine 32 bits BIN Do The result address 32 bits BI
242. ul rT TE TT Lx o I JJ y li Lx tet I1 JUI JJ iljlli C600 C620 C630 can support 80KHz with special requirement XC 3 19AR E Increment Pulse Dir Input AB Phase Mode Se a iu L ImImmmNI MN a Bw ee c XC 3 247 32 PLC and XC5 48 60 PLC cree Pueri mpa AB Pine Ma cacao podcsogpsoosuospscengpers pasados osagpas possc MaF 80K sox 10K 10K 10K 10K sok 10K 10K _ 80K SK sx sims e jv meme TTT eT EEE Pe errup px v J j j uv JA xor fof L j fer fet 8M 5 X003 XC3 48 60 PLC a rms caa csoipascsonpsnosuo spa coiden cacesz Prick jefe fodo posod med 11l JlllllclLil Count V jv v V V Interrupt U Exe tet Lj JI D ji 1 ilig XC5 24 32 PLC XCM 24 32 PLC ue acia AB Pane Mode meme Se ped a uiu E 8 EL 4 times F times F Count Interrupt BECK EE X001 Dir B xos jo Ff ett Exe L y L iy Exo L j Exe oi Jig 5 60 Read Write HSC value All high speed counters support read instruction HSCR and write instruction HSCW but users need to use hardware V3 1c and above 5 6 1 Read HSC value H SCR IL Instruction Summary Read HSC value to the specified register 16 bits 32 b
243. ulse Config Single 24 Segment Opposite Absolute Frequency DO Fides Nase D2 Aa And Docdano Time D4 Output Pulse Y Num YO Config Value Accelerate And Decelerate Ims 50 oi 1 Frequency 1000 1 Pulse Num 5000 ica Read From PLC Write To PLC Click ok the pulse item is added in the list Edit Sequence Block 1 Comment Sequence Block 1 Insert Edit Delete Upwards Downwards Pulse Config DSPLSR DO De D4 YO Click ok the BLOCK will show in the program SBLOCK Sequence Block1 DSPLSR SBLOCKE HU o mwem N If you want to move the block to other position you have to select the former block and delete it Mo SBLOCK Sequence Black DSPLSR DO D2 D4 O DSPLSR DE DS 010 YO CBLOCKE Then put the cursor in the place you want to move Right click the add to lad in the project bar Project Re Project e Ej Ba PLCI EL Code ofl Ladder m fq Config Black eA Sequence Black m Sequence Bloc a Comment Editor E Free Monitor T Data Monitor Now the block is moved to the new place a 10 2 3 Delete the BLOCK a You can select the whole block and delete it If you want to delete the block forever please right click the block you want to delete in the project bar and select delete sequence block After this operation you can not call this block anymore Project a PL
244. ulse number per rotate is 8000 High frequency pulse maximum frequency is 100KHz total pulse number is 24000 3 rotates Low frequency pulse maximum frequency is 1OKHz total pulse number is 8000 1 rotates Ladder Program MO 0 DMOV K100000 DO H DMOV K24000 D2 DMOV K10000 D4 DMOV K8000 D6 FMOV KO D8 K4 DMOV K100 D20 MI S p MO CR MI co S 55 32 R MI 36 DPLSR DO D20 YO Y2 H Explanation When PLC changes from STOP to RUN set ON MO set the high frequency parameter DO D2 low frequency parameter D4 D6 speed up down time D20 clear D8 D11 set ON M1 set OFF MO The motor rotates at high frequency for 3 turns set ON M8170 then the motor rotates at low frequency for 1 turn set OFF M8170 set OFF MI A frequency 100000 10000 0 ish frequency 3 p lt Lew frequency 1 turn turns e 12 2 MODBUS COMMUNICATION SAMPLES Example 1 one master station communicates with 3 slave stations Operation 1 write content in D10 D14 to D10 D14 of slave station 2 2 read DI5 D19 of the slave station 2 to DI5 D19 of the mater station anyhow write the first five registers content to the slaves the left five registers are used to store the content from the slaves 3 slave stati
245. ut is OFF the instruction is not executed encode output don t change When n if encode instruction s S is bit unit it s point number is 2 8 256 4 8 10 Low bit coding ENCOL 1 Summary Transform the ASCII to hex numbers Low bit coding ENCOL 16 bits ENCOL Execution Normally ON OFF XC2 XC3 XC5 XCM condition rising falling edge Models Hardware Software requirement requirement 2 Operands S Soft element address need coding 16bit BIN bit Soft element address to save coding result 16bit BIN The soft element quantity to save result 16bit BIN 3 Suitable soft components 4 applied instructions gt e pw e ww ow v wn o lo s 114114111 L1 ide 11 E s Ce ee if 5 is bit device gt n lt 16 lt 2 X m ENCOL MIO DIO K3 XO M17 Ml6 M15 M14 M13 M12 Mil MIO All be 0 if s is word device n lt 4 eC me DO D1 K3 XI ENCOL 0 0 0 0 0 0 0 0 0 0 0 0 0 All be 0 If many bits in the source ID are 1 ignore the high bits If source ID are all 0 don t execute the instructions When drive input is OFF the instruction is not executed encode output don t
246. utput direction terminal 3 Suitable soft element Sl S2 ssa je f To CMAR Model no Z phase signal T Q GO X0 X1 X2 ZRN DO Mode2 with Z phase signal T Q GO GO G9 GO XO X1 X2 ZRN DO X3 YO Y1 Parameter address distribution 32 bits 2 bytes SO back to origin speed VH S042 back to origin speed VL S0 4 creep speed S046 slope of pulse rising and falling S0 8 initial pulses after back to origin D8170 S010 Z phase count value for mode2 CA back start point is behind the origin Model Limit Origin 3 Speed 0 Description Move towards the origin with speed VH If it encounters origin auxiliary signal S2 it will decelerate to speed VL with the slope K note if it encounters the origin when decelerating from VH to VL please modify the pulse slope or origin position to avoid it Keep forward with the current speed VL Decelerate to 0 with the slope K after touching the origin Start to delay delay time is FD8209 unit is ms It accelerates to creep speed with the slope K after delaying Move in reverse direction with creep speed Stop origin returning when it leaves the origin with creep speed Change the pulses D8170 to setting value Note in this mode please keep the origin limit sw
247. value clears to be 0 Counter C According to different application and purpose we can divide the counters to different types as below For internal count for general using power off retentive usage y 16 bits counter for increment count the count range is 1 32 767 y 32 bits counter for increment count the count range is 1 2 147 483 647 y These counters can be used by PLC s internal signal The response speed is one scan cycle or longer For High Speed Count Power off retentive y 32 bits counter for increment decrement count the count range is 2 147 483 648 2 147 483 647 single phase increment count single phase increment decrement count AB phase cont specify to special input points y The high speed counter can count 80KHz frequency it separates with the PLC s scan cycle Data R egister DO Usage of Data Registers Data Registers are used to store data represent with D Addressing Form The data registers in XC series PLC are all 16 bits the highest bit is the sign bit combine two data registers together can operate 32 bits the highest bit is the sign bit data process Points to note Same with other soft components data registers also have common usage type and power off retentive type FlashROM Register FD Usage of FlashROM registers FlashROM registers are used to store data soft components represent with FD Addressing Form In basic units FlashROM registe
248. w www an o lo s liidedlidiliili Li X0 SWAP D10 D10 E284 A BAT Ween ee Low 8 bits and high 8 bits change when it is 16 bits instruction If the instruction is a consecutive executing instruction each operation cycle should change 4 applied instructions 4 5 11 Exchange XCH 1 Summary Exchange the data in two soft element Exchange XCH 16 bits XCH DXCH Execution Normally ON OFF Suitable XCI XC2 XC3 XC5 XCM Hardware Software 2 Operands The soft element address 16 bits BIN The soft element address 16 bits BIN 3 Suitable soft component Word D m E m DX Y m o KH D wD m je fe oe eo oe fe m2 el ele fe fe fe fT lt 16 bits instruction gt m XCH D10 D11 Before D10 100 After D10 101 D11 101 D11 100 The contents of the two destination devices D1 and D2 are swapped When drive input X0 is ON each scan cycle should carry on data exchange please note lt 32 bits instruction gt ls DXCH D10 D20 32 bits instruction DXCH swaps value composed by D10 D11 and the value composed by D20 D21 4 applied instructions 4 5 12 Floating move EMOV l Summary send the floating number from one soft element to another Floating move EMOV Execution Normally on off edge trigger Suitable XC2 XC3
249. x The using method of the functions in the table double sinh double x float sinhf float x Take function arcsin as an example float asinf float x float asinf float means the return value is float format float x float means the function formal parameter is float format In actual using it no needs to write the float See line14 in the following example 5 void ZHENGXIAN WORD W BIT B 108 11 int a ie float x Z 13 x FU O 14 v asinfi ix 15 2 180 y 3 14159 15 a l int 17 W 2 a ig 3 SEQUENCE BLOCK This chapter will introduce the sequence block instruction and the application 10 1 Concept of the BLOCK 10 2 Call the BLOCK 10 3 Edit the instruction inside the BLOCK 10 4 Running form of the BLOCK 10 5 BLOCK instruction editing rules 10 6 BLOCK related instructions 10 7 BLOCK flag bit and register 10 8 Program example Block instruction Block SBSTOP Stop the BLOCK SBSTOP S1 S2 Continue running SBGOON SBGOON BLOCK i 10 1 Concept of the BLOCK H B Sequence block which is also called block is a program block can realize certain function Block is a special flow all the instructions run in order this is the difference from other flows BLOCK starts from SBLOCK and ends by SBLOCKE you can write program between them If there are many pulse output instructions or other instructions they wil
250. y YO Y17 equals 21 i e YO Y2 Y4 becomes to be ON Before M1 activates if DO 0 DX2 D0 represents a word combined by X2 X21 If M1 changes from OFF ON DO 3 then DX2 DO represents a E 2 2 2 Structure of Bit Soft Components B Bit soft components structure is simple the common ones are X YU M S TU C besides a bit of a register can also represents Input Relay X octal type Output Relay Y octal type Auxiliary Relay M S decimal type Auxiliary Relay T C decimal type as the represent method is same with registers so we need to judge if it s word register or bit register according to the register Register s Bit Composed by register s bit support register D Represent method Dn m OS m lt 15 the Nr m bit of Dn register The represent method of word with offset Dn Dm x Bit of Word can t compose to be word again E g Y C5 lt lt D5 b1 4 y D0A means when the Nr 4 bit of DO is 1 set YOON y DS DI 4 means bit addressing with offset if D1 5 then DS5 DI means the Nr 4 bit of D10 2 3 Soft Components L ist 2 3 1 Soft Components L ist X C1 Series ptu Output Pons vo va vo vr vo vis vo ir s 12 36 Y7 memimaw Yoxmy a 64 M0 MI199 M200 M319 320 For Special Usage M8000 M8079 For Special Usage M8120 M8139 For Special Usage M8170 M8172 128 For Special Usage M8238 M8242 For Special Usage

Download Pdf Manuals

image

Related Search

Related Contents

GUÍA DEL USUARIO USER`S GUIDE - Support  取扱説明書 - トヨタホームの充電設備  Philips SWV2202W User's Manual  2014 Nautique Brochure  MANUAL DE INSTRUÇÕES PARA SORVETEIRAS E PICOLETEIRAS    Phases amont de l`innovation - Bibliothèques de l`Université de  Affichez ou téléchargez le dossier de présentation  Samsung SGH-Z240 Bruksanvisning  Sunjoy L-GZ652PST Installation Guide  

Copyright © All rights reserved.
Failed to retrieve file