sts123 Posted June 18 Report Posted June 18 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.viFetching info... Quote
Francois Normandin Posted June 18 Report Posted June 18 @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. Quote
sts123 Posted June 18 Author Report Posted June 18 On 6/18/2025 at 2:55 PM, 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. Expand 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. Quote
cordm Posted June 18 Report Posted June 18 If the time appears for each channel, then you didn't set the loop tunnel mode to last value. Quote
sts123 Posted June 20 Author Report Posted June 20 Not sure what that is. Can you please guide me? Quote
cordm Posted June 25 Report Posted June 25 First search result for "labview loop tunnel mode": Auto-Indexing Tunnels with For Loops and While Loops in LabVIEW In your case: Quote
sts123 Posted June 26 Author Report Posted June 26 On 6/25/2025 at 6:24 AM, cordm said: First search result for "labview loop tunnel mode": Auto-Indexing Tunnels with For Loops and While Loops in LabVIEW In your case: Expand This worked as intended. Many thanks. Quote
sts123 Posted June 26 Author Report Posted June 26 Any thoughts how can I add header to the file, that are the same name as channels names in the Task? Quote
cordm Posted June 27 Report Posted June 27 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. Quote
sts123 Posted June 27 Author Report Posted June 27 On 6/27/2025 at 6:31 AM, 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. Expand It does not throw the names as expected. to_Asci_3_range_2.viFetching info... Quote
cordm Posted June 27 Report Posted June 27 (edited) right-click the node, select "help" and read the manual, please why use a while loop? use an auto-indexing for loop! Edited June 27 by cordm Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.