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.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition on NI sbRIO 9636

Solved!
Go to solution

 

 

Hello! I am working on my faculty project and I have to do acquisition on NI sbRIO-9636. How can I choose sampling period of acquisition? I am working according to an example on NI website below:

 

http://www.ni.com/tutorial/4534/en/

I can't figure it out which sampling period should I put in Host.vi and which in Target.vi in order to have proper acquisition? For an example, I would like to have sampling period 10 milliseconds. How to configure loop-time in Host.vi and how in Target.vi?

 

Thank you

0 Kudos
Message 1 of 6
(5,117 Views)

Hi Chupka,

 

Essentially,  you are only going to have a sampling period on the target where you are acquiring the data.  This will be set by your loop time which is how fast you are polling you IO.  For the Host side, you just need to do some calculations to ensure that the loop time you are reading at and the number of samples you are reading per loop do no go so fast that you underflow and not so slow that you overflow your buffer.

 

Aaron L.
Applications Engineer
National Instruments
Message 2 of 6
(4,962 Views)

 

 

Hi Aaron!

 

Thank You for Yout reply.

 

Could you please help me with that calculations? Could you give me a very simple example? 

 

Here is my Target.vi. I put here 1000 Ticks in Count control.

odzivFPGA_ok1.PNG

Here is my Host.vi.

 

host_ok1.PNG

 

Like I am using only one element out of 100. And like other data 'arrives' late on the graph. I've put here 10 ms loop period.

 

Could You please explain me what happened and how to fix this?

 

Thank You

0 Kudos
Message 3 of 6
(4,950 Views)

Chupka,

 

The calculations really depend on how much data you want to pass and or how fast you want to pass it.  The first issue I can see with your data arriving late is because your timeout on the FIFO read is only 5ms but your loop wait is 10ms. so your data is always going to arrive late.  try adding a longer timeout to this and see if it helps get rid of that problem.

Aaron L.
Applications Engineer
National Instruments
Message 4 of 6
(4,907 Views)

 

 

Aaron,

 

Thank You for Your reply.

 

Okay, I will now suggest corrections on my LV Project. 

 

I have period of sampling that is 1000 ticks, which is 25 microseconds. I can acquire 400 samples in 10 milliseconds.

 

Can I put in Number of Elements 400 to take all data I acquire? And in Timeout... I suppose I should put time that is longer than Host loop rate (I suppose it can be equals to Host loop rate). 

 

Could You please anwer if I did calculations well?

 

Thank You

0 Kudos
Message 5 of 6
(4,895 Views)
Solution
Accepted by Chupka993

Chupka,

 

Yes, the sampling calculation does look correct Smiley Happy  This way you are getting all your data every loop, but you want to ensure you have a case to avoid having FIFO underflows if you are reading every data point.  As for the host loop,  you do want to ensure it is greater than the host loop so that if you experience jitter in your loops, you will not timeout.

Aaron L.
Applications Engineer
National Instruments
Message 6 of 6
(4,833 Views)