registerPoint

registerPoint — registers to receive updates from a DataHub point.

Synopsis

For C++:
ST_STATUS registerPoint(point,  
 create); 
CDataHubPoint& point;
bool create=TRUE;
 
ST_STATUS registerPoint(pointname,  
 create); 
LPCTSTR pointname;
bool create=TRUE;
 
For Java:
Exception registerPoint(point,  
 create); 
DataHubPoint point;
boolean create;
 
Exception registerPoint(pointname,  
 create); 
String pointname;
boolean create;
 
For C#:
Exception registerPoint(point,  
 create); 
DataHubPoint point;
bool create;
 
Exception registerPoint(pointname,  
 create); 
String pointname;
bool create;
 

Parameters

point

A DataHubPoint object. The name member must be valid.

pointname

The name of the point.

create

If TRUE, then the point is created if it does not already exist. If FALSE and the point does not exist, then an error message will be generated.

Returns

For C++:
  • ST_OK if the command was successfully sent to the DataHub instance. Since the command is sent asynchronously, the actual success or failure of the command must be determined through the onSuccess or onError message handlers.

  • ST_NO_TASK if a connection to the DataHub instance does not exist.

  • ST_ERROR if the connection socket is unable to send the message.

Description

When a point is registered with the DataHub instance, any changes to the value of that point in the DataHub instance will cause the onPointChange method to be called. If the DataHub point does not exist, then DataHub instance will respond with an error, and onError will be called with the following arguments:

status: ST_NO_POINT
msg: "Point does not exist"

See Also

writePoint, unregisterPoint, createPoint, registerDomain