Documente Academic
Documente Profesional
Documente Cultură
In the last post, we have the below vi at the end. This vi get continuous data from the
COM Port and then display it in the Response and the 1D array.
In the above image, the Data 1D displays the values separately and differentiate it on the
basis of a characters “,” i.e. comma.
In other words, Data 1D has a array, which consists of three values coming from the
serial port.
So if like we have sent the values 120,221,312, then the array(0) will have 120, array(1)
will have 221 and finally the array(2) will have 312.
In order to plot the values on the graph separately, what we need to do is to simply get
array(0) and then plot it vs time and so on, which is shown in below figure:
As you can see in the above figure, the logic we used is quite simple, what we did is we
simply get the array just before Data 1D and then broke it into parts i.e. array(0), array(1)
and array(2) and then fed it to the Graph plots.
In this particular example I am using accelerometer IMUv2 and displaying its values on
the graph.
After adding these blocks you are done. Now press Ctrl+T and open the Front Panel. My
front Panel looks like as shown in below figure:
Now first of all select the COM port from which you are receiving the data. If you can’t
find yours, then click on the Referesh, you will find in the drop down.
Now, run the vi and then click on the Start button and you will start receiving the values.
The values will be displayed in the Response as it is and then in the Data 1D and will
also display on these graphs separately as shown in the below figure:
Now, you can see the data is displayed. In this vi, we have displayed the data in three
formats:
1. Response: It shows the complete data coming from the Serial Port.
2. Data1D: It separates the data and then displays it in digital format.
3. Graphs: They plot the real time graph of the coming data.
I have attached the vi below for download but I would recommend you guys to design it by
yourself so that you learn the most out of it.