python - Keithley 2410 and PyVISA - VI_ERROR_TMO: Timeout expired before operation completed -


i'm trying control keithley 2410 via python on x86_64 linux machine (centos 7). i'm using python 2.7.5, ni-visa 16 , pyvisa 1.8. keithley connected computer via a rs232-to-usb cable , it's configured rs232 communication (with parameters: baud 57600, bits 8, parity none, terminator , flow-ctrl none). when try query keithley timeout error, shown below:

>>> import visa >>> rm = visa.resourcemanager() >>> print(rm.list_resources()) (u'asrl1::instr', u'asrl2::instr') >>> keithley = rm.open_resource("asrl2::instr") >>> print(keithley.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 407, in query return self.read() file "/usr/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 332, in read message = self.read_raw().decode(enco) file "/usr/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 306, in read_raw chunk, status = self.visalib.read(self.session, size) file "/usr/lib/python2.7/site-packages/pyvisa/ctwrapper/functions.py", line 1582, in read ret = library.viread(session, buffer, count, byref(return_count)) file "/usr/lib/python2.7/site-packages/pyvisa/ctwrapper/highlevel.py", line 188, in _return_handler raise errors.visaioerror(ret_value) pyvisa.errors.visaioerror: vi_error_tmo (-1073807339): timeout expired before operation completed. 

pyvisa 1.8 should default '\r' line termination serial, 2410 may not receiving '\n' needs start parsing command. try doing

keithley.write_termination = '\n' keithley.read_termination = '\n' 

right after open_resource() call.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -