from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class NdBytesCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("ndBytes", core, parent)
[docs]
def get(self, trigger=repcap.Trigger.Default) -> int:
"""
``TRIGger<*>:CAN:NDBYtes`` \n
Snippet: ``value: int = driver.trigger.can.ndBytes.get(trigger = repcap.Trigger.Default)`` \n
Returns the number of data bytes defined by DLC. DLC and NDB are different in CAN FD for DLCs > 8. See also: 'Data setup:
DLC, NDB, Transfer, Condition, Data min, Data max'.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
:return: nd_bytes: 1 to 64
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:CAN:NDBYtes?')
return Conversions.str_to_int(response)