Cicode Programming Reference > Cicode Function Categories > Statistical Process Control Functions Introduction > SPCProcessXRSGet

SPCProcessXRSGet

Gets the process mean, range, and standard deviation overrides for the specified SPC tag. The values that are returned are the values that are currently being used by the SPC (trend) server, not necessarily the values specified in the SPC Tag definition.

This function is a blocking function. It will block the calling Cicode task until the operation is complete.

This function can only be called while the SPC tag is being displayed on an SPC page.

Syntax

SPCProcessXRSGet(sSPCTag, XVariable, RVariable, SVariable [, ClusterName] )

sSPCTag:

The SPC Tag name as defined in SPC Tags.

XVariable:

The Cicode variable that stores the process mean (X double bar). This variable needs to be defined as a global of type REAL. A constant is not allowed.

RVariable:

The Cicode variable that stores the range (R). This variable needs to be defined as a global of type REAL. A constant is not allowed.

SVariable:

The Cicode variable that stores the standard deviation (S). This variable needs to be defined as a global of type REAL. A constant is not allowed.

ClusterName:

Specifies the name of the cluster of the SPC tag.

Return Value

0 (zero) if successful, otherwise an error number is returned. The process mean is written to XVariable, the process range to RVariable, and the standard deviation to SVariable.

Related Functions

SPCClientInfo, SPCProcessXRSSet

Example

/* This function will set a new override value for Mean, without
overwriting the values already in place for Standard Deviation and
Range */
REAL rOldMean;
REAL rRange;
REAL rStdDev;
! These variables need to be global to the file, so are declared outside of the function
INT
FUNCTION
Tank1SPCNewMean(REAL rNewMean)
INT iError;
iError = SPCProcessXRSGet("TANK_1_TEMP", rOldMean, rRange, rStdDev);
! If no error, rOldMean, rRange and rStdDev now hold the current values of XRS.
IF iError = 0 THEN
iError = SPCProcessXRSSet("TANK_1_TEMP", rNewMean, rRange, rStdDev);
END
Return iError;
END

See Also

SPC Functions