SPCSpecLimitGet
Gets the process Upper and Lower Specification Limits (USL and LSL) 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.
Syntax
SPCSpecLimitGet(sSPCTag, LSLVariable, USLVariable [, ClusterName] )
sSPCTag:
The SPC Tag name as defined in SPC Tags.
LSLVariable:
The Cicode variable that stores the Lower Specification Limit (LSL). This variable needs to be defined as a global of type REAL. Do not specify a constant in this field.
USLVariable:
The Cicode variable that stores the Upper Specification Limit (USL). This variable needs to be defined as a global of type REAL. Do not specify a constant in this field.
ClusterName:
Specifies the name of the cluster of the SPC tag.
Return Value
0 (zero) if successful, otherwise an error number is returned. The LSL is written to LSLVariable, while the USL is written to USLVariable.
Related Functions
SPCClientInfo, SPCSpecLimitSet
Example
/* This function will increase the current USL and LSL of the specified Tag by 10 percent.*/
REAL rLSL;
REAL rUSL;
! These variables need to be global to the file, so are declared outside of the function
INT
FUNCTION
ExpSLbyPercent(STRING sTAG)
REAL rIncPercent = 1.1;
REAL rDecPercent = 0.9;
INT iError;
iError = SPCSpecLimitGet(sTag, rLSL, rUSL);
! If no error, rLSL and rUSL now hold the current values of LSL and USL for sTAG
rLSL = rLSL * rDecPercent;
rUSL = rUSL * rIntPercent;
IF iError = 0 THEN
iError = SPCSpecLimitSet(sTAG, rLSL, rUSL);
END
Return iError;
END
! The function would be called as follows;
Page Button |
||
Button Text |
Expand Temperature Limits |
|
Expression |
ExpSLby10Percent("TANK_1_TEMP"); |
See Also