import sys import clr sys.path.append(r'C:\windows\assembly\GAC_32\Ivi.Visa.Interop\5.5.0.0__a128c98f1d7717c1') clr.AddReferenceToFile('Ivi.Visa.Interop.dll') from Ivi.Visa.Interop import * visa_rm = ResourceManagerClass() dev = FormattedIO488Class() dev.IO = visa_rm.Open('GPIB0::5::INSTR') dev.WriteString('*IDN?') idn = dev.ReadString() print(idn) # 本題はこちら↓ imessage_close = clr.GetClrType(IMessage).GetMethod('Close') imessage_close.Invoke(dev.IO, None)
NI Spyで確認した結果