LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restarting a VI

Just out of curiosity, why did you use 4 invoke nodes, instead of just placing the subVI in your code?
Then you can just wire your controls directly to the subVI's inputs.
Cory K
0 Kudos
Message 11 of 19
(1,665 Views)

Cory,

 

See the earlier posts - I want to be able to abort the VI using the abort VI node.

 

I can't do this if it is a subVI, it has to be called as a VI in its own right.

Dan
CLD
0 Kudos
Message 12 of 19
(1,662 Views)

The VI might be running already when you try to call it.

By the way, usually you should set the control values BEFORE running the VI.

 

Daniel

 

0 Kudos
Message 13 of 19
(1,661 Views)

Daniel,

 

That makes sense, about the VI already running when I try to call it.

 

How can I prevent this from happening?  How can I call it once, and make the top level VI wait until it has finished executing (i.e. as though it were a subVI)?

Dan
CLD
0 Kudos
Message 14 of 19
(1,657 Views)

Just set the "Wait until done" flag to True.

But don't forget, set the control values before running the VI.

 

Daniel

 

Message Edited by dan_u on 09-28-2009 05:50 PM
Message 15 of 19
(1,653 Views)

Hi,

 

Surely it would be better to make all_tests.vi detect when a test has taken too long, or retured an incorrect value? This could be used to set a failed boolean and skip the remaining tests. Then you can do away with all this surrounding timing stuff with all its race conditions, vi server complexity, or closing an IO channel whilst it's being used

 

Rod.

 

0 Kudos
Message 16 of 19
(1,627 Views)

Rod,

 

Yes, given the increasing complexity and susceptibility to race conditions etc., I am inclined to agree.

 

The trouble is that if the programme does "hang", it will be inside a while loop waiting for a response from some DUT (albeit several layers down the hierachy).  Hence, I have the same issue - just at a lower level within the hierachy.

 

Dan

Dan
CLD
0 Kudos
Message 17 of 19
(1,620 Views)
Sounds like you need to put a timeout on the comms port read. Both serial and TCP reads can do it.
Message 18 of 19
(1,618 Views)

Yes,

 

On reflection, I think timeouts on my comms VIs are the way forward.  It's a bit tricky though, as I am currently using the timeout on the "TCP read" VI to add a delay to the while loop that I sit in waiting for my end-of-transmission character (">" in this case).  See attached code.

 

I think I will just OR the stop condition with "if number of iterations is greater than 100", or something similar.

 

Cheers,

Dan

Dan
CLD
0 Kudos
Message 19 of 19
(1,588 Views)