MCPcopy Create free account
hub / github.com/LabPy/lantz / query

Method query

lantz/drivers/olympus/ixbx.py:82–97  ·  view source on GitHub ↗

Query the instrument and parse the response. :raises: InstrumentError

(self, command, *, send_args=(None, None), recv_args=(None, None))

Source from the content-addressed store, hash-verified

80 self.send('2LOG IN')
81
82 def query(self, command, *, send_args=(None, None), recv_args=(None, None)):
83 """Query the instrument and parse the response.
84
85 :raises: InstrumentError
86 """
87 response = super().query(command, send_args=recv_args, recv_args=recv_args)
88 command = command.strip()[0]
89 if response in ('1x', '2x'):
90 raise InstrumentError("Unknown command: '{}'".format(command))
91 if not response.startswith(command):
92 raise InstrumentError("Unknown response: '{}'".format(response))
93 if response == 'X' or 'x':
94 raise InstrumentError('Unable to set')
95 elif not response == '+':
96 raise InstrumentError("Unknown response: '{}'".format(response))
97 return response
98
99 @Feat(read_once=True)
100 def idn(self):

Callers 8

idnMethod · 0.95
soft_limitsMethod · 0.95
movement_statusMethod · 0.95
move_relativeMethod · 0.95
zMethod · 0.95
stopMethod · 0.95
_getFunction · 0.45
_setFunction · 0.45

Calls 1

InstrumentErrorClass · 0.90

Tested by

no test coverage detected