11-26-2013 11:21 AM
I am working on a graduate project where I need to produce some sine waves and I am getting more of a square wave when I output it and measure on the scope. The program I am running is quite simple at the moment to attempt to discover any errors by process of elimination. I have the sine wave generator in a while loop outputting to an AO port. I am using the cRIO 9022 with the 9269 AO module. I will attach screen shots of my code and my oscope image. Thank you for your time
11-26-2013 12:19 PM
You have the amplitude for the sine wave set to 32676.5, which is of course much larger than the analog output can produce. The output is clipped, and you get what looks like a square wave. You can try simply setting the sine wave amplitude to 20, but you might lose resolution. If so, you'll need to use one of the fixed-point conversion functions to convert the the integer output into the correct fixed-point representation, but with the same bit pattern.
12-02-2013 05:12 AM
You can see the coersion dot on the AO block , this says ur sine wave generated and your module both are in different limits.
Find the limits of the AO block and scale it appropriately.
Also try to change the Calibration Mode in Module Configuration of the analog ouput to Raw.
12-02-2013 08:39 PM - edited 12-02-2013 08:51 PM
if you set the calibration mode to raw on these modules, the error is significant. better to use the integer to fxp routines and use the calibrated mode of output. see attached code snippet for my preferred approach.
@nmadhaneie wrote:
You can see the coersion dot on the AO block , this says ur sine wave generated and your module both are in different limits.
Find the limits of the AO block and scale it appropriately.
Also try to change the Calibration Mode in Module Configuration of the analog ouput to Raw.
12-03-2013 05:34 AM
Thanks a bunch for your help
12-03-2013 09:18 AM
I am currently attempting your setup Stu and I'm not really getting a signal at all. I'll attach my code with the oscope screenshot(not much of anything). I believe I have my dimension values correct but apparently not if I'm not getting my desired signal.
12-03-2013 09:39 AM
you did not follow the code.
leave the sine generation at full scale. (you changed it to 4). use +/-16,1 as the integer to fxp type and make sure your amplitude is not zero.
12-03-2013 11:54 AM
it worked!!!! I'm so happy haha. Thanks for your time Stu, problems been killing me