Table of Contents

COM Module/Card CFLink Documentation

The following documentation is for COM (serial port) modules and cards.

Port Configurations

The COM4 supports up to 4 COM port combinations, with RS232, RS422 and RS485 support, including flow control options.

The default port configuration is 4 x RS232, 9600 Baud Rate, 8 Data Bits, No Parity, 1 Stop Bit, No Flow Control.

The following tables demonstrate the possible port combinations of a single COM4 module:

Legend:
RS232 without handshaking/flow control RS232 with RTS/CTS RS485 half-duplex RS485/422 full-duplex
1 232 232 2
3 232 232 4
4 x RS232
 
1 232 232 2
3 232H  
2 x RS232
1 x RS232 RTS/CTS
1 232H  
3 232H  
2 x RS232 RTS/CTS
 
1 485  
3 232 232 4
1 x RS485 half-duplex
2 x RS232
1 485  
3 232H  
1 x RS485 half-duplex
1 x RS232 RTS/CTS
1 485  
3 485  
2 x RS485 half-duplex
 
1 485  
3 485/422  
1 x RS485 half-duplex
1 x RS485/422 full-duplex
1 485/422  
3 485/422  
2 x RS485/422 full-duplex
 
1 485/422  
3 232H  
1 x RS485/422 full-duplex
1 x RS232 RTS/CTS
1 485/422  
3 232 232 4
1 x RS485/422 full-duplex
2 x RS232
Note that when using any RS232 mode in combination with RS485 or RS422 (any duplex type), the RS232 must be on ports 3 and/or 4.
RS232 can never be in ports 1 or 2 when using alongside RS485 or RS422.

THE FOLLOWING MODES ARE INVALID!
1 232 232 2
3 485  
2 x RS232
1 x RS485 half-duplex
1 232H  
3 485  
1 x RS232 RTS/CTS
1 x RS485 half-duplex
1 232 232 2
3 485/422  
2 x RS232
1 x RS485/422 full-duplex
1 232H  
3 485/422  
1 x RS232 RTS/CTS
1 x RS485/422 full-duplex

Queries

SPC - Query Configuration

The SPC (Serial Port Configuration) query is used to return the status of the port configurations for the module/card.

Data

> [F2]<ID>[F3]QCOMSPC[F4]<M#>[F5][F5]

Reply

< [F2]<ID>[F3]RCOMSPC[F4]<M#>|<P##>:<MODE>:<BAUD>:<DATABITS>:<PARITY>:<STOPBITS>:<FLOWCONTROL>[F5][F5]

Each port on the COM module/card will be included in the reply.
See the definitions for all returned data in the SPC command.

Example

// Query configuration for Module 2 in a MOD4 on CFLink ID [11]
> [F2][11][F3]QCOMSPC[F4]M2[F5][F5]
// Reply
< [F2][11][F3]RCOMSPC[F4]M2|P01:232:9600:8:N:1:0|P02:232:115200:8:N:1:0|P03:OFF:9600:8:N:1|P04:OFF:9600:8:N:1[F5][F5]
// Ports 03 and 04 are both off.
// Ports 01 and 02 are set to RS232 mode

Configuration Messages

SPC - Configure Serial Port

The SPC (Serial Port Configure) command is used to setup the configuration of each port within the module.
You can configure multiple ports at once, across multiple modules, using the Port and Module separators.

Data

// Target device: COM4 Module
> [F2]<ID>[F3]CCOMSPC[F4]<M#>|<P##>:<MODE>:<BAUD>:<DATABITS>:<PARITY>:<STOPBITS>:<FLOWCONTROL>[F5][F5]

Reply

< [F2]<ID>[F3]RCOMSPC[F4]<M#>|<P##>:<MODE>:<BAUD>:<DATABITS>:<PARITY>:<STOPBITS>:<FLOWCONTROL>[F5][F5]

The reply will contain information for each port of the module/card, even if only one port was changed. See the definitions for all returned data above.

Example

// Set Port 01 to RS485 115200 Baud, 8 data bits, no parity, 1 stop bit, no flow control
// For Module 1 in a MOD4 on CFLink ID [11]
> [F2][11][F3]CCOMSPC[F4]M1|P01:4XXF:115200:8:N:1:0[F5][F5]
// Reply
< [F2][11][F3]RCOMSPC[F4]M1|P01:4XXF:115200:8:N:1:0|P02:OFF:9600:8:N:1|P03:OFF:9600:8:N:1|P04:OFF:9600:8:N:1[F5][F5]

// Port 01 is already set to RS485 mode, now we want to set port 02 to 232 mode.
// For Module 2 in a MOD4 on CFLink ID [11]
// This will break the RS485 mode, as it requires both A and B ports combined.
> [F2][11][F3]CCOMSPC[F4]M2|P02:232:115200:8:N:1:0[F5][F5]
// Reply
< [F2][11][F3]RCOMSPC[F4]M2|P01:232:9600:8:N:1:0|P02:232:115200:8:N:1:0|P03:OFF:9600:8:N:1|P04:OFF:9600:8:N:1[F5][F5]

// Error setting port mode, invalid port combination (only port 01 or 03 can be set in RS485/422 mode)
> [F2][11][F3]CCOMSPC[F4]M1|P04:4XXF:115200:8:N:1:0[F5][F5]
// Reply, when previous command was sent from a LANBridge on CFLink ID [02]
< [F2][11][F3]RCOMERR[F4]Invalid COM Mode:02:CCOMSPC:M1|P04:4XXF:115200:8:N:1:0[F5][F5]

Transmission Messages

SPW - Send Serial Data

The SPW (Serial Port Write) command is used to send serial data out a specific port within the module/card.

// Target device: COM4 Module
> [F2]<ID>[F3]TCOMSPW[F4]<M#>|<P##>:<DATA>[F5][F5]

Note: Only one port can be written to per transmission command.

Reply

// Replying device: COM4 Module
< [F2]<ID>[F3]RCOMSPW[F4]<M#>|<P##>[F5][F5]

If the SPW command is successful, the reply will contain the module/card and port number parameters used for the SPW. The data will not be echoed, in an effort to reduce bus traffic.

Example - Sending Serial Data

// Send a command out of port 02 of a COM4 module in slot 1 of a MOD4 on CFLink ID [04]
> [F2][04][F3]TCOMSPW[F4]M1|P02:PWRON[0D][F5][F5]
< [F2][04][F3]RCOMSPW[F4]M1|P02[F5][F5]

Errors

Notifications

SPR - Read Serial Data

The SPR (Serial Port Read) reply contains any data received via a specific port within the module/card.
This reply is automatically transmitted whenever data is received.

// Replying device: COM4 Module
< [F2]<ID>[F3]RCOMSPR[F4]<M#>|<P#>:<DATA_RECEIVED>[F5][F5]

Example - Receiving Serial Data

// Receive data via port 1 of a COM4 module in slot 1 of a MOD4 on CFLink ID [04]
< [F2][04][F3]RCOMSPR[F4]M1|P01:MV50[0D][F5][F5]

// Receive data via port 3 of a COM4 module in slot 2 of a MOD4 on CFLink ID [04]
< [F2][04][F3]RCOMSPR[F4]M2|P03:Hello World![F5][F5]

Glossary