I am under the impression that when a USB, serial, or GPIB device is plugged into a computer, the computer and the device go through some sort of handshake and the device is assigned an address. It seems like I should be able to set up an event to trigger on this, and do some initialization action whenever a device is plugged in. I am using pyvisa to communicate with devices, but I have not been able to find any documentation about their events. How do I set up such an event?
I know I could use list_resources()
to check what devices are available every second or something, but this seems hacky. Does listing the resources actually query the resources, or just list the ones it already knows?