4 accumulator operations, Accumulator operations – Rice Lake iRite IDE User Manual

Page 39

Advertising
background image

920i

Programming Reference - API Reference

35

5.1.4

Accumulator Operations

ClearAccum

Sets the value of the accumulator for scale S to zero.

Method Signature:
function ClearAccum (S : Integer) : SysCode;

Parameters:

[in]

S

Scale number

SysCode values returned:

SysInvalidScale

The scale specified by

S

does not exist.

SysPermissionDenied

The accumulator is not enabled for the specified scale.

SysDeviceError

The scale is reporting an error condition.

SysOK

The function completed successfully.

Example:
ClearAccum (Scale1);

GetAccum

Sets W to the value of the accumulator associated with scale S, in the units specified by U.

Method Signature:
function GetAccum (S : Integer; U : Units; VAR W ; Real) : SysCode;

Parameters:

[in]

S

Scale number

[in]

U

Units (Primary, Secondary, Tertiary)

[out]

W

Accumulated weight

SysCode values returned:

SysInvalidScale

The scale specified by

S

does not exist.

SysInvalidUnits

The units specified by

U

is not valid.

SysDeviceError

The scale is reporting an error condition.

SysPermissionDenied

The accumulator is not enabled for the specified scale.

SysOK

The function completed successfully.

Example:
AccumValue : Real;

GetAccum (Scale1, AccumValue);

GetAccumCount

Sets N to the number of accumulations performed for scale S since its accumulator was last cleared.

Method Signature:
function GetAccumCount (S : Integer; VAR N ; Integer) : SysCode;

Parameters:

[in]

S

Scale number

[out]

N

Accumulator count

SysCode values returned:

SysInvalidScale

The scale specified by

S

does not exist.

SysPermissionDenied

The accumulator is not enabled for the specified scale.

SysDeviceError

The scale is reporting an error condition.

SysOK

The function completed successfully.

Example:
NumAccums : Integer;

GetAccumCount (Scale1, NumAccums);

Advertising
This manual is related to the following products: