In my previous article, I have made the Bridge Monitoring System using Wireless Sensor Network project, which allows me to display all the related measurements from Arduino on my PC. Therefore, in this article, I am going to explain in details on how to display the Arduino measurements using Laboratory Virtual Instrument Engineering Workbench (LabVIEW). Two analog inputs of Arduino will be measured and displayed on a graph in LabVIEW.
LabView Installation Guide Contents: Introduction to LabView How to interface Arduino with LabView VISA drivers installation VI package manager installation Installation of Linx maker hub libraries Activation of LabView Introduction to LabView: Labview is an advanced tool for Engineers and industrial. You will now have access to the Arduino palette in LabVIEW. You can use this palette to interface with the LabVIEW Interface for Arduino Firmware once it has been loaded onto your Arduino. See How Do I Load the LabVIEW Interface for Arduino Firmware Onto My Arduino Uno? For steps on how to setup the firmware.
A brief introduction to LabVIEW, according to Wiki, LabVIEW is a system design platform and development environment using graphical programming made by National Instruments. In other words, it can be used for various purposes such as creating graphical user interface (GUI), programming and simulation, hardware interface and data acquisition (DAQ).
Even though there are many platforms or tools available that can be used to create GUI for Arduino, my personal preference is using LabVIEW, mainly is due to the my previous experience with LabVIEW. The graphical programming is also an advantage as it eliminates the need to learn a new programming language. Creating user interface is also an easy task as LabVIEW was designed to enable engineers without heavy programming background to easily configure and display measurements from DAQ devices.
How do I install gpedit.msc on Windows Starter Edition, Home and Home Premium? I used the following procedure to successfully install gpedit.msc on Windows 7 64 bit Home Premium. Notes: Confirmed as working on Windows 10 by Moab. It apparently works on Windows 8, Windows 8.1 and Windows 10 as well. I have not personally tested this. Microsoft windows grouppolicy clientextensions package list.
To get started, I will explain what is actually going on in Arduino. In this project, I am using an Arduino Nano to acquire signals and send the data to PC. As mentioned earlier, two analog input channels (A0 & A1) will be used to measure input signals. To ensure an accurate measurement is performed at fixed sample rate, the Arduino is configured to wait the predefined interval before taking a measurement and send to PC serially. The concept used is similar to the BlinkWithoutDelay example in Arduino. The benefit of using this method is that there is a while loop that always checks if it has crossed the desired interval. If it is reached, it will take the measurement, else it will skip and you can make it to work on other task.
Here is the code for Arduino, it is also available at my github. Best mac desktop backgrounds.
In this code, Arduino will continuously check the microseconds since the beginning of program using micros() and compare to a previous checkpoint if it is greater than interval defined. This time interval is the sample period, Ts desired in microseconds. The figure below is used to describe the concept of sampling (you can skip this part as it is not required to interface Arduino and LabVIEW, but I feel that it is interesting to introduce the concept of fixed sampling on Arduino here).
Usb drivers for windows 8. Aug 31, 2016 Download and install drivers in Windows 8.1. Content provided by Microsoft. Applies to: Windows 8.1. Select Product Version. Windows comes with drivers for many devices, such as printers, displays, keyboards, and TVs. A driver is software that a device uses to work with your PC. Download the latest driver for your device, and follow the. Windows 8.1 usb driver free download - Windows 8.1, Cisco VPN Client Fix for Windows 8.1 and 10, VIA USB 2.0 Host Controller Driver, and many more programs. USB 3.0 Driver for Windows 7 32 Bit and Windows 8.1 64-Bit. This is the quickest approach to exchange your documents to the PC from the telephone by means of utilizing a good USB information link.
Sample period, Ts is the time interval between each successive measurement. Taking the reciprocal of sample period is the sample rate or sample frequency. Sample rate, fs is a measure of how many samples is taken in 1 second. From the diagram at t = 0s, the first sample is taken. Then it will wait for a time given by the sample period before taking the second measurement at t = Ts. Similarly, after the second sample, the third sample will occur at t = 2Ts. For a measurement, it is desired to have a fixed sample rate so that we can know what is really happening at the exact time and also able to reconstruct the actual signal.
Back to the code, I have configured the Arduino to measure at the sample rate of 20 samples per second (S/s). With that it is also important to note that this sample rate is only able to reconstruct any signals at half of the sample frequency given by Nyquist Shannon sampling theorem. In simpler words, if my sample rate is 20S/s, I am only able to measure signals up to 10Hz. Beyond that, aliasing will occur where higher frequency signal appear as lower frequency content.
Once the measurement on analog input A0 & A1 is made, this measurement together with the actual time interval is formatted into a string stored in the buffer[] variable. This buffer has a header, ‘$’ and terminates with ‘rn’ which is used to move the cursor to the beginning of new line. Within this string, the information is stored in the position in the <>. Finally, this buffer is written serially to the COM port using Serial.write() and we are ready to move on to LabVIEW.
For this project, I am using LabVIEW 2015 to develop the VI. VI or virtual instrument is the file format used to store the program routine developed. In order to interface with Arduino through serial communication, you also need to install the NI-VISA driver. VISA allows you to communicate with instrumentation busses such as USB, Serial or Ethernet.
To give you a big picture of what it looks like for the GUI design, the front panel looks like this.
Breakdown of the elements in front panel:
![]()
And here is the block diagram of the VI. A block diagram is where you ‘draw’ your program using blocks and connect them using wires. This looks a bit complicated or scary, don’t worry, I am just adding a bunch of comments (blocks in yellow with text) to describe each section.
The program start from left to right according the flow of wires. Starting at the left, the COM port is configured with baud rate 115200, 8 bit mode with no parity. The serial communication has a timeout of 10s. And since I had defined the string format, the serial interface is set to read until every termination character and dump for further process.
Connecting Arduino To Labview
Once the serial port is configured, the main loop will read 1000 bytes from the COM port. However, since it was configured to read anything until the term char, it will always return only the string specified. Then a property node is used to check how many bytes remaining in the serial buffer. Ideally, this should be 0 or at least some bounded value. If this value is growing, sooner or later, overflow will occur and some data will be lost. This will happen if the serial device is sending faster than it is read from the PC buffer.
The data read from the serial buffer is passed to a ‘Scan from string’ block. This block will convert the string input based on the format specified and return the individual values from the string. In this case, you can see that two signed 16 bit integer (I16) and an unsigned 32 bit integer (U32) are read. The two I16 corresponds to the two reading from analog inputs and U32 is the time interval taken by Arduino loop.
After the two variables are read from the string, they are combined into a cluster to display on the graph. It’s that simple.
To show how the system works, I am using a myDAQ to generate signals to the Arduino analog inputs. I will cover more on myDAQ in the future article. For now, myDAQ will act as a function generator using the analog output feature. Arduino A0 is fed with a sine wave with 2V peak to peak at 0.5Hz with 2.5V offset and A1 is fed with a sine wave with 1V peak to peak at 1Hz with 2.5V offset. The overall system diagram is as below.
Labview Lifa
Once the VI is executed, this is how the front panel looks like. You can see that there are two sine wave from the graph indicate by two different colours. Besides that, the graph is also set to display actual samples points. In digital domain, the actual samples are just the individual points. The ‘analog’ waveform seen is actually an interpolation and reconstruction by the software to visualise the actual signal measured.
All the Arduino codes and Labview files are available at https://github.com/zxlee/arduino-labview-voltage-display. Basically this is how you can create and visualise your Arduino data easily using LabVIEW. In my opinion, both Arduino and LabVIEW are very powerful tools which you can consider in your next projects. I hope this has covers much of the details needed for you to create your own. If you have any questions, feel free to drop me a comment below.
Arduino Labview Driver Download
If you find this article is useful, give a thumbs up so I know what my readers actually interested and share this article with your friends.
Arduino Labview Drivers
Advertisements
Arduino Labview Driver Manual
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |