diff --git a/rigol.go b/rigol.go index 73e2a72..f6330bc 100644 --- a/rigol.go +++ b/rigol.go @@ -46,11 +46,7 @@ func main() { tstart := time.Now() - result := queryScope(conn, toRun) - // Return from scope is semicolon separated, so just switch for commas. - result = strings.Replace(result, ";", ", ", -1) - - // Collect and write screenshot if the screen flag is set. + // Collect and write screenshot if the screen flag is set. Do this first because queries can take a little while. if *fScreen { img := getScreenshot(conn) if img != nil { @@ -58,6 +54,10 @@ func main() { } } + result := queryScope(conn, toRun) + // Return from scope is semicolon separated, so just switch for commas. + result = strings.Replace(result, ";", ", ", -1) + // Clear history if *fClear { fmt.Fprintf(conn, ":CLE;MEAS:STAT:RES\n")