跳转到内容

Light Control Feature Set#

Light Control Feature Set 可让您通过 pylon 软件控制多达 4 个光源设备。

Light Control Feature Set 基于 SLP 协议,该协议使相机和光源设备可以直接相互通信。

如果您使用 Basler Standard Light 或任何其他机器视觉 LED 标准照明,则需要 Basler SLP 频闪控制器,以启用相机和光源之间的通信。

如果您使用 Basler Camera Light,由于其中已经包含了控制器功能,因此不需要单独的控制器。

该功能的使用#

Configuring the Light Devices#

  1. 如果尚未连接控制器和光源,请执行连接。
  2. pylon Viewer 中启用轮询
  3. BslLightControlMode 参数设置为 On
    BslLightControlSource 参数将显示相机的哪条 GPIO 线路用于控制光源功能。
    如果连接新的控制器,则系统会自动为它分配下一个可用的光源设备 ID。
  4. 执行 BslLightControlEnumerateDevices 命令。
  5. 如果您的环境中有多个 Basler 光源或光源控制器,请将 BslLightDeviceSelector 参数设置为要配置的设备。
    请确保没有光源设备 ID 冲突。
  6. 如果您使用 Basler SLP 频闪控制器,请通过 BslLightDeviceControlMode 参数指定是使用电流还是电压来控制光源设备。每个灯都可以通过电流进行控制。对于设计用于 12 VDC 或 24 VDC 连接的灯,建议使用电压控制。如果您使用 Basler Camera Light,您可以跳过此步骤。在这种情况下,该参数会自动设置。

    信息

    请注意,在您每次从电流切换到电压时(反之亦然),控制器存在短暂的初始化阶段,在此期间,连接的光源设备将亮起。此阶段可能会持续长达 15 s,这是正常现象。

  7. 如果您使用 Basler SLP 频闪控制器,请将 BslLightDeviceMaxCurrent 参数设置为连续运行时光源的最大额定电流。
    如果您使用 Basler 相机光源,则会自动设置最大电流。
    这样可以确保您的光源不会受到损坏,并且可以通过 BslLightDeviceBrightness 参数安全地使用整个电流范围。
    BslLightDeviceOperationMode 参数设置为 Off时,您只能更改 BslLightDeviceMaxCurrent 参数值。

  8. Set the BslLightDeviceBrightness parameter to the desired brightness.
    This parameter can be set in a range from 0 to 100 %. 100 % corresponds to the current that you have specified with the BslLightDeviceMaxCurrent parameter. 50 % will reduce the current by a factor of 2. The Basler Camera Light uses pulse width modulation (PWM), the Basler SLP Strobe Controller doesn't. PWM can lead to brightness fluctuations for short exposure times (< 500 µs) or to stripes in rolling shutter cameras.
  9. 设置 BslLightDeviceOperationMode 参数设置为所需模式:
    • On:这将使光源连续发光。
    • Strobe:将光源设置为频闪模式。您可以使用 BslLightDeviceStrobeModeBslLightDeviceStrobeDuration 参数配置频闪模式

配置频闪模式#

频闪模式的优点之一是,它可以帮助延长光源的预期寿命。通过不连续操作而是像闪光灯一样在需要时工作,LED 产生的热量更少。这减慢了光源的老化过程。另一个优点是,在频闪模式下,您可以使光源过载,也就是将提供的电流最大增加到 500%(对于光控制器),这会增加光源的亮度。这样做之前,请阅读过载模式部分中的说明。

在滚动快门相机上,如果已将 BslLightDeviceOperationMode 参数设置为 Strobe,则使用 BslLightControlTriggerMode 参数来确定如何触发光源。可以使用不同的触发模式:

  • ExposureActive:仅当您不重叠图像采集时才使用此模式。
  • FlashWindow:如果使用此模式,请确保相机生成闪烁窗口信号。

在全局快门相机上,触发模式是预设的。

信息

从曝光开始到光源打开之间有一个大约 23 µs 的延迟。

信息

与 Light Control Feature Set 有关的闪烁窗口信号的实现目前仍在开发中。特别是在闪烁窗口信号非常短的情况下,结果可能不尽如人意(所得到的图像中的部分行可能太亮,而其他一些行可能太暗)。

要控制单次频闪脉冲的持续时间,必须使用 BslLightDeviceStrobeMode 参数指定要自动还是手动进行频闪操作。

  • Automatic:各频闪脉冲的持续时间由相机的 ExposureTime 参数控制。频闪会持续您指定的曝光时间。有关更多信息,请参见故障排除部分。
  • Manual:您可以使用 BslLightDeviceStrobeDuration 参数定义各个频闪脉冲的持续时间。如果您在达到其性能上限时操作相机,则可能会出现过度触发。

信息

如果您使用触发宽度曝光模式Sequencer 功能或相机的任何自动功能(例如,Auto Exposure、Auto Gain),则必须使用手动频闪模式。

信息

相机使用同一条线路触发光源并传输光源控制参数设置的任何更改。由于参数更改优先,因此在此期间,该线路将不可用于触发信号,并且频闪操作将被中断。为了避免这种情况,请检查 BslLightControlStatus。如果值为 Ready,则表示光源设备已准备好接收触发条件。此外,应该仅在禁用频闪模式时更改参数设置。

过载模式#

使光源过载意味着您可以增加电流,从而在光源处于频闪模式时提高光源强度。

注意 – 错误的操作可能会损坏您的光源。

请仔细阅读本节中的说明,以免损坏连接的光源,并确保光源不会过早老化。

使用过载模式时,必须考虑以下方面,以免损坏您的光源:

  • 在频闪模式下,可以将 BslLightDeviceBrightness 参数设置为 100% 以上的值。最大值取决于频闪脉冲持续时间和占空比。对于 Basler Camera Lights,系统会自动计算允许的最大亮度,并会相应地调整亮度滑块的范围。当使用第三方光源和 Basler SLP 频闪控制器 时,您必须自己计算最大亮度值,然后在 BslLightDeviceOverdriveLimit 参数中输入该值。例如,200% 表示频闪操作中的最大电流将是 BslLightDeviceMaxCurrent 参数值的两倍。
  • 如果不确定您的光源在频闪模式下可以承受的最大电流,请与光源的制造商联系。Basler SLP 频闪控制器允许将 BslLightDeviceOverdriveLimit 参数设置为 500%,但是大多数光源无法承受由此过载限制引起的电流。
  • 由于增加的电流会导致 LED 发热量增大,因此必须在各次频闪脉冲之间留出足够的时间,以保证光源再次冷却。根据经验,脉冲强度越高,两次脉冲之间应留出的时间越长。
  • 考虑曝光时间,因为这会影响脉冲的长度和占空比。

信息

避免损坏控制器硬件的安全功能。

  • 大于 2 A 的电流以及较长的曝光时间和高占空比可能会损坏控制器硬件。为了避免这种情况,将自动计算最大允许电流,并相应降低最大允许亮度(请参阅表 1)。
    占空比的计算基于相机的最大可能帧速率。使用 Acquisition Frame Rate 功能可以降低相机的最大可能帧速率。

避免损坏光源的安全功能。

  • 如果所选的过载亮度相对于频闪持续时间和占空比而言过高(请参见表 2),则频闪持续时间将减少,或者触发器将被忽略。
表 1(控制器保护)#
输出电流
(BslLightDeviceBrightness x
BslLightDeviceMaxCurrent)
最大频闪持续时间 最大占空比
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 %
表 2(光源保护)#
所需亮度 最大频闪持续时间 最大占空比
0–100 % - 100 %
101-200 % 30 ms 30 %
201-300 % 10 ms 20 %
301-500 % 2 ms 10 %
501-1000 % 1 ms 5 %

更改光源设备 ID#

要更改光源的 ID:

  1. BslLightControlMode 参数设置为 On
  2. BslLightDeviceOperationMode 参数设置为 Off
  3. Set the BslLightDeviceSelector parameter to the Basler light device whose ID you want to change.
  4. BslLightDeviceChangeID 参数设置为所需的值。
    该 ID 将立即更改。

信息

使用多个光源设备或 Basler 相机光源

使用多个光源设备时,必须确保其 ID 各不相同。使用具有相同 ID 的设备会导致通信错误。如果您是第一次连接新的设备,因为所有设备出厂时的光源设备 ID 都设置为 7,因此可能会出现重复的 ID。当从另一个系统连接现有的设备时,由于设备会记住设置好的光源设备 ID,因此也会出现重复的 ID。防止冲突的最佳方法是逐一连接设备,并在连接设备后始终分配一个新的唯一 ID。

故障排除#

检查和清除错误#

The light device 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.

最多可以存储 25 个错误。如果发生第 26 个错误,则最早的错误将被覆盖,依此类推。

If you have several devices connected, the BslLightControlErrorStatus tells you which device is experiencing problems.

检查和清除错误是一个反复迭代过程,具体取决于发生了多少个错误。

要检查并清除错误:

  1. 要检查最近发生的错误,请获取 BslLightDeviceLastError 参数的值。
  2. 更正相应的错误。
  3. 要从错误列表中删除最后一个错误,请执行 BslLightDeviceClearLastError 命令。
  4. 不断获取并删除最后一个错误,直到 BslLightDeviceLastError 参数显示 NoError 为止。

可用错误代码

含义
无错误 The light device hasn't detected any errors since the last time the error memory was cleared.
通信故障 A communication error occurs if the data transmission between the light device and the camera is faulty. This can be caused by using cables that are too long or by too much noise on the line.
连接错误 A connection error occurs if the connection between the light device 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.
硬件错误 The light device is experiencing a technical fault. Disconnecting and reconnecting the power supply may solve the issue. See Power-Cycling the Controller for more information.

在自动频闪模式下过度触发#

If you're operating the camera at the upper end of its capabilities, overtriggering of the light device may occur. Overtriggering means that the light device receives a trigger while it isn't ready for it, e.g., because it is still in the process of switching off the light. This would mean that the trigger is ignored and the light would not come on for the next exposure. To better understand this problem, consider the following example.

A camera that is capable of 100 fps is operated with the exposure time set to 50 ms, i.e., the camera would acquire 20 frames per second in quick succession without any pause between the exposures. This means that the trigger for the light device would have to come exactly at the edge between two exposures. In practice, this is almost impossible because of an inherent jitter that causes the trigger to sometimes arrive while the light is still switching off. In those cases, the trigger will be ignored and the resulting image will be too dark.

由于抖动是不规则的,没有精确的方法可防止此情况的发生。如果您注意到其中一些图像比其他的要暗,则考虑是否可以选择以连续模式操作光源。您还可以尝试调整帧速率,例如,使用 19 fps,而不是 20 fps。

重启控制器#

为确保重启,需要将控制器断开电源五分钟。这是正常现象。如果您使用多个控制器,即使其他控制器没有遇到任何故障,也需要重启其他控制器的电源。

第一张图像太暗#

BslLightControlMode 参数设置为 On 时,在实际打开光源设备之前最多会有 1 秒的延迟。因此,第一张图像可能过暗。可以丢弃该图像,或者,如果需要所有图像,则仅在适当的延迟之后开始图像采集(例如,可以使用计时器)。

详情#

显示所有相机型号

相机型号 可用光源控制触发模式
a2A640-240gmSWIR 不支持的功能
a2A640-240umSWIR 不支持的功能
a2A1280-80gmSWIR 不支持的功能
a2A1280-125umSWIR 不支持的功能
a2A1920-51gcBAS 不支持的功能
a2A1920-51gcPRO 不支持的功能
a2A1920-51gmBAS 不支持的功能
a2A1920-51gmPRO 不支持的功能
a2A1920-160ucBAS 不支持的功能
a2A1920-160ucPRO 不支持的功能
a2A1920-160umBAS 不支持的功能
a2A1920-160umPRO 不支持的功能
a2A1920-165g5cBAS 不支持的功能
a2A1920-165g5mBAS 不支持的功能
a2A2448-23gcBAS 不支持的功能
a2A2448-23gcPRO 不支持的功能
a2A2448-23gmBAS 不支持的功能
a2A2448-23gmPRO 不支持的功能
a2A2448-75ucBAS 不支持的功能
a2A2448-75ucPRO 不支持的功能
a2A2448-75umBAS 不支持的功能
a2A2448-75umPRO 不支持的功能
a2A2448-105g5cBAS 不支持的功能
a2A2448-105g5mBAS 不支持的功能
a2A2590-22gcBAS 不支持的功能
a2A2590-22gcPRO 不支持的功能
a2A2590-22gmBAS 不支持的功能
a2A2590-22gmPRO 不支持的功能
a2A2590-60ucBAS 不支持的功能
a2A2590-60ucPRO 不支持的功能
a2A2590-60umBAS 不支持的功能
a2A2590-60umPRO 不支持的功能
a2A2600-20gcBAS 不支持的功能
a2A2600-20gcPRO 不支持的功能
a2A2600-20gmBAS 不支持的功能
a2A2600-20gmPRO 不支持的功能
a2A2600-64ucBAS 不支持的功能
a2A2600-64ucPRO 不支持的功能
a2A2600-64umBAS 不支持的功能
a2A2600-64umPRO 不支持的功能
a2A2840-14gcBAS 不支持的功能
a2A2840-14gcPRO 不支持的功能
a2A2840-14gmBAS 不支持的功能
a2A2840-14gmPRO 不支持的功能
a2A2840-48ucBAS 不支持的功能
a2A2840-48ucPRO 不支持的功能
a2A2840-48umBAS 不支持的功能
a2A2840-48umPRO 不支持的功能
a2A2840-67g5cBAS 不支持的功能
a2A2840-67g5mBAS 不支持的功能
a2A3840-13gcBAS 不支持的功能
a2A3840-13gcPRO 不支持的功能
a2A3840-13gmBAS 不支持的功能
a2A3840-13gmPRO 不支持的功能
a2A3840-45ucBAS 不支持的功能
a2A3840-45ucPRO 不支持的功能
a2A3840-45umBAS 不支持的功能
a2A3840-45umPRO 不支持的功能
a2A4096-9gcBAS 不支持的功能
a2A4096-9gcPRO 不支持的功能
a2A4096-9gmBAS 不支持的功能
a2A4096-9gmPRO 不支持的功能
a2A4096-30ucBAS 不支持的功能
a2A4096-30ucPRO 不支持的功能
a2A4096-30umBAS 不支持的功能
a2A4096-30umPRO 不支持的功能
a2A4096-44g5cBAS 不支持的功能
a2A4096-44g5mBAS 不支持的功能
a2A4200-12gcBAS 不支持的功能
a2A4200-12gcPRO 不支持的功能
a2A4200-12gmBAS 不支持的功能
a2A4200-12gmPRO 不支持的功能
a2A4200-40ucBAS 不支持的功能
a2A4200-40ucPRO 不支持的功能
a2A4200-40umBAS 不支持的功能
a2A4200-40umPRO 不支持的功能
a2A4504-5gcBAS 不支持的功能
a2A4504-5gcPRO 不支持的功能
a2A4504-5gmBAS 不支持的功能
a2A4504-5gmPRO 不支持的功能
a2A4504-18ucBAS 不支持的功能
a2A4504-18ucPRO 不支持的功能
a2A4504-18umBAS 不支持的功能
a2A4504-18umPRO 不支持的功能
a2A4504-27g5cBAS 不支持的功能
a2A4504-27g5mBAS 不支持的功能
a2A4508-6gcBAS 不支持的功能
a2A4508-6gcPRO 不支持的功能
a2A4508-6gmBAS 不支持的功能
a2A4508-6gmPRO 不支持的功能
a2A4508-20ucBAS 不支持的功能
a2A4508-20ucPRO 不支持的功能
a2A4508-20umBAS 不支持的功能
a2A4508-20umPRO 不支持的功能
a2A5320-7gcBAS 不支持的功能
a2A5320-7gcPRO 不支持的功能
a2A5320-7gmBAS 不支持的功能
a2A5320-7gmPRO 不支持的功能
a2A5320-23ucBAS 不支持的功能
a2A5320-23ucPRO 不支持的功能
a2A5320-23umBAS 不支持的功能
a2A5320-23umPRO 不支持的功能
a2A5320-34g5cBAS 不支持的功能
a2A5320-34g5mBAS 不支持的功能
a2A5328-4gcBAS 不支持的功能
a2A5328-4gcPRO 不支持的功能
a2A5328-4gmBAS 不支持的功能
a2A5328-4gmPRO 不支持的功能
a2A5328-15ucBAS 不支持的功能
a2A5328-15ucPRO 不支持的功能
a2A5328-15umBAS 不支持的功能
a2A5328-15umPRO 不支持的功能
a2A5328-22g5cBAS 不支持的功能
a2A5328-22g5mBAS 不支持的功能
acA640-90gc 不支持的功能
acA640-90uc 不支持的功能
acA640-121gm 不支持的功能
acA640-300gc 曝光激活
acA640-300gm 曝光激活
acA640-750uc 曝光激活
acA640-750um 曝光激活
acA720-290gc 曝光激活
acA720-290gm 曝光激活
acA720-520uc 曝光激活
acA720-520um 曝光激活
acA800-200gc 曝光激活
acA800-200gm 曝光激活
acA800-510uc 曝光激活
acA800-510um 曝光激活
acA1280-60gc 不支持的功能
acA1280-60gm 不支持的功能
acA1300-60gc 不支持的功能
acA1300-60gm 不支持的功能
acA1300-60gmNIR 不支持的功能
acA1300-75gc 曝光激活
acA1300-75gm 曝光激活
acA1300-200uc 曝光激活
acA1300-200um 曝光激活
acA1440-73gc 曝光激活
acA1440-73gm 曝光激活
acA1440-220uc 曝光激活
acA1440-220um 曝光激活
acA1600-20gc 不支持的功能
acA1600-20uc 不支持的功能
acA1600-60gc 不支持的功能
acA1600-60gm 不支持的功能
acA1920-25gc 不支持的功能
acA1920-25gm 不支持的功能
acA1920-25uc 不支持的功能
acA1920-25um 不支持的功能
acA1920-40gc 曝光激活
acA1920-40gm 曝光激活
acA1920-40uc 曝光激活
acA1920-40ucMED 不支持的功能
acA1920-40um 曝光激活
acA1920-40umMED 不支持的功能
acA1920-48gc 曝光激活
acA1920-48gm 曝光激活
acA1920-50gc 曝光激活
acA1920-50gm 曝光激活
acA1920-150uc 曝光激活
acA1920-150um 曝光激活
acA1920-155uc 曝光激活
acA1920-155ucMED 不支持的功能
acA1920-155um 曝光激活
acA1920-155umMED 不支持的功能
acA2000-50gc 不支持的功能
acA2000-50gm 不支持的功能
acA2000-165uc 不支持的功能
acA2000-165um 不支持的功能
acA2040-25gc 不支持的功能
acA2040-25gm 不支持的功能
acA2040-25gmNIR 不支持的功能
acA2040-35gc 曝光激活
acA2040-35gm 曝光激活
acA2040-55uc 曝光激活
acA2040-55um 曝光激活
acA2040-90uc 不支持的功能
acA2040-90um 不支持的功能
acA2040-90umNIR 不支持的功能
acA2040-120uc 曝光激活
acA2040-120um 曝光激活
acA2440-20gc 曝光激活
acA2440-20gm 曝光激活
acA2440-35uc 曝光激活
acA2440-35ucMED 不支持的功能
acA2440-35um 曝光激活
acA2440-35umMED 不支持的功能
acA2440-75uc 曝光激活
acA2440-75ucMED 不支持的功能
acA2440-75um 曝光激活
acA2440-75umMED 不支持的功能
acA2500-14gc 不支持的功能
acA2500-14gm 不支持的功能
acA2500-14uc 不支持的功能
acA2500-14um 不支持的功能
acA2500-20gc 曝光激活
acA2500-20gcMED 不支持的功能
acA2500-20gm 曝光激活
acA2500-20gmMED 不支持的功能
acA2500-60uc 曝光激活
acA2500-60um 曝光激活
acA3088-16gc 曝光激活
闪烁窗口
acA3088-16gm 曝光激活
闪烁窗口
acA3088-57uc 曝光激活
闪烁窗口
acA3088-57ucMED 不支持的功能
acA3088-57um 曝光激活
闪烁窗口
acA3088-57umMED 不支持的功能
acA3800-10gc 不支持的功能
acA3800-10gm 不支持的功能
acA3800-14uc 不支持的功能
acA3800-14um 不支持的功能
acA4024-8gc 曝光激活
闪烁窗口
acA4024-8gm 曝光激活
闪烁窗口
acA4024-29uc 曝光激活
闪烁窗口
acA4024-29um 曝光激活
闪烁窗口
acA4096-11gc 曝光激活
acA4096-11gm 曝光激活
acA4096-30uc 曝光激活
acA4096-30ucMED 不支持的功能
acA4096-30um 曝光激活
acA4096-30umMED 不支持的功能
acA4096-40uc 曝光激活
acA4096-40ucMED 不支持的功能
acA4096-40um 曝光激活
acA4096-40umMED 不支持的功能
acA4112-8gc 曝光激活
acA4112-8gm 曝光激活
acA4112-20uc 曝光激活
acA4112-20ucMED 不支持的功能
acA4112-20um 曝光激活
acA4112-20umMED 不支持的功能
acA4112-30uc 曝光激活
acA4112-30ucMED 不支持的功能
acA4112-30um 曝光激活
acA4112-30umMED 不支持的功能
acA4600-7gc 不支持的功能
acA4600-10uc 不支持的功能
acA5472-5gc 曝光激活
闪烁窗口
acA5472-5gm 曝光激活
闪烁窗口
acA5472-17uc 曝光激活
闪烁窗口
acA5472-17ucMED 不支持的功能
acA5472-17um 曝光激活
闪烁窗口
acA5472-17umMED 不支持的功能
boA1936-400cc 不支持的功能
boA1936-400cm 不支持的功能
boA2448-250cc 不支持的功能
bo2448-250cm 不支持的功能
boA2832-190cc 不支持的功能
bo2832-190cm 不支持的功能
boA4096-93cc 不支持的功能
boA4096-93cm 不支持的功能
boA4096-180cc 不支持的功能
bo4096-180cm 不支持的功能
boA4112-68cc 不支持的功能
boA4112-68cm 不支持的功能
boA4500-45cc 不支持的功能
boA4500-45cm 不支持的功能
boA4504-100cc 不支持的功能
boA4504-100cm 不支持的功能
boA5120-150cc 不支持的功能
boA5120-150cm 不支持的功能
boA5120-230cc 不支持的功能
boA5120-230cm 不支持的功能
boA5320-150cc 不支持的功能
boA5320-150cm 不支持的功能
boA5328-100cc 不支持的功能
boA5328-100cm 不支持的功能
boA6500-36cc 不支持的功能
boA6500-36cm 不支持的功能
boA8100-16cc 不支持的功能
boA8100-16cm 不支持的功能
boA9344-70cc 不支持的功能
boA9344-70cm 不支持的功能
daA720-520uc 不支持的功能
daA720-520um 不支持的功能
daA1280-54uc 不支持的功能
daA1280-54um 不支持的功能
daA1440-220uc 不支持的功能
daA1440-220um 不支持的功能
daA1600-60uc 不支持的功能
daA1600-60um 不支持的功能
daA1920-15um 不支持的功能
daA1920-30uc 不支持的功能
daA1920-30um 不支持的功能
daA1920-160uc 不支持的功能
daA1920-160um 不支持的功能
daA2448-70uc 不支持的功能
daA2448-70um 不支持的功能
daA2500-14uc 不支持的功能
daA2500-14um 不支持的功能
daA3840-45uc 不支持的功能
daA3840-45um 不支持的功能
puA1280-54uc 不支持的功能
puA1280-54um 不支持的功能
puA1600-60uc 不支持的功能
puA1600-60um 不支持的功能
puA1920-30uc 不支持的功能
puA1920-30um 不支持的功能
puA2500-14uc 不支持的功能
puA2500-14um 不支持的功能

示例代码#

// 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
CEnumParameter(nodemap, "BslLightControlMode").SetValue("On");
// Enumerate the light devices
CCommandParameter(nodemap, "BslLightControlEnumerateDevices").Execute();
// Select light device 1
CEnumParameter(nodemap, "BslLightDeviceSelector").SetValue("Device1");
// Set the maximum 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 continuous
CEnumParameter(nodemap, "BslLightDeviceOperationMode").SetValue("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);
/* 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);

您也可以使用 pylon Viewer 轻松设置参数。