Project

General

Profile

trouble getting Tecnai and camera to work

Added by Anonymous over 19 years ago

Hi Denis, Jim, and Christian,

now that all networking is o.k., I can start e.g. application Manual with the instrument node showing up in the Leginon client. It does make the connection to the Gatan camera (as long as Digital Micrograph is running ...) but not to the Tecnai ("Cannot set scope to type Tecnai").

I checked the directory pyScope for any idea, and I found "emregistry.py".

So the problem is: why does Leginon not connect to the Tecnai. In the database I have as scope "Tecnai" (but did use "tecnai" as well), as camera "Gatan" (which works).

Do I need to add our particular type of scope somewhere (emregistry.py -> registerScope) ?

???

And: It is the same behavior if I start Leginon on the EM-Windows computer itself.

Thanks for your help!

All for now

Rasmus


Replies (7)

Re: Leginon problem in Frankfurt mail_3 - Added by Anonymous over 19 years ago

You might need to register the exposure adaptor.

Download adaExp.exe from the Leginon download site

Put it in a directory you'd like to keep it in (like C:\tecnai\adapters)

Open a command prompt

cd to the directory where you put adaexp.exe

then type: adaexp.exe /regserver

Then open the Start Menu and run pyScope -> updatecom.py

Hopefully that will fix your problem

-Christian

- Added by Anonymous over 19 years ago

Dear Christian, (and also Jim and Denis)

sorry to tell you, but it did not work.

I tried the procedure below, the error was still the same.

Then I let updatecom.py run in a python window to yield the following error output:

Tecnai Scripting: Tecnai Scripting -> tecnaicom.py

Tecnai Low Dose Kit: Low Dose Server Library -> ldcom.py

Tecnai Exposure Adaptor: adaExp Library -> adacom.py

Tietz CCD Camera:

Traceback (most recent call last):

File "C:\Python23\Lib\site- packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript

exec codeObject in main.__dict__

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 46, in ?

run()

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 42, in run

makeFile(desc, filename)

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 33, in makeFile

progressInstance=makepy.SimpleProgress(0))

File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line 203, in GenerateFromTypeLibSpec

tlb = pythoncom.LoadTypeLib(typelibInfo.dll)

com_error: (-2147312566, 'Error loading type library/DLL.', None, None)

After that I checked the files: tecnaicom.py, ldcom.py and adacom.py to find them updated ...

I also checked updatecom.py and found the entry for the Tietz CCD ...

Do I need to replace it by some other call for the Gatan camera? Would we need a gatancom.py file (it was not there ...).

But then I do not understand one thing: why is it not giving an error message for the camera but the tecnai itself ?

Is there something else still wrong? Is it still the new database? Should I have loaded another instrument configuration file instead of creating a new one, is something missing in that entry? Can you send me an instrument description file? Is it an FEI software problem (is the normal tecnai software identical to the Spirit (tecnai G2 120kV) software ???

Thanks for your help

Rasmus

- Added by Anonymous over 19 years ago

Hi again,

sorry, I cut off the first line of the "error" message in my last mail, it reads in full:

Generating .py files from type libraries...

Tecnai Scripting: Tecnai Scripting -> tecnaicom.py

Tecnai Low Dose Kit: Low Dose Server Library -> ldcom.py

Tecnai Exposure Adaptor: adaExp Library -> adacom.py

Tietz CCD Camera:

Traceback (most recent call last):

File "C:\Python23\Lib\site- packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript

exec codeObject in main.__dict__

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 46, in ?

run()

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 42, in run

makeFile(desc, filename)

File "C:\Python23\Lib\site-packages\pyScope\updatecom.py", line 33, in makeFile

progressInstance=makepy.SimpleProgress(0))

File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line 203, in GenerateFromTypeLibSpec

tlb = pythoncom.LoadTypeLib(typelibInfo.dll)

com_error: (-2147312566, 'Error loading type library/DLL.', None, None)

and here the information about our tecnai software:

in the "About Tecnai" window we get:

Tecnai G2

Type: Tecnai 12

D-Nr: 01019

Version: 2.1.5

Build: 3234 (01 Dec 2004)

all running from an administrator account.

Now I am waiting ...

All the best

Rasmus

