Results 1 to 2 of 2

Thread: Com Port question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    8

    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

  2. #2
    Lively Member
    Join Date
    Sep 2002
    Posts
    77
    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
  •  



Click Here to Expand Forum to Full Width