Phase Micro Stepper subpackage

This module contains the phase microstepper functionality.

class PhaseMicroStepperDriver(logger, host, udp_port, tcp_port, communication_state_changed=None, component_state_changed=None, update_rate=5.0)

Device Server for the SAT.LMC PhaseMicrostepper (100MHz).

__init__(logger, host, udp_port, tcp_port, communication_state_changed=None, component_state_changed=None, update_rate=5.0)

Initialise the attributes and properties of the PhaseMicroStepper.

Parameters:
  • logger (Logger) – a logger for this object to use

  • host (str) – the hostname of the PhaseMicroStepper

  • udp_port (int) – the udp port number

  • tcp_port (int) – the tcp port number

  • communication_state_changed (Optional[Callable[[CommunicationStatus], None]]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_changed (Optional[Callable[[bool], None]]) – callback to be called when the component faults (or stops faulting)

  • 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).

advance_10megahertz(advance)

Advance the output phase of 10MHz OUT signals.

Value in units of 10ns. Acceptable range is from 0 to +9.

Parameters:

advance (int) – advance by this value

Return type:

str

Returns:

the command string & value

advance_phase(advance)

Advance the output phase of all OUT signals.in units of 1e-15s.

The resolution is about 1e-13. Acceptable range is from -5000000 to +5000000.

Parameters:

advance (int) – advance by this value

Return type:

str

Returns:

the command string & value

advance_pps(advance)

Advance the phase of PPS OUT signals in units of 10ns.

The acceptable range is limited from -99000000 to 30000000.

Parameters:

advance (int) – advance by this value

Return type:

str

Returns:

the command string & value

get_offset_frequency()

Return the offset frequency set in the last setF command.

Return type:

str

Returns:

the command and offset frequency in units of 1e-20

get_request()

Check whether the attributes should be read on the next poll.

Return type:

bool

Returns:

true if attributes are read on the next poll.

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 (bool) – whether to perform in this poll.

Return type:

dict[str, Any]

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 (dict[str, Any]) – 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

set_ip_address(ip_address)

Set the IP address of the EOG and closes the TCP connection.

Parameters:

ip_address (str) – the new IP address

Return type:

str

Returns:

the command string & IP address set

set_offset_frequency(offset)

Set the offset frequency.

Sets the OUT signals respect to the frequency of 100MHz IN signal, in units of 1e-20. Resolution is better than 3e-20. The acceptable range is from -1000000000000 to 1000000000000.

Parameters:

offset (int) – the offset frequency

Return type:

str

Returns:

the command and converted frquency in units of 1e-20

set_udp_address(udp_address)

Set the UDP destination address.

If network address is 255.255.255.255, the UDP message is broadcast to all address.

Parameters:

udp_address (str) – the new UDP address

Return type:

str

Returns:

the command string & UDP address set

start_communicating()

Establish communication with the phasemicrostepper.

Return type:

None

stop_communicating()

Stop communicating with the PhaseMicroStepper.

Return type:

None

sync_pps()

Shift the rising edge of 1PPS OUT signals in order to align it with 1PPS IN.

The value in the second string is 0 if the operation is OK, 1 in case of error. In most of the cases, the error is due to the absence of a valid signal on the 1PPS IN connector.

Return type:

tuple[int, str]

Returns:

the command string and second string as “syncPPS done, Error = 0”

class PhaseMicroStepperHealthModel(health_changed_callback, **kwargs)

A health model for a phase microstepper.

At present this uses the base health model; this is a placeholder for a future, better implementation.

class SatPhaseMicroStepper(*args, **kwargs)

An implementation of a PhaseMicroStepper Tango device for SatLmc.

Advance10M(argin)

Advance the output phase of 10MHz OUT signals, in units of 10ns.

Acceptable range is from 0 to +9.

Parameters:

argin (int) – the phase advance in units of 10ns

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class Advance10MCommand(component_manager, logger=None)

Class for handling the Advance10M command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement Advance10M command functionality.

Parameters:
  • args (Any) – positional arguments. [0] the advance in units of 10ns

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

AdvanceAllPhase(argin)

Advance the output phase of all OUT signals, in units of 1e-15s.

The resolution is about 1e-13. Acceptable range is from -5000000 to +5000000.

Parameters:

argin (int) – the advance in units of 1e-15s

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class AdvanceAllPhaseCommand(component_manager, logger=None)

Class for handling the AdvanceAllPhase command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement AdvanceAllPhase command functionality.

Parameters:
  • args (Any) – positional arguments.

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

AdvancePPS(argin)

Advance the phase of PPS OUT signals in units of 10ns.

The acceptable range is limited from -99000000 to 30000000.AdvancePPS.

