LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor update sync to AO

For a psycho-physical experiment I need to present an image to the subject and, at a fixed (potentially zero) delay, apply eg. electrical stimulation, controlled by analog output via an A/D-board.
The precision of the delay between the two stimuli should be in the ms range.

With a 60Hz monitor update rate, and no synchronization, we would suffer (at least) 16.67ms jitter in timing from trial to trial.

Can anyone point out a way in LabVIEW to programatically synchronize analog output to the update of the monitor (vertical sync)?
Thanx in advance!

0 Kudos
Message 1 of 4
(1,383 Views)

If you have the vsync signal, many NI analog output devices support triggering, so you should be able to trigger your output using the vsync as the trigger input to the device.  If you monitor does not have a vsync output (most consumer level monitors do not), you can probably modify a VGA or DVI connector to the monitor to look at the vsync signal.  You may need to buffer it so that your monitor still works.  Using such a hardware trigger should get your jitter down in the microsecond range or better, depending upon what hardware you choose.

This account is no longer active. Contact ShadesOfGray for current posts and information.
0 Kudos
Message 2 of 4
(1,354 Views)

Thank you for your suggestion.

 

I need to synch the presentation of an image on the screen to an analog output. I still lack a way to ensure the image is presented on the same vsync as is triggering the D/A (or at least a fixed no of vsync time-difference). Otherwise there will still be jitter of one frame-interval (16.7ms @ 60Hz frame rate).

 

Some software for psycho-physical experiments offers a function like WaitForVsync (but the sw does not support use of D/A). Do you know of any way to implement a WaitForVsync function in LabVIEW?

0 Kudos
Message 3 of 4
(1,327 Views)

WaitForVsync is another name for Wait For Trigger (VSynch).  If you are using a VSynch pulse for a trigger, almost any NI analog input device, and many analog output devices, will trigger on it.  But, like anything else, they will trigger on the first frame after the trigger is armed.

 

You will need some way to determine which frame is the frame of interest, since VSync occurs on every frame.  This will need to be implemented in hardware, since anything which goes through software on a modern, multi-tasking operating system is subject to random jitter in the 15ms to 50ms range, and sometimes seconds.  If you want to implement this in software, consider an NI-FPGA or cRIO solution, which do not go through a desktop operating system.  This will give you the flexibility and customization of software with hardware level timing control.

 

My apologies for not giving a better answer.  Please let us know what hardware you are using and we can help more.  If you are still selecting hardware, there are lots of options.

This account is no longer active. Contact ShadesOfGray for current posts and information.
0 Kudos
Message 4 of 4
(1,311 Views)