How Do I Get the Data Type of Elements in a Cluster?

Updated Jul 30, 2020

Reported In

Software

  • LabVIEW

Issue Details

I have a cluster and I need to know what is the type of each element in the cluster programmatically, how can I do that?

Solution

To know the type of elements in a cluster, we can base on the Type Descriptor of the elements in the cluster. We can see how to get the Type descriptor programmatically in the next picture:


Once we have the Type Descriptor we will know what kind of data is in our cluster using the next table:

 
Data TypeType Descriptor (numbers in hexadecimal)
8-bit Integer0004 xx01
16-bit Integer0004 xx02
32-bit Integer0004 xx03
64-bit Integer0004 xx04
Unsigned 8-bit Integer0004 xx05
Unsigned 16-bit Integer0004 xx06
Unsigned 32-bit Integer0004 xx07
Unsigned 64-bit Integer0004 xx08
Single-Precision, Floating-Point Number0004 xx09
Double-Precision, Floating-Point Number0004 xx0A
Extended-Precision, Floating-Point Number0004 xx0B
Complex Single-Precision, Floating-Point Number0004 xx0C
Complex Double-Precision, Floating-Point Number0004 xx0D
Complex Extended-Precision, Floating-Point Number0004 xx0E
Enumerated 8-bit Integer<nn>xx15 <k><k pstrs>
Enumerated 16-bit Integer<nn>xx16 <k><k pstrs>
Enumerated 32-bit Integer<nn>xx17 <k><k pstrs>
Single-Precision Physical Quantity<nn>xx19 <k><k base-exp>
Double-Precision Physical Quantity<nn>xx1A <k><k base-exp>
Extended-Precision Physical Quantity<nn>xx1B <k><k base-exp>
Complex Single-Precision Physical Quantity<nn>xx1C <k><k base-exp>
Complex Double-Precision Physical Quantity<nn>xx1D <k><k base-exp>
Complex Extended-Precision Physical Quantity<nn>xx1E <k><k base-exp>
Boolean0004 xx21
String0008 xx30 <dim>
Path0008 xx32 <dim>
Picture0008 xx33 <dim>
Array<nn>xx40 <k dims><element type descriptor>
Cluster<nn>xx50 <k elems><element type descriptors>
Waveform<nn>xx54 <waveform type><element type descriptors>
Refnum<nn> <refnum type code>
Variant<nn>xx53

If you want to know more about LabVIEW Type descriptors please check Related Links section