Click here to Skip to main content
15,867,994 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hey Guys,
I followed a tutorial and done a program in visual studio where its reading in values via the serial port and displaying them in a text box,just random numbers really.Code is only a couple of lines long.
I'm wondering can I graph those values as they're coming in?
I tried this example using the chart component as it only had a few lines of code but was unsuccessful.
http://codeabout.wordpress.com/2011/05/15/easy-way-to-plot-graphs-in-c-and-visual-studio-2010/

Would the above method work combined with passing the value of one of the axis(x axis) from the serial port?
Or if not could anyone direct to another tutorial that shows how to graph the serial port
Posted
Updated 26-Aug-14 15:15pm
v4
Comments
Sergey Alexandrovich Kryukov 26-Aug-14 17:54pm    
Graphing is easy enough, but not clear what do you want to graph, exactly.
Besides, you need to tag the UI library and/or application type you want to use.
—SA
Johnjameson2011 26-Aug-14 21:11pm    
Well I suppose with the graph I wanna have one of the axis as a period of time which I could set myself in the code(0-100 or something) and the other would be the numbers coming in via the serial port.
How its looks isn't hugely important,once I can see the serial value's on the graph I can fiddle around with how it looks.
I'll add more tags.
Sergey Alexandrovich Kryukov 26-Aug-14 23:31pm    
It depends of format of the data coming through a port. Graphics depends on what UI library and/or application type you use. Any preferences?
—SA
Johnjameson2011 27-Aug-14 10:56am    
Everything that is coming through is set to a string but thats what it was set to in the tutorial I followed,graphics can as basic as can be, not trying to do anything fancy.
Sergey Alexandrovich Kryukov 27-Aug-14 11:15am    
You still did not specify application type...
—SA

1 solution

Serial port: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport%28v=vs.110%29.aspx[^].

For graphing, there can be many different options. You can use Microsoft Charts: http://msdn.microsoft.com/en-us/library/dd456632.aspx[^] (for .NET v.4.0-4.5).

For v.3.5, download http://www.microsoft.com/en-us/download/details.aspx?id=14422[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900