Private Sub Form_Load()
On Error GoTo A
MSComm1.Settings = "4800,n,8,1"
MSComm1.RThreshold = 5
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InputLen = 0
c.Wait (1)
bElc = True
If MSComm1.Input = "" Then
MsgBox "电子秤连接异常", 0 + 64, Me.Caption
cmdGetQty.Enabled = False
bElc = False
End If
Exit Sub
A:
MsgBox "电子秤连接异常", 0 + 64, Me.Caption
cmdGetQty.Enabled = False
End Sub好奇怪呀,为什么不管机器接不接地磅,MSComm1.PortOpen = True一直都能打开,在其他程序中相同的代码却正常的不能打开
有哪位高人知道怎么回事不
On Error GoTo A
MSComm1.Settings = "4800,n,8,1"
MSComm1.RThreshold = 5
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InputLen = 0
c.Wait (1)
bElc = True
If MSComm1.Input = "" Then
MsgBox "电子秤连接异常", 0 + 64, Me.Caption
cmdGetQty.Enabled = False
bElc = False
End If
Exit Sub
A:
MsgBox "电子秤连接异常", 0 + 64, Me.Caption
cmdGetQty.Enabled = False
End Sub好奇怪呀,为什么不管机器接不接地磅,MSComm1.PortOpen = True一直都能打开,在其他程序中相同的代码却正常的不能打开
有哪位高人知道怎么回事不
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货