LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use LabVIEW to do a real time plot of data processing by Arduino Mega

what i am trying to do is to plot out the value of a variable while arduino is running.

Is it possible to use LabVIEW to do it? 

I try to use Matlab to read serial port while arduino send out the variable value through serial port. but thats not real time, Matlab can only draw the plot after the run.

 

thanks for any suggestion and info.

 

 

0 Kudos
Message 1 of 5
(5,830 Views)

Yes, as fast as the delay due to the serial port isn't the problem. At >100kbaud full of data you have to start thinking about bottlenecks in your software, for lower baudrates it should be no problem.

The most simple way is: init your serial, set the arduino into continuous send mode , enter a loop the read one (set of) value(s) the serial, decode what you read and send it to a chart diagram. When a stop button is pressed ....ah, it's faster to draw in LabVIEW than to explain ....

read serial loop.png

 

If more data processing is needed, or the reading of a single value is more complex, a producer consumer architecture is the best way to go....

More details for the serial protocol , amount of data , example data stream stored in a string constant of your vi etc is helpful for more assistant.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 5
(5,826 Views)

You can plot while it is running in LabVIEW.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 3 of 5
(5,824 Views)

hello Henrik,

 

thanks a lot for your enlightenment. I try to use what you have suggested to plot, but got some problem.

this is my arudino code:

i just let arduino send a string to serial port.

my labview diagram

it is almost the same as you suggested.

when I run it, this function report error

;

error:

I have no idea which part got problem, do you have any idea on it?

my ultimate goal is to display the "test" variable in arduino code, and plot the real time plot of values of "test", which is a float number.

 

thanks for your help, expect your answer. 🙂

 

Regards

SF 

0 Kudos
Message 4 of 5
(5,789 Views)

@Henrik Volkers wrote:

More details for the serial protocol , amount of data , example data stream stored in a string constant of your vi etc is helpful for more assistant.

 



Stream some datastrings into a string indicator ... right klick and make current data default.... save the vi and post it here...

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 5
(5,773 Views)