Source code for rsrtx.Implementations.Bus.Can.Fdata.T1Segment

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


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

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

[docs] def set(self, flex_dat_time_seg_1: float, bus=repcap.Bus.Default) -> None: """ ``BUS<*>:CAN:FDATa:T1Segment`` \n Snippet: ``driver.bus.can.fdata.t1Segment.set(flex_dat_time_seg_1 = 1.0, bus = repcap.Bus.Default)`` \n Sets the number of time quanta before the sample point (T1Segment) . T1Segment comprises the segments Synch_seg, Prop_seg, and Phase_seg1 which are specified in the CAN standard. Make sure to set also method ``RsRtx.bus.can.t2Segment.set()`` for correct definition of the sample point. Alternatively, you can use method ``RsRtx.bus.can.samplePoint.set()`` . See also: 'Advanced settings' For CAN FD signals, method ``RsRtx.bus.can.t1Segment.set()`` defines the synchronization of the arbitration phase, and method ``RsRtx.bus.can.fdata.t1Segment.set()`` defines the synchronization of the data phase. :param flex_dat_time_seg_1: Time quanta :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') """ param = Conversions.decimal_value_to_str(flex_dat_time_seg_1) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) self._core.io.write(f'BUS{bus_cmd_val}:CAN:FDATa:T1Segment {param}')
[docs] def get(self, bus=repcap.Bus.Default) -> float: """ ``BUS<*>:CAN:FDATa:T1Segment`` \n Snippet: ``value: float = driver.bus.can.fdata.t1Segment.get(bus = repcap.Bus.Default)`` \n Sets the number of time quanta before the sample point (T1Segment) . T1Segment comprises the segments Synch_seg, Prop_seg, and Phase_seg1 which are specified in the CAN standard. Make sure to set also method ``RsRtx.bus.can.t2Segment.set()`` for correct definition of the sample point. Alternatively, you can use method ``RsRtx.bus.can.samplePoint.set()`` . See also: 'Advanced settings' For CAN FD signals, method ``RsRtx.bus.can.t1Segment.set()`` defines the synchronization of the arbitration phase, and method ``RsRtx.bus.can.fdata.t1Segment.set()`` defines the synchronization of the data phase. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') """ bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) response = self._core.io.query_str(f'BUS{bus_cmd_val}:CAN:FDATa:T1Segment?') return Conversions.str_to_float(response)