Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COM] Connecting to NI-VISA server #434

Open
thedeadliestcatch opened this issue Jun 6, 2024 · 0 comments
Open

[COM] Connecting to NI-VISA server #434

thedeadliestcatch opened this issue Jun 6, 2024 · 0 comments

Comments

@thedeadliestcatch
Copy link

I have been trying to get pyvisa to get along with NI-VISA server to no avail,

I noticed the 'find' family of functions (which will use the hosts configured through 'visaconf') is also not implemented even when using the ivi/visa (non librevisa) backend.

Both IP and ADDR are correct, However, this is the result when attempting to connect:

>>> inst = rm.open_resource('TCPIP0::IP_OF_SERVER::gpib0,ADDR::INSTR')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/pyvisa/highlevel.py", line 3304, in open_resource
    res.open(access_mode, open_timeout)
  File "/usr/lib/python3/dist-packages/pyvisa/resources/resource.py", line 297, in open
    self.session, status = self._resource_manager.open_bare_resource(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyvisa/highlevel.py", line 3232, in open_bare_resource
    return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyvisa/ctwrapper/functions.py", line 1851, in open
    ret = library.viOpen(
          ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyvisa/ctwrapper/highlevel.py", line 222, in _return_handler
    return self.handle_return_value(session, ret_value)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyvisa/highlevel.py", line 251, in handle_return_value
    raise errors.VisaIOError(rv)
pyvisa.errors.VisaIOError: VI_ERROR_INV_PROT (-1073807239): The protocol specified is invalid.

gpib0,ADDR is correctly reported from the Keysight VISA and I can confirm that adding the resource locally from the host itself works (obviously using its own IP or localhost).

Network connectivity is allowed to pass thru.

Instrument details

NI-VISA server running on Windows 11 test host with GPIB USB interface.

Output of pyvisa-info

$ pyvisa-info
Machine Details:
   Platform ID:    Linux-...
   Processor:      x86_64

Python:
   Implementation: CPython
   Executable:     /usr/bin/python3
   Version:        3.12....
   Compiler:       ...
   Bits:           64bit
   Build:         ....
   Unicode:        UCS4

PyVISA Version: 1.11.3

Backends:
   ivi:
      Version: 1.11.3 (bundled with PyVISA)
      #1: /usr/lib/x86_64-linux-gnu/libvisa.so.24.0.0:
         found by: auto
         bitness: 64
         Vendor: National Instruments
         Impl. Version: National Instruments
         Spec. Version: National Instruments
      #2: /usr/lib/x86_64-linux-gnu/libvisa.so.0.0.0:
         found by: auto
         bitness: 64
         Could not get more info:
            VI_ERROR_NSUP_ATTR (-1073807331): The specified attribute is not defined or supported by the referenced object.
   py:
      Version: 0.5.1
      ASRL INSTR: Available via PySerial (3.5)
      USB INSTR: Available via PyUSB (1.2.1-2). Backend: libusb1
      USB RAW: Available via PyUSB (1.2.1-2). Backend: libusb1
      TCPIP INSTR: Available 
      TCPIP SOCKET: Available 
      GPIB INSTR: Available via Linux GPIB (b'4.3.7-rc1')
      GPIB INTFC: Available via Linux GPIB (b'4.3.7-rc1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant