Skip to main content
Version: 8.3 Beta 🚧

Connecting to Modbus Device

Inductive University

Connecting to Modbus Device

Watch the video

Connect to a Modbus Device​

This driver requires the OPC UA module to be installed and enabled. If the module is missing or disabled, the device will fault with a β€œMissing Dependency” error on the Platform System > Modules page.

  1. On the Gateway, go to Connections > Devices > Connections.

  2. Click Create Device Connection +.

  3. Choose a Modbus driver from the list and click Next:

    • Modbus TCP for devices that support native Modbus TCP/IP.

    • Modbus RTU over TCP for devices that encapsulate RTU messages inside TCP packets.

    • Modbus RTU for serial RTU communication.

  4. On the Configure Device screen, enter the required fields:

    • Name: Modbus

    • Hostname (TCP and RTU over TCP): IP address of the device (e.g., 10.20.8.117)

    • Serial Port (RTU): Serial port path (e.g., COM1)

  5. Click Create Device Connection.

The device will be listed now on the Connections page. The status will initially show Disconnected, but will move to a Connected state.

note

Modbus devices do not support tag browsing. To access tags, you must manually define addresses in the Tag Browser or configure mappings using the Modbus Addressing and Modbus Address Mapping pages.

Modbus Protocol Support​

The Modbus driver can connect to any device that supports the Modbus protocol via Ethernet or serial. Only one Modbus device should be added per IP address in the Ignition Device List. For Modbus Gateways that route to multiple devices, use separate unit IDs per device, either in the tag path or via the address mapping page.

Supported Function Codes​

Function NameCodeHex
Read Coils010x01
Read Discrete Inputs020x02
Read Holding Registers030x03
Read Input Registers040x04
Write Single Coil050x05
Write Single Register060x06
Write Multiple Coils150x0F
Write Multiple Registers160x10
Mask Write Register220x16

Device Connection Settings​

General​

NameDescription
NameA user-defined name for the device. This name appears in OPC item paths and the Devices list. Name must begin with an underscore or a letter, and cannot include special characters.
DescriptionOptional description to help identify the device.
EnabledWhen selected, the device is active and available for use.

Connectivity – Modbus TCP / RTU over TCP​

NameDescription
HostnameSpecifies the IP address of the Modbus device or TCP Gateway.
PortDefines the TCP port used by the device. The default is 502.
Local AddressSpecifies the IP address of the local adapter to bind from. Leave this blank to allow automatic selection.
Communication TimeoutSets the time, in milliseconds, to wait for a response before the request is considered failed.

Connectivity – Modbus RTU​

NameDescription
Serial PortSpecifies the name of the serial port (for example, COM1).
Bit RateSets the bit rate used for the serial connection.
Data BitsDefines the number of data bits in the message frame.
ParitySets the parity configuration for serial communication.
Stop BitsDefines the number of stop bits used in the frame.
HandshakeSpecifies the flow control method for the serial connection.
Communication TimeoutSets the time, in milliseconds, to wait for a response before the request is considered failed.
RS-485 ModeEnables RS-485 mode instead of the default RS-232.

Request Optimization​

NameDescription
Max Holding Registers per RequestSpecifies the maximum number of holding registers to read in a single request. The default is 125.
Max Input Registers per RequestSpecifies the maximum number of input registers to read per request. The default is 125.
Max Coils per RequestSets the maximum number of coils to read in a single request. The default is 2000.
Max Discrete Inputs per RequestSets the maximum number of discrete inputs to read per request. The default is 2000.
Concurrent RequestsDefines the number of simultaneous requests the driver can issue. Not available for Modbus RTU.
Span GapsSpecifies whether to span gaps in the address space to reduce the total number of requests.

Write Request​

NameDescription
Allow Write Multiple Registers RequestEnables the use of function code 0x10 for writing multiple registers. Disable this option only if the device does not support it.
Force Multiple Register WritesForces the driver to use function code 0x10 for all multi-word register writes.
Allow Write Multiple Coils RequestEnables the use of function code 0x0F for writing multiple coils. Disable this option only if the device does not support it.

Read Request​

NameDescription
Allow Read Multiple Registers RequestEnables reading registers in blocks instead of individually. Disable this option to read each register separately.
Allow Read Multiple CoilsEnables reading coils in blocks instead of individually. Disable this option to read each coil separately.
Allow Read Multiple Discrete InputsEnables reading discrete inputs in blocks instead of individually. Disable this option to read each input separately.

Advanced​

NameDescription
Reconnect After Consecutive TimeoutsForces the driver to reconnect after three consecutive timeouts. The default setting is true.
Reverse Word OrderSwaps the low and high words in 32-bit values. Enable this option if the data appears reversed.
Zero-based AddressingEnables zero-based addressing. This is required by some Modbus implementations.
Max Retry CountSets the number of times the driver will retry a request after receiving a device error. The default is 1.

String Handling​

NameDescription
Reverse String Byte OrderReverses the byte order when reading string values.
Right Justify StringsPads string values to the right instead of the default left padding.
Read Raw StringsReads the full configured string length, including any null characters.