First of all I want to thank you for your great help, it worked beautifully!!! How did you came up with such idea? I would have never figure that one out....It took me almost one week of trying different things till I decided to throu this question here and there you were with the answer to my question in no time. Thanks again, very much appreciated.
I looked up the pin number defined as A0 in the pins_arduino.h file of the Arduino 1.0 firmware. Since our code can't resolve what A0 is we need to give it the actual pin number instead of the named pin number.
For stepper motor control, it would be useful to have ability to set an Initial Speed when using Acceleration. Acceleration is typically used when the stepper motor is not capable of immediately starting at its maximum speed. The control implementation right now starts the acceleration at 0 speed and gradually ramps up to the maximum speed. A motor might be capable of starting out at a nonzero speed that is less than its maximum. That would decrease the time required for it to reach (by acceleration) it maximum speed. There are times when one wants overall motion to occur at the fastest speed possible but the motor cannot start out at that fastest speed so it has to accelerate to that speed. Being able to start out at a non-zero speed would decrease the time required to reach the maximum speed adn thus the overall motion would complete quicker.
I have arduino uno .I want to take input on pin 6 and from that I want to create an output.I have arduino toolkit(LIFA). In what way I can show that input has come in labview through LED and also I want to show output LED on labview.
I am attaching my vi also .........
thanks in advance
I would start by taking a look at this example:https://decibel.ni.com/content/docs/DOC-16067 of doing an analog read. If you have questions on that I would start a new thread so people are more likely to look at it.
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 188.8.131.52 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?