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.

PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I convert on HDF file from HWS file?

how can I convert on HDF file from HWS file?
0 Kudos
Message 1 of 18
(4,672 Views)
NI-HWS files are HDF5 files.  No conversion is necessary.  The internal structure is based on the SCPI-DIF to avoid as many data copies as possible, but is a bit complex as a result.  You can browse the structure use HDF-VIEW, available from the NCSA website.  Unfortunately, our spec is over 40 pages long and barely good enough for internal use, so we have never released it.  If you let us know what you would like to extract, we would be happy to tell you where it is in the file.
0 Kudos
Message 2 of 18
(4,667 Views)
I really want to transform a file HDF to JPG file through the tool hdf2jpg, and I have right now is a file HWS, if I use as infile a file HWS an error occurs. How can I do?

Thanks

0 Kudos
Message 3 of 18
(4,670 Views)
NI-HWS files do not contain HDF raster images, so direct conversion to a JPEG file using hdf2jpg is not possible.  NI-HWS is used for waveform storage only (1D data arrays).  However, if you want a JPEG image of the graph, you have several options:
  1. Read the NI-HWS file using HDF-VIEW and take a screenshot of the graph.
  2. Write a LabVIEW application to read the data, plot it, and export the graph image as a JPEG.  This could be made into an application so it can be called from the command line or you can launch LabVIEW and run the VI from the command line.
  3. Write a MeasurementStudio application to read the file, create a graph, and export as a JPEG.
I am sure you can think of other options.  If you need help with any of these options, let us know.

One last note.  JPEG is a lossy format designed for photos.  For line drawings, such as a graph, you will get better quality and about the same size by using the PNG format (also fully supported by LabVIEW and most other drawing/office applications).  PNG is a lossless format, so the output is much crisper.  JPEGs of graphs end up with "halo"s around all the edges due to the lossy compression.
0 Kudos
Message 4 of 18
(4,665 Views)

DFGray:

 

Hi I am attempting to import a datafile generated with Modelsim in VCD format to the NI HWS format.  Once it is converted to HWS we cannot see exactly how the data is arranged in the binary ... I tried opening up the HWS file with the freeware HDFView:

 

http://www.hdfgroup.org/products/java/release/download.html

 

and I can view the data vectors and properties now ... but it isn't clear what the meaning is of each section is.  Is there timing information stored?  Does any of this info control sampling trigger settings in the PXI card?  We are using a 6555 DIO card with a PXI chassis.

 

Thanks.

 

Ed

 

0 Kudos
Message 5 of 18
(3,863 Views)

NI-HWS can contain all sorts of timing and triggering information - or none - depending upon how it is written. It is unclear from your post how you are getting from VCD to HWS, so what the file contains could be highly variable. Can you give me more details of exactly how you are doing the conversion and what types of data you are converting?

0 Kudos
Message 6 of 18
(3,857 Views)

Sure, thanks for responding.  We are using the NI Digital Waveform Editor tool that can import a VCD file that is created by Modelsim.

 

0 Kudos
Message 7 of 18
(3,856 Views)

I would expect the NI-HWS file to contain the timing info needed to run the DIO board. NI-HWS supports all features of the digital waveform editor, so if you can see it in the editor, it should be in the NI-HWS file. Digital waveforms are the most complex of the waveform types stored by NI-HWS due to their many options, so the file formatting is not simple. If you have a specific item(s) you need to verify in the file, I can tell you where to find it. Unfortunately, the NI-HWS spec was never put into a publishable form, so I cannot post it.

 

Note that if you are using the NI-HWS file to drive your 6555 directly, the timing information is not used by default. If you are using niHSDIO Write Named Waveform VI, set the Use rate from waveform (no:F) input to TRUE to use the file timing info.

0 Kudos
Message 8 of 18
(3,847 Views)

Well by opening up the HWS file with HDFView, it contains the below structure.  In the axis0 properties (time axis) there is a field called increment that is the sampling rate I used (5 nanoseconds).  But I do NOT see any additional info in terms of triggering modes or delays, etc.

 

 

wfm_group0

axes

axis0

axis1

data_vector

data (here is our data, I verified it is correct)

id

traces

trace0 (we don't care about this, I think)

vectors

vector0

data (not sure what the difference is between this and axis1

 

 

 

wfm_group0 (1576, 2)
    Group size = 4
    Number of attributes = 5
        major_version = 2
        minor_version = 0
        release_version = 6
        type = NI-Waveform
        writer = NI-HWS

 

 

axis0 (7424, 2)
    Group size = 0
    Number of attributes = 5
        implicit? = 1
        increment = 5.0E-9
        numDigits = 57
        ref_time = 0
        start = 0.0

 

0 Kudos
Message 9 of 18
(3,844 Views)

NI-HWS is arranged in a flexible format that minimizes data copies. This is done by grouping data into three categories - vectors, axes, and traces (id is simply that, an identifier for the waveform group). Starting with the low level, your actual data is in the vectors (vector0 in your case). Axes are the X and Y data (axes) of a data set. In your case, axis0 will contain the timing and triggering (the X axis) while axis1 will contain the Y data (the digital waveform). Axes can be implicit (formula based) or explicit (data based). Usually, the X axis is implicit and the Y axis is explicit. Implicit axes contain the information needed to generate their data as an array of coefficients to an equation. There are around twenty equations supported (to support the digital and analog waveform editors), but your axis0 is almost certainly a simply polynomial with two coefficients (a line). Axes are combined together in the traces. You have a single trace0 which should point back to axis0 and axis1. This is done to allow multiple use of axes, such as the X data from a multi-trace oscilloscope.

 

This is all information from a very old memory. If you need something more specific, let me know and I will dig up the spec so I can get it to you.

0 Kudos
Message 10 of 18
(3,824 Views)