Object representing a COM port on one of the CF devices that can have one (i.e. LanBridge, CFMini, MOD4, DIN-MOD4) or in a modular device (COM4). It inherits the functions and properties of CFLink.IOPort.

This class is a low-level object that you shouldn't need to use directly. Use the convenience methods in the device classes instead.
Instances of this object are being created for you by the device class that holds the port (CFLink.CFMini, CFLink.DINMOD4).
Members

<static> CONFIGURATION_CHANGE :String

Event fired when we receive information about the configuration of an RS232 port (including the initial configuration) Your callback function for this event should have the following prototype: function(event, device, port) the event parameter is the name of this event the device parameter is the CFLink.Device or CFLink.Module object owning this COM/RS232 port the port parameter is the CFLink.RS232Port object.

<static> SERIAL_DATA_RECEIVED :String

Event fired when serial data arrives over a COM or RS232 port. Your callback function for this event should have the following prototype: function(event, device, port, data) the event parameter is the name of this event the device parameter is the CFLink.Device or CFLink.Module object owning this COM/RS232 port the port parameter is the CFLink.RS232Port object. the data parameter is the actual data received
Methods
setBaud ( val )
Parameters:
Name Type Description
val Number 100, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 128000, 256000
Set the port's baudrate and immediately reconfigure the port
setFlowControl ( val )
Parameters:
Name Description
val 0 to disable flow control, 1 to enable. True and false are also valid values
Set whether the port has flow control and immediately reconfigure the port
setMode ( val )
Parameters:
Name Type Description
val string for built-in RS232 ports (LANBridge, CFMini): "OFF" (port OFF), "PGM" (port accepts CFLink packets) or "232" (port acts as an actual RS232 port and forwards notifications on data input). For configurable COM modules, "OFF", "232" (RS232 mode), "485H" (RS485 half-duplex) or "4XXF" (RS485 or RS422 full-duplex)
Set the port mode and immediately reconfigure the port
setParity ( val )
Parameters:
Name Type Description
val string "N" for none, "E" for even, "O" for odd
Set the port's parity setting and immediately reconfigure the port
setStopBits ( val )
Parameters:
Name Description
val 1 or 2 stop bits
Set the number of stop bits to use and immediately reconfigure the port