LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to freeze the prompt sign in command line while an executable is runing

Solved!
Go to solution

Hi,

 

I have an executable file I compiled in Labview and I run it from the command line (CMD) as a part of a command sequence.

The command line may look like this for example:

Command#1

Command#2

MyLabviewFile.exe

Command#3

Command#4

....

 

Once the exe file starts it runs for about 1 minute.

The problem is that the command line is not locked while the executable is runing and the following command (#3 in the example) is sent before the executable finishes. This can cause a problem.

 

I must "freeze"/lock the prompt sign while the executable is runing or have some kind of indication INSIDE THE COMMAND LINE when the executable finishes. Or any other way to make command#3 starts only when the executable finishes.

 

Does anybody have an idea how to do this ?

0 Kudos
Message 1 of 5
(3,762 Views)

Hello,

 

Certainly a good question fro implementation in LabVIEW. For Command Line interaction LabVIEW employs the System Executive.vi, which allows users to programmatically run command line scripts from the LabVIEW application. However, this function creates new instances of the command window each time. 

 

I am currently experimenting with a custom Batch file , that may implement variable logic to wait for process completion. I will post additional in formation, or an example batch file, when it is completed. 

 

Cheers!

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 2 of 5
(3,738 Views)
Solution
Accepted by topic author Mentos

Instead of using

 

MyLabVIEWFile.exe

 

use

 

cmd /C MyLabVIEWFile.exe

 

This will cause the command sequence to hang until MyLabVIEWFile.exe finishes executing.  If your exe/path has spaces in it, you will need to put quotes around it like such:

 

cmd /C "MyLabVIEWFile.exe"

 

 

Message Edited by Matthew Kelton on 04-03-2010 01:29 AM
0 Kudos
Message 3 of 5
(3,725 Views)

hi mentos,

 Is your immediate command following the exe is expecting any input which is coming as output from the executable.

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 4 of 5
(3,718 Views)

Hi all,

 

Sorry for the late reply, I've out of office for a few days.

 

The following command isn't waiting for any input from the executable.

However, Matthew suggestion seems to do the job.

One I type

cmd /C "MyLabVIEWFile.exe" the commander waits until the executable finishes.

 

Cheers!

 

Thanks,

Mentos.

0 Kudos
Message 5 of 5
(3,688 Views)