Error 1 Occured After Modbus VI Has Been Working for Some Time

Updated Jan 17, 2025

Reported In

Software

  • Modbus Master
  • LabVIEW

Issue Details

I get an error from the Modbus communication VI after it runs for a certain amount of time. The duration between the error pop-ups can vary.

Error 1 occurred at: in TCP Master.lvclass:Protocol Write.vi:6190001->IP Data Unit.lvclass:Write ADU Packet.vi:1820001->Modbus Master.lvclass:Read Holding Registers.vi:2420001->The VI NAME.vi
 
error.png 

Solution

The reason this error can occur may be related to the interface used for the Modbus communication. 
In case multiple sessions are using the same physical interface, it is essential to make sure that sessions are opened and closed in proper order. 

  • Make sure all the VISA references are properly closed.
  • In case the Modbus session works on a serial or TCP interface, that is used by a VISA session, add a VISA Close function with a data dependency after the Modbus Shutdown VI.