Option Explicit
Private Sub cmdOpenCOM1_Click()
Form_Load
End Sub
Private Sub cmdSend_Click()
Dim Instring As String
Dim Buffer As String
Instring = "ABC"
COM1.Output = txtTestText.Text
COM1.PortOpen = False
MsgBox "COM 1 is now closed!", vbInformation, "Port Closing"
cmdOpenCOM1.Enabled = True
End Sub
Private Sub Form_Load()
COM1.CommPort = 1 ' COM 1
COM1.Settings = "9600,N,8,1" ' 9600, NONE, 8, 1
COM1.InputLen = 0 ' GET ALL
COM1.PortOpen = True ' OPEN PORT
cmdOpenCOM1.Enabled = False ' DISABLE BUTTON
MsgBox "COM 1 is now opened!", vbInformation, "Port Opening"
End Sub