跳至內容
測試伺服器
開發伺服器

Light Control#

使用 Light Control camera feature,您可以控制多達 4 個照明裝置。

此功能基於 SLP 協定,可讓相機與照明裝置直接相互通訊。

如果您使用 Basler Light 或其他製造商的 LED 照明解決方案,則需要 Basler SLP Strobe Controller 來實現相機與燈光之間的通訊。

如果您使用 Basler Camera Light,則不需要獨立的控制器,因為控制器功能已經內建。

資訊

對於 dart M camera modules,目前只有在使用 Basler dart M 介面板(即 Interface Board ⁠dart M GigE RJ45 PoE 或 ⁠Interface Board dart M GigE RJ45 AUX)時,才能使用 Light Control 功能。

使用此功能#

設定光源裝置#

若要設定您的照明裝置:

  1. 使用 pylon Viewer 時,請確保已選取 Features 窗格中的 Polling 選項:

    pylon Viewer 中的 Polling 選項

  2. 請確保相機處於閒置狀態,也就是未擷取影像。

  3. 如果尚未連線,請連接照明裝置與控制器。
  4. 將 BslLightControlMode 參數設為 On.
  5. 執行 BslLightControlEnumerateDevices 命令。
    這會透過 GPIO line 啟用照明裝置通訊,並指派 light device ID.
  6. 如果您的環境中有 多個 照明裝置,請將 BslLightDeviceSelector 參數設定為您要設定的裝置。
    請確保裝置已正確連線,亦即 BslLightDeviceErrorStatus 參數傳回 NoError.
  7. 如果您使用 Basler SLP Strobe Controller:

    1. 將 BslLightDeviceControlMode 參數設為 Current.
    2. 將 BslLightDeviceOperationMode 參數設為 Off.
    3. 將 BslLightDeviceMaxCurrent 參數設為燈光在持續運作下的標稱額定電流(以 mA 為單位)。

      注意 – 指定過高的標稱額定電流會損壞您的燈光。

      使用電流控制時,請務必指定您的燈光能夠承受的標稱額定電流。

      否則,您的燈光在運作過程中將會受損。

  8. 將 BslLightDeviceBrightness 參數調整至所需的亮度。
    100.0 的值對應於您的燈光裝置標稱額定電流的 100 %。50 % 會將電流降低 2 倍。您也可以將亮度設定為超過 100 %。這稱為 overdriving.

  9. 將 BslLightDeviceOperationMode 參數設定為所需的模式:
    • On:使燈光持續發光。
    • Strobe:將燈光設定為 strobe mode.
  10. 如果需要,將設定儲存至 user set。

資訊

  • 如果您使用 Basler Camera Light,則 BslLightDeviceControlMode 和 BslLightDeviceMaxCurrent 參數將會自動設定。
  • 每次您從電流切換至電壓(反之亦然)時,控制器都會有一個短暫的初始化階段,在此期間連接的燈會亮起。這可能長達 15 s,屬於正常現象。

頻閃模式#

strobe mode 允許您在需要時像閃光燈一樣操作燈光裝置,而不是持續操作。

使用 strobe mode 具有以下優點:

  • 它有助於延長燈光的壽命。透過僅在需要時操作燈光,LED 中產生的熱量較少。這減緩了燈光的老化過程。
  • 在 strobe mode 下,您可以 overdrive 燈光,即將供應的電流增加到最高 500 %(針對 Light Controller),這會增加燈光的亮度。

若要啟用 strobe mode,請選擇一個燈光裝置並將 BslLightDeviceOperationMode 參數設為 Strobe.

設定觸發訊號與頻閃持續時間#

通常,觸發燈光裝置的運作方式如下:

  • 最初,燈光處於 off 狀態。
  • 燈光透過觸發訊號被切換至 on 狀態。
  • 燈光會 保持開啟 一定時間,即 strobe duration。
  • 在 strobe duration 結束後,燈光再次被切換至 off 狀態。
ace 2、boost R 與 dart M 相機#

