LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sine Generator output using 7846R analog output

Solved!
Go to solution

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. 

 

cabala_0-1738003752250.png

 

0 Kudos
Message 1 of 5
(273 Views)
Solution
Accepted by topic author cabala

You can configure your AO channels to receive raw mode. See Working With Calibrated and Uncalibrated Data on NI R Series

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
Message 2 of 5
(219 Views)

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? 

0 Kudos
Message 3 of 5
(206 Views)

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. 

 

cabala_0-1738101623389.png

 

0 Kudos
Message 4 of 5
(188 Views)

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. 

0 Kudos
Message 5 of 5
(144 Views)