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.
SPCProcessXRSGet(sSPCTag, XVariable, RVariable, SVariable [, ClusterName] )
The SPC Tag name as defined in SPC Tags.
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.
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.
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.
Specifies the name of the cluster of the SPC tag.
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.
/* This function will set a new override value for Mean, without overwriting the values already in place for Standard Deviation and Range */
! These variables need to be global to the file, so are declared outside of the function
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);