W
wangwa
Unregistered / Unconfirmed
GUEST, unregistred user!
如何用MSCOMM采集串口不定长度的实时数据,并取得指定字节(DD)开头的12个字节??
我正在做采集串口的一个程序,我需要从实时接收的串口中取得如下面这样的串,DD,6A,12,XX,XX,XX,XX,F3,XX,XX,45,X3
我用串口助手,采集实时数据如下:
CA 2E 00 00 00 00 00 0E CA 2F 00 00 00 00 00 0F
CA 30 00 00 00 00 00 00 CA 31 00 00 00 00 00 01
CA 01 00 01 00 00 00 02
CA 02 00 00 00 00 00 02 CA 03 00 00 00 00 00 03
CA 04 00 00 00 00 00 04 CA 05 00 00 00 00 00 05
CA 06 00 00 00 00 00 06 CA 07 00 00 00 00 00 07
CA 08 00 00 00 00 00 08 CA 09 00 00 00 00 00 09
CA 0A 00 00 00 00 00 0A CA 0B 00 00 00 00 00 0B
CA 0C 00 01 00 00 00 0D CA 0D 00 01 00 00 00 0E
CA 0E 00 01 00 00 00 0F CA 0F 00 00 00 00 00 0F
CA 10 00 00 00 00 00 00 CA 11 00 00 00 00 00 01
CA 12 00 00 00 00 00 02 CA 13 00 00 00 00 00 03
CA 14 00 00 00 00 00 04 CA 15 00 00 00 00 00 05
CA 16 00 00 00 00 00 06 CA 17 00 00 00 00 00 07
CA 18 00 00 00 00 00 08 CA 19 00 00 00 00 00 09
CA 1A 00 00 00 00 00 0A CA 1B 00 00 00 00 00 0B
CA 1C 00 00 00 00 00 0C CA 1D 00 00 00 00 00 0D
CA 1E 00 00 00 00 00 0E CA 1F 00 00 00 00 00 0F
CA 20 00 00 00 00 00 00 CA 21 00 00 00 00 00 01
CA 22 00 00 00 00 00 02 CA 23 00 00 00 00 00 03
CA 24 00 00 00 00 00 04 CA 25 00 00 00 00 00 05
CA 26 00 00 00 00 00 06 CA 27 00 00 00 00 00 07
CA 28 00 00 00 00 00 08 CA 29 00 00 00 00 00 09
CA 2A 00 00 00 00 00 0A CA 2B 00 00 00 00 00 0B
CA 2C 00 00 00 00 00 0C CA 2D 00 00 00 00 00 0D
CA 2E 00 00 00 00 00 0E CA 2F 00 00 00 00 00 0F
CA 30 00 00 00 00 00 00 CA 31 00 00 00 00 00 01
CA 01 00 01 00 00 00 02 F3 00 00 01 00 DD 65 04 01 00 00 00 F3 00 00 01 00 0B
100分请高手解答,要求有代码!!
我正在做采集串口的一个程序,我需要从实时接收的串口中取得如下面这样的串,DD,6A,12,XX,XX,XX,XX,F3,XX,XX,45,X3
我用串口助手,采集实时数据如下:
CA 2E 00 00 00 00 00 0E CA 2F 00 00 00 00 00 0F
CA 30 00 00 00 00 00 00 CA 31 00 00 00 00 00 01
CA 01 00 01 00 00 00 02
CA 02 00 00 00 00 00 02 CA 03 00 00 00 00 00 03
CA 04 00 00 00 00 00 04 CA 05 00 00 00 00 00 05
CA 06 00 00 00 00 00 06 CA 07 00 00 00 00 00 07
CA 08 00 00 00 00 00 08 CA 09 00 00 00 00 00 09
CA 0A 00 00 00 00 00 0A CA 0B 00 00 00 00 00 0B
CA 0C 00 01 00 00 00 0D CA 0D 00 01 00 00 00 0E
CA 0E 00 01 00 00 00 0F CA 0F 00 00 00 00 00 0F
CA 10 00 00 00 00 00 00 CA 11 00 00 00 00 00 01
CA 12 00 00 00 00 00 02 CA 13 00 00 00 00 00 03
CA 14 00 00 00 00 00 04 CA 15 00 00 00 00 00 05
CA 16 00 00 00 00 00 06 CA 17 00 00 00 00 00 07
CA 18 00 00 00 00 00 08 CA 19 00 00 00 00 00 09
CA 1A 00 00 00 00 00 0A CA 1B 00 00 00 00 00 0B
CA 1C 00 00 00 00 00 0C CA 1D 00 00 00 00 00 0D
CA 1E 00 00 00 00 00 0E CA 1F 00 00 00 00 00 0F
CA 20 00 00 00 00 00 00 CA 21 00 00 00 00 00 01
CA 22 00 00 00 00 00 02 CA 23 00 00 00 00 00 03
CA 24 00 00 00 00 00 04 CA 25 00 00 00 00 00 05
CA 26 00 00 00 00 00 06 CA 27 00 00 00 00 00 07
CA 28 00 00 00 00 00 08 CA 29 00 00 00 00 00 09
CA 2A 00 00 00 00 00 0A CA 2B 00 00 00 00 00 0B
CA 2C 00 00 00 00 00 0C CA 2D 00 00 00 00 00 0D
CA 2E 00 00 00 00 00 0E CA 2F 00 00 00 00 00 0F
CA 30 00 00 00 00 00 00 CA 31 00 00 00 00 00 01
CA 01 00 01 00 00 00 02 F3 00 00 01 00 DD 65 04 01 00 00 00 F3 00 00 01 00 0B
100分请高手解答,要求有代码!!