Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Time-critical synchronization using TTL trigger

Solved!
Go to solution

Dear all,

 

I am working with an NI DAQ board (PCIe 6363), and am using a waveform as analog output to control a scanning unit.

 

Now, I want this analog output to be synchronized with the rising edge of an external TTL signal (the *fire* output of a camera).

 

To do this, I used the [Cont Gen Voltage Wfm-Int Clk-Analog Start]-template with minor modifications (see attachment with some comments included). Actually, this works, but only if the output waveform is long finished when the next TTL rising edge arrives. What I want, is a rising edge trigger which arrives, say, with 100 Hz, and an almost 10 ms-long waveform which starts with this trigger. Until now, I get it working with a ca. 8 ms-long waveform. It seems to me that the loop in Labview software (see attachment) takes the rest of the time. If I increase the waveform length to 9 ms or more, the loop is too slow and kind of misses the next rising edge trigger.

 

Unfortunately, I cannot use [continuous sampling] as there is too much jitter in the external trigger.

 

Is there a way to optimize this problem? For example, is it possible to tell the DAQ board 'put out this waveform every time you receive the trigger' instead of 'put out this waveform when you receive the trigger, then be silent' ? Or is it possible to run two while loops in parallel which alternately wait for the trigger signal and both use the same output channel ? Is there another, better, simpler solution?

 

Thank you for any pointers,

 

Peter

0 Kudos
Message 1 of 11
(6,353 Views)

Ok, I found a similar problem now:

 

http://forums.ni.com/t5/LabVIEW/Restarting-a-DAQ-Task-Inside-a-For-Loop/td-p/1948479

 

But the solution there is basically the same as mine. Is it possible that this is already the fastest solution, set aside FPGA etc?

 

Any help would be appreciated!

 

Peter

0 Kudos
Message 2 of 11
(6,303 Views)

Question: Why not sync the camera to the sine?

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 11
(6,294 Views)

I found a possible solution for the problem. If I use the Control Task VI to commit the task before starting, this will possibly make the re-start much faster. I hadn't though of it before because the task state diagram shows these issues incorrectly, as discussed in this thread:

 

http://forums.ni.com/t5/Multifunction-DAQ/How-to-query-DAQmx-task-state-in-LabVIEW/td-p/1515460

 

I'll check this out when I'm back on a PC with Labview.

0 Kudos
Message 4 of 11
(6,293 Views)

Dear Henrik,

 

how would you do this synchronization? Can you give me a link to a thread or method which gives an example, so that I can check this out?

 

(For controling the camera, I'm using Andor Solis.)

 

Best,

Peter

0 Kudos
Message 5 of 11
(6,291 Views)

@PierreLunaere wrote:

I found a possible solution for the problem. If I use the Control Task VI to commit the task before starting, this will possibly make the re-start much faster. I hadn't though of it before because the task state diagram shows these issues incorrectly, as discussed in this thread:

 

http://forums.ni.com/t5/Multifunction-DAQ/How-to-query-DAQmx-task-state-in-LabVIEW/td-p/1515460

 

I'll check this out when I'm back on a PC with Labview.


Ok, this does not inhance the speed significantly. So I am still looking for a solution. I will see whether I can get the synchronization done, but I'm open to any other propositions.

 

Peter

 

0 Kudos
Message 6 of 11
(6,284 Views)
Solution
Accepted by topic author PierreLunaere

You should use the start.retriggerable property, something like this:

 

AO_Retriggerable.png

 

 

Best Regards,

John Passiak
Message 7 of 11
(6,260 Views)

Hi John,

 

thanks a lot! I'll test it tomorrow.

 

Peter

0 Kudos
Message 8 of 11
(6,244 Views)

@PierreLunaere wrote:

Dear Henrik,

 

how would you do this synchronization? Can you give me a link to a thread or method which gives an example, so that I can check this out?

 

(For controling the camera, I'm using Andor Solis.)

 

Best,

Peter


Well, these scientific cameras usually support external triggering ... and you can output a triggerpulse in sync with your AO

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 11
(6,225 Views)

 


Henrik_Volkers wrote:

Well, these scientific cameras usually support external triggering ... and you can output a triggerpulse in sync with your AO


Basically, yes. But the external triggering normally leads to a delay of some 100µs with a jitter of some 100µs, too. Otherwise, this would be the first choice option, I agree.

0 Kudos
Message 10 of 11
(6,207 Views)