'open ports 1 and 2
Private Sub Form_Load()
Dim Buffer 'As String
If MSCOM1.PortOpen Then MSCOM1.PortOpen = False 'not required
If MSCOM2.PortOpen Then MSCOM2.PortOpen = False
MSComm1.Settings ="2400,N,8,1" 'IMPORTANT
MSComm2.Settings ="2400,N,8,1"
MSCOM1.CommPort = 1 'SOURCE
MSCOM2.CommPort = 2 'DESTINATION
MSCOM1.PortOpen = True
MSCOM2.PortOpen = True
Do
Buffer=MSComm1.Input
if buffer<>"" then
MSComm2.Output = Buffer
Call DoLog(Buffer)
end if
doevents
Loop
End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
MSComm2.PortOpen = False
End Sub
Sub DoLog(str As String)
Text1.text = Text1.text & vbcrlf & str 'text1 multined textbox...
End Sub