I’ve gotten TCP communication within LabView down, for the most part. I’m just trying to figure out a way to execute a sub-VI after about a second of not receiving any packets. Here’s how I thought it could work.
After the TCP listener gets a TCP packet from the IP+port it’s listening onto, it primes/activates the safety code. This code watches and sees if there are no packets coming in, and if none come in for around a second, a sub-VI is executed.
Any ideas/suggestions? Thanks.
I believe what you want to do is to set the timeout on the TCP read to 1500. Then wire the error out to a switch statement. If you don’t get an error, cast the string as shown in your attachment. If you get an error, specifically an error 56, then call the subVI.
Should I be worried that LabView might throw error 66 before error 56? Or should I just provide a sub-VI for both errors?
I think that 66 means that the refnum isn’t valid because the other side closed the connection. In that case, I usually close my refnum and reopen the session.