<< Click to Display Table of Contents >>
Gateway Configuration |
In gateway applications, where it's necessary to send data from this 61850 driver to other protocols (like DNP 3.0 or IEC 104), it is possible to find situations of event loss or duplication, especially at application startup or gateway switch-over (hot standby).
This may happen when an event is received by 61850 driver and forwarded, but it not received yet by a remote master in another protocol. Example:
Aba Reports
The image above show events being transferred and pending of transmission in several gateway components (61850 Server, 61850 Client, DNP Slave and DNP Master). This event queue size can change depending on the protocol driver configuration and network architecture, between other factors.
When a switch-over from Gateway A to Gateway B happens, for example, the pending events can be lost or duplicated, depending on the application configuration. This behavior can be controlled by programming the EntryID field of the 61850 buffered reports. The EntryID is a unique identifier for each report message sent.
This driver already has a feature to generate files with the last BRCB EntryID, which is used to enable the reports at driver startup. However, these EntryID´s are updated based on the moment the report messages are received by 61850 Client driver, and not by the real reception of the event in an external system, i.e. in the example above the Control Center.
When enabling the Gateway feature by the option "Wait for Gtw Ref on Startup", the driver will wait for E3 application to inform a string text which represents each 61850 tag inside another driver (ex: DNP or IEC 104 Slave). When this other driver receives the confirmation the event was delivered to Control Center, it can inform back 61850 driver about this event, so it's possible to position EntryID values forward and save the EntryID File. If a new swtichover happens, the driver will enable the reports starting from this point - avoiding the event loss or repetition.
EntryID Management
The steps to configure this resource are the following:
1 - Enable the options "Check BRCB Entry ID", "R/W Entry ID File (.EID)", "Wait for Gtw Ref on Startup". Further, if the IED uses the same reports for both gateways, you should evaluate using a fixed report list - "User Defined Report List", avoiding the redundant application to enable unexpected reports.
2 - At 61850 driver, create the tag "FinishedGtwRef", and the blocks "GatewayRef" and "GatewayEventOK" as below. These 3 tags are described at the topic Referência de Tags - Tags Internos.
3 - Taking DNP Slave driver as example, a block with N2=-22 shall be created. It receives at the OnRead script a list with master confirmed events. Please consult DNP Slave driver documentation for more details.
4 - DNP Slave tags shall receive links from 61850 tags. At the image below we have an example where tag AI_0 (DNP object 32 variation 05 index 0) is receiving a link from a phase A current from 61850 IED.
5 - Upon startup, the application shall initialize the external references, passing a string text which represents the DNP Address for each 61850 tag which needs the EntryID management. This write operation, however, can only be performed from the moment the driver has the Logical Devices created, otherwise the write will fail. To solve this problem, the exemple below shows an internal tag script which tries to send the configuration every 5 seconds. If the operation is successful, the event is not fired anymore. At the process end, the tag "FinishedGtwRef" is written.
Also in this example, the reference string is obtained through the union of DNP object/variation and the index. At the DNP Slave driver these values are available at N3 and N4 parameters.
Initial Value of the tag InitGateway: TRUE (Boolean)
Event WhileNotOK: Expression: Value - Repeat event every 5000 ms
Sub InitGateway_WhileNotOK()
Set DNPSlave = Application.GetObject("DNPSlave")
Set Ref = Application.GetObject("IEC61850").Item("GatewayRef")
bFirst = FALSE
for each tag in DNPSlave
if TypeName(tag) = "IOTag" Then
if tag.N2 = 1 Then
Source = tag.Links.Item("Value").Source
Set s = Application.GetObject(Source)
arr = Split(s.ParamDevice,":")
Ref.Item("IEDName").Value = arr(0)
Ref.Item("LDName").Value = arr(1)
Ref.Item("Object").Value = s.ParamItem
Ref.Item("Ref").Value = CStr(tag.N3) + ";" + CStr(tag.N4)
if NOT bFirst Then
bFirst = Ref.Write(1) 'sync
if NOT bFirst Then Exit Sub
Else
Ref.Write 2 'async unconfirmed
End If
End If
End If
Next
res = Application.GetObject("IEC61850").Item("FinishedGtwRef").WriteEx(2) 'async unconfirmed
if res Then Value = FALSE
End Sub
6 - When "EventOK" Block is read at DNP Slave driver, it means a new event was received and confirmed by DNP Master. The script below gets the event information and forwards to 61850 driver. At the DNP Slave specific case, this block returns object and variation, index, class, value, valid timestamp and timestamp. The script sends all these parameters to 61850 (except DNP class, which is not relevant) using the block GatewayEventOK.
Sub EventOK_OnRead()
Set IECBlock = Application.GetObject("IEC61850.GatewayEventOK")
IECBlock.Item("Ref").Value = CStr(Item("ObjVar").Value) + ";" + CStr(Item("Index").Value)
IECBlock.Item("Value").Value = Item("Value").Value
IECBlock.Item("TSValid").Value = Item("TSValid").Value
IECBlock.Item("Time").Value = Item("Time").Value
IECBlock.Write 2 'async
End Sub
7 - At this moment the driver will position the EntryIDs at the next pending event. To synchronize the EntryIDs with the redundant computer, it is necessary to follow the steps indicated at the section Redundancy - Using EID Files.
8 - To position the EntryID´s, the driver uses the following algorithm:
- When a new 61850 report is received, it checks if any dataset object with a gateway reference has changed quality or value. If positive, a new event is added to an internal individual list per 61850 object.
- When an event is confirmed by external driver and informed at the block "GatewayEventOK", the internal list is compared with the informed event:
- If timestamp is not valid (DNP/IEC104 Slave tag is not using timestamp), all events are removed from the list;
- If timestamp is valid, all events are removed if they are equal or happened before the informed event.
In order to avoid unnecessary processing, it is recommended to only add gateway references to tags that can´t have event loss or duplication, typically digital and simple/double state tags. It is also recommended in this case, to separate report Datasets by tag types. By configuring digital and analog tags in different datasets, you can avoid receiving useless old analog values if the digital reports have to roll back in time.