01-17-2019 12:08 PM
I'd like to use Labview+LINX to read from an i2c device, via an Arduino. At present, I have an Adafruit/TI ADS1015 I2C analog to digital converter attached to an Arduino Uno via the SDA and SCL pins on the Arduino. I'm just using this as a test example - reading from most any i2c device is the longer-term goal
I've been working with the LINX i2c vi's for a bit, but I haven't gotten a send+receive to work yet.
1. From the TI datasheet, the component has an i2c address of 0x48 (or 0b1001000). On the LINX i2c write vi, the i2c slave device port is an unsigned 8-bit integer. I'm pretty sure 0x48=0b1001000=72 (base 10). Is there a way to specify the hex or binary version of the address? Is (int) 72 converted properly? When I enter 1001000 Labview rounds down to 255 immediately. I don't see a "digital" datatype in the palettes.
2. The ti data sheet (quickstart) suggests that I send and receive the following bit patterns to the ADS1015. What's the proper way to structure these messages with the i2c-LINX vi's?
i2c Write 0b10010000
i2c Write 0b00000001
i2c Write 0b00000100
i2c Write 0b10000011
i2c Write 0b10010000
i2c Write 0b00000000
i2c Write 0b10010001
i2c Read
i2c Read
The screenshot below obviously doesn't work. Any suggestions appreciated.
Here's the spec sheet for the ADS 1015 I'm using
01-17-2019 12:34 PM
Should I be sending the i2c commands as int, eg,
i2c Write 0b10010000 (send as 144, base 10)
i2c Write 0b00000001 (1_10)
i2c Write 0b00000100 (4_10)
i2c Write 0b10000011 (131_10)
i2c Write 0b10010000 (144_10)
i2c Write 0b00000000 (0_10)
i2c Write 0b10010001 (145_10)
i2c Read
i2c Read
If so, code and output look like,
01-18-2019 12:25 PM
Hi nmoorewsu,
Questions about LINX are best directed to the LabVIEW MakerHub forums. They're generally pretty active, so you can post your question over there to continue troubleshooting this.
01-18-2019 12:33 PM
Thanks Melanie.
Is there a binary data structure in LabVIEW? I can't recall seeing a hex/octal/byte type in the palette menu.
01-21-2019 03:41 PM
Hi nmoorewsu,
You can right click the control or indicator and go to Properties. From there, you can set the type of the control or indicator. The link below has more details about what is available:
http://zone.ni.com/reference/en-XX/help/371361P-01/lvpage/pp_display_format_db/