Periodic Signal (dart E)#
機能を使用する#
仕組み#
Periodic Signal機能をサポートするBasler dart Eカメラには、追加のカメラ信号ソースが用意されています。 PeriodicSignal1。この信号は、カメラの入力ライン1を介して印加される電気信号と同期します。
たとえば、入力ライン1に0.3秒間の電気信号を印加すると、カメラの内部周期信号が適応し、カメラは0.3秒ごとに画像をキャプチャします。
電気信号の周期を増減させると、カメラの内部周期信号が新しい時間に適応するまでに時間がかかります。カメラのフレームレートは、それに応じて増減します。電気信号の印加を停止すると、画像取得は停止します。
この機能には、標準的なハードウェアトリガーと比較して、次のような利点があります:
- これにより、エッジトリガー(立ち上がりエッジまたは立ち下がりエッジ。設定は
BslPeriodicSignalActivationパラメータで行います)が可能になります。標準的なハードウェアトリガーでは、レベルトリガーしか使用できません。 - カメラは信号が周期的であることを「認識している」ので、次の信号を予測して、カメラを画像取得のために準備することができます。これにより、トリガー信号の検出から実際の露光開始までの時間が短縮されます。
- 負のTrigger Delay(設定は
BslPeriodicSignalDelayパラメータで行います)を指定できるため、電気信号が実際に印加される前にカメラが画像を取り込むことができます。
情報
Baslerは、電気信号を一定の速度で印加することをお勧めします。撮影周期の増減によりカメラの動作が不安定になり、フレームが落ちてしまうおそれがあります。
Periodic Signalの設定#
同期画像取得をカメラに設定するには:
- 定期的な信号によってトリガーされるようにカメラを設定します。
- パラメーターを
TriggerModeパラメータをOn. - パラメーターを
TriggerSourceパラメータをPeriodicSignal1.
- パラメーターを
- 信号遷移タイプを設定します:
- カメラに入力信号の 立ち下がり エッジで画像を取り込ませる場合は、
BslPeriodicSignalActivationパラメータをFallingEdge. - カメラに入力信号の 立ち上がり エッジで画像を取り込ませる場合は、
BslPeriodicSignalActivationパラメータをRisingEdge.
- カメラに入力信号の 立ち下がり エッジで画像を取り込ませる場合は、
- 信号遅延を設定します:
- 入力信号が到着した 直ちに カメラに画像を取り込ませる場合は、
BslPeriodicSignalDelayパラメータを0に設定します。 - 入力信号が到着した 前または後 に入力信号が到着した場合は、
BslPeriodicSignalDelayパラメータをナノ秒単位の他の任意の値に設定します。たとえば、パラメータを-500000に設定した場合、次の信号の到着予定時刻の0.5秒前にカメラが画像を取り込みます。
- 入力信号が到着した 直ちに カメラに画像を取り込ませる場合は、
- カメラの入力ライン1を介して周期的に電気信号を印加します。
サンプルコード#
// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
camera.TriggerSource.SetValue(TriggerSource_PeriodicSignal1);
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the transition type to falling edge
camera.BslPeriodicSignalActivation.SetValue(BslPeriodicSignalActivation_FallingEdge);
// Set the signal delay to 0
camera.BslPeriodicSignalDelay.SetValue(0);
INodeMap& nodemap = camera.GetNodeMap();
// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
CEnumParameter(nodemap, "TriggerSource").SetValue("PeriodicSignal1");
CEnumParameter(nodemap, "TriggerMode").SetValue("On");
// Set the transition type to falling edge
CEnumParameter(nodemap, "BslPeriodicSignalActivation").SetValue("FallingEdge");
// Set the signal delay to 0
CIntegerParameter(nodemap, "BslPeriodicSignalDelay").SetValue(0);
// Configure the camera to be triggered by the periodic signal
// Note: You must set the trigger source first and then the trigger mode
camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.PeriodicSignal1);
camera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);
// Set the transition type to falling edge
camera.Parameters[PLCamera.BslPeriodicSignalActivation].SetValue(PLCamera.BslPeriodicSignalActivation.FallingEdge);
// Set the signal delay to 0
camera.Parameters[PLCamera.BslPeriodicSignalDelay].SetValue(0);
/* 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 */
/* Configure the camera to be triggered by the periodic signal */
/* Note: You must set the trigger source first and then the trigger mode */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
/* Set the transition type to falling edge */
errRes = PylonDeviceFeatureFromString(hdev, "BslPeriodicSignalActivation", "FallingEdge");
CHECK(errRes);
/* Set the signal delay to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
CHECK(errRes);
# Configure the camera to be triggered by the periodic signal
# Note: You must set the trigger source first and then the trigger mode
camera.TriggerSource.Value = "PeriodicSignal1"
camera.TriggerMode.Value = "On"
# Set the transition type to falling edge
camera.BslPeriodicSignalActivation.Value = "FallingEdge"
# Set the signal delay to 0
camera.BslPeriodicSignalDelay.Value = 0
/* 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 */
/* Configure the camera to be triggered by the periodic signal */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "PeriodicSignal1");
CHECK(errRes);
/* Set the transition type to falling edge */
errRes = PylonDeviceFeatureFromString(hdev, "BslPeriodicSignalActivation", "FallingEdge");
CHECK(errRes);
/* Set the signal delay to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslPeriodicSignalDelay", 0);
CHECK(errRes);
また、pylon Viewerを使用してパラメーターを簡単に設定することもできます。