First time user for the cRIO and I ran into this issue which I can't wrap my head around it. I am sure it is probably very simple and I hope someone can point out the obvious for me.
I have the DAQ hardware (NI-cRIO 9034 + NI-9205) connected to a function generator with a sine wave at 60 Hz and 5 Vpp. I wrote a very simple vi (ReadAI. vi attached) to read the AI and save it in file. I deployed the vi to the cRIO for data collection. The NI-9205 is a ±10 V, 250 kS/s, 16-Bit, 32-Channel C Series Voltage Input Module. But for some reason, the signal captured (test4,txt) shows more like a square wave than a sine wave. Sampling shouldn't be the problem especially for such slow varying input signal. It seems as if the ADC is only 1-bit as the output is either close to +/- 5V. Anyone have an idea? Thanks
Could you attach your whole cRIO project, not just the VI? That way we can see how you have the scan engine configured.
There are a couple things going on here. One is that you are only reading the value from your input channel at 100 Hz since you have a 10 ms wait in your read loop. Since you are using the module in scan interface mode, the sampling speed of the data read into LabVIEW is determined by how often you read from the AI0 I/O variable. 100 Hz is not sufficient to capture a 60 Hz sine wave. I'd recommend reading Understanding NI CompactRIO Scan Mode for more information on how scan interface mode works on a cRIO.
I'm not really sure why you are getting such an even square wave, but try running one of the cRIO shipping examples to see if you get the signal that you expect. There are both generic scan mode input examples and examples that are specific to the 9205 module that utilize the FPGA to take data from the module. Open the LabVIEW example finder (Help»Find Examples...) and then browse to the following locations:
Scan engine examples: Hardware Input and Output»CompactRIO»NI Scan Engine»Module Specific IO»Analog Input»Analog Input - Getting Started - Scan Mode.lvproj
9205 examples: Hardware Input and Output»CompactRIO»Module Specific IO»Analog Input»NI 9205...