Private Sub Command1_Click()
 ' Buffer to hold input string
   Dim Instring As String
   ' Use COM1.
   MSComm1.CommPort = 1
   ' 9600 baud, no parity, 8 data, and 1 stop bit.
   MSComm1.Settings = "9600,N,8,1"
   ' Tell the control to read entire buffer when Input
   ' is used.
   MSComm1.InputLen = 0
   ' Open the port.
   MSComm1.PortOpen = True
   ' Send the attention command to the modem.
  
  'MSComm1.Output = "0x20x01TEST MESSAGE0x03"
   Dim exo As Variant
  ' exo = "0x20"
    exo = Chr(2) & "?NUOAEECIA   IAIA  OOII  ?AENAEA " & Chr(3)
    MSComm1.Output = exo

   For i = 1 To 30
       MSComm1.Output = Chr(2) & 1 & Chr(3)
       MSComm1.Output = Chr(2) & Chr(0) & "abcdefghijklmnop" & Chr(3)
       MSComm1.Output = Chr(2) & Chr(1) & "1234567890123456" & Chr(3)
       MSComm1.Output = Chr(2) & Chr(0) & "ABCDEFGHIJKLMNOP" & Chr(3)
       MSComm1.Output = Chr(2) & Chr(1) & "010203040506070809" & Chr(3)
   
   Next i
   
   Dim a(4) As String
   Do
      DoEvents
   buffer$ = buffer$ & MSComm1.Input
   For i = 1 To Len(buffer$)
      a(i) = Asc(Mid(buffer$, i, 1))
   Next i
   Loop Until InStr(buffer$, Chr(19))
   ' Read the "OK" response data in the serial port.
   ' Close the serial port.
   
   
   
   MSComm1.PortOpen = False

End Sub
