LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data sampling rate accuracy study

Dear all,

 

I make Labview program to record a temperature at 100 Hz sampling rate. "Iteration 1" input is 100 . 

I found that number of data per second recorded is 96~98 data only. Refer to column C and F in attached excel sheet.

By right, i have to get 100 data in 1 second.

Attached my project file for your study and improvement.

Please attached your improvement project file if you manage to solve the problem.

 

thank you very much.

best regards.

 

Download All
0 Kudos
Message 1 of 14
(2,576 Views)

I think you are discovering the difference between hardware timing that relies on a high-accuracy clock and software timing that relies on system clock through the Wait (ms) primitive. The help for the Wait (ms) primitive should give you cause for pause as it states: The actual wait time may be up to 1 ms shorter than the requested wait time. 'Shorter', 'longer' - it makes no real difference to me as it does not claim to be exact.

 

Hardware timing is more precise. In a real (data-driven) application where you need 100 Hz, acquire a waveform at 100 Hz, and let the hardware time your loop instead of inserting a Wait (ms) artificially.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 2 of 14
(2,521 Views)

Hi, Doug

 

Can you advice me the external hardware part number from NI.

 

Thank you very much.

Best Regards.

 

0 Kudos
Message 3 of 14
(2,507 Views)

The hardware would be the data acquisition device used to acquire real temperature data from temperature sensors (for example: thermocouples). Your question surprises me, so maybe I am missing something. Are you needing to eventually acquire data from a temperature sensor using a DAQmx device? some other device? or is this just a software exercise?

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 4 of 14
(2,497 Views)

Hi, Doug.

The hardware I refer to is how to get precise timer not the temperature.

I want to have accurate sampling rate by using external hardware devices. 

 

Best Regards. 

0 Kudos
Message 5 of 14
(2,491 Views)

Hi Jeffrey,

 


@Jeffrey_Oon wrote:

The hardware I refer to is how to get precise timer not the temperature.

I want to have accurate sampling rate by using external hardware devices. 


How "accurate" do you need that timing?

Even the cheap USB600x devices from NI provide a hardware-timed ADC. Read the specsheets for the timing accuracy numbers!

Best regards,
GerdW


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

Hi, Gerd,

My target for data sampling rate is up to 4k Hz.

Which NI hardware is suitable for me?

 

Thank you very much. 

0 Kudos
Message 7 of 14
(2,478 Views)

Hi Jeffrey,

 


@Jeffrey_Oon wrote:

Which NI hardware is suitable for me?


To answer this question you need to provide a lot more of information than just that "4kHz samplerate"!

Please collect ALL requirements - and then call your local NI sales support!

 

(Even the cheapest USB6008 could sample at more than 4kS/s…)

Best regards,
GerdW


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

Hi, Gerd,

Thank you very much.

Best Regards 

0 Kudos
Message 9 of 14
(2,454 Views)

To reiterate (hopefully before you buy the first thing mentioned), the device you use/buy will depend on what you need to do with it.

For example, RTDs may have different connections to thermocouples (with/without additional amplication) to a function generator with a nice, buffered voltage output.

 

It's important to consider what you want to measure, what other hardware you plan on using (e.g. a "sense" resistor for ratiometric measurements with RTDs), the output of your sensors (uncommon for temperature, but for encoders pull-up/down is quite common, and could require different acquisition hardware or choices, or additional bits and pieces), along with more straightforward requirements like "accuracy" or sample rate.


GCentral
0 Kudos
Message 10 of 14
(2,426 Views)