VB读取串口数据乱码。求指导
PrivateSubForm_Load()'初始化MSComm1.Settings="9600,N,8,1"MSComm1.InputMode=0MSComm1.RThr...
Private Sub Form_Load() '初始化
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputMode = 0
MSComm1.RThreshold = 1
MSComm1.SThreshold = 0
MSComm1.InBufferSize = 1024
MSComm1.OutBufferSize = 512
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
Combo1.AddItem "COM1"
Combo1.AddItem "COM2"
Combo1.AddItem "COM3"
Combo1.AddItem "COM4"
Combo1.AddItem "COM5"
Picture1.Scale (-100, 100)-(100, -100)
Command1.Caption = "采集数据"
Command2.Caption = "打开串口"
Timer1.Interval = 1000
Timer2.Interval = 1000
Timer2.Enabled = False
End Sub 展开
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputMode = 0
MSComm1.RThreshold = 1
MSComm1.SThreshold = 0
MSComm1.InBufferSize = 1024
MSComm1.OutBufferSize = 512
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
Combo1.AddItem "COM1"
Combo1.AddItem "COM2"
Combo1.AddItem "COM3"
Combo1.AddItem "COM4"
Combo1.AddItem "COM5"
Picture1.Scale (-100, 100)-(100, -100)
Command1.Caption = "采集数据"
Command2.Caption = "打开串口"
Timer1.Interval = 1000
Timer2.Interval = 1000
Timer2.Enabled = False
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询