10-14-2012 02:28 AM
d.gelman wrote:
Regarding performance, this is not performing like an embedded system - rather a hardware interface. With the speeds I mentioned for sampling and outputing rates, would the Arduino + LV reach anywhere near RT? I love the versatility of LV but I want be as close to an embedded RT system as possible.
That really depends on your definition of "real-time" and what you are requiring of it. Personally, I would not consider the Arduino + LIFA a real-time system. It can be fast but there are no guarantees of speed. AFAIK.
For digital reads ~300-500Hz (3 encoders)
PWM outputs ~3Khz (3 DC motors)
Just remember that if you choose to go with the UNO (without interupt pins) that your encoder reliability will depend on how long it takes to execute all the other code being on the Arduino (including every time that you use a LIFA function in LabVIEW).
Also, would developing Arduino code to perform sampling and outputing as functions and then using LIFA to call those functions within LV a possibility? Where can I read up on these inquries.
I do this all the time. It's quite simple. All you need to do is look at existing functions and first learn how they work. Then, you can add your function to the switch() in processCommand() of LabVIEWInterface.pde/.ino
10-14-2012 12:42 PM
The following web page has an interesting heads up.
<http://www.hessmer.org/blog/2011/01/30/quadrature-encoder-too-fast-for-arduino/>
A commnt extracted from the above web page.
"It turns out that the Arduino function digitalRead() comes with a lot of overhead and is correspondingly slow. it can be avoided by directly reading from Atmel ports rather than going through the Arduino library, thus gaining a factor of about 50 in performance."
hrh1818
10-17-2012 03:51 PM
hrh1818's find above is correct. The digitalRead function (as well as almost every other Arduino function) introduce significant overhead by checking, or reconfiguring settings each time you try to call a function. This reduces performance but makes the API very simple to use. There is always a trade off of simplicity / easy of use vs performance. Arduino definatly leans toward simplicity and ease of use.
-Sam K
LIFA Developer