Creating Modbus I/O Servers (DSC Module or Real-Time Module)

LabVIEW 2017 Real-Time Module Help

Edition Date: March 2017

Part Number: 370622R-01

»View Product Info
Download Help (Windows Only)

(DSC Module) You can create a Modbus or Modbus Slave I/O server interactively or programmatically.

(Real-Time Module) You can create a Modbus or Modbus Slave I/O server interactively.

Note Note  The Modbus I/O server uses serial ports to communicate with the device. The Shared Variable Engine (SVE) registers the available serial ports only while the SVE is initializing. Ensure that no process or application occupies any serial ports when the SVE is initializing. Otherwise, the SVE does not register the occupied serial ports. If you install new serial ports using the ENET232, USB, or Virtual Ports when the SVE is running, restart the computer or the SVE to register the new serial ports.

After you create a Modbus I/O server, you can create shared variables and bind the shared variables to Modbus I/O server data items. Use the Create Bound Variables dialog box to generate multiple shared variables and bind them to Modbus I/O server data items simultaneously.

Note Note  If you create multiple Modbus Slave I/O servers in Ethernet model on a single computer, only the first one works properly. The other Modbus Slave I/O servers return errors in the CommFail and ErrorStatus data items.

Creating Modbus I/O Servers Interactively

Complete the following steps to create a Modbus or Modbus Slave I/O server interactively.

  1. In the Project Explorer window, right-click a target, such as the My Computer target, and select New»I/O Server from the shortcut menu.
  2. In the Create New I/O Server dialog box, select Modbus or Modbus Slave and click the Continue button.
  3. In the Configure Modbus I/O Server or Configure Modbus Slave I/O Server dialog box, select the communication protocol, or Model, and configure the Communication Settings you want to use.
  4. (Optional) Click the Advanced button of the Configure Modbus I/O Server dialog box to configure the Maximum Data Points Per Command.
  5. Click the OK button.

Creating Modbus I/O Servers Programmatically

Complete the following steps to create a Modbus or Modbus Slave I/O server programmatically.

  1. Place the Create and Configure IO Server Express VI on the block diagram.
  2. In the configuration dialog box that appears, select Modbus or Modbus Slave from the I/O server type pull-down list.
  3. Click the Set Attributes button to display the Configure Modbus I/O Server or Configure Modbus Slave I/O Server dialog box.
    Note  If you click the OK button before you set the attributes for this I/O server instance, LabVIEW automatically displays the Configure Modbus I/O Server or Configure Modbus Slave I/O Server dialog box.
  4. In the Configure Modbus I/O Server or Configure Modbus Slave I/O Server dialog box, configure the settings for the new I/O server.
  5. (Optional) Click the Advanced button of the Configure Modbus I/O Server dialog box to configure the Maximum Data Points Per Command.
  6. Click the OK button.

 Understanding Modbus Communication in LabVIEW

WAS THIS ARTICLE HELPFUL?

Not Helpful