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.
SPCGetHistogramTable(sSPCTag, iNoBars, TableVariable)
The SPC Tag name as defined in SPC Tags.
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.
The Cicode array that will store the histogram data. This variable needs to be defined as a global array of type REAL. The number of elements in the array needs to be equal to (or greater than) iNoBars.
0 (zero) if successful, otherwise an error number is returned. The histogram table is written to TableVariable.
/* This function will get the maximum frequency present in the histogram of a particular SPC tag.*/
! This variable needs to be global to the file so is declared outside of the function
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);