从串口读取数据并以图形形式连续显示 [英] Read data from serial port and display it continuosly in graph form

查看:300
本文介绍了从串口读取数据并以图形形式连续显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算做一个监控程序.该程序将能够不断从硬件捕获温度读数.我将需要从串行端口或USB端口接收数据,并以图形的形式连续显示.并具有按钮Save&打开.
请帮助!提前谢谢.


图片 [^ ]

I plan to do a monitoring program. The program will be able to capture temperature reading constantly from hardware. I will need to receive data from the serial port or usb port and present it continuously in graph. and have button save & open .
Pls help! Thanks in advance.


pic[^]

推荐答案

请参阅我的回答


从串行端口读取数据 [ ^ ]

从中,您将获得输入/输出数据并将其显示为图形.

谢谢.
See My answer at


Reading Data from Serial Port[^]

From it you will get the data Input/Output and show it to graph.

Thanks.


就这样.

这闻起来很像您的作业,所以没有代码!

您将需要:
SerialPort类实例:处理已接收数据 [ ^ ]事件和从传感器格式转换为实际温度.
存放它的地方:我建议使用列表类 [
So do it.

This smells strongly of your homework, so no code!

You will need:
A SerialPort class instance: handle the DataReceived[^] event and convert from sensor format to actual temperature.
Somewhere to store it: I would suggest a List class[^] - what type you put in the list depends on what kind of temperatures you receive from the sensor. I would suggest your own class, so that you can timestamp each temperature, to help with charting them.
A Chart control to display it (MS provide one if you aren''t going to make your own - Google will help you find it.
Buttons, and code to save and load - again this will depend on what your values look like.


这篇关于从串口读取数据并以图形形式连续显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