multiplyPointValue

multiplyPointValue — multiplies a Cascade DataHub point value by a specified amount.

Syntax

For C++:

ST_STATUS multiplyPointValue(CDataHubPoint&  point,
 double  value);
ST_STATUS multiplyPointValue(LPCTSTR  pointname,
 double  value);

For Java and C#:

Exception multiplyPointValue(DataHubPoint  point,
 double  value);
Exception multiplyPointValue(String  pointname,
 double  value);

Parameters

point

A DataHubPoint object. The name, seconds and nanoseconds members must be valid.

pointname

The name of the point. The point timestamp is automatically set to the current time.

value

The value by which to multiply the current point value.

Returns

For C++:

    ST_OK if the command was successfully sent to the DataHub. 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 does not exist.

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

Description

This method multiplies the current value of the DataHub point by the specified value. If the DataHub point is not of a numeric type, then the DataHub will respond with an error, and onError will be called with the following arguments:

status: ST_WRONG_TYPE
msg: "Wrong type"

If the DataHub 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

multiplyPointValue(_T("intPoint1"), 1.0);
CDataHubPoint point;
point.name = "realPoint2";
setPointTimeStamp (&point);
multiplyPointValue(&point, 1.234);

See Also

appendPointValue, addPointValue, dividePointValue, writePoint