About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Using ADC Pi Plus with LabVIEW LINX

943 Views - Created 18/09/2017

18/09/2017

Posted by:
Moulinas

Users Avatar

Hello,

i am using the LINX library in order to run LabVIEW exe files on the raspberry.

The LINX library allows to read/write on spi, i2c, GPIO, send PWM / digital signals and so on.

I am trying to send a GPIO order to contactors plugged into the Raspberry.

Do you know : 

  1. Will the ADC automatically "translate" the Digital input into a Numerical output (without any command from labview other than 'GPIO write', for example) ?
  2. Is there any command required to enable the ADC after powering it up along with the raspberry 

Thank you for any answer

 

~Moulinas

18/09/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hello

I don't have any experience working with LabView or LINX so I don't know how it works but to read a value from the ADC Pi Plus you have to first send a command byte to the I2C address for the ADC chip and then read either three or four bytes depending on what bit rate you have selected.  The three or four bytes have to be combined together into a single value which can be converted into a number.  You don't have to send any commands when you first power up the ADC.

The ADC Pi Plus uses the Microchip MCP3424 ADC chip, the datasheet for the chip can be found here.  The details on what you need to put in the command byte can be found on page 18 and how to read back the values is on page 22.  Once you have send a command byte you will need to keep reading from the ADC until the ready bit goes goes low which tells you that the data conversion has been done and the value is ready to read.

To get an idea of what code you will need to read the values from the ADC it may be worth having a look at our python library.  The read_raw function contains the code for reading a raw value from the ADC chip and the read_voltage function converts that raw number into a voltage based of the gain and bit rate settings.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.