From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 10/05/2009

Now that VI Scripting is available, I thought it would be handy to write a nugget about the VariantDataType VIs.  In LabVIEW 8.0 and later, there is a set of VIs in vi.lib/utility/VariantDataType that are immensely helpful when writing code that involves parsing LabVIEW data types.  There's too much in there for me to describe in a single nugget, so I encourage you to explore the VIs, and keep in mind these tips:

 

  • You will usually use these VIs in conjunction with the Data Type property of the Terminal class.  GetTypeInfo.vi is the best place to get started, as it is the VI that will return an enum describing the data type you wired in to the VI.
  • A few of the data types listed in the type enum used by these VIs are internal LabVIEW types that you should never encounter in a VI diagram.
  • The more recent your LabVIEW version, the more useful stuff you'll find in the VariantDataType folder (like the Check for Contained Data Type.vi I added in LabVIEW 8.6).
  • If you are using LabVIEW 7.x, a similar set of utilities resides in vi.lib/utility/GetType.llb.  These VIs parse I16 array type descriptors, which were deprecated in LabVIEW 8.0 in favor of Variant-based type descriptors.

 

Most of the VIs in this folder have Context Help that describe their functionality.  The "Get" VIs are probably going to be the most helpful for you since they are useful for obtaining information about existing data types.  There are also some "Set" VIs that might be useful for more advanced applications that involve changing certain characteristics of certain data types.

Message 1 of 7
(8,461 Views)
Nice tip. I've already used started using the "GetNumericInfo" VI  because of this tip.
CLED (2016)
0 Kudos
Message 2 of 7
(8,432 Views)

I am sorry but I cant't access you blog(http://labviewartisan.blogspot.com/.

0 Kudos
Message 3 of 7
(8,389 Views)

tom.huo wrote:

I am sorry but I cant't access you blog(http://labviewartisan.blogspot.com/.


I'm not sure why...I think some employers block access to certain domains...blogspot.com might be one of them?

0 Kudos
Message 4 of 7
(8,302 Views)

Darren wrote:
I think some employers block access to certain domains...blogspot.com might be one of them?

Very much, yes! Smiley Mad

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 5 of 7
(8,226 Views)

I started playing around with these in LV 7.1, very useful so far (I want to convert a cluster to a spreadsheet string).

 

I found some 'bug':

When I use a timestamp, it say 'Waveform (Measurement Data)', the same goes for Analog Waveform (as expected).

Is this still the case for 2009?

 

Felix 

0 Kudos
Message 6 of 7
(8,202 Views)

F. Schubert wrote:

 

I found some 'bug':

When I use a timestamp, it say 'Waveform (Measurement Data)', the same goes for Analog Waveform (as expected).

Is this still the case for 2009?


In LabVIEW 7.x, the Measure Data (waveform) type includes both waveforms and timestamps.  In LabVIEW 8.0 and later, there are different entries in the enum for them:  Waveform and Timestamp.

Message 7 of 7
(8,156 Views)