background image

 

 

 

 

 

 

 

    XD/XL series PLC 

     User manual [Instruction]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WUXI XINJE ELECTRIC CO., LTD.

Data No.  PD05 20201022 3.5 

Summary of Contents for XD Series

Page 1: ...XD XL series PLC User manual Instruction WUXI XINJE ELECTRIC CO LTD Data No PD05 20201022 3 5 ...

Page 2: ...mmary 3 Soft component functions 4 Basic program instructions 5 Applied instructions 6 High speed counter 7 Pulse output 8 Communication functions 9 PID functions 10 C function block 11 Sequences BLOCK 12 Special function instructions 13 Applications 14 Q A 15 Appendixes ...

Page 3: ...ety of PLC and machines by yourself when use the PLC Machines may be damaged by PLC errors Responsibility declaration The manual content has been checked carefully however mistakes may happen We often check the manual and will correct the problems in subsequent version Welcome to offer advices to us Excuse us that we will not inform you if manual is changed Contact information If you have any prob...

Page 4: ...UXILIARY RELAY M HM SM 37 2 6 STATUS RELAY S HS 38 2 7 TIMER T HT 39 2 8 COUNTER C HC 43 2 9 DATA REGISTER D HD 48 2 9 1 Word consist of bits 51 2 9 2 Offset application 52 2 10 FLASH REGISTER FD SFD FS 53 2 11 CONSTANT 54 2 12 PROGRAMMING PRINCIPLE 55 3 BASIC PROGRAM INSTRUCTIONS 59 3 1 BASIC INSTRUCTIONS LIST 59 3 2 LD LDI OUT 61 3 3 AND ANI 62 3 4 OR ORI 63 3 5 LDP LDF ANDP ANDF ORP ORF 64 3 6 ...

Page 5: ... Data block Move PMOV 106 4 5 6 Fill Move FMOV 107 4 5 7 Floating move EMOV 109 4 5 8 FlashROM Write FWRT 110 4 5 9 Zone set MSET 111 4 5 10 Zone reset ZRST 112 4 5 11 Swap the high and low byte SWAP 113 4 5 12 Exchange XCH 114 4 6 DATA OPERATION INSTRUCTIONS 116 4 6 1 Addition ADD 116 4 6 2 Subtraction SUB 118 4 6 3 Multiplication MUL 120 4 6 4 Division DIV 121 4 6 5 Increment INC Decrement DEC 1...

Page 6: ... 1 Floating Compare ECMP 157 4 9 2 Floating Zone Compare EZCP 158 4 9 3 Floating Addition EADD 160 4 9 4 Floating Subtraction ESUB 161 4 9 5 Floating Multiplication EMUL 162 4 9 6 Floating Division EDIV 164 4 9 7 Float Square Root ESQR 165 4 9 8 Sine SIN 166 4 9 9 Cosine COS 167 4 9 10 TAN TAN 168 4 9 11 ASIN ASIN 169 4 9 12 ACOS ACOS 170 4 9 13 ATAN ATAN 171 4 10 RTC INSTRUCTIONS 172 4 10 1 Read ...

Page 7: ...ers 220 6 2 MODBUS COMMUNICATION 220 6 2 1 Function overview 220 6 2 2 Changing of Modbus instruction 221 6 2 3 Modbus communication address 222 6 2 4 Modbus data format 232 6 2 5 Communication Instructions 238 6 2 6 Modbus serial port configuration 248 6 2 7 Modbus Communication application 252 6 2 8 Application 253 6 3 FREE COMMUNICATION 256 6 3 1 Free communication mode 256 6 3 2 Serial port co...

Page 8: ...9 2 4 Modify the BLOCK 312 9 3 EDIT THE INSTRUCTION OF THE BLOCK 314 9 3 1 Command item 314 9 3 2 Pulse Item 315 9 3 3 Wait Item 316 9 3 4 Module Read and Write FROM TO instruction 317 9 4 RUNNING FORM OF THE BLOCK 318 9 5 BLOCK INSTRUCTION EDITING RULES 320 9 6 BLOCK RELATED INSTRUCTIONS 322 9 6 1 Instruction explanation 322 9 6 2 The timing sequence of the instructions 324 9 7 BLOCK FLAG BIT AND...

Page 9: ...APPENDIX 1 SPECIAL AUXILIARY RELAY 368 APPENDIX 2 SPECIAL DATA REGISTER 374 APPENDIX 3 SPECIAL FLASH REGISTER 381 APPENDIX 4 PLC RESOURCE CONFLICT TABLE 384 APPENDIX 5 PLC FUNCTION CONFIGURATION LIST 385 ...

Page 10: ...rough Modbus instruction FS cannot be compared to register but only constant in XDPpro software The value cannot be read FS is used to protect the user s copyright The register D HD can replace by FS When the user program is too long the comments of program and soft components are necessary in order to change the program easily later Add offset appendix like X3 D100 M10 D100 D0 D100 after coils da...

Page 11: ...1 2 1 Type XD XL series PLC support two types of programming language Make the program with instructions directly such as 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 operand Make sequential control graph with sequential control signal and soft components This method is called Ladder chart This method uses coils and contactor...

Page 12: ... to use like pulse output PID etc XDPPro software has the configuration window for these special instructions User just needs to input parameters in the configuration window without remembering complicated instructions The following window is multi section pulse output For the details of instruction configuration please refer to XD XL series PLC user manual software part Instruction Ladder Direct ...

Page 13: ...L3 main unit XD5 XDM XDC XD5E XDME XDH XL5 XL5E XLME can connect 16 extension modules Extension BD board BD 1 starts from X20000 The 24 32 points PLC can connect one extended BD board and the 48 60 points PLC can connect two extended BD boards 16 point PLC does not support extended BD board XL XDH series does not support extended BD board The address number of the left extended ED module starting ...

Page 14: ... PLC the sign is M and HM Address assignment principle In basic units assign the auxiliary address in decimal form Using notes This type of relays are different from the input output relays they can t drive external load and receive external signal but only be used in the program Retentive relays can keep its ON OFF status when PLC power OFF Function of status relays Used as relays in Ladder the s...

Page 15: ...rminals The high speed counter will not be affected by PLC scanning period For increment mode it can count max 80KHz pulses for AB phase mode it can count max 50KHz pulses Address assignment principle In basic units assign the timer address in decimal form Function of Data Registers Data Registers are used to store data the sign is D and HD Address assignment principle The data registers in XD XL ...

Page 16: ...t users write frequently When using MOV instruction to transmit data to FS the rising edge is valid The value of the soft element can be set arbitrarily in the FS register but the value of the register can not be read always returned to 0 and it can not be compared with the register in the PLC software only with the constant so the actual value of the register can not be read B means Binary K repr...

Page 17: ...10 HC11 E g MOV D0 T11 M0 T11 Y1 X0 TMR T11 K99 K100 In the above example MOV T11 D0 T11 represents word register LD T11 T11 represents bit register For power off retentive usage 16 bits For power off retentive usage 32 bits combine two continuous 16 bits registers For special usage occupied by the system can t be used as common instruction parameters For common usage 16 bits combine 16 bits The s...

Page 18: ...onent Input Relay X octal form Output Relay Y octal form Auxiliary Relay M HM S HS decimal form Auxiliary Relay T HT C HC decimal form The represent method is same to registers so we need to judge if it s word register or bit register according to the instruction Composed by bit of register support register D Represent method Dn m 0 m 15 for example D10 2 means the second bit of D10 The represent ...

Page 19: ...28 Y Output points 4 Y20000 Y20077 1 expansion BD Y20100 Y20177 2 expansion BD 128 X Input points 5 X30000 X30077 1 expansion ED 64 Y Output points 5 Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M7999 8000 HM HM0 HM959 1 960 SM Special purpose SM0 SM2047 2 2048 S Flow S0 S1023 1024 HS HS0 HS127 1 128 T Timer T0 T575 576 HT HT0 HT95 1 96 ET Precise timer ET0 ET31 32 C Counter C0 C575 576 HC ...

Page 20: ...1 expansion BD QD20100 QD20199 2 expansion BD 200 expansion ED QD30000 QD30099 1 expansion ED 100 SEM Special coil of Sequence block instruction WAIT SEM0 SEM31 32 XD2 series PLC soft components list Name Range Points 16 I O 24 I O 32 I O 48 I O 60 I O 16 24 32 48 60 X Input points X0 X7X0 X15X0 X21X0 X33X0 X43 8 14 18 28 36 Y Output points Y0 Y7Y0 Y11Y0 Y15Y0 Y23Y0 Y27 8 10 14 20 24 X Input point...

Page 21: ...D2047 2048 HSD Special purpose HSD0 HSD499 2 500 FD FlashROM register FD0 FD5119 5120 SFD Special purpose SFD0 SFD1999 2 2000 FS Special secret register FS0 FS47 48 ID 6 Main body ID0 ID99 100 Expansion module ID10000 ID10099 1 expansion module ID10900 ID10999 10 expansion module 1000 expansion BD ID20000 ID20099 1 expansion BD ID20100 ID20199 2 expansion BD 200 expansion ED ID30000 ID30099 1 expa...

Page 22: ...00 X30077 1 expansion ED 64 Y Output points 5 Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M7999 8000 HM HM0 HM959 1 960 SM special purpose SM0 SM2047 2 2048 S Flow S0 S1023 1024 HS HS0 HS127 1 128 T Timer T0 T575 576 HT HT0 HT95 1 96 ET precise timer ET0 ET31 32 C Counter C0 C575 576 HC HC0 HC95 1 96 HSC high speed counter HSC0 HSC31 32 D Data register D0 D7999 8000 HD HD0 HD999 1 1000 SD ...

Page 23: ...s Y0 Y11 Y0 Y15 Y0 Y23 Y0 Y27 10 14 20 24 X Input points 3 X10000 X10077 1 expansion module X11700 X11777 16 expansion module 1024 Y Output points 3 Y10000 Y10077 1 expansion module Y11700 Y11777 16 expansion module 1024 X Input points 4 X20000 X20077 1 expansion BD X20100 X20177 2 expansion BD 192 Y Output points 4 Y20000 Y20077 1 expansion BD Y20100 Y20177 2 expansion BD 192 X Input points 5 X30...

Page 24: ...ain body ID0 ID99 100 Expansion module ID10000 ID10099 1 expansion module ID11500 ID11599 16 expansion module 1600 expansion BD ID20000 ID20099 1 expansion BD ID20100 ID20199 2 expansion BD 200 expansion ED ID30000 ID30099 1 expansion ED 100 QD 7 Main body QD0 QD99 100 Expansion module QD10000 QD10099 1 expansion module QD11500 QD11599 16 expansion module 1600 expansion BD QD20000 QD20099 1 expans...

Page 25: ...30000 X30077 1 expansion ED 64 Y Output points 5 Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M69999 70000 HM HM0 HM11999 1 12000 SM special purpose SM0 SM4999 2 5000 S Flow S0 S7999 8000 HS HS0 HS999 1 1000 T Timer T0 T4999 5000 HT HT0 HT1999 1 2000 ET precise timer ET0 ET39 40 C Counter C0 C4999 5000 HC HC0 HC1999 1 2000 HSC high speed counter HSC0 HSC39 40 D Data register D0 D69999 70000...

Page 26: ...24 I O 32 I O 48 I O 60 I O 24 32 48 60 X Input points X0 X15 X0 X21 X0 X33 X0 X43 14 18 28 36 Y Output points Y0 Y11 Y0 Y15 Y0 Y23 Y0 Y27 10 14 20 24 X Input points 3 X10000 X10077 1 expansion module X11700 X11777 16 expansion module 1024 Y Output points 3 Y10000 Y10077 1 expansion module Y11700 Y11777 16 expansion module 1024 X Input points 4 X20000 X20077 1 expansion BD X20100 X20177 2 expansio...

Page 27: ...al secret register FS0 FS47 48 ID 6 Main body ID0 ID99 100 Expansion module ID10000 ID10099 1 expansion module ID11500 ID11599 16 expansion module 1600 expansion BD ID20000 ID20099 1 expansion BD ID20100 ID20199 2 expansion BD 200 expansion ED ID30000 ID30099 1 expansion ED 100 QD 7 Main body QD0 QD99 100 Expansion module QD10000 QD10099 1 expansion module QD11500 QD11599 16 expansion module 1600 ...

Page 28: ... expansion ED 64 Y Output points 5 Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M69999 70000 HM HM0 HM11999 1 12000 SM special purpose SM0 SM4999 2 5000 S Flow S0 S7999 8000 HS HS0 HS999 1 1000 T Timer T0 T4999 5000 HT HT0 HT1999 1 2000 ET precise timer ET0 ET39 40 C Counter C0 C4999 5000 HC HC0 HC1999 1 2000 HSC high speed counter HSC0 HSC39 40 D Data register D0 D69999 70000 HD HD0 HD2499...

Page 29: ... XDME series PLC soft components list Name Range Points 60 I O 60 X Input points X0 X43 36 Y Output points Y0 Y27 24 X Input points 3 X10000 X10077 1 expansion module X11700 X11777 16 expansion module 1024 Y Output points 3 Y10000 Y10077 1 expansion module Y11700 Y11777 16 expansion module 1024 X Input points 4 X20000 X20077 1 expansion BD X20100 X20177 2 expansion BD 128 Y Output points 4 Y20000 ...

Page 30: ...0 FS Special secret register FS0 FS47 48 ID 6 Main body ID0 ID99 100 Expansion module ID10000 ID10099 1 expansion module ID11500 ID11599 16 expansion module 1600 expansion BD ID20000 ID20099 1 expansion BD ID20100 ID20199 2 expansion BD 200 expansion ED ID30000 ID30099 1 expansion ED 100 QD 7 Main body QD0 QD99 100 Expansion module QD10000 QD10099 1 expansion module QD11500 QD11599 16 expansion mo...

Page 31: ... points 5 Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M19999 20000 HM HM0 HM19999 1 20000 SM special purpose SM0 SM49999 2 50000 S Flow S0 S19999 20000 HS HS0 HS1999 1 2000 T Timer T0 T19999 20000 HT HT0 HT1999 1 2000 ET precise timer ET0 ET39 40 C Counter C0 C19999 20000 HC HC0 HC1999 1 2000 HSC high speed counter HSC0 HSC39 40 D Data register D0 D499999 500000 HD HD0 HD49999 1 50000 SD s...

Page 32: ...ion WAIT SEM0 SEM31 32 XL1 XL3 series PLC soft components list Name Range Points 16 I O 16 X Input points X0 X7 8 Y Output points Y0 Y7 8 X Input points 3 X10000 X10077 1 expansion module X11100 X11177 10 expansion module 640 Y Output points 3 Y10000 Y10077 1 expansion module Y11100 Y11177 10 expansion module 640 X Input points 4 X20000 X20077 1 expansion BD X20100 X20177 2 expansion BD 128 Y Outp...

Page 33: ...secret register FS0 FS47 48 ID 6 Main body ID0 ID99 100 Expansion module ID10000 ID10099 1 expansion module ID10900 ID10999 10 expansion module 1000 expansion BD ID20000 ID20099 1 expansion BD ID20100 ID20199 2 expansion BD 200 expansion ED ID30000 ID30099 1 expansion ED 100 QD 7 Main body QD0 QD99 100 Expansion module QD10000 QD10099 1 expansion module QD10900 QD10999 10 expansion module 1000 exp...

Page 34: ... Y30000 Y30077 1 expansion ED 64 M Internal relay M0 M69999 70000 HM HM0 HM11999 1 12000 SM special purpose SM0 SM4999 2 5000 S Flow S0 S7999 8000 HS HS0 HS999 1 1000 T Timer T0 T4999 5000 HT HT0 HT1999 1 2000 ET precise timer ET0 ET39 40 C Counter C0 C4999 5000 HC HC0 HC1999 1 2000 HSC high speed counter HSC0 HSC39 40 D Data register D0 D69999 70000 HD HD0 HD24999 1 25000 SD special purpose SD0 S...

Page 35: ...n the appendix of this manual 3 I O address assignment octal of the extended module which can be used as intermediate relay when the extension module is not connected XL1 XD1 XD2 does not support extension modules XD3 XL3 can expand up to 10 at the same time XD5 XDM XDC XD5E XDME XDH XL5 XL5E XLME can expand up to 16 at the same time 4 Extended BD I O address allocation octal can be used as interm...

Page 36: ...e Points 16 I O 24 I O 32 I O 48 I O 60 I O 16 24 32 48 60 XD2 XD3 XD5 X X0 X7 X0 X15 X0 X21 X0 X33 X0 X43 8 14 18 28 36 Y Y0 Y7 Y0 Y11 Y0 Y15 Y0 Y23 Y0 Y27 8 10 14 20 24 Series Name Range Points 24 I O 32 I O 60 I O 24 32 60 XDM X X0 X15 X0 X21 X0 X43 14 18 36 Y Y0 Y11 Y0 Y15 Y0 Y27 10 14 24 Series Name Range Points 24 I O 32 I O 48 I O 60 I O 24 32 48 60 XDC X X0 X15 X0 X21 X0 X33 X0 X43 14 18 2...

Page 37: ... not connected with external devices can be seemed to fast internal relays Output Relay Y PLC 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 which are not connected with external devices can be seemed to fast internal relays Functio...

Page 38: ...L series PLC are all in decimal form please see the following table Series Name Range Normal Power off holding Special XD1 M M0 M7999 HM0 HM959 SM0 SM2047 XD2 M0 M7999 HM0 HM959 SM0 SM2047 XD3 M0 M7999 HM0 HM959 SM0 SM2047 XD5 M0 M69999 HM0 HM11999 SM0 SM4999 XDM M0 M69999 HM0 HM11999 SM0 SM4999 XDC M0 M69999 HM0 HM11999 SM0 SM4999 XD5E M0 M69999 HM0 HM11999 SM0 SM4999 XDME M0 M69999 HM0 HM11999 S...

Page 39: ...re usually used to memory the status before stop the power then when power the PLC on again the status can run again For Special Usage Special relays are some relays which are defined with special meanings or functions start from SM0 There are two functions for special relays first is used to drive the coil the other type is for special running E g SM2 is the initial pulse activates only at the mo...

Page 40: ...e them freely in the program Note The range of soft components mentioned above is the valid range of PLC in the X NET communication mode In the MODBUS communication mode some relays can not read and write The specific usable range is shown in chapter 6 2 3 2 7 Timer T HT The timer addresses of XD XL series PLC are in the form of decimal please see the following table Series Name Range Normal Power...

