LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wait on tcp read

Solved!
Go to solution

I'm sure this is a total noob question, but here it goes.

I have a test device that spits out data on a serial line after every test (about 1 or 2 minutes).  This device is not close to my pc so it has a serial to ethernet converter connected to it.  All is well with the data getting to my pc but I dont know when the test is completed.

My only solution is to stay connected while having TCP Read.vi in a loop and ignoring the timeout error (56).  I don't want the timeout input to be set to infinity because if, for some reason, the test never completes, my program is stuck.

 

Any ideas?  Your input is greatly appreciated.

Ron Deavers, CLD
0 Kudos
Message 1 of 4
(2,554 Views)

I'm not clear what you're asking here.  Why not just set the timeout value to slightly more than 2 minutes?  Otherwise, there's nothing wrong with putting the TCP Read in a loop.

0 Kudos
Message 2 of 4
(2,546 Views)
Solution
Accepted by topic author programmindragon

@programmindragon wrote:

My only solution is to stay connected while having TCP Read.vi in a loop and ignoring the timeout error (56).  I don't want the timeout input to be set to infinity because if, for some reason, the test never completes, my program is stuck.

 

Any ideas?  Your input is greatly appreciated.


I have an idea...it's the same as your idea Smiley Wink. Set some timeout and clear errors if you get error 56. I would not suggest setting it to 2 minutes though, because, like you said, in that case your program could potentially take 2 minutes to stop. I'd set it to something like 200 ms (random value I picked.).

0 Kudos
Message 3 of 4
(2,541 Views)

Thanks for confirming my thoughts, imstuck.  I guess thats my only good option.

Ron Deavers, CLD
0 Kudos
Message 4 of 4
(2,526 Views)