LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Arduino LIFA - Ethernet

Hello All,

I have gotten LIFA working over ethernet (https://decibel.ni.com/content/thread/16861?tstart=0) and now im wondering if I could get multiple Arduinos working over ethernet communications in one VI.  I hear that it's possible to get multiple Arduinos communicating via serial communications (https://decibel.ni.com/content/message/35177#35177).  I used MAX to get two raw sockted TCP VISA's of the Arduinos.  I am communicating to both of those individually through two VI's.  However, I'd like to use one VI to talk to both Arduinos.  Can someone give me some direction to get going?

Thanks,

Matt

0 Kudos
Message 1 of 4
(4,916 Views)

If you could tell me exactly every VI that you changed to get it to work over ethernet then I will be better able to understand all that is required for ethernet communication.  Then, I would be better able to answer your question.

Getting two Arduinos working via USB is quite simple, you just need to make sure that each has it's own unique COM port and that you keep each of the Arduino resource wires separate.  It will likely be the same in your case but I would stilll like to get that list of all the VIs that you actually had to change to get this to work (I think I can making things much simpler for distributing your ethernet VIs).

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

Nathan,

The main thing I changed is the Init VI and it's sub VI's.  In the sub VI's I changed the way LV finds the Arduino (made it look for a TCP VISA instead of a Serial for Find Arduino.VI), how the arduino sends/recieves commands (created a new VI in send/recieve VI that refinds the arduino by closing the previous session and opening a new one), and the Arduino code itself.  I do communications through VISA created by raw socketed TCP settings in MAX. 

Attached is an image of the current VI I'm testing with.  It is a simple VI which controls a servo.  I tried running two versions of this at the same time with different IP's (192.168.0.xxx and .xxy).  Both communicate over the same socket.

When running the VIs at the same time I notcied the pulse width wouldnt update on either, so I went to highlight execution and saw that both VI's froze up.  I stopped one and the other started working again.  I believe my problem is the way I handle refinding the arduino.  If LV doesn't get back a sync from the Arduino thats linked to the VISA, I tell LV to close communications to the Arduino and open a new connection to the same VISA.  I believe LV is getting the sync from the two VISAs and can't figure out which one is which. 

If you would like to make things easier for distributing the code, by all means go for it.  I would like the LIFA community to grow.  I'm not the best with creating LV, I mainly took Sam's code an modified it for my needs. 

Thanks,

Matt

0 Kudos
Message 3 of 4
(3,295 Views)

Hello all,

please,could you help me

i need to read multiple sensors over the ethernet , bul i  not know what i do , i read it using the serial communication, i use Ethernet w5100 shield and arduino mega

http://img.dxcdn.com/productimages/sku_152203_1.jpg

best regards

0 Kudos
Message 4 of 4
(3,295 Views)