LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Arduino MCP23017 I/O Expander

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.

 

0 Kudos
Message 1 of 5
(1,467 Views)

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

 

 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(1,420 Views)

Thank you for your help. I will try out LINX.

0 Kudos
Message 3 of 5
(1,372 Views)

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?

Download All
0 Kudos
Message 4 of 5
(1,344 Views)

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

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(1,324 Views)