Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

can Save to Ascii function be modified so that DAQ data points have (dd/mm/year HH:MM:SS.fff) time stamp format?

Hi everyone, I recently posted the following post 

 

How to save acquired data from USB 6009 into ASCII file with system date format (dd/mm/year HH:MM:SS.FFF) for each data point per segment.

 

Since I haven't gotten any response for it yet, I wanted to find out if the Save to Ascii function can be modified so the DAQ data points from USB 6009 can be saved to a txt file with the time stamp in the following system date format - dd/mm/year HH:MM:SS.fff, instead of the default which is in seconds. I welcome any ideas or suggestions. Thank you in advance everyone.

 

Kumar

 

P.S: I need the data in ascii format so I can export it into MATLAB to create data plots.

0 Kudos
Message 1 of 4
(6,552 Views)

Hi Kumar,

 

Here is a sample of one way you can try executing this operation.  Basically, it takes a waveform and generates a timestamp in the format you want to use for each data point in the waveform.  The vi at the top is the Format Date/Time String which would probably need to replace the Get Date/Time String vi being used in the for loop currently.  This program will generate a timestamp, but not in the format you are looking for exactly.  Hopefully this can get you started in the right direction:

 

Notes:  First portion is just to generate random waveform for testing.  Waveform is then parsed for components and the size of the array is sampled to drive how many iterations the for loop iterates.  The output is the calculated timestamp from the waveform in a string array.  That is concatenated with the data values and then is sent to the array indicator.

 

20787i3591B97E8F9B0390

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 4
(6,539 Views)

 


P.S: I need the data in ascii format so I can export it into MATLAB to create data plots.


 

How about creating your data plots in LabVIEW?  Is there something that you are having trouble with in LabVIEW as far as viewing your data?

 

-Alan

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

I also created an example that would do this, a little more robust.

 

LabVIEW has a VI called Export Waveforms to Spreadsheet File which, as the name implies, allows you to save your waveforms to a file easily.  However, by default it doesn't allow you to define the time string format.  I changed that.

 

I modified the default VI, and a subVI in it, Waveform Time to Date Time String.vi so now the time format string parameter is passed up to the user level.

 

Check out the community example: Export Waveform to Spreadsheet File with Custom Time Format String

Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 4 of 4
(6,461 Views)