LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA Product Feedback and Suggestions

Hello Kevin.

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.

Mike

0 Kudos
Message 51 of 82
(1,645 Views)

Hey Mike,

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.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 52 of 82
(1,645 Views)

Hey Kevin.

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?

Thanks.

0 Kudos
Message 53 of 82
(1,645 Views)

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.

LIFA 3!

0 Kudos
Message 54 of 82
(1,645 Views)

Mike,

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.

Ryan,

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.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 55 of 82
(1,645 Views)

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

http://softsolder.com/2009/02/21/changing-the-arduino-pwm-frequency/

http://www.arduino.cc/playground/Main/TimerPWMCheatsheet

Cheers,

Chris

0 Kudos
Message 56 of 82
(1,645 Views)

I've just installed LabVIEW Interface for Arduino ver 2.0.0.67 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[15]".  What's going on?

Rich

0 Kudos
Message 57 of 82
(1,645 Views)

Hey Rich,

Which version of Arduino are you using? Arduino 2.0 only supports Arduino 1.0 022 or 023.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 58 of 82
(1,645 Views)

Arduino 1.0 is what the IDE says.  (Sorry to have omitted that bit.)

Rich

0 Kudos
Message 59 of 82
(1,645 Views)

Arduino 1.0 on a Mega 2560...

0 Kudos
Message 60 of 82
(1,645 Views)