PyFixate / Fixate

Framework for hardware test fixtures and automatic test environments
MIT License
22 stars 17 forks source link

Keithly dmm driver addition #162

Closed Jasper-Harvey0 closed 1 year ago

Jasper-Harvey0 commented 2 years ago

I have the driver for the new DMM working. Cleaned up some unused code in the Fluke driver too

Jasper-Harvey0 commented 2 years ago

I am still hunting some issues where the DMM will crash after being given a bad command, requiring a power cycle.

jcollins1983 commented 2 years ago

Also, @Jasper-Harvey0, can you please update the release notes before you put the PR back to open?

Jasper-Harvey0 commented 2 years ago

I have made a few updates to the drivers to help remove direct writes to the instruments in some test scripts.

Main change is functions for manual triggering of the DMM. Typical test scripts that use manual triggering look something like:

dmm._write("TRIG:SOUR BUS")                  # set DMM to remote trigger
dmm._write(f"TRIG:COUN {sample_count}")      # set amount of tigger counts   
time.sleep(1)

dmm._write("INIT")                       # Arm DMM for next measurement
for trig in range(0, sample_count):      # loop manually to collect samples and step voltage
    dmm._write("*TRG")                   # trigger DMM measurement
    if trig == 5:                        # voltage step change part way through loop
        # Do stuff
        pass
samples = dmm.instrument.query_ascii_values("FETCH?")    # retrieve measurements from DMM

This now looks like the following:

dmm.set_manual_trigger(samples=1) # Set to manual trigger mode. 1 sample per trigger event

for trig in range(0, sample_count):
    dmm.trigger()
    if trig == 5:
        # Do stuff
        pass
samples = dmm.measurements() # Collect measurements from buffer
Jasper-Harvey0 commented 1 year ago

@jcollins1983 Can we get this merged?

jcollins1983 commented 1 year ago

@Jasper-Harvey0, you will need to resolve the conflict on the releae notes now.