InTouch Configuration

White Papers:
Prev | Hot Standby for InTouch | Next

# 3. InTouch Configuration

### Preliminary Notes

- Every tag in the InTouch application that is transmitted from QNX using Cascade Connect must be configured as an "Indirect" tag in the Tagname Dictionary. This will enable the tag to get its actual value from either Cascade DataHub `a` or `b`, depending on which one is currently active. For example, if we have a message tag named `input1`, then we would configure the tag to an "Indirect Message".

- Every indirect tag that is associated with data coming from QNX will also need to have two additional input tags associated with it. These new tags will be named according to the Cascade DataHub domains that are sending the data to Windows, for example:

          	a@input1	(value for input1 sent by Cascade DataHub a)
          	b@input1	(value for input1 sent by Cascade DataHub b)

  These two points will be linked to `input1` by using InTouch scripts. The `@` sign is the symbol we use as the domain name separator for Cascade Connect. When we have configured this character in the Cascade Connect configuration file, Cascade Connect will know that any characters before the `@` sign will refer to the name of the Cascade DataHub domain that is sending the data.

- You must also create two DDE Access Names within InTouch, one for each Cascade DataHub.

- InTouch must start the two Cascade Connect programs when it starts so that the link to both QNX datahubs is established.

### Step-by-Step Procedure

1. Create a tag in the InTouch Tagname Dictionary called `input1`. You can make this tag a Message, Analog or Discrete type, but remember to select an "Indirect" type tag. In our example we make our data point an "Indirect Message" type.

2. Create tags called `a@input1` and `b@input1`. These tags can be configured as either Memory or DDE type tags. For our example, we will not be sending data back to QNX using these tagnames so we do not need to configure them as DDE. We will configure these tags as Memory Messages.

3. Create a point called `domain`. This point should be configured as a Memory type tag. We will choose to make this tag a Memory Message. This tag will contain a value that indicates the current active datahub domain.

4. Create two more tags called `db_a_up` and `db_b_up`. These tags should be configured to be Memory Discrete type tags. When Cascade Connect starts, it will connect to the first available Cascade DataHub listed in its configuration file. We will be starting two Cascade Connect programs in Windows, one for datahub `a` and one for datahub `b`. When the Connect Server successfully attaches to the Cascade DataHub it sends a message to Cascade Connect telling it that the link to the datahub is established. This message is in the form:

           db_domain_name_up = 1

   In our example, two messages will be sent to InTouch, one from each Cascade Connect. These messages will be `db_a_up = 1` and `db_b_up = 1`. In the InTouch tag datahub, the value for these tags will be set to `1`. If the link to the Cascade DataHub is ever broken, Cascade Connect will send a message `(db_a_up = 0)`, which tells the Windows client that the link has been broken. This is the mechanism that allows InTouch to switch between datahubs when the link to one datahub is lost.

5. Now we need to create a Data Change Script (using the Special ==> Scripts ==> Data Change Scripts selection in the Window Maker menu bar).

   1. In the Tagname field, type `domain`

   2. Click on the Add button.

   3. In the Script field, type:

              input1.Name = domain + "@input1";

      | For all of the data points being transmitted from QNX you will need to duplicate this line in the domain Data Change Script. For example, you may be sending 50 data points from QNX. You must create an entry in the domain Data Change Script for each of the 50 points, for example:
              	tank100_level.Name = domain + "@tank100_level";
              	motor23_amps.Name = domain + "@motor23_amps";
              	gatevalve1_pos.Name = domain + "@gatevalve1_pos";
              	gatevalve2_pos.Name = domain + "@gatevalve2_pos";
              	...
      Remember that you will need to create three InTouch tags for each data point sent from QNX. One point will be the tag used in the InTouch system (e.g. `input34`) and the other two will be used by InTouch to determine the source of the data (e.g. `a@input34` and `b@input34`).

6. Now create another Data Change Script as follows:

   1. In the Tagname field, type `db_a_up`.

   2. Click on the Add button.

   3. In the Script field, type:

              IF db_a_up == 1 THEN
                 IF db_b_up == 0 THEN
                    domain = "a";
                 ENDIF;
              ELSE
                 IF db_b_up == 1 THEN
                    domain = "b";
                 ENDIF;
              ENDIF;

7. We now need to create a similar Data Change Script for datahub `b`, as follows:

   1. In the Tagname field, type `db_b_up`.

   2. Click on the Add button.

   3. In the Script field, type:

              IF db_b_up == 1 THEN
                 IF db_a_up == 0 THEN
                    domain = "b";
                 ENDIF;
              ELSE
                 IF db_a_up == 1 THEN
                    domain = "a";
                 ENDIF;
              ENDIF;

8. We have to create a DDE channel for each of the two Cascade Connect programs. These channels are used to send data between Cascade Connect and InTouch. You may have already created a DDE channel for your original Cascade Connect development. In that case you would simply add another channel to accommodate the second Cascade Connect program. For this description, we will assume that two DDE channels need to be defined. DDE Channels are defined and configured from within InTouch as follows:

   1. Select Special ==> DDE Access Names from the Window Maker menu bar.

   2. Click on the Add button.

   3. For the Access Name, type `cascade1`.

   4. For the Application/Server Name, type `cascade1`.

   5. For the Topic Name, type `data`.

9. We need to repeat this process for the second DDE Channel as follows:

   1. Select Special ==> DDE Access Names from the Window Maker menu bar.

   2. Click on the Add button.

   3. For the Access Name, type `cascade2`.

   4. For the Application/Server Name, type `cascade2`.

   5. For the Topic Name, type `data`.

10. We have found that in our own tests that we need to change the DDE retry timeout settings in order to make InTouch start the two Cascade Connect programs. This is done as follows:

    1. Select Special ==> Configure DDE from the Window Maker menu bar.

    2. In the Retry Initiates: field, type `60`.

11. We now need to configure InTouch so that it starts the two Cascade Connect programs when the user starts the InTouch application. This can be done by creating an Application Startup Script as follows:

    1. Select Special ==> Scripts ==> Application Scripts from the Window Maker menu bar.

    2. In the Condition Type field, select On Startup

    3. In the script field, type:

               StartApp "C:\cascade3\cascade.exe -i c:\cascade3\indir1.ini"
               StartApp "C:\cascade3\cascade.exe -i c:\cascade3\indir2.ini"

Prev | Home | Next
System Configuration | Up | Cascade Connect Configuration

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