LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Launch LabVIEW VI from Command Line with Gitlab CI

I'm currently trying to set up continuous integration with LabVIEW using Gitlab's continuous integration services. Here's my setup:

 

Windows 10 Virtual Machine

LabVIEW 2015

LabVIEW-CLI for LabVIEW/Command Line integration

Windows Powershell

GitLab Runner Service running as my administrator account

 

I'm trying to launch a LabVIEW VI from the command line that runs all the unit tests in the LabVIEW project contained within git directory of my current project.

 

The Problem

I can run the following command from powershell sucessfully:

PS C:\Users\diagonalley\Desktop\DA622\builds\0\project-0> labview-cli --lv-ver 2015 --verbose --kill '.\common-tools\source\run UTF tests.vi'

 

LabVIEW opens, loads the VI, runs my unit tests, and all is dandy. Here's the output:

 

successful_command.PNG

 

Running the exact same command using the gitlab-runner service yields the following output:

 

unsuccessful_command.PNG

 

LabVIEW opens and tries to load "run UTF tests" but fails and reverts to the getting started window:

 

getting_started.PNG

 

The LabVIEW-cli never opens and my command times out. This is incredibly frustrating because LabVIEW gives me no indication as to why it can't open my VI, it just goes directly to the getting started window. Attempting to open the vi manually from the same getting started window works. Does anyone have any idea how to figure out why LabVIEW can't load my VI? There aren't any crash logs because LabVIEW isn't crashing. Any help would be greatly appreciated.

 

Cheers,

Ian K.
Software Developer
Data Ahead AG
0 Kudos
Message 1 of 19
(6,412 Views)

I guessed someone forgot at the compilation of LabVIEW.exe to enable the checkmark "Pass al command line arguments to application" Smiley Tongue

0 Kudos
Message 2 of 19
(6,333 Views)

I wish that were the case, but the command line argument works great when I run the script manually. The problem only occurs when I run the command line script through my gitlab-runner service. 

 

Anyone have any ideas on how to increase the verbosity of LabVIEW? 😛

Ian K.
Software Developer
Data Ahead AG
0 Kudos
Message 3 of 19
(6,327 Views)

Are you sure you have those parameters right? Like, I never use those double hyphens, although the documentation indicates you need it.

0 Kudos
Message 4 of 19
(6,312 Views)

I'm pretty confident I have the parameters correct. I know because LabVIEW launches fine when I run the command line script myself with powershell. When I run the exact same command through the gitlab runner service, LabVIEW fails to load the VI. I can see Loading "Run UTF tests.vi" in the splash window before the getting started window appears. 

 

To be clear, the gitlab runner service is running under my user account and is using the exact same shell (powershell) as my test. The service parses my configuration file (.gitlab-ci.yaml) and passes the exact same commands as in my test (the images above are slgihtly different because I didn't pass the project path and utf output path to LabVIEW to save time. I have tried this however and the results are exactly the same). 

 

I need to know why LabVIEW can't load the VI when being launched from the command line through my gitlab-runner service. Unfortunately LabVIEW doesn't give me any information. LabVIEW is already pretty jenky to use with source control, I'm not surprised the environment doesn't make continuous integration easy.

 

 

Ian K.
Software Developer
Data Ahead AG
0 Kudos
Message 5 of 19
(6,307 Views)

Are you using the forward and backward slashes correctly?

0 Kudos
Message 6 of 19
(6,302 Views)

That was my first thought as well. The gitlab-runner's environment variables all use forward slashes even in a windows environment. Luckily powershell (and LabVIEW) don't seem to care. They can handle both slash directions. I've tried both forward and backward slashes with the same results; LabVIEW works fine when launch directly from powershell through the CLI, it doesn't work when launched through the gitlab-runner service.

Ian K.
Software Developer
Data Ahead AG
0 Kudos
Message 7 of 19
(6,299 Views)

In the pictures it seems it's waiting for some connection. Could it be the firewall is blocking that?

0 Kudos
Message 8 of 19
(6,296 Views)

Yeah, the LabVIEW-CLI is basically a wrapper to allow communication between LabVIEW and the command line. The CLI exe opens a TCP listener and waits for the LabVIEW side to connect. There's no firewall issue, the code that opens the TCP connection from the LabVIEW side is in the VI I'm trying to launch. LabVIEW can't launch the VI, so the connection times out.

Ian K.
Software Developer
Data Ahead AG
0 Kudos
Message 9 of 19
(6,293 Views)

Perhaps you could enable an INI key to have more logging and find out why it won't open you VI.

 

See:

https://lavag.org/topic/18469-i-found-some-more-hidden-ini-keys/

 

https://pastebin.com/j1iAEZXg

0 Kudos
Message 10 of 19
(6,284 Views)