07-29-2022 07:26 AM
Hi,
I have connected MPU9250 sensor to Arduino and have programmed the Arduino using Arduino IDE. The code runs fine and I'm getting the sensor readings on the Arduino serial monitor window.
Now I want to make a GUI page through LabView, which would have dials on it showing the sensor readings, and convert it to an application (exe. form).
Any guidelines on how can I do it? What software do I have to download? Are there any YouTube links that could help me?
Also, programming Arduino through Labview, and making a GUI for an Arduino program, are these two different things?
Please help!
Solved! Go to Solution.
07-29-2022 08:29 AM
yes, everything are different things.
you can program arduino with LabVIEW by using an add on Arduino Compiler (which may not be supported anymore)
you can interface arduino with LabVIEW by using LINX (hobbyist toolkit), there is a section in the community forum with people that can help
you can program arduino with IDE and send data using whatever protocol to you PC, and read that protocol with LabVIEW (it seems that since you already are up and running, this could be the best solution). I suggest Serial USB communication, since it is also easy to test in serial monitor.
Try using LabVIEW community edition if this is a non commercial application.
07-29-2022 08:34 AM - edited 07-29-2022 08:35 AM
@sarwatsarfaraz wrote:Now I want to make a GUI page through LabView, which would have dials on it showing the sensor readings, and convert it to an application (exe. form).
Any guidelines on how can I do it? What software do I have to download? Are there any YouTube links that could help me?
I highly recommend reading this article and watching the presentation: https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial.
It will cover 95% of what you need.
Also, programming Arduino through Labview, and making a GUI for an Arduino program, are these two different things?
It is difficult to answer, because "programming" can mean very different things.
When talking about Micro-Controllers like the Arduino, "programming" can mean to take the compiled binary files and transfer them to the on-chip-memory. Some people want to automate this task and use LabVIEW to do so. They are programming (writing the binary files) using LabVIEW (as an automation tool).
You could also say you are programming the source code that can then be compiled into a binary file that can be executed by the microcontroller. If you do so, you are programming (writing source code) for the (program that can be run on the) Arduino.
You could also say that you already loaded a program on the Arduino and it just just fine (i.e., you get the readings on the serial monitor) and then want a tool that can automatically read and display these values, as you asked in the first paragraph. If you do so, some people say you would program (write source code) for (a program that runs on your computer that communicates with a program that runs on) Arduino.
Being precise with these terms is difficult and people often mix these terms around, leading to much confusion. It is good that you asked and I hope I could clarify it.
07-29-2022 09:09 AM - edited 07-29-2022 09:14 AM
In general there are three ways of using LabVIEW with an Arduino
07-29-2022 03:25 PM
@sarwatsarfaraz wrote:
Hi,
I have connected MPU9250 sensor to Arduino and have programmed the Arduino using Arduino IDE. The code runs fine and I'm getting the sensor readings on the Arduino serial monitor window.
Now I want to make a GUI page through LabView, which would have dials on it showing the sensor readings, and convert it to an application (exe. form).
Any guidelines on how can I do it? What software do I have to download? Are there any YouTube links that could help me?
Also, programming Arduino through Labview, and making a GUI for an Arduino program, are these two different things?
Please help!
Which Arduino?
When I was prorgramming the Arduino Mega and wanted to have it communicate with LabVIEW running on a Windows 10 PC, I used a USB-to-TTL adapter cable.
I then used VISA in LabVIEW.
If you are using the Arduino Uno, which has just one serial port, it gets a little tricky.
Do you intend on having the Arduino continually spit out data or only when the LabVIEW program sends out a query?
07-29-2022 04:16 PM - edited 07-29-2022 04:22 PM
@psuedonym wrote:
Which Arduino?
When I was prorgramming the Arduino Mega and wanted to have it communicate with LabVIEW running on a Windows 10 PC, I used a USB-to-TTL adapter cable.
I then used VISA in LabVIEW.
If you are using the Arduino Uno, which has just one serial port, it gets a little tricky.
Do you intend on having the Arduino continually spit out data or only when the LabVIEW program sends out a query?
Honestly there's no trick to using an Arduino Uno. In fact I don't understand what would be tricky about it as I have use an Uno in all three of the methods I mentioned above without any issues.
The Arduino Uno bootloader goes into a "looking for new firmware" mode for a couple seconds when it comes out of a reset condition. This allows you to stop it from autorunning and reprogram it. Once the Uno goes to "run mode" the serial port becomes available for your program to use to communicate with the Uno.
The only time things get "tricky" with an Uno is when you need more than one serial port on the Arduino.
As for constant data streaming versus a query and response scheme. It depends on where you want to do the (hard) work. Constant streaming has the advantage of easy Arduino implementation but more complicated string parsing may be needed in LabVIEW. While a query/response is easy LabVIEW implementation but more complicated Arduino code.
08-01-2022 10:41 AM
@RTSLVU wrote:
@psuedonym wrote:
Which Arduino?
When I was prorgramming the Arduino Mega and wanted to have it communicate with LabVIEW running on a Windows 10 PC, I used a USB-to-TTL adapter cable.
I then used VISA in LabVIEW.
If you are using the Arduino Uno, which has just one serial port, it gets a little tricky.
Do you intend on having the Arduino continually spit out data or only when the LabVIEW program sends out a query?
Honestly there's no trick to using an Arduino Uno. In fact I don't understand what would be tricky about it as I have use an Uno in all three of the methods I mentioned above without any issues.
The Arduino Uno bootloader goes into a "looking for new firmware" mode for a couple seconds when it comes out of a reset condition. This allows you to stop it from autorunning and reprogram it. Once the Uno goes to "run mode" the serial port becomes available for your program to use to communicate with the Uno.
The only time things get "tricky" with an Uno is when you need more than one serial port on the Arduino.
As for constant data streaming versus a query and response scheme. It depends on where you want to do the (hard) work. Constant streaming has the advantage of easy Arduino implementation but more complicated string parsing may be needed in LabVIEW. While a query/response is easy LabVIEW implementation but more complicated Arduino code.
The part I have highlighted in bold has tripped up many a newbie with Arduinos.
08-02-2022 12:27 AM
So if I go for the second method, all I have to do is download LINX, install the firmware, connect Arduino to my PC and start programming it through Labview? No additional drivers are to be downloaded?
And this method has nothing to with VISA right? Because I haven't downloaded that.
08-02-2022 05:58 AM
yes, but you will have to keep connected all the time to your pc, since you wont be programming your arduino with LabVIEW (besides flashing the LINX firmware to command RX/TX)
i believe that VISA is inside LINX library, opening ports and configuring USB access. In some way, VISA is a Dependency of LINX.
08-02-2022 09:00 AM
@sarwatsarfaraz wrote:
So if I go for the second method, all I have to do is download LINX, install the firmware, connect Arduino to my PC and start programming it through Labview? No additional drivers are to be downloaded?
And this method has nothing to with VISA right? Because I haven't downloaded that.
I believe if you install it through the JKI Package manager it will make sure you have all the dependencies installed.
But I have to wonder why you have not installed VISA? It's free and the vast majority of LabVIEW communications uses it in some way.