Project

General

Profile

Leginon installation JEOL JEM 3200FSC / Gatan K2 camera

Added by Oliver Hofnagel about 10 years ago

Dear all,
we have two questions during our JEOL JEM 3200FSC /K2 leginon installation:

We need the entry for the instruments.cfg !
Cs is known, but what class must be used to reach the jeolcom.py script ?

And second:
When we try to aquire an image with the K2 the message "Error aquiring image: No proxy selected for this data class" is coming (in combination with all camera pixel configurations).
Orientation is set to 270 degree with flip around vertical axis, default storage position is used (D:\\).

Thanks for your help,

Oliver


Replies (31)

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

1. jeolcom.Jeol

2. Is this through the testing script in Gatan_K2_installation_and_setup ?

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Dear Anchi,
I added jeolcom.JEOL to the instrument.cfg (please see attached file for the complete instrument.cfg).
So, I am able to start the leginon client on the TEM computer. When I start leginon on the processing computer I am also able to connect to TEM client computer (named 3200jeol). But when I start the "Manual2.2" application with "3200jeol" to scope and main (as described in the leginon manual under "Test leginon on the computer controlling the EM") the application dont start and the EM computer get an error message (please see attached screenshot).
BUT, when I start "manual2.2 application" with "3200jeol" for "scope" and "leginon" for "main" the application starts. Then I tried to create a node connecting "3200jeol" with "instrument node". Since there is no "instrument" node I used the "EM" node. The "EM" node also appear on leginon client on the TEM computer (see screenshot). But unfortunately the "Get Magnification" button is not working and also I am not able to select another TEM than "None" in the instrumnet selector (see screenshot).
Can you help me ? Thanks a lot,
Oliver

instrument.cfg.JPG (142 KB) instrument.cfg.JPG instrument.cfg
error message EM computer.JPG (253 KB) error message EM computer.JPG error message EM computer
leginon client.JPG (162 KB) leginon client.JPG leginon EM client
Untitled.jpg (87.9 KB) Untitled.jpg leginon instrument

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Try the more basic test on the scope computer in python commandline. I just added it to JEOL_installation_specifics

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Alexander Fieroch about 10 years ago

Hi Anchi,

we have tried your test

from pyscope import jeolcom
t =jeolcom.Jeol()
t.getMagnification()

but unfortunately it's not working.
We had to add the line

from pyscope import jeolcom

to get access to that class. But after running
t =jeolcom.Jeol()

the command is doing nothing and not returning to the command line - maybe it is waiting for something or trying to connect without a timeout.
Any hints?

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Hi, Oliver,

This is a bit hard as the original developer is not in the field any more and we have no experience on JEOL scope. If you have some python scripting experience, look in myami/pyscope/jeolcom.py It does quite a few things in the function init. It hangs somewhere in there. Check how far down it hangs with some debuging tool if you have them. Otherwise, as simple as a print statement at the critical steps would help.

For example, it might be that it could not find JEOL COM Library in the line;

temext = comtypes.client.GetModule(('{CE70FCE4-26D9-4BAB-9626-EC88DB7F6A0A}', 3, 0))

or that it is stuck in the following block because the com interface is not activated.

    while result != 0:
      ht, result = self.ht3.GetHTValue()
      time.sleep(1)

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Alexander Fieroch about 10 years ago

Hi Anchi,

you are right - it is the while loop where it is stuck.
Any ideas, why the com interface could not be activated or how to analyze it?

Thanks,
Alex

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Alex,

Xing Meng gave me some parameters and steps he used to get at least through the test on his JEOL 3200.
See the thread he opened while having issues JEOL 3200

Let's see if these apply to you:

1. Where did you install pyscope and configure jeolcom.JEOL at ?

In his case there is a Tietz F416. Aparently nothing needed to be installed on TEM PC. The jeolcom.Jeol was configured and tested on the Tietz computer.
He also noted that configuring jeolcom.Jeol on K2 camera computer failed which is reasonable. You should only configure an instrument at one computer.

2. There may require some time before the class is initialized. Here is his wording. It is in agreement with the wait loop in the code.

Now it is tricky!  it may give error.
If so do
t =jeolcom.Jeol()
the second works (and always???)
now you can read the mAG

3. comtypes is required by jeolcom.Jeol, but I think you have gone past that.

4. You may want to check the constants (those in all capital letters at the beginning of jeolcom.py to see if they match your model of scope.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Dear Anchi,
to 1.): We installed the leginon client with pyscope and configured jeolcom.JEOL on the original Jeol 3200FSC controling computer, this is a WinXP 32bit system. Additionally we installed a leginon client on the original Gatan K2 controling computer (a Win Server2008 64bit system). The K2 implementation to leginon is working!

