OPCAddItem

OPCAddItem — adds OPC items to a connection.

Syntax

(OPCAddItem label flags propid item (parent...))
    

Arguments

label

The name for this connection, as displayed in the OPC option of the Properties window.

flags

one or more of the following:

IS_BRANCH = 0X0001
IS_LEAF = 0X0002
IS_PROP = 0X0004
PARENT_IS_LEAF = 0X0008
propid

If this point is a property of an OPC leaf item (IS_PROP is true), then the property ID must be entered here. Otherwise, enter 0. This entry is ignored if IS_PROP is not true.

item

The name of the item on the OPC server, as a string.

(parent...)

A list of parent DataHub points (OPC branch nodes) that lead to this point, each as a string. If the point is a property (has a non-zero propid), then the last element of the list should be an OPC leaf node. OPC servers can use the "." character in item names, so this hierarchy is not necessarily derivable from the point name.

Returns

A message indicating success or error. Please refer to Return Syntax for details.

Description

This command adds OPC items to an OPC server connection. It does not take effect until the OPCApply command is issued.

Example

(OPCAddItem "MyOPCServer" 2 0 "Tank3.Level" ("Tank3" "Level"))