Results 1 to 2 of 2

Thread: MSCOMM Settigns

  1. #1

    Thread Starter
    Hyperactive Member dRAMmer's Avatar
    Join Date
    Oct 2001
    Location
    strangelans
    Posts
    463

    MSCOMM Settigns

    to what value shall i set the Setings property of mscomm control if i'm using comm port1? does the default value ok to use?
    live, code and die...

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    I'm not sure there is a sensible default setting for Settings.

    This is what MSDN has anyway.

    VB Code:
    1. Private Sub Form_Load ()
    2.    ' Buffer to hold input string
    3.    Dim Instring As String
    4.    ' Use COM1.
    5.    MSComm1.CommPort = 1
    6.    ' 9600 baud, no parity, 8 data, and 1 stop bit.
    7.    MSComm1.Settings = "9600,N,8,1"
    8.    ' Tell the control to read entire buffer when Input
    9.    ' is used.
    10.    MSComm1.InputLen = 0
    11.    ' Open the port.
    12.    MSComm1.PortOpen = True
    13.    ' Send the attention command to the modem.
    14.    MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
    15.    ' the modem responds with "OK".
    16.    ' Wait for data to come back to the serial port.
    17.    Do
    18.       DoEvents
    19.    Buffer$ = Buffer$ & MSComm1.Input
    20.    Loop Until InStr(Buffer$, "OK" & vbCRLF)
    21.    ' Read the "OK" response data in the serial port.
    22.    ' Close the serial port.
    23.    MSComm1.PortOpen = False
    24. End Sub
    This world is not my home. I'm just passing through.

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