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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I prepare a waveform TDMS file to include x-axis name and unit

Solved!
Go to solution

I'm using DAQmx to stream a TDMS file to disk. When opening the file in DIAdem the x-axis shows up with "NoName" and no unit. Is there any TDMS property I can write in LabVIEW to set the x-axis name to "Time" and unit to "s" so they show up automatically when viewing the file in DIAdem?. 

 

- Tore

0 Kudos
Message 1 of 7
(5,216 Views)
Solution
Accepted by TJohnsen

Hey Tore!

 

The names of the TDMS channel properties you'll need to set are as follows:

 

wf_xname (which stands for Waveform X-Name)

wf_xunit_string (which stands for Waveform X-Unit)

 

Wire those as strings into the TDMS Set Property VI as the property name input, and populate the values acccordingly.

 

Let me know if you need additional help!

Derrick S.
Product Manager
NI DIAdem
National Instruments
Message 2 of 7
(5,214 Views)

Hey Derrick,

Works great! Thanks for the quick reply!

0 Kudos
Message 3 of 7
(5,205 Views)

Hi guys,

 

Can you explain more about this please? Maybe by giving a screenshot or something.

Somehow I couldnt understand how to name the x-axis in my VI.

This is what I did, but doesnt work on me; x-axis is still without name. And the value between x-min and x-max is also "random"?

 

TDMS error.png

 

Regards,

Yan.

0 Kudos
Message 4 of 7
(4,691 Views)

Hi Yan -

 

To the best of my knowledge, the TDMS File Viewer does not respect the wf_xname property.  DIAdem will, though, so you could view your data in DIAdem to see the X-Axis appropriately updated.

 

Even still, you have two bugs in your code:

 

  1. When you call the Set Properties VI, you have to provide a group name and a channel name input.  Otherwise, your property is being written to the file level, not the channel level.  You're trying to write the property of a channel.
  2. You're trying to set a property for a waveform, yet you're sending a numeric array to the file - not a waveform.  When you call the TDMS Write VI, you need to write a waveform, otherwise this property is meaningless.
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 5 of 7
(4,684 Views)

Hi Derrick, thanks for responding.



@DRock wrote:

Hi Yan -

 

To the best of my knowledge, the TDMS File Viewer does not respect the wf_xname property.  DIAdem will, though, so you could view your data in DIAdem to see the X-Axis appropriately updated.

 

*I dont get it, did you mean, I cant use any means to name my x-axis in File viewer? I've been searching, but didnt find anything helps. I'm not using DIAdem, just Labview 🙂

 

Even still, you have two bugs in your code:

When you call the Set Properties VI, you have to provide a group name and a channel name input.  Otherwise, your property is being written to the file level, not the channel level.  You're trying to write the property of a channel.

*hmm, so I should have put my Groupname and Channelname while calling Set Properties VI, then wire the ouput this VI into input write TDMS, right?

 

You're trying to set a property for a waveform, yet you're sending a numeric array to the file - not a waveform.  When you call the TDMS Write VI, you need to write a waveform, otherwise this property is meaningless.

*meaningless refer to wf_xname?


Regards,

Yan.

0 Kudos
Message 6 of 7
(4,679 Views)

Hi Yan,

 

Yes, this is what I meant.  The TDMS File Viewer is not meant to be a full-functional file-browser experience, and may sometimes be incomplete.  I do not think it uses the wf_xname property for display on the X-Axis.  If you want to build your own TDMS File Viewer, you can honor this property and display it as an X-Axis (or use your own custom property).

 

The Set Properties VI allows you to write properties to either the File, Group, or Channel level in the TDMS hierarchy.  If you wire no Group Name and no Channel Name, then the property you configure is written to the File level.  If you wire only a Group Name, the property you configure is written to the Group level.  If you wire a Group Name and a Channel Name, then the property is written to the Channel level.  Wf_xname is a channel-level property (representing the X-Name of a Waveform channel).

 

It is meaningless to write the wf_xname property unless the channel you're writing is a waveform.  In your code, you were wiring an orange wire (array of doubles) to the TDMS Write VI.  Numeric arrays are not waveforms, and therefore have no wf_xname property.  Since waveforms have implicit time values, you can specify the wf_xname property.

 

Waveform, Array.png

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 7 of 7
(4,663 Views)