Welcome to Instruments Automatisation Libraries’s documentation!

This is a python Library that allow the users to controll the following Instruments:

  • Anrtisu Spectrum Analyzer MS2760A

  • Anritsu Signal Generator MG3694C

  • Rohde and Schwarz Signal Generator SMA100B

  • Anritsu Vector Network Analyzer MS4647B

  • Yokogawa Optical Spectrum Analyzer AQ6370D

  • Power Meter ThorLabs PM100D

  • KEITHLEY Source Meter 2612

  • Novoptel Laser LU1000
    • NovoptelTCP

    • NovoptelUSB

  • CoBrite Tunable Laser

  • Power Supply RD3005

  • Power Supply KA3005

  • Power Supply KA3005p

  • 4 Channels Power Suppy GPP4323

  • AnaPico AG APPH20G

  • Keysight Realtime Oscilloscope UXR0702A

Python Libraries

This Python Librarys can be used with Python Version 3.10.0 or newr. For the Moment you will need the following python Libraries.

pip install ftd2xx
pip install pyserial
pip install serial-tool
pip install python-vxi11
pip install PyVISA
pip install sockets
pip install pandas
pip install matplotlib
pip install numpy
pip install matplotlib

Programms needed when using the Novoptel Laser

To use the LU1000 Laser you need to install the FTDI D2XX Driver e.g. from https://www.novoptel.de/Home/Downloads_de.php - USB Driver for USB2.0 or https://ftdichip.com/drivers/d2xx-drivers/ - 2.12.36.4 (accessed on 08.02.2025) Python Library needed: pip install ftd2xx

How to use the GUI

In folder “GUI_Scripts/Instrument Connect and Disconnect GUI” you will find an customtkinter GUI write by me to help you faster connect and disconnect to different devices. You can copy the hole “Instrument Connect and Disconnect GUI” folder to your prefered location. Inside you will see an main.py. You can open the main.py in your Python IDE. To use the GUI you will be needing two more extra library.

pip install customtkinter
pip install pillow

After installing it you can run the main.py. An GUI window will open with list of instruments. Choose your instrument and press select. You can choose more the one instrument! Afterwords press the green button Connect. This will automatically search your ports for the devices you selected. Please be shure to connect the devices to your PC/Laptop befor you connect otherwise you will be not able to find any devices! After some time you will see an green text in the box bewol your selected devices with “Instruments are Connected !”. When you get this massage you can now close the GUI with Close and all the devices will be saved in your dictionary “dictTest” see main.py. You now can use the dictionary to call an device function for example

Python code example to how to set frequency on R&S SMA100B

Here’s a simple Python code example:

from App_Constructor import App, DisconnectApp

#######################################################
# How to use the GUI Automation Controll
# Call the GUI App and select your instruments
# The selected instruments will be connected and you will see an
# green Massage in the GUI Massage Box.
# After you see the massage you can Close the app with the Close button
#######################################################

# Call GUI App
app = App()
app.mainloop()

# The devices will be given back in a dictionary
dictTest = {} # Create empty dictionary to store the devices
dictTest =  app.ExtractData() # Call the app ExtractData Function to give you the Connected Devices back

dictTest[' Rohde and Schwarz SMA100B '].set_freq_CW(FreqVec[i], "GHz")
dictTest[' Rohde and Schwarz SMA100B '].Close()

How to use the code without the GUI

If you wann use the codes without the GUI, you can do it too. You can copy the library of the instrument you wanna use from “GUI_Scripts/Instrument Connect and Disconnect GUI/InstrumentControl”. To connect to your instrument you will still need the python librarys given in the section “Python Libraries”! Then you need to know what kind of connection your instrument have to your PC/Laptop Ethernet, USB-C, USB-A, RS323 etc. After you find out you can connect to your instrument and use all the function from the choosen instrument library. See the code bewol for a short example on how to connect use some function and then close the connection to your instrument.

Python code example to how to connect to ThorLabs Power Meter PM100D

Here’s a simple Python code example how to connect and disconnect from an instrument:

from PM100D import PM100D
PM = PM100D("Serial Number Of the ThorLabs Power Meter PM100D")
PM.getIdn()
PM.Close()

Instruments

Anritsu Vector Network Analyzer MS2760A module

Created on Wed Dec 1 13:11:32 2021

@author: Martin.Mihaylov

class MS2760A.MS2760A(resource_str)[source]

Bases: object

This function is using pyvisa to connect to Instruments. Please install PyVisa before using it.

Close()[source]
ExtractTtraceData(value)[source]
Parameters:
  • value (int)

  • function (!!!!!USE IT AT YOUR OWN RISK is not an official) –

    Trace Number from which the data is taken:

    Can be set to [1,2,3,4,5,6].

    1 - This Function will set the continues Measurement to ‘OFF’. 2 - Will set the Data Format to ASCii. This is needed since :TREACE:DATA? <num> is defect!! 3 - Will write TRACE:DATA? <num>. Will return only 3 bits. The rest will be packed in the next command asked. 4 - Will ask for the Data Format. This is dummy command that will have the data and the Data Format. 5 - Make manupulations to separate the actual data from the rest and return the data in Output np.array() form.

  • workaround!!!!! (but a) –

    Trace Number from which the data is taken:

    Can be set to [1,2,3,4,5,6].

    1 - This Function will set the continues Measurement to ‘OFF’. 2 - Will set the Data Format to ASCii. This is needed since :TREACE:DATA? <num> is defect!! 3 - Will write TRACE:DATA? <num>. Will return only 3 bits. The rest will be packed in the next command asked. 4 - Will ask for the Data Format. This is dummy command that will have the data and the Data Format. 5 - Make manupulations to separate the actual data from the rest and return the data in Output np.array() form.

Returns:

Output – DESCRIPTION.

Return type:

TYPE

Init()[source]
Returns:

Initialize meas

Return type:

None.

OPC()[source]
Returns:

Places a “1” into the output queue when all device operations have been completed

Return type:

TYPE str

abort()[source]

Description: Resets the trigger system. This has the effect of aborting the sweep or any measurement that is currently in progress. Additionally, any pending operation flags that were set by initiation of the trigger system will be set to false. If :INITiate:CONTinuous is OFF (i.e. the instrument is in single sweep mode), send the command :INITiate[:IMMediate] to trigger the next sweep. If :INITiate:CONTinuous is ON (i.e. the instrument is in continuous sweep mode) a new sweep will start immediately

ask_CHPowerState(state)[source]
Parameters:

state (str/int) – Channel Power State Sets the state of the channel power measurement, ON or OFF. When using :CONFigure:CHPower,the state is automatically set to ON state = [‘ON’,’OFF’,1,0]

Returns:

State ON or OFF

Return type:

str

ask_CenterFreq()[source]
Returns:

Query the Central Frequency Numeric (Hz)

Return type:

TYPE float

ask_Configuration()[source]
Returns:

Title: Option Configuration Description: This command returns a quoted string of characters readable only by Anritsu Customer Service. Only instrument configuration information is returned. No setup information is included.

Return type:

TYPE str

ask_DataFormat()[source]
Returns:

Query the data format

Return type:

TYPE str

ask_DataPointCount()[source]
Returns:

Query the data point count. Title: Display Point Count Query Return: Numeric

Return type:

TYPE str

ask_FreqSpan()[source]
Returns:

Query the Frequency Span Numeric (Hz)

Return type:

TYPE float

ask_MarkerExcursion()[source]
Returns:

Query the excursion for a marker. The excursion is the vertical distance from the peak to the next highest valley which must be exceeded for a peak to be considered a peak in marker max commands

Return type:

TYPE str

ask_MarkerExcursionState()[source]
Returns:

Turn on/off excursion checking for marker max commands

Return type:

str

ask_ResBwidth()[source]
Returns:

Ask the resolution bandwidth. Query Return: Numeric (Hz)

Return type:

TYPE str

ask_ResBwidthAuto()[source]
Returns:

val – Query the resolution bandwidth. Defaoulf: ON

Return type:

str

ask_SingleOrContinuesMeas()[source]
Returns:

data – The query version of the command returns a 1 if the instrument is continuously sweeping/measuring and returns a 0 if the instrument is in single sweep/measurement mode.

Return type:

str

ask_TraceData(traceNumber)[source]

!!!!!DONT USE IT!!!!!

Parameters:

traceNumber (int) – Description: This command transfers trace data from the instrument to the controller. Data are transferred from the instrument as an IEEE definite length arbitrary block response, which has the form <header><block>.

Returns:

Trace Data

Return type:

TYPE str

ask_TraceSelected()[source]
Returns:

Query selected trace will be used by operations that use a single trace. The max number of traces available to select is model specific

Return type:

TYPE str

ask_TraceState(number)[source]
Parameters:

number (int) –

Description: The trace visibility state. If it is OFF, the :TRAC:DATA? command will return nan. Trace Number:

int. [1,2,3,4,5,6]

Raises:

ValueError – Error message

Returns:

State ON or OFF

Return type:

str

ask_TraceType(number)[source]
Parameters:

number (int) – Specifies how successive sweeps are combined to produce the resulting display value. Setting the TYPE to NORMal will cause the displayed value for a point to be the current measured value for that point. Setting the TYPE to AVERage will cause the displayed value for a point to be the average of the last <integer> measured values where <integer> is set by [:SENSe]:AVERage:COUNt. Setting the TYPE to MAXimum will cause the displayed value for a point is the maximum measured value for that point over sweeps. Setting the TYPE to MINimum will cause the displayed value for a point is the minimum measured value for that point over sweeps.Setting the TYPE to RMAXimum will cause the displayed value for a point to be the maximum of the last <integer> measured values where <integer> is set by [:SENSe]:AVERage:COUNt.Setting the TYPE to RMINimum will cause the displayed value for a point to be the minimum of the last <integer> measured values where <integer> is set by [:SENSe]:AVERage:COUNt. This command will be ignored when spectrogram is disabled by DISPlay:VIEW.

Raises:

ValueError – Error message

Returns:

Query Return: NORM|MIN|MAX|AVER|RMAX|RMIN|RAV

Return type:

TYPE str

ask_freq_Start()[source]
Returns:

Query return set start Frequency. Numeric (Hz)

Return type:

TYPE str

ask_freq_Stop()[source]
Returns:

Query return set stop Frequency. Numeric (Hz)

Return type:

TYPE str

ask_sweepTime()[source]
Returns:

Title: Measured Sweep Time Description: This command queries the measured sweep time, in number of milliseconds. This command will return “nan” if no measured sweep time is available, which happens if the sweep was reset and the instrument has not yet swept enough to measure a full sweep.

Return type:

TYPE str

get_Data()[source]

This function will stop temporally set Continuous Measurement to OFF, extract the max. peak value and frequency and restore the Continuous Measurement to ON. :returns: OutPut – Return a dictionary with the measured voltage and current. :rtype: dict

query(message)[source]
set_CHPowerState(state)[source]
Parameters:

state (str) – Sets the state of the channel power measurement, ON or OFF. When using :CONFigure:CHPower,the state is automatically set to ON state = [‘ON’,’OFF’,1,0]

Raises:

ValueError – Error message

Return type:

None.

set_CenterFreq(value, unit)[source]
Parameters:
  • value (float) – Sets the center frequency. Note that changing the value of the center frequency will change the value of the coupled parameters Start Frequency and Stop Frequency. It might also change the value of the span.

  • unit (str) – Unit value. Can be [‘HZ’,’KHZ’,’MHZ’,’GHZ’]

Raises:

ValueError – Error message

Return type:

None.

set_Continuous(status)[source]
Parameters:

status (str/int) – Stop/start Sweep. Can be [‘ON’, ‘OFF’, 1, 0]

Raises:

ValueError – Error message

Return type:

None.

set_ContinuousMeas(state)[source]
Parameters:

state (str/int) – Title: Sweep Type Description: Specifies whether the sweep/measurement is triggered continuously. If the value is set to ON or 1, another sweep/measurement is triggered as soon as the current one completes. If continuous is set to OFF or 0, the instrument remains initiated until the current sweep/measurement completes, then enters the ‘idle’ state and waits for the :INITiate[:IMMediate] command or for :INITiate:CONTinuous ON.

