Private Sub Command1_Click()
MSComm1.PortOpen = True
MSComm1.OutBufferCount = 0
MSComm1.Output = Text1.Text
End Sub
Private Sub Form_Load()
Me.MSComm1.InBufferCount = 0
Text1.Text = "a123456b"
Me.MSComm1.Handshaking = comXOnXoff
Me.MSComm1.Settings = "4800,n,8,1"
Me.MSComm1.InBufferSize = 1
Me.MSComm1.OutBufferSize = 1
Me.MSComm1.InputMode = comInputModeText
Me.MSComm1.InputLen = 0
Me.MSComm1.RThreshold = 1
Me.MSComm1.SThreshold = 1
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
Text2.Text = MSComm1.Input
MSComm1.PortOpen = False
Case comEvSend
MSComm1.Output = "a123456b"
End Select
End Sub
请做串口的高手指导一下.我要做的是读取一个加密锁里的加密字符窜,读取的指令是:a123456b,但是我收到的都是0.这是为什么呢,我是菜鸟.所以你们不要笑我.