A script to initialize connection with instrument using SCPI through VISA connection.
- get_resource_list() -> scan & list available resource
- open_connection(resource_id) -> connect to an instrument using resource id (VISA address)
- query(query_str) -> write & read operation based on query SCPI commands
- write(cmd_str) -> write operation based on SCPI commands, expect to return response
- read() -> read response from instrument (useful for polling response)
- query_image(cmd_str) -> read image file from instrument and create BMP image file in current directory (binary block read)
- Clone the repo
- Install required python library. (pip install -r requirements.txt)
- Import and use InstrumentController class to init connection
controller = InstrumentController()
print(controller.get_resource_list())
instrument_address = 'GPIB0::14::INSTR'
controller.open_connection(instrument_address)
print(controller.query('*IDN?'))
controller.write('OPERating:FREQuency?')
print(controller.read())
controller.query_image('IMAGe:DOWNload?')