Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I synchronize line camera with galvanometers?

Hello, everyone,

I am Hoon-sup, Kim. I'd like to synchronize galvanometers with line san camera to implement optical coherence tomography system. As you can see the attached snippet of my c language code('each line trigger with galvo.pdf'), I imitated llgrab.c example code and imgSessionLineTrigSource2() function to trigger each line and to grab one image continually.

One image consists of 2048(Width) x 500(Height). I used GL2048L line camera and PCIe-1429 and PCI-6229. The counter0 channel is generating five hundred pulses with 30kHz frequency and then the counter0 output pulses is driving GL2048L as each line trigger mode. Measurement & Automation Explorer(MAX) was set as follows.
Trig mode: 2 variable exposure
CC1: external, Number: 0

For your information, refering to this manual(http://www.ni.com/white-paper/13786/en/), I already checked that HL Trigger each line from Encoder (Express).vi example code is working well.

Even though the acquisition time is correct as 17msec which is calculated from 500 points divided by 30kHz, I have two problems under the text based customized code as you can see the attached 'two issues.pdf' file.


First, Image is continually being shifted to the right with some ratio.
Second, backward part of the galvanometer analog output signal is sometimes being stopped abruptly with no completion.

In order to synchronizing analog output Channel with Counter Channel, I used "ao/StartTrigger" as a Counter output trigger source and I kept the order of DAQmxStartTask functions, which means that COtaskHandle first and AO0taskHandle last.

DAQmxCfgDigEdgeStartTrig(COtaskHandle,"ao/StartTrigger", DAQmx_Val_Rising);
...

DAQmxErrChk (DAQmxStartTask(COtaskHandle));
DAQmxErrChk (DAQmxStartTask(AO0taskHandle));
...

Are there any faults when I used a few of DAQmx API and IMAQ API functions in my code? Do I really need to use RTSI bus to connect framegrabber to DAQ board as 'LL Triggered Ring using RTSI from DAQ.vi' from http://www.ni.com/example/29476/en/ ? Actually I would like to resolve this synchronization issue without introducing RTSI bus. I want to know if it is possible or not.

Sincerely,
Hoon-sup, Kim

Download All
0 Kudos
Message 1 of 1
(5,102 Views)