Error 56 Occurs When Using The NI Modbus API

Updated Jun 22, 2023

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. 

If using Modbus TCP:
  • Make sure that the device is powered on and ready to receive communication.
  • Make sure that you have specified the correct IP address and port of the slave device.
  • 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.
  • It could be the case that the slave response is not entirely formatted according to the Modbus TCP standard, to confirm this use network packet sniffers like WireShark to check if the slave is responding at all to the master queries.
If using Modbus RTU:
  • Reinstall NI-VISA driver, sometimes it happens that installing 3rd party software instruments drivers interferes with NI-VISA driver
  • 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.
  • 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