PDA

Click to See Complete Forum and Search --> : getting data from serila port using MSCOMM conmtrol


shastri_s
Dec 12th, 1999, 08:52 PM
has anybody used the MScomm control to get the serial data available on the port.

When I try to send some dataon MSCOMM.output command, it does not allow me( just to check that it works).

any ideas ?

Foll. is the code :

Private Sub Form_Load()
' Open the serial port
MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
Dim ss As Variant
ss = "a"
MSComm1.Output = ss
MSComm1.InputLen = 0
MsgBox MSComm1.Input
End Sub

Thanks

Bart
Dec 12th, 1999, 09:11 PM
You should add an enter to ss: ss = "a" & vbcrlf
Use MSComm.input in the OnComm event.

shastri_s
Dec 12th, 1999, 10:44 PM
thanks, man.

Will try and let u know.

Shastri