LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to compile a VI so it contains all of the necessary source code to run and no longer needs to have access to the SubVIs?

I would like to take a high level VI and compile it so it contains all of the subVI code, but is no longer editable. Students will be able to use the high level VI and won't have to have access to all of the SubVIs.
0 Kudos
Message 1 of 14
(3,559 Views)
There are a number of options for doing this.

If you want to use this as an application, with NO access to any diagrams, then you just use the application builder to build it into a single executable.

Another way to do this is to use the "Save with Options" feature, and save it for application distribution. This retains all subVIs but removes the diagrams. If you use the VI Library editor, you can then select the top level VI such that when a user opens the new .llb file, they only open this top level application. This is equivalent to the above suggestion, but doesn't require building the application. This is only recommended if you don't have the application builder. It is VERY important that you make a copy of your VIs before doing this, as it re
moves the diagrams permanently.

Another solution is to manually remove diagrams from the subVIs.

I am not exactly sure what you are looking for. If this doesn't help, please post more specific definitions of your needs, and we will try to help.
0 Kudos
Message 2 of 14
(3,558 Views)
I would like students to be able to use the high level VI as a subVI in their applications. I would like the students to not have access to any of the high level VI's SubVIs and ideally to not even need read access to the SubVIs.
0 Kudos
Message 3 of 14
(3,558 Views)
To add to the reply of Labviewguru, you can also password lock the subVIs. Diagrams are still there but can't be edited without the password. For safety, do not lock your working copies of VIs but only the copy you distribute.


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 14
(3,395 Views)
You'll want to follow Jean-Pierre's suggestion of password protecting all of the VIs. Removing diagrams will also work but the downside is that VIs without diagrams cannot be converted to a later version of LabVIEW. Password protected VIs can be converted, so long-term support requirements is less.
0 Kudos
Message 5 of 14
(3,558 Views)
Wouldn't I still need to provide all of the SubVIs (called by the VI that I want to protect) to my students? I would like to eliminate all of the lower level subVIs so my students can work with a much smaller set of VIs.
0 Kudos
Message 6 of 14
(3,395 Views)
If you provide a high level VI using low level subVIs, the subVIs will usually appear in the hierarchy window and students will be able to drag and drop their icon on diagrams, whatever the subVI has its diagram removed or locked or even if the subVI is stored into an executable internal LLB.

There is however a way to hide VIs from the hierarchy window: in the GOOP Toolkit, there is a VI named "Hide System VIs.vi" that can mark/unmark VIs as "System VI" and make them invisible in the hierarchy. Yet you have to distribute the subVIs in a LLB and the student are a still able to browse it. Maybe changing the file extension may fool them for a while...


LabVIEW, C'est LabVIEW

0 Kudos
Message 7 of 14
(3,395 Views)
Try this:

Build the subVI as a DLL. Then, build a wrapper for the DLL and call it. This will create a single piece of code, contained in a subVI that allows you to do exactly what you need. Of course, you have to have the application builder.

DLLs are actually very easy to work with, especially in this manner. If you have trouble, please post here and let us know.

Good luck
0 Kudos
Message 8 of 14
(3,558 Views)
Oops, wrong spot...just in case you don't catch it, here it is again:

Try this:

Build the subVI as a DLL. Then, build a wrapper for the DLL and call it. This will create a single piece of code, contained in a subVI that allows you to do exactly what you need. Of course, you have to have the application builder.
0 Kudos
Message 9 of 14
(3,395 Views)
Thanks! I think I am making progress.
The code I am calling is a dialog box and it uses a global variable to pass calibration information.
Here is what I have done so far.

I built a shared DLL. I added my VI as an exported VI.
I used C calling conventions. I added 4 parameters (connection ID for TCP communication in and out) and sensor array (information on the configuration of a sensor) in and out.

I built a wrapper for the shared library (attached).

The dialog box doesn't open and I get either a hang or an error saying that LabVIEW has been corrupted.

I am hoping that I am making an obvious mistake!

Thanks again for your help!
0 Kudos
Message 10 of 14
(3,559 Views)