LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run Matlab Executable from Labview

Solved!
Go to solution

Hi,

 

I have a Matlab executable "Report_GUI.exe" , Its a GUI which takes an input ( a file) and generate data report. I want this GUI executable to run through my Labview DAQ program. I am unable to find any proper ways to do it. Can you please help me out on this, is there any example for this which i can look at it.Please let me know.

 

Thanks,

 

Ankit

0 Kudos
Message 1 of 4
(5,528 Views)
Solution
Accepted by topic author AnkitG

@AnkitG wrote:

Hi,

 

I have a Matlab executable "Report_GUI.exe" , Its a GUI which takes an input ( a file) and generate data report. I want this GUI executable to run through my Labview DAQ program. I am unable to find any proper ways to do it. Can you please help me out on this, is there any example for this which i can look at it.Please let me know.

 

Thanks,

 

Ankit


Hey Ankit,

 

You can open up external .exe files from a LabVIEW program when using the System Exec VI. You can find an example of this sort of operation in the NI Example Finder (Help > Find Examples...) under Communicating with External Applications.

 

Open EXE.png

 

All you need to provide to the input terminals of the System Exec VI is the name of the .exe you wish to open and a reference to it's folder directory;

LabVIEW will do the rest of the work. For extra parameters in terms of the command line arguments you may require, after the entry of the filename in the string attribute of the VI you must type a hyphen  (-) followed by the name of your parameter; for example, "notepad.exe -myFirstParameter".

 

Let me know if you need any more help; a full tutorial of this operation can be found at this URL.

Good luck!


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 4
(5,504 Views)

Hi Ankit,

 

Alex's solution is valid for opening the file through LabVIEW.

However this Knowledge Based article Calling GUIs for use with The MathWorks explains that "there is no way for LabVIEW to be able to actively handle callbacks from the GUI since the MATLAB Script Server permits no way to do it".

 

If you are also wanting to extract the output string of the command, you can do this through some additional formatting.

I have attached an example VI file that may be able to help on this.

 

Hope we've managed to help!

Tori

 

 

 

Tori
Student
0 Kudos
Message 3 of 4
(5,487 Views)

thanks a lot , I have a now got an understanding by both of yours suggestions it was a great help.

 

-Ankit G

0 Kudos
Message 4 of 4
(5,460 Views)