I try to use python 3 and pyvisa 1.8 to communicate with GPIB devices.
but how to distinguish different type of excptions.
For example:
try:
visa.ResourceManager().open_resources('COM1')
exception visa.VisaIOError:
<some code>
when open fails, it generate a general exception VisaIOError, but how can I know, is the port busy or the port does not exist or something else?
like:
try:
visa.ResourceManager().open_resources('COM1')
exception <1>:
# device busy
exception <2>:
# device does not exist
exception ...
what should I right on position <1><2> and so on to catch different type of exceptions?
Thanks