pyvilab_lib package
Submodules
pyvilab_lib.config_generator module
Config of device_generator.py
- class pyvilab_lib.config_generator.GeneratorConfig
Bases:
object
Working on all basic and arbitrary waveforms Not working for AM, FM, PM, PULSE, SWEEP and BURST modes
- Example:
>>> from pyvilab_lib import GeneratorDevice, GeneratorConfig >>> >>> generator = GeneratorDevice() >>> generator.open() >>> >>> config = GeneratorConfig() >>> config.channel = "CH1" >>> config.wave_type = "COT" >>> config.frequency = "12000" >>> config.amplitude = "5" >>> config.offset = "-1.5" >>> generator.set_config(config) >>> generator.close()
pyvilab_lib.config_multimeter module
Config of device_multimeter.py
- class pyvilab_lib.config_multimeter.MultimeterConfig
Bases:
object
Class for simplification of device settings
- Variables
function – Function variable take values: MultimeterConfig.function = “VOLTAGE_DC”, “VOLTAGE_AC”, “CURRENT_DC”,”CURRENT_AC”, “RESISTANCE”, “FRESISTANCE”, “FREQUENCY”, “PERIOD”, “CONTINUITY” , “DIODE”, “CAPACITANCE” Type is str.
range – Index of function or name of variable, for accessible indexes, see
config_multimeter.json
, in form “<index>” or MultimeterConfig.range = “AUTO”. Values available: “MAX”, “MIN”, “DEF”, “AUTO”. Type is str, int.rate – Selects rate for function, in some cases there is no rate, see
config_multimeter.json
or await error. Write in form MultimeterConfig.rate = “FAST”. Values available: “FAST”, “MEDIUM”, “SLOW”. Type is str.
- Example:
>>> from pyvilab_lib import MultimeterDevice, MultimeterConfig >>> >>> multimet = MultimeterDevice() >>> multimet.open() >>> >>> config = MultimeterConfig() >>> config.function = "VOLTAGE_DC" >>> config.range = "4" >>> config.rate = "FAST" >>> multimet.set_config(config) >>> multimet.close()
- checker()
- function_setter(name)
- range_setter(input_value)
- rate_setter(input_rate)
pyvilab_lib.config_osciloscope module
Config of device_osciloscope.py
- class pyvilab_lib.config_osciloscope.OscilloscopeConfig
Bases:
object
- Example:
>>> from pyvilab_lib import OscilloscopeDevice, OscilloscopeConfig >>> >>> scoper = OscilloscopeDevice() >>> scoper.open() >>> >>> config = OscilloscopeConfig() >>> config.channel = "CH1" >>> config.channel_display = "ON" >>> config.timebase_scale = "0.0002" >>> config.channel_scale = "1" >>> scoper.set_config(config) >>> scoper.close()
pyvilab_lib.device_generator module
Library of functions of GeneratorConstants DG1022A
- class pyvilab_lib.device_generator.GeneratorConstants
Bases:
object
Class storing static constants for GeneratorConstants
- ABS_SINE = 'AbsSine'
- ABS_SINE_HALF = 'AbsSineHalf'
- AIRY = 'Airy'
- AMP_ALT = 'AmpALT'
- AM_MODE = 'AM'
- ATT_ALT = 'AttALT'
- BAND_LIMITED = 'BandLimited'
- BARLETT = 'Barlett'
- BLACKMAN = 'Blackman'
- BOXCAR = 'Boxcar'
- BUTTERWORTH = 'Butterworth'
- CARDIAC = 'Cardiac'
- CENTER = 'CENT'
- CH1 = ''
- CH2 = 'CH2'
- CHEBYSHEV1 = 'Chebyshev1'
- CHEBYSHEV2 = 'Chebyshev2'
- COMBIN = 'Combin'
- COT = 'Cot'
- CPULSE = 'Cpulse'
- DC = 'DC'
- DIRICHLET = 'Dirichlet'
- EXP_FALL = 'Exp_Fall'
- EXP_RISE = 'Exp_Rise'
- FM_MODE = 'FM'
- GAMMA = 'Gamma'
- GATED = 'GAT'
- GAUSS = 'Gauss'
- GAUSS_PULSE = 'GaussPulse'
- HAMMING = 'Hamming'
- HANNING = 'Hanning'
- HAVER_SINE = 'HaverSine'
- INF = 'INF'
- INVERTED = 'INV'
- KAISER = 'Kaiser'
- LINEAR = 'LIN'
- LIST_OF_COMMON_WAVEFORMS = {'DC', 'NOISE', 'PULSE', 'RAMP', 'SINUSOID', 'SQUARE', 'USER'}
- LOGARITHMIC = 'LOG'
- LORENTZ = 'Lorentz'
- MAX = 'MAX'
- MIN = 'MIN'
- NEG_RAMP = 'NegRamp'
- NOISE = 'NOIS'
- NORMAL = 'NORM'
- NPULSE = 'NPulse'
- NRAM = 'NRAM'
- OFF = 'OFF'
- ON = 'ON'
- PM_MODE = 'PM'
- PPULSE = 'PPulse'
- PULSE = 'PULS'
- QUAKE = 'Quake'
- RAMP = 'RAMP'
- ROUNDHALF = 'RoundHalf'
- ROUNG_PM = 'Roundpm'
- SINC = 'Sinc'
- SINE_TRA = 'SINE_TRA'
- SINE_VER = 'SINE_VER'
- SINUSOID = 'SIN'
- SPAN = 'SPAN'
- SQRT = 'Sqrt'
- SQUARE = 'SQU'
- STAIR_DOWN = 'StairDown'
- STAIR_UD = 'StairUD'
- STAIR_UP = 'StairUp'
- START = 'STAR'
- STEP_RESPONSE = 'Stepresponse'
- STOP = 'STOP'
- TAN = 'Tan'
- TRAPEZIA = 'Trapezia'
- TRI = 'TRI'
- TRIANG = 'triang'
- TRIGGERED = 'TRIG'
- TV = 'TV'
- UNIT_DBM = 'DBM'
- UNIT_VPP = 'VPP'
- UNIT_VRMS = 'VRMS'
- USER = 'USER'
- VOICE = 'Voice'
- X2 = 'X^2'
- class pyvilab_lib.device_generator.GeneratorDevice(device='', timeout=0.05, recognition_sign='DG')
Bases:
VirtualInstrument
This is class of functions to control a Rigol DG1000 series waveform GeneratorConstants. All essentials functions, that are common for all Rigol devices, are enherited from base class above.
- Parameters
device – Path to device in string. If the parameter is not defined, it searches device through path
“/dev/usbtmc1” to “/dev/usbtmc3”. :type device: str, optional :param timeout: Sets timeout between individual commands. Default is 0.05. :type timeout: float, optional :param recognition_sign: Recognize part of devices name in string format. Default sign is “G” which stands for GeneratorConstants. :type recognition_sign: str, optional
- get_am_depth(peak='')
Query the depth of AM internal modulation.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of am depth to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the percent of the depth of AM internal modulation in scientific notation, such as: 7.000000e+01 in %.
- Return type
bytes
- Example
>>> GeneratorDevice.get_am_depth()
- Triggers
“AM:DEPT?”
- get_amplitude(channel='')
Query the output amplitude of selected channel. :param channel: Defaults to last used channel or CH1. Write in form
GeneratorConstant.CH2
.Values available: CH1, CH2.
- Returns
The query returns the amplitude of the function currently selected in scientific notation, such as: 4.000000e-03.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude()
- Triggers
“VOLTage?”
- get_amplitude_high_level(channel='')
Query the high level of waves output from selected channel. The default unit is Vpp.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the high level set in scientific notation, such as: 1.000000e+01 in Vpp.
- Example
>>> GeneratorDevice.get_amplitude_high_level()
- Triggers
“VOLT:HIGH?”
- get_amplitude_low_level(channel='')
Query the low level of waves output from selected channel. The default unit is V.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the low level set in scientific notation, such as: -1.000000e+01 in V.
- Example
>>> GeneratorDevice.get_amplitude_low_level()
- Triggers
“VOLT:LOW?”
- get_amplitude_offset(channel='')
Query the offset voltage of selected channel. The default unit is Vdc.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the offset voltage set in scientific notation, such as: -9.998000e+00 in Vdc.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude_offset()
- Triggers
“VOLT:OFFS?”
- get_amplitude_unit(channel='')
Query the unit of voltage output from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns VPP, VRMS or DBM.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude_unit()
- Triggers
“VOLTage:UNIT?”
- get_arb_function(channel='')
Query the name of arbitrary wave generated from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the name of built-in arbitrary wave selected (such as EXP_RISE), VOLATILE or the name of any of the user-defined waves in nonvolatile memory. The default is EXP_RISE.
- Return type
bytes
- Example
>>> GeneratorDevice.get_arb_function()
- Triggers
“FUNCtion:USER?”
- get_burst_internal_period(peak='')
Query the period of burst in internal trigger mode.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the burst period in scientific notation and the default unit is s, such as: 1.000000e+01.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_internal_period()
Trigger: “BURSt:INTernal:PERiod?”
- get_burst_mode()
Query the burst mode.
- Returns
The query returns TRIG or GAT.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_mode()
- Triggers
“BURSt:MODE?”
- get_burst_ncycles()
Query the cycle number of burst.
- Returns
The query returns the burst counting in scientific notation (such as 1.000000e+02) or returns “Infinite”.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_ncycles()
Trigger: “BURSt:NCYCles?”
- get_burst_phase(peak='')
Query the initial phase of burst.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of burst phase to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the initial phase of burst in scientific notation and the default unit is degree, such as: 1.500000e+02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_phase()
Trigger: “BURSt:PHASe?”
- get_burst_state()
Query the state of burst mode.
- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_state()
Trigger: “BURSt:STATe?”
- get_duty_cycle_of_square_wave(peak='', channel='')
Query the duty cycle of square wave from selected channel.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines peak values of square wave when selected. Write in formGeneratorConstant.MAX
. Values available: MAX, MIN.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current duty cycle setting, such as 50.000000. Unit is %.
- Return type
- Example
>>> GeneratorDevice.get_duty_cycle_of_square_wave()
- Triggers
“FUNCtion:SQUare:DCYCle?”
- get_frequency(channel='')
Query the frequency of output function of selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the frequency set in scientific notation and in Hz, such as: 1.000000e-06.
- Return type
bytes
- Example
>>> GeneratorDevice.get_frequency()
- Triggers
“FREQuency?”
- get_modulated_wave_deviation(peak='', modulated_wave='AM')
Query the frequency deviation of FM or PM.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of modulated wave deviation to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: FM_MODE, PM_MODE.
- Returns
The query returns the frequency deviation of FM or PM in the scientific notation and in Hz, such as: 1.000000e+02
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_deviation()
- Triggers
“FM:DEViation?”
- get_modulated_wave_frequency(modulated_wave='AM')
Query the frequency of modulated_wave internal modulation. The default unit is Hz.
- Parameters
modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns the frequency of modulated_wave internal modulation in scientific notation and the default unit is Hz, such as: 2.000000e+02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_frequency()
- Triggers
“AM:INT:FREQ?”
- get_modulated_wave_function(wave_mode='AM')
Query the internal modulating wave selected.
- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns SIN, SQU, RAMP, NRAM, TRI, NOIS or USER.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_function()
- Triggers
“AM:INTernal:FUNCtion?”
- get_modulated_wave_state(wave_mode='AM')
Query the modulation state of wave_mode.
- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_state()
- Triggers
“AM:STATe?”
- get_output(channel='')
Query the state of the [Output] connector of selected channel at the front panel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output()
- Triggers
“OUTP?”
- get_output_load(channel='')
Query the current load setting of selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the current load setting in Ω or returns “Infinity”.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_load()
- Triggers
“OUTP:LOAD?”
- get_output_polarity(channel='')
Query the polarity of waveform output from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns NORM or INV.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_polarity()
- Triggers
“OUTP:POL?”
- get_output_sync()
Query the state of the [Sync Out] connector of CH1 on the rear panel.
- Returns
The query returns SYNC OFF or SYNC ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_sync()
- Triggers
“OUTP:SYNC?”
- get_phase(peak='', channel='')
Query the initial phase of signals output from selected channel. The default unit of angle is degree.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which phase peak to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns any numerical value between -180 and 180, such as: 90.000 in degree.
- Return type
bytes
- Example
>>> GeneratorDevice.get_phase()
- Triggers
“PHAS?”
- get_pulse_duty_cycle(peak='', channel='')
Query the duty cycle of pulse output from selected channel. The default unit is %.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of pulse duty cycle to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the percent of duty cycle of pulse in scientific notation, such as: 5.000000e+01 in %
- Example
>>> GeneratorDevice.get_pulse_duty_cycle()
- Triggers
“PULSe:DCYCle?”
- get_pulse_period(peak='', channel='')
Query the period of pulse output from selected channel in seconds.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which period of pulse period to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the pulse period in scientific notation and in seconds, such as: 1.000000e-02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_pulse_period()
- Triggers
“PULSe:PERiod?”
- get_pulse_width(peak='', channel='')
Query the width of pulse output from selected channel in seconds.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of pulse width to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the pulse width in scientific notation and in seconds, such as: 5.000000e-03.
- Return type
bytes
- Example
>>> GeneratorDevice.get_pulse_width()
- Triggers
“PULSe:WIDTh?”
- get_sweep_frequency(joiner)
Query the start, stop, center or span frequency in sweep mode. The default unit is Hz.
- Parameters
joiner (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.START
. Values available: START, STOP, CENTER, SPAN.- Returns
The query returns the start, stop, center or span frequency set in scientific notation and in Hz, such as: 1.000000e-06.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_frequency(GeneratorConstants.START)
- Triggers
“FREQuency:STARt?”
- get_sweep_spacing()
Query the current sweep mode.
- Returns
The query returns LINEAR or LOG.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_spacing()
- Triggers
“SWEep:SPACing?”
- get_sweep_state()
Query the sweep state.
- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_state()
- Triggers
“SWEep:STATe?”
- get_sweep_time()
Query the sweep time needed for the generator to sweep from the start frequency to the stop frequency. The default unit is s.
- Returns
The query returns the sweep time in scientific notation and in seconds, such as: 1.000000e+01.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_time()
- Triggers
“SWEep:TIME?”
- get_symmetry_of_ramp_wave(peak='', channel='')
Query the symmetry of ramp wave output from selected channel.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current symmetry setting, such as 50.000000. Unit is %.
- Return type
bytes
- Example
>>> GeneratorDevice.get_symmetry_of_ramp_wave()
- Triggers
“FUNCtion:RAMP:SYMMetry?”
- get_wave_function(channel='')
Function asks device what measurement function is it currently using on selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
Returns what channel and measurement function we are on, in cases: Channel:SIN, SQU, RAMP, PULS, NOIS, ARB.
- Return type
bytes
- Example
>>> GeneratorDevice.get_wave_function()
- Triggers
“FUNCtion?”
- get_wave_function_with_parameters(channel='')
Query the current configuration of CH1 or CH2 and the type of wave outputted. The default units of <frequency>, <amplitude> and <offset> are Hz, Vpp and V DC respectively
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns a character string enclosed in double quotation marks, including function, frequency, amplitude and offset. Such as, CH1:”SIN,1.000000e+03,5.000000e+00,-1.500000e+00”
- Return type
bytes
- Example
>>> GeneratorDevice.get_wave_function_with_parameters()
- Triggers
“APPLy?”
- set_am_depth(value)
Set the depth of AM internal modulation in percent. Depth range: 0% to 120%. The default unit is %.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines am depth, percent write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Example
>>> GeneratorDevice.set_am_depth(str(70))
- Triggers
“AM:DEPT 70”
- set_amplitude(value, channel='')
Set the output amplitude of selected channel. The default unit is Vpp. Unit can be set in
GeneratorDevice.set_amplitude_unit()
func.- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage peak to peak values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude(GeneratorConstants.MIN)
- Triggers
“VOLTage MIN” (value in Vpp)
- set_amplitude_high_level(value, channel='')
Set the high level of waves output from selected channel and the default unit is V.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_high_level(GeneratorConstants.MAX)
- Triggers
“VOLT:HIGH MAX”
- set_amplitude_low_level(value, channel='')
Set the low level of waves output from selected channel and the default unit is V.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_low_level(GeneratorConstants.MAX)
- Triggers
“VOLT:LOW MAX”
- set_amplitude_offset(value, channel='')
Set the offset voltage of selected channel in Vdc.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Volt dirrect current values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_offset(GeneratorConstants.MIN)
- Triggers
“VOLT:OFFS MIN”
- set_amplitude_unit(unit_type, channel='')
Set the unit of voltage output from selected channel. DBM could be used only in non-high resistance.
- Parameters
unit_type (static variable from
GeneratorConstants
) – Defines units for amplitude. Constants write in formGeneratorConstant.UNIT_VPP
. Values available: UNIT_VPP, UNIT_VRMS, UNIT_DBM.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_unit(GeneratorConstants.UNIT_VPP)
- Triggers
“VOLT:UNIT VPP”
- set_arb_function(wave_name, channel='')
Select any wave from built-in arbitrary waves, 10 user-defined waves or waves that have been downloaded into volatile memory for selected channel.
- Parameters
wave_name (static variable from
GeneratorConstants
) – Defines build-in arbitrary wave. Write in formGeneratorConstant.X2
. Values available: NEG_RAMP, ATT_ALT, AMP_ALT, STAIR_DOWN, STAIR_UP, STAIR_UD, CPULSE, PPULSE, NPULSE, TRAPEZIA, ROUNDHALF, ABS_SINE, ABS_SINE_HALF, SINE_TRA, SINE_VER, EXP_RISE, EXP_FALL, TAN, COT, SQRT, X2, SINC, GAUSS, HAVER_SINE, LORENTZ, DIRICHLET, GAUSS_PULSE, AIRY, CARDIAC, QUAKE, GAMMA, VOICE, TV, COMBIN, BAND_LIMITED, STEP_RESPONSE, BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2, BOXCAR, BARLETT, TRIANG, BLACKMAN, HAMMING, HANNING, KAISER, ROUNG_PM.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_arb_function(GeneratorConstants.X2)
- Triggers
“FUNCtion:USER Exp_Rise”
- set_burst_internal_period(period)
Set the period of burst in internal trigger mode.
- Parameters
period (static variable from
GeneratorConstants
, str(<seconds>)) – Is the burst period set by users, the default unit is s. Write int in form str(<seconds>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=0.000001, MAX=500.- Example
>>> GeneratorDevice.set_burst_internal_period(str(10))
- Triggers
“BURS:INT:PER 10”
- set_burst_mode(mode)
Set the burst mode to trigger (TRIGgered) or gated (GATed).
In trigger mode, the generator outputs a wave with specified number of cycles once it receives a trigger from the specified trigger source (via sending TRIGger:SOURce).
In gated mode, the output state of waves (“ON” or “OFF”) depends on the external signal level at the [Ext Trig/FSK/Burst] connector on the rear panel.
The default burst mode is trigger.
- Parameters
mode (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.GATED
. Values available: TRIGGERED, GATED.- Example
>>> GeneratorDevice.set_burst_mode(GeneratorConstants.GATED)
- Triggers
“BURS:MODE GAT”
- set_burst_ncycles(cycle)
Set the cycle number of burst. Only used in triggermode.
- Parameters
cycle (static variable from
GeneratorConstants
, str(<cycles>)) – Is the cycle number set by users. Write int in form str(<cycles>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX, INF. Where MIN=1, MAX=50000 cycles.- Example
>>> GeneratorDevice.set_burst_ncycles(str(100))
- Triggers
“BURS:NCYC 100”
- set_burst_phase(phase)
Set the initial phase of burst.
- Parameters
phase (static variable from
GeneratorConstants
, str(<angle>)) – Is the phase set by users, the default unit is degree. Write float in form str(<angle>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=-180, MAX=180.- Example
>>> GeneratorDevice.set_burst_phase(str(150))
- Triggers
“BURS:PHAS 150”
- set_burst_state(state)
Enable or disable burst mode.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_burst_state(GeneratorConstants.ON)
- Triggers
“BURS:STAT ON”
- set_config(config)
Setter for
config_GeneratorConstants.py
.- Parameters
config – Stores all values from
config_GeneratorConstants.py
.
- set_duty_cycle_of_square_wave(percent_of_duty, channel='')
Set the duty cycle of square wave for selected function. <percent> is the percent of duty cycle selected, MIN is the minimum duty = 0 cycle of the selected frequency and MAX is the maximum = 100.
- Parameters
percent_of_duty (static variable from
GeneratorConstants
, str(<percent_value>)) – Percent values write in form str(<percent>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_duty_cycle_of_square_wave(GeneratorConstants.MAX)
- Triggers
“FUNC:SQU:DCYC 100”
- set_frequency(value, channel='')
Set the frequency of output function for channel. The default unit is Hz. Resolution is 1μHz.
Waveforms
Frequency limits
Sine
1μHz ~ 25MHz
Square
1μHz ~ 5MHz
Pulse
500μHz ~ 5MHz
Ramp/Triangle
1μHz ~ 500kHz
White Noise
5MHz bandwidth (-3dB)
Arb.
1μHz ~ 5MHz
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Frequency values write in form str(<value_in_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_frequency(str(1000))
- Triggers
“FREQuency 1000”
- set_modulated_wave_deviation(deviation, modulated_wave='AM')
Set the frequency deviation of FM or PM in Hz.
- Parameters
deviation (static variable from
GeneratorConstants
, str(<value>)) – Deviation in float write in form str(<value_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_deviation(str(100))
- Triggers
“FM:DEViation 100”
- set_modulated_wave_frequency(frequency_value, modulated_wave='AM')
Set the frequency of modulated_wave internal modulation in Hz.
- Parameters
frequency_value (static variable from
GeneratorConstants
, str(<value>)) – Defines frequency of mode function, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_frequency(str(200))
- Triggers
“AM:INT:FREQ 200”
- set_modulated_wave_function(wave_type, wave_mode='AM')
Select the internal modulating wave of modulated_wave. :param wave_type: Defines basic waveform function. Defaults to SIN. Write in form
GeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, NRAM, NOISE, TRI, USER.- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Example
>>> GeneratorDevice.set_modulated_wave_function(GeneratorConstants.SQUARE)
- Triggers
“AM:INT:FUNC SQU”
- set_modulated_wave_state(state, wave_mode='AM')
Disable or enable wave_mode function.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFFwave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_state(GeneratorConstants.ON)
- Triggers
“AM:STATe ON”
- set_output(on_off, channel='')
Disable or enable the Output connector of selected channel at the front panel. The default is “OFF”.
- Parameters
on_off (static variable from
GeneratorConstants
) – Defines state of output connector. Constants write in formGeneratorConstant.ON
. Values available: ON, OFF.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output(GeneratorConstants.ON)
- Triggers
“OUTP ON”
- set_output_load(value, channel='')
Select the desired output termination of selected channel. The specified value is only used for amplitude and offset voltage.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines value of output load, write in form str(<ohm_value>). Constants write in formGeneratorConstant.MIN>
. Values available: MIN, MAX, INF.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output_load(GeneratorConstants.ON)
- Triggers
“OUTP:LOAD 50”
- set_output_polarity(value, channel='')
Set the polarity of waveform output from selected channel.
- Parameters
value (static variable from
GeneratorConstants
) – Defines polarity of waveform. Constants write in formGeneratorConstant.INVERTED
. Values available: NORMAL, INVERTED.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output_polarity(GeneratorConstants.NORMAL)
- Triggers
“OUTP:POL NORM”
- set_output_sync(state)
Disable or enable the rear panel [Sync Output] connector of CH1.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_output_sync(GeneratorConstants.ON)
- Triggers
“OUTP:SYNC ON”
- set_phase(value, channel='')
Set the initial phase of signals output from selected channel.
- Parameters
value (static variable from
GeneratorConstants
, str(<angle>)) – Is the phase set by users, the default unit is degree. Write float in form str(<angle>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=-180, MAX=180.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_phase(str(90))
- Triggers
“PHAS 90”
- set_phase_align()
Enable the alignment phase output of dual channels.
- Example
>>> GeneratorDevice.set_phase_align()
- Triggers
“PHASe:ALIGN”
- set_pulse_duty_cycle(value, channel='')
Set the duty cycle of pulse for selected channel. The default unit is %.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse duty cycle, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_duty_cycle(str(50))
- Triggers
“PULSe:DCYCle 50”
- set_pulse_period(value, channel='')
Set the period of pulse output from selected channel in seconds.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse period, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_period(str(0.01))
- Triggers
“PULSe:PER 0.01”
- set_pulse_width(value, channel='')
Set the width of pulse for selected channel in seconds.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse width, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_width(str(0.005))
- Triggers
“PULSe:WIDTh 0.005”
- set_sweep_frequency(joiner, value)
Set the start, stop frequency (stop used in conjunction with start frequency) in sweep mode. Set the frequency center, span (span used in conjunction with center frequency) in sweep mode. The default unit is Hz.
- Parameters
joiner (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.START
. Values available: START, STOP, CENTER, SPAN.value (static variable from
GeneratorConstants
, str(<value>)) – Write float in form str(<value_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.
- Example
>>> GeneratorDevice.set_sweep_frequency(GeneratorConstants.START, str(5000))
- Triggers
“FREQuency:STARt 5000”
- set_sweep_spacing(spacing)
Select linear or logarithmic spacing for the sweep, the default is Linear.
- Parameters
spacing (static variable from
GeneratorConstants
,) – Define spacing type. Constants write in formGeneratorConstant.MIN
. Values available: LINEAR, LOGARITHMIC.- Example
>>> GeneratorDevice.set_sweep_spacing(GeneratorConstants.LINEAR)
- Triggers
“SWE:SPAC LIN”
- set_sweep_state(state)
Disable or enable the sweep mode.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_sweep_state(GeneratorConstants.ON)
- Triggers
“SWE:STAT OFF”
- set_sweep_time(sweep_time)
- Set the sweep time needed for the generator to sweep from the start frequency to the stop frequency,
the default time is 1s. <seconds> is the sweep time set by users, the unit is s.
- Parameters
sweep_time (static variable from
GeneratorConstants
, str(<value>)) – Sweep time seconds in float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN = 0.001s and MAX = 500s.- Example
>>> GeneratorDevice.set_sweep_time(str(10))
- Triggers
“SWE:TIME 10”
- set_symmetry_of_ramp_wave(percent_of_symmetry, channel='')
Set the symmetry of ramp wave output from selected channel. <percent> is the selected percent of symmetry; MIN=0, MAX=100.
- Parameters
percent_of_symmetry (static variable from
GeneratorConstants
, str(<percent_value>)) – Percent values write in form str(<percent>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_symmetry_of_ramp_wave(GeneratorConstants.MAX)
- Triggers
“FUNC:RAMP:SYMM 100”
- set_wave_function(wave_type, channel='')
Function selects the output function for selected channel.
- Parameters
wave_type (static variable from
GeneratorConstants
, optional) – Defines basic waveform function. Defaults to SIN. Write in formGeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, PULSE, NOISE, DC, USER.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_wave_function(GeneratorConstants.SINUSOID)
- Triggers
“FUNCtion SIN”
- set_wave_function_with_parameters(channel='', wave_type='SIN', frequency='', amplitude='', offset='')
Generate wave with specific frequency, amplitude and DC offset via CH1 or CH2. If the parameters you set are less than three, the sequence would be: <frequency>, <amplitude>, <offset>. Frequency limits can be found at
GeneratorDevice.set_frequency()
.- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.wave_type (static variable from
GeneratorConstants
, optional) – Defines basic waveform function. Defaults to SIN. Write in formGeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, PULSE, NOISE, DC, USER.frequency (str, optional) – Defines frequency value in int or float format in Hz. Initial value is 1000.
amplitude (str, optional) – Defines amplitude in int or float format in Vpp. Initial value is 5.
offset (str, optional) – Defines offset in int or float format in volts of direct current, VDC. Initial value is 0.
- Example
>>> GeneratorDevice.set_wave_function_with_parameters(amplitude=str(1001))
- Triggers
“APPL:SIN 1001,5.0,-1.5”
pyvilab_lib.device_multimeter module
Library of functions of multimeter DM3086
- class pyvilab_lib.device_multimeter.MultimeterConstants
Bases:
object
Class of static constants for multimeter
- AUTO = 'AUTO'
- AVERAGE = 'AVERAGE'
- CAPACITANCE = 'CAP'
- CONTINUITY = 'CONT'
- CURRENT_AC = 'CURR:AC'
- CURRENT_DC = 'CURR:DC'
- DB = 'DB'
- DBM = 'DBM'
- DEFAULT = 'DEF'
- DIODE = 'DIOD'
- EXTERNAL = 'EXT'
- FALL = 'FALL'
- FREQUENCY = 'FREQ'
- FRESISTANCE = 'FRES'
- HIGH = 'HIGH'
- LOW = 'LOW'
- MAXIMUM = 'MAX'
- MINIMUM = 'MIN'
- NEG = 'NEG'
- NONE = 'NONE'
- OFF = 'OFF'
- ON = 'ON'
- PERIOD = 'PER'
- PF = 'PF'
- POS = 'POS'
- RATE_FAST = 'F'
- RATE_MEDIUM = 'M'
- RATE_SLOW = 'S'
- RELATIVE = 'REL'
- RESISTANCE = 'RES'
- RISE = 'RISE'
- SINGLE = 'SINGLE'
- TEN_GIGA = '10G'
- TEN_MEGA = '10M'
- TOTAL = 'TOTAL'
- VOLTAGE_AC = 'VOLT:AC'
- VOLTAGE_DC = 'VOLT:DC'
- class pyvilab_lib.device_multimeter.MultimeterDevice(device='', timeout=0, recognition_sign='DM')
Bases:
VirtualInstrument
This is class of functions to control a Rigol DM3000 series digital multimeter. All essentials functions, that are common for all Rigol devices, are enherited from base class above.
- Parameters
device (str, optional) – Path to device. If the parameter is not defined, it searches device through path “/dev/usbtmc1” to “/dev/usbtmc3”.
timeout (float, optional) – Sets timeout between individual commands. Defaults to 0.
recognition_sign (str, optional) – Recognize part of devices name in string format. Default sign is “M” which stands for multimeter.
- get_calculate_function()
Queries the current selected math operation.
- Returns
The query returns the current selected operation, such as REL, DB, DBM, MIN, MAX, AVERAGE, TOTAL or PF. If more than one operation are used, the query may return a combination such as REL+PF; if all the operations are disabled, the query returns NONE.
- Return type
bytes
- Example
>>> MultimeterDevice.get_calculate_function()
- Triggers
“:CALCulate:FUNCtion?”
- get_data_acquired_success()
The command queries if a new data has been acquired under current trigger setting.
- Returns
TRUE | FALSE
- Return type
bytes
- Example
>>> MultimeterDevice.get_data_acquired_success()
- Triggers
“:MEASure?”
- get_dc_filter()
Queries the filter state.
- Returns
The query returns ON (1) or OFF (0).
- Return type
bytes
- Example
>>> MultimeterDevice.get_dc_filter()
- Triggers
“:MEASure:VOLTage:DC:FILTer?”
- get_external()
Queries the current external trigger type, the default is Rise trigger.
- Returns
The query returns: RISE, FALL, HIGH or LOW.
- Return type
bytes
- Example
>>> MultimeterDevice.get_external()
- Triggers
“:TRIGger:EXT?”
- get_measured()
The command queries the measured input type once.
- Returns
Returns value of measurement_type in scientific notation. e.g. 9.67441e-05 in SI base units. Units specificly described in
config_multimeter.json
.- Return type
bytes
- Example
>>> MultimeterDevice.get_measured()
- Triggers
“:MEASure:VOLTage:DC?”
- get_measuring_function()
Function queries the current measurement function is it currently using.
- Returns
Returns what measurement function we are on from: DCV, ACV, DCI, ACI, 2WR, 4WR, FREQ, PER, CONT, DIODE, CAP.
- Return type
bytes
- Example
>>> MultimeterDevice.get_measuring_function()
- Triggers
“:FUNCtion?”
- get_range()
The command queries the current measurement type range.
- Returns
0, 1, 2, 3, 4,… or any int value measurement_type can take. Closer info in
set_range()
doc.- Return type
bytes
- Example
>>> MultimeterDevice.get_range()
- Triggers
“:MEASure:VOLTage:DC:RANGe?”
- get_rate()
Queries the current measuring rate of measurement_type. The command is valid only when measurement_type function is enabled.
- Returns
Rate of measurement_type: FAST, MEDIUM, SLOW.
- Return type
bytes
- Example
>>> MultimeterDevice.get_rate()
- Triggers
“:RATE:VOLTage:DC?”
- get_trigger_auto_hold()
Queries if the hold function under auto trigger is enabled.
- Returns
The query returns the ON (1) or OFF (0).
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_hold()
- Triggers
“:TRIGger:AUTO:HOLD?”
- get_trigger_auto_hold_sensitivity()
Queries the current delay sensitive of auto trigger.
- Returns
The query returns: 0, 1, 2 or 3
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_hold_sensitivity()
- Triggers
“:TRIGger:AUTO:HOLD:SENSitivity?”
- get_trigger_auto_interval()
Queries the interval of auto trigger. Defaults to 400.
- Returns
The query returns the current interval of auto trigger. Unit is ms.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_interval()
- Triggers
“:TRIGger:AUTO:INTErval?”
- get_trigger_single()
Queries the number of sample under current single trigger. Defaults to 1.
- Returns
The query returns the number of sample under current single trigger.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_single()
- Triggers
“:TRIGger:SINGle?”
- get_trigger_source()
Queries the trigger source used currently.
- Returns
The query returns: AUTO, SINGLE or EXT.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_source()
- Triggers
“:TRIGger:SOURce?”
- get_vmcomplete_polar()
Queries the current VMC output polar, the default is POS (positive).
- Returns
The query returns the current VMC output polar, POS or NEG.
- Return type
bytes
- Example
>>> MultimeterDevice.get_vmcomplete_polar()
- Triggers
“:TRIGger:VMComplete:POLAr?”
- get_vmcomplete_pulse_width()
Queries the current VMC output pulsewidth. Defaults to 100ms.
- Returns
The query returns the VMC output pulsewidth time.
- Return type
bytes
- Example
>>> MultimeterDevice.get_vmcomplete_pulse_width()
- Triggers
“:TRIGger:VMComplete:PULSewidth?”
- get_voltage_dc_impedance()
The commands query the DC impedance.
- Returns
The query returns 10M or 10G (that is >10G).
- Return type
bytes
- Example
>>> MultimeterDevice.get_voltage_dc_impedance()
- Triggers
“:MEASure:VOLTage:DC:IMPEdance?”
- set_calculate_function(calc_func)
The commands set the math function. Default value is set to NONE. Functions can be stacked for desired calculate functions combinations, such as RELATIVE + MAXIMUM functions with individual function calls.
- Parameters
calc_func (static variable from
MultimeterConstants
, str) –One of following calculation functions in form:
MultimeterConstant.NONE
:Parameters
Desciption
NONE
Turn off all the math functions
RELATIVE
Relative operation
DB
dB operation
DBM
dBm operation
MINIMUM
Minimum operation
MAXIMUM
Maximum operation
AVERAGE
Average operation
TOTAL
Turn on all the statistics which include MIN, MAX and AVERAGE
PF
Limit operation
- Example
>>> MultimeterDevice.set_calculate_function(MultimeterConstants.AVERAGE)
- Triggers
“:CALCulate:FUNCtion AVERAGE”
- set_config(config)
Setter for
config_multimeter.py
.- Parameters
config – Stores all values from
config_multimeter.py
.
- set_dc_filter(state)
Opens or closes the filter.
- Parameters
state (static variable from
MultimeterConstants
, str) – Bool that opens or close filter. Write in formMultimeterConstant.ON
. Values available: ON, OFF- Example
>>> MultimeterDevice.set_dc_filter(MultimeterConstants.ON)
- Triggers
“:MEASure:VOLTage:DC:FILTer ON”
- set_external(trigger_type)
Sets the desired trigger type. The parameters provided are rise trigger, fall trigger, high-level trigger, low-level trigger.
- Parameters
trigger_type (static variable from
MultimeterConstants
, str) – Write in formMultimeterConstant.RISE
. Values available: RISE, FALL, HIGH, LOW.- Example
>>> MultimeterDevice.set_external(MultimeterConstants.RISE)
- Triggers
“:TRIGger:EXT RISE”
- set_measuring_function(measurement_type='CURR:DC')
Function enable common measurement function on devices front panel. Without parameter function sets last/default value. Defaults to VOLTAGE_DC.
- Parameters
measurement_type (static variable from
MultimeterConstants
, str) –Defines which measurement function will be enabled. Write in form
MultimeterConstant.VOLTAGE_DC
. Functions:VOLTAGE_DC,
VOLTAGE_AC,
CURRENT_DC,
CURRENT_AC,
RESISTANCE,
FRESISTANCE,
FREQUENCY,
PERIOD,
CONTINUITY,
DIODE,
CAPACITANCE
- Example
>>> MultimeterDevice.set_measuring_function()
- Triggers
“:FUNCtion:VOLTage:DC”
- set_range(meas_range)
The command sets the range (in some case resolution too) of measurement type. Closer info about ranges below. Only AUTO set works without measurement type value.
Tables with ranges of individual functions:
- VOLTAGE_DC
Parameter
Range
Resolution
0
200 mV
100 nV
1
2 V
1 μV
2
20 V
10 μV
3
200 V
100 μV
4
1000 V
1 mV
MINIMUM
200 mV
100 nV
MAXIMUM
1000 V
1 mV
DEFAULT
20 V
10 μV
- VOLTAGE_AC
Parameter
Range
0
200 mV
1
2 V
2
20 V
3
200 V
4
750 V
MINIMUM
200 mV
MAXIMUM
750 V
DEFAULT
20 V
- CURRENT_DC
Parameter
Range
Resolution
0
200 μA
1 nA
1
2 mA
10 nA
2
20 mA
100 nA
3
200 mA
1 μA
4
2 A
10 μA
5
10 A
100 μA
MINIMUM
200 μA
1 nA
MAXIMUM
10 A
100 μA
DEFAULT
200 mA
1 μA
- CURRENT_AC
Parameter
Range
0
20 mA
1
200 mA
2
2 A
3
10 A
MINIMUM
20 mA
MAXIMUM
10 A
DEFAULT
200 mA
- RESISTANCE
Parameter
Range
0
200 Ω
1
2 kΩ
2
20 kΩ
3
200 kΩ
4
1 MΩ
5
10 MΩ
6
100 MΩ
MAXIMUM
100 MΩ
MINIMUM
200 Ω
DEFAULT
200 kΩ
- FREQUENCY
The available frequency range is 20Hz~1MHz. For range ref. to table VOLTAGE_AC.
- CONTINUITY
The available frequency range is consecutive integer from 1 Ω to 2000 Ω. Default range is set to 10 Ω. Available values: 1~2000, MINIMUM, MAXIMUM, DEFAULT.
- CAPACITANCE
Parameter
Range
0
2 nF
1
20 nF
2
200 nF
3
2 μF
4
200 μF
5
10000 μF
MINIMUM
2 nF
MAXIMUM
10000 μF
DEFAULT
200 nF
- Parameters
meas_range (static variable from
MultimeterConstants
, str(meas_range)) – Any number corresponding to measurement_type, number info bellow. General ranges can be set viaMultimeter.Constants.AUTO
. Values can be: AUTO, MINIMUM, MAXIMUM, DEFAULT- Example
>>> MultimeterDevice.set_range(str(3))
- Triggers
“:MEASure:VOLTage:DC 3”
- set_rate(measure_speed)
Sets the desired measuring rate of measurement_type. For the range and the explanation of each parameter, see table below.
Parameter
Explanation
Mark
Rate
Refresh rate
RATE_FAST
Fast measure
F
123 reading/s
50 Hz
RATE_MEDIUM
Medium measure
M
20 reading/s
20 Hz
RATE_SLOW
Slow measure
S
2.5 reading/s
2.5 Hz
- Parameters
measure_speed (static variable from
MultimeterConstants
, str) – Defines speed of measurements. Write in formMultimeterConstant.RATE_FAST
. Values available: RATE_FAST, RATE_MEDIUM, RATE_SLOW.- Example
>>> MultimeterDevice.set_rate(MultimeterConstants.RATE_FAST)
- Triggers
“:RATE:VOLTage:DC F”
- set_trigger_auto_hold(state)
Sets the desired hold state under auto trigger.
- Parameters
state (static variable from
MultimeterConstants
, str) – Defines state of auto hold. Write in formMultimeterConstant.ON
. Values available: ON, OFF.- Example
>>> MultimeterDevice.set_trigger_auto_hold(MultimeterConstants.ON)
- Triggers
“:TRIGger:AUTO:HOLD ON”
- set_trigger_auto_hold_sensitivity(state)
Sets the desired delay sensitive of auto trigger. For the parameter range, see table below.
0 - (MIN) 0.01%
1 - 0.1%
2 - (DEF) 1%
3 - (MAX) 10%
- Parameters
state (static variable from
MultimeterConstants
, str) – str(<int delay, see in table above>), Write in formMultimeterConstant.DEF
. Values available: MIN, DEF, MAX.- Example
>>> MultimeterDevice.set_trigger_auto_hold_sensitivity(str(0))
- Triggers
“:TRIGger:AUTO:HOLD:SENSitivity MIN”
- set_trigger_auto_interval(interval_value)
Sets the desired interval of auto trigger. Different rate has different intervals:
In Fast measurement, the default interval is 8 ms and the available range is within 8 ms and 2000 ms;
In Medium measurement, the default interval is 50 ms and the available range is within 50 ms and 2000 ms;
In Slow measurement, the default interval is 400 ms and the available range is within 400 ms and 2000 ms.
The default measurement rate is Slow, so the default interval of the multimeter is 400 ms.
- Parameters
interval_value (str) – Desired interval of auto trigger in form str(<int:see explanation above>)
- Example
>>> MultimeterDevice.set_trigger_auto_interval(str(200))
- Triggers
“:TRIGger:AUTO:INTErval 200”
- set_trigger_single(state)
Sets the required sample number in single trigger mode. DEF = 1.
- Parameters
state (str) – str(<int sample number in range 1~2000>)
- Example
>>> MultimeterDevice.set_trigger_single(str(1000))
- Triggers
“:TRIGger:SINGle 1000”
- set_trigger_single_triggered()
The command enables the multimeter trigger once manually. The command is equal to execute a single trigger manually through front panel.
- Example
>>> MultimeterDevice.set_trigger_single_triggered()
- Triggers
“:TRIGger:SINGle:TRIGgered”
- set_trigger_source(source_type)
Sets the trigger source to be used. The parameter AUTO, SINGLE, EXT denotes Auto trigger, Single trigger and External trigger, separately.
- Parameters
source_type (static variable from
MultimeterConstants
, str) – Defines what trigger source to be set. Write in formMultimeterConstant.AUTO
. Values available: AUTO, SINGLE, EXTERNAL- Example
>>> MultimeterDevice.set_trigger_source(MultimeterConstants.AUTO)
- Triggers
“:TRIGger:SOURce AUTO”
- set_vmcomplete_polar(polar_state)
Sets the VMC output polar to be used. The parameters provided are positive and negative.
- Parameters
polar_state (static variable from
MultimeterConstants
) – Write in formMultimeterConstant.POS
. Values available: POS, NEG.- Example
>>> MultimeterDevice.set_vmcomplete_polar(MultimeterConstants.POS)
- Triggers
“:TRIGger:VMComplete:POLAr POS”
- set_vmcomplete_pulse_width(pulse_width)
Sets the desired VMC output pulsewidth, the unit is ms.
Note
The ranging of pulsewidth will vary with sample rate. When the sample rate is S, the range is 1~399(ms); when the sample rate is M, the range is 1~49(ms); and when the sample rate is F, the range is 1~7(ms).
- Parameters
pulse_width (str) – str(<int in ms, see above>)
- Example
>>> MultimeterDevice.set_vmcomplete_pulse_width(str(200))
- Triggers
“:TRIGger:VMComplete:PULSewidth 200”
- set_voltage_dc_impedance(impedance_value)
Sets the desired DC impedance value to 10 MΩ or >10 GΩ. .. Note:: 10G is available only when the DC voltage range is 200mV or 2V that is 0,1,MIN.
- Parameters
impedance_value (static variable from
MultimeterConstants
) – Impedance can be set viaMultimeter.Constants.TEN_MEGA
. Values can be: TEN_GIGA, TEN_MEGA- Example
>>> MultimeterDevice.set_voltage_dc_impedance("10G")
- Triggers
“:MEASure:VOLTage:DC:IMPEdance 10G”
pyvilab_lib.device_osciloscope module
Commands for osciloscope RIGOL DS2072A
- class pyvilab_lib.device_osciloscope.Oscilloscope1000Device(device='', timeout=0, recognition_sign='DS1')
Bases:
OscilloscopeDevice
- get_channel_range(channel='1')
Query the vertical range of the specified channel. The default unit is V.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the vertical range in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_range()
- Triggers
“:CHANnel1:RANGe?”
- get_channel_tcal(channel='1')
Query the delay calibration time of the specified channel to calibrate the zero offset of the corresponding channel. The default unit is s.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the delay calibration time in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_tcal()
- Triggers
“:CHANnel1:TCAL?”
- get_decoding_display(channel='1')
Query the current display status of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1. 1 means ON.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_display()
- Triggers
“:DEC1:DISPlay?”
- get_decoding_format(channel='1')
Query the current display format of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns HEX, DEC, BIN, LINE or ASC.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_format()
- Triggers
“:DEC1:FORMat?”
- get_decoding_mode(channel='1')
Query the current decoding mode of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns PAR, RS232, IIC or SPI.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_mode()
- Triggers
“:DEC1:MODE?”
- get_decoding_threshold(channel_decoder='1', channel='1')
Query the threshold level of the specified analog channel. The units for the trigger threshold match the units of the input channels.
- Parameters
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Defines source channel decoder. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current threshold in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_threshold()
- Triggers
“:DEC1:THRE:CHAN1?”
- get_decoding_threshold_auto(channel_decoder='1')
Query the status of the auto threshold function of the analog channels.
- Parameters
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 1 or 0.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_threshold_auto()
- Triggers
“:DEC1:THRE:AUTO?”
- get_math_auto_scale()
Query the status of the auto scale setting.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_auto_scale()
- Triggers
“:MATH:OPTion:ASCale?”
- get_math_display()
Query the math operation status.
- Returns
The query returns 1 or 0.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_display()
- Triggers
“:MATH:DISPlay?”
- get_math_fft_hcenter()
Query the center frequency of the FFT operation result, namely the frequency relative to the horizontal center of the screen. The default unit is Hz.
- Returns
The query returns the frequency value in scientific notation in Hz.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_hcenter()
- Triggers
“:MATH:FFT:HCEN?”
- get_math_fft_hscale()
Query the horizontal scale of the FFT operation result. The default unit is Hz.
- Returns
The query returns the horizontal scale in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_hscale()
- Triggers
“:MATH:FFT:HSC?”
- get_math_fft_mode()
Query the FFT mode.
- Returns
The query returns TRAC or MEM.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_mode()
- Triggers
“:TIMebase:MODE?”
- get_math_fft_source()
Query the current signal source of FFT operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_source()
- Triggers
“:MATH:FFT:SOUR?”
- get_math_fft_split()
Query the status of the half display mode of the FFT operation.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_split()
- Triggers
“:MATH:FFT:SPL?”
- get_math_fft_unit()
Query the vertical unit of the FFT operation result.
- Returns
The query returns VRMS or DB.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_unit()
- Triggers
“:MATH:FFT:UNIT?”
- get_math_fft_window()
Query the current window function of the FFT operation.
- Returns
The query returns RECT, BLAC, HANN, HAMM, FLAT, or TRI.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_window()
- Triggers
“:MATH:FFT:WIND?”
- get_math_invert()
Query the inverted display mode status of the operation result.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_invert()
- Triggers
“:MATH:INVert?”
- get_math_logic_source_1()
Query source A of logic operation.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_logic_source_1()
- Triggers
“:MATH:LSOUrce1?”
- get_math_logic_source_2()
Query source B of logic operation.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_logic_source_2()
- Triggers
“:MATH:LSOUrce2?”
- get_math_operator()
Query the operator of the math operation.
- Returns
The query returns ADD, SUBT, MULT, DIV, AND, OR, XOR, NOT, FFT, INTG, DIFF, SQRT, LOG, LN, EXP, ABS, or FILT.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_operator()
- Triggers
“:MATH:OPERator?”
- get_math_source_1()
Query the source or source A of algebraic operation/functional operation/the outer layer operation of compound operation.
- Returns
The query returns CHAN1, CHAN2, or FX.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_source_1()
- Triggers
“:MATH:SOURce1?”
- get_math_source_2()
Query the source or source B of algebraic operation/functional operation/the outer layer operation of compound operation.
- Returns
The query returns CHAN1, CHAN2, or FX.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_source_1()
- Triggers
“:MATH:SOURce2?”
- get_math_voffset()
Query the vertical offset of the operation result. The unit depends on the operator currently selected and the unit of the source.
- Returns
The query returns the vertical offset in scientific notation in V.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_voffset()
- Triggers
“:MATH:OFFSet?”
- get_math_vscale()
Query the vertical scale of the operation result. The unit depends on the operator currently selected and the unit of the source.
- Returns
The query returns 2.000000e+00.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_vscale()
- Triggers
“:MATH:SCALe?”
- get_measure_item(item, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES,channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:ITEM? VPP,CHAN1”
- get_measure_setup_dsa()
Query source A of RDELay 1→2 and FDELay 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_dsa()
- Triggers
“:MEASure:SETup:DSA?”
- get_measure_setup_dsb()
Query source B of RDELay 1→2 and FDELay 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psb()
- Triggers
“:MEASure:SETup:DSB?”
- get_measure_setup_psa()
Query source A of RPHase 1→2 and FPHase 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psa()
- Triggers
“:MEASure:SETup:PSA?”
- get_measure_setup_psb()
Query source B of RPHase 1→2 and FPHase 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psb()
- Triggers
“:MEASure:SETup:PSB?”
- get_measure_statistic_item(item, extra, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES.extra (static variable from
OscilloscopeConstants
) – Defines specific frequency measurement. Write in formOscilloscopeConstant.MAXIMUM
. Values available: MAXIMUM, MINIMUM, CURRENT, AVERAGE or DEVIATION.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_statistic_item(OscilloscopeConstants.VPP, >>> OscilloscopeConstants.MAXIMUM)
- Triggers
“:MEASure:STATistic:ITEM? MAXimum,VPP,CHAN1”
- set_acquire_memory_depth(memory_depth_value)
Set or query the memory depth of the oscilloscope (namely the number of waveform points that can be stored in a single trigger sample). The default unit is pts (points). Default value set is AUTO.
Note
The following equation describes the relationship among memory depth, sample rate, and waveform length:
Memory Depth = Sample Rate x Waveform Length
Wherein, the Waveform Length is the product of the horizontal timebase (set by the
set_timebase_scale()
method) times the number of grids in the horizontal direction on the screen (12 for DS1000Z-E). When AUTO is selected, the oscilloscope will select the memory depth automatically according to the current sample rate.- Parameters
memory_depth_value (str, static variable from
OscilloscopeConstants
) –Defines memory depth to be set. Static value write in form
OscilloscopeConstant.AUTO
. Other memory depth values can be set via str(<number>), where values can be:for single channel - AUTO, 12000, 120000, 1200000, 12000000, 24000000
for dual channel - AUTO, 6000, 60000, 600000, 6000000, 12000000
- Example
>>> Oscilloscope1000Device.set_acquire_memory_depth(str(1200000))
- Triggers
“:ACQuire:MDEPth 1200000”
- set_channel_range(range_value, channel='1')
Set the vertical range of the specified channel. The default unit is V. This command indirectly modifies the vertical scale of the specified channel (Vertical Scale = Vertical Range/8). The vertical scale can be set by the
set_channel_scale()
method.- Parameters
range_value (str) –
Default is 8V (the probe is 10X). Write in form str(<range>). Related to the probe ratio
When the probe ratio is 1X: 8mV to 80V
When the probe ratio is 10X: 80mV to 800V
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_range(str(1))
- Triggers
“:CHANnel1:RANGe 1”
- set_channel_tcal(calibration_time, channel='1')
Set the delay calibration time of the specified channel to calibrate the zero offset of the corresponding channel. The default unit is s.
- Parameters
calibration_time (str) –
Default is 0s. Write in form str(<time_delay>). Value can only be set to the specific values in the specified step. If the parameter you sent is not one of the specific values, the parameter will be set to the nearest specific values automatically. The step varies with the horizontal timebase (set by the
set_timebase_scale()
method, as shown in the table below.Horizontal Timebase
Step of the Delay Calibration Time
5ns
100ps
10ns
200ps
20ns
400ps
50ns
1ns
100ns
2ns
200ns
4ns
500ns
10ns
1μs to 10μs
20ns
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_tcal(str(1))
- Triggers
“:CHANnel1:TCAL 1”
- set_decoding_display(boolean, channel='1')
Enable or disable the display of bus 1 or 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_display(OscilloscopeConstants.ON)
- Triggers
“:DEC1:DISPlay ON”
- set_decoding_format(format_type, channel='1')
Set the display format of bus 1 or 2 to hexadecimal, decimal, binary or ASCII.
- Parameters
format_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.HEX
. Values available: HEX, DEC, BIN, ASCII, LINE.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_format(OscilloscopeConstants.HEX)
- Triggers
“:DEC1:FORMat HEX”
- set_decoding_mode(mode, channel='1')
Set the decoding mode of bus 1 or 2. PARallel, UART, SPI, and IIC correspond to parallel decoding, RS232 decoding, SPI decoding, and I2C decoding respectively.
- Parameters
mode (static variable from
OscilloscopeConstants
, optional) – Defines decoding mode. Write in formOscilloscopeConstant.PARALLEL
. Values available: PARALLEL, RS232, IIC, SPI.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_mode(OscilloscopeConstants.SPI)
- Triggers
“:DEC1:MODE SPI”
- set_decoding_threshold(threshold_value, channel_decoder='1', channel='1')
Set the threshold of the channel of parallel decoding on bus 1 or 2. Default value is 0. The units for the trigger threshold match the units of the input channels. By default, the auto threshold function of the analog channels of the oscilloscope is turned on. To set the threshold level manually, send the
set_decoding_threshold_auto()
method to turn off the auto threshold function.- Parameters
threshold_value (str) – Defines real number:(-4 x VerticalScale - VerticalOffset) to (4 x VerticalScale - VerticalOffset). Write in form srt(<number>). VerticalScale is the vertical scale of the specified analog channel. VerticalOffset is the vertical position of the specified analog channel.
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Defines decoder number. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_threshold(str(2.4))
- Triggers
“:DEC1:THRE:CHAN1 2.4”
- set_decoding_threshold_auto(boolean, channel_decoder='1')
Turn on or off the auto threshold function of the analog channels.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_threshold_auto(OscilloscopeConstants.ON)
- Triggers
“:DEC1:THRE:AUTO ON”
- set_math_auto_scale(boolean)
Enable or disable the auto scale setting of the operation result.
When the auto scale is enabled, the instrument will automatically calculate the vertical scale range according to the current operator, the vertical scale and the horizontal timebase. If the current scale is out of the range, it will adjust the vertical scale to the best value automatically.
Sending this command will modify the auto scale status of all the operation results.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_auto_scale(OscilloscopeConstants.ON)
- Triggers
“:MATH:OPTion:ASCale ON”
- set_math_display(boolean)
Enable or disable the math operation function.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_display(OscilloscopeConstants.ON)
- Triggers
“:MATH:DISPlay ON”
- set_math_fft_hcenter(center_frequency)
Set the center frequency of the FFT operation result, namely the frequency relative to the horizontal center of the screen. The default unit is Hz. Default value is 5MHz.
- Parameters
center_frequency (str) –
Defines horizontal offset. Write in form str(<number>). * When the FFT mode is set to TRACe, the range of <cent> is from 0 to (0.4 x FFT
sample rate). Wherein, FFT sample rate equals to screen sample rate, that is, 100/horizontal timebase.
When the FFT mode is set to MEMory, the range of <cent> is from 0 to (0.5 x FFT sample rate). Wherein, FFT sample rate equals to memory sample rate (
get_acquire_sample_rate()
).
- Example
>>> Oscilloscope1000Device.set_math_fft_hcenter(str(10000000))
- Triggers
“:MATH:FFT:HCEN 10000000”
- set_math_fft_hscale(hscale_value)
Set the horizontal scale of the FFT operation result. The default unit is Hz.
- Parameters
hscale_value – Write in form str(<number>).
Horizontal scale can be set to 1/1000, 1/400, 1/200, 1/100, 1/40, or 1/20 of the FFT sample rate.
When the FFT mode is set to TRACe, FFT sample rate equals to screen sample rate, that is, 100/horizontal timebase. When the FFT mode is set to MEMory, FFT sample rate equals to memory sample rate (
get_acquire_sample_rate()
).You can view the detailed information of the frequency spectrum by reducing the horizontal scale.
- Example
>>> Oscilloscope1000Device.set_math_fft_hscale(str(500000))
- Triggers
“:MATH:FFT:HSC 500000”
- set_math_fft_mode(mode)
Set the FFT mode. DEF = TRACE
- Parameters
mode (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.ROLL
. Values available: TRACE, MEMORY. * TRACE: denotes that the data source of the FFT operation is the data of thewaveform displayed on the screen.
MEMORY: denotes that the data source of the FFT operation is the data of the waveform in the memory.
- Example
>>> Oscilloscope1000Device.set_math_fft_mode(OscilloscopeConstants.MAIN)
- Triggers
“:TIMebase:MODE MAIN”
- set_math_fft_source(source_channel='1')
Select the signal source of FFT operation.
- Parameters
source_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_fft_source()
- Triggers
“:MATH:FFT:SOUR CHAN2”
- set_math_fft_split(boolean)
Enable or disable the half-screen display mode of the FFT operation. * Enable the half-screen display mode: the source channel and the FFT operation
results are displayed separately. The time domain and frequency domain signals are displayed clearly.
Disable the half-screen display mode (full-screen display mode): the source channel and the FFT operation results are displayed in the same window to view the frequency spectrum more clearly and to perform more precise measurement.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_fft_split(OscilloscopeConstants.ON)
- Triggers
“:MATH:FFT:SPL ON”
- set_math_fft_unit(vunit)
Set the vertical unit of the FFT operation result. Default value set is DB.
- Parameters
vunit (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.VRMS
. Values available: VRMS, DB.- Example
>>> Oscilloscope1000Device.set_math_fft_unit(OscilloscopeConstants.VRMS)
- Triggers
“:MATH:FFT:UNIT VRMS”
- set_math_fft_window(window_type)
Select the window function of the FFT operation. Spectral leakage can be considerably decreased when a window function is used. Different window functions are applicable to measure different waveforms. You need to select the window function according to waveform to be measured and its characteristics.
- Parameters
window_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.RECTANGLE
. Values available RECTANGLE, HANNING, HAMMING, BLACKMAN, FLATTOP, TRIANGLE.- Example
>>> Oscilloscope1000Device.set_math_fft_window(OscilloscopeConstants.HANNING)
- Triggers
“:MATH:FFT:WIND HANN”
- set_math_invert(boolean)
Enable or disable the inverted display mode of the operation result. This command is invalid for the FFT operation.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF.- Example
>>> Oscilloscope1000Device.set_math_invert(OscilloscopeConstants.ON)
- Triggers
“:MATH:INVert ON”
- set_math_logic_source_1(channel='1')
Set source A of logic operation. Default value set is CH1. The logic operations include A&&B, A||B, A^B, and !A.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_logic_source_1()
- Triggers
“:MATH:LSOUrce1 CHANnel1”
- set_math_logic_source_2(channel='2')
Set source B of logic operation. Default value set is CH1. The logic operations include A&&B, A||B, A^B, and !A.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_logic_source_2()
- Triggers
“:MATH:LSOUrce2 CHANnel2”
- set_math_operator(operator)
Set the operator of the math operation.
- Parameters
operator (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ADD
. Values available: ADD, SUBTRACT, MULTIPLY, DIVISION, FFT, AND, OR, XOR, NOT, INTG, DIFF, SQRT, LOG, LN, EXP, ABS, FILTER.- Example
>>> Oscilloscope1000Device.set_math_operator(OscilloscopeConstants.ADD)
- Triggers
“:MATH:OPERator ADD”
- set_math_reset()
Sending this command, the instrument adjusts the vertical scale of the operation result to the most proper value according to the current operator and the horizontal timebase of the source.
- Example
>>> Oscilloscope1000Device.set_math_reset()
- Triggers
“:MATH:RESet”
- set_math_source_1(channel='1')
Set the source or source A of algebraic operation/functional operation/the outer layer operation of compound operation. Default value set is CH1.
For algebraic operations, this command is used to set source A.
For functional operations, only this command is used to set the source.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_source_1()
- Triggers
“:MATH:SOURce1 CHANnel1”
- set_math_source_2(channel='2')
Set the source or source B of algebraic operation/functional operation/the outer layer operation of compound operation. Default value set is CH1.
This command is only applicable to algebraic operations (requiring two sources) and compound operations whose outer layer operations are algebraic operations.
When the outlayer operation of compound operation is algebraic operation, this command is used to set source B of the outer layer operation.
- ..Note: When the outer layer operation of compound operation is algebraic operation, at least
one of source A and source B of the outer layer operation should be set to FX.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, FX.- Example
>>> Oscilloscope1000Device.set_math_source_1()
- Triggers
“:MATH:SOURce2 CHANnel1”
- set_math_voffset(offset_value)
Set the vertical offset of the operation result. The unit depends on the operator currently selected and the unit of the source. Default value set is 0.00V.
- Parameters
offset_value (str) – Defines vertical offset value. Write in form str(<number>). The default unit is V. e Related to the vertical scale of the operation result Range: (-1000 x MathVerticalScale) to (1000 x MathVerticalScale) Step: MathVerticalScale/50 MathVerticalScale is the vertical scale of the operation result and can be set by the
set_math_vscale()
method.- Example
>>> Oscilloscope1000Device.set_math_voffset(str(2))
- Triggers
“:MATH:OFFSet 2”
- set_math_vscale(scale_value)
Set the vertical scale of the operation result. The unit depends on the operator currently selected and the unit of the source. Default value set is 1.00V.
The range of the vertical scale is related to the operator currently selected and the vertical scale of the source channel. For the integration (intg) and differential (diff) operations, it is also related to the current horizontal timebase.
- Parameters
scale_value (str) – Defines vertical scale value. Write in form str(<number>). The max range is from 1p to 5T (in 1-2-5 step)
- Example
>>> Oscilloscope1000Device.set_math_vscale(str(2))
- Triggers
“:MATH:SCALe 2”
- set_measure_item(item, channel='', second_channel='')
Enable any waveform parameter of the specified source.
If the parameter to be measured only needs a single source (see table below), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.- Voltage Parameters
VMAX: The voltage value from the highest point of the waveform to the GND.
VMIN: The voltage value from the lowest point of the waveform to the GND.
VPP: The voltage value from the highest point to the lowest point of the waveform.
VTOP: The voltage value from the flat top of the waveform to the GND.
VBASe: The voltage value from the flat base of the waveform to the GND.
VAMP: The voltage value from the top of the waveform to the base of the waveform.
VAVG: The arithmetic average value on the whole waveform or on the gating area. The calculation formula is as follows:
VRMS: The root mean square value on the whole waveform or the gating area.
OVERshoot: The ratio of the difference between the maximum value and top value of the waveform to the amplitude value.
PREShoot: The ratio of the difference between the minimum value and base value of the waveform to the amplitude value.
VUPper: The actual voltage value corresponding to the threshold maximum value.
VMID: The actual voltage value corresponding to the threshold middle value.
VLOWer: The actual voltage value corresponding to the threshold minimum value.
VARIance: The average of the sum of the squares for the difference between the amplitude value of each waveform point and the waveform average value on the whole waveform or on the gating area. The variance reflects the fluctuation degree of the waveform.
PVRMS: The root mean square value within a period. For the calculation formula, please refer to “Vrms”.
- Time Parameters
PERiod: Defined as the time between the threshold middle points of two consecutive, like-polarity edges.
FREQuency: Defined as the reciprocal of period.
RTIMe: The time for the signal amplitude to rise from the lower limit to the upper limit of the threshod.
FTIMe: The time for the signal amplitude to fall from the upper limit to the lower limit of the threshod.
PWIDth: The time difference between the threshold middle point of a rising edge to that of the next falling edge of the pulse.
NWIDth: The time difference between the threshold middle point of a falling edge to that of the next rising edge of the pulse.
PDUTy: The ratio of the positive pulse width to the period.
NDUTy: The ratio of the negative pulse width to the period.
TVMAX: The time corresponding to the waveform maximum value (Vmax).
TVMIN: The time corresponding to the waveform minimum value (Vmin).
- Others
MARea: The area of the whole waveform within the screen and the unit is voltage-second. The area meadured above the zero reference (namely the vertical offset) is positive and the area measured below the zero reference is negative. The area measured is the algebraic sum of the area of the whole waveform within the screen.
MPARea: The area of the first period of the waveform on the screen and the unit is voltage-second. The area above the zero reference (namely the vertical offset) is positive and the area below the zero reference is negative. The area measured is the algeraic sum of the area of the waveform within the whole period.
PSLEWrate: Divide the difference of the upper value and lower value on the rising edge by the corresponding time.
NSLEWrate: Divide the difference of the lower value and upper value on the falling edge by the corresponding time.
- Count value
PPULses: The number of positive pulses that rise from below the threshold lower limit to above the threshold upper limit.
NPULses: The number of negative pulses that fall from above the threshold upper limit to below the threshold lower limit.
PEDGes: The number of rising edges that rise from below the threshold lower limit to above the threshold upper limit.
NEDGes: The number of falling edges that fall from above the threshold upper limit to below the threshold lower limit.
- If the parameter to be measured needs two sources (see table below), the command needs to include two sources;
otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by
- the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.
RDELay: The time difference between the rising edges of source 1 and source 2. Negative delay indicates that the selected rising edge of source 1 occurred after the selected rising edge of source 2.
FDELay: The time difference between the falling edges of source 1 and source 2. Negative delay indicates that the selected falling edge of source 1 occurred after the selected falling edge of source 2.
RPHase: Phase difference calculated according to “RDELay 1→2” and the period of source 1, expressed in degree. The calculation formula is as shown below.
FPHase: Phase difference calculated according to “FDELay 1→2” and the period of source 1, expressed in degree.The calculation formula is as shown below.
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES,channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Example
>>> Oscilloscope1000Device.set_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:ITEM VPP,CHAN1”
- set_measure_setup_dsa(signal_source='1')
Set or query source A of RDELay 1→2 and FDELay 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_dsa()
- Triggers
“:MEASure:SETup:DSA CHAN1”
- set_measure_setup_dsb(signal_source='1')
Set or query source B of RDELay 1→2 and FDELay 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_dsb()
- Triggers
“:MEASure:SETup:DSB CHAN1”
- set_measure_setup_psa(signal_source='1')
Set or query source A of RPHase 1→2 and FPHase 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_psa()
- Triggers
“:MEASure:SETup:PSA CHAN1”
- set_measure_setup_psb(signal_source='1')
Set or query source B of RPHase 1→2 and FPHase 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_psb()
- Triggers
“:MEASure:SETup:PSB CHAN1”
- set_measure_statistic_item(item, channel='', second_channel='')
Enable the statistic function of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to . see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Example
>>> Oscilloscope1000Device.set_measure_statistic_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:STATistic:ITEM VPP,CHAN1”
- class pyvilab_lib.device_osciloscope.Oscilloscope2000Device(device='', timeout=0, recognition_sign='DS2')
Bases:
OscilloscopeDevice
- get_acquire_antialiasing()
The query returns the current state of the antialiasing function of the oscilloscope.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_acquire_antialiasing()
- Triggers
“:ACQuire:AALias?”
- get_calculate_fft_hcenter()
Query the current center frequency of the current FFT operation result.
- Returns
The query returns the frequency value in scientific notation in Hz.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hcenter()
- Triggers
“:CALC:FFT:HCEN?”
- get_calculate_fft_hoffset()
Query the current horizontal offset of the FFT operation result.
- Returns
The query returns the horizontal offset in scientific notation in Hz.
:rtype : bytes :Example:
>>> Oscilloscope2000Device.get_calculate_fft_hoffset()
- Triggers
“:CALC:FFT:HOFF?”
- get_calculate_fft_hscale()
Query the current horizontal coefficient in FFT operation.
- Returns
The query returns 1, 2, 3 or 4.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hscale()
- Triggers
“:CALC:FFT:HSC?”
- get_calculate_fft_hspan()
Query the current horizontal scale of the FFT operation result.
- Returns
The query returns the current horizontal scale in scientific notation and the unit is Hz/div.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hspan()
- Triggers
“:CALC:FFT:HSP?”
- get_calculate_fft_source()
Query the current signal source of FFT operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_source()
- Triggers
“:CALC:FFT:SOUR?”
- get_calculate_fft_split()
Query the current status of the split display of the FFT operation.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_split()
- Triggers
“:CALC:FFT:SPL?”
- get_calculate_fft_vsmode()
Query the current vertical scale of the FFT operation result.
- Returns
The query returns VRMS or DBVR.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_vsmode()
- Triggers
“:CALC:FFT:VSM?”
- get_calculate_fft_window()
Query the current window function of the FFT operation.
- Returns
The query returns RECT, HANN, HAMM or BLAC.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_window()
- Triggers
“:CALC:FFT:WIND?”
- get_calculate_invert()
Query the current status of the inverted display of the selected operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_invert()
- Triggers
“:CALC:SUB:INV?”
- get_calculate_mode()
Query the type of the current math operation.
- Returns
The query returns ADD, SUB, MULT, DIV, FFT, LOG, ADV or OFF.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_mode()
- Triggers
“:CALC:MODE?”
- get_calculate_source_a()
Query the current channel source of signal source A of defined operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_source_a()
- Triggers
“:CALC:SUB:SA?”
- get_calculate_source_b()
Query the current channel source of signal source B of defined operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_source_b()
- Triggers
“:CALC:SUB:SB?”
- get_calculate_voffset()
Query the current vertical offset of the defined operation result. The default unit is V. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.- Returns
The query returns the vertical offset in scientific notation in V.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_voffset()
- Triggers
“:CALC:SUB:VOFF?”
- get_calculate_vscale()
Query the current vertical scale of the defined operation result. Unit varies for different math functions, see
set_calculate_vscale()
description. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command withset_calculate_function()
.- Returns
The query returns 2.000000e+00.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_vscale()
- Triggers
“:CALC:SUB:VSC?”
- get_decoding_display(channel='1')
Query the current display status of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1. 1 means ON.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_display()
- Triggers
“:BUS1:DISPlay?”
- get_decoding_event(channel='1')
Query the current status of the event table of bus 1 or bus 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_event()
- Triggers
“:BUS1:EVENt?”
- get_decoding_format(channel='1')
Query the current display format of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns HEX, DEC, BIN or ASC.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_format()
- Triggers
“:BUS1:FORMat?”
- get_decoding_mode(channel='1')
Query the current decoding mode of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns PAR, RS232, IIC or SPI.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_mode()
- Triggers
“:BUS1:MODE?”
- get_decoding_parallel_clock(channel='1')
Query the current clock channel source of parallel decoding on bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns CHAN1, CHAN2 or OFF.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_clock()
- Triggers
“:BUS1:PAR:CLK?”
- get_decoding_parallel_offset(channel='1')
Query the current vertical offset in parallel decoding on bus 1 or bus 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the offset in integer.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_offset()
- Triggers
“:BUS1:PAR:OFFS?”
- get_decoding_parallel_slope(channel='1')
Query on which kind of edge of the clock the oscilloscope samples the data channel.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns POS, NEG or BOTH.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_slope()
- Triggers
“:BUS1:PAR:SLOPe?”
- get_decoding_parallel_threshold(channel='1')
Query the current threshold of the channel of parallel decoding on bus 1 or 2. The units for the trigger threshold match the units of the input channels.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the current threshold in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_threshold()
- Triggers
“:BUS1:PAR:THR?”
- get_measure_area()
Query the current type of the measurement range.
- Returns
The query returns SCR or CREG.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area()
- Triggers
“:MEASure:AREA?”
- get_measure_area_cax()
Query the current position of cursor A. Default value set is 300.
- Returns
The query returns an integer as value of position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area_cax()
- Triggers
“:MEASure:CREGion:CAX?”
- get_measure_area_cbx()
Query the current position of cursor B. Default value set is 300.
- Returns
The query returns an integer as value of position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area_cbx()
- Triggers
“:MEASure:CREGion:CBX?”
- get_measure_history_display()
Query the current status of the measurement history.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_history_display()
- Triggers
“:MEASure:HISTory:DISPlay?”
- get_measure_history_dmode()
Query the current display mode of the history measurement data
- Returns
The query returns TABL or GRAP.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_history_dmode()
- Triggers
“:MEASure:HISTory:DMODe?”
- get_measure_item(item, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source.
If the parameter to be measured only needs a single source, see table below, you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.Item
Description
Unit
VMAX
maximum
VMIN
minimum
VPP
peak-peak value
VTOP
top value
VBASe
base value
VAMP
value of the amplitude
VAVG
average of the amplitude
VRMS
RMS value of the amplitude
OVERshoot
overshoot
PREShoot
preshoot
PERiod
value of the period
s
FREQuency
frequency measurement
Hz
RTIMe
rise time
s
FTIMe
value of the fall time
s
PWIDth
positive pulse width
s
NWIDth
negative pulse width
s
PDUTy
positive duty cycle
NDUTy
value of the negative duty cycle
If the parameter to be measured needs two sources, see table below, the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the first source is selected by the
set_measure_source()
method by default.Item
Description
Unit
RDELay
delay between channels (rising edge)
s
FDELay
delay between channels (falling edge)
s
RPHase
phase deviation between channels (rising edge)
°
FPHase
phase deviation between channels (falling edge)
°
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.second_channel (static variable from
OscilloscopeConstants
, optional) – Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:VPP? CHAN1”
- get_measure_setup_type()
Query the type of current measurement setting.
- Returns
The query returns DEL, PHAS or THR.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_setup_type()
- Triggers
“:MEASure:SETup:TYPE?”
- get_measure_statistic_item(item, extra, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source.
If the parameter to be measured only needs a single source, see table below, you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.Item
Description
Unit
VMAX
maximum
VMIN
minimum
VPP
peak-peak value
VTOP
top value
VBASe
base value
VAMP
value of the amplitude
VAVG
average of the amplitude
VRMS
RMS value of the amplitude
OVERshoot
overshoot
PREShoot
preshoot
PERiod
value of the period
s
FREQuency
frequency measurement
Hz
RTIMe
rise time
s
FTIMe
value of the fall time
s
PWIDth
positive pulse width
s
NWIDth
negative pulse width
s
PDUTy
positive duty cycle
NDUTy
value of the negative duty cycle
If the parameter to be measured needs two sources ,see table below, the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the first source defaults to one selected by the
set_measure_source()
.Item
Description
Unit
RDELay
delay between channels (rising edge)
s
FDELay
delay between channels (falling edge)
s
RPHase
phase deviation between channels (rising edge)
°
FPHase
phase deviation between channels (falling edge)
°
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE.extra (static variable from
OscilloscopeConstants
) – Defines specific frequency measurement. Write in formOscilloscopeConstant.MAXIMUM
. Values available: MAXIMUM, MINIMUM, CURRENT, AVERAGE or DEVIATION.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method when not defined. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.second_channel (static variable from
OscilloscopeConstants
, optional) – Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- :Example:ITEM? VPP,
>>> Oscilloscope2000Device.get_measure_statistic_item(OscilloscopeConstants.VPP, >>> OscilloscopeConstants.MAXIMUM)
- Triggers
“:MEASure:VPP:SMAXimum? CHAN1”
- get_timebase_href_mode()
Query the current horizontal reference mode.
- Returns
The query returns CENT, TPOS or USER.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_href_mode()
- Triggers
“:TIMebase:HREF:MODE?”
- get_timebase_href_position()
Query the current user-defined reference position around which the waveform expands or compresses horizontally.
- Returns
The query returns an integer as a reference position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_href_position()
- Triggers
“:TIMebase:HREF:POSition?”
- get_timebase_vernier()
Query the current status of the fine adjustment of the horizontal scale.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_vernier()
- Triggers
“:TIMebase:VERNier?”
- get_waveform_points()
Query the current number of waveform points to be read.
- Returns
The query returns an integer.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_waveform_points()
- Triggers
“:WAVeform:POINts?”
- get_waveform_status()
Query and return the current waveform reading state.
IDLE: the waveform reading thread finishes.
READ: the waveform reading thread is running.
n: the current number of waveform points to be read.
- Returns
The query returns IDLE,n or READ,n.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_waveform_status()
- Triggers
“:WAVeform:STATus?”
- set_acquire_antialiasing(boolean)
Enable or disable the antialiasing function of the oscilloscope.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_acquire_antialiasing(OscilloscopeConstants.ON)
- Triggers
“:ACQuire:AALias ON”
- set_acquire_memory_depth(memory_depth_value)
Set the memory depth of the oscilloscope namely the number of waveform points that can be stored in a single trigger sample. DEF = AUTO.
- Parameters
memory_depth_value (str, static variable from
OscilloscopeConstants
) –Defines memory depth to be set. Static value write in form
OscilloscopeConstant.AUTO
. Other memory depth values can be set via str(<number>), where values can be:for single channel - AUTO, 14000, 140000, 1400000, 14000000, 56000000
for dual channel - AUTO, 7000, 70000, 700000, 7000000, 28000000
- Example
>>> Oscilloscope2000Device.set_acquire_memory_depth(str(1400000))
- Triggers
“:ACQuire:MDEPth 1400000”
- set_calculate_fft_hcenter(center_frequency)
Set the center frequency of the FFT operation result and the unit is Hz. Default value is 35MHz.
- Parameters
center_frequency (str) – Defines horizontal offset of the operation result +7* the current horizontal scalestr, as float number. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hcenter(str(10000000))
- Triggers
“:CALC:FFT:HCEN 10000000”
- set_calculate_fft_hoffset(offset_value)
Set the horizontal offset of the FFT operation result and the unit is Hz. Defaults to 0.
- Parameters
offset_value (str) – Write in form str(<number>). Number = -0.4*the current FFT sample rate of the screen to +0.4*the current FFT sample rate of the screen.
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hoffset(str(1000000))
- Triggers
“:CALC:FFT:HOFF 2”
- set_calculate_fft_hscale(hscale_value)
Set the horizontal coefficient in FFT operation. This command indirectly sets the FFT horizontal scale.
- Parameters
hscale_value (str) –
Write in form str(<number>). Horizontal scale = the current FFT sample rate of the screen divided by:
20
40
100
200
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hscale(str(2))
- Triggers
“:CALC:FFT:HSC 2”
- set_calculate_fft_hspan(sample_rate)
Set the horizontal scale of the FFT operation result. The default unit is Hz/div. Default value 5MHz/div.
- Parameters
sample_rate (str) – Defines current FFT sample rate of the screen/200 to the current FFT sample rate of the screen/20. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hspan(str(2500000))
- Triggers
“:CALC:FFT:HSP 2500000”
- set_calculate_fft_source(source_channel='1')
Select the signal source of FFT operation.
- Parameters
source_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_fft_source()
- Triggers
“:CALC:FFT:SOUR CHAN2”
- set_calculate_fft_split(boolean)
Enable or disable the split display of the FFT operation.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_calculate_fft_split(OscilloscopeConstants.ON)
- Triggers
“:CALC:FFT:SPL ON”
- set_calculate_fft_vsmode(vmode)
Set the vertical scale of the FFT operation result to linear or log.
- Parameters
vmode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.VRMS
. Values available: VRMS, DBVRMS.- Example
>>> Oscilloscope2000Device.set_calculate_fft_vsmode(OscilloscopeConstants.VRMS)
- Triggers
“:CALC:FFT:VSM VRMS”
- set_calculate_fft_window(window_type)
Select the window function of the FFT operation.
- Parameters
window_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.RECTANGLE
. Values available RECTANGLE, HANNING, HAMMING, BLACKMAN.- Example
>>> Oscilloscope2000Device.set_calculate_fft_window(OscilloscopeConstants.HANNING)
- Triggers
“:CALC:FFT:WIND HANN”
- set_calculate_invert(boolean)
Enable or disable the inverted display of the selected operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF.- Example
>>> Oscilloscope2000Device.set_calculate_invert(OscilloscopeConstants.ON)
- Triggers
“:CALC:SUB:INV ON”
- set_calculate_mode(mode)
Select the type of the math operation or disable the math operation function.
- Parameters
mode (static variable from
OscilloscopeConstants
) – Defines what math operation to use. Write in formOscilloscopeConstant.OFF
. Values available: ADD, SUBTRACT, MULTIPLY, DIVISION, FFT, LOGIC, OFF.- Example
>>> Oscilloscope2000Device.set_calculate_mode(OscilloscopeConstants.FFT)
- Triggers
“:CALC:MODE FFT”
- set_calculate_source_a(channel_source='1')
Select the channel source of signal source A of defined operation. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
channel_source (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_source_a()
- Triggers
“:CALC:SUB:SA CHAN1”
- set_calculate_source_b(channel_source='2')
Select the channel source of signal source B of defined operation. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
channel_source (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_source_b()
- Triggers
“:CALC:SUB:SB CHAN1”
- set_calculate_voffset(offset_value)
Set the vertical offset of the defined operation result. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.- Parameters
offset_value (str) – Defines vertical offset value. Write in form str(<number>). The default unit is V. offset_value range for every math_function -40 × VScale to 40 × VScale. DEF 0
- Example
>>> Oscilloscope2000Device.set_calculate_voffset(str(2))
- Triggers
“:CALC:SUB:VOFF 2”
- set_calculate_vscale(scale_value)
Set the vertical scale of the defined operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.scale_value for each math function. Value is related to the current channel scale:
Math function
Range
Default value
ADD
0.02V to 500V
2V
SUBTRACT
0.02V to 500V
2V
MULTIPLY
5.0e-08U to 1.0e+07U
2U
DIVISION
5.0e-07U to 5.0e+08U
2U
FFT
dBVrms: 1 to 100 | Vrms: 0.01 to 200
10dBVrms/div
- Parameters
scale_value (str) – Defines vertical scale value. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_vscale(str(2))
- Triggers
“:CALC:SUB:VSC 2”
- set_decoding_display(boolean, channel='1')
Enable or disable the display of bus 1 or 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_display(OscilloscopeConstants.ON)
- Triggers
“:BUS1:DISPlay ON”
- set_decoding_event(boolean, channel='1')
Enable or disable the event table of bus 1 or bus 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_event(OscilloscopeConstants.ON)
- Triggers
“:BUS1:EVENt ON”
- set_decoding_format(format_type, channel='1')
Set the display format of bus 1 or 2 to hexadecimal, decimal, binary or ASCII.
- Parameters
format_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.HEX
. Values available: HEX, DEC, BIN, ASCII.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_format(OscilloscopeConstants.HEX)
- Triggers
“:BUS1:FORMat HEX”
- set_decoding_mode(mode, channel='1')
Set the decoding mode of bus 1 or 2.
- Parameters
mode (static variable from
OscilloscopeConstants
, optional) – Defines decoding mode. Write in formOscilloscopeConstant.PARALLEL
. Values available: PARALLEL, RS232, IIC, SPI.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_mode(OscilloscopeConstants.SPI)
- Triggers
“:BUS1:MODE SPI”
- set_decoding_parallel_clock(source_channel, channel='1')
Set the clock channel source of parallel decoding on bus 1 or 2. When OFF is selected, no clock channel is set and the oscilloscope samples data once the channel data jumps. At this point, the edge set by the set_decoding_parallel_scope function can be ignored.
- Parameters
source_channel (static variable from
OscilloscopeConstants
) – Defines source channel for clock. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, OFF.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_clock(OscilloscopeConstants.CH2)
- Triggers
“:BUS1:PAR:CLK CHAN2”
- set_decoding_parallel_offset(offset_value, channel='1')
- Set the vertical offset in parallel decoding on bus 1 or 2. Enable the display of the bus
(refer to the
set_decoding_display function()
), before using this command.
- Parameters
offset_value – Write in form str<number>.
Normal: -166 to 148 {if scope.set_measure_statistic_display(scope.ON)},
Statistic: -163 to 143 {if scope.set_measure_statistic_display(scope.OFF)},
Half screen: -103 to 52 {the screen is divided into two windows (refer to the
set_timebase_delay_enable()
andset_calculate_fft_split functions()
).}>
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_decoding_parallel_offset(str(2))
- Triggers
“:BUS1:PAR:OFFS 2”
- set_decoding_parallel_slope(pos_value, channel='1')
Set the oscilloscope to sample the channel data on the rising edge, falling edge or rising&falling edges of the clock. When no clock channel is set (refer to the
set_decoding_parallel_clock()
function), the oscilloscope samples data once the channel data jumps and the edge set by this command can be ignored.- Parameters
pos_value (static variable from
OscilloscopeConstants
) – Defines what edge to be set for measurement. Write in formOscilloscopeConstant.POSITIVE
. Values available POSITIVE, NEGATIVE, BOTH.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_slope(OscilloscopeConstants.POSITIVE)
- Triggers
“:BUS1:PAR:SLOPe POS”
- set_decoding_parallel_threshold(source_channel, threshold_value, channel='1')
Set the threshold of the channel of parallel decoding on bus 1 or 2. Default value is 0. The units for the trigger threshold match the units of the input channels.
- Parameters
source_channel (static variable from
OscilloscopeConstants
) – Defines source channel. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2, OFF.threshold_value (str) – Defines real number:{± 5 × VerticalScale from the screen center - OFFSet. Write in form srt(<number>).
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_threshold(OscilloscopeConstants.CH2, str(2.4))
- Triggers
“:BUS1:PAR:THR CHAN2,2.4”
- set_measure_area(area_measured)
Set the measurement range to the screen region or the cursor region.
SCReen: waveforms within the screen region.
CREGion: region specified by cursor A (refer to the
set_measure_area_cax()
method) and cursor B (refer to theset_measure_area_cbx()
method).
- Parameters
area_measured (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.SCREEN
. Values available: SCREEN, CREGION.- Example
>>> Oscilloscope2000Device.set_measure_area(OscilloscopeConstants.CREGION)
- Triggers
“:MEASure:AREA CREG”
- set_measure_area_cax(cursor_value_a)
When the measurement range is set to the cursor region, use this command to set the position of cursor A. Default value set is 300.
- Parameters
cursor_value_a (str) – Defines position of cursor A. Values range available is 0 to (the current position of cursor B - 6). Write word str(<position>).
- Example
>>> Oscilloscope2000Device.set_measure_area_cax(str(20))
- Triggers
“:MEASure:CREGion:CAX 20”
- set_measure_area_cbx(cursor_value_b)
When the measurement range is set to the cursor region, use this command to set the position of cursor B. Default value set is 400.
- Parameters
cursor_value_b (str) – Defines position of cursor A. Values range available is cursor A + 6 to 697. Write word str(<position>).
- Example
>>> Oscilloscope2000Device.set_measure_area_cbx(str(600))
- Triggers
“:MEASure:CREGion:CBX 600”
- set_measure_history_display(boolean)
Enable or disable the measurement history.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_measure_history_display(OscilloscopeConstants.ON)
- Triggers
“:MEASure:HISTory:DISPlay ON”
- set_measure_history_dmode(display_mode)
Set the display mode of the history measurement data to table or graph. Before using this command, enable the measurement history (refer to the
set_measure_history_display()
method).TABLE: display the measurement results of the last 10 measurements of at most 5 measurement items that are enabled last in table mode.
GRAPH: display the measurement results of the last 10 measurements of at most 5 measurement items that are enabled last in graph mode. The measurement points are connected using linear interpolation.
- Parameters
display_mode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.TABLE
. Values available: TABLE, GRAPH.- Example
>>> Oscilloscope2000Device.set_measure_history_dmode(OscilloscopeConstants.TABLE)
- Triggers
“:MEASure:HISTory:DMODe TABLe”
- set_measure_setup_type(setup_type)
Set the type of measurement setting to phase, delay or threshold.
- Parameters
setup_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.DELAY
. Values available: DELAY, PHASE, THRESHOLD.- Example
>>> Oscilloscope2000Device.set_measure_setup_type(OscilloscopeConstants.PHASE)
- Triggers
“:MEASure:SETup:TYPE PHASe”
- set_timebase_href_mode(mode)
Set the horizontal reference mode namely the reference position according to which the waveform expands and compresses horizontally. Default mode set is CENTER.
- Parameters
mode (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.USER
. Values available: CENTER, TPOSITION, USER.CENTER: the waveform expands or compresses horizontally around the center of the screen.
TPOSITION: the waveform expands or compresses horizontally around the trigger position.
USER: the waveform expands or compresses horizontally around the user-defined reference position. Refer to the
set_timebase_href_position()
method.
- Example
>>> Oscilloscope2000Device.set_timebase_href_mode(OscilloscopeConstants.TPOSITION)
- Triggers
“:TIMebase:HREF:MODE TPOSition”
- set_timebase_href_position(position_value)
Set the user-defined reference position around which the waveform expands or compresses horizontally. Default value set is 0.
- Parameters
position_value (str) – Write in form str(<value>). Available range is from -350 to 350.
- Example
>>> Oscilloscope2000Device.set_timebase_href_position(str(150))
- Triggers
“:TIMebase:HREF:POSition 150”
- set_timebase_vernier(boolean)
Enable or disable the fine adjustment of the horizontal scale. Default value set is 0.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_timebase_vernier(OscilloscopeConstants.ON)
- Triggers
“:TIMebase:VERNier ON”
- set_tlhalf()
Set the trigger level to the vertical midpoint of the trigger signal amplitude.
- Example
>>> Oscilloscope2000Device.set_tlhalf()
- Triggers
“:TLH”
- set_waveform_begin()
Enable the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_begin()
- Triggers
“:WAVeform:BEGin”
- set_waveform_end()
Stop the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_end()
- Triggers
“:WAVeform:END”
- set_waveform_points(points_value)
Set the number of waveform points to be read. The number of waveform points is limited by the current reading mode of waveform (refer to the
set_waveform_mode()
method).- Parameters
points_value (str) – str({ int for NORMal: 1 to 1400 points MAX: 1 to the number of effective points currently on the screen RAW: 1 to the current maximum memory depth})
points_value –
Write in form str(<number>). Integer values available:
NORMal: 1 to 1400 points
MAX: 1 to the number of effective points currently on the screen
RAW: 1 to the current maximum memory depth
- Example
>>> Oscilloscope2000Device.set_waveform_points(str(600))
- Triggers
“:WAVeform:POINts 600”
- set_waveform_reset()
Reset the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_reset()
- Triggers
“:WAVeform:RESet”
- class pyvilab_lib.device_osciloscope.OscilloscopeConstants
Bases:
object
Class for storing static constants of oscilloscope
- ABS = 'ABS'
- AC = 'AC'
- ACLINE = 'ACLine'
- ADD = 'ADD'
- AMPERE = 'AMP'
- AND = 'AND'
- ASCII = 'ASC'
- AVERAGE = 'AVERage'
- BIN = 'BIN'
- BLACKMAN = 'BLAC'
- BOTH = 'BOTH'
- BW20M = '20M'
- BYTE = 'BYTE'
- CENTER = 'CENT'
- CH1 = '1'
- CH2 = '2'
- CREGION = 'CREG'
- CURRENT = 'CURRent'
- DB = 'DB'
- DBVRMS = 'DBVRms'
- DC = 'DC'
- DEC = 'DEC'
- DELAY = 'DELay'
- DEVIATION = 'DEViation'
- DIFF = 'DIFF'
- DIFFERENCE = 'DIFF'
- DIVISION = 'DIV'
- EDGE = 'EDGE'
- EXP = 'EXP'
- EXT = 'EXT'
- EXTREMUM = 'EXTR'
- FDELAY = 'FDELay'
- FFT = 'FFT'
- FILTER = 'FILTER'
- FLATTOP = 'FLAT'
- FPHASE = 'FPHase'
- FREQUENCY = 'FREQuency'
- FTIME = 'FTIMe'
- FX = 'FX'
- GND = 'GND'
- GRAPH = 'GRAP'
- HAMMING = 'HAMM'
- HANNING = 'HANN'
- HEX = 'HEX'
- HFREJECT = 'HFReject'
- HRESOLUTION = 'HRES'
- IIC = 'IIC'
- INTG = 'INTG'
- LFREJECT = 'LFReject'
- LINE = 'LINE'
- LN = 'LN'
- LOGIC = 'LOG'
- MAIN = 'MAIN'
- MAREA = 'MARea'
- MATH = 'MATH'
- MAXIMUM = 'MAX'
- MEMORY = 'MEM'
- MINIMUM = 'MINimum'
- MPAREA = 'MPARea'
- MULTIPLY = 'MULT'
- NDUTY = 'NDUTy'
- NEDGES = 'NEDGes'
- NEGATIVE = 'NEG'
- NORMAL = 'NORM'
- NOT = 'NOT'
- NPULSES = 'NPULses'
- NSLEWRATE = 'NSLEWrate'
- NWIDTH = 'NWIDth'
- OFF = 'OFF'
- ON = 'ON'
- OR = 'OR'
- OVERSHOOT = 'OVERshoot'
- PARALLEL = 'PARallel'
- PDUTY = 'PDUTy'
- PEAK = 'PEAK'
- PEDGEG = 'PEDGes'
- PERIOD = 'PERiod'
- PHASE = 'PHAS'
- POSITIVE = 'POS'
- PPULSES = 'PPULses'
- PRESHOOT = 'PREShoot'
- PSLEWRATE = 'PSLEWrate'
- PULSE = 'PULSe'
- PVRMS = 'PVRMS'
- PWIDTH = 'PWIDth'
- RAW = 'RAW'
- RDELAY = 'RDELay'
- RECTANGLE = 'RECT'
- RFALI = 'RFALI'
- ROLL = 'ROLL'
- RPHASE = 'RPHase'
- RS232 = 'RS232'
- RTIME = 'RTIMe'
- SCREEN = 'SCR'
- SPI = 'SPI'
- SQRT = 'SQRT'
- SUBTRACT = 'SUB'
- TABLE = 'TABL'
- THRESHOLD = 'THR'
- TPOSITION = 'TPOS'
- TRACE = 'TRAC'
- TRIANGLE = 'TRI'
- TVMAX = 'TVMAX'
- TVMIN = 'TVMIN'
- UNKNOWN = 'UNKN'
- USER = 'USER'
- VAMP = 'VAMP'
- VARIANCE = 'VARIance'
- VAVG = 'VAVG'
- VBASE = 'VBASe'
- VLOWER = 'VLOWer'
- VMAX = 'VMAX'
- VMID = 'VMID'
- VMIN = 'VMIN'
- VOLTAGE = 'VOLT'
- VPP = 'VPP'
- VRMS = 'VRMS'
- VTOP = 'VTOP'
- VUPPER = 'VUPper'
- WATT = 'WATT'
- WORD = 'WORD'
- XOR = 'XOR'
- XY = 'XY'
- class pyvilab_lib.device_osciloscope.OscilloscopeDevice(device='', timeout=0.05, recognition_sign='DS')
Bases:
VirtualInstrument
This is class of functions to control a Rigol DS series digital oscilloscope. All essentials functions, that are common for all Rigol devices, are enherited from base class above.
- Parameters
device (str, optional) – Path to device. If the parameter is not defined, it searches device through path “/dev/usbtmc1” to “/dev/usbtmc3”.
timeout (float, optional) – Sets timeout between individual commands. Defaults to 0.05.
recognition_sign (str, optional) – Recognize part of devices name in string format. Default sign is “S” which stands for scope.
- get_acquire_averages()
Query the current number of averages of the oscilloscope. Default value is 2.
- Returns
The query returns an integer between 2 and 8192(in case of DS2000) or 1024(in case of DS1000).
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_acquire_averages()
- Triggers
“:ACQuire:AVERages?”
- get_acquire_memory_depth()
Query the current memory depth of the oscilloscope.
- Returns
The query returns the actual number of points (integer) or AUTO.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_acquire_memory_depth()
- Triggers
“:ACQuire:MDEPth?”
- get_acquire_sample_rate()
Query the current sample rate. The default unit is Sa/s. Sample rate is the sample frequency of the oscilloscope, namely the waveform points sampled per second.
- Returns
The query returns the sample rate in scientific notation. e.g. The query returns 2.000000e+09 in Sa/s.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_acquire_sample_rate()
- Triggers
“:ACQuire:SRATe?”
- get_acquire_type()
Query the current acquisition mode of the sample.
- Returns
The query returns NORM, AVER, PEAK or HRES.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_acquire_type()
- Triggers
“:ACQuire:TYPE?”
- get_channel_bwlimit(channel='1')
Query the current bandwidth limit of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current bandwidth limit of CH1 or CH2. e.g.:20M
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_bwlimit()
- Triggers
“:CHANnel1:BWLimit?”
- get_channel_coupling(channel='1')
Query the current coupling mode of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current coupling mode of CH1 or CH2. AC, DC or GND.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_coupling()
- Triggers
“:CHANnel1:COUPling?”
- get_channel_display(channel='1')
Query the current status of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current bool status of CH1 or CH2. Returns 1 for ON or 0 for OFF.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_display()
- Triggers
“:CHANnel1:DISPlay?”
- get_channel_invert(channel='1')
Query the current status of the inverted display of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current bool status of the inverted display of CH1 or CH2. Returns 1 for ON or 0 for OFF
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_invert()
- Triggers
“:CHANnel1:INVert?”
- get_channel_offset(channel='1')
Query the current vertical offset of the waveform of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current real value of vertical offset of the waveform. E.g.: the query returns 1.000000e-02 in V.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_offset()
- Triggers
“:CHANnel1:OFFSet?”
- get_channel_probe(channel='1')
Query the probe attenuation ratio of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the attenuation ratio currently set. e.g.: 10.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_probe()
- Triggers
“:CHANnel1:PROBe?”
- get_channel_scale(channel='1')
Query the current vertical scale of the waveform of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
Current real value of vertical scale of the waveform. e.g. The query returns 1.000000e-00 in V.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_scale()
- Triggers
“:CHANnel1:SCALe?”
- get_channel_units(channel='1')
Query the current amplitude display unit of the CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns VOLT, WATT, AMP or UNKN.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_units()
- Triggers
“:CHANnel1:UNITs?”
- get_channel_vernier(channel='1')
Query the current status of the fine adjustment function of the vertical scale of CH1 or CH2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_vernier()
- Triggers
“:CHANnel1:VERNier?”
- get_measure_adisplay()
Query the current status of all measurement.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_adisplay()
- Triggers
“:MEASure:ADISplay?”
- get_measure_amsource()
Query the current signal source of all measurement.
- Returns
The query returns CHAN1, CHAN2 or MATH.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_amsource()
- Triggers
“:MEASure:AMSource?”
- get_measure_counter_source()
Query the current measurement source of the frequency counter.
- Returns
The query returns CHAN1, CHAN2 or OFF.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_counter_source()
- Triggers
“:MEASure:COUNter:SOURce?”
- get_measure_counter_value()
Query the measuremenmt result (frequency value, the unit is Hz) of the frequency counter. Before using this command, enable the frequency counter in
set_measure_counter_source()
function.- Returns
The query returns the current measurement value in scientific notation in Hz.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_counter_value()
- Triggers
“:MEASure:COUNter:VALue?”
- get_measure_max_threshold()
Query the current upper limit of threshold measurement. Default value set is 90.
- Returns
The query returns an integer between 7 and 95 and the unit is %.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_max_threshold()
- Triggers
“:MEASure:SETup:MAX?”
- get_measure_mid_threshold()
Query the current middle value of threshold measurement.
- Returns
The query returns an integer between 6 and 94 and the unit is %.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_mid_threshold()
- Triggers
“:MEASure:SETup:MID?”
- get_measure_min_threshold()
Query the current lower limit of threshold measurement.
- Returns
The query returns an integer from 5 to 93 and the unit is %.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_min_threshold()
- Triggers
“:MEASure:SETup:MIN?”
- get_measure_source()
Query the signal source of the current measurement parameter.
- Returns
The query returns CHAN1, CHAN2 or MATH.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_source()
- Triggers
“:MEASure:SOURce?”
- get_measure_statistic_display()
The query returns the current status of the statistic function.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_statistic_display()
- Triggers
“:MEASure:STATistic:DISPlay?”
- get_measure_statistic_mode()
Query the current statistic selection type.
- Returns
The query returns DIFF or EXTR.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_statistic_mode()
- Triggers
“:MEASure:STATistic:MODE?”
- get_timebase_delay_enable()
Query the current status of the delayed sweep.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_delay_enable()
- Triggers
“:TIMebase:DELay:ENABle?”
- get_timebase_delay_offset()
Query the current offset of the delayed time base.
- Returns
The query returns the offset in scientific notation in s.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_delay_offset()
- Triggers
“:TIMebase:DELay:OFFSet?”
- get_timebase_delay_scale()
Query the current scale of the delayed time base.
- Returns
The query returns the horizontal scale in scientific notation and unit is s/div.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_delay_scale()
- Triggers
“:TIMebase:DELay:SCALe?”
- get_timebase_mode()
Query the current horizontal time base mode.
- Returns
The query returns MAIN, XY or ROLL.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_mode()
- Triggers
“:TIMebase:MODE?”
- get_timebase_offset()
Query the current offset of the main time base.
- Returns
The query returns the offset in the scientific notation and unit is s.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_offset()
- Triggers
“:TIMebase:OFFSet?”
- get_timebase_scale()
Query the current scale of the main time base.
- Returns
The query returns the current scale of the main time base in scientific notation and unit is s/div.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_timebase_scale()
- Triggers
“:TIMebase:SCALe?”
- get_trigger_coupling()
Query the trigger coupling type.
- Returns
The query returns AC, DC, LFR, or HFR.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_trigger_coupling()
- Triggers
“:TRIGger:COUPling?”
- get_trigger_level()
Query the trigger level in edge trigger. The unit is the same as the current amplitude unit of the signal source selected.
- Returns
The query returns the trigger level in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_trigger_level()
- Triggers
“:TRIGger:EDGe:LEVel?”
- get_trigger_mode()
Query the trigger type.
- Returns
The query returns EDGE, PULS, RUNT, WIND, NEDG, SLOP, VID, PATT, DEL, TIM, DUR, SHOL, RS232, IIC, or SPI.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_trigger_mode()
- Triggers
“:TRIGger:MODE?”
- get_trigger_slope()
Query the edge type in edge trigger.
- Returns
The query returns POS, NEG, or RFAL.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_trigger_slope()
- Triggers
“:TRIGger:EDGe:SLOPe?”
- get_trigger_source()
Query the trigger source in edge trigger.
- Returns
The query returns CHAN1, CHAN2, EXT, ACL or AC.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_trigger_source()
- Triggers
“:TRIGger:EDGe:SOURce?”
- get_waveform_data()
Read the waveform data. This command is affected by timeout(delay) set on device, without delay its possible to read only 500 values per read. This command is affected by the
set_waveform_format()
see table below,set_waveform_mode()
,set_waveform_points()
,set_waveform_source()
and related functions.Return Format of the Waveform Data
Maximum Number of Waveform Points can be Read Each Time
BYTE
250000
WORD
125000
ASCii
15625
- Return:The data returned contains 2 parts
the TMC data description header and the waveform data. #900000ddddXXXX…
Wherein, dddd denotes the number of the effective waveform points in the data stream.
When reading the internal memory data, the waveform data returned each time might be the data block in one area of the buffer. Each data block has a TMC description header similar to #9XXXXXXXXX, wherein XXXXXXXXX denotes the number of the waveform points in this data block. Waveform data in two adjacent data blocks are consecutive.
The waveform data read can be converted to the voltage of each point of the waveform on the screen according to the method below.
The figure below shows the waveform data read. First, select “View as hexadecimal only” from the dropdown list at the right of Buffer; at this point, the waveform data read is displayed in hexadecimal format; the first 11 figures denote the number of bytes that the “Denoter” holds in the internal memory; the figures following are the waveform data on the screen and users can convert the waveform data read to the voltage of each point of the waveform on the screen using the formula (ox63 - vertical reference position in Y direction) × VerticalScale-OFFSet. For the vertical reference position in Y direction, refer to the
get_waveform_yreference()
func, for the VerticalScale, refer to theset_channel_scale()
funcion and for the OFFSet, refer to theset_channel_offset()
function.Note
when the return format of the waveform data is set to ASCii (refer to the
set_waveform_format()
function), the query returns the actual voltage of each.- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_data()
- Triggers
“:WAVeform:DATA?”
- get_waveform_format()
Query the current return format of the waveform data.
- Returns
The query returns WORD, BYTE or ASC.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_format()
- Triggers
“:WAVeform:FORMat?”
- get_waveform_mode()
Query the current reading mode of waveform.
- Returns
The query returns NORM, MAX or RAW.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_mode()
- Triggers
“:WAVeform:MODE?”
- get_waveform_preamble()
Query and return all the waveform parameters.
- Returns
The query returns 10 waveform parameters separated by comma: <format>, <type>, <points>, <count>, <xincrement>, <xorigin>, <xreference>, <yincrement>, <yorigin>, <yreference> Wherein DS2000:
<format>: 0 (WORD), 1 (BYTE) or 2 (ASC). Refer to the
get_waveform_format()
function.<type>: 0 (NORMAL), 1 (MAXIMUM) or 2 (RAW). Refer to the
get_waveform_mode()
function.<points>: integer between 1 and 56000000. Refer to the
get_waveform_points()
function.<count>: the number of averages in average sample mode (refer to the
get_acquire_averages()
function) and 1 in other modes.<xincrement>: the time difference between two neighboring points in X direction. Refer to the
get_waveform_xincrement()
function.<xorigin>: the time from the trigger point to the “Reference Time” in X direction. Refer to the
get_waveform_xorigin()
function.<xreference>: the reference time of the data point in X direction. Refer to the
get_waveform_xreference()
function.<yincrement>: the voltage value per unit in Y direction. Refer to the
get_waveform_yincrement()
function.<yorigin> the vertical offset relative to the “Vertical Reference Position” in Y direction. Refer to the
get_waveform_yorigin()
function.<yreference>: the vertical reference position in Y direction. Refer to the
get_waveform_yreference()
function.
And wherein DS1000:
<format>: 0 (BYTE), 1 (WORD) or 2 (ASC).
<type>: 0 (NORMal), 1 (MAXimum) or 2 (RAW).
<points>: an integer between 1 and 24000000.
<count>: the number of averages in the average sample mode and 1 in other modes.
<xincrement>: the time difference between two neighboring points in the X direction.
<xorigin>: the start time of the waveform data in the X direction.
<xreference>: the reference time of the data point in the X direction.
<yincrement>: the waveform increment in the Y direction.
<yorigin>: the vertical offset relative to the “Vertical Reference Position” in the Y direction.
<yreference>: the vertical reference position in the Y direction.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_preamble()
- Triggers
“:WAVeform:PREamble?”
- get_waveform_source()
Query the current channel source of waveform reading.
- Returns
The query returns CHAN1 or CHAN2, in case of DS1000 even MATH.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_source()
- Triggers
“:WAVeform:SOURce?”
- get_waveform_start()
Query the current start position of internal memory waveform reading.
- Returns
The query returns an integer.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_start()
- Triggers
“:WAVeform:STARt?”
- get_waveform_stop()
Query the current stop position of internal memory waveform reading.
- Returns
The query returns an integer.
- Example
>>> Oscilloscope1000Device.get_waveform_stop()
- Triggers
“:WAVeform:STOP?”
- get_waveform_xincrement()
Query the time difference between two neighboring points of the specified source (refer to the
set_waveform_source()
function) in X direction and the unit is s.- Returns
The query returns the time difference in scientific notation.
DS1000 oscilloscope return explanation:
The returned value is related to the current data reading mode:
In the NORMal mode, XINCrement = TimeScale/100.
In the RAW mode, XINCrement = 1/SampleRate.
In MAX mode, XINCrement = TimeScale/100 when the instrument is in running status; XINCrement = 1/SampleRate when the instrument is in stop status.
The unit is related to the current channel source: When the channel source is CHANnel1 or CHANnel2, the unit is s. When the channel source is MATH and the operation type is FFT, the unit is Hz.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_xincrement()
- Triggers
“:WAVeform:XINCrement?”
- get_waveform_xorigin()
Query the time from the trigger point to the reference time (refer to the
set_waveform_source()
function) of the specified source (refer to theget_waveform_xreference()
function) in X direction and the unit is s.- Returns
The query returns the time value difference in scientific notation.
DS1000 oscilloscope return explanation:
- The return value is related to the current data reading mode:
In NORMal mode, the query returns the start time of the waveform data displayed on the screen.
In RAW mode, the query returns the start time of the waveform data in the internal memory.
In MAX mode, the query returns the start time of the waveform data displayed on the screen when the instrument is in running status; the query returns the start time of the waveform data in the internal memory when the instrument is in stop status.
The unit is related to the current channel source: When the channel source is CHANnel1 or CHANnel2, the unit is s. When the channel source is MATH and the operation type is FFT, the unit is Hz.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_xorigin()
- Triggers
“:WAVeform:XORigin?”
- get_waveform_xreference()
Query the reference time of the specified source (refer to the
set_waveform_source()
function) in X direction and the unit is s.- Returns
The query returns the reference time in integer.
The query returns 0 (namely the first point on the screen or in the internal memory). :rtype: bytes :Example:
>>> Oscilloscope1000Device.get_waveform_xreference()
- Triggers
“:WAVeform:XREFerence?”
- get_waveform_yincrement()
Query the voltage value per unit of the specified source (refer to the
set_waveform_source()
function) in Y direction and the unit is the same with the unit of the signal source.- Returns
The query returns the voltage value in scientific notation.
DS1000 return explanation: The return value is related to the current data reading mode:
In NORMal mode, YINCrement = VerticalScale/25.
In RAW mode, YINCrement is related to the Verticalscale of the internal waveform and the Verticalscale currently selected.
In MAX mode, YINCrement = VerticalScale/25 when the instrument is in running status; YINCrement is related to the Verticalscale of the internal waveform and the Verticalscale currently selected when the instrument is in stop status.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_yincrement()
- Triggers
“:WAVeform:YINCrement?”
- get_waveform_yorigin()
Query the vertical offset relative to the vertical reference position (refer to the
set_waveform_source`function) of the specified source (refer to the :meth:`get_waveform_yreference()
function) in Y direction and the unit is the same with the unit of the signal source.
- Returns
The query returns the offset value in scientific notation
DS1000 return explanation: The return value is related to the current data reading mode:
In NORMal mode, YORigin = VerticalOffset/YINCrement.
In RAW mode, YORigin is related to the Verticalscale of the internal waveform and the Verticalscale currently selected.
In MAX mode, YORigin = VerticalOffset/YINCrement when the instrument is in running status; YORigin is related to the Verticalscale of the internal waveform and the Verticalscale currently selected when the instrument is in stop status.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_waveform_yorigin()
- Triggers
“:WAVeform:YORigin?”
- get_waveform_yreference()
Query the vertical reference position of the specified source (refer to the
set_waveform_source()
function) in Y direction and the unit is the same with the unit of the signal source.- Returns
The query returns the reference position in integer.
YREFerence is always 127 (the screen bottom is 0 and the screen top is 255). :rtype: bytes :Example:
>>> Oscilloscope1000Device.get_waveform_yreference()
- Triggers
“:WAVeform:YREFerence?”
- set_acquire_averages(count)
Set the number of averages and the value should be a power function of 2. Default value is 2. Use the
set_acquire_type()
func to select the average acquisition mode. In this mode, the oscilloscope averages the waveforms from multiple samples to reduce the random noise of the input signal and improve the vertical resolution. The greater the number of averages is, the lower the noise will be and the higher the vertical resolution will be but the slower the response of the displayed waveform to the waveform changes will be.- Parameters
count (str) – Defines number of averages. Write in form str(<number>}). Values available: * for DS2000 oscilloscope - 2 to 8192, * for DS1000 oscilloscope -2 to 1024.
- Example
>>> Oscilloscope1000Device.set_acquire_averages(str(128))
- Triggers
“:ACQuire:AVERages 128”
- set_acquire_type(acquisition_mode)
Set the acquisition mode of the sample. Default value is set to NORMAL.
NORMal : i n this mode, the oscilloscope samples the signal at equal time interval to rebuild the waveform. For most of the waveforms, the best display effect can be obtained using this mode.
AVERages: in this mode, the oscilloscope averages the waveforms from multiple samples to reduce the random noise of the input signal and improve the vertical resolution. The number of averages can be set by the:ACQuire:AVERages command. Greater number of averages can lower the noise and increase the vertical resolution, but will also slow the response of the displayed waveform to the waveform changes.
PEAK (Peak Detect): in this mode, the oscilloscope acquires the maximum and minimum values of the signal within the sample interval to get the envelope of the signal or the narrow pulse of the signal that might be lost. In this mode, signal confusion can be prevented but the noise displayed would be larger.
HRESolution (High Resolution): this mode uses a kind of ultra-sample technique to average the neighboring points of the sample waveform to reduce the random noise on the input signal and generate much smoother waveforms on the screen. This is generally used when the sample rate of the digital converter is higher than the storage rate of the acquisition memory.
- Parameters
acquisition_mode (static variable from
OscilloscopeConstants
) – Defines which acqisition mode will be enabled. Write in formOscilloscopeConstant.NORMAL
. Values available: NORMAL, AVERAGE, PEAK, HRESOLUTION.- Example
>>> Oscilloscope1000Device.set_acquire_type(OscilloscopeConstants.NORMAL)
- Triggers
“:ACQuire:TYPE NORMal”
- set_autoscale()
Enable the auto setting function. Note that to use the auto setting, the frequency of the signal under test should be no lower than 50 Hz, the duty cycle be greater than 1% and the amplitude be at least 20 mVpp
- Example
>>> Oscilloscope1000Device.set_autoscale()
- Triggers
“:AUT”
- set_channel_bwlimit(bandwidth_type, channel='1')
Set the bandwidth limit of CH1 or CH2. Enabling the bandwidth limit can reduce the noise, but can also attenuate the high frequency components.
- Parameters
bandwidth_type (static variable from
OscilloscopeConstants
) –Bandwidth limit: 20M (20 MHz) or OFF(turn bandwidth limit off). Write in form
Oscilloscope.BW20M
. Values available BW20M, OFF. * OFF: disable the bandwidth limit and the high frequency components of the signalunder test can pass the channel.
20M: enable the bandwidth limit and the high frequency components of the signal under test that exceed 20 MHz are attenuated.
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_bwlimit(OscilloscopeConstants.BW20M)
- Triggers
“:CHANnel1:BWLimit 20M”
- set_channel_coupling(coupling_type, channel='1')
Set the coupling mode of CH1 or CH2 to AC, DC or GND.
- Parameters
coupling_type (static variable from
OscilloscopeConstants
) –Defines coupling mode. Write in form
OscilloscopeConstant.AC
. Values available: AC, DC, GND.AC: the DC components of the signal under test are blocked.
DC: the DC and AC components of the signal under test can both pass the channel.
GND: the DC and AC components of the signal under test are both blocked.
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_coupling(OscilloscopeConstants.AC)
- Triggers
“:CHANnel1:COUPling AC”
- set_channel_display(boolean, channel='1')
Enable or disable CH1 or CH2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_display(OscilloscopeConstants.ON)
- Triggers
“:CHANnel1:DISPlay ON”
- set_channel_invert(boolean, channel='1')
Enable or disable the inverted display of CH1 or CH2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_invert(OscilloscopeConstants.ON)
- Triggers
“:CHANnel1:INVert ON”
- set_channel_offset(offset_value, channel='1')
Set the vertical offset of the waveform of CH1 or CH2. The default unit is V.
- Parameters
offset_value (str) –
Defines vertical offset of wavaform, as float number. Write in form str(<number>). DS 2000 defaults CH1 to 2V and CH2 to -2V. DS 1000 defaults to 0V (the probe ratio is 10X). Offset ranges:
- DS2000 oscilloscope
500μV/div to 50mV/div: ± 2V,
51mV/div to 200mV/div: ± 10V,
205mV/div to 2V/div: ± 50V,
2.05V/div to 10V/div: ± 100V
- DS1000 oscilloscope
When the probe ratio is 1X, vertical scale≥500mV/div: -100V to +100V, vertical scale<500mV/div: -2V to +2V
When the probe ratio is 10X, vertical scale≥5V/div: -1000V to +1000V, vertical scale<5V/div: -20V to +20V
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_offset(str(0.01))
- Triggers
“:CHANnel1:OFFSet 0.01”
- set_channel_probe(probe_attenuation, channel='1')
Set the probe attenuation ratio of CH1 or CH2. DEFAULT value is 1(DS2000) and 10(DS1000). Setting the probe ratio refers to multiply the signal sampled with the specified ratio and then display the result (the actual amplitude of the signal will not be affected). Setting the probe ratio will affect the range of the vertical scale.
- Parameters
probe_attenuation (str) – Defines probe attenuation ratio. Write in form str(<number>). Numbers available: 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000.
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_probe(str(1))
- Triggers
“:CHANnel1:PROBe 1”
- set_channel_scale(scale_value, channel='1')
Set the vertical scale of the waveform of CH1 or CH2. The default unit is V.
- Parameters
scale_value (str) –
Default is 1V. Write in form str(<number>). The range of the vertical scale is related to the probe ratio currently set. For the setting of the probe ratio, refer to the
set_channel_probe()
function. Related to the current probe ratio: * DS1000 oscilloscopeWhen the probe ratio is 1X: 1mV to 10V
When the probe ratio is 10X (default): 10mV to 100V
- DS2000 oscilloscope
500μV to 10V.
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_scale(str(1))
- Triggers
“:CHANnel1:SCALe 1”
- set_channel_units(display_units, channel='1')
Set the amplitude display unit of CH1 or CH2. Default value is VOLTAGE.
- Parameters
display_units (static variable from
OscilloscopeConstants
) – Defines amplitude units. Write in formOscilloscopeConstant.WATT
. Values available: VOLTAGE, WATT, AMPERE, UNKNOWN.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_units(OscilloscopeConstants.WATT)
- Triggers
“:CHANnel1:UNITs VOLTage”
- set_channel_vernier(boolean, channel='1')
Enable or disable the fine adjustment of the vertical scale of the specified channel, or query the fine adjustment status of the vertical scale of the specified channel. .. Note::By default, the fine adjustment is off. At this point, you can only set the vertical scale in
1-2-5 step, namely 10mV, 20mV, 50mV, 100mV…100V (the probe ratio is 10X). When the fine adjustment is on, you can further adjust the vertical scale within a relatively smaller range to improve the vertical resolution. If the amplitude of the input waveform is a little bit greater than the full scale under the current scale and the amplitude would be a little bit lower if the next scale is used, fine adjustment can be used to improve the display amplitude of the waveform to view the signal details.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_vernier(OscilloscopeConstants.ON)
- Triggers
“:CHANnel1:VERNier ON”
- set_clear()
Clear all the waveforms on the screen. Waveform will still be displayed if the oscilloscope is in RUN state.
- Example
>>> Oscilloscope1000Device.set_clear()
- Triggers
“:CLE”
- set_config(config)
Setter for
config_oscilloscope.py
.- Parameters
config – Stores all values from
config_oscilloscope.py
.
- set_measure_adisplay(boolean)
Enable or disable all measurement display. All measurement can measure all the time and voltage parameters of the current measurement source.
DS2000: Each measurement source has 20 kinds of measurement parameters and you can measure the three measurement sources (CH1, CH2 and MATH) at the same time.
10 kinds of voltage measurement items: maximum, minimum, peak-peak, top, bottom, amplitude, average, RMS, overshoot and preshoot.
8 kinds of time measurement items: period, frequency, rise time, fall time, positive pulse width, negative pulse width, positive duty cycle and negative duty cycle.
2 kinds of other measurement items: area and period area.
DS1000: The all measurement function can measure the following 29 parameters of the source at the same time:
Voltage Parameters: Vmax, Vmin, Vpp, Vtop, Vbase, Vamp, Vupper, Vmid, Vlower, Vavg, Vrms, Overshoot, Preshoot, Period Vrms, and Variance
Time Parameters: Period, Frequency, Rise Time, Fall Time, +Width, -Width, +Duty, -Duty, tVmax, and tVmin
Other Parameters: +Rate, -Rate, Area, and Period Area.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_measure_adisplay(OscilloscopeConstants.ON)
- Triggers
“:MEASure:ADISplay ON”
- set_measure_amsource(signal_source='1', signal_source_2='')
Set the source(s) of the all measurement function.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2 MATH.signal_source_2 (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2 MATH.
- Example
>>> Oscilloscope1000Device.set_measure_amsource()
- Triggers
“:MEASure:AMSource CHAN1”
- set_measure_clear()
Clear all measurement items on bottom.
- Example
>>> Oscilloscope1000Device.set_measure_clear()
- Triggers
“:MEASure:CLEar ALL”
- set_measure_counter_source(source='1')
Set the measurement source of the frequency counter or disable the frequency counter measurement. Analog channels (CH1 and CH2) can be selected no matter wether they are currently turned on. This function will not set last channel value.
- Parameters
source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.OFF
. Values available: CH1, CH2 or OFF.- Example
>>> Oscilloscope1000Device.set_measure_counter_source()
- Triggers
“:MEASure:COUNter:SOURce CHAN1”
- set_measure_max_threshold(upper_limit)
Set the upper limit of threshold measurement and the unit is %.
The threshold is the vertical level (in percentage) being measured in the analog channel. Setting the threshold will affect all the time, delay and phase parameters. You can also use the
set_measure_setup_type()
to select the threshold measurement setting.Setting the upper limit lower than the middle point will automatically reduce the middle point to keep it lower than the upper limit.
- Parameters
upper_limit (str) – Defines percent value of max threshold. Write in form str(<value>). Range is 7 to 95. Default value set is 90.
- Example
>>> Oscilloscope1000Device.set_measure_max_threshold(str(95))
- Triggers
“:MEASure:SETup:MAX 95”
- set_measure_mid_threshold(middle_value)
Set the middle value of threshold measurement and the unit is %.
The threshold is the vertical level (in percentage) being measured in the analog channel. Setting the threshold will affect all the time, delay and phase measurement parameters.
You can use the
get_measure_setup_type()
method to select the threshold measurement setting.The middle value set must be lower than the upper limit currently set (refer to the
get_measure_max_threshold()
method) and greater than the lower limit currently set (refer to theget_measure_min_threshold()
method).- Parameters
middle_value (str) – Defines percent value of mid threshold. Write in form str(<value>). Range is 6 to 94. Default value set is 50.
- Example
>>> Oscilloscope1000Device.set_measure_mid_threshold(str(94))
- Triggers
“:MEASure:SETup:MID 94”
- set_measure_min_threshold(lower_limit)
Set the middle value of threshold measurement and the unit is %.
The threshold is the vertical level (in percentage) being measured in the analog channel. Setting the threshold will affect all the time, delay and phase parameters. You can also use the
set_measure_setup_type()
to select the threshold measurement setting.Setting the lower limit greater than the middle point will automatically increase the middle point to keep it greater than the lower limit.
- Parameters
lower_limit (str) – Defines percent value of min threshold. Write in form str(<value>). Range is 5 to 93. Default value set is 10.
- Example
>>> Oscilloscope1000Device.set_measure_min_threshold(str(93))
- Triggers
“:MEASure:SETup:MIN 93”
- set_measure_recover()
Will recover all of measurement items.
- Example
>>> Oscilloscope1000Device.set_measure_recover()
- Triggers
“:MEASure:RECover ALL”
- set_measure_source(signal_source='1')
Select the signal source of the current measurement parameter. This function will not set last channel value. Analog channels (CH1 and CH2) can be selected no matter wether they are currently turned on.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2 MATH.- Example
>>> Oscilloscope1000Device.set_measure_source()
- Triggers
“:MEASure:SOURce CHAN1”
- set_measure_statistic_display(boolean)
Enable or disable the statistic function. When the statistic function is enabled, the system will make statistics and display the current value, average, minimum (or standard deviation) and maximum (or count) of at most five measurement items that are enabled last.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_measure_statistic_display(OscilloscopeConstants.ON)
- Triggers
“:MEASure:STATistic:DISPlay ON”
- set_measure_statistic_mode(mode)
Set the statistic selection to Extremum or Difference. When “Extremum” is selected, minimum and maximum values are displayed. When “Difference” is selected, standard deviation and count values are displayed. Before using thoes command, enable the statistic function (refer to the
set_measure_statictic_display()
command).- Parameters
mode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.DIFFERENCE
. Values available: DIFFERENCE, EXTREMUM.- Example
>>> Oscilloscope1000Device.set_measure_statistic_mode(OscilloscopeConstants.DIFFERENCE)
- Triggers
“:MEASure:STATistic:MODE DIFF”
- set_measure_statistic_reset()
Clear the history statistic data and make statistic again.
- Example
>>> Oscilloscope1000Device.set_measure_statistic_reset()
- Triggers
“:MEASure:STATistic:RESet”
- set_run()
Start the oscilloscope. You can use the set_stop function to set the oscilloscope to STOP.
- Example
>>> Oscilloscope1000Device.set_run()
- Triggers
“:RUN”
- set_single()
Set the oscilloscope to single trigger mode. In single trigger mode, the oscilloscope triggers once the trigger conditions are met and then stops. In single trigger mode, using the :TFORce command can generate a trigger signal forcefully. You can use the :RUN and :STOP command to set the oscilloscope to Auto trigger mode or STOP state respectively.
- Example
>>> Oscilloscope1000Device.set_single()
- Triggers
“:SING”
- set_stop()
Stop the oscilloscope. You can use the set_run function to set the oscilloscope to Run.
- Example
>>> Oscilloscope1000Device.set_stop()
- Triggers
“:STOP”
- set_tforce()
Generate a trigger signal forcefully. Force trigger is applicable to normal and single trigger modes.
- Example
>>> Oscilloscope1000Device.set_tforce()
- Triggers
“:TFOR”
- set_timebase_delay_enable(boolean)
Enable or disable the delayed sweep. Default value set is 0 or OFF.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_timebase_delay_enable(OscilloscopeConstants.ON)
- Triggers
“:TIMebase:DELay:ENABle ON”
- set_timebase_delay_offset(offset_value)
Set the offset of the delayed time base and the unit is s. Default value set is 0.
DS2000
LeftTime = 7 x MainScale – MainOffset. For the MainScale, refer to the
set_timebase_scale()
method.RightTime = 7 x MainScale + MainOffset. For the MainOffset, refer to the
set_timebase_offset()
method.DelayRange = 14 x DelayScale. For the DelayScale, refer to the
set_timebase_scale()
method.
- DS1000
LeftTime = 6 x MainScale - MainOffset
RightTime = 6 x MainScale + MainOffset
DelayRange = 12 x DelayScale
- Parameters
offset_value (str) – Write in form str(<number>). Range of values that are available: (LeftTime - DelayRange/2) to (RightTime - DelayRange/2).
- Example
>>> Oscilloscope1000Device.set_timebase_delay_offset(str(0.000002))
- Triggers
“:TIMebase:DELay:OFFSet 0.000002”
- set_timebase_delay_scale(scale_value)
Set the scale of the delayed time base and the unit is s/div. DEF = 500ns/div. For the MAIN SCALe, refer to the set_timebase_scale() command.
- Parameters
scale_value (str) –
Ranges of values available: * DS2000 - (1×50/real-time sample rate)×1/40 to the current MAIN SCALe. * DS1000 - The maximum value of <scale> is the main timebase scale currently set, and
the minimum value is expressed as: 50/(current sample rate x amplification factor). Wherein, the amplification factor is related to the sum number (the number of enabled analog channels plus the number of analog channels that are set as trigger sources). When the sum number counts as 1, the amplification factor is 10; when the sum number counts as 2, the amplification factor is 20. Note: If an analog channel is both enabled and set as the trigger source, the sum number will only be counted once. For example, ― If only CH1 is enabled currently and there is only one trigger source (CH1), then, the sum number counts as 1, and the amplification factor is 10. ― If only CH1 is enabled currently and there is only one trigger source (CH2), then, the sum number counts as 2, and the amplification factor is 20. ― If CH1 and CH2 are enabled currently; and there are two trigger sources (CH1 and CH2), then, the sum number counts as 2, and the amplification factor is 20.
- Example
>>> Oscilloscope1000Device.set_timebase_delay_scale(str(0.00000005))
- Triggers
“:TIMebase:DELay:SCALe 0.00000005”
- set_timebase_mode(mode)
Set the horizontal time base mode. For DS1000 Main means YT mode. DEF = MAIN
- Parameters
mode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ROLL
. Values available: MAIN, XY, ROLL.- Example
>>> Oscilloscope1000Device.set_timebase_mode(OscilloscopeConstants.MAIN)
- Triggers
“:TIMebase:MODE MAIN”
- set_timebase_offset(offset_value)
Set the offset of the main time base and the unit is s. Default value set is 0. .. TODO:: Check lists with shpinx.
- Parameters
offset_value (str) –
Write in form str(<number>).
DS2000
RUN:
MemDepth/SamplingRate to 1s (when the TimeScale < 20ms),
MemDepth/SamplingRate to 10×TimeScale (when the TimeScale >= to 20ms)
STOP: -7000s to 7000s
ROLL RUN: not avaliable
ROLL STOP: -7000s to 0})
DS1000
The range of <offset> is related to the current mode of the horizontal timebase (refer to
get_timebase_mode()
) and run state of the oscilloscope.YT mode RUN: (-0.5 x MemDepth/SampleRate) to 1s (when the horizontal timebase is less than 200ms/div) (-0.5 x MemDepth/SampleRate) to (10 x MainScale) (when the horizontal timebase is greater than or equal to 200ms/div, namely the “Slow Sweep” mode) STOP: (-MemDepth/SampleRate) to (1s + 0.5 x MemDepth/SampleRate)
Roll mode RUN: This command is invalid. STOP: (-12 x MainScale) to 0
Wherein, MemDepth is the current memory depth of the oscilloscope, SampleRate is the current sample rate of the oscilloscope, and MainScale is the current main timebase scale of the oscilloscope.
Note
For the MemDepth, refer to the
set_acquire_memory_depht()
method.For the SamplingRate, refer to the
get_acquire_sample_rate()
method.For the TimeScale, refer to the
set_timebase_scale()
method.
- Example
>>> Oscilloscope1000Device.set_timebase_offset(str(0.0002))
- Triggers
“:TIMebase:OFFSet 0.0002”
- set_timebase_scale(scale_value)
Set the scale of the main time base and the unit is s/div. Default value set is 1μs/div.
For DS1000 when the horizontal timebase mode is YT and the horizontal timebase is 200ms/div or larger (namely the “Slow Sweep” mode), this command is invalid when the oscilloscope is in the transition to the “Stop” state.
- Parameters
scale_value (str) – Depend on the time base mode in
set_timebase_mode()
. Ranges for each timebase mode: * DS2000 - Normal: 5ns to 1ks, ROLL: 200ms to 1ks. * DS1000 - YT mode: 5ns/div to 50s/div in 1-2-5 step, Roll mode: 200ms/div to 50s/div in 1-2-5 step.- Example
>>> Oscilloscope1000Device.set_timebase_scale(str(0.0002))
- Triggers
“:TIMebase:SCALe 0.0002”
- set_trigger_coupling(couple)
Select the trigger coupling type. This command is only applicable to edge trigger of which the signal source is an analog channel.
AC: block all the DC components and attenuate signals lower than 75 kHz.
DC: allow DC and AC components into the trigger path.
LFReject: block the DC components and reject the low frequency components (lower than 75 kHz).
HFReject: reject the high frequency components (higher than 75 kHz).
- Parameters
couple (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.AC
. Values available: AC, DC, LFREJECT, HFREJECT.- Example
>>> Oscilloscope1000Device.set_trigger_coupling(OscilloscopeConstants.DC)
- Triggers
“:TRIGger:COUPling EDGE”
- set_trigger_level(level_value)
Set the trigger level in edge trigger. The unit is the same as the current amplitude unit of the signal source selected.
For VerticalScale, refer to the
set_channel_scale()
method. For OFFSet, refer to theset_channel_offset()
method.- Parameters
level_value (str) –
Write in form str(<value>). Range available:
DS1000: (-5 x VerticalScale - OFFSet) to (5 x VerticalScale - OFFSet)
DS2000: ± 5 × VerticalScale from the screen center - OFFSet
- Example
>>> Oscilloscope1000Device.set_trigger_level(str(2))
- Triggers
“:TRIGger:EDGe:LEVel 2”
- set_trigger_mode(mode)
Select the trigger type.
- Parameters
mode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.EDGE
. Values available: EDGE, PULSE.- Example
>>> Oscilloscope1000Device.set_trigger_mode(OscilloscopeConstants.PULSE)
- Triggers
“:TRIGger:MODE EDGE”
- set_trigger_slope(slope)
Set the edge type in edge trigger.
- Parameters
slope (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.POSITIVE
. Values available: POSITIVE, NEGATIVE, RFALI.- Example
>>> Oscilloscope1000Device.set_trigger_slope(OscilloscopeConstants.POSITIVE)
- Triggers
“:TRIGger:EDGe:SLOPe POSitive”
- set_trigger_source(source_val='1')
Set the trigger source in edge trigger.
- Parameters
source_val (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.AC
. Values available:DS1000: CH1, CH2, AC.
DS2000: CH1, CH2, EXT, ACLINE.
- Example
>>> Oscilloscope1000Device.set_trigger_source()
- Triggers
“:TRIGger:EDGe:SOURce CHAN1”
- set_waveform_format(format_value)
Set the return format of the waveform data. Default value set is BYTE.
- Parameters
format_value (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.WORD
. Values available: WORD, BYTEBYTE, ASCII.WORD: a waveform point occupies two bytes (namely 16 bits) in which the lower 8 bits are valid and the higher 8 bits are 0.
BYTE: a waveform point occupies one byte (namely 8 bits).
ASCii: return the actual voltage value of each waveform point in scientific notation. The voltage values are separated by commas.
- Example
>>> Oscilloscope1000Device.set_waveform_format(OscilloscopeConstants.WORD)
- Triggers
“:WAVeform:FORMat WORD”
- set_waveform_mode(mode)
Set the reading mode of waveform. Default value set is NORMAL. In different modes, the
get_waveform_points()
function returns different numbers of waveform points.- Parameters
mode (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.RAW
. Values available: NORMAL, MAXIMUM, RAW.NORMAL: return the number of waveform points currently displayed.
MAXIMUM: return the maximum number of effective data points under the current state. Return the number of data points displayed on the screen when the instrument is in run state and the number of data points in the internal memory in stop state.
RAW: It is only available when the instrument is in stop state. You can use the
set_waveform_points()
function to set the desired number of data points in the internal memory.If the MATH channel is selected, only the NORMal mode is valid.
- Example
>>> Oscilloscope1000Device.set_waveform_mode(OscilloscopeConstants.RAW)
- Triggers
“:WAVeform:MODE RAW”
- set_waveform_source(channel_source='1')
Set the channel source of waveform reading. Default value set is CH1. MATH will not be set as default channel. If the MATH channel is selected, only NORMAL can be selected in
set_waveform_mode()
.- Parameters
channel_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2. MATH option only available for DS1000.- Example
>>> Oscilloscope1000Device.set_waveform_source()
- Triggers
“:WAVeform:SOURce CHAN2”
- set_waveform_start(start_position)
Set the start position of internal memory waveform reading. For the memory depth, refer to the
set_acquire_memory_depth()
function.When reading the waveform data in the internal memory, the actual settable ranges of the start point and stop point of a reading operation are related to the memory depth of the oscilloscope and the return format of the waveform data currently selected; for the details, refer to the explanation in the
get_waveform_data()
method.- Parameters
start_position (str) –
Write in form str(<number>). The setting of the start position is limited by the current reading mode of the waveform (refer to the
set_waveform_mode()
function).NORMAL: 1 to 1400 (1200 for DS1000 oscilloscope)
MAX: 1 to the number of effective point currently on the screen
RAW: 1 to the current maximum memory depth
- Example
>>> Oscilloscope1000Device.set_waveform_start(str(100))
- Triggers
“:WAVeform:STARt 100”
- set_waveform_stop(stop_position)
Set the stop position of internal memory waveform reading. For the memory depth, refer to the
set_acquire_memory_depth()
function.When reading the waveform data in the internal memory, the actual settable ranges of the start point and stop point of a reading operation are related to the memory depth of the oscilloscope and the return format of the waveform data currently selected; for the details, refer to the explanation in the
get_waveform_data()
method.- Parameters
stop_position (str) –
Write in form str(<number>). The setting of the stop position is limited by the current reading mode of the waveform (refer to the
set_waveform_mode()
function).NORMAL: 1 to 1400 (1200 for DS1000 oscilloscope)
MAX: 1 to the number of effective point currently on the screen
RAW: 1 to the current maximum memory depth
- Example
>>> Oscilloscope1000Device.set_waveform_stop(str(200))
- Triggers
“:WAVeform:STOP 200”
pyvilab_lib.instrument module
- class pyvilab_lib.instrument.MetaConst
Bases:
type
Class that removes setter function, so it makes variables and methods static
- class pyvilab_lib.instrument.VirtualInstrument(device, timeout, recognition_sign)
Bases:
object
Simple implementation of a USBTMC device driver, in the style of visa.h
- clear_errors()
Read and clear an error from error queue.
- Returns
The query returns an error information in following format: -118,”Invalid parameter”
- Return type
bytes
- Example
>>> VirtualInstrument.clear_errors()
- Triggers
“SYSTem:ERRor?”
- close()
- get_name()
- open()
- query(command)
- read(length=4000)
- send_reset()
Restore the instrument to the default state.
- Example
>>> VirtualInstrument.send_reset()
- Triggers
“*RST”
- write(command)
Module contents
- class pyvilab_lib.GeneratorConfig
Bases:
object
Working on all basic and arbitrary waveforms Not working for AM, FM, PM, PULSE, SWEEP and BURST modes
- Example:
>>> from pyvilab_lib import GeneratorDevice, GeneratorConfig >>> >>> generator = GeneratorDevice() >>> generator.open() >>> >>> config = GeneratorConfig() >>> config.channel = "CH1" >>> config.wave_type = "COT" >>> config.frequency = "12000" >>> config.amplitude = "5" >>> config.offset = "-1.5" >>> generator.set_config(config) >>> generator.close()
- class pyvilab_lib.GeneratorConstants
Bases:
object
Class storing static constants for GeneratorConstants
- ABS_SINE = 'AbsSine'
- ABS_SINE_HALF = 'AbsSineHalf'
- AIRY = 'Airy'
- AMP_ALT = 'AmpALT'
- AM_MODE = 'AM'
- ATT_ALT = 'AttALT'
- BAND_LIMITED = 'BandLimited'
- BARLETT = 'Barlett'
- BLACKMAN = 'Blackman'
- BOXCAR = 'Boxcar'
- BUTTERWORTH = 'Butterworth'
- CARDIAC = 'Cardiac'
- CENTER = 'CENT'
- CH1 = ''
- CH2 = 'CH2'
- CHEBYSHEV1 = 'Chebyshev1'
- CHEBYSHEV2 = 'Chebyshev2'
- COMBIN = 'Combin'
- COT = 'Cot'
- CPULSE = 'Cpulse'
- DC = 'DC'
- DIRICHLET = 'Dirichlet'
- EXP_FALL = 'Exp_Fall'
- EXP_RISE = 'Exp_Rise'
- FM_MODE = 'FM'
- GAMMA = 'Gamma'
- GATED = 'GAT'
- GAUSS = 'Gauss'
- GAUSS_PULSE = 'GaussPulse'
- HAMMING = 'Hamming'
- HANNING = 'Hanning'
- HAVER_SINE = 'HaverSine'
- INF = 'INF'
- INVERTED = 'INV'
- KAISER = 'Kaiser'
- LINEAR = 'LIN'
- LIST_OF_COMMON_WAVEFORMS = {'DC', 'NOISE', 'PULSE', 'RAMP', 'SINUSOID', 'SQUARE', 'USER'}
- LOGARITHMIC = 'LOG'
- LORENTZ = 'Lorentz'
- MAX = 'MAX'
- MIN = 'MIN'
- NEG_RAMP = 'NegRamp'
- NOISE = 'NOIS'
- NORMAL = 'NORM'
- NPULSE = 'NPulse'
- NRAM = 'NRAM'
- OFF = 'OFF'
- ON = 'ON'
- PM_MODE = 'PM'
- PPULSE = 'PPulse'
- PULSE = 'PULS'
- QUAKE = 'Quake'
- RAMP = 'RAMP'
- ROUNDHALF = 'RoundHalf'
- ROUNG_PM = 'Roundpm'
- SINC = 'Sinc'
- SINE_TRA = 'SINE_TRA'
- SINE_VER = 'SINE_VER'
- SINUSOID = 'SIN'
- SPAN = 'SPAN'
- SQRT = 'Sqrt'
- SQUARE = 'SQU'
- STAIR_DOWN = 'StairDown'
- STAIR_UD = 'StairUD'
- STAIR_UP = 'StairUp'
- START = 'STAR'
- STEP_RESPONSE = 'Stepresponse'
- STOP = 'STOP'
- TAN = 'Tan'
- TRAPEZIA = 'Trapezia'
- TRI = 'TRI'
- TRIANG = 'triang'
- TRIGGERED = 'TRIG'
- TV = 'TV'
- UNIT_DBM = 'DBM'
- UNIT_VPP = 'VPP'
- UNIT_VRMS = 'VRMS'
- USER = 'USER'
- VOICE = 'Voice'
- X2 = 'X^2'
- class pyvilab_lib.GeneratorDevice(device='', timeout=0.05, recognition_sign='DG')
Bases:
VirtualInstrument
This is class of functions to control a Rigol DG1000 series waveform GeneratorConstants. All essentials functions, that are common for all Rigol devices, are enherited from base class above.
- Parameters
device – Path to device in string. If the parameter is not defined, it searches device through path
“/dev/usbtmc1” to “/dev/usbtmc3”. :type device: str, optional :param timeout: Sets timeout between individual commands. Default is 0.05. :type timeout: float, optional :param recognition_sign: Recognize part of devices name in string format. Default sign is “G” which stands for GeneratorConstants. :type recognition_sign: str, optional
- get_am_depth(peak='')
Query the depth of AM internal modulation.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of am depth to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the percent of the depth of AM internal modulation in scientific notation, such as: 7.000000e+01 in %.
- Return type
bytes
- Example
>>> GeneratorDevice.get_am_depth()
- Triggers
“AM:DEPT?”
- get_amplitude(channel='')
Query the output amplitude of selected channel. :param channel: Defaults to last used channel or CH1. Write in form
GeneratorConstant.CH2
.Values available: CH1, CH2.
- Returns
The query returns the amplitude of the function currently selected in scientific notation, such as: 4.000000e-03.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude()
- Triggers
“VOLTage?”
- get_amplitude_high_level(channel='')
Query the high level of waves output from selected channel. The default unit is Vpp.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the high level set in scientific notation, such as: 1.000000e+01 in Vpp.
- Example
>>> GeneratorDevice.get_amplitude_high_level()
- Triggers
“VOLT:HIGH?”
- get_amplitude_low_level(channel='')
Query the low level of waves output from selected channel. The default unit is V.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the low level set in scientific notation, such as: -1.000000e+01 in V.
- Example
>>> GeneratorDevice.get_amplitude_low_level()
- Triggers
“VOLT:LOW?”
- get_amplitude_offset(channel='')
Query the offset voltage of selected channel. The default unit is Vdc.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the offset voltage set in scientific notation, such as: -9.998000e+00 in Vdc.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude_offset()
- Triggers
“VOLT:OFFS?”
- get_amplitude_unit(channel='')
Query the unit of voltage output from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns VPP, VRMS or DBM.
- Return type
bytes
- Example
>>> GeneratorDevice.get_amplitude_unit()
- Triggers
“VOLTage:UNIT?”
- get_arb_function(channel='')
Query the name of arbitrary wave generated from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the name of built-in arbitrary wave selected (such as EXP_RISE), VOLATILE or the name of any of the user-defined waves in nonvolatile memory. The default is EXP_RISE.
- Return type
bytes
- Example
>>> GeneratorDevice.get_arb_function()
- Triggers
“FUNCtion:USER?”
- get_burst_internal_period(peak='')
Query the period of burst in internal trigger mode.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the burst period in scientific notation and the default unit is s, such as: 1.000000e+01.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_internal_period()
Trigger: “BURSt:INTernal:PERiod?”
- get_burst_mode()
Query the burst mode.
- Returns
The query returns TRIG or GAT.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_mode()
- Triggers
“BURSt:MODE?”
- get_burst_ncycles()
Query the cycle number of burst.
- Returns
The query returns the burst counting in scientific notation (such as 1.000000e+02) or returns “Infinite”.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_ncycles()
Trigger: “BURSt:NCYCles?”
- get_burst_phase(peak='')
Query the initial phase of burst.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of burst phase to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Returns
The query returns the initial phase of burst in scientific notation and the default unit is degree, such as: 1.500000e+02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_phase()
Trigger: “BURSt:PHASe?”
- get_burst_state()
Query the state of burst mode.
- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_burst_state()
Trigger: “BURSt:STATe?”
- get_duty_cycle_of_square_wave(peak='', channel='')
Query the duty cycle of square wave from selected channel.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines peak values of square wave when selected. Write in formGeneratorConstant.MAX
. Values available: MAX, MIN.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current duty cycle setting, such as 50.000000. Unit is %.
- Return type
- Example
>>> GeneratorDevice.get_duty_cycle_of_square_wave()
- Triggers
“FUNCtion:SQUare:DCYCle?”
- get_frequency(channel='')
Query the frequency of output function of selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the frequency set in scientific notation and in Hz, such as: 1.000000e-06.
- Return type
bytes
- Example
>>> GeneratorDevice.get_frequency()
- Triggers
“FREQuency?”
- get_modulated_wave_deviation(peak='', modulated_wave='AM')
Query the frequency deviation of FM or PM.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of modulated wave deviation to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: FM_MODE, PM_MODE.
- Returns
The query returns the frequency deviation of FM or PM in the scientific notation and in Hz, such as: 1.000000e+02
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_deviation()
- Triggers
“FM:DEViation?”
- get_modulated_wave_frequency(modulated_wave='AM')
Query the frequency of modulated_wave internal modulation. The default unit is Hz.
- Parameters
modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns the frequency of modulated_wave internal modulation in scientific notation and the default unit is Hz, such as: 2.000000e+02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_frequency()
- Triggers
“AM:INT:FREQ?”
- get_modulated_wave_function(wave_mode='AM')
Query the internal modulating wave selected.
- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns SIN, SQU, RAMP, NRAM, TRI, NOIS or USER.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_function()
- Triggers
“AM:INTernal:FUNCtion?”
- get_modulated_wave_state(wave_mode='AM')
Query the modulation state of wave_mode.
- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_modulated_wave_state()
- Triggers
“AM:STATe?”
- get_output(channel='')
Query the state of the [Output] connector of selected channel at the front panel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output()
- Triggers
“OUTP?”
- get_output_load(channel='')
Query the current load setting of selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the current load setting in Ω or returns “Infinity”.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_load()
- Triggers
“OUTP:LOAD?”
- get_output_polarity(channel='')
Query the polarity of waveform output from selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns NORM or INV.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_polarity()
- Triggers
“OUTP:POL?”
- get_output_sync()
Query the state of the [Sync Out] connector of CH1 on the rear panel.
- Returns
The query returns SYNC OFF or SYNC ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_output_sync()
- Triggers
“OUTP:SYNC?”
- get_phase(peak='', channel='')
Query the initial phase of signals output from selected channel. The default unit of angle is degree.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which phase peak to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns any numerical value between -180 and 180, such as: 90.000 in degree.
- Return type
bytes
- Example
>>> GeneratorDevice.get_phase()
- Triggers
“PHAS?”
- get_pulse_duty_cycle(peak='', channel='')
Query the duty cycle of pulse output from selected channel. The default unit is %.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of pulse duty cycle to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the percent of duty cycle of pulse in scientific notation, such as: 5.000000e+01 in %
- Example
>>> GeneratorDevice.get_pulse_duty_cycle()
- Triggers
“PULSe:DCYCle?”
- get_pulse_period(peak='', channel='')
Query the period of pulse output from selected channel in seconds.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which period of pulse period to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the pulse period in scientific notation and in seconds, such as: 1.000000e-02.
- Return type
bytes
- Example
>>> GeneratorDevice.get_pulse_period()
- Triggers
“PULSe:PERiod?”
- get_pulse_width(peak='', channel='')
Query the width of pulse output from selected channel in seconds.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Defines which peak of pulse width to acquire. Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the pulse width in scientific notation and in seconds, such as: 5.000000e-03.
- Return type
bytes
- Example
>>> GeneratorDevice.get_pulse_width()
- Triggers
“PULSe:WIDTh?”
- get_sweep_frequency(joiner)
Query the start, stop, center or span frequency in sweep mode. The default unit is Hz.
- Parameters
joiner (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.START
. Values available: START, STOP, CENTER, SPAN.- Returns
The query returns the start, stop, center or span frequency set in scientific notation and in Hz, such as: 1.000000e-06.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_frequency(GeneratorConstants.START)
- Triggers
“FREQuency:STARt?”
- get_sweep_spacing()
Query the current sweep mode.
- Returns
The query returns LINEAR or LOG.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_spacing()
- Triggers
“SWEep:SPACing?”
- get_sweep_state()
Query the sweep state.
- Returns
The query returns OFF or ON.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_state()
- Triggers
“SWEep:STATe?”
- get_sweep_time()
Query the sweep time needed for the generator to sweep from the start frequency to the stop frequency. The default unit is s.
- Returns
The query returns the sweep time in scientific notation and in seconds, such as: 1.000000e+01.
- Return type
bytes
- Example
>>> GeneratorDevice.get_sweep_time()
- Triggers
“SWEep:TIME?”
- get_symmetry_of_ramp_wave(peak='', channel='')
Query the symmetry of ramp wave output from selected channel.
- Parameters
peak (static variable from
GeneratorConstants
, optional) – Write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current symmetry setting, such as 50.000000. Unit is %.
- Return type
bytes
- Example
>>> GeneratorDevice.get_symmetry_of_ramp_wave()
- Triggers
“FUNCtion:RAMP:SYMMetry?”
- get_wave_function(channel='')
Function asks device what measurement function is it currently using on selected channel.
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
Returns what channel and measurement function we are on, in cases: Channel:SIN, SQU, RAMP, PULS, NOIS, ARB.
- Return type
bytes
- Example
>>> GeneratorDevice.get_wave_function()
- Triggers
“FUNCtion?”
- get_wave_function_with_parameters(channel='')
Query the current configuration of CH1 or CH2 and the type of wave outputted. The default units of <frequency>, <amplitude> and <offset> are Hz, Vpp and V DC respectively
- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns a character string enclosed in double quotation marks, including function, frequency, amplitude and offset. Such as, CH1:”SIN,1.000000e+03,5.000000e+00,-1.500000e+00”
- Return type
bytes
- Example
>>> GeneratorDevice.get_wave_function_with_parameters()
- Triggers
“APPLy?”
- set_am_depth(value)
Set the depth of AM internal modulation in percent. Depth range: 0% to 120%. The default unit is %.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines am depth, percent write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.- Example
>>> GeneratorDevice.set_am_depth(str(70))
- Triggers
“AM:DEPT 70”
- set_amplitude(value, channel='')
Set the output amplitude of selected channel. The default unit is Vpp. Unit can be set in
GeneratorDevice.set_amplitude_unit()
func.- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage peak to peak values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude(GeneratorConstants.MIN)
- Triggers
“VOLTage MIN” (value in Vpp)
- set_amplitude_high_level(value, channel='')
Set the high level of waves output from selected channel and the default unit is V.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_high_level(GeneratorConstants.MAX)
- Triggers
“VOLT:HIGH MAX”
- set_amplitude_low_level(value, channel='')
Set the low level of waves output from selected channel and the default unit is V.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Voltage values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_low_level(GeneratorConstants.MAX)
- Triggers
“VOLT:LOW MAX”
- set_amplitude_offset(value, channel='')
Set the offset voltage of selected channel in Vdc.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Volt dirrect current values write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_offset(GeneratorConstants.MIN)
- Triggers
“VOLT:OFFS MIN”
- set_amplitude_unit(unit_type, channel='')
Set the unit of voltage output from selected channel. DBM could be used only in non-high resistance.
- Parameters
unit_type (static variable from
GeneratorConstants
) – Defines units for amplitude. Constants write in formGeneratorConstant.UNIT_VPP
. Values available: UNIT_VPP, UNIT_VRMS, UNIT_DBM.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_amplitude_unit(GeneratorConstants.UNIT_VPP)
- Triggers
“VOLT:UNIT VPP”
- set_arb_function(wave_name, channel='')
Select any wave from built-in arbitrary waves, 10 user-defined waves or waves that have been downloaded into volatile memory for selected channel.
- Parameters
wave_name (static variable from
GeneratorConstants
) – Defines build-in arbitrary wave. Write in formGeneratorConstant.X2
. Values available: NEG_RAMP, ATT_ALT, AMP_ALT, STAIR_DOWN, STAIR_UP, STAIR_UD, CPULSE, PPULSE, NPULSE, TRAPEZIA, ROUNDHALF, ABS_SINE, ABS_SINE_HALF, SINE_TRA, SINE_VER, EXP_RISE, EXP_FALL, TAN, COT, SQRT, X2, SINC, GAUSS, HAVER_SINE, LORENTZ, DIRICHLET, GAUSS_PULSE, AIRY, CARDIAC, QUAKE, GAMMA, VOICE, TV, COMBIN, BAND_LIMITED, STEP_RESPONSE, BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2, BOXCAR, BARLETT, TRIANG, BLACKMAN, HAMMING, HANNING, KAISER, ROUNG_PM.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_arb_function(GeneratorConstants.X2)
- Triggers
“FUNCtion:USER Exp_Rise”
- set_burst_internal_period(period)
Set the period of burst in internal trigger mode.
- Parameters
period (static variable from
GeneratorConstants
, str(<seconds>)) – Is the burst period set by users, the default unit is s. Write int in form str(<seconds>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=0.000001, MAX=500.- Example
>>> GeneratorDevice.set_burst_internal_period(str(10))
- Triggers
“BURS:INT:PER 10”
- set_burst_mode(mode)
Set the burst mode to trigger (TRIGgered) or gated (GATed).
In trigger mode, the generator outputs a wave with specified number of cycles once it receives a trigger from the specified trigger source (via sending TRIGger:SOURce).
In gated mode, the output state of waves (“ON” or “OFF”) depends on the external signal level at the [Ext Trig/FSK/Burst] connector on the rear panel.
The default burst mode is trigger.
- Parameters
mode (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.GATED
. Values available: TRIGGERED, GATED.- Example
>>> GeneratorDevice.set_burst_mode(GeneratorConstants.GATED)
- Triggers
“BURS:MODE GAT”
- set_burst_ncycles(cycle)
Set the cycle number of burst. Only used in triggermode.
- Parameters
cycle (static variable from
GeneratorConstants
, str(<cycles>)) – Is the cycle number set by users. Write int in form str(<cycles>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX, INF. Where MIN=1, MAX=50000 cycles.- Example
>>> GeneratorDevice.set_burst_ncycles(str(100))
- Triggers
“BURS:NCYC 100”
- set_burst_phase(phase)
Set the initial phase of burst.
- Parameters
phase (static variable from
GeneratorConstants
, str(<angle>)) – Is the phase set by users, the default unit is degree. Write float in form str(<angle>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=-180, MAX=180.- Example
>>> GeneratorDevice.set_burst_phase(str(150))
- Triggers
“BURS:PHAS 150”
- set_burst_state(state)
Enable or disable burst mode.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_burst_state(GeneratorConstants.ON)
- Triggers
“BURS:STAT ON”
- set_config(config)
Setter for
config_GeneratorConstants.py
.- Parameters
config – Stores all values from
config_GeneratorConstants.py
.
- set_duty_cycle_of_square_wave(percent_of_duty, channel='')
Set the duty cycle of square wave for selected function. <percent> is the percent of duty cycle selected, MIN is the minimum duty = 0 cycle of the selected frequency and MAX is the maximum = 100.
- Parameters
percent_of_duty (static variable from
GeneratorConstants
, str(<percent_value>)) – Percent values write in form str(<percent>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_duty_cycle_of_square_wave(GeneratorConstants.MAX)
- Triggers
“FUNC:SQU:DCYC 100”
- set_frequency(value, channel='')
Set the frequency of output function for channel. The default unit is Hz. Resolution is 1μHz.
Waveforms
Frequency limits
Sine
1μHz ~ 25MHz
Square
1μHz ~ 5MHz
Pulse
500μHz ~ 5MHz
Ramp/Triangle
1μHz ~ 500kHz
White Noise
5MHz bandwidth (-3dB)
Arb.
1μHz ~ 5MHz
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Frequency values write in form str(<value_in_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_frequency(str(1000))
- Triggers
“FREQuency 1000”
- set_modulated_wave_deviation(deviation, modulated_wave='AM')
Set the frequency deviation of FM or PM in Hz.
- Parameters
deviation (static variable from
GeneratorConstants
, str(<value>)) – Deviation in float write in form str(<value_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_deviation(str(100))
- Triggers
“FM:DEViation 100”
- set_modulated_wave_frequency(frequency_value, modulated_wave='AM')
Set the frequency of modulated_wave internal modulation in Hz.
- Parameters
frequency_value (static variable from
GeneratorConstants
, str(<value>)) – Defines frequency of mode function, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.modulated_wave (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_frequency(str(200))
- Triggers
“AM:INT:FREQ 200”
- set_modulated_wave_function(wave_type, wave_mode='AM')
Select the internal modulating wave of modulated_wave. :param wave_type: Defines basic waveform function. Defaults to SIN. Write in form
GeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, NRAM, NOISE, TRI, USER.- Parameters
wave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.- Example
>>> GeneratorDevice.set_modulated_wave_function(GeneratorConstants.SQUARE)
- Triggers
“AM:INT:FUNC SQU”
- set_modulated_wave_state(state, wave_mode='AM')
Disable or enable wave_mode function.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFFwave_mode (static variable from
GeneratorConstants
, optional) – Defaults to last used mode or AM mode. Write in formGeneratorConstant.PM_MODE
. Values available: AM_MODE, FM_MODE, PM_MODE.
- Example
>>> GeneratorDevice.set_modulated_wave_state(GeneratorConstants.ON)
- Triggers
“AM:STATe ON”
- set_output(on_off, channel='')
Disable or enable the Output connector of selected channel at the front panel. The default is “OFF”.
- Parameters
on_off (static variable from
GeneratorConstants
) – Defines state of output connector. Constants write in formGeneratorConstant.ON
. Values available: ON, OFF.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output(GeneratorConstants.ON)
- Triggers
“OUTP ON”
- set_output_load(value, channel='')
Select the desired output termination of selected channel. The specified value is only used for amplitude and offset voltage.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines value of output load, write in form str(<ohm_value>). Constants write in formGeneratorConstant.MIN>
. Values available: MIN, MAX, INF.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output_load(GeneratorConstants.ON)
- Triggers
“OUTP:LOAD 50”
- set_output_polarity(value, channel='')
Set the polarity of waveform output from selected channel.
- Parameters
value (static variable from
GeneratorConstants
) – Defines polarity of waveform. Constants write in formGeneratorConstant.INVERTED
. Values available: NORMAL, INVERTED.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_output_polarity(GeneratorConstants.NORMAL)
- Triggers
“OUTP:POL NORM”
- set_output_sync(state)
Disable or enable the rear panel [Sync Output] connector of CH1.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_output_sync(GeneratorConstants.ON)
- Triggers
“OUTP:SYNC ON”
- set_phase(value, channel='')
Set the initial phase of signals output from selected channel.
- Parameters
value (static variable from
GeneratorConstants
, str(<angle>)) – Is the phase set by users, the default unit is degree. Write float in form str(<angle>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN=-180, MAX=180.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_phase(str(90))
- Triggers
“PHAS 90”
- set_phase_align()
Enable the alignment phase output of dual channels.
- Example
>>> GeneratorDevice.set_phase_align()
- Triggers
“PHASe:ALIGN”
- set_pulse_duty_cycle(value, channel='')
Set the duty cycle of pulse for selected channel. The default unit is %.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse duty cycle, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_duty_cycle(str(50))
- Triggers
“PULSe:DCYCle 50”
- set_pulse_period(value, channel='')
Set the period of pulse output from selected channel in seconds.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse period, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_period(str(0.01))
- Triggers
“PULSe:PER 0.01”
- set_pulse_width(value, channel='')
Set the width of pulse for selected channel in seconds.
- Parameters
value (static variable from
GeneratorConstants
, str(<value>)) – Defines pulse width, float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_pulse_width(str(0.005))
- Triggers
“PULSe:WIDTh 0.005”
- set_sweep_frequency(joiner, value)
Set the start, stop frequency (stop used in conjunction with start frequency) in sweep mode. Set the frequency center, span (span used in conjunction with center frequency) in sweep mode. The default unit is Hz.
- Parameters
joiner (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.START
. Values available: START, STOP, CENTER, SPAN.value (static variable from
GeneratorConstants
, str(<value>)) – Write float in form str(<value_Hz>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.
- Example
>>> GeneratorDevice.set_sweep_frequency(GeneratorConstants.START, str(5000))
- Triggers
“FREQuency:STARt 5000”
- set_sweep_spacing(spacing)
Select linear or logarithmic spacing for the sweep, the default is Linear.
- Parameters
spacing (static variable from
GeneratorConstants
,) – Define spacing type. Constants write in formGeneratorConstant.MIN
. Values available: LINEAR, LOGARITHMIC.- Example
>>> GeneratorDevice.set_sweep_spacing(GeneratorConstants.LINEAR)
- Triggers
“SWE:SPAC LIN”
- set_sweep_state(state)
Disable or enable the sweep mode.
- Parameters
state (static variable from
GeneratorConstants
) – Constants write in formGeneratorConstant.ON
. Values available: ON, OFF- Example
>>> GeneratorDevice.set_sweep_state(GeneratorConstants.ON)
- Triggers
“SWE:STAT OFF”
- set_sweep_time(sweep_time)
- Set the sweep time needed for the generator to sweep from the start frequency to the stop frequency,
the default time is 1s. <seconds> is the sweep time set by users, the unit is s.
- Parameters
sweep_time (static variable from
GeneratorConstants
, str(<value>)) – Sweep time seconds in float write in form str(<value>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX. Where MIN = 0.001s and MAX = 500s.- Example
>>> GeneratorDevice.set_sweep_time(str(10))
- Triggers
“SWE:TIME 10”
- set_symmetry_of_ramp_wave(percent_of_symmetry, channel='')
Set the symmetry of ramp wave output from selected channel. <percent> is the selected percent of symmetry; MIN=0, MAX=100.
- Parameters
percent_of_symmetry (static variable from
GeneratorConstants
, str(<percent_value>)) – Percent values write in form str(<percent>). Constants write in formGeneratorConstant.MIN
. Values available: MIN, MAX.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_symmetry_of_ramp_wave(GeneratorConstants.MAX)
- Triggers
“FUNC:RAMP:SYMM 100”
- set_wave_function(wave_type, channel='')
Function selects the output function for selected channel.
- Parameters
wave_type (static variable from
GeneratorConstants
, optional) – Defines basic waveform function. Defaults to SIN. Write in formGeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, PULSE, NOISE, DC, USER.channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.
- Example
>>> GeneratorDevice.set_wave_function(GeneratorConstants.SINUSOID)
- Triggers
“FUNCtion SIN”
- set_wave_function_with_parameters(channel='', wave_type='SIN', frequency='', amplitude='', offset='')
Generate wave with specific frequency, amplitude and DC offset via CH1 or CH2. If the parameters you set are less than three, the sequence would be: <frequency>, <amplitude>, <offset>. Frequency limits can be found at
GeneratorDevice.set_frequency()
.- Parameters
channel (static variable from
GeneratorConstants
, optional) – Defaults to last used channel or CH1. Write in formGeneratorConstant.CH2
. Values available: CH1, CH2.wave_type (static variable from
GeneratorConstants
, optional) – Defines basic waveform function. Defaults to SIN. Write in formGeneratorConstant.RAMP
. Values available: SINUSOID, SQUARE, RAMP, PULSE, NOISE, DC, USER.frequency (str, optional) – Defines frequency value in int or float format in Hz. Initial value is 1000.
amplitude (str, optional) – Defines amplitude in int or float format in Vpp. Initial value is 5.
offset (str, optional) – Defines offset in int or float format in volts of direct current, VDC. Initial value is 0.
- Example
>>> GeneratorDevice.set_wave_function_with_parameters(amplitude=str(1001))
- Triggers
“APPL:SIN 1001,5.0,-1.5”
- class pyvilab_lib.MultimeterConfig
Bases:
object
Class for simplification of device settings
- Variables
function – Function variable take values: MultimeterConfig.function = “VOLTAGE_DC”, “VOLTAGE_AC”, “CURRENT_DC”,”CURRENT_AC”, “RESISTANCE”, “FRESISTANCE”, “FREQUENCY”, “PERIOD”, “CONTINUITY” , “DIODE”, “CAPACITANCE” Type is str.
range – Index of function or name of variable, for accessible indexes, see
config_multimeter.json
, in form “<index>” or MultimeterConfig.range = “AUTO”. Values available: “MAX”, “MIN”, “DEF”, “AUTO”. Type is str, int.rate – Selects rate for function, in some cases there is no rate, see
config_multimeter.json
or await error. Write in form MultimeterConfig.rate = “FAST”. Values available: “FAST”, “MEDIUM”, “SLOW”. Type is str.
- Example:
>>> from pyvilab_lib import MultimeterDevice, MultimeterConfig >>> >>> multimet = MultimeterDevice() >>> multimet.open() >>> >>> config = MultimeterConfig() >>> config.function = "VOLTAGE_DC" >>> config.range = "4" >>> config.rate = "FAST" >>> multimet.set_config(config) >>> multimet.close()
- checker()
- function_setter(name)
- range_setter(input_value)
- rate_setter(input_rate)
- class pyvilab_lib.MultimeterConstants
Bases:
object
Class of static constants for multimeter
- AUTO = 'AUTO'
- AVERAGE = 'AVERAGE'
- CAPACITANCE = 'CAP'
- CONTINUITY = 'CONT'
- CURRENT_AC = 'CURR:AC'
- CURRENT_DC = 'CURR:DC'
- DB = 'DB'
- DBM = 'DBM'
- DEFAULT = 'DEF'
- DIODE = 'DIOD'
- EXTERNAL = 'EXT'
- FALL = 'FALL'
- FREQUENCY = 'FREQ'
- FRESISTANCE = 'FRES'
- HIGH = 'HIGH'
- LOW = 'LOW'
- MAXIMUM = 'MAX'
- MINIMUM = 'MIN'
- NEG = 'NEG'
- NONE = 'NONE'
- OFF = 'OFF'
- ON = 'ON'
- PERIOD = 'PER'
- PF = 'PF'
- POS = 'POS'
- RATE_FAST = 'F'
- RATE_MEDIUM = 'M'
- RATE_SLOW = 'S'
- RELATIVE = 'REL'
- RESISTANCE = 'RES'
- RISE = 'RISE'
- SINGLE = 'SINGLE'
- TEN_GIGA = '10G'
- TEN_MEGA = '10M'
- TOTAL = 'TOTAL'
- VOLTAGE_AC = 'VOLT:AC'
- VOLTAGE_DC = 'VOLT:DC'
- class pyvilab_lib.MultimeterDevice(device='', timeout=0, recognition_sign='DM')
Bases:
VirtualInstrument
This is class of functions to control a Rigol DM3000 series digital multimeter. All essentials functions, that are common for all Rigol devices, are enherited from base class above.
- Parameters
device (str, optional) – Path to device. If the parameter is not defined, it searches device through path “/dev/usbtmc1” to “/dev/usbtmc3”.
timeout (float, optional) – Sets timeout between individual commands. Defaults to 0.
recognition_sign (str, optional) – Recognize part of devices name in string format. Default sign is “M” which stands for multimeter.
- get_calculate_function()
Queries the current selected math operation.
- Returns
The query returns the current selected operation, such as REL, DB, DBM, MIN, MAX, AVERAGE, TOTAL or PF. If more than one operation are used, the query may return a combination such as REL+PF; if all the operations are disabled, the query returns NONE.
- Return type
bytes
- Example
>>> MultimeterDevice.get_calculate_function()
- Triggers
“:CALCulate:FUNCtion?”
- get_data_acquired_success()
The command queries if a new data has been acquired under current trigger setting.
- Returns
TRUE | FALSE
- Return type
bytes
- Example
>>> MultimeterDevice.get_data_acquired_success()
- Triggers
“:MEASure?”
- get_dc_filter()
Queries the filter state.
- Returns
The query returns ON (1) or OFF (0).
- Return type
bytes
- Example
>>> MultimeterDevice.get_dc_filter()
- Triggers
“:MEASure:VOLTage:DC:FILTer?”
- get_external()
Queries the current external trigger type, the default is Rise trigger.
- Returns
The query returns: RISE, FALL, HIGH or LOW.
- Return type
bytes
- Example
>>> MultimeterDevice.get_external()
- Triggers
“:TRIGger:EXT?”
- get_measured()
The command queries the measured input type once.
- Returns
Returns value of measurement_type in scientific notation. e.g. 9.67441e-05 in SI base units. Units specificly described in
config_multimeter.json
.- Return type
bytes
- Example
>>> MultimeterDevice.get_measured()
- Triggers
“:MEASure:VOLTage:DC?”
- get_measuring_function()
Function queries the current measurement function is it currently using.
- Returns
Returns what measurement function we are on from: DCV, ACV, DCI, ACI, 2WR, 4WR, FREQ, PER, CONT, DIODE, CAP.
- Return type
bytes
- Example
>>> MultimeterDevice.get_measuring_function()
- Triggers
“:FUNCtion?”
- get_range()
The command queries the current measurement type range.
- Returns
0, 1, 2, 3, 4,… or any int value measurement_type can take. Closer info in
set_range()
doc.- Return type
bytes
- Example
>>> MultimeterDevice.get_range()
- Triggers
“:MEASure:VOLTage:DC:RANGe?”
- get_rate()
Queries the current measuring rate of measurement_type. The command is valid only when measurement_type function is enabled.
- Returns
Rate of measurement_type: FAST, MEDIUM, SLOW.
- Return type
bytes
- Example
>>> MultimeterDevice.get_rate()
- Triggers
“:RATE:VOLTage:DC?”
- get_trigger_auto_hold()
Queries if the hold function under auto trigger is enabled.
- Returns
The query returns the ON (1) or OFF (0).
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_hold()
- Triggers
“:TRIGger:AUTO:HOLD?”
- get_trigger_auto_hold_sensitivity()
Queries the current delay sensitive of auto trigger.
- Returns
The query returns: 0, 1, 2 or 3
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_hold_sensitivity()
- Triggers
“:TRIGger:AUTO:HOLD:SENSitivity?”
- get_trigger_auto_interval()
Queries the interval of auto trigger. Defaults to 400.
- Returns
The query returns the current interval of auto trigger. Unit is ms.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_auto_interval()
- Triggers
“:TRIGger:AUTO:INTErval?”
- get_trigger_single()
Queries the number of sample under current single trigger. Defaults to 1.
- Returns
The query returns the number of sample under current single trigger.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_single()
- Triggers
“:TRIGger:SINGle?”
- get_trigger_source()
Queries the trigger source used currently.
- Returns
The query returns: AUTO, SINGLE or EXT.
- Return type
bytes
- Example
>>> MultimeterDevice.get_trigger_source()
- Triggers
“:TRIGger:SOURce?”
- get_vmcomplete_polar()
Queries the current VMC output polar, the default is POS (positive).
- Returns
The query returns the current VMC output polar, POS or NEG.
- Return type
bytes
- Example
>>> MultimeterDevice.get_vmcomplete_polar()
- Triggers
“:TRIGger:VMComplete:POLAr?”
- get_vmcomplete_pulse_width()
Queries the current VMC output pulsewidth. Defaults to 100ms.
- Returns
The query returns the VMC output pulsewidth time.
- Return type
bytes
- Example
>>> MultimeterDevice.get_vmcomplete_pulse_width()
- Triggers
“:TRIGger:VMComplete:PULSewidth?”
- get_voltage_dc_impedance()
The commands query the DC impedance.
- Returns
The query returns 10M or 10G (that is >10G).
- Return type
bytes
- Example
>>> MultimeterDevice.get_voltage_dc_impedance()
- Triggers
“:MEASure:VOLTage:DC:IMPEdance?”
- set_calculate_function(calc_func)
The commands set the math function. Default value is set to NONE. Functions can be stacked for desired calculate functions combinations, such as RELATIVE + MAXIMUM functions with individual function calls.
- Parameters
calc_func (static variable from
MultimeterConstants
, str) –One of following calculation functions in form:
MultimeterConstant.NONE
:Parameters
Desciption
NONE
Turn off all the math functions
RELATIVE
Relative operation
DB
dB operation
DBM
dBm operation
MINIMUM
Minimum operation
MAXIMUM
Maximum operation
AVERAGE
Average operation
TOTAL
Turn on all the statistics which include MIN, MAX and AVERAGE
PF
Limit operation
- Example
>>> MultimeterDevice.set_calculate_function(MultimeterConstants.AVERAGE)
- Triggers
“:CALCulate:FUNCtion AVERAGE”
- set_config(config)
Setter for
config_multimeter.py
.- Parameters
config – Stores all values from
config_multimeter.py
.
- set_dc_filter(state)
Opens or closes the filter.
- Parameters
state (static variable from
MultimeterConstants
, str) – Bool that opens or close filter. Write in formMultimeterConstant.ON
. Values available: ON, OFF- Example
>>> MultimeterDevice.set_dc_filter(MultimeterConstants.ON)
- Triggers
“:MEASure:VOLTage:DC:FILTer ON”
- set_external(trigger_type)
Sets the desired trigger type. The parameters provided are rise trigger, fall trigger, high-level trigger, low-level trigger.
- Parameters
trigger_type (static variable from
MultimeterConstants
, str) – Write in formMultimeterConstant.RISE
. Values available: RISE, FALL, HIGH, LOW.- Example
>>> MultimeterDevice.set_external(MultimeterConstants.RISE)
- Triggers
“:TRIGger:EXT RISE”
- set_measuring_function(measurement_type='CURR:DC')
Function enable common measurement function on devices front panel. Without parameter function sets last/default value. Defaults to VOLTAGE_DC.
- Parameters
measurement_type (static variable from
MultimeterConstants
, str) –Defines which measurement function will be enabled. Write in form
MultimeterConstant.VOLTAGE_DC
. Functions:VOLTAGE_DC,
VOLTAGE_AC,
CURRENT_DC,
CURRENT_AC,
RESISTANCE,
FRESISTANCE,
FREQUENCY,
PERIOD,
CONTINUITY,
DIODE,
CAPACITANCE
- Example
>>> MultimeterDevice.set_measuring_function()
- Triggers
“:FUNCtion:VOLTage:DC”
- set_range(meas_range)
The command sets the range (in some case resolution too) of measurement type. Closer info about ranges below. Only AUTO set works without measurement type value.
Tables with ranges of individual functions:
- VOLTAGE_DC
Parameter
Range
Resolution
0
200 mV
100 nV
1
2 V
1 μV
2
20 V
10 μV
3
200 V
100 μV
4
1000 V
1 mV
MINIMUM
200 mV
100 nV
MAXIMUM
1000 V
1 mV
DEFAULT
20 V
10 μV
- VOLTAGE_AC
Parameter
Range
0
200 mV
1
2 V
2
20 V
3
200 V
4
750 V
MINIMUM
200 mV
MAXIMUM
750 V
DEFAULT
20 V
- CURRENT_DC
Parameter
Range
Resolution
0
200 μA
1 nA
1
2 mA
10 nA
2
20 mA
100 nA
3
200 mA
1 μA
4
2 A
10 μA
5
10 A
100 μA
MINIMUM
200 μA
1 nA
MAXIMUM
10 A
100 μA
DEFAULT
200 mA
1 μA
- CURRENT_AC
Parameter
Range
0
20 mA
1
200 mA
2
2 A
3
10 A
MINIMUM
20 mA
MAXIMUM
10 A
DEFAULT
200 mA
- RESISTANCE
Parameter
Range
0
200 Ω
1
2 kΩ
2
20 kΩ
3
200 kΩ
4
1 MΩ
5
10 MΩ
6
100 MΩ
MAXIMUM
100 MΩ
MINIMUM
200 Ω
DEFAULT
200 kΩ
- FREQUENCY
The available frequency range is 20Hz~1MHz. For range ref. to table VOLTAGE_AC.
- CONTINUITY
The available frequency range is consecutive integer from 1 Ω to 2000 Ω. Default range is set to 10 Ω. Available values: 1~2000, MINIMUM, MAXIMUM, DEFAULT.
- CAPACITANCE
Parameter
Range
0
2 nF
1
20 nF
2
200 nF
3
2 μF
4
200 μF
5
10000 μF
MINIMUM
2 nF
MAXIMUM
10000 μF
DEFAULT
200 nF
- Parameters
meas_range (static variable from
MultimeterConstants
, str(meas_range)) – Any number corresponding to measurement_type, number info bellow. General ranges can be set viaMultimeter.Constants.AUTO
. Values can be: AUTO, MINIMUM, MAXIMUM, DEFAULT- Example
>>> MultimeterDevice.set_range(str(3))
- Triggers
“:MEASure:VOLTage:DC 3”
- set_rate(measure_speed)
Sets the desired measuring rate of measurement_type. For the range and the explanation of each parameter, see table below.
Parameter
Explanation
Mark
Rate
Refresh rate
RATE_FAST
Fast measure
F
123 reading/s
50 Hz
RATE_MEDIUM
Medium measure
M
20 reading/s
20 Hz
RATE_SLOW
Slow measure
S
2.5 reading/s
2.5 Hz
- Parameters
measure_speed (static variable from
MultimeterConstants
, str) – Defines speed of measurements. Write in formMultimeterConstant.RATE_FAST
. Values available: RATE_FAST, RATE_MEDIUM, RATE_SLOW.- Example
>>> MultimeterDevice.set_rate(MultimeterConstants.RATE_FAST)
- Triggers
“:RATE:VOLTage:DC F”
- set_trigger_auto_hold(state)
Sets the desired hold state under auto trigger.
- Parameters
state (static variable from
MultimeterConstants
, str) – Defines state of auto hold. Write in formMultimeterConstant.ON
. Values available: ON, OFF.- Example
>>> MultimeterDevice.set_trigger_auto_hold(MultimeterConstants.ON)
- Triggers
“:TRIGger:AUTO:HOLD ON”
- set_trigger_auto_hold_sensitivity(state)
Sets the desired delay sensitive of auto trigger. For the parameter range, see table below.
0 - (MIN) 0.01%
1 - 0.1%
2 - (DEF) 1%
3 - (MAX) 10%
- Parameters
state (static variable from
MultimeterConstants
, str) – str(<int delay, see in table above>), Write in formMultimeterConstant.DEF
. Values available: MIN, DEF, MAX.- Example
>>> MultimeterDevice.set_trigger_auto_hold_sensitivity(str(0))
- Triggers
“:TRIGger:AUTO:HOLD:SENSitivity MIN”
- set_trigger_auto_interval(interval_value)
Sets the desired interval of auto trigger. Different rate has different intervals:
In Fast measurement, the default interval is 8 ms and the available range is within 8 ms and 2000 ms;
In Medium measurement, the default interval is 50 ms and the available range is within 50 ms and 2000 ms;
In Slow measurement, the default interval is 400 ms and the available range is within 400 ms and 2000 ms.
The default measurement rate is Slow, so the default interval of the multimeter is 400 ms.
- Parameters
interval_value (str) – Desired interval of auto trigger in form str(<int:see explanation above>)
- Example
>>> MultimeterDevice.set_trigger_auto_interval(str(200))
- Triggers
“:TRIGger:AUTO:INTErval 200”
- set_trigger_single(state)
Sets the required sample number in single trigger mode. DEF = 1.
- Parameters
state (str) – str(<int sample number in range 1~2000>)
- Example
>>> MultimeterDevice.set_trigger_single(str(1000))
- Triggers
“:TRIGger:SINGle 1000”
- set_trigger_single_triggered()
The command enables the multimeter trigger once manually. The command is equal to execute a single trigger manually through front panel.
- Example
>>> MultimeterDevice.set_trigger_single_triggered()
- Triggers
“:TRIGger:SINGle:TRIGgered”
- set_trigger_source(source_type)
Sets the trigger source to be used. The parameter AUTO, SINGLE, EXT denotes Auto trigger, Single trigger and External trigger, separately.
- Parameters
source_type (static variable from
MultimeterConstants
, str) – Defines what trigger source to be set. Write in formMultimeterConstant.AUTO
. Values available: AUTO, SINGLE, EXTERNAL- Example
>>> MultimeterDevice.set_trigger_source(MultimeterConstants.AUTO)
- Triggers
“:TRIGger:SOURce AUTO”
- set_vmcomplete_polar(polar_state)
Sets the VMC output polar to be used. The parameters provided are positive and negative.
- Parameters
polar_state (static variable from
MultimeterConstants
) – Write in formMultimeterConstant.POS
. Values available: POS, NEG.- Example
>>> MultimeterDevice.set_vmcomplete_polar(MultimeterConstants.POS)
- Triggers
“:TRIGger:VMComplete:POLAr POS”
- set_vmcomplete_pulse_width(pulse_width)
Sets the desired VMC output pulsewidth, the unit is ms.
Note
The ranging of pulsewidth will vary with sample rate. When the sample rate is S, the range is 1~399(ms); when the sample rate is M, the range is 1~49(ms); and when the sample rate is F, the range is 1~7(ms).
- Parameters
pulse_width (str) – str(<int in ms, see above>)
- Example
>>> MultimeterDevice.set_vmcomplete_pulse_width(str(200))
- Triggers
“:TRIGger:VMComplete:PULSewidth 200”
- set_voltage_dc_impedance(impedance_value)
Sets the desired DC impedance value to 10 MΩ or >10 GΩ. .. Note:: 10G is available only when the DC voltage range is 200mV or 2V that is 0,1,MIN.
- Parameters
impedance_value (static variable from
MultimeterConstants
) – Impedance can be set viaMultimeter.Constants.TEN_MEGA
. Values can be: TEN_GIGA, TEN_MEGA- Example
>>> MultimeterDevice.set_voltage_dc_impedance("10G")
- Triggers
“:MEASure:VOLTage:DC:IMPEdance 10G”
- class pyvilab_lib.Oscilloscope1000Device(device='', timeout=0, recognition_sign='DS1')
Bases:
OscilloscopeDevice
- get_channel_range(channel='1')
Query the vertical range of the specified channel. The default unit is V.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the vertical range in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_range()
- Triggers
“:CHANnel1:RANGe?”
- get_channel_tcal(channel='1')
Query the delay calibration time of the specified channel to calibrate the zero offset of the corresponding channel. The default unit is s.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the delay calibration time in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_channel_tcal()
- Triggers
“:CHANnel1:TCAL?”
- get_decoding_display(channel='1')
Query the current display status of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1. 1 means ON.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_display()
- Triggers
“:DEC1:DISPlay?”
- get_decoding_format(channel='1')
Query the current display format of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns HEX, DEC, BIN, LINE or ASC.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_format()
- Triggers
“:DEC1:FORMat?”
- get_decoding_mode(channel='1')
Query the current decoding mode of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns PAR, RS232, IIC or SPI.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_mode()
- Triggers
“:DEC1:MODE?”
- get_decoding_threshold(channel_decoder='1', channel='1')
Query the threshold level of the specified analog channel. The units for the trigger threshold match the units of the input channels.
- Parameters
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Defines source channel decoder. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the current threshold in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_threshold()
- Triggers
“:DEC1:THRE:CHAN1?”
- get_decoding_threshold_auto(channel_decoder='1')
Query the status of the auto threshold function of the analog channels.
- Parameters
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 1 or 0.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_decoding_threshold_auto()
- Triggers
“:DEC1:THRE:AUTO?”
- get_math_auto_scale()
Query the status of the auto scale setting.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_auto_scale()
- Triggers
“:MATH:OPTion:ASCale?”
- get_math_display()
Query the math operation status.
- Returns
The query returns 1 or 0.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_display()
- Triggers
“:MATH:DISPlay?”
- get_math_fft_hcenter()
Query the center frequency of the FFT operation result, namely the frequency relative to the horizontal center of the screen. The default unit is Hz.
- Returns
The query returns the frequency value in scientific notation in Hz.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_hcenter()
- Triggers
“:MATH:FFT:HCEN?”
- get_math_fft_hscale()
Query the horizontal scale of the FFT operation result. The default unit is Hz.
- Returns
The query returns the horizontal scale in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_hscale()
- Triggers
“:MATH:FFT:HSC?”
- get_math_fft_mode()
Query the FFT mode.
- Returns
The query returns TRAC or MEM.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_mode()
- Triggers
“:TIMebase:MODE?”
- get_math_fft_source()
Query the current signal source of FFT operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_source()
- Triggers
“:MATH:FFT:SOUR?”
- get_math_fft_split()
Query the status of the half display mode of the FFT operation.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_split()
- Triggers
“:MATH:FFT:SPL?”
- get_math_fft_unit()
Query the vertical unit of the FFT operation result.
- Returns
The query returns VRMS or DB.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_unit()
- Triggers
“:MATH:FFT:UNIT?”
- get_math_fft_window()
Query the current window function of the FFT operation.
- Returns
The query returns RECT, BLAC, HANN, HAMM, FLAT, or TRI.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_fft_window()
- Triggers
“:MATH:FFT:WIND?”
- get_math_invert()
Query the inverted display mode status of the operation result.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_invert()
- Triggers
“:MATH:INVert?”
- get_math_logic_source_1()
Query source A of logic operation.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_logic_source_1()
- Triggers
“:MATH:LSOUrce1?”
- get_math_logic_source_2()
Query source B of logic operation.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_logic_source_2()
- Triggers
“:MATH:LSOUrce2?”
- get_math_operator()
Query the operator of the math operation.
- Returns
The query returns ADD, SUBT, MULT, DIV, AND, OR, XOR, NOT, FFT, INTG, DIFF, SQRT, LOG, LN, EXP, ABS, or FILT.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_operator()
- Triggers
“:MATH:OPERator?”
- get_math_source_1()
Query the source or source A of algebraic operation/functional operation/the outer layer operation of compound operation.
- Returns
The query returns CHAN1, CHAN2, or FX.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_source_1()
- Triggers
“:MATH:SOURce1?”
- get_math_source_2()
Query the source or source B of algebraic operation/functional operation/the outer layer operation of compound operation.
- Returns
The query returns CHAN1, CHAN2, or FX.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_source_1()
- Triggers
“:MATH:SOURce2?”
- get_math_voffset()
Query the vertical offset of the operation result. The unit depends on the operator currently selected and the unit of the source.
- Returns
The query returns the vertical offset in scientific notation in V.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_voffset()
- Triggers
“:MATH:OFFSet?”
- get_math_vscale()
Query the vertical scale of the operation result. The unit depends on the operator currently selected and the unit of the source.
- Returns
The query returns 2.000000e+00.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_math_vscale()
- Triggers
“:MATH:SCALe?”
- get_measure_item(item, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES,channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:ITEM? VPP,CHAN1”
- get_measure_setup_dsa()
Query source A of RDELay 1→2 and FDELay 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_dsa()
- Triggers
“:MEASure:SETup:DSA?”
- get_measure_setup_dsb()
Query source B of RDELay 1→2 and FDELay 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psb()
- Triggers
“:MEASure:SETup:DSB?”
- get_measure_setup_psa()
Query source A of RPHase 1→2 and FPHase 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psa()
- Triggers
“:MEASure:SETup:PSA?”
- get_measure_setup_psb()
Query source B of RPHase 1→2 and FPHase 1→2 measurements.
- Returns
The query returns CHAN1, CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_setup_psb()
- Triggers
“:MEASure:SETup:PSB?”
- get_measure_statistic_item(item, extra, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES.extra (static variable from
OscilloscopeConstants
) – Defines specific frequency measurement. Write in formOscilloscopeConstant.MAXIMUM
. Values available: MAXIMUM, MINIMUM, CURRENT, AVERAGE or DEVIATION.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope1000Device.get_measure_statistic_item(OscilloscopeConstants.VPP, >>> OscilloscopeConstants.MAXIMUM)
- Triggers
“:MEASure:STATistic:ITEM? MAXimum,VPP,CHAN1”
- set_acquire_memory_depth(memory_depth_value)
Set or query the memory depth of the oscilloscope (namely the number of waveform points that can be stored in a single trigger sample). The default unit is pts (points). Default value set is AUTO.
Note
The following equation describes the relationship among memory depth, sample rate, and waveform length:
Memory Depth = Sample Rate x Waveform Length
Wherein, the Waveform Length is the product of the horizontal timebase (set by the
set_timebase_scale()
method) times the number of grids in the horizontal direction on the screen (12 for DS1000Z-E). When AUTO is selected, the oscilloscope will select the memory depth automatically according to the current sample rate.- Parameters
memory_depth_value (str, static variable from
OscilloscopeConstants
) –Defines memory depth to be set. Static value write in form
OscilloscopeConstant.AUTO
. Other memory depth values can be set via str(<number>), where values can be:for single channel - AUTO, 12000, 120000, 1200000, 12000000, 24000000
for dual channel - AUTO, 6000, 60000, 600000, 6000000, 12000000
- Example
>>> Oscilloscope1000Device.set_acquire_memory_depth(str(1200000))
- Triggers
“:ACQuire:MDEPth 1200000”
- set_channel_range(range_value, channel='1')
Set the vertical range of the specified channel. The default unit is V. This command indirectly modifies the vertical scale of the specified channel (Vertical Scale = Vertical Range/8). The vertical scale can be set by the
set_channel_scale()
method.- Parameters
range_value (str) –
Default is 8V (the probe is 10X). Write in form str(<range>). Related to the probe ratio
When the probe ratio is 1X: 8mV to 80V
When the probe ratio is 10X: 80mV to 800V
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_range(str(1))
- Triggers
“:CHANnel1:RANGe 1”
- set_channel_tcal(calibration_time, channel='1')
Set the delay calibration time of the specified channel to calibrate the zero offset of the corresponding channel. The default unit is s.
- Parameters
calibration_time (str) –
Default is 0s. Write in form str(<time_delay>). Value can only be set to the specific values in the specified step. If the parameter you sent is not one of the specific values, the parameter will be set to the nearest specific values automatically. The step varies with the horizontal timebase (set by the
set_timebase_scale()
method, as shown in the table below.Horizontal Timebase
Step of the Delay Calibration Time
5ns
100ps
10ns
200ps
20ns
400ps
50ns
1ns
100ns
2ns
200ns
4ns
500ns
10ns
1μs to 10μs
20ns
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_channel_tcal(str(1))
- Triggers
“:CHANnel1:TCAL 1”
- set_decoding_display(boolean, channel='1')
Enable or disable the display of bus 1 or 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_display(OscilloscopeConstants.ON)
- Triggers
“:DEC1:DISPlay ON”
- set_decoding_format(format_type, channel='1')
Set the display format of bus 1 or 2 to hexadecimal, decimal, binary or ASCII.
- Parameters
format_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.HEX
. Values available: HEX, DEC, BIN, ASCII, LINE.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_format(OscilloscopeConstants.HEX)
- Triggers
“:DEC1:FORMat HEX”
- set_decoding_mode(mode, channel='1')
Set the decoding mode of bus 1 or 2. PARallel, UART, SPI, and IIC correspond to parallel decoding, RS232 decoding, SPI decoding, and I2C decoding respectively.
- Parameters
mode (static variable from
OscilloscopeConstants
, optional) – Defines decoding mode. Write in formOscilloscopeConstant.PARALLEL
. Values available: PARALLEL, RS232, IIC, SPI.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_mode(OscilloscopeConstants.SPI)
- Triggers
“:DEC1:MODE SPI”
- set_decoding_threshold(threshold_value, channel_decoder='1', channel='1')
Set the threshold of the channel of parallel decoding on bus 1 or 2. Default value is 0. The units for the trigger threshold match the units of the input channels. By default, the auto threshold function of the analog channels of the oscilloscope is turned on. To set the threshold level manually, send the
set_decoding_threshold_auto()
method to turn off the auto threshold function.- Parameters
threshold_value (str) – Defines real number:(-4 x VerticalScale - VerticalOffset) to (4 x VerticalScale - VerticalOffset). Write in form srt(<number>). VerticalScale is the vertical scale of the specified analog channel. VerticalOffset is the vertical position of the specified analog channel.
channel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Defines decoder number. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_threshold(str(2.4))
- Triggers
“:DEC1:THRE:CHAN1 2.4”
- set_decoding_threshold_auto(boolean, channel_decoder='1')
Turn on or off the auto threshold function of the analog channels.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel_decoder (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope1000Device.set_decoding_threshold_auto(OscilloscopeConstants.ON)
- Triggers
“:DEC1:THRE:AUTO ON”
- set_math_auto_scale(boolean)
Enable or disable the auto scale setting of the operation result.
When the auto scale is enabled, the instrument will automatically calculate the vertical scale range according to the current operator, the vertical scale and the horizontal timebase. If the current scale is out of the range, it will adjust the vertical scale to the best value automatically.
Sending this command will modify the auto scale status of all the operation results.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_auto_scale(OscilloscopeConstants.ON)
- Triggers
“:MATH:OPTion:ASCale ON”
- set_math_display(boolean)
Enable or disable the math operation function.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_display(OscilloscopeConstants.ON)
- Triggers
“:MATH:DISPlay ON”
- set_math_fft_hcenter(center_frequency)
Set the center frequency of the FFT operation result, namely the frequency relative to the horizontal center of the screen. The default unit is Hz. Default value is 5MHz.
- Parameters
center_frequency (str) –
Defines horizontal offset. Write in form str(<number>). * When the FFT mode is set to TRACe, the range of <cent> is from 0 to (0.4 x FFT
sample rate). Wherein, FFT sample rate equals to screen sample rate, that is, 100/horizontal timebase.
When the FFT mode is set to MEMory, the range of <cent> is from 0 to (0.5 x FFT sample rate). Wherein, FFT sample rate equals to memory sample rate (
get_acquire_sample_rate()
).
- Example
>>> Oscilloscope1000Device.set_math_fft_hcenter(str(10000000))
- Triggers
“:MATH:FFT:HCEN 10000000”
- set_math_fft_hscale(hscale_value)
Set the horizontal scale of the FFT operation result. The default unit is Hz.
- Parameters
hscale_value – Write in form str(<number>).
Horizontal scale can be set to 1/1000, 1/400, 1/200, 1/100, 1/40, or 1/20 of the FFT sample rate.
When the FFT mode is set to TRACe, FFT sample rate equals to screen sample rate, that is, 100/horizontal timebase. When the FFT mode is set to MEMory, FFT sample rate equals to memory sample rate (
get_acquire_sample_rate()
).You can view the detailed information of the frequency spectrum by reducing the horizontal scale.
- Example
>>> Oscilloscope1000Device.set_math_fft_hscale(str(500000))
- Triggers
“:MATH:FFT:HSC 500000”
- set_math_fft_mode(mode)
Set the FFT mode. DEF = TRACE
- Parameters
mode (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.ROLL
. Values available: TRACE, MEMORY. * TRACE: denotes that the data source of the FFT operation is the data of thewaveform displayed on the screen.
MEMORY: denotes that the data source of the FFT operation is the data of the waveform in the memory.
- Example
>>> Oscilloscope1000Device.set_math_fft_mode(OscilloscopeConstants.MAIN)
- Triggers
“:TIMebase:MODE MAIN”
- set_math_fft_source(source_channel='1')
Select the signal source of FFT operation.
- Parameters
source_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_fft_source()
- Triggers
“:MATH:FFT:SOUR CHAN2”
- set_math_fft_split(boolean)
Enable or disable the half-screen display mode of the FFT operation. * Enable the half-screen display mode: the source channel and the FFT operation
results are displayed separately. The time domain and frequency domain signals are displayed clearly.
Disable the half-screen display mode (full-screen display mode): the source channel and the FFT operation results are displayed in the same window to view the frequency spectrum more clearly and to perform more precise measurement.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope1000Device.set_math_fft_split(OscilloscopeConstants.ON)
- Triggers
“:MATH:FFT:SPL ON”
- set_math_fft_unit(vunit)
Set the vertical unit of the FFT operation result. Default value set is DB.
- Parameters
vunit (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.VRMS
. Values available: VRMS, DB.- Example
>>> Oscilloscope1000Device.set_math_fft_unit(OscilloscopeConstants.VRMS)
- Triggers
“:MATH:FFT:UNIT VRMS”
- set_math_fft_window(window_type)
Select the window function of the FFT operation. Spectral leakage can be considerably decreased when a window function is used. Different window functions are applicable to measure different waveforms. You need to select the window function according to waveform to be measured and its characteristics.
- Parameters
window_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.RECTANGLE
. Values available RECTANGLE, HANNING, HAMMING, BLACKMAN, FLATTOP, TRIANGLE.- Example
>>> Oscilloscope1000Device.set_math_fft_window(OscilloscopeConstants.HANNING)
- Triggers
“:MATH:FFT:WIND HANN”
- set_math_invert(boolean)
Enable or disable the inverted display mode of the operation result. This command is invalid for the FFT operation.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF.- Example
>>> Oscilloscope1000Device.set_math_invert(OscilloscopeConstants.ON)
- Triggers
“:MATH:INVert ON”
- set_math_logic_source_1(channel='1')
Set source A of logic operation. Default value set is CH1. The logic operations include A&&B, A||B, A^B, and !A.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_logic_source_1()
- Triggers
“:MATH:LSOUrce1 CHANnel1”
- set_math_logic_source_2(channel='2')
Set source B of logic operation. Default value set is CH1. The logic operations include A&&B, A||B, A^B, and !A.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_logic_source_2()
- Triggers
“:MATH:LSOUrce2 CHANnel2”
- set_math_operator(operator)
Set the operator of the math operation.
- Parameters
operator (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ADD
. Values available: ADD, SUBTRACT, MULTIPLY, DIVISION, FFT, AND, OR, XOR, NOT, INTG, DIFF, SQRT, LOG, LN, EXP, ABS, FILTER.- Example
>>> Oscilloscope1000Device.set_math_operator(OscilloscopeConstants.ADD)
- Triggers
“:MATH:OPERator ADD”
- set_math_reset()
Sending this command, the instrument adjusts the vertical scale of the operation result to the most proper value according to the current operator and the horizontal timebase of the source.
- Example
>>> Oscilloscope1000Device.set_math_reset()
- Triggers
“:MATH:RESet”
- set_math_source_1(channel='1')
Set the source or source A of algebraic operation/functional operation/the outer layer operation of compound operation. Default value set is CH1.
For algebraic operations, this command is used to set source A.
For functional operations, only this command is used to set the source.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_math_source_1()
- Triggers
“:MATH:SOURce1 CHANnel1”
- set_math_source_2(channel='2')
Set the source or source B of algebraic operation/functional operation/the outer layer operation of compound operation. Default value set is CH1.
This command is only applicable to algebraic operations (requiring two sources) and compound operations whose outer layer operations are algebraic operations.
When the outlayer operation of compound operation is algebraic operation, this command is used to set source B of the outer layer operation.
- ..Note: When the outer layer operation of compound operation is algebraic operation, at least
one of source A and source B of the outer layer operation should be set to FX.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, FX.- Example
>>> Oscilloscope1000Device.set_math_source_1()
- Triggers
“:MATH:SOURce2 CHANnel1”
- set_math_voffset(offset_value)
Set the vertical offset of the operation result. The unit depends on the operator currently selected and the unit of the source. Default value set is 0.00V.
- Parameters
offset_value (str) – Defines vertical offset value. Write in form str(<number>). The default unit is V. e Related to the vertical scale of the operation result Range: (-1000 x MathVerticalScale) to (1000 x MathVerticalScale) Step: MathVerticalScale/50 MathVerticalScale is the vertical scale of the operation result and can be set by the
set_math_vscale()
method.- Example
>>> Oscilloscope1000Device.set_math_voffset(str(2))
- Triggers
“:MATH:OFFSet 2”
- set_math_vscale(scale_value)
Set the vertical scale of the operation result. The unit depends on the operator currently selected and the unit of the source. Default value set is 1.00V.
The range of the vertical scale is related to the operator currently selected and the vertical scale of the source channel. For the integration (intg) and differential (diff) operations, it is also related to the current horizontal timebase.
- Parameters
scale_value (str) – Defines vertical scale value. Write in form str(<number>). The max range is from 1p to 5T (in 1-2-5 step)
- Example
>>> Oscilloscope1000Device.set_math_vscale(str(2))
- Triggers
“:MATH:SCALe 2”
- set_measure_item(item, channel='', second_channel='')
Enable any waveform parameter of the specified source.
If the parameter to be measured only needs a single source (see table below), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.- Voltage Parameters
VMAX: The voltage value from the highest point of the waveform to the GND.
VMIN: The voltage value from the lowest point of the waveform to the GND.
VPP: The voltage value from the highest point to the lowest point of the waveform.
VTOP: The voltage value from the flat top of the waveform to the GND.
VBASe: The voltage value from the flat base of the waveform to the GND.
VAMP: The voltage value from the top of the waveform to the base of the waveform.
VAVG: The arithmetic average value on the whole waveform or on the gating area. The calculation formula is as follows:
VRMS: The root mean square value on the whole waveform or the gating area.
OVERshoot: The ratio of the difference between the maximum value and top value of the waveform to the amplitude value.
PREShoot: The ratio of the difference between the minimum value and base value of the waveform to the amplitude value.
VUPper: The actual voltage value corresponding to the threshold maximum value.
VMID: The actual voltage value corresponding to the threshold middle value.
VLOWer: The actual voltage value corresponding to the threshold minimum value.
VARIance: The average of the sum of the squares for the difference between the amplitude value of each waveform point and the waveform average value on the whole waveform or on the gating area. The variance reflects the fluctuation degree of the waveform.
PVRMS: The root mean square value within a period. For the calculation formula, please refer to “Vrms”.
- Time Parameters
PERiod: Defined as the time between the threshold middle points of two consecutive, like-polarity edges.
FREQuency: Defined as the reciprocal of period.
RTIMe: The time for the signal amplitude to rise from the lower limit to the upper limit of the threshod.
FTIMe: The time for the signal amplitude to fall from the upper limit to the lower limit of the threshod.
PWIDth: The time difference between the threshold middle point of a rising edge to that of the next falling edge of the pulse.
NWIDth: The time difference between the threshold middle point of a falling edge to that of the next rising edge of the pulse.
PDUTy: The ratio of the positive pulse width to the period.
NDUTy: The ratio of the negative pulse width to the period.
TVMAX: The time corresponding to the waveform maximum value (Vmax).
TVMIN: The time corresponding to the waveform minimum value (Vmin).
- Others
MARea: The area of the whole waveform within the screen and the unit is voltage-second. The area meadured above the zero reference (namely the vertical offset) is positive and the area measured below the zero reference is negative. The area measured is the algebraic sum of the area of the whole waveform within the screen.
MPARea: The area of the first period of the waveform on the screen and the unit is voltage-second. The area above the zero reference (namely the vertical offset) is positive and the area below the zero reference is negative. The area measured is the algeraic sum of the area of the waveform within the whole period.
PSLEWrate: Divide the difference of the upper value and lower value on the rising edge by the corresponding time.
NSLEWrate: Divide the difference of the lower value and upper value on the falling edge by the corresponding time.
- Count value
PPULses: The number of positive pulses that rise from below the threshold lower limit to above the threshold upper limit.
NPULses: The number of negative pulses that fall from above the threshold upper limit to below the threshold lower limit.
PEDGes: The number of rising edges that rise from below the threshold lower limit to above the threshold upper limit.
NEDGes: The number of falling edges that fall from above the threshold upper limit to below the threshold lower limit.
- If the parameter to be measured needs two sources (see table below), the command needs to include two sources;
otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by
- the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.
RDELay: The time difference between the rising edges of source 1 and source 2. Negative delay indicates that the selected rising edge of source 1 occurred after the selected rising edge of source 2.
FDELay: The time difference between the falling edges of source 1 and source 2. Negative delay indicates that the selected falling edge of source 1 occurred after the selected falling edge of source 2.
RPHase: Phase difference calculated according to “RDELay 1→2” and the period of source 1, expressed in degree. The calculation formula is as shown below.
FPHase: Phase difference calculated according to “FDELay 1→2” and the period of source 1, expressed in degree.The calculation formula is as shown below.
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES,channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to .see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Example
>>> Oscilloscope1000Device.set_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:ITEM VPP,CHAN1”
- set_measure_setup_dsa(signal_source='1')
Set or query source A of RDELay 1→2 and FDELay 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_dsa()
- Triggers
“:MEASure:SETup:DSA CHAN1”
- set_measure_setup_dsb(signal_source='1')
Set or query source B of RDELay 1→2 and FDELay 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_dsb()
- Triggers
“:MEASure:SETup:DSB CHAN1”
- set_measure_setup_psa(signal_source='1')
Set or query source A of RPHase 1→2 and FPHase 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_psa()
- Triggers
“:MEASure:SETup:PSA CHAN1”
- set_measure_setup_psb(signal_source='1')
Set or query source B of RPHase 1→2 and FPHase 1→2 measurements. This function will not set last channel value.
- Parameters
signal_source (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope1000Device.set_measure_setup_psb()
- Triggers
“:MEASure:SETup:PSB CHAN1”
- set_measure_statistic_item(item, channel='', second_channel='')
Enable the statistic function of any waveform parameter of the specified source. For more information about parameters see
set_measure_item()
method.If the parameter to be measured only needs a single source (VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, MARea, MPARea, PREShoot, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLEWrate, NSLEWrate, VUPper, VMID, VLOWer, VARIance, PVRMS, PPULses, NPULses, PEDGes, and NEDGes), you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.If the parameter to be measured needs two sources (RDELay, FDELay, RPHase, and FPHase), the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the sources are the ones selected by the
set_measure_setup_dsa()
andset_measure_setup_dsb()
or
set_measure_setup_psa()
andset_measure_setup_psb()
by default.- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, MAREA, MPAREA, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE, TVMAX, TVMIN, PSLEWRATE, NSLEWRATE, VUPPER, VMID, VLOWER, VARIANCE, PVRMS, PPULSES, NPULSES, PEDGEG, NEDGES.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.second_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to . see above written explanation. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, MATH.
- Example
>>> Oscilloscope1000Device.set_measure_statistic_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:STATistic:ITEM VPP,CHAN1”
- class pyvilab_lib.Oscilloscope2000Device(device='', timeout=0, recognition_sign='DS2')
Bases:
OscilloscopeDevice
- get_acquire_antialiasing()
The query returns the current state of the antialiasing function of the oscilloscope.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_acquire_antialiasing()
- Triggers
“:ACQuire:AALias?”
- get_calculate_fft_hcenter()
Query the current center frequency of the current FFT operation result.
- Returns
The query returns the frequency value in scientific notation in Hz.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hcenter()
- Triggers
“:CALC:FFT:HCEN?”
- get_calculate_fft_hoffset()
Query the current horizontal offset of the FFT operation result.
- Returns
The query returns the horizontal offset in scientific notation in Hz.
:rtype : bytes :Example:
>>> Oscilloscope2000Device.get_calculate_fft_hoffset()
- Triggers
“:CALC:FFT:HOFF?”
- get_calculate_fft_hscale()
Query the current horizontal coefficient in FFT operation.
- Returns
The query returns 1, 2, 3 or 4.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hscale()
- Triggers
“:CALC:FFT:HSC?”
- get_calculate_fft_hspan()
Query the current horizontal scale of the FFT operation result.
- Returns
The query returns the current horizontal scale in scientific notation and the unit is Hz/div.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_hspan()
- Triggers
“:CALC:FFT:HSP?”
- get_calculate_fft_source()
Query the current signal source of FFT operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_source()
- Triggers
“:CALC:FFT:SOUR?”
- get_calculate_fft_split()
Query the current status of the split display of the FFT operation.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_split()
- Triggers
“:CALC:FFT:SPL?”
- get_calculate_fft_vsmode()
Query the current vertical scale of the FFT operation result.
- Returns
The query returns VRMS or DBVR.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_vsmode()
- Triggers
“:CALC:FFT:VSM?”
- get_calculate_fft_window()
Query the current window function of the FFT operation.
- Returns
The query returns RECT, HANN, HAMM or BLAC.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_fft_window()
- Triggers
“:CALC:FFT:WIND?”
- get_calculate_invert()
Query the current status of the inverted display of the selected operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_invert()
- Triggers
“:CALC:SUB:INV?”
- get_calculate_mode()
Query the type of the current math operation.
- Returns
The query returns ADD, SUB, MULT, DIV, FFT, LOG, ADV or OFF.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_mode()
- Triggers
“:CALC:MODE?”
- get_calculate_source_a()
Query the current channel source of signal source A of defined operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_source_a()
- Triggers
“:CALC:SUB:SA?”
- get_calculate_source_b()
Query the current channel source of signal source B of defined operation.
- Returns
The query returns CHAN1 or CHAN2.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_source_b()
- Triggers
“:CALC:SUB:SB?”
- get_calculate_voffset()
Query the current vertical offset of the defined operation result. The default unit is V. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.- Returns
The query returns the vertical offset in scientific notation in V.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_voffset()
- Triggers
“:CALC:SUB:VOFF?”
- get_calculate_vscale()
Query the current vertical scale of the defined operation result. Unit varies for different math functions, see
set_calculate_vscale()
description. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command withset_calculate_function()
.- Returns
The query returns 2.000000e+00.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_calculate_vscale()
- Triggers
“:CALC:SUB:VSC?”
- get_decoding_display(channel='1')
Query the current display status of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1. 1 means ON.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_display()
- Triggers
“:BUS1:DISPlay?”
- get_decoding_event(channel='1')
Query the current status of the event table of bus 1 or bus 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_event()
- Triggers
“:BUS1:EVENt?”
- get_decoding_format(channel='1')
Query the current display format of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns HEX, DEC, BIN or ASC.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_format()
- Triggers
“:BUS1:FORMat?”
- get_decoding_mode(channel='1')
Query the current decoding mode of bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns PAR, RS232, IIC or SPI.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_mode()
- Triggers
“:BUS1:MODE?”
- get_decoding_parallel_clock(channel='1')
Query the current clock channel source of parallel decoding on bus 1 or 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns CHAN1, CHAN2 or OFF.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_clock()
- Triggers
“:BUS1:PAR:CLK?”
- get_decoding_parallel_offset(channel='1')
Query the current vertical offset in parallel decoding on bus 1 or bus 2.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the offset in integer.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_offset()
- Triggers
“:BUS1:PAR:OFFS?”
- get_decoding_parallel_slope(channel='1')
Query on which kind of edge of the clock the oscilloscope samples the data channel.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns POS, NEG or BOTH.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_slope()
- Triggers
“:BUS1:PAR:SLOPe?”
- get_decoding_parallel_threshold(channel='1')
Query the current threshold of the channel of parallel decoding on bus 1 or 2. The units for the trigger threshold match the units of the input channels.
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Returns
The query returns the current threshold in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_decoding_parallel_threshold()
- Triggers
“:BUS1:PAR:THR?”
- get_measure_area()
Query the current type of the measurement range.
- Returns
The query returns SCR or CREG.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area()
- Triggers
“:MEASure:AREA?”
- get_measure_area_cax()
Query the current position of cursor A. Default value set is 300.
- Returns
The query returns an integer as value of position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area_cax()
- Triggers
“:MEASure:CREGion:CAX?”
- get_measure_area_cbx()
Query the current position of cursor B. Default value set is 300.
- Returns
The query returns an integer as value of position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_area_cbx()
- Triggers
“:MEASure:CREGion:CBX?”
- get_measure_history_display()
Query the current status of the measurement history.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_history_display()
- Triggers
“:MEASure:HISTory:DISPlay?”
- get_measure_history_dmode()
Query the current display mode of the history measurement data
- Returns
The query returns TABL or GRAP.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_history_dmode()
- Triggers
“:MEASure:HISTory:DMODe?”
- get_measure_item(item, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source.
If the parameter to be measured only needs a single source, see table below, you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.Item
Description
Unit
VMAX
maximum
VMIN
minimum
VPP
peak-peak value
VTOP
top value
VBASe
base value
VAMP
value of the amplitude
VAVG
average of the amplitude
VRMS
RMS value of the amplitude
OVERshoot
overshoot
PREShoot
preshoot
PERiod
value of the period
s
FREQuency
frequency measurement
Hz
RTIMe
rise time
s
FTIMe
value of the fall time
s
PWIDth
positive pulse width
s
NWIDth
negative pulse width
s
PDUTy
positive duty cycle
NDUTy
value of the negative duty cycle
If the parameter to be measured needs two sources, see table below, the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the first source is selected by the
set_measure_source()
method by default.Item
Description
Unit
RDELay
delay between channels (rising edge)
s
FDELay
delay between channels (falling edge)
s
RPHase
phase deviation between channels (rising edge)
°
FPHase
phase deviation between channels (falling edge)
°
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, OVERSHOOT, PRESHOOT, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.second_channel (static variable from
OscilloscopeConstants
, optional) – Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_item(OscilloscopeConstants.VPP)
- Triggers
“:MEASure:VPP? CHAN1”
- get_measure_setup_type()
Query the type of current measurement setting.
- Returns
The query returns DEL, PHAS or THR.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_measure_setup_type()
- Triggers
“:MEASure:SETup:TYPE?”
- get_measure_statistic_item(item, extra, channel='', second_channel='')
Query the statistic result of any waveform parameter of the specified source.
If the parameter to be measured only needs a single source, see table below, you only need to set a single source. If both channels are omitted, the source is the one selected by the
set_measure_source()
method by default.Item
Description
Unit
VMAX
maximum
VMIN
minimum
VPP
peak-peak value
VTOP
top value
VBASe
base value
VAMP
value of the amplitude
VAVG
average of the amplitude
VRMS
RMS value of the amplitude
OVERshoot
overshoot
PREShoot
preshoot
PERiod
value of the period
s
FREQuency
frequency measurement
Hz
RTIMe
rise time
s
FTIMe
value of the fall time
s
PWIDth
positive pulse width
s
NWIDth
negative pulse width
s
PDUTy
positive duty cycle
NDUTy
value of the negative duty cycle
If the parameter to be measured needs two sources ,see table below, the command needs to include two sources; otherwise, the command is invalid. If both channels are omitted, the first source defaults to one selected by the
set_measure_source()
.Item
Description
Unit
RDELay
delay between channels (rising edge)
s
FDELay
delay between channels (falling edge)
s
RPHase
phase deviation between channels (rising edge)
°
FPHase
phase deviation between channels (falling edge)
°
- Parameters
item (static variable from
OscilloscopeConstants
) – Defines specific item to be measured. Write in formOscilloscopeConstant.VMAX
. Values available: VMAX, VMIN, VPP, VTOP, VBASE, VAMP, VAVG, VRMS, OVERSHOOT, PRESHOOT, PERIOD, FREQUENCY, RTIME, FTIME, PWIDTH, NWIDTH, PDUTY, NDUTY, RDELAY, FDELAY, RPHASE, FPHASE.extra (static variable from
OscilloscopeConstants
) – Defines specific frequency measurement. Write in formOscilloscopeConstant.MAXIMUM
. Values available: MAXIMUM, MINIMUM, CURRENT, AVERAGE or DEVIATION.channel (static variable from
OscilloscopeConstants
, optional) – Defaults toget_measure_source()
method when not defined. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.second_channel (static variable from
OscilloscopeConstants
, optional) – Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Returns
The query returns the statistic result in scientific notation.
- Return type
bytes
- :Example:ITEM? VPP,
>>> Oscilloscope2000Device.get_measure_statistic_item(OscilloscopeConstants.VPP, >>> OscilloscopeConstants.MAXIMUM)
- Triggers
“:MEASure:VPP:SMAXimum? CHAN1”
- get_timebase_href_mode()
Query the current horizontal reference mode.
- Returns
The query returns CENT, TPOS or USER.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_href_mode()
- Triggers
“:TIMebase:HREF:MODE?”
- get_timebase_href_position()
Query the current user-defined reference position around which the waveform expands or compresses horizontally.
- Returns
The query returns an integer as a reference position.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_href_position()
- Triggers
“:TIMebase:HREF:POSition?”
- get_timebase_vernier()
Query the current status of the fine adjustment of the horizontal scale.
- Returns
The query returns 0 or 1.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_timebase_vernier()
- Triggers
“:TIMebase:VERNier?”
- get_waveform_points()
Query the current number of waveform points to be read.
- Returns
The query returns an integer.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_waveform_points()
- Triggers
“:WAVeform:POINts?”
- get_waveform_status()
Query and return the current waveform reading state.
IDLE: the waveform reading thread finishes.
READ: the waveform reading thread is running.
n: the current number of waveform points to be read.
- Returns
The query returns IDLE,n or READ,n.
- Return type
bytes
- Example
>>> Oscilloscope2000Device.get_waveform_status()
- Triggers
“:WAVeform:STATus?”
- set_acquire_antialiasing(boolean)
Enable or disable the antialiasing function of the oscilloscope.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_acquire_antialiasing(OscilloscopeConstants.ON)
- Triggers
“:ACQuire:AALias ON”
- set_acquire_memory_depth(memory_depth_value)
Set the memory depth of the oscilloscope namely the number of waveform points that can be stored in a single trigger sample. DEF = AUTO.
- Parameters
memory_depth_value (str, static variable from
OscilloscopeConstants
) –Defines memory depth to be set. Static value write in form
OscilloscopeConstant.AUTO
. Other memory depth values can be set via str(<number>), where values can be:for single channel - AUTO, 14000, 140000, 1400000, 14000000, 56000000
for dual channel - AUTO, 7000, 70000, 700000, 7000000, 28000000
- Example
>>> Oscilloscope2000Device.set_acquire_memory_depth(str(1400000))
- Triggers
“:ACQuire:MDEPth 1400000”
- set_calculate_fft_hcenter(center_frequency)
Set the center frequency of the FFT operation result and the unit is Hz. Default value is 35MHz.
- Parameters
center_frequency (str) – Defines horizontal offset of the operation result +7* the current horizontal scalestr, as float number. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hcenter(str(10000000))
- Triggers
“:CALC:FFT:HCEN 10000000”
- set_calculate_fft_hoffset(offset_value)
Set the horizontal offset of the FFT operation result and the unit is Hz. Defaults to 0.
- Parameters
offset_value (str) – Write in form str(<number>). Number = -0.4*the current FFT sample rate of the screen to +0.4*the current FFT sample rate of the screen.
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hoffset(str(1000000))
- Triggers
“:CALC:FFT:HOFF 2”
- set_calculate_fft_hscale(hscale_value)
Set the horizontal coefficient in FFT operation. This command indirectly sets the FFT horizontal scale.
- Parameters
hscale_value (str) –
Write in form str(<number>). Horizontal scale = the current FFT sample rate of the screen divided by:
20
40
100
200
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hscale(str(2))
- Triggers
“:CALC:FFT:HSC 2”
- set_calculate_fft_hspan(sample_rate)
Set the horizontal scale of the FFT operation result. The default unit is Hz/div. Default value 5MHz/div.
- Parameters
sample_rate (str) – Defines current FFT sample rate of the screen/200 to the current FFT sample rate of the screen/20. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_fft_hspan(str(2500000))
- Triggers
“:CALC:FFT:HSP 2500000”
- set_calculate_fft_source(source_channel='1')
Select the signal source of FFT operation.
- Parameters
source_channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_fft_source()
- Triggers
“:CALC:FFT:SOUR CHAN2”
- set_calculate_fft_split(boolean)
Enable or disable the split display of the FFT operation.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_calculate_fft_split(OscilloscopeConstants.ON)
- Triggers
“:CALC:FFT:SPL ON”
- set_calculate_fft_vsmode(vmode)
Set the vertical scale of the FFT operation result to linear or log.
- Parameters
vmode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.VRMS
. Values available: VRMS, DBVRMS.- Example
>>> Oscilloscope2000Device.set_calculate_fft_vsmode(OscilloscopeConstants.VRMS)
- Triggers
“:CALC:FFT:VSM VRMS”
- set_calculate_fft_window(window_type)
Select the window function of the FFT operation.
- Parameters
window_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.RECTANGLE
. Values available RECTANGLE, HANNING, HAMMING, BLACKMAN.- Example
>>> Oscilloscope2000Device.set_calculate_fft_window(OscilloscopeConstants.HANNING)
- Triggers
“:CALC:FFT:WIND HANN”
- set_calculate_invert(boolean)
Enable or disable the inverted display of the selected operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF.- Example
>>> Oscilloscope2000Device.set_calculate_invert(OscilloscopeConstants.ON)
- Triggers
“:CALC:SUB:INV ON”
- set_calculate_mode(mode)
Select the type of the math operation or disable the math operation function.
- Parameters
mode (static variable from
OscilloscopeConstants
) – Defines what math operation to use. Write in formOscilloscopeConstant.OFF
. Values available: ADD, SUBTRACT, MULTIPLY, DIVISION, FFT, LOGIC, OFF.- Example
>>> Oscilloscope2000Device.set_calculate_mode(OscilloscopeConstants.FFT)
- Triggers
“:CALC:MODE FFT”
- set_calculate_source_a(channel_source='1')
Select the channel source of signal source A of defined operation. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
channel_source (static variable from
OscilloscopeConstants
, optional) – Defaults to CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_source_a()
- Triggers
“:CALC:SUB:SA CHAN1”
- set_calculate_source_b(channel_source='2')
Select the channel source of signal source B of defined operation. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION, select before this command with
set_calculate_function()
.- Parameters
channel_source (static variable from
OscilloscopeConstants
, optional) – Defaults to CH2. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_calculate_source_b()
- Triggers
“:CALC:SUB:SB CHAN1”
- set_calculate_voffset(offset_value)
Set the vertical offset of the defined operation result. This function is available only for ADD, SUB, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.- Parameters
offset_value (str) – Defines vertical offset value. Write in form str(<number>). The default unit is V. offset_value range for every math_function -40 × VScale to 40 × VScale. DEF 0
- Example
>>> Oscilloscope2000Device.set_calculate_voffset(str(2))
- Triggers
“:CALC:SUB:VOFF 2”
- set_calculate_vscale(scale_value)
Set the vertical scale of the defined operation result. This function is available only for ADD, SUBTRACT, MULTIPLY, DIVISION or FFT select before this command with
set_calculate_function()
.scale_value for each math function. Value is related to the current channel scale:
Math function
Range
Default value
ADD
0.02V to 500V
2V
SUBTRACT
0.02V to 500V
2V
MULTIPLY
5.0e-08U to 1.0e+07U
2U
DIVISION
5.0e-07U to 5.0e+08U
2U
FFT
dBVrms: 1 to 100 | Vrms: 0.01 to 200
10dBVrms/div
- Parameters
scale_value (str) – Defines vertical scale value. Write in form str(<number>).
- Example
>>> Oscilloscope2000Device.set_calculate_vscale(str(2))
- Triggers
“:CALC:SUB:VSC 2”
- set_decoding_display(boolean, channel='1')
Enable or disable the display of bus 1 or 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_display(OscilloscopeConstants.ON)
- Triggers
“:BUS1:DISPlay ON”
- set_decoding_event(boolean, channel='1')
Enable or disable the event table of bus 1 or bus 2.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFFchannel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_event(OscilloscopeConstants.ON)
- Triggers
“:BUS1:EVENt ON”
- set_decoding_format(format_type, channel='1')
Set the display format of bus 1 or 2 to hexadecimal, decimal, binary or ASCII.
- Parameters
format_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.HEX
. Values available: HEX, DEC, BIN, ASCII.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_format(OscilloscopeConstants.HEX)
- Triggers
“:BUS1:FORMat HEX”
- set_decoding_mode(mode, channel='1')
Set the decoding mode of bus 1 or 2.
- Parameters
mode (static variable from
OscilloscopeConstants
, optional) – Defines decoding mode. Write in formOscilloscopeConstant.PARALLEL
. Values available: PARALLEL, RS232, IIC, SPI.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_mode(OscilloscopeConstants.SPI)
- Triggers
“:BUS1:MODE SPI”
- set_decoding_parallel_clock(source_channel, channel='1')
Set the clock channel source of parallel decoding on bus 1 or 2. When OFF is selected, no clock channel is set and the oscilloscope samples data once the channel data jumps. At this point, the edge set by the set_decoding_parallel_scope function can be ignored.
- Parameters
source_channel (static variable from
OscilloscopeConstants
) – Defines source channel for clock. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2, OFF.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_clock(OscilloscopeConstants.CH2)
- Triggers
“:BUS1:PAR:CLK CHAN2”
- set_decoding_parallel_offset(offset_value, channel='1')
- Set the vertical offset in parallel decoding on bus 1 or 2. Enable the display of the bus
(refer to the
set_decoding_display function()
), before using this command.
- Parameters
offset_value – Write in form str<number>.
Normal: -166 to 148 {if scope.set_measure_statistic_display(scope.ON)},
Statistic: -163 to 143 {if scope.set_measure_statistic_display(scope.OFF)},
Half screen: -103 to 52 {the screen is divided into two windows (refer to the
set_timebase_delay_enable()
andset_calculate_fft_split functions()
).}>
- Parameters
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.- Example
>>> Oscilloscope2000Device.set_decoding_parallel_offset(str(2))
- Triggers
“:BUS1:PAR:OFFS 2”
- set_decoding_parallel_slope(pos_value, channel='1')
Set the oscilloscope to sample the channel data on the rising edge, falling edge or rising&falling edges of the clock. When no clock channel is set (refer to the
set_decoding_parallel_clock()
function), the oscilloscope samples data once the channel data jumps and the edge set by this command can be ignored.- Parameters
pos_value (static variable from
OscilloscopeConstants
) – Defines what edge to be set for measurement. Write in formOscilloscopeConstant.POSITIVE
. Values available POSITIVE, NEGATIVE, BOTH.channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_slope(OscilloscopeConstants.POSITIVE)
- Triggers
“:BUS1:PAR:SLOPe POS”
- set_decoding_parallel_threshold(source_channel, threshold_value, channel='1')
Set the threshold of the channel of parallel decoding on bus 1 or 2. Default value is 0. The units for the trigger threshold match the units of the input channels.
- Parameters
source_channel (static variable from
OscilloscopeConstants
) – Defines source channel. Write in formOscilloscopeConstant.CH1
. Values available: CH1, CH2, OFF.threshold_value (str) – Defines real number:{± 5 × VerticalScale from the screen center - OFFSet. Write in form srt(<number>).
channel (static variable from
OscilloscopeConstants
, optional) – Defaults to last used channel or CH1. Write in formOscilloscopeConstant.CH2
. Values available: CH1, CH2.
- Example
>>> Oscilloscope2000Device.set_decoding_parallel_threshold(OscilloscopeConstants.CH2, str(2.4))
- Triggers
“:BUS1:PAR:THR CHAN2,2.4”
- set_measure_area(area_measured)
Set the measurement range to the screen region or the cursor region.
SCReen: waveforms within the screen region.
CREGion: region specified by cursor A (refer to the
set_measure_area_cax()
method) and cursor B (refer to theset_measure_area_cbx()
method).
- Parameters
area_measured (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.SCREEN
. Values available: SCREEN, CREGION.- Example
>>> Oscilloscope2000Device.set_measure_area(OscilloscopeConstants.CREGION)
- Triggers
“:MEASure:AREA CREG”
- set_measure_area_cax(cursor_value_a)
When the measurement range is set to the cursor region, use this command to set the position of cursor A. Default value set is 300.
- Parameters
cursor_value_a (str) – Defines position of cursor A. Values range available is 0 to (the current position of cursor B - 6). Write word str(<position>).
- Example
>>> Oscilloscope2000Device.set_measure_area_cax(str(20))
- Triggers
“:MEASure:CREGion:CAX 20”
- set_measure_area_cbx(cursor_value_b)
When the measurement range is set to the cursor region, use this command to set the position of cursor B. Default value set is 400.
- Parameters
cursor_value_b (str) – Defines position of cursor A. Values range available is cursor A + 6 to 697. Write word str(<position>).
- Example
>>> Oscilloscope2000Device.set_measure_area_cbx(str(600))
- Triggers
“:MEASure:CREGion:CBX 600”
- set_measure_history_display(boolean)
Enable or disable the measurement history.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_measure_history_display(OscilloscopeConstants.ON)
- Triggers
“:MEASure:HISTory:DISPlay ON”
- set_measure_history_dmode(display_mode)
Set the display mode of the history measurement data to table or graph. Before using this command, enable the measurement history (refer to the
set_measure_history_display()
method).TABLE: display the measurement results of the last 10 measurements of at most 5 measurement items that are enabled last in table mode.
GRAPH: display the measurement results of the last 10 measurements of at most 5 measurement items that are enabled last in graph mode. The measurement points are connected using linear interpolation.
- Parameters
display_mode (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.TABLE
. Values available: TABLE, GRAPH.- Example
>>> Oscilloscope2000Device.set_measure_history_dmode(OscilloscopeConstants.TABLE)
- Triggers
“:MEASure:HISTory:DMODe TABLe”
- set_measure_setup_type(setup_type)
Set the type of measurement setting to phase, delay or threshold.
- Parameters
setup_type (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.DELAY
. Values available: DELAY, PHASE, THRESHOLD.- Example
>>> Oscilloscope2000Device.set_measure_setup_type(OscilloscopeConstants.PHASE)
- Triggers
“:MEASure:SETup:TYPE PHASe”
- set_timebase_href_mode(mode)
Set the horizontal reference mode namely the reference position according to which the waveform expands and compresses horizontally. Default mode set is CENTER.
- Parameters
mode (static variable from
OscilloscopeConstants
) –Write in form
OscilloscopeConstant.USER
. Values available: CENTER, TPOSITION, USER.CENTER: the waveform expands or compresses horizontally around the center of the screen.
TPOSITION: the waveform expands or compresses horizontally around the trigger position.
USER: the waveform expands or compresses horizontally around the user-defined reference position. Refer to the
set_timebase_href_position()
method.
- Example
>>> Oscilloscope2000Device.set_timebase_href_mode(OscilloscopeConstants.TPOSITION)
- Triggers
“:TIMebase:HREF:MODE TPOSition”
- set_timebase_href_position(position_value)
Set the user-defined reference position around which the waveform expands or compresses horizontally. Default value set is 0.
- Parameters
position_value (str) – Write in form str(<value>). Available range is from -350 to 350.
- Example
>>> Oscilloscope2000Device.set_timebase_href_position(str(150))
- Triggers
“:TIMebase:HREF:POSition 150”
- set_timebase_vernier(boolean)
Enable or disable the fine adjustment of the horizontal scale. Default value set is 0.
- Parameters
boolean (static variable from
OscilloscopeConstants
) – Write in formOscilloscopeConstant.ON
. Values available: ON, OFF- Example
>>> Oscilloscope2000Device.set_timebase_vernier(OscilloscopeConstants.ON)
- Triggers
“:TIMebase:VERNier ON”
- set_tlhalf()
Set the trigger level to the vertical midpoint of the trigger signal amplitude.
- Example
>>> Oscilloscope2000Device.set_tlhalf()
- Triggers
“:TLH”
- set_waveform_begin()
Enable the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_begin()
- Triggers
“:WAVeform:BEGin”
- set_waveform_end()
Stop the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_end()
- Triggers
“:WAVeform:END”
- set_waveform_points(points_value)
Set the number of waveform points to be read. The number of waveform points is limited by the current reading mode of waveform (refer to the
set_waveform_mode()
method).- Parameters
points_value (str) – str({ int for NORMal: 1 to 1400 points MAX: 1 to the number of effective points currently on the screen RAW: 1 to the current maximum memory depth})
points_value –
Write in form str(<number>). Integer values available:
NORMal: 1 to 1400 points
MAX: 1 to the number of effective points currently on the screen
RAW: 1 to the current maximum memory depth
- Example
>>> Oscilloscope2000Device.set_waveform_points(str(600))
- Triggers
“:WAVeform:POINts 600”
- set_waveform_reset()
Reset the waveform reading.
- Example
>>> Oscilloscope2000Device.set_waveform_reset()
- Triggers
“:WAVeform:RESet”
- class pyvilab_lib.OscilloscopeConfig
Bases:
object
- Example:
>>> from pyvilab_lib import OscilloscopeDevice, OscilloscopeConfig >>> >>> scoper = OscilloscopeDevice() >>> scoper.open() >>> >>> config = OscilloscopeConfig() >>> config.channel = "CH1" >>> config.channel_display = "ON" >>> config.timebase_scale = "0.0002" >>> config.channel_scale = "1" >>> scoper.set_config(config) >>> scoper.close()
- class pyvilab_lib.OscilloscopeConstants
Bases:
object
Class for storing static constants of oscilloscope
- ABS = 'ABS'
- AC = 'AC'
- ACLINE = 'ACLine'
- ADD = 'ADD'
- AMPERE = 'AMP'
- AND = 'AND'
- ASCII = 'ASC'
- AVERAGE = 'AVERage'
- BIN = 'BIN'
- BLACKMAN = 'BLAC'
- BOTH = 'BOTH'
- BW20M = '20M'
- BYTE = 'BYTE'
- CENTER = 'CENT'
- CH1 = '1'
- CH2 = '2'
- CREGION = 'CREG'
- CURRENT = 'CURRent'
- DB = 'DB'
- DBVRMS = 'DBVRms'
- DC = 'DC'
- DEC = 'DEC'
- DELAY = 'DELay'
- DEVIATION = 'DEViation'
- DIFF = 'DIFF'
- DIFFERENCE = 'DIFF'
- DIVISION = 'DIV'
- EDGE = 'EDGE'
- EXP = 'EXP'
- EXT = 'EXT'
- EXTREMUM = 'EXTR'
- FDELAY = 'FDELay'
- FFT = 'FFT'
- FILTER = 'FILTER'
- FLATTOP = 'FLAT'
- FPHASE = 'FPHase'
- FREQUENCY = 'FREQuency'
- FTIME = 'FTIMe'
- FX = 'FX'
- GND = 'GND'
- GRAPH = 'GRAP'
- HAMMING = 'HAMM'
- HANNING = 'HANN'
- HEX = 'HEX'
- HFREJECT = 'HFReject'
- HRESOLUTION = 'HRES'
- IIC = 'IIC'
- INTG = 'INTG'
- LFREJECT = 'LFReject'
- LINE = 'LINE'
- LN = 'LN'
- LOGIC = 'LOG'
- MAIN = 'MAIN'
- MAREA = 'MARea'
- MATH = 'MATH'
- MAXIMUM = 'MAX'
- MEMORY = 'MEM'
- MINIMUM = 'MINimum'
- MPAREA = 'MPARea'
- MULTIPLY = 'MULT'
- NDUTY = 'NDUTy'
- NEDGES = 'NEDGes'
- NEGATIVE = 'NEG'
- NORMAL = 'NORM'
- NOT = 'NOT'
- NPULSES = 'NPULses'
- NSLEWRATE = 'NSLEWrate'
- NWIDTH = 'NWIDth'
- OFF = 'OFF'
- ON = 'ON'
- OR = 'OR'
- OVERSHOOT = 'OVERshoot'
- PARALLEL = 'PARallel'
- PDUTY = 'PDUTy'
- PEAK = 'PEAK'
- PEDGEG = 'PEDGes'
- PERIOD = 'PERiod'
- PHASE = 'PHAS'
- POSITIVE = 'POS'
- PPULSES = 'PPULses'
- PRESHOOT = 'PREShoot'
- PSLEWRATE = 'PSLEWrate'
- PULSE = 'PULSe'
- PVRMS = 'PVRMS'
- PWIDTH = 'PWIDth'
- RAW = 'RAW'
- RDELAY = 'RDELay'
- RECTANGLE = 'RECT'
- RFALI = 'RFALI'
- ROLL = 'ROLL'
- RPHASE = 'RPHase'
- RS232 = 'RS232'
- RTIME = 'RTIMe'
- SCREEN = 'SCR'
- SPI = 'SPI'
- SQRT = 'SQRT'
- SUBTRACT = 'SUB'
- TABLE = 'TABL'
- THRESHOLD = 'THR'
- TPOSITION = 'TPOS'
- TRACE = 'TRAC'
- TRIANGLE = 'TRI'
- TVMAX = 'TVMAX'
- TVMIN = 'TVMIN'
- UNKNOWN = 'UNKN'
- USER = 'USER'
- VAMP = 'VAMP'
- VARIANCE = 'VARIance'
- VAVG = 'VAVG'
- VBASE = 'VBASe'
- VLOWER = 'VLOWer'
- VMAX = 'VMAX'
- VMID = 'VMID'
- VMIN = 'VMIN'
- VOLTAGE = 'VOLT'
- VPP = 'VPP'
- VRMS = 'VRMS'
- VTOP = 'VTOP'
- VUPPER = 'VUPper'
- WATT = 'WATT'
- WORD = 'WORD'
- XOR = 'XOR'
- XY = 'XY'