08-03-2021 02:41 AM
Hi,
I made a simple test with myRIO connector B with MXP. Basically on the hardware, I connect directly connectorB/AO0 to connectorB/AI0. The expected reading value should be approximately the same. In this case should be around 3V. However, the reading is completely different. Is there something wrong with my setup or code? (screenshot below)
I tried this because I used connectorC/AI* and it was working fine. But I used LabView2017, instead of LabView myRIO 2017.
Solved! Go to Solution.
08-03-2021 04:00 AM
Hi,
For additional information, I connect connectorB/AI0 and connectorB/GND to a battery, but it still gives insane readings (not the 1.6 V battery potential). No idea why it is working like this.
08-27-2021 02:54 AM
@dopamod wrote:
For additional information, I connect connectorB/AI0 and connectorB/GND to a battery, but it still gives insane readings (not the 1.6 V battery potential). No idea why it is working like this.
Those analog IO are integer values in your diagram. They don't provide you the measurement in voltage but the digital ADC value which is a 12-bit ADC with an input range of 0-5V.
In this manual on page 10 you can read about the formula to calculate voltage from the read integer value.
V = Raw Data Value * LSB Weight
LSB Weight for the MXP analog inputs is 1.221mV
08-27-2021 08:47 AM
@dopamod wrote:
Hi,
I made a simple test with myRIO connector B with MXP. Basically on the hardware, I connect directly connectorB/AO0 to connectorB/AI0. The expected reading value should be approximately the same. In this case should be around 3V. However, the reading is completely different. Is there something wrong with my setup or code? (screenshot below)
I tried this because I used connectorC/AI* and it was working fine. But I used LabView2017, instead of LabView myRIO 2017.
I don't see any code running in the myRIO. You put a number into Connector B/AO0 (Pin 2), but where do you have code that says "Take this number, convert it to a Voltage, and make that Voltage appear on the named Connector"? Similarly, you read whatever number happens to be on Connector B/AI0 (Pin 3), but where do you say "Do an A/D Conversion of the Voltage that is on Pin 3"?
This is a very simple example I coded using the myRIO Software Toolkit. The two VI Icons are the "Icon View" of two Express VIs that come with the Toolkit, namely Analog Output (1 sample) and Analog Input (1 sample). You can see I wire 1 (volt) into the D/A converter, I have a (copper) wire going from Pin 2 to Pin 3 (and my breadboard is plugged into Connector MXP B), and when I run the code, I get a value of 0.997314 (pretty close to 1, wouldn't you say?) on the output.
Bob Schor