Source code for rsrtx.Implementations.Trigger.Holdoff.Mode

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


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

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

[docs] def set(self, mode: enums.TriggerHoldoffMode, trigger=repcap.Trigger.Default) -> None: """ ``TRIGger<*>:HOLDoff:MODE`` \n Snippet: ``driver.trigger.holdoff.mode.set(mode = enums.TriggerHoldoffMode.AUTO, trigger = repcap.Trigger.Default)`` \n Selects the method to define the holdoff condition. The trigger holdoff defines when the next trigger after the current will be recognized. Thus, it affects the next trigger to occur after the current one. Holdoff helps to obtain stable triggering when the oscilloscope is triggering on undesired events. Holdoff settings are not available at the following conditions: \n - The trigger source is an external trigger input. - The trigger source is a serial bus. - The trigger type is serial pattern or CDR. :param mode: TIME | EVENts | RANDom | AUTO | OFF \n - TIME: Defines the holdoff directly as a time period. The next trigger occurs only after the Holdoff time has passed (defined using TRIGgert:HOLDoff:TIME) . - EVENts: Defines the holdoff as a number of trigger events. The next trigger occurs only when this number of events is reached. The number of triggers to be skipped is defined using TRIGgert:HOLDoff:EVENts. - RANDom: Defines the holdoff as a random time limited by TRIGgert:HOLDoff:MIN and TRIGgert:HOLDoff:MAX. For each acquisition period, the instrument selects a new random holdoff time from the specified range. - AUTO: The holdoff time is calculated automatically based on the current horizontal scale. - OFF: No holdoff :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') """ param = Conversions.enum_scalar_to_str(mode, enums.TriggerHoldoffMode) trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) self._core.io.write_with_opc(f'TRIGger{trigger_cmd_val}:HOLDoff:MODE {param}')
# noinspection PyTypeChecker
[docs] def get(self, trigger=repcap.Trigger.Default) -> enums.TriggerHoldoffMode: """ ``TRIGger<*>:HOLDoff:MODE`` \n Snippet: ``value: enums.TriggerHoldoffMode = driver.trigger.holdoff.mode.get(trigger = repcap.Trigger.Default)`` \n Selects the method to define the holdoff condition. The trigger holdoff defines when the next trigger after the current will be recognized. Thus, it affects the next trigger to occur after the current one. Holdoff helps to obtain stable triggering when the oscilloscope is triggering on undesired events. Holdoff settings are not available at the following conditions: \n - The trigger source is an external trigger input. - The trigger source is a serial bus. - The trigger type is serial pattern or CDR. :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') :return: mode: TIME | EVENts | RANDom | AUTO | OFF \n - TIME: Defines the holdoff directly as a time period. The next trigger occurs only after the Holdoff time has passed (defined using TRIGgert:HOLDoff:TIME) . - EVENts: Defines the holdoff as a number of trigger events. The next trigger occurs only when this number of events is reached. The number of triggers to be skipped is defined using TRIGgert:HOLDoff:EVENts. - RANDom: Defines the holdoff as a random time limited by TRIGgert:HOLDoff:MIN and TRIGgert:HOLDoff:MAX. For each acquisition period, the instrument selects a new random holdoff time from the specified range. - AUTO: The holdoff time is calculated automatically based on the current horizontal scale. - OFF: No holdoff """ trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) response = self._core.io.query_str_with_opc(f'TRIGger{trigger_cmd_val}:HOLDoff:MODE?') return Conversions.str_to_scalar_enum(response, enums.TriggerHoldoffMode)