若要在 ace 2、boost R 和 dart M 相機上設定觸發訊號與 strobe duration:

  1. 將 BslLightControlTriggerSource 參數設定為您要用來開啟連接燈光的來源,例如: FlashWindow.
  2. 若適用,請將 BslLightControlTriggerActivation 參數設為下列其中一個值:
    • RisingEdge (預設):當訊號出現時,所有連接的燈光都會開啟 上升,亦即當信號狀態由低變高時。
    • FallingEdge:當信號 下降,亦即當信號狀態由高變低時。
    • AnyEdge:當信號 下降或上升.
  3. 將 BslLightDeviceStrobeMode 參數設為下列其中一個值:
    • Automatic:閃光持續時間由相機的閃光視窗持續時間(BslFlashWindowDuration 參數)控制。 BslLightDeviceStrobeDuration 參數將變為唯讀,並顯示計算出的閃光持續時間。
    • Manual:您可以自行定義閃光持續時間,透過 BslLightDeviceStrobeDuration 參數的值。
  4. 如果您選擇 Manual strobe mode,請將 BslLightDeviceStrobeDuration 參數設為所需的閃光持續時間(以微秒為單位)。

資訊

  • 如果您正在使用 Trigger Width exposure mode 或 Exposure Auto 自動功能,請勿使用 Automatic strobe mode。否則,相機和燈光可能會出現無法預期的行為。
  • 如果您正在使用 Sequencer 功能,則無法使用 Automatic strobe mode。
  • 在 Automatic strobe mode 下,計算出的閃光持續時間可能會短於閃光視窗持續時間。這是為了補償燈光開啟所需的時間,亦即開啟延遲。
  • 如果您在相機效能的極限狀態下運作,可能會發生 overtriggering。
ace U/L 相機#

若要在 ace U/L 相機上設定觸發信號和閃光持續時間:

  1. 如果您使用的是 rolling shutter 相機,請將 BslLightControlTriggerMode 參數設為下列其中一個值:

    • ExposureActive:當曝光開始時,所有連接的燈光都會開啟。請僅在未 重疊 圖像擷取。
    • FlashWindow:當相機的 Flash Window 訊號上升時,所有連接的燈光都會開啟。如果您使用此模式,請確保您的相機型號支援 Flash Window 訊號。

    在具備 global shutter 的相機上,當曝光開始時,所有連接的燈光都會保持開啟。

  2. 將 BslLightDeviceStrobeMode 參數設為下列其中一個值:

    • Automatic:閃光持續時間由相機的 ExposureTime 參數控制。
    • Manual:您可以自行定義閃光持續時間,透過 BslLightDeviceStrobeDuration 參數的值。
  3. 如果您選擇 Manual strobe mode,請將 BslLightDeviceStrobeDuration 參數設為所需的閃光持續時間。

資訊

超載驅動光源裝置#

注意 – 過載驅動可能會損壞您的燈光。

請仔細閱讀本節中的說明,以避免損壞連接的燈光,並確保燈光不會過早老化。

燈光過載驅動是指在閃光模式下,您可以增加電流以提升光強度。

若要過載驅動燈光裝置:

  1. 如果您使用的是 Basler Light 或第三方燈光裝置:

    1. 根據目前的工作週期(duty cycle)與閃光持續時間,計算您裝置允許的最大電流。在 Basler ace 2、boost R 和 dart M 相機上,您可以讀取 BslLightDeviceDutyCycle 參數來決定目前的工作週期。
    2. 將 BslLightDeviceOverdriveLimit 參數進行相應設定。例如,如果您的燈光可以承受其標稱電流額定值的 200%,請將過載限制設為 200.0。

    如果您使用的是 Basler Camera Light,過載限制會自動計算,且 BslLightDeviceOverdriveLimit 參數將無法使用。

  2. 將 BslLightDeviceBrightness 設為大於 100.0 的值。

進行過載驅動時,請考慮以下事項以避免損壞您的燈光:

  • 如果您不確定燈光在閃光模式下可以承受的最大電流是多少,請向燈光製造商諮詢。
  • 由於電流增加會導致 LED 發熱更嚴重,因此您必須在各個閃光脈衝之間留出足夠的時間,讓燈光冷卻。一般而言,脈衝強度越高,脈衝之間應留出的時間就越長。
  • 請考慮曝光時間,因為這會影響脈衝的長度和工作週期。

