LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Error Clusters

Is there a way to identify Error Clusters?

The only thing I've come with so far is get a Ref to all Controls, cast to Cluster, get Refs to all Cluster Controls and look to see if there's a boolean, numeric and a string and nothing else. Of course I can look at all the labels and make sure they are what they should be. But in what I'm doing the cluster name may not be "Error In" or "Error Out".

I thought maybe they would be tied back to the error controls in the ...vi.lib/errorclust.llb, but they are not type defs. But they are not type defs so I can't use that property.

I also looked at the BasicObjectFlags property, but if you build an error cluster with the same settings as the built in ones, that comes back the same.

I'm thinking I'm going to have to settle for "sure enough" based on the fact that it is a cluster and the label names. But if there a better way...

Thanks

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 5
(4,616 Views)

NI does this by parsing the typedescriptor to be of a cluster with three elements, being an boolean, int32, and string in that order. When you select Flatten To String and select the Convert 7.x option you still get the old style typedescriptor that can be used for such things. the parsing of the typedescriptor is a little complicated but basically you only want to see that the lower byte of the second word in there is 0x50, then 3, and then 3 times the typedescriptor for the individual elements. Take a look at the OpenG Variants tools how they are doing that for typedescriptor parsing.

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(3,341 Views)

Rather than parsing type descriptors you can extract the information from the variant returned by the value property. Somewhere in vi.lib there are a folder of "VariantType" vis (in a support or utlity sub directory of vi.lib from memory) - these provide all the tools you need to work out whether a variant is a cluster of boolean, numeric, string.

--
Gavin Burnell
Condensed Matter Physics Group, University of Leeds, UK
http://www.stoner.leeds.ac.uk/
0 Kudos
Message 3 of 5
(3,341 Views)

As Rolf said, an error cluster is defined internally as a cluster containing a boolean, an I32, and a string, in that order.  Names and labels do not matter (or there would be localization issues).

You can find the type tools in <vi.lib>\Utility\VariantDataType.  I would recommend you use these, since they were created for this type of issue.  You also do not need scripting to use them.

You can also find type information using the Class ID and Class Name properties.  Class Name properties have been known to change, but Classs IDs have not and should not.  I usually use Class Name only to find generic, top-level information (e.g. search for Constant in the Class Name to find constants).

0 Kudos
Message 4 of 5
(3,341 Views)

Thanks Guys,

This should give me enough to figure it out.

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(3,341 Views)