Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:请问下,有关e.Port.ReadExisting()

1楼
baoxyang 发表于:2010/6/30 15:12:00
串口发送的是二进制字节,请问下,如何使用的接收的数据也是二进制字节显示出来。e.Port.ReadExisting()接收的数据是乱码,应如何处理,请指教!!先谢了!!!
2楼
狐狸爸爸 发表于:2010/6/30 15:21:00

With Ports("COM2")

    If .BytesToRead > 0 Then

         Dim b(.BytesToRead) As Byte

         b = .Read

    End If

End With

3楼
baoxyang 发表于:2010/6/30 15:30:00
以下是引用狐狸爸爸在2010-6-30 15:21:00的发言:

With Ports("COM2")

    If .BytesToRead > 0 Then

         Dim b(.BytesToRead) As Byte

         b = .Read

    End If

End With

这个我知道,事例中有,比如想把串口接收数据(b字节数组字节全部显示在一个文本框中)

这个一时不知道如何编写?

 

4楼
狐狸爸爸 发表于:2010/6/30 15:36:00

With Ports("COM2")

    If .BytesToRead > 0 Then

         Dim b(.BytesToRead) As Byte

         b = .Read

         Dim v As String

         For Each t As Byte In Bytes

             v= v & t

         Next

    End If

End With

共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.