We are receiving the error "Capability value can be set only when device is open." randomly when scanning during the day. This error is thrown not when we are manually setting the capabilities but during the image transfer process based on the log file.

Thank you for information. Log-file shows that your application tries to set unit of measure when device is transferring image - this is prohibited.

SDK does not have code that sets unit of measure. Your code looks correct, the SetDeviceCapabilities method is correct. BUT "something" sets unit of measure in a wrong state. Please inspect your code and try to find where you are setting the unit of measure.

We found that the problem should be cause by calling the Scan method again before the previous call is finished. However, we are using the synchronous way to acquires the images and the scan method can be call again before the previous call has finished. Explain me more in details each device states. It is safe to check if the device is closed before the scanning process?

You have the problem because you are breaking the modal image acquisition loop when you are throwing an exception if scan is failed or device event occured. Please update your code and call the Device.AcquireModal method until it does not return the AcquireModalState.None value.