-
从串口读取数据,有两种方法,1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。2、接收到一个EV_RXCHAR后,等一定数据量的...
从串口读取数据,有两种方法,1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。2、接收到一个EV_RXCHAR后,等一定数据量的CPU周期(GetTickCount),再一次性读取缓冲区里的数据。这样做,一般情况下不会有问题,但是,如果数据很多,过了“一定数据量的CPU周期”,还没收完数据怎么办?就会少读数据了。 我用三个线程序来完成串口数据的接收,其实就是第一种方法的变种: 一个侦听EV_RXCHAR,一个对EV_RXCHAR进行分析,其实就是超时判断。如果接收到一个消息后,一段时间没收到下一个EV_RXCHAR,就认为是一个数据包的结束。这个线程就会通知数据接收线程,进行数据接收。一般同一包数据,两个字符之间的时间间隔,应该很小了吧,而两个数据包之间的间隔,应该不会太小吧!(这个地方我不清楚,猜的:( :) )最后一个线程,是接收数据的。-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 reception, the first method is a variant : an interception EV_RXCHAR, one pair of EV_RXCHAR analys
- 2023-03-23 09:55:03下载
- 积分:1
-
Advantech Driver Demo : port I/O 软件修改 控制外板输出
Advantech Driver Demo : port I/O 软件修改 控制外板输出-Advantech Driver Demo : port I/O software change control plate output
- 2022-08-09 00:15:30下载
- 积分:1
-
USB转串口的一个例子(源代码),可以在KEIAL下直接编译。...
USB转串口的一个例子(源代码),可以在KEIAL下直接编译。-USB to serial port of an example (source code)
- 2022-02-26 22:23:43下载
- 积分:1
-
使用vb编程RS232输出
comboDevice.AddItem "COM1"
comboDevice.AddItem "COM2"
com...
使用vb编程RS232输出
comboDevice.AddItem "COM1"
comboDevice.AddItem "COM2"
comboDevice.AddItem "COM3"
comboDevice.AddItem "COM4"
comboDevice.AddItem "COM5"
comboDevice.AddItem "COM6"
comboDevice.AddItem "COM7"
comboDevice.AddItem "COM8"-use vb programming RS232 output comboDevice.AddItem "COM a "comboDevice.AddItem" COM2 "comboDevice.A ddItem "COM3" comboDevice.AddItem "COM4" com boDevice.AddItem "COM5" comboDevice.AddIte m "COM6" comboDevice.AddItem "COM7" comboDev ice.AddItem "COM8"
- 2023-09-06 10:00:05下载
- 积分:1
-
提供I2C总线初始化、工作时的启始位、结束位、提供I2C总线的时钟信号,并返回在时钟电平为高期间 SDA信号线上状态。本函数可用于数据发送,也可用于数据接收...
提供I2C总线初始化、工作时的启始位、结束位、提供I2C总线的时钟信号,并返回在时钟电平为高期间 SDA信号线上状态。本函数可用于数据发送,也可用于数据接收-provide I2C bus initialization, the Start-end, provide the I2C bus clock signal, the clock and return to the high-level signal line during the SDA state. This function can be used to transmit data, can also be used for data reception
- 2022-03-19 00:33:10下载
- 积分:1
-
write parking card procedures, yes, oh
停车场写卡程序,不错哦-write parking card procedures, yes, oh
- 2022-03-20 05:32:51下载
- 积分:1
-
Described in detail the use of VB
详细介绍了使用VB开发RS-232通信程序的全过程,并介绍了vb通信控件的用法。-Described in detail the use of VB-RS-232 communication program the whole process and introduced the use of the Communication Control in vb.
- 2023-05-29 22:10:08下载
- 积分:1
-
MSComm in MFC single document of
MSComm在MFC的单文档中的应用-MSComm in MFC single document of
- 2023-05-04 02:25:03下载
- 积分:1
-
DM642串口UART(DM642模拟串口源)
DM642 MCBSP UART(DM642 模拟串口源码)-DM642 MCBSP UART (DM642 analog serial source)
- 2022-01-30 22:30:09下载
- 积分:1
-
this program is targeted at specific GPS receiver
本程序是针对特定GPS接收机--JAVAD公司的legacy的一个应用,用来收取标准的NMEA-1083GGA信息或JPS格式(JAVAD公司的特有GPS信息格式)的{RT,PO}信息,并统计数据大小与经历时间。本程序用VC6.0+串口控件MSComm实现,其中关于如何在数据长度不定的情况下实现数据帧的同步的方法可以借鉴到其它串口数据采集的应用之中,具备一定的实用价值-this program is targeted at specific GPS receiver-- JAVAD the legacy of an application, used to collect standard NMEA- 1083GGA information or JPS format (JAVAD company"s unique GPS information format) (RT, PO) information and statistical data on the size and duration. The procedures used VC6.0 Serial MSComm control, on how volatile the data length of the data frame synchronization method can draw on to other serial data acquisition applications, to have some practical value
- 2022-05-25 01:49:57下载
- 积分:1