Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

SPCProcessXRSGet

  • Last UpdatedJul 18, 2023
  • 2 minute read

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 [, sClusterName] )

sSPCTag:

The SPC Tag name as defined in SPC Tags.

XVariable:

The Cicode variable that stores the process mean (X double bar). A constant is not allowed. Must be a Real type global variable.

RVariable:

The Cicode variable that stores the range (R). A constant is not allowed. Must be a Real type global variable.

SVariable:

The Cicode variable that stores the standard deviation (S). A constant is not allowed. Must be a Real type global variable.

sClusterName:

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.

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

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in