# Anritsu MS464xB Vector Network Analyzer

class pymeasure.instruments.anritsu.AnritsuMS4642B(adapter, name='Anritsu MS464xB Vector Network Analyzer', active_channels=16, installed_ports=4, traces_per_channel=None, **kwargs)

  Bases: `AnritsuMS464xB`

  A class representing the Anritsu MS4642B Vector Network Analyzer (VNA).

  This VNA has a frequency range from 10 MHz to 20 GHz and is part of the `AnritsuMS464xB` family of instruments; for documentation, for documentation refer to this base class.

class pymeasure.instruments.anritsu.AnritsuMS4644B(adapter, name='Anritsu MS464xB Vector Network Analyzer', active_channels=16, installed_ports=4, traces_per_channel=None, **kwargs)

  Bases: `AnritsuMS464xB`

  A class representing the Anritsu MS4644B Vector Network Analyzer (VNA).

  This VNA has a frequency range from 10 MHz to 40 GHz and is part of the `AnritsuMS464xB` family of instruments; for documentation, for documentation refer to this base class.

class pymeasure.instruments.anritsu.AnritsuMS4645B(adapter, name='Anritsu MS464xB Vector Network Analyzer', active_channels=16, installed_ports=4, traces_per_channel=None, **kwargs)

  Bases: `AnritsuMS464xB`

  A class representing the Anritsu MS4645B Vector Network Analyzer (VNA).

  This VNA has a frequency range from 10 MHz to 50 GHz and is part of the `AnritsuMS464xB` family of instruments; for documentation, for documentation refer to this base class.

class pymeasure.instruments.anritsu.AnritsuMS4647B(adapter, name='Anritsu MS464xB Vector Network Analyzer', active_channels=16, installed_ports=4, traces_per_channel=None, **kwargs)

  Bases: `AnritsuMS464xB`

  A class representing the Anritsu MS4647B Vector Network Analyzer (VNA).

  This VNA has a frequency range from 10 MHz to 70 GHz and is part of the `AnritsuMS464xB` family of instruments; for documentation, for documentation refer to this base class.

