# SetFocusPosition

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

Note:

- The SetFocusPosition function is not supported for the In-Sight ViDi 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 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.

## SetFocusPosition Inputs

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

## SetFocusPosition 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.