10-21-2014 09:33 PM
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
10-22-2014 11:46 AM
Hi,
Is there anyone who can provide any help with this?
Thanks!
10-22-2014 12:10 PM
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?
10-22-2014 12:36 PM
I think you are simply missing the FP.Open in method 1
10-22-2014 12:56 PM
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.
10-22-2014 01:20 PM
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"
10-22-2014 05:38 PM
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?
10-23-2014 09:05 AM
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?
10-23-2014 12:03 PM
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.
10-23-2014 01:27 PM
The owner is not ("LabVIEW.Application"), That is the development enviornment's Active X server.
The server name you want is this one: