base_afg_source_channel

Base AFG source channel module.

BaseAFGSourceChannel

BaseAFGSourceChannel(pi_control: PIControl, channel_name: str)

Bases: BaseSourceChannel, ABC

flowchart LR tm_devices.driver_mixins.abstract_device_functionality.base_afg_source_channel.BaseAFGSourceChannel[BaseAFGSourceChannel] tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel[BaseSourceChannel] tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin[_ExtendableMixin] tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel --> tm_devices.driver_mixins.abstract_device_functionality.base_afg_source_channel.BaseAFGSourceChannel tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin --> tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel click tm_devices.driver_mixins.abstract_device_functionality.base_afg_source_channel.BaseAFGSourceChannel href "" "tm_devices.driver_mixins.abstract_device_functionality.base_afg_source_channel.BaseAFGSourceChannel" click tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel href "" "tm_devices.driver_mixins.abstract_device_functionality.base_source_channel.BaseSourceChannel" click tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin href "" "tm_devices.driver_mixins.shared_implementations._extension_mixin._ExtendableMixin"

Base AFG source channel.

Parameters:
  • pi_control (PIControl) –

    A PI device.

  • channel_name (str) –

    The channel name for the AFG source channel.

name property

name: str

Return the channel name.

num property

num: int | None

Return the channel number.

add_method classmethod

add_method(method: Callable[Concatenate[Self, _P], _T]) -> None

Add a method to the class.

This class method is best used as a decorator on functions in order to add them to a class.

Examples:

>>> from tm_devices.drivers.device import Device
>>>
>>> @Device.add_method
... def print_hello(self: Device, var: str):
...     print("Hello World!")
...     print(f"I am a {self.__class__.__name__}!")
...     print(f"My var is {var}")
Parameters:

add_property classmethod

add_property(method: Callable[Concatenate[_EM, _P], _T]) -> None
add_property(
    method: None = None, /, *, is_cached: bool = False
) -> Callable[[Callable[Concatenate[_EM, _P], _T]], None]
add_property(
    method: Callable[[Self], _T] | None = None, /, *, is_cached: bool = False
) -> Callable[[Callable[[Self], _T]], None] | None

Add a property to the class.

This class method is best used as a decorator on functions in order to add them to a class.

Examples:

>>> from tm_devices.drivers.device import Device
>>>
>>> @Device.add_property
... def foo(self: Device):
...     return "bar"
>>>
>>> @Device.add_property(is_cached=True)
... def foo(self: Device):
...     return self.name + self.address
Parameters:
  • method (Callable[[Self], _T] | None, default: None ) –

    The property to add to the class.

  • is_cached (bool, default: False ) –

    Whether the property is only evaluated once and cached.

set_amplitude abstractmethod

set_amplitude(value: float, absolute_tolerance: float = 0) -> None

Set the amplitude on the source channel.

Parameters:
  • value (float) –

    The amplitude value to set.

  • absolute_tolerance (float, default: 0 ) –

    The acceptable difference between two floating point values.

set_burst_count abstractmethod

set_burst_count(value: int) -> None

Set the number of wavelengths to be generated when the source channel is set to burst.

Parameters:
  • value (int) –

    The number of wavelengths to be generated within [1, 1000000].

set_frequency abstractmethod

set_frequency(value: float, absolute_tolerance: float = 0) -> None

Set the frequency on the source channel.

Parameters:
  • value (float) –

    The frequency value to set.

  • absolute_tolerance (float, default: 0 ) –

    The acceptable difference between two floating point values.

set_function abstractmethod

set_function(value: SignalGeneratorFunctionBase) -> None

Set the function to output on the source channel.

Parameters:

set_function_properties abstractmethod

set_function_properties(
    frequency: float,
    function: SignalGeneratorFunctionBase,
    amplitude: float,
    offset: float,
    burst_count: int = 0,
    termination: Literal["FIFTY", "HIGHZ"] = "FIFTY",
    duty_cycle: float = 50.0,
    polarity: Literal["NORMAL", "INVERTED"] = "NORMAL",
    symmetry: float = 100.0,
) -> None

Set the given parameters on the provided source channel.

Parameters:
  • frequency (float) –

    The frequency of the waveform to generate.

  • function (SignalGeneratorFunctionBase) –

    The waveform shape to generate.

  • amplitude (float) –

    The amplitude of the signal to generate.

  • offset (float) –

    The offset of the signal to generate.

  • burst_count (int, default: 0 ) –

    The number of wavelengths to be generated.

  • termination (Literal['FIFTY', 'HIGHZ'], default: 'FIFTY' ) –

    The impedance this device’s channel expects to see at the received end.

  • duty_cycle (float, default: 50.0 ) –

    The duty cycle percentage within [0.4, 99.6].

  • polarity (Literal['NORMAL', 'INVERTED'], default: 'NORMAL' ) –

    The polarity to set the signal to.

  • symmetry (float, default: 100.0 ) –

    The symmetry to set the signal to, only applicable to certain functions.

set_offset abstractmethod

set_offset(value: float, absolute_tolerance: float = 0) -> None

Set the offset on the source channel.

Parameters:
  • value (float) –

    The offset value to set.

  • absolute_tolerance (float, default: 0 ) –

    The acceptable difference between two floating point values.

set_ramp_symmetry abstractmethod

set_ramp_symmetry(value: float) -> None

Set the symmetry of the ramp waveform on the source channel.

Parameters:
  • value (float) –

    The symmetry value to set within [0, 100].

set_state abstractmethod

set_state(value: int) -> None

Set the output state to ON/OFF (1/0) on the source channel.

Parameters:
  • value (int) –

    The output state.

setup_burst_waveform abstractmethod

setup_burst_waveform(burst_count: int) -> None

Prepare the source channel for a burst waveform.

Parameters:
  • burst_count (int) –

    The number of wavelengths to be generated.