coburnw / python-vxi11-server

A VXI-11 Instrument Server written in Python
27 stars 13 forks source link

"Device not accessible [open]" in the demo code #4

Closed grassmochi closed 3 years ago

grassmochi commented 3 years ago

Hi, I am running the code on python 3.7.5. I start the server with time_device.py "python ../demo_servers/time_device.py" and using "python ../demo_clients/time_client.py" or part of code in it as below would give the error of "Device not accessible [open]" (the first part below) However, the "time_device.py" seems to create a link. (the second part below). I also try to print something under the "init" of "TimeDeivce" But it looks like the TimeDevice is not initializing. I am not sure what did I missing. Is there something we need to modify before we try the demo code? Thank you.


Error on the time_client.py


(base) bash-4.4$ python Python 3.7.5 (default, Oct 25 2019, 15:51:11) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import sys import os import vxi11 test_instr = vxi11.Instrument("TCPIP::localhost::inst0::INSTR") print(test_instr.read()) Traceback (most recent call last): File "", line 1, in File "/xxx/vxi11_server/vxi11.py", line 763, in read return self.read_raw(num).decode(encoding).rstrip('\r\n') File "/xxx/vxi11_server/vxi11.py", line 705, in read_raw self.open() File "/xxx/vxi11_server/vxi11.py", line 633, in open raise Vxi11Exception(error, 'open') vxi11.Vxi11Exception: 3: Device not accessible [open]



time_device.py


(base) bash-4.4$ python ../demo_servers/time_device.py Press Ctrl+C to exit INFO:main:starting time_device INFO:instrument_server:abortServer started... INFO:rpc:registering (395183, 1, 6, 38327) on ('0.0.0.0', 38327) INFO:instrument_server:coreServer started... INFO:rpc:strting new request handler DEBUG:instrument_server:**** DEBUG:instrument_server:CREATE_LINK (1609871971, False, 10000, b'inst0')


coburnw commented 3 years ago

This code was written. tested and used on python2.7 It makes no sense for you to downgrade to python2.7. The master branch is updated to python 3. Please do a pull and lets see how things go.