# SetFocusPosition

The SetFocusPosition is used to control the focus position of the lens.

Note:

- The SetFocusPosition 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. is not supported for the In-Sight Spreadsheet PC.
- The SetFocusPosition function is only available for vision systems with the autofocus accessory installed. If the vision system does not have the autofocus accessory installed, the SetFocusPosition function returns #ERR.
- You cannot edit the SetFocusPosition value in the spreadsheet when the vision system is Online.
- The focus position value is saved with 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. and reapplied to the lens when the job is loaded.
- If you have more than one SetFocusPosition functions in a spreadsheet, only the last updated SetFocusPostion value will be used to control the focus position.

Inputs

Parameter | Description
Manual Focus Position | Specifies a value (0 - 100; default = 50) or cell reference to use as the focus position.

Outputs

Returns | The input value of the SetFocusPosition, or #ERR if the input parameter is invalid or the In-Sight vision system does not support focus control.

## Use the SetFocusPosition Function

1. Insert the SetFocusPosition function into the Spreadsheet.

2. In the Manual Focus Position parameter, specify a value or cell reference to use as the focus position and click OK.

3. Click the Trigger Once button to update the lens position and acquire a new image.