LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SUB VI STALLING PROBLEM

Solved!
Go to solution

Hi Smeurico,

 

Yes I need to display all the values in the main VI plus the controls to adjust the time targets. How would I then display the values?

 

Also I have put the subVI into its own loop besdie the main VI and it does run but only once because then the 4th part of the sequence structure just loops?

 

Any ideas for that?

 

Thanks for all the help by the way!!!

0 Kudos
Message 11 of 14
(592 Views)
Solution
Accepted by Marko1982

As I've noted, there are many solutions to your issue. One way is to have the subVI simply count time, and use control references so that it can write directly to the indicators on the main VI. Another is to have the subVI write the timer values to a queue, and then you read out the queue in the main VI to get the timer values. Another is to write the timer values to a global variable and have the main VI read the global variables to get the timer values. This last one may cause race conditions if you do not program it correctly.

 

Attached is an example using the control references idea. It's not a rewrite of your VI. It's a demo of one way to do it. Note that the subVI uses just one loop to go through several timers, and is easier to expand that your sequence frame and multiple loops. 

 

I'll leave it to you to investigate the use of queues. Smiley Wink

 

 

Download All
Message 12 of 14
(577 Views)

Hi Smercurio,

 

Thanks for all your help!!!

 

Marko1982

0 Kudos
Message 13 of 14
(565 Views)

No problem. Post back if you have any further questions.

 

Note that the subVI can actually be written without using Express VIs. See attached. 

Message 14 of 14
(555 Views)