hvl_ccb.dev.supercube package

Submodules

hvl_ccb.dev.supercube.base module

Base classes for the Supercube device.

class hvl_ccb.dev.supercube.base.SupercubeBase(com, dev_config=None)[source]

Bases: hvl_ccb.dev.base.SingleCommDevice

Base class for Supercube variants.

static config_cls()[source]

Return the default configdataclass class.

Returns:a reference to the default configdataclass class
static default_com_cls()[source]

Get the class for the default communication protocol used with this device.

Returns:the type of the standard communication protocol for this device
get_cee16_socket() → bool[source]

Read the on-state of the IEC CEE16 three-phase power socket.

Returns:the on-state of the CEE16 power socket
get_door_status(door: int) → hvl_ccb.dev.supercube.constants.DoorStatus[source]

Get the status of a safety fence door. See constants.DoorStatus for possible returned door statuses.

Parameters:door – the door number (1..3)
Returns:the door status
get_earthing_manual(number: int) → bool[source]

TODO: Test get_earthing_manual with device

Get the manual status of an earthing stick. If an earthing stick is set to manual, it is closed even if the system is in states RedReady or RedOperate.

Parameters:number – number of the earthing stick (1..6)
Returns:earthing stick manual status
get_earthing_status(number: int) → hvl_ccb.dev.supercube.constants.EarthingStickStatus[source]

Get the status of an earthing stick, whether it is closed, open or undefined (moving).

Parameters:number – number of the earthing stick (1..6)
Returns:earthing stick status
get_measurement_ratio(channel: int) → float[source]

TODO: test get_measurement_ratio with device

Get the set measurement ratio of an AC/DC analog input channel. Every input channel has a divider ratio assigned during setup of the Supercube system. This ratio can be read out.

Parameters:channel – number of the input channel (1..4)
Returns:the ratio
get_measurement_voltage(channel: int) → float[source]

TODO: test get_measurement_voltage with device

Get the measured voltage of an analog input channel. The voltage read out here is already scaled by the configured divider ratio.

Parameters:channel – number of the input channel (1..4)
Returns:measured voltage
get_status() → hvl_ccb.dev.supercube.constants.SafetyStatus[source]

Get the safety circuit status of the Supercube. :return: the safety status of the supercube’s state machine.

get_support_input(port: int, contact: int) → bool[source]

Get the state of a support socket input.

Parameters:
  • port – is the socket number (1..6)
  • contact – is the contact on the socket (1..2)
Returns:

digital input read state

get_support_output(port: int, contact: int) → bool[source]

Get the state of a support socket output.

Parameters:
  • port – is the socket number (1..6)
  • contact – is the contact on the socket (1..2)
Returns:

digital output read state

get_t13_socket(port: int) → bool[source]

Read the state of a SEV T13 power socket.

Parameters:port – is the socket number (1..3)
Returns:on-state of the power socket
operate(state: bool) → None[source]

Set operate state. If the state is RedReady, this will turn on the high voltage and close the safety switches.

Parameters:state – set operate state
quit_error() → None[source]

Quits errors that are active on the Supercube.

read(node_id: str)[source]

Local wrapper for the OPC UA communication protocol read method.

Parameters:node_id – the id of the node to read.
Returns:the value of the variable
ready(state: bool) → None[source]

Set ready state. Ready means locket safety circuit, red lamps, but high voltage still off.

Parameters:state – set ready state
set_cee16_socket(state: bool) → None[source]

Switch the IEC CEE16 three-phase power socket on or off.

Parameters:state – desired on-state of the power socket
Raises:ValueError – if state is not of type bool
set_earthing_manual(number: int, manual: bool) → None[source]

TODO: Test set_earthing_manual with device

Set the manual status of an earthing stick. If an earthing stick is set to manual, it stays closed even if the system is in states RedReady or RedOperate.

Parameters:
  • number – number of the earthing stick (1..6)
  • manual – earthing stick manual status (True or False)
set_remote_control(state: bool) → None[source]

TODO: test set_remote_control with device

Enable or disable remote control for the Supercube. This will effectively display a message on the touchscreen HMI.

Parameters:state – desired remote control state
set_support_output(port: int, contact: int, state: bool) → None[source]

Set the state of a support output socket.

Parameters:
  • port – is the socket number (1..6)
  • contact – is the contact on the socket (1..2)
  • state – is the desired state of the support output
set_support_output_impulse(port: int, contact: int, duration: float = 0.2, pos_pulse: bool = True) → None[source]

Issue an impulse of a certain duration on a support output contact. The polarity of the pulse (On-wait-Off or Off-wait-On) is specified by the pos_pulse argument.

This function is blocking.

Parameters:
  • port – is the socket number (1..6)
  • contact – is the contact on the socket (1..2)
  • duration – is the length of the impulse in seconds
  • pos_pulse – is True, if the pulse shall be HIGH, False if it shall be LOW