Page 41: ...Y0 Function If X0 is ON HT0 accumulates the 10ms pulse based on the current value When the accumulation value reaches the set value K2000 the timer output activates If X0 is suddenly OFF during timer working the timer value will be retentive Then X0 is ON again the timer will continue working When X2 is ON the timer and output will be reset If X0 is ON then T0 accumulates 10ms pulse based on the c...

Page 42: ... is 10ms set time is K10 the real time is 10ms 10 0 1s TMR T0 K10 K10 X0 TMR T0 D0 K10 X0 X1 MOV K10 D0 Set value is constant K set value is register D 3 Time unit is 100ms set time is K1 the real time is 100ms 1 0 1s TMR T0 K1 K100 X0 TMR T0 D0 K100 X0 X1 MOV K1 D0 Set value is constant K set value is register D Power off retentive accumulation 1 Time unit is 1ms set time is K100 the real time is...

Page 43: ...K10 and K100 Please do not write other values or registers besides these three parameters Otherwise although the program can be written into the programming software and downloaded to the PLC the timing instruction will not be executed 3 The setting range of constant K and the actual setting value of timer are shown in the following table Timer K range Actual value 1ms timer 1 32 767 0 001 32 767s...

Page 44: ...nd write The specific usable range is shown in chapter 6 2 3 2 8 Counter C HC The counter addresses of XD XL series PLC are in decimal please see the following table for details Series Name Range Normal Power off holding High speed counter XD1 C HC HSC C0 C575 HC0 HC95 HSC0 HSC31 XD2 C0 C575 HC0 HC95 HSC0 HSC31 XD3 C0 C575 HC0 HC95 HSC0 HSC31 XD5 C0 C4999 HC0 HC1999 HSC0 HSC39 XDM C0 C4999 HC0 HC1...

Page 45: ...ion mode Item 16 bit counter 32 bit counter Count direction Count down up Count up down Set value 0 32 767 2 147 483 648 2 147 483 647 Set value type Constant K or register Constant K or a couple of registers Count value The value will not change when reaching the max or min value The value will not change when reaching the max or min value Output Keep the state for count up Reset for count down R...

Page 46: ...ugh instruction DCNT C0 K5 X4 X3 RST C0 C0 Y0 DCNT_D HC0 K 5 X4 RST HC0 HC0 Y0 X3 Common count up counter power off retentive count down counter If X3 is ON the counter and output will be reset For power off retentive counter the present counter value output state will be kept after power supply is off 32 bit counter can be seemed to 32 bit register The set value contains two conditions 16 bit and...

Page 47: ...r common count up set value is constant K set value is register CNT C0 K5 X1 CNT C0 D0 X1 X0 MOV K5 D0 16 bit counter power off retentive count up set value is constant K set value is register CNT HC0 K5 X1 CNT HC0 D0 X1 X0 MOV K5 D0 16 bit counter common count down set value is constant K set value is register CNT_D C0 K 5 X1 CNT_D C0 D0 X1 X0 MOV K 5 D0 16 bit counter power off retentive count d...

Page 48: ...ange Actual setting range 16 bit counter 1 32 767 1 32 767 32 bit counter 1 2 147 483 647 1 2 147 483 647 The counter counting mode is 16 bit linear incremental mode 0 K32 767 When the counter s count value CD reaches the maximum value K32 767 the counter will stop counting and the state of the counter will remain unchanged The counter counting mode is a 16 bit linear decreasing mode 32768 0 When ...

Page 49: ...nput terminal X0 High speed counter is not affected by the response lag time of input filter and cycle scan time Therefore higher frequency input pulses can be processed Refer to the details in chapter 5 Note The range of soft components mentioned above is the valid range of PLC in the X NET communication mode In the MODBUS communication mode some relays can not read and write The specific usable ...

Page 50: ...data register D ranges from D0 to D59999 Data register is used to store data it includes 16 bits the higheset bit is sign bit and 32 bits 32 bits contains two registers the highest bit is sign bit 16 bits register range is 32 768 32 767 Read and write the register data through instruction or other device such as HMI 32 bits value is consisted of two continuous registers The range is 2147483648 214...

Page 51: ...special registers are initialized when PLC is power on 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 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 K0 D0 SM2 MOV K5 D0 M2 MOV D10 D0 D100 SM0 Y0 D0 When D0 0 D100 D10 Y0 ...

Page 52: ... can not read and write The specific usable range is shown in chapter 6 2 3 2 9 1 Word consist of bits One of the coils from X0 to X17 is ON Y0 will be ON Programming method one Example When M0 is ON write 100 into D0 16 bits value When M1 is ON write 41100 into D11 D10 32bits value When M0 is ON transfer the value of D10 to D0 When M0 is ON move the value of C10 to D0 When X0 is ON T10 starts to ...

Page 53: ...o application of word consists of bits DX0 K0 Y0 2 9 2 Offset application Application 1 When M0 is ON the output from Y1 to Y7 will be ON one by one D0 is offset address If there are many output points M can replace Y SM13 M0 MOV K1 D0 D0 D4000 INC D0 MOV K7 D4000 SM2 R Y0 D0 Y0 D0 S ...

Page 54: ...FD5999 FS0 FS47 XDM FD0 FD8191 SFD0 SFD5999 FS0 FS47 XDC FD0 FD8191 SFD0 SFD5999 FS0 FS47 XD5E FD0 FD8191 SFD0 SFD5999 FS0 FS47 XDME FD0 FD8191 SFD0 SFD5999 FS0 FS47 XDH FD0 FD65535 SFD0 SFD49999 FS0 FS47 XL1 FD0 FD5119 SFD0 SFD1999 FS0 FS47 XL3 FD0 FD5119 SFD0 SFD1999 FS0 FS47 XL5 FD0 FD8191 SFD0 SFD5999 FS0 FS47 XL5E FD0 FD8191 SFD0 SFD5999 FS0 FS47 XLME FD0 FD8191 SFD0 SFD5999 FS0 FS47 FLASH Us...

Page 55: ... permanent damage to Flash registers so it is not recommended that users write frequently Do not use oscillating coil e g SM11 as driving condition 3 When data is transmitted to the same Flash register several times if the value in the source register does not change from the previous transmission the transmission instruction will not be executed even if the driving condition is established again ...

Page 56: ...am 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 HA means decimal number 10 It is used to set operand value of ap...

Page 57: ...nterruption XD1 32 XD2 24 32 48 60 XD3 24 32 48 60 XD5 24 32 48 60 XDM XDC XD5E XDME XL5 XL5E XLME I X2 I0000 I0001 There are 20 timer interruptions From I40 to I59 means the timeof timer interruption the unit is ms X3 I0100 I0101 X4 I0200 I0201 X5 I0300 I0301 X6 I0400 I0401 X7 I0500 I0501 X10 I0600 I0601 X11 I0700 I0701 X12 I0800 I0801 X13 I0900 I0901 P is usually used in flow it is used together...

Page 58: ...t each specified interruption loop time Use this interruption in the control which is different from PLC s operation cycle Action sequence of input output relays and response delay Input Before PLC executing the program read all the input terminal s ON OFF status to the image area In the process of executing the program even the input changed the content in the input image area will not change How...

Page 59: ...ied instructions such as high speed count input interruption input filter adjustment Dual output Dual coils action X0 OUT Y0 Y0 OUT Y1 X1 OUT Y0 X0 ON X1 OFF Y0 OFF Y1 ON When executing dual output use dual coil the after one is act in priority As shown in the left map please consider the case of using the same coil Y0 at many positions E g X0 ON X1 OFF The first Y0 X0 is ON its image area is ON o...

Page 60: ...y closed contact directly 3 6 LDP Initial logical operation Rising edge pulse 3 5 LDF Initial logical operation Falling trailing edge pulse 3 5 AND Serial connection of NO normally open contacts M0 3 3 ANDD Read the status from the contact directly 3 6 ANI Serial connection of NC normally closed contacts M0 3 3 ANDDI Read the normally closed contact directly 3 6 ANDP Serial connection of rising ed...

Page 61: ... contact directly 3 6 SET Set a bit device permanently ON 3 12 RST Reset a bit device permanently OFF 3 12 CNT 16 bit non power off retentive incremental count CNT C0 K8 3 13 CNT_D 16 bit power off retentive decremented count CNT_D HC0 K8 3 13 DCNT 32 bit non power off retentive incremental count DCNT C0 K8 3 13 DCNT_D 32 bit power off retentive decremented count DCNT_D HC0 K8 3 13 PLS Turn on a s...

Page 62: ...ive Initial logic operation contact type NO Normally Open M0 Operands X Y M HM SM S HS T HT C HC Dn m LDI negative Initial logic operation contact type NC Normally Closed M0 Devices X Y M HM SM S HS T HT C HC Dn m OUT OUT Final logic operation type drive coil Y0 Operands X Y M HM SM S HS T HT C HC Dn m Connect the LD and LDI instructions directly to the left bus bar It can work with ANB and be use...

Page 63: ...T HT C HC Dn m Use AND and ANI to connect the contactors in series There is no limit for contactors in series They can be used for many times Use OUT instruction through other coil is called follow on output For an example see the program below OUT M2 and OUT Y3 Follow on output can repeat as long as the output order is correct There s no limit for the serial connected contactors and follow on out...

Page 64: ... the instruction step parallel connect with the LD and LDI instruction step introduced before There is no limit for the parallel connect times LD X2 AND M1 OUT Y2 LD Y2 ANI X3 OUT M2 AND T1 OUT Y3 Mnemonic Function Format and Operands OR OR Parallel connection of NO Normally Open contactors M0 Operand X Y M HM SM S HS T HT C HC Dn m ORI OR reverse Parallel connection of NC Normally Closed contacto...

Page 65: ...ailing edge pulse X Y M HM SM S HS T HT C HC Dn m ANDP AND Pulse Serial connection of Rising edge pulse X Y M HM SM S HS T HT C HC Dn m ANDF Serial connection of Falling trailing edge pulse 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 LD X5 OR X6 OR M11 OUT Y6 LDI Y6...

Page 66: ...HC Dn m ORP OR Pulse Parallel connection of Rising edge pulse X Y M HM SM S HS T HT C HC Dn m ORF OR Falling pulse Parallel connection of Falling trailing edge pulse X Y M HM SM S HS T HT C HC Dn m Mnemonic Function Format and Operands LDD Read the status from the contact directly Devices X LDDI Read the normally closed contact directly Devices X X0 D X0 D LDP X5 ORP X6 OUT M13 LD M8000 ANDP X7 OU...

Page 67: ...isfied needn t wait for the next scan cycle 3 7 ORB Mnemonic Function Format and Devices ORB OR Block Parallel connect the serial circuits ANDD Read the status from the contact directly Devices X ANDDI Read the normally closed contact directly Devices X ORD Read the status from the contact directly Devices X ORDI Read the normally closed contact directly Devices X OUTD Output to the contact direct...

Page 68: ...ndependent instruction which is not associated with any soft component There are no limits for parallel circuits quantity when using ORB for every circuit 3 8 ANB Mnemonic Function Format and Devices Recommended good programming method LD X0 AND X1 LD X2 AND X3 ORB LD X4 AND X5 ORB OUT Y10 Non preferred programming method LD X0 AND X1 LD X2 AND X3 LD X4 AND X5 ORB ORB OUT Y10 Statements Program Mn...

Page 69: ...CR ANB And Block Serial connection of parallel circuits Devices none Mnemonic Function Format and Devices MCS Master control The start of new bus line Devices None MCR Master control Reset Reset the bus line ZRN D0 X0 X1 M0 S2 X2 S3 S0 Y0 Y1 D1 D2 S1 Devices None LD X0 OR X1 LD X2 AND X3 LDI X4 AND X5 ORB OR X6 ANB OR X7 OUT Y20 Statements Program Statements Mnemonic and Function ...

Page 70: ...g MCR instruction go back to the last level of bus line When use flow program bus line management could only be used in the same flow When the flow ends it must go back to the main bus line Note The MCS and MCR instructions can not be written directly in the ladder diagram of XD XL series PLC programming software They can be constructed by horizontal and vertical lines 3 10 ALT Mnemonic Function F...

Page 71: ... PLF instruction soft component Y and M will act during one scanning period after the drive is OFF Mnemonic Function Format and Devices PLS Rising Pulse Turn on a scan cycle when Rising edge Operand X Y M HM SM S HS T HT C HC Dn m PLF Falling Pulse Turn on a scan cycle when Falling edge Operand X Y M HM SM S HS T HT C HC Dn m LDP M100 ALT M0 LD M0 OUT Y0 LDI M0 OUT Y1 Statements Program Statements...

Page 72: ...t Any order is allowed but the last one is effective RST can be used to reset the counter timer and contactor When using SET or RST it cannot use the same soft component with OUT Mnemonic Function Format and Devices SET Set Set a bit device permanently ON Operand X Y M HM SM S HS T HT C HC Dn m RST Reset Reset a bit device permanently OFF Operand X Y M HM SM S HS T HT C HC Dn m LD X0 PLS M0 LD M0 ...

Page 73: ...mat and devices CNT Output 16 bits non power off retentive increase count the drive of count coil CNT C0 K8 Operand K D CNT_D Output 16 bits power off retentive decrease count the drive of count coil CNT_D HC0 K8 Operand K D Program Mnemonic and Function LD X10 SET Y0 LD X11 RST Y0 LD X12 SET M50 LD X13 RST M50 LD X14 SET S0 LD X15 RST S0 LD X16 TMR T250 K10 K10 LD X17 RST T250 ...

Page 74: ...on power off retentive increase count the drive of count coil DCNT C0 K8 Operand K D DCNT_D Output 32 bits power off retentive decrease count the drive of count coil DCNT_D HC0 K8 Operand K D RST Reset Reset the output coil clear the current count value Operand C HC HSC C0 increase counts the X11 OFF to ON times When C0 reaches K10 C0 will become OFF to ON When X11 becomes OFF to ON the C0 current...

Page 75: ...0ms timer the drive of coil operand K D TMR_A output Power off retentive 10ms timer the drive of coil TMR_A HT0 K10 K10 operand K D TMR_A output Power off retentive 1ms timer the drive of coil TMR_A HT0 K10 K1 operand C HC HSC TMR T0 K10 K10 Y0 RST T0 M0 T0 M1 Power off retentive timer will keep the current value and counter coil status when the power is off 3 15 END Mnemonic and Function When M0 ...

Page 76: ...ng the program from 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 16 GROUP GROUPE Mnemonic Function Format and Devices ...

Page 77: ...ral programming principle is a write the circuit with many serial contacts on the top b write the circuit with many parallel contactors in the left 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 procedure Dual output dual coil s activation and the solution If carry on coil s ...

Page 78: ...t the input rule But as the preceding action is very complicate please modify the program as in the following example Y0 Y0 X0 X2 X3 X4 Y0 X0 X2 X3 X4 M0 M1 X0 X2 X3 X4 Y0 M0 M1 There are other methods E g jump instructions or flow instructions ...

Page 79: ...rent flow 4 3 3 ST Open the assigned flow not close the current flow 4 3 3 FOR Start a FOR NEXT loop 4 3 4 NEXT End of a FOR NEXT loop 4 3 4 FEND Main program END 4 3 5 END Program END 4 3 5 Data Compare LD LD activates if S1 S2 4 4 1 LD LD activates if S1 S2 4 4 1 LD LD activates if S1 S2 4 4 1 LD LD activates if S1 S2 4 4 1 LD LD activates if S1 S2 4 4 1 LD LD activates if S1 S2 4 4 1 AND AND ac...

Page 80: ... 4 5 2 MOV Move 4 5 3 BMOV Block move 4 5 4 PMOV Transfer the Data block 4 5 5 FMOV Multi points repeat move 4 5 6 EMOV Float number move EMOV S D 4 5 7 FWRT Flash ROM written 4 5 8 MSET Zone set 4 5 9 ZRST Zone reset 4 5 10 SWAP Swap the high and low byte 4 5 11 XCH Exchange two values 4 5 12 Data Operation ADD Addition 4 6 1 SUB Subtraction 4 6 2 MUL Multiplication 4 6 3 AND S1 S2 AND S1 S2 AND ...

Page 81: ...Word shift left 4 7 6 WSFR Word shift right 4 7 7 Data Convert WTD Single word integer converts to double word integer 4 8 1 FLT 16 bits integer converts to float point 4 8 2 DFLT 32 bits integer converts to float point 4 8 2 FLTD 64 bits integer converts to float point 4 8 2 INT Float point converts to integer 4 8 3 BIN BCD converts to binary 4 8 4 BCD Binary converts to BCD 4 8 5 MEAN S D n WAND...

Page 82: ... 4 9 2 EADD Float Add 4 9 3 ESUB Float Subtract 4 9 4 EMUL Float Multiplication 4 9 5 EDIV Float division 4 9 6 ESQR Float Square Root 4 9 7 SIN Sine 4 9 8 COS Cosine 4 9 9 TAN Tangent 4 9 10 ASIN Float Sine 4 9 11 ACOS Float Cosine 4 9 12 ATAN Float Tangent 4 9 13 Clock Operation TRD Read RTC data 4 10 1 TWR Write RTC data 4 10 2 HEX S D n DECO S D n ENCO S D n ENCOL S D n GRY S D GBIN S D EADD S...

Page 83: ... the sum result 16 bits 32 bits BIN Suitable Soft Components Note D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS M includes M HM SM S includes S and HS T includes T and HT C includes C and HC 16 bits instruction ADD D10 D12 D14 X0 S1 S2 D 32 bits instruction DADD D10 D12 D14 X0 S1 S2 D Two source data make binary addition and the result data st...

Page 84: ...esult is over 32767 16bits or 2147483647 32bits OFF the calculate result is not over 32767 16bits or 2147483647 32bits SM22 Carry ON the calculate result is over 32767 16bits or 2147483647 32bits OFF the calculate result is not over 32767 16bits or 2147483647 32bits The assignment of the data The data register of XD XL series PLC is a single word 16 bit data register single word data only occupy o...

Page 85: ...l coil Condition Jump CJ 16 bits CJ 32 bits Execution condition Normally ON OFF coil Suitable Models XD XL Hardware requirement Software requirement Operands Operands Function Data Type Pn Jump to the target with pointer Nr P P0 P9999 Pointer s Nr Mnemonic Instruction s name Chapter CJ Condition Jump 4 3 1 CALL Call subroutine 4 3 2 SRET Subroutine return 4 3 2 STL Flow start 4 3 3 STLE Flow end 4...

