08-21-2020 01:29 PM
Hello all,
I am generating an analog sine wave to output through the C/AO0 to read on an external oscilloscope. Currently, I have been able to generate a specified frequency and amplitude through an FPGA VI. . However, the values that I read are all positive (0-20V) instead of the desired -10-10V. How may I obtain both positive and negative values? Could I do it by scaling the 2nd half of each oscillation by -1?
I have attached a zipfile of pictures of my front panel, block diagram, and oscilloscope readings. The oscilloscope is a Hantek DSO4102C.
I currently do not have an RT Host; it is just the FPGA VI.
- Best regards, 2001J
08-21-2020 02:37 PM
There is not enough information visible, but what if you would convert to I16 instead of U16?
08-21-2020 02:59 PM
Hello attenbach,
I did not think about the data type. I will try converting it to I16, then I will update you on whether it fixed it or not.
The pictures that i provided actually had all of the code in use, so there is currently no more LabVIEW code for me to provide, if that is what you were alluding to.
- Best regards, 2001J
08-21-2020 04:22 PM - edited 08-21-2020 08:18 PM
I wasn't able to tell how the AO was configured. (Range, bits, etc.)
08-21-2020 04:47 PM
Oh, yes. That makes sense. I have attached a zipfile of the project. The Host VI is "CustomDAC_RT Main.vi" and the Target is "DAC_FPGA". Let me know if this file has any issues.
- Best regards, 2001J
08-21-2020 05:18 PM
Also, for generating a signal, I would recommend setting the scale to 0.25 and the frequency to 2.5E-5. These values currently generate a 1kHz sine wave from 0-5V.
08-21-2020 10:34 PM
Hello again altenbach,
I just wanted to notify you that I fixed the issue of my signal. The way that I did it was by recording the maximum value of the generated sine wave, then subtracting half of this max from all further points. This translates the waveform vertically while maintaining its shape. It results in half of the waveform being positive, while the other half is negative.
Thank you for your assistance.
- Best regards, 2001J
06-02-2021 08:22 AM
Hey, I am currently having the same problem. Care to explain more thoroughly how did you fix it, please?
I am trying to do the same with the blue signal of the image attached.