LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading HDF5 files

Hello,

 

I am trying to read the HDF5 file attached to this post using the LabVIEW blocks written by Jason S.

 

I can manage to read the 'Simulation time' section of the data set but not the 'Signal' it keeps giving a conversion error from source to destination.

 

I have attached the VI called main which is the closest to reading anything from the HDF5 file if the 'Signal' element is removed out of the cluster.

 

I can read the file fine using HDFView program and using code within Matlab, however I need to use LabVIEW as a license for Matlab is much more expensive.

 

Can anyone advise what I am doing wrong?

 

Regards

 

Tom Horsfall

Download All
0 Kudos
Message 1 of 6
(3,211 Views)

I don't have Jason's code installed, but looking at your code, and given your error, it appears you are setting up your datatype incorrectly.  The dataspace is a simple unlimited 1D array.  The datatype is a compound datatype composed of a 64-bit float and a 32-bit float.  However, it appears from HDFView that the first element is a 1D array with one element and the second is a 2D array with one element (second signal set is different).  It does not appear you are creating this datatype and properly using it to fetch your data.  This would cause your conversion problem.

 

Hopefully this helps.  I have not really used HDF5 in several years, so take my advice with a grain of salt.

0 Kudos
Message 2 of 6
(3,207 Views)

Hi DFGray,

 

I will try using a 2D array compound today and see if that fixes the problem.

 

I have been through different types for this variable before and have struggled to read it.

 

Will keep you posted

 

Tom

0 Kudos
Message 3 of 6
(3,180 Views)

I have tried many different combinations of data type into the block and am having no success with reading the file.

I have even tried mimicing the process that works in matlab within LabVIEW with no success.

 

Any other thoughts?

 

Regards

 

Tom

0 Kudos
Message 4 of 6
(3,160 Views)

Hello Tom,

s. the attached vi.

 

Best Regards.

 

0 Kudos
Message 5 of 6
(2,856 Views)

This is better.

0 Kudos
Message 6 of 6
(2,833 Views)