Skip to content

New server gives error #100

@damazter

Description

@damazter

Upon instantiating my instrument I get an error
command:
Wines("Wines", server_name='')
Error is posted below.

When I run the same command again, it suddenly works.
I have the feeling that qcodes tries to connect to the new instrument server before it is fully instantiated. I guess some timeout needs to be set, such that the first connect is allowed to take a little bit of time.

in server.py

    def connect(self, remote_instrument, instrument_class, args, kwargs):
        new_id = self.ask('new_id')  # <--add some timeout here

Else I would not know what the problem is, anyone else experiencing the same problem?

error traceback:

---------------------------------------------------------------------------
Empty                                     Traceback (most recent call last)
<ipython-input-3-3d79c9947757> in <module>()
      1 print("define wines instrument")
----> 2 simulation = wines.wire_network.WireNetwork("Wines", server_name='')

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\instrument\base.py in __new__(cls, server_name, *args, **kwargs)
     61         else:
     62             return RemoteInstrument(*args, instrument_class=cls,
---> 63                                     server_name=server_name, **kwargs)
     64 
     65     def __init__(self, name, server_name=None, **kwargs):

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\instrument\remote.py in __init__(self, instrument_class, server_name, *args, **kwargs)
     25         manager = get_instrument_server(server_name, shared_kwargs)
     26         # connect sets self.connection
---> 27         manager.connect(self, instrument_class, args, kwargs)
     28 
     29         # bind all the different categories of actions we need

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\instrument\server.py in connect(self, remote_instrument, instrument_class, args, kwargs)
     78 
     79     def connect(self, remote_instrument, instrument_class, args, kwargs):
---> 80         new_id = self.ask('new_id')
     81         try:
     82             conn = InstrumentConnection(

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\utils\multiprocessing.py in ask(self, timeout, *query)
    332                 if self._error_queue.empty():
    333                     # only raise if we're not about to find a deeper error
--> 334                     raise e
    335             self._check_for_errors(self._expect_error)
    336 

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\utils\multiprocessing.py in ask(self, timeout, *query)
    324 
    325             try:
--> 326                 res = self._check_response(timeout)
    327 
    328                 while not self._response_queue.empty():

c:\users\t-dadejo\pycharm_projects\qcodes\qcodes\utils\multiprocessing.py in _check_response(self, timeout)
    301 
    302     def _check_response(self, timeout):
--> 303         res = self._response_queue.get(timeout=timeout)
    304         if res == SERVER_ERR:
    305             self._expect_error = True

C:\Users\t-dadejo\AppData\Local\Continuum\Anaconda3\envs\santabarbara\lib\multiprocessing\queues.py in get(self, block, timeout)
    103                     timeout = deadline - time.time()
    104                     if timeout < 0 or not self._poll(timeout):
--> 105                         raise Empty
    106                 elif not self._poll():
    107                     raise Empty

Empty: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions