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 increment the 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 of the data to be computed. If no cell is referenced, the function returns a #ERR for all results.

Count When Offline

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

0 = OFF

Do not calculate statistics when the sensor is Offline.

1 = ON (default)

Calculate statistics when the sensor is Offline.

Reset Events

Forces the computations to reset depending on specific events.

Manual

Specifies whether the computations will be reset when the specified Event occurs. This parameter automatically references the Reset button, which is inserted into the spreadsheet when the function is initially created.

Note: If this checkbox is manually toggled in the Property Sheet, the reference to the Reset button will be removed. To use the Reset button, this parameter must reference the cell containing the Reset button.

0 = OFF (default)

Do not reset computations when the specified Event occurs.

1 = ON

Reset computations when the specified Event occurs.

Online

Specifies whether the computations will be reset when the sensor is put Online.

0 = OFF

Do not reset computations when the sensor is put Online.

1 = ON (default)

Reset computations when the sensor is put Online.

Job Load

Specifies whether the computations will be reset when a job is loaded.

0 = OFF

Do not reset computations when a job is loaded.

1 = ON (default)

Reset computations when a job is loaded.

ComputeStatsOutputs

Returns

A Stats data structure containing the 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 are created in the spreadsheet. When the Reset button is pressed, all counters will 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.