Raises:

ValueError – Error message

Return type:

None.

set_DataFormat(status)[source]
Parameters:

status (str) – Set Data Format status = [‘ASCii’,’INTeger’,’REAL’]

Raises:

ValueError – Error message

Return type:

None.

set_DataPointCount(value)[source]
Parameters:

value (int) –

Title: Display Point Count

Description: Changes the number of display points the instrument currently measures. Increasing the number of display points can improve the resolution of measurements but will also increase sweep time.

Default Value: 501 Range: 10 to 10001

Raises:

ValueError – Error message

Return type:

None.

set_FreqSpan(value, unit)[source]
Parameters:
  • value (float) – Sets the frequency span. Setting the value of <freq> to 0 Hz is the equivalent of setting the span mode to zero span. Note that changing the value of the frequency span will change the value of the coupled parameters Start Frequency and Stop Frequency and might change the Center Frequency.

  • unit (str) – Unit value. Can be [‘HZ’,’KHZ’,’MHZ’,’GHZ’]

Raises:

ValueError – Error message

Return type:

None.

set_MarkerExcursion(value)[source]
Parameters:

value (float) – Sets the excursion for a marker. The excursion is the vertical distance from the peak to the next highest valley which must be exceeded for a peak to be considered a peak in marker max commands

Return type:

None.

set_MarkerExcursionState(state)[source]
Parameters:

state (str/int) – Turn on/off excursion checking for marker max commands. Can be state = [‘ON’,’OFF’,1,0]

Raises:

ValueError – Error message

Return type:

None.

set_MarkerPreset()[source]
Returns:

Presets all markers to their preset values.

Return type:

None.

set_MaxPeak()[source]
Returns:

Moves the marker X value to the point in the marker’s assigned trace that has the highest peak.

Return type:

None.

set_NextPeak()[source]
Returns:

Moves the marker X value to the point in the marker’s assigned trace that is the next highest peak

Return type:

None.

