OS: Centos 7 (Linux DAQ 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux)
pyvisa-py: 0.3.1
pyvisa: 1.9.1
GPIB: Bus 001 Device 002: ID 3923:709b National Instruments Corp. GPIB-USB-HS
Device: KEITHLEY INSTRUMENTS INC.,MODEL 2400
linux-gpib: 4.1.0-1.20180529svn1753.el7
The linux-gpib native python wrapper (Gpib.py) seems to work fine (after much tinkering) but I cannot get pyvisa + pyvisa-py to work. If there is additional info that I could report please let me know.
[***@*** ~]$ sudo python
[sudo] password for ***:
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import visa
>>> rm = visa.ResourceManager('@py')
>>> rm.list_resources()
(u'GPIB0::24::INSTR',)
>>> inst = rm.open_resource('GPIB0::24::INSTR')
>>> print(inst.query("*IDN?"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 563, in query
self.write(message)
File "/usr/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 223, in write
count = self.write_raw(message.encode(enco))
File "/usr/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 201, in write_raw
return self.visalib.write(self.session, message)
File "/usr/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 373, in write
raise errors.VisaIOError(ret[1])
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
>>> import Gpib
>>> inst = Gpib.Gpib(0,24)
>>> inst.write("*IDN?")
>>> inst.read(100)
'KEITHLEY INSTRUMENTS INC.,MODEL 2400,4302945,C33 Mar 31 2015 09:32:39/A02 /V/M\n'
PS Is there a way to use the GPIB device without sudo?
The linux-gpib native python wrapper (Gpib.py) seems to work fine (after much tinkering) but I cannot get pyvisa + pyvisa-py to work. If there is additional info that I could report please let me know.
PS Is there a way to use the GPIB device without sudo?