LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling LabVIEW activex application from Matlab

Hi All,

 

I am having trouble calling a vi and passing parameters to it using ActiveX calls. 

 

I tried 2 methods to call the vi using ActiveX but none of them works. I have described the 2 methods below.

 

Method 1:

sc = actxserver('LabVIEW.Application');

glob = invoke(sc,'GetVIReference','C:\Program VIs\ControlSC.vi');

SetControlValue(glob,'Command','open')

glob.Run(0);

 

After running the above code I get the an error

"Source: LabVIEW
Description: LabVIEW: Cannot load front panel."

 

 

Method 2:

sc = actxserver('LabVIEW.Application');

glob = invoke(sc,'GetVIReference','C:\Program VIs\ControlSC.vi');

paramNames={'Command'}

paramValues = {'open'}

glob.Call(paramNames, paramValues)

 

After running the above code I get the an error

"No method 'Call' with matching signature found for class"

 

 

Does anyone have any idea how to fix these errors?

 

Thanks,

Ritesh

 

 

 

0 Kudos
Message 1 of 11
(5,864 Views)

Hi,

 

Is there anyone who can provide any help with this?

 

Thanks!

0 Kudos
Message 2 of 11
(5,819 Views)

Hi there,

 

Have you been able to successfully run the VI you are trying to call in LabVIEW on its own? Have you seen this white paper? What kind of tasks are you executing inside of your VI? 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 3 of 11
(5,812 Views)

I think you are simply missing the FP.Open in method 1


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(5,803 Views)

Hi,

 

The vi is part of the EXE. The acutal vi path is "C:\SoundApp\Sound.exe\Program VIs\ControlSC.vi"

 

sc = actxserver('LabVIEW.Application');

glob = invoke(sc,'GetVIReference','C:\SoundApp\Sound.exe\Program VIs\ControlSC.vi');

SetControlValue(glob,'Command','open')

glob.Run(0);

 

The vi checks the value in "Command" parameter and updates some global variable based on the value.

0 Kudos
Message 5 of 11
(5,796 Views)

I looked at the project settings of my application and it seems I removed the front panel of the vi that I want to run using ActiveX and hence I am getting the error "LabVIEW: Cannot load front panel"

 

Interesting thing is that if I use the 'Call' method from the activeX class then I do not get the front panel error. Then it barks about "No method 'Call' with matching signature found for class"

0 Kudos
Message 6 of 11
(5,788 Views)

The only choice left now is to use Method 2

sc = actxserver('LabVIEW.Application');

glob = invoke(sc,'GetVIReference','C:\Program VIs\ControlSC.vi');

paramNames={'Command'}

paramValues = {'open'}

glob.Call(paramNames, paramValues)

 

Does anyone know how to create array of variants in matlab? 

0 Kudos
Message 7 of 11
(5,772 Views)

Did I read this right?  You are trying to call a dependancy of an executable via Active X?

 

So, Why are you trying to run it with LabVIEW?  The owing app is the exe isn't it?


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(5,748 Views)

I am not trying to call the dependency of an EXE from LabVIEW. I am trying to call it from Matlab via ActiveX.

 

My matlab application wants to call my LabVIEW app and it needs to call a vi which resides in the EXE which will make my LV app take some action and output the data which is read by my Matlab app.

0 Kudos
Message 9 of 11
(5,732 Views)

The owner is not ("LabVIEW.Application"), That is the development enviornment's Active X server.

 

The server name you want is this one:

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 11
(5,724 Views)