01-27-2025 12:50 PM
Not sure if this is the proper board for this particular post, apologies if not.
I wanted to use the Sine Wave Generator vi to drive two analog outputs on the 7846R series PXIe card but I am not sure what I am doing wrong or not understanding. Below is some very simple code. Amplitude output is set to full scale, and I was just trying to divide down the output to ultimately get the amplitude I wanted.
Do I have a data type issue by chance? Generator says output is an I16 so I converted to fixed point because that's what the r-series card wants. Code compiles fine but one output (AO0) does nothing and the AI0 output looks like a square wave on my scope and frequency is way off.
Solved! Go to Solution.
01-28-2025 07:38 AM
You can configure your AO channels to receive raw mode. See Working With Calibrated and Uncalibrated Data on NI R Series
01-28-2025 10:22 AM - edited 01-28-2025 10:24 AM
Interesting, much appreciated for this reference link. While I am new to R-series FPGA and don't follow everything in that article it seems for my quick application (which does not require a host interface) I just need to change the AO to raw mode. I'll give that a shot later today when I can get back to the lab.
I did find the Analog Sine Generation example for R-series cards in the built-in examples and that was helpful, but it does not actually output the data to a physical pin. It generates the sine wave on the FPGA but then passes it back to the host and just plots it. I tried adding an actual analog output node and tied the data to it before it gets passed back to the host, but I got similar results as my little program so hopefully updating the outputs to raw mode fixes this.
Interestingly enough, the output does work as expected when simply using a control and setting the output to a constant (DC voltage). Any idea why calibrated vs raw mode would not affect a DC output vs an AC output?
01-28-2025 04:02 PM - edited 01-28-2025 04:43 PM
Thank you again for this recommendation, that helped tremendously.
I am getting a perfect 2kHz sine wave output on AO1 at full scale and dividing it down allows me to set the amplitude to any level.
Also, I modified the code slightly as shown below because I am still not getting anything out on AO0 and I don't understand why. I thought maybe the sine generator couldn't drive two output connectors at the same time so I added a second generator vi but that didn't fix anything. I am using the SCB-68A connector block with an RMIO cable, and I have double checked the pinout against the 7846R card at least ten times.
Thank you in advance for any additional tips you might be able to provide. I will add AO2 through AO7 and double check that those output as expected as well.
01-30-2025 12:36 PM
Just to follow-up, I ended up re-wiring the code, recompiling, and for some reason that fixed the issue on AO0. Not sure why but now all eight outputs are working when set to "raw" mode.