Source code for rsrtx.Implementations.Wgenerator.Modulation.Pwm.Frequency

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class FrequencyCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("frequency", core, parent)

[docs] def set(self, frequency: float, wgenerator=repcap.Wgenerator.Default) -> None: """ ``WGENerator<*>:MODulation:PWM:FREQuency`` \n Snippet: ``driver.wgenerator.modulation.pwm.frequency.set(frequency = 1.0, wgenerator = repcap.Wgenerator.Default)`` \n Sets the frequency of the modulation waveform for pulse width modulation, if method ``RsRtx.wgenerator.modulation.typePy.set()`` is set to PWM. :param frequency: 1E-3 to 1E+6 :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') """ param = Conversions.decimal_value_to_str(frequency) wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) self._core.io.write(f'WGENerator{wgenerator_cmd_val}:MODulation:PWM:FREQuency {param}')
[docs] def get(self, wgenerator=repcap.Wgenerator.Default) -> float: """ ``WGENerator<*>:MODulation:PWM:FREQuency`` \n Snippet: ``value: float = driver.wgenerator.modulation.pwm.frequency.get(wgenerator = repcap.Wgenerator.Default)`` \n Sets the frequency of the modulation waveform for pulse width modulation, if method ``RsRtx.wgenerator.modulation.typePy.set()`` is set to PWM. :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') :return: frequency: 1E-3 to 1E+6 """ wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) response = self._core.io.query_str(f'WGENerator{wgenerator_cmd_val}:MODulation:PWM:FREQuency?') return Conversions.str_to_float(response)