« Close

Datasheets and User Guides

App Notes

Software & Driver

 

Direct Modbus TCP Examples

Direct Modbus TCP

Overview

LabJack T-Series devices speak Modbus TCP. This makes them compatible with dozens of 3rd-party libraries. For most applications, however, LabJack recommends using the LJM library as it is simpler than using direct Modbus. Other reasons include:

Reasons to use direct Modbus

  • If the programming language you need is not supported in the LJM examples.
    • Please let us know if this describes you, since we like to support LJM for popular languages.
  • If you prefer to use an open-source library.
  • If you're already familiar with Modbus.
  • If you're using an architecture (such as embedded) that isn't supported on LJM.

Getting Started

The T7 and T4 have five test registers that should be used before trying to read/write to other registers. This will help in trying to debug any getting-started related issues with addressing or bit-wise (byte-flipping) issues.

Modbus Map

The Modbus Map defines the address and name of all registers, along with other information.  This section has a dynamic map that allows you to filter and search.

Direct Modbus API Documentation

For more information about LabJack's direct Modbus implementation check out the API documentation section.

Modbus TCP Example Code Table

Modbus TCP Example Code Table (Referencable)

Direct Modbus TCP Example Code

T7 T4

T7, T4


Libraries... Windows Mac Linux
LabVIEW
Node.js
Python
C/C++ (Streaming)
C# .NET

To use a 3rd party Modbus program, such as a Rockwell/Allen Bradley application, follow the instructions on the Modbus Client Applications page.

More information about Modbus as well as some getting started information can be found on the Modbus API Documentation page. A list of the available Modbus registers is available on the Modbus Map page.