EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: justanothername on January 01, 2021, 10:22:34 pm

Title: HP 5316A/B python driver
Post by: justanothername on January 01, 2021, 10:22:34 pm
Here is a litte python driver for the HP5316A counter I wrote.
I hope it works haven't tested througly yet.
usage example:

Code: [Select]
from HP5316x import HP5316X
instrument = HP5316X("GPIB1::20::INSTR")
instrument.measmode = instrument.MeasModes.PERIOD_A
instrument.gatemode = instrument.GateModes.LONG_FRONT
instrument.triggerlevelmode = instrument.TriggerLevelModes.SET_LEVEL
instrument.timeout = 10
instrument.triggerlevel_a = 0.01
instrument.triggerslope_a = instrument.TriggerSlopes.POSITIVE

meas = instrument.get_measurement()

if meas is not None:
   print("raw answer: " + meas.raw)
   print("value: " + str(meas.value))
   print("unit: " + meas.unit)
   print("overflow: " + str(meas.overflow))

del instrument