Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/08/2004, 00:33
Panzon
 
Fecha de Ingreso: agosto-2004
Mensajes: 4
Antigüedad: 20 años, 7 meses
Puntos: 0
En una forma agregas un Textbox llamado Texterminal, y el control MSComm.

'Aqui se abre el puerto
'
Private Sub Form_load()
Comm.CommPort = 1
Comm.Settings = "9600,n,8,1"
Comm.RThreshold = 1
Comm.PortOpen = True
End Sub


'Aqui se escribe en el puerto
'
Private Sub TextTerminal_KeyPress(KeyAscii As Integer)
Comm.Output = Chr$(KeyAscii)
KeyAscii = 0
End Sub



'Aqui se recibe del puerto
'
Private Sub Comm_OnComm()
Dim a$

Select Case Comm.CommEvent
Case comEvReceive
a$ = Comm.Input
TexTerminal.text = TexTerminal.text & a$
Case comEvCTS
Case comEvDSR
Case comEvCD
Case comEvRing
Case Else
MsgBox "Otro evento de Comunicacion" & Str(Comm.CommEvent)
End Select
End Sub

Espero que te sirva.............El Panzon