Function DoBreakerRating

 

Function DoBreakerRating( ByRef vnScope() As Long, _

           ByVal dRatingThreshold as Double, ByVal dOutputOpt as Double, _

           ByVal nOptionalReportFlag as Long, _

           ByRef sReportTXT$, ByRef sReportCSV$, ByRef sConfigFile$ ) As Long

Purpose: Run breaker rating study.

Works in:      OneLiner only.

Parameters:     

vnScope       [in] Study scope
vnScope[1] – Breaker rating standard: 0-ANSI/IEEE; 1-IEC.
vnScope[2] – Bus selection: 0-All buses; 1-in Area; 2-in Zone; 3- selected buses
vnScope[3] – Selected area or zone number.
vnScope[4] or list of handle number of selected buses. The last element in the list
…             must be -1.

dRatingThreshold [in] Percent rating threshold.

dOutputOpt  [in] Rating output option: 0- Output only overduty cases; 1- Output all cases;
OR Floating number S (0 < S < 1) - Check only breakers at buses where ratio “Bus fault current / Breaker rating” exceeds S.

OptionalReportFlag  [in] Integer number flag. Enable various bits to enable optional sections in rating report: Bit 1- Detailed fault simulation result; Bit 2- Breaker name plate data; Bit 3- List of connected equipment.

sReportTXT  [in] Full path name of text report file. Set to emty to omit text report.

sReportCSV  [in] Full path name of CSV report file. Set to emty to omit CSV report.

sConfigFile [in] Full path name of  breaker rating configuration file to apply in this study. Set to emty to omit reading configuration file.

Return value:

1               success

0               failure

Example:

 

Sub Main

 dim vnScope(5) As long

 sWorkDir$ = "e:\data\PowerScriptDoBreakerRating\"

 sOLRFile$ =  sWorkDir & "SAMPLE30_noBreaker.olr"

 sChangeFile$ = sWorkDir & "breaker1.CHF"

 sConfigFile$ = sWorkDir & "checkoption1.OSF"

 If 0 = LoadDataFile( sOLRFile$ ) Then

  Print "Error: LoadDataFile"

  Stop

 End If

 If 1000 <= ReadChangeFile( sChangeFile, 1 ) Then

  Print "Error: ReadChangeFile"

  Stop

 End If

 vnScope(1) = 0

 dThreshold# = 80

 nOptionalReport& = 1 + 2 + 4

 dOutputOpt# = 1

 sReportTXT$ = sWorkDir & "rating" & ".txt"

 sReportCSV$ = sWorkDir & "rating" & ".csv"

 If 0 = DoBreakerRating(vnScope, dThreshold, dOutputOpt, nOptionalReport, _

               sReportTXT$, sReportCSV$, sConfigFile ) Then

  Print "Error: " & testNo$ & "-DoBreakerRating"

End If

End Sub