[sh]$ writept test1 25
You will need to use this syntax: [sh]$ writept test:test1 25 if you started the DataHub with the command datahub -d test. This is because the point test1 is in the test domain. Please refer to Section 2.4.3, “Domains and Names” for more information. |
[sh]$ readpt test1
[sh]$ readpt test:test1
Point: test1 Value: 25 Time: Jun 14 10:43:38.896 Conf: 100 Lock: 0 Secur: 0
These tests establish that you can read and write data points to the Cascade DataHub. The syntax for writept and readpt are described in the Utilities reference, and their source code is listed in the Writing data to the Cascade DataHub and Reading from the Cascade DataHub appendicies of the Cogent C API manual.
The simplest way to shut down the DataHub is to send a kill -9 command for the DataHub's process ID. A more graceful and orderly method is to send the exit command using the lsend utility, like this:
[sh]$ ps -aux
...
name 19350 0.0 0.3 3160 1612 ? S 16:37 0:00 datahub
name 19354 0.0 0.1 2856 868 pts/0 R 16:39 0:00 ps -aux
[sh]$ lsend 19350
/dh/19350> exit()
</dh/19350 no longer reachable>
/dh/19350(disconnected)>Ctrl-C
[sh]$
If the DataHub shuts down in any way other than using lsend, it takes Linux or QNX a couple of minutes, more or less, to free up the TCP socket that the DataHub was using. So if you kill the DataHub, you'll have to wait a couple of minutes before attempting to restart it. |
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.