Function DoVS

 

Function DoVS (ByVal nDevHnd&, ByRef vnFltConn() As Long, _

       ByRef vdFltOpt() as Double, ByRef sCSVFileName$ ) As Long

Purpose: Run voltage sag 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

sCSVFileName [in] CSV output file name

Return value:

1               success

0               failure

Remarks: .

Example:

 

  Dim vdOption(5) 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

  If 0 = DoVS( nBusHnd, vnFltConn, vdOption, CSVFile ) Then GoTo HasError

  Print "Voltage sag simulation complete. Output is in " + CSVFile