Best way is usually to just read them into binary file initially.
# Python 2.7 code draft ... it may even work
import os
import time
import visa
rm = visa.ResourceManager()
inst = rm.open_resource('GPIB0::22::INSTR')
def read_cal_rom(inst, cal_time):
lo = 0x60000
hi = 0x60000 + 2048 * 2
try:
inst.write("TRIG HOLD")
inst.write("QFORMAT NUM")
l = list()
for i in range(lo, hi, 2):
inst.write("MREAD {}".format(i))
j = int(inst.read().strip())
if j < 0:
j = 65536 + j
l.append(j)
fname = "cal-rom-{}-{}.bin".format(cal_time, time.strftime("%d.%m.%Y-%H:%M:%S", time.localtime(cal_time)))
with open(os.path.join("/home/pi/3458a-meas/calram-dumps", fname), "w") as f:
for i in l:
f.write("%c" % (i >> 8))
f.flush()
print "CAL ROM read ok"
except:
print "CAL ROM reading failed: {}".format(e)
pass
inst.write("QFORMAT NORM")
inst.write("TRIG AUTO")
read_cal_rom(inst, time.time())