[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OPEN "COM...             Open a Communications File

 OPEN "COMn: [speed] [,parity] [,data] [,stop] [,RS] [,CS[m]] [,DS[m]]
             [,CD[m]] [,LF] [,PE]" AS [#]filenum [LEN=num]

    Opens a communications device for input and output via GET and PUT.

    Required arguments:

           n    A numeric expression. Must be either 1, for COM1:, or 2,
                for COM2:. An asynchronous adapter must be installed.

     filenum    An integer expression specifying a valid file number.

    Optional arguments (all must be constants):

       speed    Transfer rate, in bits per second. Default: 300. Other
                legal values: 75, 110, 150, 600, 1200, 1800, 2400, 4800,
                and 9600.

      parity    Type of parity checking, if any. Default: E, for EVEN.
                Other legal values: S (SPACE), O (ODD), M (MARK), and N
                (NONE). Parity must be set to N if data is set to 8.

        data    Number of data bits to be transmitted. Default: 7. Other
                legal values: 5, 6, and 8.

        stop    Number of stop bits. Must be 1 or 2. Default: 2, for 75
                and 110 bps; 1, for all other transmission rates.

          RS    If included, suppresses RTS (Request to Send). If not
                included, OPEN "COM..." automatically turns the RTS line
                on.

         CSm    If included, controls CTS (Clear to Send). m specifies, in
                milliseconds, the delay before a timeout occurs. Default:
                1000. Acceptable values: 0 to 65535. If m is 0, the CS
                argument is ignored. If RTS is suppressed via the RS
                parameter, the default CS time is 0 milliseconds.

         DSm    If included, controls DSR (Data Set Ready). m specifies,
                in milliseconds, the delay before a timeout occurs;
                acceptable values are 0 to 65535. Default: 1000. If m is
                0, the DS argument is ignored.

         CDm    If included, controls CD (Carrier Detect). m specifies, in
                milliseconds, the delay before a timeout occurs;
                acceptable values are 0 to 65535. Default: 0. If m is 0,
                the CD argument is ignored.

          LF    If included, sends a line feed after each carriage return.

          PE    If included, enables parity checking, causing a Device I/O
                error on parity errors.

     LEN=num    If included, num specifies the maximum number of bytes
                that can be read from the communications buffer via GET or
                PUT. Must not be larger than the communications buffer,
                which is set via the $COM metastatement. Default: 128.

   --------------------------------------------------------------------------

      Notes:    The speed, parity, data, and stop arguments must be
                presented in that order. Use commas as placeholders for
                omitted arguments.

                The remaining arguments--RS, CS, DS, CD, and LF may be
                specified in any order.

See Also: $COM COM(n) GET (File I/O) ON COM PUT (File I/O)
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson