Support of USB bind identification for iseq power supplies#235
Support of USB bind identification for iseq power supplies#235
Conversation
| if read_after_query: | ||
| return inst.read() | ||
| else: | ||
| return reply |
There was a problem hiding this comment.
Because the SHQ 122m returns as query response the command string as check if the command was executed successfully. To get the return value of an command (or in this case the identification string) one has to additionally perform a read operation.
|
|
||
|
|
||
| def query_identification(rm, resource, baud_rate, read_termination=None, write_termination=None, timeout=1000 * 5): | ||
| def query_identification(rm, resource, baud_rate, read_termination=None, write_termination=None, timeout=1000 * 5, indentifer_cmd="*IDN?", read_after_query=False): |
| result = memorized_binds[res] | ||
| else: | ||
| result = query_identification(rm, res, instrument['baud_rate'], instrument['read_termination'], instrument['write_termination'], timeout=timeout) | ||
| if instrument["type"].lower() == "iseg_hv": |
There was a problem hiding this comment.
Maybe make a global "devices_with_non_default_values" dict, so that it is easier to potentially add more devices there instead of blowing up an if clause?
| else: | ||
| result = query_identification(rm, res, instrument['baud_rate'], instrument['read_termination'], instrument['write_termination'], timeout=timeout) | ||
| if instrument["type"].lower() == "iseg_hv": | ||
| result = query_identification(rm, res, instrument['baud_rate'], instrument['read_termination'], instrument['write_termination'], timeout=timeout, indentifer_cmd="#", read_after_query=True) |
basil/utils/USBBinds.py
Outdated
| "name": tf["name"], | ||
| "type": "", # Standard instruments with *IQN? command |
There was a problem hiding this comment.
What is happening here exactly? Is this a way to define different devices with non-*IDN? identifier commands?
There was a problem hiding this comment.
This is done to identify serial transfer layers which uses implemented non-*IDN? devices. Without the addition of "name" and "type" in this temporary instrument dictionary the linking in the code block below would not work and thus also not the logic which you commented in your third comment.
TL;DR: The serial transfer layer does not know if it is used for e.g. an SHQ 122M. Therefore this part is needed to identify an instrument correctly.
The iseq SHQ 122M does not support the standard
*IDN?query. Therefore this PR adds the functionality to query/read the identifier of the SHQ 122M via the#command. Additionally included is a small fix for an bug with memorized_binds.