登录
首页 » Com Port » 从串口读取数据,有两种方法, 1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。 2、接收到一个EV_RXCHAR后,等一定数据...

从串口读取数据,有两种方法, 1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。 2、接收到一个EV_RXCHAR后,等一定数据...

于 2022-08-09 发布 文件大小:47.92 kB
0 63
下载积分: 2 下载次数: 1

代码说明:

从串口读取数据,有两种方法, 1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。 2、接收到一个EV_RXCHAR后,等一定数据量的CPU周期(GetTickCount),再一次性读取缓冲区里的数据。这样做,一般情况下不会有问题,但是,如果数据很多,过了“一定数据量的CPU周期”,还没收完数据怎么办?就会少读数据了。 我用三个线程序来完成串口数据的-read data from the serial port, there are two methods, one, each receiving a EV_RXCHAR, on the ReadFile read, I think this vote. 2, received a EV_RXCHAR after a certain volume of data, such as CPU cycles (GetTickCount), and the one-time reader, the data buffer. To do so, under normal circumstances there is no problem, but if many of the data, and after a "certain amount of data the CPU cycles," also confiscated End Data how do? Few will read the data. I used three lines to complete serial data

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 串口通信与工程实践tty编程TTY.dsp,TTY.h
    串口通信与工程实践tty编程TTY.dsp,TTY.h-Serial Communication tty programming and engineering practice TTY.dsp, TTY.h
    2022-06-21 01:23:20下载
    积分:1
  • Kermit协议的嵌入式系统上使用kermit协议与PC机传输的做…
    kermit protocol 嵌入式系统使用kermit协议,与pc传送文件. 可方便的使用windows 超级终端等.-Kermit protocol embedded systems use Kermit agreement with pc transmission of documents. To facilitate the use of windows Super terminals.
    2022-02-03 16:57:11下载
    积分:1
  • 把DS18B20获取来的4字节数据每隔一段时间发送到PC,在串口调试助手上可以看到温度数据....
    把DS18B20获取来的4字节数据每隔一段时间发送到PC,在串口调试助手上可以看到温度数据.-The DS18B20 the past four bytes of data to obtain from time to time sent to the PC, the serial port debugging aids can see the temperature data.
    2023-06-23 15:50:03下载
    积分:1
  • 非常实用的串口通信程序 并且在中间使用了托盘技术 (站长,源程序个数怎么计算啊,其实这里面含有两个源程序,一个是串口通信,一个是托盘程序 )...
    非常实用的串口通信程序 并且在中间使用了托盘技术 (站长,源程序个数怎么计算啊,其实这里面含有两个源程序,一个是串口通信,一个是托盘程序 )-very practical serial communication procedures and the use of in the middle of the tray technology (head source Number how calculated ah, actually it contains two sources, one serial port communications, a procedure tray)
    2022-05-25 10:05:06下载
    积分:1
  • 根据AD7862四232川口电压采集C++串口通信…
    c++串口通信 基于ad7862四路电压采集系统232川口通信,c++上位机程序。-c++ serial communication based on the AD7862 Quad 232 Kawaguchi voltage acquisition system communications, c++ PC program.
    2022-06-01 06:44:14下载
    积分:1
  • 一个用于在窗口下进行串行通信的组件,我已经试过了,…
    用java编写的一个组件,用于windows下串口通信,我已经试过了,可以成功-prepared with a component for serial communications under Windows, I have tried, successful
    2022-03-20 18:55:08下载
    积分:1
  • WL013开发板的串口通信详细例程,包括软件…
    WL013开发板,串口通信详细例程,含软件流程框图,c源程序、asm源程序等!适合初学者学习!-WL013 development board, serial communication detailed routines, including software flow chart, c source. asm2 source, etc.! for beginners learning!
    2023-07-12 04:25:03下载
    积分:1
  • 串行通信接口标准经过使用和发展,目前已经有几种。但都是在RS...
    串行通信接口标准经过使用和发展,目前已经有几种。但都是在RS-232标准的基础上 经过改进而形成的。所以,以RS-232C为主来讨论。RS-323C 标准是美国EIA(电子工业联合 会)与BELL等公司一起开发的1969 年公布的通信协议。它适合于数据传输速率在0~ 20000b/s 范围内的通信。这个标准对串行通信接口的有关问题,如信号线功能、电器特性 都作了明确规定。由于通行设备厂商都生产与RS-232C制式兼容的通信设备,因此,它作为 一种标准,目前已在微机通信接口中广泛采用。-Serial communication interface standard through the use and development, now has several. However, in the RS-232 standard on the basis of an improved formed. So to the main RS-232C for discussion. RS-323C standard is the United States EIA (Electronics Industry Association) and BELL, such as the development of the company in 1969 with the publication of the communication protocol. It is suitable for data transfer rate at 0 ~ 20000b/s within the scope of communication. The standard serial communication interface of the relevant issues, such as signal line features, electrical characteristics have been clearly defined. Because of prevailing production and equipment manufacturers have standard RS-232C compatible communications equipment, t
    2022-02-01 11:07:15下载
    积分:1
  • 从串口读取数据,有两种方法, 1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。 2、接收到一个EV_RXCHAR后,等一定数据...
    从串口读取数据,有两种方法, 1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。 2、接收到一个EV_RXCHAR后,等一定数据量的CPU周期(GetTickCount),再一次性读取缓冲区里的数据。这样做,一般情况下不会有问题,但是,如果数据很多,过了“一定数据量的CPU周期”,还没收完数据怎么办?就会少读数据了。 我用三个线程序来完成串口数据的-read data from the serial port, there are two methods, one, each receiving a EV_RXCHAR, on the ReadFile read, I think this vote. 2, received a EV_RXCHAR after a certain volume of data, such as CPU cycles (GetTickCount), and the one-time reader, the data buffer. To do so, under normal circumstances there is no problem, but if many of the data, and after a "certain amount of data the CPU cycles," also confiscated End Data how do? Few will read the data. I used three lines to complete serial data
    2022-08-09 09:18:25下载
    积分:1
  • 8155扩展程序,可以进新键盘和数码显示的扩展,是一个不错的源代码...
    8155扩展程序,可以进新键盘和数码显示的扩展,是一个不错的源代码-8155 expansion procedures, can enter the new keyboard and the expansion of the digital display, is a good source
    2023-07-20 21:10:03下载
    积分:1
  • 696518资源总数
  • 104353会员总数
  • 66今日下载