class pymeasure.instruments.anritsu.AnritsuMS464xB(adapter, name='Anritsu MS464xB Vector Network Analyzer', active_channels=16, installed_ports=4, traces_per_channel=None, **kwargs)

  Bases: `SCPIUnknownMixin`, `Instrument`

  A class representing the Anritsu MS464xB Vector Network Analyzer (VNA) series.

  This family consists of the MS4642B, MS4644B, MS4645B, and MS4647B, which are represented in their respective classes (`AnritsuMS4642B`, `AnritsuMS4644B`, `AnritsuMS4645B`, `AnritsuMS4647B`), that only differ in the available frequency range.

  They can contain up to 16 instances of `MeasurementChannel` (depending on the configuration of the instrument), that are accessible via the channels dict or directly via ch_ + the channel number.

  Parameters:

    - active_channels (int (1-16) or str ("auto")) – defines the number of active channels (default=16); if active_channels is “auto”, the instrument will be queried for the number of active channels.

    - installed_ports (int (1-4) or str ("auto")) – defines the number of installed ports (default=4); if “auto” is provided, the instrument will be queried for the number of ports

    - traces_per_channel (int (1-16) or str ("auto") or None) – defines the number of traces that is assumed for each channel (between 1 and 16); if not provided, the maximum number is assumed; “auto” is provided, the instrument will be queried for the number of traces of each channel.

  property active_channel

    Control the active channel.

  property bandwidth_enhancer_enabled

    Control the state of the IF bandwidth enhancer.

  property binary_data_byte_order

    Control the binary numeric I/O data byte order.

    valid values are:

    value | description
    --- | ---
    NORM | The most significant byte (MSB) is first
    SWAP | The least significant byte (LSB) is first

  check_errors()

    Read all errors from the instrument.

    Returns:

      list of error entries

  copy_data_file(from_filename, to_filename)

    Copy a file on the VNA HDD.

    Parameters:

      - from_filename (str) – full filename including pat

      - to_filename (str) – full filename including path

  create_directory(dir_name)

    Create a directory on the VNA HDD.

    Parameters:

      dir_name (str) – directory name

  property data_drawing_enabled

    Control whether data drawing is enabled (True) or not (False).

  property datablock_header_format

    Control the way the arbitrary block header for output data is formed.

    Valid values are:

    value | description
    --- | ---
    0 | A block header with arbitrary length will be sent.
    1 | The block header will have a fixed length of 11 characters.
    2 | No block header will be sent. Not IEEE 488.2 compliant.

  property datablock_numeric_format

    Control format for numeric I/O data representation.

    Valid values are:

    value | description
    --- | ---
    ASCII | An ASCII number of 20 or 21 characters long with floating point notation.
    8byte | 8 bytes of binary floating point number representation limited to 64 bits.
    4byte | 4 bytes of floating point number representation.

  property datafile_frequency_unit

    Control the frequency unit displayed in a SNP data file.

    Valid values are HZ, KHZ, MHZ, GHZ.

  property datafile_include_heading

    Control whether a heading is included in the data files.

  property datafile_parameter_format

    Control the parameter format displayed in an SNP data file.

    Valid values are:

    value | description
    --- | ---
    LINPH | Linear and Phase.
    LOGPH | Log and Phase.
    REIM | Real and Imaginary Numbers.

  delete_data_file(filename)

    Delete a file on the VNA HDD.

    Parameters:

      filename (str) – full filename including path

  delete_directory(dir_name)

    Delete a directory on the VNA HDD.

    Parameters:

      dir_name (str) – directory name

  property display_layout

    Control the channel display layout in a Row-by-Column format.

    Valid values are: R1C1, R1C2, R2C1, R1C3, R3C1, R2C2C1, R2C1C2, C2R2R1, C2R1R2, R1C4, R4C1, R2C2, R2C3, R3C2, R2C4, R4C2, R3C3, R5C2, R2C5, R4C3, R3C4, R4C4. The number following the R indicates the number of rows, following the C the number of columns; e.g. R2C2 results in a 2-by-2 layout. The options that contain two C’s or R’s result in asymmetric layouts; e.g. R2C1C2 results in a layout with 1 channel on top and two channels side-by-side on the bottom row.

  property event_status_enable_bits

    Control the Standard Event Status Enable Register bits.

    The register can be queried using the `query_event_status_register()` method. Valid values are between 0 and 255. Refer to the instrument manual for an explanation of the bits.

  property external_trigger_delay

    Control the delay time of the external trigger in seconds.

    Valid values are between 0 [s] and 10 [s] in steps of 1e-9 [s] (i.e. 1 ns).

  property external_trigger_edge

    Control the edge type of the external trigger.

    Valid values are POS (for positive or leading edge) or NEG (for negative or trailing edge).

  property external_trigger_handshake

    Control status of the external trigger handshake.

  property external_trigger_type

    Control the type of trigger that will be associated with the external trigger.

    Valid values are POIN (for point), SWE (for sweep), CHAN (for channel), and ALL.

  property hold_function_all_channels

    Control the hold function of all channels.

    Valid values are:

    value | description
    --- | ---
    CONT | Perform continuous sweeps on all channels
    HOLD | Hold the sweep on all channels
    SING | Perform a single sweep and then hold all channels

  load_data_file(filename)

    Load a data file from the VNA HDD into the VNA memory.

    Parameters:

      filename (str) – full filename including path

  load_data_file_to_memory(filename)

    Load a data file to a memory trace.

    Parameters:

      filename (str) – full filename including path

  property manual_trigger_type

    Control the type of trigger that will be associated with the manual trigger.

    Valid values are POIN (for point), SWE (for sweep), CHAN (for channel), and ALL.

  property max_number_of_points

    Control the maximum number of points the instrument can measure in a sweep.

    Note that when this value is changed, the instrument will be rebooted. Valid values are 25000 and 100000. When 25000 points is selected, the instrument supports 16 channels with 16 traces each; when 100000 is selected, the instrument supports 1 channel with 16 traces.

  property number_of_channels

    Control the number of displayed (and therefore accessible) channels.

    When the system is in 25000 points mode, the number of channels can be 1, 2, 3, 4, 6, 8, 9, 10, 12, or 16; when the system is in 100000 points mode, the system only supports 1 channel. If a value is provided that is not valid in the present mode, the instrument is set to the next higher channel number.

  property number_of_ports

    Get the number of instrument test ports.

  query_event_status_register()

    Query the value of the Standard Event Status Register.

    Note that querying this value, clears the register. Refer to the instrument manual for an explanation of the returned value.

  read_datafile(channel, sweep_points, datafile_freq, datafile_par, filename)

    Read a data file from the VNA.

    Parameters:

      - channel (int) – Channel Index

      - sweep_points (int) – number of sweep point as an integer

      - datafile_freq (DataFileFrequencyUnits) – Data file frequency unit

      - datafile_par (DataFileParameter) – Data file parameter format

      - filename (str) – full path of the file to be saved

  property remote_trigger_type

    Control the type of trigger that will be associated with the remote trigger.

    Valid values are POIN (for point), SWE (for sweep), CHAN (for channel), and ALL.

  return_to_local()

    Returns the instrument to local operation.

  property service_request_enable_bits

    Control the Service Request Enable Register bits.

    Valid values are between 0 and 255; setting 0 performs a register reset. Refer to the instrument manual for an explanation of the bits.

  store_image(filename)

    Capture a screenshot to the file specified.

    Parameters:

      filename (str) – full filename including path

  trigger()

    Trigger a continuous sweep from the remote interface.

  trigger_continuous()

    Trigger a continuous sweep from the remote interface.

  trigger_single()

    Trigger a single sweep with synchronization from the remote interface.

  property trigger_source

    Control the source of the sweep/measurement triggering.

    Valid values are:

    value | description
    --- | ---
    AUTO | Automatic triggering
    MAN | Manual triggering
    EXTT | Triggering from rear panel BNC via the GPIB parser
    EXT | External triggering port
    REM | Remote triggering

  update_channels(number_of_channels=None, **kwargs)

    Create or remove channels to be correct with the actual number of channels.

    Parameters:

      number_of_channels (int) – optional, if given, defines the desired number of channels.

