14.2.1 Settings

Select [Tools] – [Data Server] – [MODBUS Slave] or select [Modbus Slave] in the project tree to bring up the Modbus Slave configuration window as shown below.

Item

Description

Adds a tag to the selected area. You cannot add tags when the ‘Communication Channel’ folder is selected. If you select an existing communication channel and press this button, you can only add string tags.

Edits the selected tag.

Deletes the selected tag.

Adds a communication channel for Modbus Slave. This button is enabled only when you select the ‘Communication Channel’ folder. You can register up to 3 channels.

Edits the selected communication channel.

Deletes the selected communication channel

Communication channels are registered here. The added channels will be displayed beneath the 'Communication Channel' folder icon.

Shows the tags in the Coils area and allows new tags to be registered.

Shows the tags in the Holding Register and allows new tags to be registered.

(1) Communication Channel

To create a new communication channel, select [Communication Channel] in the tree structure and press the  button. A configuration window will appear as shown below.

Item

Description

Slave Type

Selects the Modbus Slave type. You can select Modbus RTU or Modbus TCP. When you select Modbus TCP, only Unit No. and Socket No. can be configured.

Unit No.

Assigns the Slave’s unit number.

Socket No. (TCP only)

Assigns the Slave’s socket port number. The default socket is 502. It is recommended that you only change the socket number when a communication failure occurs.

PORT

Assigns the local (Xpanel) COM port to use Modbus RTU Slave.

Baud Rate

Configures the baud rate (300bps ~ 256,000bps).

MODE

Selects one of the following communication modes: RS232, RS422, RS485.

Parity

Determines whether to use an even, odd, or no parity bit for error checking.

Data Bits

Determines the number of data bits per packet. You can select between 5 and 8 bits. If the data contains Korean characters, please select 8 bits to avoid errors.

Stop Bit(s)

Determines the number of stop bits between frames.

RTS/CTS

Determines whether to use RTS/CTS (Request To Sent/Clear To Send) or not.

Note: when configuring Modbus RTU, all options except for ‘Unit No.' and 'PORT’ should match the settings used for the Modbus Master device.

(2) Coils Area

To create a new tag in the coils area, select [Coils Area] and press the  button. A configuration window will appear as shown below.

Item

Description

Modbus Address

Assign a Modbus address for the device address or tag.

In the coils area, valid Modbus addresses range from 00001 to 09999. The first digit “0” indicates the Modbus function code, which in this case is used to read/write bit data.

E.g.) 00001, 00002 … 05000 … 09998, 09999

Address

Assigns a device address for the current Modbus Slave address. You may only register bit data. Press the  button to configure the detailed device address.

TagName

Assigns a virtual tag for the current Modbus Slave address. You may only use digital tags in the coils area. Press the  button to browse for the tag, or manually enter the tag name in the field.

(3) Holding Register Area

To add a tag to the holding register area, select [Holding Register Area] and press the  button. A configuration window will appear as shown below.

Item

Description

Modbus Address

Assign a Modbus address for the device address or tag.

In the holding register area, valid Modbus addresses range from 40001 to 49999. The first digit “4” indicates the Modbus function code, which in this case is used to read/write word (16-bit) data.

E.g.) 40001, 40002 … 45000 … 49998, 49999

Address

Assigns a device address for the current Modbus Slave address. You may only register word or string data. Press the  button to configure the detailed device address.

TagName

Assigns a virtual tag for the current MODBUS Slave address. You may only use analog and string tags in the holding register area. Press the  button to browse for the tag, or manually enter the tag name in the field.

If a tag or device address which is assigned to the Holding Register has a data type with multiple words (e.g. UINT32, INT32, Float, etc.) or string data, the corresponding word addresses will be allocated automatically.

Example: UINT32 data is assigned to Holding Register address 1. Then, Holding Register addresses 1 and 2 will be assigned for the UINT32 data.

When you assign a device address to a MODBUS Slave address, a real tag will be created in the database with the corresponding information. The device name and the station name will be the group tags, and the child tag will be registered within the nested group tags. In the example shown below, the full tag names are “IO_DEVICE.ST_STATION.Y00_B“ and “IO_DEVICE.ST_STATION.D00_W“.