當前位置:編程學習大全網 - 網站源碼 - VB6.0如何通過程序修改串口通信參數?

VB6.0如何通過程序修改串口通信參數?

If Combo1.Text = Com1 Then

MSComm1.CommPort = 1

End If

If Combo1.Text = Com2 Then

MSComm1.CommPort = 2

End If

If Combo1.Text = Com3 Then

MSComm1.CommPort = 3

End If

If Combo1.Text = Com4 Then

MSComm1.CommPort = 4

End If

If Combo2.Text = "2400" Then

MSComm1.Settings = "2400,n,8,1"

End If

If Combo2.Text = "4800" Then

MSComm1.Settings = "4800,n,8,1"

End If

If Combo2.Text = "9600" Then

MSComm1.Settings = "9600,n,8,1"

End If

If Combo2.Text = "19200" Then

MSComm1.Settings = "19200,n,8,1"

End If

這樣就可以進行設置了

沒有停止位和校驗位的程序,應該是也壹樣的

  • 上一篇:剛剛裝了Ubuntu,事先對Ubuntu 也有壹些了解,但是在編譯C源文件時出現問題,求助阿!!!
  • 下一篇:人臉識別顏值超準嗎?
  • copyright 2024編程學習大全網