LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append text to textbox

Solved!
Go to solution

I'm trying to create a command line utility to build LabView (2013) application exe from command line.
I worked out a solution that works fine .. it uses a powershell script and a VI that executes the build task.

The shell script is something like that:

param(
    [Parameter(Mandatory=$true)]
    [string]$Project
)
 
$LV = "C:\Program Files (x86)\National Instruments\LabVIEW 2013\LabVIEW.exe"
$BuildVI = "C:\Builder\Builder.vi"
 
if((Test-Path $Project) -eq $false) {
Write-Host "WARNING: Project file '$($Project)' does not exist"
throw "Project file does not exist"
}
 
& $LV $BuildVI -- "$Project"

Builder.VI is something like that:
michelesantucci_0-1770125080283.png

As I stated everything works fine but "Build output" string indicator is always empty or looks like that..

of course it's a matter of UI thread synchronization.
I tried putting some delay inside for loop, checking the "Synchronous  Display", but nothing appears.. just a 1 second or higher delay before the exit allows to read some of the text on the output.

0 Kudos
Message 1 of 5
(119 Views)

Have you tried to use local variable instead of property node?

 

George Zou
0 Kudos
Message 2 of 5
(94 Views)
Solution
Accepted by topic author michele.santucci

I think I understood... and it was also pretty obvious but I didn't get it immediately because I was thinking Build VI was working as the build action when launched from LabView... but.. Build VI just run synchronously.


Anyway I had a chance to learn a little bit on queues (as I used a consumer producer template trying to solve the asynchronous UI update and it works).

Set aside the main issue a new question emerged: "It's possibile to know if a .lvproj defines more than one build specification?"

0 Kudos
Message 3 of 5
(82 Views)

a new question emerged: "It's possibile to know if a .lvproj defines more than one build specification?"

Sure.  From Project property node => MyComputer=>BuildSpecs ...

 

George Zou
Message 4 of 5
(74 Views)
Set aside the main issue a new question emerged: "It's possibile to know if a .lvproj defines more than one build specification?"

And the answer is yes... as cleary explained here:

Programmatically Find the Names of Build Specifications 

The need for this it's just to verify if the Build Specification provided by the user as parameter is correct; leaving Build VI to run with a wrong specification input does not provide an useful error message.
The example provided above works fine but if you're using such method to run a build over the project you probably wish to close the Project reference, if you don't call the Close method you will probably asked for the project to be saved.
Maybe this last point should be investigated for side effects on build number update.

0 Kudos
Message 5 of 5
(65 Views)