Parameters:

argin (int) – the advance in units of 10ns

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class AdvancePPSCommand(component_manager, logger=None)

Class for handling the AdvancePPS command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement AdvancePPS command functionality.

Parameters:
  • args (Any) – positional arguments. [0] the advance in units of 10ns

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

GetOffsetFrequency()

Get the offset frequency, in units of 1e-20.

Return type:

str

Returns:

the offset frequency send in the last setOffsetFrequencu command.

class GetOffsetFrequencyCommand(component_manager, logger=None)

Class for handling the GetOffsetFrequency() command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement GetOffsetFrequency() command functionality.

Parameters:
  • args (Any) – positional arguments. This should be empty and is provided for typehinting purposes only.

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

str

Returns:

the offset frequency

class InitCommand(*args, **kwargs)

Implement the device initialisation for the PhaseMicroStepper device.

do(*args, **kwargs)

Initialise the attributes and properties.

Parameters:
  • args (Any) – additional positional arguments; unused here

  • kwargs (Any) – additional keyword arguments; unused here

Return type:

tuple[ResultCode, str]

Returns:

a resultcode, message tuple

class SetIPAddressCommand(component_manager, logger=None)

Class for handling the SetIPAddress command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement SetIPAddress command functionality.

Parameters:
  • args (Any) – positional arguments. [0] the new IP address

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetIPaddress(argin)

Set the IP address of the EOG and closes the TCP connection.

Parameters:

argin (str) – the new IP address

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetOffsetFrequency(offset)

Set the offset frequency.

Set the offset frequency of OUT signals respect to the frequency of 100MHz IN signal, in units of 1e-20. 7 Resolution is better than 3e-20. The acceptable range is from -1000000000000 to 1000000000000

Parameters:

offset (int) – the offset frequency

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

the command + the converted offset frequency

class SetOffsetFrequencyCommand(component_manager, logger=None)

Class for handling the SetOffsetFrequency(argin) command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement SetOffsetFrequency command functionality.

Parameters:
  • args (Any) – positional args, the offset frequency is [0]

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class SetUDPAddressCommand(component_manager, logger=None)

Class for handling the SetUDPAddress command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement SetUDPAddress command functionality.

Parameters:
  • args (Any) – positional arguments. [0] the new UDP address

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SetUDPaddress(argin)

Set the UDP address destination.

Parameters:

argin (str) – the str

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

SyncPPS()

External sync of the 1PPS outputs.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

class SyncPPSCommand(component_manager, logger=None)

Class for handling the SyncPPS(argin) command.

__init__(component_manager, logger=None)

Initialise a new Command instance.

Parameters:
do(*args, **kwargs)

Implement SyncPPS command functionality.

Parameters:
  • args (Any) – positional arguments. This should be empty and is provided for typehinting purposes only.

  • kwargs (Any) – unspecified keyword arguments. This should be empty and is provided for typehinting purposes only.

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

__init__(*args, **kwargs)

Initialise a new instance.

Parameters:
  • args (Any) – positional arguments.

  • kwargs (Any) – keyword arguments.

create_component_manager()

Create and return a component manager for this device.

Return type:

PhaseMicroStepperDriver

Returns:

a component manager for this device.

first_internal_oscillator()

Report the status of the first internal oscillator.

Return type:

float

Returns:

oscillator 1 value (fixed point 6 decimal digits)

init_command_objects()

Initialise the command handlers for commands supported by this device.

Return type:

None

init_device()

Initialise the device.

Return type:

None

internal_temperature()

Report the internal temperature of the device.

Return type:

float

Returns:

temperature in celcius (fixed point 2 decimal digits)

is_Advance10M_allowed()

Check if command Advance10M is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_AdvanceAllPhase_allowed()

Check if command AdvanceAllPhase is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_AdvancePPS_allowed()

Check if command AdvancePPS is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_SetIPaddress_allowed()

Check if command SetIPaddress is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_SetUDPaddress_allowed()

Check if command SetUDPaddress is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_SyncPPS_allowed()

Check if command SyncPPS is allowed in the current device state.

Return type:

bool

Returns:

True if the command is allowed

is_attribute_allowed(attr_req_type)

Protect attribute access before being updated otherwise it reports alarm.

Parameters:

attr_req_type (AttReqType) – tango attribute type READ/WRITE

Return type:

bool

Returns:

True if the attribute can be read else False

second_internal_oscillator()

Report the status of the second internal oscillator.

Return type:

float

Returns:

oscillator 2 value (fixed point 6 decimal digits)

serial_number()

Report the serial number of the device.

Return type:

int

Returns:

the serial number