Bug #2920
closedGatan object not working
0%
Description
We are having an error where pyscope is unable to initialize a Gatan object. I tried a lot of stuff, and I think the problem is with comtypes. We upgraded to trunk leginon and Python 2.7 when we got the DE camera. The DE is working fine, but when we try to use the Gatan GIF we get an error. I've attached a screen capture of the error. I believe we were using comarray before which is why we didn't see the error before the upgrade. I tried installing comarray as a workaround, but I got an error when I tried "python setup.py" install in that directory. We really need to use the GIF so help would be much appreciated.
Files
Updated by Anchi Cheng about 10 years ago
Hi, Scott,
There are more than one case of this happening not due to Leginon upgrade but TUI or Gatan software upgrade. Try register tecnaiccd.dll as in
regsrv32 -u ..../tecnaiccd.dll
then register it again.
Does this Gatan GIF control on the scope computer ?
Looking around here at NRAMM, we do have a case that uses comtypes to control gatan camera through tecnaiccd, so it should work.
Updated by Scott Stagg about 10 years ago
All the tests that were in the thread that you linked to worked for me, and I unregistered and reregistered the dll, but the connection is still not working. I still get that 'module' object has no attribute 'IGatanCamera' exception. I've attached a screenshot. I still think this has something to do with the Leginon upgrade. Everything was working until right after I updated.
P.S. Sorry the screenshot is in a funny orientation. I have no idea why it's doing that.
Updated by Scott Stagg about 10 years ago
To answer your other question, yes the camera is on the microscope computer.
Updated by Anchi Cheng about 10 years ago
win32com which you tested successfully needs comarray to go with.
comtypes is meant to combine the functions of the two.
Unfortunately, there is no way to compile comarray with python27 on XP since two needed macros are in Visual Studio 2008 that Jim and I could not find a source to download any more.
For now, if you want a work around, you have to go back using python 2.5 and win32com+comarray. I can't try it on a real scope now and am waiting to password for installing a simulator.
However, before you give up, could you test comtypes directly for me ? I want to make sure the problem shows up from this simple call.
import comtypes.client comtypes.client.CreateObject('TecnaiCCD.GatanCamera.2')
This should give you the same error. What I can't figure out is why win32com can find the interface IGatanCamera, but not comtypes.
Updated by Anchi Cheng about 10 years ago
Scott, an idea,
Could you check how many tecnaiccd.dll you have on that computer and what their names are? I've noticed that I got multiple when search for "tecnaicdd" on the scope where comtypes works. They also carries version number such 185 and 220.
It could be a version problem. What is the version of Titan software and Gatan DM ?
Updated by Anchi Cheng about 10 years ago
- Status changed from New to Assigned
- Assignee set to Scott Stagg
Updated by Anchi Cheng about 10 years ago
It took some time, but I now have a virtual machine with Window XP and tecnai simulator and gatan camera simulator at 1.85 version working.
Unfortunately I could not duplicate the error. The Leginon installation works without any problem.
Two things I've noticed:
1. There are two tecnaiccd.dll The one registered is the one in c:\\program file\\gatan\\ditialmicrograph\\plugins\\tecnaiccd.dll
2. comtypes generated files in c:\Python27\Lib\site-packages\comtypes-1.1.1-py2.7.egg\gen files such as
_BE24587C_098....._0_1_0.py and TECNAICCDLib.py when I first try to start gatan.Gatan
This is expected since these gen files makes later loading faster.
Scott, I expect that you just went back to 2.5 to get around the problem. Am I correct ?
----
I wonder know how to make " a virtual machine with Window XP and tecnai simulator and gatan camera simulator" for testing.It is because we also have the gatan camera question.
Updated by ShinBo Chen over 9 years ago
- File IMG_20150526_102249.jpg IMG_20150526_102249.jpg added
- File IMG_20150526_102732.jpg IMG_20150526_102732.jpg added
- Category set to pyscope
- Assignee changed from Scott Stagg to Anchi Cheng
We cannot use leginon GUI tool to acquire image by Gatan camera!
So we did the test for tecnai/gatan and it showed the wrong message(tecnai is passed the test).
------
AttributeError:'Gatan' object has no attribute 'unsupported'
------
ps: leginon version 3.0 and the connection from admin to client is well. We've added the instrument on web: http://..../myamiweb/addinstrument.php & instruments.cfg is setting!
Hope someone could help to figure out ~
Updated by Anchi Cheng over 9 years ago
ShinBo,
From the line where the error occur, you are running an old version from 2.2 release. This means your upgrade to 3.0 is not completed on the computer where the camera is. The error is consistent with the error reported in
. Not to this redmine issue.Sometimes the pyc file does not get updated when the py file is replaced. Remove gatan.pyc at where it is installed on the camera computer may solve your problem.
Updated by Anchi Cheng about 9 years ago
- Status changed from Assigned to Closed