Page 86: ... Call CALL 16 bits CALL 32 bits Execution condition Normally ON OFF Rising Falling edge Suitable Models XD XL Hardware requirement Software requirement Subroutine Return SRET 16 bits SRET 32 bits Execution condition Suitable Models XD XL Hardware requirement Software requirement Pointer P I Other Description In the left graph Y0 becomes to be dual coil output but when X0 OFF X1 activates when X0 O...

Page 87: ...with FEND instruction will describe this instruction later In the subroutine 9 times call is allowed so totally there can be 10 nestings When calling the subprogram all the timer OUT PLS PLF of the main program will keep the status All the OUT PLS PLF timer of subprogram will keep the status when subprogram returning Do not write pulse counter or timer inside the subprogram which cannot be complet...

Page 88: ... If the program will be used in many places make the program in subprogram and call it 4 3 3 Flow SET ST STL STLE Summary Instructions to specify the start end open close of a flow Open the specified flow close the local flow SET 16 bits SET 32 bits Execution condition Normally ON OFF Rising Falling edge Suitable Models XD XL Hardware requirement Software requirement Open the specified flow not cl...

Page 89: ... write the flow as the order S0 S1 S2 you can make the order For example executing S10 then S5 S0 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 S1 close the current flow S0 open flow S1 In flow S0 ST S2 open the flow S2 but don t close flow S0 When flow turns from ON to be OFF res...

Page 90: ... run in branch then merge in one flow Program diagram S0 start S20 start S12 start S11 start S21 start S22 start S30 start S10 start After executing SET S1 close S0 open S1 After executing ST S2 open S2 not close S0 Example ...

Page 91: ... M0 is ON set ON flow S10 and S20 In S10 branch it runs S10 S11 and S12 Set on M1 means the S10 branch is finished In S20 branch it runs S20 S21 and S22 Set on M2 means the S20 branch is finished When both branch S10 and S20 end set on S30 When S30 end reset S30 ...

Page 92: ...tus of S1 is kept When S0 is running for certain time closes S0 and force close S1 and S2 S0 S M0 ZRST S0 S1 S0 STL S0 M1 S S0 SM000 TMR T0 K50 K100 TMR T4 K1000 K100 ST S1 T0 TMR T3 K10 K100 T0 ST S2 T3 S0 R T4 STLE STL S2 TMR T2 K400 K100 S2 S2 R T2 STLE STL S1 TMR T1 K200 K100 S1 S1 R T1 STLE ...

Page 93: ...uctions must be programmed as a pair Nesting is allowed and the nesting level is 8 The program after NEXT will not be executed unless the program between FOR and NEXT is executed for specified times Between FOR and NEXT LDP LDF instructions are effective for one time Every time when M0 turns from OFF to ON and M1 turns from OFF to ON A loop is executed 5 6 30 times Every time if M0 turns from OFF ...

Page 94: ...1 SM0 FOR D0 D1 D21 D2 D21 XCH D1 D21 D2 D21 INC D21 NEXT NEXT LD SM2 SM2 is initial ON coil MOV K19 D0 the times of FOR loop LD M0 M0 to trigger the FOR loop MCS FOR D0 Nesting FOR loop the loop times is D0 MOV K0 D21 the offset starts from 0 LD SM0 SM0 is always ON coil MCS FOR D0 nesting FOR loop the loop times is D0 LD D1 D21 D2 D21 if the current data is larger than the next it will be ON XCH...

Page 95: ...itable Models XD XL Hardware requirement Software requirement program ends END Execution condition Suitable Models XD XL Hardware requirement Software requirement Operands Operands Function Data Type None Suitable Soft Components Even though FEND instruction represents the end of the main program the function is same to END to process the output input monitor the refresh of the timer return to pro...

Page 96: ...uting NEXT an error will occur In the condition of using many FEND instructions please make program or subprogram between the last FEND instruction and END instruction 4 4 Data compare function Mnemonic Function Chapter LD LD activates when S1 S2 4 4 1 LD LD activates when S1 S2 4 4 1 LD LD activates when S1 S2 4 4 1 LD LD activates when S1 S2 4 4 1 LD LD activates when S1 S2 4 4 1 LD LD activates...

Page 97: ...Function Data Type S1 Being compared number address 16 32bits BIN S2 Comparand address 16 32 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS 16 bits instruction 32 bits instruction Activate Condition Not Activate Condition LD DLD S1 S2 S1 S2 LD DLD S1 S2 S1 S2 LD DLD S1 S2 S1 S2 LD DLD S1 S2 S1 S2 LD DLD...

Page 98: ...ND serial connection comparison instruction AND Compare AND 16 bits As Below 32 bits As Below Execution condition Normally ON OFF coil Suitable Models XD XL Hardware requirement Software requirement Operands Operands Function Data Type S1 Being compared number address 16 32bit BIN S2 Comparand address 16 32bit BIN suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD...

Page 99: ...s counter should use 32 bits instruction If using 16 bits instruction the program or operation will be error 4 4 3 Parallel Compare OR 1 Summary OR parallel connection comparison instruction Parallel Compare OR 16 bits As below 32 bits As below Execution condition Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 Being compared number address...

Page 100: ...b15 32 bits b31 is 1 it is seemed to negative number The comparison of 32 bits counter should use 32 bits instruction If using 16 bits instruction the program or operation will be error Example forbid the outputs when it reaches the certain time In the below program when the date is June 30th 2012 all the outputs will be disabled The password 1234 is stored in D4000 D4001 When the password is corr...

Page 101: ...C date 30 AND D1 K6 RTC month 6 AND D0 K12 RTC year 12 LD D1 K7 or RTC month 7 AND D0 K12 RTC year 12 ORB or OR D0 K13 RTC year 13 DAND D4000 K1234 and password 1234 SET SM34 set ON M34 all the outputs are disabled DLD D4000 K1234 password 1234 correct password RST SM34 reset M34 all the outputs are enabled ...

Page 102: ... 12 4 5 1 Data Compare CMP 1 Summary Compare the two data output the result Data compare CMP 16 bits CMP 32 bits DCMP Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 Specify the data to be compared or soft component s address code 16 bit BIN S Specify the comparand s value or soft comp...

Page 103: ... compare result 4 5 2 Data zone compare ZCP 1 Summary Compare the current data with the data in the zone output the result Data Zone compare ZCP 16 bits ZCP 32 bits DZCP Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 The low limit of zone 16 bit BIN S2 The high limit of zone 16 bit BI...

Page 104: ...utput the three results starting from 1 2 store the three results 4 5 3 MOV MOV 1 Summary Move the specified data to the other soft components MOV MOV 16 bits MOV 32 bits DMOV Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement Word Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S1 S2 S Bit Operand System X Y M S ...

Page 105: ...he source data to the target When X0 is off the data will not change Move K10 to D10 read the counter or timer current value indirect set the timer value Move the 32bits data Please use DMOV when the value is 32 bits such as MUL instruction high speed counter DMOV D0 D10 DMOV HSC0 D20 MOV K10 D10 X0 S D MOV T0 D20 X1 Word Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S D Descript...

Page 106: ... the target soft components address code 16 bits BIN bit n Specify the move data s number 16 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS M includes M HM SM S includes S HS T includes T and HT C includes C and HC Move the source data block to the target data block The data quantity is n word move bit ...

Page 107: ...k mov PMOV 16 bits PMOV 32 bits Execution condition Normally ON OFF coil rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Specify the source data block or soft component address 16 bits BIN bit D Specify the target soft components address 16 bits BIN bit n Specify the data quantity 16 bits BIN BMOV D10 D11 K3 BMOV D10 D9 K...

Page 108: ...PMOV finish in one scan cycle when executing PMOV close all the interruptions Mistake may happen if the source address and target address are overlapped 4 5 6 Fill Move FMOV 1 Summary Move the specified data to the other soft components Fill Move FMOV 16 bits FMOV 32 bits DFMOV Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement P...

Page 109: ... CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS 16 bits instruction Move K0 to D0 D9 copy a single data device to a range of destination device Move the source data to target data the target data quantity is n If the set range exceeds the target range move to the possible range 32 bits instruction Move D0 D1 to D10 D11 D12 D13 D14 D15 16 bits Fill Move FMOV K0 D0 K10 X0 n S D DFMOV D0 D10 K...

Page 110: ...0 D15 D1 4 5 7 Floating move EMOV Summary Move the float number to target address Floating move EMOV 16 bits 32 bits EMOV Execution condition Normally on off edge trigger Suitable models XD XL Hardware Software Operands Operand Function Type S Source soft element address 32 bits BIN D Destination soft element address 32 bits BIN ...

Page 111: ...l be converted to floating number K500 will be converted to floating value 4 5 8 FlashROM Write FWRT 1 Summary Write the specified data to FlashRom register FlashROM Write FWRT 16 bits FWRT 32 bits DFWRT Execution condition rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S The data write in the source or save in the soft el...

Page 112: ... is not recommended 3 The written time of Flashrom is about 1 000 000 times So we suggest using edge signal LDP LDF etc to activate the instruction 4 Frequently write in will damage the FlashRom 4 5 9 Zone set MSET Summary Set the soft element in certain range Multi set MSET 16 bits MSET 32 bits Execution condition Normally ON OFF falling or rising pulse edge signal Suitable Models XD XL Hardware ...

Page 113: ...un Zone set but set SM409 SD409 2 4 5 10 Zone reset ZRST Summary Reset the soft element in the certain range Multi reset ZRST 16 bits ZRST 32 bits Execution condition Normally ON OFF falling or rising pulse edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type D1 Start address of soft element Bit 16 bits BIN D2 End address of soft element Bit 1...

Page 114: ...TD HTD CD HCD D HD FMOV can move 0 to these soft components DX DY DM DS T TD HT HTD C CD HC HCD D HD 4 5 11 Swap the high and low byte SWAP 1 Summary Swap the high and low byte of specified register High and low byte swap SWAP 16 bits SWAP 32 bits Execution condition Falling or rising pulse edge Suitable Models XD XL Hardware requirement Software requirement ZRST M500 M559 D0 D100 D1 D2 D1 D2 X0 Z...

Page 115: ...the instruction will be executed in every scanning period when X0 is ON Falling or rising pulse is recommended to activate the instruction 4 5 12 Exchange XCH 1 Summary Exchange the data in two soft element Exchange XCH 16 bits XCH 32 bits DXCH Execution condition Rising or falling pulse edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type D1 ...

Page 116: ...every scanning period Falling or rising pulse is recommended to activate the instruction 32 bits instruction 32 bits instruction DXCH swaps the dword value D10 D11 and D20 D21 XCH D10 D11 X0 D1 D2 DXCH D10 D20 X0 D1 D2 Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD D1 D2 Word Description Before D10 100 After D10 101 D11 101 D11 100 Before D10 100 after D10 200 D11 1 D11D10 65636 D...

Page 117: ... 6 1 Addition ADD 1 Summary Add two numbers and store the result Add ADD 16 bits ADD 32 bits DADD Execution condition Normal ON OFF falling or rising pulse edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type Three operands S1 The add operation data address 16 bit 32 bit BIN S2 The add operation data address 16 bit 32bit BIN D The result addre...

Page 118: ...ration word device s low 16 bits are assigned the device close to the preceding device s is the high bits To avoid ID repetition we recommend you assign device s ID to be even number The source and target address can be the same In the above example when X0 is ON the instruction will be executed in every scanning period Two operands ADD D10 D12 X0 S1 D Two source data do binary addition and send t...

Page 119: ...culate result is zero OFF the calculate result is not zero SM021 Borrow ON the calculate result is over 32768 16 bit or 2147483648 32bit OFF the calculate result is less than 32768 16 bit or 2147483648 32bit SM022 Carry ON the calculate result is over 32768 16 bit or 2147483648 32bit OFF the calculate result is less than 32768 16 bit or 2147483648 32bit 4 6 2 Subtraction SUB 1 Summary Two numbers ...

Page 120: ...m if X0 is ON SUB operation will be executed every scan cycle Refer to chapter 4 6 1 for flag action and functions Two operands SUB D10 D12 X0 S1 D appoint the soft unit s content subtract the soft unit s content appointed by in the format of algebra The result will be stored in the soft unit appointed by 5 8 13 The action of each flag the setting method of 32 bits operation s soft units are both ...

Page 121: ...L Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 The multiplication operation data address 16 bits 32bits BIN S2 The multiplication operation data address 16 bits 32bits BIN D The result address 16 bits 32bits BIN 3 Suitable soft component Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS Operand System C...

Page 122: ... destination device in the format of 64 bits Even use word device 64 bits results can t be monitored Please change to floating value operation for this case 4 6 4 Division DIV 1 Summary Divide two numbers and store the result Division DIV 16 bits DIV 32 bits DDIV Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Opera...

Page 123: ...osed by the device appointed by and 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 the instruction will be error 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 ...

Page 124: ...nt 2 Operands Operands Function Data Type D The increase or decrease data address 16 bits 32bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS Increment INC INC D0 X0 D will increase one when X0 is ON For 16 bits operation when 32767 increase one it will become 32768 for 32 bits operation 2147483647 increas...

Page 125: ...e source data start address 16 bits BIN D The mean result address 16 bits BIN n The data quantity 16 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS D0 3 D10 D1 D2 Store the mean value of source data source sum divide by source quantity n give the remainder The n cannot larger than soft component quantit...

Page 126: ...Logic Exclusive OR WXOR 16 bits WXOR 32 bits DWXOR Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 The operation data address 16bit 32bit BIN S2 The operation data address 16bit 32bit BIN D The result address 16bit 32bit BIN 3 Suitable soft components Notes D includes D HD TD includes ...

Page 127: ...421 code and store in D0 WAND DX0 H0F D0 M0 Example 2 Combine the low 8 bits of D0 and D2 to a word WAND D0 HFF D10 X0 WAND D2 HFF D12 SWAP D12 WOR D10 D12 D20 LDP X0 WAND D0 HFF D10 WAND D2 HFF D12 SWAP D12 WOR D10 D12 D20 0 or 0 0 0 or 1 1 1 or 0 1 1 or 1 1 0 xor 0 0 0 xor 1 1 1 xor 0 1 1 xor 1 0 X0 rising edge Logic and take the low 8 bits of D0 and save in D10 Logic and take the low 8 bits of ...

Page 128: ...Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 D0 Y17 Y7 Y6 Y5 Y4 Sign bit 0 positive 1 negative Each data bit in the source device is reversed 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 This instructi...

Page 129: ...le soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS NEG D10 D10 1 D10 M0 D Converse each bit of source data 1 0 0 1 then plus one and store the result in the source data address For example the source data D10 is 20 when M0 rising edge is coming D10 become 20 The following two instructions are the same The sequential control...

Page 130: ...metic shift left SHL Arithmetic shift right SHR 1 Summary Do arithmetic shift left right for the numbers Arithmetic shift left SHL 16 bits SHL 32 bits DSHL Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement Arithmetic shift right SHR 16 bits SHR 32 bits DSHR Execution condition Normally ON OFF rising falling edge Suitable Models ...

Page 131: ...s stored in carry flag After executing SHR once the highest bit is the same the last bit is stored in carry flag Arithmetic shift left Arithmetic shift right SHL D0 K4 D n 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 SM22 1 SM22 Highest bit Lowest bit Move left Highest bit Lowest bit Execute once M0 Bit n Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD D n Word D...

Page 132: ... Suitable Models XD XL Hardware requirement Software requirement Logic shift right LSR 16 bits LSR 32 bits DLSR Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type D Source data address 16 bits 32 bits BIN n Arithmetic shift left right times 16 bits 32bits BIN 3 Suitable soft components Notes...

Page 133: ...ce M0 N bits LSR D0 K4 D n 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 SM22 0 SM22 Highest bit Lowest bit Move right Highest bit Lowest bit After executing once M1 N bits 4 7 3 Rotation shift left ROL Rotation shift right ROR 1 Summary Cycle shift left or right Rotation shift left ROL 16 bits ROL 32 bits DROL Execution condition rising falling edge Suitable Models XD XL Hardwar...

Page 134: ...lue will be cycle moved left or right the last bit is stored in carry flag Cycle shift left ROL D0 K4 D n 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 SM22 1 SM22 Highest bit Lowest bit Cycle move left Highest bit Lowest bit After executing once X0 N bits Cycle shift right Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD D n Word Description ...

Page 135: ...ing edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Types S Source soft element head address bit D Target soft element head address bit n1 Source data quantity 16 bits 32 bits BIN n2 Shift left times 16 bits 32 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS ...

Page 136: ...e 4 7 5 Bit shift right SFTR 1 Summary Bit shift right Bit shift right SFTR 16 bits SFTR 32 bits DSFTR Execution condition rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element head address bit D Target soft element head address bit n1 Source data quantity 16 bits 32 bits BIN n2 Shift right times 16 bits 32 ...

Page 137: ...ve n2 bits for the object For example if n2 is 1 the object will move 1 bit right when the instruction executes once 4 7 6 Word shift left WSFL 1 Summary Word shift left Word shift left WSFL 16 bits WSFL 32 bits Execution condition rising falling edge Suitable Models XD XL Hardware requirement Software requirement Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD n1 n2 Word Bit Descr...

Page 138: ...des DS DHS Move n2 words left for the object which contains n1 words When X0 changes from OFF to ON the instruction will move n2 words for the object 4 7 7 Word shift right WSFR 1 Summary Word shift right Word shift right WSFR 16 bits WSFR 32 bits Execution condition rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operand System Constant Module D FD T...

Page 139: ... contains n1 words When X0 changes from OFF to ON the instruction will move n2 words for the object 4 8 Data Convert Mnemonic Function Chapter WTD Single word integer converts to double word integer 4 8 1 FLT 16 bits integer converts to float point 4 8 2 DFLT 32 bits integer converts to float point 4 8 2 FLTD 64 bits integer converts to float point 4 8 2 INT Float point converts to integer 4 8 3 O...

Page 140: ...ouble word integer WTD 16 bits WTD 32 bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element address 16 bits BIN D Target soft element address 32 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM...

Page 141: ...ition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element address 16 bits 32 bits 64 bits BIN D Target soft element address 32 bits 64 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS 16 bits 32 bi...

Page 142: ...l operation parameters are floating number 4 8 3 Float point converts to integer INT 1 Summary Floating point converts to integer INT 16 bits INT 32 bits DINT Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element address 16 bits 32 bits BIN D Target soft element address 16...

