From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Sine wave on analog port of myRIO

Hi,

 

I want to generate a sine wave of a known frequency and amplitude on analogue out (ConnectorA/AO0) of myRIO.

 

Any ideas how to do that? I have tried looking at example codes in the forum but nothing has worked for me so far.

 

Best Regards,

Mubeen Haadi.

0 Kudos
Message 1 of 28
(7,089 Views)

There are a couple of approaches we can take for this task. There is an example VI included in the NI Example Finder named "Customized FPGA Signal Generator" that will allow you to do this without having to add anything to the code. Additionally, you can use the "Ex_Inst_Simulate Signal" Express VI to configure and generate analog output signals.

Message 2 of 28
(7,057 Views)

Hi, thank you for diracting me to that example. that is really good example code and now I am understanding how the signal generation is working. I was wondering though what is the highest frequency that can be generated?

can you give me another "hint" on how I can generate and read a sine wave simultaneously ?

0 Kudos
Message 3 of 28
(7,045 Views)

The highest frequency will be dependent on a few things: if you're running the code on your PC it will be based on your computer's timing, if it is running on the FPGA, what else is running on the FPGA, or if you are creating this signal to run as analog output it will be be based off the analog sample timing. So it is going to be hard to determine the highest rate that we will be able to run at any given time but more about the myRIO timing can be found in the following spec sheet.

 

NI myRIO-1900

http://www.ni.com/pdf/manuals/376047c.pdf

 

Also, to read simultaneously you could read the signal you are generating via a graph indicator on the front panel. 

0 Kudos
Message 4 of 28
(7,037 Views)

Hi, the following image shows the code for the FPGA side and the configuration of the sine wave generator. The quality of the sine wave drops considerably when I increase the frequency beyond 500 Hz?

Download All
0 Kudos
Message 5 of 28
(7,035 Views)

If you change the amplitude resolution does the quality of the sine wave improve?  

0 Kudos
Message 6 of 28
(7,009 Views)

yes, the lower the amplitude, the better the quality.

0 Kudos
Message 7 of 28
(7,004 Views)

Have you tried interfacing with the "Ex_Inst_Simulate Signal" Express VI on the Real-Time target instead of the FPGA?

0 Kudos
Message 8 of 28
(6,931 Views)

how do I do that? can you share a screen shot?

 

Best Regards,

Mubeen Haadi.

0 Kudos
Message 9 of 28
(6,926 Views)

You would need to structure your project similar to the attached image with the Waveform Generation VI located on the device but not located on the FPGA. 

0 Kudos
Message 10 of 28
(6,905 Views)