This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Modbus Communication Using LabVIEW or LabVIEW Real-Time Module

Updated Feb 19, 2019

Reported In


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

Issue Details

  • I need to communicate to my device using the Modbus protocol. Is this possible with LabVIEW? If so, how can I do it?
  • Do I have the free API/toolkit of Modbus, or the one that comes with the DSC Module?


Modbus I/O Servers 

The Modbus I/O Server allows you to easily link Modbus register values to Shared Variables, which you can access in your VI. For simpler monitoring applications, Modbus I/O servers provide a simpler and easier API for accessing or serving up Modbus data. In exchange for ease of use, I/O servers give up the tight control over the protocol that can be required for some applications.

Included in LabVIEW Datalogging and Supervisory Control (DSC) Module and LabVIEW Real-Time (RT) Module 

Supported Modbus API (Boxed in Blue)

The low-level Modbus API provides fine control over the Modbus protocol, with high performance, at the expense of ease of use. Everything must be done manually when using this low-level API.

Included in LabVIEW Datalogging and Supervisory Control (DSC) Module and LabVIEW Real-Time (RT) Module

NI OPC Servers and DataSockets

If you are using LabVIEW on Windows, you can also use DataSocket to communicate with an OPC Server that can communicate with Modbus. If you do not have access to an OPC Server, NI OPC Servers provides an interface to many protocols, including Modbus. If you would like more information about using DataSockets to connect to OPC Servers, take a look at the tutorial: Connecting LabVIEW to an OPC Server Using Front Panel DataSocket.

Unsupported Modbus Library (Boxed in Green)

  • LabVIEW 2012 and later
    The LabVIEW Modbus API is the latest release of the free LabVIEW Modbus Library. It is intended as a replacement and expansion of the free Modbus library functionality that supports versions of LabVIEW before 2012.
  • LabVIEW 7.1 and later
    The Modbus Library for LabVIEW is a wrapper for VISA commands. Programming with it requires some knowledge of Modbus function calls to program. This library may not contain as many features you need as the LabVIEW Modbus API or the API included with LabVIEW DSC Module.
   Note: The Unsupported Modbus Library is only supported on the NI Community Forums.

Additional Information

Modbus is a serial communication protocol. This means it is also possible to program LabVIEW to talk to a Modbus device via serial communications. The same principles apply to Modbus TCP/IP, which is built on the TCP/IP protocol.


Not Helpful