How can you call a LabVIEW VI from MATLAB script?

94 views (last 30 days)
I was wondering if I could run a LabVIEW VI through a command/function in MATLAB. I don't want exchange of any data, or anything fancy. I just want to run the VI at a specific time through my MATLAB code. I looked up the net and found this:
However, whenever I try to run this, I get the error
Error using
Invoke Error, Dispatch Exception:
Source: LabVIEW
Description: LabVIEW: Open VI Reference no
longer matches VIs in memory by filename. A
filename is no longer sufficient because the
full name of a VI now includes any owning
Error in readColorVI (line 7)
Can anyone help me around with this error? From what I gather, it seems I need to provide something else along the path of the VI? If so, what is it? Is there any other way to do it?

Accepted Answer

Ahmet Cecen
Ahmet Cecen on 28 Mar 2018
If you have them both installed this should just work:
Deepansh Bhatia
Deepansh Bhatia on 29 Mar 2018
Awesome! Worked like a charm! Thank you so very much.

Sign in to comment.

More Answers (2)

Stefano Franceschini
Stefano Franceschini on 7 Sep 2018
hi! i saw this code and I wanted to test it, but when I run the "e=actxserver('LabVIEW.Application');" line, and matlab shows me this error "Error using feval Server Creation Failed: Impossible to find the specific file.
Error in actxserver (line 86) h=feval(['COM.' convertedProgID], 'server', machinename, interface); " Does anyone know how to fix this issue?
  1 Comment
Guillaume on 7 Sep 2018
Edited: Guillaume on 7 Sep 2018
"Does anyone know how to fix this issue?"
Install LabVIEW.

Sign in to comment.

NI_OS on 25 Feb 2020
You need LabVIEW & MATLAB on the same machine installed and licensed.
I'll tested it with LV2019SP1 & MATLAB R2019b:
!start C:\Users\NI\Desktop\
This code works perfect for running a LabVIEW VI out of MATLAB.
See the LabVIEW attatched as a Snipped:


Community Treasure Hunt

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

Start Hunting!

Translated by