Monitoring a Client/Server TCP Connection (Scripting)

<< Click to Display Table of Contents >>

Navigation:  Working with Docklight (Advanced) >

Monitoring a Client/Server TCP Connection (Scripting)

DL-Net-Monitoring-OriginalSetup-OL

 

 

Docklight Scripting allows you to monitor and debug a TCP-based application with the same ease as when using RS232 ports and cables. Instead of using a Docklight Monitoring Cable between the two devices being tested, you can run Docklight Scripting within the network and simply have the client (Device 1) connect to Docklight Scripting instead of the network-enabled product (Device 2).

 

 

DL-Net-Monitoring-Bridging-OL

 

Preconditions

 

Device 1, Device 2 and the PC with Docklight are connected in a common network (LAN).

All IP addresses and the TCP port number are known.

Device 1 is currently configured to connect to Device 2, and communications between the two devices is working.

 

Route and debug TCP traffic

 

A) Route the traffic through Docklight Scripting

In Device 1, change the communication parameters: Device 1 must connect to the Docklight PC (in our example IP 192.0.0.2).

 

 

B) Setup Docklight Scripting for operating as a bridge for the communication between Device 1 and Device 2

1.Choose the menu Tools > PROPERTIES Project Settings...
2.Choose communication mode Monitoring (Receive only)
3.For Receive Channel 1, type the keyword SERVER and the TCP port to listen on (e.g. SERVER:502).
4.For Receive Channel 2, type the IP address and TCP Port number for connecting to Device 2 (e.g. 192.0.0.1:502).
5.Confirm the settings and close the dialog by clicking the OK button.

 

 

C)  Running the test

Start Docklight Scripting using Run > play Start Communication. Let Device 1 connect and perform a test run. Docklight Scripting will act as a bridge between the devices and show you all the TCP data transferred between the devices in the communication window.

 

NOTE: Docklight Scripting does not allow multiple connections on a SERVER port. Only one connection at a time may be used. This is similar to the default operation of many Serial Device Servers.

 

TIP: An example that can be tried on any computer with a web browser and Internet access is the TCP_Monitoring_HTTP.ptp project which can be found in the \Network folder of the \ScriptSamples directory.