Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 ratings:
 3 out of 5     Rate this Document

TCP/IP Error Codes and Related Time-out Issues in LabVIEW

Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Modules>>LabVIEW Real-Time Module

Problem:
I am trying to communicate between two computers using the TCP/IP VIs in LabVIEW. I usually am able to communicate successfully between the computers, but occasionally I receive a TCP/IP error. There are several different errors that come up depending on the situation, and I am not sure what the cause is or how to correct the problem since it does not occur every time I run my VI. Where can I find more information on the TCP/IP errors generated by LabVIEW?

Solution:
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 each system, and you otherwise can communicate between the computers (via pinging each system's IP address, for instance), 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.

Refer to the Networking Error Codes topic in the LabVIEW Help (linked below) for a complete list of the LabVIEW networking error codes.

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.
In a Windows environment, either error 56 or error 66 are possible. However, without determinism it is not possible to specify which communication error will occur first. If Windows polls to see if a connection is valid and subsequently closes the connection before the LabVIEW TCP/IP VI times out, then error 66 will result. However, if LabVIEW detects that no response is received before Windows has a chance to poll the connection, error 56 will be generated. The unpredictable timing associated with when each of these operations times out and which one occurs first results in different error codes being generated by different runs of the same VI.

If you are using the LabVIEW Real-Time (RT) Module along with TCP communication to communicate between an embedded RT VI and a host VI on a Windows computer, other errors in addition to the ones listed above might occur. On an RT system, error 66 is typically replaced by error 64. LabVIEW still returns error 56 when a network response is not received within the user-specified time limit.

In LabVIEW 8.0 or later, refer to the Fundamentals»Using LabVIEW with TCP/IP and UDP book in the LabVIEW Help (linked below) for more information. In LabVIEW 7.1 or earlier, refer to the Using LabVIEW with TCP/IP and UDP Application Note by selecting Help»Search the LabVIEW Bookshelf in LabVIEW for more information. Also, refer to the KnowledgeBase documents linked below for more information about TCP/IP errors in relation to LabVIEW Real-Time Module programming.

Related Links:
LabVIEW Help: Networking Error Codes
LabVIEW Help: Using LabVIEW with TCP/IP and UDP
Developer Zone Tutorial: Basic TCP/IP Communication in LabVIEW
Developer Zone Tutorial: Using the LabVIEW Real-Time Communication Wizard
KnowledgeBase 2CND08Z8: Error 64 When the Client Closes My TCP/IP Connection to an RT Engine
KnowledgeBase 2M59E6T4: TCP Server Running on RT Target Returns Error 61 When Connection is Closed by TCP Client on Host
KnowledgeBase 2X8GD12P: Error 54 in TCP Connection.vi while using FTP VI’s

Attachments:





Report Date: 03/01/2004
Last Updated: 09/26/2008
Document ID: 370GCFBS

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit