Using the Workbench to define a Modbus Server device
The Workbench provides the view into a node's installation, configuration and resource definition. The Workbench also provides access and control over those resources.
A device is a resource that can represent a physical device, such as a programmable logic controller (PLC), an RF tag reader or a sensor. A device can also be defined in one node to represent a device that is defined and supported in another node. This allows your application solution to have access to devices and their data independent of their location or connectivity details.
The following devices can be defined in with the Modbus Server:
- Devices that appear as a Modbus enabled appliance and is accessible through TCP/IP
- Devices that appear as a Modbus enabled appliance that can be connected to serially over a RS-232 connection.
The Modbus Server provides to a vendor's Modbus Client application Read only or Read/Write support to a combination of the following Modbus tables:
- Coils
- Discrete Inputs
- Input Registers
- Holding Registers.
To define a Modbus Server device, follow these steps:
- From the Workbench left pane, expand the node where you want to define the Modbus Server device.
- Select the Devices icon to display the Devices panel, right-click the Devices icon to display its pop-up menu, and then select New.
You also can select the New button at the bottom of the Devices panel.
The Device window appears. - Name the device. The device name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
- Use the Type down-arrow to locate the Modbus category and then the Modbus Server type. There may be additional available device types shown in this list box. The device types shown are determined by the driver packages that are installed on the node.
Using the Modbus Server device type, you will specify, among other things, the size for each of the four Modbus data block regions, Coils, Discrete Inputs, Input Registers, and Holding Registers. - The Device window changes to accommodate the selection of the Modbus Server device type.
The Modbus Server type lets you define a device that will represent a Modbus enabled device. In addition, the Modbus Server is accessible through either an Ethernet TCP/IP connection or a serial RS-232 connection. -
To define a Modbus Server device that will be connected to via an Ethernet TCP/IP connection, set Connection Type parameter to Ethernet.
Parameters for Connection Type = Ethernet
The following parameter shows in the Device window when Type is set to Modbus Server and Connection Type is set to Ethernet.Parameter
Description
Connection Type Select Ethernet when the Modbus Client applications will connect to the device using TCP/IP over Ethernet. Access List The access list defines what IP addresses are allowed to connect to this Modbus Server device. This parameter can be used to limit access to the Modbus Server device to a select IP address or as broadly as an entire subnet of addresses. Port This is the port number that the Modbus Server device will use to listen for connections. The default value is 502. It is strongly recommended that the default port value is used, as all Modbus Client applications will be expecting to use this port when communicating to Modbus enabled devices. Maximum Connections This is the maximum number of concurrent Modbus Client connections that will be allowed to connect to the Modbus Server device. Timeout The timeout value in milliseconds to use when communicating with the Modbus Server device. Coils The number of Bits needed to represent the Coils defined in the Modbus Server device. Discrete Inputs The number of Bits needed to represent the Discrete Inputs defined in the Modbus Server device. Input Registers The number of Words (two bytes) needed to represent the Input Registers defined in the Modbus Server device. Holding Registers The number of Words(two bytes) needed to represent the Holding Registers defined in the Modbus Server device. Start Address Select if you would like the variable array offset for each of the data tables to begin with a 1 or zero. This setting affects the visual display of a variable and its reference from within a trigger. Physical device level references are zero based. Per Variable Security Select False to disable the allocation of additional memory to track user to variable access for all variables in this Modbus Server device. Select True to enable this feature if required. For more information, see Setting up Read Write per device variable. -
To define a device that represents a Modbus Server that will be connected to via a Serial RS-232 connection, set the Connection Type parameter to RS-232.
Parameters for Connection Type = RS-232
The following shows the Device window when Type is set to Modbus Server and Connection Type is set to RS-232.Parameter
Description
Connection Type Select RS-232 when the Modbus Client applications will connect to the device using a serial connection. Serial Port The port through which the serial connection to the Modbus Server device will be made. This list will be generated to match the serial ports available on the node. For example, the list will contain the COM ports for Microsoft Windows operating systems, //dev/tty ports for Linux operating systems, and so forth. Baud Rate The baud rate defined for the port. The default value is 19200. Parity The parity setting. The default value is None. Data Bits The data bit value. The default value is 8. Stop Bits The number of stop bits. The default value is 1. Force DTR/RTS High A setting to send power to the DTR and RTS signals of the serial connection. The default value is False. Coils The number of Bits needed to represent the Coils defined in the Modbus Server device. Discrete Inputs The number of Bits needed to represent the Discrete Inputs defined in the Modbus Server device. Input Registers The number of Words(two bytes) needed to represent the Input Registers defined in the Modbus Server device. Holding Registers The number of Words(two bytes) needed to represent the Holding Registers defined in the Modbus Server device. Start Address Select if you would like the variable array offset for each of the data tables to begin with a 1 or zero. This setting affects the visual display of a variable and its reference from within a trigger. Physical device level references are zero based. Per Variable Security Select False to disable the allocation of additional memory to track user to variable access for all variables in this Modbus Server device. Select True to enable this feature if required. For more information, see Setting up Read Write per device variable.