Page 143: ... 2 147 483 648 2 147 483 647 INT D0 D10 X0 For example if D0 is floating value 130 2 after executing INT D10 value is integer 130 4 8 4 BCD convert to binary BIN 1 Summary BCD convert to binary BIN 16 bits BIN 32 bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element a...

Page 144: ... error occurs As constant K automatically converts to binary so it s not suitable for this instruction For example all the information stored in the clock information register SD13 SD19 of PLC is BCD code but we are used to using decimal value The time information can be converted from BCD code information to binary Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S D Word Descripti...

Page 145: ...de Binary convert to BCD BCD 16 bits BCD 32 bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Source soft element address 16 bits BIN D Target soft element address BCD code 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM ...

Page 146: ... Source soft element address 2 bits HEX D Target soft element address ASCII code n Transform character quantity 16 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS ASCI D100 D200 K4 S D n X0 Transform the source Hex data to ASCII code and store in The transformation chacters are n Will store one ASCII cod...

Page 147: ...II D Target soft element address 2 bits HEX n ASCII Character quantity 16 bits BIN 3 Suitable soft components n D K1 K2 K3 K4 K5 K6 K7 K8 K9 D200 down C B A 0 4 3 2 1 8 D200 up C B A 0 4 3 2 1 D201 down C B A 0 4 3 2 D201 up C B A 0 4 3 D202 down C B A 0 4 D202 up C B A 0 D203 down C B A D203 up C B D204 down C Assign start device D100 0ABCH D101 1234H D102 5678H 0 30H 1 31H 5 35H A 41H 2 32H 6 36...

Page 148: ...1 0 1 0 0 1 0 D201 43H C 42H B 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 D100 0 A B C 4 8 8 Coding DECO Summary Change any data or bit to 1 Coding DECO 16 bits DECO 32 bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement Description S ASCII Code HEX Convert D200 down 30H 0 D200 up 41H A D201 down 42H B D201 up 43H C D202 down 31H 1 D202...

Page 149: ...ect is the lower three bits in DX0 which are X2 X0 N 3 so the decoding results need to be expressed by 23 8 bits which are M17 M10 When X2 1 X1 0 X0 1 the value it represents is 4 1 5 so M15 in the fifth place from M10 changes to 1 when X2 X0 is all zero the value is 0 so M10 is 1 M10 is the 0th place If n 0 the instruction will not be executed If n is the value out of 0 16 the instruction will no...

Page 150: ...that is bit7 bit0 When bit2 and bit1 are both 1 and bit0 are 0 the value is 4 2 6 so bit6 in D1 is ON is word soft component n 4 D0 DECO D1 K4 X0 n S D 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 7 6 5 4 2 1 0 D0 D1 bit15 bit15 bit0 bit0 4 2 1 8 3 11 10 9 8 13 12 15 14 The low n bit n 4 of the source address is decoded to the target address When n 3 the high 8 bit of the target...

Page 151: ...N n The bit quantity of coding result 16 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS M includes M HM SM S includes S HS T includes T and HT C includes C and HC When is bit device n 16 M10 ENCO D10 K3 X0 n S D 0 0 0 1 0 1 0 M17 M16 M15 M14 M13 M12 M11 M10 7 6 5 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ...

Page 152: ...1 are 1 When is word device n 4 D0 ENCO D1 K3 X1 n S D 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 7 6 5 4 2 1 0 D0 D1 bit15 bit15 bit0 bit0 4 2 1 3 High 8 bit are ignored All to be 0 If multiple bits in the source address is 1 the low side is ignored and if the source address is 0 the instruction will not be executed When the driver input is OFF the instruction is not executed...

Page 153: ...t of 1 in D0 is bit14 ignoring all low bits 1 and encoding bit14 bit3 bit0 represent 14 bit3 bit2 and bit1 are 1 4 8 10 Low bit coding ENCOL 1 Summary Find the position where the low bit is ON Low bit coding ENCOL 16 bits ENCOL 32 bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Sof...

Page 154: ... executed When the driving condition is OFF the instruction is not executed and the coding output is unchanged When n 16 if the of encoding instruction is a bit element its point is 2 16 65536 N 3 the encoded object has 23 8 bits which are M17 M10 and the encoding results are stored in the lower three bits of D10 which are bit2 bit0 M12 and M16 are both 1 Ignoring M16 M12 is coded bit2 bit0 repres...

Page 155: ... 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 7 6 5 4 2 1 0 D0 D1 bit15 bit15 bit0 bit0 4 2 1 3 All to be 0 15 14 13 12 10 9 8 11 8 If multiple bits in the source address is 1 the high bit side is ignored and if the source address is 0 the instruction will not be executed When the driver input is OFF the instruction is not executed and the coding output is unchanged N 4 the encoded object has 24 16 bits that i...

Page 156: ... DGRY which can transform 32 bits gray code Range is 0 32 767 16 bits instruction 0 2 147 483 647 32 bits instruction 4 8 12 Gray code to binary GBIN 1 Summary Transform the gray code to binary data Gray code to binary GBIN 16 bits GBIN 32 bits DGBIN Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operand System Con...

Page 157: ...an transform 32 bits binary value Range is 0 32 767 16 bits instruction 0 2 147 483 647 32 bits instruction 4 9 Floating number Operation Mnemonic Function Chapter ECMP Floating Compare 4 9 1 EZCP Floating Zone Compare 4 9 2 EADD Floating Add 4 9 3 ESUB Floating Subtract 4 9 4 EMUL Floating Multiplication 4 9 5 EDIV Floating Division 4 9 6 ESQR Floating Square Root 4 9 7 Operand System Constant Mo...

Page 158: ...perands Function Data Type S1 Soft element address need compare 32 bits BIN S2 Soft element address need compare 32 bits BIN D Compare result bit 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS M includes M HM SM S includes S and HS C includes C and HC Operand System Constant Module D FD TD CD DX DY DM DS K H ID ...

Page 159: ...Compare EZCP 1 Summary Floating Zone Compare EZCP 16 bits 32 bits EZCP Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 Soft element address need compare 32 bits BIN S2 Upper limit of compare data 32 bits BIN S3 Lower limit of compare data 32 bits BIN D11 D10 D21 D20 Binary Floating Bin...

Page 160: ... store in three coils starting from D Constant K and H will transform to binary floating value when they are source data EZCP K10 K2800 D5 M0 X0 Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S1 S2 S3 Word Operand System X Y M S T C Dn m D Bit Description D1 D0 D11 D10 ON Binary Floating Binary Floating D11 D10 D1 D0 D21 D20 ON Binary Floating Binary Floating Binary Floating D1 D0...

Page 161: ...tes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS EADD D10 D20 D50 S1 S2 D X0 The two binary floating source data do addition operation the result will be stored in target address If a constant K or H used as source data the value is converted to floating point before the addition operation EADD D100 K1234 D110 X1 Please set S1 S2 when S2 S1 m...

Page 162: ...ment Software requirement 2 Operands Operands Function Data Type S1 Subtraction operation data address 32 bits BIN S2 Subtraction operation data address 32 bits BIN D Result address 32 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS ESUB D10 D20 D50 S1 S2 D X0 The binary floating value S1 subtract S2 the...

Page 163: ...mally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S1 Multiplication operation data address 32 bits BIN S2 Multiplication operation data address 32 bits BIN D Result address 32 bits BIN 3 Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS...

Page 164: ... D as a floating value If a constant K or H used as source data the value is converted to floating point before the multiplication operation EMUL D100 K100 D110 X1 Note the operand value must be floating numbers otherwise the result will be error K100 D101 D100 D111 D110 Binary converts to Floating Binary Floating Binary Floating ...

Page 165: ... D20 D50 S1 S2 D X0 The floating point value of S1 is divided by the floating point value of S2 The result of the division is stored in D as a floating point value If a constant K or H used as source data the value is converted to floating point before the division operation EDIV D100 K100 D110 X1 The source data S2 is 0 the calculation will be error The instruction will not work Note the operand ...

Page 166: ...quare root is performed on the floating point value S the result is stored in D If a constant K or H used as source data the value is converted to floating point before the operation ESQR K1024 D110 X1 When the result is zero zero flag activates Only when the source data is positive will the operation be effective If S is negative then an error occurs and error flag SM409 is set ON SD409 7 the ins...

Page 167: ...s D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS SIN D50 D60 X0 S D This instruction performs the mathematical SIN operation on the floating point value in S angle RAD The result is stored in D D51 D50 D61 D60 S D Note the operand value must be floating numbers otherwise the result will be error Operand System Constant Module D FD TD CD DX DY DM DS K H ID...

Page 168: ...includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS COS D50 D60 X0 S D This instruction performs the mathematical COS operation on the floating point value in S angle RAD The result is stored in D D51 D50 D61 D60 S D Note Before the instruction is executed the data in parameter S must be floating number otherwise the execution result will be wrong Operand System Constant Module D FD TD ...

Page 169: ...udes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS TAN D50 D60 X0 S D This instruction performs the mathematical TAN operation on the floating point value in S The result is stored in D D51 D50 D61 D60 S D Note Before the instruction is executed the data in parameter S must be floating number otherwise the execution result will be wrong Word Operand System Constant Module D FD TD CD DX DY ...

Page 170: ...includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS ASIN D50 D60 X0 S D This instruction performs the mathematical ASIN operation on the floating point value in S The result is stored in D D51 D50 D61 D60 S D Note Before the instruction is executed the data in parameter S must be floating number otherwise the execution result will be wrong Operand System Constant Module D FD TD CD DX DY...

Page 171: ... TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS ACOS D50 D60 X0 S D Calculate the arcos value radian save the result in the target address D51 D50 D61 D60 S D Note Before the instruction is executed the data in parameter S must be floating number otherwise the execution result will be wrong Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S D Wo...

Page 172: ...D includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS ATAN D50 D60 X0 S D Calculate the arctan value radian save the result in the target address D51 D50 D61 D60 S D Note Before the instruction is executed the data in parameter S must be floating number otherwise the execution result will be wrong Operand System Constant Module D FD TD CD DX DY DM DS K H ID QD S D Wor...

Page 173: ... bits Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type D Register address to save clock data 16 bits BIN 3 Suitable Soft Components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS TRD D0 X0 D The current time and date of the real t...

Page 174: ...s 32 bits TWR Execution condition Normally ON OFF rising falling edge Suitable Models XD XL Hardware requirement Software requirement 2 Operands Operands Function Data Type S Write the clock data to the register 16 bits BIN 3 Suitable Soft Components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS Unit Item D0 Year D1 Month D2 Date D3 Hour...

Page 175: ...through TWR instruction There is another method to write the RTC In the XDPpro software please click the clock details in project bar on the left Then click write into the current time the PC will auto write the current time to the PLC 4 10 3 Clock compare TCMP 1 Instruction Summary Compare three continuous clocks time Clock compare TCMP 16 bits TCMP 32 bits Condition Normally ON OFF rising fallin...

Page 176: ...HC TCMP D20 D21 D22 M0 X0 D S1 S2 S3 D20 M0 M1 M2 D30 TRD D30 S4 D22 D21 D30 D32 D31 D20 D22 D21 D30 D32 D31 D20 D22 D21 D30 D32 D31 TRD will read the present clock information in D30 D36 year month day hour minute second week X0 from OFF to ON TCMP worked Compare the three registers starting from S4 to three registers S1 S2 S3 year month day When S1 S2 S3 is larger than S4 clock M0 is ON When S1 ...

Page 177: ... is D33 it means hour minute second then S1 S2 S3 mean hour minute second S4 can start from year month day hour cannot start from minute second The week cannot compare For example TCMP D20 D21 D22 M0 X0 M0 M1 M2 D33 TRD D30 Y0 Y2 Y1 The present clock is 15 32 49 7 30 2014 Wednesday So D30 14 D31 7 D32 30 D33 15 D34 32 D35 49 D36 3 If the setting time is 15 32 49 D20 15 D21 32 D22 49 so Y1 ON If th...

Page 178: ...reset 5 8 5 1 Functions Summary XD XL series PLC has HSC High Speed Counter function which will not affect by the scanning cycle Via choosing different counter test the high speed input signals with detect sensors and rotary encoders The highest testing frequency can reach 80 KHz Note 1 The high speed counting input of XD XL series PLC can only receive collector open circuit signal OC but can not ...

Page 179: ...e s rising edge 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 but the default count mode is 4 time mode 1 time frequency and 4 time frequency modes are shown below 1 time Frequency Increasing Mode AB Phase Mode Count input Sensor Rotary encoder A B ...

Page 180: ...nge is 2 147 483 648 2 147 483 647 If the count value overflows this range then overflow or underflow appears Overflow means the count value jumps from 2 147 483 647 to 2 147 483 648 then continue counting underflow means the count value jumps from 2 147 483 648 to 2 147 483 647 then continue counting Counter current value B phase input A phase input ...

Page 181: ... X5 X6 AB phase mode counter HSC0 COM COM X1 X0 X3 X2 X4 X5 X6 5 5 HSC ports assignment XD series PLC HSC channels list PLC model HSC channel Incremental mode AB phase mode XD1 16 32 0 0 XD2 XD3 16 24 32 48 60 3 3 XD5 16 24 32 48 60 3 3 24T4 32T4 48T4 60T4 4 4 48D4T4 8 8 48T6 60T6 6 6 60T10 10 10 XDM 24T4 32T4 48T4 60T4 4 4 60T10 10 10 XDC 24 32 48 60 4 4 XD5E 24 30 48 60 3 3 30T4 4 4 60T4 4 4 60T...

Page 182: ...cy doubling 4 means 4 frequency doubling 2 4 means 2 and 4 frequency doubling Note Z phase signal counting function is in developping XD2 16 Increasing mode AB phase mode HSC0 HSC2 HSC4 HSC6 HSC8 HSC10 HSC12 HSC0 HSC2 HSC4 HSC6 HSC8 Max frequency 10K 10K 10K 5K 5K 5K Frequency doubling 2 4 2 4 2 4 Counter interruption X000 U A X001 B X002 Z X003 U A X004 B X005 Z X006 U A X007 B X010 Z XD2 24 32 X...

Page 183: ...interruption X000 U A X001 B X002 Z X003 U A X004 B X005 Z X006 U A X007 B X010 Z XD5 24T4 32T4 48T4 60T4 XDM 24T4 32T4 60T4 60T4L XDC 24 32 48 60T XD5E 30T4 60T4 XDME 30T4 60T4 XL5 32T4 XL5E 32T4 XLME 32T4 Increasing mode AB phase mode HSC0 HSC2 HSC4 HSC6 HSC8 HSC10 HSC0 HSC2 HSC4 HSC6 HSC8 HSC10 Max frequency 80K 80K 80K 80K 50K 50K 50K 50K Frequency doubling 2 4 2 4 2 4 2 4 Counter interruption...

Page 184: ...nter interruptio n X0 U A X0 U A X1 B X1 B X2 X3 U A X3 U A X4 B X4 B X5 X6 U A X6 U A X7 B X7 B X10 X11 U A X11 U A X12 B X12 B X13 X14 U A X15 B X16 X17 U A X20 B X21 X22 U A X23 B X24 X25 U A X26 B X27 XDH 60T4 E Increasing mode AB phase mode HSC0 HSC2HSC4HSC6HSC8 HSC10 HSC0 HSC2HSC4HSC6HSC8HSC10 Max frequency 200K 200K 200K 200K 100K 100K 100K 100K Frequency doubling 2 4 2 4 2 4 2 4 Counter in...

Page 185: ...ter interruption X000 U A X001 B X002 Z X003 U A X004 B X005 Z X006 U A X007 B X010 Z X011 U A X012 B X013 Z X014 U A X015 B X016 Z X017 U A X020 B X021 Z XD5 60T10 XDM 60T10 XD5E 60T10 XDME 60T10 Increasing mode HSC0 HSC2 HSC4 HSC6 HSC8 HSC10 HSC12 HSC14 HSC16 HSC18 HSC20 HSC22 Max frequency 80K 80K 80K 80K 80K 80K 80K 80K 80K 80K Frequency doubling Counter interruption X000 U X001 X002 X003 U X0...

Page 186: ...14 HSC16 HSC18 HSC20 HSC22 Max frequency 50K 50K 50K 50K 50K 50K 50K 50K 50K 50K Frequency doubling 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 Counter interruption X000 A X001 B X002 Z X003 A X004 B X005 Z X006 A X007 B X010 Z X011 A X012 B X013 Z X014 A X015 B X016 Z X017 A X020 B X021 Z X022 A X023 B X024 Z X025 A X026 B X027 Z X030 A X031 B X032 Z X033 A X034 B X035 Z ...

Page 187: ...23 HSC6 frequency doubling 2 2 frequency doubling 4 4 frequency doubling SFD324 HSC8 frequency doubling 2 2 frequency doubling 4 4 frequency doubling SFD325 HSC10 frequency doubling 2 2 frequency doubling 4 4 frequency doubling SFD326 HSC12 frequency doubling 2 2 frequency doubling 4 4 frequency doubling SFD327 HSC14 frequency doubling 2 2 frequency doubling 4 4 frequency doubling SFD328 HSC16 fre...

Page 188: ... HSD DM includes DM DHM DS includes DS DHS CNT HSC0 D20 S1 S2 M0 When M0 is on HSC0 counts X0 signal in single phase mode compares the high speed counting value with the value set in register D20 When the high speed counting value is equal to the set value HSC0 coil is set on immediately and the counting value is accumulated in HSCD0 double words If the driving condition M0 is not disconnected HSC...

Page 189: ...n AB phase mode compares the high speed counting value with the value set in register D20 When the high speed counting value is equal to the set value HSC0 coil is set on immediately and the counting value is accumulated in HSCD0 double words If the driving condition M0 is not disconnected HSC0 will remain on state and continue counting and the counting value in HSCD0 will continue to accumulate I...

Page 190: ...sing falling edge Suitable models XD XL exclude XD1 XL1 Hardware requirement Software requirement Operands Operands Function Type S Specify HSC code 32 bits BIN D Specify the read written register 32 bits BIN Suitable Soft Components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS DMOV HSC0 D10 S D When the trigger condition is established...

Page 191: ... D20 CNT_AB HSC2 K999999999 Y0 5 7 5 Write HSC value DMOV Instruction Summary Write the specified register value into HSC Write HSC value DMOV 16 bits Instruction 32 bits Instruction DMOV Execution condition Normally ON OFF rising falling edge Suitable models XD XL exclude XD1 XL1 Hardware requirement Software requirement operands Operands Function Type S Specify HSC code 32 bits BIN D Specify the...

