| 간략한 설명 | |
|---|---|
|
파일: \examples\Processing\Trigger\mE4VD4-CL\Line\TrgPortLineRebuild_mE4VD4CL.va |
![]() |
|
기본 플랫폼: mE4VD4-CL |
|
|
요약 설명 VisualApplets 연산자 TrgPortLine 는 VisualApplets 연산자 라이브러리의 다른 신호 처리 연산자들과 함께 재구축되었습니다. 이 재구축을 통해 사용자 정의 트리거 기능을 사용할 수 있으며, VisualApplets 에서 다양한 신호 처리 연산자의 사용법을 확인할 수 있습니다. |
|
연산자 TrgPortLine 는 다양한 라인 스캔 트리거 기능을 제공하는 복합 VisualApplets 연산자입니다. 일부 애플리케이션에서는 맞춤형 신호 처리를 위해 이 연산자의 기능을 수정해야 할 필요가 있습니다.
이 예제에서는 TrgPortLine 연산자를 다른 VisualApplets 신호 처리 연산자들과 함께 재구현한 예를 제시합니다. 이를 통해 사용자 정의 요구 사항에 맞게 기능을 조정하고 수정할 수 있습니다. 이 구현은 고급 수준이지만 이해하기 쉽습니다. 구현의 복잡한 매개변수 설정을 단순화하기 위해, 다음 변환표를 활용하면 기존 연산자의 매개변수 이름을 바탕으로 새로운 설계의 매개변수를 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 채널이 없으므로, 데이터 수집이 아직 시작되지 않았더라도 애플릿이 프레임 그래버에 로드된 직후 즉시 시작됩니다. 이 방식의 장점은 데이터 수집이 시작되기 전에도 카메라를 트리거할 수 있다는 점입니다. DMA 채널이 없는 프로세스에 대한 자세한 내용은 ‘DMA가 없는 프로세스 / 트리거 프로세스’를 참조하십시오.
다음 두 절에서는 이미지 트리거와 라인 트리거의 구현 방법을 간략히 설명합니다.
이미지 트리거 부분은 이미지를 조합하는, 즉 1차원 입력 라인 스트림으로부터 2차원 이미지를 형성하는 역할을 담당합니다. TrgPortLine 연산자에 따라 이미지 높이는 다음 중 하나로 정의될 수 있습니다. 고정된 높이로 모든 입력 라인을 사용하는 경우(자유 실행), 고정된 높이이지만 외부 컨트롤러에 의해 이미지 시작이 제어되는 경우(외부 또는 소프트웨어 트리거) 또는 외부 또는 소프트웨어 트리거 신호의 펄스 길이에 따라 높이가 정의되는 경우(게이트 모드).
이미지 트리거 구현의 핵심 부분은 SignalGate 연산자입니다. 이미지의 높이는 게이트가 열려 있는 시간에 의해 정의됩니다. ImageHeight 모듈( SignalWidth 연산자)은 프리 런 또는 에지 제어 트리거 모드에서 높이를 정의합니다. 이러한 경우, 연산자 값은 새로운 입력 라인이 들어올 때마다 증가합니다. 이는 Tick 입력을 사용하여 카운팅 속도를 제어하는 좋은 예시입니다. 자유 실행 모드에서는 이전 이미지가 완료된 직후, 즉 SignalWidth 연산자가 해당 주기의 출력을 완료한 직후에 새로운 이미지가 시작됩니다. 외부 또는 소프트웨어 트리거 모드에서는 SignalWidth 입력의 상승 에지가 발생하면 새로운 이미지가 시작됩니다. 충분히 긴 펄스를 보장하기 위해서는 RS-FF가 필요합니다.
SelectGatedImageTrigger를 사용하면 구현 방식을 게이트 모드로 전환할 수 있으며, 이 모드에서는 펄스 길이가 이미지 높이를 제어합니다.
계층적 박스 NOP_DelayChain에는 몇 개의 NOP 연산자가 포함되어 있습니다. 이 연산자들은 입력 신호를 몇 클럭 사이클 동안 지연시키는 데 필요합니다. 게이트를 열어야 할지 닫아야 할지를 계산하는 데 몇 클럭 사이클이 소요되기 때문입니다. 이 경우VisualApplets 는 자동 파이프라인 조정을 수행할 수 없습니다. 따라서 지연이 필요합니다.
구현의 다른 부분은 입력 및 출력 신호 생성을 포함합니다. 이러한 부분의 구현은 간단하고 직관적입니다. 플래시 출력 신호는 h-box의 FlashOutput에 있는 TxSignalLine 연산자를 사용하여 Process1로 전송됩니다. 이는 플래시 신호를 CC 신호로도 출력해야 하기 때문에 필요합니다.
LineTrigger 계층적 상자는 주로 입력 및 출력 신호 생성 기능과 샤프트 인코더 분석 및 주파수 발생기로 구성됩니다. 샤프트 인코더 신호 분석 연산자로는 ShaftEncoder 및 ShaftEncoderCompensate가 사용됩니다. Select 스위치인 LineTriggerMode를 통해 보정 또는 트랜스 분석을 활성화하거나 비활성화할지를 개별적으로 선택할 수 있습니다. 또한, Generate 연산자로 표현되는 내부 주파수 발생기가 구현되어 카메라를 트리거합니다.


![[참고]](../common/images/admon/note.png)


이전

