Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger timeout prevention

Solved!
Go to solution

Hi, I'm using the NI 1427 with a Goodrich 640x512 NIR camera.  We are using an external source to trigger the camera and occasionally the time between trigger pulses is longer than the timeout for the camera (i have it set to 2000 ms right now).  I would rather not set a 10 sec timeout period for the camera and was wondering if there was some funciton I could call before calling the imaqGrab function to see if the camera has actually aqcuired an image and was ready to be "grabbed" from.  Thanks!

0 Kudos
Message 1 of 11
(4,959 Views)

Hi Feral,

 

How important is using an external trigger? If you wanted to base your triggering in software it would be fairly simple to use an event structure to only take a picture when a trigger actually occurs. That way you wouldn't need to bother increasing the timeout on the camera itself.

0 Kudos
Message 2 of 11
(4,935 Views)

Thanks for the reply burrito, this is our setup:  The computer system logs the time of an external event (this event is periodic and we only want to acquire a frame when this event occurs), it logs the time of the next event, finds the difference in the two times and calculates when the next event should happen.  We then set up our time card to trigger the camera a few milliseconds before the next event.

 

We have the triggering working fine but if there are no external events we get no new triggers and the Grab timeouts and crashes the entire program.  I was hoping there was an easy function call to check to see if there was a new image or some error handle that would avoid the entire program crashing if there is no new image to acquire.  Thanks!

0 Kudos
Message 3 of 11
(4,933 Views)

I don't believe there's a function for that; however, if you want to use error handling so that you don't have to deal with the error until you actually want to, make sure that you're using manual error handling and passing the error through the VI properly.

 

Here's a link on manual error handling.

0 Kudos
Message 4 of 11
(4,910 Views)
Solution
Accepted by topic author FeralPhys

@FeralPhys:

 

I think you can set the timeout period much higher. Actually, we have several projects where the timeout period is set to infinity.

 

The obvious question is, how do you stop the grab while it's stuck infinitely in the wait and you need to stop the application. You can do this by having a parallel execution loop, which in case of stop condition closes the IMAQ session. After IMAQ session is closed, IMAQ Grab stops with an error (which you can easily handle).

 

We are using this approach usually with IMAQdx, but I think it works with IMAQ the same way.

 

V


View my profile on LinkedIn
Message 5 of 11
(4,897 Views)

Hi Vladimir,

 

How do you set the timeout period to infinity?  Thanks!

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

It's not actually infinity, but it's the highest number you can set. Which is, as far as I can remember, 2^32-1 = 4294967295


View my profile on LinkedIn
Message 7 of 11
(4,695 Views)

Great!  Thank you.  I was having trouble finding an "infinity" entry in the CamGen documentation, I was searching for a "-1" or "inf" entry and was coming up empty handed.  This seems to fix our problem and ~50 days is close enough to infinity for us, Thanks again!

0 Kudos
Message 8 of 11
(4,693 Views)

How do you do this in VBAI ?

0 Kudos
Message 9 of 11
(3,561 Views)

Hi rex678805,

 

You should be able to configure the trigger settings for a framegrabber in the Acquire Image step. You should then see similar options in the Image Trigger tab. Here you should be able to set the tmeout for the acquisition.

 

Regards,

Paolo F.
National Instruments
Applications Engineer
0 Kudos
Message 10 of 11
(3,535 Views)