# Where to control light

If a lighting controller device is added in the wizard configuration, there will be a pair of light on and light off callbacks for user to control the actual lighting hardware on and off after the application is generated.

These callbacks are can be found in Scripting/User Scripts/LightingController category.

## Light On

Light On function is called to turn on the light before an image acquisition that uses the light to acquire. For more information about how to enable a light for an image acquisition and how to set its intensity for each channel, please refer to Cameras and Lights for Calibration and Camera and Lights for Alignment.

The signature of Light On is as below:

public void Light_On(Int32[] Channels, Int32[] Intensities)

Input Name | Type | Description
--- | --- | ---
Channels | Int32[ ] | The indexes of channels which should be turned on for current image acquisition
Intensities | Int32[ ] | The intensities of each channels which should be turned on

## Light Off

Light Off function is called after associated image acquisition is finished. The signature of it is as below:

public void Light_Off(Int32[] Channels)

Input Name | Type | Description
--- | --- | ---
Channels | Int32[ ] | The indexes of channels which should be turned off for current image acquisition

Note:

If there are multiple image acquisition positions for one vision task and a light device is used for each position, then during run time, the light will be turned on and off at each acquisition position.

To control an actual light device, user needs to implement Light On and Light Off scripts based on specific light controller and its communication protocol.