LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Arduino - and then untethering it from LabVIEW

I really think that being able to program the Arduino boards with the LabVIEW Development System is really snazzy!  I am impressed.  I was able to program the Arduino Uno, the Arduino Duemilove, and the Ardion MEGA1280 using LabVIEW 2011 with the Arduino library provided by JKI.  I did not have success with the 2560 unfortunately; and looking at many of the other postings, it looks like I am not the only one having problems with the 2560. 

I know that my Mega 2560 is not a bad board because I was able to update the firmware and I was able to put one of my more complex text based code on it that I normally run on the 1280 (which was being seriously taxed). 

Anyways, back to the real reason I am posting this... all of the examples that I have seen have the Arduino tethered via USB to LabVIEW; and although programming the Arduino with LabVIEW and visually seeing the user actions or sensor inputs on the computer screen is great, I would like to know if there is a way to program the Arduino from LabVIEW, then disconnect the Ardiuno from the computer all together, and given a power source have the Arduino system run autonomously.   If anybody has any ideas of how to convert the LabVIEW code to Arduino hex files, I would be most grateful.  I like LabVIEW a lot, and I like Arduino stuff a lot... if I can have the best of both worlds, I would be in heaven!!!!

0 Kudos
Message 1 of 15
(14,288 Views)

The LIFA is not a graphical method for writing code to run on an Arduino board.

A far superior approach to running an Arduino board untethered is to just use the Arduino programming environmet to write your own sketch and then upload it to an Arduino board.  For what you want to do Labview doesn't provide any benefits.  For prove of this statment take a look at the sketch that is uploaded to an Arduino board to enable Labview to communicate with an Arduino board.  When looking at the sketch try to answer these questions how would I modified the sketch so the board could run untethered and whether it would take more time to modify the LIFA sketch or use the Arduino library to write your own sketch.

Howard

0 Kudos
Message 2 of 15
(6,017 Views)

Excellent reply Howard and thank you for responding so quickly.  What you said above is kinda what I was thinking yesterday when I was creating some code; but I wanted to see if, just maybe, there was a function created or some method to create the Arduino hex file from LabVIEW.  I think you will agree with me on this: LabVIEW is pretty awesome and the makers of LabVIEW and the subVIs to facilitate such great functions are simply amazingly smart people!   So, with that being said, I would think that LabVIEW has the capability to do something like this.  i just thought somebody might have already made this function; although I must say, I do think that it would be very difficult! 

Take care, and thank you much.  Please have a great weekend.

Justin 

0 Kudos
Message 3 of 15
(6,017 Views)

I have been after any product that would do that for many years. NI has Labview embedded but it is expensive, not easy to use and is aimed at ARM processors. I've seen different versions of BASIC interpreters over the years on the PIC platform and PARALLAX.

Even if the functionality was reduced it would be worth it. If anyone ever made one it would be a huge seller.

0 Kudos
Message 4 of 15
(6,017 Views)

Hi,

I was just browsing through the available information on this toolkit and saw your comment.

I believe that what you mention has been done by these guys, although not sure.They claim low prices but I don't know at what scale.

They were at the 2011 NI Week.

http://zbrain.ch

http://schmid-engineering.ch

0 Kudos
Message 5 of 15
(6,017 Views)

I'm new to the Arduino and LabVIEW and have been trying to figure out the same thing.

 

Would it be possible to:

 

(1) Create a VI and test the functionality with: http://sine.ni.com/nips/cds/view/p/lang/en/nid/209835 

 

(2) Generate C Code with: http://sine.ni.com/nips/cds/view/p/lang/en/nid/209015 

 

(3) Use the C code to make an Arduino sketch

 

Thanks for taking the time!

 

 
Message 6 of 15
(6,017 Views)

No.  LIFA is not designed to create code for Arduino.  It is just an interface program, it only communicates with Arduino via serial communication.  Code generated by the utility to which you refer will not run on an Arduino if you use LIFA.

0 Kudos
Message 7 of 15
(6,017 Views)

LIFA and the C Generator Toolkit are two entirely different AND incompatible beasts. While LIFA is a firmware component for the Arduino that allows using the Arduino like an intelligent device over the (virtual) serial port from within LabVIEW, the C Generator Toolkit allows creatinbg C code routines that can then be compiled by the compiler toolchain of your target into an executable (and with some research and sweat probably also into an Arduine sketch). But that requires fairly intimate knowledge of the target compiler toolchain. Just knowing how to type .configure, make on the command line is definitely not enough.

