Function DoSteppedEvent (ByVal nDevHnd&, ByRef vdFltOpt() as Double, _
ByRef vnOpt() As Long, ByVal nTiers as Long ) As Long
Purpose: Simulate one or more faults.
Works in: OneLiner only.
Parameters:
nDevHnd [in] handle of a bus or a relay group.
vdFltOpt
[in] fault simulation options
vdFltOpt (1) – Fault
connection
code
1=3LG
2=2LG_BC,3=2LG_CA,4=2LG_AB
5=1LG_A,6=1LG_B,7=1LG_C
8=LL_BC,9=LL_CA,10=LL_AB
vdFltOpt (2) – Intermediate percent between 0.01-99.99. 0 for a close-in fault. This parameter is ignored if nDevHnd is a bus handle.
vdFltOpt (3) – Fault resistance, ohm
vdFltOpt (4) – Fault reactance, ohm
vdFltOpt (4+1) – Zero or Fault connection code for additional user event
vdFltOpt (4+2) – Time of additional user event, seconds.
vdFltOpt (4+3) – Fault resistance in additional user event, ohm
vdFltOpt (4+4) – Fault reactance in additional user event, ohm
vdFltOpt (4+5) – Zero or Fault connection code for additional user event
…
vnOpt
[in] Study options flags. 1 – set; 0 - reset
vnOpt (1) -
Consider OCGnd operations
vnOpt (2) -
Consider OCPh operations
vnOpt (3) -
Consider DSGnd operations
vnOpt (4) -
Consider DSPh operations
vnOpt (5) -
Consider Protection scheme operations
nTiers [in] Study extent
Return value:
1 success
0 failure
Remarks: After successful completin of DoSteppedEvent()you must call function GetSteppedEvent() to retrieve detailed result of each step in the simulation.
Example:
vdFltOpt(1) = 5 '1LG phase A
vdFltOpt(2) = 10 'Intermediate percent between 0.01-99.99
vdFltOpt(3) = 0 'Fault resistance
vdFltOpt(4) = 0 'Fault reactance
vdFltOpt(5) = 0 'Zero or nFltconn of additional event
vnDevOpt(1) = 1 'Consider OCGnd
vnDevOpt(2) = 1 'Consider OCPh
vnDevOpt(3) = 1 'Consider DSGnd
vnDevOpt(4) = 1 'Consider DSPh
nTiers& = 5
If 0 = DoSteppedEvent( nBusHnd, vdFltOpt, vnDevOpt, nTiers ) Then GoTo HasError
' Call GetSteppedEvent with 0 to get total number of events simulated
nSteps = GetSteppedEvent( 0, dTime#, dCurrent#, nUserEvwent&, sEventDesc$, sFaultDest$ )
Print "Stepped-event simulation completed successfully with ", nSteps-1, " events"
For ii = 1 to nSteps
Call GetSteppedEvent( ii, dTime#, dCurrent#, nUserEvwent&, sEventDesc$, sFaultDest$ )
Print "Fault: ", sFaultDest$
Print sEventDesc$
Print "Time = ", dTime, " Current= ", dCurrent
Next
Stop
HasError:
Print "Error: ", ErrorString( )
Stop