LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i reduce the sample rate of a task

Hi all. very new to Labview so please excuse me if this is a simple question.

 

I have an NI-9237 which has a minimal sample rate much higher than I can use for the test I have designed.

 

I would like to be able to control the sample frequency in the range of 100 samples per second down to 1 sample per 60 seconds. The reason for this is that I need to be able to run the test for several days. I have been using the "Strain - Continuous Input.vi" as the backbone of my program and have had no luck in trying to change the sample rate. 

 

On the forums there have been posts regarding methods of resampling but I can not figure out how to get the task/TDMS file to record a modified signal.

 

Any help would be greatly appreciated.

 

0 Kudos
Message 1 of 10
(6,181 Views)

Downsampling is essentially just combining a whole bunch of points that you have too many of down to a smaller set. So if you want to go from 1Hz to 1/60Hz, you would take 60 data points and average them (or however you want to combine them) down to one point.

 

With respect to your VI, there is a Sample Rate input. Have you played with this? I think your device can probably only go as low as 0.1Hz, so you would have to do some downsampling to get 1 data point per minute.

 

Your task won't record a modified signal, the downsampling is done by your code after you read in the values. This might help.

 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 10
(6,176 Views)
You could also simply use the 1Samp option for the DAQmx Read with a Wait (ms) or Time Delay function to control the timing. There will be some jitter but with 1 sample pet minute, I can't imagine that you would be concerned about that.
0 Kudos
Message 3 of 10
(6,158 Views)

Thanks for your response.

 

Unfortunately it seems the NI-9237 is limited to a minimum of 1.613kHz Sample Rate, which I find very frustrating. I have tried forcing it lower with the sample rate input but it will maintain 1.6129kHz. The downsampling example you guided me to works somewhat, which I hope I can make do in a pinch. So far I can't get it to continuously log lower than 10Hz (while a significant improvement I still don't understand why that is the limit), maybe if I put two in sequence?

 

Adding in a wait function does not seem to work. The recorded array data seems to act erratically; the samples either keep the high frequency sampling rate or don't log at all. 

 

Thank you again for your help!

0 Kudos
Message 4 of 10
(6,057 Views)
The wait will certainly work. You are obviously doing something wrong but you have not posted your code so someone can see.
0 Kudos
Message 5 of 10
(6,044 Views)

Hi Sunkistlist,

 

Unfortunately it seems the NI-9237 is limited to a minimum of 1.613kHz Sample Rate, which I find very frustrating.

Well, you could have read the manual before using this module, it's all described in there…

 

To have 100S/s you need to decimate by a factor of 16.

To get from 100S/s to 1/60S/s you need to decimate by a factor of 6000, but I would use two steps (down to 1S/s, then 1S/min) for display reasons…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(5,979 Views)