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

AVEVA™ Plant SCADA

SPCGetHistogramTable

  • Last UpdatedJul 18, 2023
  • 2 minute read

Returns an array containing the frequencies of particular ranges for the given SPC tag. The histogram structure is implied in the order of the table as follows - the first array element is the data less than -3 sigma. The second value is the data between -3 sigma and -3 sigma plus the bar width etc. The last value is the data greater than +3 sigma.

This function can only be called while the SPC tag is being displayed on an SPC page.

Syntax

SPCGetHistogramTable(sSPCTag, iNoBars, TableVariable)

sSPCTag:

The SPC Tag name as defined in SPC Tags.

iNoBars:

The number of bars in the table. The valid range is restricted to values from 7 to 100. This also indicates the size of the array to be returned.

TableVariable:

The Cicode array that will store the histogram data. The number of elements in the array needs to be equal to (or greater than) iNoBars. Must be a Real type global array variable.

Return Value

0 (zero) if successful, otherwise an error number is returned. The histogram table is written to TableVariable.

TableMath

Example

/* This function will get the maximum frequency present in the

histogram of a particular SPC tag.*/

REAL iFrequency[7];

! This variable needs to be global to the file so is declared outside
of the function

INT

FUNCTION

GetMaxFreq(STRING sTAG)

INT iError;

INT iMax = -1;

iError = SPCGetHistogramTable(sTag, 7, iFrequency);

!The elements of iFrequency now hold the histogram table frequencies.

IF iError = 0 THEN

! Get maximum

iMax = TableMath(iFrequency,7,1,0);

END

Return iMax;

END

See Also

SPC Functions

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