03-31-2008 04:53 PM
04-01-2008 08:00 AM
04-01-2008 10:27 AM
Thanks for the help, Lynn.
I fully understand that the Main VI waits until the subVI finishes given the way I invoke the subVI (merely putting it on the Main VI diagram in the normal flow of things).
But are you telling me that the data structures (controls/indicators) in the Main VI are not available to the subVI? I would think that the controls/indicators would be implemented as subroutines (to animate them and change their values) and that those subroutines in a main VI would be global in the sense that subVIs could also access them.
I don't want to interact with the Main VI in the sense that it needs to execute code in response to changing conditions in the subVI. But it seems to me that the subVI should be able to call service routines and access data structures in the Main VI even while the Main VI is waiting for the subVI to complete... in much the same way as a subVI can call other subVIs that the Main VI calls also...
If you are correct, I don't understand how controls/indicators are implemented in Labview. (By the way, this is NOT a CVI question).
Gary
04-01-2008 10:49 AM
04-01-2008 11:44 AM
My understanding of the implementation of global variables is that they exist on a special front panel that ISN'T visible. So if the sole purpose of my use of globals is to have a boolean indicator that I can flash on and off to indicate activity inside the loop in a subVI, and I want that indicator to be visible on the mainVIs front panel, the global doesn't appear to help...
I tried creating a reference to the indicator and giving that to the vi; the vi got the property:value from the reference and changes it. But the indicator on the mainVI front panel doesn't change; the update to the visual part of the indicator only occurs when the subVI exits.
There *must* be a way that a subVI can change indicators on the panel of a mainVI *without* the mainVI having to run in parallel....
04-01-2008 12:07 PM
Hello Gary
Creating a reference is what i wanted to recommend you. This should work. I attach a zip file with a simple main VI and a subVI . The boolen control changes its value every half second. Does this work on your computer?
Greetings,
shb
04-01-2008 06:13 PM
Not only does it work on my machine, but MY code works on my machine... after I fixed the STUPID blunders. Geez, you'd think after doing this a quarter century I wouldn't still step in the same potholes.
Thanks... my implementation using references was architecturally correct. My syntax screwups prevented my knowing that. Your confirmation that references are the thing to use made me go back and actually think about what I was looking at. Anyone know how to run 'lint' on G code?!
PROBLEM SOLVED.