LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking if a control is a sequence context

Solved!
Go to solution

Hi,

 

In one of my projects, I have to check if a control is a Sequence context control. This cannot be done using any properties like the 'Classname' of the control. Hence I am converting the control reference to variant and using 'Variant to Flattened String' to get the 'type String' array which describes the type. I see that the first two element of this array varies for each control and the remaining elements are the same for controls of the same ActiveX class type. Please tell me if this is the best way of doing it. I have 

 

Thank you.

Ganesh Kumar

0 Kudos
Message 1 of 7
(3,258 Views)

An easier way to do this would be to use VI scripting to find the name of your typedef and check that. It also has the added benifit of being easier to understand exactly what is being done in the section of code.

Check out the attached VI for an example of performing this type of operation.

Screen shot 2011-11-08 at 8.46.27 AM.png

All you need to do is to create a reference to your control and use the attached VI to return the name of the typedef file it is attached to. There is more information on VI Scripting in the LabVIEW Help.

Regards,
Dan King

0 Kudos
Message 2 of 7
(3,238 Views)

There is also a large library of VIs for returning type information from variants in <vi.lib>\Utility\VariantDataType that may help.  We do not recommend using type descriptors if you can avoid it.

0 Kudos
Message 3 of 7
(3,235 Views)

DFGray,

Ganesh Kumar is trying to find the ActiveX class of the control. When we convert the ActiveX control to Variant and enable the type to displayed it actually shows the CLSID of the ActiveX server. I don't think any functions in <vi.lib>\Utility\VariantDataType folder give the CLSID information. The CLSID will help to identify the ActiveX server name. Is there any function that will be able to do this ?

 

0 Kudos
Message 5 of 7
(3,222 Views)

Dan_K and DFGray,

Thank you for your replies. I am looking for a way to find out whether a control is a sequence context control and that control need not necessarily be a typedef. As Sathish says, we will be able to get the CLSID if we convert the control to a variant. Any method to extract this CLSID from the variant would be useful. I have attached the VI snippet shhowing the conversion to variant.

 

Thanks,

Ganesh Kumar

Download All
0 Kudos
Message 6 of 7
(3,188 Views)
Solution
Accepted by topic author Ganesh Sol

I believe jcarmody answered this on the LAVA forums.  Flatten your ActiveX reference to XML, then parse the XML.  The XML includes both the name and the GUID of the ActiveX object.

Message 7 of 7
(3,172 Views)