The Light Control feature set is based on the SLP protocol that enables cameras and light devices to communicate directly with each other. A light device can be a third-party light or a light from the Basler Camera Light portfolio (available from September 2019). If you want to use a third-party light, you need the Basler SLP Strobe Controller to enable the communication between the camera and the light. If you choose a Basler light, a separate controller is not required as the controller features are already included. Both options are plug-and-play.
In this topic Hide
One of the advantages of the strobe mode is that it can help to increase
the life expectancy of your light. By not operating it continuously but
like a flash when needed, less heat is generated in the LEDs. This slows
down the aging process of the lights.
The other advantage is that while in strobe mode you can overdrive
the lights, i.e., increase the current supplied to a maximum of 10 A,
which increases the brightness of your light. Before you do so, read the
instructions in the Overdrive Mode section.
If you have set the BslLightDeviceOperationMode parameter to Strobe, the light is triggered by the ExposureActive signal. To control the duration of the individual strobe pulses, you have to specify whether you want automatic or manual strobe operation using the BslLightDeviceStrobeMode parameter.
If you're using the Trigger Width exposure mode or the Sequencer feature, you have to use the Manual strobe mode.
The camera uses the same line for sending the ExposureActive signal to the controller and for sending any changes of light control parameter settings. As parameter changes take precedence, the line will not be available for the ExposureActive signal and strobe operation will be disrupted. To avoid this, only change parameter settings while the strobe mode is disabled.
Overdriving your light means that you can increase the current, resulting in a higher light intensity, while the light is in strobe mode.
Notice
Carefully read the instructions in this section to avoid damaging the connected lights and to ensure that the lights don't age prematurely.
When using the overdrive mode, you have to consider the following aspects to avoid damaging your light:
To change the ID of a light:
Using
More Than One Light Controller
When using more than one light controller, you have to make sure that their
IDs are all different. Using controllers with identical IDs will cause
communication errors.
Duplicate IDs can occur, if you're connecting new controllers for the first
time because all controllers are shipped with the light device ID set
to 7. It can also occur when connecting existing controllers from another
system as light device IDs are remembered by the controller once they
have been set.
The best way to prevent conflicts, is to connect controllers one after
the other and always assign a new and unique ID after having connected
a controller.
The light / light controller can detect errors that you can correct yourself. Check the BslLightDeviceLastError parameter to find out which error has occurred. After you have corrected the error, you can clear it from the list.
Up to 25 errors can be stored. If a 26th error occurs, the oldest error will be overwritten and so on.
If you have several lights / light controllers connected, the BslLightControlErrorStatus tells you which device is experiencing problems.
Checking and clearing errors is an iterative process, depending on how many errors have occurred.
Value | Meaning |
---|---|
No Error | The light / light controller hasn't detected any errors since the last time the error memory was cleared. |
Communication Error | A communication error occurs if the data transmission between the light / light controller and the camera is faulty. This can be caused by using cables that are too long or by too much noise on the line. |
Connection Error | A connection error occurs if the connection between the light / light controller and the camera is broken or if a communication error has already occurred. Other reasons may be loose connections or the controller being disconnected completely. |
Hardware Error | The light / light controller is experiencing a technical fault. Disconnecting and reconnecting the power supply may solve the issue. |
Insufficient Current |
The light controller is unable to supply the requested current. Try lowering the BslLightDeviceMaxCurrent parameter value. |
Short Circuit | There is a short circuit at the Lighting connector of the light controller. This can be caused by a faulty light unit. |
After power-cycling the controller, it can take up to five minutes for the controller to become available again. This is normal behavior.
// Enable the light control mode
camera.BslLightControlMode.SetValue(BslLightControlMode_On);
//Enumerate the light devices
camera.BslLightControlEnumerateDevices.Execute();
//Select light device 1
camera.BslLightDeviceSelector.SetValue(BslLightDeviceSelector_Device1);
//Set the maximum current of device 1 to 100 mA
camera.BslLightDeviceMaxCurrent.SetValue(100.0);
//Set the brightness to 100 %
camera.BslLightDeviceBrightness.SetValue(100.0);
//Set the operation mode to continuous
camera.BslLightDeviceOperationMode.SetValue(BslLightDeviceOperationMode_On);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the light control mode
CEnumerationPtr(nodemap.GetNode("BslLightControlMode"))->FromString("On");
// Enumerate the light devices
CCommandPtr(nodemap.GetNode("BslLightControlEnumerateDevices"))->Execute();
// Select light device 1
CEnumerationPtr(nodemap.GetNode("BslLightDeviceSelector"))->FromString("Device1");
// Set the maximum current of device 1 to 100 mA
CFloatPtr(nodemap.GetNode("BslLightDeviceMaxCurrent"))->SetValue(100.0);
// Set the brightness to 100 %
CFloatPtr(nodemap.GetNode("BslLightDeviceBrightness"))->SetValue(100.0);
// Set the operation mode to continuous
CEnumerationPtr(nodemap.GetNode("BslLightDeviceOperationMode"))->FromString("On");
// Enable the light control mode
camera.Parameters[PLCamera.BslLightControlMode].SetValue(PLCamera.BslLightControlMode.On);
// Enumerate the light devices
camera.Parameters[PLCamera.BslLightControlEnumerateDevices].Execute();
// Select light device 1
camera.Parameters[PLCamera.BslLightDeviceSelector].SetValue(PLCamera.BslLightDeviceSelector.Device1);
// Set the maximum current of device 1 to 100 mA
camera.Parameters[PLCamera.BslLightDeviceMaxCurrent].SetValue(100.0);
// Set the brightness to 100 %
camera.Parameters[PLCamera.BslLightDeviceBrightness].SetValue(100.0);
// Set the operation mode to continuous
camera.Parameters[PLCamera.BslLightDeviceOperationMode].SetValue(PLCamera.BslLightDeviceOperationMode.On);
// Enable the light control mode
Pylon.DeviceFeatureFromString(hdev, "BslLightControlMode", "On");
// Enumerate the light devices
Pylon.DeviceExecuteCommandFeature(hdev, "BslLightControlEnumerateDevices");
// Select light device 1
Pylon.DeviceFeatureFromString(hdev, "BslLightDeviceSelector", "Device1");
// Set the maximum current of device 1 to 100 mA
Pylon.DeviceSetFloatFeature(hdev, "BslLightDeviceMaxCurrent", 100.0);
// Set the brightness to 100 %
Pylon.DeviceSetFloatFeature(hdev, "BslLightDeviceBrightness", 100.0);
// Set the operation mode to continuous
Pylon.DeviceFeatureFromString(hdev, "BslLightDeviceOperationMode", "On");
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */
/* Enable the light control mode */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightControlMode", "On");
CHECK(errRes);
/* Enumerate the light devices */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslLightControlEnumerateDevices");
CHECK(errRes);
/* Select light device 1 */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightDeviceSelector", "Device1");
CHECK(errRes);
/* Set the maximum current of device 1 to 100 mA */
errRes = PylonDeviceSetFloatFeature(hdev, "BslLightDeviceMaxCurrent", 100.0);
CHECK(errRes);
/* Set the brightness to 100 % */
errRes = PylonDeviceSetFloatFeature(hdev, "BslLightDeviceBrightness", 100.0);
CHECK(errRes);
/* Set the operation mode to continuous */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightDeviceOperationMode", "On");
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.