LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems calling LabVIEW VI through ActiveX inside another LabVIEW VI

Hi everybody,
basically I would like to create an ActiveX to be inserted in a LabVIEW VI which at its turn would call another LabVIEW VI.
I have choosen Visual Basic to create this ActiveX, being the main section code:
...
Dim lv As LabVIEW.Application
Dim vi As LabVIEW.VirtualInstrument
Dim names(0 To 1) As String, values(0 To 1) As Variant
'Assign an object reference to VI
Set lv = New LabVIEW.Application
'Assign an object reference to VI
Set vi = lv.GetVIReference(lv.ApplicationDirectory & "\Examples\General\Strings.llb\Parse Arithmetic Expression.vi")
vi.ShowFPOnCall = False 'Open front panel if requested
'Initialize the variables & define the strings corresponding to the VI connector labels.
names(0) = "Arithmetic Expression": values(0) = "1+1"
names(1) = "Result"
'Call the VI
vi.Call names, values
...
 
So, when this ActiveX executes this code sequence it locks when creating the "LabVIEW. Application" object. I have tested this ActiveX from another client application (Internet Explorer) and it works perfectly, so the problem is located in the creation of ActiveX from LabVIEW. Do I need to do anything special in my code or simple it cannot be done what I want to do?
 
Thanks !!!
 
Jesus Valero
Plataforma Solar de Almeria.
0 Kudos
Message 1 of 3
(2,738 Views)
Let me try to understand. In LabVIEW, you've got an ActiveX object that is trying to create another instance of LabVIEW? You can only have one LabVIEW open so I assume that's why you're getting the error. The ActiveX object only makes sense if you're trying to start LabVIEW from some other application. From within LabVIEW itself, you don't need a wrapper around the methods and properties you're using to open a VI and set control values.
0 Kudos
Message 2 of 3
(2,708 Views)

Exactly, but really the code of above it's only an example that I want to do. I'm trying something more sophisticated.

I want to create an ActiveX control that could work as stand alone executation with the ability of directly get some indicator values from its LabVIEW VI container and depending of those values, set the control values of others LABVIEW VIs. I really know that within LabVIEW itself I can get/set those indicators/controls, but with this method I think that the diagram block of the LabVIEW VI container can be more simple.

0 Kudos
Message 3 of 3
(2,692 Views)