from typing import List
from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ValuesCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("values", core, parent)
[docs]
def get(self, channel=repcap.Channel.Default, waveform=repcap.Waveform.Default) -> List[float]:
"""
``CHANnel<1..4>[:WAVeform<*>]:DATA[:VALues]`` \n
Snippet: ``value: List[float] = driver.channel.waveform.data.values.get(channel = repcap.Channel.Default, waveform = repcap.Waveform.Default)`` \n
Returns the data of the channel waveform points for transmission from the instrument to the controlling computer.
The data can be used in MATLAB, for example. Without parameters, the complete waveform is retrieved. Using the offset and
length parameters, data can be retrieved in smaller portions, which makes the command faster. To set the export format,
use method ``RsRtx.formatPy.data.set()`` . You can retrieve only Y-values (usually voltage values) , or X- and Y-values.
Use method ``RsRtx.export.waveform.incx_values()`` to define which values are retrieved. If multichannel export is active
(method ``RsRtx.export.waveform.multi_channel()`` ) , the channel suffix is ignored. To select the channels to be
exported, use method ``RsRtx.channel.exportState.set()`` . The Y-values are written in interleaved order, for example,
YCh10; YCh20; YCh11; YCh21... for a 2-channel instrument.
:param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel')
:param waveform: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Waveform')
:return: waveform_data: List of values according to the format and content settings.
"""
channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel)
waveform_cmd_val = self._cmd_group.get_repcap_cmd_value(waveform, repcap.Waveform)
response = self._core.io.query_bin_or_ascii_float_list(f'FORMAT REAL,32;CHANnel{channel_cmd_val}:WAVeform{waveform_cmd_val}:DATA:VALues?')
return response