01-13-2012 01:29 AM
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.
01-13-2012 02:25 AM - edited 01-13-2012 02:29 AM
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 ....
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.
01-13-2012 02:29 AM
You can plot while it is running in LabVIEW.
01-18-2012 05:00 AM
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
01-18-2012 11:02 AM
@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...