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

SPCSubgroupSizeSet

Sets a new subgroup size for the specified SPC tag. The new subgroup size becomes the new size as long as the SPC (trend) server is running. The subgroup size is updated first in the SPC server, which then informs the clients to update. This will force re-calculation of SPC values (UCL and LCL) across the span of any displayed charts.

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

SPCSubgroupSizeSet(sSPCTag, iSize [, ClusterName] )

sSPCTag:

The SPC Tag name as defined in SPC Tags.

iSize:

The new size of the subgroup to set.

ClusterName:

Specifies the name of the cluster of the SPC tag.

Return Value

0 (zero) if successful, otherwise an error number is returned.

Related Functions

SPCSubgroupSizeGet

Example

/* This function increments the subgroup size for FEED_RATE_1 by
the specified amount. */
INT iSize;
! This variable needs to be global to the file, so is declared outside of the function
INT
FUNCTION
IncSubgroupSize(INT iIncrement)
INT iError;
iError = SPCSubgroupSizeGet("FEED_RATE_1", iSize);
! If no error, iSize now contains the current subgroup size of FEED_RATE_1
iSize = iSize + iIncrement;
IF iError = 0 and (isize > 1) THEN
iError = SPCSubgroupSizeSet("FEED_RATE_1", iSize );
END
Return iError;
END

See Also

SPC Functions