LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run external program but keep window in background?

Hi folks,
 
I couldn't find a hint to the following problem.
 
I start an external program from LabVIEW via a batch file which is executed with the "system exec.vi". The option "run minimized" is chosen. However, the window of the external program stays in the foreground nevertheless. How can I keep the panel of the calling vi in the foreground?
 
My question is very similar to
 
 
but that question was not sufficiently answered by anybody.
 
Thanks in advance,
Peter
0 Kudos
Message 1 of 8
(8,221 Views)
The "run minimized" option applies to the command window, it has no effect on the program called from within the command window.
 
The solution is to use the "start" command with option /MIN.
 
For example, to start notepad minimized, you would use the command "start /MIN notepad.exe". So feed this command to the "system exec". See if it works!
 
0 Kudos
Message 2 of 8
(8,218 Views)
For more details, have a look at the microsoft article:
 
 
(It is a bit misleading, because the description for /min and /max seem wrong, they only describe the behavior if start is used without parameters. The correct description should be:

/min : Starts an application minimized. 
/max : Starts an application maximized.

In any case, if you run a more sophisticated application, it might have its own fancy commandline parameters, some of them might specify minimized, minimized to tray, or hidden, etc. In this case you could used those instead. Check the documentation

0 Kudos
Message 3 of 8
(8,216 Views)
Hi,
 
thanks for the hints. It works with programs like notepad, but it doesn't with more sophisticated like Opus, the software for control of Bruker spectrometers. I have contacted the vendor for help.
 
Bye, bye,
Peter
0 Kudos
Message 4 of 8
(8,190 Views)

Hi Peter

I'm trying to control OPUS (for Alpha FTIR) via Labview. I'm really lost..

Do you have any example code for me ?

 

Thank you

Tomer

0 Kudos
Message 5 of 8
(7,825 Views)
0 Kudos
Message 6 of 8
(7,823 Views)
The OPUS in page you have sent me is other OPUS software.
0 Kudos
Message 7 of 8
(7,821 Views)

This post is pretty similar to a previous post. This person wanted to know how to use LabVIEW to control OPUS. I have atteched a program which starts OPUS. You will need to input the approriate PW information (mine is just the default admin) and file extensions. You will notice one of the invoke nodes is whether or not you want to minimize OPUS. You can pass this control from one VI to another using the icon connectors as usual.

 

I hope this helps. Once you read the previous post and learn to utilize Visual Basic, you can automate ANYTHING in OPUS.

0 Kudos
Message 8 of 8
(6,800 Views)