Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Waves in FPGA

My cRio has a base clock of 40 MHz. I'm trying to produce a 500Hz wave (so 500 periods per second) using the sine wave generator in the FPGA. Since the Sine Wave Generator VI frequency control input only accepts frequency input in periods/tick, I divide 500Hz with the 40 MHz to get the correct input. Then I input this and plot the output of the generator, as shown below. But here, there's 4 periods in 197 seconds, so 0.02 periods per second. What am I doing wrong, or my understanding is wrong?

 

EDIT: now I realize the x-axis is not actually time, but rather data points. I'm running the VI inside a timed loop; so I figure if I know the amount of data points that is generated per loop iteration I can find how many data points are there in a second. So I can translate data points to seconds and verify that the output is indeed 500 Hz. How can I find how many data points per loop iteration, because I know how long does one loop take?

2.png1.png

0 Kudos
Message 1 of 1
(2,062 Views)