How the Wizard Decides Who Opens Connections

When you click Next on the netmask and gateway step the Wizard has enough information to decide which side of the application-to-DS connection will be responsible for establishing data connections with the other side.

In doing this, the Wizard decides on the future values of the Routing Mode (RM) and Connection Mode (CM) settings of the DS. With VSP-to-DS connections , the Wizard would also be able to set the  routing and connection modes on the VSP side. For the application-to-DS connection, the Wizard can only setup the DS side. It is your responsibility to set the application side as expected by the Wizard . For the discussion below we will assume that the application also has "imaginary" routing and connection options, similar in function to the ones found in VSP . Here is what this means:

VSP properties

Corresponding expected application behavior

Server routing mode

Once the application is opened it is ready to accept incoming connections. The application never establishes outgoing connections.

Server/client routing mode

Once the application is opened it is ready to accept incoming connections and establish outgoing connections to the specified IP-address and port number (whichever happens first)

Client routing mode

The application only establishes outgoing connections to the specified IP-address and port number. Incoming connections are not accepted

On data connection mode

The application establishes an outgoing connection when it has the data to send (that is, if outgoing connections are allowed)

Immediate connection mode

The application establishes an outgoing connection as soon as it is started, even if there is no data to transmit (that is, if outgoing connections are allowed)

In general, the Wizard tries to follow the natural flow of data between the application and the serial device. In the initiator of the data exchange step you have already specified which side sends the data first, so the Wizard will have this side open a data connection to the other side as soon as the first data needs to be sent from this side of the connection.

For example, if you are dealing with the "scanner" type of serial device, then the first data is always sent by the serial device. Therefore, the Wizard will program the Routing Mode (RM) setting of the DS to "client". Consequently, the DS will be opening the data connections to the PC application so the application needs to be ready to accept those connections (in VSP terms this is the server routing mode).

Lines 1-3 of the following table illustrate what's just been said. Notice that the Connection Mode (CM) setting is always set to "on data". As the first data is received (by one side of the link) it triggers an attempt to open a data connection with the other side of the link:


Which side can "see" the other side of the connection
Which side sends the first data
Routing Mode on the appl**.
Connection Mode on the appl**.
Routing Mode on the DS
Connection Mode on the DS
1
Both sides can see each other
Application
Client
On data
Server
---
2
Both sides can see each other
Serial device
Server
---
Client
(server/client)
On data
3
Both sides can see each other
Any side
Server/client
On data
Server/client
On data
4
Only PC can see the DS
Application

Client
On data
Server
---
5
Only PC can see the DS
Serial device

Client
Immediately
Server
---
6
Only PC can see the DS
Any side
Client
Immediately
Server
---
7
Only DS can see the PC
Application
Server
---
Client
Immediately
8
Only DS can see the PC
Serial device
Server
---
Client
On data
9
Only DS can see the PC
Any side
Server
---
Client
Immediately

The situation becomes more complicated when only one side of the connection can "see" the other side. Consider the case in line 7 of the table. The application has to send the data first, but it cannot "see" the DS. Therefore, even when the application needs to transmit the data it will be unable to establish a connection to the DS!

The way out is to have the DS connect to the PC (application) as soon as the DS is powered (so, the Connection Mode (CM) setting is 0 (immediately)). This way, by the time the application needs to send the first data to the DS the connection is already established. This kind of connections are called "reverse".

A special comment should be made on line 2 of the table, where the Routing Mode on the DS is designated to be either "client" or "server/client". The Wizard chooses "client" if DS programming is effected using out-of-band access method (you have selected this on the target DS step of the Wizard ). If inband access method was selected the Wizard will set the mode to "server/client". This is because choosing "client" would cause it DS to reject all incoming connections in the future and this means that you wouldn't be able to program the DS using inband access in the future!

* This is the case when you have specified that "the Device Server is not accessible from this PC" on the target DS step, or that "the PC is not accessible from this Device Server" on the netmask and gateway for the DS step of the Wizard.

** "Imaginary" options of the PC application.