LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable in Progress Bar

Solved!
Go to solution

I have an existing labview code that is comprised of a main vi, which is the user GUI, and several (approx 70) sub vi's. I am trying to add a progress bar to the front screen (User GUI) that will immediately increment after it hits certain sections of code. I am doing this using a global variable to store the value of the current progress, and then attempting to write to the progress bar on the main screen after each incrementation. Is there a way to link the value of the main progress bar to the global variable so that it updates as soon as the value is incremented? The problem I am facing is that when I update the global variable in a subvi, the progress bar takes the value of the subvi after it is completed, skipping all the numbers in between. I realize this is because I am not correctly writing to the progress bar, but I am unsure how to do so. If this isn't a good method, does anyone have any suggestions?  

 

For Example:

 

Main Vi           SubVi1        SubVi2

(1-4)                (5-8)             (8-12)

 

Progress Bar: 1 2 3 4 8 12

 

 

(I did try the Progress Bar Library NI provides, but I need a progress bar on the Front Panel, not a pop up, so I can debug while the code runs)

 

Thanks- Adam

0 Kudos
Message 1 of 4
(3,578 Views)

If this is just for debugging then Highlight Execution and Probes are your friend here.

 

If you've got sections of code which you think are suspect, use Breakpoints.

0 Kudos
Message 2 of 4
(3,569 Views)
Solution
Accepted by topic author apmsj08

I'd go with a Action Engine to update the progress bar VIA vi server referance.  Here's an example using a AE I have for just this type of progress bar.

 

If you haven't read Ben action engine nugget, it should be required, you can find it here

 

By constructing a "resource module" (a special AE that holds a referance to the resource to act on)  after initializint the AE you can call any "method" on the resorce from any location in the application instance.  These babys really let you do some interesting things to the GUI from wherever the real actions is taking place.


"Should be" isn't "Is" -Jay
Download All
Message 3 of 4
(3,564 Views)

thank you

0 Kudos
Message 4 of 4
(3,526 Views)