LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different reading of myRIO FPGA connectors B (with MXP) and C

Solved!
Go to solution

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.

 

fpga_myRIO.png

0 Kudos
Message 1 of 4
(3,259 Views)

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.

0 Kudos
Message 2 of 4
(3,240 Views)

@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

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 3 of 4
(3,170 Views)
Solution
Accepted by dopamod

@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.

 

fpga_myRIO.png


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.

Simple myRIO Analog Example.png

Bob Schor 

Message 4 of 4
(3,160 Views)