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.