12-02-2022 01:09 PM
Hi,
I am trying to maintain someone's old Vi program. I see that the designer has made several SubVi's that are listed in the dependency tree of LabView. Moreover, the designer also calls the Sub-Vi as local variable in the main program.
I do not understand 2 things here:
1. How do I call a Sub-Vi as a local variable?
2. How do I get the Sub-Vi to show up in the dependencies?
Thanks for your help.
12-03-2022 12:33 PM
It is very difficult to say anything meaningful about your "old VI program" unless you include the entire Project (which is probably contained in a Folder, possibly with the same name as the Project). The important things for us to see are the Project file (a file with the extension .lvprog), the main VI (which might have the name "Main.vi", or the name of the Project.vi), and all of the user-written sub-VIs and Type Definitions (files with the extension .ctl). With luck, these are all in a single folder, possibly named for the Project.
If so, right-click that folder, choose "Send to", then "Compressed (zipped) folder". It will create a .zip file that you can attach, and that we can open. We'll be able to see (and, I hope, to understand) what is going on with the code. We'll also learn the version of LabVIEW that was used, and might have suggestions along those lines, as well. We'll also be able to find where (and possibly understand "why" and "how") the designer calls the sub-VI as a local variable (this puzzles me -- I don't know what this means, and don't think you can really do that ...). Without knowing more, we can only speculate ...
Bob Schor
12-03-2022 02:13 PM
@beyondgravity wrote:
Hi,
I am trying to maintain someone's old Vi program. I see that the designer has made several SubVi's that are listed in the dependency tree of LabView. Moreover, the designer also calls the Sub-Vi as local variable in the main program.
I do not understand 2 things here:
1. How do I call a Sub-Vi as a local variable?
2. How do I get the Sub-Vi to show up in the dependencies?
Thanks for your help.
1. Cannot be done! However there IS a construct known as an Action Engine aka LabVIEW 2 Global which uses either an uninitialized shift register or a feedback node to store data values. Read Ben's famous Action Engine Nugget is always a good read. http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801. Note I keep that all time most kudosed post in a macro because it is such an important concept!
2 to move a dependency into a project just select then drag to anywhere that is not an autopopulating folder. That's why we hate autopopulating folders and NEVER use them.