Establishing a Connection

A connection is established using the Establish Connection (CE) instruction . This instructions can be sent with no parameters, or with parameters specifying the destination IP and port.

Option One: With Parameters

With parameters, a CE instructions looks like this:

<STX>PCE192.168.0.5/1001<CR>


The parameters are the IP address and the port to which the DS has to connect.

Option Two: With No Parameters

The CE instruction can be issued simply as <STX>PCE<CR> . In this case, the DS infers the parameters according to the most recent Destination IP-address (DI) parameter and Destination Port Number (DP) parameter it has received. However , if since the last PDI/PDP instructions, another network host has opened a connection to the DS, the DS then uses the Destination IP-address (DI) setting and Destination Port Number (DP) setting and attempts to connect to the destination host defined by these settings.

How to Prevent Another Host From Opening a Connection to The DS

To prevent another host from connection to the DS while you are sending it parameters and instructions to configure an outbound connection, use the Routing Mode (RM) parameter to set it to 2 (Client Only). Thus, a typical connection establishment sequence could go like this (bold lines are commands sent to DS).

Set the DS to work as Client Only, thus denying incoming connections:

<STX>PRM2<CR>                        

DS acknowledges command:

<STX>A<CR>

Set Destination IP address:

<STX>PDI192.168.0.120<CR>        

DS acknowledges command:

<STX>A<CR>

Set Destination Port:

<STX>PDP1001<CR>                

DS acknowledges command:

<STX>A<CR>

Establish the connection:

<STX>PCE<CR>                        

DS acknowledges command:

<STX>A<CR>

Log out of Serial Programming Mode:

<STX>O<CR>                        

DS acknowledges command:

<STX>A<CR>

You are now supposedly connected to 192.168.0.120:1001. To verify this, see Finding Out Connection Status (X) .