# Timer

The Timer 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. triggers a spreadsheet event after a specified time interval or at specific times each day. The Timer only raises events when the vision system is Online.

## Time Synchronization

To synchronize the internal clock of the vision system, use the Time Settings utility in In-Sight Vision Suite. The utility configures the vision system to use Network Time Protocol (NTP) for automatic time synchronization with a local or remote network server.

For more information, see the In-Sight Vision Suite Help document.

## Starting and Stopping Timer Events

To start or stop the timer events from reaching the spreadsheet, set a cell state on the Event function that is connected to the external event raised by the Timer function.

## Timing Considerations in Job Deployment

In job A job is a user-configured program in In-Sight 3D Spreadsheet consisting of functions and designed for specific applications. You can create and edit jobs using the In-Sight 3D Spreadsheet interface, and load them on a vision system for deployment in a live environment. deployment environments where the vision system monitors inspections, using a Timer function to raise an external event can delay image inspection. This delay is more likely if the external event occurs shortly before the acquisition Acquisition is the process or result of the vision system acquiring a new image. cycle completes.

If the job file is large, for example containing many vision tools like Pattern Match, Flaw Detection, or InspectEdge, the system might delay image inspection until the display update is queued.

This delay can affect the following actions:

- The timing of pass/fail result determination

- The transmission of results to the next station, such as a PLC A Programmable Logic Controller is a ruggedized computer that you can use for automating processes or even an entire production line. or motion controller

Cognex recommends that you avoid external events in applications that require precise timing, for example within tens of milliseconds, to prevent inspection delays.

## Timer Inputs

Syntax: Timer(Time-String, Trigger)

Parameter | Description
--- | ---
Time-String | A string that specifies an interval of time, or specific daily times. The default interval is one minute. Time examples:
"01:00:00" | Triggers every hour.
"00:10:00" | Triggers every 10 minutes.
"00:01:00" | Triggers every 1 minute.
"00:00:10" | Triggers every 10 seconds.
"@8:00" | Triggers at 8:00 a.m. every day.
"@8:30, 20:00" | Triggers at 8:30 a.m. and 8:00 p.m. every day.
Note: The Time-String parameter can be a cell reference. In this case, prepend an apostrophe (') to the time in the referenced cell. See the following cell configuration example: A2=Timer(B2,200) B2='00:01:00
Trigger | Specifies a trigger to signal an event after the time interval, or at the specific daily times.
Event | Event Code | Description
--- | --- | ---
None | -1 | The vision system signals no event.
Manual Acquire | 32 | Acquires an image and updates the spreadsheet. The Trigger Type in the Acquisition Panel must be set to Single.
External 0 to External 7 | 200–207 | Signals an external event. The default is External 0, event code 200.

## Timer Outputs

Returns | A Timer data structure, or #ERR if any of the input parameters is invalid.