Summary of XC series PLC CONTENTS Preface ————————————— Chapter XC series Summary of XC series PLC Programmable controller ————————————— Operating Manual Spec., Input/output and layout V2.5 ————————————— Function of each device ————————————— Basic SFC instructions ————————————— Applied instructions ————————————— Special function —————————————...
Page 3
Summary of XC series PLC This manual includes some basic precautions which you should follow to keep you safe and protect the products. These precautions are underlined with warning triangles in the manual. About other manuals that we do not mention please follow basic electric operating rules.
Page 4
The programming of XC series programmable controller has the following characteristics: • Support two kinds of program languages In XC series PLC, besides statement format, you can also adopt ladder chart on the screen and these two formats could convert to the other.
Page 5
Summary of XC series PLC 1. Summary of XC series PLC XC series PLC are mini type PLC with powerful function. These series products can satisfy diverse control requirement. With compact design excellent extend capability, cheap price and powerful function, XC series PLC has become perfect solution of small size control.
Page 6
Summary of XC series PLC 1-1. Summary of XC series PLC and program format XC series programmable controller Introduction I/O 14~60 points FlashROM memory inside Real time clock: With clock inside, Li battery power drop memory Multi-COM ports can connect with inverters, instruments, printers etc.
Page 7
Summary of XC series PLC 1-2. XC series PLC’s Model and Type XC Series Main Units Series Name XC1 series, XC3 series and XC5 series I/O points Input Format(NPN) R: Relay output T: Transistor output RT: Mix output of Transistor /Relay (Y0, Y1 are transistor)
Page 8
Summary of XC series PLC XC3 series models: Model AC Power DC Power Input Output Relay Output Transistor Mix output Relay Output Transistor Mix output (DC24V) (R, T) Output (R&T) Output (R&T) XC3-14R-E XC3-14T-E XC3-14RT-E XC3-14R-C XC3-14T-C XC3-14RT-C 8 points...
Page 9
Summary of XC series PLC Digital I/O Expansions 1. Series name 2. E: Expansion 3. Input points 4. X: Input 5. Output points 6. Output format YR: Relay output YT: Transistor output Model Input Output Input elay Output Transistor points...
Page 10
Summary of XC series PLC 1-3. Expansion’s constitution and ID assignment • XC series PLC can be used independently or used along with Expansion the expansions. The following is the chart of a basic unit with seven expansions. • Digital Input/Output quantity is Octal Constitution •...
Page 11
Summary of XC series PLC Max points/ Unit Type ID(As register) Channels Assignment Input switch quantity X X100~X137 32 points Output switch quantity Y Y100~Y137 32 points Expansion Input analog quantity ID ID100~ID131 16 channels Output analog quantity QD QD100~QD131 16 channels Module’s set value D...
Summary of XC series PLC 1-4. General Specification General Specification Items Specifications Insulate voltage Up to DC 500V 2MΩ Anti-noise 1000V 1uS pulse per minute Ambient 0°C~60°C temperature Ambient humidity 5%~95% COM 1 RS-232, connect with host machine, HMI program or debug...
Page 13
Summary of XC series PLC Performance XC3 series: Specification Item 14 points 24/32 points 48/60 points Program executing Loop scan format, time scan format format Program format Both statement and ladder Dispose speed 0.5us Power cut retentive Use FlashROM and Li battery User program’s capacity...
Page 14
Summary of XC series PLC 1-5. Shape and Size Exterior Size XC1 series 16 points main units XC3 series 14 points main units (Including 16 points expansions) XC1 series 32 points main units (Including 24 points main units) XC3 series 24 / 32 points main units (Including 32 points expansions) XC5 series 32 points main units 73.3...
Page 15
Summary of XC series PLC XC3 series 60 points main units (Including 48 points main units) XC5 series 60 points main units (Including 48 points main units) 207.4 199.4 73.3 CO M CO M PW R XC3- 60R- E PO RT1...
Page 16
Summary of XC series PLC 1-6. Terminal arrangement Main Units 1. Input terminals 2. BD expansion 3. Input label 4. COM port 5. COM port 6. COM port’s cover door 7. Output label 8. Output terminals 9. Screws 10. Input indicate LED 11.
Page 17
Summary of XC series PLC XC3- 60 main units, XC5- 60 main units: 36 Input/24 Output CAN+ CAN- COM 5 COM 7 COM 0 COM 1 COM 2 COM 3 COM 4 COM 6 COM 8 XC3- 48 main units, XC5- 48 main units: 28 Input /20 Output...
Page 18
Summary of XC series PLC Expansions XC-E8X8YR CO M CO M CO M 3 CO M 0 CO M 1 CO M 2 XC-E16X CO M CO M XC-E16YR CO M 3 CO M 0 CO M 1 CO M 2...
Page 19
Summary of XC series PLC 1-7. COM Port Definition Pin of COM 1 COM 1 2: PRG 4: RxD 5: TxD 备注 6: VCC 8: GND Mini Din 88 core socket (hole) Pin of COM 2 COM 2 4: RxD...
Page 21
2-1. Power Specification For the power specification of XC series programmable controller’s basic units, please see the following table: Rated voltage AC100V~240V AC Power Voltage allow bound AC90V~265V Type Rated frequency 50/60Hz Allow momentary Interrupt time≤0.5 AC cycle, alternation≥1 sec...
Page 22
Spec., Input/output and layout 2-2. AC Power, DC Input Type Constitution Connection · • The Input power is connected between L and N terminals. • 24+, COM terminals can be used to power 400mA/DC24V for sensor · supply. Besides, this terminal can’t be connected to external power. •...
Page 23
Spec., Input/output and layout 2-3. Input Specification Basic Units Input signal’s DC24V±10% voltage Input signal’s 7mA/DC24V current Input ON current Up to 4.5mA Input OFF current Low than 1.5mA Input response time About 10ms Input signal’s Contact input format NPN open collector transistor Circuit insulation Photo-electricity...
Page 24
Spec., Input/output and layout 2-4. DC Input Signal’s Disposal(AC Power Type) DC input signal Input terminal When connect input terminal and COM terminal with contacts without voltage or NPN open collector transistor, if input is ON,LED lamp lights, which indicates input。 There are many terminals to connect in PLC.
Page 25
Spec., Input/output and layout XC series PLC’s input power is supplied by its interior 24V power,so if Exterior use exterior power to drive photoelectricity sensor etc., this exterior power should be DC24V±4V,please use NPN open collector type for sensor’s output transistor...
Page 26
Spec., Input/output and layout 2-5. Output Specifica tion Relay output Interior power low AC250V, DC30V Circuit insulation Mechanism insulat Action deno LED indicate la Resistant load load Induce load 80VA Lamp load 100W Open circuit’s leak current Mini load DC5V 2mA Response OFF→ON 10ms...
Page 27
Spec., Input/output and layout 2-6. Disposal of Relay Output Circuit Relay output circuit Output terminals Relay output type includes 2~4 public terminals. So each public-end unit can drive different power-voltage system’s (E.g.:AC200V,AC100V,DC24V etc.) load. Circuit’s insulation Between the relay output coils and contacts,PLC’s interior circuits and exterior circuits, load circuits are electric insulation.
Page 28
Spec., Input/output and layout Constitution For DC induce load, please parallel connect with commutate diode. of output If not connect with the commutate diode, the contact’s life will be circuit decreased greatly. Please choose the commutate diode which allow inverse voltage endurance up to 5~10 times of the load’s voltage, ordinal current exceeds load current.
Page 29
Spec., Input/output and layout 2-7. Disposal of Transistor Output Circuit Transistor output circuit Output terminal Basic unit’s transistor output has 1~4 public-end output. Exterior power Please use DC5~30V steady-voltage power for load drive, Circuit insulation Use photoelectricity coupling device to insulate PLC’s interior circuit and output transistor.
Page 31
. Each Soft Unit’s Usage and Function T his chapter, we’ll give some description of the PLC’s data and the function of interior input/output relay, auxiliary lay, status, counter, data register etc. This item is the base to use PLC. 3-1.Every Soft Unit of PLC 3-2.Soft Unit’s ID List 3-3.Disposal of Data...
Function of each device 3-1. Every Soft Unit of Programmable Controller In the programmable controller, there are many relays、timers and counters,they all have countless “a” contacts ( Normally open contacts) and “b” contacts ( Normally closed contacts) , Connect these contacts and coils to constitute sequencial control circuit. The following, we’ll briefly introduce each soft unit: 【Input(X)and output(Y)relay】...
Page 33
PLC’s scan cycle. 【Data register(D) 】 Data register is the soft unit used by data register to save data. XC series PLC’s data registers are all 16 bits (The high bit is the sign bit), Combine two registers can carry on 32 bits data disposal (The high bit is the sign bit).
Page 34
Function of each device 3-2. Device’s ID List For the allocate of device’s ID, please see the following list: Besides, when connect input / output expansions and special expansions on the basic units, for the input / output relay’s No., please refer to the user manual. Bound points Mnemonic...
Page 35
Function of each device NOTE: ※1. The memorizer area in 【 】 is the defaulted power failure retentive area;soft elements D、 M、 S、 T、 C can be set to change the power failure retentive area. For the details, please see the following table ※2.
Page 36
Hex. Data.). 《OCT》 (OCT:OCTAL NUMBER) The input relay, output relay’s soft units’ ID of XC series PLC are allocate in the format of OCT data. So, it can go on carry of [1-7,10-17, . . .70-77,...
Page 37
Function of each device 3-4. Some encode principles of device 1、Data register could be used as offset(indirect assignment) Format:Dn[Dm]、Xn[Dm] 、Yn[Dm] 、Mn[Dm] etc. M8002 M8000 D10[D0] D100 Y0[D0] In the preceding example, when D0=0, then D100=D10, Y0 is ON; When M2 turns from OFF to be ON, D0=5, then D100=D15, Y5 is ON. When D10[D0]=D[10+D0], Y0[D0]=Y[0+D0].
Page 38
Function of each device 3、 Bit of word device Format:Dn.m Register could carry on bit searching address, e.g. Dn.m means number “m” bit of Dn data register(0≤m≤15) 。 D0.4 D5[D1].4 In the preceding example, D0.4 means when the No.4 bit of D0 is 1, Y0 set ON; D5[D1].4 means bit searching address with offset, if D1=5,it says D5[D1] means the number 4 bit of D10.
Page 39
Function of each device 3-5. Timer’s Number and Function [T] Please see the following table for the timer’s [T] number (the Timer’s number number is assigned according to Hex.) 100ms not accumulated(16 bits) T0~T99 100ms accumulated(16 bits) T100~T199 10ms not accumulated(16 bits) T200~T299 10ms accumulated(16 bits) T300~T399...
Page 40
Function of each device 《Constant assignment (K)》 T10 is a timer with the unit of Assign 100ms. Assign 100 as a constant, method of K100 then 0.1s×100=10s timer work. the set value 《Indirect assignment (D)》 Write content in indirect data register to program or input via data switch.
Page 41
Function of each device 3-6. Counter’s ID and function [C] For the counter’s number (C), ple ase refe r to the following table: Counter’s ID 16 bits positive counter C0~C C300~C598 (C300, C302...C598) (Each one 32 bits positive/negative engrosses 2 counter No.) The number must be counter even.
Page 42
Function of each device About the assignment of normally used counter and power failure retentive counter, they could be changed in the method of changing FD parameters’ Function settin via the peripheral device. 16 bits binary increment counter, its valid setting value is K1~K32,767 (Decimal constant).
Page 43
Function of each device For 32 bits binary increment counter, its valid bound is K1~K2,147,483,647 (Decimal constant). With special auxiliary relay M8238, assign the direction of bits positive/negative counter’s (C300~C498) direction If X2 drives M8238, then it is negative count; If no drive, then it is positive count.
Page 44
Function of each device 32 bits counter 《Constant assignment(K) 》 X001 C300 K43,100 《Indicate assignment(K) 》 X000 DMOV K43100 X001 C300 D0 ( D1 ) The count The count mode of counters T0~T599 is 16 bits linear increment mode (0~K32767). When counter’s count value reaches the max value K32767, the value counter will stop counting, the counter’s status will remain.
Page 45
Function of each device 3-7. Some Points to Note 《 Action order of input/output relay and response delay》 Input disposal Before PLC executing the program, read all the input terminal’s ON/OFF status of PLC to the image area. In the process of executing the program, even the input changed, the content in the input image area will not chang e.
Page 46
Basic Program Instructions In this chapter, we tell some basic instructions and their functions. 4-1.List of Basic Instructions 4-2. 【LD】,【LDI】,【OUT】 4-3. 【AND】,【ANI】 4-4. 【OR】,【ORI】 4-5. 【LDP】,【LDF】,【ANDP】,【ANDF】,【ORP】, 【ORF】 4-6.Compare Instructions 4-7. 【ORB】 4-8. 【ANB】 4-9. 【MCS】,【MCR】 4-10. 【ALT】 4-11. 【PLS】, 【PLF】 4-12....
Basic SFC Functions 4-1. List of Basic Instructions XC1, XC3, XC5 series basic SFC instructions Mnemonic Function Format and Device Initial logical operation contact X, Y, M, S, T, C, Dn.m, FDn.m (LoaD) type NO (normally open) Initial logical operation contact X, Y, M, S, T, C, Dn.m, FDn.m (LoaD Inverse) type NC (normally closed)
Page 48
Basic SFC Functions Connect the public serial contacts None (New bus line start) Clear the public serial contacts None (Bus line return) The status of the assigned device X, Y, M, S, T, C, Dn.m (Alternate state) is inverted on every operation of the instruction No operation or null step None...
Page 49
Basic SFC Functions 4-2. 【LD】,【LDI】,【OUT】 Mnemonic Function Format and Devices Mnemonic Initial logic operation contact type NO (Normally (LoaD) Open) evice : X, Y, M, S, T, C, Dn.m, FDn.m Initial logic operation contact type NC (Normally (LoaD Inverse) Closed) evice : X, Y, M, S, T, C, Dn.m, Dn.m...
Page 50
Basic SFC Functions Y100 Program Y100 M1203 M120 -3. 【AND】,【ANI】 Mnemonic Function Format and Devices Serial connection of Mnemonic (AND) NO (Normally Open) contacts Devices : X, Y, M, S, T, C, Dn.m, FDn.m Serial connection of (ANd Inverse) NC (Normally Closed) contacts Devices : X, Y, M, S, T, C, Dn.m, FDn.m...
Page 51
Basic SFC Functions 4-4. 【OR】,【ORI】 Mnemonic Function Format and Devices Mnemonic Parallel connection of (OR) NO (Normally Open) Function contacts Devices: X, Y, M, S, T, C, Dn.m, FDn.m Parallel connection of (OR Inverse) NC (Normally Closed) contacts Devices: X, Y, M, S, T, C, Dn.m, FDn.m Use the OR and ORI instructions for parallel connection of contacts.
Page 52
Basic SFC Functions Y6 M4 X7 M100 The parallel connection with Relationship OR, ORI instructions should with ANB connect with instructions in principle. But after the ANB instruction, it’s available to add a LD or LDI instruction. 4-5. 【LDP】,【L 【AND P】,【ANDF】,【OR 】...
Page 53
Basic SFC Functions Mnemonic Function Format and Devices Mnemonic Initial gical (LoaD Pulse) operation-Rising edge Function pulse Devices: X, Y, M, S, T, C, Dn.m, FDn.m Initial logical (LoaD Falling operation pulse) Falling/trailing edge pulse Devices: X, Y, M, S, T, C, Dn.m, FDn.m ANDP Serial connection of (AND Pulse)
Page 54
Basic SFC Functions Output drive In two conditions, when X0 turns from OFF to ON, M20 gets a scan cycle. NOTE: When X10 turns from OFF to ON, only execute once MOV instruction. When X10 turns from OFF to ON, each scan cycle execute once MOV instruction.
Page 55
Basic SFC Functions 4-7. 【ORB】 Mnemonic Mnemonic Function Format and Devices Parallel connection of Function (OR Block) multiply parallel circuits Devices: none To declare the starting point of the circuit (usually serial circuit blocks) Description to the preceding circuit in parallel. Serial circuit blocks are those in which more than one contacts in series or the ANB instruction is used.
Page 56
Basic SFC Functions 4-8. 【ANB】 Mnemonic Function Format and Devices Mnemonic Serial connection (ANd Block) multiply parallel circuits Devices: none To declare the starting point of the circuit block, use a LD or LDI Description instruction. After completing the parallel circuit block, connect it to the preceding block in series using the ANB instruction.
Page 57
Basic SFC Functions 4-9. 【MCS】,【MCR】 Function Format and Devices Mnemonic Mnemonic Denotes the start (Master control) of a master control block Devices None Denotes the end of (Master control a master control Reset) block Devices None After the execution of an MCS instruction, the bus line (LD、 LDI) shifts Description to a point after the MCS instruction.
Page 58
Basic SFC Functions 4-10. 【ALT】 Mnemonic Function Format and Devices Mnemonic The status of the assigned (Alternate devices inverted on every Function status) operation of the instruction Devices: Y, M, S, T, C, Dn.m The status of the destination device is alternated on every operation of the Description ALT instruction.
Page 59
Basic SFC Functions 4-11. 【PLS】,【PLF】 Mnemonic Function Format and Devices Mnemonic Rising edge pulse (PuLSe) Function Devices: Y, M, S, T, C, Dn.m Falling/trailing edge pulse (PuLse Falling) Devices: Y, M, S, T, C, Dn.m When a PLS instruction is executed, object devices Y and M operate for one operation cycle after the drive in ut signal has turned ON.
Page 60
Basic SFC Functions 4-12. 【SET】,【RST】 Function Mnemonic Format and Devices Mnemonic Set a bit device permanently (SET) Function Devices: Y, M, S, T, C, Dn.m Reset device (ReSeT) permanently OFF Devices: Y, M, S, T, C, Dn.m Turning ON X010 causes Y000 to turn ON. Y000 remains ON even after X010 turns OFF.
Page 61
Basic SFC Functions 4-13. 【OUT】,【RST】for the counters Mnemonic Function Format and Devices Mnemonic Final logic operation type (OUT) coil drive Function K or D Reset device (ReSeT) permanently OFF C0 carries on increase count for the OFF→ON of X011. When reach the Programming value K10, output contact C0 activates.
Page 62
Basic SFC Functions 4-14. 【NOP】,【END】 Mnemonic Function Format and Devices: None operation or null step Operation) Devices: None Force (END) current program scan Devices: None to end When clear the whole program, all the instructions become NOP. If add Description NOP instructions between the common instructions, they have no effect and PLC will keep on working.
Page 63
Basic SFC Functions 4-15. Items To Note When Programming , Contacts’ structure and step number Even in the sequencial control circuit with the same action, it’s also available to simple the program and save program’s steps according to the contacts’ structure. General program principle is: a)write t he circuit with many serial contacts on the top;b)write the circuit with many parallel contacts in the...
Applied Instructions 5. Applied Instructions In this chapter, we describe applied instruction’s function of XC series PLC. 5-1.Table of App lied Inst ructions 5-2.Reading Meth od of Applied Instructions 5-3.Flow Instructions 5-4.Contactors Co mpare Instructions 5-5.Move and Co mpare I nstructions 5-6.Arithmetic an...
Page 65
Applied Instructions 5-1. Applied Instruction List The applied instructions’ sort a nd thei r correspond instructions are listed i n the follow ing table: Common statements of XC1/ XC3/X Sort Mnemonic Function ndition jum CALL all subroutin SRET Subro utine re turn Flow start STLE...
Page 66
Applied Instructions The high and low byte of the destinated devices SWAP are exchanged Exch ange Addi tion Subtraction Mult iplication Division Increment Data Decrement Operation MEAN Mean WAND Word And Word OR WXOR Word exclusive OR Compliment Negative...
Page 67
Applied Instructions Common statements of XC3/XC5 Arithmetic Shift Left Arithmetic Shift Right Logic shift left Logic shift right Rotation shift left Data Shift Rotation shift right SFTL Bit shift left SFTR Bit shift right WSFL Word shift left WSFR Word shift right Single word integer converts to double word integer 32 bits integer converts to float point FLTD...
Page 68
Applied Instructions 5-2. Reading Method of Applied Instructions nderstanding method of instruction understanding this manual, the applied instructions are described in the following manner. Note: ① Denote the instruction name ② 16 bits instruction and 32 bits instruction ③ Denotes the soft units which can be used as the operation object ④...
Page 69
Applied Instructions The assignment of the data The related The data register of XC series PLC is a single word (16 bit) data register, single word data only engross one data register which is assi gned by singl e word description object instruction.
Page 70
Applied Instructions Instructions list of 16 bits and correspond 32 bits: 16 bits 32 bits 16 bits 32 bits CALL DFLT SRET DINT DBIN DBCD Program S LE ta convert Flow DECO NEXT ENCO FEND ENCOL DMOV ECMP BMOV EZCP FMOV EADD Data Move...
Page 71
Applied Instructions 5-3. Program Flow Instructions Mnemonic Instruction’s name Condition Jump CALL Call subroutine SRET Subroutine return Flow start STLE Flow end Open the assigned flow, close the current flow (flow jump) Open the assigned flow, not close the current flow (Open the new flow) Start of a FOR-NEXT loop NEXT...
Page 72
Applied Instructions Condition Jump [CJ] Suitable Models: XC1、XC3、XC5 16 bits instruction:CJ 32 bits instruction:- Pointer: P Soft Unit’s Bound: P0~P9999 As the instructions of executing list, with CJ instructions, the operate cycle and Function dual coil can be greatly shorten. In the following chart, if X000“ON”, then jump from step 1 to the end step of and Action flag P6.
Page 73
Applied Instructions [CALL] [SRET] Call subroutine and Subroutine return Suitable Models: XC1、XC3、XC5 16 bits instruction:CALL、SRET 32 bits instruction:- Pointer: P Soft Unit’s Bound: P0~P9999 CALL Function FEND SRET If X000“ON”, carry on Jump instruction and jump to step of flag P10. Here, after executing the subroutine, return to the original step via executing SRET instruction.
Page 74
Applied Instructions Flow [SET]、[ST] 、[STL]、 [STLE] Suitable Models: XC1、XC3、XC5 16 bits instruction: SET、 ST、 STL、 STLE 32 bits instruction:- Pointer: S Soft Unit’s Bound: S0~S Function STL S0 STLE STL S1 STLE STL S2 STLE STL and STLE should be used in pairs. STL means start of a flow, STLE means end of a flow.
Page 75
Applied Instructions [FOR] AND [NEXT] Suitable Models: XC1、XC3、XC5 16 bits instruction:FOR、NEXT 32 bits instruction:- D· D· Word Device Dn.m Device First execute the instructions between FOR~NEXT instructions for several times Function (the loop time is assigned by the source data), then execute the steps after NEXT. S·...
Page 76
Applied Instructions [FEND] AND [END] Suitable Models: XC1、XC3、XC5 6 bits instruction:FEND、END 32 bits instruction:- None n FEND instruction indicates the first end of a main program and the start of the ogram area to be used for subroutines. Under normal operating circumstanc es the Function ND instruction performs a similar action to the END instruction, i.e.
Page 77
Applied Instructions 5-4. Contactor’s Compare Instructions Mnemonic & Function Mnemonic Function LD= Initial comparison contact. Active when the comparison (S1)=(S2) is true. LD> Initial comparison contact. Active when the comparison (S1)> (S2) is true LD< Initial comparison contact. Active when the comparison (S1)< (S2) is true LD<>...
Page 78
Applied Instructions LD □ nitial Comparison Suitable Models: XC1、XC3、XC5 16 bits instruction:Refer Below 32 bits instruction:Refer Below S1· S2· Word Device Dn.m Device Instruction & Function The value of S1 and S2 are tested according to the comparison of the instruction. If the comparison is ue then the LD contact is active.
Page 79
Applied Instructions When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1, Note Items use the data as a negative. The comparison of 32 bits counter (C300~) must use 32 bits instruction. If assigned as 16 bits instruction, it will lead the program error or operation error.
Page 80
Applied Instructions S1· S2· AND= K100 AND> K-30 DAND> K68899 When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1, Note Items use the data as a negative. The comparison of 32 bits counter (C300~) must use 32 bits instruction. If assigned as 16 bits instruction, it will lead the program error or operation error.
Page 81
Applied Instructions OR □ Parallel Compar ision Suitable Models: XC1、XC3、XC5 16 bits instruction:Refer Below 32 bits instruction:Refer Below S1· S2· Word Device Dn.m vice Instruction & Function he valu e of S1 and S2 are tested ac cording to the instruction. If the comparison is true then the AND ontact is active.
Page 82
Applied Instructions 5-5. Data Move Mnemonic Function Move BMOV Block Move FMOV Fill Move FWRT Written of FlashROM MSET Zone Set ZRST Zone Reset Float To Scientific Exchange...
Page 83
Applied Instructions Suitable Models: XC1、XC3、XC5 16 bits instruction:MOV 32 bits instruction:DMOV S· Word Device D· Dn.m Device Function & Action S· D· Move data from one storage area to a new one. Move contents from source to destination If X000 is OFF, data will not change. Constant K10 will automatically convert to be BIN code.
Page 84
Applied Instructions [BMOV] Suitable Models: XC1、XC3、XC5 16 bits instruction:BMOV 32bits instruction:- S· Word Device D· Dn.m Device Function A quantity of consecutively occurring data elements can be copied to a new destination. The source data is identified as a device head address(S) and a quantity of consecutive data elements (n).
Page 85
Applied Instructions [FMOV] Suitable Models: XC1、XC3、XC5 16 bits instruction:FMOV 32 bits instruction:- S· Word Device D· Dn.m Device S· D· Function FMOV Move K0 to D ~D9. Copy a single data device to a range of destination devices. The data stor ed in the source device (S) is c opied to every device within the destination range, The range is specified by a device head address (D) and a quantity of consecutive elements (n).
Page 86
Applied Instructions [FWRT] Suitable Models: XC1、XC3、XC5 16 bits instruction:FWRT 32 bits instruction:DFWRT S· Word Device D· Dn.m Device 1, Written of a word Function S· D· FWRT Function:write value in D0 into FD0 2, Written of double word S· D· DFWRT Function:write value in D0、D1 into FD0、FD1 3, Written of multi-word...
Page 88
Applied Instructions WAP] Suitable Models: XC1、XC3、XC5 16bits instruction:SWAP 32 bits instruction:- S· Word Device Dn.m Device Function High 8 bits Low 8 bits Low 8 bits and high 8 bits change when it is 16 bits instruction. If the instruction is a consecutive executing instruction, each operation cycle should change.
Page 90
Applied Instructions 5-6. Data Operation Instructions Mnemonic Function Addition Subtraction Multiplication Division Increment Decrement MEAN Mean WAND Logic Word And Logic Word Or WXOR Logic Exclusive Or Compliment Negation...
Page 91
Applied Instructions Addition Operation [A Suitable Models: XC1、XC3、XC5 16 bits instruction:ADD 32 bits instruction:DADD Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device S1· S2· D· Function ( D10 )+( D12 )→( D14 ) The data contained within the two source devices are combined and the total is stored in the specified destination device.
Page 92
Applied Instructions Suitable Models: XC1、XC3、XC5 16 bits instruction:SUB 32 bits instruction:DSUB Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device S1· S2· D· Function ( D10 )—( D12 )→( D14 ) point th soft unit’s content, subtract the soft unit’s content appointed by in the S2·...
Page 95
Applied Instructions [INC] & [DEC] Suitable Models: XC1、XC3、XC5 16 bits instruction:INC、DEC 32 bits instruction:DINC、DDEC Zero M8020 D· Word Borrow M8021 Device Carry M8022 Dn.m Device Function & Action 1、Increment [INC] D· ( D0 )+ 1 → (D0) On every execution of the instruction the device specified as the destination D·...
Page 96
Applied Instructions [MEAN] Suitable Models: XC1、XC3、XC5 16 bits instruction:MEAN 32 bits instruction:- Zero M8020 S· Word Borrow M8021 Device D· Carry M8022 Dn.m Device Function & Action S· D· MEAN (D0) (D1) (D2) (D10) The value of all the devices within the source range is summed and then divided by the number of devices summed, i.e.
Page 97
Applied Instructions [WAND]、 [WOR] & [WXOR] Suitable Models: XC1、XC3、XC5 16 bits instruction:WAND、WOR 32 bits instruction:DWAND、DWOR Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device Function & Action Execute logic AND operation with each bit S1· S2· D·...
Page 98
Applied Instructions [CML] Suitable Models: XC1、XC3、XC5 16 bits instruction:CML 32 bits instruction:DCML S· Word Device D· Dn.m Device Function & Action S· D· A copy of each data bit within the source device is inverted and then moved to the designated destination.
Page 99
Applied Instructions [NEG] Suitable Models: XC1、XC3、XC5 1 6 bits instruction:NEG 32 bits instruction:DNEG D· Word Device Dn.m Device Functio n & A ction D· (D10) +1 (D10) The bit format of the selected device is inverted, I.e. any occurrence of a “1’ becomes a “0”...
Page 100
Applied Instructions 5-7. Shift Instructions Mnemonic Function Arithmetic shift left Arithmetic shift right Logic shift left Logic shift right Rotation left Rotation right SFTL Bit shift left SFTR Bit shift right WSFL Word shift left WSFR Word shift right...
Page 101
Applied Instructions [SHL] & [SHR] Suitable Models: XC3、XC5 16 bits instruction:SHL、SHR 32 bits instruction:DSHL、DSHR D· Word Device Dn.m Device 《Arithmetic shift left》 Function & After once execution, the Action low bit is filled in 0, the final bit is stored in carry flag.
Page 102
Applied Instructions [LSL] & LSR] Suitable Models: XC3、XC5 16 bits instruction: 32 bits instruction:DLSL、DLSR D· Word Device Dn.m Device Function & Action 《Logic shift left》 After once execution, the low bit is filled in 0, the final bit is stored in carry flag.
Page 103
Applied Instructions [ROL] & [ROR] Suitable Models: XC3、XC5 16 bits instruction:ROL、ROR 32 bits instruction:DROL、DROR D· Word Device Dn.m Device Function & Action The bit format of the destination device is rotated n bit places to the left on every operation of the struction 《Rotation shift left》...
Page 104
Applied Instructions [SFTL] & [SFTR] Suitable Models: XC3、XC5 16 bits instruction:SFTL、SFTR 32 bits instruction:DSFTL、DSFTR n1 n2 Word Device S· Dn.m Device D· Function & Action The instruction copies n2 source devices to a bit stack of length n1. For every new addition of n2 bits, the existing data within the bit stack is shifted n2 bits to the left/right.
Page 105
Applied Instructions [WSFL] & [WSFR] Suitable Models: XC3、XC5 16 bits instruction:WSFL、WSFR 32 bits instruction:DWSFL、DWSFR n1 n2 S· Word Device D· Dn.m Device Function & Action The instruction copies n2 source devices to a word stack of length n1. For each addition of n2 words, the existing data within the word stack is shifted n2 words to the left/right.
Page 106
Applied Instructions -8. Data Convert Mnemonic Function Single word integer converts to double word integer 32 bits integer converts to float point FLTD 64 bits integer converts to float point Float point converts to integer BCD convert to binary Binary converts to BCD Hex.
Page 107
Applied Instructions [WTD] Suitable Models: XC3、XC5 16 bits instruction:WTD 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action S· D· (D0) → (D11,D10) Single Word Double Word 0 or 1 High bits Low bits When single word D0 is positive integer, after exe ing this instruction, the high bit of double word D10 is 0.
Page 109
Applied Instructions [INT] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:INT S· Word Device D· Dn.m Device Function & Action 《16 位》 S· D· ( D11,D10 ) → (D20) Binary Floating BIN integer Give up the data after the decimal dot 《32 位》...
Page 110
Applied Instructions [BIN] Suitable Models: XC3、XC5 16 bits instruction:BIN 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action S· D· Convert and move instruction of Source (BCD) → destination (BIN) When source data is not BCD code, M8067(Operation error) , M8068 (Operation error lock) will not work.
Page 111
Applied Instructions [BCD] Suitable Models: XC3、XC5 16 bits instruction:BCD 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action Convert and move instruction of source (BIN)→destination (BCD). S· D· This instruction can be used to output data directly to a seven-segment display.
Page 112
Applied Instructions [ASCI] Suitable Models: XC3、XC5 16 bits instruction:ASCI 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action 《16 bits convert mode》 S· D· ASCI D100 D200 Convert each bit source’s (S) Hex. format data to be ASCII code, move separately to the high 8 bits and low 8 bits of destination (D).
Page 113
Applied Instructions [HEX] Suitable Models: XC3、XC5 16 bits instruction:HEX 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action 《16 bits switch mode》 S· D· D200 D100 Convert the gh and low 8 bits in source to HEX data. Move 4 bits every time to destination.
Page 114
Applied Instructions [DECO] Suitable Models: XC3、XC5 16 bits instruction:DECO 32 bits instruction:- S· Word Device Dn.m Device D· Function & Action 《 When is software unit》 n≤16 D· S· D· DECO X002 X001 X000 ① ② ③ The source address is 1+2=3,so starts from M10, the number 3 bit (M13) is 1. If the source are all 0, M10 is 1 When n=0, no operation, beyond n=0~16, don’t execute the instruc on.
Page 115
Applied Instructions [ENCO] Suitable Models: XC3、XC5 6 bits instruction:ENCO 32 bits instruction:- S· Word Device D· Dn.m Device S· Funct ion & A ction 《 When is bit device》 n≤16 S· S· D· ENCO ③ ② ① All be 0 《...
Page 116
Applied Instructions [ENCOL] Suitable Models: XC3、XC5 16 bits instruction 32 bits instruction:- :ENCOL S· Word Device D· Dn.m Device S· Function & Action 《 If is bit device》 n≤16 S· S· D· ENCOL ③ ② ① All be 0 是字软元件时》 n≤16 《...
Page 117
Applied Instructions 5-9. Floating Operation Mnemonic Function ECMP Float Compare EZCP Float Zone Compare EADD Floa Add ESUB Float Subtract EMUL Float Mu ltiplication EDIV Float Division ESQR Float Square Root Sine Cosine Tangent...
Page 119
Applied Instructions [EZCP] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:ECMP S1· S2· S3· Word Device S1· S2· S3· Dn.m Device D· Function & Action Compare a float range with a float value. S1· S2· D1· D2· EZCP (D20, D21) >...
Page 120
Applied Instructions [EADD] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EADD S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EAAD ( D11,D10 ) (D21,D20) → (D51,D50) Binary Floating Binary Floating Binary Floating The floating point values stored in the source devices S1 and S2 are algebraically added and the result stored in the destination device D.
Page 121
Applied Instructions [ESUB] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:ESUB S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· ESUB (D11,D10) (D21,D20) → (D51,D50) - Binary Floating Binary Floating Binary Floating The floating point value of S2 is subtracted from the floating point value of S1 and the result stored in destination device D.
Page 122
Applied Instructions [EMUL] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EMUL S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EMUL ( D11 , D10 ) × ( D21,D20 ) → (D51,D50) Binary Floating Binary Floating Binary Floating The floating value of S1 is multiplied with the floating value point value of S2.
Page 123
Applied Instructions [EDIV] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EDDIV S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EDIV ( D11,D10 )÷( D21,D20 )→( D51,D50 ) Binary Floating Binary Floating Binary Floating The floating point value of S1 is divided by the floating point value of S2.
Page 124
Applied Instructions [ESQR] Suitable Models: XC3、XC5 16 bits instruction: 32 bits instruction :ESQR S· S· Word Device D· Dn.m Device Function & Action S· D· (D11,D10) →( D21,D20 ) ESQR Binary Floating Binary Floating A square root is performed on the floating point value in 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 addition operation.
Page 125
Applied Instructions S· S· Word Device D· Dn.m Device Function & Action S· D· (D51,D50) → (D61,D60)SIN Binary Floating Binary Floating This instruction performs the mathematical SIN operation on the floating point value in S (angle RAD). The result is stored in D. RAD value (angle ×π...
Page 126
Applied Instructions S· S· Word Device D· Dn.m Device Functi on & Ac tion S· D· (D51,D50)RAD → (D61,D60)COS Binary Floating Binary Floating This instruction performs the mathematical COS operation on the floating point value in S (angle RAD). The result is stored in D. RAD value (angle ×π...
Page 127
Applied Instructions S· S· Word Device D· Dn.m Device Function & Action S· D· (D51,D50)RAD → (D61,D60)TAN Binary Floating Binary Floating This instruction performs the mathematical TAN operation on the floating point value in S. The result is stored in D. RAD value (angle ×π...
Page 128
Applied Instructions 5-10. Clock Operation Mnemonic Function TCMP Time Compare TZCP Time Zone Compare TADD Time Add TSUB Time Subtract Read RTC data Set RTC data :The models without clock can not use these instructions.
Page 129
Applied Instructions Time Compare [TCMP] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S1· S2· S3· Word Device S· Dn.m Device D· Function & Action Compare the assigned time with time data. The status of the destination devices is kept, even if the TCMP instruction is deactivated. S2·...
Page 130
Applied Instructions [TZCP] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S1· S2· S3· Word Device Dn.m Device D· Function & Action Compare the two assigned time with time data The status of the destination devices is kept, even if the TCMP instruction is deactivated. Compare the 3 clock data start from with the two ends on the clock compare bound, S·...
Page 133
Applied Instructions [TRD] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV D· Word Device Dn.m Device Function & Action The current time and date of the real time clock are read and stored in the 7 data D· devices specified by the head address D. Read PLC’s real time clock according to the following format.
Page 134
Applied Instructions [TWR] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S· Word Device Dn.m Device Function & Action S· The 7 data devices specified with the data devices specified with the head address S are sed to set a ne Write th e set clo ck data into PLC’s real time clock.
Page 135
Applied Instructions 5. Applied Instruction s In this chapter, we describe applied instruction’s function of XC series PL 5-1.Table of Appl ied Instru ctions 5-2.Reading Met hod of A pplied Instructions 5-3.Flow Instructions 5-4.Contactors Compare Instructions 5-5.Move and Compare Instructions 5-6.Arithmetic and Logic Operation Instructions 5-7.Loop and Shift Instructions 5-8.Data Convert...
Page 136
Applied Instructions 5-1. Applied Instruction List The applied instructions’ sort and their correspond instru ctions are listed in the following table: Common statements of XC 1/XC3/XC5: Sort Mnemonic Function Conditio n jump CALL Call subroutine SRET Subroutine return Flow start STLE Flow end Open the assigned flow, close the curre...
Page 137
Applied Instructions The high and low byte of the destinated devices SWAP are exchanged Exchange Addition Subtraction Multiplication Division Increment Data Decrement Operation MEAN Mean WAND Word And Word OR WXOR Word exclusive OR Compliment Negative...
Page 138
Applied Instructions Common statements of XC3/XC5 Arithmetic Shift Left Arithmetic Shift Right Logic shift left Logic shift right Rotation shift left Data Shift Rotation shift right SFTL Bit shift left SFTR Bit shift right WSFL Word shift left WSFR Word shift right Single word integer converts to double word integer 32 bits integer converts to float point FLTD...
Page 139
Applied Instructions 5-2. Reading Method of Applied Instructions nderstanding method of instruction understanding In this manual, the applied instructions are described in the following manne Note: ⑧ Denote the instruction name ⑨ 16 bits instruction and 32 bits instruction ⑩ Denotes the soft units which can be used as the operation object Ladder Example Flag after executing the instruction.
Page 140
Applied Instructions The assignment of the data The related The data register of XC series PLC is a single word (16 bit) data register, single word data only engross one data register which is assigned by single word description object instruction. The disposal bound is: Dec. –327,68~327,67, Hex.
Page 141
Applied Instructions Instructions list of 16 bits and correspond 32 bits: 16 bits 32 bits 16 bits 32 bits CALL DFLT SRET DINT DBIN DBCD Program STLE Data convert Flow DECO NEXT ENCO FEND ENCOL DMOV ECMP BMOV EZCP FMOV EADD Data Move FWRT...
Page 142
Applied Instructions 5-3. Program Flow Instructions Mnemonic Instruction’s name Condition Jump CALL Call subroutine SRET Subroutine return Flow start STLE Flow end Open the assigned flow, close the current flow (flow jump) Open the assigned flow, not close the current flow (Open the new flow) Start of a FOR-NEXT loop NEXT...
Page 143
Applied Instructions Condition Jump [CJ] Suitable Models: XC1、XC3、XC5 16 bits instruction:CJ 32 bits instruction:- Pointer: P Soft Unit’s Bound: P0~P9999 As the instructions of executing list, with CJ instructions, the operate cycle and Function dual coil can be greatly shorten. In the following chart, if X000“ON”, then jump from step 1 to the end step of and Action flag P6.
Page 144
Applied Instructions [CALL] [SRET] Call subroutine and Subroutine return Suitable Models: XC1、XC3、XC5 16 bits instruction:CALL、SRET 32 bits instruction:- Pointer: P Soft Unit’s Bound: P0~P9999 CALL Function FEND SRET If X000“ON”, carry on Jump instruction and jump to step of flag P10. Here, after executing the subroutine, return to the original step via executing SRET instruction.
Page 145
Applied Instructions T] 、[STL Flow [SET]、[S ]、 [STLE] Suitable Models: XC1、XC3、XC5 16 bits instruction: SET、 ST、 STL、 STLE 32 bits instruction:- Pointer: S Soft Unit’s Bound: S0~S Function STL S0 STLE STL S1 STLE STL S2 STLE STL and STLE should be used in pairs. STL means start of a flow, STLE means end of a flow.
Page 146
Applied Instructions [FOR] AND [NEXT] Suitable Models: XC1、XC3 、XC5 bits instr uction 32 bits instruction:- :FOR、NEXT D· D· Word Device Dn.m Devi First execute the instructions between FOR~NEXT instructions for several times Function (the loop time is assigned by the source data), then execute the steps after NEXT. S·...
Page 147
Applied Instructions N one An FEND instru ction indicates t he first end of a m ain program and the start of the program area to be used for subroutines. Under normal operating circumstances the Function FEND instruction performs a similar action to the END instruction, i.e. output processing, inpu t processing and watchdog timer refresh are all carried out on...
Page 148
Applied Instructions 5-4. Contactor’s Compare Instructions Mnemonic & Function monic Function LD= Initial comparison contact. Active when the comparison (S1)= (S2) is true LD> Initial comparison contact. Active when the comparison (S1)> (S2) is true LD< Initial com parison contact. Active when the comparison (S1)< (S2) is true LD<>...
Page 149
Applied Instructions LD □ Initial Comparison Suitable Models: XC1、XC3、XC5 16 bits instruction:Refer Below 32 bits instruction:Refer Below S1· S2· Word Device Dn.m Device Instruction & Function The value of S1 and S2 are tested according to the comparison of the instructio n.
Page 150
Applied Instructions When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1, Note Items use the data as a negative. The comparison of 32 bits counter (C300~) mu st use 32 bits instruction. If assigned as 16 bits instruct ion, it wi ll lead the program error or operation error.
Page 151
Applied Instructions S1· S2· AND = K100 AND > K-30 DAND > K68899 When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1, Note Items use the data as a negative. The comparison of 32 bits counter (C300~) must use 32 bits instruction. If assigned as 16 bits instruction, it will lead the program error or operation error.
Page 152
Applied Instructions OR □ Parallel Comparision Suitable Models: XC1、XC3、XC5 16 bits instruction:Refer Below 32 bits instruction:Refer Below S1· S2· Word Device Dn.m Device Instruction & Function value of S1 and S2 are tested according to the instruction. If the comparison is true then the AND contact is active.
Page 153
Applied Instructions 5-5. Data Move Mnemonic Function Move BMOV Block Move FMOV Fill Move FWRT Written of FlashROM MSET Zone Set ZRST Zone Reset SWAP Float To Scientific Exchange...
Page 154
Applied Instructions [MOV] Suitable Models: XC1、XC3、XC5 16 bits instruction:MOV 32 bits instruction:DMOV S· Word Device D· Dn.m Device Function & Action S· D· Move data from one storage area to a new one. Move contents from source to destination If X000 is OFF, data will not change. Constant K10 will automatically convert to be BIN code.
Page 155
Applied Instructions [BMOV] Suitable Models: XC1、XC3、XC5 16 bits instruction:BMOV 32bits instruction:- S· Word Device D· Dn.m Device Function A quantity of consecutively occurring data elements can be copied to a new destination. The source data is identified as a device head address(S) and a quantity of consecutive data elements (n).
Page 156
Applied Instructions [FMOV] Suitable Models: XC1、XC3、XC5 16 bits instruction:FMOV 32 bits instruction:- S· Word Device D· Dn.m Device S· D· Function FMOV Move K0 to D0~D9. Copy a single data device to a range of destination devices. The data stored in the source device (S) is copied to every device within the destination range, The range is specified by a device head address (D) and a quantity of consecutive elements (n).
Page 157
Applied Instructions [FWRT] Suitable Models: XC1、XC3、XC5 16 bits instruction:FWRT 32 bits instruction:DFWRT S· Word Device D· Dn.m Device 1, Written of a word Function S· D· FWRT Function:write value in D0 into FD0 2, Written of double word S· D· DFWRT Function:write value in D0、D1 into FD0、FD1 3, Written of multi-word...
Page 159
Applied Instructions [SWAP] Suitable Models: XC1、XC3、XC5 16bits instruction:SWAP 32 bits instruction:- S· Word Device Dn.m Device Function High 8 bits Low 8 bits Low 8 bits and high 8 bits change when it is 16 bits instruction. If the instruction is a consecutive executing instruction, each operation cycle should change.
Page 160
Applied Instructions [XCH] Suitable Models: XC1、XC3、XC5 16 bits instruction:XCH 32 bits instruction:DXCH D1· D2· Word Device Dn.m Device 《16 bits instruction》 Function D1· D2· Before ( D10 ) =100 → After ( D10 ) =101 ( D11 ) =101 ( D11 ) =100 The contents of the two destination devices D1 and D2 are swapped, When drive input X0 is ON each scan cycle should carry on data exchange 《32 bits instruction》...
Page 161
Applied Instructions 5-6. Data Operation Instructions Mnemonic Function Addition Subtraction Multiplication Division Increment Decrement MEAN Mean WAND Logic Word And Logic Word Or WXOR Logic Exclusive Or Compliment Negation...
Page 162
Applied Instructions Addition Operation [ADD] Suitable Models: XC1、XC3、XC5 16 bits instruction:ADD 32 bits instruction:DADD Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device S1· S2· D· Function ( D10 )+( D12 )→( D14 ) The data contained within the two source devices are combined and the total is stored in the specified destination device.
Page 163
Applied Instructions Suitable Models: XC1、XC3、XC5 16 bits instruction:SUB 32 bits instruction:DSUB Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device S1· S2· D· Function ( D10 )—( D12 )→( D14 ) appoint the soft unit’s content, subtract the soft unit’s content appointed by in the S2·...
Page 166
Applied Instructions [INC] & [DEC] Suitable Models: XC1、XC3、XC5 16 bits instruction:INC、DEC 32 bits instruction:DINC、DDEC Zero M8020 D· Word Borrow M8021 Device Carry M8022 Dn.m Device Function & Action 1、Increment [INC] D· ( D0 )+ 1 → (D0) On every execution of the instruction the device specified as the destination D·...
Page 167
Applied Instructions [MEAN] Suitable Models: XC1、XC3、XC5 16 bits instruction:MEAN 32 bits instruction:- Zero M8020 S· Word Borrow M8021 Device D· Carry M8022 Dn.m Device Function & Action S· D· MEAN (D0) (D1) (D2) (D10) The value of all the devices within the source range is summed and then divided by the number of devices summed, i.e.
Page 168
Applied Instructions [WAND]、 [WOR] & [WXOR] Suitable Models: XC1、XC3、XC5 16 bits instruction:WAND、WOR 32 bits instruction:DWAND、DWOR Zero M8020 S1· S2· Word Borrow M8021 Device D· Carry M8022 Dn.m Device Functio n & A ction Execute logic AND operation with each bit S1·...
Page 169
Applied Instructions [CML] Suitable Models: XC1、XC3、XC5 16 bits instruction:CML 32 bits instruction:DCML S· Word Device D· Dn.m Device Function & Action S· D· A copy of each data bit within the source device is inverted and then moved to the designated destination.
Page 170
Applied Instructions [NEG] Suitable Models: XC1、XC3、XC5 16 bits instruction:NEG 32 bits instruction:DNEG D· Word Device Dn.m Device Function & Action D· (D10) +1 (D10) The bit format of the selected device is inverted, I.e. any occurrence of a “1’ becomes a “0” and any occurrence of “0” becomes “1”, when this is complete, a further binary 1 is added to the bit format.
Page 171
Applied Instructions 5-7. Shift Instructions Mnemonic Function Arithmetic shift left Arithmetic shift right Logic sh left Logic shift right Rotation left Rotation right SFTL Bit shift left SFTR Bit shift right WSFL Word shift left WSFR Word shift right...
Page 172
Applied Instructions [SHL] & [SHR] Suitable Models: XC3、XC5 16 bits instruction:SHL、SHR 32 bits instruction:DSHL、DSHR D· Word Device Dn.m Device 《Arithmetic shif t left》 Function & After once execution, the Action low bit is filled in 0, the final bit is stored in carry flag.
Page 173
Applied Instructions [LSL] & LSR] Suitable Models: XC3、XC5 16 bits instruction: 32 bits instruction:DLSL、DLSR D· Word Device Dn.m Device Function & Action 《Logic shift le ft》 After onc e execution, the low b it is filled in 0, the final bi t is stored in carry flag.
Page 174
Applied Instructions [ROL] & [ROR] Suitable Models: XC3、XC5 16 bits instruction:ROL、ROR 32 bits instruction:DROL、DROR D· Word Device Dn.m Device Function & Action The bit format of the destination device is rotated n bit places to the left on every operation of the instruction 《Rotation shift left》...
Page 175
Applied Instructions [SFTL] & [SFTR] Suitable Models: XC3、XC5 16 bits instruction:SFTL、SFTR 32 bits instruction:DSFTL、DSFTR n1 n2 Word Device S· Dn.m Device D· Function & Action The instruction copies n2 source devices to a bit stack of length n1. For every new addition of n2 bits, the existing ta within the bit stack is shifted n2 bits to the left/right.
Page 176
Applied Instructions [WSFL] & [WSFR] Suitable Models: XC3、XC5 16 bits instruction:WSFL、WSFR 32 bits instruction:DWSFL、DWSFR n1 n2 S· Word Device D· Dn.m Device Function & Action The instruction copies n2 source devices to a word stack of length n1. For each addition of n2 words, the existing data within the word stack is shifted n2 words to the left/right.
Page 177
Applied Instructions -8. Data Con vert Mnemonic Function Single word integer converts to double word integer 32 bits integer converts to float point FLTD 64 bits integer converts to float point Float point converts to integer BCD convert to binary Binary converts to BCD Hex.
Page 178
Applied Instructions [WTD] Suitable Models: XC3、XC5 16 bits instruction:WTD 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action S· D· (D0) → (D11,D10) Single Word Double Word 0 or 1 High bits Low bits When single word D0 is positive integer, after executing this instruction, the high bit of double word D10 is 0.
Page 179
Applied Instructions [FLT] & [FLTD] Suitable Models: XC3、XC5 16 bits instruction:FLT 32 bits instruction:DFLT S· S· Word Device D· Dn.m Device Function & Action 《16 Bits》 S· D· (D10) → (D13,D12) BIN integer Binary fl oat p int 《 32 Bits》 S·...
Page 180
Applied Instructions [INT] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:INT S· Word Device D· Dn.m Device Function & Action 《 位》 S· D· ( D11,D10 ) → (D20) inary Floating BIN integer Give up the data after the decimal dot 《32 位》...
Page 181
Applied Instructions [BIN] Suitable Models: XC3、XC5 16 bits instruction:BIN 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action S· D· Convert and move instruction of Source (BCD) → destination (BIN) When source data is not BCD code, M8067(Operation error) , M8068 (Operation error lock) will not work.
Page 182
Applied Instructions [BCD] Suitable Models: XC3、XC5 16 bits instruction:BCD 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action Convert and move instruction of source (BIN)→destination (BCD). S· D· This instruction can be used to output data directly to a seven-segment display.
Page 183
Applied Instructions [ASCI] Suitable Models: XC3、XC5 16 bits instruction:ASCI 32 bits instruction:- S· Word Device D· Dn.m Device Function & Action 《16 bits convert mode》 S· D· ASCI D100 D200 Convert each bit of source’s (S) Hex. format data to be ASCII code, move separately to the high 8 bits and low 8 bits of destination (D).
Page 184
Applied Instructions Applied Instructions [HEX] Suitable Models: XC3、XC5 16 bits instruction:HEX 32 bits instruction:- S· Word Device D· Dn.m Device Funct ion & Ac tion 《16 bits switch mode》 《16 bits switch mode》 S· S· D· D· D200 D200 D100 D100 Convert the high and low 8 bits in source to HEX data.
Page 185
Applied Instructions [DECO] Suitable Models: XC3、XC5 16 bits instruction:DECO 32 bits instruction:- S· Word Device Dn.m Device D· Function & Action 《 When is software unit》 n≤16 D· S· D· DECO X002 X001 X000 ① ② ③ The source address is 1+2=3,so starts from M10, the number 3 bit (M13) is 1. If the source are all 0, M10 is 1 When n=0, no operation, beyond n=0~16, don’t execute the instruction.
Page 186
Applied Instructions [ENCO] Suitable Models: XC3、XC5 16 bits instruction:ENCO 32 bits instruction:- S· Word Device D· Dn.m Device S· Function & Action 《 When is bit device》 n≤16 S· S· D· ENCO ③ ② ① All be 0 《 When is word device》...
Page 187
Applied Instructions [ENCOL] Suitable Models: XC3、XC5 16 bits instruction:ENCOL 32 bits instruction:- S· Word Device D· Dn.m Device S· Function & Action 《 If is bit device》 n≤16 S· S· D· ENCOL ③ ② ① All be 0 是字软元件时》 n≤16 《...
Page 190
Applied Instructions [EZCP] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:ECMP S1· S2· S3· Word Device S1· S2· S3· Dn.m Device D· Function & Action Compare a float range with a float value. S1· S2· D1· D2· EZCP (D20, D21) >...
Page 191
Applied Instructions [EADD] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EADD S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EAAD ( D11,D10 ) (D21,D20) → (D51,D50) Binary Floating Binary Floating Binary Floating The floating point values stored in the source devices S1 and S2 are algebraically added and the result stored in the destination device D.
Page 192
Applied Instructions [ESUB] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:ESUB S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· ESUB (D11,D10) (D21,D20) → (D51,D50) - Binary Floating Binary Floating Binary Floating The floating point value of S2 is subtracted from the floating point value of S1 and the result stored in destination device D.
Page 193
Applied Instructions [EMUL] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EMUL S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EMUL ( D11 , D10 ) × ( D21,D20 ) → (D51,D50) Binary Floating Binary Floating Binary Floating The floating value of S1 is multiplied with the floating value point value of S2.
Page 194
Applied Instructions [EDIV] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:EDDIV S1· S1· S2· S2· Word Device D· Dn.m Device Function & Action S1· S2· D· EDIV ( D11,D10 )÷( D21,D20 )→( D51,D50 ) Binary Floating Binary Floating Binary Floating The floating point value of S1 is divided by the floating point value of S2.
Page 195
Applied Instructions [ESQR] Suitable Models: XC3、XC5 16 bits instruction:- 32 bits instruction:ESQR S· S· Word Device D· Dn.m evice Function & Action S· D· (D11,D10) →( D21,D20 ) ESQR Binary Floating Binary Floating A square root is performed on the floating point value in 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 addition operation.
Page 196
Applied Instructions S· S· Word Device D· Dn.m Device Function & Action S· D· (D51,D50) → (D61,D60)SIN Binary Floating Binary Floating This instruction performs the mathematical SIN operation on the floating point value in S (angle RAD). The result is stored in D. RAD value (angle ×π...
Page 197
Applied Instructions S· S· Word Device D· Dn.m Device Function & Action S· D· (D51,D50)RAD → (D61,D60)COS Binary Floating Binary Floating This instruction performs the mathematical COS operation on the floating point value in S (angle RAD). The result is stored in D. RAD value (angle ×π...
Page 198
Applied Instructions S· S· Word Device D· Dn.m Device Function & Action S· D· (D51,D50)RAD → (D61,D60)TAN Binary Floating Binary Floating This instruction performs the mathematical TAN operation on the floating point value in S. The result is stored in D. RAD value (angle ×π...
Page 199
Applied Instructions 5-10. Clock O peration Mnemonic Function TCMP Time Compare TZCP Time Zone Compare TADD Time Add TSUB Time Subtract Read RTC data Set RTC data Note:The models without clock can not use these instructions.
Page 200
Applied Instructions Time Compare [TCMP] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S1· S2· S3· Word Device S· Dn.m Device D· Function & Action Compare the assigned time with time data. The status of the destination devices is kept, even if the TCMP instruction is deactivated. S2·...
Page 201
Applied Instructions [TZCP] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S1· S2· S3· Word Device Dn.m Device D· Function & Action Compare the two assigned time with time data The status of the destin ation devices is kept, even if the TCMP instruction is deactivated. Comp are the 3 clock data start from...
Page 204
Applied Instructions [TRD] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV D· Word Dn.m Device Function & Action The current time and date of the real time clock are read and stored in the 7 data D· devices specified by the head address D. Read PLC’s real time clock according to the following format.
Page 205
Applied Instructions [TWR] Suitable Models: XC3、XC5 16 bits instruction:DIV 32 bits instruction:DDIV S· Word Device Dn.m Device Function & Action S· The 7 data devices specified with the head address S are sed to set a ne Write the set clock data into PLC’s real time clock. In order to write real time clock, the 7 data devices specified with the head address should be pre-set.
Applied Instructions 6. Special Function Instructions(XC3/XC5) In this chapter, we introduce the functions of high-speed count input, high-speed pulse output and MODBUS communication instructions of XC series PLC. 6-1.High-speed Count 6-2.Pulse Uutput 6-3.Modbus Instructions 6-4.Free Format Communication 6-5.PWM Pulse Modulate 6-6.Frequency Testing...
Page 207
200KHz. The Assignment of Count Input Ports 1, In the following table, we list how many high speed counters are there in XC series PLC: High-speed counters PLC Model Increment Mode...
Page 208
Applied Instructions 2, About the definition of high speed counter’s input terminals, please refer to the following table: When X input terminals are not used as high speed input port, they could be used as common input terminals. [U]---count pulse input [Dir]---count direction judgment (OFF means +, ON means -) [A]---A phase input [B]---B phase input XC3-48、XC3-60 PLC models...
Page 210
Applied Instructions Pulse + Direction input mode: Under pulse + direction input mode, both the pulse signal and direction signal are input, the count value increase/decrease according to the direction signal’s status. Pulse input Direction Dir AB phase mode: U nder AB phase mode, the count value increase/decrease according to the signal difference (A phase and B phase) A phase input B phase input...
Page 211
Applied Instructions Connection of input terminal The following, we take C600 as the example to introduce the connection format. AB phase mode Pulse + Direction mode Pulse input B phase input Direction input A phase input Increment Mode Pulse input Program Example The following, we take XC3-60 PLC model as the example to tell how to program with the high speed count:...
Page 212
Applied Instructions When M4 is ON, C620 counts with OFF C620 D0(D1) →ON from X000, via OFF or ON status from X001, decide the count direction. If X001 is OFF, execute increase count; if C620 X001 is ON, execute decrease count”. When M6 is ON, C622 counts with C622 K100...
Page 213
Applied Instructions High speed counters have one time frequency and four times frequency two Times modes. PLC’s defaulted count mode is four times frequency mode. The count Frequency format of two count modes is shown below: One time frequency mode: A、B phase counter’s count format: Increment count Decrement count...
Page 214
Applied Instructions 6-2. Pulse Output Pulse Output Function ormally XC3 series and XC5 series PLC have 2 channels pulse output. Via different instruction to rogram, you can realize single direction pulse output without speedup/speed-down; or you can realize ingle direction pulse output with speedup/speed-down; or you can realize multiply-segment, ositive/negative output and so on.
Page 215
Applied Instructions PLSY Instruction: S1· D· S2· PLSY M8170 Generate certain quantity pulse with the assigned frequency; support 32 bits instruction [DPLSY]. Assign the Frequency. Operands: K、TD、CD、D、FD S1· S2· Assign the generated pulse volume. Operands: K、TD、CD、D、FD Assign Y port which generates pulse, can only output at Y000 or Y001 D·...
Page 217
Applied Instructions Pulse output of segments and single phase S1· D· S2· PLSR D100 M8170 The instruction which generates a certain quantity pulse with the assigned frequency. An area with Dn or FDn as the start address. In the above example, D0 set the highest S1·...
Page 218
Applied Instructions 3, Dual Pulse Output with speedup/speed-down • Frequenc y: 0~400KHz • Speedup/spe ed-down time: Below 5000ms • Output Term inals: Y0 or Y1 • Direction ou tput terminal: A ny Y • Output Mode: Limited number of pulse •...
Page 219
Applied Instructions 4, Pulse Segment Switch [PLSNEX PLSY D100 PLSNEXT In the condition of pulse output reaches the highest frequency of current segment, and stably output, if M 1 turns from OFF to ON, then enter next pulse output with the speedup/speed-down time. In pu lse output speedu p/speed-down process, execute this instruction...
Page 220
Applied Instructions Connection of output terminals COM0 COM1 COM2 Output port Y0: pulse output port 0 (Single Phase) Output port Y1: pulse output port 1 (Single Phase) The following graph is connection of output terminals and step motor driver: PLC Side Step Motor Driver Side...
Page 221
Applied Instructions Note Items 1, Concep t of Step Frequency In the process of speedup/speed-down, each step’s time is 5ms, this time is fixed. The max. step is 15K. (the increase/decrease frequency of each step). If the value exceeds 15K, count as 15K;the minimum step frequency is 10Hz, if lower than 10Hz, calculate as 10Hz.
Page 222
Applied Instructions Application E.g.1: Fixed Stop With subsection pulse output statement [PLSR] and pulse segment switch statement [PLSNEXT], realize fixed-length function. Take the preceding program as the example, in D0、 D1 and D2, D3, set two parts pulse output with the same frequency value. The pulse number in D3 is set to be the number...
Page 223
Applied Instructions Pulse output specia l coil and register Som flag bits of pulse output is shown below: High Function Description frequency pulse ID M81 0 PULSE_1 Sending pulse flag Be 1 at pulse sending bits pulse sending M8171 Be 1 when overflow overflow flag 1 is p ositive direction, the correspond...
Page 224
Applied Instructions Some special registers of puls e output: High Function Description frequency pulse ID D8170 PULSE_1 The low 16 bits of accumulated pulse number D8171 The high 16 bits of accumulated pulse number D8172 The current segment (means No.n segment) D8173 PULSE_2 The low 16 bits of accumulated pulse number...
Page 225
The parameters (baud rate, data bit etc.) of this COM port can be re-set via software. Via BD board, XC series PLC can expend another COM port. This COM port could be RS232 and RS485.
Page 226
Applied Instructions 1、 RS232 COM port The pin graph of COM 1(Port1) : 2:PRG 4:RxD 备注 5:TxD 6:VCC 8:GND Mini Din 8 core socket (Hole) The pin graph of COM 1(Port1) : 4:RxD 5:TxD 8:GND Mini Din 8 core socket (Hole)
Page 227
2, RS485 COM Port About RS485 COM port, A is “+” signal、B is “-“ signal. On XC series PLC, COM2 (Port2) can be both RS485 and RS232, so, you can’t only use two at the same time. 3, CAN Port CAN port can be used to realize CANbus communication.
Page 228
Special Functions XC series PLC can set the communication parameters with the COM port Parameter Setting How to set the communication parameter: Number Function Description 255 is free format, FD8210 Communication mode 1~254 bit is modbus station number FD8211 Communication format...
Page 229
Special Functions Setting method of communication parameters: FD8211(COM1)/FD8221(COM2): 0:300bps 0:No check 1:600bps 1:Odd check 2:1200 bps 2: Even check 3:2400 bps 4:4800 bps 0:2 stop bits 5:9600 bps 2:1stop bit 6:19.2K bps 0:8bits data 7:38.4K bps 1:7bits data 8:57.6K bps 9:115.2K bps FD8216(COM1)/FD8226(COM2): 0:8 bits communication...
Page 230
Special Functions 6-3-1. MODBUS Communication function Communication XC series PLC support both Modbus master and Modbus slave Function Master format: When PLC is set to be master, PLC sends request to other slave devices via Modbus instructions, other devices response the master.
Page 231
Special Functions Communication Instructions 1, Coil Read [COLR] S1· S2· S3· D1· D2· COLR K500 Coil read instruction, Modbus function code is 01H . Function: Read the assig ned bureau’s assigned coil status to PLC’s assigned coil. Far away com municat ion bureau number .
Page 232
Special Functions 3, Single coil write [COLW] D1· D2· S1· S2· COLW K500 Write single coil instruction, Modbus function code is 05H Function: Write the assigned coil status to PLC’s assigned bureau’s assigned coil. Far away communication bureau number . Operands: K、TD、CD、D、FD D1·...
Page 233
Special Functions 5, Register Read [REGR] S1· S2· S3· D1· D2· REGR K500 Read register instruction, Modbus function code is 03H. Function: Read the assigned bureau’s assigned register status to PLC’s assigned register. Far away communication bureau number. Operands: K、TD、CD、D、FD S1·...
Page 234
Special Functions 7, Single Register Write [REGW] D1· D2· S1· S2· REGW K500 Write single register instruction, Modbus function code is 06H Function: write the assigned register status to PLC’s assigned bureau’s assigned register. Far away communication bureau number. Operands: K、TD、CD、D、FD D1·...
Page 235
Special Functions 6-3-2. Free Format Communication Free Communication Communication Mode: Start Symbol (1 byte) Data Block (max. 128 bytes) End Symbol (1 byte) Baud Rate: 300bps~115.2Kbps Data Format Data Bit: 7bits、8bits Check Bit: Odd、Even、No Check Stop bit: 1 bit、2 bits Start Symbol: 1 bit End Symbol: 1 bit User can set a start/end symbol, after set start/end symbol, PLC will automatically add this...
Page 236
Special Functions Instruction Format 1, Send Data: S1· S2· SEND D100 Data sending instruction, send data every rising edge of M0 Start address of send data. Operands: K、TD、CD、D、FD S1· The sent character’s number. Operands: K、TD、CD、D、FD S2· Bound: K1~K2 n:COM port In the data sending process, “sending”...
Page 237
Special Functions 6-4. PWM Pulse Width Modulation Suitable Model: XC3、XC5 16 bits instruction:PWM 32 bits instruction:- S1· S1· S2· S2· Word D· Dn.m Device S1· D· S2· Function K100 and Action Assign occupy/empty ratio value “n”. The bound is:1~255 S1· Assign output frequency f.
Page 238
Special Functions 6-5. Frequency Testin Suitable Model: XC3、XC5 16 bits instruction: FRQM 32 bits instruction S1· S1· S2· Word Device D· S3· Dn.m Device Function and Action S1· D· S2· S3· X000 FRQM D100 X003 S1: Pulse cycle number (The sampled pulse cycle number in one scan cycle.) perands: D, CD, TD D: Testing result.
Page 239
Special Functions -6. Precise Time Suitable Model: XC3、XC5 16 bits instruction:STR 32 bits instruction:- D2· D2· Word D1· Dn.m Device D1· D2· 功能和动作 T600 K100 T600 T600 :Timer’s number. The bound:T600~T618(T600、T602、T604…T618) D1· :The time valu e. D2· This instruction is the precise time instruction with the cycle of 1ms. Precise timer is 32 bits, the count value’s bound is 0~+2,147,483,647.
Page 240
Special Functions When precise time reaches the count value, a correspond interrupt tag will be Precise generated, some interrupt subroutines can be executed. Each precise timer has its correspond interr upt tag. See the following graph: erruption T600 K100 When X000 turns from OFF to ON, timer T600 starts to time, when time reaches 100ms, T600 set;...
Page 242
Special Functions 6-7. Interruption Function XC series PL C all have interrupt function. There are two kinds of interrupt function: external interrupt and time interrupt. Via int errupt function, some special program can be disposed, not affecte d by PLC’s scan cycle.
Page 243
Special Functions Enable Interruption [EI], Disable Interruption [DI] and Interrupt Return [IRET] Normally PLC is in the status of disable interruption, if use EI instruction Interruption of allow interru ption, then in the process allow bound of scan the program, if interrupt input changes from OFF to ON, then execute FEND errupt...
Page 244
Special Functions 《Disable Interruptio n》 To each input interruption, special relay disable interruption given. (M8050~M8052) M8050 In the left program, if use M0 to make M8050 “ON”, then disable the interrupt input of route 0 FEND I0000 IRET...
Page 245
Special Functions 6-7-2.Time Inte rrupt In the condition of the main p gram’s executing cyc le too long, if certain special Function program should be executed; or in sequential control scan, a special program should and Action be executed every certain time, t ime interruption f unction is suitable.
Page 246
Special Functions 《Limitation of interruption’s bound》 Normally time interruption is in the status of enable. Use EI、DI instructions can set enable interruption/ disable interruption bound. See the preceding graph, in DI~EI section, all time interruption are disabled, while beyond DI~EI section, all time interruption are enabled. Enable interruption Disable interruption Enable interruption...
Page 247
Special Functions 6-8. CAN-Bus Function(XC5 Series) CAN-Bus Brief Introduction Sub-address 00 120R 120R CAN-bus Node CAN-bus Node CAN-bus Node CAN-bus Node Sub-address 01 Sub-address 02 Sub-address 03 Sub-address 04 CAN: Controller Area Network, included in industrial area bus category. Compared with common communication bus, CAN bus data communication has performance of outstanding dependability, real time ability and flexibility.
Page 248
Special Functions Network Format of CAN Bus There are two forms of CAN bus network: one is statements communication format; the other is interior protocol communication format. These two forms can carry on at the same Statements communication format This format means, in the local PLC program, via CA N-bus instructions, carry on bit r word reading/writing with the assigne d far away PLC.
Page 249
Special Functions 2、 Register read [CREGR] S1· D· S2· S3· CREGR Read regis ter statement Function:Read the assigned bureau’s assigned register to the local assigned register. Far away communication bureau ID. S1· Far away register’s start number. Operands:K、D S2· Register number. S3·...
Page 250
Special Functions Interior protocol communication form at Function description: Open and close of interior protocol communication function Using via setting the data of registe r FD8350: 0 means not use CAN interior protocol communication; 1 means use CAN interior protocol communication CAN interior protocol communication function is defaulted closed.
Page 251
Special Functions CAN Communication Setting Function Description FD8350 CAN communication mode 0 means not use;1 means interior protocol FD8351 CAN baud rate Refer to CAN baud rate setting table FD8352 Self’s CAN bureau ID CAN protocol using (the defaulted value is 1) The set value’s unit is ms (sending one time every Configured sending several ms)
Page 253
Special Functions CAN status flag: If error, set 1, if correct, set 0; 8240 CAN self-check error flag If error, set 1, if correct, set 0; M8241 CAN configure check error flag If set to be 1, then automatic self recover after error generate If set to be 0, then after error generate, M8242 CAN bus self-recover control after error...
In this chapter, we give you some sample programs for your reference. XC series PLC is mini model 、 high speed 、 good performance PLC. Besides the independent using of I/O points, pulse output and other functions could be used. So XC series PLC could satisfy diverse control.
Page 255
Special Functions 7-1. Example of Pulse Output E.g: The following is the program which realize continuous sending high-low pulse parameters: Paramete rs o f step motor: step square angle =1. 8 degree/step, fractionlet =40, the pulse number of a round is 8000。 High frequen cy pulse: max frequency is 100K Hz, the total pulse number is 24000(3 rounds)
Page 256
Special Functions D210 K100 D220 // Transfer decimal data 10 0 into word regi ster D220 //M10 rising edge tr igger condition K10000 D200 // Tra nsfer decima l data 10000 into double-word register D200 8000 D210 // Tra nsfer decima l data 8000 into double-word register D210 //M1 status trigger condition...
Page 257
Special Functions 7-2. Example of MODBUS Instructions E.g.: The following is the communication program of one master station and 4 slave stations Each par ameters: he mast er s tation number is 1, slave st ation s numbers are 2, 3, 4, 5. This example, we use COM Ladder program: Program description:...
Page 258
Special Functions 7-3. Example of free format communication This example is the free format program with DH107/DH108 series instruments: I, Interface specification DH107/DH108 series instruments use asynchronism serial communication ports, the interface level fits the standard of RS232C or RS485. the data format is 1 start bit, 8 bits data, no check bit, one or two stop bits.
Page 259
Special Functions Temperature display: D200,D201 Form of sending d ata: 81H 81 H 43H 00H c8H 00H 0c H 01H (display of the current emperatu etting of mmunication par ameters: baud rate: 9600, 8 bits data bit, 2 bits stop bit, no check. Set FD8220=255;FD8221=5。...
Special Functions 8. Appendix This chapter gives some auxiliary i nformation o f XC series PLC. 8-1.List of special auxiliary relay, special data register 8-2.List of Special FLASH data register SFD 8-3 Brief Introduction of XC1 series PLC . 8-4 Brief Introdu ....
Page 264
Special Functions 8-1. List of special auxiliary re lay, specia l data register Special s oft unit ’s type and its function PC status(M) Funct n Description Workin g normally PLC be ON when M8000 ON coi running Working normally PLC be OFF when M8001 OFF co...
Page 265
Special Functions Clock(M) Function Description M8010 M8011 Shake with the cycle of 10ms 50ms Shake with the cycle of M8012 100ms 50ms 0.5s M8013 Shake with the cycle of 1 0.5s M8014 Shake with the cycle of 1 M8018 Bits of year Defaulted is OFF(OFF: 2;ON: 4) Flag (M)...
Page 266
Special Functions Clock (D) Function Description D8010 The curren t scan cycle nit: 0.1ms D8011 Mini value of scan time Unit: 0.1ms x vale of scan time Unit: 0.1ms D8013 Second(clock) 0~59(BCD code format) D8014 Minute(clock) 0~59(BCD code format) D8015 Hour(clo 3(BCD c ode format)
Page 267
Special Functions PC mode(M) Function Description M8030 PLC initializing When driving this , ON/OFF image memory of Y, M8031 Non-re tentive register clear M, S, TC and the current value of T, C, D are all M8032 Retentive register clear cleared When PLC changes from RUN to STOP, leave all M8033...
Page 268
Special Functions Step ladder(M) Function Description M8041 M8045 All output reset forbidden When mode shifting, all output reset are forbidden When M8047 acts, act when any unit of S0~S999 M8046 STL sta us act turns to be ON Interrupt(M) Function Description M8050 Forbi nput interruption 0...
Page 269
Special Functions Error check(M) Function Description M8067 Operation error Power on and STOP->RUN check M8070 Scan overtime M8071 No user program Interior codes checking error M8072 User program error Execute code or collocate table check error Error check(D) Function Desc ription D8067 Execute error c...
Page 270
Special Functions Co mmunication(M) Function Description M8120 8122 232 is sending flag RS232 is receiving flag COM1 Receiving finished normally, but the Rece ive imperfect flag eived data i s less than the required M8127 Receive error flag M8128 Receive corre ct flag M812 Timeout judgment flag M8130...
Page 271
Special Functions Communication(D) Function Description D8120 D8121 Data number received by D8123 RS232 D8126 COM1 7: hardware error 10: no start sign 8: CRC check error 11: no end sign D8127 Communication error code 9: bureau ID error 12: communication time out D8128 D8129 D8130...
Page 272
Special Functions High speed count(M) Counter Funct Description M8150 C600 Count finished sign 24 segments count finished, flag is 1 M8151 C602 Count finished sign 24 segments count finished, flag is 1 M8152 C604 Count finished sign 24 segments count finished, flag is 1 M8153 C606 Count finished sign...
Page 273
Special Functions Pulse output(M) High Function Description frequency pulse ID M8170 PULSE_1 Sending pulse flag Be 1 at pulse sending bits pulse sending M8171 Be 1 when overflow overflow flag 1 is positive direction, the correspond M8172 Direction flag direction port is ON M8173 PULSE_2 Sending pulse flag...
Page 274
Special Functions High speed count(D) Function Description Counter’s ID The current segment (means D8150 C600 No.n segment) D8151 C602 The current segment D8152 C604 The current segment D8153 C606 The current segment D8154 C608 The current segment D8155 C610 The current segment D8156 C612 The current segment...
Page 275
Special Functions Pulse output(D) High Function Description frequency pulse ID D8170 PULSE_1 The low 16 bits of accumulated pulse number D8171 The high 16 bits of accumulated pulse number D8172 The current segment (means No.n segment) D8173 PULSE_2 The low 16 bits of accumulated pulse number D8174 The high 16 bits of accumulated pulse number D8175...
Page 276
Special Functions Expansion’s information(D) Unit Type ID(as register) I/O//channels Input switch quantity X X100~X137 32 points Output switch quantity Y Y100~Y137 32 points Expansion Input analog ID ID100~ID131 16 channels Output analog QD QD100~QD131 16 channels Module’s set value D D8250~D8259 Input switch quantity X X200~X237...
Page 277
Special Functions 8-2. List of special FLASH data register SFD 1、 I filter Number Function Description FD8000 X port, input filter time value Unit: ms FD8002 FD8003 FD8004 FD8005 FD8006 FD8007 FD8008 FD8009 2、 I mapping Number Function Description FD8010 X00 corresponds with I** X0 corresponds with the number of input image I** FD8011...
Page 278
Special Functions 6、 Communication Number Function Description 255 is free format, FD8210 Communicate mode 1~254 bits modbus station ID FD8211 Communicate format Baud rate, data bit, stop bit, checkout Judgment time of ASC FD8212 Unit: ms timeout COM1 Judgment time of reply Unit: ms, if set to be 0, it means no timeout FD8213 timeout...
Page 279
Special Functions 8-3. Brief Introduction of XC1 Series PLC 8-3-1. Performance 1, Brief Introduction of XC1-PLC XC1 series PLC are suitable for small control system which needs little I/O. The main units can not connect with the expansions. Special BD boards can be inserted into XC1-PLC main units. This can realize analog sampling and temperature sampling, realize PID control.
Page 280
Special Functions 8-3-2. Statements XC1 series PLC includes all SFC statements of XC3 series PLC, part of applied statements, no special function statements. XC1 series PLC has the following applied instructions: Sort Mnemonic Function Condition jump CALL Call subroutine SRET Subroutine return Flow start STLE...
Page 281
Special Functions 8-3-3. Soft unit’s bound: Soft unit’s bound: Bound Points Mnemonic Name 14 points 24\32 points 14 points 24\32 points X000~X013 Input relay X000~X007 8 points 12\16 points X000~X017 Y000~Y013 Output relay Y000~Y007 8 points 12\16 points Y000~Y017 M0~M319 Interior relay M8000~M8370 for special using Flow...
Page 282
Special Functions 8-4. XC5 series PLC 8-4-1. Performance 1, Brief introduction of XC5 series XC5 series PLC covers all functions of XC1 series、XC3 series, also the interior source space is larger than XC1 and XC3 series; XC5 series PLC also have CANbus function, which can realize complex communication network function.
Need help?
Do you have a question about the XC Series and is the answer not in the manual?
Questions and answers