LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call application builder from a compiled VI

Hello,

I wish to develop a tool (call it make) that can be executed from the command line, passed a LV project name and calls upon the application builder to compile the applications within this project. The problem I have is the following:

I can call the application builder (by means of invoking the Run method of BuiltTargetBuildSpecification.vi) to do what I want from within a VI but command line parameters are not passed to it.
prompt > LabVIEW.exe make.vi -- "project path" "project name"

In order to get command line parameters, I have to compile my make.vi to generate an executable but the application builder returns an error when invoked from within the executable.
prompt > make.exe -- "project path" "project name"

I do not know how to progress nor if what I need to do is altogether possible.

Cheers,
B.
0 Kudos
Message 1 of 4
(2,548 Views)
Even if you execute the BuiltTarget... VI with VI Server, it will execute in
the executable's Run Time environment. Methods regarding building an
executable are disabled in your executable.

You need to somehow open a reference to LabVIEW.exe, and use that
appliciation reference instead of your exe's application reference that is
used by default. Not sure if this is possible. I've tried once, but gave up
after a while because I didn't have a real use for it.

Regards,

Wiebe.


0 Kudos
Message 2 of 4
(2,532 Views)
Attached is a LV8.5 VI I wrote to do basically what you want to do.  You would use this VI in your make EXE.

It basically opens an ActiveX reference to LabVIEW, and runs the BuildTargetBuildSpecification.vi provided by NI to programatically build a project item.  Since the VI runs in the LabVIEW development environment, you will not get the errors associated with trying to build in the runtime engine.

This still requires the LabVIEW Development System to be installed on the PC as well as the Application Builder.  It does not require LabVIEW to be open at the time the VI is called, nor does it require it to be closed.  The example NI provides will only run in the LabVIEW Development System and requires LabVIEW to be closed in order to handle command line arguments.

Brief Instructions:

The VI has three states:  Init, Build, Close.

Init opens an ActiveX reference to LabVIEW and opens the BuildTargetBuildSpecification.vi reference.

Build builds an item in a project.

Close, closes the VI and ActiveX references.
0 Kudos
Message 3 of 4
(2,517 Views)
Splendid, I shall try this out.

Cheers,
B.
0 Kudos
Message 4 of 4
(2,487 Views)