from RsSmw import *

RsSmw.assert_minimum_version('4.80.2')
smw = RsSmw('TCPIP::10.112.1.67::HISLIP')
# smw = RsSmw('TCPIP::10.112.1.179::5025::SOCKET', options='SelectVisa=SocketIo') # No VISA needed
print(f'Driver Info: {smw.utilities.driver_version}')
print(f'Instrument: {smw.utilities.idn_string}')

# Instrument options are properly parsed duplicates are removed, and the items are sorted (k-options first)
print(f'Instrument options: {",".join(smw.utilities.instrument_options)}')

# Driver's instrument status checking ( SYST:ERR? ) after each command (default value is True):
smw.utilities.instrument_status_checking = True

# The smw object uses the global HW instance one - RF out A
smw.repcap_hwInstance_set(repcap.HwInstance.InstA)

# Clone the smw object to the smw_rf2 and select the RF out B
smw_rf2 = smw.clone()
smw_rf2.repcap_hwInstance_set(repcap.HwInstance.InstB)

# Now we have two independent objects for two RF Outputs - smw and smw_rf2
# They share some common features of the instrument, like for example resetting
smw_rf2.utilities.reset()

smw.output.state.set_value(True)
smw.source.frequency.set_mode(enums.FreqMode.CW)
smw.source.power.level.immediate.set_amplitude(-20)
smw.source.frequency.fixed.set_value(223E6)
print(f'Channel 1 PEP level: {smw.source.power.get_pep()} dBm')

smw_rf2.output.state.set_value(False)
smw_rf2.source.frequency.set_mode(enums.FreqMode.SWEep)
smw_rf2.source.power.level.immediate.set_amplitude(-35)
smw_rf2.source.frequency.set_start(800E6)
smw_rf2.source.frequency.set_stop(900E6)
smw_rf2.source.frequency.step.set_mode(enums.FreqStepMode.DECimal)
smw_rf2.source.frequency.step.set_increment(10E6)
print(f'Channel 2 PEP level: {smw_rf2.source.power.get_pep()} dBm')

# Direct SCPI interface:
response = smw.utilities.query_str('*IDN?')
print(f'Direct SCPI response on *IDN?: {response}')
smw.close()

bc590185378270fcb60325e50d4684f51e4190ec
<mask token>

<mask token>
RsSmw.assert_minimum_version('4.80.2')
<mask token>
print(f'Driver Info: {smw.utilities.driver_version}')
print(f'Instrument: {smw.utilities.idn_string}')
print(f"Instrument options: {','.join(smw.utilities.instrument_options)}")
<mask token>
smw.repcap_hwInstance_set(repcap.HwInstance.InstA)
<mask token>
smw_rf2.repcap_hwInstance_set(repcap.HwInstance.InstB)
smw_rf2.utilities.reset()
smw.output.state.set_value(True)
smw.source.frequency.set_mode(enums.FreqMode.CW)
smw.source.power.level.immediate.set_amplitude(-20)
smw.source.frequency.fixed.set_value(223000000.0)
print(f'Channel 1 PEP level: {smw.source.power.get_pep()} dBm')
smw_rf2.output.state.set_value(False)
smw_rf2.source.frequency.set_mode(enums.FreqMode.SWEep)
smw_rf2.source.power.level.immediate.set_amplitude(-35)
smw_rf2.source.frequency.set_start(800000000.0)
smw_rf2.source.frequency.set_stop(900000000.0)
smw_rf2.source.frequency.step.set_mode(enums.FreqStepMode.DECimal)
smw_rf2.source.frequency.step.set_increment(10000000.0)
print(f'Channel 2 PEP level: {smw_rf2.source.power.get_pep()} dBm')
<mask token>
print(f'Direct SCPI response on *IDN?: {response}')
smw.close()

<mask token>
RsSmw.assert_minimum_version('4.80.2')
smw = RsSmw('TCPIP::10.112.1.67::HISLIP')
print(f'Driver Info: {smw.utilities.driver_version}')
print(f'Instrument: {smw.utilities.idn_string}')
print(f"Instrument options: {','.join(smw.utilities.instrument_options)}")
smw.utilities.instrument_status_checking = True
smw.repcap_hwInstance_set(repcap.HwInstance.InstA)
smw_rf2 = smw.clone()
smw_rf2.repcap_hwInstance_set(repcap.HwInstance.InstB)
smw_rf2.utilities.reset()
smw.output.state.set_value(True)
smw.source.frequency.set_mode(enums.FreqMode.CW)
smw.source.power.level.immediate.set_amplitude(-20)
smw.source.frequency.fixed.set_value(223000000.0)
print(f'Channel 1 PEP level: {smw.source.power.get_pep()} dBm')
smw_rf2.output.state.set_value(False)
smw_rf2.source.frequency.set_mode(enums.FreqMode.SWEep)
smw_rf2.source.power.level.immediate.set_amplitude(-35)
smw_rf2.source.frequency.set_start(800000000.0)
smw_rf2.source.frequency.set_stop(900000000.0)
smw_rf2.source.frequency.step.set_mode(enums.FreqStepMode.DECimal)
smw_rf2.source.frequency.step.set_increment(10000000.0)
print(f'Channel 2 PEP level: {smw_rf2.source.power.get_pep()} dBm')
response = smw.utilities.query_str('*IDN?')
print(f'Direct SCPI response on *IDN?: {response}')
smw.close()

