-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple cameras #19
Comments
I have created a new branch that should support systems with more than 1 camera. This is most of the git diff:
So the constructor and andorCCDConfig functions take an additional parameter, cameraID. This is the index number of the desired camera in the system. You will need to know which camera each index number corresponds to. This change breaks backwards compatibility, but the only alternative is to put the parameter at the end of the argument list, which is not very logical. I think it belongs before shamrockID. @hinxx please test this branch and let me know if it works for you. |
Thank you @MarkRivers ! |
After patching the R2-7 ADAndor with the above changes and adjusting the st.cmd to talk to camera ID 0 and 1 (third argument to the andorCCDConfig), I get the following results:
I'm not really sure if the errors above mean something, since at the end there is and OK message.
I will need to debug a bit more to see what the problem is. |
I can successfully talk to only one camera. The other one, even though the initialize says it is OK, does not respond to any commands. I'm also seeing this failure quite often now - it kills the IOC, but not every IOC start suffers from this fault:
|
Hi Hinko, |
I see @MarkRivers, let me give it a try in the coming days and get back to you. |
I changed st.cmd to add the cameraID argument to andorCCDConfig. You should copy iocAndor to iocAndor2 and in iocAndor2/st.cmd change PREFIX to 13ANDOR2:. You can pull these changes from the multiple_cameras branch on Github. |
Note that the reason you cannot easily control multiple cameras from the same IOC is a limitation of the Andor SDK. The SDK has functions like this:
Note that those functions do not have an argument that controls what camera is being addressed, such as a pointer or handle. This means that each set of calls to the SDK would need to be prefixed by a call to
This is quite inconvenient, and would require lots of changes to the driver. Putting the second camera in its own IOC should avoid this, because hopefully SetCurrentCamera sets a handle that is local to this application, and not global to the entire computer. |
Thanks for the effort @MarkRivers . I'll give it a run ASAP! I'm trying to understand how the Andor SDK enumerates the USB devices, i.e. which is 0 which is 1, and so on. It seems one can go only with trial and error and change the startup script cameraID parameter afterwards, but this would likely to be required after system power cycle and/or camera re-plugging.. Would it be more intuitive to use model:serial, or VID:PID:serial type of 'cameraID' parameter instead? In the constructor of the ADAndor one would search for the cameraID index that the GetCameraHandle() and SetCurrentCamera() need. I can do some work on this if you would find it acceptable. I can also test this with two different Andor cameras in the coming weeks, but let me first try out what you have in the multiple_cameras branch. |
It would definitely be better to be able to specify a serial number or some other identifier instead of an index number, if that is possible. |
I can control two Andor cameras, using two IOCs, with the above branch. |
Created pull request #20 where camera serial number is used instead of the camera index to select the camera. |
As far as I can tell current ADAndor supports single camera only.
How big of an effort would it be to support 2 or more cameras?
If I'm not mistaken, one could not run two IOCs and have each instantiate a single ADAndor driver, as-is. The reason being that there is no way of telling a particular ADAndor instance which camera should it talk to.
The Andor SDK seems to support up to 8 cameras. I'm not sure if the way vendor envisioned the access to multiple cameras would work for us.
The text was updated successfully, but these errors were encountered: