LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Project Items in executable

Solved!
Go to solution

I have built a VI which looks through all of the project items to find libraries which contain a control called parameters.ctl and output an array of references to these controls. This works correctly in the development environment however when building to an executable the array of projects out of the application.projects property node is empty. Is there a way to get a reference to all project items in an executable?

 

 

Download All
0 Kudos
Message 1 of 21
(4,355 Views)

I doubt you could.

 

A project is something that really only exists in the development environment to organize your project.  Once you've built the application into an executable, everything is combined into whatever is needed to allow the executable to run and it no longer cares about the details of how the project is arranged.

 

Why do you want your executable to know about the project?

0 Kudos
Message 2 of 21
(4,324 Views)

I think the project is not accessible like it is during development.

 

You could get all VI's in memory, and check which are called "parameters.ctl", and then what library they are in. You'll get a new problem after that. LV will remove front panels when possible (e.g. no property\invoke nodes, event structures etc.). So looping over all VI's to read the front panels will fail.

 

Not sure what the use case is, but I'd say there must be better ways to do it.

0 Kudos
Message 3 of 21
(4,301 Views)

Why do you want your executable to know about the project?


I have a series of tests within my software which have an input cluster (parameters.ctl) which determines pass/fail criteria; speed; duration etc. I have a configuration table set up which will display each of the parameters for each of the tests. There are other projects with different tests and i would like to be able to use the same VI for all of them where the tests parameters are loaded into the configuration table dynamically. Currently it works really well with in the development environment but sadly not when i build it to exe. 
If there is really no way to get project information in the build environment then I guess ill have to do something a little less dynamic and automated.

0 Kudos
Message 4 of 21
(4,285 Views)

You can certainly do things dynamically.  The project file shouldn't have any effect on that.

 

Provide more details on what is so special about what you are trying to do that you think your VI needs to know about the project file, and I'm sure several people will be able to suggest good ways to do it without needing to know about the project file.

0 Kudos
Message 5 of 21
(4,273 Views)

wrote:

You can certainly do things dynamically.  The project file shouldn't have any effect on that.

 

Provide more details on what is so special about what you are trying to do that you think your VI needs to know about the project file, and I'm sure several people will be able to suggest good ways to do it without needing to know about the project file.

I have a bunch of controls called "parameters.ctl" in many different libraries. These controls all differ from each other however they are all clusters. I want to determine the labels and data type of each element in the clusters.
This is fairly straight forward if you have access to the project data as you can search through every project item to find any called "parameters.ctl" and get a reference to these controls.
If there is a way to get this information without needing to use the project data that would be great, anything anyone can suggest for this would be greatly appreciated.

0 Kudos
Message 6 of 21
(4,270 Views)

Property Nodes.

 

Here is how to get the names of the labels for a specific typedef cluster I have on my front panel.

 

Example_VI_BD

0 Kudos
Message 7 of 21
(4,254 Views)

Of coarse, (dynamically loading a class and then) calling dynamic dispatch methods would do similar things without having to do the work... But some OO knowledge would be required. That's what your building here: a custom dynamic dispatch framework...

0 Kudos
Message 8 of 21
(4,245 Views)

wrote:

Property Nodes.

 

Here is how to get the names of the labels for a specific typedef cluster I have on my front panel.

 

Example_VI_BD


Of course that is quite simple to do but my trouble is that the clusters i need information on are not in the same vi but are in the same project. I need to be able to get the references to those clusters somehow while still allowing the vi to be used in any arbitrary project. That's why I am looking for any way I can get the cluster references without directly passing them in. My current backup is to have an array of clusters input as a part of the constructor for my configuration class, however that would require the calling vi to have to statically assign the references to these clusters which is doable but i am trying to find a better solution.
Like i stated in the beginning of the thread the current method i am using which is to go through each project item and find the controls i require works great in the development environment however does not work after building as I can no longer get access to the project item list.

If someone knows a way to get access to the project item list in build environment then i can use my existing method otherwise if someone knows another way to find typedef controls references which are located in another part of the project i can use that too. If not I will go to my fallback which is to statically assign an array of references to the controls i need and pass them in as part of my constructor.
I hope what I am saying makes some kind of sense.

0 Kudos
Message 9 of 21
(4,233 Views)

You can certainly get references to controls in other VI's and pass that into the property node shown.  Just disconnect the link to "Cluster" like I have and wire in a reference.  Open a reference to another VI, get the references to the controls in that VI, figure out whatever scheme gets you specifically the control you want, and pass that reference into the property node.

 

It is probably easier for you to just create an array of names that you fill out based on each VI if you have a difficult time working with property nodes.

 

Stop thinking about the project because you are not going to get any info from the exe itself file about your project architecture.

0 Kudos
Message 10 of 21
(4,226 Views)