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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to include a sample time column in my stored data file

I have created a labVIEW program by combining 2 programs. I am logging my data into a file, the problem is i want also to inlcude a sample time column. How can I do that. I am attaching my Vi and a picture of what I am aiming to get in the end. Since I am new to labVIEW i have limited knowledge. Please help.

Download All
0 Kudos
Message 1 of 9
(2,865 Views)

Hi shivik,

 

just add another signal named "Time [s]" and calculate the needed values for this signal…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(2,860 Views)

Okay, can you give me an idea of how to do that, can you maybe add it to the VI

0 Kudos
Message 3 of 9
(2,834 Views)

Hi shivik,

 

can you give me an idea of how to do that,

Create a new array with the values you want to use as "Time" column. Basically it looks from your image above you want to have something like "sample number / sample rate"…

 

can you maybe add it to the VI

Your VI is already way too big, so I will not add anything to it!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(2,832 Views)

I have added the sample time column, bit there is still a problem. After the for loop runs the specified number of times in the while loop there is an abrupt change in the  sample time, can anyone tell me the cause of this and how to solve it?. I think the for loop needs to keep running for the number of values that will be indexed by the while loop. How can I solve this.

Download All
0 Kudos
Message 5 of 9
(2,809 Views)

Hi shivik,

 

why do you need to call another ExpressVI in this FOR loop?

Why not use simple functions like GetDateTimeInSeconds?

Or by creating a ramp:

check.png

(This is just a rough sketch. You need to adapt sample timing in the ramp and start time t0. You might also use waveforms for this task.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(2,802 Views)

That woulde be an soultion, but if my gps sensor is static(not moving) i would not work. Any other options with the express VI(I know it is not an good idea) but maybe compacter

0 Kudos
Message 7 of 9
(2,796 Views)

I tried the above solution, but now i got an emptuy time column

0 Kudos
Message 8 of 9
(2,791 Views)

Hi shivik,

 

when you make changes to your VI(s) you should attach them again…

Best regards,
GerdW


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