Page 192: ...eir functions are quite different When M0 is changed from OFF to ON once the value of common counter is added 1 The high speed counter trigger condition must be in the normally closed state when counting which is equivalent to the high number counter being activated but the value of the high number counter does not change Only when the corresponding external signal input terminal receives the sign...

Page 193: ...mental mode the setting value is K888888 and reads the high speed counting value to D0 double word in real time When D0 double words is less than D2 double words Y0 is ON when D0 double words is equal to or larger than D2 double words and less than D4 double words Y1 is ON when D0 double words is equal to or larger than D4 double words Y2 is ON When M1 rising edge is coming reset HSC0 and HSCD0 do...

Page 194: ...in HSCD0 is cleared When coil SM0 is on HSC0 begins to count X0 and X1 ports in AB phase mode The setting value of counting is K888888 At the same time the counting value in HSCD0 double words is written into D0 double words in real time When the counting value in D0 double words is greater than K0 and less than K100 the output coil Y0 is ON when the counting value in D0 double words is greater th...

Page 195: ...rrupt program corresponding to N segment The interruption marks corresponding to each high speed counter are shown in chapter 5 9 4 When using high speed counting interrupt function instructions can be written directly see chapters 5 9 2 and 5 9 3 or can be configured by software panel Please click in the XDPPro software it will show below window In this panel we can configure the parameters relat...

Page 196: ...rs starting from HD100 and the set values are stored in the double word registers HD100 HD102 HD104 Interruption cycle It must be used in relative mode When all interrupts are over high speed counting interrupts can still be generated circularly CAM It must be used in absolute mode When the counting value equals any set value interruption occurs 1 100 optional If set to 3 it means execute three hi...

Page 197: ...such as HD102 HD102 HD104 and other double word registers it will immediately produce the corresponding high speed counting interrupt when the condition is met each section of the corresponding interrupt marks please refer to chapter 5 9 4 During the high speed counting process it is invalid to modify the set value of 100 segments In the process of high speed counting the driving condition M0 can ...

Page 198: ...0 HD100 S3 When the high speed counter HSC0 counts in AB phase mode high speed counting value is compared to data block starting from HD100 such as HD102 HD102 HD104 and other double word registers it will immediately produce the corresponding high speed counting interrupt when the condition is met each section of the corresponding interrupt marks please refer to chapter 5 9 4 During the high spee...

Page 199: ...I2001 I2002 I 2000 N 1 I2099 HSC2 I2100 I2101 I2102 I 2100 N 1 I2199 HSC4 I2200 I2201 I2202 I 2200 N 1 I2299 HSC6 I2300 I2301 I2302 I 2300 N 1 I2399 HSC8 I2400 I2401 I2402 I 2400 N 1 I2499 HSC10 I2500 I2501 I2502 I 2500 N 1 I2599 HSC12 I2600 I2601 I2602 I 2600 N 1 I2699 HSC14 I2700 I2701 I2702 I 2700 N 1 I2799 HSC16 I2800 I2801 I2802 I 2800 N 1 I2899 HSC18 I2900 I2901 I2902 I 2900 N 1 I2999 5 9 5 ...

Page 200: ...segment 1 interruption I2000 when the counter s current value is 5000 it generates the segment 2 interruption I2001 when the counter s current value is 25000 it generates the segment 3 interruption I2002 See graph below Example 2 HSC2 current value is 10000 the segment one preset value is 10000 the preset value of segment 2 is 5000 the preset value of segment 3 is 20000 When starting to count when...

Page 201: ...d the setting value of segment 3 is 20000 When it starts counting if the current value of the counter is 10000 the segment 1 interruption I2000 is generated when the current value of the counter is 15000 the segment 2 interruption I2001 is generated when the current value of the counter equals 20000 the segment 3 interruption I2002 is generated Example 2 The current value of counter HSC2 is 5000 s...

Page 202: ...lue continues to increase to 20000 5 9 6 HSC interruption cycle mode Mode 1 Single loop normal mode The HSC interruption will not happen after it ends The following conditions can start the interruption again reset the HSC Reboot the HSC activate condition The interruption is generated as the following sequence when single loop execution Segment 1 interruption Segment 2 interruption Segment 3 inte...

Page 203: ...ill be effective after setting OFF and ON the driving condition again Address HSC Setting Bit0 100 segments HSC interruption cycle HSC0 0 single loop 1 continuous loop Bit1 100 segments HSC interruption cycle HSC2 Bit2 100 segments HSC interruption cycle HSC4 Bit3 100 segments HSC interruption cycle HSC6 Bit4 100 segments HSC interruption cycle HSC8 Bit5 100 segments HSC interruption cycle HSC10 B...

Page 204: ...on function of ordinary electronic cam but also can generate multiple times of positive and negative single point interruption in single cycle It is widely used in control systems of high speed winding machine and packaging machine Note CAM function is only fit for absolute counting mode Cam function can be set by configuration panel in XINJE PLC software or by special Flash register SFD332 Note D...

Page 205: ...ue of 100 segments in double word form Attention should be paid to using high speed counting interrupts The register after the last segment no needs to set 0 but should be reserved and cannot be used for other purpose For example it has 3 segments segment 1 is HD0 segment 2 is HD2 segment 3 is HD4 then HD6 is reserved It is not allowed to set the interrupt setting value without writing the interru...

Page 206: ...g way Move the mouse over the high speed counting instruction and right click it Select CNT_AB Instruction Parameter Configuration from the drop down menu A configuration panel will appear to configure the parameters in this window As shown in the following figure 5 9 9 Application of HSC interruption Application 1 When M0 is ON HSC0 starts counting The counting value is stored in the address star...

Page 207: ... compare value HSC0 is ON here the compare value is 200000 which is saved in D10 Relative and absolute The HSC is relative mode or absolute mode Interrupt address The starting registers to store 100 segments interruption preset value Circulate 100 segments interruption mode is cycle or not Cam The cam function is executed when any set value of 100 segment high speed counting interruption equals th...

Page 208: ...eset value HD2 is 10000 DMOV K200000 D10 set HSC compare value LD M0 HSC activate condition M0 CNT_AB HSC0 D10 HD0 HSC interruption instruction LDP M1 HSC reset condition M1 RST HSC0 reset HSC and 100 segments interruption FEND the main program end I2000 segment one interruption flag LD SM0 SM0 is normally ON coil INC D0 D0 D0 1 IRET interruption return flag I2001 segment 2 interruption flag LD SM...

Page 209: ... precise position HSC0 K0 K75000 HSC0 K75000 K15000 HSC0 K90000 K 75000 HSC0 K15000 K 15000 I2002 I2003 I2000 I2001 Below is PLC program Y2 represents forward output signal Y3 represents reverse output signal Y4 represents output signal of speed 1 HSC2 Back forth times accumulation counter HSC0 AB phase HSC Pulse frequency f Forward fast run Forward slow run Reverse fast run Reverse slow run Forwa...

Page 210: ...209 ...

Page 211: ...210 SM0 CNT HSC2 CNT_AB HSC0 D0 K1000000 DMOV HSC0 D200 D100 SM2 FEND SM0 I2000 IRET SM0 I2001 IRET Y2 S Y2 Y4 S Y4 R Y2 R Y3 S I2002 SM0 Y4 S IRET SM0 I2003 IRET Y3 R Y4 R Y2 S ...

Page 212: ...al ON coil SET Y4 set ON Y4 run at speed 1 IRET interruption return I2001 interruption 2 flag LD SM0 SM0 is normal ON coil RST Y4 reset Y4 stop running at speed 1 RST Y2 reset Y2 stop forward running SET Y3 set ON Y3 reverse running IRET interruption return I2002 interruption 3 flag LD SM0 SM0 is normal ON coil SET Y4 set ON Y4 run at speed 1 IRET interruption return I2003 interruption 4 flag LD S...

Page 213: ...RGW D1 D2 D3 S1 S2 6 2 3 Free Communication SEND Send data SEND D10 D100 K2 6 3 4 RCV Receive data RCV D20 D200 K2 6 3 4 Read and write serial port data CFGCR Read serial port CFGCR HD0 K7 K2 6 5 1 CFGCW Write serial port6 3 4 CFGCW HD0 K8 K2 6 5 1 6 1 Summary XD XL series PLC main units can fulfill your requirement on communication and network They not only support Modbus RTU but also support Mod...

Page 214: ...XDME XDH is RS232 port The distribution of XL series communication ports is as follows COM COM X0 X1 X2 X3 X4 X5 X6 X7 COM0 24V 0V A B COM0 Y0 COM1 Y1 COM2 Y2 COM3 Y3 COM4 Y4 Y5 COM5 Y6 Y7 COM6 Y10 Y11 Y12 Y13 COM7 Y14 Y15 Y16 Y17 COM8 Y20 Y21 Y22 Y23 COM9 Y24 Y25 Y26 Y27 PWR RUN ERR XD3 60R E 3 2 1 0 4 3 2 1 0 Y 6 5 7 7 6 5 4 X PROGRAMMABLE CONTROLLER X10 X11 X12 X13 X14 X15 X16 X17 X20 X21 X22 X...

Page 215: ...d connect external devices set the port parameters through software or xinje config tool COM2 RS485 A B port RS485 port Modbus RTU Modbus ASCII Free communication X NET Download program and connect external devices set the port parameters through software or xinje config tool COM2 A B port RS485 port USB USB port X NET High speed download port please install the USB driver first RJ45 Ethernet port...

Page 216: ...reboot in the software and then power on again to solve the problem if unnecessary it is better not to modify COM1 communication parameters 4 COM3 port of XDH series PLC does not support communication extended ED module LAN1 port supports Ethernet communication LAN2 port supports EtherCAT bus function 5 X NET communication function is not within the scope of this manual please refer to the X NET u...

Page 217: ...ust be installed first Because the current USB driver has been built in the XINJEConfig software the USB driver will be installed automatically after the XINJEConfig software is installed After installing the xinje config tool and usb driver please switch to Xnet mode in the PLC software 1 Open XDPPro software click option software serial port config 2 Click Xnet protocol to switch to xnet mode Th...

Page 218: ...r Ethernet PLC supports TCP IP Ethernet communication the port is faster and more stable than USB communication the data monitoring real time ability is better program downloading and uploading is faster The connection mode of Ethernet communication itself has obvious advantages over RS485 and USB In many situations of PLC communication users can communicate with any PLC on the spot through only o...

Page 219: ...ion 5 Left extension ED port COM3 The left extension ED port can connect ED card to extend RS232 and RS485 port The ED models include XD NES ED can extend one RS232 and one RS485 port but the two cannot communicate at the same time XD NES ED Each part name is shown as below Name Function Power LED The light is ON when the ED module power on Communication LED The light is ON when ED module communic...

Page 220: ... on the switch right 3 XD NO BD Each part name is shown as below Name Function Communication LED Not support this function Wiring terminal TX Signal send RX Signal receive GND Ground Empty Each part name is shown as below Name Function Communication LED The light is flashing when the BD card communication is successful Wiring terminal A 485 B 485 S Signal ground Empty Terminal resistor switch To c...

Page 221: ...X NET fieldbus manual for details Note For the A B terminal on the PLC body 1Mbps and higher baud rate is only fit for X NET communication mode 6 2 MODBUS communication 6 2 1 Function overview XD XL series PLC support both Modbus master and Modbus slave Master mode When PLC is set to be master it can communicate with other slave devices which have MODBUS RTU or MODBUS ASCII protocol via Modbus ins...

Page 222: ...slave PLC receiving the last one completely slave PLC end data error may occur For XD XL series PLC we solve this problem by adding waiting time before communication which means the slave PLC will receive the next data only after some time the last data finished 6 2 2 Changing of Modbus instruction Modbus instruction handling mode has changed in XD XL series PLC users can write Modbus instructions...

Page 223: ... 7999 X X0 X77 main unit 64 5000 503F 20480 20543 X10000 X10077 1 module 64 5100 513F 20736 20799 X10100 X10177 2 module 64 5140 517F 20800 20863 X10200 X10277 3 module 64 5180 51BF 20864 20927 X10300 X10377 4 module 64 51C0 51FF 20928 20991 X10400 X10477 5 module 64 5200 523F 20992 21055 X10500 X10577 6 module 64 5240 527F 21056 21119 X10600 X10677 7 module 64 5280 52BF 21120 21183 X10700 X10777 ...

Page 224: ...959 960 C100 C4BF 49408 50367 HS 1 HS0 HS127 128 D900 D97F 55552 55679 HT 1 HT0 HT95 96 E100 E15F 57600 57695 HC 1 HC0 HC95 96 E500 E55F 58624 58719 HSC 1 HSC0 HSC31 32 E900 E91F 59648 59679 Register word D D0 D7999 8000 0 1F3F 0 7999 ID ID0 ID99 main unit 100 5000 5063 20480 20579 ID10000 ID10099 1 module 100 5100 5163 20736 20835 ID10100 ID10199 2 module 100 5164 51C7 20836 20935 ID10200 ID10299...

Page 225: ...19 TD TD0 TD575 576 8000 823F 32768 33343 CD CD0 CD575 576 9000 923F 36864 37439 ETD ETD0 ETD31 32 A000 A01F 40960 40991 HD 1 HD0 HD999 1000 A080 A467 41088 42087 HSD 1 HSD0 HSD499 500 B880 BA73 47232 47731 HTD 1 HTD0 HTD95 96 BC80 BCDF 48256 48351 HCD 1 HCD0 HCD95 96 C080 C0DF 49280 49375 HSCD 1 HSCD0 HSCD31 32 C480 C49F 50304 50335 FD 2 FD0 FD5119 5120 C4C0 D8BF 50368 55487 SFD 2 SFD0 SFD1999 20...

Page 226: ...600 X11677 15 module 64 5480 54BF 21632 21695 X11700 X11777 16 module 64 54C0 54FF 21696 21759 X20000 X20077 1 BD 64 58D0 590F 22736 22799 Y Y0 77 main unit 64 6000 603F 24576 24639 Y10000 Y10077 1 module 640 6100 613F 24832 24895 Y10100 Y10177 2 module 64 6140 617F 24896 24959 Y10200 Y10277 3 module 64 6180 61BF 24960 25023 Y10300 Y10377 4 module 64 61C0 61FF 25024 25087 Y10400 Y10477 5 module 64...

Page 227: ...4 59647 HSC 1 HSC0 HSC36 40 E900 E927 59648 59687 Register word D D0 D20479 20480 0 4FFF 0 20479 ID ID0 ID99 main unit 100 5000 5063 20480 20579 ID10000 ID10099 1 module 100 5100 5163 20736 20835 ID10100 ID10199 2 module 100 5164 51C7 20836 20935 ID10200 ID10299 3 module 100 51C8 522B 20936 21035 ID10300 ID10399 4 module 100 522C 528F 21036 21135 ID10400 ID10499 5 module 100 5290 52F3 21136 21235 ...

Page 228: ...9 9 module 100 6420 6483 25632 25731 QD10900 QD10999 10 module 100 6484 64E7 25732 25831 QD11000 QD11099 11 module 100 64E8 654B 25832 25931 QD11100 QD11199 12 module 100 654C 65AF 25932 26031 QD11200 QD11299 13 module 100 65B0 6613 26032 26131 QD11300 QD11399 14 module 100 6614 6677 26132 26231 QD11400 QD11499 15 module 100 6678 66DB 26232 26331 QD11500 QD11599 16 module 100 66DC 673F 26332 26431...

Page 229: ...200 523F 20992 21055 X10500 X10577 6 module 64 5240 527F 21056 21119 X10600 X10677 7 module 64 5280 52BF 21120 21183 X10700 X10777 8 module 64 52C0 52FF 21184 21247 X11000 X11077 9 module 64 5300 533F 21248 21311 X11100 X11177 10 module 64 5340 537F 21312 21375 X11200 X11277 11 module 64 5380 53BF 21376 21439 X11300 X11377 12 module 64 53C0 53FF 21440 21503 X11400 X11477 13 module 64 5400 543F 215...

Page 230: ... 25855 Y20000 Y20077 1 BD 64 68D0 690F 26832 26895 S S0 S7999 8000 7000 8F3F 28672 36671 SM SM0 SM4095 4096 9000 9FFF 36864 40959 T T0 T4095 4096 A000 AFFF 40960 45055 C C0 C4095 4096 B000 BFFF 45056 45151 ET ET0 ET39 40 C000 C027 49152 49191 SEM SEM0 SEM127 128 C080 C0FF 49280 49407 HM 1 HM0 HM6143 6144 C100 D8FF 49408 55551 HS 1 HS0 HS999 1000 D900 DCEF 55552 56551 HT 1 HT0 HT1023 1024 E100 E4FF...

Page 231: ...20099 1 BD 100 58D0 5933 22736 22835 QD QD0 QD99 main unit 100 6000 6063 24576 24675 QD10000 QD10099 1 module 100 6100 6163 24832 24931 QD10100 QD10199 2 module 100 6164 61C7 24932 25031 QD10200 QD10299 3 module 100 61C8 622B 25032 25131 QD10300 QD10399 4 module 100 622C 628F 25132 25231 QD10400 QD10499 5 module 100 6290 62F3 25232 25331 QD10500 QD10599 6 module 100 62F4 6357 25332 25431 QD10600 Q...

Page 232: ...rotocol 4 if the upper computer is SCADA or HMI there are two situations the first one has the Xinje driver for example Xinje HMI Zijinqiao SCADA The program can be written directly by using PLC internal soft components Y0 M0 for the second type Modbus RTU or Modbus ASCII is selected if there is no Xinje driver and then use the addresses in the table above to define the data variables 5 input and ...

Page 233: ...Modbus station Function code data CRC 1 byte 1 byte 0 252 byte 2 byte CRC low CRC high Format START No input signal 10ms Address station no Communication address 8 bit binary Function Function code 8 bit binary DATA n 1 Data content N 8 bit data N 8 max 8 bytes DATA 0 CRC CHK Low CRC check code CRC CHK High 16 bit CRC check code is consist of two 8 bit binary END No input signal 10ms 2 Modbus addr...

Page 234: ... other one write K5000 to D2 M0 REGW K1 H0002 K5000 K2 M0 is trigger condition Rising edge If communication fails the instruction will try twice If the third time communication fails then communication ends The relationship between REGW and Modbus RTU protocol other instructions are the same REGW Function code 06H K1 Station no H0002 Modbus address K5000 Data contents 1388H K2 PLC serial port The ...

