07-11-2011 02:29 PM
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
Solved! Go to Solution.
07-11-2011 02:50 PM
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.
07-11-2011 02:52 PM - edited 07-11-2011 02:58 PM
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.
07-12-2011 09:52 AM
thank you