File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -193,18 +193,23 @@ def show_main_dialog():
193
193
#############################
194
194
def main ():
195
195
global module_max_volt
196
- # Save state
196
+ # Save state and set in known (default) state.
197
197
scpi ("*SAV 10" )
198
198
scpi ("MEM:STATE:FREEZE ON" )
199
-
199
+ scpi ("*RST" )
200
+
200
201
# From now on we always restore the state in case of an error.
201
202
try :
202
203
# Script requires firmware > 1.6, check for it.
203
- firmwareversion = scpi ("SYSTem:CPU:FIRMware?" )
204
- if float (firmwareversion ) < 1.6 :
204
+ fwstr = scpi ("SYSTem:CPU:FIRMware?" )
205
+ i = fwstr .index ('.' )
206
+ j = fwstr .index ('.' ,i + 1 )
207
+ fwmaj = int (fwstr [0 :i ])
208
+ fwmin = int (fwstr [i + 1 :j ])
209
+ if not (fwmaj > 1 or (fwmaj == 1 and fwmin >= 6 )):
205
210
scpi ('DISP:ERR "Script requires firmware >= 1.6"' )
206
211
return
207
-
212
+
208
213
# Digital output for timing/jitter measurements
209
214
scpi ('SYSTEM:DIGITAL:PIN4:FUNCTION DOUTPUT' )
210
215
scpi ('SYST:DIGITAL:PIN4:POLARITY POS' )
@@ -223,6 +228,7 @@ def main():
223
228
scpi ("INST ch1" )
224
229
module_max_volt = float (scpi ("VOLT? MAX" ))
225
230
scpi ("OUTP 0" )
231
+
226
232
show_main_dialog ()
227
233
228
234
while True :
You can’t perform that action at this time.
0 commit comments