LabVIEW, Arduino and LINX

Hello,

I have just started my first tentative steps in interfacing Arduino with LabVIEW via LabVIEW’s LINX package.

I used LabVIEW several years back now to make various controls and interfaces to basic stamp and basic atom microcontrollers. I am a bit rusty with it if I am honest, but already it is astonishing how quickly you can get things done.

Basically LINX allows you to program the Arduino using LabVIEW graphical methods, so you never have to write a line of C. LabVIEW uses structures that are similar to electronic circuits so it is intuitive if you have electrical or electronics knowledge. As well as programming the Arduino you can also easily build GUI’s for you applications.

I was wondering if anyone here has used LINX with LabVIEW and how they got on. As I say I am just starting out, but I’d be really interested to hear and see what others have done, if anything.

Thanks,

Carl.

Hello,

I thought I would share with you my first experiment in programming an Arduino using LINX with LabVIEW.

LabVIEW is a graphical programming language that is aimed at engineers and scientists. Those who may not be the best programmers in the world, but who have an understanding of systems and who want to get things done. It is sopecifically aimed at building control and measurement systems.

Instead of writing lines of code in C, Basic, Java etc, one simply drags and drops various function blocks onto what is called the “block diagram” These are then wired together, the “wires” representing data flow and data type. The flip side of this is the “front panel” which looks just like the front panel of a conventional instrument. You can add potentiometers, switches, buttons, LEDs, dialogue boxes, just as you want.

LINX is a subset of function blocks designed to make programming an Arduino very easy using LabVIEW. It also allows the ARduino to communicate with the LabVIEW software and have a professional GUI for the application.

Before the Arduino can be used with LINX and LabVIEW, a small sketch is uploaded to it during a short configuration process. This allows LabVIEW to interface with and programme the Arduino using LINX.

My first little test was to build a simple voltmeter. A potentiometer is connected to one of the analogue input pins of the Arduino. The code is then put together using LabVIEW and LINX.

The screenshots below show the block diagram and front panel, respectively. The grey rectangle in the block diagram is called a while loop structure. This is rather like a goto statement in basic. You will see that there is a LINX initiate and close block at each end of the while loop. Inside the loop is the part of the programme that runs continuously. Some of this runs on the Arduino, some on the machine hosting LabVIEW.

You can see that there is a LINX analogue read block, this is code running on the Arduino. The analogue channel is read and converted to a voltage which is then sent to the laptop via the USB connection (COM 4 in this case). The voltage is then displayed on a meter. I have also included a reference voltage whih is compared to th emeasured one. If the measured exceeds the reference then an LED is lit on the front panel. The front panel stop button and the LINX error output are OR’d to the stop terminal of the while loop. Either of these conditions will stop execution.

The idea behind this simple application is to work towards a data acquisition and control system for my rocket engine project.

Mind how you go,

Carl.