OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 11875|回复: 7

求一个可以串口发送数据,让电脑画曲线的上位机~~~

[复制链接]

17

主题

175

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1016
金钱
1016
注册时间
2014-4-7
在线时间
99 小时
发表于 2014-5-14 09:24:30 | 显示全部楼层 |阅读模式
5金钱
想用STM32的串口发送若干个数据,让上位机画出曲线,用来分析曲线。。
在你没有做出成绩之前,这个世界不会在乎你的自尊。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

29

主题

94

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
230
金钱
230
注册时间
2013-8-7
在线时间
0 小时
发表于 2014-5-14 11:59:11 | 显示全部楼层
自己操作寄存器写一个发送程序!
回复

使用道具 举报

38

主题

527

帖子

1

精华

金牌会员

Rank: 6Rank: 6

积分
1424
金钱
1424
注册时间
2011-11-27
在线时间
122 小时
发表于 2014-5-14 13:05:06 | 显示全部楼层

#Describes Configuration file syntax for SerialChart application (.scc files)

Introduction

SerialChart configuration is done through a text file. The general format of the file is as follows:

[section1] param1 = value
param2 = value ... [section2] param1 = value
param2 = value[/mw_shl_code]

Setup Section

Each configuration file starts with the [_setup_] section, here you can setup global parameters. For example:

[_setup_] port=COM3   
baudrate=57600 width=1000 height=201 background_color = white
grid_h_origin = 100 grid_h_step = 10 grid_h_color = #EEE grid_h_origin_color = #CCC grid_v_origin = 0 grid_v_step = 10 grid_v_color = #EEE grid_v_origin_color = transparent[/mw_shl_code]

Below are the parameters that can be used in the [_setup_] section:

port

Specifies the communication port to which the software connects. For ex: COM1,COM2,..

baudrate

Baudrate in bps (bits per second). Only certain values are currently supported: 110,300,600,1200,2400,9600,19200,38400,57600,115200.

Please note that currently no flow control parameters are supported, and parity will default to "none", stop bits defaults to 1, as these are most common values.

width, height

width and height of the chart area in pixels

background_color

Background color of the chart.

Note about color formats lease note that colors in .SCC files can be specified in hex format (for ex: #FFF, or #FFFFFF) or named color (white,blue,magenta,pink,gray) see: http://www.w3.org/TR/SVG/types.html#ColorKeywords . Please note the special value transparent which means "no color". You can use it if you don't want some elements to be drawn at all.

grid_h_origin, grid_v_origin

Both horizontal and vertical grids will have an origin axis line, usually of different color from the regular grid lines. These parameters specifies the shift of this line from top/left borders of chart in pixels.

grid_h_origin_color, grid_v_origin_color

Color of the grid origin (axis) line.

grid_h_step, grid_v_step

Draw a grid line at each step of pixels from the origin line.

grid_h_color, grid_v_color

Color of regular grid lines.

Default and Field Sections

SerialChart accepts packets in CSV format (other formats might be supported in the future). Each packet comes on a separate line and each field value is separated by comma. Here is an example of sample data that SerialChart would receive:

100,0.50,0.70 101,0.30,0.50 102,0.25,0.35[/mw_shl_code]

The purpose of the following sections in the configuration file is to specify parameters for each field in the packet. For example:

[_default_] min=-1 max=1 [Field1] color=gray
min=0 max=255 [Field2] color=blue [Field3] color=red[/mw_shl_code]

You can specify parameters that would apply by default to all fields in the [_default_] section. These parameters will apply to all field sections unless they will be overridden in the field section by parameters with the same name.

In the example above note that Field2 and Field3 will inherit min=-1 and max=1 from the [_default_] section. However Field1 will override these values with min=0 and max=255

After you have defined the default parameters, you should define one section for each field that will be received in a packet. Field sections should be in the order in which they are received in the packet.

The name of field sections can be chosen randomly but should be distinct from the reserved section names _setup_, _default_. For that matter avoid any names that start and end with _.

Below is an explanation of the parameters accepted in the [_default_] and field sections:

min,max

These are the field values that correspond to the top and bottom lines of the chart. In other words if you specify min = -1 and max = 1. A value of -1 will be plotted at the top border of the chart , and a value of 1 will be plotted at the bottom border of the chart. A value of 0 (which is is the midpoint between -1 and 1) will be plotted at the middle of the chart. Field values are linearly mapped from [min,max] range to [0,height] range where height is the chart height in pixels, specified in the setup section.

color

This is the color used to plot a field value. Use transparent color value if you don't want a specific field to be plotted.

dash

Creates an interrupted line. For example: dash = 3 will render 3 samples then will not render the next 3 samples, then render 3 samples, then again pause for 3 samples and so on...

SerialChartInstall.exe

4.19 MB, 下载次数: 9646

永远保持一颗学习的心态。
回复

使用道具 举报

38

主题

527

帖子

1

精华

金牌会员

Rank: 6Rank: 6

积分
1424
金钱
1424
注册时间
2011-11-27
在线时间
122 小时
发表于 2014-5-14 13:08:27 | 显示全部楼层
serialchart configuration里设置为以下时:
[_setup_]
port=COM5   
baudrate=57600

width=2000
height=200
background_color = white

grid_h_origin = 100
grid_h_step = 10
grid_h_color = #EEE
grid_h_origin_color = #CCC

grid_v_origin = 0
grid_v_step = 10
grid_v_color = #EEE
grid_v_origin_color = transparent

[_default_]
min=-180
max=180

[Field1]
color=red

[Field2]
color=blue

[Field3]
color=black


下位机发送数据格式为:

printf("%f,%f,%f, \n",x,y,z);
永远保持一颗学习的心态。
回复

使用道具 举报

19

主题

107

帖子

0

精华

初级会员

Rank: 2

积分
195
金钱
195
注册时间
2015-3-5
在线时间
44 小时
发表于 2015-3-12 08:10:27 | 显示全部楼层
http://www.openedv.com/posts/list/22181.htm

楼主,看这个
回复

使用道具 举报

14

主题

338

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
464
金钱
464
注册时间
2013-6-15
在线时间
15 小时
发表于 2015-3-12 16:33:09 | 显示全部楼层
串口猎人....
回复

使用道具 举报

1

主题

5

帖子

0

精华

新手入门

积分
8
金钱
8
注册时间
2021-9-27
在线时间
0 小时
发表于 2021-9-27 09:14:01 | 显示全部楼层
本帖最后由 wuldzdyz 于 2021-9-27 09:31 编辑

DotTrend是一款可以采集串口数据,并将数据绘制成曲线进行展示记录保存的软件,同时兼顾上位机监控功能,欢迎使用.楼主有需要可以联系我:wx_dottrend123
回复

使用道具 举报

0

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
52
金钱
52
注册时间
2019-5-14
在线时间
15 小时
发表于 2021-9-27 22:30:24 | 显示全部楼层
大兄弟谢谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-5-13 12:40

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表