PdceMeasureQueryStatus Function

Action

This function provides the status for a given measure for the last collection cycle.

Include file

Pdce.bdh

Syntax

PdceMeasureQueryStatus( in  hMeasure   : number,
                        out uErrorCode : number,
                        out sErrorText : string,
                        in  uSize      : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hMeasure Specifies the measure's handle, from the PdceMeasureSubscribe or PdceAddMeasure function.
uErrorCode Specifies an unsigned integer to receive the error code.
sErrorText Specifies the buffer to receive the measure's error text.
uSize Specifies an unsigned integer providing the size of the buffer (optional).

Example

dcltrans
  transaction TPdceMonitor
  var    
      sMeasureKey        : string;    
      sMeasureName       : array[10] of string;    
      sDescription       : string;    
      fMeasureLastValue  : float;    
      fMeasureSum        : float;    
      fMeasureMin        : float;    
      fMeasureMax        : float;    
      fMeasureAvg        : float;    
      fMeasureStDev      : float;    
      uiMeasureTimeStamp : number;    
      uiMeasureStatus    : number;    
      uiErrorCode        : number;    
      sErrorText         : string;
  begin
    // get actual status of measure
    PdceMeasureQueryStatus(pMeasure[1], uiErrorCode, sErrorText);
    // get actual values of measure    
    PdceMeasureQueryValue(pMeasure[1], fMeasureLastValue, fMeasureSum, fMeasureMin, fMeasureMax,
    fMeasureAvg, fMeasureStDev, uiMeasureTimeStamp, uiMeasureStatus);
    // write to output file
    write(sMeasureName[1]);
    write(": Timestamp:");
    write(uiMeasureTimeStamp,10);
    write(" Value: ");
    write(fMeasureLastValue,8,2);
    write(" Sum: ");
    write(fMeasureSum,10,2);
    write(" Min: ");
    write(fMeasureMin,8,2);
    write(" Max: ");
    write(fMeasureMax,8,2);
    write(" Avg: ");
    write(fMeasureAvg,8,2);
    write(" StDev: ");
    write(fMeasureStDev,8,2);
    write(" Status: ");
    writeln(sErrorText);
  end TPdceMonitor;