觸發式影像擷取 (dart E)#
大多數現代造影應用皆採用觸發式影像擷取。
使用功能#
硬體與軟體觸發#
當攝影機設定為硬體觸發時,施加到攝影機其中一個輸入線路的電子訊號可以作為觸發訊號。
當相機設定為 軟體 觸發時,軟體命令或訊號會作為觸發訊號。此軟體命令可使用 pylon API 執行。
在組態設定方面,硬體觸發與軟體觸發唯一的差別在於 Trigger Source。針對硬體觸發,您必須選擇 hardware trigger source。針對軟體觸發,您必須選擇 software trigger source。
此外,某些組態步驟並不適用於軟體觸發,例如選擇 trigger activation mode。
設定觸發影像擷取#
若要設定觸發式影像擷取:
- 將相機中的
TriggerMode參數設為On以啟用觸發式影像擷取。 - 設定觸發:
- 將相機中的
TriggerSource可用來定義參數 哪個信號 會觸發觸發源。 - 如果適用,請設定
TriggerActivation可用來定義參數 哪一個信號轉態(signal transition) 會觸發觸發源。
- 將相機中的
資訊
-
觸發相機的速率請勿超過以下一個或兩個限制因素:
- 目前攝影機設定允許的最大影格率。如果您在攝影機尚未準備好接收時發送 Frame Start 觸發訊號,這些訊號將會被忽略。
- 主機電腦在資料傳輸、儲存或兩者方面的容量限制。如果您嘗試擷取主機電腦無法處理的更多影像,可能會遺失畫格。
Trigger Sources#
您可以使用以下項目設定 Trigger Source: TriggerSource 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。
這定義了觸發如何被觸發。
以下是可用的 Trigger Source:
硬體觸發源 (Hardware Trigger Sources)#
Line1:透過對 I/O 線路 1 施加電子訊號,可以觸發所選的觸發器。PeriodicSignal1:選定的觸發可使用 Periodic Signal 功能。
軟體觸發源 (Software Trigger Sources)#
Software:選定的觸發可以透過執行TriggerSoftware指令透過 pylon API 來觸發。
Trigger Activation Modes#
您可以使用以下設定來設定 Trigger Activation 模式: TriggerActivation 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。
此設定僅適用於硬體觸發。它定義了哪個訊號轉態會啟動選定的觸發。例如,您可以指定當觸發訊號下降時,觸發會變為作用中。
以下是可用的 Trigger Activation 模式:
LevelHigh:觸發處於作用中 只要 觸發訊號為 高.LevelLow:觸發處於作用中 只要 觸發訊號為 低.
範例程式碼#
// Enable triggered image acquisition for the Frame Start trigger
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the trigger source to Line 1
camera.TriggerSource.SetValue(TriggerSource_Line1);
// Set the trigger activation mode to level high
camera.TriggerActivation.SetValue(TriggerActivation_LevelHigh);
INodeMap& nodemap = camera.GetNodeMap();
// Enable triggered image acquisition for the Frame Start trigger
CEnumParameter(nodemap, "TriggerMode").SetValue("On");
// Set the trigger source to Line 1
CEnumParameter(nodemap, "TriggerSource").SetValue("Line1");
// Set the trigger activation mode to level high
CEnumParameter(nodemap, "TriggerActivation").SetValue("LevelHigh");
// Enable triggered image acquisition for the Frame Start trigger
camera.Parameters[PLCamera.TriggerMode].SetValue(PLCamera.TriggerMode.On);
// Set the trigger source to Line 1
camera.Parameters[PLCamera.TriggerSource].SetValue(PLCamera.TriggerSource.Line1);
// Set the trigger activation mode to level high
camera.Parameters[PLCamera.TriggerActivation].SetValue(PLCamera.TriggerActivation.LevelHigh);
/* 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 triggered image acquisition for the Frame Start trigger */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerMode", "On");
CHECK(errRes);
/* Set the trigger source to Line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerSource", "Line1");
CHECK(errRes);
/* Set the trigger activation mode to level high */
errRes = PylonDeviceFeatureFromString(hdev, "TriggerActivation", "LevelHigh");
CHECK(errRes);
您也可以使用 pylon Viewer 輕鬆設定參數。