01-16-2012 04:08 AM
As the attached screen, when one loop failed by tcp read/write, the other 2 loops need to stop.
But the tcp read will keep waiting there.
Any suggestion, thanks.
01-16-2012 04:19 AM - edited 01-16-2012 04:24 AM
Please attach real code instead of pictures.
Should only the two other loops stop or is there more code that we cannot see that needs to continue to run? What else is there? Is this a subVI?
We need to know a little more about your application to decide what is best, but there are many possibilities (locals, globals, action engines, shared variables, notfiers, etc.).
01-16-2012 10:01 PM
Just start, pls see the attachement
01-16-2012 10:45 PM
Some links, that may be of interest.
Using FGV: https://decibel.ni.com/content/docs/DOC-18262
Using locals (possiblity of race conditions, I would avoid this personally): http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE
Or this forum post: http://forums.ni.com/t5/LabVIEW/starting-stopping-multiple-while-loops/m-p/1765802?requireLogin=Fals...
01-17-2012 03:54 AM
It seems the samples are sending info between the loop, now the case is the tcp read will keep waiting there until new info in, it will hold the loop to make it hang, no info can pass in untill next loop.
01-17-2012 04:00 AM - edited 01-17-2012 04:01 AM
Can you set your tcp timeout to a lower sensible value?
01-18-2012 01:18 AM
Will it take more resource for more loop times.
01-18-2012 01:30 AM - edited 01-18-2012 01:31 AM
I wouldnt think so. Running a loop every now and then should have very minimal impact on your resource use.
If you are concerened, you could use a timed out output from the vi's to optimise your application.
I am not sure about the TCP vi's as you havent attached them, but the dequeue element vi's have a boolean output - timed out?
You could wire this to a case structure and not execute any code which you dont have to when the loop times out.
Hope that makes sense!
01-19-2012 01:54 AM
Is it possible using registered event, one event is when tcp has data coming, another event is when queue has command coming, thanks.