-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabc.py
More file actions
29 lines (24 loc) · 1.04 KB
/
Copy pathabc.py
File metadata and controls
29 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
Test connecting to the scope over ETHERNET (LAN).
1. Find the scope's IP on its screen (Setup/Menu -> Interface/Ethernet).
2. Put that IP in SCOPE_IP below.
3. Run this. It should print the scope's name if the LAN connection works.
The library is the SAME (pyvisa); only the address format changes to TCPIP.
"""
import pyvisa
# ---- put your scope's IP address here (from the scope screen) ----
SCOPE_IP = "169.254.153.1" # <-- CHANGE THIS to your scope's actual IP
# ------------------------------------------------------------------
addr = f"TCPIP::{SCOPE_IP}::INSTR"
print("Trying to connect to:", addr)
rm = pyvisa.ResourceManager()
try:
scope = rm.open_resource(addr)
scope.timeout = 10000
print("Scope says:", scope.query("*IDN?").strip())
scope.close()
print("SUCCESS - Ethernet connection works.")
print("Use this address in your scripts: SCOPE_ADDR =", repr(addr))
except Exception as e:
print("FAILED:", type(e).__name__, str(e))
print("Check: correct IP? scope and PC on same network? R&S VISA installed?")