LSIS XGL-CH2A User Manual

LSIS XGL-CH2A User Manual

Xgt series
Hide thumbs Also See for XGL-CH2A:

Advertisement

Right choice for ultimate yield
LSIS strives to maximize customers' profit in gratitude of choosing us for your partner.
Programmable Logic Controller
XGT Series
Read this manual carefully before
installing, wiring, operating, servicing
or inspecting this equipment.
Keep this manual within easy reach
for quick reference.
Cnet I/F Module
http://eng.lsis.biz
User's Manual
XGL-CH2A
XGL-C22A
XGL-C24A

Advertisement

Table of Contents
loading

Summary of Contents for LSIS XGL-CH2A

  • Page 1 Right choice for ultimate yield LSIS strives to maximize customers' profit in gratitude of choosing us for your partner. Programmable Logic Controller Cnet I/F Module XGT Series User’s Manual XGL-CH2A XGL-C22A XGL-C24A Read this manual carefully before  installing, wiring, operating, servicing or inspecting this equipment.
  • Page 2 Safety Instructions Before using the product … For your safety and effective operation, please read the safety instructions thoroughly before using the product. ► Safety Instructions should always be observed in order to prevent accident or risk with the safe and proper use the product. ►...
  • Page 3 Safety Instructions Safety Instructions for design process Warning  Please install a protection circuit on the exterior of PLC so that the whole system may operate safely regardless of failures from external power or PLC. Any abnormal output or operation from PLC may cause serious problems to safety in whole system.
  • Page 4 Safety Instructions Safety Instructions for design process Caution I/O signal or communication line shall be wired at least 100mm  away from a high-voltage cable or power line. Fail to follow this instruction may cause malfunctions from noise Safety Instructions on installation process Caution ...
  • Page 5 Safety Instructions Safety Instructions for wiring process Warning Prior to wiring works, make sure that every power is turned off. If  not, electric shock or damage on the product may be caused. After wiring process is done, make sure that terminal covers are ...
  • Page 6 Safety Instructions Safety Instructions for test-operation and maintenance Warning  Don’t touch the terminal when powered. Electric shock or abnormal operation may occur.  Prior to cleaning or tightening the terminal screws, let all the external power off including PLC power. If not, electric shock or abnormal operation may occur.
  • Page 7 Safety Instructions Safety Instructions for waste disposal Caution Product or battery waste shall be processed as industrial waste.  The waste may discharge toxic materials or explode itself.
  • Page 8 Revision History Revision History Version Data Remark Page V 1.0 ’05.03 First Edition V1.1 ’05.05.19 Add function description V1.2 ’05.19.12 Change available CPU device address V2.0 ’07.01.15 Change XG-PD description 1. Adding contents (1) Production Configuration (2) Software to use the product 1-4 ~ 1-5 (3) Operation Sequence (4) I/O assignment and Device Information...
  • Page 9: Table Of Contents

    Revision History Version Data Remark Page (27) User interface using Visual Basic A-18 ~ A-29 (28) Dimension A-30 (29) Index A-31 ~ A-32 2. Fixing the contents (1) Introduction (2) Characteristics (3) Performance Specifications (4) Designation of Parts (5) Cable Specifications (6) Terminal Resistance (7) Channel Operation during Normal Run (8) Method of Serial Interface...
  • Page 10 10. Add example UDATA function V2.7 ’14.04.19 Change system configuration Entire V2.8 ’14.11 XG5000 V4.0 UI Updated Entire ※ The number of User’s manual is indicated right part of the back cover. Copyright ⓒ 2005 LSIS Co., Ltd All Rights Reserved.
  • Page 11 User’s Manual. The User’s Manual describes the product. If necessary, you may refer to the following description and order accordingly. In addition, you may connect our website (http://eng.lsis.biz/) and download the information as a PDF file. Relevant User’s Manuals...
  • Page 12: Introduction

    Contents ◎ Contents ◎ Chapter 1 Overview 1.1 Introduction------------------------------------------------------------------------------------------------------------------------------------------------- 1-1 1.2 Characteristics-------------------------------------------------------------------------------------------------------------------------------------------- 1-2 1.3 Product Configuration----------------------------------------------------------------------------------------------------------------------------------- 1-3 1.3.1 Type name indication----------------------------------------------------------------------------------------------------------------- 1-3 1.3.2 Equip-able number per CPU------------------------------------------------------------------------------------------------------------- 1-3 1.4 Software to use the product-------------------------------------------------------------------------------------------------------------------- 1-4 1.4.1 Software check point------------------------------------------------------------------------------------------------------------------- 1-4 1.4.2 XG5000 ---------------------------------------------------------------------------------------------------------------------------------------- 1-4 1.4.3 Check of version----------------------------------------------------------------------------------------------------------------------------- 1-5 Chapter 2 Product Specifications...
  • Page 13: P2P Setting Parameter

    Contents Chapter 5 System Configuration 5.1 Available System Configurations ------------------------------------------------------------------------------------------------------------------- 5-1 5.1.1 1:1 connection (no modem) to PC (HMI) ------------------------------------------------------------------------------------------------ 5-1 5.1.2 1:1 dedicated modem connection to PC (HMI) --------------------------------------------------------------------------------------- 5-1 5.1.3 Modem connection to PC & Communication between Cnet I/F modules----------------------------------------------------- 5-2 5.1.4 Dedicated communication with PC (HMI) &...
  • Page 14 Contents Chapter 7 XGT Dedicated Communication 7.1 Summary of Protocol ----------------------------------------------------------------------------------------------------------------------------------- 7-1 7.1.1 Summary ---------------------------------------------------------------------------------------------------------------------------------------- 7-1 7.2 Frame Structure ----------------------------------------------------------------------------------------------------------------------------------------- 7-2 7.2.1 Frame structure --------------------------------------------------------------------------------------------------------------------------------- 7-2 7.2.2 Instruction list ----------------------------------------------------------------------------------------------------------------------------- 7-4 7.2.3 Writing the single direct variable (W(w)SS)---------------------------------------------------------------------------------------------- 7-6 7.2.4 Reading single direct variable (R(r)SS) -------------------------------------------------------------------------------------------------- 7-8 7.2.5 Writing the direct variable continuously (W(w)SB)---------------------------------------------------------------------------------- 7-11 7.2.6 Reading direct variable continuously (R(r)SB) --------------------------------------------------------------------------------------- 7-13 7.2.7 Registration and execution of monitor variable -------------------------------------------------------------------------------------- 7-15...
  • Page 15 Contents 8.5 Modbus RTU/ASCII Client ------------------------------------------------------------------------------------------------------------------------- 8-27 8.5.1 Standard settings in case of Modbus client ----------------------------------------------------------------------------------------- 8-27 8.5.2 Settings in case of Modbus RTU/ASCII client ------------------------------------------------------------------------------------- 8-29 8.5.3 Writing the parameter --------------------------------------------------------------------------------------------------------------------- 8-31 8.6 Frame Monitor ----------------------------------------------------------------------------------------------------------------------------------------- 8-32 Chapter 9 User-defined Communication 9.1 General --------------------------------------------------------------------------------------------------------------------------------------------------- 9-1 9.1.1 Procedure of user-defined communication ---------------------------------------------------------------------------------------- 9-1 9.2 Structure of user definition frame --------------------------------------------------------------------------------------------------------------- 9-2...
  • Page 16: Dimension

    Contents 11.3.9 When error code of Status by Service is “E000”----------------------------------------------------------------------------- 11-10 11.3.10 When error code of Status by Service is “E001”--------------------------------------------------------------------------- 11-10 Appendix A.1 Definition of Terms ----------------------------------------------------------------------------------------------------------------------- A-1 A.2 Flag List ------------------------------------------------------------------------------------------------------------------ A-7 A.2.1 Special Relays List (F) ------------------------------------------------------------------------------------------------------------------ A-7 A.2.2 Communication Relays List (L) --------------------------------------------------------------------------------------------------------- A-15 A.2.3 Link Devices List (N) ---------------------------------------------------------------------------------------------------------------------- A-17 A.3 RS-232C interface through VisualBasic --------------------------------------------------------------------------------------------------- A-19...
  • Page 17 Chapter 1 Overview Chapter 1 Overview 1.1 Introduction This user’s manual describes the Computer Link I/F module (hereinafter referred to as Cnet I/F module) of XGT PLC system network. Cnet I/F module has the connection function with different model to communicate with communication devices of various different type protocols such as other company’s PLC and computer, etc., and the function of modem communication to control remote PLC.
  • Page 18: Characteristics

    Chapter 1 Overview 1.2 Characteristics The XGT Cnet I/F module is serial communication device supporting the RS-232C and RS-422(485) protocol and has the following characteristics. (1) Since the user can write directly, it is easy to connect with other company’s products (2) Because communication speed and communication mode (protocol) are directly specified by user using XG5000 operative in Windows environment, connection with other company’s products is easy.
  • Page 19 1.3.1 Type name indication Describes on the product configuration of the XGT Cnet module Type name Contents Reference XGL-C22A RS-232C 2 ports XGL-CH2A RS-232C 1 port, RS-422 1 port Twisted-pair shield cable XGL-C42A RS-422 2 ports 1.3.2 Equip-able number per CPU Note1) The Cnet I/F module can be mounted up to 24 without distinction of basic and extension base.
  • Page 20 (1) Applied at the XGT series Classification Connection port Communication setting tool XGL-C22A RS-232C 2 ports XGL-CH2A RS-232C 1 port, RS-422 1 port XG5000 XGL-C42A RS-422 2 ports Note 1) The above program can be downloaded from our website now. In case of not using the internet, visit the near our company and get the CD.
  • Page 21 Chapter 1 Overview 1.4.3 Check of version Before using the Cnet module, check the version of module. (1) Check through XG5000 Here describes on how to read communication module information by online connection to communication module. If interface with CPU is normal, it is available to get the following information. (a) Execute the XG5000.
  • Page 22 • Duration : 11ms Shocks Immunity IEC61131-2 • Pulse wave type : Half-sine (3 times each direction per each axis) AC : ±1,500V Square wave LSIS internal test impulse noise DC : ±900V spec. Electrostatic IEC61131-2 Voltage: 4kV (Contact discharge)
  • Page 23: Performance Specifications

    Remote communication with external devices is Modem connection function available via public telephone line by connecting external modem to the module. Operated by communication client Protocol client exclusively used for LSIS, Operating Modbus ASCII/RTU client mode Use defined communication available...
  • Page 24: Product Specification

    Chapter 2 Product Specifications 2.3 Names of Parts Names of parts are as follows; ①-> ①-> ②-> ②-> ③-> ③-> [Fig. 2.3.1] Cnet I/F Module, Front <Name of each part> Name Contents ① Refer to the LED details ② RS-232C interface RS-232C interface to communicate with other device through serial ③...
  • Page 25: Cable Specifications

    Chapter 2 Product Specifications 2.4 Cable Specifications When using communication channel, RS-422 or RS-485, twisted pair cable for RS-422 shall be used in consideration of communication distance and speed. [Table 2.4] describes recommended specifications of cable. Also when using other cable than recommended, the cable conforming to characteristics in [Table 2.4] shall be used.
  • Page 26 Chapter 2 Product Specifications 2.5 Terminal Resistance For communication via RS-422/RS-485 channel, terminal resistance from external must be connected. Terminal resistance has the function to prevent distortion of signal by reflected wave of cable for long-distance communication, and the same resistance (1/2W) as characteristic impedance of cable must be connected to terminal of network.
  • Page 27 Chapter 2 Product Specifications (2) How to connect with terminal resistance during RS-485 connection [Fig. 2.5.3] RS-485 connection with Terminal Resistance (Less than V2.0) (Less than V2.0) (Less than V2.0) (V2.0 or Later) [Fig. 2.5.4] RS-485 connection with Terminal Resistance by hardware version...
  • Page 28 Chapter 3 Performance Specifications Chapter 3 Performance Specifications 3.1 Operation Mode Setting The operation mode of XGT Cnet is decided by the basic communication parameters. It operates separately from each communication port with the operation modes available as described below. (1) Server Mode Operates as a server in the network.
  • Page 29: Channel Operation During Normal Run

    Chapter 3 Performance Specifications 3.2 Channel Operation during Normal Run Each communication port operates independently to allow simultaneous Tx/Rx in separate transmission specifications. Therefore, transmission specifications can be set per RS-232C and RS-422 channel, and the operation is started and stopped according to channels.
  • Page 30 Chapter 3 Performance Specifications 3.3 Channel Operation in Diagnosis Mode (Loop-Back) Loop-Back diagnosis is a function to check if communication channel normally operates by itself without connection with external devices, which is available when the diagnosis service is executed. For the details of its operation method, see ‘Chapter 11 Diagnosis Function’.
  • Page 31 Chapter 3 Performance Specifications (1) How to connect RS-232C connector during modem connection This module can communicate with devices of long distance as connected with modem. Modem and RS-232C channel shall be connected as in [Fig. 3.4.2] below. Cnet (9-PIN) Modem side (25-PIN) Connection No.
  • Page 32 Chapter 3 Performance Specifications 3.4.2 RS-422/485 interface Channel RS-422 uses 5-pin connector (Terminal Block) for communication with external devices. The names and functions of pins and data directions are as shown in [Fig. 3.5] below Signal Direction Description Pin No. Name (Cnet<-->...
  • Page 33 Chapter 4 Installation and Test Operation Chapter 4 Installation and Test Operation 4.1 Installation Environment This product is of high reliance regardless of installation environment. However, for the sake of reliance and stability of the system, please pay attention to those precautions described below. (1) Environmental Conditions (a) To be installed on the control panel waterproof and dustproof.
  • Page 34 Chapter 4 Installation and Test Operation 4.2 Precautions for Handling The system configuration with Cnet I/F module shall be performed under the following precautions. 1) Don’t let it dropped or shocked hard. 2) Don’t remove PCB from the case. It will cause abnormal operation. 3) Don’t let any foreign materials including wiring waste inside the top of the module when wiring.
  • Page 35 Chapter 4 Installation and Test Operation 4.3 Operation Sequence The sequence of the product from installation to operation will be described below. After the product installation is complete, install and configure the system to be operated as specified in the following sequence. START Check the function and specification Install Cnet I/F module on the base.
  • Page 36 Chapter 4 Installation and Test Operation 4.4 Contents of Parameter Setting in the XG5000 Contents of parameter setting in XG5000 are as follows. 4.4.1 Basic setting parameter Setting right Lower Parameter Setting item Setting range Reference menu Client Server RS-232C ○...
  • Page 37 Chapter 4 Installation and Test Operation 4.4.2 P2P setting parameter Setting right (client) Setting range and User Parameter Lower menu Setting item Modbus Modbus contents definition ASCII frame Communication Base ○ ○ ○ ○ module setting Slot 0~11 ○ ○ ○...
  • Page 38 Chapter 4 Installation and Test Operation 4.5 I/O Assignment and Device Information 4.5.1 I/O assignment (1) When using the XGK CPU (a) How to configure the basic system The characteristic of basic system consisting of basic and extension base is as follows. The number of extension base is different according to CPU type and there are fixed type and changeable methods on I/O assignment.
  • Page 39 Chapter 4 Installation and Test Operation (2) When using the XGI CPU (a) How to configure the basic system Classification XGI-CPUU XGI-CPUS XGI-CPUE Max. extension no. Max. equip-able IO module no. • In case of 16 points module: 1,536 point 768 point 384 point •...
  • Page 40 Chapter 4 Installation and Test Operation (3) When using the XGR CPU (a) How to configure the basic system Classification XGR-CPUU Configuration of basic • Install basic base of same configuration double base • Available to install 1~31 extension bases Max.
  • Page 41 Chapter 4 Installation and Test Operation 4.5.2 Device information (1) Basic setting Waiting time Communication Communication Data Stop Modem Station Response Parity bit Model type Delay time between type speed initialization waiting time character Null 0~50 0~255 0~255 Disable 0~31 modem Dedicated 0~50...
  • Page 42 Chapter 4 Installation and Test Operation (4) P2P block setting Conditi Operational Command No. of Destination Read Save onal Data type Data size address mode driver function type variable area area flag XGT server Single 1 ~ 4 Disable 1/2/4/8 (XGK) Single 1 ~ 4 B/W/D/L (XGI)
  • Page 43 Chapter 4 Installation and Test Operation (5) User definition frame Group Frame Segment Reference Max. 10Byte Numerical constant 12345678901234567890 HEAD 1234567890 String constant (Saved as 3132..30) Max. 10Byte Numerical constant 12345678901234567890 TAIL 1234567890 String constant Transmission 1 (Saved as 3132..30) Max.
  • Page 44: Available Device Area Per Cpu

    Chapter 4 Installation and Test Operation 4.5.3 Available device area per CPU series Area Range Size (word) Reference type P0~P2047 2048 Read/Write/Monitor available M0~M2047 2048 Read/Write/Monitor available K0~K2047 2048 Read/Write/Monitor available Read/Monitor available F0~F2047 2048 (Write: available from 1025 word) T0~T2047 2048 Read/Write/Monitor available...
  • Page 45 Chapter 5 System Configuration Chapter 5 System Configuration Cnet I/F module is used for CPUH and CPUS both. Up to 24 modules can be mounted on the main and expansion bases, and all 24 modules can be used using a dedicated protocol. However, only 8 modules are available to use P2P service. Various communication systems can be configured via this module in accordance with application fields.
  • Page 46 Chapter 5 System Configuration 5.1.3 Modem connection to PC & Communication between Cnet I/F modules (1) PC and Cnet #1 station are connected through modem via RS-232C channel. (2) Cnet #1 station ~ N station carry out communication between Cnet I/F modules via RS-422 channel. (3) PC is operated as client station of Cnet #1 station.
  • Page 47 Chapter 5 System Configuration 5.1.4 Dedicated communication with PC (HMI) & Other company’s RS-422 communication (1) Null-modem communication with PC (HMI) via RS-232C channel is available. (2) PC (HMI) is operated as client station and Cnet I/F module RS-232C channel is operated as XGT server. (3) Cnet I/F module RS-422 channel is operated in P2P mode.
  • Page 48 Chapter 5 System Configuration 5.1.5 Optical modem communication for mobile communication Optical modem communication system for Cnet communication on body in lineal motion. Dedicated mode communication or P2P communication with monitoring device. RS -232C/RS-422 communication with optical modem. Dedicated client/sever communication between Cnet I/F modules. Optical modem connected with Cnet I/F module on mobile body can communicate with the other optical modem only when positioned in communication available Main application: Parking tower...
  • Page 49 (4) RS-232C channel of Cnet I/F module is dedicated modem mode. [Fig. 5.1.6] Wireless modem communication system Module setting Type RS-232C RS-422 Station No. Dedicated mode Not used 1 & 2 XGL-CH2A User mode [Table 5.1.3] Setting details between communication modules...
  • Page 50 Chapter 5 System Configuration 5.1.7 TM/TC communication system Long-distance communication with remote sever PLC via dedicated modem. Dedicated modem communication via RS-232C channel set to dedicated modem mode. Dedicated client/sever communication between Cnet I/F modules. 8 Cnet I/F modules can be mounted on TM client PLC. Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem Dedicated modem [Fig.
  • Page 51 Chapter 5 System Configuration 5.2 Unavailable System Configurations 5.2.1 Dial-up modem communication between Cnet I/F modules(on condition) (1) Cnet I/F module has no function to make telephone calls. (2) Cnet I/F module has only function to answer telephone calls. (3) Dial-up modem communication between Cnet I/F modules is unavailable. If using ‘UDATA’...
  • Page 52 Chapter 5 System Configuration 5.2.2 XG5000 connection using RS-422 channel of Cnet I/F module (1) XG5000 service of Cnet I/F module supports only RS-232C channel. (2) XG5000 connection via RS-422 channel is unavailable. (3) Setting of Cnet’s station number in XG5000 remote connection is unavailable. (4) XG5000 connection is available only for Cnet #1 station as shown in [Fig.
  • Page 53 Chapter 6 Communication Parameter Chapter 6 Communication Parameter 6.1 General Communication parameter is classified into basic setting parameter and P2P setting parameter. 6.1.1 Basic setting parameter Here sets the media information, H/W information and basic protocol information. Setting authority Lower Parameter Setting item Setting range...
  • Page 54 Chapter 6 Communication Parameter (1) P2P service (a) The Cnet I/F module operates as a client in the network. (b) When the designated event occurs, it is available to read or write the meory. (It can operate as XGT client and modbus client.) (c) It is used to communicate with other device that doesn’t support the XGT or modbus protocol or send/receive the user definition frame.
  • Page 55 Chapter 6 Communication Parameter 6.1.2 P2P setting parameter This sets the communication frame. Lower Parameter Setting item Setting range Contents menu Communica Base 0~7(0~31:XGR) tion module Set the location of module Slot 0~11 setting User frame definition XGT client Modbus ASCII P2P driver Communication method setting channel...
  • Page 56 Chapter 6 Communication Parameter 6.2 Transmission Standard In order to use the Cnet I/F module, set the transmission standard like baud rate, data/stop bit. The basic setting item of Cnet I/F module should be same with transmission standard of system. The written contents are saved in the CPU module of PLC, those are kept regardless of power supply unit the user write new one.
  • Page 57 Chapter 6 Communication Parameter (1) Communication type Check the Cnet I/F module and set the parameter about each channel accurately. If communication type set by parameter is different with channel type of real communication module, normal communication is impossible because CPU recognizes the channel type of real communication module. (a) Parity bit The Cnet I/F module defines three parity bit.
  • Page 58 Chapter 6 Communication Parameter 6.3 Installation and Execution of Software To use the XG5000 software, the user should install the XG5000. System requirement for execution is as follows. (1) PC and memory More than Pentium CPU and 128MB memory (2) Communication port RS-232C serial port and USB port is necessary.
  • Page 59 Chapter 6 Communication Parameter (3) Click the ‘Next’ button. The contract is shown. (4) Read carefully and press the ‘yes’ button. (5) Input the name and company name.
  • Page 60 Chapter 6 Communication Parameter (6) Designates the folder to install the XG5000. If the user wants to change the folder, press the ‘search’ button and input or select the new folder. The XG5000 needs the 30MB to install. If installation area is not enough, you can’t install the XG5000.
  • Page 61 Chapter 6 Communication Parameter (9) Among installation, XG5000 USB driver installation screen shows. (10) After a while, installation is complete.
  • Page 62 Chapter 6 Communication Parameter 6.3.2 USB device driver installation In case of installing the XG5000 first time, the user should install the USB device driver additionally. In case of not connecting with USB, install the USE device driver like below. In the window 2000, when installing the XG5000, USB device driver is installed automatically.
  • Page 63 Chapter 6 Communication Parameter (4) Among driver searching options, select “Search for the best driver in these locations” and check “Include this location in the search”. (5) Click [Browse] button. On Browse Folder Dialog Box, select Drivers’ folder where XG5000 is installed. 6-11...
  • Page 64 Chapter 6 Communication Parameter (6) Click [OK] button. Then, a computer starts searching for the driver files in the selected folder. (7) If the computer found the most suitable device driver, you will be asked to decide to install the selected device driver. Since USB device driver operated stably based on Windows OS, you may click [Continue Anyway] button (8) If the device driver has been installed completely, the Installation Complete Dialog Box will be displayed as follows.
  • Page 65 (a) Normal Case The USB device driver for XGT PLC has been installed successfully, if the list [LSIS XG Series] appears with the figure under [Universal Serial Bus Controller].
  • Page 66 Chapter 6 Communication Parameter (b) Abnormal Case The device driver has not been installed successfully, if the following figure is displayed. If the USB driver for XGT PLC is not installed successfully, reinstall the USB driver for XGT PLC in the following steps. (1) On the device driver with the icon with an exclamation mark, click the right button of the mouse.
  • Page 67 Chapter 6 Communication Parameter (2) H/W Update Wizard Dialog Box will appear. Select the option “Installation from a list or specific location (Advanced)” and click [Next]. The next sequence is manually the same as in Installation of Device Driver. If the USB driver for XGT PLC is not installed successfully, reinstall the USB driver for XGT PLC in the following steps (1) If the device driver has been installed incorrectly or in error, execute H/W Update Wizard.
  • Page 68 Chapter 6 Communication Parameter (2) On search and installation options, select [Don’t Search. I will choose the driver to install.] and click [Next] (3) Click [Have Disk…] on the Dialog Box below 6-16...
  • Page 69 Chapter 6 Communication Parameter (4) If Installation Dialog Box is displayed on the disk, click [Browse] button. (5) From the Browse File Dialog Box, move to the folder XG5000 is installed in. Select drivers folder to display GmUSBD.inf file. With this file selected, click [Open] button. (6) On the item of ‘Copy manufacturer’s files from’, a directory with the file of the device driver will be displayed.
  • Page 70 Chapter 6 Communication Parameter (7) On ‘Show compatible hardware’ list of the device driver Select Dialog Box, select “LSIS XGSeries” driver and then click [Next] button (8) Hardware Installation Dialog Box will appear. Click [Continue Anyway] to go on with the installation...
  • Page 71 Chapter 6 Communication Parameter (9) Completing the Hardware Update Dialog Box will appear. Click [Finish] button to end the installation of the driver 6-19...
  • Page 72 Chapter 6 Communication Parameter 6.4 Communication Module Registration In order to use Cnet I/F module, communication parameters shall be specified in XG5000. And for system setting of Cnet I/F module positioned at an optional place, its applicable module shall be registered in XG5000. How to register the optionally positioned Cnet I/F module depends on On/Off line status as described below.
  • Page 73 Chapter 6 Communication Parameter 6.4.2 Online registration of Cnet I/F module Step (1), (2) of off-line registration is same and the next step is as follows. (1) Input the project name, file location and PLC type the user is using. (2) If connection fails, check the connection status.
  • Page 74 Chapter 6 Communication Parameter (4) Click “I/O Sync”. (6) Read the message. If there is no problem, click “OK” 6-22...
  • Page 75 Chapter 6 Communication Parameter 6.4.3 How to read the parameter saved in the PLC To read the parameter saved in the PLC, follow the below sequence. (1) Select the ‘Open from PLC’. (2) After setting the connection type and depth, click the “connect” (3) The user can check the setting value of standard settings and P2P saved in the PLC.
  • Page 76 To operate the Cnet I/F module according to communication standard and mode defined by the user, follow the lower steps. For example, the following example sets the XGL-CH2A (RS232 1 port, RS422 1port) equipped at the base 0, slot 2 according the lower standard.
  • Page 77 Chapter 6 Communication Parameter (c) Writing the parameter 1) Select [Online]-[Write…] or click the icon ( 2) Check the setting module and click the ‘OK’. (d) Checking the operation 1) Select [Oline]-[Communication module setting]-[System Diagnosis] 2) Click the right button at the relevalet module and click the ‘Frame Monitor’ or ‘Status By Service’ to check the communication 6-25...
  • Page 78 Chapter 6 Communication Parameter 6.5.2 Menu bar and shortcut of XG5000 The following is menu bar and short cut of XG5000. Menu bar Menu Icon Description New Project Create a new project. Open Project Open the existing project. Open from PLC Upload the project and program stored in PLC.
  • Page 79 Close all windows belonging to XG5000. Reset Window Layout - Reset the default layout of the project. Help Open the help for each item LSIS Home Page Connect to LSIS Home Page via the Internet. Help About XG5000 Shows XG5000 information. 6-27...
  • Page 80 Chapter 6 Communication Parameter 6.6 How to set the Parameter according to Service 6.6.1 Exclusive Service Through this exclusive service function built-in Cnet I/F module, information and data of PLC can be read or written in PC and associated devices without additional programming in PLC. It operates as a server in communication network and responds to memory Read/Write request conforming to exclusive XGT protocol in external devices or PC, or conforming to Modbus protocol.
  • Page 81 Chapter 6 Communication Parameter Correspondent client device shall request within the range described in the table below. For example, bit Read request is available up to 2000 bits, and bit Write request is available up to 1968 bits (using Modbus RTU). Code (Hex) Purpose Used area...
  • Page 82 Chapter 6 Communication Parameter write area is assigned at the M300.  Address input data should be in effective area like M, P  Since modbus address is 1~9999 (decimal), size of bit IO is 9999/8=1249.875 (namely 1249, byte should be integer unit) ...
  • Page 83 Chapter 6 Communication Parameter 6.6.2 P2P service P2P service executes client operation of the communication module as realized with parameters setting which was set by instruction blocks in case of GM/MK. Four P2P instructions available in Cnet I/F module are Read/Write/Send/Receive. Send/Receive are used in case of ‘user definition frame’...
  • Page 84 Chapter 6 Communication Parameter  P2P parameters registration window  Up to 8 P2P parameters can be set  Multiple P2P parameters can be set for an identical Cnet I/F module However, Enable is available only for 1 parameter among the multiple P2P parameters for the identical Cnet I/F module ...
  • Page 85 Chapter 6 Communication Parameter (2) P2P channel setting Cnet I/F module provides 2 communication channels (channel 1, channel 2) separately operated. Driver type of the channels can be defined respectively for P2P service. In order for P2P channel to operate as client, active mode of standard settings should be ‘Use P2P’.
  • Page 86 Chapter 6 Communication Parameter ▶ Meaning of modbus function code Code Purpose Data address Reference (hex) Output Contact Status Read (Read Coil Status) 0XXXX(bit-output) Bit read 1XXXX(bit-input) Bit read Input Contact Status Read (Read Input Status) Output Register Read (Read Holding Registers) 4XXXX(word-output) Word read 3XXXX(word-input)
  • Page 87 Chapter 6 Communication Parameter 6.7 Operation Start XGT Cent I/F module’s operation is divided into P2P service and server function generally. When setting the Cnet I/F module as server, follow the 6.7.1 and when setting the Cnet I/F module as P2P service, follow the 6.7.2 about parameter setting 6.7.1 In case of acting as server (1) Connection setting...
  • Page 88 Chapter 6 Communication Parameter (4) Selecting the active mode (a) Selects the active mode. (b) XGT Cnet I/F module supports XGT server, Modbus ASCII server, Modbus RTU server. (5) Writing the parameter (a) Select [Online] - [Write] or click the icon ( (b) Select the module in which parameter setting is completed.
  • Page 89 Chapter 6 Communication Parameter (6) Checking the operation (a) Select [Online]-[Communication module setting]- [System Diagnosis] or click the icon ( (b) Click the right button on the the relevant module and click Frame Monitor or Status By Service. 6-37...
  • Page 90 Chapter 6 Communication Parameter 6.7.2 In case of acting as P2P service (client) (1) Standard settings (a) Step 1~3 of chapter 6.7.1 is same. * In case of acting as ASCII client, data bit is 7. (b) Select Active mode as Use P2P. (2) P2P channel setting (a) Select P2P Driver according to protocol.
  • Page 91 Chapter 6 Communication Parameter (3) P2P block setting (a) According to type of client, P2P block setting is activated differently. (b) Fill the activated cell according to protocol. *In case of user definition frame, it is available when frame is written in the user definition frame. (4) Writing the parameter (a) Select [Online] –...
  • Page 92 Chapter 6 Communication Parameter (5) Enabling the link (a) Select [Online]-[Communication module setting]-[Enable Link] or click the icon ( (b) Click the P2P to enable and click Write. 6-40...
  • Page 93 Chapter 6 Communication Parameter * Enable Link through flag It describes “Enable Link” method through flag. The following XG5000 version, CPU OS version is needed. Item Version XG5000 V3.61 or above XGR CPU V1.91 or above XGI CPU V3.4 or above XGK CPU V3.7 or above Flag list related with “Enable Link”...
  • Page 94 Chapter 6 Communication Parameter Flag Data type Device Description _HS10_REQ F10309 HS link 10 enable/disable request _HS11_REQ F1030A HS link 11 enable/disable request _HS12_REQ F1030B HS link 12 enable/disable request _HS1_REQ_NUM F10310 HS link 1 enable/disable setting _HS2_REQ_NUM F10311 HS link 2 enable/disable setting _HS3_REQ_NUM F10312 HS link 3 enable/disable setting...
  • Page 95 Chapter 6 Communication Parameter (7) Checking the operation (a) Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( (b) Click the right button on the relevant module and click Frame Monitor or Status By Service. 6-43...
  • Page 96 Chapter 6 Communication Parameter 6.8 Diagnosis Function of XG5000 6.8.1 Type of diagnosis function The user can check/diagnose the status of network/system by using the XG5000. 1) CPU module information 2) Detailed module information 3) Frame monitor 4) Loop back test 5) Status by service (1) System diagnosis How to check/diagnose the status of network/system by using the XG5000 is described below.
  • Page 97 Chapter 6 Communication Parameter 6.8.2 Checking the CPU status (1) CPU module information (a) Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( (b) Click the right button on the the CPU module and click CPU module information. 6.8.3 Communication module information (1) Communication module information (a) Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( (b) Click the right button on the the relevant module and click Detailed information.
  • Page 98 Chapter 6 Communication Parameter (2) Meaning of communication module information item Item Contents Base Number Information of base number under diagnosis Standard information Slot Number Information of slot number under diagnosis Link Type Type of communication module under diagnosis Station Station address used in the dedicated service and P2P Link information Information about communication type...
  • Page 99 Chapter 6 Communication Parameter (2) Detail of frame monitor items Item Contents Base No. Information of base number under diagnosis Standard information Slot No. Information of slot number under diagnosis Monitor selections Select Channel Select channel to monitor From Indicates whether it is TX or RX frame. Indicates the protocol type 1) XGT server 2) XGT client...
  • Page 100 Chapter 6 Communication Parameter 6.8.5 Loop back test (1) How to wire the module (a) Set actiive mode of test module as server. (b) Disable the P2P link of test module. (c) Wire like figure below according to communication port. 1) RS-232C communication: connect no.
  • Page 101 Chapter 6 Communication Parameter 6.8.6 Status by service (1) Dedicated service (a) Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( (b) Click the right button on the the Cnet I/F module and click Status By Service. (c) Click Dedicated Service tap. (d) Click Multiple reading and check the status by service.
  • Page 102 Chapter 6 Communication Parameter (3) Meaning of status by service Classification Item Contents Base Number Information of base number under diagnosis Standard Slot Number Information of slot number under diagnosis information Link type Type of communication module under diagnosis Dedicated service Drive type by service information Dedicated...
  • Page 103 7.1 Summary of Protocol 7.1.1 Summary XGT protocol is developed by LSIS for XGT Cnet I/F module, which allows the user to read/write the data, monitor by registration of monitor variable and read/write the XG5000 program of remote PLC CPU through remote connection of remote PLC CPU.
  • Page 104 Chapter 7 XGT Dedicated Communication 7.2 Frame Structure 7.2.1 Frame structure Frames of the XGT protocol are divided into request frame that request writing/reading the data and response frame that responds to request frame. (1) Sequence of instruction frame If XGT client transmits the specified request frame into server, server analyzes the received frame. If frame is suited for XGT protocol, server transmits the ACK response and if frame is not suited for XGT protocol, server transmits the NAK response including the error code.
  • Page 105 Chapter 7 XGT Dedicated Communication (3) Frame characteristic (a) Numerical data of frame are displayed as ASCII code about hexadecimal value as long as there is no special notice. (b) The following items are displayed as hexadecimal. 1) Station number 2) Instruction type as of figures (= data type) when main instruction is R(r) and W(w) 3) All items indicating total data size in structured data area 4) Instruction registration number for monitor registration and execution instruction...
  • Page 106 Chapter 7 XGT Dedicated Communication 7.2.2 Instruction list (1) Type of instruction Instructions used in dedicated communication are as follows. Instruction Classification Description Main instruction Instruction type Item ASCII ASCII Reading Reads direct variables in Bit, Word r(R) h72(h52) h5353 (Note1) single data Reading...
  • Page 107 Chapter 7 XGT Dedicated Communication (3) Available device area Area Range Size(Word) Remarks P0~P2047 2048 Read/Write/Monitor available M0~M2047 2048 Read/Write/Monitor available K0~K2047 2048 Read/Write/Monitor available Read/Monitor available F0~F2047 2048 (write: available from 1025) T0~T2047 2048 Read/Write/Monitor available C0~2047 2048 Read/Write/Monitor available L0~L11263 11264 Read/Write/Monitor available...
  • Page 108 Chapter 7 XGT Dedicated Communication 7.2.3 Writing the single direct variable (W(w)SS) This function is used to directly write the PLC device applicably to its data type. (1) Example of XGT client single write frame Station Instructio No. of Variable Variable Frame Classification...
  • Page 109 Chapter 7 XGT Dedicated Communication Item Description ▶ If the instruction is of small letter (w), BCC data is added and if it is of capital letter (W), no BCC data is added. Frame Check ▶ If the instruction is of small letter(w), ENQ ~ EOT are converted to ASCII value, which is added respectively, where the last 1 byte only of the result shall be contained in the frame as BCC.
  • Page 110 Chapter 7 XGT Dedicated Communication 7.2.4 Reading single direct variable (R(r)SS) ▷ This function is used to directly specify and read the PLC device applicably to its data type. ▷ Up to 16 separate devices memory can be read at a time. (1) Example that XGT client requests reading single direct variable Instruction No.
  • Page 111 Chapter 7 XGT Dedicated Communication Classification Description ▶Specify the no. of byte of Hex type and its type is ASCII. ▶This number is determined by data type (X, B, W, D, L) contained in direct variable name of external communication device request format. ▷Number of data according to variable type is as follows.
  • Page 112 Chapter 7 XGT Dedicated Communication (4) Example Example that M020’s 1 word and P001’s 1 word of station No.1 are read. (At this time, it is supposed that H1234 is in M020 and H5678 is in P001.) (a) XGT client’s request frame that requests reading single variable Station Instruction No.
  • Page 113 Chapter 7 XGT Dedicated Communication 7.2.5 Writing the direct variable continuously (W(w)SB) This function is used to write the data of the device continuously as long as specified from the specified address. (1) Example of request frame that XGT client requests writing direct variable continuously. Station Instruction Variable...
  • Page 114 Chapter 7 XGT Dedicated Communication (a) Request frame that XGT client requests writing direct variable continuously. Instruction Variable No. of Frame Variable Head Station no. Instruction Data Tail Classification type Length data Check Name Frame W(w) %DW000 AA15 h25445730 h4141313 h3031 h57(77) h5342...
  • Page 115 Chapter 7 XGT Dedicated Communication 7.2.6 Reading direct variable continuously (R(r)SB) This function is used to read the data of PLC device continuously as many as specified from the address. (1) XGT client: Request frame to read continuous data Station Variable No.
  • Page 116 Chapter 7 XGT Dedicated Communication (4) Example Example that reads two words from M000 of station no. 10(h0A) (We assume that the following data is included.) M000 = h1234 M001 = h5678 (a) XGT client: Request frame to read continuously Station Frame Instruction Instruction type Variable Length Variable...
  • Page 117 Chapter 7 XGT Dedicated Communication 7.2.7 Registration and execution of monitor variable (1) Registration of monitor variable (X##) Monitor variables can be registered separately up to 32 (0 to 31) with Read instruction of actual variables through this function, which executes the registered details by monitor instruction after the registration. (a) XGT client: frame to register monitor variable Station Registration...
  • Page 118 Chapter 7 XGT Dedicated Communication (d) Example Registers device M000 of station no. 1 as registration no. 01 1) XGT client: frame to register monitor variable Registration format Station Registrat Frame Classification Head Instruction Tail No. of Variable Variable ion no. check block length...
  • Page 119 Chapter 7 XGT Dedicated Communication ▷ In case that registration format of registration number is reading continuous device Classifica Station Registrati No. of Frame Head Instruction Data Tail tion on no. data check Frame Y(y) 9183AABB h3130 h59(79) h3039 h3034 h3931383341414242 2) In case of NAK response Classific...
  • Page 120 Chapter 7 XGT Dedicated Communication 7.2.8 Error code of XGT communication If XGT client transmits the request frame to server, server analyzes the received frame. If frame is suited for XGT protocol, it transmits the ACK response frame and if frame is not suited for XGT protocol, it transmits the NAK response frame including the error code.
  • Page 121 Chapter 7 XGT Dedicated Communication 7.3 XGT Communication Function 7.3.1 General XGT communication acts as XGT server or P2P (XGT client) by setting of Cnet I/F module and each setting can be done by XG5000. (1) XGT server (a) PC and peripheral device can read/write the inner information or data of PLC without special program. (b) Responses to request frame from XGT client.
  • Page 122 Chapter 7 XGT Dedicated Communication (c) Delay time is activated in case of RS422/485 and Response waiting time is activated in case of P2P mode. (4) Selecting active mode Select XGT server (5) Writing parameter (a) Select [Online] – [Write]. (b) Select the module to write and click OK.
  • Page 123 Chapter 7 XGT Dedicated Communication (6) Checking the operation (a) Select [Online]-[Communication module setting]-[System Diagnosis]. (b) Click the right button on the the relevant module and click Frame Monitor or Status By Service. (c) For more information about ‘Status By Service’, refer to ch. 11. 7-21...
  • Page 124 Chapter 7 XGT Dedicated Communication 7.3.3 Parameter setting in case of XGT client XGT client is executed by setting the P2P setting of XG5000. (1) P2P parameter configuration To use P2P service, the user should execute the setting in the P2P parameter window. P2P parameter consists of three categories.
  • Page 125 Chapter 7 XGT Dedicated Communication (2) Setting P2P channel Cnet I/F module provides two communication ports (channel 1, channel 2) that operates independently. It is available to define driver type for P2P service about each channel. However, active mode in the standard settings should be set as “Use P2P settings”.
  • Page 126 Chapter 7 XGT Dedicated Communication (3) P2P block setting If selecting P2P block in the P2P parameter setting window, P2P block setting window shows. Block setting window is same according to protocol and activated area is different. P2P Driver P2P block setting (4) Parameter setting when PLC acts as XGT client Operation of XGT client is divided into Read that executes reading the destination station’s memory and Write that executes writing self-station’s memory to destination station’s memory.
  • Page 127 Chapter 7 XGT Dedicated Communication 3) Standard settings (a) Double-click the relevant Cnet I/F module and execute the standard settings window. Designate the communication type, speed, modem type, data bit, stop bit and station. (b) Modem initialization is available in case of dial-up modem. (c) Delay time setting is available in case of RS-422/485 and Response waiting time setting is available in case of RS-422/485 P2P mode.
  • Page 128 Chapter 7 XGT Dedicated Communication 4) Selecting the active mode Select ‘Use P2P settings’ to act as XGT client. (b) Setting P2P parameter Type Block form Contents Channel Driver name changes according to driver set in the P2P Driver. 1. Read : when reading the destination station’s memory function 2.
  • Page 129 Chapter 7 XGT Dedicated Communication (c) Writing the parameter 1) Writing the parameter a) Select [Online] – [Write] b) Select the module in which parameter setting is completed. c) After writing, reset the module. 2) Enabling the link a) Select [Online]-[Communication module setting]-[Enable Link]. b) Click the P2P to enable and click Write.
  • Page 130 Chapter 7 XGT Dedicated Communication 3) Checking the operation a) Select [Online]-[Communication module setting]-[System Diagnosis]. b) Click the right button on the relevant module and click Frame Monitor or Status By Service. 7-28...
  • Page 131 Chapter 7 XGT Dedicated Communication 7.3.4 Frame monitor The user can check the TRX frame of Cnet module by using the frame monitor. (1) Checking the operation (a) Select [Online]-[Communication module setting]-[System Diagnosis]. (b) Click the right button on the relevant module and click Frame Monitor (2) Frame monitor (a) Select channel to monitor.
  • Page 132 Chapter 7 XGT Dedicated Communication 7.3.5 Example of parameter setting (1) Example of parameter setting in case of XGT client Client reads data of P0200 when M00001 is On and saves that 1 word data at the M200 of client. In order to check whether data is transmitted normally or not, there are two methods (using XG5000).
  • Page 133 Chapter 7 XGT Dedicated Communication 7.4 Remote connection 7.4.1 Summary of remote connection If XG5000 executed PC is located far from XGT-PLC, remote PLC program can be controlled for download, upload, debugging, monitoring, etc. through remote connection function of Cnet I/F module. Especially in case that XG5000 is located far away from PLC, PLC CPU can be conveniently accessible through remote function of XG5000.
  • Page 134 Chapter 7 XGT Dedicated Communication 7.4.3 Remote 1 connection This is used in the system like [Figure 7.3.1] and connection method is as follows. (1) Click ‘Connection settings’ and set Depth as Remote 1 (a) General 1) Timeout interval: when trying to connect PLC, if response doesn’t come within Timeout interval, XG5000 considers connection trial as timeout, connection fail.
  • Page 135 Chapter 7 XGT Dedicated Communication 2) Click [Setting…] and set details of RS-232C and remote connection 1 3) Details of RS-232C a) Port number: port of computer where XG5000 is installed. b) Baud rate: supports 38400 and 115200 bps. 4) Details of remote 1 a) Network type: means communication module executing remote connection and select XGT-Cnet.
  • Page 136 Chapter 7 XGT Dedicated Communication (2) Click Connection settings and set details of remote 1 connection (a) Details of RS-232C 1) Port number: Computer port number where XG-5000 installed 2) Baud rate: supports 38400, 115200 bps (b) Details of remote 1 1) Network type: means communication module executing remote connection and select XGT-Cnet.
  • Page 137 Chapter 7 XGT Dedicated Communication 7.5 Modem Communication 7.5.1 Summary When using RS-232C and RS 422/485, because of characteristic of communication type, communication length is limited (RS-232C: 15m, RS 422/485: 500m). If Modem and Cnet module is used, control of remote PLC is possible.
  • Page 138 Chapter 7 XGT Dedicated Communication Procedure of remote connection through modem is as follows. (a) Set active mode of RS-232C as XGT server. 1) Modem type a) Dial-up: when using the airline, select dial-up modem. b) Dedicated: when using the dedicated line, select dedicated modem. 2) Modem Initialization Input command to initialize the modem.
  • Page 139 Chapter 7 XGT Dedicated Communication (d) Click Settings… and set details of modem. 1) Modem a) Dial-up When using the public line, select Dial up. b) Dedicated When not using the public line, select Dedicated. 2) Modem settings a) Port number Indicates communication port of modem b) Baud rate Modem’s communication speed...
  • Page 140 Chapter 7 XGT Dedicated Communication e) In case of remote 2 connection, select base and slot number of remote 1 communication module and select station number of remote 2 communication module. Input station number set in the Cnet module. In case of Cnet channel, select communication channel of remote 2.
  • Page 141 Chapter 7 XGT Dedicated Communication Note 1) Baud rate is communication speed between PC and modem. Modem communication speed means communication speed between modem and other modem and it is determined automatically according to quality of airline and partner modem’s speed. 2) XG5000 remote connection should use RS-232C channel.
  • Page 142 Chapter 7 XGT Dedicated Communication 7.6 Communication Command 7.6.1 XGK command (1) P2PSN Available area Flag Cons command Step Error Zero Carry PMK F Z D.x R.x tant (F110) (F111) (F112) P2PSN COMMAND P2PSN P2PSN (a) Area setting Operand Setting Data size P2P number ( 1 ~8 ) Word...
  • Page 143 Chapter 7 XGT Dedicated Communication (2) P2PWRD Available area Flag Erro Erro Cons Command Step Error Zero Carry Z D.x R.x tant (F11 (F11 (F110) (F111) (F112) P2PWRD COMMAND P2PWRD P2PWRD (a) Area setting Operand Description Data size P2P number ( 1 ~ 8 ) Word Block number ( 0 ~ 63 ) Word...
  • Page 144 Chapter 7 XGT Dedicated Communication (3) P2PWWR Available area Flag Erro Erro Erro Cons command Step Error Zero Carry PMK F Z D.x R.x tant (F11 (F11 (F11 (F110) (F111) (F112) P2PWWR COMMAND P2PWWR P2PWWR (a) Area setting Operand Description Data size P2P number ( 1 ~ 8 ) word...
  • Page 145 Chapter 7 XGT Dedicated Communication (4) P2PBRD Available area Flag Cons command Step Error Zero Carry PMK F Z D.x R.x tant (F110) (F111) (F112) P2PBRD COMMAND P2PBRD P2PBRD (a) Area setting Operand Description Data size P2P number ( 1 ~ 8 ) word Block number ( 0 ~ 63 ) word...
  • Page 146 Chapter 7 XGT Dedicated Communication (5) P2PBWR Available area Flag Cons command Step Error Zero Carry PMK F Z D.x R.x tant (F110) (F111) (F112) P2PBWR COMMAND P2PBWR P2PBWR (a) Area setting Operand Description Data size P2P number ( 1 ~ 8 ) word Block number ( 0 ~ 63 ) word...
  • Page 147 Chapter 7 XGT Dedicated Communication 7.6.2 XGI command (1) P2PSN Function block Description P2PSN Input : requests function block execution BOOL DONE BOOL P_NUM : P2P number BL_NUM : block number P_NUM USINT BOOL STAT : station number USINT BL_NUM output DONE : Keeping 1 after first operation USINT...
  • Page 148 Chapter 7 XGT Dedicated Communication (2) P2PRD Function block Description P2PRD Input : requests function block execution BOOL BOOL DONE P_NUM : P2P number BL_NUM : block number P_NUM USINT STAT USINT VAL_NUM : Variable number BL_NUM USINT VAL_SIZE : Variable size : Device (Only direct variable) VAL_NUM USINT...
  • Page 149 Chapter 7 XGT Dedicated Communication (3) P2PWR Function block Description P2PWR Input : requests function block execution BOOL BOOL DONE P_NUM : P2P number BL_NUM : block number USINT P_NUM STAT USINT VAL_NUM : Variable number VAL_SIZE : Variable size USINT BL_NUM : Device (Only direct variable)
  • Page 150 Chapter 8 Modbus Communication Chapter 8 Modbus Communication 8.1 General Modbus protocol is specified open protocol used between client-server, which executes reading/writing data according to function code. Communication between devices that use Modbus protocol uses Client-server function in which only one client processes the data.
  • Page 151 Chapter 8 Modbus Communication 8.2.2 Structure of modbus protocol Modbus protocol’s structure is as follows. In case of normal communication, process step is as follows. In case of abnormal communication, process step is as follows. When receiving the abnormal frame from client, server transmits error code and exceptional code. Error code is function code adding 80(Hex) and exceptional code indicate the specific error content.
  • Page 152 Chapter 8 Modbus Communication 8.3 Structure of Frame 8.3.1 Structure of frame in the ASCII mode Frame structure in the ASCII mode is as follows. Classification Start Station no. Function code Data Error check Size (byte) (1) Characteristic of ASCII mode (a) In the ASCII mode, start of frame is indicated with colon (:), which is ASCII code, and end of frame is indicated with ‘CRLF’.
  • Page 153 Chapter 8 Modbus Communication (4) Error check area It determines if frame is normal or not by using CRC check of 2 byte. (5) Modbus address regulation Address in the data starts from 0 and it is same with value that is minus 1 from modbus memory, Modbus address 2 is same with address 1 of data.
  • Page 154 Chapter 8 Modbus Communication (c) In case of response frame (In case of receiving abnormal frame) Exceptional Frame Station no. Error code Tail (CRLF) code Size (byte) (2) Details of frame (a) Station no.: indicates the station no. of slave to read bit of output area. (b) Function code: ‘01’...
  • Page 155 Chapter 8 Modbus Communication 8.3.5 (02) Read Input Status (1) Reading bit of input area In case of reading data of bit type of input area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Station Function code...
  • Page 156 Chapter 8 Modbus Communication 8.3.6 Read Holding Registers (03) (1) Reading word of output area When reading data of word type of output area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Station Function code...
  • Page 157 Chapter 8 Modbus Communication 8.3.7 Read Input Registers (04) (1) Reading word of input area In case of reading word of input area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Station Function code...
  • Page 158 Chapter 8 Modbus Communication 8.3.8 Force Single Coil (05) (1) Writing single bit of output area When writing single bit of output area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Function Frame error...
  • Page 159 Chapter 8 Modbus Communication 8.3.9 Preset Single Register (06) (1) Writing single word of output area In case of writing single word to output area, request and response frame is as follows. Detail of frame is applied in case of ASCII mode. a) Request frame Station Function code...
  • Page 160 Chapter 8 Modbus Communication 8.3.10 Force Multiple Coils (0F) (1) Writing continuous bit to output area In case of writing continuous bit to output area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Frame Station...
  • Page 161 Chapter 8 Modbus Communication (3) Frame example Example writing 10 continuous bits starting 20 address of 1 server acting as Modbus RTU mode Ex.) Data value to write continuously Bit value Address (a) Request frame Error Address No. of output Output Classifica Station...
  • Page 162 Chapter 8 Modbus Communication 8.3.11 Preset Multiple Registers (10) (1) Writing word continuously to output area In case of writing word continuously to output area, request and response frame is as follows. Tail of frame is applied in case of ASCII mode. (a) Request frame Frame Station...
  • Page 163 Chapter 8 Modbus Communication (3) Frame example Example writing continuous 2 words starting 20 address of server 1acting as Modbus RTU mode Ex.) value to write continuously Address (a) Request frame Address No. of output Classific Station Functio Data Error Output Upper Lower...
  • Page 164 Chapter 8 Modbus Communication 8.4 Modbus Server This is used when partner communication device acts as Modbus client. XGT supports ASCII mode and RTU mode of Modbus, it can be defined in the standard setting window. 8.4.1 Setting when CPU is XGK series and Cnet acts as ASCII server (1) Connection setting (a) Select [Online]-[Connection settings].
  • Page 165 Chapter 8 Modbus Communication (4) Selecting active mode Select Modbus ASCII server. (5) Modbus settings (a) Modbus settings is activated when selecting Active mode as Modbus ASCII server. (b) Bit read area Address: indicates Bit read area start address and it consists of 5 digits. At this time, first 4 digits indicate word value and last one digit indicates bit value.
  • Page 166 Chapter 8 Modbus Communication (7) Checking the operation (1) Select [Online]-[Communication module setting]-[System Diagnosis]. (2) Click the right button on the the relevant module and click Frame Monitor or Status By Service. 8-17...
  • Page 167 Chapter 8 Modbus Communication 8.4.2 Setting when CPU is XGI/XGR series and Cnet acts as ASCII server (1) Connection setting (a) Select [Online] -> [Connection Settings] (b) Click Connect after setting. (2) Reading I/O information Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync” Reads the information about currently equipped module (3) Standard settings (a) Double-click the relevant Cnet I/F module and execute the standard setting window.
  • Page 168 Chapter 8 Modbus Communication (4) Selecting active mode Select Modbus ASCII server (5) Modbus settings (a) Modbus settings is activated when selecting Active mode as Modbus ASCII server. (b) Bit read area Address: indicates Bit read area start address Ex.) In case of %MX100: 100 bit of M device is selected as start address of Bit read area Address.
  • Page 169 Chapter 8 Modbus Communication (7) Checking the operation (a) Select [Online]-[Communication module setting]-[System Diagnosis]. (b) Click the right button on the the relevant module and click Frame Monitor or Status By Service. 8-20...
  • Page 170 Chapter 8 Modbus Communication 8.4.3 Setting when CPU is XGK series and Cnet acts as Modbus RTU server (1) Connection settings (a) Select [Online]-[Connection settings]. (b) After setting, click Connection. (2) Reading I/O information Select [Online]-[Diagnosis]- [I/O Information] and click “I/O Sync”. Reads the information about currently equipped module (3) Standard settings (a) Double-click the relevant Cnet I/F module and execute the standard setting window.
  • Page 171 Chapter 8 Modbus Communication (4) Selecting active mode Select Modbus RTU server. (5) Modbus settings (a) Modbus settings is activated when selecting Active mode as Modbus RTU server. (b) Bit read area Address: indicates Bit read area start address and it consists of 5 digits. At this time, first 4 digits indicate word value and last one digit indicates bit value.
  • Page 172 Chapter 8 Modbus Communication 8-23...
  • Page 173 Chapter 8 Modbus Communication 8.4.4 Setting when CPU is XGI/XGR series and Cnet acts as Modbus RTU server (1) Connection setting (a) Select [Online]-[Connection settings]. (b) After setting, click Connection. (2) Reading I/O information Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”. Reads the information about currently equipped module (3) Standard settings (a) Double-click the relevant Cnet I/F module and execute the standard setting window.
  • Page 174 Chapter 8 Modbus Communication (4) Selecting active mode Select Modbus RTU server. (5) Modbus settings (a) Modbus settings is activated when selecting Active mode as Modbus RTU server. (b) Bit read area Address: indicates Bit read area start address Ex.) In case of %MX100: 100 bit of M device is selected as start address of Bit read area Address.
  • Page 175 Chapter 8 Modbus Communication (7) Checking the operation (1) Select [Online]-[Communication module setting]-[System Diagnosis]. (2) Click the right button on the the relevant module and click Frame Monitor or Status By Service. 8-26...
  • Page 176 Chapter 8 Modbus Communication 8.5 Modbus RTU/ASCII Client 8.5.1 Standard settings in case of Modbus client (1) Connection setting (a) Select [Online] -> [Connection Settings] (b) Click Connect after setting. (2) Reading I/O information Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”. Reads the information about currently equipped module (3) Standard settings (a) Double-click the relevant Cnet I/F module and execute the standard setting window.
  • Page 177 Chapter 8 Modbus Communication (4) Selecting active mode Select Use P2P settings. (5) P2P channel setting (a) Double-click P2P Channel and select protocol for each channel. (b) P2P driver supports user frame definition, XGT client, Modbus RTU/ASCII client. 8-28...
  • Page 178 Chapter 8 Modbus Communication 8.5.2 Settings in case of Modbus RTU/ASCII client There are two commands; Write (writes memory of self station to destination station’s memory area) and Read (reads memory of destination memory and saves it in the memory area of self station) Setting methods of both RTU and ASCII clients are same.
  • Page 179 Chapter 8 Modbus Communication 1. It is checked automatically. Destinatio 2. In case that the user doesn’t want to use relevant block, remove n station the check indication. Then that block doesn’t work. Destinatio n station 1. Destination station number, setting range is 0~31. number ▶...
  • Page 180 Chapter 8 Modbus Communication 8.5.3 Writing the parameter (1) Writing the parameter (a) Select [Online]-[Write]. (b) Select the module in which parameter setting is completed. (c) After writing, reset the module. (2) Enabling the link (a) Select [Online]-[Communication module setting]-[Enable Link]. (b) Click the P2P to enable and click Write.
  • Page 181 Chapter 8 Modbus Communication 8.6 Frame Monitor The user can check the TRX frame of Cnet module by using the frame monitor. (1) Checking the operation (a) Select [Online]-[Communication module setting]-[System Diagnosis]. (b) Click the right button on the relevant module and click Frame Monitor (2) Frame monitor (a) Select channel to monitor.
  • Page 182 Chapter 9 User-defined Communication Chapter 9 User-defined Communication 9.1 General There are many protocols according to producer of communication device and it is impossible to supports diverse protocols. So if the user defines protocols and writes program, Cnet I/F module allows the communication between different devices according to defined protocol.
  • Page 183 Byte SUM 1’S COMP Takes 1’s complement about byte sum result CRC 16 16 bit error detection method LGIS CRC Error detection method used for LSIS PLC Method checking error DLE AB Error detection method used for DF1Protocol of Allen Bradley...
  • Page 184 Chapter 9 User-defined Communication When setting BCC, in case of general method, the user need not set BCC setting range and indication method and in case of dedicated method, the user should set BCC setting range and indication method. Item Contents Start area Determines where BCC calculation starts from among HEAD/BODY/TAIL...
  • Page 185 Chapter 9 User-defined Communication 9.3 Writing of frame 9.3.1 Standard setting for user-defined communication To use user-defined communication, select Use P2P settings like client. Sequence Procedure Setting method Connection setting 1. Select [Online]-[Connection Settings]. 2. Click [Connect] after setting. Reading I/O Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”.
  • Page 186 Chapter 9 User-defined Communication Sequence Procedure Setting method Setting 1. Click P2P View 2. Right click on the CPU -> Add item -> P2P Communication 3. Setting type, base, slot, P2P index channel setting 1. Double-click P2P driver and select protocol according to each channel 2.
  • Page 187 Chapter 9 User-defined Communication 9.3.2 Writing transmission frame Frame is composed of HEAD indicating start, TAIL indicating end and BODY which is data area. How to write transmission frame is as follows. Sequence Setting contents Setting method Writing user frame definition 1.
  • Page 188 Chapter 9 User-defined Communication Sequence Setting contents Setting method HEAD registration 1. Double-click HEAD. Then edit window is created. 2. Double-click edit window or click right button and select Add segment. 3. Select Form. 1) Numerical constant (1) Defines numerical constant among frame (2) Data value is always Hex (Hexadecimal) 2) String constant (1) Registers string constant among frame...
  • Page 189 Chapter 9 User-defined Communication 9.3.3 Writing reception frame Sequence Setting method Setting method Writing user-defined frame 1. Select User frame definition. 2. Click the right button of mouse and select Add Group. Creating frame 1. Group name is name of frame for user to write. 2.
  • Page 190 Chapter 9 User-defined Communication Sequence Setting method Setting method 1. If double-click TAIL, edit window shows. TAIL registration 2. Setting method is same with step 5. 3. Add BCC is activated after inserting segment. BODY registration 1. Double-click BODY and select data form. 1) Numerical constant and string constant are same as described above.
  • Page 191 Chapter 9 User-defined Communication 9.3.4 Setting parameter To send and receive the user definition frame of XG-PD, the user should set the parameter by P2P block. How to set the P2P block is as follows. Type Block type Meaning Channel Driver name changes according to driver set in the P2P Driver.
  • Page 192 Chapter 9 User-defined Communication 9.3.5 Writing parameter Sequence Procedure Setting method Writing parameter 1. Select [Online]-[Write]. 2. Select the module in which parameter setting is completed. 3. After writing, reset the module. Checking operation 1. Select [Online]-[Communication module setting]-[System Diagnosis]. 2.
  • Page 193 Chapter 9 User-defined Communication 9.4 Frame Monitor The user can check the TRX frame of Cnet module by using the frame monitor. Sequence Procedure Setting method Checking the operation 1. Select [Online]-[Communication module setting]-[System Diagnosis]. 2. Click the right button on the relevant module and click Frame Monitor Frame monitor 1.
  • Page 194 Chapter 9 User-defined Communication 9.5 UDATA Instruction 9.5.1 XGI Instruction (1) SEND_UDATA SEND_UDATA Availability Flags XGI, XGR User defined data send Function Block Description Input REQ: requires to execute the function block BASE : base number SLOT: slot number CH: channel(1 or 2) DATA: data area to send SIZE: data size to send Output...
  • Page 195 Chapter 9 User-defined Communication (b) Error STAT Message Description Initial state Initial state before instruction operation No error normal operation Module setting error Module is not installed or CNET module trouble Channel setting error Input range(1, 2) is exceeded Array size error Transmit data size exceed 1024 Parameter setting error CNET module’s parameter is not set as User defined or link enable is not...
  • Page 196 Chapter 9 User-defined Communication RCV_UDATA Availability Flags RCV_UDATA User defined data send XGI, XGR Function Block Description Input REQ: requires to execute the function block BASE : base number SLOT: slot number CH: channel(1 or 2) DATA: data area to save Output DONE: maintains 1 after operation STAT: completion and ERR info...
  • Page 197 Chapter 9 User-defined Communication (3) SEND_DTR SEND_DTR Availability Flags DTR signal send XGI, XGR Function Block Description Input REQ: requires to execute the function block BASE : base number SLOT: slot number CH: channel(1 or 2) DTR: 0 or 1 Output DONE: maintains 1 after operation STAT: completion and ERR info...
  • Page 198 Chapter 9 User-defined Communication (4) SEND_RTS SEND_RTS Availability Flags RTS signal send XGI, XGR Function Block Description Input REQ: requires to execute the function block BASE : base number SLOT: slot number CH: channel(1 or 2) RTS: 0 or 1 Output DONE: maintains 1 after operation STAT: completion and ERR info...
  • Page 199 Chapter 9 User-defined Communication 9.5.2 XGK Instruction (1) SNDUDATA Area Available Flag Instruction Step Error Zero Carry PMK F D.x R.x Const U N (F110) (F111) (F112) O O O SNDUDATA O O O O O O O O O COMMAND SNDUDATA SNDUDATA...
  • Page 200 Chapter 9 User-defined Communication (b) Error 1) If sl value is not matched with CNET module installed, set error flag(F110). (c) State Information State code State Information Initial state Before excute instruction Done Instruction excute complete Modlue setting error If sl value is not matched with CNET module installed Channel setting error S1 value is not 1 or 2 Data size setting error...
  • Page 201 Chapter 9 User-defined Communication (2) RCVUDATA Area Available Flag Instruction Step Error Zero Carry D.x R.x (F110) (F111) (F112) SNDUDATA COMMAND RCVUDATA RCVUDATA [Area Setting] Operand Description Data type Base and slot number WORD Channel (1 or 2) WORD Data area to receive WORD Data size to receive (maximum 1024 Byte) WORD...
  • Page 202 Chapter 9 User-defined Communication (c) State Information State code State Information Initial state Before excute instruction Done Instruction excute complete Modlue setting error If sl value is not matched with CNET module installed Channel setting error S1 value is not 1 or 2 No data received No data received Communication...
  • Page 203 Chapter 9 User-defined Communication (3) SENDDTR Area Available Flag Instruction Step Error Zero Carry D.x R.x (F110) (F111) (F112) SNDDTR COMMAND SENDDTR SENDDTR [Area Setting] Operand Description Data type Base and slot number WORD Channel (1 or 2) WORD DTR (0 or 1) WORD Temporary device that used in instruction WORD...
  • Page 204 Chapter 9 User-defined Communication (c) State Information State code State Information Initial state Before excute instruction Done Instruction excute complete Modlue setting error If sl value is not matched with CNET module installed Channel setting S1 value is not 1 or 2 error DTR level setting S2 DTR setting value is not 0 or 1...
  • Page 205 Chapter 9 User-defined Communication (4) SENDRTS Area Available Flag Instruction Step Error Zero Carry D.x R.x (F110) (F111) (F112) SNDDTR COMMAND SENDRTS SENDRTS [Area Setting] Operand Description Data type Base and slot number WORD Channel (1 or 2) WORD RTS (0 or 1) WORD Temporary device that used in instruction WORD...
  • Page 206 Chapter 9 User-defined Communication (c) State Information State code State Information Initial state Before excute instruction Done Instruction excute complete Modlue setting error If sl value is not matched with CNET module installed Channel setting error S1 value is not 1 or 2 DTR level setting error S2 RTS setting value is not 0 or 1 Communication...
  • Page 207 Chapter 10 Program Examples Chapter 10 Program Examples 10.1 Setting of Cnet I/F module in the XG5000 Operation of XGT Cnet I/F is divided into P2P service and Server. ▶ P2P service: acts as client (master) and request reading/writing. ▷ XGT client ▷...
  • Page 208 Chapter 10 Program Examples 10.1.1 In case of acting as server Sequence Procedure Setting method Connection setting 1. Select [Online]-[Connection Settings] or click icon( 2. Click [Connect] after setting. Reading I/O Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”. information Reads the information about currently equipped module. Standard Settings 1.
  • Page 209 Chapter 10 Program Examples Sequence Procedure Setting method 1. Select active mode of server for user to use. Selecting the 2. XGT Cnet I/F module supports XGT server, Modbus ASCII server, Modbus RTU active mode server. Writing parameter 1. Select [Online]-[Write] or click icon ( 2.
  • Page 210 Chapter 10 Program Examples 10.1.2 In case of acting as P2P service (client) Sequence Procedure Setting method Standard 1. Step 1~3 is same as described above. settings *In case of ASCII client, data bit should be 7. Active mode 1. Select Use P2P settings as active mode. P2P Setting 1.
  • Page 211 Chapter 10 Program Examples Sequence Procedure Setting method channel setting 1. Double-click P2P driver and select protocol according to each channel 2. P2P driver supports user definition frame, XGT client, Modbus RTU/ASCII client. P2P block setting 1. P2P items are activated differently according to type of client set in the channel. 2.
  • Page 212 Chapter 10 Program Examples Enabling the link 1. Select [Online]-[Communication module setting]-[Enable Link] or click icon ( 2. Click the P2P to enable and click Write. Checking operation 1. Select [Online]-[Communication module setting]-[System Diagnosis] or click icon ( 2. Click the right button on the relevant module and click Frame Monitor or Status By Service. 10-6...
  • Page 213 Chapter 10 Program Examples 10.2 XGT Communication What is XGT communication? ▶ Protocol defined by LSIS, which is divided into XGT client and XGT server. ▶ XGT Client: requests reading/writing data ▶ XGT server: answer to request of client System configuration and operation of dedicated service ▶...
  • Page 214 Chapter 10 Program Examples 10.2.1 Settings of XGT server Setting methods of above settings are as follows. (in case of server) Sequence Procedure Setting method Connection settings 1. Select [Online]-[Connection settings] or click ( 2. After setting the connection option according to user, click the ‘connection’. Reading IO Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”.
  • Page 215 Chapter 10 Program Examples Sequence Procedure Setting method Writing the parameter 1. Select [Online]-[Write] or click icon ( 2. Select the module in which parameter setting is completed. 3. After writing, reset the module. 10-9...
  • Page 216 Chapter 10 Program Examples 10.2.2 Settings when acting as XGT client To operate XGT client, standard settings of Cnet I/F should be done first. Sequences of standard settings are as follows. Sequence Procedure Setting method Connection setting 1. Select [Online]-[Connection settings] or click icon ( 2.
  • Page 217 Chapter 10 Program Examples After standard settings, P2P channel and P2P block should be set. Setting methods are as follows. Sequence Procedure Setting method P2P setting Click ‘ ’ below th project windows Communication module settings 1. Right click on the Network -> Add Item -> Communication module 2.
  • Page 218 Chapter 10 Program Examples Sequence Procedure Setting method Setting of reading operation 1. Channel, conditional flag, command type, data type, No. of variable, destination station no.: Same as described in setting is writing. 2. P2P function: select READ. 3. Setting: set Read area and Save area. 1) Read area: device address of data saved in server 2) Save area: device address of client to save Writing...
  • Page 219 Chapter 10 Program Examples Sequence Procedure Setting method Enabling the link 1. Select [Online]-[Communication module setting]-[Enable Link] or click icon ( 2. Click the P2P to enable and click Write. 10-13...
  • Page 220 Chapter 10 Program Examples 10.2.3 Checking the operation The user can analyze frame by using the frame monitor of XG5000 to check it communication is normal or not. Method of frame monitor of Cnet I/F module is same regardless of protocol. Sequence Procedure Setting method...
  • Page 221 System configuration and operation of Modbus communication (Modbus RTU mode) example ▶ System configuration [Figure 10.2] XGT Modbus communication system configuration example ▶ Mount XGL-CH2A on no. 0 slot of each PLC ▶ Modbus communication at channel 2 of each PLC ▶ Settings of client...
  • Page 222 Chapter 10 Program Examples 10.3.1 Settings when acting as Modbus RTU server Standard settings are as follows to act as Modbus RTU server. Sequence Procedure Setting method Connection setting 1. Select [Online]-[Connection settings] or click icon ( 2. After setting the connection option according to user, click the ‘connection’. Reading IO Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”.
  • Page 223 Chapter 10 Program Examples Modbus setting 1. Bit read area Address: P00000 2. Bit write area Address: M0000 3. Word read area Address: P0000 4. Word write area Address: M0000 * In the Bit read/write area Address, upper 4 digit is word address and the last digit is bit address (P00110: 0 bit of P11 word)
  • Page 224 Chapter 10 Program Examples 10.3.2 Setting when acting as RTU client Standard settings are as follows to act as Modbus RTU client. Sequence Procedure Setting method Connection setting 1. Select [Online]-[Connection settings] or click icon ( 2. After setting the connection option according to user, click the ‘connection’. Reading IO Select [Online]-[Diagnosis]-[I/O Information] and click “I/O Sync”.
  • Page 225 Chapter 10 Program Examples After standard settings, P2P channel and P2P block should be set. Setting methods are as follows. Sequence Procedure Setting method P2P setting Click ‘ ’ below th project windows Communication module settings 1. Right click on the Network -> Add Item -> Communication module 2.
  • Page 226 Chapter 10 Program Examples Sequence Procedure Setting method Setting of writing operation (2) ▶ Write 4 words from D0 of client to M2~M5 of server 1. Ch., P2P function, conditional flag, destination station no.: same with step 4 2. Command type, Data type: because of writing continuous 4words, select Continuous, WORD 3.
  • Page 227 Chapter 10 Program Examples Sequence Procedure Setting method Setting of writing operation (4) ▶ Write 0~15 bit of M2 to 0~15 bit of M21 of server 1. Ch., P2P function, conditional flag, destination station no.: same with step 6 2. Command type: select continuous. 3.
  • Page 228 Chapter 10 Program Examples Sequence Procedure Setting method Setting of reading operation ▶ Read 1 bit of P2 of server and save it at 1 bit of M170. 1. Ch., Conditional flag, Command type, Data type, Destination station no.: same with step 6 2.
  • Page 229 Chapter 10 Program Examples Sequence Procedure Setting method Writing parameter 1. Select [Online]-[Write] or click icon ( 2. Select the standard setting and P2P set as Modbus RTU client to write and click OK 3. Write parameter and Reset the module. Enabling the link 1.
  • Page 230 [Figure 10.3] configuration of user-defined communication system ▶ System configuration Describes operation between Cnet I/F module and partner device (Temperature controller) XGK-CPUH Han-Young temperature controller Device name Communication *note2) XGL-CH2A module Operation mode Client Server Protocol User frame definition PC Link...
  • Page 231 Chapter 10 Program Examples ▶ Frame structure of PC Link Frame of temperature is executed by ASCII string and can read/write defined D, I register. There are two protocols, STD standard protocol and SUM protocol adding Check Sum to standard protocol. Selection of protocol type is determined by parameter of temperature controller.
  • Page 232 Chapter 10 Program Examples ▶ Standard settings For standard setting, refer to setting method when acting as P2P service of 10.1.2 and configure above system. ▶Writing frame that requests reading data Describes how to write frame in XG5000 frame that requests reading data (transmission frame) Sequence Setting method 1.
  • Page 233 Chapter 10 Program Examples Sequence Setting method 1. If the user double-clicks HEAD, segment setting window named DRS.HEAD is created. 2. Name of segment setting window is different according to frame (frame name.HEAD/TAIL/BODY name) 3. Double-click data window. Select Numerical constant as Form and input 2 as Data. 02 means STX as ASCII code.
  • Page 234 Chapter 10 Program Examples ▶Writing frame to receive response frame of temperature controller Writing response frame (Reception frame) Sequence Setting method 1. Write like step 2 of frame that request reading data. 2. Frame name is DRS_RECE. 1. Click ‘Add Frame’ and select HEAD, TAIL, BODY as type and input BODY name. 2.
  • Page 235 Chapter 10 Program Examples ▶ Writing frame Sequence Setting method 1. Double-click P2P block of P2P 01. 2. Input channel (User definition frame) which is selected in P2P channel. 3. In the P2P function, in case of transmission frame, select SEND and in case of reception frame, select RECEIVE.
  • Page 236 ▷ PLC 1 transmits frame named ‘C’ as soon as it receives frame named ‘B’. Note1) In example, PLC 1, PLC 2 is used to account for easily. The following program is written in one the system where two XGL-CH2A s are equipped and they communicate through RS-232C. ▶System configuration...
  • Page 237 Chapter 10 Program Examples ▶P2P flag number P2P 02 P2P 03 Flag name Device address Flag name Device address _P2P2_NDR00 L10090 _P2P3_NDR00 L13930 _P2P2_NDR01 L10150 _P2P3_NDR01 L13990 _P2P2_NDR02 L10210 _P2P3_NDR02 L14050 ▶Frame structure PLC 1 PLC 2 Frame name Operation Data Frame name Operation...
  • Page 238 Chapter 10 Program Examples Sequence Setting method 1. Input frame name and select frame type like above figure 2. Click send1[Transmission] and click right button of mouse 3. Click Add frame and input body name 1. Double-click BODY. Then segment setting window named send1.a shows. 2.
  • Page 239 Chapter 10 Program Examples ▶P2P Block setting Setting of PLC 1 Sequence Setting method 1. Double-click P2P block of P2P 02 2. Input channel which (user definition frame) was selected in the P2P channel. 3. In P2P function, in case of transmission frame, select SEND and in case of reception frame, select RECEIVE.
  • Page 240 Chapter 10 Program Examples ▶Program to reset P2P flag Since P2P flag keeps its value after on, for continuous communication, P2P flag should be reset every scan. To make program, reset device address of P2P flag used as conditional flag by using reset coil after lastly received flag is on. Program 1.
  • Page 241 ▶Operation of HMI (XP 50) By communication between XP 50 (HMI made by LSIS) and Cnet I/F module, monitoring lower device and operation can be executed. XP 50 is the highest device and it always acts as client (master). Cnet I/F module respond to XP 50 and it acts as server.
  • Page 242 Acts as Modbus RTU client and controls inverter (SV-iG5A) XGL-C42A(channel 1) Executes request from HMI 2 SV-iG5A Acts as Modbus RTU server and executes request from XGL-CH2A (channel 2) ▶ Setting in XP_Builder (XP 50 editor) Sequence Setting method 1. Select model type of XP 50 in XGT Panel Type 2.
  • Page 243 2) Set protocol as RS-422/485. 3) Click [Detail Settings] and set communication parameter like above screen. ▶ Setting in inverter For more detail about inverter, refer to user manual of SV-iG5A in our homepage (http://www.lsis.com) Sequence Setting method (1)Drv setting (Operation order method): 3 (RS 485)
  • Page 244 Chapter 10 Program Examples ▶ Setting in XGL-CH2A Sequence Setting method 1. In case of channel 1, setting method when acting as XGT server of 9.2.1 is same and set the communication parameter to be same with XP 50,1 setting value of 9.5.3 2.
  • Page 245 Chapter 10 Program Examples ▶ Setting in XGL-C22A Sequence Setting method 1. In case of channel 1, setting method when acting as XGT server of 10.2.1 is same and set the communication parameter to be same with XP 50,2 setting value of 10.5.3 10-39...
  • Page 246 Chapter 10 Program Examples ▶ XG 5000 program Sequence Program 10-40...
  • Page 247 Chapter 10 Program Examples Sequence Program 10-41...
  • Page 248 Chapter 10 Program Examples 10.6 SMS transmission method using the CDMA modem This example is a method to send CDMA modem road SMS using the UDATA function of the Cnet I/F module. This function works Cnet I/F module V3.2 or later (XGK CPU: V4.3, XGI CPU: V3.9, XGR CPU: V2.6, XG5000 V3.7) This example made the CDMA modem in an exercise to send a message to using BSM-856R, RCU-890.
  • Page 249 Chapter 10 Program Examples ▶ XGL-C22A setting Sequence Setting method 1. Set standard setting at the channel 1 to be same with setting described in the example of client above. Speed(115,200), Data bit(8), Stop bit(1), parity bit(NONE) 2. When acting as client mode, active mode should be Use P2P settings. 1.
  • Page 250 Chapter 10 Program Examples 10.6.1 SMS send message using CDMA modem The Cnet I/F module communicate with a CDMA modem using the UDATA communication instruction. The communication method speaks the AT instruction to offer with a CDMA modem. Please refer to the use manual of the CDMA modem for the AT instruction.
  • Page 251: Example Program

    Chapter 10 Program Examples ▶ SMS send message using XGI instruction Sequence Program example(BSM-856R SMS send) 1) Upper example program generate the AT instruction for the SMS send message of BSM-856R (‘4098,,,,’ is SMS send message instruction of BSM-856R.) 2) The example program is an order to send ‘Hello’. BSM-856R changes the character string to send to Hex.
  • Page 252 Chapter 10 Program Examples 1) Send AT instruction using SEND_UDATA through a CDMA modem connection port. 1) Receive ‘OK’ message in RCV_UDATA. If the AT instruction send a modem normally, the modem send ‘OK’ message. 2) Receive ‘$006’ message in RCV_UDATA again. If the modem send SMS message normally, the modem send ‘$006’...
  • Page 253 Chapter 10 Program Examples Sequence Program example(RCU-890 SMS send) 1) Upper example program generate the AT instruction for the SMS send message of RCU-890 2) The example program is an order to send ‘TESTMSG’. RCU-890 changes the character string to send to ASCII. The instruction can be added by send character string. 1) Send AT instruction using SEND_UDATA through a CDMA modem connection port.
  • Page 254 Chapter 10 Program Examples 1) Receive ‘*SKT*PRIMO:0’ and ‘OK’ message in RCV_UDATA. If the AT instruction send a modem normally, the modem send ‘*SKT*PRIMO:0’ and ‘OK’ message. 2) Receive ‘*SKT*MOACK:0,1’ message in RCV_UDATA again. If the modem send SMS message normally, the modem send ‘*SKT*MOACK:0,1’ message. When you receive ‘*SKT*MOACK:0,0’, you should check a communication network connection state of the modem.
  • Page 255 Chapter 10 Program Examples ▶ SMS send message using XGK instruction Sequence Program example(BSM-856R SMS send) 1) Upper example program generate the AT instruction for the SMS send message of BSM-856R It generate the AT instruction Using FMOV, $MOV, SCH. 2) Initialize a send buffer using FMOV.
  • Page 256 Chapter 10 Program Examples 1) Receive ‘OK’ message in RCV_UDATA. If the AT instruction send a modem normally, the modem send ‘OK’ message. 2) Receive ‘$006’ message in RCV_UDATA again. If the modem send SMS message normally, the modem send ‘$006’ message. When you cannot receive it, you should check a communication network connection state of the modem.
  • Page 257 Chapter 11 Diagnosis Chapter 11 Diagnosis With XG5000 used, the status of the system and the network can be checked and diagnosed. Diagnosis function is composed as described below. ▶ CPU status ▶ Communication module information ▶ Frame monitoring ▶ Loop Back test ▶...
  • Page 258 Chapter 11 Diagnosis ▶ Communication module information Check list Detail result Communication module information 1. Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( 2. Click the right button on the the relevant module and click Detailed Module Information. ▶...
  • Page 259 Chapter 11 Diagnosis ▶ Frame monitor The user can check the TRX frame of Cnet module by using the frame monitor. Check list Detail result Frame monitor 1. Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( 2. Click the right button on the the Cnet module and click Frame Monitor to check. ▶...
  • Page 260 Chapter 11 Diagnosis ▶ Loop back test Check list Detail result How to wire the module < Less than V2.0 > < V2.0 or later > 1. Set actiive mode of test module as server. 2. The RS-422/485 sets a parameter in RS-422. 3.
  • Page 261 Chapter 11 Diagnosis ▶ Status by service Check list Detail result Dedicated service 1. Select [Online]-[Communication module setting]-[System Diagnosis] or click the icon ( 2. Click the right button on the the Cnet I/F module and click Status By Service. 3.
  • Page 262 Chapter 11 Diagnosis ▶ Meaning of status by service Classification Item Contents Base Number Information of base number under diagnosis Standard Slot Number Information of slot number under diagnosis information Link type Type of communication module under diagnosis Dedicated service Drive type of each Channel information Dedicated...
  • Page 263 Chapter 11 Diagnosis 11.2 Error code by protocol Error code by protocol ▶XGT client/server Error code Error type Error content and reason Ex. of error frame No. of block is larger than 16 when requesting reading/writing 0003 No. of block excess error 01rSS1105%MW10…...
  • Page 264 Chapter 11 Diagnosis 11.3 Trouble Shooting by Error 11.3.1 Trouble shooing when P2P parameter setting error occurs in case of XG5000 connection Phenomenon Reason Trouble shooting P2P setting error warning in case of XG5000 1. Turn off and check if module is Cnet I/F module applying connection removed or not...
  • Page 265 Chapter 11 Diagnosis 11.3.4 Two response frame are dealt with as unknown when executing frame monitor Phenomenon Reason Trouble shooting Two response frame are dealt with as unknown when executing frame Communication Change monitor type in XG5000 is communication set as RS-422 but type in XG5000 or output wiring wiring method...
  • Page 266 Chapter 11 Diagnosis 11.3.8 Communication is not normal or communication is not executed repeatedly Phenomenon Reason Trouble shooting 1. Execute 1:1 communication with server In case of multi drop, More and check if it works properly. than one server sends frame 2.
  • Page 267 Appendix Appendix A. 1 Definition of Terms (1) Communication type (a) Simplex This is the communication type that data is transferred in a constant direction. Information can not be transferred in the reverse direction. (b) Half-Duplex Data is transferred in two ways with one cable if time interval provided, though it can’t be transferred simultaneously. (c) Full-Duplex Data is simultaneously transferred and received in two ways with two cables.
  • Page 268 Appendix (b) Parallel transmission This type is used in printer, etc., which transmits data in unit of 1 byte, so the speed is high and the accuracy of data is reliable. However, the longer the transmission distance is, the higher the cost of installation is geometrically. 송신...
  • Page 269 Appendix (4) Protocol This is communication rule established in relation between the transmission side and the receiving side of information in order to send and accept information between two computers/terminals or more without error, effectively, and reliably. In general, this specifies call establishment, connection, structure of message exchange form, re-transmission of error message, procedure of line inversion, and character synchronization between terminals, etc.
  • Page 270 Appendix (11) Half Duplex Communication Two-way communication is available, however simultaneous communication of transmission & receiving isn’t available. This communication type is applied to RS-485 for instance. It is used a lot for multi-drop communication type which communicates via one signal line by several stations. Half Duplex Communication results from the transmission characteristic performed by stations one by one not allowing simultaneous transmission by multi stations due to the data damage of data impact caused by the simultaneous multi-transmission of the stations.
  • Page 271 Appendix (13) BCC(Block Check Character) As serial transmission may have signals distorted due to undesirable noise in transmission line, BCC is used as data to help receiving side to check the signals if normal or distorted and to detect errors in signals as compared with the received BCC after calculating BCC by receiving side itself using the data input to the front terminal of BCC.
  • Page 272 Appendix - Head: ASCII value indicating frame start. - Tail: ASCII value indicating frame end. - BCC (Block Check Character)  Check data for Tx/Rx frame  Used to inspect reliability of data with such various methods as ADD, OR, Exclusive OR, MULTPLY, etc. (16) Reset This function is used to initialize the communication module with errors.
  • Page 273 Appendix A. 2 Flag List A.2.1 Special Relays List (F) Device 1 Device 2 Type Variable Function Description Mode & Status PLC mode & run status displayed. DWORD _SYS_STATE RUN status. F00000 _RUN STOP STOP status. F00001 _STOP ERROR ERROR status. F00002 _ERROR DEBUG...
  • Page 274 Appendix Device 1 Device 2 Type Variable Function Description System error Serious error in system reported. DWORD _CNF_ER CPU error CPU configuration error found. F00020 _CPU_ER Module type error Module type not identical. F00021 _IO_TYER Module installation Module displaced. F00022 _IO_DEER error Fuse error...
  • Page 275 Appendix Device 1 Device 2 Type Variable Function Description HS link 8 HS link – parameter 8 error F0004F _HS_WAR8 HS link 9 HS link – parameter 9 error F00050 _HS_WAR9 HS link 10 HS link – parameter 10 error F00051 _HS_WAR10 HS link 11...
  • Page 276 Appendix Device 1 Device 2 Type Variable Function Description _LOGIC_RESULT Logic result Logic result displayed. WORD Calculation error ON for 1 scan if calculation in error. F00110 _LER Zero flag ON if calculation result is 0. F00111 _ZERO F0011 Carry flag ON if Carry found during calculation.
  • Page 277 Appendix Device 1 Device 2 Type Variable Function Description Max. scan time Max. scan time displayed F0050 WORD _SCAN_MAX Min. scan time Min. scan time displayed F0051 WORD _SCAN_MIN Present scan time Present scan time displayed. F0052 WORD _SCAN_CUR Month / Year PLC’s time information (Month/Year) F0053 WORD _MON_YEAR...
  • Page 278 Appendix Device 1 Device 2 Type Variable Function Description F0090 WORD _IO_TYER_N Discordant slot Slot number with discordant module type displayed. F0091 WORD _IO_DEER_N Displaced slot Slot number with displaced module displayed. F0092 WORD _FUSE_ER_N Fuse blown slot Slot number with fuse blown displayed. F0093 WORD _IO_RWER_N RW error slot...
  • Page 279 Appendix Device 1 Device 2 Type Variable Function Description F0128 WORD _IO_IFER_0 Module IF 0 error Main base module interface error F0129 WORD _IO_IFER_1 Module IF 1 error Added base step 1 module interface error F0130 WORD _IO_IFER_2 Module IF 2 error Added base step 2 module interface error F0131 WORD _IO_IFER_3...
  • Page 280 Appendix Device 1 Device 2 Type Variable Function Description External slight error Slight error information in external F1027 WORD _ANC_WAR information equipment displayed. Month / Year Time information data (Month/Year) F1034 WORD _MON_YEAR_DT Hour / Date Time information data (Hour/Date) F1035 WORD _TIME_DAY_DT Second / Minute...
  • Page 281 Appendix A.2.2 Communication Relays List (L Special register for data link HS link No. 1 ~ 12 Keyword Type Detail Description Displays all stations normally operated as specified in HS link parameter, which will be On HS link parameter No.1’s 1.There is no RUN mode error in all stations specified in parameter L000000 _HS1_RLINK...
  • Page 282 Appendix P2P parameters : 1~8, P2P block : 0~63 Keyword Type Detail Description P2P parameter No.1, block No.00 P2P parameter No.1, block No.0 service L006250 _P2P1_NDR00 service complete normally complete normally P2P parameter No.1, block No.00 P2P parameter No.1, block No.0 service L006251 _P2P1_ERR00 service complete abnormally...
  • Page 283 Appendix A.2.3 Link Devices List (N) - These devices are used to save the size and the details of P2P number and block number. - P2P No. : 1 ~ 8, P2P block: 0 ~ 63 Keyword Type Detail Description P2P parameter No.1, block P2P parameter No.1, block No.00’s correspondent station No.
  • Page 284 Appendix Keyword Type Detail Description P2P parameter No.1, block N00051 _P1B01RS2 Word P2P parameter No.1, block No.01 area size 2 to read saved No.01 area size 2 to read N00052 ~ Device P2P parameter No.1, block _P1B01RD3 P2P parameter No.1, block No.01 area device 3 to read saved N00055 structure No.01 area device 3 to read...
  • Page 285 Appendix A.3 RS-232C interface through VisualBasic A.3.1 System configuration VB Program RS-232C Interface RS-232C port A.3.2 Pin No Cnet(9-PIN) Computer Signal direction Pin No. Name Name A-19...
  • Page 286 Appendix A.3.3 Mode setting [Table A.5] XGT Dedicated communication mode setting Operation mode Module name Mode switch Remark RS-232C Dedicated communication Interlocking mode Dedicated communication Stand-alone mode G3L-CUEA User defined communication G4L-CUEA Dedicated communication GMWIN User defined communication G6L-CUEB Dedicated communication A.3.4 Instruction [Table A.6] Instruction index Instruction...
  • Page 287 Appendix A.3.5 Project Project name Form name Module name A.3.6 Form design Communication Control Combo box Text box Command button If click each box with a mouse, can edit each box (1) Command button comndOpen, comndSend, comndClose (2) Text box txtTx, txtRx (3) Combo box cmbPort, cmbBps, cmbParity, cmbDataBit, cmbStopBit...
  • Page 288 Appendix A.3.7 make form procedure code (1) Form procedure Setting basic parameter of Communication module.  Port:COM1~COM4  Speed: 300,600,1200,2400,4800,9600,19200,38400bps  Parity bit: None/Odd/Even  Data bit: 7/8bit  Stop bit: 1/2bit (2) Open form ♦ Form procedure A-22...
  • Page 289 Appendix ♦ Sub procedure (module) When port open event occurs, perform the next module. A-23...
  • Page 290 Appendix (3) Send data ♦ Form procedure Set the procedure by the send event. It is a process to receive an answer from communication module and to check time-out. A-24...
  • Page 291 Appendix The lower code shows BCC check setting. A-25...
  • Page 292 Appendix ♦ Sub procedure(module) ♦ Function procedure (Calculate BCC) Define the function procedure to calculate BCC and display result. A-26...
  • Page 293 Appendix ♦ Function procedure (Data change) It is the string conversion code of the data result (4) Close port (a) Form procedure Close port and Stop communication A-27...
  • Page 294 Appendix A.3.8 Execute program (1) Direct variable single read(RSS)  parameter setting Basic communication parameter setting  Open port  Setting frame Frame setting from Communication module A-28...
  • Page 295 Appendix  Data Send/receive Receive ACK (Complete Data read :16#546D) (2) Example Direct variable single write(wSS) Write Word data(16#FD4C) BCC check Receive ACK (3) Example Named variable write result(Word type) Write variable of server (ACC_DATA) A-29...
  • Page 296 Appendix (4) Example Register monitor(X##) Address of server (5) Example execution monitor(Y##) Monitor result A-30...
  • Page 297 Appendix A.4 Dimension Unit: mm • XGL-C22A/CH2A/C42A <H/W version : Less than V2.0 > < H/W version: V2.0 or Later > A-31...
  • Page 298 3. Since the above warranty is limited to PLC unit only, make sure to use the product considering the safety for system configuration or applications. Environmental Policy LSIS Co., Ltd supports and observes the environmental policy as below. Environmental Management About Disposal LSIS considers the environmental preservation LSIS’...
  • Page 299 109 First Floor, Park Central, Sector-30, Gurgaon- 122 002, Haryana, India Tel : +0091-124-493-0070 Fax : 91-1244-930-066 E-Mail : hwyim@lsis.com ※ LSIS constantly endeavors to improve its product so that 2011. 5 information in this manual is subject to change without notice.

This manual is also suitable for:

Xgl-c22aXgl-c24a

Table of Contents