Connecting to Apsin 26G by Anapico in Python
Instrument Card
The APSINXXG is an analog signal generator (analog signal source) series covering RF and microwave frequency ranges from 9 kHz to 12, 20 and 26.5 GHz
Device Specification: here
Manufacturer card: ANAPICO
AnaPicoย is an ISO 9001:2015 certified technology leader, developing, manufacturing and supplying RF and MW test & measurement instruments
- Headquarters: Switzerland
- Yearly Revenue (millions, USD): 5
- Vendor Website: here
Connect to the Apsin 26G in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
from pymeasure.instruments import Instrumentfrom pymeasure.instruments.validators import strict_range, strict_discrete_set
class APSIN26G(Instrument): """ Represents the Anapico APSIN26G Signal Generator with option 9K, HP and GPIB. """ FREQ_LIMIT = [9e3, 26e9] POW_LIMIT = [-30, 27]
power = Instrument.control( "SOUR:POW:LEV:IMM:AMPL?;", "SOUR:POW:LEV:IMM:AMPL %gdBm;", """ A floating point property that represents the output power in dBm. This property can be set. """, validator=strict_range, values=POW_LIMIT ) frequency = Instrument.control( "SOUR:FREQ:CW?;", "SOUR:FREQ:CW %eHz;", """ A floating point property that represents the output frequency in Hz. This property can be set. """, validator=strict_range, values=FREQ_LIMIT ) blanking = Instrument.control( ":OUTP:BLAN:STAT?", ":OUTP:BLAN:STAT %s", """ A string property that represents the blanking of output power when frequency is changed. ON makes the output to be blanked (off) while changing frequency. This property can be set. """, validator=strict_discrete_set, values=['ON', 'OFF'] ) reference_output = Instrument.control( "SOUR:ROSC:OUTP:STAT?", "SOUR:ROSC:OUTP:STAT %s", """ A string property that represents the 10MHz reference output from the synth. This property can be set. """, validator=strict_discrete_set, values=['ON', 'OFF'] )
def __init__(self, adapter, name="Anapico APSIN26G Signal Generator", **kwargs): super().__init__( adapter, name, **kwargs )
def enable_rf(self): """ Enables the RF output. """ self.write("OUTP:STAT 1")
def disable_rf(self): """ Disables the RF output. """ self.write("OUTP:STAT 0")
This code defines a new class APSIN26G
that represents the Anapico APSIN26G Signal Generator. It inherits from the Instrument
class provided by PyMeasure.
The class defines several properties such as power
, frequency
, blanking
, and reference_output
that can be controlled and queried using the Instrument.control
method. Each property has a corresponding SCPI command for querying and setting its value.
The power
property represents the output power in dBm and is validated using the strict_range
validator with the limits defined in POW_LIMIT
.
The frequency
property represents the output frequency in Hz and is validated using the strict_range
validator with the limits defined in FREQ_LIMIT
.
The blanking
property represents the blanking of output power when the frequency is changed. It can be set to either โONโ or โOFFโ and is validated using the strict_discrete_set
validator.
The reference_output
property represents the 10MHz reference output from the synth. It can be set to either โONโ or โOFFโ and is also validated using the strict_discrete_set
validator.
The enable_rf
method enables the RF output by sending the corresponding SCPI command.
The disable_rf
method disables the RF output by sending the corresponding SCPI command.
The APSIN26G
class can be used to connect to and control an Anapico APSIN26G Signal Generator using PyMeasure.