Error 56 Occurs When Using Modbus API

Updated May 12, 2021

Reported In

Software

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

Issue Details

I am using the Modbus API that installs with the LabVIEW Datalogging and Supervisory Control (DSC) or Real-Time Modules to communicate with a Modbus slave device. When I try to read a coil or register on the slave device, I get the following error:

Error 56 occurred at SubVIs.lvlib:RTU Data Unit.lvclass:Read ADU Packet.vi:5030001

Possible reason(s):

LabVIEW: (Hex 0x38) The network operation exceeded the user-specified or system time limit.

 

Solution

This error indicates that the Modbus slave device did not respond to your read request within the timeout specified for the Modbus session. 
  • Make sure that the device is powered on and ready to receive communication.
  • If using the TCP polymorphic instance of the Create Master VI, make sure that you have specified the correct IP address and port of the slave device.
  • If using the Serial polymorphic instance of the Create Master VI, make sure that you have specified the correct serial port, Unit ID, parity, and flow control settings. Refer to the manual for your device for information on how these should be set.
  • If you have multiple devices on the same network, remove all the other devices but one, and try them one after the other. This issue can be caused by one of the devices and can impact all the networks.
  • Reinstall NI-VISA driver, sometimes it happens that installing 3rd party software instruments drivers interferes with NI-VISA driver
  • If you are doing Modbus over a serial connection, please make sure that the connection between the serial pins on each end is correct. 

Additional Information

Error 56: Timeout When Communicating Between Network Devices Using NI Software