ComputeStats

Calculates statistics for a referenced value.

ComputeStatsInputs

Syntax: ComputeStats(Event,Value,CountWhen Offline,ResetEvents.Manual,ResetEvents.Online,ResetEvents.Job Load)

Parameter Description

Event

Specifies the event on which to incrementthe counter.This parameter must be a reference to one of the following:

  • The Image data structure in cell A0, containing the AcquireImage function. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.

Value

Specifies a required reference to the cell containing the source ofthe data to be computed.If no cell is referenced, the function returnsa #ERR for all results.

Count When Offline

Specifies whether statistics will be calculatedwhile the sensor is Offline.For more information, see Online/Offline.

0 = OFF

Do not calculate statistics whenthe sensor is Offline.

1 = ON (default)

Calculate statistics when the sensoris Offline.

Reset Events

Forces the computations to reset dependingon specific events.

Manual

Specifies whether the computations will bereset when the specified Event occurs.This parameter automatically references the Reset button, which is insertedinto the spreadsheet when the function is initially created.

Note: If this checkboxis manually toggled in the PropertySheet, the reference to the Reset button will be removed.To use theReset button, this parameter must reference the cell containing the Resetbutton.

0 = OFF (default)

Do not reset computations when thespecified Event occurs.

1 = ON

Reset computations when the specifiedEvent occurs.

Online

Specifies whether the computations will bereset when the sensor is put Online.

0 = OFF

Do not reset computations when thesensor is put Online.

1 = ON (default)

Reset computations when the sensoris put Online.

Job Load

Specifies whether the computations will bereset when a job is loaded.

0 = OFF

Do not reset computations when ajob is loaded.

1 = ON (default)

Reset computations when a job isloaded.

ComputeStatsOutputs

Returns

A Stats data structure containingthe computed statistics or #ERR if any of the input parameters are invalid.

Results

When ComputeStatsis initially inserted into a cell, a result table and a Reset button arecreated in the spreadsheet.When the Reset button is pressed, all counterswill be reset to zero.

ComputeStatsVision Data Access Functions

The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table. For more information, see Stats.

Latest

GetLatest(Stats)

The most recent value.

Minimum

GetMin(Stats)

The smallest value used to compute the statistics.

Maximum

GetMax(Stats)

The largest value used to compute the statistics.

Mean

GetMean(Stats)

The mean (average) of the values.

Sum

GetSum(Stats)

The sum of the values.

Standard Deviation

GetSDev(Stats)

The standard deviation of the values.

Variance

GetVariance(Stats)

The variance in the values.

Range

GetRange(Stats)

The range between the minimum and maximum values.

NumError

GetErrorCount(Stats)

The total number of errors from the referenced value.

NumSamples

GetNumSamples(Stats)

The total number of samples used for calculations.