This document describes the MODBUS communication driver for Xpanel. This driver supports the RTU (serial) version of the MODBUS protocol.
Communication Setup: Xpanel
Create a new Devicedevice
| To create a new device, select ‘Tools’ → ’I[Tools] → [I/O Devices’ Devices] or click the I/O Device Name: Give a device name. This name will be used in the tag database, accompanied by the ‘Station Name’. |
Select a device type
| After selecting the ‘OK’ [Ok] button in the previous step, the ‘Serial Communication Configuration’ dialog box will appear as shown in the following picture: In this window, set the ‘Device Type’ to ‘MODBUS RTU Protocol’ and configure the remaining serial communication parameters. Ensure that these parameters are matched with the device’s configuration. See the Communication Configuration section for more information. |
Create a station | Move to the ‘Station’ [Station] tab of the ‘Serial Communication Configuration’ dialog box. In this dialog box, connected PLC stations can be configured and registered to the Xpanel. Each field can be configured with the following rules: Station Name: Give a name to the PLC. This name will be used in the tag database, accompanied by the ‘Device Name’. Station Type: Choose the type of connected PLC (Modbus RTU, Multi Write CMD, Max Block Read). Network ID: N/A Station No:Specify a decimal number between 1 and 247. This must match the station number of the PLC. 16-Bit Data Swap: This option swaps the upper and lower bytes of all word- or double-word-sized data. The following diagram shows an example of byte swapping: Almost all data types will be influenced by this option except for INT8 / UINT8 / BCD8 / UBCD8. 32-Bit Data Swap: This option swaps the upper and lower words of all double-word-sized data. The following diagram shows an example of word swapping: Tags with data type INT32 / UINT32 / BCD32 / UBCD32 / FLOAT will be influenced by this option. Using Checksum: This field has no effect. This MODBUS driver always uses a checksum. Comm. Error Message Pop Up: When this item is checked, Xpanel displays a communication error message box for every Rx and Tx error. Otherwise (unchecked), Xpanel does not display a message for communication errors. This message box will close automatically after a few seconds.See the Communication Configuration section for more information about the remaining parameters. |
Address Notation
The following table shows the list of valid address ranges and MODBUS function codes for each address area.
Area | Symbol | Analog TAGTag | Digital TAGTag | Read | Write |
Coil | 0 |
| 000001 - 029999 (1 ) | 1 | 5 |
Input | 1 |
| 100001 - 129999 | 2 |
|
Holding Register | 4 | 400001 - 429999 |
| 3 | 6, 16 (2 ) |
Input Register | 3 | 300001 - 329999 |
| 4 |
|
Notes:
The symbol character (0, 1, 3, or 4) must be placed in the first position of the address string. The address number follows the symbol character.
The symbol character does not behave as a number. For example, 400100 and
...
40100 designate the same memory area (holding register 100).
The memory areas listed above are provided for general purposes. The actual available memory area and range of each area should be checked using the manual for the connected device. The ‘Read’/’Write’ columns show the MODBUS function codes used in this communication driver.
Code 16 is issued for writing double words or when the recipe write function is activated. When writing single words, code 6 is used.
Communication Cable Wiring
ATVXEL XPANEL COM/CPM2 RS232CRS-232C | |
ATVXEL XPANEL COM1 RS422RS-422/485 |
The above picture shows the RS-232C and RS-422/485 ports of the Xpanel. Refer to the manual of your device for signal descriptions.
...