from RsSmw import *
RsSmw.assert_minimum_version('4.80.2')
smw = RsSmw('TCPIP::10.112.1.67::HISLIP')
print(f'Driver Info: {smw.utilities.driver_version}')
print(f'Instrument: {smw.utilities.idn_string}')
print(f"Instrument options: {','.join(smw.utilities.instrument_options)}")
smw.utilities.instrument_status_checking = True
smw.repcap_hwInstance_set(repcap.HwInstance.InstA)
smw_rf2 = smw.clone()
smw_rf2.repcap_hwInstance_set(repcap.HwInstance.InstB)
smw_rf2.utilities.reset()
smw.output.state.set_value(True)
smw.source.frequency.set_mode(enums.FreqMode.CW)
smw.source.power.level.immediate.set_amplitude(-20)
smw.source.frequency.fixed.set_value(223000000.0)
print(f'Channel 1 PEP level: {smw.source.power.get_pep()} dBm')
smw_rf2.output.state.set_value(False)
smw_rf2.source.frequency.set_mode(enums.FreqMode.SWEep)
smw_rf2.source.power.level.immediate.set_amplitude(-35)
smw_rf2.source.frequency.set_start(800000000.0)
smw_rf2.source.frequency.set_stop(900000000.0)
smw_rf2.source.frequency.step.set_mode(enums.FreqStepMode.DECimal)
smw_rf2.source.frequency.step.set_increment(10000000.0)
print(f'Channel 2 PEP level: {smw_rf2.source.power.get_pep()} dBm')
response = smw.utilities.query_str('*IDN?')
print(f'Direct SCPI response on *IDN?: {response}')
smw.close()

from RsSmw import *

RsSmw.assert_minimum_version('4.80.2')
smw = RsSmw('TCPIP::10.112.1.67::HISLIP')
# smw = RsSmw('TCPIP::10.112.1.179::5025::SOCKET', options='SelectVisa=SocketIo') # No VISA needed
print(f'Driver Info: {smw.utilities.driver_version}')
print(f'Instrument: {smw.utilities.idn_string}')

# Instrument options are properly parsed duplicates are removed, and the items are sorted (k-options first)
print(f'Instrument options: {",".join(smw.utilities.instrument_options)}')

# Driver's instrument status checking ( SYST:ERR? ) after each command (default value is True):
smw.utilities.instrument_status_checking = True

# The smw object uses the global HW instance one - RF out A
smw.repcap_hwInstance_set(repcap.HwInstance.InstA)

# Clone the smw object to the smw_rf2 and select the RF out B
smw_rf2 = smw.clone()
smw_rf2.repcap_hwInstance_set(repcap.HwInstance.InstB)

# Now we have two independent objects for two RF Outputs - smw and smw_rf2
# They share some common features of the instrument, like for example resetting
smw_rf2.utilities.reset()

smw.output.state.set_value(True)
smw.source.frequency.set_mode(enums.FreqMode.CW)
smw.source.power.level.immediate.set_amplitude(-20)
smw.source.frequency.fixed.set_value(223E6)
print(f'Channel 1 PEP level: {smw.source.power.get_pep()} dBm')

smw_rf2.output.state.set_value(False)
smw_rf2.source.frequency.set_mode(enums.FreqMode.SWEep)
smw_rf2.source.power.level.immediate.set_amplitude(-35)
smw_rf2.source.frequency.set_start(800E6)
smw_rf2.source.frequency.set_stop(900E6)
smw_rf2.source.frequency.step.set_mode(enums.FreqStepMode.DECimal)
smw_rf2.source.frequency.step.set_increment(10E6)
print(f'Channel 2 PEP level: {smw_rf2.source.power.get_pep()} dBm')

# Direct SCPI interface:
response = smw.utilities.query_str('*IDN?')
print(f'Direct SCPI response on *IDN?: {response}')
smw.close()
