LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does TCP Read fail if it recieves an error into its error input terminal?

I'm writing a TCP com program and sometimes I might have unsolicited bytes waiting in the TCP buffer. I need to check or clear these messages before I send a message to recieve a solicited response or I will generate. If I wire up the error terminals as expected and use a shift register to store the previous errors then the TCP Read function will fail every time once a single timeout error is generated. The help seems to indicate that the function will perform normally and simply pass the error (or generate a new error if the function fails again).

0 Kudos
Message 1 of 2
(1,278 Views)

Most VIs have what is called "standard error in functionality" which means that they do nothing if the error in cluster contains an error.  If your application experiences a particular error such as the timeout for which you do not want that to happen, then you need to write your own error handler.  Immediately before the TCP Read check the error.  If the timeout error has occurred, simply clear the error and call the TCP Read. If some other error has occurred, you will need to decide how to handle that.

 

Search for error handling and you should find many suggestions.

 

Lynn

0 Kudos
Message 2 of 2
(1,275 Views)