QHYCCD

GetQHYCCDSingleFrame stalls

GetQHYCCDSingleFrame stalls
« on: March 10, 2021, 03:25:04 PM »
Hello dear QHY team,
I am currently using the QHY600M on my CDK12.5 scope - and I am very happy with the camera.
Due to problems with SharpCap I wrote my own control software (QHYCapture) in VB.NET which does everything I like and love, but I can see a problem that I can currently not overcome:
The function GetQHYCCDSingleFrame sometimes does not return any data - I did wait for several hours but nothing came back. The only think that can overcome the problem is turn off and on the 12 Volt power - which is not a real solution if you want to operate the system remote and unattended.

Attached you can find a log of all DLL calls - as it typically works I do not think I am doing anything really wrong. I use not the latest SDK / DLL from QHY as this generated a lot more problems (is this a known issue)?
(The attached log is a "good" log, but everything is the same for a bad one, it only stalls at the given point).

Perhaps you could go through my calls and tell me if there is anything worng / any other solution for my issue.

Best regards

Martin.

Re: GetQHYCCDSingleFrame stalls
« Reply #1 on: March 11, 2021, 06:48:54 PM »
Hi,
    Sorry,I'm not known about VB,so I just can give you advice from C++,your order of API list seem not right,here is the list:
Code: [Select]
uint32_t ret = InitQHYCCDResource();
int num = ScanQHYCCD();
char id[40] = { 0 };
ret = GetQHYCCDId(i,id);
qhyccd_handle *camhandle = OpenQHYCCD(id);
ret = SetQHYCCDReadMode(camhandle, 0);
ret = SetQHYCCDStreamMode(camhandle, 0);
ret = InitQHYCCD(camhandle);
//next is setup image format
ret = SetQHYCCDDebayerOnOff(camhandle, false);
ret = GetQHYCCDChipInfo(camhandle, &chipw, &chiph, &imagew, &imageh, &pixelw, &pixelh, &bits);
ret = SetQHYCCDBinMode(camhandle, 1 , 1);
ret = SetQHYCCDResolution(camhandle, 0, 0, imagew, imageh);
ret = SetQHYCCDParam(camahndle, CONTROL_TRANSFERBIT, 16);
//next is setup parameters
ret = SetQHYCCDParam(camhandle, CONTROL_EXPOSURE, 10*1000);
ret = SetQHYCCDParam(camhandle, CONTROL_GAIN, 10);
ret = SetQHYCCDParam(camhandle, CONTROL_OFFSET, 10);
ret = SetQHYCCDParam(camhandle, CONTROL_DDR, 1.0);
//next is expose
ret = ExpQHYCCDSingleFrame(camhandle);
ret = GetQHYCCDSingleFrame(camhandle, &imagew, &imageh, &bits, &channels, ImgData);
ret = CancelQHYCCDExposingAndReadout(camhandle);
//next is close camera
ret = CloseQHYCCD(camhandle);
ret = ReleaseQHYCCDResource();

Re: GetQHYCCDSingleFrame stalls
« Reply #2 on: March 12, 2021, 09:45:07 AM »
Dear QinXiaoXu,

thanks for the reply. Calling the DLL from VB or C++ is all-the-same, and I compared your sequence with my sequence but can not find any different order. Could you tell me a little bit more in detail where the difference is?
The crazy thing is that is sometimes work without any problem - the problem typically occures at the start of the recording night when the temperature control is started, but not always.
The DLL simply then does not return from the GetQHYCCDSingleFrame function and hangs there.

If you are interested you can also share the QHYCapture software and my C# wrapper functions, please find a software screenshot attached. I run all my recordings with it and I am very happy. It can also be controlled from other software and displays very verbose statistical information.

Best regards

Martin.

Re: GetQHYCCDSingleFrame stalls
« Reply #3 on: March 14, 2021, 08:28:13 PM »
Hi,
    I known a little C#,maybe I can sent you a C# Demo,what do you think?And did you test it with EZCAP_Qt?If not,you can have a try.And EZCAP_Qt's code also is open,I can send share it to you.
    About difference,I found you call CancelQHYCCDExposingAndReadout function many times,in fact you only need call it after GetQHYCCDSingleFrame.
    And you said this issue occur when cooler start,please open system device manager and check if device list refresh when issue occur.And when issue occur,if temperature will have drastic change,for example,-4000.
Best Regards,
QinXiaoXu