The Cascade DataHub can be configured with a configuration file at startup, or dynamically during runtime. The commands used for configuration are listed in the Cascade DataHub Command Set reference, but are not yet documented in detail. The most commonly-used commands are:
alive tells the Cascade DataHub that the client is running. |
domain identifies the client domain name. |
enable_dde_client enables or disables DDE client capabilities. |
enable_dde_server enables or disables DDE server capabilities. |
enable_mirror_master enables or disables mirror master capabilities. |
enable_mirror_slave enables or disables mirror slave capabilities. |
enable_tcp_server enables or disables TCP server capabilities. |
heartbeat establishes a heartbeat message. |
ignore ignore a given point. |
register_datahub registers the Cascade DataHub on a given domain. |
request requests the value of a point. |
request_initial_data gets current data when client connection is made. |
timeout suspends data flow. |
The Cascade DataHub can read a configuration file at startup, using the -f option. The commands in the configuration file are written using Lisp syntax. This consists of the name of the command, followed by a space-separated list of arguments, all enclosed in parentheses, like this:
(command arg1 arg2 arg3 ...)
The commands are commonly written one per line. Comments are denoted by a semicolon (;) at the beginning of each comment line. For example:
; This line is a comment. (tcp_service 4601) (enable_tcp_server 1) (enable_mirror_master 1)
There are several ways that the Cascade DataHub can be configured or reconfigured dynamically during run time:
Using the lsend or gsend command-line tools. These two commands are similar, except one uses Lisp syntax, as explained above, while the other uses Gamma syntax. Please refer to the lsend documentation in the Cogent C API manual for more information.
Here is an example using lsend:
[sh]$ datahub -d example
[sh]$ lsend "/dh/example" /dh/example>
/dh/example> (alive) (success "alive") /dh/example> (heartbeat 200) (success "heartbeat" "200") /dh/example>
Here is the same example using gsend:
[sh]$ datahub -d example [sh]$ gsend "/dh/example" /dh/example> alive; (success "alive") /dh/example> heartbeat (200); (success "heartbeat" "200") /dh/example>
The return values for gsend from the DataHub are in also in Lisp syntax.
Sending a command from a C program. The Cogent C API has functions that allow you to send configuration information to the Cascade DataHub. These are explained in the Communicating with the Cascade DataHub section of the Cogent C API manual.
Using the Gamma send and send_async functions. Cogent's Gamma programming language uses these two functions to send commands to the Cascade DataHub and other Cogent products. Please refer to send and send_async in the Gamma manual reference for more details.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.