Chapter21.Using DataHub Commands

Table of Contents

21.1. Command Syntax
21.2. Return Syntax
21.3. Sending Commands by TCP

The DataHub has an internal command set, documented in the OPC DataHub Command Set reference. When you change the configuration of the DataHub in the Properties window, one or more of these commands is written in the configuration file, and the DataHub receives that command every time it starts up. You can use these commands to create custom configuration files. (Please see AppendixB, Configuration Files.)

It is also possible to issue these commands to the DataHub during run-time in any of the following ways:

This is how custom applications can interact directly with the DataHub. For example, DataSim connects to the DataHub by using the DataHub APIs for C++, Java, and .NET.

21.1.Command Syntax

DataHub commands have the following syntax:

(command arg1 arg2 ...)

The whole command must be surrounded by parentheses. The command name and its arguments are each separated by white space—single spaces, tabs, or carriage returns are allowed. For example, the following line of a custom configuration file tells the OPC DataHub to create a new data domain, named TestDomain.

(create_domain TestDomain)

Multiple-word strings must be in quotes. Numbers take their own values. Booleans are 0 for false and 1 for true.