SetCommPort

This command will enable or disable the serial port on a device.

Group: ceObject

Syntax:             Device.SetCommPort(bEnabled, iPort, nBaudRate, iByteSize, enStopBits, enParity, enFlowControl, nPollingInterval, [bIsUnicode], [bAddPrefix], [nPacketSize])

bEnabled:         (Boolean) True / False, enable or disable the serial port

iPort                 (Integer) 1,2,3,etc - the port number to activate

nBaudRate        (Long) 9600, 19200, etc.

iByteSize          (Integer) 7, 8, etc.

enStopBits        (enStopBits) Select the appropriate stopbits from the drop-down list (1,1.5 or 2)

enParity            (enParity) Select the appropriate Parity from the drop-down list (none, even, odd, etc.)

enFlowControl   (enFlowControl) Select the appropriate FlowControl from the drop-down list (CTS, DSR, XONXOFF, etc.)

nPollingInterval  (Long) The device will poll the serial port and look for data coming in using this timing interval in milliseconds.

bIsUnicode       (Boolean) Optional – alerts the server that the attached COM device sends and receives in UNICODE. The default is False.

bAddPrefix       (Boolean) Optional – when set to true, all data returned in the scan event coming from a COM port will have the COM port as a prefix

nPacketSize      (Long) Optional – when set to a positive number, the data will only be returned in strings of this size. RFgen will cache the data until the packet size has been read.

Example:

Device.SetCommPort(True, 1, 9600, 8, 1, NONE, NONE, 1000, False, True, 8)