smajli
smajli

Reputation: 351

PyVisa lists my ethernet connected device, but error when trying to open resource [python3.11]

I am trying to communicate with TTi power supply model QPX1200SP through ethernet connection.

Here is my script:

import pyvisa as visa
rm = visa.ResourceManager()
print(rm.list_resources(query='TCP?*')) #specific query for anything over Ethernet

#above line gives me an answer ('TCPIP0::10.10.0.27::9221::SOCKET',), so line below:

ttipsu = 'TCPIP0::10.10.0.27::9221::SOCKET'

psu = rm.open_resource(ttipsu)

I receive a traceback:

File C:\Python\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals) File c:\users\me\documents\python scripts\visa\pyvisa_v1.py:18 psu = rm.open_resource(ttipsu)

File C:\Python\Lib\site-packages\pyvisa\highlevel.py:3291 in open_resource res.open(access_mode, open_timeout)

File C:\Python\Lib\site-packages\pyvisa\resources\resource.py:281 in open self.session, status = self._resource_manager.open_bare_resource(

File C:\Python\Lib\site-packages\pyvisa\highlevel.py:3216 in open_bare_resource return self.visalib.open(self.session, resource_name, access_mode, open_timeout)

File C:\Python\Lib\site-packages\pyvisa\ctwrapper\functions.py:1850 in open ret = library.viOpen(

File C:\Python\Lib\site-packages\pyvisa\ctwrapper\highlevel.py:226 in _return_handler return self.handle_return_value(session, ret_value) # type: ignore

File C:\Python\Lib\site-packages\pyvisa\highlevel.py:251 in handle_return_value raise errors.VisaIOError(rv)

VisaIOError: VI_ERROR_RSRC_NFOUND (-1073807343): Insufficient location information or the requested device or resource is not present in the system.

I also tried it with line:

rm = visa.ResourceManager('C:\\Windows\\System32\\visa64.dll')

I can ping the 10.10.0.27 with success, 2ms, 0% loss. Ping

What seems to be a problem here?

Upvotes: 0

Views: 237

Answers (1)

smajli
smajli

Reputation: 351

After some research I have found that information in the manual (for this device) is misleading.
The device is Thurlby Thandar instruments (TTi) QPX1200SP.
The manual's info states, that user shall use (example)
TCPIP0::192.168.1.100::9221::SOCKET
instead of 'normal' VISA resource name of
TCPIP0::192.168.1.100::inst0::INSTR

When I replaced resource name to 'normal' VISA name, it begin to work correctly.

Upvotes: 0

Related Questions