Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to generate a graph of lines and points based on some data acquired from a USB microcontolador real-time
in C# °
Posted
Comments
shakil0304003 21-Nov-10 1:29am    
Not Clear!!!
Sandeep Mewara 21-Nov-10 3:09am    
Not clear.

That's a very challenging assignment, requiring that you learn to do several things at once. You'll need to interface with your USB microcontroller and receive a data stream from it, then put the data somewhere. Then you need to draw a line graph that updates itself with newly arrived data whenever new data comes in from the USB port. This would probably be accomplished by dividing the tasks into separate threads, one master thread to coordinate everything, and two worker threads to maintain the data flow, and keep the graph updated.

There are some excellent articles here on CodeProject that can teach you about accessing USB ports, and others about graphing. The complexity of the problem is too great to expect an answer here, but spend some time searching for and reading the articles available. After you've become more informed about what you need to do, come back here with specific questions on matters you can't solve yourself.
 
Share this answer
 
It may not be so hard to do this with C# WinForm & a charting library like Zedgraph(an excellent free charting library).The first step is to establish a connection with your device.If you are using RS232 serial communication this may be accomplished with SeialPort class in System.IO.Ports namespace.Once you have connection in place you need to query data from the device via some command or if device is regularly sending data you need to receive this data via your serial port. Now you need to know how the data format is. Suppose you are receiving a CSV string data, that may be X and Y coordinates of the points , now parse this data to Point structure depending on the charting library you are using and once you have collection of these points , plot them on the graph . Now if this is relevant to what you was looking for then you need to know about using SerialPort class and ZedGraph library.Of course you can find number of excellent articles on CodeProject. In my opinion you should develop a working program without any threading and once your application is up and running then you can go for threading to improve the performance. If your data is not pumped at very high rate you may not require a multi- threading at all & also the additional complexity.
 
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