Tekvel Magic
|
GOOSESubscriber class for monitoring GOOSE messages. More...
Public Member Functions | |
def | __init__ (self, SCL scl=None, str ied_name=None, nif_id=None, str cb_ref=None, str da_ref=None, bool autostart=True, Subnetwork sn=None) |
Initialize a GOOSESubscriber instance. More... | |
def | __str__ (self) |
def | get_gocb_ref (self) |
Returns a reference to the GOOSE Control Block associated with this GOOSESubscriber. More... | |
def | gocbref (self) |
Returns a reference to the GOOSE Control Block associated with this GOOSESubscriber. More... | |
Subnetwork | sn (self) |
Returns the associated Subnetwork instance. More... | |
def | get_ied_name (self) |
Returns IED name of the GOOSE publishing IED. More... | |
def | get_ap_name (self) |
Returns AccessPoint name of the GOOSE publishing IED. More... | |
def | wait_for_goose (self, int timeout=10000) |
Wait for first GOOSE message. More... | |
def | wait_for_goose_change (self, int timeout=1000) |
Wait for GOOSE change. More... | |
def | wait_for_signal_change (self, int timeout=5000) |
Wait for specific signal change in the GOOSE. More... | |
def | wait_for_signal_value (self, value, str valType="BOOLEAN", int timeout=5000) |
Wait for a specific value of a signal in the GOOSE. More... | |
def | destroy (self) |
Destroys GOOSE subscriber. More... | |
GOOSESubscriber class for monitoring GOOSE messages.
The GOOSESubscriber class allows subscribing to GOOSE messages to trigger actions based on received GOOSE messages. It supports selecting specific data attributes within GOOSE messages or monitoring the entire message. The class utilizes an SCL file to identify and connect to the appropriate IED and GOOSE control block.
When a specific Subnetwork is not provided, a new instance will be created. This class ensures that only one subscriber can be set up for each GOOSE control block reference to avoid conflicts. The subscription is configured using the GOOSE control block references, which can be manually selected or provided directly. Network interface connections can also be managed via the Subnetwork parameter.
def __init__ | ( | self, | |
SCL | scl = None , |
||
str | ied_name = None , |
||
nif_id = None , |
|||
str | cb_ref = None , |
||
str | da_ref = None , |
||
bool | autostart = True , |
||
Subnetwork | sn = None |
||
) |
Initialize a GOOSESubscriber instance.
This constructor sets up a GOOSESubscriber instance by connecting it to an IED and GOOSE control block defined in the provided SCL file. The user can either pass specific parameters or let the class prompt for selections. The setup includes selecting the IED, verifying GOOSE control blocks, and configuring network interfaces.
If multiple IEDs are present in the SCL file and the ied_name
is not provided, the user will be prompted to select one. Similarly, if no specific GOOSE control block reference (cb_ref
) is passed, a selection list will be presented. The class ensures only valid configurations proceed, raising exceptions if issues arise during the setup.
The network interface can be specified via the sn
parameter, an instance of Subnetwork, or a new instance will be created automatically if not provided.
scl | The SCL file object used for configuration. |
ied_name | Name of the IED to connect to. |
xrefitem deprecated 2.
cb_ref | Control block reference for the GOOSE message. |
da_ref | Specific data attribute reference to monitor within the GOOSE message. |
autostart | Boolean flag to automatically start the subscriber after setup. Default is True. |
sn | Subnetwork instance to specify network connection. |
Exception | Raised when configuration issues prevent successful initialization. |
def __str__ | ( | self | ) |
def destroy | ( | self | ) |
Destroys GOOSE subscriber.
def get_ap_name | ( | self | ) |
Returns AccessPoint name of the GOOSE publishing IED.
def get_gocb_ref | ( | self | ) |
Returns a reference to the GOOSE Control Block associated with this GOOSESubscriber.
def get_ied_name | ( | self | ) |
Returns IED name of the GOOSE publishing IED.
def gocbref | ( | self | ) |
Returns a reference to the GOOSE Control Block associated with this GOOSESubscriber.
Subnetwork sn | ( | self | ) |
Returns the associated Subnetwork instance.
This property returns the Subnetwork instance that the GOOSESubscriber is connected to. If the Subnetwork was not provided during initialization, a default instance would have been created.
def wait_for_goose | ( | self, | |
int | timeout = 10000 |
||
) |
Wait for first GOOSE message.
This method allows to pause the scenario until the first goose message has been recieved by the GOOSESubscriber instance.
timeout | GOOSE wait timeout in ms. The function throws an Exception if timeout has expired and no GOOSE message has been recieved. |
def wait_for_goose_change | ( | self, | |
int | timeout = 1000 |
||
) |
Wait for GOOSE change.
Pause script execution until data changes in the subscribed GOOSE message or timeout event occurs.
timeout | GOOSE change wait timeout in ms. The function throws an Exception if timeout has expired and no data changed in the GOOSE message. |
def wait_for_signal_change | ( | self, | |
int | timeout = 5000 |
||
) |
Wait for specific signal change in the GOOSE.
Pause script execution until data changes in the specified signal of the specified GOOSE message or timeout event occurs.
timeout | GOOSE change wait timeout in ms. The function throws an Exception if timeout has expired and no data changed in the GOOSE message. |
def wait_for_signal_value | ( | self, | |
value, | |||
str | valType = "BOOLEAN" , |
||
int | timeout = 5000 |
||
) |
Wait for a specific value of a signal in the GOOSE.
Pause script execution until the specified FCDA reaches specified value or timeout event occurs.
value | The expected value of the specified signal. |
valType | The Type of the signal. Selected from the following list: [‘BOOLEAN’, ‘INT8’, ‘INT16’, ‘INT32’, ‘INT64’, ‘INT8U’, ‘INT16U’, ‘INT24U’, ‘INT32U’, ‘FLOAT32’, ‘FLOAT64’, ‘VisString32’, ‘VisString64’, ‘VisString65’, ‘VisString128’, ‘VisString255’, ‘Dbpos’] |
timeout | GOOSE change wait timeout in ms. The function throws an Exception if timeout has expired and no data changed in the GOOSE message. |