LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing time to milliseconds

Solved!
Go to solution

Hello all, I have a VI that records signal data and writes it to a file. As it currently stands, the time column displays in a date and time format, is there a way to get the time column to be recorded in milliseconds instead? Thank you.

0 Kudos
Message 1 of 15
(1,373 Views)

Hi svazquez,

 


@svazquez22 wrote:

I have a VI that records signal data and writes it to a file. As it currently stands, the time column displays in a date and time format,


This is because you use an ExpressVI to save your data: they are easy to use and limited in their options…

 

Suggestion:

Read the samples as an array of waveforms and save the waveforms. So you get the t0/dtinformation for free!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(1,358 Views)

It seems like changing the DAQmx read to 1D Wfm displays the timing properly on the graph. I tried using the Export Waveforms To Spreadsheet file block and ran into issues with the column formatting, also the timing appears to still be exported as a date and time. I have included my vi and a screenshot of the data output.

Download All
0 Kudos
Message 3 of 15
(1,279 Views)

Hi svazquez,

 


@svazquez22 wrote:

the timing appears to still be exported as a date and time. I have included my vi and a screenshot of the data output.


Thanks for VI and screenshots…

 

See these suggestions:

GerdW_0-1675450608060.png

Here you see two ways of creating an array of relative timestamps from measurement data. (The orange wire in the lower example comes from the sample rate constant…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(1,274 Views)

Ok thank you, but my excel file is still formatting everything into one column, how do I prevent that from happening? Also I want to note I am trying to write to a .csv file.

0 Kudos
Message 5 of 15
(1,264 Views)

You can ignore my last post as I figured out how to separate the data into separate columns, but again, the time is not displaying how I would like in my file. Once again, I have included a screenshot and my vi, sorry if the last thing you posted explains how to fix my time display issue.

Download All
0 Kudos
Message 6 of 15
(1,246 Views)
Solution
Accepted by svazquez22

Hi svazquez,

 


@svazquez22 wrote:

sorry if the last thing you posted explains how to fix my time display issue.


Next suggestion:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 15
(1,228 Views)

I'm assuming the idea is to create a new time column and then write it into a new spreadsheet. However, when I tried using your method I got an error. I did some searching online and it might have to do with the fact I am taking a finite number of samples.

Download All
0 Kudos
Message 8 of 15
(1,177 Views)

Hi svazquez,

 


@svazquez22 wrote:

I did some searching online and it might have to do with the fact I am taking a finite number of samples.


The error comes because you are trying to read the samples TWICE from your task. Why do you do this?

 

Read once, format the data as you need and write once to a file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(1,165 Views)

Ok I believe that the time is displaying how I would like it now, but my data is now being written incorrectly. I would like the data separated by columns and not rows. Like I had in previous results I got. I have included a screenshot of what I have and of my desired format. I appreciate all of your help up to now!

Download All
0 Kudos
Message 10 of 15
(1,159 Views)