LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus TCP comm error with fixed IP address

I am trying to communicate to a slave modbus device over ethernet using the LabVIEW Modbus library.

In the Modbus library, there is an example via "MB Ethernet Example Master.vi" that uses a fixed IP address to communicate to a slave device. When running the VI, I get error 56 indicating a timeout from the read input registers block.

I have enabled VI Server TCP/IP communication via port 502, which is consistent with modbus protocol on the slave.

Any thoughts?

0 Kudos
Message 1 of 4
(8,093 Views)
Error 56 is a "no connection related error". This occurs when there is nothing to read. Check your connections
0 Kudos
Message 2 of 4
(8,075 Views)
0 Kudos
Message 3 of 4
(8,074 Views)
Hi,
 
TCP/IP communication errors most often are caused by timeout conditions in either the LabVIEW TCP/IP VIs or at the operating system level. If you are sure that the network cable is properly connected to the slave device, a timeout condition of some type is likely the cause of the errors. The particular error code and symptoms associated with the error depend on whether a LabVIEW operation timed-out first or if an error is generated first by the operating system.
 
There are two typical error codes in cases where TCP/IP communication fails as a result of a timeout condition: 
-Error 56 is generated when an operation exceeds the user-specified time limit. This error is caused by the LabVIEW code not receiving a network response in the defined time limit. 
-Error 66 occurs if the TCP/IP connection is closed by the peer. In this case, Windows notices that no data is returned within a reasonable time, and it closes the TCP/IP connection. When LabVIEW attempts to communicate after Windows closes the connection, error 66 is the result. 
 
Try to increase the length of the timeout value wired to the timeout terminal of the event structure in the Ethernet Master VI. Also, make sure your command that you are trying to write is formatted according to the manual for the slave device you have. Sometimes if the data is formatted wrong the slave cannot recognize it.
 
 
Regards,
Message Edited by Ryan_F on 10-23-2009 11:00 AM
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(8,061 Views)