Dialog: Project Settings - Communication

Top  Previous  Next

Menu Tools > PROPERTIES Project Settings... | Communication

 

Communication Mode

 

Send/Receive

Docklight acts both as transmitter and receiver of serial data. This mode is used when Testing the functionality or the protocol implementation of a serial device or simulating a serial device.

Naming conventions: The received data (RX) will be displayed and processed as "Channel 1", the transmitted data (TX) will be displayed as "Channel 2".

 

Monitoring

Docklight receives serial data on two different communication channels. This mode is used, for example, when Monitoring the communication between two devices.

Naming conventions: The serial data from device 1 is "Channel 1", the data from device 2 is "Channel 2".

 

Communication Channels - Serial COM ports, Docklight TAP ports, TCP or UDP communications

In Docklight Scripting, a communication channel can be configured as a serial COM port (RS232, RS422 or RS485), as TAP port for Docklight Tap monitoring, or as a network communication socket for TCP or UDP. The following settings can be used:

 

Setting / Examples

Description

COMxxx

 

COM1

COM256

The channel is connected to a serial COM port.

Use the dropdown list to see all COM ports available on your PC from the Windows operating system.

TAPx

 

TAP0

TAP1

The channel is connected to one of the Docklight Tap monitoring data directions. The TAP connections are only available if Communication Mode is set to 'Monitoring', the Docklight Tap is plugged in and the Docklight Tap USB device drivers are installed properly.

RemoteHost:RemotePort

 

192.168.1.100:10001

NIC.COM:80

LOCALHOST:504

The channel acts a TCP client.

When starting communications, it connects to the host and TCP port specified. For RemoteHost you can enter

an IP4 address, e.g. 192.168.1.100
a host name, e.g. NIC.COM (for accessing a server on the Internet) or the Windows NetBIOS name for another computer on your local network.
the LOCALHOST keyword which always points to the computer Docklight is running on. This is equivalent to using the loopback IP address 127.0.0.1.

SERVER:LocalPort

 

SERVER:10001

SERVER:80

SERVER:504

The channel acts as a TCP server. When communication is started, Docklight accepts one connection from a TCP client. When a client is connected, further connection attempts are rejected. 

UDP:RemoteHost:Port

 

UDP:10.0.0.1:8001

UDP:LOCALHOST:10001

 

The channel acts as a UDP peer. Transmit data is sent to the destination RemoteHost:Port, and Docklight listens to UDP data on the local UDP port number Port.

When using a channel setting like UDP:LOCALHOST:10001 you effectively create a loopback, similar to a serial port loopback, where and all outgoing data is immediately received.

UDP:RemoteHost:RemotePort:

LocalPort

 

UDP:10.0.0.1:8001:8002

The channel acts as a UDP peer, but using different port numbers for outgoing and incoming data. Data is transmitted to RemotePort, and Docklight listens on the LocalPort.

UDP:LocalPort

 

UDP:10001

The channel acts as a UDP server. Docklight listens for UDP data on LocalPort. Send data is transmitted to the source IP and port number of the last UDP packet received.

 

Monitoring Mode - Channel Combinations And Their Applications

In Monitoring Mode, two communication channels are available, which can be set up individually. This allows Docklight Scripting to be used in a large number of different applications and test environments. Below is a list of typical channel combinations:

 

Communication Channel Settings

Example Settings

 

Application

Ch1: COM Port

Ch2: COM Port

COM1

COM2

Monitoring Serial Communications Between Two Devices using the Docklight Monitoring Cable

Ch1: Docklight Tap

Ch2: Docklight Tap

TAP0

TAP1

Monitoring Serial Communications Between Two Devices using the Docklight Tap

Ch1: COM Port

Ch2: TCP Server

COM1

SERVER:10001

Emulating a Serial Device Server. A client can connect to the Docklight server on port 10001 and talk to the serial device connected on COM1.

Ch1: TCP Client

Ch2: TCP Server

10.0.0.1:502

SERVER:502

Monitoring a Client/Server TCP Connection

Ch1: UDP Peer

Ch2: UDP Peer

UDP:10.0.0.1:8001

UDP:10.0.0.2:8002

Monitoring and forwarding a UDP transmission, similar to the TCP example above. Note that for each channel you need to specify a different UDP port, because each channel needs to listen on its own separate port number.

 

 

COM Port Settings (serial COM channels only)

 

Baud Rate

Choose a standard baud rate from the dropdown list, or use a non-standard baud rate by typing any integer number between 110 and 9999999.

 

NOTE: Non-standard baud rates may not work correctly on all COM ports, dependant on the capabilities of your COM port's hardware UART chip. You will receive no warning, if any non-standard rate cannot be applied.

 

NOTE: Although Docklight's Project Settings allow you to specify baud rates up to 9 MBaud, this does not mean Docklight is able to handle this level of throughput continuously. The average data throughput depends very much on your PC's performance and the Docklight display settings. See also How to Increase the Processing Speed.

 

Data Bits and Stop Bits

Specify the number of data bits and stop bits here. As with the baud rate, some of the available settings may not be supported by the COM port device(s) on your PC.

 

Parity

All common parity check options are available here. (The settings 'Mark' and 'Space' will probably not be used in practical applications. 'Mark' specifies that the parity bit always is 1, 'Space' that the parity bit is always 0, regardless of the character transmitted.)

 

Parity Error Character

This is the character that replaces an invalid character in the data stream whenever a parity error occurs. You should specify an ASCII character (printing or non-printing) that does not usually appear within your serial data stream. Characters may be defined by entering the character itself or entering its decimal ASCII code (please enter at least two digits).

 

NOTE: Choose "(ignore)" for the Parity Error Character if you need to transmit/receive the parity bit but Docklight should preserve all incoming characters, even when the parity bit is wrong. This is useful for applications where a 9th bit is used for addressing purposes and not for error checking.