Page 235: ...egister address 03H Byte number 04H E8H Register number 00H Data contents 12H 2EH 02H 04H E8H CRC CHECK Low 44H CRC CHECK Low 9DH CRC CHECK High 7BH CRC CHECK High CCH At this time the data read from D1000 and D1001 are 122EH 4654 and 04E8H 1256 4 Function code 05H write single coil Eg Set on the coil address 6000H Y0 RTU mode Asking format Response format Address 01H Address 01H Function code 05H...

Page 236: ...at is 0000 0001 0000 0011 write in corresponding Y17 Y0 so Y0 Y1 Y10 are set ON Note when writing the data contents the low byte is before the high byte 6 Function code 10H write multiple registers Eg Write 3 registers starting from address 0000H D0 RTU mode Asking format Response format Address 01H Address 01H Function code 10H Function code 10H Register address 00H Register address 00H 00H 00H R...

Page 237: ...t STX 3AH Start mark 3AH Address code high bit Communication position no Consist of 2 ASCII codes Address code low bit Function code high bit Function code command Consist of 2 ASCII codes Function code low bit Instruction start ID Command start bit Consist of 4 ASCII codes Instruction start ID Instruction start ID Instruction start ID Data length Length from start to end Consist of 4 ASCII codes ...

Page 238: ...5H 43H End mark 0DH 0AH Description 1 address is PLC station number 2 Function code is Modbus ASCII protocol read write code 3 Register ID is the PLC modbus communication ID please see chapter 7 2 2 4 Data content is the value in D2 5 LRC CHECK Low CRC CHECK High is low and high bit of CRC check value If two pieces of Xinje XD3 PLC communicate with each other write K5000 to D2 M0 REGW K1 H0002 K50...

Page 239: ... of PLC read and write it is normally used with assigned coil register number E g PLC read Xinje inverter s output frequency H2103 output current H2104 bus voltage H2105 then remote register coil start ID is H2103 assigned coil number is K3 3 Local receipt send coil register address Coil register in PLC used to exchange data with lower computer E g write coil M0 write M0 status to assigned address...

Page 240: ...the remote coil start address 16 bits BIN S3 Specify the coil quantity 16 bits BIN D1 Specify the local coil start address bits D2 Specify the serial port no 16 bits BIN Suitable soft components Notes D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM M includes M HM SM S includes S and HS T includes T and HT C includes C and HC COLR K1 K500 K3 M1 X0 K2 S1 S2 S3 D1 D...

Page 241: ...r The execution result of Modbus read and write instructions of serial port 2 is in SD160 Input coil read INPR Summary Read the specified station s input coil status to local device Input coil read INPR 16 bits instruction INPR 32 bits instruction Execution condition Normally ON OFF rising edge Suitable models XD XL Hardware requirement Software requirement Operands Operands Function Type S1 Speci...

Page 242: ...resend is set it will be automatically resend Users can check the relevant registers to determine the cause of the error The execution result of Modbus read and write instructions of serial port 2 is in SD160 This instruction cannot read XINJE PLC input coil Single Coil Write COLW Summary Write local device specified coil to remote station no s coil Single Coil write COLW 16 bits instruction COLW ...

Page 243: ...60 is set OFF when the execution is completed If a communication error occurs and the number of resend is set it will be automatically resend Users can check the relevant registers to determine the cause of the error The execution result of Modbus read and write instructions of serial port 2 is in SD160 Multiple coils write MCLW Summary Write local device multiple coils to remote station no s coil...

Page 244: ...ort4 above extension port 1 K5 Port5 above extension port 2 Operand D3 max coil number is 1976 When X0 is ON MCLW instruction is executed Modbus read write flag SM160 serial port2 is set ON SM160 is set OFF when the execution is completed If a communication error occurs and the number of resend is set it will be automatically resend Users can check the relevant registers to determine the cause of ...

Page 245: ...tion code is 03H Serial port K0 K5 K0 Port0 RS232 K1 Port1 RS232 K2 Port2 RS485 K3 Port3 left extension port K4 Port4 above extension port 1 K5 Port5 above extension port 2 Operand S3 max register number is 125 When X0 is ON REGR instruction is executed Modbus read write flag SM160 serial port2 is set ON SM160 is set OFF when the execution is completed If a communication error occurs and the numbe...

Page 246: ...RR K1 K500 K3 D1 X0 K2 S1 S2 S3 D1 D2 Read input register Modbus function code is 04H Serial port K0 K5 K0 Port0 RS232 K1 Port1 RS232 K2 Port2 RS485 K3 Port3 left extension port K4 Port4 above extension port 1 K5 Port5 above extension port 2 Operand S3 max register number is 125 When X0 is ON INRR instruction is executed Modbus read write flag SM160 serial port2 is set ON SM160 is set OFF when the...

Page 247: ... CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS REGW K1 K500 D1 X0 K2 D1 S1 S2 D2 Write register Modbus function code is 06H Serial port K0 K5 K0 Port0 RS232 K1 Port1 RS232 K2 Port2 RS485 K3 Port3 left extension port K4 Port4 above extension port 1 K5 Port5 above extension port 2 When X0 is ON REGW instruction is executed Modbus read write flag SM160 serial port2 is set ON SM160 is set OFF ...

Page 248: ... includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS MRGW K1 K500 K3 D1 X0 K2 D1 D2 D3 S1 S2 Write multiple registers Modbus function code is 10H Serial port K0 K5 K0 Port0 RS232 K1 Port1 RS232 K2 Port2 RS485 K3 Port3 left extension port K4 Port4 above extension port 1 K5 Port5 above extension port 2 Operand D3 the max register number is 123 When X0 is ON MRGW instruction is executed Mo...

Page 249: ...n below V3 4 must use XNET communication mode and the version above V3 4 can also use Modbus communication mode RS232 port 1 Use the USB download cable to connect the PLC with the computer Here the USB download cable is the HMI download cable as shown below the software must switch to XNet communication mode 2 Open the programming software click configure PLC comm port settings It will show below ...

Page 250: ...nd delay to solve the problem That is after receiving data from the slave station it must delay a certain time to receive the next communication data so as not to cause the above problems Reply overtime ms it refers to the time when the PLC can not receive the response after sending the request and wait for sending again Retry times It refers to the number of times that the PLC can not receive the...

Page 251: ...tool for V1 6 309 and above can also be configured using RS232 port 1 Use the USB download cable to connect the PLC with the computer Here the USB download cable is the HMI download cable as shown below 2 Open xinjeconfig tool 3 Click config find device 4 Choose the com port connecting PC and PLC click ok Click config single device comport The com port is connecting PC and PLC please check it in t...

Page 252: ...2 or Port2 RS485 RS485 Port3 left extension port Port4 upper extension port 1 Port5 upper extension port 2 Here we can set the communication mode and parameters of each communication port 6 When the com port parameters setting is completed click writeconfig It will show write configuration success message ...

Page 253: ...direction 3 RS232 communication distance is short about 13m RS485 is suitable for longer distance 485 wiring methods Connect all A terminals connect all B terminals A is RS485 B is RS485 Application One xinje XD3 series PLC controls 3 XC series PLCs slave PLCs follow the master s action Master PLC Y0 ON then slave PLC Y0 ON Master PLC Y0 OFF then slave PLC Y0 OFF Precondition on off of Y0 makes co...

Page 254: ... it broadcasts the status to all the slaves The synchronization of three PLCs is better than method 1 6 2 8 Application Example 1 Following are the programs for reading and writing Modbus communication between 1 master station and 3 slave stations Program operation 1 Write master PLC Y0 Y11 status to slave PLC 2 Y0 Y11 2 Read slave PLC 2 Y0 Y11 to master PLC M10 M19 3 Write master PLC D10 D19 to s...

Page 255: ...ute the process S0 set ON Y0 Y11 of master station write the master status to Y0 Y11 of slave PLC 2 3 4 Enter process S1 when the communication succeeded read the Y0 Y11 of slave PLC 2 3 4 to master PLC M10 M19 Reset master PLC Y0 Y11 and enter process S2 after the communication is successful write 1 to master PLC D10 D19 write the master PLC D10 D19 to D10 D19 of slave PLC 2 3 4 Enter process S3 ...

Page 256: ...ame time as the original XC series PLC XD series program MCLW K2 K24576 K10 Y0 K2 M0 COLR K2 K24576 K10 M10 K2 MRGW K2 K10 K10 D10 K2 REGR K2 K10 K10 D20 K2 MCLW K3 K24576 K10 Y0 K2 COLR K3 K24576 K10 M20 K2 MRGW K3 K10 K10 D10 K2 REGR K3 K10 K10 D30 K2 MCLW K4 K24576 K10 Y0 K2 COLR K4 K24576 K10 M30 K2 MRGW K4 K10 K10 D10 K2 REGR K4 K10 K10 D40 K2 M200 MOV H3FF DY0 FMOV K1 D10 K10 M201 MOV H0 DY0...

Page 257: ...s Data bit 5 bits special model supported 6 bits special model supported 7 bits 8 bits 9 bits Parity bit none odd parity even parity empty mask Stop bit 1 bit 1 5 bit 2 bits 4 Starter 1 byte terminator 1 byte Users can set a start termination character After setting the start termination character PLC automatically adds the start termination character when sending data and automatically removes th...

Page 258: ...ta Reply timeout refers to the time when the PLC can not receive the response after sending the request waiting for the resend If the response time is set to exceed 300 ms when default communicating the PLC waits 300ms for the other party to respond If the response time is not received the request will be sent again If you want to shorten the communication time you can adjust the above two paramet...

Page 259: ...e resend Other serial parameters can be set according to the parameters of the lower device 4 After setting click write to PLC then cut off the PLC power supply and power on again to make the settings effective Note Versions V3 4 and above can be configured in Modbus communication mode RS232 port Versions V3 4 and below XD series PLC must use X NET communication mode when downloading and uloading ...

Page 260: ...led usage will be used as an example to program the sample program in later chapters 6 3 4 Free communication instruction Send data SEND 1 Instruction overview Write the local data to specified remote station address Send data SEND 16 bit instruction SEND 32 bit instruction Execution condition Normally ON OFF rising edge triggering Suitable model XD XL Hardware V3 2 3 and higher version Software V...

Page 261: ...00 the number of registers sent 2 For example when sending high and low byte data in D10 D17 D100 should be set to 16 and when sending low byte will be before the high byte Receive data RCV 1 Instruction overview Write the specified remote station no s data to local device Send data RCV 16 bit instruction RCV 32 bit instruction Execution condition Normally ON OFF rising edge triggering Suitable mo...

Page 262: ... of the eight registers D20 D27 in turn at this time D200 should be set to 16 When the buffer number is 16 bits the received data is stored in a complete register so D200 the number of bytes to be received for example to receive 8 bytes of data stored in the four registers of D20 D23 in turn at this time D200 should be set to 8 And when receiving low bytes are before high bytes Release serial port...

Page 263: ...SM163 Data 6 3 5 Free communication example Example 1 In chapter 6 3 3 we give an example of communication between Xinje PLC and temperature control instrument when explaining why to use free communication Here is an example Operation steps 1 Connect the hardware first Here we use the serial port 2 of the PLC to communicate that is 485 on the instrument is connected to A of the output port of the ...

Page 264: ...code D1 CR ascii code D0 ascii code SM162 Port 2 RS232 sending flag Read switch D10 Receive starting register 0 0 0 0 0 0 When trying to communicate between PLC and other intelligent devices it is suggested to use serial debugging tool to determine the data format of communication that is protocol The advantages of this method are the serial debugging tool is easy to modify and flexible to use aft...

Page 265: ...ands the Modbus communication he can use the Modbus RTU communication mode to do so as long as he writes a write multiple register instructions MRGW in the host Here we do it in free communication mode Operation steps 1 Connect the hardware first Here we use the serial port 2 of the PLC to communicate that is connect A of the two PLC and connect B of the two PLC 2 Set the same serial port paramete...

Page 266: ...SCII value Control character ASCII value Control character ASCII value Control character 0 NUT 32 space 64 96 1 SOH 33 65 A 97 a 2 STX 34 66 B 98 b 3 ETX 35 67 C 99 c 4 EOT 36 68 D 100 d 5 ENQ 37 69 E 101 e 6 ACK 38 70 F 102 f 7 BEL 39 71 G 103 g 8 BS 40 72 H 104 h 9 HT 41 73 I 105 i 10 LF 42 74 J 106 j 11 VT 43 75 K 107 k 12 FF 44 76 L 108 l 13 CR 45 77 M 109 m 14 SO 46 78 N 110 n 15 SI 47 79 O 1...

Page 267: ... D0 D6 registers can be monitored as follows Switch to decimal format and show as below By comparing the relationship between ASCII codes and decimal values we can find the rule that there is 48 difference between ASCII codes in D1 D3 D4 D5 D6 and decimal values The final decimal values are obtained by subtracting the values in registers by K48 and multiplying by 10 The formula is as follows D46 D...

Page 268: ... 8 FLT D16 D16 0 1 FLT D18 D18 0 4 EMUL D12 K0 1 D20 7 0 7 EMUL D14 K0 01 D24 8 0 08 EMUL D16 K0 001 D28 1 0 001 EMUL D18 K0 0001 D32 4 0 0004 EADD D10 D20 D40 0 0 7 0 7 EADD D40 D24 D42 0 7 0 08 0 78 EADD D42 D28 D44 0 78 0 001 0 781 EADD D44 D32 D46 0 781 0 0004 0 7814 D0 EMUL D46 K 1 D100 K45 D0 EMUL D46 K1 D100 K43 0 7814 0 7814 0 7814 0 7814 45 45 ...

Page 269: ...tion flag When the instruction starts to execute set ON When execution is completed set OFF SM151 SM152 Free communication sending flag When the instruction starts to execute set ON When execution is completed set OFF SM153 Free communication received flag When receiving a frame of data or receiving data timeout set ON Require user program to set OFF SM154 SM159 Port 2 SM160 Modbus read write inst...

Page 270: ...CRC error SD142 Free communication sending result 0 correct 410 free communication buffer overflow SD143 Free communication receiving result 0 correct 410 send data length overflow 411 receive data short 412 receive data long 413 receive error 414 receive timeout 415 no start symbol 416 no end symbol SD144 free communication receiving data number Count as byte not include start symbol and end symb...

Page 271: ...ve error 101 receive timeout 180 CRC error 181 LRC error 182 station number error 183 send buffer overflow 400 function code error 401 address error 402 length error 403 data error 404 slave station busy 405 memory error erase FLASH SD161 X Net communication result 0 correct 1 communication timeout 2 memory error 3 receive CRC error SD162 Free communication sending result 0 correct 410 free commun...

Page 272: ...tware V3 4 and higher version 2 Operand Operand Function Type D Local register starting address 16 bit BIN S1 Read serial port parameters number 16 bit BIN S2 Serial port no 16 bit BIN 3 Suitable soft component Note D denotes D HD TD denotes TD HTD CD denotes CD HCD HSCD HSD DM denotes DM DHM DS stands for DS DHS CGFCR HD0 K8 K2 X0 S1 S2 D Operator S1 The number of registers used to read serial pa...

Page 273: ...l port parameters number 16 bit BIN S3 Serial port no 16 bit BIN 3 Suitable soft component Note D denotes D HD TD denotes TD HTD CD denotes CD HCD HSCD HSD DM denotes DM DHM DS stands for DS DHS CFGCW HD0 K8 K2 X0 S2 S3 S1 Operator S2 The number of registers used to write serial parameters is generally 8 XD5E XDME series is 9 Operator S3 Serial port range K0 K5 K0 Port0 K1 Port1 K2 Port2 or Port2 ...

Page 274: ...roperties bit7 1 with start character 0 no start character bit6 1 with end character 0 no end character Physical layer type 1 PHY_RS485 2 PHY_SOF Unidirectional Fiber Ring Network 3 PHY_OFPP Optical Fiber Point Network 4 PHY_RS232 5 PHY_RS422 6 PHY_TTL TTLvoltage network HD4 Frame format refer to table 2 Start character Link Layer Type 0 TBN 1 HDN 2 CCN 3 PPFD 4 PPU 5 Ethernet HD5 retry count 0 5 ...

Page 275: ...d rate Value Baud rate Value Baud rate Value Baud rate Value Baud rate 1 300 bps 7 19200 bps 13 256000 bps 19 1000000 bps 2 600 bps 8 28800 bps 14 288000 bps 20 1200000 bps 3 1200 bps 9 38400 bps 15 384000 bps 21 1500000 bps 4 2400 bps 10 57600 bps 16 512000 bps 22 2400000 bps 5 4800 bps 11 115200 bps 17 576000 bps 23 3000000 bps 6 9600 bps 12 192000 bps 18 768000 bps Table 2 frame format Stop bit...

Page 276: ...D control separates the basic units with the expansions which improves the flexibility of this function XD XL series PLC have two methods for auto tune step response method and critical oscillation method For temperature control object Step response method the PID auto tune will start when current temperature of object controlled is equal to ambient temperature Critical oscillation method the PID ...

Page 277: ... use them as the common data registers This instruction executes when each sampling time interval comes For the operation result data registers are used to store PID output values the output points are used to output the occupy duty ratio in the form of ON OFF PID control rules are shown as below P proportion I integral D differential Analog PID control system Functions and Action Operands System ...

Page 278: ...output digital form of MV u t the default range is 0 4095 2 Digital output Y T MV PID output upper limit Y is the outputs activate time within the control cycle T is the control cycle equals to the sampling time PID output upper limit default value is 4095 7 3 Parameters setting Users can call PID in XDP Pro software directly and set the parameters in the window see graph below for the details ple...

Page 279: ...parameters ID please refer to the below table ID Function Description Memo S3 Sampling time Whatever it is manual or auto mode all needs to set 32 bits without sign Unit ms S3 2 Mode setting bit0 0 negative action 1 positive action bit1 bit6 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 ...

Page 280: ...ential gain KD 0 100 Only for advanced mode normal mode default value is 50 0 is no differential gain S3 10 Upper limit value of output 0 32767 S3 11 Lower limit value of output 0 32767 S3 12 Change of Unit Temperature Corresponds to Change of AD Value full scale AD value 0 3 1 default value is 10 16 bit no sign only for step PID S3 13 PID auto tune overshoot 0 enable overshoot 1 not overshoot try...

Page 281: ...e The value before changing the target temperature Internal use parameters of the system for monitoring purposes only S3 23 Parameter is reserved The following is the joint address divided into step setting critical oscillation setting and manual control Step part read only parameters only for monitoring S3 24 Actual sampling space 0 4294967296 unit ms Internal usage parameters of the system S3 26...

