el control mscomm debe estar en inputmode=1, inputlen=1, rthreshold=1, 115200 bps
Private hwsw(17) As Integer
Private s As Byte, Tx(0) As Byte
Private borrar As Boolean
Private Sub puerto_OnComm()
"esta es la forma de recepcionar los datos en el puerto Dim Rx(0) As Variant
Dim c1 As Integer
Dim Vacio As String
If puerto.InBufferCount <> 0 Then
Rx(0) = puerto.Input
Vacio = Mid(Rx(0), 1, 1)
If Vacio <> "" Then
c = AscB(Rx(0))
If c = 30 Then
salto = vbNewLine
End If
rec.Text = rec.Text & " " & salto & Hex(c)
End If
salto = ""
End If
End Sub
"la siguiente es la forma de enviar tramas hacia el celular, para mi caso no es 1C sino 10, por favor si cambian 1C a 10 calculen los checksum
Private Sub env_Click()
"FBUS version 1, peticion de la vercion software y hardware
"1E 03 D1 00 03 00 60 AF
"MBUS peticion de la version software y hardware
"1F 00 1D D1 00 03 00 00 03 00 40 93
"peticion de la version software y hardware
"1E 00 10 D1 00 07 00 01 00 03 00 01 60 00 6E D5
"bateria
"1E 00 0C 17 00 04 01 00 02 01 60 XX XX
"puerto.InputMode = comInputModeBinary
"reset
"1E-00-0C-40-00-06-00-01-64-03-01-60-77-24
"estado bateria
"1E-00-0C-40-00-06-00-01-7E-17-01-60-6D-30
"fecha y hora
"1E-00-0C-11-00-06-00-01-00-62-01-42-13-36
"EMEI
" 0 1 2 3 4 5 6 7 8 9 10 11 12 13
"1E 00 0C 1B 00 05 00 00 01 01 60 00 73 1F
"mandar un mensaje de texto
"1E 00 10 02 00 31 00 01 00 01 02 00 07 91 75 03 30 96 00 52 00 00 00 00 11 00 00 00
"05 09 81 21 43 65 87 F9 00 00 00 00 00 A7 00 00 00 00 00 00 E8 32 9B FD 06 01 60 00
"0A B8
hwsw(0) = 30
hwsw(1) = 0
hwsw(2) = 16
hwsw(3) = 1
hwsw(4) = 0
hwsw(5) = 9
hwsw(6) = 1
hwsw(7) = 0
hwsw(

= 1
hwsw(9) = 0
hwsw(10) = 32
hwsw(11) = 1
hwsw(12) = 70
hwsw(13) = 1
hwsw(14) = 96
hwsw(15) = 0
hwsw(16) = 8
hwsw(17) = 8
For y = 0 To 2 Step 1
For a = 0 To 17 Step 1
Tx(0) = hwsw(a)
puerto.Output = Tx
Next a
Next y
puerto.InBufferCount = 0
rec.Text = ""
End Sub
y cuando se cargue la forma
Private Sub Form_Load()
Dim trama As String
puerto.PortOpen = True
s = 85
Tx(0) = s
For b = 0 To 127 Step 1
puerto.Output = Tx
"trama = trama & "U"
Next b
End Sub
Private Sub Form_Unload(Cancel As Integer)
puerto.PortOpen = False
End Sub