LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating sine wave on LabView FPGA

Hi everyone,

 

I am using a Sine Wave Generator to generate sine wave using LabView FPGA with the program and settings shown in the figure attached. I know there are a number of posts about this and I followed the instructions in this one: https://forums.ni.com/t5/LabVIEW/Generate-a-sine-with-LabView-FPGA-and-connect-it-to-an-AOModule/td-...

 

However, as you can see, the sine wave in the Waveform Chart is still gibberish, and I would really appreciate if you can provide me with any help. I am using NI cRIO-9082.

 

Thank you very much!

0 Kudos
Message 1 of 5
(3,696 Views)

Here's the image embedded (because you didn't):

sine_wave_fpga

 

What's the value of count us?

 

You seem to be generating a 100 kHz sine, and if count is 1000 us, you'd only be able to generate decent from .5 kHz and lower.

 

If you want a 100 kHz sine, you'd need 1 us wait (or less).

 

Never mind that.

0 Kudos
Message 2 of 5
(3,665 Views)

Thank you very much for your reply. I am using a 1 us wait time, but the waveform is still non-sinusoidal. Do you have any suggestions?

 

Thanks.

0 Kudos
Message 3 of 5
(3,653 Views)

@JustinZZJ wrote:

Thank you very much for your reply. I am using a 1 us wait time, but the waveform is still non-sinusoidal. Do you have any suggestions?

 

Thanks.


Not really. I don't have an FPGA available right now.

 

I'd experiment until I encounter something that makes sense. Like a very low frequency. Double, triple check the wait. It seems the only suspect. Did the example have the wait? It seems the sine generator is expecting a different timing.

 

Are you running compiled code? It almost seems like you're running in simulation, although I have no idea what the result would be.

0 Kudos
Message 4 of 5
(3,616 Views)

Making the assumption you're using a 40 MHz base clock. Your problem may come from the fact that the sine generator VI wanting to control the while loop timing, and conflicting with the 1-us tick out VI in the first sequence pane.  

Try removing the timing VI in that first pane, and put some timers in the loop to see what frequency that loop counter increments at.   That will tell you 1) what sampling rates you're generating sine points at and 2) what frequency is the sine-wave.

 

0 Kudos
Message 5 of 5
(3,605 Views)