对不起,图片贴不上去,复制代码段如下: '========================================================== ' SERIAL PORT SETTING & DATA SEND '==========================================================Private Sub SendStrData(strData As String)
With MSComm1 If .PortOpen Then .PortOpen = False 'Close Port .CommPort = 1 'Select Serial Port .OutBufferCount = 0 'Empty Out buffer .InBufferCount = 0 'Empty Input buffer .Settings = "9600,n,8,1" 'Port Setting .RThreshold = 0 'stop receive data rspounding .RTSEnable = False 'RTS check enabled .DTREnable = False 'DTR check enabled .Handshaking = comNone 'Forbid Hand shaking .InputLen = 0 'Receive all data in input buffer .InputMode = comInputModeText 'Receive Mode: Text .PortOpen = True .Output = strData End With