LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX Object references - casting to a specific instance

I have some ActiveX controls that are used to interface between a vendors hardware. The activex controls are quite heavy weight in that at any one time there should only be one instance of each of the type of controls within the program.

What I want to do is keep the activex controls in the top level vi and pass references to sub-vi's in order to do property changes or method calls on the activex objects.

When I create an activex reference control in a sub vi it doesnt seem to know what methods/propertys are available on that reference. I beleive it needs casting/converting to a reference that will allow LabView to recognize the reference type but im not sure how to do this.

Thanks

TMC
0 Kudos
Message 1 of 2
(2,797 Views)
Your automation refnums are probably not linked to the ActiveX control. Try this... select a property node in your main VI's diagram that has the desired ActiveX control attributes displayed and then select Edit>>Create SubVI from the menu. The automation refnum in the subVI will be linked to the ActiveX control and will work the way you want it to. Copy this to your other subVIs and the property nodes will start behaving. The other way to link the automation refnums is to right-click on them and choose select ActiveX class and then browse to your control.

-Jim
0 Kudos
Message 2 of 2
(2,797 Views)