04-27-2009 03:41 PM
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!!!
04-27-2009 11:20 PM
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.
04-28-2009 03:56 AM
Hi Smercurio,
Thanks for all your help!!!
Marko1982
04-28-2009 09:07 AM
No problem. Post back if you have any further questions.
Note that the subVI can actually be written without using Express VIs. See attached.