Function DoVSEx (ByVal nDevHnd&, ByRef vnFltConn() As Long, _
ByRef vdFltOpt() as Double, ByRef sCSVFileName$ ) As Long
Purpose: Run voltage sag analysis with option for computation of fault duration using stepp-event analysis
Works in: OneLiner only.
Parameters:
nDevHnd [in] handle of the monitored bus.
vnFltConn
[in] fault connection flags. 1 – set; 0 - reset
vnFltConn(1) – 3PH
vnFltConn(2)
– 2LG
vnFltConn(3) – 1LG
vnFltConn(4)
– LL
vdFltOpt
[in] study parameters
vdFltOpt(1) -
Sag threshold
vdFltOpt(2) -
Line percent divided by 100 (Set to zero for no intermediate faults)
vdFltOpt(3) -
Output All Buses flag (1- set; 0-reset)
vdFltOpt(4) -
Fault impedance - reactance
vdFltOpt(5) -
Fault impedance – resistance
vdFltOpt(6) - 1.0 to compute fault duration using stepped-event analys. 0 otherwise.
vdFltOpt(7) - Study extent for stepped-event analysis, in tiers. Must >= 2.
sCSVFileName [in] CSV output file name
Return value:
1 success
0 failure
Remarks: .
Example:
Dim vdOption(7) As Double, vdMag(4) As Double
Dim vnFltConn(4) As Long
' Output file
CSVFile$ = "c:\0tmp\vs.csv"
' Get picked bus handle
If GetEquipment( TC_PICKED, nBusHnd& ) = 0 Then
Print "Must select a bus"
Exit Sub
End If
vnFltConn(1) = 1 '1LG
vnFltConn(2) = 0 '2LG
vnFltConn(3) = 0 '3PH
vnFltConn(4) = 0 'LL
vdOption(1) = 0.6 'Sag threshold
vdOption(2) = 0.0 'Line percent
vdOption(3) = 1 'Ouput all
vdOption(4) = 0.0 'Zground.imag
vdOption(5) = 0.0 'Zground.real
vdOption(6) = 1.0 'Turn on stepped-event analysis
vdOption(7) = 5.0 'Study extent of 5 tiers from faulted bus.
If 0 = DoVSEx( nBusHnd, vnFltConn, vdOption, CSVFile ) Then GoTo HasError
Print "Voltage sag simulation complete. Output is in " + CSVFile