7 Save/Recall/Print
7.3 Save
'Ref Level'|':DISPlay:WINDow:TRACe:Y:SCALe:RLEVel 5']
def ConnecToInstrument():
rm = pyvisa.ResourceManager()
_inst = rm.open_resource(_connectionString)
_inst.read_termination = '\n'
_inst.write_termination = '\n'
idn = _inst.query('IDN?')
print("Sending Recording Entries to: " + idn)
def CheckError()
err = _inst.query('SYST:ERR?')
return err.lower.find("no error")
def SendCommand(recordingEntry):
# split the recording entry into label and mnemonic
labelAndMnemonic = recordingEntry.split('|')
label = labelAndMnemonic[0]
mnemonic = labelAndMnemonic[1]
# check and see if this is OPC query
opcIndex = mnemonic.find('OPC?')
#if OPC query send the query and get OPC query value
if opcIndex >= 0:
opcQueryValue = _inst.query(mnemonic)
print(opcQueryValue)
else:
print(mnemonic)
_inst.write(mnemonic)
err = CheckError()
# publish any errors from the previous command
if err:
print('Error for command ' + label + ': ' + err)
for entry in _recordingEntries
2619 Spectrum Analyzer Mode User's &Programmer's Reference