Register    Login    Forum    Search    FAQ

Board index » Software » Windows




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post Posted: Fri May 26, 2017 7:33 am 
Offline

Joined: Fri May 26, 2017 7:27 am
Posts: 4
Hi

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:

Code:
   ASICameraDll.startExposure();
            ASICameraDll.EXPOSURE_STATUS status = ASICameraDll.EXPOSURE_STATUS.EXP_WORKING;
            while (status == ASICameraDll.EXPOSURE_STATUS.EXP_WORKING)
                status = ASICameraDll.getExpStatus();
            ASICameraDll.stopExposure();                       
            if (status == ASICameraDll.EXPOSURE_STATUS.EXP_SUCCESS) //transfer data
            {
                camera_dataPtr = Marshal.AllocHGlobal(camera_bufferSize);
                ASICameraDll.getImageAfterExp(camera_dataPtr, camera_bufferSize);
                Marshal.Copy(camera_dataPtr, camera_buffer, 0, camera_bufferSize);
                Marshal.FreeHGlobal(camera_dataPtr);
            }


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.


Top 
 Profile  
Reply with quote  
 Post Posted: Mon May 29, 2017 8:33 am 
Offline

Joined: Fri May 26, 2017 7:27 am
Posts: 4
New informations - I changed cable from yours to normal USB and violet stopped significantly, although it appears occasionally. Unfortunately the frame rate was strongly reduced to 2-3 FPS only. However in SharpCap the violet-problem is never present.


Top 
 Profile  
Reply with quote  
 Post Posted: Wed May 31, 2017 1:14 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 198
Please attach an image with that problem, thank you.

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Thu Jun 01, 2017 11:05 am 
Offline

Joined: Fri May 26, 2017 7:27 am
Posts: 4
There is nothing to attach, just violet B/W image. In SharpCam it seems OK, while in my program the exposure time below 50ms results in probable failures of data transfer (probably red and blue channel are the same - just like copied - which results in violet image). Above 50ms this happens very rarely or never, and images look OK, thus I conclude that my program is written correctly. I suppose there might be an issue with timings during data transfer, which results in failures. This is also strange that I never receive status "failed" - it is always success. I would expect that transfer fail should happen from time to time which I cannot see in my program.


Top 
 Profile  
Reply with quote  
 Post Posted: Fri Jun 02, 2017 1:45 am 
Online
User avatar

Joined: Thu Feb 21, 2013 2:51 am
Posts: 2349
AdamPopowicz wrote:
There is nothing to attach, just violet B/W image. In SharpCam it seems OK, while in my program the exposure time below 50ms results in probable failures of data transfer (probably red and blue channel are the same - just like copied - which results in violet image). Above 50ms this happens very rarely or never, and images look OK, thus I conclude that my program is written correctly. I suppose there might be an issue with timings during data transfer, which results in failures. This is also strange that I never receive status "failed" - it is always success. I would expect that transfer fail should happen from time to time which I cannot see in my program.


how about test with our demo2?

_________________
ZWO Founder
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Fri Jun 02, 2017 3:14 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 198
Please try this version, I've fixed a bug occurs when continuous exposure:
https://astronomy-imaging-camera.com/so ... 3.0.19.zip

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 6 posts ] 

Board index » Software » Windows


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: