Click the blue text above to subscribe to us
Peihua LabVIEW Basic Course| Lecture 13
“How to Compile LabVIEW Code and Upload it to Arduino?”
Shania recently wanted to achieve the effect of displaying the voltage value read from the Arduino analog port on a “4-digit digital tube” and found that the program written with the LINX toolkit did not perform well. Although it could display the value, it displayed one digit at a time; running at the fastest speed without delay still flickered too much… it was still not fast enough! (It needs to be fast enough that the flickering is not visible to the naked eye)
Later, after being reminded by a colleague, I realized a problem: communication between LabVIEW and Arduino using the LINX toolkit is based on serial communication, and the program’s running speed cannot be fast enough! It cannot meet the requirement of displaying 4 digits “simultaneously”. So how can this effect be achieved?
Since serial communication is too slow, what if we directly compile the LabVIEW program and download it to the Arduino development board? This way, we can avoid communication delays and also detach from the PC!
This requires using another toolkit from LabVIEW – the Arduino Compatible Compiler For LabVIEW (hereinafter referred to as the compiler). With it, we can compile LabVIEW code and download it to the Arduino development board, making the VI independent from the PC and embedded into the Arduino hardware for independent operation!
Before using this compiler, the PC must install the Arduino IDE version 1.5.7 or higher (preferably the latest version).
Arduino IDE Startup Page
Arduino IDE Download Address:
https://www.arduino.cc/en/Main/Software?setlang=cn
1
Open JKI VI Package Manager, select “Arduino Compatible Compiler For LabVIEW Home/Student” (the first: Home/Student version).
PS: Because this toolkit is not free! The Home/Student version can be used for free trial.
After successful installation, open LabVIEW, in the “Tools” menu, you can find the “Arduino Compatible Compiler For LabVIEW” board selection. After opening it, you can see the following page:
2
Download LabVIEW VI to Arduino Hardware
After opening the compiler main page, first select the corresponding Arduino development board in “Tools“, then select the corresponding connection port;
If you cannot find the corresponding connection port, select “Detect Ports” in the “Tools” menu to refresh the connected ports, then select the corresponding Arduino hardware board’s connection port. (This is the same operation as in the Arduino IDE)
3
Open any example and click the fourth icon “Compile and Download” on the compiler main page. If everything goes well, the example will be downloaded to the Arduino development board!
At this point, unplug the data cable and power the Arduino development board separately with a battery, and you will find: the program is already running! Completely detached from the PC! Isn’t it amazing?
4
Compile the code and download it to the Arduino development board after the VI has been completed.
Click the “File” menu, select “Load VI“, load the VI to be compiled and downloaded to the hardware version, then select the fourth icon “Compile and Download” in the toolbar, and the following page will appear to indicate that the compilation is complete!
Common Arduino Development Boards
Arduino Yun
Arduino Uno
Arduino Due
Arduino Mega
Arduino Leonardo
Arduino Nano



1
When selecting the board for “Arduino Compatible Compiler For LabVIEW”
The compiler actually deploys code using C language programming methods, and some functional functions are not supported in this compiler, sotry to use the VIs under the program block “Arduino Compatible Compiler For LabVIEW” for embedded programming, otherwise compilation may fail.
2
If the non-English version of LabVIEW translates functional functions into the local language, the compiler may not recognize those functions, leading to compilation errors, sowhen using this compiler, try to use the 2014 or later English version of LabVIEW!
3
Controls and display controls are prohibited from using characters! Slashes ” / ” and backslashes ” \ “, as well as “:”, “;”, “#” and “&”, these characters are special characters for the compiler, and using them will also lead to compilation errors.
That’s all I can think of for now. As for the specific programming methods using this compiler, let’s continue in the next class~ I’m off, bye!
WeChat has been updated again
To avoid losing contact & get the latest and most interesting information
Remember to star & pin our public account!
How to Pin
1. First click the blue text & scan the QR code to enter;
2. Click the 【●●●】 symbol in the upper right corner;
3. Then click 【Set as Star】 and you are done!!!

Peihua
More fun than you think!

Written on: 19.03.19
Long press the QR code to follow