LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Realtime TCP Error codes

Hello,

 

I have a problem with the error codes of the TCP-Networking VIs:

 

 In particular, it is about the TCP-Read-VI. On Windows-OS, when I try to read on a TCP-Connection, and the connection ist closed or interrupted during the read-operation, I get an error 66 (connetion closes) or 62 (connection aborted). However, on a cRio-RT-Controller, interrupting the connection to the communication-partner (by pulling the ethernet plug), the read operation only produces an error 56, that ist "timeout". Therefor, I have no distinction, wether the peer just did not send anything (timeout) or wether my connection is lost.

This behavior is different to what happens, if both communication-peers are running in windows-OS.

 

What is the reason. Is the TCP/IP-Stack on cRio-RT-OS differently implemented?

 

Thanks for any hints.

0 Kudos
Message 1 of 4
(3,323 Views)
Hi,

In general both errors, 56 and 66, are possible in Windows if the connection is lost. Since Windows is a non-deterministic OS, you cannot tell which error comes up first.
Error 56 is generated when the time limit is exceeded, error 66 is generated when the TCP/IP Connection is closed by the peer. If Windows polls to if a connection is valid and subsequently closes the connection before the TCP/IP VI times out, error 66 occurs. The other way round, if LabVIEW detects that no response is received before Windows polls the connection, error 56 will be generated.

If you communicate between a LV Realtime Target and a Host using TCP, some errors will be replaced with others, you are right on that. On an RT system error 66 is typically replaced by error 64. But LabVIEW still returns error 56 when a network response is not received with the time limit.

Anyhow, there is always a chance that the only error you see is error 56 even though the connection was terminated.
The only way to check a connection status is to let the client send a kind of heartbeat, which needs to be acknowledged by the server.

Hope this helps,
Christian
0 Kudos
Message 2 of 4
(3,299 Views)

please ignore. happend due to forums hang

Message Edited by Christian_M on 01-18-2010 05:06 AM
0 Kudos
Message 3 of 4
(3,299 Views)

please ignore. happend due to forums hang...again

Message Edited by Christian_M on 01-18-2010 05:09 AM
0 Kudos
Message 4 of 4
(3,298 Views)