FlexPLL Offline
The following diagram shows a FlexPLL Offline connection which allows you to view saved Response files. The JTF Source and Receiver are not connected. This script opens a connection to FlexPLL, loads a Response Memory, and returns a Response measurement. You must enter a valid Response file name (*.rspx) for the script to load and view. Notice that the address uses localhost instead of the PC's computer name.

Example Script
Copy
FlexPLL-offline.py
""" Script on PC controls FlexPLL offline. The JTF Source and Receiver are
not connected. This script opens a connection to FlexPLL, loads a
Response Memory, and returns a Response measurement. """
import pyvisa as visa # import VISA library
ADDRESS = 'TCPIP0::localhost::hislip1,4880::INSTR'
CALFILE = '%USER_DATA_DIR%\Response Calibration\JTF_Cal_2020-09-04_2.jtfx'
RESPONSEFILE = '%USER_DATA_DIR%\Responses\Response_2020-09-16_250khz.rspx'
TIMEOUT = 10000
def open_flexpll_connection(address):
""" Opens visa connection to FlexFlexDCA. """
print('Connecting to Flexdca ...')
try:
rm = visa.ResourceManager()
connection = rm.open_resource(address)
connection.timeout = 20000 # Set connection timeout to 20s
connection.read_termination = '\n'
connection.write_termination = '\n'
inst_id = connection.query('*IDN?')
print('\nFlexPLL connection established to:\n' + inst_id, flush=True)
except (visa.VisaIOError, visa.InvalidSession):
print('\nVISA ERROR: Cannot open instrument address.\n', flush=True)
return None
except Exception as other:
print('\nVISA ERROR: Cannot connect to instrument:', other, flush=True)
print('\n')
return None
return connection
FlexPLL = open_flexpll_connection(ADDRESS)
FlexPLL.query(':SYSTem:DEFault;*OPC?')
FlexPLL.write(':RESPonse1:DISPlay OFF')
FlexPLL.write(':CAL:RESP:LOAD:FNAMe "' + CALFILE + '"')
FlexPLL.write(':RMEMory1:FILE:NAME "' + RESPONSEFILE + '"')
FlexPLL.query(':RMEMory1:FILE:LOAD;*OPC?')
FlexPLL.write(':RMEMory1:DISPlay ON')
FlexPLL.write(':RMEMory1:DISPlay:MJTF ON')
FlexPLL.write(':RMEMory1:DISPlay:MOJTF ON')
FlexPLL.write(':RMEMory1:UNAMe "DUT 4. 250KHz LBW"')
FlexPLL.query(':DISPlay:GRAPh:Y:AUTO;*OPC?')
FlexPLL.write(':DISPlay:VRESponse RMEMory1')
meas = FlexPLL.query(':MEASure:RMEMory1:BANDwidth?').strip('"')
print('\nResponse Bandwidth: ' + meas + ' Hz')
FlexPLL.write(':SYSTem:GTLocal')
FlexPLL.close()