Attribute VB_Name = "Module1"
Rem 串行口初始化
Public Sub SCIinit(MSComm1 As MSComm, ByVal COMx As Byte, ByVal SCIFormat As String)
   If MSComm1.PortOpen = True Then
      MSComm1.PortOpen = False
   End If
   MSComm1.CommPort = COMx                   '串行口号
   MSComm1.Settings = SCIFormat            '定义传输格式
   MSComm1.InputMode = comInputModeBinary  '二进制数据格式
   MSComm1.RThreshold = 0            '关闭串行中断
   MSComm1.InputLen = 0              '一次读取缓冲区全部数据
   MSComm1.PortOpen = True           '打开串行口
   MSComm1.InBufferCount = 0
End Sub
