Function GetPSCVoltage

 

Function GetPSCVoltage( ByVal hHandle&, ByRef vdOut1() as double, _

       ByRef vdOut2() as double, ByVal nStyle& ) As Long

Purpose: Retrieve pre-fault voltage of a bus, or of connected buses of a line, transformer, switch or phase shifter.

Works in:      OneLiner only.

Parameters:     

nHandle       [in] data object handle

vdOut1      [out] voltage magnitude

vdOut2      [out] voltage angle in degree

nStyle      [in] result style
=1: output voltage in kV
=2: output voltage in per-unit

Return value:

1               success

0               failure

Remarks: The size of arrays vdOut1 and vdOut2 must be at least 3. For equipment that is connected to more than one bus, the voltage result is stored in the following order:
- vdOut1(1), vnOut2(1):  Voltage at equipment’s Bus1
- vdOut1(2), vnOut2(2):  Voltage at equipment’s Bus2
- vdOut1(3), vnOut2(3):  Voltage at equipment’s Bus3

 

Example:

 

   Dim MagArray(3) As Double, AngArray(3) As Double

   ‘ Get end bus names

   If GetData( LineHnd, LN_nBus1Hnd, BusHnd ) = 0 Then GoTo HasError

   Bus1ID = FullBusName( BusHnd )

   If GetData(LineHnd, LN_nBus2Hnd, BusHnd ) = 0 Then GoTo HasError

   Bus2ID = FullBusName( BusHnd )

   ' Show the fault

   If PickFault( 1 ) Then GoTo HasError

   ‘ Get pre-fault

   If GetPSCVoltage( nDevHnd&, vdVal1, vdVal2, 2 ) = 0 Then GoTo HasError

   ' Show it

   Print "Pre-fault voltage on line: "; sVal2$ & "-"; sVal3$ & " ID= "; sVal1$; ": "; Chr(10); _

         "V1 = "; Format( MagArray(1), "#0.00"); "@"; Format( AngArray(1), "#0.0");  _

         "; V2 = "; Format( MagArray(2), "#0.00"); "@"; Format(AngArray 2), "#0.0")