PaSD bus device
This module implements the MCCS PaSD bus device.
- class MccsPasdBus(*args, **kwargs)
An implementation of a PaSD bus Tango device for MCCS.
- GetPasdDeviceSubscriptions(device_id)
Get subscriptions for a particular pasd device.
- InitializeFndh()
Initialize an FNDH.
- InitializeSmartbox(smartbox_id)
Initialize a smartbox.
- ResetFnccStatus()
Reset the FNCC status register.
- ResetFndhAlarms()
Reset the FNDH alarms register.
- ResetFndhWarnings()
Reset the FNDH warnings register.
- ResetSmartboxAlarms(smartbox_number)
Reset a Smartbox alarms register.
- ResetSmartboxPortBreaker(smartbox_number, port_number)
Reset a Smartbox’s port’s breaker.
- Parameters:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_ResetSmartboxPortBreaker.json", "title": "MccsPasdBus ResetSmartboxPortBreaker schema", "description": "Schema for MccsPasdBus's ResetSmartboxPortBreaker command", "type": "object", "properties": { "smartbox_number": { "description": "Number of the smartbox being addressed", "type": "integer", "minimum": 1, "maximum": 24 }, "port_number": { "description": "Number of the port whose breaker is to be reset", "type": "integer", "minimum": 1, "maximum": 12 } }, "required": ["smartbox_number", "port_number"] }
- ResetSmartboxWarnings(smartbox_number)
Reset a Smartbox warnings register.
- SetFndhLedPattern(pattern)
Set the FNDH service LED pattern.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetFndhLedPattern.json", "title": "MccsPasdBus SetFndhLedPattern schema", "description": "Schema for MccsPasdBus's SetFndhLedPattern command", "type": "object", "properties": { "pattern": { "description": "Name of the service LED pattern", "type": "string", "enum": [ "OFF", "ON", "VFAST", "FAST", "SLOW", "VSLOW" ] } }, "required": [ "pattern" ] }
- SetFndhLowPassFilters(cutoff, extra_sensors=False)
Set the FNDH’s sensors’ low pass filter constants.
- Parameters:
The given cut-off frequency is stored as the LowPassFilterCutoff property in the tango database. It is automatically written to all sensor registers of the FNDH and smartboxes after MccsPasdBus is initialised and set ONLINE, and after any of them are powered on or reset later.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetFndhLowPassFilters.json", "title": "MccsPasdBus SetFndhLowPassFilters schema", "description": "Schema for MccsPasdBus's SetFndhLowPassFilters command", "type": "object", "properties": { "cutoff": { "description": "Cut-off frequency to set for the low-pass filtering", "type": "number", "minimum": 0.1, "maximum": 1000.0 }, "extra_sensors": { "description": "Write the filter constant to the extra sensors' registers after the LED status register", "type": "boolean" } }, "required": [ "cutoff" ] }
- SetFndhPortPowers(port_powers, stay_on_when_offline)
Set FNDH port powers.
This command takes as input a JSON string that conforms to the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetFndhPortPowers.json", "title": "MccsPasdBus SetFndhPortPowers schema", "description": "Schema for MccsPasdBus's SetFndhPortPowers command", "type": "object", "properties": { "port_powers": { "description": "The desired power of each port", "type": "array", "minItems": 28, "maxItems": 28, "items": { "type": [ "boolean", "null" ] } }, "stay_on_when_offline": { "description": "Whether to stay on when M&C is offline", "type": "boolean" } }, "required": [ "port_powers", "stay_on_when_offline" ] }
- Parameters:
- Return type:
- Returns:
A tuple containing a result code and a human-readable status message.
- SetSmartboxLedPattern(smartbox_number, pattern)
Set a Smartbox’s service LED pattern.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetSmartboxLedPattern.json", "title": "MccsPasdBus SetSmartboxLedPattern schema", "description": "Schema for MccsPasdBus's SetSmartboxLedPattern command", "type": "object", "properties": { "smartbox_number": { "description": "Number of the smartbox being addressed", "type": "integer", "minimum": 1, "maximum": 24 }, "pattern": { "description": "Name of the service LED pattern", "type": "string", "enum": [ "OFF", "ON", "VFAST", "FAST", "SLOW", "VSLOW" ] } }, "required": [ "smartbox_number", "pattern" ] }
- SetSmartboxLowPassFilters(smartbox_number, cutoff, extra_sensors=False)
Set a Smartbox’s sensors’ low pass filter constants.
The given cut-off frequency is stored as the LowPassFilterCutoff property in the tango database. It is automatically written to all sensor registers of the FNDH and smartboxes after MccsPasdBus is initialised and set ONLINE, and after any of them are powered on or reset later.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetSmartboxLowPassFilters.json", "title": "MccsPasdBus SetSmartboxLowPassFilters schema", "description": "Schema for MccsPasdBus's SetSmartboxLowPassFilters command", "type": "object", "properties": { "smartbox_number": { "description": "Number of the smartbox being addressed", "type": "integer", "minimum": 1, "maximum": 24 }, "cutoff": { "description": "Cut-off frequency to set for the low-pass filtering", "type": "number", "minimum": 0.1, "maximum": 1000.0 }, "extra_sensors": { "description": "Write the filter constant to the extra sensors' registers after the LED status register.", "type": "boolean" } }, "required": [ "smartbox_number", "cutoff" ] }
- Parameters:
- Return type:
- Returns:
A tuple containing a result code and a human-readable status message.
- SetSmartboxPortPowers(smartbox_number, port_powers, stay_on_when_offline)
Set a Smartbox’s port powers.
- Parameters:
smartbox_number (
int) – number of the smartbox to be addressed.port_powers (
list[Optional[bool]]) – the desired power for each port. True means powered on, False means off, None means no desired changestay_on_when_offline (
bool) – whether any ports being turned on should remain on if communication with the MCCS is lost.
This command takes as input a JSON string that conforms to the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsPasdBus_SetSmartboxPortPowers.json", "title": "MccsPasdBus SetSmartboxPortPowers schema", "description": "Schema for MccsPasdBus's SetSmartboxPortPowers command", "type": "object", "properties": { "smartbox_number": { "description": "Number of the smartbox being addressed", "type": "integer", "minimum": 1, "maximum": 24 }, "port_powers": { "description": "The desired power of each port", "type": "array", "minItems": 12, "maxItems": 12, "items": { "type": [ "boolean", "null" ] } }, "stay_on_when_offline": { "description": "Whether to stay on when M&C is offline", "type": "boolean" } }, "required": [ "smartbox_number", "port_powers", "stay_on_when_offline" ] }
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- Returns:
a component manager for this device.
- delete_device()
Prepare to delete the device.
Make sure the component manager doesn’t have a socket open. (The socket should be closed when it is deleted, but it is good practice to close it explicitly anyhow.)
- Return type:
- init_device()
Initialise the device.
This is overridden here to change the Tango serialisation model.
- Return type:
- set_logging_level(value)
Update logging level and explicitly set pymodbus logging level.
- Parameters:
value (
LoggingLevel) – Logging level for logger- Return type: