FSWP50 module

Created on Wed Feb 26 20:21:23 2025

@author: Maxim Weizel

class Instruments_Libraries.FSWP50.FSWP50(address)[source]

Bases: object

This class is using RsInstrument to connect. Please install RsInstrument before using it.

Parameters:

address (str)

ExtractTraceData(traceNumber=1, clearTrace=True, timeout=20, window_number=1)[source]

Initiate a measurement and return the trace data.

Parameters:
  • traceNumber (int) –

    Trace Number:

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

  • clearTrace (bool, optional) – Clears the trace before taking the data measurement. The default is True.

  • timeout (float, optional) – Defines the timeout for the operation. The default is 20s.

  • window_number (int, optional) – Window number between 1 and 16, by default 1

Raises:

TimeoutError

Returns:

Output

Return type:

np.array

Idn()[source]

Identify the Insturment.

Returns:

A string with the Instrument name.

Return type:

str

Init()[source]

Starts a (single) new measurement. With measurement count or average count > 0, this means a restart of the corresponding number of measurements. With trace mode MAXHold, MINHold and AVERage, the previous results are reset on restarting the measurement.

Return type:

None

abort()[source]

Abort the measurement (execute ABORT command).

Return type:

None

clear()[source]

Clear the instrument status (execute *CLS command).

Return type:

None

create_new_channel(ChannelType, ChannelName)[source]

Adds a measurement channel. You can configure up to 10 measurement channels at the same time (depending on available memory)

Parameters:
  • ChannelType (str) – One of: [PNOise, SMONitor, SANalyzer]

  • ChannelName (str) – Set a meantingful name for the channel.

Raises:

ValueError – Error message

Return type:

None

delete_channel(ChannelName)[source]

Deletes a channel. If you delete the last channel, the default “Phase Noise” channel is activated.

Parameters:

ChannelName (str) – Your Channel Name.

Return type:

None

get_trace_data(trace_number, window_number=1)[source]

This command queries current trace data and measurement results.

Parameters:
  • trace_number (int) – Trace number between 1 and 6

  • window_number (int, optional) – Window number between 1 and 16, by default 1

Returns:

Trace Data.

Return type:

np.ndarray

Raises:

ValueError

init_single_measurement()[source]

Restarts a (single) measurement that has been stopped (using ABORt) or finished in single measurement mode. The measurement is restarted at the beginning, not where the previous measurement was stopped. As opposed to INITiate<n>[:IMMediate], this command does not reset traces in maxhold, minhold or average mode. Therefore it can be used to continue measurements using maxhold or averaging functions.

Return type:

None

list_channels()[source]

Queries all active channels. The query is useful to obtain the names of the existing channels, which are required to replace or delete the channels.

Return type:

str

operation_complete()[source]

Wait until the operation is complete (execute *OPC command).

Return type:

int

query_float(command)[source]
Parameters:

command (str)

Return type:

float

query_float_list(command)[source]
Parameters:

command (str)

Return type:

list

query_str(command)[source]
Parameters:

command (str)

Return type:

str

query_str_list(command)[source]
Parameters:

command (str)

Return type:

list

reset()[source]

Reset the instrument (execute *RST command).

Return type:

None

set_Continuous(state)

Controls the measurement mode for an individual channel.

Parameters:

state (int or str) – ON | OFF | 1 | 0

Return type:

None

set_DataPointCount(datapoints)

This command defines the number of measurement points to analyze after a measurement.

Parameters:

datapoints (int) – Number of data points.

Return type:

None

set_RefLevel(ref_level)

This command defines the maximum level displayed on the y-axis.

Parameters:

ref_level (float) – Default unit: Depending on the selected diagram.

Return type:

None

set_ResBwidth(res_bw, unit='Hz')

Sets the resolution bandwidth.

Parameters:
  • value (int/float) – Sets the resolution bandwidth.

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

  • res_bw (int | float)

Raises:

ValueError – Error message

Return type:

None

set_continuous(state)[source]

Controls the measurement mode for an individual channel.

Parameters:

state (int or str) – ON | OFF | 1 | 0

Return type:

None

set_detection_function(det_func, trace_number=1, window_number=1)[source]

Defines the trace detector to be used for trace analysis

Parameters:
  • det_func (str) – detector function: APEAK|NEGATIVE|POSITIVE|RMS|AVERAGE|SAMPLE

  • trace_number (int)

  • window_number (int)

Raises:

ValueError – Error Message

Return type:

None

set_freq_Start(start_freq, unit='Hz')

This command defines the start frequency offset of the measurement range.

Parameters:
  • start_freq (float) – Start frequency.

  • unit (str)

Return type:

None

set_freq_Stop(stop_freq, unit='Hz')

This command defines the stop frequency offset of the measurement range.

Parameters:
  • start_freq (float) – Stop frequency.

  • stop_freq (int | float)

  • unit (str)

Return type:

None

set_input_attenuation(atten)[source]

Set the input attenuation.

Parameters:

atten (float) – Attenuation value.

Return type:

None

set_input_attenuation_auto(state)[source]

Set the input attenuation auto mode to ON or OFF.

Parameters:

state (str | int) – Can be: [ON, 1, OFF, 0]

Raises:

ValueError – Error Message

Return type:

None

set_reference_level(ref_level)[source]

This command defines the maximum level displayed on the y-axis.

Parameters:

ref_level (float) – Default unit: Depending on the selected diagram.

Return type:

None

set_reference_level_lower(ref_level=0)[source]

This command defines the minimum level displayed on the y-axis.

Parameters:

ref_level (float, optional) – Default unit: Depending on the selected diagram.

Return type:

None

set_resolution_bandwidth(res_bw, unit='Hz')[source]

Sets the resolution bandwidth.

Parameters:
  • value (int/float) – Sets the resolution bandwidth.

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

  • res_bw (int | float)

Raises:

ValueError – Error message

Return type:

None

set_start_frequency(start_freq, unit='Hz')[source]

This command defines the start frequency offset of the measurement range.

Parameters:
  • start_freq (float) – Start frequency.

  • unit (str)

Return type:

None

set_stop_frequency(stop_freq, unit='Hz')[source]

This command defines the stop frequency offset of the measurement range.

Parameters:
  • start_freq (float) – Stop frequency.

  • stop_freq (int | float)

  • unit (str)

Return type:

None

set_sweep_points(datapoints)[source]

This command defines the number of measurement points to analyze after a measurement.

Parameters:

datapoints (int) – Number of data points.

Return type:

None

set_trace_mode(trace_mode, trace_number=1, window_number=1)[source]

Selects the trace mode.

Parameters:
  • trace_mode (str) – WRITE|WRIT|AVERAGE|AVER|MAXHOLD|MAXH|MINHOLD|MINH|VIEW|BLANK|BLAN

  • trace_number (int, optional) – Trace Number, by default 1

  • window_number (int, optional) – Window Number, by default 1

Raises:

ValueError – Error Message

Return type:

None

wait()[source]

Wait to continue. Prevents servicing of the subsequent commands until all preceding commands have been executed and all signals have settled (see also command synchronization and *OPC command).

Return type:

None

write_float(command, value)[source]
Parameters:
  • command (str)

  • value (float)

Return type:

None

write_str(command)[source]
Parameters:

command (str)

Return type:

None