安全功能#

Basler 燈光裝置實作了下列安全功能,以避免損壞硬體:

SLP Light Controllers 上的安全功能#

大於 2 A 的電流若搭配長 Exposure Time 與高工作週期,可能會損壞控制器硬體。

為避免發生此情況,您無法將 Basler SLP Light Controllers 的 nominal current (BslLightDeviceMaxCurrent 參數) 設定為大於 2000 mA。

不過,如果您正在 overdriving 該裝置,可能會產生大於 2 A 的電流。

在此情況下,相機將自動調整特定燈光裝置設定的最大值。請參閱下方表格。

輸出電流 (額定電流 x 亮度百分比) 最大選通脈衝持續時間 最大工作週期
低於 2 A - 100 %
2 A to <3 A 5 ms 15 %
3 A to <4 A 5 ms 8 %
4 A to <5 A 5 ms 6 %
5 A to <6 A 5 ms 4 %
6 A to <8 A 1 ms 4 %
8 A to <9 A 1 ms 3 %
9 A to <10 A 1 ms 2 %
Camera Lights 上的安全功能#

在 Basler Camera Lights 上,如果所選亮度相對於選通脈衝持續時間與工作週期而言過高,選通脈衝持續時間將會縮短,或觸發訊號將會遭到忽略。請參閱下方表格。

所需亮度 最大選通脈衝持續時間 最大工作週期
0–100 % - 100 %
101–200 % 30 ms 30 %
201–300 % 10 ms 20 %
301–500 % 2 ms 10 %
501–1000 % 1 ms 5 %

GPIO 線路設定#

相機會透過其中一個相機的 GPIO 線路與燈光裝置進行通訊:

  • 在 ace 2、boost R 與 dart M 相機,相機一律會使用 Line 3 進行光學通訊。因此,當啟用 Light Control 功能時, 行模式 Line 3 的 InOut 會設為 線路連接 且 LightControl.

  • 在 ace U/L 相機上, BslLightControlSource 參數會顯示相機用於光學通訊的 GPIO 線路。

光源裝置 ID#

透過 SLP 通訊協定連接的每個照明裝置都有一個照明裝置 ID。該 ID 儲存在裝置上。

有效的照明裝置 ID 為 1、2、3、4 和 7。所有裝置出廠時的 ID 皆設為 7(出廠預設值)。

當使用 BslLightControlEnumerateDevices 命令列舉裝置時,相機會自動搜尋 ID 設為 7 的裝置,並將 1 到 4 之間下一個可用的 ID 指派給它。

當使用一個以上的照明裝置時,必須確保其 ID 各不相同。使用 ID 相同的裝置會導致通訊錯誤。

  • 範例 1:假設您連接了一個新的照明裝置並列舉裝置。相機會將 ID 1 指派給該裝置。然後,您中斷連接該裝置,連接下一個照明裝置,並再次列舉裝置。相機也會將 ID 1 指派給此裝置。
  • 範例 2:假設您連接了兩個新的照明裝置並列舉裝置。相機會找到兩個 ID 設為 7 的裝置,並將下一個可用的 ID(即 1)分別指派給它們。

在這兩個範例中,當您將兩個照明裝置都連接到相機時,將會發生通訊錯誤。您必須變更其中一個 ID 以解決衝突。

提示

防止衝突的最佳方法是逐一連接裝置,並在連接裝置後始終指派新的唯一 ID。

變更光源裝置 ID#

若要變更照明裝置的 ID:

  1. 將 BslLightControlMode 參數設為 On.
  2. 將 BslLightDeviceOperationMode 參數設為 Off.
  3. 將 BslLightDeviceSelector 參數設為您要變更 ID 的 Basler 照明裝置。
  4. 將 BslLightDeviceChangeID 參數設為所需的 ID,例如 Device1.
    在 ace U/L 相機,ID 會立即變更。
  5. 在 ace 2、boost R 與 dart M 相機,執行 BslLightDeviceNewIDSave 命令。

