Function Run1LPFCommand: SIMULATEFAULT

 

Function Function Run1LPFCommand( sInput$ ) As Long

Purpose: Run OneLiner command FAULTS  | BATCH COMMAND & FAULT SPEC FILE | EXECUTE COMMAND.

Works in:                             OneLiner.  

Parameters:     

sInput       [in] XML string, or full path name to XML file, containing XML node as described in Remarks section below.

Return value:

N>0             Index number of the last fault simulated by the function

0               Failure

Remarks: sInput must include XML node SIMULATEFAULT with one or multiple children nodes of <FAULT>. Each <FAULT> node can have up to 40 <FLTSPEC> children nodes, which contain the value of fault specification string data as described in OneLiner’s user manual APPENDIX I: FAULT SPECIFICATION FILE. The fault spec data can also be entered as attributes of <FLTSPEC> node as listed below  (* denotes required entries, [] denotes default value).

<SIMULATEFAULT> node attributes

CLEARPREV         Clear the fault simulation result buffer

<FLTSPEC> node attributes:

FLTDESC            Fault description String enclosed in quotes. Description can have up to 127 characters.

       PHASETYPE      (*)Which phase(es) are involved in the fault.

                        1LG: 0="A"; 1="B"; 2="C"

                        2LG Or LL: 0="A-B"; 1="B-C";2="A-C"

                        Bus-to-bus: 0="A-A";1="A-B";2="A-C";3="B-B";4="B-C";5="C-C"

FLTCONN            (*)Fault connection code. Enter 0 For 3LG; 1 For 2LG; 2 For 1LG; 3 For L-L.

FLTAPPL             (*)Fault application code. Enter 0 For bus fault; 1 For Close-in fault;

                                    2 For bus-to-bus fault; 3 For Line-End fault; 4 For intermediate fault;

                                    5 For branch outage; 6,7,8 For 1-, 2- And 3-phase Open.

FPARAM             Intermediate fault location in percent.

FRA FXA FRB FXB FRC FXC FRGg FXG   

                        Resistance And reactance value of fault impedances Za, Zb, Zc And Zg per figure in section SPECIFY SIMULTANEOUS FAULT COMMAND.

                                    Fault impedance is Not used when FLTAPPL is 5, 6, 7 Or 8, in which case all values must be zero.

BUS1NAME          (*)Name of first fault bus in quotes. Name can have up to 13 characters.

BUS1KV              (*)Nominal kV of first fault bus in quotes. Name can have up to 13 characters.

                        Following data fields are required only If FLTAPPL is other than 0

BUS2NAME          Name of Second fault bus in quotes. Name can have up to 13 characters.

BUS2KV              Nominal kV of Second fault bus in quotes. Name can have up to 13 characters.

BRTYPE              Fault branch Type code. Enter 1 For transmission Line; 2 For 2-winding transformer;

                                    3 For phase shifter; 7 For switch; 10 For 3-winding transformer.

CKTID                Faulted branch circuit ID.

 

Example:                                                                                          

 

Fault specification as <FLTSPEC>  node string:

Sub main

  sInput$ = "<SIMULATEFAULT>" & _

      "<FAULT>" & _

 "<FLTSPEC>" & _

            """'Bus Fault on:          28 ARIZONA      132. kV 1LG Type=A' 0 2 0 0 0 0 0 0 0 0 0 0 'ARIZONA' 132"" " & _

         "</FLTSPEC>" & _

      "</FAULT>" & _

  "</SIMULATEFAULT>"

  Print sInput

  If Run1LPFCommand( sInput ) Then Print "Success" Else Print ErrorString()

End Sub

 

Fault specification as <FLTSPEC> node attributes:

Sub main

  sInput$ = "<SIMULATEFAULT>" & _

      "<FAULT>" & _

         "<FLTSPEC " & _

            "FLTDESC=""Bus Fault On:          28 ARIZONA      132. kV 1LG Type=A "" " & _

            "PHASETYPE=""0"" " & _

          "FLTCONN=""2"" " & _

          "FLTAPPL=""0"" " & _

          "FPARAM=""0"" " & _

          "FRA=""0"" " & _

          "FXA=""0"" " & _

          "FRB=""0"" " & _

          "FXB=""0"" " & _

          "FRC=""0"" " & _

          "FXC=""0"" " & _

          "FRG=""0"" " & _

          "FXG=""0"" " & _

            "BUS1NAME=""ARIZONA"" " & _

          "BUS1KV=""132"" " & _

         "/>" & _

      "</FAULT>" & _           

  "</SIMULATEFAULT>"

  Print sInput

  If Run1LPFCommand( sInput ) Then Print "Success" Else Print ErrorString()

End Sub