pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
288 stars 124 forks source link

Blank output when inputting rm.list_resources() in pyvisa #240

Closed hiroki-oist closed 4 years ago

hiroki-oist commented 4 years ago

Hello anyone,

Please guide me on below problem.

Code:

import visa rm = visa.ResourceManager('@py') rm.list_resources() () inst = rm.open_resource(TCPIP::192.168.0.2::SOCKET") File "", line 1 inst = rm.open_resource(TCPIP::192.168.0.2::SOCKET") ^ SyntaxError: invalid syntax

Problem: There's sourcemeter and nanovoltmeter connected by GPIB using port number 7 and 18. I've sent a ping to one of them and have already checked if the connection is successful. The hat which shows where the error is was under the first colon. I have no idea why this is a SyntaxErroe...

MatthieuDartiailh commented 4 years ago

Currently pyvisa-py does detect TCPIP instrument (I am even sure there is a way to that for socket instrument). The Syntax error comes from the forgotten " at the beginning of the instrument address.

hiroki-oist commented 4 years ago

Currently pyvisa-py does detect TCPIP instrument (I am even sure there is a way to that for socket instrument). The Syntax error comes from the forgotten " at the beginning of the instrument address.

Thank you! It worked!