Why am I facing a timeout error using getsnapshot - often, not always?
    9 views (last 30 days)
  
       Show older comments
    
Hello,
I really hope, someone can help me with this as meanwhile I'm quite desperate.
I'm using a gig-e camera from Allied Vision (Manta G-145B) with Matlab R2104a, R2019b and R2021a and the Image Acquisition toolbox.
After having initialised the camera, I'm facing a timeout error quite often while attempting to acquire images by getsnapshot. I've played with triggering ('manually' and 'start()', 'trigger()' and 'stop()') but that didn't change anything.
Error using imaqdevice/getsnapshot (line 65)
A timeout occurred during GETSNAPSHOT.
It seems to me, that R2014a doesn't run into this timeout as often as the later revisions.
Has anybody any idea? For any help I would be grateful.
Cheers,
Ralf
Here's my code:
% Init
imaqreset;
hwinfo = imaqhwinfo;
cam = 'gige';
fmt = 'Mono8';
packetsize = 8000;
framerate = 5;
info = imaqhwinfo(cam);    
display(info);
dev_info = imaqhwinfo(cam,1);
display(dev_info);
vid = videoinput(cam, 1, fmt);
triggerinfo(vid)
triggerconfig(vid, 'manual');
vid.FramesPerTrigger = 1;
src = getselectedsource(vid);
src.PacketSize = packetsize;
src.AcquisitionFrameRateAbs = framerate;
src.ExposureTimeAbs = 15000; % ms
% Get the image - hopefully
start(vid);
trigger(vid);
img = getsnapshot(vid);
imagesc(img);
stop(vid);
% Clean up
flushdata(vid);
delete(vid);
clear vid;
objects = imaqfind; % find video input objects in memory
if ~isempty(objects)
    delete(objects) % delete a video input object from memory
end
imaqreset;
0 Comments
Answers (0)
See Also
Categories
				Find more on GigE Vision Hardware in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!