LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Control ref to ActiveX ref

I have a Main.vi containing an ActiveX container, a TSUI.ISequenceView. 

I need to get the automation reference in an external VI, but the method on the screenshot returns only the LabVIEW control reference as ActiveX container, but not the  ActiveX class. 

 

How to get the ActiveX class?

 

Madottati_1-1728024910407.png

 

 

 

 

0 Kudos
Message 1 of 7
(422 Views)

IIRC, you can get the value of the control.

 

So, use the Value property.

 

However, you'll get a variant. You'd need to cast it to the type. This is probably OK, because you seem to know the type (there's an indicator of that type).

Message 2 of 7
(401 Views)

That was a good idea, the code is executable but it doesn't work 😞 
The problem is, I have to get this reference before the Main.VI starts. Can it be a problem? 

 

Madottati_0-1728030931511.png

 

0 Kudos
Message 3 of 7
(387 Views)

@Madottati wrote:

That was a good idea, the code is executable but it doesn't work 😞 
The problem is, I have to get this reference before the Main.VI starts. Can it be a problem? 


Yes, that is a problem. If you get the value from the main before the main set the value, you get an old or default value.

 

The value of an ActiveX control is (concerning the value) not different from a string value.

0 Kudos
Message 4 of 7
(364 Views)

What do you need it for? Can't it wait until it's needed to get that reference? You could e.g. ask for it through a queue or event, or store it in a FGV which can flag if it's initialized or you need to wait.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 7
(340 Views)

Launching the VI and then passing the reference is working - but I still have doubts about your comment 

"The value of an ActiveX control is (concerning the value) not different from a string value."

 

A string has a default value. But after placing an ActiveX container on the front panel I have to insert an ActiveX object in edit time. So that object is the default value, and I expect it to be valid, when the VI is not started. 

0 Kudos
Message 6 of 7
(308 Views)

@Madottati wrote:

Launching the VI and then passing the reference is working - but I still have doubts about your comment 

"The value of an ActiveX control is (concerning the value) not different from a string value."

 

A string has a default value. But after placing an ActiveX container on the front panel I have to insert an ActiveX object in edit time. So that object is the default value, and I expect it to be valid, when the VI is not started. 


OK, in my defense I didn't get to see all the details of your main.

 

I didn't know your ActiveX control was a front panel container, from your description it could also be a normal ActiveX reference control.

 

I don't really know when a ActiveX container becomes valid. I wouldn't think it's valid before the VI is run, but maybe it becomes  valid when it isn't idle (e.g. not editable), or maybe it takes time to become valid after running. I don't know...

 

I try to avoid ActiveX. It never was convenient to work with and now it's dated as well...

0 Kudos
Message 7 of 7
(295 Views)