Page 282: ...rs of the system S3 44 Stop temperature Temperature at the end of auto tuning Range 32767 32767 Internal usage parameters of the system Critical oscillation part read only parameters only for monitoring S3 24 PID control mode 0 PID control 1 PI control 2 P control 16 bit no sign internal usage parameters of the system S3 25 Current auto tuning segment 0 Preparation stage 1 start to auto tune 2 3 a...

Page 283: ...nit ms Internal usage parameters of the system S3 32 Sampling temperature after last filtering The filtered temperature acquired in the last sampling time the input filter constant in the advanced mode needs to be set first Floating point internal usage parameters of the system S3 34 Last temperature deviation Floating point internal usage parameters of the system S3 36 Value of last integral term...

Page 284: ...by users S3 16 S3 69 are occupied by system users can t use them Sample time S3 The system samples the current values according to some certain interval and compares them with the output value This time interval is the sample time T There is no requirement for T during DA output T should be larger than one PLC scan period during port output T value should be chosen among 100 1000 times of PLC scan...

Page 285: ...roportion gain Kp integral time Ti differential time TD automatically Auto tune mode is suitable for these controlled objects temperature pressure not suitable for liquid level and flow Auto tuning is the process of extracting PID parameters Sometimes auto tuning can not find the best parameters at one time It needs auto tuning for many times It is normal that there is a vibration in the process A...

Page 286: ...ent temperature Two different methods and PID control diagram 1 Step response method Make sure current temperature is equal to ambient temperature output D0 DIFF D0 Setting value D0 DIFF 2 Critical oscillation method The auto tune start temperature can be any value t Output D0 DIFF D0 Setting value D0 DIFF To enter the auto tune mode please set bit7 of S3 2 to be 1 and turn on PID working conditio...

Page 287: ...alue seriously In the 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 bit8 keeps 0 when S3 2 bit7 changes from 1 to 0 it means auto tune is finished but the parameters are not the best and they need to be modified by hand Every adjustment percent of current target value in auto tune end transition stage S3 14 This parameter i...

Page 288: ... better PID control effect Enter into the advanced mode please set S3 2 bit 15 to be 1 or set it in the XDP Pro software Input Filter constant S3 8 It will smooth the sampling value The default value is 0 which means no filter Differential Gain S3 9 The low pass filtering process will relax the sharp change of the output value The default value is 50 the relaxing effect will be more obviously if i...

Page 289: ...rameters got from auto tune 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 for reference only If the auto tune 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 contr...

Page 290: ...to tune is finished 5 Set ON M0 use the PID parameters getting from auto tune 6 If the PID effect is not good by using the auto tune PID parameters user can adjust the PID parameters to get good effect Note This PLC temperature PID control program is applicable to almost all temperature control projects Move ID100 content into D10 auto tune mode or set to autotune mode after auto tune end start PI...

Page 291: ...290 Example 2 To control the target temperature 60 in step response mode Overshoot is permitted 1 The target temperature 60 600 2 Parameters setting 3 The result curve ...

Page 292: ...ure reaches 100 degree and stops heating the PID auto tune success bit D4002 8 will be ON at once 3 When it starts PID calculation the PLC will auto set a sampling time about 2500 This parameter will be replaced by the PID best sampling time after stoping heating at 100 degree 4 When it starts PID calculation the PLC will auto set the PID parameters P 4454 I 926 D 2317 These parameters will be rep...

Page 293: ...PID starts to work the output will heat the object from 28 degree to 60 degree then the output is forced to stop heating to avoid overshoot but this will interrupt the PID auto tune process 9 To enlarge the PID calculation range can suppress the heating overshoot Overshoot is not permitted 1 The target temperature is 60 degree 600 2 The related parameter settings 3 The result curve ...

Page 294: ...reaches 48 degree and stops heating the PID auto tune success bit D4002 8 will not be ON at once It hasn t set ON even when the auto tune succeeded 3 When it starts PID calculation the PLC will auto set a sampling time about 2500 This parameter will be replaced by the PID best sampling time after stoping heating at 48 degree 4 When it starts PID calculation the PLC will auto set the PID parameters...

Page 295: ...ftware also supports global variable Users can call the function at many places and call different functions which greatly increase program security and programmer s efficiency 8 2 Instruction Format 1 Instruction Summary Call the C language Function Block at the specified place Call the C language function block NAME_C 16 bits instruction NAME_C 32 bits Instruction Execution condition Normally ON...

Page 296: ...underlines The first character can t be number and the name length should be 9 ASC The name can be the same with PLC s self instructions like LD ADD SUB PLSR etc The name can t be the same with the function blocks existing in current PLC 8 3 Operation Steps 1 Open PLC edit tool in the left Project toolbar choose Func Block right click it and choose Add New Func Block Function and Action Operands S...

Page 297: ...new Function Block you can see the edit interface as shown below Parameters transfer way if call the Function Block in ladder the transferred D and M Editor Name Function Block Name Edit your C language program between Main function s name it s function block s name this name can t be changed freely and users should modify in the edit window WORD W correspond to soft component D BIT B correspond t...

Page 298: ...ort the definition of floating variable in the function and execute floating operation E g float register D0 double word means FW 0 FW 0 123 456 Other soft elements definition in C language In C language of PLC if you want to use input X and output Y then macro definition define SysReg Addr_X_Y is needed E g send the state of input X0 to given coil M0 then B 0 X 0 send the state of Y0 to given coi...

Page 299: ...teger FP32 single precision floating FP64 double precision floating Predefined Marco define true 1 define false 0 define TRUE 1 define FALSE 0 8 4 Import and Export the Functions 1 Export 1 Function Export the function as the file then other PLC program can import to use 2 Export Format a Editable Export the source codes out and save as a file If import again the file is editable ...

Page 300: ... click OK 8 5 Edit the Func Blocks Example Add D0 and D1 in PLC s registers and 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 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 pro...

Page 301: ...o grammar error in the program 3 Write PLC program assign value 10 and 20 into registers D0 D1 separately then call Func Block ADD_2 see graph below 4 Download program into PLC run PLC and set M0 5 From Free Monitor in the toolbar we can see that D2 changes to be 30 it means assignment is successful Free Monitor ...

Page 302: ... of three multiplication equations Get the sum Ladder chart only support two original operands it needs many steps to get the result 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 calc...

Page 303: ...parity value via Func Block CRC calculation rules 1 Set 16 bit register CRC register FFFF H 2 XOR Exclusive OR the first 8 bit byte message and the low 16 bit CRC register 3 Right shift 1 bit of CRC register fill 0 into the highest bit 4 Check the right shifted value if it is 0 save the new value from step3 into CRC register if it is not 0 XOR the CRC register value with A001 H and then save the r...

Page 304: ...PLC then RUN PLC set M0 via Free Monitor we can find that values in D6 and D7 are the highest and lowest bit of CRC parity value 8 7 Application notes In one Func Block file you can write many functions and they can be called by each other Each Func Block file is independent they can t call block in each other ...

Page 305: ...rt local variable while XD XL series PLC support both local and global variable This makes C language Block more flexible and convenient XDPPro software v3 3 and later version keep C function library In this function block user can call the C function directly For example click TEL10 the function name will show on the project bar ...

Page 306: ...void s2 size_t n Copy n words from position s2 to s1 and return s1 void memset void s int c size_t n Replace the n words start from s position with word c and return to position s char strcat char s1 const char s2 Connect string ct behind string s char strchr const char s int c Return the first word c position in string s int strcmp const char s1 const char s2 Compare string s1 and s2 char strcpy ...

Page 307: ...uble x float logf float x Nature logarithm logic double log10 double x float log10f float x logarithm log10x double modf double val double pd float modff float val float pd Break floating data X to be integral part and decimal part return the decimal part save the integral part into parameter ip double pow double x double y float powf float x float y Power value of parameter y x y double sin doubl...

Page 308: ...est difference with general processes BLOCK starts from SBLOCK and ends with SBLOCKE and programmers can write instructions in the BLOCK If one BLOCK contains multiple pulse output instructions or other instructions then pulse output instructions will execute in accordance with conditions meet order And meanwhile the next pulse output instruction will not execute until the current instruction is o...

Page 309: ...e top to the bottom When the trigger condition is disconnected the BLOCK will not stop immediately but will complete the last scan and stop after the execution of the unexecuted program 3 When the triggering condition of BLOCK is triggered by the rising edge of the coil the sequential function BLOCK will be executed one time from top to bottom and will not be executed circularly 9 2 Call the BLOCK...

Page 310: ...9 You can edit the BLOCK in the window Upwards Downwards are used to change the position of instructions in the block Click insert button some instructions list under the menu Take Pulse Item for example ...

Page 311: ...310 After click OK you will find information in the configuration Click OK the following instructions are added in the ladder Meantime a new sequence block is added in the right of the project bar ...

Page 312: ...nt to move the BLOCK to other place you have to select the original BLOCK and delete it select all then delete Move the cursor to the new place and then right click the BLOCK and select add to lad Now the BLOCK is moved to the new place ...

Page 313: ...t to completely delete the BLOCK right click the function block and select delete sequence block After this operation you can t call this BLOCK any more 9 2 4 Modify the BLOCK There are two methods to modify the BLOCK A Double click the start end segment to modify the BLOCK in general ...

Page 314: ...313 B Double click the middle part to modify ...

Page 315: ...fter click the command item Users can add instructions in the frame Skip to control the stop and run of the instructions If you select skip and input control coil in the frame then when the control coil is ON the command will not be executed If not select the default action is execution Comment to modify the note for the instruction ...

Page 316: ... OK the ladder program will change as the following Note We can add multiply instructions in one BLOCK and use Skip as every instruction s execution condition 9 3 2 Pulse Item Open the pulse item in the same way ...

Page 317: ...ons 9 3 3 Wait Item Wait Item to wait coil flag or timer bit Open Wait Item in the same way There are two waiting modes flag bit and timer wait A Flag bit SEM corresponding ladder diagram is as below M30 POST SEM0 B Timer wait C Corresponding ladder diagram ...

Page 318: ... state of SEM the OUT command needs to be triggered by the normally open coil and the SEM is reset when the triggering condition is disconnected 9 3 4 Module Read and Write FROM TO instruction This item is used to read and write data between PLC and modules and the operate panel is as below 1 read FROM TO instruction can be selected from pull down list M0 SBLOCK BLOCK 1 FROM K10000 K0 K6 M10 TO K1...

Page 319: ...t executed and the triggering condition M is disconnected the BLOCK will not stop immediately but will complete the last scan and will stop after the rest of the program has been executed B The condition is rising or falling edge of pulse M1 SBLOCK Sequence block 1 SBLOCK Sequence block 2 SBLOCK Sequence block 3 M2 M3 Scanning period 1 Scanning period 2 Scanning period 3 Block1 Block1 Block2 Block...

Page 320: ...block run in sequence according to the scanning time They run one after another when the condition is ON A Without SKIP condition The instructions running sequence in block 1 is shown as below B With SKIP condition M1 SBLOCK Sequence block 1 SBLOCK Sequence block 2 SBLOCK Sequence block 3 M2 M3 ...

Page 321: ...Y0 pulse PLSR HD0 HD100 K1 Y0 will run if not the PLSR HD0 HD100 K1 Y0 will run after it is released by other instructions E After Y0 pulse sending completed check M4 If M4 is OFF check Y1 block if M4 is ON check M5 If M5 is OFF module commmunication will run 9 5 BLOCK instruction editing rules In the BLOCK the instruction editing should accord with some standards Do not use the same pulse output ...

Page 322: ...minal in BLOCK and main program NO YES There only can be one SKIP condition for one BLOCK instruction NO YES The SKIP condition only can use M X can not use other coil or register NO YES The output instructions cannot be CNT_AB CNT PWM NO YES ...

Page 323: ...added in block but they do not work in fact 9 6 BLOCK related instructions 9 6 1 Instruction explanation stop running the BLOCK SBSTOP Summarization Stop the instructions running in the block SBSTOP 16 bits SBSTOP 32 bits Condition NO NC coil and pulse edge Suitable types XD XL Hardware Software V3 2 Operand Operand Function Type S1 The number of the BLOCK 16bits BIN S2 The mode to stop the BLOCK ...

Page 324: ...OON instruction so the remaining instructions will not be executed After executing this instruction the BLOCK can be restarted Note K2 mode is only supported by V3 4 2 and above PLC Continue running the BLOCK SBGOON Summarization This instruction is opposite to SBSTOP To continue running the BLOCK SBGOON 16 bits SBGOON 32 bits Condition Pulse edge Suitable types XD XL Hardware Software V3 2 Operan...

Page 325: ...se 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 This instruction only applies to PLSR instructions in BLOCK and can only send the remaining pulses for interpolation instructions which can no...

Page 326: ...hen M0 is from OFF ON run PLSR HD0 HD100 K1 Y0 in the BLOCK to output the pulse When M2 is from OFF ON the BLOCK stops running at once When M4 is from OFF ON abandon the rest pulse SBSTOP K1 K1 SBGOON K1 K0 ...

Page 327: ... M2 is OFF ON the BLOCK stops running the pulse output stops at once When M3 is OFF ON output the rest pulses 3 SBSTOP K1 K0 SBGOON K1 K1 Scanning period 1 Scanning period 2 Scanning period 3 Condition M0 M0 Scanning period 4 Scanning period 5 Condition M2 M1 Condition M3 PLS Y0 PLS Y0 ...

Page 328: ...FF ON run PLSR HD0 HD100 K1 Y0 in the BLOCK to output the pulse When M1 is from OFF ON stop running 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 K0 ...

Page 329: ...OON K1 K0 again it will output the rest of the pulses 9 7 BLOCK flag bit and register 1 BLOCK flag bit Address Function Explanation SM300 BLOCK1 running flag 1 running 0 not running SM301 BLOCK2 running flag SM302 BLOCK3 running flag SM399 BLOCK100 running flag 2 BLOCK flag register Address Function Explanation SD300 BLOCK1 running instruction BLOCK use this value when monitoring SD301 BLOCK2 runn...

Page 330: ...I Enable Interruption EI 10 4 1 DI Disable Interruption DI 10 4 1 IRET Interruption Return IRET 10 4 1 10 1 Pulse Width Modulation PWM 1 Instruction s Summary Instruction to realize PWM pulse width modulation PWM pulse width modulation PWM 16 bits instruction PWM 32 bits instruction execution condition normally ON OFF coil suitable models XD XL except XD1 XL1 XDH hardware requirement software requ...

Page 331: ... 60T6 Y0 Y1 Y2 Y3 XDM 24T4 32T4 60T4 60T10 Y0 Y1 Y2 Y3 XDC 24T 32T 48T 60T Y0 Y1 XD5E 30T4 60T10 Y0 Y1 Y2 Y3 XDME 60T10 Y0 Y1 Y2 Y3 XL3 16T Y0 Y1 XL5 32T4 XL5E 32T4 XLME 32T4 Y0 Y1 Y2 Y3 Duty cycle of PWM output n 65535 100 PWM use the unit of 0 1Hz so when set S2 frequency the set value is 10 times of the actual frequency 10f E g to set the frequency as 72 KHz and then set value in S2 is 720000 W...

Page 332: ...nged by changing the duty ratio There are many methods to change the value The normal way is pulse width modulation PWM which means only changing the ON holding time but not changing the ON frequency This example applies the PWM technology to the LED brightness adjustment The controller can accpet 24V PWM control signal The brightness range includes 25 50 75 100 The brightness is controlled by the...

Page 333: ...LED brightness is 50 5 X4 is ON HD0 24576 HD0 32768 0 75 the LED brightness is 75 6 X5 is ON HD0 32768 HD0 32768 1 the LED brightness is 100 7 Press shut down button X1 is ON HD0 is reset shut down the PWM trigger condition LED voltage is 0V 10 2 Frequency measurement FRQM 1 Instruction list Measure the frequency Frequency measurement FRQM 16 bits instruction 32 bits instruction FRQM execution con...

Page 334: ...0 is ON FRQM collects 20 pulses from X0 and records the sampling time The result of sampling numbers dividing by sampling time will be saved in D100 The measurement process will repeat If the measurement freqeuncy is less than the measurement range the result is 0 The measurement precision is 0 001 The pulse input terminal for FRQM Model X terminal Max frequency Hz XD2 16 I O X0 10K X3 X6 24 32 I ...

Page 335: ...X6 X11 XD5E 30T4 60T10 I O X0 80K X3 X6 X11 XL3 16 I O X0 80K X3 10K X6 XL5 32T4 I O X0 80K X3 X6 X11 XL5E 32T4 I O X0 80K X3 X6 X11 XLME 32T4 I O X0 80K X3 X6 X11 Example Asynchronous motor drives the conveyor to transfer the work piece It needs to real time display the work piece moving speed The diameter of the transmission shaft is 100mm the gear numbers on the transmission shaft are 100 the s...

Page 336: ...mber Program FRQM K20 D0 X0 K1 EDIV D2 K100 D4 DFLT D0 D2 M0 EMUL K0 1 K3 14 D6 EMUL D4 D6 D10 EMUL D10 K60 D16 Program explanation 1 Set ON the start signal M0 to run the frequency meansurement program 2 Transform the frequency to float number then it is divided by 100 gear numbers per rotation the result is shaft rotate numbers per second float number ...

Page 337: ...execution condition edge activation suitable models XD XL except XDH hardware requirement software requirements 2 Operands Operands Function Type D1 Timer Number bit D2 specify timer s value or soft component s ID number 32 bits BIN 3 Suitable Soft Components Note D includes D HD TD includes TD HTD CD includes CD HCD HSCD HSD DM includes DM DHM DS includes DS DHS M includes M HM SM S includes S HS...

Page 338: ... to OFF restart to time when time accumulation reaches 100ms T600 reset again See graph below X0 ET0 100ms 100ms M0 When the pre condition of STR is normally open closed coil the precise timer will set ON immediately when the timing time arrives and reset the timing and cycle back and forth read the precise timing stop precise time DMOV ET0 X0 STOP ET0 M0 D D D0 D1 D2 When X0 changes from OFF to O...

Page 339: ...on To improve the filling capacity precision the liquid valve open time can be controlled by precise timing When the precise timing reaches the count value it will generate an interruption tag interruption subprogram will be executed Can start the precise timing in precise timing interruption Every precise timer has its own interruption tag as shown below Precise Timing Interruption When X0 change...

