Canon EDSDK Command TakePicture blocks everything after focus error

3.6k views Asked by At

I'm using the Canon SDK 2.1 and i am trying to take a picture at the camera from C# code. I started a session (EdsOpenSession) and everything works fine with this line of code:

EDSDK.EdsSendCommand(cameraDev, EDSDK.CameraCommand_TakePicture, 0);

the camera takes a picture and stores it on memory card.

The problem is here: if there is an AF error (e.g. the lens cap is on), the camera gets 'BUSY' and never gets back.

Also if i try to shut down the EDSDK with the functions EdsCloseSession or EdsTerminateSDK, they blocks. The only thing to get it up again is to restart the application and the camera. I'm using an EOS 100D.

What can i do to get ignore these AF error and try to take another picture?

2

There are 2 answers

2
Łukasz Dziedziul On

I have the same problem with Canon EOS 1100D, but I've found http://digicamcontrol.com which is open source. They've managed to make autofocus working, but I haven't found what exactly they did. Maybe you can find it. I if you do, please share the solution.

0
Tim On

I have also just had this issue.

I have solved it by Sending a half button press to focus followed by a full button press to take the photo if that succeeds.

try
{
    EDSDK.EdsSendCommand(cameraDev, EDSDK.CameraCommand_PressShutterButton, 1); // Half
    EDSDK.EdsSendCommand(cameraDev, EDSDK.CameraCommand_PressShutterButton, 3); // Completely
}
finally
{
    EDSDK.EdsSendCommand(cameraDev, EDSDK.CameraCommand_PressShutterButton, 0); // Off
}