readPoint

readPoint — gets the value of a DataHub point.

Synopsis

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

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.

force

If a valid connection to the DataHub instance exists but the message is undeliverable immediately (due to the TCP buffer being full), then if the force parameter is TRUE, the message is queued and will be transmitted when possible.

Returns

For C++:
  • ST_OK if the command was successfully sent to the DataHub instance.

  • 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

This method requests that the value of the specified point be transmitted. The point value is received as a point message, which causes the virtual method onPointChange to be called. The point value cannot be obtained synchronously.

If the create parameter is FALSE and the point does not exist, then the 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"

Examples

readPointValue(_T("strPoint1"));
CDataHubPoint point;
point.name = "strPoint1";
readPoint(&point, FALSE);

See Also

writePoint