LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One loop stop a loop

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.

0 Kudos
Message 1 of 9
(2,646 Views)

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.).

 

Message 2 of 9
(2,644 Views)

Just start, pls see the attachement

 

0 Kudos
Message 3 of 9
(2,599 Views)

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...

 


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 4 of 9
(2,594 Views)

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. 

0 Kudos
Message 5 of 9
(2,572 Views)

Can you set your tcp timeout to a lower sensible value?


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 6 of 9
(2,569 Views)

Will it take more resource for more loop times.

0 Kudos
Message 7 of 9
(2,546 Views)

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!

 


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 8 of 9
(2,543 Views)

Is it possible using registered event, one event is when tcp has data coming, another event is when queue has command coming, thanks.

0 Kudos
Message 9 of 9
(2,514 Views)