Skip to content

Commit

Permalink
Added check for presence of second module before querying its model type
Browse files Browse the repository at this point in the history
  • Loading branch information
fietser28 committed Nov 19, 2020
1 parent 618b1df commit b9c10db
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/CapReform/CapReform.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,16 @@ def main():
scpi('SYST:DIGITAL:PIN4:POLARITY POS')
scpi('SYST:DIG:OUTP:DATA 4,0')

# TODO: check & setup stuff
# set maximum values, check channel/module types/configure serial if possible....
ch1Model = scpi("SYSTem:CHANnel:MODel? ch1")
ch2Model = scpi("SYSTem:CHANnel:MODel? ch2")
if ch1Model.startswith("DCP405") and ch2Model.startswith("DCP405"):
if scpi("SYSTem:CHANnel:COUNt?") >= 2:
ch1Model = scpi("SYSTem:CHANnel:MODel? ch1")
ch2Model = scpi("SYSTem:CHANnel:MODel? ch2")
if ch1Model.startswith("DCP405") and ch2Model.startswith("DCP405"):
scpi("INST:COUP:TRAC SER")
else:
else:
scpi("INST:COUP:TRAC NONE")

else:
scpi("INST:COUP:TRAC NONE")

scpi("INST ch1")
module_max_volt = float(scpi("VOLT? MAX"))
scpi("OUTP 0")
Expand Down

0 comments on commit b9c10db

Please sign in to comment.