Skip to content

Instantly share code, notes, and snippets.

@lrodorigo
Created June 20, 2024 06:39
Show Gist options
  • Save lrodorigo/cdfad0ef9e7c20568e0914c27f3f3cbd to your computer and use it in GitHub Desktop.
Save lrodorigo/cdfad0ef9e7c20568e0914c27f3f3cbd to your computer and use it in GitHub Desktop.
import time
# from threading import Event
#
import pyvisa
#
rm = pyvisa.ResourceManager()
resources = rm.list_resources()
print(f"Risorse disponibili: {resources}")
instrument = rm.open_resource('USB0::2391::8199::MY57008022::0::INSTR') # Aggiorna con il tuo identificativo
measurements = []
instrument.timeout = 5000
# instrument.write("*CLS")
instrument.write("*RST")
time.sleep(5)
channels = ["101", "102", "103"]
config = f"CONF:TEMP TC,J,(@{','.join(channels)})"
instrument.write(config)
while True:
for channel in channels:
instrument.write(f"MEAS:TEMP? (@{channel})")
reading = instrument.read()
print(f"Read {channel}: {float(reading)}")
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment