Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Tick Count in myRIO FPGA software

Hi Forums,

 

Having worked with some myRIO and determined that Scan Engine style coding on the myRIO won't achieve high enough sampling rates for what I need, I'm now looking to recreate my code using the LabVIEW FPGA palette.

 

On the FPGA side of things, I was going to try to keep things pretty simple, but read from 4 AI channels and write an AO; therefore potentially able to read from AI at 125kS/s (as the device has a 500kS/s capability).

 

Therefore on my FPGA code, if I were to use the "Tick Count" FPGA block, what values could I configure the function to in order to achieve the best potential sampling rate that would be suitable for the device?

 

Best regards,

Tori
Student
0 Kudos
Message 1 of 2
(6,592 Views)

Hi Tori,

 

When talking about timing express vi's on an FPGA we've got 3 options: Loop Timer, Wait and Tick Count. 

 

You can use the Wait vi to force the code to wait for a specified time, which isn't what you're looking for in this case. The Tick Count is used to give a single value when called telling you the current value of an internal tick counter. This is best used for benchmarking the speed of your code, since each instance on the same Block Diagram references the same counter.

Finally there's the Loop Timer. This function is used to control loop execution rate - so as long as the code contained within the loop takes less time than is specified for this function, you know that each iteration will take exactly the same amount of time to execute. Based on your description this is the best suited function for what you're trying to achieve.

 

You can calculate the settings you'll need for the Loop Timer function based on the sample rate you want. For example, if you're aiming to read at 125kS/s, the period of aquisition per sample is 1/125000 = 0.000008s = 8us.

Therefore you could configure the Loop Timer to use usec as the units, and wire a value of 8 into the Count(usec) input.

 

I hope the above makes sense!

 

Regards,

Al C
National Instruments,
Application Engineer
0 Kudos
Message 2 of 2
(6,553 Views)