vb串口程序运行时总提示8012错误,端口未打开。怎么回事?
PrivateSubCommand1_Click()MSComm1.Output=Text1.TextEndSubPrivateSubCommand2_Click()Di...
Private Sub Command1_Click()
MSComm1.Output = Text1.Text
End Sub
Private Sub Command2_Click()
Dim st As String
st = MSComm1.Input
Text2.Text = st
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
MSComm1.Settings = "9600,N,8,1"
MSComm1.CommPort = 1
MSComm1.InBufferSize = 256
MSComm1.OutBufferSize = 256
MSComm1.SThreshold = 1
MSComm1.RThreshold = 1
MSComm1.PortOpen = ture
End Sub
台式机有串口。 展开
MSComm1.Output = Text1.Text
End Sub
Private Sub Command2_Click()
Dim st As String
st = MSComm1.Input
Text2.Text = st
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
MSComm1.Settings = "9600,N,8,1"
MSComm1.CommPort = 1
MSComm1.InBufferSize = 256
MSComm1.OutBufferSize = 256
MSComm1.SThreshold = 1
MSComm1.RThreshold = 1
MSComm1.PortOpen = ture
End Sub
台式机有串口。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询