set_t13_socket(port: int, state: bool) → None[source]

Set the state of a SEV T13 power socket.

Parameters:
  • port – is the socket number (1..3)
  • state – is the desired on-state of the socket
start() → None[source]

Starts the device. Sets the root node for all OPC read and write commands to the Siemens PLC object node which holds all our relevant objects and variables.

stop() → None[source]

Stop the Supercube device. Deactivates the remote control and closes the communication protocol.

write(node_id, value) → None[source]

Local wrapper for the OPC UA communication protocol write method.

Parameters:
  • node_id – the id of the node to read
  • value – the value to write to the variable
class hvl_ccb.dev.supercube.base.SupercubeConfiguration(namespace_index: int = 3)[source]

Bases: object

Configuration dataclass for the Supercube devices.

clean_values()

Cleans and enforces configuration values. Does nothing by default, but may be overridden to add custom configuration value checks.

force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

Parameters:
  • fieldname – name of the field
  • value – value to assign
is_configdataclass = True
classmethod keys() → Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:a list of strings containing all keys.
namespace_index = 3

Namespace of the OPC variables, typically this is 3 (coming from Siemens)

classmethod optional_defaults() → Dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:a list of strings containing all optional keys.
classmethod required_keys() → Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:a list of strings containing all required keys.
class hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunication(config)[source]

Bases: hvl_ccb.comm.opc.OpcUaCommunication

Communication protocol specification for Supercube devices.

static config_cls()[source]

Return the default configdataclass class.

Returns:a reference to the default configdataclass class
class hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunicationConfig(host: str, endpoint_name: str, port: int = 4840, sub_handler: hvl_ccb.comm.opc.OpcUaSubHandler = <hvl_ccb.dev.supercube.base.SupercubeSubscriptionHandler object>, update_period: int = 500)[source]

Bases: hvl_ccb.comm.opc.OpcUaCommunicationConfig

Communication protocol configuration for OPC UA, specifications for the Supercube devices.

force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

Parameters:
  • fieldname – name of the field
  • value – value to assign
classmethod keys() → Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:a list of strings containing all keys.
classmethod optional_defaults() → Dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:a list of strings containing all optional keys.
classmethod required_keys() → Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:a list of strings containing all required keys.
sub_handler = <hvl_ccb.dev.supercube.base.SupercubeSubscriptionHandler object>

Subscription handler for data change events

class hvl_ccb.dev.supercube.base.SupercubeSubscriptionHandler[source]

Bases: hvl_ccb.comm.opc.OpcUaSubHandler

OPC Subscription handler for datachange events and normal events specifically implemented for the Supercube devices.

datachange_notification(node: opcua.common.node.Node, val, data)[source]

In addition to the standard operation (debug logging entry of the datachange), alarms are logged at INFO level using the alarm text.

Parameters:
  • node – the node object that triggered the datachange event
  • val – the new value
  • data

hvl_ccb.dev.supercube.constants module

Constants, variable names for the Supercube OPC-connected devices.