使用 Light Control 功能時的注意事項#

  • 當 BslLightControlMode 且 On上, Serial Communication 功能停用時。這是因為 Light Control 功能同時也會使用 Serial Communication。
  • Basler Camera Lights use pulse width modulation (PWM), the Basler SLP Strobe Controller doesn't. If you're using very short exposure times (<500 µs) and a brightness value other than 100 %, PWM can lead to brightness fluctuations or to stripes in rolling shutter cameras.
  • 避免使用非常短的 Flash Window 訊號。否則,所產生影像中的某些行可能會過亮,而其他行則會過暗。
  • 在設定 BslLightControlMode 參數設為 On時,燈光裝置實際開啟會有最多 1 秒的延遲。因此,第一張影像可能會過暗。您可以放棄此影像,或者如果您需要所有影像,請在適當的延遲後開始影像擷取。
  • 超驅動 Basler Camera Light 時,相機的運作頻率請勿超過每秒 60 張畫面。否則,相機和燈光可能會出現無法預期的行為。
  • Basler ace 2、boost R 和 dart M 相機:從 user set載入燈光裝置設定時,這些設定只有在執行 BslLightControlEnumerateDevices 命令。

過度觸發#

如果您在相機效能的極限邊緣運作相機,可能會發生燈光裝置過度觸發(overtriggering)的情況。過度觸發是指燈光裝置在尚未準備就緒時收到觸發訊號,例如因為它仍處於關閉燈光的過程中。這意味著觸發訊號將被忽略,並且燈光在下一次曝光時不會亮起。

為了更好地理解這個問題,請考慮以下範例。

一部最高支援 100 fps 的相機以曝光時間設定為 50 ms 的方式運作。因此,相機以極快的速度連續擷取每秒 20 張畫面,曝光之間沒有任何暫停。這意味著燈光裝置的觸發必須準確地落在兩次曝光之間的邊緣。

在實務上,這幾乎是不可能的,因為固有的抖動會導致觸發有時會在燈光仍在關閉時到達。在這些情況下,觸發將被忽略,所產生的影像將會過暗。

由於抖動是不規則的,因此沒有精確的方法可以防止這種情況發生。如果您注意到您的某些影像比其他影像暗,請考慮以連續模式運作燈光。您也可以嘗試使用 Acquisition Frame Rate 功能來調整影格率。

監控過度觸發#

在 ace 2、boost R 與 dart M 相機上, BslLightControlOvertriggerCount 參數可用。它允許您監控發送了多少個觸發訊號,而此時至少有一個連接的燈光裝置尚未準備就緒。

範例: 假設有 4 個燈光裝置連接到您的相機。您在其中 3 個裝置尚未準備就緒時發送觸發訊號。因此, BslLightControlOvertriggerCount 參數增加 1。

該參數最多計數到 65 535 的最大值。之後,它會停止計數。

若要重設過度觸發計數器,請執行 BslLightControlOvertriggerCountReset 命令。

檢查與清除錯誤#

ace 2、boost R 與 dart M 相機#

Basler ace 2、boost R 和 dart M 相機可以從連接的燈光裝置讀取以下錯誤資料:

  • error status 可以幫助您自行修正錯誤。
  • error code 提供有關錯誤類型的附加資訊,可由 Basler 支援團隊進行評估。

若要檢查並清除錯誤:

  1. 如果您連接了多個裝置:
    1. 檢查 BslLightControlErrorSummary 參數以找出哪個裝置發生問題,例如 Device2.
    2. 將 BslLightDeviceSelector 參數設定為發生問題的裝置。
  2. 取得 BslLightDeviceErrorStatus 參數的值,並在下方的 Error Statuses 表中尋找其含義。
  3. 如果錯誤狀態為 "Hardware Error":
    1. 執行 BslLightDeviceErrorStatusReadAndClear 命令。
    2. 取得 BslLightDeviceErrorCode 參數的值,並在下方的 Error Codes 表中尋找其含義。
    3. 如果可能,請修正錯誤。
  4. 如果錯誤狀態不是 "Hardware Error":
    1. 如果可能,請修正錯誤。
    2. 執行 BslLightDeviceErrorStatusReadAndClear 命令以將錯誤狀態重設為 NoError.
