LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout effects in two LL Ring IMAQ codes

Hello,

I am learning two IMAQ examples:

LL RIng.VI


LL Ring without timeout.VI


I am wondering:

(1) Why in the second VI the inclusion of Last Valid Frame Property Node causes ' the timeout take effects only when IMAQ Extract Vi is called'?

(2) In the second code how timeout effect works when IMAQ Extract is called?  Does it mean that only when the IMAQ Exact (and corresponding image processing) takes too long (exceeding 2000ms)  a timeout error will be generated?

Thanks for advise.

-Dejun

Message Edited by Dejun on 09-09-2007 11:27 AM

Download All
0 Kudos
Message 1 of 7
(3,636 Views)
Anyone knows the answer? Thanks.
0 Kudos
Message 2 of 7
(3,607 Views)
Hi Dejun,

In the second example, the Last Valid Frame Property Node is -1 until an image is acquired and increases by one for each new acquired image. When the trigger fires and the Last Valid Buffer changes, IMAQ Extract returns the image.  The case structure keeps the code from executing the IMAQ Extract VI until an image has actually been acquired.  The Extract VI is where the code will halt and wait for a timeout, so if the IMAQ Extract is only called after an image has been acquired, then there can never be a timeout.

The second VI will never timeout.  If an image is not acquired, then the "false" case will keep executing indefinitely.

I hope this helps.

Regards,
Brandon M.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 7
(3,588 Views)
Thanks Brandon for your nice reply.

I understand the function of the case structure in the second loop, but the reason that I ask this question is:
The specification of frame timeout for IMAQ Contigure Trigger2 is before the second loop, so I think judging of timeout is independent of 'later' case structure, since the case structure only decide whether to execute IMAQ extract buffer VI, instead of whether acquire image.......
0 Kudos
Message 4 of 7
(3,572 Views)
Dejun,

I think the missing piece of information here is that the timeout timer begins counting as soon as you request an image with either Copy or Extract.  This can be a little confusing, since you specify the timeout in the Configure Trigger VI, but the timeout will only happen when Copy or Extract waits for that specificed period of time. In this case, Extract is only called when  there is already a new image in the buffer, so the VI will never timeout.
Regards,
Brandon M.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(3,553 Views)
So, for the second VI (LL Ring without timeout.VI), the input of 'frame timeout=2000ms' to the configure trigger2 VI is redundent, right?
Thanks a lot.

Message Edited by Dejun on 09-13-2007 03:04 PM

0 Kudos
Message 6 of 7
(3,550 Views)

Hello Dejun,

The Frame timeout (ms) input on the IMAQ Configure Trigger2.vi is not a redundant input.  This timeout input specifies the amount of time (in milliseconds) that NI-IMAQ waits for the trigger to occur and the image to be captured.  An error will occur if the image is not acquired in the timeout period, but this timeout period only begins when IMAQ Extract is called.  The LL Triggered Ring without Timeout.vi avoids incurring a timeout error by refraining from calling IMAQ Extract until a new buffer has been acquired.

For more information on this and other shipping examples, please make sure to read the text in the Information window located in the upper right-hand corner of the NI Example Finder.  When you single-click on an example in the NI Example Finder, this window populates with important information about the example, including a description that often walks you through the mechanics of how the example operates.  If this information is insufficient for your needs, remember that you also have a valuable resource in LabVIEW's built-in Help files.  By pressing Ctrl+H on your keyboard, you can bring up a Context Help window that will display relevant information on VIs and other block diagram objects that you mouse over.  From the Context Help window, you can find a Detailed Help link for the most thorough information available.

Good luck with your application!

Best Regards,
Travis McCarty

0 Kudos
Message 7 of 7
(3,512 Views)