How can I continuously acquire image with GigE camera?

2 views (last 30 days)
Hello, I am working with Basler Camera to acquire image to Matlab. When I configure the image properties, and start the acquisition, it is done correctly. However, whenever I try the second time, there will be a message: "Could not connect to the image acquisition device. Device may be in use.". Normally, I use "imaqreset" and start everything again, it will be fine. According to my understanding, it should not happen this way and it is really uncomfortable when I have to start from the beginning. Could you explain me and give my some suggestions on how I can solve this problem? Thank you. (this is just one example) vid = videoinput('gige', 1, 'Mono8'); src = getselectedsource(vid); src.PacketSize = 8000; framesToAcquire = 20; framesPerSecond = CalculateFrameRate(vid, framesToAcquire); delay = CalculatePacketDelay(vid, framesPerSecond); src.PacketDelay = delay; start(vid) wait(vid); set(vid, 'FramesPerTrigger', inf) start(vid) Error event occurred at 11:38:20 for video input object: Mono8-gige-1. Could not connect to the image acquisition device. Device may be in use.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!