We followed the installation wiki on
http://emg.nysbc.org/projects/leginon/wiki/Windows_Installation_All
replaced safearray.py and did the update

 C:\python27\python.exe updatecom.py

2.): We gave the class hours for initializing... ;-)
We added some print line code to the init() function in the class Jeol.
The command

t =jeolcom.Jeol()

is hanging in the first while loop waiting for a result != 0 from
self.ht3.GetHTValue()

3.): Yes, comtypes 0.6.2 is installed

4.): We changed the LOWMAG and the MAG1 values in jeolcom.py, they were different to our microscope. But still not running. We think there is some problem with the TEM3 interface from JEOL,because it hangs at the point where the (TEM3?) interface should be activated. (See also Support #1575). The jeol_tem3.py shows also wrong MAG values, might be this the reason ? Christian Suloway is not any longer reachable, or ?
Thanks for your help,
Alex and Oliver

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

If you add jeolcom.Jeol as an instrument class on K2 computer instruments.cfg and do the test there, would it work ? Xing's successful initialization was done on their Tietz camera. I wonder if K2 also already has access to TEM3. JEOL's Jaap Brink insisted that nothing needs to be installed on the original Jeol computer. I will see if I can find indirect contact or access to a scope/camera pair myself.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Alexander Fieroch about 10 years ago

Hm, unfortunately we cannot test jeolcom.Jeol on our K2 computer. We have tried but we failed because of a missing comtypes module.
The OS from our K2 computer is Windows 7 64bit and we couldn't find any comtypes libraries in 64bit for python 2.7. Any ideas to get comtypes working with 64bit?

Thanks & best regards,
Alex

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

comtypes is pure python.

I gave it a try making amd64 installer and attached it to Issue #2897.

I installed with this installer on our K2 computer. It loaded in python. This is as much as I can test from here. We don't have a case here that needs the same thing.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Hi Anchi,

thank you very much for 64bit comtypes!
Unfortunately we have the same errors as Xing Meng in http://emg.nysbc.org/boards/15/topics/2185.

C:\Python27\Lib\site-packages\leginon>\Python27\python.exe
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import comtypes
>>> from pyscope import jeolcom
>>> from pyscope import tecnai
>>> t=jeolcom.Jeol()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pyscope\jeolcom.py", line 90, in __init__
    tem.TEM.__init__(self)
  File "C:\Python27\lib\site-packages\pyscope\tem.py", line 90, in __init__
    self.config_name = config.getNameByClass(self.__class__)
  File "C:\Python27\lib\site-packages\pyscope\config.py", line 112, in getNameByClass
    conf = getConfigured()
  File "C:\Python27\lib\site-packages\pyscope\config.py", line 96, in getConfigured
    parse()
  File "C:\Python27\lib\site-packages\pyscope\config.py", line 62, in parse
    cls = getattr(mod, clsname)
AttributeError: 'module' object has no attribute 'Jeol()'

And with replacing updatecom.py with your one linked at
http://emg.nysbc.org/projects/leginon/repository/raw/branches/myami-3.0/pyscope/updatecom.py
we get the same errors again as Xing Meng.

C:\Python27\Lib\site-packages\pyscope>\Python27\python.exe updatecom.py
Generating .py files from type libraries...
initializing TEM Scripting
Traceback (most recent call last):
  File "updatecom.py", line 54, in <module>
    run()
  File "updatecom.py", line 50, in run
    makeFile(desc)
  File "updatecom.py", line 29, in makeFile
    print 'Error, cannot find typelib for "%s"' % descs
TypeError: not all arguments converted during string formatting

I have removed updatecom.pyc but it didn't recompile because of the error above.

Any ideas?
Thank you very much!

Best regards,
Alex

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

The error of no attribute 'Jeol()' comes from instruments.cfg

You probably put

jeolcom.Jeol()

instead of just the class name

jeolcom.Jeol

there. Did I have it wrong in the wiki some where ? Please point it out to me so it can be correct. Sorry about that.

Regarding the format string error in updatecom.py. I fixed the bug in 3.0 now. If you download again, it should come out right. However, updatecom.py should not be necessary in your combination of scope and camera.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Hi Anchi,

thank you very much for your help.
I don't know if it's wrong in the wiki but I'll write to you if I find it.

jeolcom.Jeol
fixes the last error but unfortunately there is a new one:

C:\Python27\Lib\site-packages\pyscope>\Python27\python.exe
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyscope import tecnai
>>> from pyscope import jeolcom
>>> t=jeolcom.Jeol()
# Generating comtypes.gen._CE70FCE4_26D9_4BAB_9626_EC88DB7F6A0A_0_3_0
# Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
# Generating comtypes.gen.stdole
# Generating comtypes.gen.TEMEXTLib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pyscope\jeolcom.py", line 100, in __init__
    self.tem3 = comtypes.client.CreateObject(temext.TEM3, comtypes.CLSCTX_ALL)
  File "C:\Python27\lib\site-packages\comtypes\client\__init__.py", line 235, in CreateObject
    obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface)
  File "C:\Python27\lib\site-packages\comtypes\__init__.py", line 1145, in CoCreateInstance
    _ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p))
  File "_ctypes/callproc.c", line 945, in GetResult
WindowsError: [Error -2147221164] Class not registered

Any ideas?

Thank you very much and best regards,
Alex

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

I talked to Christian Suloway and he did not do anything special as far as he knew on their system. The only thing he said to check is whether TEMServer is running on JEOL computer. He said it is in the system tray and the icon looks like a microscope and a blue circle should be turning around it.

We agreed that it is possible that the TEMEXTLib that you have problem with was already registered on their system because SerialEM was already installed when he started. SerialEM would need the same to run.

I consulted Jaap Brink at JEOL USA, here is his suggestion for solution:

Is the file TemExt.dll on the computer? You have to create and initialize the TEM3 interface and this is not related at all to the presence or absence of a K2, as far as I know.

This file, usually residing under C:\Program Files\JEOL\External. Make sure it's registered within Windows through the use of TemExtReg.exe.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Dear Anchi,
thanks for your help ! The TEMServer is running, also TEMEXTLib is registered. By the way, we are able to communicate with the TEM via DigitalMicrograph (all TEM values shown in Digital Micrograph are correct), so the TEM3 interface to the Jeol3200 is working. I contacted Xing Meng directly and he told me that he was not able to install the leginon 64bit version sucessfully, but he was able to get the leginon 32bit version running on the K2 computer. I think we will also try this... Or do you have another idea ?
Greetings,
Oliver

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

If your pyscope.jeolcom.JEOLCOM test worked with your current 64-bit installation, I don't think you will need to switch to 32bit version. The communication to com is the last hurdle normally. When Xeng did the installation, there was no comtypes installer for 64-bit. I actually had to debug comtypes to make it compile. Maybe that was the problem he had.

What I did not know is if COM registered on JEOL computer (presumable 32-bit) would work on 64-bit. Since your test went through, I presume it does work.

I encourage that you continue with your 64-bit installation. K2 control part works as 64-bit installation in our hand. It would be good if we can use the native stuff.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Oliver,

Reading again your post, I think I might have misunderstood you. Did you mean that when you had the failure, both TEMEXTLib and TEMServer were working ?

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Hi Anchi,
I have the failure with running TEMServer registered TEMEXTLib......
The class is not registered, please see the attached files...........
Any idea ?

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Oliver,

Please update this thread after you've tried using 32-bit version of the python installation so that it can have solution recorded. Thanks.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Dear Anchi,
we installed the 32bit version in addition to the 64bit leginon version, so we have now a 32bit AND a 64bit leginon version installed on the K2 computer. And the jeolcom "getMag" test in the 32bit version was successful !
But unfortunately launcher.py in 32bit (and in 64 bit version) is not starting now, the error message is:
leginon.project.NotConnectedError: (2003, "Cant connect to MySQL server on 169.254.199.111 (10060)
Do you know a way to let run the 32bit and the 64bit version in parallel ?
Greetings,
Oliver and Alex

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

Hi, Oliver,

You should only run one version of python per computer. In this case, the 32-bit version. Your instruments.cfg on K2 computer would include both the scope and the cameras in this setup.

The MySQL server error is a different problem. It is related to server configuration.
The autoinstaller is not set up for remote connection. You have to follow instruction in Database_Server_Setup_to_allow_connection_from_the_instruments to make it possible.

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Anchi Cheng about 10 years ago

By the way, if you run into this problem, chances are you have not done anything else on the steps to do after autoinstallation

RE: Leginon installation JEOL JEM 3200FSC / Gatan K2 camera - Added by Oliver Hofnagel about 10 years ago

Dear Anchi,
our MySQL server error message was an internal server problem in our institute. After solving our internal problem the 32bit leginon is running ! Now I start the calibrations..........
Thanks a lot,
Oliver

(1-25/31)