Error Statuses#

影像 BslLightDeviceErrorStatus 參數可接受下列值:

Value 含義
Communication Error 如果照明裝置與相機之間的資料傳輸發生故障,就會發生通訊錯誤。這可能是由於使用過長的纜線或線路上有太多雜訊所造成的。
Connection Lost 與先前連線的照明裝置已失去連線。例如,如果纜線鬆脫,就可能會發生這種情況。
Hardware Error 照明裝置發生技術故障。如需有關硬體錯誤類型的詳細資訊,請執行 BslLightDeviceErrorStatusReadAndClear 命令以擷取 error code.a
Light Device Error 照明裝置發生內部錯誤。a
No Error 未偵測到錯誤。
Not Connected 照明裝置未連線至相機,或尚未列舉。執行 BslLightControlEnumerateDevices 命令以列舉裝置。
不支援的裝置版本 此燈光裝置與目前的相機不相容。請聯絡支援團隊以確認是否有可用的韌體更新。
Error Codes#

影像 BslLightDeviceErrorCode 參數可接受下列值:

Value 含義
0x30024 Light Controller 的燈光連接器發生短路。這可能是由故障的燈光單元所引起的。
0x3002A Light Controller 無法提供要求的電流。請嘗試降低 BslLightDeviceCurrent 參數值。
(其他) 請提供錯誤代碼並聯絡 Basler 支援團隊。

ace U/L 相機#

Basler ace U/L 相機可以讀取來自所連接燈光裝置的錯誤清單。

最多可儲存 25 個錯誤。如果發生第 26個錯誤,最舊的錯誤將被覆寫,依此類推。

檢查並清除錯誤是一個反覆的過程,取決於發生的錯誤數量。

若要檢查並清除錯誤:

  1. 如果您連接了多個裝置:
    1. 檢查 BslLightControlErrorStatus 參數以找出哪個裝置發生問題,例如 Device2.
    2. 將 BslLightDeviceSelector 參數設定為發生問題的裝置。
  2. 取得 BslLightDeviceLastError 參數並在下表中查詢其含意。
  3. 請修正對應的錯誤。
  4. 若要從錯誤清單中刪除最後一個錯誤,請執行 BslLightDeviceClearLastError 命令。
  5. 持續取得並刪除最後一個錯誤,直到 BslLightDeviceLastError 參數顯示 NoError.
Value 含義
Communication Error 如果照明裝置與相機之間的資料傳輸發生故障,就會發生通訊錯誤。這可能是由於使用過長的纜線或線路上有太多雜訊所造成的。
連線錯誤 如果燈光裝置與相機之間的連線中斷,或者通訊錯誤已經發生,就會發生連線錯誤。其他原因可能包括連接鬆脫或控制器完全斷線。
Hardware Error 燈光裝置發生技術故障。a
電流不足 Light Controller 無法提供要求的電流。請嘗試降低 LightDeviceMaxCurrent 參數值。
No Error 自上次清除錯誤 Memory 以來,燈光裝置未偵測到任何錯誤。
短路 Light Controller 的燈光連接器發生短路。這可能是由故障的燈光單元所引起的。

  1. 拔掉並重新連接電源供應器可能會解決此問題。為確保完成電源循環(power-cycling),控制器必須斷電五分鐘。這是正常現象。如果您使用的是多個控制器,其他控制器也必須進行電源循環,即使它們未發生任何故障。

範例程式碼#

ace 2, boost R, dart M 相機#
// 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 nominal current of device 1 to 100 mA
camera.BslLightDeviceCurrent.SetValue(100.0);
//Set the brightness to 100 %
camera.BslLightDeviceBrightness.SetValue(100.0);
//Set the operation mode to Strobe
camera.BslLightDeviceOperationMode.SetValue(BslLightDeviceOperationMode_Strobe);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the light control mode
CEnumParameter(nodemap, "BslLightControlMode").SetValue("On");
// Enumerate the light devices
CCommandParameter(nodemap, "BslLightControlEnumerateDevices").Execute();
// Select light device 1
CEnumParameter(nodemap, "BslLightDeviceSelector").SetValue("Device1");
// Set the nominal current of device 1 to 100 mA
CFloatParameter(nodemap, "BslLightDeviceCurrent").SetValue(100.0);
// Set the brightness to 100 %
CFloatParameter(nodemap, "BslLightDeviceBrightness").SetValue(100.0);
// Set the operation mode to Strobe
CEnumParameter(nodemap, "BslLightDeviceOperationMode").SetValue("Strobe");
// 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 nominal current of device 1 to 100 mA
camera.Parameters[PLCamera.BslLightDeviceCurrent].SetValue(100.0);
// Set the brightness to 100 %
camera.Parameters[PLCamera.BslLightDeviceBrightness].SetValue(100.0);
// Set the operation mode to Strobe
camera.Parameters[PLCamera.BslLightDeviceOperationMode].SetValue(PLCamera.BslLightDeviceOperationMode.Strobe);
/* 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 nominal current of device 1 to 100 mA */
errRes = PylonDeviceSetFloatFeature(hdev, "BslLightDeviceCurrent", 100.0);
CHECK(errRes);
/* Set the brightness to 100 % */
errRes = PylonDeviceSetFloatFeature(hdev, "BslLightDeviceBrightness", 100.0);
CHECK(errRes);
/* Set the operation mode to Strobe */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightDeviceOperationMode", "Strobe");
CHECK(errRes);
# Enable the light control mode
camera.BslLightControlMode.Value = "On"
# Enumerate the light devices
camera.BslLightControlEnumerateDevices.Execute()
# Select light device 1
camera.BslLightDeviceSelector.Value = "Device1"
# Set the nominal current of device 1 to 100 mA
camera.BslLightDeviceCurrent.Value = 100.0
# Set the brightness to 100 %
camera.BslLightDeviceBrightness.Value = 100.0
# Set the operation mode to Strobe
camera.BslLightDeviceOperationMode.Value = "Strobe"

您也可以使用 pylon Viewer 來輕鬆設定參數。

ace U/L 相機#
// 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 nominal 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 Strobe
camera.BslLightDeviceOperationMode.SetValue(BslLightDeviceOperationMode_Strobe);
INodeMap& nodemap = camera.GetNodeMap();
// Enable the light control mode
CEnumParameter(nodemap, "BslLightControlMode").SetValue("On");
// Enumerate the light devices
CCommandParameter(nodemap, "BslLightControlEnumerateDevices").Execute();
// Select light device 1
CEnumParameter(nodemap, "BslLightDeviceSelector").SetValue("Device1");
// Set the nominal current of device 1 to 100 mA
CFloatParameter(nodemap, "BslLightDeviceMaxCurrent").SetValue(100.0);
// Set the brightness to 100 %
CFloatParameter(nodemap, "BslLightDeviceBrightness").SetValue(100.0);
// Set the operation mode to Strobe
CEnumParameter(nodemap, "BslLightDeviceOperationMode").SetValue("Strobe");
// 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 nominal 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 Strobe
camera.Parameters[PLCamera.BslLightDeviceOperationMode].SetValue(PLCamera.BslLightDeviceOperationMode.Strobe);
/* 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 nominal 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 Strobe */
errRes = PylonDeviceFeatureFromString(hdev, "BslLightDeviceOperationMode", "Strobe");
CHECK(errRes);
# Enable the light control mode
camera.BslLightControlMode.Value = "On"
# Enumerate the light devices
camera.BslLightControlEnumerateDevices.Execute()
# Select light device 1
camera.BslLightDeviceSelector.Value = "Device1"
# Set the nominal current of device 1 to 100 mA
camera.BslLightDeviceMaxCurrent.Value = 100.0
# Set the brightness to 100 %
camera.BslLightDeviceBrightness.Value = 100.0
# Set the operation mode to Strobe
camera.BslLightDeviceOperationMode.Value = "Strobe"