Page 2
In no event will RS Automation Co., Ltd. be responsible or liable for indirect or consequential damages resulting from the use or application of this equipment.
Page 3
X8 series PLC. If you do not have a basic understanding of the X8 series PLC, contact your local RS Automation sales representative before using this product, for information on available training courses.
Page 4
Safety Instructions Please read this manual and the related documentation thoroughly and familiarize yourself with the directions before installing, operating, performing inspection and preventive maintenance. Make sure to follow the directions correctly to ensure normal operation of the product and your safety. Environment and Enclosure ...
Page 5
Preventing Electrostatic This equipment is sensitive to electrostatic discharge, which can cause internal damage and affect normal operation. Discharge Follow these guidelines when you handle this equipment. If you connect or disconnect the serial cable with power applied WORNING to this module or the serial device on the other end of the cable, an electrical arc can occur.
Page 6
Touch a grounded object to discharge potential static. ATTENTION ATTENTION Wear an approved grounding wrist strap. Do not touch connectors or pins on component boards. Do not touch circuit components inside the equipment. Use a static-safe workstation, if available. ...
Page 15
ACMP - Compare String........6 ARNL - Number of Characters for Line .
Page 17
The controller also allows for adding expansion I/O. Topic Page Introduction Embedded I/O Expantion I/O X8 Series Embedded I/O Memory Mapping X8 Series Expansion I/O Memory Mapping I/O Addressing 1-22 I/O Forcing 1-24 Input Filtering...
Page 18
Addressing Expansion I/O Slots The figure below shows the addressing for the base and expantion I/O module of X8 Series PLC . The expansion I/O is addressed as slots 1 to 80. Modules are counted from left to right as shown below.
Page 19
X:s.b (X = Table type letter, s = slot number, b = bit number) For example I3:0.0 X8 Series Embedded I/O Digital I/O Configuration of X8 Series PLC base module Memory Mapping X8-M14DDT, X8-M16DDR Input Image For X8-M14DDT and X8-M16DDR base module, the Bit positions 0 to 7 correspond to input terminals 0 to 7.
Page 20
I/O Configuration Bit Position 15 14 13 12 10 9 r = read only, x = not used, always at a 0 or OFF state X8-B48DDX Input Image For X8-B48DDX base module, the Bit positions 0 to 15 with word 0 correspond to input terminals 0 to 15.
Page 21
I/O Configuration Bit Position 15 14 13 12 w= write only, x = not used, always at a 0 or OFF state X8-M16DDR Output Image For X8-M16DDR base module, the Bit positions 0 to 7 correspond to output terminals 0 to 7. Bit Position 15 14 13 12 w= write only, x = not used, always at a 0 or OFF state...
Page 22
Bit Position 15 14 13 12 10 9 w= write only, x = not used, always at a 0 or OFF state X8 Series Expansion I/O Digital I/O Input Module Configuration Memory Mapping X8-XU16, X8-XA16 Input Image 16-point input module has a total area of the 16-bit from bit 0 to 15 with one word.
Page 23
I/O Configuration Bit Position 15 14 13 12 r = read only, x = not used, always at a 0 or OFF state * it will be released in 2013. X8-XU64 Input Image 64-point input module has a total area of the 64-bit from bit 0 to 15 with four words.
Page 24
I/O Configuration Digital I/O Output Module Configuration X8-YN16, X8-YR16 Output Image 16-point output module has a total area of the 16-bit from bit 0 to 15 with one word. Bit Position 15 14 13 12 10 9 w= write only, x = not used, always at a 0 or OFF state X8-YN32 Input Image 32-point output module has a total area of the 32-bit from bit 0 to 15 with two words.
Page 25
I/O Configuration X8-YR6C Output Image YR6C output module has a total area of the 6-bit from bit 0 to 5 with one word. Bit Position 15 14 13 12 w= write only, x = not used, always at a 0 or OFF state Analog I/O Module Configuration Analog module has different memory configuration area with digital I/O module.
Page 26
1-10 I/O Configuration Data Address Mapping Bit Position 15 14 13 12 10 9 Input Channel 0 , Read Only Input Channel 1 , Read Only Input Channel 2 , Read Only Input Channel 3 , Read Only Input Channel 4 , Read Only Input Channel 5 , Read Only Input Channel 6 , Read Only Input Channel 7 , Read Only...
Page 27
I/O Configuration 1-11 Data Configuration of Control Area Display Format Bit Position 14 13 12 0 (0000): Raw Data 1 (0001): Left Align 2 (0010) : Voltage Value 3 (0011) : Percent Value 4 (0100) : Scaled for PID 5 (0101) : User Scale Filter Frequency Format Bit Position 14 13 12...
Page 28
1-12 I/O Configuration • Reserved for future use. Input Data Type Selection Bit Position 14 13 12 0 (0000): Voltage Input 0~5V 1 (0001) : Voltage Input 0~10V 2 (0010) : Voltage Input -5~5V 3 (0011) : Voltage Input -10~10V 4 (0100) : Current Input 0~20mA 5 (0101): Current Input 4~20mA X8-AO4 Input Image...
Page 29
I/O Configuration 1-13 Status Output Mapping by Channel Bit Position 15 14 13 12 Reserved S3 S2 S1 Reserved F3 F2 F1 Reserved Firmware Rev major Firmware Rev minor • S0 ~ S4: Ready Status (Normal : 0, Reset/Error:0) • F0 ~ F3: Fault Status: (Fault: 1, Normal: 0). Control Area Address Mapping Bit Position 15 14 13 12...
Page 30
1-14 I/O Configuration 0 (0000): Raw Data 1 (0001): Left Align 2 (0010) : Voltage Value 3 (0011) : Percent Value 4 (0100) : Scaled for PID 5 (0101) : User Scale Reserved Bit Position 14 13 12 Reserved • Reserved for future use. Reserved Bit Position 14 13 12...
Page 31
I/O Configuration 1-15 the input of data, and 8 words are allocated to the control area to set each channel. Data Address Mapping Bit Position 15 14 13 12 Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 Channel 5 Control Area Address Mapping Bit Position 15 14 13 12...
Page 32
1-16 I/O Configuration Filter Frequency Format Bit Position 14 13 12 0(0000) : No Filter 1(0001) : 1 KHz 2(0010) : 500 Hz 3(0011) : 100 Hz 4(0100) : 60 Hz 5(0101) : 50 Hz 6(0110) : 10 Hz Enable Bit Position 14 13 12 0: Disable...
Page 33
I/O Configuration 1-17 Open Circuit Bit Position 14 13 12 0 (00): Up Scale 1 (01): Down Scale 2 (10) : Last State 3 (11) : Zero Data Input Type Bit Position 14 13 12 Ω 0 (0000): 100 Pt385 Ω...
Page 34
1-18 I/O Configuration Ω 9 (1001): 120 Ni 618 Ω 11 (1011): 120 Ni 672 Ω 12 (1100): 1~2000 Ω 13 (1101): 1~327 Ω 14 (1110): 1~1200 X8-TC6 Input Image X8-TC6 module is the high-end expantion TC input module with 6-channel TC input.
Page 35
I/O Configuration 1-19 Display Format Bit Position 14 13 12 0 (0000): Raw Data 1 (0001): Percent Value 2 (0010) : Scaled for PID Filter Frequency Format Bit Position 14 13 12 0 (0000): No Filter 1 (0001): 1KHz 2 (0010) : 500Hz 3 (0011) : 100Hz 4 (0100) : 60Hz 5 (0101) : 50Hz...
Page 36
1-20 I/O Configuration Temperature Unit Bit Position 14 13 12 ℉ ℃ Open Circuit Bit Position 14 13 12 0 (00): Up Scale 1 (01): Down Scale 2 (10) : Last State 3 (11) : Zero X8 Instruction Set Reference Manual...
Page 37
I/O Configuration 1-21 Data Input Type Bit Position 14 13 12 0 (0000): K Type 1 (0001): J Type 2 (0010): T Type 3 (0011): B Type 4 (0100): R Type 5 (0101): S Type 6 (0110): E Type 7 (0111): N Type 8 (1000): L Type 9 (1001): U Type 10 (1010): C Type...
Page 38
1-22 I/O Configuration I/O Addressing Addressing Detail Slot Word Delimiter Delimeter Delimiter Xd.s.w.b Data Type Data Slot Word X: Input Table Number Number Number Y: Output Number B: Binary N: Integer ..I/O Addressing schema Format Explanation Input (X), Output (Y), Status (ST), Binary (B), Integer (N), Timer (TM), Counter (CT), Control (CR), ASCII (A), Float (F), Data Type STRING (ST), Long (L), Message (MG), PID (PD), Pulse Limited...
Page 39
I/O Configuration 1-23 Addressing Example Addressing Level Explanation Data Table No. Word X1.0.0.0 Word 0 Input bit 0 Y0.0.0.1 Word 0 Output bit 1 ST8.0.3 Word 0 Status bit 3 Bit Addressing B3.0.15 Word 0 Binary bit 15 N20.0.4 Word 0 Integer bit 4 Addressing Level Explanation...
Page 40
Input Filtering Configurable Input The X8 Series PLC allow users to configure embedded digital I/O of DC inputs for high-speed or normal operation. Users can configure each input's response time. That is, it can be set the duration time that can recognize input signal form the PLC through a configurable input filter function.
Page 41
I/O Configuration 1-25 This function is used to process high-speed counters, latching inputs, and input interrupts. Note that the maximum filtered value is 16mS , and minimum is 5μS. Input filtering is configured using XGPC programming software which RS Automation is supply freely. 1.
Page 42
1-26 I/O Configuration Almost the X8 series PLC Analog modules such as X8-AI4AO2, X8-AI8, X8-AO4, X8-RT6 and X8-TC6 are able to config internal setting value. To use this function, the functions of analog modules, X8-AI4AO2 and X8-AI8, will be changed voltage Input or Current Input.
Page 44
1-28 I/O Configuration Input Channel Filtering The analog input channels use on-board signal conditioning to distinguish AC power line noise from normal variations in the input signal. Frequency components of the input signal at the filter frequency are rejected. Frequency components below the filter bandwidth (-3 dB frequency) are passed with under 3 dB of attenuation.
Page 45
X8-AO4 that supports 4-channels, 16-bit resolution. X8-AI4AO2 has 0~10V DC or 4~20mA output range. The X8 Series PLC have X8-AI4AO2 that supports 2-channels, 12-bit resolution and X8-AO4 that supports 4-channels, 16-bit resolution. X8-AI4AO2 has 0~10V DC or 4~20mA output range. X8-AO4, as high functional product, supports 0~5V, 0~10V, -5~5V and -10~10V voltage output, and 0~20mA and 4~20mA current output depending on the setting.
Page 46
---------------- -x3000 0.457 V 65535 The X8 Series PLC provides the ability to configure latching input ports. A latching input is an input that captures a high-speed pulse signal and holds it for a single PLC scan. The pulse width that can be captured is dependent upon the input filtering selected for that input.
Page 47
I/O Configuration 1-31 Controller X8 Series PLC 0~11 Enable this feature using XGPC: 1. Open the Controller folder on the left and click the Embedded I/O configuration folder. 2. Double click the base module in the Slot 0. 3. If screen appears as shown in the figure below, selects the corresponding bit to activation, and then, select rising (Rising Edge) or falling (Falling Edge).
Page 48
1-32 I/O Configuration Rising Edge Time Chart-Example 1 Scan Number (X) Scan Number (X+1) Scan Number (X+2) Input Ladder Output Output Input Ladder Input Ladder Output Scan Scan Scan Scan Scan Scan Scan Scan Scan External Input Latched Status Input File Value Rising Edge Time Chart-Example 2 Scan Number (X)
Page 49
I/O Configuration 1-33 The external input signal does not displayed in the input data area IMPORTANT when the input port is configured for latching behavior. When the input port configuration is raising Edge in input data area, the data value is normally "off" and "on" when a rising edge is detected.
Page 50
1-34 I/O Configuration Falling Edge Time Chart-Example 2 Scan Number (X) Scan Number (X+1) Scan Number (X+2) Input Ladder Input Ladder Output Input Ladder Output Output Scan Scan Scan Scan Scan Scan Scan Scan Scan External Input Latched Status Input File Value The "gray"...
Page 51
I/O Configuration 1-35 2. From the below screen, select empty slot number for manual setting and then double click. For automatic setting, click "Read I/O Config" button. 3. Expansion module selection screen will be appeared in the manual setting. In automatic setting, all expansion modules currently connected will be displayed automatically.
Page 52
1-36 I/O Configuration 4. For some modules, usually with the default settings, user defined setting is required. The screen below shows setup screen of X8-AI4AO2 module. X8 Instruction Set Reference Manual...
Page 53
Chapter X8 Series PLC Memory and Data Table Introduction This chapter describes Memory and Data Table used by the X8 Series PLC. The chapter is organized as follows: Topic Page Introduction X8 Series PLC Memory Data Table Protecting Data Table During Download...
Page 54
X8 Series PLC Memory and Data Table X8 Series PLC Memory Data Table Structure The X8 Series PLC internal memory comprises Data Table, Special Function Register, and Ladder Program, etc. The data table number 0~2 sown in the table are reserved number for internal uses and cannot be changed.
Page 55
Channel 1 User Memory User memory is the amount of storage of X8 Series PLC available to store user defiend data such as ladder program, data tables, and I/O configuration. User Memory consist of the system status data, I/O image files, and all other user-creatable data tables.
Page 56
64KW limited user memory size in the PLC. X8 Series PLC User Memory The X8 Series PLC supports64KW of memory for data and programs. And X8 Series PLC suuports seperate 4GB SD memory for data logging, recipe, ladder backup.
Page 57
X8 Series PLC Memory and Data Table 2. The amount of Memory Used will appear in the Controller Properties window. Data Table Data Table Operand Data Table No. Words per Description Element The output image data table stores the actual output value of the...
Page 58
X8 Series PLC Memory and Data Table Data Table Operand Data Table No. Words per Description Element Binary Binary typed Data Table for bit logic. Timer Data Tablefor timer operation. Counter Data Table for counter operation. The contorl data table is used for various purposes (Error, Length, Contorl Position, etc.) in the Ladder Program.
Page 59
All protected data table numbers, types, and sizes (number of elements) currently in the controller exactly match. If all of these conditions are met, the X8 Series PLC will not write over any data table in the PLC that is configured as Protected.
Page 60
PLC is changed, SR2.36.10 register status in the screen is changed to "ON" status. The X8 Series PLC will not reset the SR2.36.10 register automatically. Static part of Properties in the Data Table defines whether it can change its Static value through communication.
Page 61
X8 Series PLC Memory and Data Table Programmable Limit Switch (PS) Routing Path (RP) X8 Series PLC supports powerful threefold password protection system using Password characters include special characters never before seen in the existed small PLC. PLC System Passwords consist of up to 12 characters include special characters.
Page 62
2-10 X8 Series PLC Memory and Data Table Even the X8 Series PLC password system supports more powerful threefold protection system that is consist of up to 12 characters include special characters, if a password is lost or forgotten, there is no way to bypass the password to recover the program.
Page 63
3. If you reply "yes" to this prompt, the programming software instructs the controller to clear PLC memory. This allows open to public X8 Series PLC's internal data table via Web. Allow Access Data Table Only offline setting is avaiable. If it is online status, it cannot be selected.
Page 64
2-12 X8 Series PLC Memory and Data Table X8 Instruction Set Reference Manual...
Page 65
Chapter SFR (Special Function Register) Introduction This chapter describes Special Function Registers include internal configuration and status data of X8 Series PLC. The chapter is organized as follows. Topic Page Introduction Overview Real-Time Clock Register RTCA-Real Time Clock Adjust Instruction...
Page 66
SFR (Special Function Register) Overview Function Resister) are embedded default resources within the X8 SFR (Special series PLC. SFR provide useful features such as RTC (Real Time Clock), HSC (High Speed Counter), and PTO (Pulse Trained Output), etc. SFR (Special Function Register) Type SFR Name Description Identifier...
Page 67
SFR (Special Function Register) The real-time clock provides year, month, day of month, day of week, hour, Real-Time Clock Register minute, and second information to the Real-Time Clock (RTC) data table in the PLC. The Real-Time Clock parameters and their valid ranges are shown in the table below Feature Address...
Page 68
SFR (Special Function Register) An example write MSG from another X8 Series PLC to synchronize their RTCs is shown here: The RTC in SFR screen is shown below: When valid data is sent to the real-time clock from the programming device or another PLCs, the new values are stored to the RTC immediately .
Page 69
SFR (Special Function Register) Ambient Temperature Accuracy (1) 0°C (+32°F) -13…-121 seconds/month +25°C (+77°F) +54…-54 seconds/month +40°C (+104°F) +29…-78 seconds/month +55°C (+131°F) -43…-150 seconds/month (1)These numbers are worst case values. RTCA-Real Time Clock Adjust Instruction RTCA Instruction Type: output The RTCA instruction is used to synchronize the PLC Real-Time Clock (RTC) with an external source.
Page 70
Do not use more than one RTCA instruction in your program. You can also use a MSG instruction to write RTC data from X8 Series PLC to another to synchronize time. The X8 Series PLC has a Memory Card Data Table which is stores SD Memory Card Information memory cards information.
Page 71
SFR (Special Function Register) MCI Data Table Parameters Parameters Address Data Format Type User Program Access LoadProgramCompare MCI.0.LOADPROGRAMCOMPARE Binary Control Read Only LoadOnError MCI.0.LOADONERROR Binary Control Read Only LoadAlways MCI.0.LOADALWAYS Binary Control Read Only Functionality Type The flag is used to check the compatibility of the user program stored in the memory card MemoryCardPresent The MemoryCardPresent flag can be used in the user program to determine...
Page 72
The Communications Status Data Table is a read-only data table that contains Communications Status status information on how the X8 Series PLC internal communication ports Data Table configuration and various registers, and located on CS0, CS1, CS2 and ES3 in the SFR.
Page 73
MSG instruction is serviced, this bit is cleared. MCP - Outgoing Message Command Pending Bit This bit is set when the X8 Series PLC has one or more MSG instructions enabled and in the communication queue. This bit is cleared when the queue is empty.
Page 74
PLC on the network. 8 ~15 Baud Rate This byte value contains the baud rate of the X8 Series PLC on the network. Diagnostic Counter Block of Communications Status Data Table With XGPC, displays of the diagnostic counters for PLCs are available.
Page 75
SFR (Special Function Register) 3-11 Xnet Master Communication Port Counters Block Word Description Diagnostic Counters Category Identifier Length (always 30) Format Code (always 1) Reserved Reserved 4~15 Reserved Total Message Packets Sent Total Message Packets Received Undelivered Message Packets ENQuiry Packets Sent NAK Packets Received ENQuiry Packets Received Bad Message Packets Received and NAKed...
Page 76
3-12 SFR (Special Function Register) Word Description Diagnostic Counters Category Identifier Length (always 30) Format Code (always 1) Reserved Reserved 4~15 Reserved Total Message Packets Sent Total Message Packets Received Undelivered Message Packets ENQuiry Packets Sent NAK Packets Received ENQuiry Packets Received Bad Message Packets Received and NAKed No Buffer Space Duplicate Message Packets Received...
Page 77
SFR (Special Function Register) 3-13 Word Description Diagnostic Counters Category Identifier Length (always 30) Format Code (always 1) Reserved Reserved 4~15 Reserved Total Message Packets Sent Total Message Packets Received Undelivered Message Packets ENQuiry Packets Sent NAK Packets Received ENQuiry Packets Received Bad Message Packets Received and NAKed No Buffer Space Duplicate Message Packets Received...
Page 78
3-14 SFR (Special Function Register) Word Description No Buffer Space Duplicate Message Packets Received 19~22 Reserved DF1 Half-Duplex Slave Diagnostic Counters Block Word Description Diagnostic Counters Category Identifier Length (always 30) Format Code (always 1) Reserved Reserved 4~15 Reserved Total Message Packets Sent Total Message Packets Received Undelivered Message Packets ENQuiry Packets Sent...
Page 79
SFR (Special Function Register) 3-15 DF1 Half-Duplex Master Diagnostic Counters Block Word Description Diagnostic Counters Category Identifier Code (always 2) Length (always 30) Format Code (always 3) Reserved Reserved 4~15 Reserved Total Message Packets Sent Total Message Packets Received Undelivered Message Packets Message Packets Retried Reserved Polls Sent...
Page 80
3-16 SFR (Special Function Register) Modbus RTU Slave Diagnostic Counters Block (Data Link Layer) Word Description Diagnostic Counters Category Identifier Code (always 2) Length (always 30) Format Code (always 4) Reserved Reserved Reserved Total Message Packets Sent Total Message Packets Received for This Slave Total Message Packets Received Link Layer Error Count Link Layer Error Code...
Page 81
SFR (Special Function Register) 3-17 Word Description Execution Function Error Code Last Transmitted Exception Error Code Data Table Number of Error Request Element Number of Error Request Modbus RTU Slave Diagnostic Counters Block (Presentation Layer) Word Description Function Code 1 Message Counter Function Code 2 Message Counter Function Code 3 Message Counter Function Code 4 Message Counter...
Page 82
3-18 SFR (Special Function Register) Word Description Reserved Reserved 4~15 Reserved Total Message Packets Sent Reserved Total Message packets Received Modbus RTU Master Diagnostic Counters Block (Data Link Layer) Word Description Link Layer Error Count Link Layer Error Code 15~22 Reserved Modbus RTU Master Diagnostic Counters Block (Presentation Layer) Word...
Page 83
SFR (Special Function Register) 3-19 ASCII Diagnostic Counters Block Word Description Diagnostic Counters Category Identifier (Always 2) Length (Always 30) Format Code (Always 5) Reserved Reserved 4~15 Reserved Software Handshaking Status 1~15 Reserved Echo Character Count Received Character Count 13~18 Reserved Bad Character Count 20~22...
Page 84
3-20 SFR (Special Function Register) Active Node Table Block Word Description Active Node Category Identifier Code (Always 3) Length: • Always 18 for DF1 Half-Duplex Master Communication • Always 0 for DF1 Full-Duplex Master, DF1 Half-Duplex Slave, Modbus RTU Slave, Modbus RTU Master, ASCII Communication Format Code (Always 0) Number of Nodes: •...
Page 85
SVC, or REF), this bit is OFF. MCP - Outgoing Message Command Pending Bit This bit is ON when the X8 Series PLC has one or more MSG instructions enabled and in the communication queue. This bit is OFF when the queue is empty.
Page 86
This bit is ON when the SNMP server is enabled. The OFF means that the SNMP server is disabled. HTTP Server Status This bit is ON when the internal X8 Series PLC web server is enabled. The OFF means that the internal web server is disabled.
Page 87
SFR (Special Function Register) 3-23 General Channel Status Blcok Word Description Forced Duplex Mode Status This bit set (1) when the Auto Negotiation function is disabled and the Ethernet port’s duplex mode is Full Duplex. Forced Duplex Mode Status This bit set (1) when the Auto Negotiation function is disabled and the Ethernet port's duplex mode is Full Duplex.
Page 88
3-24 SFR (Special Function Register) General Channel Status Blcok Word Description 53 ~ 84 SNMP Contact SNMP Contact information is stored. 85 ~ 116 SNMP Location SNMP Location information is stored. Message Connection Timeout The amount of Timeout of the MSG instruction is stored. The MSG Connection Timeout has a range of 250 ms ~ 65,500 ms.
Page 89
SFR (Special Function Register) 3-25 Word Description DLL Diagnostic Counters Category Identifier Code (always 2) Length: 110 (55 words to follow including format code) Counters Format Code: Ethernet (always 0) Low word RMON Rx Octets High word (RMON_R_OCTETS) Low word RMON Tx Octets High word (RMON_T_OCTETS)
Page 90
3-26 SFR (Special Function Register) Word Description Low word RMON Tx Collision Count High word RMON_T_COL) Low word Total Commands Sent High word Low word Total Commands Received High word Low word Total Replies Sent High word Low word Total Replies Received High word Low word Total Replies Sent with Error...
Page 91
Chapter Programming Instruction Overview This chapter describes X8 Series PLC Programming Insturcution Overview. The Introduction chapter is organized as follows. Topic Page Introduction X8 Instruction Group Instruction Descriptions X8 Instruction Set Reference Manual...
Page 92
Programming Instruction Overview The following table shows the X8 Series PLC programming instructions listed X8 Instruction Group within their functional group. Instruction Group Descriptions HSCS, HSCC High-Speed Counter Input The high-speed counter instructions allow you to monitor and control the high-speed counter. Generally used with DC inputs.
Page 93
The X8 Series PLC supports three types of data addressing: • Immediate • Direct • Indirect The X8 Series PLC do not support indexed addressing. Indexed addressing can be duplicated with indirect addressing. Each of the addressing modes are described below. Immediate Addressing Immediate addressing is the most basic addressing mode and primarily used to assign numeric constants directly to X8 Series PLC data table.
Page 94
Programming Instruction Overview Direct Addressing When you use direct addressing, you can input a specific data table elements of internal X8 Series PLC (below is an example of N4.1) as shown in the example below. B3.0.0 0002 N4.1 - IN 1 OUT - N4:2 0 <...
Page 95
Programming Instruction Overview If you access to a number lager than the number of elements specified from the data table through Indrect Addressing method, 28 H error (runtime error and ladder progrm error) will be occurred. For the initial compiling, any errors could not be founded because there is no grammatical errors.
Page 96
Programming Instruction Overview Do not allocate 4,096 or more in the Indirect Addressing method. X8 Instruction Set Reference Manual...
Page 97
Chapter Using the High-Speed Counter and Programmable Limit Switch Introduction This chapter describes high-speed counter and programmable limit switch. This chapter organized as follows: Topic Page Introduction High-Speed Counter Overview Programmable Limit Switch High-Speed Counter (HSC) Function Register High-Speed Counter SFR Elements HSC SFR Sub-Elements HSCS - Set High-Speed Counter Value 5-28...
Page 98
Using the High-Speed Counter and Programmable Limit Switch All X8 Series PLC have six 100kHz high-speed counters. There are three High-Speed Counter main high-Speed counters (counter 0, 1, 2) and three sub high speed counters Overview (counter 3, 4, 5). Each main high-speed counter has four dedicated inputs and each sub high-speed counter has two dedicated inputs.
Page 99
HSC for any one of ten modes and the sub HSC for any one of five modes of operation. The HSC SFR of X8 Series PLC is comprised of 37 sub-elements for control High-Speed Counter SFR and status output .
Page 100
Using the High-Speed Counter and Programmable Limit Switch Address Data Format HSC Modes(1) Function User Program Access HSC.0.LowPresetMask 2...9 Control Read / Write HSC.0.HighPresetMask 0...9 Control Read / Write HSC.0.UnderflowMask 2...9 Control Read / Write HSC.0.OverflowMask 0...9 Control Read / Write HSC.0.Mode Word (INT) 0...9...
Page 101
Using the High-Speed Counter and Programmable Limit Switch 37 sub-elements of the HSC SFR of X8 Series PLC is described. All examples HSC SFR Sub-Elements illustrate based on HSC0. LadderProgramNumber Address Data Format HSC Mode Function User Program Access HSC.0.LadderProgramNumber...
Page 102
The AutoStart is stored as part of the user program and is used when the HSC function is automatically started if the X8 Series PLC is in run or test mode. The CountingEnabled bit must also be set to enable the HSC functions.
Page 103
Using the High-Speed Counter and Programmable Limit Switch LowPresetMask Description Data Format HSC Mode Function User Program Access HSC.0. LowPresetMask Control Read/Write The LowPresetMask control bit is used to control the Low Preset Interrupt bit. If this bit is clear (0), the HSC user interrupt is not executed when the HSC condition is reaches to the Low Preset.
Page 104
Using the High-Speed Counter and Programmable Limit Switch OverflowMask Description Data Format HSC Mode Function User Program Access HSC.0. OverflowMask Control Read/Write The OverflowMask control bit is used to control the overflow interrupt. If this bit is clear(0), he HSC user interrupt is not executed when the HSC condition is reaches to the High Preset.
Page 105
Using the High-Speed Counter and Programmable Limit Switch HSC Operating Modes Mode Number Type Up Counter The accumulator is immediately cleared (0) when it reaches the high preset. A low preset cannot be defined in the mode 0. Up Counter with external reset and hold The accumulator is immediately cleared (0) when it reaches the high preset.
Page 106
5-10 Using the High-Speed Counter and Programmable Limit Switch Counting Method according to Multiplication and Phase Difference Description Phased input Counting every falling edge in phase A, and check signal level in phase B to check direction of rotation. X4 High-Speed Counter Performance Count at falling edge and rising edge in Phase A and Phase B.
Page 107
Using the High-Speed Counter and Programmable Limit Switch 5-11 I.0.0.0 I.0.0.1 I.0.0.2 I.0.0.3 I.0.0.4 I.0.0.5 I.0.0.6 I.0.0.7 I.0.0.8 I.0.0.9 I.0.0.10 I.0.0.11 HSC:0 Reset HSC:1 Reset Hold HSC:2 Reset Hold HSC:3 HSC:4 HSC:5 HSC Function Operating Modes & Input Assignments Modes of Operation Input0 (HSC:0) Input 1 (HSC:0) Input 2 (HSC:0)
Page 108
5-12 Using the High-Speed Counter and Programmable Limit Switch Modes of Operation Input0 (HSC:0) Input 1 (HSC:0) Input 2 (HSC:0) Input 3 (HSC:0) Mode Value in Input4 (HSC:1) Input 5 (HSC:1) Input 6 (HSC:1) Input 7 (HSC:1) User Program Input 8 (HSC:2) Input 9 (HSC:2) Input 10 (HSC:2) Input 11 (HSC:2)
Page 109
Using the High-Speed Counter and Programmable Limit Switch 5-13 ↑ ↓ Blank cells = don’t care, = rising edge, = falling edge HSC Mode 2 - Counter with External Direction HSC Mode 2 - Counter with External Direction Example Input X1.0.0.0 (HSC0) X1.0.0.0 (HSC0) X1.0.0.0 (HSC0)
Page 110
5-14 Using the High-Speed Counter and Programmable Limit Switch HSC Mode 4 - Two Input Counter (up and down) HSC Mode 4 Examples Input X1.0.0.0 (HSC0) X1.0.0.0 (HSC0) X1.0.0.0 (HSC0) X1.0.0.0 (HSC0) Comments Terminals Function Count Up Count Down Not Used Not Used HSC Accumulator +1 ↑...
Page 111
Using the High-Speed Counter and Programmable Limit Switch 5-15 The High-speed counter can be reset using the Z input. The Z outputs from the encoders typically provide one pulse per revolution. Input 0 Encoder Input 1 Input 2 (Reset Input) Counter HSC Mode 6 - Quadrature Counter (phased inputs A and B) HSC Mode 6 - Quadrature Counter (phased inputs A and B) Example...
Page 112
5-16 Using the High-Speed Counter and Programmable Limit Switch HSC Mode 7 - Quadrature Counter (phased inputs A and B) With External Reset and Hold HSC Mode 7 - Quadrature Counter (phased inputs A and B) With External Reset and Hold Example Input X1.0.0.0 (HSC0) X1.0.0.0 (HSC0)
Page 113
Using the High-Speed Counter and Programmable Limit Switch 5-17 HSC Mode 9 - Quadrature X4 Counter with External Reset and Hold HSC Mode 9 - Quadrature X4 Counter with External Reset and Hold Example X1.0.0.1(HSC0) (A) X1.0.0/1(HSC0) (B) X1.0.0.2(HSC0) X1.0.0.3(HSC0) Value of CE Bit Accumulator and Counter (reset)
Page 114
5-18 Using the High-Speed Counter and Programmable Limit Switch The HighPreset is the high preset configuration value of the counter that is used in the HSC. When the SetParameter bit is changed from 0 to 1, the HighPreset value is loaded into the HSC so that can be operated from the HSC.
Page 115
Using the High-Speed Counter and Programmable Limit Switch 5-19 Underflow Description Data Format HSC Mode Function User Program Access HSC.0.Underflow Status Read/Write The Underflow flag is set when the accumulated value decreases the lower setpoint or Underflow value. If this flag is set, any PLC error does not generated.
Page 116
5-20 Using the High-Speed Counter and Programmable Limit Switch HighPresetOutput Description Data Format HSC Mode Function User Program Access Word (16 bit HSC.0.HighPresetOutput Control Read/Write binary) The HighPresetOutput shows the state (1 = ON or 0 = OFF) of the outputs on the controller when the accumulator value is reaches to the high preset.
Page 117
Using the High-Speed Counter and Programmable Limit Switch 5-21 Error Code Error Name Mode Description Invail ed High Preset If the high preset value is less than 0 This error is generated when the high preset value is less than or Invalid High Preset equal to the low preset.
Page 118
5-22 Using the High-Speed Counter and Programmable Limit Switch UserInterruptPending Description Data Format HSC Mode Function User Program Access HSC:0.UserInterruptPending Status Read Only The UserInterruptPending status flag that represents an interrupt is pending by the specific conditions. This flag is used to detect in the user control program if an HSC interrupt is executing and will be automatically cleared when the PLC completes its processing.
Page 119
Using the High-Speed Counter and Programmable Limit Switch 5-23 • . PLC enters an executing mode HighPresetInterrupt Description Data Format HSC Mode Function User Program Access HSC:0.HighPresetInterrupt Status Read/Write The HighPresetInterrupt status bit is set when the HSC accumulator reaches the high preset value and the HSC interrupt has been triggered.
Page 120
5-24 Using the High-Speed Counter and Programmable Limit Switch The HowPresetReached flag is set when the HSC accumulator value is less than or equal to the high preset. This bit is updated continuously by the HSC s whenever the PLC is in a run mode.
Page 121
Using the High-Speed Counter and Programmable Limit Switch 5-25 • Overflow Interrupt executes • PLC enters an executing mode CountDirection Description Data Format HSC Mode Function User Program Access HSC:0.CountDirection Status Read Only The CountDirection flag represents the HSC directions. When the HSC accumulator counts up, the direction flag is set.
Page 122
5-26 Using the High-Speed Counter and Programmable Limit Switch CountUp Description Data Format HSC Mode Function User Program Access HSC:0.CountUp Status Read Only The CountUp flag is used to the HSC mode from 0 to 9. When the CountingEnabled Bit is set, the CountDown flag is set. Overflow Description Data Format...
Page 123
Using the High-Speed Counter and Programmable Limit Switch 5-27 To set the Underflow value, toggles the SetParameter bit (from OFF to ON) and the Underflow value stored in the SFR is transferred to the HSC. The value stored in the Underflow must be less than or equal to the Low Preset or an HSC error is generated.
Page 124
5-28 Using the High-Speed Counter and Programmable Limit Switch HSCS - Set High-Speed Counter Value HSCS HSC0 - HSC Number N4.0 - High Preset N4.1 - Low Preset N4.3 - Output High Source N4.4 - Output Low Source Instruction Type: output Data Size: Word, Long Word The HSCS instruction allows the high and low presets, and high and low output source to be applied to a high-speed counter.
Page 125
Using the High-Speed Counter and Programmable Limit Switch 5-29 HSCC - Clear High-Speed Counter Value HSCC HSC0 - Counter 0 - Source Instruction Type: output The HSCC instruction resets the HSC and allows a specific value to be written to the HSC accumulator. •...
Page 126
5-30 Using the High-Speed Counter and Programmable Limit Switch The Programmable Limit Switch function allows you to configure the HSC to High-Speed Counter (HSC) operate as a rotary cam switch. Data Table When the Programmable Limit Switch (PS) operation is enabled through the PlsTableNumber of HSC in the SFR, the PS data table can be used for Limit Position and CAM position.
Page 127
Using the High-Speed Counter and Programmable Limit Switch 5-31 Using Programmable Limit Switch The X8 Series PLC is in the run mode, and when the PLS function is enabled, the HSC will count incoming pulses. When the HSC accumulator data reaches X8 Instruction Set Reference Manual...
Page 128
5-32 Using the High-Speed Counter and Programmable Limit Switch the High Preset or Low preset defined in the PS data table, the filtered data will be written to defined data table through the HSC mask. At that point, the next preset defined in the PS file becomes active.When the HSC counts to that new preset, the new output data is written through the HSC mask.
Page 129
Using the High-Speed Counter and Programmable Limit Switch 5-33 2. Right click on Data Table of XGPC and select “New” menu. 3. Select PS (Programmable Limit Switch) in the Data Table Type menu. X8 Instruction Set Reference Manual...
Page 130
5-34 Using the High-Speed Counter and Programmable Limit Switch 4. Enter the number of the Data Table Number (Max. 1535) and Elements (Max. 1535). Description is optional. 5. Then, enter the number of Elements. The number of Elements means the number of steps of the Programmable Limit Switch.
Page 131
Using the High-Speed Counter and Programmable Limit Switch 5-35 6. You can see the PS data table created before is assigned to 12 and added on the project window as below. 7. Double click the new PS data table and see the contents. The Elements is set to 4 on the above step, 4 elements from PS12.0 to PS12.3 are created in the screen below.
Page 132
5-36 Using the High-Speed Counter and Programmable Limit Switch 8. Enter 500,100,1500 and 2000 as HighPreset value. 9. Specifies the SFR (Special Function Register) for inter working with HSC and double click the Special Function Register in the Project window . 10.
Page 133
Using the High-Speed Counter and Programmable Limit Switch 5-37 11. When the HSC accumulator value reaches to 500 specified to the HighPrest of the first PS, If you use OutputHighData value and HighPresetMask, it outputs the result value that masked value and logical ANDed value.
Page 134
5-38 Using the High-Speed Counter and Programmable Limit Switch X8 Instruction Set Reference Manual...
Page 135
Chapter Using High-Speed Outputs Introduction This chapter explains about using high-speed outputs of the X8 Series PLC. This chapter organized as follows: Topic Page Introduction PTO - Pulse Train Output Pulse Train Output Function SFR (Special Function Register) PTO Sub-Elements...
Page 136
Using High-Speed Outputs High-speed output (PTO and PWM) functions of X8 Series PLC support up PTO - Pulse Train Output to 100KHz, and it would be applied to simple motion control and High-speed pulse output. The PTO function is only available for Embedded I/O in the base module (CPU) and cannot be used as an External expansion I/O.
Page 137
Using High-Speed Outputs Users can input only three items above to set PTO set in SFR and create example for simple pulse output by using the PTO instruction in the ladder program. The figure above is four parameters of the SFR . B3.0.0 PTO Address The figure above shows simple PTO operating program based on the SFR...
Page 138
Using High-Speed Outputs • When B3.0.0 is cleared, the IdleStatus is set and PTO is in a Idle state. The graph above shows the graph according to the set value of the above behavior. Each Status Bit is updated for every scan during the execution of the PTO. When the invalid AccelDecelPulses and OutputFrequency data IMPORTANT is input, PTO error will be generated.
Page 139
Using High-Speed Outputs PTO Function Following is the SFR screen of the PTO instruction as mentioned above. Elements for PTO control is described in this chapter. The variables within each PTO sub-element are listed individually below. All SFR (Special Function examples illustrate PTO:0.
Page 140
Using High-Speed Outputs SFR PTO Sub-Element (PTO.0) Address and sub-element Data Format Range User Program Access Status PTO.0.ErrorCode Word (INT) -2 ~ 7 Read Only PTO.0.Done 0 or 1 Read Only PTO.0.DeceleratingStatus 0 or 1 Read Only PTO.0.RunStatus 0 or 1 Read Only PTO.0.AcceleratingStatus 0 or 1...
Page 141
Using High-Speed Outputs PTO.0.Done Address Data Format HSC Mode Function User Program Access PTO.0.Done 0 or 1 Status Read Only The PTO.0.Done flag bit is set when the PTO pulse output has completed its operation. When the EN signal of PTO instruction is false, or if the PTO instruction is run, the PTO.0.Done bit remains set until the PTO.0.Done bit is cleared.
Page 142
Using High-Speed Outputs The PTO.0.AcceleratingStatus bit is set when the PTO instruction is within the acceleration phase. It is cleared when the PTO instruction is within the run phase. PTO.0.RampProfile Address Data Format HSC Mode Function User Program Access PTO.0.RampProfile 0 or 1 Control Read / Write...
Page 143
Using High-Speed Outputs PTO.0.NormalOperationStatus Address Data Format HSC Mode Function User Program Access PTO.0.NormalOperationStatus 0 or 1 Status Read / Write The PTO.0.NormalOperationStatus flag is set when the PTO is in the nomal state. A normal state is ACCEL, RUN, DECEL or DONE, with no PTO errors.
Page 144
6-10 Using High-Speed Outputs PTO.0.OutputFrequency Address Data Format HSC Mode Function User Program Access PTO.0.OutputFrequency Long Word 0 ~ 100,000 Control Read /Write The PTO.0.OutputFrequency variable defines the frequency of the PTO output during the run phase. The maximum range is from 0 to 100,000Hz (100KHz).
Page 145
Using High-Speed Outputs 6-11 The PTO.0.OutputPulsesProduced monitors how many pulses have been generated by the PTO. PTO.0.AccelDecelPulsesIndependent Address Data Format HSC Mode Function User Program Access PTO.0.AccelDecelPulsesIndependent 0 or 1 Control Read / Write The PTO.0.AccelDecelPulsesIndependent bit is used to define whether the acceleration and deceleration intervals will be the same, or if each will have a unique value.
Page 146
6-12 Using High-Speed Outputs This cannot be changed like other SFR once the program is downloaded into the controller. If this flag is set, PTO error -3 is generated when the data combinations of data file number and element number is not entered or invalid data is entered. PTO.0.AccelDecelPulses Address Data Format...
Page 147
Using High-Speed Outputs 6-13 For more descriptions, refer to PTO.0.AccelDecelPulsesIndependent. Followings are error conditions according to the PTO.0.AccelDecelPulses data • PTO.0.AccelDecelPulses is less than 0 • The total pulses for the PTO.0.AccelDecelPulses acceleration and deceleration pulse is greater than the total output pulses (PTO.0.TotalOutputPulses) (PTO.0.AccelDecelPulsesIndependent is 0 or 1) In the example below shows the PTO.0.AccelDecelPulsesIndependent is 0.
Page 148
6-14 Using High-Speed Outputs PTO.0.OutputFrequency ) ] +0.5 = [PTO.0.OutputFrequency X ( PTO.0.OutputFrequency = 0.999 X PTO.0.OutputFrequency X √ PTO.0.ControlledStop Address Data Format HSC Mode Function User Program Access PTO.0.ControlledStop 0 or 1 Control Read / Write The PTO.0.ControlledStop bit is used to stop an executing PTO instruction. Following two graphs show that the PTO is stop forcedly by PTO.0.ControlledStop=1 within the run phase, and within the acceleration phase.
Page 149
Using High-Speed Outputs 6-15 PTO.0.JogFrequency Address Data Format HSC Mode Function User Program Access PTO.0.JogFrequency Long Word 0 ~ 100,000 Control Read / Write The PTO.0.JogFrequency variable defines the frequency of the PTO output during all Jog phases. The range of frequency is 0 ~ 100,000 (Hz). This value is typically determined by the type of device that is being driven, the mechanics of the application, or the device/components being moved.
Page 150
6-16 Using High-Speed Outputs PTO.0.JogPulseStatus Address Data Format HSC Mode Function User Program Access PTO.0.JogPulseStatus 0 or 1 Status Read Only The PTO.0.JogPulseStatus bit is set when the PTO instruction detects the PTO has generated a Jog Pulse. PTO.0.JogContinuous Address Data Format HSC Mode Function...
Page 151
The PWM function can only be used with the controller's embedded I/O. It cannot be used with expansion I/O modules. The PWM instruction should only be used with X8 Series PLC. Relay outputs are not capable of performing very high-speed operations.
Page 152
PTO and PWM data update, it can be controlled by the STI (Selectable Timed Interrupt) that can be set in SFR. The PWM output ports supported by the X8 Series PLC is allocated to have Y0.0.2, Y0.0.3, and Y0.0.4. The element is shown below.
Page 153
Using High-Speed Outputs 6-19 The variables within each PWM element, along with what type of behavior and PWM Data Table Elements access the control program has to those variables, are listed individually below. Summary Address and Element Data Format Range User Program Access Contorl...
Page 154
6-20 Using High-Speed Outputs Output Embedded Output Port PTO.0.Output=2 Y0.0.2 PTO.0.Output=3 Y0.0.3 PTO.0.Output=4 Y0.0.4 PWM.0.ProfileParameterSelect Address Data Format HSC Mode Function User Program Access PWM.0.ProfileParameterSelect 0 or 1 Status Read Only The PWM.0.ProfileParameterSelect flag is used to set which waveform is output: •...
Page 155
Using High-Speed Outputs 6-21 The PWM.0.OutputFrequency bit is specify the frequency of the PWM. This frequency can be changed at any time unlike the PTO. PWM.0.DutyCycle Address Data Format HSC Mode Function User Program Access PWM.0.DutyCycle Word 0 ~1000 Control Read / Write The PWM.0.DutyCycle is used to define the Duty Cycle.
Page 156
6-22 Using High-Speed Outputs PWM.0.DeceleratingStatus Address Data Format HSC Mode Function User Program Access PWM.0.DeceleratingStatus 0 or 1 Status Read Only The PWM.0.DeceleratingStatus bit is set when the PWM output is within deceleration phase. • Set (1) - Whenever a PWM instruction is within the deceleration phase. •...
Page 157
Using High-Speed Outputs 6-23 PWM.0.ErrorDetectedStatus Address Data Format HSC Mode Function User Program Access PWM.0.ErrorDetectedStatus 0 or 1 Status Read Only The PWM.0.ErrorDetectedStatus bit is set when the PWM error is detected. • Set (1) - Whenever the PWM error is detected. •...
Page 158
6-24 Using High-Speed Outputs PWM.0.OperatingFrequencyStatus Address Data Format HSC Mode Function User Program Access PWM.0.OperatingFrequency Status Long Word 0 ~100,000 Status Read Only The PWM.0.OperatingFrequencyStatus bit shows the frequency that the PWM is executed. PWM.0.DutyCycleStatus Address Data Format HSC Mode Function User Program Access...
Page 159
Chapter Relay-Type (Bit) Instructions Introduction This chapter describes the X8 Series PLC relay-type (bit) instructions. This chapter organized as follows. Topic Page Introduction NOC- Normal Open Contact NCC - Normal Closed Contact OUT - Output Coil SET - Set Coil RST - Reset Coil...
Page 160
Relay-Type (Bit) Instructions Use relay-type (bit) instructions to control bits such as ON/OFF input and output bits. The following instructions are described in this chapter: Instruction Description Normally Open Contact Normally Closed Contact Output Coil Set Coil Reset Coil Edge Rising ONSR One Short Rising ONSF...
Page 161
Relay-Type (Bit) Instructions TM9.0.Done • Check Binary typed data table B3.0.0 • Check Binary type data table value B3.0.0 Address Address Parameter Data Table Mode Level √ √ √ √ √ √ √ √ √ √ √ √ √ √ √...
Page 162
Relay-Type (Bit) Instructions • Power Cycle (Off -> ON) • The OUT is programmed within an inactive or false MCR (Master Control Reset) zone. A bit that is set within a subroutine using an OUT instruction remains set until the OUT is scanned again. Address Address Parameter...
Page 163
Storage bit remains SET (1) FALSE TRUE to TRUE Storage bit is CLEARD (0) FALSE FALSE to FALSE The EGR instruction of the X8 Series PLC is functionally the same as the ONSR (ONe Shot Rising) instruction. X8 Instruction Set Reference Manual...
Page 164
Relay-Type (Bit) Instructions Address Address Parameter Data Table Mode Level √ √ √ √ √ ONSR - One Shot Rising ONSF - One Shot Falling ONSR Storage Bit B3.0.8 - Output Bit - Y0.0.0.3 ONSF Storage Bit B3.0.9 - Output Bit - Y0.0.0.4 Instruction Type: input Use the ONSR and ONSF instructions to trigger an event to occur one time.
Page 165
Relay-Type (Bit) Instructions ONSF Instruction Table Rung Transition Storage Bit Rung State after Execution FALSE to TRUE (1 Scan) TRUE to TRUE TRUE to TRUE FALSE to FALSE Since the output bit data is remains for 1 scan, you can apply the SET instruction like below.
Page 166
Relay-Type (Bit) Instructions X8 Instruction Set Reference Manual...
Page 167
Chapter Timer and Counter Instructions Introduction In this chapter, the X8 Series PLC Timer and Counter Instructions are described. This chapter organized as follows Topic Page Introduction Timer Instructions Overview TON - Timer, On-Delay TOF - Timer, Off-Delay TOR - Retentive Timer, On-Delay...
Page 168
Timer and Counter Instructions Timers and counters are output instructions that let you control operations based on time. The following Timer and Counter Instructions are described in this chapter: Instruction Description Timer ON Timer OFF TONR Retentive Timer Count up Count down RSTA Accumulator Initialization (Reset)
Page 169
Timer and Counter Instructions ACC - 0 TM9.0 - Timer 0.001 - BASE 100 < Enable Done Following table shows the timer data table elements. Element Data Type Access Description TimeBase0 Read / Write Time setting based on timer TimeBase1 Read / Write Done Read Only...
Page 170
Timer and Counter Instructions Timer accuracy refers to the length of time between the moment a timer instruction is enabled and the moment the timed interval is complete. Timer Accuracy Time Base Accuracy 0.001 seconds -0.001 ~ 0.00 0.01 seconds -0.01 ~ 0.00 1.00 seconds -1.00 ~ 0.00...
Page 171
Timer and Counter Instructions TON - Timer, On-Delay ACC > 0 TM9.0 - Timer 0.01- BASE 10 < Enable Done Instruction Type: output Use the TON instruction to delay turning on an output. The TON instruction begins to count time base intervals when rung conditions become true.
Page 172
Timer and Counter Instructions B3.0.14 TM9.1 - Timer ACC - 0 1.0 - BASE 2 < Enable Done • If the rung condition is false, the TOF timer is timing. As long as rung conditions remain false, the Enable bit is cleared. The Done bit is configured since the TOF timer is timing.
Page 173
Timer and Counter Instructions Because the RSTA instruction resets the accumulated value and ATTENTION internal flags, do not use the RES instruction to reset a timer address used in a TOF instruction. If the TOF accumulated value and status bits are reset, unpredictable machine operation may occur.
Page 174
Timer and Counter Instructions After the free running clock reaches 0xFFFFFFFF (42949.67295 seconds) value, it wraps around to 0 and continues incrementing. Address Parameter Data Table Address Mode Level Output √ √ √ √ √ CLKC - Compute Time Difference CLKC OUT - F5.6 F5.4 - Start...
Page 175
Timer and Counter Instructions The figure below demonstrates how a counter works. The count value must How Counters Work remain in the range of Low Preset -2,147,483,647 ~ High Preset +2,147,483,647. If the count value goes above +2,147,483,647, the counter status overflow bit is set (1).
Page 176
8-10 Timer and Counter Instructions CT.10.0.Underflow Address Data Format HSC Mode Function User Program Access CT.10.0.Underflow 0 or 1 Status Read / Write This bit is set when the accumulator value is less than -2,147,483,647. CT.10.0.Overflow Address Data Format HSC Mode Function User Program Access...
Page 177
Timer and Counter Instructions 8-11 CT.10.0.CountUp Address Data Format HSC Mode Function User Program Access CT.10.0.CountUp 0 or 1 Status Read Only This bit is set when counter is down by the CTD instruction. CT.10.0.Preset Address Data Format HSC Mode Function User Program Access...
Page 179
Timer and Counter Instructions 8-13 RSTA - Reset Accumulator CT10.0 RSTA Instruction Type: output The RSTA instruction resets the Counters, Timers and various contorl elements. The follwong table shows the reset result by the RSTA instruction of each element. Timer Element Couneter Element Contorl Element Accumulator ->...
Page 180
8-14 Timer and Counter Instructions X8 Instruction Set Reference Manual...
Page 181
Chapter Compare Instructions Introduction In this chapter, the X8 Series PLC compare Instructions are described.This chapter organized as follows Topic Page Introduction Using the Compare Instructions EQ - Compare for Equal NE - Compare for Not Equal GT - Compare for Greater Than LT - Compare for Less Than...
Page 182
Compare Instructions The following table shows the compare instructions. Instructions Description EQ : Compare for equal Compare whether two values are equal. !=. < >, ? NE : Compare for not equal Compare whether one value is not equal to a second value.
Page 183
Compare Instructions • For NE - Even the Source A and B is number, rung state remains true. EQ - Compare for Equal NE - Compare for Not Equal N4.0 - IN 1 1 < N4.1 - IN 2 2 < N4.2 - IN 1 3 <...
Page 184
Compare Instructions B3.1.6 N4.2 - IN 1 3 < N4.3 - 4< GT - Compare for Greater Than LT - Compare for Less Than N4:0 - IN 1 166 < N4:1 - IN 2 0 < N4:0 - IN 1 166 <...
Page 185
Compare Instructions B3.1.7 N4.0 - IN 1 1 < N4.1 - 2< • If the LT instruction is IN1 =3, and IN2=4, it compare whether IN 1 is greater than IN 2. Since the IN 2 is greater than IN1, output B3.1.8 bit state remains B3.1.8 N4.2 - IN 1...
Page 186
Compare Instructions GE and LE Instruction Operation Instruction Relationship of Source Resulting Rung State Values A ≥ B true A < B false A > B false A ≤ B true For example: • If the GE instruction is IN1 =1, and IN2=1, it compares whether IN 1is greater than or equal to IN 2.
Page 187
Compare Instructions The MEQ instruction is used to compare whether Source A and result of Mask data value through ANDed is equal to Source B and result of Mask data through ANDed. For example: If the EQM instruction is IN1=240 (0F0H), and IN2=4080 (FF0H), compare whether the two values are equal to F0H through ANDes.
Page 188
Compare Instructions The LIM instruction is used to compare to values between Low Limit and High Limit. LIM Instruction Operation Based on Low Limit, Test, and High Limit Values And: Rung State Low Limit ≤ Input≤ High Limit true Test < Low Limit or Input >High Limit false High Limit <...
Page 189
Chapter Math Instructions Introduction In this chapter, the X8 Series PLC math Instructions are described. This chapter organized as follows Topic Page Introduction 10-1 Using the Math Instructions 10-2 Floating Point 10-4 ADD - Add SUB - Subtract 10-5 MUL - Multiply DIV - Divide...
Page 190
10-2 Math Instructions The following table shows various math instructions and a specific arithmetic instructions supported from the X8 Series PLC use these output instructions to perform computations using an expression or a specific arithmetic instruction. Instructions Descriptions Add two values...
Page 191
The remainder is stored in SR2.13 when the division operation. • SR2.14: Register High: The quotient is stored in SR2.14 when the division operation. The data types of X8 Series PLC operations, and arithmetic instructions are determined according to table below. X8 Instruction Set Reference Manual...
Page 192
Float Float Float Float The X8 Series PLC supports Floating Point typed (F) 32 bit size data table, Floating Point and Floating Point observes IEEE-754 specifications. Like other data tables, it supports 1, 536 of elements. Floating Point Type Data Structure...
Page 193
Math Instructions 10-5 • Zero: represented by an exponent and a mantissa of zero. • Denormalized : Since denormalized numbers have very small, insignificant values, they are treated as zero in order to increase the performance. • ∞ : represented by an exponent of 255 and a mantissa part of zero. Both positive and negative infinity are generated when operations overflow.
Page 194
10-6 Math Instructions MUL: Use the MUL instruction to multiply one value by another value (Source A x Source B) and place the result in the Destination. DIV: Use the DIV instruction to divide one value by another value (Source A/ Source B) and place the result in the Destination.
Page 195
Math Instructions 10-7 Input Output Considerations When Using Floating Point Data •rounded data is output •If an overflow occurs after rounding, 32767 or 2147836647 is output, SR2.2.14 Math Overflow Selection bit is ignored. • Carry flag is reset. •If all of Destination is zero, the Zero flag is set.
Page 196
10-8 Math Instructions The following table shows data tables of SCAL instruction: Address Address Parameter Data Table Mode Level Input 1 √ √ √ √ √ √ √ √ √ Rate √ √ √ √ √ √ √ √ √ √...
Page 197
Math Instructions 10-9 This instruction solves the following equation listed below to determine scaled output: Address Address Parameter Data Table Mode Level Input √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √...
Page 198
10-10 Math Instructions The SIN instruction places the sine of the Source (in radians) in the Destination. Address Levels for the operands involved in the SIN can be ALL word, ALL Long word, ALL float, or a combination. These operands shall undergo a conversion to float.
Page 199
Math Instructions 10-11 ASIN-Arc Sine ASIN F5.0 - OUT - F5.1 >0.0873776 0.08726646 < Instruction Type: Output Use the ASN instruction to take the arc sine of a number and store the result (in radians) in the destination. Address Levels for the operands involved in the ASIN can be ALL word, ALL Long word, ALL float, or a combination.
Page 201
Math Instructions 10-13 DEG - Radians to Degrees N4:0 - OUT - N4:1 166 < > 0 Instruction Type: Output The DEG instruction converts the Source(in radians) to degrees and store the result in the Destination. The formula applies: Degree = Source * 180/π Address Parameter Data Table...
Page 202
10-14 Math Instructions LN - Natural Log N4:0 - OUT - N4:1 166 < > 0 Instruction Type: output Use the LN instruction to take the natural log of the value in the source and store the result in the destination. Address Parameter Data Table...
Page 203
*(N4.0 + N4.1))) > 32767 (SQRT 4) Instruction Type: output The CALC instruction is function for user’s convenience and performs arithmetic operations by a instruction through this when you use X8 Series PLC. The following table shows the expressions. Instructions Description...
Page 204
10-16 Math Instructions Instructions Sumbol Description Division SQRT SQRT Squa Root Sine Cosine Tangent ASIN ASIN Arc Sine ACOS ACOS Arc Cosine ATAN ATAN Arc Tangent Logical And Logical Inclusive Or Logical Exclusive Or Logical Not - (NEG) Negative Natu al Log Base 10 Log Absolute Value Radians to Degrees...
Page 205
Math Instructions 10-17 X8 Instruction Set Reference Manual...
Page 206
10-18 Math Instructions X8 Instruction Set Reference Manual...
Page 207
Chapter Converion Instructions Instruction In this chapter, the X8 Series PLC conversion Instructions are described. This chapter organized as follows. Topic Page Instruction 11-1 11-2 DECD - Decode 4 to 1-of-16 11-4 BIN - Convert form Binary Coded Decimal (BCD)
Page 208
11-2 Converion Instructions The conversion instructions multiplex and de-multiplex data and perform conversions between binary and decimal values. Instruction Description Decodes 4 to 1-of-16 DECO Decodes a 4-bit value , turning on the corresponding bit in the 16-bit destination. Encode 1-of-16 to 4. ENCO Encodes a 16-bit source to a 4-bit value.
Page 209
Converion Instructions 11-3 Decode 4 to 1-of-16 Source Bits Destination Bits X = not used ENCO - Encode 1-of-16 to 4 ENCO N4.32 - OUT - N4.33 > 0002h 0000000000000100 < Instruction Type: Output The ENCO instruction uses the lower four bits of the source word to set multiplex 16 bit of the destination word.
Page 210
11-4 Converion Instructions Encode 1-of-16 to 4 Source Bits Destination Bits 15 to 04 x = determines the state of the flag BIN - Convert form Binary Coded Decimal (BCD) N4.35 - OUT - N4.36 0457h < > 0 Instruction Type: Output The BIN instruction is used to convert the Binary Coded Decimal (BCD) source value to an integer and place the result in the destination.
Page 212
11-6 Converion Instructions X8 Instruction Set Reference Manual...
Page 213
Chapter Logical Instructions Introduction This chapter describes Logical Instructions of X8 Series PLC. The chapter is organized as follows. Topic Page Introduction 12-1 AND - Bit-Wise AND 12-3 OR - Logical OR 12-3 XOR - Exclusive OR 12-4 NOT - Logical NOT...
Page 214
12-2 Logical Instructions The follwing table shows 4 logical instructions of the X8 Series PLC. Application Specific Insturcitons Instruction Used To: Bit-Wise AND Perform an AND operation Logical OR Perform an inclusive OR operation Exclusive OR Perform an Exclusive Or operation...
Page 215
Logical Instructions 12-3 AND - Bit-Wise AND N4.36 - IN 1 OUT - N4.38 01C9h < > 0141h N4.37 - IN 2 0171h < Instruction Type: output The AND instruction performs a bit-wise logical AND of two sources and places the result in the destination. Source Source The above example means:...
Page 216
12-4 Logical Instructions The above example means: Source 1: 01C9H = 0000 0001 1100 1001 Source 2: 0171H = 0000 0001 0111 0001 Destination = 0000 0001 0100 0001 = 01F9H XOR - Exclusive OR N4.36 - IN 1 OUT - N4.40 01C9h <...
Page 218
12-6 Logical Instructions X8 Instruction Set Reference Manual...
Page 219
Chapter Move Instructions Introduction This chapter describes move Instructions of X8 Series PLC. The chapter is organized as follows. Topic Page Introduction 13-1 MOV - Move 13-2 MOVM - Masked Move 13-3 X8 Instruction Set Reference Manual...
Page 220
13-2 Move Instructions The following table shows two move instructions. Application Specific Instr citons Instruction Move Move the source value to the destination Masked Move MOVM Move data from a source location to a selected portion of the destination. MOV - Move F5.4 - OUT - F5.6 379560.0 <...
Page 223
Chapter Data Table Instructions Introduction This chapter describes data table Instructions of X8 Series PLC. The chapter is organized as follows Topic Page Introduction 14-1 FILT - Fill Table 14-2 COPT - Copy Table 14-4 SWAP - Swap Word 14-4...
Page 224
14-2 Data Table Instructions The following table shows data table instructions. Instructions Description Fill Table FILT Move Source data to Destination data table. Copy Table COPT After mask Source data , copy to Destination data table. SWAP Swap Word COPW Copy Word FILT - Fill Table FILT...
Page 227
Data Table Instructions 14-5 Address Address Parameter Data Table Mode Level Source 1 √ √ √ √ √ √ √ Destination √ √ COPW - Copy Word COPW #N12.16 - OUT - #12.19 3 < Length Instruction Type: output The COPW instruction copies Source data to Destination for a given length. Although similar to the COPT instruction, the COPW instruction allows different source and destination parameters.
Page 229
Chapter Shift and FIFO, LIFO Instructions Introduction This chapter describes Shift and FIFO, LIFO instructions of the X8 Series PLC.The chapter is organized as follows. Topic Page Introduction 15-1 BSL - Bit Shift Left BSR - Bit Shift Righter 15-2...
Page 230
15-2 Shift and FIFO, LIFO Instructions The following table shows bit shift instructions of internal data. Instruction Description Bit Shift Left Load the sp cified BIT to LSB and shift left a bit array one bit at a time when the rung status is true. Bit Shift Right Load the sp cified BIT to MSB and shift right a bit array one bit at a time when the rung state is true.
Page 231
Shift and FIFO, LIFO Instructions 15-3 This instruction uses the following data format. • Data Table : data table to Shift • CTRL : CR data table. When the BSL instruction is in run state, this instruction is used to control the internal flags. •...
Page 233
Shift and FIFO, LIFO Instructions 15-5 You can check the result of the above example to the figure below. When the N14.0 is specified as IN , N14.10 ~ N14.19 are as QUEUE area, and N14.2 is OUT, if the FIFOL instruction is in run state , the N14.0 is stored to the POS in the QUEUE.
Page 235
Shift and FIFO, LIFO Instructions 15-7 When the N15.11 is specified to IN , N15.0 ~ N15.9 are Stack area, and N15.12 is OUT, if the LIFOL instruction is in run state, N15.11 is stored to the POS in the Stack area. If the LIFOU instruction is in run state, unload the data from the POS in the Stack area, and then stores the data to N15.12.
Page 236
15-8 Shift and FIFO, LIFO Instructions X8 Instruction Set Reference Manual...
Page 237
Chapter Sequencing Instructions Introduction This chapter describes sequencer instructions of the X8 Series PLC.The chapter is organized as follows. Topic Page Introduction 16-1 SEQIC - Sequencer Input Compare 16-2 SEQO - Sequencer Ou put 16-4 SEQL - Sequencer Load 16-5...
Page 238
16-2 Sequencing Instructions The following table shows Sequencer instructions of internal data. Instruction Description Sequencer Input Compare If rung state is true, compare IN data and masked source SEQIC at the data table. If the data are equal, it sets Found flag in the CR data table specified as CTRL.
Page 239
Sequencing Instructions 16-3 After the Source data in N19.20 and masked data in N19.0 are logically Anded, then compare the result values with the data in the N19.10 ~ N19.19 data table. If the rung state goes true, the POS value increments as +1 automatically to compare with the data in the N19.10 ~ N19.19 data table.
Page 240
16-4 Sequencing Instructions Instruction Type: output If the rung state is true, the data table value of POS and masked value are logically ANDed, then copies the value to destination data table. When the copy is done for a given length, the DONE flag in the CR data table specified CTRL is set.
Page 241
Sequencing Instructions 16-5 SEQL - Sequencer Load SEQL #N20.20 - Data Table N20.31 - CR17.2< CTRL 10 < Length 7 < Enable Done Instruction Type: output If the rung state is true, the SEQL instruction copies the data table values specified IN to the data table specified by POS sequentially.
Page 242
16-6 Sequencing Instructions X8 Instruction Set Reference Manual...
Page 243
Chapter Program Control Instructions Introduction n this chapter, the X8 Series PLC program con ol Instructions are described.This chapter organized as follows Topic Page Introduction 17-1 JMP - Jump to Label 17-2 LBL - Lable 17-3 CALL- Call Subroutine 17-3...
Page 244
17-2 Program Control Instructions The following table shows the program control instructions of X8 Series PLC ladder program. Instructions Descriptions Jump to Label JUMP Jump forward/backward to a corresponding label instruction Label Indicate the location for JUMP instruction. Call Subroutine CALL Call the subroutine.
Page 245
Program Control Instructions 17-3 LBL - Labe LBL5.1 Instruction Type: output The LBL instruction is used to indicate the location for the JMP instruction to change the order of ladder execution. The data range for the label is from 0 to 999. CALL- Call Subroutine SUB 6 - Instruction Type: output...
Page 246
17-4 Program Control Instructions RET - Return from Subroutine Instruction Type: output The RET instruction marks the end of the subroutine execution and returns from subroutine to the next instruction which is call the subroutine. SUSP - Suspend SUSP Instruction Type: output The SUSP instruction is used for program debugging and system troubleshooting.
Page 247
Program Control Instructions 17-5 END - End of Ladder Program Instruction Type: output The END instruction marks the end of the ladder program. And the PLC displays the end of ladder program scan. This instruction causes return from subroutine, interrupt routine at the point where it is called.
Page 248
17-6 Program Control Instructions If you start with MCR instruction, must end with the MCR instruction. IMPORTANT You cannot nest one MCR within another. Do not jump into an MCR zone to control logic of the program to be working correctly. X8 Instruction Set Reference Manual...
Page 249
Chapter Input and Output Instructions Introduction This chapter, the X8 Series PLC input and output Instructions are described.This chapter organized as follows. Topic Page Introduction 18-1 REFI - Embedded Input Refresh 18-2 REFO- Embedded Output Refresh 18-3 EOS - End of Scan...
Page 250
18-2 Input and Output Instructions The following table shows input and output instruction of X8 Series PLC. Application Specific Instr ct ons Instruction Used To: Embedded Input Refresh REFI Update input port state embedded CPU module immediately. Embedded Output Refresh...
Page 251
Input and Output Instructions 18-3 REFO- Embedded Output Refresh REFO Y0.0.0 - Slot N20.0 - Mask 1 - Length Instruction Type: output The REFO instruction updates output port embedded in CPU module and the I/O port is updated when the ladder program scan automatically. To update output port immediately, use the REFO instruction.
Page 252
18-4 Input and Output Instructions X8 Instruction Set Reference Manual...
Page 253
Chapter Using Interrupts Introduction This chapter, the X8 Series PLC interrupts are described.This chapter organized as follows. Topic Page Introduction 19-1 What is an Interrupt? 19-2 Priority of User Interrupts 19-4 Interrupt Type and Elements 19-5 PITS - Programmable Interrupt Timer Start...
Page 254
19-2 Using Interrupts The following table shows usage of the interrupt of the X8 Series PLC. Instruction Description Interrupt Subroutine Label to indicate the start of the interrupt. PIT(Programmable Interrupt Timer) Start PITS Execute interrupt timer. Interrupt Disable INTD Disable the user interrupt.
Page 255
Using Interrupts 19-3 [Example 1] PIT interrupt service routine configuration window [Example 2] EII (External Input Interrupt) interrupt service routine configuration window [Example 3] HSC interrupt service routine configuration window [Example 4] UFR (User Fault Routine) interrupt service routine configuration window X8 Instruction Set Reference Manual...
Page 256
19-4 Using Interrupts * User Fault Routine (URF) configuration part is located in “Error” of SR2 different with other interrupt configuration. But, the interrupt service routine execution can affect to PLC scan time directly, interrupt processing must be completed in the shortest time. It is applied to most devices using interrupt.
Page 257
Using Interrupts 19-5 Interrupt Type and Elements User Fault Routine (UFR) Interrupt The UFR interrupt is an interrupt with the highest priority and recovers User Fault (Error). The fault routine is executed when any recoverable or non-recoverable user fault occurs. The basic types of faults are described below: •...
Page 258
The EventInterruptEnabled control bit is used to execute whether the EII performs. AutoStart Description Data Format HSC Mode Function User Program Access EII.0.AutoStart 0 or 1 Control Read/Write The AutoStart control bit automatically sets the interrupt when the X8 Series PLC enters any executing mode. X8 Instruction Set Reference Manual...
Page 259
Using Interrupts 19-7 EdgeSelect Description Data Format HSC Mode Function User Program Access EII.0.EdgeSelect 0 or 1 Control Read/Write The EdgeSelect control bit is used to select the trigger types when using EII. • 1: falling edge • 0: rising edge InputSelect Description Data Format...
Page 260
19-8 Using Interrupts Error Code Descriptions Invalid Program File Number The program file number is not 6 ~ 1535 or not exist. Invalid Input Selection The input port range is 0,1,2,3,4,5,6,7. Input Selection Overlap Each EII uses a different input since the EII cannot share the input. UserInterruptExecuting Description Data Format...
Page 261
Using Interrupts 19-9 ErrorDetected Description Data Format HSC Mode Function User Program Access EII.0.ErrorDetected Status Read Only The ErrorDetected flag is a status bit that can be used by the control program to detect if an error is present in the EII configuration. High Speed Counter (HSC) Interrupt The following figure shows HSC interrupts in the box among the SFR of the high-speed counter.
Page 262
19-10 Using Interrupts Programmable Interrupt Timer (PIT) Interrupt Following descriptions for elements related to Interrupt of SFR. It is described based on PIT and ach elemets are used in EII and HSC similarly. LadderProgramNumber Description Data Format HSC Mode Function User Program Access PIT.0.LadderProgramNumber...
Page 263
Data Format HSC Mode Function User Program Access PIT.0.AutoStart 0 or 1 Control Read/Write The AutoStart control bit automatically sets the intterupt when the X8 Series PLC enters any exeruting mode. SetPointMsec Description Data Format HSC Mode Function User Program Access PIT.0.SetPointMsec...
Page 264
19-12 Using Interrupts Error Code Descriptions Invalid Program File Number The program file number is not 6 ~ 1535 or not exist. UserInterruptExecuting Description Data Format HSC Mode Function User Program Access PIT.0.UserInterruptExecuting Status Read Only The UserInterruptExecuting status bit is set when the interrupt service routine of PIT is in execution mode.
Page 265
Using Interrupts 19-13 ErrorDetected Description Data Format HSC Mode Function User Program Access PIT.0.ErrorDetected Status Read Only The ErrorDetected flag is a status bit that can be used by the control program to detect if an error is present in the PIT configuration. PITS - Programmable Interrupt Timer Start PITS...
Page 266
19-14 Using Interrupts Instruction Type: output The INTD instruction disables the user interrupts. The following table shows Interrupt Bits Select value for disable each interrupts. EII.1 interrupt is disabled in the above example. Interrupt hexadecimal EII.0 EII.1 EII.2 EII.3 EII.4 EII.5 EII.6 EII.7...
Page 267
Using Interrupts 19-15 INTE - Interrupt Enable INTE 1H - Interrupt Bits Select Instruction Type: output The INTE instruction enables the user interrupts. The following table shows Interrupt Bits Select value for enable each interrupts. EII.0 interrupt is enabled in the above example. Interrupt hexadecimal EII.0...
Page 268
19-16 Using Interrupts The INTF instruction removes each pending user interrupts from the system. Interrupt hexadecimal EII.0 EII.1 EII.2 EII.3 EII.4 EII.5 EII.6 EII.7 HSC.0 10000H HSC.1 20000H HSC.2 40000H HSC.3 80000H HSC.4 100000H HSC.5 200000H PIT Timer 80000000H If you need to control 2 or more interrupts at the same time, add above values and input them to the Interrupt Bits Select value.
Page 269
Chapter PID Control Introduction This chapter describes the X8 Series PLC Proportional Integral Derivative (PID) instructions. This chapter organized as follows. Topic Page Introduction 20-1 The PID Equation 20-2 PID - Proportional Integral Derivative 20-3 X8 Instruction Set Reference Manual...
Page 270
20-2 PID Control The PID instruction can be expressed like (1) or (2) formula: The PID Equation The formula adds following three actions: • Proportional Action (P Action): calculate proportional values to current deviation e. • Integral Action (I Action): calculate proportional values to accumulated pas deviation •...
Page 271
PID Control 20-3 PID - Proportional Integral Derivative PD22.0 - PID Table - N21.1 X1.1.0 - Config Instruction Type: output The PID instruction is an instruction to control the PID. Analog module data and PID instruction parameter must IMPORTANT be same. It is recommended that you place the PID instruction on a rung without any conditional logic.
Page 272
20-4 PID Control Address Data Format Data Range Function User Program Access PD22.0.TimedOrPit Binary 0 or 1 control Read/Write PD22.0.AutoOrManual Binary (Bit) 0 or 1 control Read/Write PD22.0.ForwardReverseActing Binary (Bit) 0 or 1 control Read/Write PD22:0.Kc Word (INT) 0 ~32,767 control Read/Write PD22:0.Ti...
Page 273
PID Control 20-5 Address Data Format Data Range Function User Program Access 1 =Enable PD10:0.OutputLimitingEnabled Binary control Read/Write 0 = Disable PD10:0.ControlVariableHighLimit Word (INT) 1~100% control Read/Write PD22:0.ControlVariableLowLimit Word (INT) 1~100% control Read/Write TimedOrPIT Description Data Format HSC Mode Function User Program Access PD.10.TimedOrPIT...
Page 274
20-6 PID Control The ForwardReverseActing bit define the how run the CV value of the PID. • 0 :Reverse Acting. The control variable reduced when the SP is greater than the • 1: Forward Acting. The control variable increased when the PV is greater than the SV.
Page 275
PID Control 20-7 • 1: enable the Scale. LoopUpdateTooFast Description Data Format HSC Mode Function User Program Access PD.10. LoopUpdateTooFast 0 or 1 Status Read/Write The LoopUpdateTooFast flag is set by the PID algorithm when the PID update is not executed cause of the PLC scan time limitation. To solve this, speed down the PID loop control or use PIT interrupt.
Page 276
0 ~ 32,767 Control Read/Write The KC flag is used to enter the gain value of the X8 Series PLC. Kc is proportional gain value of PID control and has the following values. • GainRangeSelection = 0 : 0 ~ 3276.7 •...
Page 277
PID Control 20-9 • GainRangeSelection = 0 : 0 ~ 3276.7 min. • GainRangeSelection = 1 : 0 ~ 327.67 min. Td (Derivative Time) Description Data Format HSC Mode Function User Program Access PD.10.Td Word 0 ~ 32,767 Control Read/Write The Td is D, that is, derivative time for D Action of the PID control.
Page 278
20-10 PID Control Enter the LoopUpdateTime data up to 10 times faster than the actual cycle. When the PID operating cycle is within the PIT mode, enter the same data with timer interrupt occur cycle in PIT configuration part. FeedForwardBias Description Data Format HSC Mode...
Page 279
PID Control 20-11 The ErrorCode displays the PID Error Code. Error Code Description 0x01 Kc Error 0x02 Ti Error 0x03 Td Error 0x04 Bias Error 0x05 Loop Update Error 0x11 CV Low Limit Error 0x12 CV High Limit Error 0x13 CV Low Limit greater than High Limit 0x21 Set Point Minimum greater than Maximum...
Page 280
20-12 PID Control X8 Instruction Set Reference Manual...
Page 281
Chapter ASCII Instructions Introduction This chapter describes the X8 Series PLC ASCII instructions. This chapter organized as follows. Topic Page Introduction 21-1 ATOI - Convert ASCII String to Integer 21-3 ITOA - Convert ASCII String to Integer 21-4 ACN - ASCII String Concatenate...
Page 282
21-2 ASCII Instructions The X8 Series PLC supports ASCII typed data and contains instructions for processing characters, string and ASCII communications. The following table shows the ASCII instructions. Instructions for ASCII character (string) Instructions Descriptions ATOI Convert ASCII String to Integer...
Page 283
ASCII Instructions 21-3 Error Code Descriptions Success Illegal parameter Not supported Channel is shutdown Protocol contention Transmit is in progress CTS Signal lost Source Control Data Table invalid Source String Length invalid Request String Length invalid Unload bit in Control Data Table is set ACB Instruction deletion Channel Configuration was changed ATOI - Convert ASCII String...
Page 284
21-4 ASCII Instructions Address Address Parameter Data Table Mode Level Source √ √ √ Destination √ √ √ √ √ √ √ √ ITOA - Convert ASCII String to Integer ITOA N25.1 - OUT - ST23.1 255 < Instruction Type: output The ITOA instruction converts an ASCII integer data to string.
Page 286
21-6 ASCII Instructions ASCH - Searching String ASCH ST23.4 - Result - N25.5 N25.4 - Index > 0 ST23.3 - String Search Instruction Type: output The ASCH instruction is an instruction to search a string you want from the source string data table. •...
Page 287
ASCII Instructions 21-7 The ACMP instruction is used to compare two strings in Source 1 and 2. If the strings are identical, the rung is true. The following example shows that compare two string in the Source 1 and 2. If the strings are identical, the rung is true and store the result to destination.
Page 288
21-8 ASCII Instructions Driver configuration in the Channel Configuration Settings should be IMPORTANT set to ASCII/BIN. Following figure shows the Channel 1 configuration part. If ARNL instruction is executed without Driver configuration, Error=3 is generated. Following ladder example reflects the CH 1 configuration. B3.10.6 ARNL ERROR - 00h...
Page 289
ASCII Instructions 21-9 The result data gets from buffer is stored to POS or Position in the Control Data Table (CR). The parameters are: • CH : serial port number ( 0:COM1, 1:COM2, 2:USB) • CTRL : CR (Control) data table Driver configuration in the Channel Configuration Settings should be IMPORTANT set to ASCII/BIN.
Page 290
21-10 ASCII Instructions B3.11.0 Yes - RX CLR Yes - TX CLR AHS - Handshake HS Bits Status - 000h Error - 00h 0002h - AND Mask CR17.8 - CTRL Enable Done Error Instruction Type: output The AHS instruction is used to on/off the RTS signal, handshake control signal.
Page 291
ASCII Instructions 21-11 If 2 (USB) is set to CH, Error 3 is generated since the USB is not support Handshake. Handshake control is only possible in ASCII/BIN communications. Other protocols are controlled in PLC autonomously. Error Code Descriptions Success Illegal parameter Not supported Channel is shutdown...
Page 292
21-12 ASCII Instructions The following example shows that read data from a buffer through USB port and store them to ST23.6. B3.11.2 OUT - ST23.6 Error - 00h CR17.3 - CTRL 43 < Length 43 - Enable Done Error AWA - Write String with Append Error - 00h ST23.6 -...
Page 293
ASCII Instructions 21-13 The input parameters are: • CH : serial port number ( 0:COM1, 1:COM2, 2:USB) • IN : STRING data table to write to destination • CTRL : CR (Control) data table • Length : data length to write to port The output parameter is: •...
Page 294
21-14 ASCII Instructions Address Address Parameter Data Table Mode Level √ √ √ √ √ CTRL √ √ √ AW - Write String Error - 00h ST23.6 - CR17.7 - CTRL 43 < Length 43 - Enable Done Error Instruction Type: output The AW instruction to write strings from a source string to the port.
Page 295
ASCII Instructions 21-15 B3.11.4 Error - 00h ST23.6 - CR17.7 - CTRL 43 < Length 43 - Enable Done Error t is set when the rung condition goes false to true. If the rung IMPORTANT condition is changed true to false during the AW instruction is in run state, the instruction complete the communication output.
Page 296
21-16 ASCII Instructions X8 Instruction Set Reference Manual...
Page 297
Chapter Communications Instructions Introduction This chapter describes the X8 Series PLC communications instructions. This chapter organized as follows. Topic Page Introduction 22-1 SVC - Service Communication 22-2 MSG - Message Communication 22-3 X8 Instruction Set Reference Manual...
Page 298
22-2 Communications Instructions The following table shows communication instructions of the X8 Series PLC. Instruction Description Interrupt the program scan to execute the service communications part of the operating cycle. The scan then resumes at the instruction following the SVC instruction.
Page 299
Communications Instructions 22-3 B3.10.7 0002h - Channel Select MSG - Message Communication MG26.0 - MSG Table Config Enable Done Error Instruction Type: output The MSG instruction send the message to the specified protocol. The supported protocols are: • Xnet • Xnet X8CPU Read •...
Page 300
22-4 Communications Instructions • NX-Plus Read Words (23) • NX-Plus Write Words (24) • CIP Generic ( Add when you choose EterNet Port as communications port) This MSG instruction, like other instructions, is set when the rung state is true. The following is an example of the MSG instruction.
Page 301
Communications Instructions 22-5 Subtype Address Data Format HSC Mode Function User Program Access MGn.0.Subtype Word -32,767~ 32,767 Status Read Only The Subtype instruction is used to set the Message type ( Communication method). • 0: Xnet Master • 1: Modbus Master •...
Page 302
22-6 Communications Instructions SuppElementInfo[0] ~ [2] Address Data Format HSC Mode Function User Program Access MGn.0.SuppElementInfo[0] ~[2] Word -32,767~ 32,767 Status Read Only The SuppElementInfo instruction is used to store the additional Element information. ChannelNumber Address Data Format HSC Mode Function User Program Access...
Page 303
Communications Instructions 22-7 TargetDataTableInfo[0] ~ [4] Address Data Format HSC Mode Function User Program Access MGn.0.TargetDataTableInfo[0] ~ [4] Word -32,767~ 32,767 Status Read Only The TargetDataTableInfor instructions is used to store the data table information of the Target node. BreakConnection Address Data Format HSC Mode...
Page 304
22-8 Communications Instructions The Timeout instruction is set when it has not receive any response for Timeout. If the Timeout is set by the user, the MSG instruction is cleared during execution. ContinuousOperation Address Data Format HSC Mode Function User Program Access MGn.0.ContinuousOperation O or 1...
Page 305
Communications Instructions 22-9 Range Address Data Format HSC Mode Function User Program Access MGn.0.Range O or 1 Status Read Only When this bit is cleared, the MSG instruction is used for Local communication. When this is set, the MSG instruction is used for Remote communication.
Page 306
22-10 Communications Instructions Done Address Data Format HSC Mode Function User Program Access MGn.0.Eone O or 1 Status Read Only The Done bit is set when the message is transmitted successfully. The Done bit is cleared the next time the associated rung goes from false to true. Start Address Data Format...
Page 307
Communications Instructions 22-11 ErrorCounter Address Data Format HSC Mode Function User Program Access MGn.0.ErrorCount Word -32,768 ~ 32,767 Status Read Only This bit is used to calculate the number of errors. If the error count exceeds the error count configuration value, this message is not triggered. •...
Page 308
22-12 Communications Instructions X8 Instruction Set Reference Manual...
Page 309
Appendix A System Error Code System Error Code Controller Fault Code Description Level (Hex) 1.1.1 No Error 1.1.2 Recoverable 1.1.3 System Hard Faults System Error - Unexpected Reset or System Watchdog Error Non-User System Error - Controller ASIC Error Non-User System Error - NVRAM Memory corrupted Non-User System Error - Hardware Error...
Page 310
Appendix A-2 System Error Code Controller Fault Code Description Level (Hex) Ladder Program Error - Duplicated Label detected. Non-Recoverable Ladder Program Error - Start Up Protection faulted. Recoverable Ladder Program Error - Minor Error Bit detected at the end of Recoverable scan.
Page 311
System Error Code Appendix A-3 Controller Fault Code Description Level (Hex) Reserved. Not for Use. Instruction Error - CALL instruction underflowed. Non-User Instruction Error - Subroutine nesting limit exceed. Non-User Instruction Error - Address Range Error in SEQx instrucitons. Recoverable Instruction Error - Address Range Error in FIFO instructions.
Page 314
Appendix B-2 MSG Instruction Error Code MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group No Error No Error Link Layer Qualification Error Confirmation from Link Layer NAK No Memory retries by link layer exhausted. Target node cannot respond because message is too large.
Page 315
MSG Instruction Error Code Appendix B-3 MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group 23 for Modbus Modbus TCP specific error codes. EtherNet/IP specific error codes. 24 for EtherNet/IP 25 for CIP Response CIP status code returned by CIP reply.
Page 317
MSG Instruction Error Code Appendix B-5 MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group RP CFG, Invalid subtype. RP CFG, Invalid IP Address. RP_CFG, No Data Table defined or Incorrect RP Data Table defined. Target node does not accept this type of MSG instruction.
Page 318
Appendix B-6 MSG Instruction Error Code MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group Format Unsupported. Current communications protocol does not support MSG initiation. Channel is shutdown or reconfiguration in progress. Current communications protocol does not support the packet type the MSG command is using.
Page 319
MSG Instruction Error Code Appendix B-7 MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group Insufficient data. Improper Amount of data. Command code mismatched. Packet type mismatched. Rejected SDN packet. Bad data type. Buffer format code mismatched.
Page 320
Appendix B-8 MSG Instruction Error Code MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group MSG waiting for buffer (MSG timed out while on overflow queue) after timeout. MSG waiting for buffer (MSG timed out while on overflow queue) before timeout.
Page 321
MSG Instruction Error Code Appendix B-9 MSG Error Code Mapping Internal Fail Code (Hex) High byte Low byte Description Identifier Code Error Code group MSG was on confirmation queue. MSG was waiting for reply, command buffer #0. MSG was waiting for reply, command buffer #1. MSG was waiting for reply, command buffer #2.
Need help?
Do you have a question about the X8 Series and is the answer not in the manual?
Questions and answers