# Accumulate

Keeps the running total of the specified value over an infinite interval. The function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. returns the current accumulated total.

The Accumulate function sums the referenced value after that value is updated by the function specified in Event.

Note:

The functionalities of the Accumulate and ClockedSum functions are reversed in In-Sight Vision Suite compared to In-Sight Explorer.

The Job A job is a user-configured program in In-Sight Spreadsheet consisting of functions and designed for specific applications. You can create and edit jobs using the In-Sight Spreadsheet interface, and load them on a vision system for deployment in a live environment. Converter tool still converts these functions correctly. This means that if there is a ClockedSum function in In-Sight Explorer, after the job conversion, it shows up as an Accumulate function in In-Sight Vision Suite. Therefore, Cognex strongly recommends using the Job Converter tool to convert jobs from In-Sight Explorer to In-Sight Vision Suite, especially if the In-Sight Explorer job uses the ClockedSum function or the Accumulate function. For more information, see Convert In-Sight Explorer Jobs into In-Sight Vision Suite Jobs.

Inputs

Syntax: Accumulate(Event,Value,Reset,Preset)

Parameter | Description
--- | ---
Event | An external event that triggers the update of the accumulator with the specified Value parameter. This parameter must be a reference to one of the following: The Image data structure in cell A0, containing the AcquireImage function. A cell containing an Event function. A cell containing a Button function. Note: The Accumulate function buffers the state of a referenced value after that value is updated by any other function that depends on the specified Event.
Value | A reference to the cell containing the source of the data stream to be accumulated between -16777216 to 16777216. The default value is 1.000. Note: If you do not specify a cell reference, the function accumulates the specified Value parameter at each Event.
Reset | Forces the accumulator to reset to the value of the Preset parameter.
0 = OFF (default) | The accumulator continues to sum the specified value indefinitely.
1 = ON | The accumulator resets on the next Event.
Preset | Specifies the initial value, and the minimum value to which the accumulator is reset when the Reset parameter is ON between -16777216 to 16777216. The default value is 0.000.

Outputs

Returns | The current accumulated total of the Value parameter since the last Reset.