Periodic Signal (dart E)#
機能を使用する#
仕組み#
Basler dart E cameras that support the Periodic Signal feature provide an additional camera signal source, PeriodicSignal1
. The signal is synchronized to electrical signals applied via the camera's input line 1.
たとえば、入力ライン1に0.3秒間の電気信号を印加すると、カメラの内部周期信号が適応し、カメラは0.3秒ごとに画像をキャプチャします。
電気信号の周期を増減させると、カメラの内部周期信号が新しい時間に適応するまでに時間がかかります。カメラのフレームレートは、それに応じて増減します。電気信号の印加を停止すると、画像取得は停止します。
この機能には、標準的なハードウェアトリガーと比較して、次のような利点があります:
- この機能では、エッジトリガー(立ち上がりエッジまたは立ち下がりエッジ、
BslPeriodicSignalActivation
パラメーターで設定)が可能になります。Standardハードウェアトリガーでは、レベルトリガーのみが可能です。 - カメラは信号が周期的であることを「認識している」ので、次の信号を予測して、カメラを画像取得のために準備することができます。これにより、トリガー信号の検出から実際の露光開始までの時間が短縮されます。
- 負のトリガー遅延(
BslPeriodicSignalDelay
パラメーターで設定)を指定できます。つまり、電気信号が実際に印加される前にカメラは画像を取得します。
情報
Baslerは、電気信号を一定の速度で印加することをお勧めします。撮影周期の増減によりカメラの動作が不安定になり、フレームが落ちてしまうおそれがあります。
Periodic Signalの設定#
同期画像取得をカメラに設定するには:
- 定期的な信号によってトリガーされるようにカメラを設定します。
TriggerMode
パラメーターをOn
に設定します。TriggerSource
パラメーターをPeriodicSignal1
に設定します。
- 信号遷移タイプを設定します:
- カメラで入力信号の 立ち下がり エッジの画像をキャプチャする場合は、
BslPeriodicSignalActivation
パラメーターをFallingEdge
に設定します。 - カメラで入力信号の立ち上がりエッジの画像をキャプチャする場合は、
BslPeriodicSignalActivation
パラメーターをRisingEdge
に設定します。
- カメラで入力信号の 立ち下がり エッジの画像をキャプチャする場合は、
- 信号遅延を設定します:
- 入力信号の受信直後にカメラで画像をキャプチャする場合は、
BslPeriodicSignalDelay
パラメーターを0に設定します。 - 入力信号の受信前または受信後にカメラで画像をキャプチャする場合は、
BslPeriodicSignalDelay
パラメーターをナノ秒単位で0以外の値に設定します。たとえば、パラメーターを-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);
You can also use the pylon Viewer to easily set the parameters.