Modbus Communication Using LabVIEW or LabVIEW Real-Time Module

Updated Aug 31, 2018

Reported In

Software

  • 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?

Solution

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

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

  • 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.

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.

WAS THIS ARTICLE HELPFUL?

Not Helpful