class hvl_ccb.dev.supercube.constants.AlarmText(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

This enumeration contains textual representations for all error classes (stop, warning and message) of the Supercube system. Use the AlarmText.get() method to retrieve the enum of an alarm number.

Alarm1 = 'STOP Emergency Stop 1'
Alarm10 = 'STOP Earthing stick 2 error while opening'
Alarm11 = 'STOP Earthing stick 3 error while opening'
Alarm12 = 'STOP Earthing stick 4 error while opening'
Alarm13 = 'STOP Earthing stick 5 error while opening'
Alarm14 = 'STOP Earthing stick 6 error while opening'
Alarm15 = 'STOP Earthing stick 1 error while closing'
Alarm16 = 'STOP Earthing stick 2 error while closing'
Alarm17 = 'STOP Earthing stick 3 error while closing'
Alarm18 = 'STOP Earthing stick 4 error while closing'
Alarm19 = 'STOP Earthing stick 5 error while closing'
Alarm2 = 'STOP Emergency Stop 2'
Alarm20 = 'STOP Earthing stick 6 error while closing'
Alarm21 = 'STOP Safety fence 1'
Alarm22 = 'STOP Safety fence 2'
Alarm23 = 'STOP OPC connection error'
Alarm24 = 'STOP Grid power failure'
Alarm25 = 'STOP UPS failure'
Alarm26 = 'STOP 24V PSU failure'
Alarm3 = 'STOP Emergency Stop 3'
Alarm4 = 'STOP Safety Switch 1 error'
Alarm41 = 'WARNING Door 1: Use earthing rod!'
Alarm42 = 'MESSAGE Door 1: Earthing rod is still in setup.'
Alarm43 = 'WARNING Door 2: Use earthing rod!'
Alarm44 = 'MESSAGE Door 2: Earthing rod is still in setup.'
Alarm45 = 'WARNING Door 3: Use earthing rod!'
Alarm46 = 'MESSAGE Door 3: Earthing rod is still in setup.'
Alarm47 = 'MESSAGE UPS charge < 85%'
Alarm48 = 'MESSAGE UPS running on battery'
Alarm5 = 'STOP Safety Switch 2 error'
Alarm6 = 'STOP Door 1 lock supervision'
Alarm7 = 'STOP Door 2 lock supervision'
Alarm8 = 'STOP Door 3 lock supervision'
Alarm9 = 'STOP Earthing stick 1 error while opening'
get = <bound method AlarmText.get of <aenum 'AlarmText'>>[source]
not_defined = 'NO ALARM TEXT DEFINED'
class hvl_ccb.dev.supercube.constants.Alarms(*args, **kwds)

Bases: hvl_ccb.dev.supercube.constants._AlarmsBase

Alarms enumeration containing all variable NodeID strings for the alarm array.

Alarm1 = '"DB_Alarm_HMI"."Alarm1"'
Alarm10 = '"DB_Alarm_HMI"."Alarm10"'
Alarm100 = '"DB_Alarm_HMI"."Alarm100"'
Alarm101 = '"DB_Alarm_HMI"."Alarm101"'
Alarm102 = '"DB_Alarm_HMI"."Alarm102"'
Alarm103 = '"DB_Alarm_HMI"."Alarm103"'
Alarm104 = '"DB_Alarm_HMI"."Alarm104"'
Alarm105 = '"DB_Alarm_HMI"."Alarm105"'
Alarm106 = '"DB_Alarm_HMI"."Alarm106"'
Alarm107 = '"DB_Alarm_HMI"."Alarm107"'
Alarm108 = '"DB_Alarm_HMI"."Alarm108"'
Alarm109 = '"DB_Alarm_HMI"."Alarm109"'
Alarm11 = '"DB_Alarm_HMI"."Alarm11"'
Alarm110 = '"DB_Alarm_HMI"."Alarm110"'
Alarm111 = '"DB_Alarm_HMI"."Alarm111"'
Alarm112 = '"DB_Alarm_HMI"."Alarm112"'
Alarm113 = '"DB_Alarm_HMI"."Alarm113"'
Alarm114 = '"DB_Alarm_HMI"."Alarm114"'
Alarm115 = '"DB_Alarm_HMI"."Alarm115"'
Alarm116 = '"DB_Alarm_HMI"."Alarm116"'
Alarm117 = '"DB_Alarm_HMI"."Alarm117"'
Alarm118 = '"DB_Alarm_HMI"."Alarm118"'
Alarm119 = '"DB_Alarm_HMI"."Alarm119"'
Alarm12 = '"DB_Alarm_HMI"."Alarm12"'
Alarm120 = '"DB_Alarm_HMI"."Alarm120"'
Alarm121 = '"DB_Alarm_HMI"."Alarm121"'
Alarm122 = '"DB_Alarm_HMI"."Alarm122"'
Alarm123 = '"DB_Alarm_HMI"."Alarm123"'
Alarm124 = '"DB_Alarm_HMI"."Alarm124"'
Alarm125 = '"DB_Alarm_HMI"."Alarm125"'
Alarm126 = '"DB_Alarm_HMI"."Alarm126"'
Alarm127 = '"DB_Alarm_HMI"."Alarm127"'
Alarm128 = '"DB_Alarm_HMI"."Alarm128"'
Alarm129 = '"DB_Alarm_HMI"."Alarm129"'
Alarm13 = '"DB_Alarm_HMI"."Alarm13"'
Alarm130 = '"DB_Alarm_HMI"."Alarm130"'
Alarm131 = '"DB_Alarm_HMI"."Alarm131"'
Alarm132 = '"DB_Alarm_HMI"."Alarm132"'
Alarm133 = '"DB_Alarm_HMI"."Alarm133"'
Alarm134 = '"DB_Alarm_HMI"."Alarm134"'
Alarm135 = '"DB_Alarm_HMI"."Alarm135"'
Alarm136 = '"DB_Alarm_HMI"."Alarm136"'
Alarm137 = '"DB_Alarm_HMI"."Alarm137"'
Alarm138 = '"DB_Alarm_HMI"."Alarm138"'
Alarm139 = '"DB_Alarm_HMI"."Alarm139"'
Alarm14 = '"DB_Alarm_HMI"."Alarm14"'
Alarm140 = '"DB_Alarm_HMI"."Alarm140"'
Alarm141 = '"DB_Alarm_HMI"."Alarm141"'
Alarm142 = '"DB_Alarm_HMI"."Alarm142"'
Alarm143 = '"DB_Alarm_HMI"."Alarm143"'
Alarm144 = '"DB_Alarm_HMI"."Alarm144"'
Alarm145 = '"DB_Alarm_HMI"."Alarm145"'
Alarm146 = '"DB_Alarm_HMI"."Alarm146"'
Alarm147 = '"DB_Alarm_HMI"."Alarm147"'
Alarm148 = '"DB_Alarm_HMI"."Alarm148"'
Alarm149 = '"DB_Alarm_HMI"."Alarm149"'
Alarm15 = '"DB_Alarm_HMI"."Alarm15"'
Alarm150 = '"DB_Alarm_HMI"."Alarm150"'
Alarm151 = '"DB_Alarm_HMI"."Alarm151"'
Alarm16 = '"DB_Alarm_HMI"."Alarm16"'
Alarm17 = '"DB_Alarm_HMI"."Alarm17"'
Alarm18 = '"DB_Alarm_HMI"."Alarm18"'
Alarm19 = '"DB_Alarm_HMI"."Alarm19"'
Alarm2 = '"DB_Alarm_HMI"."Alarm2"'
Alarm20 = '"DB_Alarm_HMI"."Alarm20"'
Alarm21 = '"DB_Alarm_HMI"."Alarm21"'
Alarm22 = '"DB_Alarm_HMI"."Alarm22"'
Alarm23 = '"DB_Alarm_HMI"."Alarm23"'
Alarm24 = '"DB_Alarm_HMI"."Alarm24"'
Alarm25 = '"DB_Alarm_HMI"."Alarm25"'
Alarm26 = '"DB_Alarm_HMI"."Alarm26"'
Alarm27 = '"DB_Alarm_HMI"."Alarm27"'
Alarm28 = '"DB_Alarm_HMI"."Alarm28"'
Alarm29 = '"DB_Alarm_HMI"."Alarm29"'
Alarm3 = '"DB_Alarm_HMI"."Alarm3"'
Alarm30 = '"DB_Alarm_HMI"."Alarm30"'
Alarm31 = '"DB_Alarm_HMI"."Alarm31"'
Alarm32 = '"DB_Alarm_HMI"."Alarm32"'
Alarm33 = '"DB_Alarm_HMI"."Alarm33"'
Alarm34 = '"DB_Alarm_HMI"."Alarm34"'
Alarm35 = '"DB_Alarm_HMI"."Alarm35"'
Alarm36 = '"DB_Alarm_HMI"."Alarm36"'
Alarm37 = '"DB_Alarm_HMI"."Alarm37"'
Alarm38 = '"DB_Alarm_HMI"."Alarm38"'
Alarm39 = '"DB_Alarm_HMI"."Alarm39"'
Alarm4 = '"DB_Alarm_HMI"."Alarm4"'
Alarm40 = '"DB_Alarm_HMI"."Alarm40"'
Alarm41 = '"DB_Alarm_HMI"."Alarm41"'
Alarm42 = '"DB_Alarm_HMI"."Alarm42"'
Alarm43 = '"DB_Alarm_HMI"."Alarm43"'
Alarm44 = '"DB_Alarm_HMI"."Alarm44"'
Alarm45 = '"DB_Alarm_HMI"."Alarm45"'
Alarm46 = '"DB_Alarm_HMI"."Alarm46"'
Alarm47 = '"DB_Alarm_HMI"."Alarm47"'
Alarm48 = '"DB_Alarm_HMI"."Alarm48"'
Alarm49 = '"DB_Alarm_HMI"."Alarm49"'
Alarm5 = '"DB_Alarm_HMI"."Alarm5"'
Alarm50 = '"DB_Alarm_HMI"."Alarm50"'
Alarm51 = '"DB_Alarm_HMI"."Alarm51"'
Alarm52 = '"DB_Alarm_HMI"."Alarm52"'
Alarm53 = '"DB_Alarm_HMI"."Alarm53"'
Alarm54 = '"DB_Alarm_HMI"."Alarm54"'
Alarm55 = '"DB_Alarm_HMI"."Alarm55"'
Alarm56 = '"DB_Alarm_HMI"."Alarm56"'
Alarm57 = '"DB_Alarm_HMI"."Alarm57"'
Alarm58 = '"DB_Alarm_HMI"."Alarm58"'
Alarm59 = '"DB_Alarm_HMI"."Alarm59"'
Alarm6 = '"DB_Alarm_HMI"."Alarm6"'
Alarm60 = '"DB_Alarm_HMI"."Alarm60"'
Alarm61 = '"DB_Alarm_HMI"."Alarm61"'
Alarm62 = '"DB_Alarm_HMI"."Alarm62"'
Alarm63 = '"DB_Alarm_HMI"."Alarm63"'
Alarm64 = '"DB_Alarm_HMI"."Alarm64"'
Alarm65 = '"DB_Alarm_HMI"."Alarm65"'
Alarm66 = '"DB_Alarm_HMI"."Alarm66"'
Alarm67 = '"DB_Alarm_HMI"."Alarm67"'
Alarm68 = '"DB_Alarm_HMI"."Alarm68"'
Alarm69 = '"DB_Alarm_HMI"."Alarm69"'
Alarm7 = '"DB_Alarm_HMI"."Alarm7"'
Alarm70 = '"DB_Alarm_HMI"."Alarm70"'
Alarm71 = '"DB_Alarm_HMI"."Alarm71"'
Alarm72 = '"DB_Alarm_HMI"."Alarm72"'
Alarm73 = '"DB_Alarm_HMI"."Alarm73"'
Alarm74 = '"DB_Alarm_HMI"."Alarm74"'
Alarm75 = '"DB_Alarm_HMI"."Alarm75"'
Alarm76 = '"DB_Alarm_HMI"."Alarm76"'
Alarm77 = '"DB_Alarm_HMI"."Alarm77"'
Alarm78 = '"DB_Alarm_HMI"."Alarm78"'
Alarm79 = '"DB_Alarm_HMI"."Alarm79"'
Alarm8 = '"DB_Alarm_HMI"."Alarm8"'
Alarm80 = '"DB_Alarm_HMI"."Alarm80"'
Alarm81 = '"DB_Alarm_HMI"."Alarm81"'
Alarm82 = '"DB_Alarm_HMI"."Alarm82"'
Alarm83 = '"DB_Alarm_HMI"."Alarm83"'
Alarm84 = '"DB_Alarm_HMI"."Alarm84"'
Alarm85 = '"DB_Alarm_HMI"."Alarm85"'
Alarm86 = '"DB_Alarm_HMI"."Alarm86"'
Alarm87 = '"DB_Alarm_HMI"."Alarm87"'
Alarm88 = '"DB_Alarm_HMI"."Alarm88"'
Alarm89 = '"DB_Alarm_HMI"."Alarm89"'
Alarm9 = '"DB_Alarm_HMI"."Alarm9"'
Alarm90 = '"DB_Alarm_HMI"."Alarm90"'
Alarm91 = '"DB_Alarm_HMI"."Alarm91"'
Alarm92 = '"DB_Alarm_HMI"."Alarm92"'
Alarm93 = '"DB_Alarm_HMI"."Alarm93"'
Alarm94 = '"DB_Alarm_HMI"."Alarm94"'
Alarm95 = '"DB_Alarm_HMI"."Alarm95"'
Alarm96 = '"DB_Alarm_HMI"."Alarm96"'
Alarm97 = '"DB_Alarm_HMI"."Alarm97"'
Alarm98 = '"DB_Alarm_HMI"."Alarm98"'
Alarm99 = '"DB_Alarm_HMI"."Alarm99"'
class hvl_ccb.dev.supercube.constants.BreakdownDetection(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Node ID strings for the breakdown detection.

TODO: these variable NodeIDs are not tested and/or correct yet.

activated = '"Ix_Allg_Breakdown_activated"'

Boolean read-only variable indicating whether breakdown detection and fast switchoff is enabled in the system or not.

reset = '"Qx_Allg_Breakdown_reset"'

Boolean writable variable to reset the fast switch-off. Toggle to re-enable.

triggered = '"Ix_Allg_Breakdown_triggered"'

Boolean read-only variable telling whether the fast switch-off has triggered. This can also be seen using the safety circuit state, therefore no method is implemented to read this out directly.

class hvl_ccb.dev.supercube.constants.Door(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for doors.

get = <bound method Door.get of <aenum 'Door'>>[source]
status_1 = '"DB_Safety_Circuit"."Türe 1"."si_HMI_status_door"'
status_2 = '"DB_Safety_Circuit"."Türe 2"."si_HMI_status_door"'
status_3 = '"DB_Safety_Circuit"."Türe 3"."si_HMI_status_door"'
class hvl_ccb.dev.supercube.constants.DoorStatus(*args, **kwds)[source]

Bases: aenum.IntEnum

Possible status values for doors.

closed = 2

Door is closed, but not locked.

error = 4

Door has an error or was opened in locked state (either with emergency stop or from the inside).

inactive = 0

not enabled in Supercube HMI setup, this door is not supervised.

locked = 3

Door is closed and locked (safe state).

open = 1

Door is open.

class hvl_ccb.dev.supercube.constants.EarthingStick(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for all earthing stick statuses (read-only integer) and writable booleans for setting the earthing in manual mode.

manual = <bound method EarthingStick.manual of <aenum 'EarthingStick'>>[source]
manual_1 = '"DB_Safety_Circuit"."Erdpeitsche 1"."sx_earthing_manually"'
manual_2 = '"DB_Safety_Circuit"."Erdpeitsche 2"."sx_earthing_manually"'
manual_3 = '"DB_Safety_Circuit"."Erdpeitsche 3"."sx_earthing_manually"'
manual_4 = '"DB_Safety_Circuit"."Erdpeitsche 4"."sx_earthing_manually"'
manual_5 = '"DB_Safety_Circuit"."Erdpeitsche 5"."sx_earthing_manually"'
manual_6 = '"DB_Safety_Circuit"."Erdpeitsche 6"."sx_earthing_manually"'
status = <bound method EarthingStick.status of <aenum 'EarthingStick'>>[source]
status_1 = '"DB_Safety_Circuit"."Erdpeitsche 1"."si_HMI_Status"'
status_2 = '"DB_Safety_Circuit"."Erdpeitsche 2"."si_HMI_Status"'
status_3 = '"DB_Safety_Circuit"."Erdpeitsche 3"."si_HMI_Status"'
status_4 = '"DB_Safety_Circuit"."Erdpeitsche 4"."si_HMI_Status"'
status_5 = '"DB_Safety_Circuit"."Erdpeitsche 5"."si_HMI_Status"'
status_6 = '"DB_Safety_Circuit"."Erdpeitsche 6"."si_HMI_Status"'
class hvl_ccb.dev.supercube.constants.EarthingStickStatus(*args, **kwds)[source]

Bases: aenum.IntEnum

Status of an earthing stick. These are the possible values in the status integer e.g. in EarthingStick.status_1.

closed = 1

Earthing is closed (safe).

error = 3

Earthing is in error, e.g. when the stick did not close correctly or could not open.

inactive = 0

Earthing stick is deselected and not enabled in safety circuit. To get out of this state, the earthing has to be enabled in the Supercube HMI setup.

open = 2

Earthing is open (not safe).

class hvl_ccb.dev.supercube.constants.Errors(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for information regarding error, warning and message handling.

message = '"DB_Meldepuffer"."Hinweis_aktiv"'

Boolean read-only variable telling if a message is active.

quit = '"DB_Meldepuffer"."Quittierbutton"'

Writable boolean for the error quit button.

stop = '"DB_Meldepuffer"."Stop_aktiv"'

Boolean read-only variable telling if a stop is active.

warning = '"DB_Meldepuffer"."Warnung_aktiv"'

Boolean read-only variable telling if a warning is active.

class hvl_ccb.dev.supercube.constants.GeneralSockets(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

NodeID strings for the power sockets (3x T13 and 1xCEE16).

cee16 = '"Qx_Allg_Socket_CEE16"'

CEE16 socket (writeable boolean).

t13_1 = '"Qx_Allg_Socket_T13_1"'

SEV T13 socket No. 1 (writable boolean).

t13_2 = '"Qx_Allg_Socket_T13_2"'

SEV T13 socket No. 2 (writable boolean).

t13_3 = '"Qx_Allg_Socket_T13_3"'

SEV T13 socket No. 3 (writable boolean).

class hvl_ccb.dev.supercube.constants.GeneralSupport(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

NodeID strings for the support inputs and outputs.

in_1_1 = '"Ix_Allg_Support1_1"'
in_1_2 = '"Ix_Allg_Support1_2"'
in_2_1 = '"Ix_Allg_Support2_1"'
in_2_2 = '"Ix_Allg_Support2_2"'
in_3_1 = '"Ix_Allg_Support3_1"'
in_3_2 = '"Ix_Allg_Support3_2"'
in_4_1 = '"Ix_Allg_Support4_1"'
in_4_2 = '"Ix_Allg_Support4_2"'
in_5_1 = '"Ix_Allg_Support5_1"'
in_5_2 = '"Ix_Allg_Support5_2"'
in_6_1 = '"Ix_Allg_Support6_1"'
in_6_2 = '"Ix_Allg_Support6_2"'
input = <bound method GeneralSupport.input of <aenum 'GeneralSupport'>>[source]
out_1_1 = '"Qx_Allg_Support1_1"'
out_1_2 = '"Qx_Allg_Support1_2"'
out_2_1 = '"Qx_Allg_Support2_1"'
out_2_2 = '"Qx_Allg_Support2_2"'
out_3_1 = '"Qx_Allg_Support3_1"'
out_3_2 = '"Qx_Allg_Support3_2"'
out_4_1 = '"Qx_Allg_Support4_1"'
out_4_2 = '"Qx_Allg_Support4_2"'
out_5_1 = '"Qx_Allg_Support5_1"'
out_5_2 = '"Qx_Allg_Support5_2"'
out_6_1 = '"Qx_Allg_Support6_1"'
out_6_2 = '"Qx_Allg_Support6_2"'
output = <bound method GeneralSupport.output of <aenum 'GeneralSupport'>>[source]
class hvl_ccb.dev.supercube.constants.MeasurementsDividerRatio(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for the measurement input scaling ratios. These ratios are defined in the Supercube HMI setup and are provided in the python module here to be able to read them out, allowing further calculations.

TODO: these variable nodeIDs are not tested and/or correct yet.

get = <bound method MeasurementsDividerRatio.get of <aenum 'MeasurementsDividerRatio'>>[source]
input_1 = 'Ir_Measure_DividerRatio_1'
input_2 = 'Ir_Measure_DividerRatio_2'
input_3 = 'Ir_Measure_DividerRatio_3'
input_4 = 'Ir_Measure_DividerRatio_4'
class hvl_ccb.dev.supercube.constants.MeasurementsScaledInput(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for the four analog BNC inputs for measuring voltage. The voltage returned in these variables is already scaled with the set ratio, which can be read using the variables in MeasurementsDividerRatio.

TODO: these variable NodeIDs are not tested and/or correct yet.

get = <bound method MeasurementsScaledInput.get of <aenum 'MeasurementsScaledInput'>>[source]
input_1 = 'Qr_Measure_Input1_scaledVoltage'
input_2 = 'Qr_Measure_Input2_scaledVoltage'
input_3 = 'Qr_Measure_Input3_scaledVoltage'
input_4 = 'Qr_Measure_Input4_scaledVoltage'
class hvl_ccb.dev.supercube.constants.OpcControl(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings for supervision of the OPC connection from the controlling workstation to the Supercube.

TODO: this variable nodeID string is not tested and/or correct yet.

active = 'Ix_OPC_active'

writable boolean to enable OPC remote control and display a message window on the Supercube HMI.

class hvl_ccb.dev.supercube.constants.Power(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

Variable NodeID strings concerning power data.

TODO: these variable NodeIDs are not tested and/or correct yet, they don’t exist
yet on Supercube side.
current_primary = 'Qr_Power_FU_actualCurrent'

Primary current in ampere, measured by the frequency converter. (read-only)

frequency = 'Ir_Power_FU_Frequency'

Frequency converter output frequency. (read-only)

setup = 'Qi_Power_Setup'

Power setup that is configured using the Supercube HMI. The value corresponds to the ones in PowerSetup. (read-only)

voltage_max = 'Iw_Power_maxVoltage'

Maximum voltage allowed by the current experimental setup. (read-only)

voltage_primary = 'Qr_Power_FU_actualVoltage'

Primary voltage in volts, measured by the frequency converter at its output. (read-only)

voltage_slope = 'Ir_Power_dUdt'

Voltage slope in V/s.

voltage_target = 'Ir_Power_TargetVoltage'

Target voltage setpoint in V.

class hvl_ccb.dev.supercube.constants.PowerSetup(*args, **kwds)[source]

Bases: aenum.IntEnum

Possible power setups corresponding to the value of variable Power.setup.

AC_DoubleStage_150kV = 4

AC voltage with two MWB transformers, one at 100kV and the other at 50kV, resulting in a total maximum voltage of 150kV.

AC_DoubleStage_200kV = 5

AC voltage with two MWB transformers both at 100kV, resulting in a total maximum voltage of 200kV

AC_SingleStage_100kV = 3

AC voltage with MWB transformer set to 100kV maximum voltage.

AC_SingleStage_50kV = 2

AC voltage with MWB transformer set to 50kV maximum voltage.

DC_DoubleStage_280kV = 8

DC voltage with two AC transformers set to 100kV AC each, resulting in 280kV DC in total (or a single stage transformer with Greinacher voltage doubling rectifier)

DC_SingleStage_140kV = 7

DC voltage with one AC transformer set to 100kV AC, resulting in 140kV DC

External = 1

External power supply fed through blue CEE32 input using isolation transformer and safety switches of the Supercube, or using an external safety switch attached to the Supercube Type B.

Internal = 6

Internal usage of the frequency converter, controlling to the primary voltage output of the supercube itself (no measurement transformer used)

NoPower = 0

No safety switches, use only safety components (doors, fence, earthing…) without any power.

class hvl_ccb.dev.supercube.constants.Safety(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

NodeID strings for the basic safety circuit status and green/red switches “ready” and “operate”.

status = '"DB_Safety_Circuit"."si_safe_status"'

Status is a read-only integer containing the state number of the supercube-internal state machine. The values correspond to numbers in SafetyStatus.

switchto_operate = '"DB_Safety_Circuit"."sx_safe_switchto_operate"'

Writable boolean for switching to Red Operate (locket, HV on) state.

switchto_ready = '"DB_Safety_Circuit"."sx_safe_switchto_ready"'

Writable boolean for switching to Red Ready (locked, HV off) state.

class hvl_ccb.dev.supercube.constants.SafetyStatus(*args, **kwds)[source]

Bases: aenum.IntEnum

Safety status values that are possible states returned from hvl_ccb.dev.supercube.base.Supercube.get_status(). These values correspond to the states of the Supercube’s safety circuit statemachine.

Error = 6

System is in error mode.

GreenNotReady = 1

System is safe, lamps are green and some safety elements are not in place such that it cannot be switched to red currently.

GreenReady = 2

System is safe and all safety elements are in place to be able to switch to ready.

Initializing = 0

System is initializing or booting.

QuickStop = 5

Fast turn off triggered and switched off the system. Reset FSO to go back to a normal state.

RedOperate = 4

System is locked in red state and in operate mode, i.e. high voltage on.

RedReady = 3

System is locked in red state and ready to go to operate mode.

class hvl_ccb.dev.supercube.constants.SupercubeOpcEndpoint(*args, **kwds)[source]

Bases: hvl_ccb.utils.enum.ValueEnum

OPC Server Endpoint strings for the supercube variants.

A = 'Supercube Typ A'
B = 'Supercube Typ B'

hvl_ccb.dev.supercube.typ_a module

Supercube Typ A module.

class hvl_ccb.dev.supercube.typ_a.SupercubeAOpcUaCommunication(config)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunication

static config_cls()[source]

Return the default configdataclass class.

Returns:a reference to the default configdataclass class
class hvl_ccb.dev.supercube.typ_a.SupercubeAOpcUaConfiguration(host: str, endpoint_name: str = 'Supercube Typ A', port: int = 4840, sub_handler: hvl_ccb.comm.opc.OpcUaSubHandler = <hvl_ccb.dev.supercube.base.SupercubeSubscriptionHandler object at 0x7f6a9d13a748>, update_period: int = 500)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunicationConfig

endpoint_name = 'Supercube Typ A'
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

Parameters:
  • fieldname – name of the field
  • value – value to assign
classmethod keys() → Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:a list of strings containing all keys.
classmethod optional_defaults() → Dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:a list of strings containing all optional keys.
classmethod required_keys() → Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:a list of strings containing all required keys.
class hvl_ccb.dev.supercube.typ_a.SupercubeWithFU(com, dev_config=None)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeBase

Variant A of the Supercube with frequency converter.

static default_com_cls()[source]

Get the class for the default communication protocol used with this device.

Returns:the type of the standard communication protocol for this device
fso_reset() → None[source]

TODO: test fso_reset with device

Reset the fast switch off circuitry to go back into normal state and allow to re-enable operate mode.

get_frequency() → float[source]

TODO: test get_frequency with device

Read the electrical frequency of the current Supercube setup.

Returns:the frequency in Hz
get_fso_active() → bool[source]

TODO: test get_fso_active with device

Get the state of the fast switch off functionality. Returns True if it is enabled, False otherwise.

Returns:state of the FSO functionality
get_max_voltage() → float[source]

TODO: test get_max_voltage with device

Reads the maximum voltage of the setup and returns in V.

Returns:the maximum voltage of the setup in V.
get_power_setup() → hvl_ccb.dev.supercube.constants.PowerSetup[source]

TODO: test get_power_setup with device

Return the power setup selected in the Supercube’s settings.

Returns:the power setup
get_primary_current() → float[source]

TODO: get_primary_current with device

Read the current primary current at the output of the frequency converter ( before transformer).

Returns:primary current in A
get_primary_voltage() → float[source]

TODO: test get_primary_voltage with device

Read the current primary voltage at the output of the frequency converter ( before transformer).

Returns:primary voltage in V
get_target_voltage() → float[source]

TODO: test get_target_voltage with device

Gets the current setpoint of the output voltage value in V. This is not a measured value but is the corresponding function to set_target_voltage().

Returns:the setpoint voltage in V.
set_slope(slope: float) → None[source]

TODO: test set_slope with device

Sets the dV/dt slope of the Supercube frequency converter to a new value in V/s.

Parameters:slope – voltage slope in V/s (0..15)
set_target_voltage(volt_v: float) → None[source]

TODO: test set_target_voltage with device

Set the output voltage to a defined value in V.

Parameters:volt_v – the desired voltage in V

hvl_ccb.dev.supercube.typ_b module

Supercube Typ B module.

class hvl_ccb.dev.supercube.typ_b.SupercubeB(com, dev_config=None)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeBase

Variant B of the Supercube without frequency converter but external safety switches.

static default_com_cls()[source]

Get the class for the default communication protocol used with this device.

Returns:the type of the standard communication protocol for this device
class hvl_ccb.dev.supercube.typ_b.SupercubeBOpcUaCommunication(config)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunication

static config_cls()[source]

Return the default configdataclass class.

Returns:a reference to the default configdataclass class
class hvl_ccb.dev.supercube.typ_b.SupercubeBOpcUaConfiguration(host: str, endpoint_name: str = 'Supercube Typ B', port: int = 4840, sub_handler: hvl_ccb.comm.opc.OpcUaSubHandler = <hvl_ccb.dev.supercube.base.SupercubeSubscriptionHandler object at 0x7f6a9d13a748>, update_period: int = 500)[source]

Bases: hvl_ccb.dev.supercube.base.SupercubeOpcUaCommunicationConfig

endpoint_name = 'Supercube Typ B'
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

Parameters:
  • fieldname – name of the field
  • value – value to assign
classmethod keys() → Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:a list of strings containing all keys.
classmethod optional_defaults() → Dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:a list of strings containing all optional keys.
classmethod required_keys() → Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:a list of strings containing all required keys.

Module contents

Supercube package with implementation for system versions from 2019 on (new concept with hard-PLC Siemens S7-1500 as CPU).