1.3. Hardware Installation Notes

The following notes can be used to configure and test the Cascade CIF Driver with your Hilscher CIF card.

1.3.1. Configuring the Hilscher CIF Card

The Hilscher CIF series of fieldbus cards are configured through their proprietary MS-Windows based configuration program called Sycon System Configurator. This tool provides a user-friendly interface to set up the bus and field device parameters on the CIF card. This configuration can be developed offline, and then transferred to the CIF card in one of two ways:

Downloaded directly from Sycon

In addition to configuration, the Sycon tool also provides some test and debugging facilities. The tool will communicate with CIF cards installed directly in the same (Windows) machine, or can interface via a null-modem cable to the 9-pin serial connector available on most CIF cards. If the card is installed on the same machine, then its address must be specified to Sycon. Alternatively, using the serial interface, you can program a CIF card which has been installed on a QNX or Linux target machine through a laptop or desktop computer configured for this purpose. This type of programming, while less convenient than programming natively using QNX or Linux, is nevertheless analogous to how other manufacturers program their interface cards and I/O devices through hand-held devices or PC-based configuration programs connected through standard serial or proprietary connectors.

If a particular CIF card does not have a serial programming port, it must be physically installed into a Windows computer, programmed using Sycon, and then moved to the QNX or Linux computer.

Downloaded using the Cascade CIF Driver

The second approach to downloading a configuration to the CIF card is to do it using the Cascade CIF Driver. This approach lets you develop the configuration offline in Windows (using Sycon), and then configure one or more cards in the target OS (Linux or QNX) without installing them in a Windows machine.

First, the configuration is established and saved using Sycon. Then, the configuration must be exported as a .dbm file, as follows:

  1. With the desired configuration open, select the Master (the CIF card).

  2. From the File menu select Export -> DBM to store the file.

    The file is stored in the same directory as the opened configuration file.

  3. Transfer the file to the target system.

    The CIF driver uses the cifDownloadCfg command to transfer the specified file to the specified card. This command can be added to the configuration file that is processed when the driver starts, or can be issued to the driver at any time through the Cogent API utilities lsend or gsend. The response from the command will indicate whether the configuration was downloaded successfully and accepted by the card, or if an error has occured. If an error has occurred, the driver will to fail to start.

If you have problems configuring the CIF card using the Sycon software, you should contact your Hilscher distributor for support.

1.3.2. Licensing the Cascade CIF Driver

The Cascade CIF Driver is licensed based on the particular card that it is driving. The license can be one of two types:

For the Cascade CIF Driver to run on either license, you must supply some information to Cogent or one of Cogent's distributors. Here is the simplest procedure:

Alternatively, to use a configuration file and get a little more information, you can follow this procedure:

  1. Create a configuration file containing the following lines:

        (debug 10)
        (cardInit)
        (cardProfile) 

    or use the file provided in /usr/cogent/drivers/cif/detect.cfg.

  2. Switch to root (use the su command), and run the driver as:

        # drcif_ad -f your_cfg_file

    or

        # drcif_ad -f /usr/cogent/drivers/cif/detect.cfg

    If the driver auto-detects the card, it will print the same information as above, but in addition, will also specify that no valid licenses were available, and will provide a key, one per card, similar to:

        0123-4567-89ab-cdef-1234-abcd
  3. E-mail this information to , and we will use it to generate a license for the card. When a permanent, commercial license has been purchased, you must specify the target OS for the driver in your email.

After completing either of the above procedures, once you have supplied the card identification information to Cogent, a software key will be generated and sent to you. It will look similar to:

    ade6-acff-3b69-3859-1769-276b 

This number must be entered on a line in the driver configuration file as:

    (license 0 ade6-acff-3b69-3859-1769-276b)

You may place any number of licenses in a single .cfg file, and so long as one of them matches an installed card, the driver will run.

To facilitate managing licenses for multiple cards, you can save all the licenses in a single file, and then add a single licenseFile command to the configuration file. Note that this file contains only licenses (and optional comments), not commands, without the association between license and card ID enforced by the license command.

1.3.3. Running the Cascade CIF Driver

The Cascade CIF Driver makes privileged calls to map the shared memory of the CIF card, and thus must be run with root privileges. The installation makes the Cascade CIF Driver set the user ID (using setuid) to root by default.

To test the Cascade CIF Driver, you can run it in auto-detection mode using the following command:

    # /usr/cogent/bin/drcif_ad -f /usr/cogent/drivers/cif/detect.cfg

This command will attempt to start the Cascade CIF Driver, will auto-detect up to 4 installed CIF cards, and then fail with no license. In the process it will generate some error messages, and a profile for each detected card. The profile should look like this:

    (cardProfile 0 
         (Id "CIF") (Addr 0XD0000) (MemorySize 2 Kb) (Polled 0) 
         (TypeModel "CIF 30-DPM") (Desc "CIF 30 for Profibus-DP Master") 
         (Protocol "PROFIBUS-DP") 
         (Date 01011997) (GNR 96030020) (SNR 00000235) 
         (OSName "SMSI") (OEMid "") 
         (Firmware "DPM CIF30DPM" "V01.014 22.11.96") 
         (DeviceAddress 0X00) (Mode 4 "HOST controlled, buffered") 
         (Task 2 "PLC " 1015 0) 
         (Task 3 "USR_INTF" 1053 2) 
         (Task 7 "FDL " 1024 0)) 

You can now create your own driver configuration file to reflect your particular setup (see Driver Startup for details). The CIF driver ships with a number of sample files that are copied to /usr/cogent/drivers/cif by the installation script.

Once you have created a driver interface file (e.g., my_config.cfg), you can run the driver with:

    # drcif_ad -f my_config.cfg

If there are errors in the configuration file, the driver will exit with messages indicating the nature of the errors.

1.3.4. Testing communication to I/O

Once the Cascade CIF Driver has started, it will begin a periodic poll of the I/O hardware. This information is stored within the driver, but is not actually transmitted anywhere until you have created a client application. If you prefer, you can download the Cascade DataHub development archive from the Cogent web site. This datahub acts as a universal client and server for process data. You can examine and modify the contents of the Cascade DataHub using one of the commands: readpt, writept, waiter and dhview.

In order to use the Cascade DataHub with the Cascade CIF Driver, the driver must be configured to use the point interface through the configuration commands: digital, analog and group in the .cfg file.

To run the Cascade DataHub see Running the Cascade DataHub in the Cascade DataHub manual. To examine and modify the contents of the Cascade DataHub, see Using the Cascade DataHub Viewer.

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