5.2. Receiving data in Excel

Once you have tested Cascade Connect and know it's working, you are ready to receive data from the data server in a Windows application. This part of the tutorial shows you how to make a simple Excel spreadsheet that can receive data from Cascade Connect. It also covers how to configure Cascade Connect to use the spreadsheet.

Note

A final version of the spreadsheet, named testfnl.xls, is part of the Cascade Connect distribution. It can be used in lieu of creating your own, but it should first be saved as test.xls.

5.2.1. Set up a spreadsheet

To begin with, you will need a spreadsheet to receive the data.

5.2.2. Edit a configuration file

You also need to edit a Cascade Connect configuration file so that when you call Cascade Connect it starts Excel, brings up your spreadsheet, and loads the information necessary to communicate with Excel.

5.2.3. Configure a shortcut icon

The best way to access Cascade Connect is with a shortcut icon. The icon you create here defines a link in Windows for Excel.

  1. Copy one of the icons that are displayed in the Cascade Connect Windows group.

  2. Change the name of the icon to Excel Test.

  3. Right click on the icon and display the properties.

  4. Ensure that the Target field reads:

        "C:\path_to_executable\cascade.exe" -i testxls.ini

    where path_to_executable is the complete form of the directory path to where Cascade Connect is installed on your machine. For example, the default installation path is "C:\Program Files\Cogent\Cascade Connect". If the entry is not correct, edit it.

  5. Ensure that the Start in field reads:

        "C:\path_to_executable"

    where path_to_executable is the same as above. If the entry is not correct, edit it.

  6. Save the new icon properties.

5.2.4. Receive the data

  1. Using a console on the data server or a telnet session from Windows, type the following at the command prompt:

        demowrite 200
  2. In the Excel spreadsheet you should see the input1 field update as the data server data arrives. You may notice that the update of this information is slower in Excel than it was before, when we were simply watching the data arrive in Cascade Connect. This is because Excel has to work hard to update the screen each time a value arrives and this slows down the connection. In all cases we have tested, the Windows client program is the slowest link in the connection, and Cascade Connect will always be faster than the Windows client can accommodate.

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