LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Command Line Arguments In While VI EXE is already running

I have a VI that I made and EXE (Executable) file which runs in a while loop.  The while loop stops after a control boolean is selected to "True".  This control is wired to the stop button in the while loop.

 

I know how to pass in command line arguments to run the EXE.  Is there a way I can pass a command line argument in after the EXE is already running to set the EXE control boolean to True to stop the EXE?

 

If not, what is the best method to do this?

 

Thanks!

0 Kudos
Message 1 of 9
(4,296 Views)

Hi,

 

no, you cannot apply command line arguments after you started the exe...

 

Use network communication to send commands to your exe!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(4,280 Views)

You can use network streams. But, why do you need this separately running executable?

Message 3 of 9
(4,264 Views)

@gregoryj, I want to call this EXE in a TestStand step and then run other tests in the Main sequence and be able to turn off and on the EXE as a test stand step whenever I'd like.  I will take a look at network streams.  Thanks.

0 Kudos
Message 4 of 9
(4,225 Views)

@GerdW, when you say use network communication are you also referring to using network streams?  Do you have an example?  Thanks!

0 Kudos
Message 5 of 9
(4,221 Views)

Hi, 

 

you can use any kind of network communication.

LabVIEW brings example VIs for all of them in the example finder...

Best regards,
GerdW


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

I'm not super familiar with TestStand, but I believe you could launch a VI asynchronously with "start asynchronous call". This could be a very simple VI that simply "points" to the desired VI. Then, desired VI will be running in the background (as long as it's in a loop that doesn't end) and you could communicate with it by queues, for example.

 

Network streams are a LabVIEW construct that is just one example of network communications that Gerd mentioned. You could also use TCP/IP communication, as another example of network communications.

0 Kudos
Message 7 of 9
(4,209 Views)

You can check out this video to see how Delacor does it. When they "DQMH module" or "thermal controller module" that is their version of a VI running in the background that can accept commands (via user events in this case). You could do it using a queue as well. No executables necessary!

0 Kudos
Message 8 of 9
(4,201 Views)

So, is this a standalone exe or does it communicate with other programs?

 

Running a second program just to stop it seems overkill. Why not have it check a small text file at regular intervals and stop if it contains the words "stop". You can control the contents with anything (*.bat, notepad, any other tool.). Have the program clear the file on startup. Since the file changes rarely and the os does a good job at caching, I doubt much real disk io takes place.

0 Kudos
Message 9 of 9
(4,193 Views)