pyvisa-py: M2 Mac - list_resources() not returning available TCPIP instrument

On an M2 Mac, rm.list_resources() isn’t returning an available TCPIP instrument.

rm = pyvisa.ResourceManager("@py")
print(rm.list_resources())

inst = rm.open_resource("TCPIP::169.254.4.179::INSTR")
print(inst.query("*IDN?"))

Returns:

()
KEITHLEY INSTRUMENTS,MODEL 2450,04505775,1.7.12b

Showing the instrument will connect but fails to show for list_resources.

I tried doing a bit of debugging but not totally sure what I was doing:

resp = pmap.recv_port((vxi11.DEVICE_CORE_PROG, vxi11.DEVICE_CORE_VERS, rpc.IPPROTO_TCP, 0))

seems to fail to return any response on Mac but succeeds on Windows.

To Reproduce

Steps to reproduce the behavior:

  1. Connect instrument withFind IP address of your instrument
  2. Use code above with a ARM Mac (?) replacing IP address with your instrument’s

Output of pyvisa-info

Machine Details:
   Platform ID:    macOS-13.5-arm64-arm-64bit
   Processor:      arm

Python:
   Implementation: CPython
   Executable:     /***
   Version:        3.11.6
   Compiler:       Clang 15.0.7 
   Architecture:   ('arm', 64)
   Build:          Oct  3 2023 10:37:07 (#main)
   Unicode:        UCS4

PyVISA Version: 1.14.1

Backends:
   ivi:
      Version: 1.14.1 (bundled with PyVISA)
      Binary library: Not found
   py:
      Version: 0.7.1
      TCPIP INSTR: Available 
         Resource discovery:
         - VXI-11: ok
         - hislip: ok
      TCPIP SOCKET: Available 
      ASRL INSTR:
         Please install PySerial (>=3.0) to use this resource type.
         No module named 'serial'
      USB INSTR:
         Please install PyUSB to use this resource type.
         No module named 'usb'
      USB RAW:
         Please install PyUSB to use this resource type.
         No module named 'usb'
      VICP INSTR:
         Please install PyVICP to use this resource type.
      GPIB INSTR:
         Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
         No module named 'gpib'
      GPIB INTFC:
         Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
         No module named 'gpib'

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

I think it is not so much a question of mask than it is a question of the ip address prefix. As @CompThing pointed out the 169.255 prefix is special and this appears to be the root issue of your problem.

Could you make a PR adding this piece of information to the documentation ?