class pymeasure.instruments.anritsu.anritsuMS464xB.MeasurementChannel(*args, frequency_range=None, traces=None, **kwargs)

  Bases: `Channel`

  Represents a channel of Anritsu MS464xB VNA.

  Contains 4 instances of `Port` (accessible via the ports dict or directly pt_ + the port number) and up to 16 instances of `Trace` (accessible via the traces dict or directly tr_ + the trace number).

  Parameters:

    - frequency_range (list of floats) – defines the number of installed ports (default=4).

    - traces (int (1-16) or str ("auto") or None) – defines the number of traces that is assumed for the channel (between 1 and 16); if not provided, the maximum number is assumed; “auto” is provided, the instrument will be queried for the number of traces.

  activate()

    Set the indicated channel as the active channel.

  property active_trace

    Set the active trace on the indicated channel.

  property application_type

    Control the application type of the specified channel.

    Valid values are TRAN (for transmission/reflection), NFIG (for noise figure measurement), PULS (for PulseView).

  property average_count

    Control the averaging count for the indicated channel.

    The channel must be turned on. Valid values are between 1 and 1024.

  property average_sweep_count

    Get the averaging sweep count for the indicated channel.

  property average_type

    Control the averaging type to for the indicated channel.

    Valid values are POIN (point-by-point) or SWE (sweep-by-sweep)

  property averaging_enabled

    Control whether the averaging is turned on for the indicated channel.

  property bandwidth

    Control the IF bandwidth for the indicated channel.

    Valid values are between 1 [Hz] and 1E6 [Hz] (i.e. 1 MHz). The system will automatically select the closest IF bandwidth from the available options (1, 3, 10 … 1E5, 3E5, 1E6).

  property calibration_enabled

    Control whether the RF correction (calibration) is enabled for indicated channel.

  check_errors()

    Read all errors from the instrument and log them.

    Returns:

      List of error entries.

  clear_average_count()

    Clear and restart the averaging sweep count of the indicated channel.

  property cw_mode_enabled

    Control the state of the CW sweep mode of the indicated channel.

  property cw_number_of_points

    Control the CW sweep mode number of points of the indicated channel.

    Valid values are between 1 and 25000 or 100000 depending on the maximum points setting.

  property display_layout

    Control the trace display layout in a Row-by-Column format for the indicated channel.

    Valid values are: R1C1, R1C2, R2C1, R1C3, R3C1, R2C2C1, R2C1C2, C2R2R1, C2R1R2, R1C4, R4C1, R2C2, R2C3, R3C2, R2C4, R4C2, R3C3, R5C2, R2C5, R4C3, R3C4, R4C4. The number following the R indicates the number of rows, following the C the number of columns; e.g. R2C2 results in a 2-by-2 layout. The options that contain two C’s or R’s result in asymmetric layouts; e.g. R2C1C2 results in a layout with 1 trace on top and two traces side-by-side on the bottom row.

  property frequency_CW

    Control the CW frequency of the indicated channel in hertz.

    Valid values are between 1E7 [Hz] (i.e. 10 MHz) and 4E10 [Hz] (i.e. 40 GHz). (dynamic)

  property frequency_center

    Control the center value of the sweep range of the indicated channel in hertz.

    Valid values are between 1E7 [Hz] (i.e. 10 MHz) and 4E10 [Hz] (i.e. 40 GHz). (dynamic)

  property frequency_span

    Control the span value of the sweep range of the indicated channel in hertz.

    Valid values are between 2 [Hz] and 4E10 [Hz] (i.e. 40 GHz). (dynamic)

  property frequency_start

    Control the start value of the sweep range of the indicated channel in hertz.

    Valid values are between 1E7 [Hz] (i.e. 10 MHz) and 4E10 [Hz] (i.e. 40 GHz). (dynamic)

  property frequency_stop

    Control the stop value of the sweep range of the indicated channel in hertz.

    Valid values are between 1E7 [Hz] (i.e. 10 MHz) and 4E10 [Hz] (i.e. 40 GHz). (dynamic)

  property hold_function

    Control the hold function of the specified channel.

    valid values are:

    value | description
    --- | ---
    CONT | Perform continuous sweeps on all channels
    HOLD | Hold the sweep on all channels
    SING | Perform a single sweep and then hold all channels

  property number_of_points

    Control the number of measurement points in a frequency sweep of the indicated channel.

    Valid values are between 1 and 25000 or 100000 depending on the maximum points setting.

  property number_of_traces

    Control the number of traces on the specified channel

    Valid values are between 1 and 16.

  property sweep_mode

    Control the sweep mode for Spectrum Analysis on the indicated channel.

    Valid options are VNA (for a VNA-like mode where the instrument will only measure at points in the frequency list) or CLAS (for a classical mode, where the instrument will scan all frequencies in the range).

  property sweep_time

    Control the sweep time of the indicated channel.

    Valid values are between 2 and 100000.

  property sweep_type

    Control the sweep type of the indicated channel.

    Valid options are:

    value | description
    --- | ---
    LIN | Frequency-based linear sweep
    LOG | Frequency-based logarithmic sweep
    FSEGM | Segment-based sweep with frequency-based segments
    ISEGM | Index-based sweep with frequency-based segments
    POW | Power-based sweep with either a CW frequency or swept-frequency
    MFGC | Multiple frequency gain compression

  update_frequency_range(frequency_range)

    Update the values-attribute of the frequency-related dynamic properties.

    Parameters:

      frequency_range (list) – the frequency range that the instrument is capable of.

  update_traces(number_of_traces=None)

    Create or remove traces to be correct with the actual number of traces.

    Parameters:

      number_of_traces (int) – optional, if given defines the desired number of traces.

class pymeasure.instruments.anritsu.anritsuMS464xB.Trace(parent, id)

  Bases: `Channel`

  Represents a trace within a `MeasurementChannel` of the Anritsu MS464xB VNA.

  activate()

    Set the indicated trace as the active one.

  property measurement_parameter

    Control the measurement parameter of the indicated trace.

    Valid values are any S-parameter (e.g. S11, S12, S41) for 4 ports, or one of the following:

    value | description
    --- | ---
    Sxx | S-parameters (1-4 for both x)
    MIX | Response Mixed Mode
    NFIG | Noise Figure trace response (only with option 41 or 48)
    NPOW | Noise Power trace response (only with option 41 or 48)
    NTEMP | Noise Temperature trace response (only with option 41 or 48)
    AGA | Noise Figure Available Gain trace response (only with option 48)
    IGA | Noise Figure Insertion Gain trace response (only with option 48)

class pymeasure.instruments.anritsu.anritsuMS464xB.Port(parent, id)

  Bases: `Channel`

  Represents a port within a `MeasurementChannel` of the Anritsu MS464xB VNA.

  property power_level

    Control the power level (in dBm) of the indicated port on the indicated channel.