JEOL setup » History » Version 10
Neil Voss, 03/02/2012 12:17 PM
| 1 | 1 | Neil Voss | h1. JEOL setup |
|---|---|---|---|
| 2 | |||
| 3 | 8 | Neil Voss | h2. more info |
| 4 | |||
| 5 | http://cryoem.nysbc.org/CemRobotics.html |
||
| 6 | |||
| 7 | 2 | Neil Voss | h2. instruments.cfg |
| 8 | 1 | Neil Voss | |
| 9 | <pre> |
||
| 10 | [TEM] |
||
| 11 | class: jeol1230.jeol1230 |
||
| 12 | 2 | Neil Voss | </pre> |
| 13 | |||
| 14 | h2. Testing pyscope instrument script functions |
||
| 15 | |||
| 16 | On the instrument host of the instrument, a TEM host that uses Tecnai class, for example, you can launch python command line window and try to create an instance of the instrument and then call a function such as getMagnifications in that like this: |
||
| 17 | |||
| 18 | <pre> |
||
| 19 | import pyscope.registry |
||
| 20 | 6 | Neil Voss | s = pyscope.registry.getClass('jeol1230')() |
| 21 | 2 | Neil Voss | s.getMagnifications() |
| 22 | 1 | Neil Voss | </pre> |
| 23 | 3 | Neil Voss | |
| 24 | 4 | Neil Voss | h2. Potential problems |
| 25 | |||
| 26 | 7 | Neil Voss | h3. import serial |
| 27 | |||
| 28 | 3 | Neil Voss | <pre> |
| 29 | >>> import pyscope.registry |
||
| 30 | Traceback (most recent call last): |
||
| 31 | File "<stdin>", line 1, in <module> |
||
| 32 | File "c:\Python25\Lib\site-packages\pyscope\registry.py", line 9, in <module> |
||
| 33 | import config |
||
| 34 | File "c:\Python25\Lib\site-packages\pyscope\config.py", line 39, in <module> |
||
| 35 | mod = imp.load_module(fullmodname, *args) |
||
| 36 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 8, in <module> |
||
| 37 | from pyscope import jeol1230lib |
||
| 38 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 8, in <module> |
||
| 39 | import serial |
||
| 40 | ImportError: No module named serial |
||
| 41 | >>> |
||
| 42 | </pre> |
||
| 43 | 4 | Neil Voss | |
| 44 | 5 | Neil Voss | you need to install "Python Serial Port Extensions" http://pypi.python.org/pypi/pyserial |
| 45 | 7 | Neil Voss | |
| 46 | h3. defocus.cfg |
||
| 47 | |||
| 48 | <pre> |
||
| 49 | >>> import pyscope.registry |
||
| 50 | >>> s = pyscope.registry.getClass('jeol1230')() |
||
| 51 | Traceback (most recent call last): |
||
| 52 | File "<stdin>", line 1, in <module> |
||
| 53 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__ |
||
| 54 | self.jeol1230lib = jeol1230lib.jeol1230lib() |
||
| 55 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__ |
||
| 56 | self.zeroDefocus = self.readZeroDefocus() |
||
| 57 | 1 | Neil Voss | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 35, in readZeroDefocus |
| 58 | infile = open(self.defocusFile,"r") |
||
| 59 | IOError: [Errno 2] No such file or directory: 'C:\\Python25\\Lib\\site-packages\\pyScope\\defocus.cfg' |
||
| 60 | 9 | Neil Voss | >>> |
| 61 | </pre> |
||
| 62 | |||
| 63 | create an empty file called defocus.cfg |
||
| 64 | |||
| 65 | h3. serial port permissions |
||
| 66 | |||
| 67 | <pre> |
||
| 68 | >>> import pyscope.registry |
||
| 69 | >>> s = pyscope.registry.getClass('jeol1230')() |
||
| 70 | Traceback (most recent call last): |
||
| 71 | File "<stdin>", line 1, in <module> |
||
| 72 | File "c:\python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__ |
||
| 73 | self.jeol1230lib = jeol1230lib.jeol1230lib() |
||
| 74 | File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__ |
||
| 75 | self.zeroDefocus = self.readZeroDefocus() |
||
| 76 | File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 37, in readZeroDefocus |
||
| 77 | line = lines[0] |
||
| 78 | IndexError: list index out of range |
||
| 79 | 10 | Neil Voss | >>> s = pyscope.registry.getClass('jeol1230')() |
| 80 | close connection to JEOL1230 through COM1 port |
||
| 81 | Traceback (most recent call last): |
||
| 82 | File "<stdin>", line 1, in <module> |
||
| 83 | File "c:\python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__ |
||
| 84 | self.jeol1230lib = jeol1230lib.jeol1230lib() |
||
| 85 | File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 18, in __init__ |
||
| 86 | self.ser = serial.Serial(port='COM1', baudrate=9600, bytesize=8, parity='N', stopbits=1, xonxoff = 0, timeout=10, rt |
||
| 87 | scts=0) |
||
| 88 | File "serial\serialwin32.py", line 31, in __init__ |
||
| 89 | SerialBase.__init__(self, *args, **kwargs) |
||
| 90 | File "serial\serialutil.py", line 261, in __init__ |
||
| 91 | self.open() |
||
| 92 | File "serial\serialwin32.py", line 59, in open |
||
| 93 | raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.WinError())) |
||
| 94 | serial.serialutil.SerialException: could not open port COM1: [Error 5] Access is denied. |
||
| 95 | 7 | Neil Voss | >>> |
| 96 | </pre> |