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

AVEVA™ Plant SCADA

SPCSpecLimitGet

  • Last UpdatedJul 18, 2023
  • 2 minute read

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

sSPCTag:

The SPC Tag name as defined in SPC Tags.

LSLVariable:

The Cicode variable that stores the Lower Specification Limit (LSL). Do not specify a constant in this field. Must be a Real type global variable.

USLVariable:

The Cicode variable that stores the Upper Specification Limit (USL). Do not specify a constant in this field. 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 LSL is written to LSLVariable, while the USL is written to USLVariable.

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 * rIncPercent;

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

SPC Functions

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