SetCom Statement

Sets or displays parameters for RS-232C port.

Syntax
SetCom #portNumber [, baud ] [, dataBits ] [, stopBits ] [, parity ] [, terminator] [, HWFlow ] [, SWFlow ] [, timeOut ]

Parameters

portNumber
Specify the RS-232C port number as an integer value.

  • Real Part: 1 to 8

  • Windows Part: 1001 to 1008

baud
Optional. Specifies the baud rate. Valid values are: (Default: 9600)

  • 110

  • 300

  • 600

  • 1200

  • 2400

  • 4800

  • 9600

  • 14400

  • 19200

  • 38400

  • 57600

  • 115200

  • When using the Windows Part port, some data may drop in the baud rate of 19200 or higher.
    dataBits
    Optional. Specifies the number of data bits per character. Valid values are 7 and 8.
    stopBits
    Optional. Valid values are 1 and 2. Specifies the number of stop bits per character.
    parity
    Specify the parity. Valid values are O (Odd), E (Even), and N (None).
    terminator
    Optional. Specifies the line termination characters. Valid values are CR, LF, CRLF.
    HWFlow
    Optional. Specifies hardware control. Valid values are RTS and NONE.
    SWFlow
    Optional. Specifies software control. Valid values are XON and NONE.
    timeOut
    Specify the timeout time (positive real number, unit: seconds) as an expression or numeric value. If this value is 0, then there is no time out.

    Description
    When all the parameter is omitted, displays a communication port setting.

    If the several ports are used in the communication at one time with more than 19200 baud rate, error 2929 or 2922 may occur. In this case, select the lower baud rate or avoid using several ports at one time.

    When using the Windows Part port, some data may drop in the baud rate of 19200 or more.

    If any data drops, select the lower baud rate or use the Real Part port.

    Parameters are stored to the Compact Flash inside the Controller. When you execute SetCom, the data is written to the Compact Flash. If a data is written to the Compact Flash frequently, it may shorten the Compact Flash life. Using SetCom only when changing the parameter is recommended.

    See Also
    OpenCom, CloseCom, SetNet

    SetCom Statement Example

    SetCom #1, 9600, 8, 1, N, CRLF, NONE, NONE, 0
    
    SetCom #2, 4800