vb.net网口通讯6 vb网口通信( 二 )


31Dim MyBuffer(1024) As Byte
32Dim i As Integer
33i = s.Receive(MyBuffer)
34If i0 Then
35Dim lstrRec As String
36Dim j As Integer
37For j = 0 To i - 1
38TextBox1.Text += Chr(MyBuffer(j))","
39Next
40End If
41End While
42Catch ex As Exception
43MsgBox(ex.Message.ToString)
44End Try
45End Sub
46
47Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
48SendMessage("192.168.0.61", TextBox2.Text)
49End Sub
VB.NET串口通讯怎么发送和接收十六进制?串口通信最终都是用二进制传输的,你用代码把二进制转化成十六进制就可以了 。不需要额外设置 。
VB.net串口通讯接收数据写法Do
Application.DoEvents()
Loop Until MSComm1.InBufferCount = 13
Dim a As String = MSComm1.Input
Label1.Caption = a.Substring(1, 9)
Label2.Caption = a.Substring(10, 3)
关于vb.net网口通讯6和vb网口通信的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读