LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Measure Sample Rate (S/s) in LabView FPGA?

Solved!
Go to solution

Hi

 

I am trying to figure out how to measure the Sample Rate (S/s) at which I read from an analog input in LabVIEW FPGA. I know the sample rate is specified in the data sheet of the AI module, but I want to measure it in LabVIEW.

 

Any suggestions?


A screenshot of an example code would be greatly appreciated

0 Kudos
Message 1 of 7
(4,422 Views)
Subtracting the previous tick count from the current tick count should do the trick.
Matt J | National Instruments | CLA
Message 2 of 7
(4,382 Views)

Wouldn't that give me the loop time in stead?

 

I'm looking for a measurement of the number of samples obtained per second (S/s) from a given analog input channel

0 Kudos
Message 3 of 7
(4,372 Views)
Hi phg,

So once you know the time it should be easy to count the samples and divide both numbers...

When you set a loop timing you should know the sample rate already!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(4,353 Views)

Hi GerdW

 

Thanks, I guess that is what I wanted to ask:

 

How can I count all samples that is output from the I/O node within a given period of time?

0 Kudos
Message 5 of 7
(4,335 Views)
Solution
Accepted by topic author ghp_1

Hey phg,

 

if you have a while loopand in this loop you output one sample per loop iteration via an I/O node. You cannot output two samples over the same I/O node in one iteration, it is always one!

 

So if your loop takes 1 second to execute you have an output sample rate of 1Hz. It is the same for input sampling. How long your loop takes to execute can be calculated as explained above.

 

Samplerate [S/s] = 1 / Loop time [s]

Message 6 of 7
(4,309 Views)

I finally understood, thanks all

0 Kudos
Message 7 of 7
(4,293 Views)