- Added by Anonymous over 19 years ago

Hi,

Since you have a Gatan camera, don't worry about it.

-Christian

- Added by Anonymous over 19 years ago

Dear all,

it seems there is a communication problem ....

I still have the problem that the instrument cannot be connected .... (see earlier mails). And yes, by checking the individual files I guessed that updatecom.py worked well. But running it did not solve the problem!

Sorry, but I am still not happy.

Thanks anyway.

All for now

Rasmus

p.s.

I will be gone for one week starting tomorrow ....

- Added by Anonymous over 19 years ago

I've attached a test script (test.py), try running it and let me know what the output is.

Thanks,

Christian

import win32com.client
import pythoncom

def testTecnai():

try:

tecnai = win32com.client.Dispatch('Tecnai.Instrument')

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Failed to initialize Tecnai interface: %s' % msg

return

else:

print 'Initialized Tecnai interface'

try:

lowdose = win32com.client.Dispatch('LDServer.LdSrv')

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Failed to initialize Low Dose interface: %s' % msg

return

else:

print 'Initialized Low Dose interface'

try:

exposure = win32com.client.Dispatch('adaExp.TAdaExp',

clsctx=pythoncom.CLSCTX_LOCAL_SERVER)

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Failed to initialize Exposure Adapter: %s' % msg

return

else:

print 'Initialized Exposure Adapter interface'

print 'Tecnai test successful'

def testTietz():

try:

camera = win32com.client.Dispatch('CAMC4.Camera')        

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Failed to initialize interface CAMC4.Camera: %s' % msg

return

try:

ping = win32com.client.Dispatch('pyScope.CAMCCallBack')

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Failed to initialize interface pyScope.Ping: %s' % msg

return

try:

hr = camera.RegisterCAMCCallBack(ping, 'EM')

except pythoncom.com_error, (hr, msg, exc, arg):

print 'Error registering callback COM object: %s' % msg

return

hr = camera.RequestLock()

if hr == win32com.client.constants.crDeny:

print 'Error locking camera, denied lock'

return

elif hr == win32com.client.constants.crBusy:

print 'Error locking camera, camera busy'

return

elif hr == win32com.client.constants.crSucceed:

pass

cameratypes = [('Tietz Simulation', 'ctSimulation'),

('Tietz SCX', 'ctSCX'),

('Tietz PXL', 'ctPXL'),

('Tietz PVCam', 'ctPVCam'),

('Tietz FastScan', 'ctFastScan'),

('Tietz FastScan Firewire', 'ctF114_FW')]

for name, cameratype in cameratypes:

cameratype = getattr(win32com.client.constants, cameratype)

print name + ':',

try:

hr = camera.Initialize(cameratype, 0)

except pythoncom.com_error, (hr, msg, exc, arg):

print 'error initializing camera, %s' % msg

else:

print 'camera initialization succeeded'

camera.UnlockCAMC()

def testGatan():

pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED)

camera = None

try:

camera = win32com.client.dynamic.Dispatch('TecnaiCCD.GatanCamera')

except pythoncom.com_error, e:

pass

else:

print 'Initialized Gatan interface (.1)'

try:

camera = win32com.client.dynamic.Dispatch('TecnaiCCD.GatanCamera.2')

except pythoncom.com_error, e:

pass

else:

print 'Initialized Gatan interface (.2)'

if camera is None:

print 'Gatan test failed (unable to initialize interfaces)'

return

print 'Gatan test successful'

if __name__ == '__main__':

print 'Testing Tecnai...'

testTecnai()

print 

#print 'Testing Tietz...'

#testTietz()

#print 'Tietz test completed.'

print 'Testing Gatan...'

testGatan()

- Added by Anonymous over 19 years ago

Dear Christian,

I tried the script this morning. I did not open Leginon etc. but did open both, the Tecnai software (EM control) and Digital Micrograph

The script was running in the Python Window, and produced the following output:

Testing Tecnai...

Failed to initialize Tecnai interface: OLE error 0x8004ffff

Testing Gatan...

Initialized Gatan interface (.1)

Initialized Gatan interface (.2)

Gatan test successful

Let's hope you can make something out of it ....

Thanks,

Rasmus

    (1-7/7)