Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Python - Error VI_ERROR_INV_OBJECT while trying examples

Programming examples for remote communication with instruments
C/C++, C#, Python, Matlab, LabVIEW
Post Reply
seeker
Posts: 1
Joined: August 17th, 2018, 12:12 pm
Country: United States

Python - Error VI_ERROR_INV_OBJECT while trying examples

Post by seeker » August 17th, 2018, 12:34 pm

First off thank for having the forum and good python examples. I got exited and wanted to try out on my MSO 3014 Scope.
I have made progress but having some issues which you can help...!!! :?:

I have installed
- pyvisa
- pyvisa-py
and
- OpenChoice_TekVisa_Deployment_Package_066093811

The I wanted to test the basic stuff and seeing the error
pyvisa.errors.VisaIOError: VI_ERROR_INV_OBJECT (-1073807346): The given session or object reference is invalid.

Is there any thing else I need to install or change to get this to work ?

Thank you
------------------------------------
following is the complete log

>>> import visa
>>> rm = visa.ResourceManager()
>>> print(rm.list_resources())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Tools\Python\Python36\lib\site-packages\pyvisa\highlevel.py", line 1571, in list_resources
return self.visalib.list_resources(self.session, query)
File "C:\Tools\Python\Python36\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 209, in list_resources
raise e
File "C:\Tools\Python\Python36\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 205, in list_resources
find_list, return_counter, instrument_description, err = self.find_resources(session, query)
File "C:\Tools\Python\Python36\lib\site-packages\pyvisa\ctwrapper\functions.py", line 485, in find_resources
instrument_description)
File "C:\Tools\Python\Python36\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 188, in _return_handler
raise errors.VisaIOError(ret_value)
pyvisa.errors.VisaIOError: VI_ERROR_INV_OBJECT (-1073807346): The given session or object reference is invalid.

Carl M
Tektronix Applications
Tektronix Applications
Posts: 800
Joined: July 30th, 2008, 4:45 pm
Country: United States

Re: Python - Error VI_ERROR_INV_OBJECT while trying examples

Post by Carl M » August 28th, 2018, 10:00 am

VI_ERROR_INV_OBJECT is an error from the VISA api. I would try removing TekVISA and pyvisa-py and give NI-VISA a go.
Tektronix Application Engineer

Post Reply

Return to “Remote Instrument Communication (Programming) Examples”

Who is online

Users browsing this forum: No registered users and 2 guests