Jump to content

Converting data file from TDMS to TXT - time format and headers.


Recommended Posts

Posted

I have this .vi that converts the .TDMS to ASCII. However at the moment the time format is "00:00.000001    5.2041    0.2388    -0.0004    0.9106" for each line.

How can I make it in seconds in scientific format so the data will show as "1e-6    5.2041    0.2388    -0.0004    0.9106"?

Also how can the headers be added into the ASCII file?

to_Asci_2.vi

Posted
7 minutes ago, Francois Normandin said:

@sts123 You can explore the String palette where you will find an array of string formatting nodes. 

The simplest for you is to replace the date/time string with Format into string, and configure for scientific number.

image.png.5dbc6312918e1403b76292e367c6c3f5.png

I tired using Format into string, but then the result text file includes time stamp 4 times for each line of data, instead of doing just once.  

Posted

Use Get Waveform Attribute (Waveform>>Get Attribute) to read the NI_ChannelName string attribute from each waveform. Add another loop before the first one where you get it from each waveform and then write it to the file.

DAQmx creates that attribute automatically. This is what Waveform Graphs use for plot names.

Posted
7 hours ago, cordm said:

Use Get Waveform Attribute (Waveform>>Get Attribute) to read the NI_ChannelName string attribute from each waveform. Add another loop before the first one where you get it from each waveform and then write it to the file.

DAQmx creates that attribute automatically. This is what Waveform Graphs use for plot names.

It does not throw the names as expected.

to_Asci_3_range_2.vi

Posted (edited)

snip_wfm_channel_name.png.d613eb368eac170b650cbfd968f2ff57.png

right-click the node, select "help" and read the manual, please

why use a while loop? use an auto-indexing for loop!

Edited by cordm

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.