Connecting Multiple Modbus Slaves to a Single Modbus Master I/O Server

Updated Apr 3, 2026

Reported In

Software

  • LabVIEW Real-Time Module
  • LabVIEW Datalogging and Supervisory Control Module

Issue Details

Is it possible to connect a single Modbus Master I/O Server to multiple Modbus Slave devices?

Solution

When configuring a Modbus I/O Server in LabVIEW, each Master server is configured to communicate with a single COM port for Modbus Serial or a single slave IP address for Modbus Ethernet.

  • For Modbus Serial, up to 247 slave devices can be connected on a single serial network. It is important that each slave device have a unique Unit ID.
  • For Modbus Ethernet, a Modbus Master I/O Server can only connect to a single slave device. To communicate with multiple Modbus Ethernet slave devices, you must define a separate Master I/O Server for each device.

 

When configuring a Serial Modbus Master to communicate with multiple Modbus Slaves, you can control the target of any read/write operations completed by the Serial Modbus Master. This is done by changing the UnitID Property of the Master. You can change it via the Set Unit ID VI or a Property Node by selecting the UnitID Property.

Additional Information

In the LabVIEW Datalogging and Supervisory Control Module Programming Reference Manual, examples are available on how to configure communication between a Serial Modbus Master and multiple Modbus Slaves.

 

Serial Modbus Master set Unit ID VI to control target Slave

 

To configure Serial communication with multiple Slaves, you can use one of the following options:

  • Create multiple Serial Modbus Master instances. This is done by forking the wire to create multiple branches and configuring the UnitID and/or other properties for each branch separately.
    • This method is depicted in the example image above.
    • Make sure that all Master instances are properly managed and closed at the end of execution.
  • Create a single Serial Modbus Master instance.
    • You can configure the instance's UnitID and/or other properties, complete read/write operations for a given slave (e.g. Slave with UnitID = 1), then change the Unit ID to complete read/write operations that target a different slave (e.g. Slave with UnitID = 2).
    • This method allows you to dynamically assign any required properties.