Drivers

Modbus
Modbus

Creating a Connection

From the main dashboard, click the plus button in the Drivers section. From the driver drop down menu, select the Modbus driver. For most applications, the default configurations are acceptable, but can be changed as needed.

The main fields which must be filled out are the "Name" and the "IP" fields. The Name is a unique name/id which identifies this specific Modbus TCP client connection. The Host field is the IP address of the desired Mobus TCP server.

Once the configuration is set as desired, click the "Submit" button at the bottom of the prompt to begin the service.

Monitoring Status

Once a client connection has been established, a dashboard item for this client will be added to the dashboard. To view the status of this client, click on the dashboard item. You will then be taken to the status page of the selected Modbus connection. If the connection is properly established, the highlights of the client status will be shown in green. If the connection has failed, these highlights will be shown in red. If the client is attempting to reconnect, the status may briefly turn yellow.

The Modbus driver also exposes "Client Controls" to stop and restart the client for troubleshooting purposes. For stop commands, the Modbus driver must wait for open connections to finish before fully stopping the driver. This may take up to the polling rate time configured for the client instance.

Collecting Data

After initiating a Modbus connection, Modbus data points can be collected by clicking the "+ Add" button at the top of the Data window.

The configuration options required are described below.

New Data Point

Name

Unique name for the Modbus data point as it will be referenced on the PLCnext Edge Gateway

Type

Type represents the Modbus Register type and therefore the underlying function code which is used to collect the data point. These types include COIL, DISCRETE, HOLDING, and INPUT registers.

Offset

The offset is the register offset from the beginning of the associated Modbus register map.

Data type

The data type field configures how the registers collected are parsed into their display value. Read the Data Types section for more information on supported types.

Writable

The Writable field enables the PLCnext Edge Gateway to write HOLDING or COIL registers back to the associated Modbus server. This option is disabled by default.

Data Types

The Modbus driver supports many data types to enable complex data collection and processing techniques. The list below contains a description of each data type and how the data type would typically be used.

INT(X)

INTX types read register values by treating each register as a signed integer. This type would typically be used for HOLDING or INPUT registers with data that is formatted as supporting negative numbers.

UINT(X)

UINTX types read register values as if they hold only unsigned data. This type would typically be used for HOLDING or INPUT registers with data that is formatted as unsigned.

FLOAT(X)

FLOATX types read register values which are formatted as IEEE floats. This type supports 32 bit (2 register) or 64 bit (4 register) register blocks. This type would typically be used for reading HOLDING or INPUT registers which have been formatted as IEEE floats.

BCD(X)

BCDX types read register values which are formatted in binary-coded decimal.

(XSWAP)

Swapped types support the case where the modbus register data bytes are in an unusual order. This type should be used in the unique case when the Modbus data is represented in reverse order or "Big Endian", or when register order is flipped.