from typing import List
from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal.Types import DataType
from ....Internal.ArgSingleList import ArgSingleList
from ....Internal.ArgSingle import ArgSingle
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ValuesPartialCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("valuesPartial", core, parent)
[docs]
def get(self, offset: int, length: int, digitalNull=repcap.DigitalNull.Default) -> List[int]:
"""
``DIGital<0..15>:DATA[:VALues]`` \n
Snippet: ``value: List[int] = driver.digital.data.valuesPartial.get(offset = 1, length = 1, digitalNull = repcap.DigitalNull.Default)`` \n
Returns the data of the indicated digital channel for transmission from the instrument to the controlling computer. The
data can be used in MATLAB, for example.
:param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital')
:return: digital_data: List of data (0 and 1)
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('offset', offset, DataType.Integer), ArgSingle('length', length, DataType.Integer))
digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull)
response = self._core.io.query_bin_or_ascii_int_list(f'FORMAT ASC;DIGital{digitalNull_cmd_val}:DATA:VALues? {param}'.rstrip())
return response