03-05-2018 04:55 PM
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!
03-05-2018 05:12 PM
03-05-2018 07:14 PM
You can use network streams. But, why do you need this separately running executable?
03-06-2018 09:38 AM
@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.
03-06-2018 09:48 AM
@GerdW, when you say use network communication are you also referring to using network streams? Do you have an example? Thanks!
03-06-2018 10:42 AM
03-06-2018 10:45 AM
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.
03-06-2018 11:09 AM - edited 03-06-2018 11:10 AM
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!
03-06-2018 11:57 AM
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.