LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data at a slower rate than I want my VI to run at?

Good morning everyone.

 

I have a VI that scans hardware for data. I need this process to run at around 0.1 to 1KHz. I only want to store this data at a rate of 1Hz though.

I can't figure out how I can get my data into the .txt file at a rate of only 1Hz without slowing down my whole VI to 1Hz.


I have attached an example of what I'm trying to do. I am using random number generators in lieu of my data acquisition code to simplify things a bit.

 

Thanks!

 

Download All
0 Kudos
Message 1 of 11
(3,182 Views)

Hi lavid,

 

you could decimate your data to 1 Hz!

 

When you get data at 1kS/s you would get the mean of 1000 samples (or just pick one sample out of 1000) for saving…

Best regards,
GerdW


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

Hi GerdW 🙂

I am saving my data in a string into a txt file. The decimator doesn't work on the date and time I want to be saved with each row of data unfortunately.

 

Hmmmm

 

0 Kudos
Message 3 of 11
(3,149 Views)

Hi lavid,

 

one note: you can decimate before converting to string…

Best regards,
GerdW


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

Right, but then my data is decimated and my date and time string still saves at 1kHz and my .txt data file gets all discombobulated :I

0 Kudos
Message 5 of 11
(3,112 Views)

Obviously you decimate the date/time as well.

0 Kudos
Message 6 of 11
(3,110 Views)

I thought I couldn't decimate a string...?

0 Kudos
Message 7 of 11
(3,106 Views)

Like GerdW said, you can decimate before converting to a string, or if you have an array of strings you can decimate that array.

0 Kudos
Message 8 of 11
(3,099 Views)

Hmm... Lets see you want high speed data acquisition and low speed data recording.

 

Isn't that by definition a Producer Consumer architecture?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 11
(3,095 Views)

I'm not certain I understand why you are having such difficulty with the idea of decimation.  Does this Snippet make sense to you?

Decimate.png

Bob Schor

Message 10 of 11
(3,067 Views)