Skip to content

Instantly share code, notes, and snippets.

View SamWolski's full-sized avatar

Sam Wolski SamWolski

View GitHub Profile
@SamWolski
SamWolski / instrument_connect_pyvisa_labber.py
Last active January 27, 2021 06:08
Instrument interaction via pyVISA and/or Labber API
import pyvisa
visa_rm = pyvisa.ResourceManager()
## Access at the address may require enabling/configuring the interface on the instrument (S)FP
pxi_vna_addr = 'TCPIP0::<HOSTNAME>::hislip_PXI0_CHASSIS1_SLOT10_INDEX0::INSTR'
inst_vna = visa_rm.open_resource(pxi_vna_addr)
inst_vna.write('SYST:PRES')
inst_vna.close()
## No need to close the RM as it is not connected to anything unless told to
import Labber