I have problems with taking exposures shorter than 50ms (USB2.0) or 30ms (USB3.0) via C# application with ASI178 MC. Longer exposures are ok, but in shorter the image is very frequently pink - no colors. There are some moments when image is ok - colors - but mostly it is only pink. It looks like there is some bug in transferred buffers when receiving data from these short exposures. My code for taking exposures is as follows:
ASICameraDll.EXPOSURE_STATUS status = ASICameraDll.EXPOSURE_STATUS.EXP_WORKING;
while (status == ASICameraDll.EXPOSURE_STATUS.EXP_WORKING)
status = ASICameraDll.getExpStatus();
if (status == ASICameraDll.EXPOSURE_STATUS.EXP_SUCCESS) //transfer data
camera_dataPtr = Marshal.AllocHGlobal(camera_bufferSize);
Marshal.Copy(camera_dataPtr, camera_buffer, 0, camera_bufferSize);
The exposure time is set in other function. All works for exposures longer than 50ms or 30ms depending on USB2 or 3 version. I tried different ways to obtain images of shorter exposure, but I did not succeeded.
The status after leaving while loop is never EXP_FAILED ... - is it normal ?
PS. Now I switched to SDK ver. 2.0 and the problem is exactly the same.
The problem is also solved if I change to smaller ROI but again, if I put e.g. 5ms the problem appears again. So this is probably due to data transfer (limits? failures?) from camera to computer.