Skip to content

Instantly share code, notes, and snippets.

@kmcallister
Created July 4, 2019 06:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmcallister/5bc46e651354c9a25603e006d72f240b to your computer and use it in GitHub Desktop.
Save kmcallister/5bc46e651354c9a25603e006d72f240b to your computer and use it in GitHub Desktop.
Dead-simple DS1054Z data logger
#!/usr/bin/env python
import time
import visa
IP_ADDR = '192.168.50.219'
INTERVAL = 1.0
rm = visa.ResourceManager('@py')
scope = rm.open_resource('TCPIP::%s::INSTR' % (IP_ADDR,))
while True:
value = float(scope.query(':MEAS:ITEM? VAVG, CHAN1'))
print time.time(), value
time.sleep(INTERVAL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment