LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the type of numeric

Hi,

I would like to know how getting the type of a numeric data programmatically. (DBL, SDL, I16, I32,etc.)

This property is defined by selecting "Type of data" in the property's window of a numeric data; then by clicking on "representing".

I tried to find the solution by using a property node then accessing to the property called 'representing".

Without success, it seems this function is not available.

Is anyone would know the solution.

Thanks by advance,

pr93

0 Kudos
Message 1 of 3
(3,455 Views)

There are several solutions.

  • The 7.x version of the Flatten To String function had an additional output called "type string" which was actually an array of numbers. This array would tell you that information. OpenG has a VI that will tell you the datatype from this array. It's called "Get TDEnum From TD" and is in the LabVIEW Data Tools library. You can use VI Package Manager to easily install OpenG libraries.
  • If you have a control you could use a reference and then use the "Get Type of Control" VI from the <vi.lib>\Utility\GetType.llb library.
  • You could convert th"e numeric value to a variant and then use the "Get Type of Variant" VI from the <vi.lib>\Utility\GetType.llb library.
Message 2 of 3
(3,436 Views)

The Representation property of a control will also give you this information.  However, you need scripting enabled to use it.  It is not in the default set of properties.

0 Kudos
Message 3 of 3
(3,386 Views)