Can I control a labview executable with matlab?

13 vues (au cours des 30 derniers jours)
Wouter Meekes
Wouter Meekes le 17 Mai 2022
Commenté : Mitch Lautigar le 17 Mai 2022
I'm aware this is a bit of a long shot, but it wouldn't be the first time matlab's capabilities have surprised me.
For a project, I have to make rovibrational fits to a nitrogen optical emission spectrum. The problem is that I have several thousand spectra and more to come. It would take me weeks to process them manually and so I want to automate this using Matlab. I got a program that can do these fits, but it is a labview .exe file and I have not received the source code. I was wondering if it is still possible to connect the two.
What I would like to do:
- Have Matlab give LabView a file
- Tell LabView to make a fit (the program has a designated button for this, if that helps)
- Save or extract the fitted parameters (it has a button for this as well)
- Save or extract the fitted curve (also a button)
e=actxserver('LabVIEW.Application');
vipath='C:\Users\...\fit_spectra_N2_SPS_main.exe';
vi=invoke(e,'GetVIReference',vipath);
Obviously this wants a vi, so I tried finding what sort of method the ‘.exe’ file would be, but couldn’t find that. If I try it like this, I get the error:
Error using COM.LabVIEW_Application/GetVIReference
Invoke Error, Dispatch Exception:
Source: LabVIEW
Description: LabVIEW: (Hex 0x423) Unexpected file type.
I've also tried a suggestion on the National Instruments website (https://forums.ni.com/t5/LabVIEW/MATLAB-calling-subVi/td-p/906758) But that seems to only change the way the invoke function is called. Either way, it gives me the exact same error.
After a lot of googling and coming up empty-handed, the last thing I tried was ask a friend who - though he's not very familiar with matlab - has a lot of programming experience. He expected it to be impossible, but recommended I ask here regardless.
So is it possible to control a labview executable (which I do not have the source code for) with matlab?
If it does happen to be possible, can you point me in the right direction to get started? Because I honestly have no idea how to go about it anymore.

Réponse acceptée

Mitch Lautigar
Mitch Lautigar le 17 Mai 2022
MATLAB and LABVIEW are two very distinctly different programs. If you wanted to pass inputs/outputs, you could do that. But having MATLAB call a labview program is impossible.
  4 commentaires
Wouter Meekes
Wouter Meekes le 17 Mai 2022
I feared as much. Thanks for you answer :)
Mitch Lautigar
Mitch Lautigar le 17 Mai 2022
No problem. Glad I could help.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Produits


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by