Arbitrary waveform generator (AWG) subpackage (ska_ser_test_equipment.awg)

Monitoring and control of arbitrary waveform generators (AWGs).

class ska_ser_test_equipment.awg.AwgComponentManager(interface_definition, protocol, host, port, logger, communication_state_callback, component_state_callback, update_rate=5.0)

A component manager for an arbitrary waveform generator (AWG).

__init__(interface_definition, protocol, host, port, logger, communication_state_callback, component_state_callback, update_rate=5.0)

Initialise a new AWG component manager instance.

Parameters:
  • interface_definition (InterfaceDefinitionType) – definition of the AWG’s SCPI interface.

  • protocol (Literal['tcp', 'telnet']) – the network protocol to be used to communicate with the AWG.

  • host (str) – the host name or IP address of the AWG.

  • port (int) – the port of the AWG.

  • logger (Logger) – a logger for this component manager to use for logging.

  • communication_state_callback (Callable) – callback to be called when the status of communications between the component manager and its component changes.

  • component_state_callback (Callable) – callback to be called when the state of the component changes.

  • update_rate (float) – how often updates to attribute values should be provided. This is not necessarily the same as the rate at which the instrument is polled. For example, the instrument may be polled every 0.1 seconds, thus ensuring that any invoked commands or writes will be executed promptly. However, if the update_rate is 5.0, then routine reads of instrument values will only occur every 50th poll (i.e. every 5 seconds).

get_request()

Return the reads and writes to be executed in the next poll.

Return type:

AttributeRequest

Returns:

reads and writes to be executed in the next poll.

off(task_callback=None)

Turn the component off.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes.

Raises:

NotImplementedError – because this command is not yet implemented.

Return type:

Tuple[TaskStatus, str]

on(task_callback=None)

Turn the component on.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes.

Raises:

NotImplementedError – because this command is not yet implemented.

Return type:

Tuple[TaskStatus, str]

poll(poll_request)

Poll the hardware.

Connect to the hardware, write any values that are to be written, and then read all values.

Parameters:

poll_request (AttributeRequest) – specification of the reads and writes to be performed in this poll.

Return type:

AttributeResponse

Returns:

responses to queries in this poll.

poll_succeeded(poll_response)

Handle the receipt of new polling values.

This is a hook called by the poller when values have been read during a poll.

Parameters:

poll_response (AttributeResponse) – response to the pool, including any values read.

Return type:

None

polling_stopped()

Respond to polling having stopped.

This is a hook called by the poller when it stops polling.

Return type:

None

reset(task_callback=None)

Reset the component (from fault state).

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes.

Return type:

Tuple[TaskStatus, str]

Returns:

the task status and a message.

standby(task_callback=None)

Put the component into low-power standby mode.

Parameters:

task_callback (Optional[Callable]) – callback to be called when the status of the command changes.

Raises:

NotImplementedError – because this command is not yet implemented.

Return type:

Tuple[TaskStatus, str]

write_attribute(**kwargs)

Update AWG attribute value(s).

This doesn’t actually immediately write to the AWG. It only stores the details of the requested write where it will be picked up by the next iteration of the polling loop.

Parameters:

kwargs (Any) – keyword arguments specifying attributes to be written along with their corresponding value.

Return type:

None

write_command(*cmds)

Enqueue a no-argument SCPI command to be executed next poll.

Parameters:

cmds (str) – SCPI commands to enqueue as named in the device definition YAML file.

Return type:

None

class ska_ser_test_equipment.awg.AwgDevice(*args, **kwargs)

A Tango device for an arbitrary waveform generator (AWG).

create_component_manager()

Create and return a component manager for this device.

Return type:

AwgComponentManager

Returns:

a component manager for this device.

class ska_ser_test_equipment.awg.AwgSimulator(model, **kwargs)

A concrete simulator class.

__init__(model, **kwargs)

Initialise a new instance.

Parameters:
  • model (str) – the model identifier to use.

  • kwargs (bool | float | int | str | list[float | int | number[Any]]) – initial values for simulator attributes; where an initial value is not provided for an attribute, a default value will be used.

play()

Simulate the AWG Play command.

Return type:

None

reset()

Reset to factory default values.

Return type:

None

stop()

Simulate the AWG Stop command.

Return type:

None