|
-
Sep 30th, 2002, 10:18 AM
#1
Thread Starter
New Member
Com Port question
Does anyone have any sample code that they could post that shows communication between the PC and a com port using the mscomm control?
thanks!
J
-
Oct 16th, 2002, 06:51 AM
#2
Lively Member
Hope these snipets help
'### this opens the comm port ###
mscom1.Settings = comms.speed + "," + comms.parity + "," + comms.bits + "," + comms.stopbit '"115200,N,8,1"
mscom1.CommPort = 1
mscom1.Handshaking = MSCommLib.HandshakeConstants.comRTS
'mscom1.CTSHolding = False
mscom1.InBufferSize = comms.inbuffersize
mscom1.OutBufferSize = comms.outbuffersize
mscom1.PortOpen = True
'### this send a string ###
mscom1.Output = "at&f&w"
'### use a timer to read the input buffer ###
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim x As Int16
If mscom1.PortOpen = True Then
comms.inbuffer(1) = comms.inbuffer(1) + mscom1.Input '### read receive buffer ###
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|