Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Short pulse triggering with IMAQ 1394 and labview

I am using a USB microcontroller digital I/O to turn on and off a LED.  I am using the same I/O to generate a trigger pulse for a EC650 prosillica camera.  I am currently using the wait.vi in labview to determine the duration of the LED pulse.  It seems to work but sometimes the VI freezes and it waits a few seconds before the VI continues.  I am attaching labview code illustrating my problem.  After the initialization stuff and alignment video on the front panel I am taking 13 images in a for loop using the wait.vi to determine the LED pulse duration, then it just outputs the images to the screen and saves the images.  I believe the problem is that pulse width (wait.vi) is too small (i.e. a few milliseconds).  Does anyone know how accurate and precise a LED pulse I can have using labview this way?  The microcontroller also has an external clock and counter, so could I use them together somehow to generate a pulse width less then 1ms and still be precise and accurate?  Thanks for any help or advice to solve my problem.

 

Kevin Baker

 

 

 

0 Kudos
Message 1 of 4
(3,620 Views)
Kevin,

With software timing, the best case accuracy you can get is limited to 1ms.  With a non-deterministic operating system such as Windows, even this level of timing accuracy cannot be guaranteed.  If the clock of your microcontroller is fast enough, you could send a pulse to the microcontroller to have it start counting and then output your trigger from there.  If it works for your application, you could use the IEEE 1394 shipping example Low-Level Sequence, which has behavior similar to what you are describing, but lacks the microcontroller I/O.

Let me know if this helps to answer your question.

Regards,


S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(3,610 Views)

Thanks Avery.  I found out that the microcontroller has an event counter not a clock.  I was told "To turn on a digital bit of any of our multifunction devices for less than 1ms with LabVIEW, VB, C/C++ etc. is not possible due to the
uncertainties of Windows.  These are polled functions and the best you
can hope to achieve it about 25ms.
", by the manufactur of the microcontroller.  Unfortunately this won't work for my application, since I need to turn on 13 different light sources with the digital I/O and switches.  I don't need to get below 1ms, but I would like get close to it.  I thought a 555 timer would work, but then I couldn't change the pulse width later.  I am thinking looking at an oscilloscope to see what kind of pulse widths I am getting.  The labview code I attached will work even if I specify a 1ms wait between the turn on and off the digital I/O.  I would like the LED pulse width to be about 1ms, and I want to use the pulse trigger  mode on the camera.  Does anyone know of a cheap way to achieve this timing?  Thanks in advance for any help.

Kevin Baker

0 Kudos
Message 3 of 4
(3,582 Views)
It sounds like you are looking for something that is capable of hardware timed Digital Input/Output.  Any NI Multifunction DAQ or Digital cards that have hardware timed or clocked Digital lines will do this.  This link shows the the low-cost multifunction DAQ boards which may be what you are looking for.
 
You can also call (888) 280-7645.  This will get you in touch with an NI sales representative to help find the hardware that fits your task the best.
 
0 Kudos
Message 4 of 4
(3,560 Views)