05-05-2021 07:12 AM
Hi,
i am trying to communicate between Labview and Arduino. I installed the Arduino Interface for Labview and i uploaded the LIFA Base on my Board. I am using 2 MCP23017 I/O Expander for my Arduino UNO and i am not sure how to set up the programm with the right adresses. Lets say i have 2 MCPs connected and i want to control 1 LED on the first MCP on the connection GPA0 and 1 LED on the second MCP on the connection GPA0. How does a simple programm like that look like and what are the right adresses? I programmed the same thing in the Arduino IDE and it worked but now i want to do it in Labview.
The Labview programm in the attechments is how i would do it but i dont know if it would work like that. I tryed to use the I2C vi.
I hope i could explain my problem in the way you can understand me.
05-05-2021 09:58 AM
LIFA was deprecated and replaced with LINX years ago. Both of them are rather limited in the peripherals they support "out of the box".
Using LINX you can create a custom command for that MCP23017 I/O Expander
Here's a link to get you started.
https://blog.digilentinc.com/how-to-use-linx-custom-commands/
And the LINX section of the LV Community
https://forums.ni.com/t5/Hobbyist-Toolkit/bd-p/linx-toolkit?profile.language=en
05-07-2021 04:03 AM - edited 05-07-2021 04:04 AM
Thank you for your help. I will try out LINX.
05-10-2021 04:27 AM - edited 05-10-2021 05:00 AM
Ok i tryed to use LINX to solve the problem i descriped. The communication is oright but as befor i don´t know how to write the exact adresses in my vi. What is the right I2C channel for the first MCP23017? And what is the right I2C Slave Adress for the GPA7 pin on the MCP? How many Bytes To Read? And what to write in Data?
I just want to understand the adressing. How should the programm look like to power 1 LED on the GPA7 Pin on the first MCP23017?
05-10-2021 10:07 AM - edited 05-10-2021 10:09 AM
@Redshadow wrote:
Ok i tryed to use LINX to solve the problem i descriped. The communication is oright but as befor i don´t know how to write the exact adresses in my vi. What is the right I2C channel for the first MCP23017? And what is the right I2C Slave Adress for the GPA7 pin on the MCP? How many Bytes To Read? And what to write in Data?
I just want to understand the adressing. How should the programm look like to power 1 LED on the GPA7 Pin on the first MCP23017?
Well the default I2C address should be in the devices data sheet.
Most I2C devices have a couple "Address pins" that you pull high or low to set its I2C address.
In fact I think most of your questions could be answered by reading the MCP23017 documentation.
Also look for some Arduino code to use as an example, I am pretty sure someone else has used the MCP23017 with an Arduino before.