Source code for rsmxo.Implementations.Pbus.Data.FormatPy
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 FormatPyCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("formatPy", core, parent)
[docs]
def set(self, data_format: enums.BitPattern, pwrBus=repcap.PwrBus.Default) -> None:
"""
``PBUS<*>:DATA:FORMat`` \n
Snippet: ``driver.pbus.data.formatPy.set(data_format = enums.BitPattern.ASCII, pwrBus = repcap.PwrBus.Default)`` \n
Sets the data format of bus values, which are displayed in the decode table and on the comb bus display. It also sets the
format for the number representation for remote data transfer with method ``RsMxo.pbus.data.values.get()`` .
:param data_format: HEX | OCT | BIN | ASCII | ASCii | SIGN | USIG
:param pwrBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Pbus')
"""
param = Conversions.enum_scalar_to_str(data_format, enums.BitPattern)
pwrBus_cmd_val = self._cmd_group.get_repcap_cmd_value(pwrBus, repcap.PwrBus)
self._core.io.write(f'PBUS{pwrBus_cmd_val}:DATA:FORMat {param}')
# noinspection PyTypeChecker
[docs]
def get(self, pwrBus=repcap.PwrBus.Default) -> enums.BitPattern:
"""
``PBUS<*>:DATA:FORMat`` \n
Snippet: ``value: enums.BitPattern = driver.pbus.data.formatPy.get(pwrBus = repcap.PwrBus.Default)`` \n
Sets the data format of bus values, which are displayed in the decode table and on the comb bus display. It also sets the
format for the number representation for remote data transfer with method ``RsMxo.pbus.data.values.get()`` .
:param pwrBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Pbus')
:return: data_format: HEX | OCT | BIN | ASCII | ASCii | SIGN | USIG
"""
pwrBus_cmd_val = self._cmd_group.get_repcap_cmd_value(pwrBus, repcap.PwrBus)
response = self._core.io.query_str(f'PBUS{pwrBus_cmd_val}:DATA:FORMat?')
return Conversions.str_to_scalar_enum(response, enums.BitPattern)