set_ResBwidth(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets the resolution bandwidth. Note that using this command turns the automatic resolution bandwidth setting OFF. In Zero Span, the range will change to allow a minimum of 5 KHz to the maximum of 20 MHz.

  • unit (str) – Parameters: <numeric_value> {HZ | KHZ | MHZ | GHZ} Default Unit: Hz

Raises:

ValueError – Error message

Return type:

None.

set_ResBwidthAuto(state)[source]
Parameters:

state (int/str) – Title:RBW AutoDescription:Sets the state of the coupling of the resolution bandwidth to the frequency span. Setting the value to ON or 1 will result in the resolution bandwidth being coupled to the span. That is, when the span changes, the resolution bandwidth changes. Setting the value to OFF or 0 will result in the resolution bandwidth being decoupled from the span. That is, changing the span will not change the resolution bandwidth. When this command is issued, the resolution bandwidth setting itself will not change. Parameters:<1 | 0 | ON | OFF> Default Value:ON

Raises:

ValueError – Error message

Return type:

None.

set_TraceSelected(number)[source]
Parameters:

number (int) –

The selected trace will be used by operations that use a single trace. The max number of traces available to select is model specific. Trace number:

Can be set to [1,2,3,4,5,6]

Raises:

ValueError – Error message

Return type:

None.

set_TraceState(state, number)[source]
Parameters:
  • state (str) – The trace visibility state status. If it is OFF, the :TRAC:DATA? command will return NaN. [‘ON’,’OFF’,0,1]

  • number (int) –

    Trace Number:

    Can be set to [1,2,3,4,5,6]

Raises:

ValueError – Error message

Return type:

None.

set_TraceType(state, number)[source]
Parameters:
  • state (str) –

    Sets Trace Type:

    Normal - NORM Hold the Minimum - MIN Hold the Maximum - MAX Average - AVER Rolling Max Hold - RMAX Rolling Min Hold - RMIN Rolling Average - RAV

  • number (int) –

    Trace number:

    Can be set to [1,2,3,4,5,6]

Raises:

ValueError – Error message

Return type:

None.

set_freq_Start(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets the start frequency. Note that in the spectrum analyzer, changing the value of the start frequency will change the value of the coupled parameters, Center Frequency and Span.

  • unit (str) – Parameters: <numeric_value> {HZ | KHZ | MHZ | GHZ}

Raises:

ValueError – Error message

Return type:

None.

set_freq_Stop(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets the start frequency. Note that in the spectrum analyzer, changing the value of the start frequency will change the value of the coupled parameters, Center Frequency and Span.

  • unit (str) – Parameters: <numeric_value> {HZ | KHZ | MHZ | GHZ}

Raises:

ValueError – Error message

Return type:

None.

write(message)[source]

Anritsu Signal Generator MG3694C module

Created on Wed Dec 1 07:00:19 2021

@author: Martin.Mihylov

class MG3694C.MG3694C(hostname)[source]

Bases: Instrument

This class uses vxi11 library to connect to Anritsu MG3694C. Need to have python ‘vxi11’ library installed!

Close()[source]
DisplayParamDict(Type)[source]

This function will print all the adjusted parameters.

abort()[source]

Description: Forces the trigger system to the idle state. Any sweep in progress is aborted as soon as possible

Parameters: None

ask_MaximalPowerLevel()[source]
Returns:

Requests the maximum RF output power level value that can be programmed for the particular MG369xC model

Return type:

TYPE Query str

ask_OutputPowerLevel()[source]
Returns:

Requests the value currently programmed for the RF output power level

Return type:

TYPE Query str

ask_am_internalFreq()[source]
Returns:

Requests the currently programmed modulating waveform frequency value for the internal AM function.

Return type:

TYPE Query str

ask_am_internalWave()[source]
Returns:

Requests the currently selected modulating waveform for the internal AM function.

Return type:

TYPE Query str

ask_am_logDepth()[source]
Returns:

Requests the currently programmed modulation depth value for the internal AM Log mode.

Return type:

TYPE Query str

ask_am_logsens()[source]
Returns:

Requests the currently programmed AM sensitivity value for the external AM Log mode.

Return type:

TYPE Query

ask_am_state()[source]
Returns:

Requests currently programmed amplitude modulation state (on/off)

Return type:

TYPE Query str

ask_am_type()[source]
Returns:

Requests the currently programmed AM operating mode.

Return type:

TYPE Query str

ask_fm_Bwidth()[source]
Returns:

Requests the currently programmed Unlocked FM synthesis mode of operation (narrow or wide)

Return type:

TYPE Query str

ask_fm_internalFreq()[source]
Returns:

Requests the currently programmed modulating waveform frequency value for the internal FM function.

Return type:

TYPE Query str

ask_fm_internalWave()[source]
Returns:

Requests the currently selected modulating waveform for the internal FM function.

Return type:

TYPE Query str

ask_fm_mode()[source]
Returns:

Requests the currently programmed synthesis mode used to generate the FM signal.

Return type:

TYPE Query str

ask_fm_state()[source]
Returns:

Requests the currently programmed frequency modulation state (on/off).

Return type:

TYPE Query str

ask_freq_CW()[source]
Returns:

Requests the current value of the frequency parameter.

Return type:

TYPE Query str

ask_freq_centerFreq()[source]
Returns:

Requests the current value of the RF output center frequency.

Return type:

TYPE Query str

ask_freq_mode()[source]
Returns:

Requests the currently selected programming mode for frequency control.

Return type:

TYPE Query str

ask_freq_span()[source]
Returns:

Requests the current value for SWEep[1] sweep span

Return type:

TYPE Query str

ask_freq_start()[source]
Returns:

Requests the current value for SWEep[1] start frequency.

Return type:

TYPE Query str

ask_freq_step()[source]
Returns:

Requests the current step increment value of the frequency parameter.

Return type:

TYPE Query str

ask_freq_stop()[source]
Returns:

Requests the current value for SWEep[1] stop frequency.

Return type:

Query str

ask_freq_unit()[source]
Returns:

Requests the currently selected frequency unit.

Return type:

Query str

ask_output_impedance()[source]
Returns:

Description: Queries the MG369xC RF output impedance. The impedance is nominally 50 ohms and is not settable.

Return type:

TYPE Query str

ask_output_protection()[source]
Returns:

Requests the currently programmed state of the MG369xC RF output during frequency changes in CW or step sweep mode.

Return type:

TYPE Query str

ask_output_retrace()[source]
Returns:

Requests the currently programmed state of the MG369xC RF output during sweep retrace

Return type:

TYPE Query str

ask_pm_Bwidth()[source]
Returns:

Requests the currently programmed phase modulation operating mode.

Return type:

TYPE Query str

ask_pm_internalFreq()[source]
Returns:

Requests the currently programmed modulating waveform frequency value for the internal phase modulation function.

Return type:

TYPE Query str

ask_pm_internalWave()[source]
Returns:

Requests the currently selected modulating waveform for the internal phase modulation function.

Return type:

TYPE Query str

ask_pm_state()[source]
Returns:

Requests the currently programmed phase modulation state (on/off).

Return type:

TYPE Query str

get_Data()[source]
Returns:

OutPut – Return a dictionary with the measured Power and CW Frequency.

Return type:

dict

query(message)[source]
reconnect(attempts_number=3)[source]
set_OutputPowerLevel(value)[source]
Parameters:

value (float/int) – Description: Sets the power level of the unswept RF output signal. Parameters: Power level (in dBm) | UP | DOWN | MIN | MAX Range: MIN to MAX (see notes below) Default: 0 dBm

Returns:

DESCRIPTION.

Return type:

TYPE

set_am_internalFreq(value, unit)[source]
Parameters:
  • value (str) – Description: Sets the frequency of the modulating waveform for the internal AM function (see :AM:INTernal:WAVE). Parameters: Frequency

  • unit (int/float) –

    Range: 0.1 Hz to 1 MHz for sine wave

    0.1 Hz to 100 kHz for square, triangle, and ramp waveforms Default: 1 kHz

    Raises

  • ------

  • ValueError – Error message

Return type:

None.

set_am_internalWave(state)[source]
Parameters:

state (str) – Description: Selects the modulating waveform (from the internal AM generator) for the internal AM function, as follows: SINE = Sine wave GAUSsian = Gaussian noise RDOWn = Negative ramp RUP = Positive ramp SQUare = Square wave TRIangle = Triangle wave UNIForm = Uniform noiseParameters: Parameters: SINE | GAUSsian | RDOWn | RUP | SQUare | TRIangle | UNIForm Default: SINE

Raises:

ValueError – Error message

Return type:

None.

set_am_logDepth(value)[source]
Parameters:

value (int/float) – Description: Sets the modulation depth of the AM signal in the internal AM Log mode. Parameters: Modulation depth (in dB) Range: 0 to 25 dB Default: 3 dB

Raises:

ValueError – Error message

Return type:

None.

set_am_logsens(value)[source]
Parameters:

value (int/float) – Description: Sets the AM sensitivity for the external AM Log mode. Parameters: Sensitivity (in dB/V) Range: 0 to 25 dB/V Default: 3 dB/V

Raises:

ValueError – Error message

Return type:

None.

set_am_state(state)[source]
Parameters:

state (str/int) – Description: Enable/disable amplitude modulation of MG369xC RF output signal. Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – Error message

Return type:

None.

set_am_type(state)[source]
Parameters:

state (str) – Description: Selects the AM operating mode. Parameters: LINear | LOGarithmic Default: LINear

Raises:

ValueError – Error message

Return type:

None.

set_correctionCommands(state)[source]
Parameters:

state (str/int) – Description: Turns the selected user level flatness correction power-offset table on/off. Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – Error message

Return type:

None.

set_fm_Bwidth(state)[source]
Parameters:

state (str) – Description: Sets the Unlocked FM synthesis mode to wide or narrow mode of operation. The Unlocked Wide FM synthesis mode allows maximum deviations of ±100 MHz for DC to 100 Hz rates. The Unlocked Narrow FM synthesis mode allows maximum deviations of ±10 MHz for DC to 8 MHz rates. Parameters: MIN | MAX Range: MIN = narrow mode; MAX = wide mode Default: MIN

Raises:

ValueError – Error message

Return type:

None.

set_fm_internalFreq(value, unit)[source]
valueint/float

Range: 0.1 Hz to 1 MHz for sine wave

unitstr

Parameters: Frequency Description: Sets the frequency of the modulating waveform for the internal FM function (see :FM:INTernal:WAVE). Default: 1 kHz

Raises
ValueError

Error message

None.

set_fm_internalWave(state)[source]
Parameters:

state (str) – Description: Selects the modulating waveform (from the internal FM generator) for the internal FM function, as follows: SINE = Sine wave GAUSsian = Gaussian noise RDOWn = Negative ramp RUP =Positive ramp SQUare = Square wave TRIangle = Triangle wave UNIForm = Uniform noise Parameters: SINE | GAUSsian | RDOWn | RUP | SQUare | TRIangle | UNIForm Default: SINE

Raises:

ValueError – Error message

Return type:

None.

set_fm_mode(state)[source]
Parameters:

state (str) – Description: Sets the synthesis mode employed in generating the FM signal, as follows: LOCKed[1] = Locked Narrow FM LOCKed2 = Locked Narrow Low-Noise FM UNLocked = Unlocked FM If LOCKed[1] or LOCKed2 is set, the YIG phase-locked loop is used in synthesizing the FM signal. If UNLocked is set, the YIG phase-lock loop is disabled and the FM signal is obtained by applying the modulating signal to the tuning coils of the YIG-tuned oscillator. Parameters: LOCKed[1] | LOCKed2 | UNLocked Default: UNLocked

Raises:

ValueError – Error message

Return type:

None.

set_fm_steta(state)[source]
Parameters:

state (str/int) – Description: Enable/disable frequency modulation of MG369xC RF output signal. Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – Error message

Return type:

None.

set_freq_CW(value, unit)[source]
Parameters:
  • value (int/float) –

    Description: Sets the RF output frequency of the MG369xC to the value entered. Parameters UP | DOWN increment/decrement the frequency by the value set by [:SOURce]:FREQuency:STEP:INCRement command. Parameters: Frequency (in Hz) | UP | DOWN | MIN | MAX Range: MIN to MAX (see note below) Default: (MIN + MAX) / 2

    Model Minimum Frequency* Maximum Frequency MG3691C 10 MHz 10 GHz MG3692C 10 MHz 20 GHz MG3693C 10 MHz 31.8 GHz MG3694C 10 MHz 40 GHz MG3695C 10 MHz 50 GHz MG3697C 10 MHz 70 GHz

  • unit (str) – Parameter Frequency.

Return type:

None.

set_freq_cent(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets the MG369xC RF output center frequency to the value entered. :CENTER and :SPAN frequencies are coupled values. Entering the value for one will cause the other to be recalculated. (See notes under :FREQuency:SPAN)

  • unit (str) – Parameters: Frequency (in Hz)

Raises:

ValueError – Error message

Return type:

None.

set_freq_mode(state)[source]
Parameters:

state (str) –

Description: Specifies which command subsystem controls the MG369xC frequency, as follows: CW|FIXed = [:SOURce]:FREQuency:CW|FIXed SWEep[1] = [:SOURce]:SWEep[1] (see Datasheet) SWCW = (see notes) ALSW = (see notes) LIST<n> = [:SOURce]:LIST<n> (see DataSheet) :SWEep and :SWEep1may be used interchangeably

Parameters: CW | FIXed | SWEep[1] | SWCW | ALSW | LIST[1] | LIST2 | LIST3 | LIST4 Default: CW

Raises:

ValueError – Error message

Return type:

None.

set_freq_span(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets sweep span for SWEep[1] to value entered. :SPAN and :CENTer are coupled values Range: 1 kHz to (MAX MIN) Default: MAX MIN

  • unit (str) – Parameters: Frequency (in Hz)

Raises:

ValueError – Error message

Return type:

None.

set_freq_start(value, unit)[source]
Parameters:
  • value (int/float) –

    Description: Sets start frequency for SWEep[1] to the value entered. (MIN is defined in the notes

    Range: MIN to MAX Default: MIN

  • unit (str) – Parameters: Frequency (in Hz) | MIN

Raises:

ValueError – Error message

Return type:

None.

set_freq_step(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets the step increment size used with the :FREQuency:CW command. Range: 0.01 Hz to (MAX MIN) Default: 0.1 GHz

  • unit (str) – Parameters: Frequency (in Hz)

Raises:

ValueError – Error message

Return type:

None.

set_freq_stop(value, unit)[source]
Parameters:
  • value (int/float) – Description: Sets stop frequency for SWEep[1] to the value entered. (MAX is defined in the notes under [:SOURce]:FREQuency:CW|FIXed). Range: MIN to MAX Default: MAX

  • unit (str) – Parameters: Frequency (in Hz) | MAX

Raises:

ValueError – Error message

Return type:

None.

set_output(state)[source]
Parameters:

state (str/int) – Description: Turns MG369xC RF output power on/off. Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – Error message

Return type:

None.

set_output_protection(state)[source]
Parameters:

state (str/int) – Description: ON causes the MG369xC RF output to be turned off (blanked) during frequency changes in CW or step sweep mode. OFF leaves RF output turned on (un blanked). Parameters: ON | OFF | 1 | 0 Default: ON

Raises:

ValueError – Error message

Return type:

None.

set_output_retrace(state)[source]
Parameters:

state (str/int) – Description: ON causes the MG369xC RF output to be turned off during sweep retrace. OFF leaves RF output turned on Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – Error message

Return type:

None.

set_pm_Bwidth(state)[source]
Parameters:

state (str) – Description: Selects the phase modulation (ΦM) operating mode. The Narrow ΦM mode allows maximum deviations of ±3 radians for DC to 8 MHz rates. The Wide ΦM mode allows maximum deviations of ±400 radians for DC to 1 MHz rates. Parameters: MIN | MAX Range: MIN = narrow mode MAX = wide mode Default: MIN

Raises:

ValueError – Error message

Return type:

None.

set_pm_internalFreq(value, unit)[source]
Parameters:
  • value (str) – Parameter: Frequency (in Hz)

  • unit (int/float) – Description: Sets the frequency of the modulating waveform for the internal phase modulation (see :PM:INTernal:WAVE) Range: 0.1 Hz to 1 MHz for sine wave; 0.1 Hz to 100 kHz for square, triangle, and ramp waveforms. Default: 1 kHz

Raises:

ValueError – Error message

Return type:

None.

set_pm_internalWave(state)[source]
Parameters:

state (str) – Description: Selects the modulating waveform (from the internal ΦM generator) for the internal phase modulation function, as follows: SINE = Sine wave GAUSsian = Gaussian noise RDOWn = Negative ramp RUP = Positive ramp SQUare = Square wave TRIangle = Triangle wave UNIForm = Uniform noise Parameters: SINE | GAUSsian | RDOWn | RUP | SQUare | TRIangle | UNIForm Default: SINE

Raises:

ValueError – Error message

Return type:

None.

set_pm_state(state)[source]
Parameters:

state (str/int) – Description: Enable/disable phase modulation of the MG369xC RF output signal. Parameters: ON | OFF | 1 | 0 Default: OFF

Raises:

ValueError – v

Return type:

None.

write(message, encoding='utf-8')[source]

Write string to instrument

Rohde and Schwarz Signal Generator SMA100B module

” Created on Fir Feb 02 13:00:00 2024

@author: mweizel

class SMA100B.SMA100B(hostname)[source]

Bases: Instrument

A class thats uses vxi11 library to interface a SMA100B Need to have python ‘vxi11’ library installed!

Close()[source]
act_DCOffset(state)[source]
Return type:

Activates a DC offset.

ask_OutputImpedance()[source]
Returns:

Queries the impedance of the RF outputs.

Return type:

TYPE

getIdn()[source]
Returns:

DESCRIPTION.

Return type:

TYPE

query(message)[source]
reset()[source]
set_CMOS_Voltage(value)[source]
Parameters:

value (int/float) – Sets the voltage for the CMOS signal. Range: 0.8 to 2.7 Increment: 0.001

Raises:

ValueError – Wrong range Error.

Return type:

None.

set_ClockSigPhase(value)[source]
Parameters:

value (int/float) – Shifts the phase of the generated clock signal. Range: -36000 to 36000 Increment: 0.1

Raises:

ValueError – Wrong Value Error.

Return type:

None.

set_DCOffset(value)[source]
Parameters:

value (int/float) – Sets the value of the DC offset. Range: -5 to 5 Increment: 0.001

Return type:

None.

set_OutputPowerLevel(value)[source]

Sets the Signal Generator Output Power in dBm

Parameters:

value (float) – Output Power in dBm

set_freq_CW(value, unit)[source]
Parameters:
  • value (int/float) – Parameter Frequency

  • unit (str) – Frequency Unit: ‘GHz’ or ‘MHz’

Return type:

None.

set_frequency_mode(MODE)[source]
Parameters:

MODE (str) –

<Mode> CW | FIXed | SWEep | LIST | COMBined

CW|FIXed

Sets the fixed frequency mode. CW and FIXed are synonyms. The instrument operates at a defined frequency.

SWEep

Sets sweep mode. The instrument processes frequency (and level) settings in defined sweep steps.

LIST

Sets list mode. The instrument processes frequency and level settings by means of values loaded from a list.

COMBined

Sets the combined RF frequency / level sweep mode. The instrument processes frequency and level settings in defined sweep steps.

set_output(value)[source]

Activates the Signal Genrator RF Output

Parameters:

value (str/int) – ‘ON’ 1 or ‘OFF’ 0

Raises:

ValueError – Valid values are: ‘ON’, ‘OFF’, 1, 0

set_rf_output(value)[source]

Activates the Signal Genrator RF Output

Parameters:

value (str/int) – ‘ON’ 1 or ‘OFF’ 0

Raises:

ValueError – Valid values are: ‘ON’, ‘OFF’, 1, 0

set_rf_output_all(value)[source]

Activates all Signal Genrator RF Outputs

Parameters:

value (str/int) – ‘ON’ 1 or ‘OFF’ 0

Raises:

ValueError – Valid values are: ‘ON’, ‘OFF’, 1, 0

set_rf_power(value)[source]

Sets the Signal Generator Output Power in dBm

Parameters:

value (float) – Output Power in dBm

Anritsu Vectro Analyzer MS4647B module

Created on Mon Dec 13 10:40:31 2021

@author: Martin.Mihaylov

class MS4647B.MS4647B(resource_str)[source]

Bases: object

This function is using pyvisa to connect to Instruments. Please install PyVisa before using it.

Close()[source]
DeleteData(name, portNumb)[source]
Parameters:
  • name (str) – File Name

  • portNumb – The N(ports number) for the .sNp data output. Delete a disk, file, or directory. Use caution with this command as there is no recovery operation in case of a user mistake or error. No query

Return type:

None.

DeleteDataCSV(name)[source]
Parameters:
  • name (str) – File Name

  • portNumb – The N(ports number) for the .sNp data output. Delete a disk, file, or directory. Use caution with this command as there is no recovery operation in case of a user mistake or error. No query

Return type:

None.

RTL()[source]
Returns:

  • None.

  • Description (Send all devices to local operation. No query)

SaveData(name, portNumb)[source]
Parameters:
  • name (str) – File Name

  • portNumb – The N(ports number) for the .sNp data output. Description: Stores a data file of the type specified by the filename extension.No query.

Return type:

None.

SaveDataCSV(name)[source]
Parameters:
  • name (str) – File Name

  • portNumb – The N(ports number) for the .sNp data output. Description: Stores a data file of the type specified by the filename extension.No query.

Return type:

None.

SaveImage(name)[source]
Parameters:
  • name (str) – File Name

  • portNumb – The N(ports number) for the .sNp data output. Description: Stores a data file of the type specified by the filename extension.No query.

Return type:

None.

SaveTransferData(file, path, name, portNumb)[source]
Parameters:
  • file (str) – File data extracted from function ask_TransferData

  • path (str) – Where on the PC to save the data

  • name (str) – Name of the File

  • portNumb (int/str) –

    The N(ports number) for the .sNp data output.

    Write a text File with the transferred data

Return type:

None.

SaveTransferDataCSV(file, path, name)[source]
Parameters:
  • file (str) – File data extracted from function ask_TransferData

  • path (str) – Where on the PC to save the data

  • name (str) – Name of the File

  • portNumb (int/str) –

    The N(ports number) for the .sNp data output.

    Write a text File with the transferred data

Return type:

None.

ask_AssignetDataPort(value)[source]
Parameters:

value (int/float) – the N(ports number) for the .sNp data output.

Raises:

ValueError – Error message

Returns:

TYPE – Outputs the data port pair assigned to use when creating an sNp data file on the indicated channel.

Return type:

str

ask_AverageCount(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

TYPE – Outputs the averaging count for the indicated channel.

Return type:

float

ask_AverageFunctionType(ChanNumber)[source]

Parameters

Raises:

ValueError – Error message

Returns:

TYPE – Outputs the averaging function type of point-by-point or sweep-by-sweep.

Return type:

str

ask_CWFreq(ChanNumber)[source]

Parameters

Raises:

ValueError – Error message

Returns:

TYPE – Sets the CW frequency of the indicated channel. Outputs the CW frequency of the indicated channel.

The output parameter is in Hertz.

Return type:

float

ask_CenterFreq(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

TYPE – Optional query. Center frequency is automatically calculated using Stop Frequency and Start Frequency as:

Fc = ((Fstop - Fstart)/2) + Fstart

Return type:

float

ask_DataFreq(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

TYPE – Outputs the frequency list for the indicated channel

Return type:

str

ask_DisplayCount()[source]
Returns:

Query the number of displayed channels.

Return type:

TYPE

ask_DisplayTitle()[source]
Returns:

Outputs the user title for the channel indicated

Return type:

TYPE

ask_DisplayTrace()[source]
Returns:

Query only. Outputs the Active Channel number.

Return type:

TYPE

ask_FreqSpan(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

TYPE – Optional query. Span is automatically calculated as Stop Frequency minus Start Frequency. The query returns the resulting span in Hertz.

Return type:

float

ask_ParamFormInFile()[source]

Outputs the parameter format displayed in an SNP data file.

ask_PowerOnPort(segment, ChanNumber)[source]
Parameters:
  • segment (int) – Selected Source. Can be from 1-16

  • ChanNumber (int) – Channel Number 1,2,3…

Returns:

Value – Outputs the power level of the indicated port on the indicated channel.

Return type:

float

ask_RFState()[source]
Returns:

TYPE – Outputs the RF on/off state in Hold

Return type:

str

ask_ResolutionBW(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Returns:

TYPE – The command sets the IF bandwidth for the indicated channel. The query outputs the IF bandwidth for the indicated channel.

Return type:

float

ask_SelectParameter()[source]
Return type:

The query outputs only the selected parameter.

ask_SetAverageState(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

TYPE – Outputs the averaging function on/off status on the indicated channel.

Return type:

str

ask_SmoothingState(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Returns:

Query outputs the smoothing on/off status for the indicated channel and active trace. 1 = ON 2 = OFF

Return type:

TYPE

ask_StatOperation()[source]
Returns:

Description: Query only. Outputs the value of the operation status condition reg. Range: 0 to 32767 Default Value: 0

Return type:

TYPE

ask_StatOperationRegister()[source]
Returns:

Sets the value of the operation status enable register. Outputs the value of the operation status enable register.

Return type:

TYPE str

ask_SubSystem()[source]
Returns:

The :SENSe:HOLD subsystem command sets the hold function for all channels on a per-instrument basis

Return type:

TYPE str

ask_SweepChannelStatus()[source]
Returns:

TYPE – The query outputs the On/Off state of the option to sweep only the active channel

Return type:

str

ask_SweepCount(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

Description: Query only. Outputs the averaging sweep count for the

indicated channel.

Return type:

TYPE

ask_SweepDelay()[source]
Return type:

Outputs the sweep delay time of the indicated channel.

ask_SweepTime()[source]
Return type:

Outputs the Sweep Time of the indicated channel.

ask_SysErrors()[source]
Returns:

Description: Query only. Outputs the number of errors in the error queue.

Return type:

TYPE

ask_TestSet(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

Query State of TS3739.

Return type:

TYPE

ask_TransferData(name, portNumb)[source]
Parameters:
  • name (str) – File Name

  • portNumb (int) – the N(ports number) for the .sNp data output.

Returns:

TYPE – The query outputs the disk file data to the GPIB. The file must exist

Return type:

str

Hard coded path on the VNA = ‘C:/tmp/’

ask_TransferDataCSV(name)[source]
Parameters:

name (str) – File Name

Returns:

TYPE – The query outputs the disk file data to the GPIB. The file must exist

Return type:

str

Hard coded path on the VNA = ‘C:/tmp/’

getIdn()[source]
Returns:

Device Serial Number and Model

Return type:

TYPE str

query(message)[source]
set_AssignetDataPort(ChanNumber, value1, value2)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value1 (int)

  • value2 (int) –

    The command assigns the data port pair to use when creating an sNp data file on the indicated channel. The use of Port 3 and/or Port 4 requires a 4-port VNA instrument

    PORT12 | PORT13 | PORT14 | PORT23 | PORT24 | PORT34

Raises:

ValueError – Error message

Return type:

None.

set_AverageCount(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int) – Sets the averaging count for the indicated channel. The channel must be turned on. The input parameter is a unitless number. Range: 1 to 1024 Default Value: 1

Raises:

ValueError – Error message

Return type:

None.

set_AverageFunctionType(ChanNumber, state)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • state (str) – Sets the averaging function type to point-by-point or sweep-by-sweep. POIN | SWE Default Value: POIN

Raises:

ValueError – Error message

Return type:

None.

set_CWFreq(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9) – Sets the CW frequency of the indicated channel. Outputs the CW frequency of the indicated channel.

Raises:

ValueError – Error message

Return type:

None.

set_CenterFreq(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9) – Sets the center value of the sweep range of the indicated channel. Outputs the center value of the sweep range of the indicated channel

Raises:

ValueError – Error message

Return type:

None.

set_ClearAverage(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3… Description: Clears and restarts the averaging sweep count of the indicated channel.

Raises:

ValueError – Error message

Return type:

None.

set_ClearError()[source]
Returns:

  • None.

  • Description (Clears the contents of the error queue.)

set_DisplayColorReset()[source]
Returns:

  • None.

  • Resets all colors and inverted colors to their normal default values.

set_DisplayCount(ChannelNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

  • None (Sets the number of displayed channels. When the VNA is in 25,000 point mode, the)

  • number of channels can only be 1 (one), 2, 3, 4, 6, 8, 9, 10, 12, or 16 channels. If the

  • channel display is set to a non-listed number (5, 7, 11, 13, 14, 15), the instrument is set to

  • the next higher channel number. If a number of greater than 16 is entered, the

  • instrument is set to 16 channels. If the instrument is set to 100,000 points, any input

  • results in 1 (one) channel. Outputs the number of displayed channels.

set_DisplayScale()[source]
Returns:

  • None.

  • Description (Auto scales all traces on all channels.)

set_DisplayTitle(ChannelName)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

None

Return type:

Sets the user title for the channel indicated.

set_DisplayTrace(ChanNumber)[source]
Parameters:

ChanNumber (int) – Channel Number 1,2,3…

Raises:

ValueError – Error message

Returns:

  • The command sets the active channel to the indicated number. When the VNA is set to

  • 100,000 point mode, the number of channels is

set_ParamFormInFile(unit)[source]
Parameters:

unit (str) –

Sets the parameter format displayed in an SNP data file. Where:

  • LINPH = Linear and Phase

  • LOGPH = Log and Phase

  • REIM = Real and Imaginary Numbers

Raises:

ValueError – Error message

Return type:

None.

set_PowerOnPort(segment, ChanNumber, value)[source]
Parameters:
  • segment (int) – Selected Source. Can be from 1-16

  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/floa/str) – Sets the power level of the indicated port on the indicated channel.

Raises:

ValueError – Error message

Return type:

None.

set_RFState(state)[source]
Parameters:

state (str/int) – Sets the RF on/off state in Hold.

Raises:

ValueError – Error message

Return type:

None.

set_ResolutionBW(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/floa/str) – The command sets the IF bandwidth for the indicated channel. The query outputs the IF bandwidth for the indicated channel.

Raises:

ValueError – Error message

Return type:

None.

set_SelectParameter(S_Param)[source]
Parameters:

S_Param (str) – S-Parameter selected.

Raises:

ValueError – Error message

Returns:

None

Return type:

Select an S-Parameter. 16 S-Parameters for 4 Ports config can be selected.

set_SetAverageState(ChanNumber, state)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • state (int/str) – Turns averaging on/off for the indicated channel (Turns on and Off the averaging for all channels).

Raises:

ValueError – Error message

Return type:

None.

set_SmoothingAPERture(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int) – Percentage smoothing between 0 to 100

Raises:

ValueError – Error message

Return type:

The command sets the smoothing aperture for the indicated channel and active trace.

set_SmoothingState(ChanNumber, state)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • state (str/int) – can be int or str form the list [‘ON’,’OFF’,1,0]

Raises:

ValueError – Error message

Return type:

The command sets the smoothing aperture for the indicated channel and active trace.

set_StartFreq(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9) – Sets the start value of the sweep range of the indicated channel. The input parameter is in Hertz, Meters, or Seconds.

Raises:

ValueError – Error message

Return type:

None.

set_StatOperationRegister(value)[source]
Parameters:

value (TYPE) –

Sets the value of the operation status enable register. Outputs the value of the operation status enable register. The input parameter is a unitless number.

Range: 0 to 65535

Return type:

None.

set_StopFreq(ChanNumber, value)[source]
Parameters:
  • ChanNumber (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9) – Sets the stop value of the sweep range of the indicated channel. The input parameter is in Hertz, Meters, or Seconds.

Raises:

ValueError – Error message

Return type:

None.

set_SubSystemCont()[source]
Returns:

  • None.

  • The sweep is sweeping continuously

set_SubSystemHold()[source]
Returns:

  • None.

  • Sets the hold function for all channels on a per-instrument basis.

  • The sweep is stopped.

set_SubSystemSing()[source]
Returns:

  • None.

  • The sweep restarts and sweeps until the end of the

  • sweep, at which point it sets the end of sweep status bit and

  • stops.

set_SweepChannelStatus(state)[source]
Parameters:

state (str/int) – The command turns On/Off the option to sweep only the active channel

Raises:

ValueError – Error message

Return type:

None.

set_SweepDelay(time)[source]
Parameters:

time (float) – Sets the sweep delay time of the indicated channel.

Return type:

None.

set_SweepTime(time)[source]
Parameters:

time (float) – Sets the Sweep Time of the indicated channel.

Return type:

None.

set_TS3739(ChanNumber, state)[source]
Parameters
ChanNumberint

Channel Number 1,2,3…

statestr/int

The :SENSe{1-16}:TS3739 subsystem commands are used to configure and control the VectorStar ME7838x Broadband/Millimeter-Wave 3738A Test Set.

ValueError

Error message

None.

write(message)[source]

Yokogawa Optical Spectrum Analyzer AQ6370D module

Created on Tue Dec 14 12:58:27 2021

@author: Martin.Mihaylov

class AQ6370D.AQ6370D(hostname)[source]

Bases: Instrument

This class uses vxi11 library to connect to a Yokogawa AQ6370D. Need to have python ‘vxi11’, ‘pandas’ and ‘numpy’ libraries installed!

Close()[source]
StartSweep()[source]

Makes a sweep

Stop()[source]
Returns:

OSA.ask_SweepMode()

Return type:

None.

ask_AverageCount()[source]
Returns:

Queries the number of times averaging for each measured point.

Return type:

float

ask_BWResolution()[source]
Returns:

Queries the measurement resolution.

Return type:

float

ask_CenterWavelenght()[source]
Returns:

Queries the synchronous sweep function.

Return type:

float

ask_CentralWavelenght()[source]
Returns:

Queries the center wavelength of the X-axis of the display scale

Return type:

str

ask_DataFormat()[source]
Returns:

Queries the format used for data transfer via GP-IB.

ASCii = ASCII format (default) REAL[,64] = REAL format (64bits) REAL,32 = REAL format (32bits)

Return type:

str

ask_DisplayAutoY()[source]
Returns:

Queries the automatic setting function of the subscale of the level axis. Response 0 = OFF, 1 = ON

Return type:

str

ask_DisplayYUnit()[source]
Returns:

Queries the units of the main scale of the level axis. DBM = dBm W = W DBM/NM = dBm/nm or dBm/THz W/NM = W/nm or W/THz Response 0 = dBm

1 = W 2 = DBM/NM 3 = W/NM

Return type:

str

ask_SamplePoints()[source]
Returns:

Queries the number of samples measured

Return type:

float

ask_SamplePointsAuto()[source]
Returns:

Queries the function of automatically setting the sampling number to be measured

Response 0 = OFF, 1 = ON

Return type:

str

ask_SegmentPoints()[source]
Returns:

Queries the number of sampling points to be measured at one time when performing SEGMENT MEASURE.

Return type:

float

ask_Sensitivity()[source]
Returns:

Queries the measurement sensitivity.

Return type:

str

ask_Span()[source]
Returns:

Queries the measurement condition measurement span.

Return type:

float

ask_SweepMode()[source]
Returns:

Queries the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]

Return type:

str

ask_SweepSpeed()[source]
Returns:

Queries the sweep speed 1x|0: Standard 2x|1: Twice as fast as standard

Return type:

str

ask_TraceActive()[source]
Returns:

Queries the trace to be transferred.

Outputs - (TRA|TRB|TRC|TRD|TRE|TRF|TRG)

Return type:

str

ask_TraceAttribute(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. sState = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Returns:

Queries the attributes of the specified trace [‘WRITe’,’FIX’,’MAX’,’MIN’,’RAVG’,’CALC’] WRITe = WRITE FIX = FIX MAX = MAX HOLD MIN = MIN HOLD RAVG = ROLL AVG CALC = CALC

Return type:

str

ask_TraceDataX(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]

Raises:

ValueError – Error message

Returns:

Queries the wavelength axis data of the specified trace.

Return type:

list of floats

ask_TraceDataY(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]

Raises:

ValueError – Error message

Returns:

data – Queries the level axis data of specified trace.

Return type:

list of floats

ask_TraceResolution(state)[source]
Parameters:

state (str) – Trace selected - [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Returns:

Queries the actual resolution data of the specified trace.

Return type:

list of floats

ask_TraceState()[source]
Returns:

Queries the display status of the specified trace.

Return type:

str

ask_UnitX()[source]
Returns:

Queries the units for the X axis.

Return type:

str

For AQ6370C, AQ6373 or AQ6373B WAVelength = Wavelength FREQuency = Frequency

ask_WavelengthStart()[source]
Returns:

Queries the measurement condition measurement start wavelength

Return type:

float

ask_WavelengthStop()[source]
Returns:

Queries the measurement condition measurement start wavelength

Return type:

float

get_Data(state)[source]

Get data on X and Y Traces from OSA. Data Output is CST File. Data is Saved in X Column and Y Column state = ‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’

get_ParamsOSA()[source]
Returns:

Parameters set on the Yokogawa AQ6370D

Return type:

srt

print_ParamsOSA()[source]
Returns:

Parameters set on the Yokogawa AQ6370D

Return type:

srt

query(message)[source]
set_AverageCount(value)[source]
Parameters:

value (int) – Set the number of times averaging for each measured point.

Return type:

None.

set_BWResolution(value, unit)[source]
Parameters:
  • value (int/float) – Set the measurement resolution.

  • unit (str) – sUnit = [‘M’,’HZ’]

Raises:

ValueError – Error message

Return type:

None.

set_CenterWavelenght(value, unit)[source]
Parameters:
  • value (int/float) – Set the center wavelength of the X-axis of the display scale

  • unit (str) – Units = [‘M’,’HZ’]

Raises:

ValueError – Error message

Return type:

None.

set_DataFormat(unit)[source]
Parameters:

unit – sUnit = [‘ASCii’, ‘REAL[,64]’, ‘REAL,32’]

Raises:

ValueError – Error message

Return type:

None.

set_DisplayYUnit(state)[source]
Parameters:

state (str) – Set the units of the main scale of the level axis [‘dBm’,’W’,’DBM/NM’,’W/NM’]

Raises:

ValueError – Error message

Return type:

None.

set_SamplePoints(value)[source]
Parameters:

value (int) – Set the number of samples measured

Return type:

None.

set_SamplePointsAuto(state)[source]
Parameters:

state (str) – Set the function of automatically setting the sampling number to be measured [‘ON’|’OFF’]

Raises:

ValueError – Error message

Return type:

None.

set_SegmentPoints(value)[source]
Parameters:

value (int) – Set the number of sampling points to be measured at one time when performing SEGMENT MEASURE.

Return type:

None.

set_Sensitivity(unit)[source]
Parameters:

unit (str) –

Set the measurement sensitivity.

NHLD = NORMAL HOLD NAUT = NORMAL AUTO NORMal = NORMAL MID = MID HIGH1 = HIGH1 or HIGH1/CHOP HIGH2 = HIGH2 or HIGH2/CHOP HIGH3 = HIGH3 or HIGH3/CHOP

Raises:

ValueError – Error message

Return type:

None.

set_Span(value, unit)[source]
Parameters:
  • value (int/float) – Set the measurement span.

  • unit (str) – sUnits = [‘M’,’HZ’]

Return type:

None.

set_SweepMode(state)[source]
Parameters:

state (str) – Set the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]

Raises:

ValueError – Error message

Return type:

None.

set_SweepSpeed(value)[source]
Parameters:

value (int) – Set the sweep speed. 1 - Standard 2 - Twice as fast as standard

Return type:

None.

set_TraceActive(state)[source]
Parameters:

state (str) – Sets the active trace. sState = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Return type:

None.

set_TraceAttribute(trace, state)[source]
Parameters:
  • trace (str) – Sets the active trace. sState = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

  • state (str) –

    Set the attributes of the specified trace [‘WRITe’,’FIX’,’MAX’,’MIN’,’RAVG’,’CALC’]

    WRITe = WRITE FIX = FIX MAX = MAX HOLD MIN = MIN HOLD RAVG = ROLL AVG CALC = CALC

Raises:

ValueError – Error message

Return type:

None.

set_UnitX(unit)[source]
Parameters:

unit (str) – Set the units for the X axis. sUnit = [‘WAV’,’FREQ’,’WNUM’]

Raises:

ValueError – Error message

Return type:

None.

set_WavelengthStart(value, unit)[source]
Parameters:
  • value (int/float) – Set the measurement condition

  • unit (str) – units - [M|HZ].

Raises:

ValueError – Error message

Return type:

None.

set_WavelengthStop(value, unit)[source]

Set the measurement condition measurement stop wavelength

[M|HZ]

Power Meter ThorLabs PM100D module

Created on Thu Dec 2 08:27:01 2021

@author: MartinMihaylov

class PM100D.PM100D(resource_str)[source]

Bases: object

This Class is using pyvisa to connect to instruments. Please install PyVisa before using it.

Abort()[source]
Returns:

Abort measurement

Return type:

None.

Close()[source]
ConfigCurrent()[source]
Returns:

Configure for current measurement

Return type:

None.

ConfigEnergy()[source]
Returns:

Configure for energy measurement

Return type:

None.

ConfigEnergyDensity()[source]
Returns:

Configure for energy density measurement

Return type:

None.

ConfigFreq()[source]
Returns:

Configure for frequency measurement

Return type:

None.

ConfigPower()[source]
Returns:

Configure for power measurement

Return type:

None.

ConfigPowerDensity()[source]
Returns:

Configure for power density measurement

Return type:

None.

ConfigResistance()[source]
Returns:

Configure for sensor presence resistance measurement

Return type:

None.

ConfigTemp()[source]
Returns:

Configure for sensor temperature measurement

Return type:

None.

ConfigVoltage()[source]
Returns:

Configure for voltage measurement

Return type:

None.

DefaultPowerMeas(WaveLength)[source]
Returns:

Performs a power measurement whit hard codded parameter!.

Return type:

TYPE Data from the measurement

DefaultPowerMeas_W(WaveLength)[source]
Returns:

Performs a power measurement whit hard codded parameter!.

Return type:

TYPE Data from the measurement

DisplayParam(Type)[source]
Parameters:

Type (str) – This function will print all the adjusted parameters. Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]

Return type:

None.

DisplayParamDict(Type)[source]
Parameters:

Type (str) – This function will print all the adjusted parameters. Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]

Returns:

  • Headers (str) – String with [‘Power’,’Energy’,’Current’,’Voltage’]

  • Data (list) – Data from the instrument.

  • Params (list) – List with str for different data that are extracted from the instrument.

Init()[source]
Returns:

Start measurement

Return type:

None.

MeasCurrent()[source]
Returns:

Performs a current measurement

Return type:

None.

MeasEnergy()[source]
Returns:

Performs a energy measurement

Return type:

None.

MeasEnergyDensity()[source]
Returns:

Performs a energy density measurement

Return type:

None.

MeasFreq()[source]
Returns:

Performs a frequency measurement

Return type:

None.

MeasPower()[source]
Returns:

Perform Power meas

Return type:

None.

MeasPowerDensity()[source]
Returns:

Performs a power density measurement

Return type:

None.

MeasResistance()[source]
Returns:

Performs a sensor presence resistance measurement

Return type:

None.

MeasTemp()[source]
Returns:

Performs a sensor temperature measurement

Return type:

None.

MeasVoltage()[source]
Returns:

Performs a voltage measurement

Return type:

None.

OPC()[source]
Returns:

Query the OPC value

Return type:

TYPE str

PowerMeas()[source]
Returns:

data – Performs a power measurement

Return type:

Data from the Measurement

PowerSpecifications()[source]
Returns:

Return Instrument parameters

Return type:

None.

ReadConfig()[source]
Returns:

Query the current measurement configuration

Return type:

None

adjustCurrentRange()[source]
Returns:

Adjust the Voltage Measurement

Return type:

None.

adjustEnergyMeas()[source]
Returns:

Adjust the Energy Measurement

Return type:

None.

adjustPowerMeas()[source]
Returns:

Adjust the power measurement

Return type:

None.

adjustVoltageRange()[source]
Returns:

Adjust the Voltage Measurement

Return type:

None.

ask_AdapterType()[source]
Returns:

Queries default sensor adapter type

Return type:

TYPE str

ask_AutoCurrentRange()[source]
Returns:

Queries the auto-ranging function state

Return type:

TYPE str

ask_AutoPowerRange()[source]
Returns:

status – Queries the auto-ranging function state

Return type:

print massage str

ask_AutoVoltageRange()[source]
Returns:

Queries the auto-ranging function state

Return type:

TYPE str

ask_Average()[source]
Returns:

Queries the averaging rate

Return type:

TYPE str

ask_BeamDiameter()[source]
Returns:

Queries the beam diameter

Return type:

TYPE str

ask_PDPower()[source]
Returns:

Queries the photodiode response value.

Return type:

TYPE str

ask_PowerRange()[source]
Returns:

Queries the power range.

Return type:

TYPE str

ask_PowerUnits()[source]
Returns:

Queries the power unit

Return type:

TYPE str

ask_Pyro()[source]
Returns:

Queries the pyro-detectr response value

Return type:

TYPE str

ask_Thermopile()[source]
Returns:

Queries the thermopile response value

Return type:

TYPE str

ask_Wavelength()[source]
Returns:

Queries the operation wavelength

Return type:

TYPE str

ask_beeper()[source]
Returns:

Return the state of the beeper

Return type:

Type print str

ask_calibration()[source]
Returns:

Returns a human readable calibration string. This is a query only command. The response is formatted as string response data.

Return type:

TYPE str

ask_currentRange()[source]
Returns:

Queries the actual current range

Return type:

TYPE str

ask_energyRange()[source]
Returns:

Queries the energy range

Return type:

TYPE str

ask_freqRange(state)[source]
Parameters:

state (str) – Queries the frequency range. Can be [‘MAX’,’MIN’]

Raises:

ValueError – Error message.

Returns:

Queries the frequency range

Return type:

TYPE

ask_voltRange()[source]
Returns:

Queries the current voltage range

Return type:

TYPE str

fetchData()[source]
Returns:

Read last measurement data. WILL NOT START THE MEASUREMENT

Return type:

TYPE float

query(message)[source]
self_test()[source]
Returns:

Use this query command to perform the instrument self-test routine. The command places the coded result in the Output Queue. A returned value of zero (0) indicates that the test passed, other values indicate that the test failed.

Return type:

TYPE

set_AdapterType(state)[source]
Parameters:

state (str) –

Sets default sensor adapter type:

Allow senor types are: [‘PHOTodiode’,’THERmal’,’PYRo’]

Raises:

ValueError – Error message.

Return type:

None.

set_AutoCurrentRange(state)[source]
Parameters:

state (str) – Switches the auto-ranging function on and off. Can be set to [‘ON’,’OFF’,1,0].

Raises:

ValueError – Error message.

Return type:

None.

set_AutoPowerRange(state)[source]
Parameters:

state – Switches the auto-ranging function on and off. Can be set to [‘ON’,’OFF’,1,0].

Return type:

None.

set_AutoVoltageRange(state)[source]
Parameters:

state (str/int) – witches the auto-ranging function on and off. Can be [‘ON’,’OFF’,1,0]

Raises:

ValueError – Error message.

Return type:

None.

set_Average(value)[source]
Parameters:

value (float) – Sets the averaging rate (1 sample takes approx. 3ms)

Return type:

None.

set_PD(state)[source]
Parameters:

state (str/int) –

Sets the bandwidth of the photodiode input stage.

Can be [‘ON’,’OFF’,1,0]

Raises:

ValueError – Error message.

Returns:

DESCRIPTION.

Return type:

TYPE

set_Parameters(Type)[source]
Parameters:

Type (str) – This function will set the measurement parameters. Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]

Return type:

None.

set_PowerRange(value)[source]
Parameters:

value (float) – Sets the current range in W

Raises:

ValueError – Error message.

Return type:

None.

set_PowerUnits(state)[source]
Parameters:

state (str) – Sets the power unit W or dBm. Can be [‘W’,’dBm’].

Raises:

ValueError – Error message.

Return type:

None.

set_WaveLength(value)[source]
Parameters:

value (float) – Sets the operation wavelength in nm.

Return type:

None.

set_currentRange(value)[source]
Parameters:

value (float) – Sets the current range in A.

Raises:

ValueError – Error message.

Return type:

None.

set_energyRange(value)[source]
Parameters:

value (float) – Sets the voltage range in J

Raises:

ValueError – Error message.

Return type:

None.

set_voltageRange(value)[source]
Parameters:

value (float) – Sets the voltage range in V

Raises:

ValueError – Error message.

Return type:

None.

write(message)[source]

KEITHLEY Source Meter 2612 module

Created on Fri Dec 10 08:39:48 2021

@author: Martin.Mihaylov

class KEITHLEY2612.KEITHLEY2612(resource_str)[source]

Bases: object

This function is using pyvisa. Please install PyVisa before you use it.

Close()[source]
Reset(chan)[source]
Parameters:

chan (str) – Select Channel A or B and restore to default channel settings.

Raises:

ValueError – Error message

Return type:

None.

ask_Current(chan: str) float[source]

This function performs one current measurements and returns the value.

Parameters:

chan (str) – Select channel A or B

Raises:

ValueError – Error message

Returns:

Return float with the measured current value on the channel.

Return type:

TYPE float

ask_LimitReached(chan: str) bool[source]

This attribute contains the state of source compliance.

Parameters:

chan (str) – This output indicates that a configured limit has been reached. (voltage, current, or power limit)

Returns:

DESCRIPTION.

Return type:

TYPE

ask_Power(chan: str) float[source]

This function performs one power measurements and returns the value.

Parameters:

chan (str) – Select channel A or B

Raises:

ValueError – Error message

Returns:

TYPE – Return float with the measured power value on the channel.

Return type:

float

ask_Resistance(chan: str) float[source]

This function performs one resistance measurements and returns the value.

Parameters:

chan (str) – Select channel A or B

Raises:

ValueError – Error message

Returns:

TYPE – Return float with the measured resistance value on the channel.

Return type:

float

ask_Voltage(chan: str) float[source]

This function performs one voltage measurements and returns the value.

Parameters:

chan (str) – Select channel A or B

Raises:

ValueError – Error message

Returns:

TYPE – Return float with the measured voltage value on the channel.

Return type:

float

ask_readBuffer(chan, start, stop)[source]

TODO: This function should be checked. Also is doesn’t return anything at the moment.

Parameters:
  • chan (str) – Select channel A or B

  • start (int) – select start value

  • stop (int) – select stop value

Raises:

ValueError – Error message

Returns:

  • Print the source function used

  • for ‘start’ - ‘stop’ readings stored in

  • source-measure unit (SMU)

  • channel A, buffer 1.

getIdn()[source]
Returns:

Instrument identification

Return type:

TYPE str

get_Data(chan)[source]
Parameters:

chan (str) – Select channel A or B

Returns:

OutPut – Return a dictionary with the measured voltage and current.

Return type:

dict

query(message)[source]
set_AutoCurrentRange(chan: str, state: int | str) None[source]

This attribute contains the state of the source autorange control (on/off).

Parameters:
  • chan (str) – Select channel A or B

  • state (str) – ON/OFF current source automatic range

Raises:

ValueError – Error message

Return type:

None.

set_AutoVoltageRange(chan: str, state: int | str) None[source]

This attribute contains the state of the source autorange control (on/off).

Parameters:
  • chan (str) – Select channel A or B

  • state (str) – ON/OFF voltage source automatic range

Raises:

ValueError – Error message

Return type:

None.

set_ChannelDisplay(chan: str, double: bool = True) None[source]
Parameters:
  • chan (str) – Select channel A or B

  • double (boolean, optional) –

    Displays source-measure for SMU A and SMU B. double = True per default. if double = True:

    Display Chan A and B

    else:

    Display only Chan selected

Raises:

ValueError – Error message

Return type:

None.

set_Current(chan: str, value: int | float) None[source]

This attribute sets the source level current.

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Set Current on channels A and B

Raises:

ValueError – Error message

Return type:

None.

set_CurrentLimit(chan: str, value: int | float) None[source]

Sets current source compliance. Use to limit the current output when in the voltage source mode. This attribute should be set in the test sequence before turning the source on.

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Sets the current limit of channel X to A. Using a limit value of 0 will result in a “Parameter Too Small” error message (error 1102)

Raises:

ValueError – Error message

Return type:

None.

set_CurrentRange(chan: str, value: int | float) None[source]
This attribute contains the positive full-scale value

of the measure range for current

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Set current source voltage limit

Raises:

ValueError – Error message

Return type:

None.

set_DisplayMeasurementFunction(chan: str, type: str) None[source]

This attribute specifies the type of measurement being displayed.

Parameters:
  • chan (str) – Select channel A or B

  • type (str) – Selects the displayed measurement function: volt, amp, ohm, or watt. SMU A and SMU B can be set for different measurement functions!

Raises:

ValueError – Error message

Return type:

None.

set_MeasOutput(chan: str, state: int | str) None[source]

This attribute sets source output state (on or off)

Parameters:
  • chan (str) – Select channel A or B

  • state (str) – Set source output (CHAN A/B) ON or OFF

Raises:

ValueError – Error message

Return type:

None.

set_MeasurementVoltageRange(chan: str, type: str, value: int | float) None[source]

This attribute contains the positive full-scale value of the measure range for voltage or current.

Parameters:
  • chan (str) – Select channel A or B

  • type (str) – Selects the measurement function: ‘volt’ or ‘amp’. SMU A and SMU B can be set for different measurement functions!

  • value (int/float) – Set to the maximum expected voltage or current to be measured.

Raises:

ValueError – Error message

Return type:

None.

set_OutputSourceFunction(chan: str, type: str) None[source]

This attribute sets the source function (V source or I source).

Parameters:
  • chan (str) – Select channel A or B

  • type (str) – The source function. Set to one of the following values: type = ‘volt’ Selects voltage source function type = ‘amp’ Selects current source function

Raises:

ValueError – Error message

Return type:

None.

set_PulseMeasured(chan: str, value: int | float, ton: int | float, toff: int | float) None[source]
Parameters:
  • chan (str) – Select channel A or B

  • value (int/float or list with curly braces for example {1,2,3....}.)

  • ton (int/float) – X ms pulse on

  • toff (int/float) – X ms pulse off

Raises:

ValueError – Error message

Return type:

None.

set_SourceOutput(chan: str, state: int | str) None[source]

This attribute sets source output state (on or off)

Parameters:
  • chan (str) – Select channel A or B

  • state (str) – Set source output (CHAN A/B) ON or OFF

Raises:

ValueError – Error message

Return type:

None.

set_Voltage(chan: str, value: int | float) None[source]

This attribute sets the source level voltage.

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Set voltage on channels A and B

Raises:

ValueError – Error message

Return type:

None.

set_VoltageLimit(chan: str, value: int | float) None[source]

Sets voltage source compliance. Use to limit the voltage output when in the current source mode. This attribute should be set in the test sequence before turning the source on.

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Sets the voltage limit of channel X to V. Using a limit value of 0 will result in a “Parameter Too Small” error message (error 1102)

Raises:

ValueError – Error message

Return type:

None.

set_VoltageRange(chan: str, value: int | float) None[source]
This attribute contains the positive full-scale value

of the measure range for voltage

Parameters:
  • chan (str) – Select Channel A or B

  • value (int/float) – Set voltage source voltage limit

Raises:

ValueError – Error message

Return type:

None.

set_offmode(chan: str, type: int | str) None[source]

This attribute sets the source output-off mode

Parameters:
  • chan (str) – Channel A or B

  • type (int | str) –

    0 or NORMAL: Configures the source function according to

    smuX.source.offfunc attribute

    1 or ZERO: Configures source to output 0 V 2 or HIGH_Z: Opens the output relay when the output is turned off

Raises:

ValueError – Channel not in Channel list or Type not in Type list

write(message)[source]

Novoptel LU1000 Module

class LU1000.LU1000_Base(target='USB', port=5025)[source]

Bases: object

Close()[source]
get_controller_temp() float[source]

Controller module temperature in Celsius

Raises:

ValueError – Error message

Returns:

res – Controller module temperature in Celsius

Return type:

float

get_firmware()[source]
get_laser_output(laser: int) int[source]

Returns the Laser output state. Enabled = 1 , Disabled = 0

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

Laser enabled = 1 or laser disabled = 0

Return type:

int

get_module_type() str[source]
get_serial_number()[source]
set_laser_output(laser: int, value: str | int) None[source]

Turn Laser N output ON/OFF

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (int/str) – value = ‘ON’|’OFF’|1|0

Raises:

ValueError – Error message

Return type:

None.

class LU1000.LU1000_Cband(target='USB')[source]

Bases: LU1000_Base

get_channel(laser: int) int[source]

Returns the Laser module’s current channel.

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Laser module’s current channel number

Return type:

int

get_data(laser: int) dict[source]

Return a dictionary with the measured power and set frequency.

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – DESCRIPTION.

Returns:

OutPut – Return a dictionary with the measured power and set frequency.

Return type:

dict

get_frequency(laser: int) float[source]

Calculate and return Frequency on the selected channel

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

Freq – Calculate and return Frequency on the selected channel

Return type:

float

get_grid_spacing(laser: int) int[source]

Grid spacing in GHz*10

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

Grid spacing in GHz*10

Return type:

int

get_max_freq(laser: int) float[source]

Lasers’s maximum possible Frequency.

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

max possible frequency

Return type:

float

get_max_optical_power(laser: int) float[source]

Get maximum possible optical power setting

Parameters:

laser (int) – Laser out selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Get maximum possible optical power setting

Return type:

float

get_measured_power(laser: int) float[source]

Returns the current optical power encoded as dBm

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Returns the current optical power encoded as dBm

Return type:

float

get_min_freq(laser: int) float[source]

Laser’s minimum possible frequency

Parameters:

laser (int) – Laser out selected - 1 or 2

Raises:

ValueError – Error message

Returns:

min possible frequency.

Return type:

float

get_min_grid_freq(laser: int) float[source]

Laser’s minimum supported grid spacing, GHz*10

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

Laser’s minimum supported grid spacing, GHz*10

Return type:

float

get_min_optical_power(laser: int) float[source]

Get minimum possible optical power setting

Parameters:

laser (int) – Laser out selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Get minimum possible optical power setting

Return type:

float

get_target_power(laser: int) float[source]

Returns the laser module’s current Optical Power in dBm

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

Returns the laser module’s current optical power in dBm

Return type:

float

get_temperature(laser: int) float[source]

Returns the current temperature encoded as °C.

Parameters:

laser (int) – Laser out selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Returns the current temperature encoded as °C.

Return type:

float

get_whispermode(laser: int) int[source]

Whispermode Status, ON = 2, OFF = 0

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Returns:

res – Whispermode Status. ON = 2, OFF = 0

Return type:

int

set_channel(laser: int, value: int) None[source]

Sets the laser module’s current channel

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (int) – Sets the laser module’s current channel value = select channel value

Raises:

ValueError – Error message

Return type:

None.

set_fine_tune(laser: int, value: int) None[source]

Fine-tuning set the frequency in MHz steps

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (int) – Fine-tuning set the frequency in MHz steps

Return type:

None.

set_frequency(laser: int, value: float) None[source]

Set Laser Frequency value in value

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (float) – Set Laser Frequency in THz e.g value = 192.876

Return type:

None.

set_grid_spacing(laser: int, value: int) None[source]

Set Grid spacing in GHz*10.

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (int) – Set Grid spacing. Smallest possible value = 1

Raises:

ValueError – Error message

Return type:

None.

set_target_power(laser: int, value: int | float, ignore_warning: bool = False) None[source]

Sets the laser module’s optical power in dBm

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (float) – optical power in dBm

  • ignore_warning (bool) – When True, no warning for power > 10dBm is displayed

Raises:

ValueError – Error message

Return type:

None.

set_whispermode(laser: int, state: str | int, timeout: int = 30) None[source]

Activates/Deactivates Whispermode

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • state (str | int) – [‘ON’,’OFF’, 1, 0]

  • timeout (int) – Timeout in seconds

Return type:

None.

class LU1000.LU1000_Oband(target='192.168.1.100')[source]

Bases: LU1000_Base

get_measured_current_1(laser: int) float[source]

Experimental! Retruns the laser module’s measured current in mA

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Measured current in mA

get_measured_current_2(laser: int) float[source]

Experimental! Retruns the laser module’s measured current in mA

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Measured current in mA

get_measured_power_dBm(laser: int) float[source]

Retruns the laser module’s measured power in dBm

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Measured power in dBm or ‘nan’ if laser is off

get_measured_power_mW(laser: int) float[source]

Retruns the laser module’s measured power in mW

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Measured power in mW or 10 if laser is off

get_target_current(laser: int) float[source]

Retruns the laser module’s current in mA

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Current in mA.

get_temperature(laser: int) float[source]

Returns the laser module temperature in °C.

Parameters:

laser (int) – Laser output selected - 1 or 2

Raises:

ValueError – Error message

Return type:

Temperature in °C

set_target_current(laser: int, current: float, ignore_warning: bool = False) None[source]

Sets the laser module’s current in mA

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • value (float) – 0mA <= value <= 100mA

Raises:

ValueError – Error message

Return type:

None.

set_temperature(laser: int, temperature: float) None[source]

Sets the laser module’s temperature in °C.

Parameters:
  • laser (int) – Laser output selected - 1 or 2

  • temperature (float) – 9°C <= temperature <= 45°C

Raises:

ValueError – Error message

Return type:

None.

NovoptelUSB module

class NovoptelUSB.NovoptelUSB(instrument_str=None)[source]

Bases: object

DEVNO = -1
baudrate = 230400
close()[source]
connect()[source]
read(addr)[source]
write(addr, data)[source]

NovoptelTCP module

class NovoptelTCP.NovoptelTCP(ip='127.0.0.1', port=5025, debug=False)[source]

Bases: object

close()[source]
connect()[source]
debug = False
ip = '127.0.0.1'
port = 5025
read(addr: int)[source]
readsdram_getpackets(startaddrseq: int, packetsinthissequence: int, cycles: int)[source]
readsdram_getpackets_raw(startaddrseq: int, packetsinthissequence: int, cycles: int)[source]
readsdram_raw(startaddr: int, numaddr: int)[source]
readsdram_sendrequest(startaddrseq: int, packetsinthissequence: int, cycles: int)[source]
reconnect()[source]
s = None
socket_read(data: bytes)[source]
socket_write(data: bytes)[source]
write(addr: int, data: int)[source]

CoBrite Tunable Laser module

Created on Mon Feb 14 13:54:49 2022

@author: Martin.Mihaylov

class CoBrite.CoBrite(resource_str)[source]

Bases: object

Close()[source]
Identification()[source]
Returns:

Identification name and model of the instrument.

Return type:

float

ask_ActualPower(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Queries the current optical output power reading of a tunable laser port. Value format is in dBm.

Return type:

float

ask_Configuration(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

Raises:

ValueError – Error message.

Returns:

DataDic – Query current configuration of Laser in location C-S-D in csv format

Return type:

dictionary

ask_FreqTHz(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Queries the wavelength setting of a tunable laser port. Value format is in THz.

Return type:

float

ask_LaserLim(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

DataDic – Query maximum tuning Parameters of Laser in location C-S-D in csv format.

Return type:

dictionary

ask_LaserOutput(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Query if laser is ON or OFF.

Return type:

str

ask_Offset(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Queries the frequency offset setting of a tunable laser port. Value format is in GHz.

Return type:

float

ask_Power(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Queries the optical output power target setting of a tunable laser port. Value format is in dBm.

Return type:

float

ask_Wavelength(chan)[source]
Parameters:

chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

Raises:

ValueError – Error message.

Returns:

Queries the wavelength setting of a tunable laser port. Value format is in Nanometer.

Return type:

float

query(message)[source]
read()[source]
Returns:

This function must be set after each set_() function. CoBrite writes the set_() to register and returns ;/r/n to the user. The ;/r/n command will mess up the next data sent to CoBrite from the user. An empty read() is required to be sended after each set_() function to the laser.

Return type:

None

set_Configuration(chan, freq, power, offset)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!

  • freq (float) – Sets frequency in Thz format. For example freq = 192.2345

  • power (float) – Sets the power to dBm. For example power = 9.8. min Power = 8.8 max Power = 17.8 Check ask_LaserLim() for more info.

  • offset (float) – Sets offset Freq in range Ghz.

Raises:

ValueError – Error message.

Return type:

None.

set_FreqTHz(chan, value)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

  • value (float) – Sets or queries the wavelength setting of a tunable laser port. Value format is in Tera Hertz.

Raises:

ValueError – Error message.

Return type:

None.

set_LaserOutput(chan, state)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

  • state (float/int) – Set if laser is ON or OFF. Can be integer 0 or 1, but can be a str ON and OFF.

Raises:

ValueError – Error message.

Return type:

None.

set_Offset(chan, value)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

  • value (float) – Sets the frequency offset setting of a tunable laser port. Value format is in Giga Hertz.

Raises:

ValueError – Error message.

Return type:

None.

set_Power(chan, value)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

  • value (float) – Sets the optical output power target setting of a tunable laser port. Value format is in dBm.

Raises:

ValueError – Error message.

Return type:

None.

set_Wavelength(chan, value)[source]
Parameters:
  • chan (int) – Channel number. Can be 1 or 2. CoBrite have only 2 channels!.

  • value (float) – Sets the wavelength setting of a tunable laser port. Value format is in Nanometer.

Raises:

ValueError – Error message.

Return type:

None.

write(message)[source]

Power Supply KA3005 module

Created on Fri Dec 10 11:35:57 2021

@author: Martin.Mihaylov

class KA3005.KA3005(psu_com)[source]

Bases: object

Close()[source]
ask_Amp()[source]
Returns:

current set.

Return type:

TYPE float

ask_Status()[source]
Returns:

Get the state of the output and CC/CV

Return type:

TYPE

ask_Volt()[source]
Returns:

Voltage set.

Return type:

TYPE float

getIdn()[source]
Returns:

Instrument identification

Return type:

TYPE str

get_data()[source]
Returns:

OutPut – Return a dictionary with the measured voltage and current.

Return type:

dict

isConnected = False
psu_com = None
read_Amp()[source]
Returns:

Current measured

Return type:

TYPE float

read_Volt()[source]
Returns:

Voltage Measured

Return type:

TYPE float

serWriteAndRecieve(data, delay=0.05)[source]
set_Amp(amp, delay=0.01)[source]
Parameters:
  • amp (int/float) – Set the current on the Display

  • delay (0.01s Delay)

Return type:

None

set_Ocp(state)[source]
Parameters:

state (str (ON/OFF)) – Set the state of the overcurrent protection ON and OFF

Return type:

None.

set_Out(state)[source]
Parameters:

state (str (ON/OFF)) – Turn Output ON and OFF

Return type:

None.

set_Volt(voltage, delay=0.01)[source]
Parameters:
  • voltage (int/float) – Set the voltage on the Display

  • delay (0.01s Delay)

Return type:

None

status = {}

Power Supply KA3005p module

Created on Mon Aug 1 12:15:19 2022

@author: Martin.Mihaylov

class KA3005p.KA3005p(psu_com)[source]

Bases: object

Close()[source]
ask_Amp()[source]
Returns:

Current set.

Return type:

TYPE float

ask_Status()[source]
Returns:

Get the state of the output and CC/CV

Return type:

TYPE

ask_Volt()[source]
Returns:

Voltage set.

Return type:

TYPE float

getIdn()[source]
Returns:

Instrument identification

Return type:

TYPE str

get_data()[source]
Returns:

OutPut – Return a dictionary with the measured voltage and current.

Return type:

dict

isConnected = False
psu_com = None
read_Amp()[source]
Returns:

Current measured

Return type:

TYPE float

read_Volt()[source]
Returns:

Voltage measured

Return type:

TYPE float

serWriteAndRecieve(data, delay=0.05)[source]
set_Amp(amp, delay=0.01)[source]
Parameters:
  • amp (int/float) – Set the current on the Display

  • delay (0.01s Delay)

Return type:

None

set_Ocp(state)[source]
Parameters:

state (str (ON/OFF)) – Set the state of the overcurrent protection ON and OFF

Return type:

None.

set_Out(state)[source]
Parameters:

state (str (ON/OFF)) – Turn Output ON and OFF

Return type:

None.

set_Volt(voltage, delay=0.01)[source]
Parameters:
  • voltage (int/float) – Set the voltage on the Display

  • delay (0.01s Delay)

Return type:

None

status = {}

Power Supply RD3005 module

Created on Mon Aug 1 12:14:47 2022

@author: Martin.Mihaylov

class RD3005.RD3005(psu_com)[source]

Bases: object

Close()[source]
ask_Amp()[source]
Returns:

current set.

Return type:

TYPE float

ask_Status()[source]
Returns:

Get the state of the output and CC/CV

Return type:

TYPE

ask_Volt()[source]
Returns:

Voltage set.

Return type:

TYPE float

getIdn()[source]
Returns:

Instrument identification

Return type:

TYPE str

get_data()[source]
Returns:

OutPut – Return a dictionary with the measured voltage and current.

Return type:

dict

isConnected = False
psu_com = None
read_Amp()[source]
Returns:

Current Measured

Return type:

TYPE float

read_Volt()[source]
Returns:

Voltage Measured

Return type:

TYPE float

serWriteAndRecieve(data, delay=0.05)[source]
set_Amp(amp, delay=0.01)[source]
Parameters:
  • amp (int/float) – Set the current on the Display

  • delay (0.01s Delay)

Return type:

None

set_Ocp(state)[source]
Parameters:

state (str (ON/OFF)) – Set the state of the overcurrent protection ON and OFF

Return type:

None.

set_Out(state)[source]
Parameters:

state (str (ON/OFF)) – Turn Output ON and OFF

Return type:

None.

set_Volt(voltage, delay=0.01)[source]
Parameters:
  • voltage (int/float) – Set the voltage on the Display

  • delay (0.01s Delay)

Return type:

None

status = {}

4 Channels Power Suppy GPP4323 module

Created on Wed Feb 1 15:55:01 2023

@author: Martin.Mihaylov

class GPP4323.GPP4323(resource_str)[source]

Bases: object

Close()[source]
ask_Amp(channel)[source]
Parameters:

channel (int) – Select channel from List of Channel Numbers [1,2,3,4].

Returns:

DESCRIPTION.

Return type:

TYPE

ask_ChannelLoadMode(channel)[source]
Parameters:

channel (int) – Select channel from List of Channel Numbers [1,2].

Returns:

Queries CH1 or CH2 work mode. 6 modes below: SERies/PARallel/INDE pendent, CV Load/CC Load/CR Load

Return type:

TYPE

ask_LoadResistor(channel)[source]
Parameters:

channel (int) – Select channel from List of Channel Numbers [1,2].

Returns:

Set load Resistance Value for given channel.

Return type:

TYPE

ask_Volt(channel)[source]
Parameters:

channel (int) – Select channel from List of Channel Numbers [1,2,3,4].

Returns:

DESCRIPTION.

Return type:

TYPE

getIdn()[source]
Returns:

Instrument identification

Return type:

TYPE str

get_data(channel)[source]
Returns:

OutPut – Return a dictionary with the measured voltage and current.

Return type:

dict

query_IND(message)[source]
query_values(message)[source]
read_Measurment(channel, Type)[source]
Returns:

Voltage Measured

Return type:

TYPE float

reset()[source]
set_Amp(channel, amp)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2,3,4].

  • amp (int/float) – Set Current on Channel.

Return type:

None.

set_ChannelLoadMode(channel, mode, status)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2].

  • mode (str) – Sets CH1/CH2 as Load CV, CC or CR mode.

  • status (str) – Possible status [“ON”, “OFF”].

Return type:

None.

set_ChannelToParallel(channel, status)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2].

  • status (str) – Sets CH1/CH2 as Tracking parallel mode.

Return type:

None.

set_ChannelToSerial(channel, status)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2].

  • status (str) – Sets CH1/CH2 as Tracking series mode.

Return type:

None.

set_ChannelTracking(mode)[source]
Parameters:

mode (int) – Selects the operation mode: independent, tracking series, or tracking parallel. GPP-1326 does not have this function. Series-parallel mode is not supported under LOAD.

Return type:

None.

set_LoadResistor(channel, value)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2].

  • value (float) – Set resistance values from range 1-1000.

Return type:

None.

set_Out(channel, state)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2,3,4].

  • state (str) – Status of power Supple output. Could be [“ON”, “OFF”]

Return type:

None.

set_Volt(channel, voltage)[source]
Parameters:
  • channel (int) – Select channel from List of Channel Numbers [1,2,3,4].

  • voltage (int/float.) – Set Voltage on Channel.

Return type:

None.

write(message)[source]

AnaPico AG APPH20G module

Keysight Realtime Oscilloscope UXR0702A module

Created on Mon Dec 1 20:17:32 2024

@author: Maxim Weizel

class UXR.UXR(resource_str='TCPIP0::KEYSIGH-Q75EBO9.local::hislip0::INSTR', num_channel=2)[source]

Bases: object

This class is using pyvisa to connect to Instruments. Please install PyVisa before using it.

Close()[source]
IDN() str[source]

The *IDN? query returns the company name, oscilloscope model number, serial number, and software version by returning this string: Keysight Technologies,<Model #>,<USXXXXXXXX>,<Rev #>[,<Options>]

str

Keysight Technologies,DSO9404A,USXXXXXXXX,XX.XX.XXXX

OPC() int[source]

Places a “1” into the output queue when all device operations have been completed :returns: 1 or 0 :rtype: TYPE str

aquisition_done() int[source]

The :ADER? query reads the Acquisition Done Event Register and returns 1 or 0. After the Acquisition Done Event Register is read, the register is cleared. The returned value 1 indicates an acquisition completed event has occurred and 0 indicates an acquisition completed event has not occurred.

Returns:

{1 | 0}

Return type:

int

aquisition_state() str[source]

The :ASTate? query returns the acquisition state.

Returns:

{ARM | TRIG | ATRIG | ADONE}

Return type:

str

autoscale() None[source]

The :AUToscale command causes the oscilloscope to evaluate all input waveforms and find the optimum conditions for displaying the waveform.

autoscale_channels(value: str | None = None) str[source]

The :AUToscale:CHANnels command selects whether to apply autoscale to all of the input channels or just the input channels that are currently displayed.

valuestr, optional

{ALL | DISPlayed}, if None then query

str

{ALL | DISP}

ValueError

Expected one of: {ALL | DISP | DISPlayed }

channel_display(channel: int, write: bool = False, value: int | str | None = None) int[source]

The :CHANnel<N>:DISPlay command turns the display of the specified channel on or off.

channelint

An integer, analog input channel 1 or 2

writebool, optional

write the channel display state, else query

valueint, str, optional

ON, 1, OFF, 0

int

The :CHANnel<N>:DISPlay? query returns the current display condition for the specified channel

ValueError

For Channel expected one of: num_channels

ValueError

For values expected one of: ON, 1, OFF, 0

channel_range(channel: int, write: bool = False, range_value: float | None = None) float[source]

The :CHANnel<N>:RANGe command defines the full-scale vertical axis of the selected channel. The values represent the full-scale deflection factor of the vertical axis in volts. These values change as the probe attenuation factor is changed.

channelint

An integer, analog input channel 1 or 2

writebool, optional

write else query, by default False

range_valuefloat, optional

A real number for the full-scale voltage of the specified channel number, by default None

float

full-scale vertical axis of the selected channel

ValueError

For Channel expected one of: num_channels

ValueError

For range_value expected to be < 2V

channel_scale(channel: int, write: bool = False, scale_value: float | None = None) float[source]

The :CHANnel<N>:SCALe command sets the vertical scale, or units per division, of the selected channel. This command is the same as the front-panel channel scale.

channelint

An integer, analog input channel 1 or 2

writebool, optional

write else query, by default False

scale_valuefloat, optional

A real number for the vertical scale of the channel in units per division, by default None

float

A real number for the vertical scale of the channel in units per division

ValueError

For Channel expected one of: num_channels

ValueError

For range_value expected to be < 500mV/div

clear_status() None[source]

The *CLS command clears all status and error registers.

digitize(channel_num: int | None = None) None[source]

This command initializes the selected channels or functions, then acquires them according to the current oscilloscope settings. When all waveforms are completely acquired, the oscilloscope is stopped. To Do: input can be: [CHANnel<N> | DIFF<D> | COMMonmode<C>]

channel_numint

Number of the Channel

channel_numError

Expected one of: channel number

query(message)[source]
query_binary_values(message, datatype='h', container=<built-in function array>, data_points=0, **kwargs)[source]
reset() None[source]

The *RST command performs a default setup which is the same as pressing the oscilloscope front panel [Default Setup] key.

run() None[source]

Set the scope in run mode.

run_state() str[source]

The :RSTate? query returns the run state:

Returns:

{RUN | STOP | SING}

Return type:

str

single() None[source]

Take a single acquisition

status(key: str | None = None, value: int | None = None) int[source]

The :STATus? query shows whether the specified channel, function, wmemory, histogram, measurement trend, measurement spectrum, or equalized waveform is on or off. To Do: Each type has a different range of values that is excepted. No Checking is implemented.

keystr, optional

if None return status of Channel1

valueint, optional

For Channel [1,2], for Function <=16

int

A return value of 1 means on and a return value of 0 means off

ValueError

Expected one of: CHANNEL, FUNCTION, HIST, … etc.

stop() None[source]

Set the scope in stop mode.

system_header(value: int | str | None = None) int[source]

!!!! SHOULD BE OFF !!!! The :SYSTem:HEADer command specifies whether the instrument will output a header for query responses. When :SYSTem:HEADer is set to ON, the query responses include the command header.

valueint | str | None, optional

{{ON | 1} | {OFF | 0}}, by default None

int

{1 | 0}

ValueError

Expected one of: {{ON | 1} | {OFF | 0}}

waveform_byteorder(value: str | None = None) str[source]

The :WAVeform:BYTeorder command selects the order in which bytes are transferred from (or to) the oscilloscope using WORD and LONG formats

valuestr, optional

byteorder {MSBF, LSBF}, by default None

str

byteorder {MSBF, LSBF}

ValueError

Expected one of: MSBFIRST, LSBFIRST

waveform_data(start: int | None = None, size: int | None = None, datatype: str = 'h', container: type = <built-in function array>, data_points: int = 0, **kwargs) ndarray[source]

The :WAVeform:DATA? query outputs waveform data to the computer over the remote interface. The data is copied from a waveform memory, function, or channel previously specified with the :WAVeform:SOURce command.

Parameters:
  • start (int, optional) – Starting point in the source memory for the first waveform point to transfer, by default None.

  • size (int, optional) – Number of points in the source memory to transfer. If larger than available data, size is adjusted to the maximum available, by default None.

  • datatype (str, optional) – Data type for binary values as defined in Python struct, by default “h” (short).

  • container (type, optional) – Type of container to hold the data, by default np.array.

  • data_points (int, optional) – Expected number of data points, by default 0.

  • kwargs (dict, optional) – Additional arguments passed to the query_binary_values method.

Returns:

Acquired data.

Return type:

np.ndarray

Raises:
  • ValueError – If start or size are invalid (non-integers or negative).

  • NotImplementedError – If the waveform format is not “WORD”.

waveform_format(value: str | None = None) str[source]

The :WAVeform:FORMat command sets the data transmission mode for waveform data output. This command controls how the data is formatted when it is sent from the oscilloscope, and pertains to all waveforms. To Do: Only WORD is tested. There is a FLOAT type?

valuestr, optional

One of {ASCii | BINary | BYTE | WORD }, by default None

str

{ASC | BIN | BYTE | WORD }

ValueError

Expected one of: {ASCii | BINary | BYTE | WORD}

waveform_points() int[source]

The :WAVeform:POINts? query returns the points value in the current waveform preamble.

int

Number of points in the current waveform

waveform_source(key: str | None = None, value: int | None = None) str[source]

The :WAVeform:SOURce command selects a channel, function, waveform memory, or histogram as the waveform source To Do: No checkes implemented

keystr | None, optional

One of: {CHANnel<N> | DIFF<D> | COMMonmode<C> | FUNCtion<F> | HISTogram | WMEMory<R> | CLOCk | MTRend | MSPectrum | EQUalized | XT<X> | PNOise | INPut | CORRected | ERRor | LFPR | NREDuced}, by default None

valueint | None, optional

Number e.g. 1 for Channel1, by default None

str

The :WAVeform:SOURce? query returns the currently selected waveform source.

waveform_streaming(value: int | str | None = None) int[source]

When enabled, :WAVeform:STReaming allows more than 999,999,999 bytes of data to be transferred from the Infiniium oscilloscope to a PC when using the :WAVeform:DATA? query.

valueint | str | None, optional

{{ON | 1} | {OFF | 0}}, by default None

int

{1 | 0}

ValueError

Expected one of: {{ON | 1} | {OFF | 0}}

waveform_x_increment() float[source]

The :WAVeform:XINCrement? query returns the duration between consecutive data points for the currently specified waveform source.

Returns:

A real number representing the duration between data points on the X axis.

Return type:

float

waveform_x_origin() float[source]

The :WAVeform:XORigin? query returns the X-axis value of the first data point in the data record.

Returns:

A real number representing the X-axis value of the first data point in the data record.

Return type:

float

waveform_y_increment() float[source]

The :WAVeform:YINCrement? query returns the y-increment voltage value for the currently specified source.

Returns:

A real number in exponential format.

Return type:

float

waveform_y_origin() float[source]

The :WAVeform:YORigin? query returns the y-origin voltage value for the currently specified source. The voltage value returned is the voltage value represented by the waveform data digital code 00000.

Returns:

A real number in exponential format.

Return type:

float

write(message)[source]

Indices and tables