mabuchilab / Instrumental

Python-based instrumentation library from the Mabuchi Lab.
http://instrumental-lib.readthedocs.org/
GNU General Public License v3.0
117 stars 77 forks source link

_INST_VISA_INFO_ pattern? #123

Open jondoesntgit opened 3 years ago

jondoesntgit commented 3 years ago

When I run inst._rsrc.query('*IDN?'), I get the following string: Newport 8008 v2.22m B222. How do I write the _INST_VISA_INFO_ string?

natezb commented 3 years ago

Your best bet is probably to implement _check_visa_support() in your module. You can look at some other drivers to see how it's used; one example is wavemeters.burleigh. You then usually should add _INST_PRIORITY to indicate the driver's priority, i.e. how early in the list of drivers it should be imported and tested.

This isn't a great solution, but it should work. Since manufacturers often don't follow the SCPI spec when it comes to the IDN query, maybe we should add some more flexibility to how you can test against IDNs.