MS4647B module

Created on Mon Dec 13 10:40:31 2021

@author: Martin.Mihaylov

class Instruments_Libraries.MS4647B.MS4647B(resource_str, visa_library='@py', **kwargs)[source]

Bases: BaseInstrument

This class uses BaseInstrument to connect to an Anritsu MS4647B VNA.

Parameters:
  • resource_str (str)

  • visa_library (str)

delete_data(name, port_num)[source]
Parameters:
  • name (str) – File Name

  • port_num (TYPE) – The N(ports number) for the .sNp data output. Delete a disk, file, or directory. Use caution with this command as there is no recovery operation in case of a user mistake or error. No query Hard coded path on the VNA = ‘C:/tmp/’

Return type:

None

delete_data_csv(name)[source]
Parameters:

name (str) – File Name Delete a disk, file, or directory. Use caution with this command as there is no recovery operation in case of a user mistake or error. No query Hard coded path on the VNA = ‘C:/tmp/’

Return type:

None

get_assignet_data_port(value)[source]

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

Parameters:

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

Return type:

str

get_average_count(channel_num)[source]

Outputs the averaging count for the indicated channel.

Parameters:

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

Return type:

float

get_average_function_type(channel_num)[source]

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

Parameters:

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

Return type:

str

get_center_freq(channel_num)[source]

Optional query. Center frequency is automatically calculated using Stop Frequency and Start Frequency as: Fc = ((Fstop - Fstart)/2) + Fstart

Parameters:

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

Return type:

float

get_cw_freq(channel_num)[source]

Sets the CW frequency of the indicated channel. Outputs the CW frequency of the indicated channel. The output parameter is in Hertz.

Parameters:

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

Return type:

float

get_data_freq(channel_num)[source]

Outputs the frequency list for the indicated channel.

Parameters:

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

Return type:

str

get_display_count()[source]

Query the number of displayed channels.

Return type:

float

get_display_title()[source]

Outputs the user title for the channel indicated.

Return type:

str

get_display_trace()[source]

Query only. Outputs the Active Channel number.

Return type:

str

get_freq_span(channel_num)[source]

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

Parameters:

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

Return type:

float

get_param_form_in_file()[source]

Outputs the parameter format displayed in an SNP data file.

Return type:

str

get_power_on_port(segment, channel_num)[source]

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

Parameters:
  • segment (int) – Selected Source. Can be from 1-16

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

Return type:

float

get_resolution_bw(channel_num)[source]

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

Parameters:

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

Return type:

float

get_rf_state()[source]

Outputs the RF on/off state in Hold.

Return type:

str

get_select_parameter()[source]

The query outputs only the selected parameter.

Return type:

str

get_set_average_state(channel_num)[source]

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

Parameters:

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

Return type:

str

get_smoothing_state(channel_num)[source]

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

Parameters:

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

Return type:

float

get_stat_operation()[source]

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

Return type:

int

get_stat_operation_register()[source]

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

Return type:

int

get_sub_system()[source]

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

Return type:

str

get_sweep_channel_status()[source]

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

Return type:

str

get_sweep_count(channel_num)[source]

Query only. Outputs the averaging sweep count for the indicated channel.

Parameters:

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

Return type:

float

get_sweep_delay()[source]

Outputs the sweep delay time of the indicated channel.

Return type:

float

get_sweep_time()[source]

Outputs the Sweep Time of the indicated channel.

Return type:

float

get_sys_errors()[source]

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

Return type:

str

get_test_set(channel_num)[source]

Query State of TS3739.

Parameters:

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

Return type:

str

get_transfer_data(name, port_num)[source]

The query outputs the disk file data to the GPIB. The file must exist. Hard coded path on the VNA = ‘C:/tmp/’

Parameters:
  • name (str) – File Name

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

Return type:

str

get_transfer_data_csv(name)[source]

The query outputs the disk file data to the GPIB. The file must exist. Hard coded path on the VNA = ‘C:/tmp/’

Parameters:

name (str) – File Name

Return type:

str

rtl()[source]

Send all devices to local operation. No query.

Return type:

None

save_data(name, port_num)[source]
Parameters:
  • name (str) – File Name

  • port_num (TYPE) – The N(ports number) for the .sNp data output. Description: Stores a data file of the type specified by the filename extension.No query. Hard coded path on the VNA = ‘C:/tmp/’

Return type:

None

save_data_csv(name)[source]
Parameters:

name (str) – File Name Description: Stores a data file of the type specified by the filename extension.No query. Hard coded path on the VNA = ‘C:/tmp/’

Return type:

None

save_image(name)[source]
Parameters:

name (str) – File Name Description: Stores a data file of the type specified by the filename extension.No query. Hard coded path on the VNA = ‘C:/tmp/’

Return type:

None

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

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

  • name (str) – Name of the File

  • port_num (int/str) – The N(ports number) for the .sNp data output. Write a text File with the transferred data

Return type:

None

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

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

  • name (str) – Name of the File Write a text File with the transferred data

Return type:

None

set_assignet_data_port(channel_num, value1, value2)[source]

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

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value1 (int)

  • value2 (int)

Return type:

None

set_average_count(channel_num, value)[source]

Sets the averaging count for the indicated channel. The channel must be turned on.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int) – The input parameter is a unitless number. Range: 1 to 1024 Default Value: 1

Return type:

None

set_average_function_type(channel_num, state)[source]

Sets the averaging function type to point-by-point or sweep-by-sweep.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

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

Return type:

None

set_center_freq(channel_num, value)[source]

Sets the center value of the sweep range of the indicated channel. Outputs the center value of the sweep range of the indicated channel

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9)

Return type:

None

set_clear_average(channel_num)[source]

Clears and restarts the averaging sweep count of the indicated channel.

Parameters:

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

Return type:

None

set_clear_error()[source]

Clears the contents of the error queue.

Return type:

None

set_cw_freq(channel_num, value)[source]

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

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9)

Return type:

None

set_display_color_reset()[source]

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

Return type:

None

set_display_count(channel_num)[source]

Sets the number of displayed channels. When the VNA is in 25,000 point mode, the number of channels can only be 1 (one), 2, 3, 4, 6, 8, 9, 10, 12, or 16 channels. If the channel display is set to a non-listed number (5, 7, 11, 13, 14, 15), the instrument is set to the next higher channel number. If a number of greater than 16 is entered, the instrument is set to 16 channels. If the instrument is set to 100,000 points, any input results in 1 (one) channel. Outputs the number of displayed channels.

Parameters:

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

Return type:

None

set_display_scale()[source]

Auto scales all traces on all channels.

Return type:

None

set_display_title(channel_name)[source]

Sets the user title for the channel indicated.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • channel_name (str)

Return type:

None

set_display_trace(channel_num)[source]

The command sets the active channel to the indicated number. When the VNA is set to 100,000 point mode, the number of channels is 1.

Parameters:

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

Return type:

None

set_param_form_in_file(unit)[source]

Sets the parameter format displayed in an SNP data file.

Parameters:

unit (str) –

  • LINPH = Linear and Phase

  • LOGPH = Log and Phase

  • REIM = Real and Imaginary Numbers

Return type:

None

set_power_on_port(segment, channel_num, value)[source]

Sets the power level of the indicated port on the indicated channel.

Parameters:
  • segment (int) – Selected Source. Can be from 1-16

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

  • value (int/floa/str) – Power level

Return type:

None

set_resolution_bw(channel_num, value)[source]

Sets the IF bandwidth for the indicated channel.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int/floa/str) – IF Bandwidth in Hz

Return type:

None

set_rf_state(state)[source]

Sets the RF on/off state in Hold.

Parameters:

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

Return type:

None

set_select_parameter(s_param)[source]

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

Parameters:

s_param (str) – S-Parameter selected.

Return type:

None

set_set_average_state(channel_num, state)[source]

Turns averaging on/off for the indicated channel (Turns ON and Off the averaging for all channels).

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • state (int/str) – ON/OFF or 1/0.

Return type:

None

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

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

Return type:

None

set_smoothing_state(channel_num, state)[source]

Turns smoothing on/off for the indicated channel.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

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

Return type:

None

set_start_freq(channel_num, value)[source]

Sets the start value of the sweep range of the indicated channel.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9) – The input parameter is in Hertz, Meters, or Seconds.

Return type:

None

set_stat_operation_register(value)[source]

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

Parameters:

value (int) – The input parameter is a unitless number. Range: 0 to 65535

Return type:

None

set_stop_freq(channel_num, value)[source]

Sets the stop value of the sweep range of the indicated channel. The input parameter is in Hertz, Meters, or Seconds.

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • value (int/str in form - 10E+9)

Return type:

None

set_sub_system_cont()[source]

The sweep is sweeping continuously.

Return type:

None

set_sub_system_hold()[source]

Sets the hold function for all channels on a per-instrument basis. The sweep is stopped.

Return type:

None

set_sub_system_sing()[source]

The sweep restarts and sweeps until the end of the sweep, at which point it sets the end of sweep status bit and stops.

Return type:

None

set_sweep_channel_status(state)[source]

The command turns On/Off the option to sweep only the active channel

Parameters:

state (str/int) – ON/OFF or 1/0.

Return type:

None

set_sweep_delay(time)[source]
Parameters:

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

Return type:

None

set_sweep_time(time)[source]
Parameters:

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

Return type:

None

set_ts3739(channel_num, state)[source]

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

Parameters:
  • channel_num (int) – Channel Number 1,2,3…

  • state (str/int) – ON/OFF or 1/0.

Return type:

None