LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lvhdf5 with dynamical datatype/labels

Hello,

 

I'm a LabView Newbie and a have hopefully fairly easy question:

 

I want to export data of measurements to HDF5 using the lvhdf5 library. A typical wiring-graph of this task is shown below:

Here the data from GenData is bundled as an array of clustered and typecasted with a cluster of variables with specific labels. These labels will then be used as column names in the compound dataset of the hdf5 file.

 

However I want the user to dynamically choose how many columns (e.g. which/how many measurement device) are recorded in each measurment. That means that Gen Data will produce an array of clusters with dynamic length. Then however I run into problems when typecasting the cluster, because i can not dynamically produce the cluster of the description variables (Here 'Index', 'Time' etc). Also, the labels can not be changed by the user during runtime, as variable labels are fixed (and captions are not used by lvhdf5 library as far as i know).

 

What I'ld like to have is a graphical input table, where the user can enter the column names and then build this cluster with the correct labels for the type cast dynamically. Is there a way to do this? Can you create variables with specific labels and maybe also specific data type during runtime?

 

Thanks a lot in advance,

Philipp

0 Kudos
Message 1 of 2
(2,338 Views)

Hi Philipp,

 

A cluster is a data type. Part of this Data type is:

- The label of the cluster (this is similar to the declaration of a variable in c, c#, vb & others)

- The number of elements

- The order of the elements

- The labels of the elements

- The datatype of the elements

 

A data type cannot be changed during runtime. You only can convert the data to a new data type, this is what type cast does. For this, the new data type has to be existing. Because of that, you will have to predefine each possible case - then you can let the user choose. For this, use a case structure or a polymorphic VI. But: In each case you will have to predefine the data type.

 

Have a nice day,

 

Stefan

NI Germany Application Engineer

0 Kudos
Message 2 of 2
(2,317 Views)