Page 340: ...n the valve opened Y0 OFF when the valve closed Program STR ET0 K3000 X0 RST ET0 S Y0 ET0 R Y0 Program explanation 1 When X0 is ON the liquid valve Y0 and precise timer ET0 open at once 2 Shut down the liquid valve Y0 and precise timer ET0 when the time arrived Example 2 The precise timer interruption can produce the following pulse wave The Y2 ON time is 500ms the pulse period is 1000ms ...

Page 341: ... STR ET0 K500 X0 FEND I3000 SM0 Y2 S Y2 PLS M0 Y2 R M0 Y2 SM0 STR ET0 K500 IRET END Program explanation 1 When X0 is ON the precise timer interruption will work Y2 will output the pusle wave 2 When X0 is OFF shut down the precise timer interruption Y2 stop outputting Example 3 As the FRQM calculating the time for fixed pulse numbers we will change the way to calculate the pulse numbers in fixed ti...

Page 342: ... RST ET0 M0 STR ET0 HD0 M0 FEND I3000 SM0 STR ET0 HD0 IRET END M0 CNT HSC0 K999999999 DMOV HSC0 D0 SM0 DFLT D0 D2 DFLT HD0 D4 EDIV K1000 D4 D6 EMUL D2 D6 D8 DINT D8 D10 DMOV K0 HSC0 Program explanation 1 Set the high speed counter sampling period register HD0 the unit is ms 2 Set ON M0 to start the precise timer interruption and high speed counter calcuate the frequency 3 The frequency range is 0 ...

Page 343: ...e to execute the main program Note The external interruption of XC series PLC cannot be activated by rising edge and falling edge at the same time but XD XL series PLC supports rising edge and falling edge activation meantime XD1 XD2 XD3 XD5 XL1 XL3 series 16 I O Input terminal Pointer No Disable the interruption instruction Rising Interruption Falling interruption X2 I0000 I0001 SM050 X3 I0100 I0...

Page 344: ...et reset transmission and operation can be written which can be executed in a scanning cycle Other instructions such as sending pulses timing except for precise timing communication and other instructions that need to be continuously executed are not supported If use EI instruction to allow interruption then when scanning the program if interruption input changes from OFF to ON then execute subrou...

Page 345: ...e I0000 I0100 I0200 The PLC external interruption terminal please refer to external interruption terminal definition The pulse terminal is Y0 the direction terminal By programming DI instruction can set interruption disabled area Allow interruption input between EI DI If interruption forbidden is not required please program only with EI and program with DI is not required Every input interruption ...

Page 346: ...999 Acceleration and deceleratoin time 0 Note as the pulse numbers of each segment is unknown the pulse numbers should set large enough to ensure the object can move to the proximity switch The STOP instruction will be run by external interruption when the object gets to position C Component explanation PLC component Control explanation Mark M0 Start button PLSF will send pulse when the button is ...

Page 347: ... the external interruption I0100 will work HD0 is set to 20000 the object will move from B to C with the speed of 20000Hz 4 When the object touches C X2 will be ON at once the external interruption I0200 will work M0 is set OFF the pulse sending will stop at once Example 2 The diagram is the product packing machine The robot will pack the product when 30 products are detected the robot and counter...

Page 348: ...0 16 bit counter Y0 Robot Program M0 X1 FEND I0000 IRET END RST C0 SM0 CNT C0 K30 Y0 M0 R Y0 R M0 S C0 Program explanation 1 In the external interruption program count the X2 input when the X2 is 30 set ON M0 2 In the main program it controls the Y0 according to the M0 state 3 When the robot action is completed X1 changes from OFF to ON once RST works Y0 and C0 are reset M0 is OFF wait for the nex...

Page 349: ...e that the main program execution cycle is very long when you have to handle with special program or execute specific program every once in a while when program is scanning in sequence control the timing interruption is very useful It is not affected by PLC scan cycle and executes timing interruption subroutine every N ms Timing interruption is open status in default just like other interruption s...

Page 350: ...ures all timing interruptions are forbidden between DI and EI and allowed beyond DI EI Interruption allowed Interruption allowed Interruption forbidden Interruption forbidden Interruption Allowed Interruption Program The first 3CH timing interruptions are equipped with special relays SM070 SM079 In the left example if use M0 to set SM070 ON then forbid timing interruption forbidden Interruption ra...

Page 351: ...LC click Config Software ComPort the following window will jump out Choose correct communication serial port according to your PC actual serial port baud rate selects 19200BPS parity check selects even parity 8 data bits 1 stop bit you can also click check button directly in the window and communication parameters will be selected by PLC itself Connect PLC successfully will be displayed on the lef...

Page 352: ...ORT1 communication of PLC is damaged The download communication cable brand is not Xinje XVP cable Solutions At first use Xinje XVP cable to connect PC and PLC After confirming the connection cable is the Xinje special XVP cable and USB convertor has been used you can use it to try to connect desktop PC with 9 needle serial port to PLC If the desktop PC can be connected correctly please change the...

Page 353: ...ain a few times until the information window of successful stop jump out Then click configure button Click Reset PLC in the drop down menu By this time Reset PLC information window will jump out and it means that all steps of Stop when PLC reboot have been finished If initialize PLC unsuccessfully after you trying a few times or the following window jumps out after clicking Reset PLC ...

Page 354: ...ion do not match PLC will not support those upgraded function About which PLC version the instruction support please refer to instruction summary in this manual or appendix 2 special function version requirement When users change the communication parameters PLC and PC can not connect When users use program confidential download function however forget the password Note PLC program will disappear ...

Page 355: ...354 Click Open File choose the PLC model for updating Note XD3_16 sys fit for PLC model XD3 16 XD3_60 sys fit for PLC model XD3 32 and XD3 60 Set the parameters ...

Page 356: ...355 Click set parameter it will show the parameter window Note set the com port the baud rate is default setting no need to change Click download the window will show below words ...

Page 357: ...356 Power on the PLC the update tool will show below words Cut off the power of PLC connect the short jumper then power on the PLC again PLC start to update the updating will take few minutes ...

Page 358: ...ing the update cut off the PLC power take off the short jumper then power on the PLC again PLC hardware version The PLC hardware version can be seen in CPU detail on the left window in XDPpro software PLC online status ...

Page 359: ...d E g DM0 a word consist of 16 coils bits M0 M15 is as below DM0 M15 M14 M13 M12 M11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 We can use bit in the register directly Example 1 M100 MOV K3 DM0 The other mode is bit operation of fixed register E g D0 0 is the first bit of 16 bits in register D0 Similarly D0 1 is the second bit and so on as shown below D0 D0 15 D0 14 D0 13 D0 12 D0 11 D0 10 D0 9 D0 8 D0 7 D...

Page 360: ... chart of LDD and LD Q6 Why the output LED keeps flashing when using ALT instruction A6 For ALT and many calculation instructions these instructions will execute every scanning period when the condition is fulfilled for example the condition is normal ON coil We recommend that the condition is rising edge or falling edge Q7 Why the M and Y cannot output sometime A7 Output mainly has two ways 1 OUT...

Page 361: ...tion by configuration parameter instruction For specific instructions please refer to Chapter 6 Communication Functions of this manual The communication parameter settings of different devices are generally different so it is important to choose the correct frequency setting mode of communication devices make clear the corresponding MODBUS communication address and function code and some communica...

Page 362: ...e of D0 and D2 is integer the result will has error D10 Please use below instruction to transform the integer to floating number FLT D0 D6 FLT D2 D8 EDIV D6 D8 D10 M0 Q13 Why the floating numbers become messy code in online ladder monitor window A13 As the floating number cannot be displayed in online ladder monitoring please monitor the floating number in free monitor function Open XDPpro softwar...

Page 363: ...he input of high speed counting of PLC the corresponding high speed counting program should be written with functional instructions For details please refer to the relevant content of Chapter 5 of this manual Q18 C language advantages compared to ladder chart A18 1 XD XL series PLC supports almost all C language functions When it comes to complex mathematical operations the advantage of C language...

Page 364: ...ypted first Note This operation is dangerous if you forget the password your PLC will be locked This download mode is suitable for users when they need to keep the device program secret and they can call out the device program at any time Secret download mode In this mode the program on the computer can be downloaded to the PLC no matter what way the user can upload the program in the PLC to the c...

Page 365: ...ries PLC Bluetooth function can perform PLC program download and upload monitor and Twin configuration software online simulation The Bluetooth can replace the cable to transfer the data Note COM Bluetooth only fit for XINJE PLC Q24 PLC I O terminal exchanging A24 Sometime the PLC I O terminals are broken User don t have to change the program PLC I O terminal exchanging function can solve the prob...

Page 366: ...ealize indirect addressing function such as D100 9 X3 D100 represents X14 M10 D100 represents M19 D0 D100 represents D9 It usually applies to large number of bit and register operation and storage Q26 How does XD XL series PLC connect to the network A26 XD XL series PLC can connect to network by Xinje T BOX G BOX W BOX S BOX A BOX expansion modules or expansion BD boards which have their own commu...

Page 367: ... line note in XDppro software A27 Soft element note Open XDPpro software and move the mouse to the corresponding soft element and right click the mouse then menu will pop out Click Modify reg comment to add element notes in below window Line note Line note starts from Double click the line then input semicolon and the contents ...

Page 368: ...herwise the default PLC when it leaves factory does not have clock function If you use a PLC with clock function check whether the value in register SD13 SD19 is decimal If not you need to convert it into decimal through BIN or TRD instructions There are some errors in the clock of XD XL series PLC The error is about 5 minutes per month Please calibrate it by HMI or directly in the PLC program ...

Page 369: ...002 is ON in first scan cycle SM003 Initial negative pulse coil SM003 is OFF in first scan cycle SM004 PLC running error When SM4 sets ON it indicates that there is an error in the operation of PLC Firmware version V3 4 5 and above supports this function by PLC SM005 Battery low alarm coil When the battery voltage is less than 2 5V SM5 will put ON at this time please replace the battery as soon as...

Page 370: ...tion overflows ID Function Description SM032 Retentive register reset When SM032 is ON ON OFF mapping memory of HM HS and current values of HT HC HD will be reset SM033 Clear user s program When SM033 is ON all PLC user s program will be cleared SM034 All output forbidden When SM034 is ON all PLC external contacts will be set OFF ID Function Description SM040 The process is running Set ON when the...

Page 371: ...ction the input interruption couldn t act independently when M acts even if the interruption is allowed E g when SM050 is ON I0000 I0001 is forbidden SM051 I0100 I0101 Forbid input interruption 1 SM052 I0200 I0201 Forbid input interruption 2 SM053 I0300 I0301 Forbid input interruption 3 SM054 I0400 I0401 Forbid input interruption 4 SM069 I1900 I1901 Forbid input interruption 19 SM070 I40 Forbid ti...

Page 372: ...or flag Address Function Note Serial port 0 SM140 Modbus instruction execution flag When the instruction starts to execute set ON When execution is complete set OFF SM141 X NET instruction execution flag When the instruction starts to execute set ON When execution is complete set OFF SM142 Free format communication sending flag When the instruction starts to execute set ON When execution is comple...

Page 373: ...ion execution flag Same to SM140 SM181 X NET instruction execution flag Same to SM141 SM182 Free format communication sending flag Same to SM142 SM183 Free format communication receive complete flag Same to SM143 Serial port 5 SM190 Modbus instruction execution flag Same to SM140 SM191 X NET instruction execution flag Same to SM141 SM192 Free format communication sending flag Same to SM142 SM193 F...

Page 374: ...n power on or users can also reset by hand SM412 Invalid data fill When offset of register overflows the return value will be SM372 value SM396 BLOCK97 running flag SM396 will be ON when block97is running SM397 BLOCK98 running flag SM397 will be ON when block98 is running SM398 BLOCK99 running flag SM398 will be ON when block99 is running SM399 BLOCK100 running flag SM399 will be ON when block100 ...

Page 375: ...wer than 2 5V it will display 0 it means please change new battery at once otherwise the data will lose when PLC power off SD007 Power off memory data error type ID Function Description SD010 Current scan cycle 100us us is the unit SD011 Min scan time 100us us is the unit SD012 Max scan time 100us us is the unit SD013 Second clock 0 59 BCD code SD014 Minute clock 0 59 BCD code SD015 Hour clock 0 2...

Page 376: ...18 error info ID Function Description SD40 Flag of the executing process S ID Function Description SD100 Current segment No n segment HSC00 SD101 Current segment No n segment HSC02 SD102 Current segment No n segment HSC04 SD103 Current segment No n segment HSC06 SD104 Current segment No n segment HSC08 SD105 Current segment No n segment HSC10 SD106 Current segment No n segment HSC12 SD107 Current ...

Page 377: ... SD143 Free format communication receive result 0 correct 410 send data length overflow 411 receive data short 412 receive data long 413 receive error 414 receive overtime 415 no start character 416 no end character SD144 Free format communication receive data numbers In bytes there are no start and stop characters SD149 Serial port 1 SD150 Modbus read write instruction execution result 0 correct ...

Page 378: ...ceive overtime 180 CRC error 181 LRC error 182 station error 183 send buffer overflow 400 function code error 401 address error 402 length error 403 data error 404 slave station busy 405 memory error erase FLASH SD161 X Net communication result 0 correct 1 communication overtime 2 memory error 3 receive CRC error SD162 Free format communication send result 0 correct 410 free format send buffer ove...

Page 379: ...l be used when BLOCK monitors SD301 Executing instruction of BLOCK2 The value will be used when BLOCK monitors SD302 Executing instruction of BLOCK3 The value will be used when BLOCK monitors SD303 Executing instruction of BLOCK4 The value will be used when BLOCK monitors SD304 Executing instruction of BLOCK5 The value will be used when BLOCK monitors SD305 Executing instruction of BLOCK6 The valu...

Page 380: ...SD450 1 Watchdog act Default 200ms 2 Control block application fail 3 Visit illegal address SD451 Hardware error type 1 Register error 2 Bus error 3 Usage error SD452 Hardware error SD453 SD card error SD454 Power off time SD460 Extension module ID not match SD461 BD ED module ID not match SD462 Extension module communication overtime SD463 BD ED module communication overtime ID Function Descripti...

Page 381: ...rror types of module write SD920 Error times of module read Expansio n module 16 SD921 Error types of module read Module address error Module accepted data length error Module CRC parity error when PLC is accepting data Module ID error Module overtime error SD922 Error times of module write SD923 Error types of module write SD924 Error times of module read BD module 1 SD925 Error types of module r...

Page 382: ...ilter time SFD2 Watchdog run up time default value is 200ms I Mapping ID Function Description SFD10 I00 corresponds to X Input terminal 0 corresponds to X number 0xFF means terminal bad 0xFE means terminal idle SFD11 I01 corresponds to X SFD12 I02 corresponds to X SFD73 I77 corresponds to X Default value is 77 Octonary O Mapping ID Function Description SFD74 O00 corresponds to Y Output terminal 0 ...

Page 383: ...frequency times Ditto SFD330 Bit selection of HSC absolute and relative 24 segment bit0 corresponds to HSC0 bit1corresponds to HSC2 and so on bit9 corresponds to HSC18 0 relative 1 absolute SFD331 Interrupt circulating of 24 segments high speed counting bit0 corresponds to HSC0 bit1corresponds to HSC2 and so on bit9 corresponds to HSC18 0 single 1 loop SFD332 CAM function bit0 corresponds to HSC0 ...

Page 384: ...D509 SFD510 BD module configuration Configuration of BD Module 1 SFD519 SFD520 BD module configuration Configuration of BD Module 2 SFD529 SFD530 ED module configuration Configuration of ED Module 1 SFD539 Communication ID Function Note SFD600 COM1 free format communication buffer bit numbers 0 8 bit 1 16 bit SFD610 COM2 free format communication buffer bit numbers 0 8 bit 1 16 bit SFD620 COM3 fre...

Page 385: ...ming and pulse output Accurate timing High speed counting Pulse output XD2 16 XD3 16 XD5 16 XL3 16 ET0 ET2 ET4 ET6 ET8 HSC0 ET10 HSC2 ET12 HSC4 ET14 Y0 ET16 Y0 ET18 Y1 ET20 Y1 ET22 ET24 XD3 24 32 48 60 ZG3 30 ET0 ET2 ET4 ET6 ET8 ET10 ET12 HSC0 ET14 HSC2 ET16 HSC4 ET18 Y0 ET20 Y0 ET22 Y1 ET24 Y1 XD5 24 32 48 60 XDM 24 32 48 60 XD5E 30 60 XDME 60 XL5 32 XL5E 32 ET0 ET2 HSC6 ET4 HSC4 ET6 HSC2 ET8 HSC...

Page 386: ...a this table we can judge products type easily Selectable Not support Support Model USB 232 485 RJ45 Extension module Extension BD Left extension ED HSC channel Pulse output T RT External interruption Incremental mode AB phase XD1 series XD1 10 2 6 XD1 16 2 6 XD1 24 2 10 XD1 32 2 10 XD2 series XD2 16 2 1 3 3 2 6 XD2 24 2 1 1 3 3 2 10 XD2 32 2 1 1 3 3 2 10 XD2 48 2 2 1 3 3 2 10 XD2 60 2 2 1 3 3 2 1...

Page 387: ...4 10 XDM 60T10 1 1 16 2 1 10 10 10 10 XDC series XDC 24 2 16 1 1 4 4 2 10 XDC 32 2 16 1 1 4 4 2 10 XDC 48 2 16 2 1 4 4 2 10 Model USB 232 485 RJ45 Extension module Extension BD Left extension ED HSC channel Pulse output T RT External interruption Incremental mode AB phase XDC series XDC 60 2 16 2 1 4 4 2 10 XD5E series XD5E 24 1 2 16 1 1 3 3 2 10 XD5E 30 1 2 16 1 1 3 3 2 10 XD5E 48 1 2 16 2 1 3 3 ...

Page 388: ... 3 2 10 XL5 32T4 1 1 16 1 4 4 4 10 XL5E series XL5E 16 1 2 16 1 3 3 2 6 XL5E 32 1 2 16 1 3 3 2 10 XL5E 32T4 1 2 16 1 4 4 4 10 XL5E 64T6 1 2 16 1 6 6 6 10 XLME series XLME 32T4 1 2 16 1 4 4 4 10 Note 1 The XL1 16T with hardware version below H4 has only one RS232 port COM1 2 all models are equipped with clock function as standard ...

Page 389: ...388 WUXI XINJE ELECTRIC CO LTD 4th Floor Building 7 No 100 Dicui Road Wuxi China 214072 Tel 510 85134139 Fax 510 85111290 Email fiona xinje vip 163 com Web www xinje com ...

Reviews: