Light Control Feature Set#
Light Control機能セットは、カメラとライトデバイスが互いに直接通信できるようにするSLPプロトコルに基づいています。ライトデバイスは、サードパーティ製のライトでもBasler Camera Lightポートフォリオのライトでもかまいません。サードパーティ製のライトを使用する場合は、カメラとライト間の通信を有効にするために、Basler SLP Strobe Controllerが必要です。Baslerライトを選択した場合は、コントローラー機能がすでに含まれているため、別のコントローラーは必要ありません。どちらのオプションもプラグアンドプレイです。
機能を使用する#
Basler Light/Light Controllerの設定#
- まだ接続していない場合は、コントローラーとライトを接続します。
- pylon ViewerでPollingオプションを有効にします。
BslLightControlMode
パラメーターをOn
に設定します。BslLightControlSource
パラメーターは、ライト機能を制御するためにカメラのどのGPIOラインが使用されているかを示します。
新しいコントローラーを接続する場合は、次に使用可能なライトデバイスIDが自動的に割り当てられます。BslLightControlEnumerateDevices
コマンドを実行します。- 環境内に複数のBaslerライトまたはライトコントローラーがある場合は、設定するデバイスに
BslLightDeviceSelector
パラメーターを設定
します。ライトデバイスIDが競合しないようにしてください。 -
If you use a Basler SLP Strobe Controller, specify whether you want to control the light device using current or voltage via the
BslLightDeviceControlMode
parameter. Every light can be controlled via current control. For lights designed for a 12 V or 24 V connection, it is recommended to use voltage control. If you use a Basler Camera Light, you can skip this step. The parameter is set automatically in this case.情報
Note that every time you're switching from current to voltage or vice versa, there is a short initialization phase of the controller during which the connected light lights up. This can last for up to 15 s and is normal behavior.
-
If you use a Basler SLP Strobe Controller, set the
BslLightDeviceMaxCurrent
parameter to the maximum current rating of your light in continuous operation.
If you use a Basler Camera Light, the maximum current is set automatically.
This ensures that your light will not get damaged and that you can safely use the whole current range of your light using theBslLightDeviceBrightness
parameter.
You can only change theBslLightDeviceMaxCurrent
parameter value, when theBslLightDeviceOperationMode
parameter is set toOff
. - 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 theBslLightDeviceMaxCurrent
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. - パラメーターを
BslLightDeviceOperationMode
目的のモードへのパラメーター:On
: This will make the light shine continuously.Strobe
: This will set the light to strobe mode. You can configure the strobe mode with theBslLightDeviceStrobeMode
andBslLightDeviceStrobeDuration
parameters.
Strobe Modeの設定#
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 500 % (for the light controller), which increases the brightness of your light. Before you do so, read the instructions in the Overdrive Mode section.
On rolling shutter cameras, if you have set the BslLightDeviceOperationMode
parameter to Strobe
, use the BslLightControlTriggerMode
parameter to determine how to trigger the light. Different trigger modes are available:
ExposureActive
: Use this mode only if you're not overlapping image acquisitions.FlashWindow
: If you use this mode, make sure that the camera generates a Flash Window signal.
On global shutter cameras, the trigger mode is preset.
情報
There is a delay of approx. 23 µs between exposure start and the light being turned on.
情報
Light Control機能セットに関連するFlash Window信号の実装は、まだ開発中です。特に、非常に短いフラッシュウィンドウ信号では、満足できる結果が得られない場合があります(生成された画像の一部の線が明るすぎたり暗すぎたりする場合があります)。
個々のストロボpulseの継続時間を制御するには、BslLightDeviceStrobeMode
パラメーターを使用して、自動または手動のどちらでストロボ操作を行うかを指定する必要があります。
Automatic
: The duration of the individual strobe pulses is controlled by theExposureTime
parameter of the camera. The strobe lasts for the duration of the exposure time that you have specified. For more information, see the Troubleshooting section.Manual
: You can define the duration of the individual strobe pulses yourself using theBslLightDeviceStrobeDuration
parameter. If you're operating the camera at the upper end of its capabilities, overtriggering may occur.
情報
TriggerWidth露光モード、Sequencer機能、またはカメラのオートファンクション(Auto Exposure、Auto Gainなど)を使用している場合は、Manual
ストボモードを使用する必要があります。
情報
カメラはライトのトリガーとライトコントロールパラメーター設定の変更に同一ラインを使用します。パラメーターの変更が優先されるため、設定変更中はラインをトリガー信号に使用できないので、ストロボ動作が中断されます。これを回避するには、BslLightControlStatus
を確認します。値がReady
の場合、ライトデバイスはトリガーを受信する準備ができた状態であることを意味します。あるいは、ストロボモードが無効になっているときにのみパラメーター設定を変更します。
Overdrive Mode#
ライトをオーバードライブすると、ライトがストロボモードのときに、電流を増加させて、より高い光輝度を得ることができます。
注意 – 正しく操作しないと、ライトが損傷するおそれがあります。
このセクションの手順をよく読んで、接続されているライトの損傷を回避し、ライトが早期劣化しないようにしてください。
オーバードライブモードを使用する場合は、ライトの損傷を避けるために、次の点を考慮する必要があります。
- In strobe mode, the
BslLightDeviceBrightness
parameter can be set to values above 100 %. The maximum value depends on the strobe pulse duration and the duty cycle. For Basler Camera Lights, the maximum allowed brightness is calculated automatically and the range of the brightness slider will be adjusted accordingly. When using a third-party light and the Basler SLP Strobe Controller, you have to calculate the maximum brightness value yourself and enter this value in theBslLightDeviceOverdriveLimit
parameter. For example, 200 % means that the maximum current in strobe operation will be twice as high as theBslLightDeviceMaxCurrent
parameter value. - Check with the manufacturer of your light if you're not sure what the maximum current is that your light can withstand in strobe mode. The Basler SLP Strobe Controller allows setting the
BslLightDeviceOverdriveLimit
parameter to 500 % but most lights are not able to withstand the currents that would result from this overdrive limit. - 電流フローが増加するとLEDの温度が上昇するため、ライトが再び冷えるまで、各ストロボpulse間に十分な時間を確保する必要があります。一般的な経験則として、pulseの輝度が高いほど、pulse間隔を空ける必要があります。
- 露光時間が、pulseの長さとデューティサイクルに影響を与える点を考慮してください。
情報
Safety features that avoid damaging the controller hardware.
- Currents above 2 A in combination with long exposure times and high duty cycles may damage the controller hardware. In order to avoid this, the maximum allowed current is calculated automatically and the maximum allowed brightness is reduced accordingly (see Table 1 below).
The duty cycle calculation is based on the maximum possible frame rate of the camera. The maximum possible frame rate of the camera can be reduced by using the Acquisition Frame Rate feature.
Safety features that avoid damaging the light.
- If the chosen overdrive brightness is too high in respect to the strobe duration and the duty cycle (see Table 2), the strobe duration will be reduced or triggers will be ignored.
Table 1 (Controller Protection)
Output Current ( BslLightDeviceBrightness xBslLightDeviceMaxCurrent ) | Max. Strobe Duration | Max. Duty Cycle |
---|---|---|
Under 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 % |
Table 2 (Light Protection)
Required Brightness | Max. Strobe Duration | Max. Duty Cycle |
---|---|---|
0–100 % | - | 100 % |
101–200 % | 30 ms | 30 % |
201–300 % | 10 ms | 20 % |
301–500 % | 2 ms | 10 % |
501–1000 % | 1 ms | 5 % |
Light Device IDの変更#
ライトのIDを変更するには、次の手順に従います。
BslLightControlMode
パラメーターをOn
に設定します。BslLightDeviceOperationMode
パラメーターをOff
に設定します。BslLightDeviceSelector
パラメーターに、IDを変更するBaslerライト/コントローラーを設定します。BslLightDeviceChangeID
パラメーターを必要な値に設定します。
IDはすぐに変更されます。
情報
Using More Than One Light Device or Basler Camera Light
When using more than one light device, you have to make sure that their IDs are all different. Using devices with identical IDs will cause communication errors. Duplicate IDs can occur, if you're connecting new devices for the first time because all devices are shipped with the light device ID set to 7. It can also occur when connecting existing devices from another system as light device IDs are remembered by the device once they have been set. The best way to prevent conflicts, is to connect devices one after the other and always assign a new and unique ID after having connected a device.
トラブルシューティング#
エラーのチェックとクリア#
ライト/ライトコントローラーは、ユーザーが自身で修正できるエラーを検出できます。BslLightDeviceLastError
パラメーターをチェックして、発生したエラーを確認します。エラーを修正したら、リストからクリアできます。
最大25個のエラーを保存できます。26番目のエラーが発生すると、最も古いエラーが上書きされます。以後同様です。
複数のライト/ライトコントローラーが接続されている場合、BslLightControlErrorStatus
は、どのデバイスに問題が発生しているかを示します。
エラーのチェックとクリアは、発生したエラーの数に応じた反復的なプロセスです。
エラーを確認してクリアするには、次の手順に従います。
- 最後に発生したエラーを確認するには、
BslLightDeviceLastError
パラメーターの値を取得します。 - 対応するエラーを修正します。
- エラーのリストから最後のエラーを削除するには、
BslLightDeviceClearLastError
コマンドを実行します。 BslLightDeviceLastError
パラメーターにNoError
が表示されるまで、最後のエラーの取得と削除を続行します。
使用可能なError Codes
値 | 意味 |
---|---|
No Error | 前回エラーメモリがクリアされてから、ライト/ライトコントローラーはエラーを検出しませんでした。 |
Communication Error | ライト/ライトコントローラーとカメラ間のデータ伝送に不具合があると、通信エラーが発生します。これは、長すぎるケーブルを使用したり、ラインのノイズが大きすぎたりして発生することがあります。 |
Connection Error | ライト/ライトコントローラーとカメラ間の接続が途絶えた場合、または通信エラーがすでに発生している場合、接続エラーが発生します。その他の理由としては、接続が緩んでいるか、コントローラーの接続が完全に切断されていることが考えられます。 |
Hardware Error | ライト/ライトコントローラーに技術的な障害が発生しています。電源を切断してから再接続すると、問題が解決する場合があります。詳細については、コントローラーへの電源再投入を参照してください。 |
Automatic Strobe Modeでのオーバートリガー#
カメラの機能の上端でカメラを操作している場合、ライト/ライトコントローラーのオーバートリガーが発生することがあります。オーバートリガーとは、ライト/ライトコントローラーが準備ができていない間(ライトのスイッチオフ処理中など)にトリガーを受信することを意味します。これは、トリガーが無視され、次の露光ではライトが点灯しないことを意味します。この問題をよりよく理解するには、次の例を吟味してください。
100fpsに対応したカメラは、露光時間を50msに設定して操作されます。つまり、カメラは、撮影の間に一時停止することなく、1秒あたり20フレームをすばやく連続して取得します。これは、ライト/ライトコントローラーのトリガーは、2回の露光の間に正確にエッジに来る必要があるということです。実際には、時々ライトがまだオフになっている間にトリガーが到着する原因となる内在的ジッターのせいで、ほとんど実現不可能です。このような場合、トリガーは無視され、生成された画像は暗くなりすぎます。
ジッターは不規則なため、この発生を回避する正確な方法はありません。一部の画像が他の画像より暗い場合は、ライトを連続モードで動作させることができるかどうかを検討してください。また、フレームレートを調整することもできます。たとえば、20fpsではなく19fpsを使用するなどです。
コントローラーへの電源再投入#
To ensure power-cycling, the controller needs to be disconnected from electricity for five minutes. This is normal behavior. If you're using more than one controller, the other controllers need to be power-cycled as well even if they haven't experienced any faults.
最初の画像が暗すぎます#
BslLightControlMode
パラメーターをOn
に設定すると、ライトデバイスが実際にオンになるまで最大1秒の遅延が発生します。これが原因で最初の画像が暗くなりすぎる可能性があります。その場合、その画像を破棄してください。また、すべての画像が必要な場合は、タイマーなどを使用して、適切な遅延後にのみ画像取得を開始するようにしてください。
特性#
カメラモデル | 使用可能なLight Control Trigger Mode |
---|---|
a2A1920-51gcBAS | 機能はサポートされていません |
a2A1920-51gcPRO | 機能はサポートされていません |
a2A1920-51gmBAS | 機能はサポートされていません |
a2A1920-51gmPRO | 機能はサポートされていません |
a2A1920-160ucBAS | 機能はサポートされていません |
a2A1920-160ucPRO | 機能はサポートされていません |
a2A1920-160umBAS | 機能はサポートされていません |
a2A1920-160umPRO | 機能はサポートされていません |
a2A2590-22gcBAS | 機能はサポートされていません |
a2A2590-22gcPRO | 機能はサポートされていません |
a2A2590-22gmBAS | 機能はサポートされていません |
a2A2590-22gmPRO | 機能はサポートされていません |
a2A2590-60ucBAS | 機能はサポートされていません |
a2A2590-60ucPRO | 機能はサポートされていません |
a2A2590-60umBAS | 機能はサポートされていません |
a2A2590-60umPRO | 機能はサポートされていません |
a2A3840-13gcBAS | 機能はサポートされていません |
a2A3840-13gcPRO | 機能はサポートされていません |
a2A3840-13gmBAS | 機能はサポートされていません |
a2A3840-13gmPRO | 機能はサポートされていません |
a2A3840-45ucBAS | 機能はサポートされていません |
a2A3840-45ucPRO | 機能はサポートされていません |
a2A3840-45umBAS | 機能はサポートされていません |
a2A3840-45umPRO | 機能はサポートされていません |
a2A4504-5gcBAS | 機能はサポートされていません |
a2A4504-5gcPRO | 機能はサポートされていません |
a2A4504-5gmBAS | 機能はサポートされていません |
a2A4504-5gmPRO | 機能はサポートされていません |
a2A4504-18ucBAS | 機能はサポートされていません |
a2A4504-18ucPRO | 機能はサポートされていません |
a2A4504-18umBAS | 機能はサポートされていません |
a2A4504-18umPRO | 機能はサポートされていません |
a2A5320-7gcBAS | 機能はサポートされていません |
a2A5320-7gcPRO | 機能はサポートされていません |
a2A5320-7gmBAS | 機能はサポートされていません |
a2A5320-7gmPRO | 機能はサポートされていません |
a2A5320-23ucBAS | 機能はサポートされていません |
a2A5320-23ucPRO | 機能はサポートされていません |
a2A5320-23umBAS | 機能はサポートされていません |
a2A5320-23umPRO | 機能はサポートされていません |
a2A5328-4gcBAS | 機能はサポートされていません |
a2A5328-4gcPRO | 機能はサポートされていません |
a2A5328-4gmBAS | 機能はサポートされていません |
a2A5328-4gmPRO | 機能はサポートされていません |
a2A5328-15ucBAS | 機能はサポートされていません |
a2A5328-15ucPRO | 機能はサポートされていません |
a2A5328-15umBAS | 機能はサポートされていません |
a2A5328-15umPRO | 機能はサポートされていません |
acA640-90gc | 機能はサポートされていません |
acA640-90gm | 機能はサポートされていません |
acA640-90uc | 機能はサポートされていません |
acA640-90um | 機能はサポートされていません |
acA640-120gc | 機能はサポートされていません |
acA640-120gm | 機能はサポートされていません |
acA640-120uc | 機能はサポートされていません |
acA640-120um | 機能はサポートされていません |
acA640-121gm | 機能はサポートされていません |
acA640-300gc | Exposure Active |
acA640-300gm | Exposure Active |
acA640-750uc | Exposure Active |
acA640-750um | Exposure Active |
acA720-290gc | Exposure Active |
acA720-290gm | Exposure Active |
acA720-520uc | Exposure Active |
acA720-520um | Exposure Active |
acA780-75gc | 機能はサポートされていません |
acA780-75gm | 機能はサポートされていません |
acA800-200gc | Exposure Active |
acA800-200gm | Exposure Active |
acA800-510uc | Exposure Active |
acA800-510um | Exposure Active |
acA1280-60gc | 機能はサポートされていません |
acA1280-60gm | 機能はサポートされていません |
acA1300-22gc | 機能はサポートされていません |
acA1300-22gm | 機能はサポートされていません |
acA1300-30gc | 機能はサポートされていません |
acA1300-30gm | 機能はサポートされていません |
acA1300-30uc | 機能はサポートされていません |
acA1300-30um | 機能はサポートされていません |
acA1300-60gc | 機能はサポートされていません |
acA1300-60gm | 機能はサポートされていません |
acA1300-60gmNIR | 機能はサポートされていません |
acA1300-75gc | Exposure Active |
acA1300-75gm | Exposure Active |
acA1300-200uc | Exposure Active |
acA1300-200um | Exposure Active |
acA1440-73gc | Exposure Active |
acA1440-73gm | Exposure Active |
acA1440-220uc | Exposure Active |
acA1440-220um | Exposure Active |
acA1600-20gc | 機能はサポートされていません |
acA1600-20gm | 機能はサポートされていません |
acA1600-20uc | 機能はサポートされていません |
acA1600-20um | 機能はサポートされていません |
acA1600-60gc | 機能はサポートされていません |
acA1600-60gm | 機能はサポートされていません |
acA1920-25gc | 機能はサポートされていません |
acA1920-25gm | 機能はサポートされていません |
acA1920-25uc | 機能はサポートされていません |
acA1920-25um | 機能はサポートされていません |
acA1920-40gc | Exposure Active |
acA1920-40gm | Exposure Active |
acA1920-40uc | Exposure Active |
acA1920-40ucMED | 機能はサポートされていません |
acA1920-40um | Exposure Active |
acA1920-40umMED | 機能はサポートされていません |
acA1920-48gc | Exposure Active |
acA1920-48gm | Exposure Active |
acA1920-50gc | Exposure Active |
acA1920-50gm | Exposure Active |
acA1920-150uc | Exposure Active |
acA1920-150um | Exposure Active |
acA1920-155uc | Exposure Active |
acA1920-155ucMED | 機能はサポートされていません |
acA1920-155um | Exposure Active |
acA1920-155umMED | 機能はサポートされていません |
acA2000-50gc | 機能はサポートされていません |
acA2000-50gm | 機能はサポートされていません |
acA2000-50gmNIR | 機能はサポートされていません |
acA2000-165uc | 機能はサポートされていません |
acA2000-165um | 機能はサポートされていません |
acA2000-165umNIR | 機能はサポートされていません |
acA2040-25gc | 機能はサポートされていません |
acA2040-25gm | 機能はサポートされていません |
acA2040-25gmNIR | 機能はサポートされていません |
acA2040-35gc | Exposure Active |
acA2040-35gm | Exposure Active |
acA2040-55uc | Exposure Active |
acA2040-55um | Exposure Active |
acA2040-90uc | 機能はサポートされていません |
acA2040-90um | 機能はサポートされていません |
acA2040-90umNIR | 機能はサポートされていません |
acA2040-120uc | Exposure Active |
acA2040-120um | Exposure Active |
acA2440-20gc | Exposure Active |
acA2440-20gm | Exposure Active |
acA2440-35uc | Exposure Active |
acA2440-35ucMED | 機能はサポートされていません |
acA2440-35um | Exposure Active |
acA2440-35umMED | 機能はサポートされていません |
acA2440-75uc | Exposure Active |
acA2440-75ucMED | 機能はサポートされていません |
acA2440-75um | Exposure Active |
acA2440-75umMED | 機能はサポートされていません |
acA2500-14gc | 機能はサポートされていません |
acA2500-14gm | 機能はサポートされていません |
acA2500-14uc | 機能はサポートされていません |
acA2500-14um | 機能はサポートされていません |
acA2500-20gc | Exposure Active |
acA2500-20gcMED | 機能はサポートされていません |
acA2500-20gm | Exposure Active |
acA2500-20gmMED | 機能はサポートされていません |
acA2500-60uc | Exposure Active |
acA2500-60um | Exposure Active |
acA3088-16gc | Exposure Active Flash Window |
acA3088-16gm | Exposure Active Flash Window |
acA3088-57uc | Exposure Active Flash Window |
acA3088-57ucMED | 機能はサポートされていません |
acA3088-57um | Exposure Active Flash Window |
acA3088-57umMED | 機能はサポートされていません |
acA3800-10gc | 機能はサポートされていません |
acA3800-10gm | 機能はサポートされていません |
acA3800-14uc | 機能はサポートされていません |
acA3800-14um | 機能はサポートされていません |
acA4024-8gc | Exposure Active Flash Window |
acA4024-8gm | Exposure Active Flash Window |
acA4024-29uc | Exposure Active Flash Window |
acA4024-29um | Exposure Active Flash Window |
acA4096-11gc | Exposure Active |
acA4096-11gm | Exposure Active |
acA4096-30uc | Exposure Active |
acA4096-30ucMED | 機能はサポートされていません |
acA4096-30um | Exposure Active |
acA4096-30umMED | 機能はサポートされていません |
acA4096-40uc | Exposure Active |
acA4096-40ucMED | 機能はサポートされていません |
acA4096-40um | Exposure Active |
acA4096-40umMED | 機能はサポートされていません |
acA4112-8gc | Exposure Active |
acA4112-8gm | Exposure Active |
acA4112-20uc | Exposure Active |
acA4112-20ucMED | 機能はサポートされていません |
acA4112-20um | Exposure Active |
acA4112-20umMED | 機能はサポートされていません |
acA4112-30uc | Exposure Active |
acA4112-30ucMED | 機能はサポートされていません |
acA4112-30um | Exposure Active |
acA4112-30umMED | 機能はサポートされていません |
acA4600-7gc | 機能はサポートされていません |
acA4600-10uc | 機能はサポートされていません |
acA5472-5gc | Exposure Active Flash Window |
acA5472-5gm | Exposure Active Flash Window |
acA5472-17uc | Exposure Active Flash Window |
acA5472-17ucMED | 機能はサポートされていません |
acA5472-17um | Exposure Active Flash Window |
acA5472-17umMED | 機能はサポートされていません |
boA4096-93cc | 機能はサポートされていません |
boA4096-93cm | 機能はサポートされていません |
boA4112-68cc | 機能はサポートされていません |
boA4112-68cm | 機能はサポートされていません |
boA6500-36cm | 機能はサポートされていません |
boA8100-16cm | 機能はサポートされていません |
daA1280-54lc | 機能はサポートされていません |
daA1280-54lm | 機能はサポートされていません |
daA1280-54uc | 機能はサポートされていません |
daA1280-54um | 機能はサポートされていません |
daA1600-60lc | 機能はサポートされていません |
daA1600-60lm | 機能はサポートされていません |
daA1600-60uc | 機能はサポートされていません |
daA1600-60um | 機能はサポートされていません |
daA1920-15um | 機能はサポートされていません |
daA1920-30uc | 機能はサポートされていません |
daA1920-30um | 機能はサポートされていません |
daA1920-160uc | 機能はサポートされていません |
daA1920-160um | 機能はサポートされていません |
daA2500-14lc | 機能はサポートされていません |
daA2500-14lm | 機能はサポートされていません |
daA2500-14uc | 機能はサポートされていません |
daA2500-14um | 機能はサポートされていません |
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を使用して、パラメーターを簡単に設定することもできます。