CLASSES AND PROCEDURES
Class SAIDI_SAIFI
This class was implemented using scripts, SS_SaidiSaifi to contain all the necessary procedures for the ease of calculation of SAIDI and SAIFI. Its function is to obtain the occurrences of opening and de-energization, calculate the indicators for the feeders and calculate the indicators for the defined regions.
It also implements methods for maintaining a Feeders table and occurrences table.
In fact, there is a class implemented within the action.NET libraries, in SPIN. ActionNet.Biz.Electric.DLL, with the name of SaidiSaifi, which implements the calculation and maintenance details of the tables.
Initialize Method
It is a public method of the SS_SaidiSaifi, implemented in Scripts in the project.
It is the first method to be called: initializes the static class and creates the dynamic class in the action.NET.
UpdateFeeders Method
It is a public method whose function is to create and popular the FEEDERS table.
Gets the list of tags in the Objects table and chooses the ones that have the attribute Category including the category FEEDERS. It then generates the table with the fields: Level, Feeder Name and Number of Consumers. In this initial generation all feeders are included with an initial default value defined in the class constants.
After initial creation you can change the table by using the Feeders screen. (See below)
Método Daily_saving_occurrencies
This method is used to search the Alarms by records of occurrences of energizing normalizations, and record them in the table Occurrencies created to store these occurrences.
The method assumes that it will run daily between 00:00 and 1:00 a.m. (AM).
It then gets the date of the previous day, just finished.
Searches all tagged-like records BAYSTATE, with category FEEDER, with date from the previous day, and attribute DURATION than a predefined interval and value 1 (Normalized).
BAYSTATE members must be placed in this category, FEEDER.
The parameter for duration is the minimum opening time, in seconds, for the occurrence to be considered in the SAIDI and SAIFI calculations. Look at the BA_SAIDI_SAIFI. PARAMS (MinTimeOccurency).
These constants are in the template BA_SAIDI_SAIFI in the Objects table.
The records thus obtained in the table Alarms are used to create the case records to be written to the table Occurencies.
During this recording, some new fields are created:
Planned- Created with value indicating the reason for the occurrence, to be used in the choice of the totalizer indicator of SAIDI and SAIFI. The method looks for occurrences of the protection or indication of NO VOLT, close to the moment of interruption and infers the reason according to what was found.
0 = Occorre oactuaof protection in the feeder
1 = Considered a planned occurrence, because no sign of trip or lack of tension was found.
2= Protection or NO-VOLT actuation was detected in a bay other than a feeder in this substation.
TripOnFeeder - It was detected occurrence of protection action (trip) near the moment of occurrence, in the feeder itself that had its supply interrupted.
Consumers - Created with attribute value consumers feeder in the FEEDERS table.
Comments – If the occurrence is considered planned, or trip in the feeder itself is left empty. If trip or no volt occurs in another bay, other than the feeder itself is indicated whether it was Trip or No volt and the bay name. It can be changed by the operator to place some text with reason for the occurrence.
The format of this table, created automatically on the first run, is as follows:
GetOccurencies method
Method used to obtain a set of existing occurrences in the table Occurencies, dated in a certain range of days. It is used on the SAIDI and SAIFI control screen to show the occurrences of a given period.
public DataTable GetOccurencies(string startDay, string endDay);
The result is a DataTable.
The range of days is defined by the parameters:
startDay and endDay , which are strings in the format 'yyyy-mm-dd', already involved with single quotes.
Ex: '2019-11-29'
CalculateFeeders Method
Method used to perform the SAIDI and SAIFI calculation of feeders, substations, and regions in which they are during a range of past dates. The date range is used for the selection of occurrences in the table Occurencies, mentioned above.
The method traverses the table records during the defined interval and calculates the SAIDI and SAIFI of each feeder that has experienced at least one occurrence in the analyzed period.
The calculation is separated into three indicators, according to the reason determined for the occurrence: Planned, by protection in the feeder or by occurrence in bay supply to the upstream of the feeder.
For each calculated value it sends records to a report and also creates objects with the data for each calculation in the period.
After this calculation, using the list of all existing feeders (Feeders table) and their location in substations, cities, etc. makes the calculation of SAIDI and SAIFI, in the same period for these levels according to the assignment of feeders to these regions.
All results are placed in the generated report, and also in the tags for indicators, defined in the SDFS templates, so that they are stored in historical measurement tables.
public void CalculateFeeders(string period, string startDay, string endDay)
The result is a file with report in notepad.exe with the file name SAIDI_<startDay>.dat.
The input parameters are:
period – string with report type: "Daily", "Weekly" or "Monthly";
startDay and endDay - The range of days that are strings in the format 'yyyy-mm-dd', already involved with single quotes.
Ex: '2019-11-29'
Class SS_CalcManager
This server domain class was implemented with the responsibility of calling the SaidiSaifiIntervalCalculation class from the SPIN library. ActionNet.Biz.Electric.dll.
The SaidiSaifiIntervalCalculation class contains the CalculateIntervalWeightedAverage(eIntervalPeriod period) method, which is responsible for searching history tables for a given period, calculating the weighted average for all tags, and saving the result in period-specific tags and tables.
CalculateLastWeek SaidiSaifiAverage Method
Calls the calculation method for the previous week. By default, the search fetches values from Sunday to Saturday of the previous week.
CalculateLastMonth SaidiSaifiAverage Method
Calls the calculation method for the previous month.
CalculateLastQuarterSaidiSaifiAverage Method
Calls the calculation method for the previous quarter.
CalculateLastYear SaidiSaifiAverage Method
Calls the calculation method for the previous year.
Class SS_SaveManager
This server domain class has been implemented to verify that the current date matches the calculation period conditions and saves the weighted average from daily SAIDI and SAIFI values.
VerifyPeriod Method
This method is responsible for verifying that the current date corresponds to one of the following conditions for calculating the weighted averages of the daily SAIDI and SAIFI values:
If the current date corresponds to a Sunday day, calculates the weighted average and saves the results for the previous week;
If the current date corresponds to the first day of the month, calculates the weighted average and saves the results for the previous month;
If the current date corresponds to the first day of the quarter, calculates the weighted average and saves the results for the previous quarter;
If the current date corresponds to the first day of the year, calculates the weighted average and saves the results for the previous year;
SS_AverageCalculationTask
This server domain task, was developed only to call the VerifyPeriod method of the SS_SaveManager every twelve hours.
SPIN class. ActionNet.Biz.Electric.SaidiSaifiIntervalCalculation
This class, implemented in the SPIN library. ActionNet.Biz.Electric.dll, is responsible for searching the daily SAIDI and SAIFI tags in the history tables for a given period, calculating weighted averages, and saving the results in the appropriate tables for the period in question.
Note that the weighted average calculation uses the tags created in the template SDSF_CALC.
These tags are described below:
NAME | DESCRIPTION |
DI_DAY | SAIDI tag saves daily |
FI_DAY | SAIFI tag saves daily |
CONS_DAY | Consumer Tag Saves Daily |
DI_WEEK | SAIDI weekly weighted average |
FI_WEEK | SAIFI weekly weighted average |
DI_MON | SAIDI monthly weighted average |
FI_MON | SAIFI monthly weighted average |
DI_QUA | Quarterly weighted average of the SAIDI |
FI_QUA | SAIFI quarterly weighted average |
DI_YEA | SAIDI annual weighted average |
FI_YEA | SAIFI annual weighted average |
CalculateIntervalWeightedAverage Method
This method is responsible for searching the daily SAIDI SAIFI tags in the history tables for a given period, calculating weighted averages, and saving the results in the appropriate tables for the period in question. The method receives a single argument, the period to be searched.
The period can contain the following values:
Value | Description |
None | This is the default value. If this value is passed, the method is executed, but no calculation is performed or saved. |
LastWeek | The search data method for the previous week |
Week | The method searches data for the current week |
LastMonth | The method searches data for the previous month |
Month | The method searches data for the current month |
LastQuarter | The search data method for the previous quarter |
Quarter | The method searches data for the current quarter |
LastYear | The search data method for the previous year |
Year | The search data method for the current year |
After searching the history data, an internal method uses the search results to calculate the weighted average for the period. After calculation, another internal method receives the values and saves them.
Saving the values consists of using the tags
Tag.BA_SAIDI_SAIFI.TriggerSaveHistorian_WEEK,
Tag.BA_SAIDI_SAIFI.TriggerSaveHistorian_MON,
Tag.BA_SAIDI_SAIFI.TriggerSaveHistorian_QUA e
Tag.BA_SAIDI_SAIFI.TriggerSaveHistorian_YEA
as triggers of the corresponding history tables by period and performing a value toggle in these tags after the result of the calculations is passed to the corresponding period tags.
E.g.: Running the CalculateIntervalWeightedAverage (eIntervalPeriod.LastQuarter) method would cause it to search all DI_DAY, FI_DAY, and CONS_DAY tags for the quarter period prior to the current period. After the search, the calculation of weighted averages is performed and the results are passed to all tags DI_QUA and FI_QUA associated with the search. Finally, the tag toggle would be Tag.BA_SAIDI_SAIFI. TriggerSaveHistorian_QUA that would trigger the save trigger for all history tables whose trigger property is associated with this tag.
Â
On this page: