Function BoundaryEquivalent( ByRef sEquFileName$, ByRef vnBusList() as Long,
ByRef vdFltOpt() as Double ) As Long\
Purpose: Run voltage sag analysis
Works in: OneLiner only.
Parameters:
sEquFileName [in] Path name of equivalent OLR file.
vnBusList [in] Array of handles of buses to be retained in the equivalent. The list is terminated with value -1
vdFltOpt
[in] study parameters
vdFltOpt(1) -
Per-unit elimination threshold
vdFltOpt(2) -
Keep existing equipment at retained buses( 1- set; 0- reset)
vdFltOpt(3) -
Keep all existing annotations (1- set; 0-reset)
Return value:
1 success
0 failure
Remarks: .
Example:
Sub main
dim BusList(40) As long
dim Options(5) As double
OLRFile$ = "c:\TestData\PowerScript\Sample30.olr"
EqOLRFile$ = " c:\TestData\PowerScript\Equivalent.olr"
If 0 = LoadDataFile( OLRFile$ ) Then
Print "Error opening OLR file"
Stop
End If
nBusHnd& = 0
nCount = 0
While NextBusByName( nBusHnd& ) > 0
Call GetData( nBusHnd&, BUS_dKVnorminal, dVal1# )
If dVal1# > 100 Then
nCount = nCount + 1
BusList(nCount) = nBusHnd
End If
Wend
BusList(nCount+1) = -1
Options(1) = 99
Options(2) = 1
Options(3) = 0
If BoundaryEquivalent( EqOLRFile, BusList, Options ) Then
Print "OK"
Else
Print "Not OK"
End If
End Sub