LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabviewCLI : Run VI within a specific project environment

Hello!

 

I need to execute a test VI from CLI in order to automatize unit tests dedicated to someone else's open code program (execution from environment, not .exe runtime). This program calls project-dependant functions, like "palette/File IO/File constants/application directory"

It seems that because of these functions, I cannot simply execute my test VI by typing "LabVIEWCLI -OperationName -RunVI -VIpath <path of the test vi>" since it calls the program to test outside of its owned project. consequently, my test VI returns NOKs because of the presence of these functions mentionned above.

 

Can someone help me? 🙂 thanks

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 1 of 2
(67 Views)

Hi Pierre,

 

It seems LabVIEW CLI does not support running a VI from a specific project.

 

What you can do instead is create a "generic runner" VI that can dynamically open the project, application and VI references and run the VI in the correct context.

 

Runner VI:

raphschru_0-1779466228165.png

 

CLI Command (replace each <...> tag with its value, enclose in double quotes if it contains spaces):

LabVIEWCLI -LabVIEWPath <LabVIEWPath> -PortNumber <PortNumber> -OperationName RunVI -VIPath <RunnerVIPath> <ProjectPath> <TargetName> <DynamicVIPath> <Arg0> <Arg1> <Arg2> ...

 

Example VI to be run:

raphschru_1-1779466391316.png

 

Result in "Log.txt":

Application Directory: C:\...\ProjectFolder
Arguments:
arg0
arg1
arg2

 

Regards,

Raphaël.

0 Kudos
Message 2 of 2
(14 Views)