M8070B module
Created on Mon Jul 21 18:56:32 2025
@author: Maxim Weizel
- class Instruments_Libraries.M8070B.M8070B(resource_str='TCPIP0::localhost::hislip0::INSTR')[source]
Bases:
object
Start the M8070B Software. Go to Utilities-> SCPI Server Information. Copy the VISA resource string (usually localhost).
- get_amplitude(channel=1)[source]
Returns the differential amplitude setting for the selected channel.
- Parameters:
channel (int, optional) – 1 or 2, by default 1
- Returns:
Differential amplitude setting.
- Return type:
float
- get_delay(channel)[source]
Returns the delay for the selected channel in seconds.
- Parameters:
channel (int) – Channel 1 or 2
- Returns:
Delay in seconds.
- Return type:
float
- get_output_state(channel)[source]
Returns the output state for the selected channel.
- Parameters:
channel (int) – Channel 1 or 2
- Returns:
Output state. 0 or 1.
- Return type:
int
- get_sample_clk_out2_power()[source]
Returns the sample clock OUT2 Power in dBm from the M8008A CLK module. Sample clock OUT1 cannot be influenced.
- Returns:
Sample Clock OUT2 Power in dBm.
- Return type:
float
- get_sample_clk_out2_state()[source]
Returns the sample clock OUT2 state from the M8008A CLK module. Sample clock OUT1 cannot be turned off.
- Returns:
Sample clock output state. 0 or 1.
- Return type:
int
- get_sample_clk_out_frequency(channel=1)[source]
Returns the sample clock OUT1 or OUT2 frequency from the M8008A CLK module. Both freqeuncies are the same.
- Parameters:
channel (int, optional) – 1 or 2, by default 1
- Returns:
Sample clock output frequency in Hz.
- Return type:
float
- iqdownload(matlab_engine, iqdata, fs, *, segment_number=1, normalize=True, channel_mapping=None, sequence=None, marker=None, arb_config=None, keep_open=False, run=True, segment_length=None, segment_offset=None, lo_amplitude=None, lo_f_center=None, segm_name=None, rms=None)[source]
Download a pre-generated IQ waveform to the AWG.
- Parameters:
matlab_engine (matlab.engine) – Active MATLAB engine session.
iqdata (array-like) – Real or complex samples (each column = one waveform). Can be empty for a connection check.
fs (float) – Sample rate in Hz.
segment_number (int, optional) – Which segment to download into (default=1).
normalize (bool, optional) – Auto-scale to DAC range (default=True).
channel_mapping (array-like, optional) – 2xM logical matrix mapping IQ data columns to AWG channels.
sequence (any, optional) – Sequence table descriptor.
marker (array-like of int, optional) – Marker bits per sample.
arb_config (struct, optional) – AWG configuration struct (default from arbConfig file).
keep_open (bool, optional) – If True, leave connection open after download (default=False).
run (bool, optional) – If True, start AWG immediately after download (default=True).
segment_length – Other advanced options as per MATLAB doc.
segment_offset – Other advanced options as per MATLAB doc.
lo_amplitude – Other advanced options as per MATLAB doc.
lo_f_center – Other advanced options as per MATLAB doc.
segm_name – Other advanced options as per MATLAB doc.
rms – Other advanced options as per MATLAB doc.
- Returns:
The output of the MATLAB iqdownload call (empty or status).
- Return type:
result
- set_OutputPowerLevel(channel, powerdBm)[source]
Sets the Signal Generator Output Power in dBm. Alias for set_rf_power().
- Parameters:
channel (int) – Channel 1 or 2
value (int/float) – Output Power in dBm
powerdBm (int | float)
- Return type:
None
- set_amplitude(channel, amplitude)[source]
Differential amplitude setting for the selected channel.
- Parameters:
channel (int) – Channel 1 or 2
amplitude (int/float) – Amplitude setting in V. Must be between 0.1 and 2.7 V
- Return type:
None
- set_delay(channel, delay)[source]
Set the delay for the selected channel in seconds.
- Parameters:
channel (int) – Channel 1 or 2
delay (float) – Delay in seconds.
- Return type:
None
- set_freq_CW(matlab_engine, channel, frequency, correction=0, run=1, fs=256000000000.0)[source]
Set the CW tone frequency on the AWG via MATLAB engine.
- Parameters:
matlab_engine (matlab.engine) – An active MATLAB engine session.
channel (int) – AWG channel (1 or 2).
frequency (float) – Tone frequency in Hz.
correction (int, optional) – Enable correction (default 0).
run (int, optional) – AWG run number (default 1).
fs (float, optional) – AWG sample rate (default 256e9).
- Return type:
None
- set_output(channel, state)[source]
Activate or deactivate the selected channel output.
- Parameters:
channel (int) – Channel 1 or 2
state (int | str) – One of: 0, 1, “off”, “on”
- Raises:
ValueError – Channel must be 1 or 2. State must be 0 or 1.
- Return type:
None
- set_rf_output(channel, state)[source]
Activate or deactivate the selected channel output. Alias for set_output().
- Parameters:
channel (int)
state (int | str)
- Return type:
None
- set_rf_power(channel, powerdBm)[source]
Sets the Signal Generator Output Power in dBm.
- Parameters:
channel (int) – Channel 1 or 2
power (int/float) – Output Power in dBm
powerdBm (int | float)
- Return type:
None
- set_sample_clk_out2_power(power)[source]
Sets the sample clock OUT2 Power in dBm from the M8008A CLK module. Sample clock OUT1 cannot be influenced.
- Parameters:
power (int | float) – Sample Clock OUT2 Power in dBm. Must be between -5 and 12 dBm
- Return type:
None