The issue with this is that just creating C code is by far not enough to get a similar seemless integration of your dream target into your LabVIEW environment as most other things in LabVIEW work. You simply get a bunch of C routines that make use of various library functions that you have to adapt from the template code to your specific target. And for every variation in target hardware, OS version and type, etc you likely have to dig through those library functions and make according changes. Also the price of the C Generator Addon is even for professional LabVIEW users rather high, and definitely not an option at all for home projects.

Then you have to add an extensive IO module library (not sure what their name is now) to integrate the various peripherals into your LabVIEW environment to be able to use them and last but not least dig into the LabVIEW project handling to integrate the entire C toolchain into LabVIEW so that you get a new target type to create from within a LabVIEW project.

While the issues in the last alinea are only necessary if you want seemless integration in LabVIEW and can be omitted if you don't mind to launch the C toolchain from the command line instead each time, the rest is still a very extensive work with a very steep learning curve that in fact nobody outside NI has yet demonstrated to make a usable thing. There have been several attempts by rather experienced people but most got stuck in some kind of prelease version that still needs much more time to get really right than it ever could make commercially so the work seems to have stalled after the initial enthusiasme. And it would need to be redone in part for every of the different Arduino boards.

Of course everybody hopes that NI would create such a Toolkit for the target of their choice but the problem here is that everybody wants his own target supported with preferably his own peripherals. And with targets like Arduino that cost around $30 you get another problem, namely everybody expects that toolkit to be in the same price range than the hardware and of course that should include the LabVIEW license too! But I'm not sure how NI could justify to sell a Toolkit which can do much more than the standard Base version of LabVIEW for a fraction of its cost. So if NI created such a Toolkit it would be likely an addon in the same price range as existing addons and therefore wouldn't sell and be a commercial flop, like all the other embedded toolkits for non NI-targets have been if you consider the development and most importantly support cost in relation to the sales. However lowering the price is also no option as it would cannibalize the existing LabVIEW sales.

I also understand that some actually feel that this approach would be the ideal way to force NI to lower the overal costs of LabVIEW, but hey most successful companies I know about don't slaughter their own revenues but rather protect them. I know about economical theories where lowering the price will create more sales but with a product like LabVIEW more sold products means more support demand, which is a substantial part of the costs of LabVIEW, so a lot if not all of that sales would be eaten up by the additional support costs and revenues would in fact go down. Also don't forget that NI is in fact a hardware company and makes a lot of revenue with hardware which LabVIEW is an enabling tool for. Nothing of all this applies for 3rd party targets, so you end up with more sales and support costs for LabVIEW and less sales of hardware and even less revenue.

Or we end up with support offerings as are quite normal nowadays in software industry, where the overal credo is: Baaaa, the product is sold, you are on your own!

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 15
(6,017 Views)

You say:

"Create a VI and test the functionality with: http://sine.ni.com/nips/cds/view/p/lang/en/nid/209835" 

 

This is not how LIFA, Labview Interface for Arduino, works.  LIFA has very few functions.  So what you do in Labview is create a VI to use one or more of the functions LIFA provides.  You can not use Labview to create an arbitray VI and then expect it to work with Arduino. 

 

You say:

Generate C Code with: http://sine.ni.com/nips/cds/view/p/lang/en/nid/209015 

Use the C code to make an Arduino sketch

 

The C Code generator you provide a link to does not come with the student edition of Labview.  It is a very expensive add on to the professional version of Labview and there is no reason to buy it for use with Arduino.  You can find free sketches on the Web for programming an Arduinom processor.

 

hrh1818

0 Kudos
Message 9 of 15
(6,017 Views)

Off topic but you aroused my curiosity when you say"

"So if NI created such a Toolkit it would be likely an addon in the same price range as existing addons and therefore wouldn't sell and be a commercial flop, like all the other embedded toolkits for non NI-targets have been if you consider the development and most importantly support cost in relation to the sales."

Is the above statement also true for Labview's FPGA addon Toolkit?

hrh1818

0 Kudos
Message 10 of 15
(6,017 Views)