LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass parameter to LabView-VI in batch mode

Hello,

I am executing LabView-VIs in batch mode, that means my batch-file calls the VI and the VI immediately executes, since its VI-properties are set in this way.
However, my requirement is that I pass a parameter value to the VIs (a string).
How can I do this in batch mode?

Regards,

Gerald

0 Kudos
Message 1 of 6
(4,030 Views)
Hi geraldW,

look for search topic "command line parameter" here in the forum - you will find many threads on this topic with quite good explanations on hwo to do it!
There are examples provided by NI too!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(4,023 Views)
Hello,

thanks for your help.
The parameter passing works, I took the VI CommandLine and modified it.
However, you have to close LabView each time you want to pass new parameters to the VI. I would like to run this VI in a sequence and each time pass new parameters.
Thereby it is time-consuming to restart LabView each time. Is there a way around this?

Regards,

Gerald


0 Kudos
Message 3 of 6
(4,007 Views)
Hi Gerald,

make an executable from your vi! This should be the preferred way when you need to call your program from within a batch file.
Instead of loading LabView development environment this only loads the runtime engine and will speed up loading this way...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(4,005 Views)
Hi,

I am using LabView Full Development System, therefore I have no Application Builder. I cannot build an exe without Application Builder?
I would prefer not to buy the Application Builder. Isn't there a way for passing parameters in a reasonable way without using executables?

Regards,

Gerald
0 Kudos
Message 5 of 6
(3,986 Views)
Hi Gerald,

of course there are other ways.
One way could be to use a text file to pass parameters like this:
*** snipppet of batch file
echo parameter1 > c:parameters.txt
wait 100
echo parameter2 > c:parameters.txt
*** snippet end

Your vi is running all the time and checks the parameter.txt-file for new data (file palette-> file/directory info). When new data is passed, the file is read and parsed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,983 Views)