CountPassFail

Counts and returns passes, failures and total events for a given referenced value.

CountPassFailInputs

Syntax: CountPassFail(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 stream to be counted. If no cell is referenced, the function returns a #ERR for all results. The counter that is incremented (Pass,Fail or #ERR) is based on the returned Value, as follows:

Pass

Value > 0

Fail

Value = 0

#ERR

Value < 0

Count When Offline

Specifies whether the counters will be incremented while the sensor is Offline.

0 = OFF

Do not increment counters when the sensor is Offline.

1 = ON (default)

Increment counters when the sensor is Offline.

Reset Events

Forces the counters to reset depending on specific events.

Manual

Specifies whether the counters will be reset to zero 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 counters when the specified Event occurs.

1 = ON

Reset counters when the specified Event occurs.

Online

When the sensor is put Online, specifies whether the counters will be reset to zero after the first Event occurs.

0 = OFF

When the sensor is put Online, do not reset counters after the first Event occurs.

1 = ON (default)

When the sensor is put Online, reset counters after the first Event occurs.

Job Load

Specifies whether the counters will be reset to zero when a job is loaded.

0 = OFF

Do not reset counters when a job is loaded.

1 = ON (default)

Reset counters when a job is loaded.

CountPassFailOutputs

Returns

A Count data structure containing the incremented counters or #ERR if any of the input parameters are invalid.

Results

When CountPassFailis 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.

CountPassFailVision Data Access Functions

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

Passes

GetPassCount(Count)

The incremental count of passes. The counter is incremented when the returned Value is greater than zero.

Failures

GetFailCount(Count)

The incremental count of failures. The counter is incremented when the returned Value is equal to zero.

Errors

GetErrorCount(Count)

The incremental count of errors. The counter is incremented when the returned Value is less than zero.

Total

GetTotalCount(Count)

The total number of passes, failures and errors.