Query the instrument and parse the response. :raises: InstrumentError
(self, command, *, send_args=(None, None), recv_args=(None, None))
| 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): |
no test coverage detected