pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
282 stars 120 forks source link

GPIB interface_clear call #274

Closed greyltc closed 4 years ago

greyltc commented 4 years ago

In the past, I thought I was able to do

sm = rm.open_resource("GPIB0::24::INSTR")
sm.send_ifc()

Should that work? Or is there another way I should be doing that?

I know that it's not strictly proper to send the IFC signal to an instrument object, but I thought that under the hood that got redirected to the actual GPIB bus controller object that the instrument is connected to so that this worked.

MatthieuDartiailh commented 4 years ago

VISA does not support send_ifc on INSTR resources (actually the current behavior of PyVISA is misleading and will be fixed). You need to access the interface object using

ifc = rm.open_resources("GPIB0::INTFC")
MatthieuDartiailh commented 4 years ago

See https://github.com/pyvisa/pyvisa/pull/550 for what I mean about fixing PyVISA.