Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling long timeouts

I'm using a PCIe-1429 with a custom camera.  The camera can generate frames at arbitrary times.  To capture images, I set a long timeout value, and then start a ring buffer with imgRingSetup (C program, Windows XP).  If I want to stop the capture, I do:

 

 

 

imgSessionAbort(*Sid, NULL);
imgClose(*Sid, TRUE);
imgClose(*Iid, TRUE);

If no frames are arriving, this code hangs until a timeout has occurred.  Ideally, I'd like an infinite timeout, and closing the session to happen immediately.  The imgSessionAbort documentation claims that the acquisition will be stopped immediately, but this appears to be false.  Are there any known solutions to this problem?

 

Thanks!

 

-Greg

 

0 Kudos
Message 1 of 10
(5,121 Views)
Do you know which call is blocking? That does not seem like expected behavior...

Eric
0 Kudos
Message 2 of 10
(5,115 Views)
Have you tried calling imgSessionStopAcquisition?

Eric
0 Kudos
Message 3 of 10
(5,112 Views)

The imgClose(*Iid, TRUE); is the call that blocks.  I have tried using imgSessionStopAcquisition - then it is the call that blocks.

 

I agree that it's strange behavior - perhaps off the shelf cameras are always sending frames, but some cameras (astronomy, for instance) might only emit one frame an hour.  I hope a good solution exists for this scenario.  Alternatively, if nobody else sees this behavior, then I need to figure out what I'm doing differently/wrong.  I have seen this same behavior across several different NI capture cards, OS's, and cameras.

0 Kudos
Message 4 of 10
(5,109 Views)
I will try reproducing that issue. If you go to MAX and start a Snap, then click it again to cancel, does it show the same problem?
0 Kudos
Message 5 of 10
(5,107 Views)

I'll try Snap the next time I'm in the lab.  I did try Grab and clicking again, and it also hung and waited for a timeout.  If I set the timeout to something really long, I have to reboot the computer to start a new capture.

0 Kudos
Message 6 of 10
(5,100 Views)

An update: after some experimentation, I've found that this problem only occurs in line scan mode.  In area scan mode, the capture can be stopped and started at will, without waiting for a timeout to elapse.

0 Kudos
Message 7 of 10
(5,048 Views)

Thanks, I'll pass this along to the Product Support Engineer that was going to replicate this setup.


Eric

0 Kudos
Message 8 of 10
(5,046 Views)

Dear Greg,

 

I experienced the same issue trying to call imgSessionAbort during a long acquisition. Did you manage to solve this problem somehow?

 

Thanks!

Laszlo

 

0 Kudos
Message 9 of 10
(2,389 Views)

No, I've moved to using ethernet instead of CameraLink.  I'm not sure if this bug was ever fixed.

 

-Greg

0 Kudos
Message 10 of 10
(2,382 Views)