| 簡短描述 | |
|---|---|
|
檔案: \examples\Processing\Trigger\mE4VD4-CL\Line\TrgPortLineRebuild_mE4VD4CL.va |
![]() |
|
預設平台: mE4VD4-CL |
|
|
簡短說明 VisualApplets 運算子 TrgPortLine 是使用來自 VisualApplets 運算子庫的其他訊號處理運算子進行重建。 此重建允許您自訂觸發功能,並展示了 VisualApplets 中許多訊號處理運算子的使用方式。 |
|
運算子 TrgPortLine 是一個複雜的 VisualApplets 運算子,提供廣泛的行掃描觸發功能。在某些應用中,需要修改此運算子的功能以進行自訂訊號處理。
在此範例中,我們展示了使用其他 VisualApplets 訊號處理運算子重建 TrgPortLine 運算子的過程。這使您能夠調整並修改功能以符合您的自訂需求。 實作過程先進但易於理解。為了簡化複雜的實作參數化,以下對照表可協助您根據 TrgPortLine 參數名稱來計算新設計的參數。
| 名稱 | YOffset |
|---|---|
| Default | 0 |
Device1_Process0_ImageTrigger_ImageHeight_Width = YHeight - YOffset Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = YHeight + YOffset |
|
| 名稱 | YHeight |
|---|---|
| Default | 1024 |
Device1_Process0_ImageTrigger_ImageHeight_Width = YHeight - YOffset Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = YHeight + YOffset |
|
| 名稱 | LineTriggerMode |
|---|---|
| Default | GrabberControlled |
Device1_Process1_LineTrigger_LineTriggerMode_Select = 3 if GrabberController 0,1 or 2 if Extern_Trigger For Extern_Trigger, the correct value is defined by the shaft encoder settings. The other modes available by TrgPortLine are not supported. |
|
| 名稱 | ExsyncEnable |
|---|---|
| Default | OFF |
Device1_Process1_LineTrigger_Exsync_ExsyncEnable_Select = 1 if ON 0 if OFF |
|
| 名稱 | LineTrgInSourceA |
|---|---|
| Default | 0 |
Device1_Process1_LineTrigger_TraceA_Input_Select = LineTrgInSourceA |
|
| 名稱 | LineTrgInSourceB |
|---|---|
| Default | 1 |
Device1_Process1_LineTrigger_TraceB_Input_Select = LineTrgInSourceB |
|
| 名稱 | EncoderABMode |
|---|---|
| Default | Signal_A_Only |
Device1_Process1_LineTrigger_LineTriggerMode_Select = 3 if LineTriggermode == GrabberControlled 0 if EncoderABMode == Signal_A_Only 1 else Device1_Process1_LineTrigger_ShaftEncoder_Mode = Mode1X if EncoderABMode == Signal_AB_Filter Mode2X if EncoderABMode == Signal_ABx2_Filter Mode4X if EncoderABMode == Signal_ABx4_Filter |
|
| 名稱 | EncoderABLead |
|---|---|
| Default | Signal_AB |
Device1_Process1_LineTrigger_ShaftEncoder_LeadingTrace = A if EncoderABLead == Signal_AB B else |
|
| 名稱 | LineTrgInPolarity |
|---|---|
| Default | LowActive |
Device1_Process1_LineTrigger_TraceA_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else |
|
| 名稱 | LineTrgInPolarity |
|---|---|
| Default | LowActive |
Device1_Process1_LineTrigger_TraceA_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else Device1_Process1_LineTrigger_TraceB_Polarity_Invert = Invert if LineTrgInPolarity = LowActive NotInvert else |
|
| 名稱 | LineTrgDownscaler |
|---|---|
| Default | 1 |
Device1_Process1_LineTrigger_Downscale_Donwscale = LineTrgDownscaler |
|
| 名稱 | LineTrgPhase |
|---|---|
| Default | 1 |
Device1_Process1_LineTrigger_Downscale_SelectecPulse = LineTrgPhase |
|
| 名稱 | ExsyncPeriod |
|---|---|
| Default | 100µs |
Device1_Process1_LineTrigger_Generate_Period = ExsyncPeriod / TClk |
|
| 名稱 | Exsync2Delay | |||
|---|---|---|---|---|
| Default | 0µs | |||
Device1_Process1_LineTrigger_Exsync_Exsync2_Delay = Exsync2Delay / TClk
|
||||
| 名稱 | ExsyncPolarity |
|---|---|
| Default | LowActive |
Device1_Process1_LineTrigger_Exsync_OutputPolarity_Polarity = Invert if ExsyncPolarity = LiwActive NotInvert else |
|
| 名稱 | ImgTriggerMode |
|---|---|
| Default | FreeRun |
Device1_Process0_ImageTrigger_SelectGatedImageTrigger_Select = 1 if ImgTriggerMode == FreeRun 0 else Device1_Process0_ImageTrigger_SelectFreeRun_Select = 1 if ImgTriggerMode == FreeRun 0 else |
|
| 名稱 | ImgTriggerInSource |
|---|---|
| Default | InSignal0 |
Device1_Process0_ImageTrigger_EnableSoftwareTrigger = 1 if ImgTriggerInSource == SoftwareTrigger 0 else Device1_Process0_ImageTrigger_ImageTriggerInput_Input_Select = 0 if ImgTriggerInSource == InSignal0 1 if ImgTriggerInSource == InSignal1 2 if ImgTriggerInSource == InSignal2 3 if ImgTriggerInSource == InSignal3 4 if ImgTriggerInSource == InSignal4 5 if ImgTriggerInSource == InSignal5 6 if ImgTriggerInSource == InSignal6 7 if ImgTriggerInSource == InSignal7 |
|
| 名稱 | ImgTrgInPolarity |
|---|---|
| Default | LowActive |
Device1_Process0_ImageTrigger_ImageTriggerInput_Polarity_Polarity = Invert if ImgTrgInPolarity == LowActive NotInvert else |
|
| 名稱 | ImgTrgDelay | |||
|---|---|---|---|---|
| Default | 0 行 | |||
Device1_Process0_ImageTrigger_ImageTriggerDelay_Delay_Delay = ImgTrgDelay
|
||||
| 名稱 | FlashEnable |
|---|---|
| Default | OFF |
Device1_Process0_ImageTrigger_FlashOutput_Enable_Select = 1 if FlashEnable == ON 0 else |
|
| 名稱 | FlashPolarity |
|---|---|
| Default | LowActive |
Device1_Process0_ImageTrigger_FlashOutput_Polarity_Polarity = Invert if FlashPolarity == LowActive NotInvert else |
|
| 名稱 | FlashDelay | |||
|---|---|---|---|---|
| Default | 0 行 | |||
Device1_Process0_ImageTrigger_FlashDelay_Delay_Delay = FlashDelay
|
||||
| 名稱 | SoftwareTrgPulse |
|---|---|
Device1_Process0_ImageTrigger_SoftwareTrigger_Mode = Pulse if SoftwareTrgPulse == 1 && ImgTrgMode == ExternSw_Trigger not write access else |
|
| 名稱 | SoftwareTrgInput |
|---|---|
Device1_Process0_ImageTrigger_SoftwareTrigger_Mode = High if SoftwareTrgInput == 1 && ImgTrgMode == ExternSw_Gate Low else |
|
| 名稱 | ImgTrgIsBusy(唯讀參數) |
|---|---|
ImgTrgIsBusy = Device1_Process0_ImageTrigger_ImgTrgIsBusy_Status |
|
| 名稱 | CC1output |
|---|---|
| Default | Exsync |
Device1_Process1_LineTrigger_Exsync_CC1_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名稱 | CC2output |
|---|---|
| Default | Exsync |
Device1_Process1_LineTrigger_Exsync_CC2_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名稱 | CC3output |
|---|---|
| Default | Exsync |
Device1_Process1_LineTrigger_Exsync_CC3_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名稱 | CC4output |
|---|---|
| Default | Exsync |
Device1_Process1_LineTrigger_Exsync_CC4_Select_Select = 0 if Exsync 1 if ExsyncInvert 2 if Exsync2 3 if Exsync2Invert 4 if Flash 5 if FlashInvert 6 if Gnd 7 if Vcc |
|
| 名稱 | ImgTrgDebounceMaxTime |
|---|---|
| 在此實作中不需要。 | |
| 名稱 | ImgTrgDebouncingTime |
|---|---|
| Default | 65.520µs |
Device1_Process0_ImageTrigger_ImageTriggerInput_Debounce_Debounce = ImgTrgDebouncingTime / TClk |
|
| 名稱 | LineTrgDebouncingTime |
|---|---|
| Default | 0.112µs |
Device1_Process1_LineTrigger_TraceA_Debounce_Debounce = LineTrgDebouncingTime / TClk Device1_Process1_LineTrigger_TraceB_Debounce_Debounce = LineTrgDebouncingTime / TClk |
|
變數 TClk 取決於所使用的擷取卡。對於 microEnable IV VD4-CL,週期為 16ns。 請參閱附錄:裝置資源以取得完整清單。
實作分為 ImageTrigger 和 LineTrigger 兩個部分。 LineTrigger 實作位於 Process1 中。 由於此程序沒有 DMA 通道,因此在將 applet 載入擷取卡後,即使尚未開始擷取,它也會立即啟動。 這樣的好處是,相機甚至可以在開始擷取之前就被觸發。 如需有關無 DMA 通道程序的詳細資訊,請參閱「無 DMA 的程序 / 觸發程序」。
接下來的兩個章節將概述影像觸發和行觸發的實作。
影像觸發部分負責組合影像,亦即從 1D 輸入行串流形成 2D 影像。 根據運算子 TrgPortLine,影像高度可以透過固定高度並使用所有輸入行(自由執行)、固定高度但由外部控制器啟動影像(外部或軟體觸發),或者由外部或軟體觸發訊號的脈衝長度來定義高度(閘控模式)。
影像觸發實作的主要部分是 SignalGate 運算子。 影像高度由閘門開啟的時間來定義。 模組 ImageHeight(運算子 SignalWidth)定義了自由執行或邊緣控制觸發模式中的高度。 在這些情況下,運算子值隨著每個新的輸入行而增加。 這是一個很好的範例,說明如何使用 Tick 輸入來控制計數速度。 在自由執行模式中,新影像會在前一個影像完成後立即開始,亦即 SignalWidth 運算子完成了其週期的輸出。 在外部或軟體觸發模式中,新影像由 SignalWidth 輸入端的上升緣啟動。 需要 RS-FF 以確保脈衝足夠長。
透過 SelectGatedImageTrigger,實作可以切換到閘控模式,在此模式下,脈衝長度控制影像高度。
階層式方塊 NOP_DelayChain 包含一些 NOP 運算子。 這些運算子是用來將輸入訊號延遲幾個時脈週期。 這是必要的,因為計算閘門是否必須開啟或關閉需要幾個時脈週期。 在此情況下,VisualApplets 無法執行自動管線調整。 因此需要進行延遲。
實作的其他部分包含輸入與輸出信號產生。 這些部分的實作簡單且直接。 閃光燈輸出信號會透過 FlashOutput 階層式方塊中的 TxSignalLine 運算子傳輸至 Process1。 這是必要的,因為閃光燈信號也必須輸出至 CC 信號。


![[注意]](../common/images/admon/note.png)


上一頁

