LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What's mean of this error about TCP librarry?

When I use TCP librarry, a Librarry function error was gotten which prompted that Librarry function error (return value==-11[0xfffffff5]).
The error function is ConnectToTCPServer.What's mean of this error and how should I do?
0 Kudos
Message 1 of 5
(3,702 Views)
-kTCP_TimeOutErr
0 Kudos
Message 2 of 5
(3,692 Views)
Hello zhgwyh,

As lingfeng413 mentioned, the error you are receiving is -11 -kTCP_TimeOutErr. You can find a list of all the TCP error codes under the TCP Support Library Error Conditions entry in CVI Help (which is linked off the ConnectToTCPServer function help). You can call the GetTCPSystemErrorString function to obtain a system message that describes the error. The system messages can be more descriptive than the TCP Library error codes. To obtain the correct system error message, you must call GetTCPSystemErrorString immediately after calling the TCP Library function that failed.

You are getting a time out error because your TCP connection was not established before the default timeout (5000 ms) or the timeout you specified in the ConnectToTCPServer function.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 3 of 5
(3,678 Views)
Thanks a lot. This mistake had been amended, but I got a new one. I connected with other computer. But I can only get a message containing two lines when I sended it with more than two lines from other computer.(such as a three lines message) What caused this problem? I also tried the CVI TCP samples. The same situation was gotten. Hope your advice and thanks in advance.
0 Kudos
Message 4 of 5
(3,673 Views)
Hello zhgwyh,

As mentioned in the function documentation for ClientTCPWrite, "it is possible that TCP is not able to transfer all the data in one call. So, if necessary, you can check the number of bytes transferred and call this function repeatedly to transfer the rest of the data".

So you should monitor the return status of the TCPWrite function to see how many bytes were transferred. If this does not equal the data size of the message you are sending, you will have to call the TCPWrite function repeatedly.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 5 of 5
(3,644 Views)