Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger on image arrival

Hi,
I'm a newbie, and this is my first post, so be kind, and please feel free to explain the obvious - cause it probably wont be to me.

I want to acquire a series of images (assynchronous) from a 1394 camera that is hardware triggered.
I'll be using LabView (8.0) to acquire and analyse the images, and I want my vi to respond to each image arrival ASAP - like some sort of event trigger based on the images arrival.  Is this possible?  It looks to me like the trigger fcn needs an hardware input to the acquisition card - and I don't think my card has that capability (NI PCI 8252). 
TIA

0 Kudos
Message 1 of 8
(3,615 Views)
Rik_nz,
 
Well... you have 3 options.  Option 1 achieves what you want via polling and options 2 and 3 achieve what you want via waiting.  If you want to do some processing while waiting or polling then you might want to consider running the firewire VIs in a parrallel loop.
 
Options...
1.  Use the NI-IMAQ IEEE 1394 property node to monitor the "Last Buffer Number" property to check if "Last Buffer Number" has incremented.  If you run this in a quick while loop you can successfully poll to see when a new image has been acquired.  Once "Last Buffer Number" has been incremented, grab the image in that buffer.
 
2.  Use "IMAQ1394 Grab Acquire.vi" to acquire your images.  Make sure the "Immediate" input is false so that the VI waits until the next image is aquired.  This will cause your VI to wait until an image is available and return the image as soon as possible.
 
3.  Use low level grab VIs and use "IMAQ1394 Occurence Config.vi".  You can create an occurance that fires when a new image is acquired and then use LabVIEW's "Wait on Occurence" function to wait for the an image to be available.  NOTE:  Only use occurrences with the low level grab functions, the high level grab functions already use occurences.
 
All of these settings will have no effect whatsoever on when your images are aquired by the camera, they only effect how soon the image will be available for manipulation on your CPU after the image has been taken.
 
I hope this helps,
Lorne Hengst
Application Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,588 Views)
Thanks Lorne,
Really helpfull advice.  Waiting on an occurance, ie image arrival, seems like it would give me the quickest response, but I'll also be doing some analysis ... so polling the image arrival count might be the way to go ... or maybe both!
Good to have options.

Cheers
Richard
0 Kudos
Message 3 of 8
(3,575 Views)
Lorne,
About option 3, using low level IMAQ acquisition after an occurence ... there is a good example (LL Occurence Snap.vi) - but I'll using a 1394 camera, and there doesn't seem to be equivalent acquisition vi.  Instead of the "IMAQ Get Buffer", wont I have to use "IMAQ1394 Get Image" with a "IMAQ1394 Configure Acquisition"?... will those work with an occurance like the example?

Getting confused here.
0 Kudos
Message 4 of 8
(3,553 Views)
Hi Richard,

It looks like it would probably be easier to just use the IMAQ 1394 shipping example called "Low-Level Snap.vi" and alter a copy of it.  Place the IMAQ1394 Occurrence Config VI right after IMAQ 1394 Init VI and select the appropriate settings for your application.   Then you can use the occurrence output much like in the shipping example "
LL Occurence Snap.vi" that you were looking at before.  Let me know if you would like me to clarify!

Cheers,
Irene Chow
National Instruments
Applications Engineer
0 Kudos
Message 5 of 8
(3,534 Views)
Thanks Irene,
I had looked at that example, and was thinking of putting the occurence vi after the grab config, rather than before (after the init) as you suggest - would it operate differently that way?
If I want to put the IMAQI394 Get Image in a loop, referring to the Low-Level Snap example (but with the occurance additions from LL Occurence Snap), would the loop sit between the Start and Stop Acquisition?
Thanks
Rik
0 Kudos
Message 6 of 8
(3,524 Views)
Hi Rik,

Let me see if there is a workaround since IMAQ1394 Occurence Config.vi does not work the same way as the NI-IMAQ example
LL Occurence Grab.vi.  I'll let you know as soon as I find out.

Thanks,
Irene Chow
National Instruments
Applications Engineer
0 Kudos
Message 7 of 8
(3,501 Views)

Hi Rik,

 


If you just want to do an occurrence with a Grab, just leave the IMAQ1394 Occurence Config.vi right after IMAQ1394 Init.vi.  The only thing you have to change between occurrences with Snap and Grab is the Continuous? input terminal for the IMAQ1394 Configure Acquisition.vi.

Let me know if you need clarification,
Irene Chow
National Instruments
Applications Engineer

0 Kudos
Message 8 of 8
(3,484 Views)