Do you know if there is a way to identify two 2560 arduino boards connected to the same computer? I am wrapping up my application and cause Im using 2560 arduino boards I have not found any means to differentiate them other than knowing looking at the COM port...
I thought about using a USB to Ethernet adapter but I do not know if it will work. I am thinking this way I can differenciate by means of a fix IP address. It is very inconvenient for me that sometimes when I need to reset/shot down the PC where I run the Labview or when I need to reset the 2560 boards I got different COM port numbers so I have to update the code. This is not the case for the instruments I have connected that are controlled by Ethernet connection like for example an Agilent Network Analyzer.
Thanks a lot.
I can't think of a good way to do it other than the COM port. One difficult way to do it would be load custom versions of firmware onto each Arduino and then have the code automatically identify which is which but that seems like more work than its really worth. You should be able to set up your code so that you only need to change it in one place and have it propagate everywhere.
Thanks a lot for your very helpful comments. The only problem I have so far with my measurement is that sometimes for some reason the COM port number changes and then I have to go again and find out which are the new ports numbers assign to the two 2560 boards. I really like your idea of changing the firmware so I have means to identify the boards. Do you know how to do it, or at least a place I could check how to implement it?
Since there are more and more Arduino boards being produced, I think it would be beneficial to go to a more Object Oriented based architecture using LabVIEW classes. That way, you initialize the board using one of however many boards there are, and it would pick the correct modules for the board.
I've seen this a few times, and it was a bug with LIFA 1, but with respect to the analog inputs, having two different analog read modules for the Uno and Mega would be beneficial.
Just a thought.
I don't know of anyone who has implemented it yet but it would be similar to the get firmware version code that is currently part of the sketch. Essentially in the sketch for each arduino you would create a function to return an ID. Then in your code based on what that ID is you call one function versus another. You just need to make sure you keep the IDs straight.
I like the idea of an object oriented approach to the toolkit. If we start to add support for new boards it is definitely going to be more appealing to make the switch. Its officially on the list of features/changes we would like.
I've been using the LVIFA toolkit for about 3 months now, and it's great. It makes it so easy to use the Arduino in control projects. I have a feature request relating to the PWM timers.
The 3 timers in the ATmega 328P can have their clock division registers altered to provide different PWM frequencies. It would be nice to be able to adjust these on-the-fly without having to add custom commands in the firmware. The registers TCCRxB (where x = 0, 1 or 2) can be given a hex code to set the clock division value (see Arduino timer PWM cheat sheet link below). This would be a fairly straightforward thing to implement. The only issue might be that the user might unwittingly alter the clock divider on timer 0 without realising that this can have strange effects on time-dependent functions such as millis(), micros() and delay().
Here are a couple of useful references...
I've just installed LabVIEW Interface for Arduino ver 184.108.40.206 which comes with the Dec 2011 version of LVIFA_Base. When I upload LVIFA_Base.pde there are 31 errors starting with "redefinition of 'unsigned char currentCommand". What's going on?
Which version of Arduino are you using? Arduino 2.0 only supports Arduino 1.0 022 or 023.