readPoint

readPoint — gets the value of a Cascade DataHub point.

Syntax

For C++:

ST_STATUS readPoint(CDataHubPoint&  point,
 bool  create=TRUE,
 bool  force=TRUE);
ST_STATUS readPoint(LPCTSTR  pointname,
 bool  create=TRUE,
 bool  force=TRUE);

For Java:

Exception readPoint(DataHubPoint point);

Exception readPoint(DataHubPoint  point,
 boolean  create,
 boolean  force);

Exception readPoint(String pointname);

Exception readPoint(String  pointname,
 boolean  create,
 boolean  force);

For C#:

Exception readPoint(DataHubPoint point);

Exception readPoint(DataHubPoint  point,
 bool  create,
 bool  force);

Exception readPoint(String pointname);

Exception readPoint(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 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.

    ST_NO_TASK if a connection to the DataHub 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 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