If not using the Cascade DataHub

Cascade Connect: Version 4.0
Prev | Chapter 10. Technical Information | Next

# 10.4. If not using the Cascade DataHub

As mentioned earlier, Cascade Connect works well with the Cascade DataHub, but it is not absolutely necessary to use it. It is possible for your data server application to communicate directly with the Connect Server executable, cserve.

## 10.4.1. The cserve executable

The Connect Server executable that converts the data server message protocol (QNX/IP in QNX or SRR/IPC in Linux) to TCP/IP and sends messages to Cascade Connect is called cserve. When cserve is started it searches all nodes of the network for an active Cascade DataHub. If it finds a datahub, cserve will register with the datahub for exceptions. The datahub will then broadcast all current datahub points to cserve, which sends the data to Windows.

If neither the Cascade DataHub nor nserve is running, and if a Server client name has been assigned in the DDE and Name Settings part of the Setup window, cserve will start on the data server and wait for messages from Cascade Connect and from the data server client. The task name of cserve is the name entered in the Connect Server name field of the same part of the Setup window. To send information to Windows, you can send an ASCII message as described below.

Figure 10-2. Cascade Connect components

Messages are transmitted to the Windows computer by cserve. On the Windows computer cascade.exe (the Cascade Connect executable) translates the message to DDE and sends it on to the Windows client program. For more information, see cserve in Cascade Connect Utilities.

## 10.4.2. Writing to cserve

The Connect Server executable (cserve) accepts standard ASCII messages of the form:

        (point name type value)

whose terms are defined as follows:

`point`

  is a literal.

``name``

  is the name of the variable. There is no limit on the length of variable names. Any variable names that contain spaces and unusual characters must be surrounded by double quotes (" ").

``type``

  is one of:

  0 (the value being passed is a character string)

  1 (the value being passed is a double precision floating point)

  2 (the value being passed is a 32 bit integer)

  The type specifier is ignored by Cascade Connect, which simply sends the data as a DDE message to the Windows client program.

``value``

  is the value associated with the variable. If `type` is 1 or 2, then `value` is a number. If `type` is 0, then `value` is a character string. If the character string contains spaces it must be surrounded by double quotes (" "). To include double quotes in a string use \". To pass a backslash (\) use \\.

`( )`

  The parentheses delimit the expression and provide the opportunity to pass many variable changes in one message. Large messages with many point values can be used to reduce communication overheads.

For example, to send a message to the cserve program indicating that the variable `output1` has a value of 55.353 the appropriate ASCII message would be:

        (point output1 1 55.353)

If cserve is sent a new string value for the variable `current alarm`, the ASCII message would be:

        (point "current alarm" 0 "no alarms currently active")

Notice that the `name` and `value` portions of this message are delimited using the quotation character (").

If cserve is sent new values for multiple points, the ASCII message would look like this:

        (point output2 1 57.229)(point output3 1 64.782)(point output4 1 71.088) . . .

## 10.4.3. Receiving from cserve

The cserve program also converts incoming TCP/IP messages to native protocol on the data server computer.

When the Connect Server is used with the Cascade DataHub, cserve automatically sends incoming Cascade Connect data to the datahub. When you are not using the Cascade DataHub, cserve looks for a task that was entered in the Setup window as the Server client name .

cserve sends information to your data server task using an ASCII string with exactly the same format that it accepts, which is:

        (point name type value)

See Writing to cserve (above) for details on this format. If the cserve task cannot find an appropriate recipient for its messages then no values will be sent from Windows to the data server.

## 10.4.4. Non-blocking data transmission

An important consideration for using Cascade Connect without the Cascade DataHub is how to prevent the blocking of data transmissions. Data transmission directly between a data server application and the Connect Server is synchronous. When a data server application sends a message directly to the Connect Server the application blocks until it receives a reply. A critical data server application sending to Windows via Cascade Connect will get bogged down waiting for a slower Windows client to respond to its messages. This unacceptable condition can be resolved by placing the Cascade DataHub between the data server application and the Connect Server. The Cascade DataHub accepts the critical application's messages asynchronously in real time, allowing it to continue working unimpeded.

Without the Cascade DataHub, however, you have to create some sort of asynchronous mechanism on the data server side of the data transmission path. This could be done with a polling program that polls for specific points from the data server application (depending on the speed that the Windows client could receive them), and sends them along to the Connect Server. Any slowdowns in Windows would cause the polling program to block, rather than the critical data server application.

## 10.4.5. Multiple connections

Another consideration is whether you plan to have more than one connection. The Cascade DataHub easily handles multiple connections, allowing free flow of data between any number of Windows and non-Windows machines on the network. Any message sent to the Cascade DataHub is sent to all interested clients, including the Connect Server, which passes it on via Cascade Connect to Windows clients.

If you aren't using the Cascade DataHub, it is still possible to share data between multiple machines, but there are inconveniences. For example, you can share data between a data server and multiple Windows computers by using multiple Cascade Connect licenses, defining a unique name for each of the Cascade Connect sessions. However, the program that is supplying the data for Windows needs to be capable of handling the multiple Cascade Connect tasks. In a similar vein, if you want multiple connections on the data server side, it means writing all the data sources to the single Connect Server (or to the polling program mentioned above). See Making Multiple Connections for details.

Prev | Home | Next
When to use the Cascade DataHub | Up | Start-up sequence

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.