Function GetRelayTime( ByVal nHandle&, ByVal dFactor#, ByRef dTime$ ) As Long
Purpose: Computes operating time for a fuse, an overcurrent relay (phase or ground), or a distance relay (phase or ground).
Works in: OneLiner only.
Parameters:
nHandle [in] Handle of OC relay, DS relay, Recloser or Fuse
dFactor [in] relay current multiplying factor
dTime [out] relay operating time in seconds
Return value:
1 success
0 failure
Remarks: All calls to this
function must be preceded by a call to ShowFault or PickFault function.
Relay current multiplying factor will be applied to relay current result
from simulation before time calculation.
Example:
' Show the fault
If ShowFault( 1, 3, 7, 0, vnShowRelay ) = 0 Then GoTo HasError
' Loop through all relays and find their operating times
nRelayCount& = 0
nRelayHnd& = 0
While GetRelay( nPickedHnd, nRelayHnd& ) > 0
nRelayCount = nRelayCount + 1
nType = EquipmentType( nRelayHnd )
If nType = TC_RLYOCG Then nParamID& = OG_sID
If nType = TC_RLYOCP Then nParamID& = OP_sID
If nType = TC_RLYDSG Then nParamID& = DG_sID
If nType = TC_RLYDSP Then nParamID& = DP_sID
If nType = TC_FUSE Then nParamID& = FS_sID
If GetData( nRelayHnd, nParamID, sID$ ) = 0 Then GoTo HasError
If GetRelayTime( nRelayHnd, 1.0, dTime# ) = 0 Then GoTo HasError
Print "Relay " & sID & ": "; Format( dTime, "#0.#0s" )
Wend
Print "Relays in this group = "; nRelayCount
Stop
' Error handling
HasError:
Print "Error: ", ErrorString( )
Stop