From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-14-2013 12:15 PM
Is there any function in LIFA_Base to assign different addresses or IDs to a set of different Arduinos connected to Labview over USB?. I would like to connect more than one Arduino to labview and then have labview retrieve the ID of each Arduino on different com ports. Also if there is a function to do this will the Arduino keep its ID on a restart? Also is there a reference on LIFA_Base explaining its functionality for someone who knows no C programming
10-14-2013 03:17 PM
This is not natively implemented but you can do it. I did it for one of my projects so that I could have two Ardunios and alwayw know which is which. I created a new LIFA function that sends an integer back to LabVIEW. This integer was changed before uploading it on to the individual Arduinos. So, I changed the value to 1 for the first Arduino and uploaded it. Then I changed the value to 2 and uploaded to the second Arduino. Finally, you use the LabVIEW VI that you create to retrieve that value.
I think I posted my code here somewhere for an older version of LIFA.
10-14-2013 09:46 PM
A "one LIFA_Base fits all" solution would would be to wire in something along the lines of a hex switch to the Digital I/O and then have the Arduinos report the encoded value back to LabView.
10-14-2013 10:09 PM
Ooo . . I like this idea. Good suggestion jbliss. Something like this would work.
10-15-2013 02:52 PM
Nathan don’t know c yet so this could be a little tricky for me. I was thinking I will try to change the firmware name to a different name for each arduino. I should be able to get LV to tell me what to look for in the code then make a make the change there and retest with LV and see if it responds to my change. I will test this and get back with my findings as soon as my boards get here which shouldn’t be long.
jbliss yes that was my fall back option, I was thinking dip switches but the encoder would make life a lot simpler, this is a option on something like a mega but on a mini or uno resources are a little tighter but still definitely still viable
08-22-2014 10:32 AM
Hey Nick!
After spending one week on trying to get it fixed, it´s kinda easy
you just have to change the LabVIEWInterface as i did.
/********************************************************************************* | ||
** LIFA Maintenance Commands | ||
*********************************************************************************/ | ||
case 0x00: | // Sync Packet | |
Serial.print("sync1"); | ||
Serial.flush(); | ||
break; | ||
case 0x01: | // Flush Serial Buffer | |
Serial.flush(); | ||
break; | ||
I just changed the Serial.print to "sync1". Have a look at the picture!
In order to identify the Arduinos, i made a VI.
08-22-2014 06:11 PM
Hi michi_ries!
I wonder if what you did can work in multiple arduino connected through Xbee?
I have 3 arduinos, each having Xbee and would send their data to the coordinator. Would this also work?
08-22-2014 06:13 PM
The changes that he made, is only for identifying the Arduino uniquely. Each Arduino still requires it's own COM port.
08-22-2014 06:17 PM
That would require 3 Xbees in coordinator. Are there any option that I can use?
08-22-2014 06:20 PM
Correct. I don't know. I'm waiting on hrh1818 to respond in the other thread since I'm not all that familar with xbee. So, I would probably just wait until he says something in that thread.