Professional Documents
Culture Documents
Page 1 of 150
DIgSILENT PowerFactory
Appendix
A: Glossary B: Hotkeys References D: Types Reference C: Elements Reference E: Reference to the use of Symbols in PowerFactory F: Interfaces with Other Programs G: The DIgSILENT Programming Language - DPL H: DPL Reference I: DSL Reference
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Appendix A Glossary
Appliance Base Case Block Definition Block Diagram Branch Elements Busbars Class Composite Frame Composite Model Cubicle DAQ Device DGS DOLE DPL Drag&Drop DSL DSL primitive Edge Elements Element Graphics Board Window Grid Node Object Page Tab Project Result Object Slot Study Case System Stage Type Virtual Instrument Virtual Instrument Panel Appliance
A specific physical, installed, power system component: a specific generator, transformer, busbar, etc. Example: a piece of NKBA 0.6/1kV 4 x 35sm cable, 12.4 meters long.
Base Case
A base case is the highest level in a tree of hierarchical system stage designs. It is the basic power system design, for which one or more alternative designs may be created and analyzed. The base case is always stored in a grid folder.
Block Definition
A block definition is a mathematical model which may be used in other block definitions or in a composite model. Examples are all default controllers (i.e. VCO's, PSS's, MDM's), and all additional user-defined DSL models. A block definition is called "primitive'' when it is directly written in DSL, or "complex'' when it is build from other block definitions, by drawing a block diagram.
Block Diagram
A block diagram is a graphical representation of a DSL model, i.e. a voltage controller, a motor driven machine model or a water turbine model. Block diagrams combine DSL primitive elements and block definitions created by drawing other block diagram. The block models thus created may (again) be used in other block diagrams or to create a Composite Frame. See also: DSL primitive, Composite Frame
Branch Elements
A one port element connected to a node, such as a load or a machine. See also nodes, edge elements.
Busbars
Busbars are particular representations of nodes. Busbars are housed in a Station folder and several busbars may be part of a station.
Class
07/10/2011
DIgSILENT PowerFactory
Page 2 of 150
A class is a template for an element, type or other kind of objects like controller block diagrams, object filters, calculation settings, etc. Examples:
The 'TypLne' class is the type model for all lines and cables The 'ElmLne' class is an element model for a specific line or cable The 'ComLdf' class is a load-flow command The 'EvtSwitch' class is an event for a switch to open or close during simulation Composite Frame
A composite frame is a special block diagram which defines a new stand-alone model, mostly without in- or outputs. A composite frame is principally a circuit in which one or more slots are connected to each other. A composite frame is used to create composite models by filling the slots with appropriate objects. The composite frame thus acts as template for a specific kind of composite models. See also: Block Diagram, Slot
Composite Model
A composite model is a specific combination of mathematical models.These models may be power system elements such as synchronous generators, or block definitions, such as voltage controllers, primary mover models or power system stabilizers. Composite models may be used to create new objects, such as protection devices, to 'dress-up' power system elements such as synchronous machines with controllers, prime movers models, etc., or for the identification of model parameters on the basis of measurements.
Cubicle
A cubicle is the connection point between a edge or branch element and a node (represented by a busbar or terminal). It may be visualized as a bay in a switch yard or a panel in a switchgear board. Elements such as CT's, protection equipment, breakers and so forth, are housed in the cubicle, as one would expect to find in reality.
DAQ
A certain kind of physical power system components: certain synchronous machines, two-winding transformers, busbars, or other kinds of equipment. Example: a NKBA 0.6/1kV 4 x 35sm cable.
DGS
Abbreviation for "DIgSILENT Object Language for Data Exchange''. DOLE was used in previous PowerFactory versions, but replaced by DGS meanwhile. Now, use DGS instead, please. The DOLE import uses a header line with the parameter name. This header must have the following structure:
The first header must be the class name of the listed objects. The following headers must state a correct parameter name. DPL
Abbreviation for "DIgSILENT Programming Language''. For further information, please refer to Chapter G The DIgSILENT Programming Language - DPL .
Drag&Drop
"Drag&Drop'' is a method for moving an object by left clicking it and subsequently moving the mouse while holding the mouse button down ("dragging''). Releasing the mouse button when the new location is reached is called "dropping''. This will move the object to the new location.
DSL
Abbreviation for "DIgSILENT Simulation Language''. For further information, please refer to Chapter 25.9 The DIgSILENT Simulation Language (DSL) .
DSL primitive
A DSL primitive is the same as a primitive block definition. A DSL primitive is written directly in DSL without the use of a block diagram. Examples are PID controllers, time lags, simple signal filters, integrators, limiters, etc. DSL primitives are normally used to build more complex block definitions. See also: Block Definition, Block Diagram
Edge Elements
The elements between two nodes. May also be termed 'two port element.' Source, topological studies; picture a 3 dimensional box, the corners of the box would be called the nodes, and the edges between corners are hence 'edges.' See also nodes, branch elements.
Element
A mathematical model for specific appliances. Most element models only hold the appliance-specific data while the more general type-specific data comes from a typereference. Example: a model of a piece of NKBA 0.6/1kV 4 x 35sm cable, 12.4 meters long, named "FC 1023.ElmLne".
Graphics Board Window
The graphics board window is a multi document window which contains one or more graphical pages. These pages may be single line graphics, virtual instrument pages, block diagrams etc. The graphics board shows page tabs when more than one page is present. These tabs may be used to change the visible page or to change the page order by drag&drop on the page tab. See also: Virtual Instrument, Block Diagram, Page Tab, Drag&Drop
Grid
A Grid is a collection of power system elements which are all stored in one so-called "Grid Folder'' in the database. Normally, a grid forms a logical part of a power system design, like a the MV distribution system in a province, or the HV transport system in a state.
Object
An object is a specific item stored in the database. Examples are specific type or element models which have been edited to model specific devices or appliances. Examples: the element "FC 1023.ElmLne", the type "NKBA_4x35.TypLne", the load-flow command "3Phase.ComLdf"
Node
The mathematical or generic description for what are commonly known as busbars in the electrical world. In PowerFactory nodes may be represented by "Busbars" or "Terminals" of various kinds. These are treated in the same manner in mathematical terms but treated slightly differently in the database. As far as possible the user should use terminals as Busbars can be somewhat inflexible. See also Busbars, Edge Elements, Branch Elements.
Page Tab
Page tabs are small indexes at the edge (mostly on the top or bottom) of a multi-page window. The tabs show the titles of the pages. Left-clicking the page tab opens the corresponding page. Page tabs are used in object dialogues, which often have different pages for different calculation functions, and in the Graphics Board Window, when more than one graphical page is present.
Project
All power system definitions and calculations are stored and activated in a project. The project folder therefore is a basic folder in the user's database tree. All grids that make out the power system design, with all design variants, study cases, commands, results, etc. are stored together in a single project folder.
Result Object
A result object keeps one or more lists of parameters which are to be monitored during a calculation. Results objects are used for building calculation result reports and for defining a virtual instrument.
07/10/2011
DIgSILENT PowerFactory
Page 3 of 150
A slot is a place-holder for a block definition in a composite frame. A composite model is created from a composite frame by filling one or more slots with an appropriate object. See also: Block Definition, Composite Frame.
Study Case
A study case is a folder which stores a list of references or shortcuts to grid or system stage folders. These folders are (de)activated when the calculation case folder is (de) activated. Elements in the grid folders that are referenced by the study case form the 'calculation target' for all calculation functions. Elements in all other, non-active, grid folders are not considered for calculation. Besides the list of active folders, the calculation case also stores all calculations commands, results, events, and other objects which are, or have been, used to analyze the active power system. See also: Grid, System Stage
System Stage
A system stage is an alternative design or variation for a particular grid. A system stage is stored in a system stage folder, which keeps track of all differences from the design in the higher hierarchical level. The highest level is formed by the base grid folder. It is possible to have system stages of system stages. See also: Grid, Base Case
Type
A mathematical model for devices: general models for two-winding transformers, two-winding transformers, busbars, etc. A type model only contains the non-specific data valid for whole groups of power system elements. Example: a NKBA 0.6/1kV 4 x 35sm cable type, named "NKBA_4x35.TypLne" See also: System Stage, Grid
Virtual Instrument
A virtual instrument is a graphical representation of calculation results. It may be a line or bar graph, a gauge, a vector diagram, etc. A virtual instrument gets its values from a result object. See also: Result Object.
Virtual Instrument Panel
Virtual instrument panels are one of the possible types of pages in a graphics board window. Virtual instrument panels are used to create and show virtual instruments. Each virtual instrument panel may contain one or more virtual instruments. See also: Graphics Board Window, Virtual Instrument
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 4 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 5 of 150
Ctrl + A Ctrl + Alt + home Ctrl + Pag (up arrow) Ctrl + Pag (down arrow) Ctrl + C Ctrl + E Ctrl + End Ctrl + F Ctrl + F3 Ctrl + home Ctrl + O Ctrl + P Ctrl + Arrow (up arrow) Ctrl + Arrow (down arrow) Ctrl + Pos1 Ctrl + Shift + End Ctrl + Shift + Pos1 End F3 F4 G H home Arrow (up arrow) Arrow (right arrow) Arrow (down arrow) Arrow (left arrow) Pos1 Shift + Pag ? Shift + Pag ? Shift + F3 Cursor in a Word Marked word Debug-Mode Debug-Mode Debug-Mode Cursor in a Word
Mark the content of the output window Like Ctrl + Pos1 Like Ctrl + End Copy the market report to the clipboard Open a new empty editor Set the cursor in the last position of the last row Open the Search and Replace dialogue Jump to previous same word Call the Open dialogue Call the Print dialogue Page up Page down Set the cursor in the first position of first row Set the cursor in the last position and marks the report in between Set the cursor in the first position and marks the report in between Set the cursor in the last position of the row Jump to next same word
Set the cursor one line above Set the cursor one position after Set the cursor one line below Set the cursor one position before Set the cursor to the first position of the row Set the cursor one page up and select the in between content Set the cursor one page down and select the in between content Jump to the next same word
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Static Var System (ElmSvs) Station Controller (ElmStactrl) Synchronous Machine (ElmSym) Tower Line Coupling (ElmTow) AC Voltage Source (ElmVac) DC Voltage Source (ElmVdc) Current Measurement (StaImea) Power Measurement (StaPqmea) Voltage Measurement (StaVmea) Digital Clock (ElmClock) Fast Fourier Transform (ElmFft) File Object (ElmFile)
07/10/2011
DIgSILENT PowerFactory
Page 6 of 150
Fourier Source (ElmFsrc) Phase Measurement Device (Phase Locked Loop, ElmPhi__pll) Digital Register (ElmReg) Sample and Hold Model (ElmSamp) Trigger Model (ElmTrigger)
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 0 0 x>0&x<100 x=0|x=1|x=2 x>=0&x<=6 x[0]='V'|x[0]='P'|x[0]='Q A V V x=1|x=0 x>=0&x<=2 x>0 x=1|x=0 p.u. MW Mvar x>=0&x<=1 p.u. p.u. MW MW Mvar Mvar Ohm Ohm Ohm Ohm uF uF uF uF x>=0 x=0|x=1 x>=0 x>=0 x>=0 x>=0 x=1|x=0 x=0|x=1 x>=0 x>=0 x>=0 0 0 0 0 ' 1. 1. 0. 0. 0 0 0. 1. 0 1. 0. 0. 0 01. Jan 0.99 0. 0. 0. 0. 0. 0. 0. 0. 0 0. 0. 0. 0. 0 0
0 0 0 0
07/10/2011
DIgSILENT PowerFactory
Page 7 of 150
ignd_l iintgnd i_hvcon i_lvcon sernum constr doc_id desc pStoch iperfect iTaps iMeasLoc mTaps i_uopt i_uoptCont maxload iOPFCload iblock ilt_op Ub_lv Ib_lv cosphib_lv Ubqmin_hv Tctrl Kqctrl Kpctrl pldc i_tapini iIntTapCtrl dpl1 dpl2 dpl3 dpl4 dpl5
Star Point External Star Point HV-side, phase 2 connected LV-side, phase 2 connected Serial Number Year of Construction Additional Data Description Element model Ideal component According to Measurement Report Measured at Measurement Report Tap Position Control Mode Max. Loading Max. Loading Unit Transformer Long-term operating conditions before short-circuit are known Highest Operating Voltage Highest Operating Current Power factor Minimum Operating Voltage Controller Time Constant Controller Sensitivity dv/dQ Controller Sensitivity dv/dP External LDC Estimate Tap Position Use Integrated Tap Controller dpl1 dpl2 dpl3 dpl4 dpl5
0 0 0 0 0
0 x=0|x=1 x=0|x=1 0 0 0 x=0|x=1 % x>=0 x=0|x=1 x=0|x=1 x=0|x=1 kV kA kV s %/Mvar %/MW x>0 x<0|x>0 x<0|x>0 0 100. 0 0 0 0. 0. 0.9 0. 0.5 0.1 0.1 0 x=0|x=1 0 0. 0. 0. 0. 0.
_NameValid
_ForKeyValid x>=0&x<=1 0 0 x>0&x<100 x=0|x=1|x=2 x>=0&x<=6 x[0]='V'|x[0]='P'|x[0]='Q A V V x=1|x=0 x>=0&x<=2 x>0 x=1|x=0 p.u. MW Mvar x>=0&x<=1 p.u. p.u. MW MW Mvar Mvar x=0|x=1 uF uF uF x>=0 x>=0 x>=0 x>=0 0 0 0 0 ' 1. 1. 0. 0. 0 0 1. 0 1. 0. 0. 0 01. Jan 0.99 0. 0. 0. 0. 0 0. 0. 0.
07/10/2011
DIgSILENT PowerFactory
Page 8 of 150
Cc0_hl ifc i_rem p_rem p_cub i_auto i_eahv i_ealv sernum constr doc_id desc pStoch iperfect iTaps iMeasLoc mTaps i_uopt i_popt i_qopt maxload iblock ilt_op Ub_lv Ib_lv cosphib_lv Ubqmin_hv Tctrl Kqctrl Kpctrl pldc iIntTapCtrl dpl1 dpl2 dpl3 dpl4 dpl5
Capacitance HV-LV, 0-Sequence Forced Cooling Enabled Remote Control Controlled Node Controlled Branch (Cubicle) Auto Transformer HV-side, phase 2 internally grounded LV-side, phase 2 internally grounded Serial Number Year of Construction Additional Data Description Element model Ideal component According to Measurement Report Measured at Measurement Report Tap Position Optimize Active Power Setpoint Optimize Reactive Power Setpoint Max. Loading Unit Transformer Long-term operating conditions before short-circuit are known Highest Operating Voltage Highest Operating Current Power factor Minimum Operating Voltage Controller Time Constant Controller Sensitivity dv/dQ Controller Sensitivity dv/dP External LDC Use Integrated Tap Controller dpl1 dpl2 dpl3 dpl4 dpl5
uF
0. 0 0
0 0 0 0
0 x=0|x=1 x=0|x=1 0 0 0 0 0 % x>=0 x=0|x=1 x=0|x=1 kV kA kV s %/Mvar %/MW x>0 x<0|x>0 x<0|x>0 x=0|x=1 100. 0 0 0. 0. 0.9 0. 0.5 0.1 0.1 0 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 0 0 x>0&x<100 x=0|x=1 p.u. MW Mvar x>=0&x<=2 x[0]='V'|x[0]='P'|x[0]='Q x>=0&x<=6 x>=0|x<=3 x>=0 0 0 1. 0. 0. 0 ' 0 0 0 0 0
07/10/2011
DIgSILENT PowerFactory
Page 9 of 150
n3rcn_h n3rcn_m n3rcn_l lodt3 nt3rl usetp_h usetp_m usetp_l psetp_h psetp_m psetp_l qsetp_h qsetp_m qsetp_l imldc_h imldc_m imldc_l t3ldc_h t3ldc_l t3ldc_m ratfac_h ratfac_m ratfac_l i_rem p_rem p_cub tapctrl Tctrl Kqctrl Kpctrl i_cont usp_up usp_low psp_up psp_low qsp_up qsp_low ignd_h ignd_m ignd_l i_auto_hl iintgnd i_cont_h i_cont_m i_cont_l re0h re0m re0l xe0h xe0m xe0l ifc sernum constr doc_id desc pStoch iperfect i_tapopt_l i_tapopt_h i_tapopt_m i_tapoptCont_l i_tapoptCont_h i_tapoptCont_m maxload iOPFCload ildc pldc i_tapini_h i_tapini_m i_tapini_l iIntTapCtrl iTaps iMeasTap
Automatic Tap Changing Automatic Tap Changing Automatic Tap Changing Type Load Pointer to relais Voltage Setpoint Voltage Setpoint Voltage Setpoint Active Power Setpoint Active Power Setpoint Active Power Setpoint Reactive Power Setpoint Reactive Power Setpoint Reactive Power Setpoint Control Mode Control Mode Control Mode Controlled Node Controlled Node Controlled Node HV-Side MV-Side LV-Side Remote Control Controlled Node Controlled Branch (Cubicle) Tap Controller Controller Time Constant Controller Sensitivity dv/dQ Controller Sensitivity dv/dP Tap Changer Upper Voltage Bound Lower Voltage Bound Upper Active Power Bound Lower Active Power Bound Upper Reactive Power Bound Lower Reactive Power Bound Star Point Star Point Star Point Auto Transformer External Star Point Tap Changer Tap Changer Tap Changer Re Re Re Xe Xe Xe Forced Cooling Enabled Serial Number Year of Construction Additional Data Description Element model Ideal component Tap Position LV-Side Tap Position HV-Side Tap Position MV-Side Control Mode LV-Side Control Mode HV-Side Control Mode MV-Side Max. Loading Max. Loading Line Drop Compensation (LDC) External LDC Estimate Tap Position HV-Side Estimate Tap Position MV-Side Estimate Tap Position LV-Side Use Integrated Tap Controller According to Measurement Report for Tap at
0 0 0 0
1. 1. 1. 0. 0. 0. 0. 0. 0.
x[0]='V'|x[0]='P'|x[0]='Q x[0]='V'|x[0]='P'|x[0]='Q x[0]='V'|x[0]='P'|x[0]='Q x>=0|x<=3 x>=0|x<=3 x>=0|x<=3 x>0 x>0 x>0 x=0|x=1
x>=0|x<=2 x>=0|x<=2 x>=0|x<=2 x=0|x=1|x=2 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 Ohm Ohm Ohm Ohm Ohm Ohm x=1|x=0
0 0 0 0 0 0 0 0 0. 0. 0. 0. 0. 0. 0 0
0 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 % x>=0 x=0|x=1 x>=0&x<=1 0 0 0 0 0 0 100. 0 0 0 0 0 x=0|x=1 x=0|x=1 x>=0&x<=2 0 0 0
07/10/2011
DIgSILENT PowerFactory
Page 10 of 150
x>=0&x<=2
0 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
ForKeyValid x>=0&x<=1 x=0|x=1 x>0&x<100 MW Mvar x>=0 0 0 0 0. 0. 0 x>=0 p.u. s x>=0&x<=100 x>=0 x=0|x=1 x=0|x=1 x=0|x=1 2. 1. 0. 0 0 0 0
x=0|x=1 x=0|x=2 x=0|x=1 Ohm Ohm x>=0 x>=0 x=0|x=1 x>=0&x<=2 s x>=0 x=0|x=1
0 0 0 0. 0. 0 0 0.5 0 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 11 of 150
The description of the booster transformers, presenting the relations among the input parameters is given in the attached Technical Reference Paper. Note: The name of the parameter is displayed in the Object edit dialogue, by placing the cursor in the input field of the parameter. Certain parameters are relevant to more than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue.
_NameValid
_ForKeyValid x>=0&x<=1 0 0 0
0 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 12 of 150
charact chr_name for_name dat_src outserv iZoneBus Sn nphases iequalz iz2eqz1 r_pu x_pu r_pu_ji x_pu_ji r0_pu x0_pu r0_pu_ji x0_pu_ji r2_pu x2_pu r2_pu_ji x2_pu_ji iZshc rs_pu xs_pu rs_pu_ji xs_pu_ji r0s_pu x0s_pu r0s_pu_ji x0s_pu_ji r2s_pu x2s_pu r2s_pu_ji x2s_pu_ji sernum manuf constr doc_id desc dpl1 dpl2 dpl3 dpl4 dpl5
Charact. Characteristic Name Foreign Key Data source Out of Service Zone Nominal Power Phases Use equal Impedances (zij = zji) Use Impedance z2 = z1 Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Use same impedance as for loadflow Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Real Part Imaginary Part Serial Number Manufacturer Year of Construction Additional Data Description dpl1 dpl2 dpl3 dpl4 dpl5
_ForKeyValid x>=0&x<=1 MVA x>=0 x=1|x=3 x=0|x=1 x=0|x=1 p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. x=0|x=1 p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. 0 0 1. 0 0 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
ForKeyValid
07/10/2011
DIgSILENT PowerFactory
Page 13 of 150
outserv typ_id monof ngnum pgini qgini i_mot mdmex mdmlp tstart sernum constr doc_id desc slipset Urot rcrow xcrow i_conv i_ctrl i_feedback cv Pmmax Kd Kq Td Tq p_pctrl iAstabint ignd Xe Re
Out of Service Type Operation Mode parallel Machines Active Power Reactive Power Generator/Motor Exponent Proportional Factor Starting Time Serial Number Year of Construction Additional Data Description Slip Rated Slip Ring Voltage Crow-Bar Resistance Crow-Bar Reactance Use Integrated PWM Converter Use Built-In Current Controller Rotor Flux Feed-Back Cv Max Pulse Width Modulation Index Kd Kq Td Tq Controlled Flow A-stable integration algorithm Star Point Xearth Rearth
0 0 0 0. 0. 0
2. 1. 0. 0
% V p.u. p.u.
0.01 0.01 0 0 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 MW Mvar MVA MVA x>=0 x>=-1&x<=1 x>0 x>=0 x>=0 x>0 x>0 x=0|x=1 x>=0 x>=0 x>=0 x>=0 x=0|x=1 x>=0|x<=2 0 0. 0. 0. 0. 10000. 0.1 10. 01. Jan 1. 0 1. 1. 1. 0.1 0 0
07/10/2011
DIgSILENT PowerFactory
Page 14 of 150
Ohm
Xe fdsymr fdsyml usetp ip_ctrl iv_mode phiini tag K desc snssmin rntxnmin xntrnmin z2tz1min z0tz1min x0tx1min r0tx0min MaxS ecost p_uctrl cmonth cpower ccost ictpg ictqg iOPFCPmin iOPFCPmax iOPFCQmin iOPFCQmax q_min q_max Pmin_uc round Kpf dpl1 dpl2 dpl3 dpl4 dpl5 Pctrl i_prty mode_inp Grounding Reactance Resistance R=R(freq) [A-Z] Reactance L=L(freq) [A-Z] Voltage Setpoint Secondary Controller (Slack) Voltage Controller Mode Angle Acceleration Time Constant Secondary Frequency Bias Description Short-Circuit Power Sk''min R/X Ratio (min.) X/R Ratio (min.) Z2/Z1 min. Z0/Z1 min. X0/X1 min. R0/X0 min. Max. Power Energy Cost Reference Busbar No load costs (monthly) From Costs Active Power Reactive Power Min. Max. Min. Max. Min. Max. Minimum Power Smoothing of Cost Function Primary Frequency Bias dpl1 dpl2 dpl3 dpl4 dpl5 Active power steps Priority Input Mode
0. 0. _FrqDepValid _FrqDepValid
Ohm
p.u.
x>=-180&x<=180 x>0 x>=0 x>0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0
x>=0 x>0
x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 Mvar Mvar MW % MW/Hz x>=0.0&x<=100.0
0 0 0 0 0 0 0. 100. 0. 5. 0. 0. 0. 0. 0. 0. 0
x>=0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 15 of 150
nlsim ishclne fshcloc lodln lprot slin1 i_dist pCondCir pCondGnd pCondN sagCir sagGnd ktrto rearth i_model kz1 pz1 zz1 kz0 pz0 zz0 kz2 pz2 zz2 ka1 a1dc Ta1 pa1 za1 ka0 a0dc Ta0 pa0 za0 ka2 a2dc Ta2 pa2 za2 fmin fmax ftau tolBode tmat cubsecs sernum constr doc_id desc NrCust i_ldlv pStoch iperfect maxload iOPFCload dpl1 dpl2 dpl3 dpl4 dpl5
Enable for Contingency Analysis Available Short-Circuit Location Type of Load Protection Devices Load Current/Nom.Current Line Model Type of Phase Conductors Type of Earth Conductors Type of Neutral Conductors Max.Sag, Phase Conductors Max.Sag, Ground Wires Transposition Earth Resistivity Line Model Surge Impedance, HF, Mode 1. Poles,Mode 1 Zeros, Z1 Surge Impedance, HF, Mode 0 Poles, Mode 0 Zeros, Zl0 Surge Impedance, HF, Mode 2. Poles,Mode 2 Zeros, Z2 Wave Propagation Constant. Wave Propagation, DC, Mode 1 Travel Time, Mode 1 Poles, A1 Zeros, A1 Wave Propagation Constant Wave Propagation, DC, Mode 0 Travel Time, Mode 0 Poles, A0 Zeros, A0 Wave Propagation Constant. Wave Propagation, DC, Mode 2 Travel Time, Mode 2 Poles, A2 Zeros, A2 Min. Frequency of Parameter Fitting Max. Frequency of Parameter Fitting Frequency for Travel-Time Estimation Tolerance for Bode Approximation Transformation Matrix Routes/Cubicles/Sections Serial Number Year of Construction Additional Data Description Number of connected customers Line Load Element model Ideal component Max. Loading Max. Loading dpl1 dpl2 dpl3 dpl4 dpl5
0 0 50.
p.u.
x>=0 x=0|x=1
0. 0
m m Ohmm Ohm Hz Hz Ohm Hz Hz Ohm Hz Hz p.u. p.u. s Hz Hz p.u. p.u. s Hz Hz p.u. p.u. s Hz Hz Hz Hz Hz %
0. 0. 0 100. 0 50.
x>0
50.
x>0
50.
1. 1. 0.001
1. 1. 0.001
1. 1. 0.001
x>=0 x=0|x=1
0 0 0
x>=0 x=0|x=1
100. 0 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 16 of 150
Name loc_name root_id fold_id charact chr_name for_name dat_src outserv typ_id dline fline inAir index sernum constr doc_id desc pStoch iperfect Name Original Location In Folder Charact. Characteristic Name Foreign Key Data source Out of Service Type Length Derating Factor Laying Index Serial Number Year of Construction Additional Data Description Element model Ideal component
Description
Unit
Range
Default
_NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
p.u.
x>0
1.
07/10/2011
DIgSILENT PowerFactory
Page 17 of 150
p_cub i_scaleini iShedding shedcost shedmax shedmin dpl1 dpl2 dpl3 dpl4 dpl5
Controlled Branch (Cubicle) Estimate Scaling Factor Allow load shedding Costs for load shedding Max. load shedding Min. load shedding dpl1 dpl2 dpl3 dpl4 dpl5
0 0 1. 100. 0. 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 0
kW kVA kV A kW
x>=0 x>=0 x>=0&x<=1 x>0 x>=0 x=0|x=1 x>=0 x>=0 x>=0&x<=3 x=0|x=1 x>=1|x<=3 x=0|x=1
0. 0. 0. 0.4 0. 0 0. 0 0 1. 0 0 0 0
1. 0 0 0 % x>=0.0&x<=100.0 0. 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 18 of 150
Table C.14 shows the input parameters for the ElmLodlvp object. Parameters are presented in the same order of the object dialogue (starting from the 'Basic Data' tab). The description of the partial load model, presenting the relations among the input parameters and the required types is given in the attached Technical Reference Paper. Note: The name of the parameter is displayed in the Object edit dialogue, by placing the cursor in the input field of the parameter. Certain parameters are relevant to more than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue.
_NameValid
_ForKeyValid x>=0&x<=1 kW kVA kV A kW x>=0 x>=0 x>=0&x<=1 x>0 x>=0 x=0|x=1 x>=0 x>=0 x>=0&x<=3 % x>=0&x<=100 0 0. 0. 0. 0.4 0. 0 0. 0 0 50. 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 19 of 150
_NameValid
_ForKeyValid x>=0&x<=1 p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. x>=0 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 20 of 150
Zero Sequence Reactance Grounding Resistance Grounding Reactance Frequency Dependency R0 Frequency Dependency L0 Frequency Dependency Re Frequency Dependency Le Serial Number Manufacturer Year of Construction Additional Data Description
0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
ForKeyValid x>=0&x<=1 kV kV MVA p.u. p.u. deg MW Mvar x>0 x>0 x>0 x>0.0 x>0.0 0 1. 1. 1. 1. 1. 0. 0. 0.
x>=0&x<=6 p.u. p.u. p.u. p.u. p.u. 0<=x 0<=x&x<=1 0<=x&x<=1 0<=x&x<=1 0<=x&x<=1 x=0|x=1|x=2 Hz Ohm uS uF S x>0 x>=0 x>0 x>=0 x=0|x=1 x=0|x=1 % kW kW uF x>=0 x>=0 x>=0 x>=0
s s p.u. p.u.
07/10/2011
DIgSILENT PowerFactory
Page 21 of 150
Serial Number Manufacturer Year of Construction Additional Data Description Static converter-fed drive Model A-stable integration algorithm
0 0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 kV kV MVA p.u. deg MW Mvar x>0 x>0 x>0 x>0.0 0 1. 1. 1. 1. 0. 0. 0.
x>=0&x<=5 p.u. p.u. p.u. p.u. p.u. 0<=x 0<=x&x<=1 0<=x&x<=1 0<=x&x<=1 0<=x&x<=1 x=0|x=1|x=2 Ohm myS x>0 x>=0 x=0|x=1
0 0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 22 of 150
_NameValid
_ForKeyValid x>=0&x<=1 0
p.u. p.u. MW Mvar kA Ohm x>0 x>=0 *x='R'|*x='I *x='V'|*x='I'|*x='P'|*x='Q'|*x='E'|*x='G deg deg p.u. 0<=x&x<=180 0<=x&x<=180 x=0|x=1|x=2 x>0 x=0|x=1
x=0|x=1 x>0 x=0|x=1 deg deg deg deg *30deg 0<=x&x<=180 0<=x&x<=180 0<=x&x<=180 0<=x&x<=180 x>=0&x<12 x=0|x=1 x=0|x=1
0 0 0 0. 180. 0. 180. 0 0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
1. 1. 1. 1. 1. 0.
07/10/2011
DIgSILENT PowerFactory
Page 23 of 150
alpha_set gamma_set ntrcn nntap alphacn pctrl phmc i_int maxorder i_cv alphamin alphamax gammamin gammamax nt2ag iAstabint iconfed
Actual Firing-Angle Extinction Angle (gamma) Setpoint Tap-Changer Actual Winding Ratio Automatic Firing Angle Control Controller Harmonic Currents Ideal Rectifier Maximum Harmonic Order Current/Voltage-Source Converter Minimum Firing Angle Maximum Firing Angle Minimum Extinction Angle Maximum Extinction Angle Phase Shift A-stable integration algorithm Static converter-fed drive
15. 15. 0 1. 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Input parameters Table C.23 shows the input parameters of the ElmScap object. Parameters are presented in the same order of the object dialogue (starting from the 'Basic Data' tab). The description of the Series Capacitance model, presenting the relations among the input parameters is given in the attached Technical Reference Paper. Note: The name of the parameter is displayed in the Object edit dialogue, by placing the cursor in the input field of the parameter. Certain parameters are relevant to more than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue
NameValid
ForKeyValid x>=0&x<=1 0 0 kV x>=0 x=1|x=3 Ohm S F kA kV kA kV kA MVA x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>0 x>0 x=0|x=1 kA kV 1. 0 0. 0. 0. 0. 0. 0. 0. 1. 173.205 0
0 0 0 10.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 24 of 150
_NameValid
_ForKeyValid x>=0&x<=1 kV kA MVA % % kW Ohm Ohm mH Ohm x>0 x=1|x=3 x>0 x>0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 0 0 6. 0 0.096225 1. 0. 0. 0. 0. 0. 0. 0.
x=0|x=1 x=0|x=1
0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 kV x>0 x>=1&x<=3 x=0|x=1 x>=0|x<=2 x[0]='V'|x[0]='Q'|x[0]='P x>=0&x<=6 x=0|x=1 x>0 x>=0 x=0|x=1|x=2|x=3|x=4 Mvar Mvar A x>=0 x>=0 x>=0 0,00 6. 0,00 0,00 0,00 ' 0,00 0,00 0,00 0,00 0,00 0.96 1. 0.
07/10/2011
DIgSILENT PowerFactory
Page 25 of 150
cutot bcap ccap c1 c2 pgrad fres nres qrean curea xrea rlrea grea greaf0 rrea rpara tandc gparac fcharL fcharR fcharC shuz0 i_opt i_optCont systp Bg Xe Re acost iswitch sernum manuf constr doc_id desc i_rem p_rem p_cub Tctrl Kctrl usetp_mx usetp_mn qsetp_mx qsetp_mn pfsetp_mx pfsetp_mn pf_recap_mx pf_recap_mn iIntTapCtrl mode_inp
Rated Current, L-C Susceptance Capacitance Capacitance C1 Capacitance C2 Degree Resonance Frequency Tuning Order Rated Reactive Power, L Rated Current, L Reactance Inductance Quality Factor (at fn) Quality Factor (at fr) Resistance Parallel Resistance Loss Factor, tan(delta) Parallel Conductance L(f) R(f) C(f) Z0/Z1 Use Controller for OPF optimization Control Mode System Type Susceptance to Ground Reactance, Xe Resistance, Re Annual Cost Switchable Serial Number Manufacturer Year of Construction Additional Data Description Remote Control Controlled Node Controlled Branch (Cubicle) Controller Time Constant Controller Sensitivity dq/dv Upper Voltage Limit Lower Voltage Limit Upper Reactive Power Limit Lower Reactive Power Limit Upper Power Factor Limit Lower Power Factor Limit Power Factor Power Factor Use Integrated Tap Controller Input Mode
A uS uF uF uF % Hz Mvar A Ohm mH
x>=0 x>=0 x>=0 x>=0 x>=0 x>=0&x<=100 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0
Ohm Ohm uS
x>=0 x=0|x=1 x=0|x=1 x=0|x=1 nS Ohm Ohm $/year x>=0 x>=0 x>=0 x>=0 x>=0&x<=1
0,00
x=0|x=1
0,00
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 26 of 150
Nominal Current Amplification Bypass Serial Number Manufacturer Year of Construction Additional Data Description
kA
1. 0. 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
) is an easy to use model of any kind of generator, which is not rotating but static. Applications are:
Wind generators, which are connected with a full-size converter to the grid, can be modelled as a static generator as well, because the behaviour of the plant (from the view of the grid side) is determined by the converter:
Wind Generators Basic Data Load Flow Data VDE/IEC Short-Circuit Data Full Short-Circuit Data Optimization Data RMS- / EMT-Simulation Data
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
C.25.1 Basic Data On the basic date tab of the Static Generator you can choose the category of the element, enter the number of parallel generators and the ratings of one generator.
C.25.2 Load Flow Data On the load flow tab you can define the power output: active and reactive power, or active power and voltage magnitude, or even a droop. Additionally you can specify a capability curve, which may be the whole range of the converter or a curve with the shape of a V for a min. and max. power factor for example.
07/10/2011
DIgSILENT PowerFactory
Page 27 of 150
C.25.3 VDE/IEC Short-Circuit Data For short circuit analysis according to IEC 60909 (VDE 0102), you can specify, whether the Static Generator shall have a contribution to the short circuit or not. In order to let the Static Generators fed into the short circuit, enable the option 'Static converter-fed drive'. With this option enabled, a Static Generator will have a contribution like a Static converter-fed drive according to IEC 60909:
It has a contribution to I''k and to ip. It has no contribution to Ib or Ik.
In IEC 60909 the contribution of a Static converter-fed drive to I''k is defined by:
The index 'rM' specifies the rating of the static converter transformer on the network side, or the rating of the static converter, if no transformer is present.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
C.25.4 Full Short-Circuit Data If you want to define a user-specific level for the subtransient and a transient short circuit, you can do so using the Complete Method. For short circuit calculations by the Complete Method you can enter a subtransient and a transient short circuit level, either as short circuit power or as short circuit current, and the R/X ratio (alternatively the X/R ratio). Additionally it is possible to enter values for the zero sequence impedance, for example if the Static Generator includes a transformer with earthed star point.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
C.25.5 Optimization Data On the optimization tab you can add the Static Generator to a Virtual Power Plant.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
C.25.6 RMS- / EMT-Simulation Data In time-domain-simulations the Static Generator has to be controlled via a DSL model. It behaves either as a controlled voltage source (input signale u1r_in and u1i_in) or as a controlled current source (input signale id_ref and iq_ref, assuming the current controller of the real converter would be ideally fast).
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 28 of 150
_NameValid
_ForKeyValid x>=0&x<=1 x>=0 x>=0 Mvar Mvar Mvar p.u. Mvar Mvar x=0|x=1 x>=0&x<=4 x>=0&x<=2 x=0|x=1 x=0|x=1 x>=0 x<=0 x>=0 x>0 x>=0 0 0 0 0. 0. 0. 1. 0. 0. 0 0 0 0 0
0 0. 0 0. 0. 0. 0. 0.
0 0 0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 29 of 150
_NameValid
_ForKeyValid x>=0&x<=1 x>0 MW Mvar MVA x>=0 x=0|x=1 x=0|x=1 $/MW x=0|x=1 x=0|x=1 p.u. Ohm Ohm x>0 x>=0 x>=0 x=0|x=1 x=0|x=1 x=0|x=1 deg x>=-180&x<=180 0 0 0. 0. 0. 0. 0 0 0. 0 0 1. 0 0. 0. 0 0 0 0. 0
0 x>=0 x=0|x=1 x=0|x=1 MW MW h h $ $ MW $/h 0. 0 x=0|x=1 x=0|x=1 p.u. p.u. MW Mvar Mvar 0 h h MW x>=0 % MW/Hz x>=0&x<=100 x>=0 x=0|x=2 x=0|x=1 x=0|x=1 0. 0. 0. 1. 0. 0. 0 0 0 0. 0. 0. 0. 0. 0 0 -1. 1. 0 0 0 0 0.8 0. 0. 0. 0. 0.
07/10/2011
DIgSILENT PowerFactory
Page 30 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>=0&x<=1 0
x>0
100.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
07/10/2011
DIgSILENT PowerFactory
Page 31 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
07/10/2011
DIgSILENT PowerFactory
Page 32 of 150
fold_id charact chr_name for_name dat_src outserv typ_id Tp tonTp iopt_meas ctrlsim
In Folder Charact. Characteristic Name Foreign Key Data source Out of Service Type Period Ratio Ton/Tp Use Measurement Frequency Control Simulation Step Size
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 33 of 150
than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue
NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue
NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue
07/10/2011
DIgSILENT PowerFactory
Page 34 of 150
NameValid
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 35 of 150
_NameValid
3. 0.
0 0 0.5 0.5 0 0
p.u. p.u. p.u. p.u. x>=0 x>=0 x>=0 x>1 x=3|x=5 x=0|x=1 % x>=0.0&x<=100.0 x>=0&x<=1 x>=0 p.u. s p.u. s x=0|x=1 Hz kW MVA x>=0 x>=0 x>=0 x=0|x=1 x=0|x=1 % kW % kW % % % %
07/10/2011
DIgSILENT PowerFactory
Page 36 of 150
p.u. p.u.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid MVA MVA MVA kV kV kV % % % kW kW kW % % x>0 x>0 x>0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 1. 1. 1. 0. 0. 0. 3. 3. 3. 0. 0. 0. 0. 0. 0 0 0 0 0 0 0 0 0 % % % deg deg deg % % % % % % x>=0 x>=0 x>=0 x>=0&x<=360 x>=0&x<=360 x>=0&x<=360 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 _FrqDepValid _FrqDepValid _IsVecGrpValid _IsVecGrpValid _IsVecGrpValid *30deg *30deg x>=0&x<=12 x>=0&x<=12 0 0 0 0 0 0 p.u. 0. 0. 0. 0. 0. 0. 0. 3. 3. 3. 0. 0. 0.
07/10/2011
DIgSILENT PowerFactory
Page 37 of 150
psi0 x3lin x3air pict3 pitt3 twct3 twtt3 pfe t3nam bname1 bname2 bname3 elemnm ansiclass nt3ag_l itapos snfc_h snfc_m snfc_l oltc_h oltc_m oltc_l itapzdep itapzside uktr3mn_h uktr3mn_m uktr3mn_l pcut3mn_h pcut3mn_m pcut3mn_l uktr3mx_h uktr3mx_m uktr3mx_l pcut3mx_h pcut3mx_m pcut3mx_l uk0mnhm uk0mnml uk0mnhl ur0mnhm ur0mnml ur0mnhl uk0mxhm uk0mxml uk0mxhl ur0mxhm ur0mxml ur0mxhl manuf doc_id desc pStoch
Saturation Flux Linear Part Saturated Ratio Ip/In Max. Time Ratio It/In Max. Time No Load Losses transformer name (only for compatib.) bus name 1 (only for compatib.) bus name 2 (only for compatib.) bus name 3 (only for compatib.) Element Name (only for compatib.) Class Phase Shift Tap Modeled at HV-Side MV-Side LV-Side HV-Side MV-Side LV-Side Tap dependent impedance for Tap at uk(HV-MV)(min. tap) uk(MV-LV)(min. tap) uk(LV-HV)(min. tap) Pcu(HV-MV)(min. tap) Pcu(MV-LV)(min. tap) Pcu(LV-HV)(min. tap) uk(HV-MV)(max. tap) uk(MV-LV)(max. tap) uk(LV-HV)(max. tap) Pcu(HV-MV)(max. tap) Pcu(MV-LV)(max. tap) Pcu(LV-HV)(max. tap) uk0(HV-MV)(min. tap) uk0(MV-LV)(min. tap) uk0(LV-HV)(min. tap) Re(uk0)(HV-MV)(min. tap) Re(uk0)(MV-LV)(min. tap) Re(uk0)(LV-HV)(min. tap) uk0(HV-MV)(max. tap) uk0(MV-LV)(max. tap) uk0(LV-HV)(max. tap) Re(uk0)(HV-MV)(max. tap) Re(uk0)(MV-LV)(max. tap) Re(uk0)(LV-HV)(max. tap) Manufacturer Additional Data Description Stochastic model
01. Jan 0. 0. 0. 0. 0. 0. 0.
x>=0&x<=12 x=0|x=1 x>=0 x>=0 x>=0 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x>=0&x<=2
0 0 0. 0. 0. 0 0 0 0 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
% % % kW kW kW % % % kW kW kW % % % % % % % % % % % %
x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
ForKeyValid
07/10/2011
DIgSILENT PowerFactory
Page 38 of 150
sgn ugn cosn nppol aiazn tag xm rtox rstr rrtrA rrtrB xstr xrtrA xrtrB xmrtr frequ istt nslty pgn anend aslkp asstl amazn amkzn amstl coazn slp mslp islp fdasmr fdasml i_mode effic i_trans fcharrstr fcharlss iinrush Tinrush Tcold Thot i_cdisp n_cdisp rrsn xrsn rrs1 xrs1 rrtrA0 xrtrA0 r0 x0 r1 x1 i_cage i_optpn rtoxshc aiaznshc xtorshc xdssshc iansitp manuf doc_id desc J rzero xzero
Rated Apparent Power Rated Voltage Rated Power Factor No of Pole Pairs Locked Rotor Current (Ilr/In) Acceleration Time Constant Mag. Reactance Xm R/X Locked Rotor Stator Resistance Rs Rotor Resistance RrA Rotor Resistance RrB Stator Reactance Xs Rotor Reactance XrA Rotor Reactance XrB Rotor Leakage Reac. Xrm Nominal Frequency Status of ESB Calculation Connection Rated Mechanical Power Nominal Speed Slip at Stalling Point Slip at Saddle Point Locked Rotor Torque Torque at Stalling Point Torque at Saddle Point cos(phi) Locked Rotor Slip Torque Current Resistance R=R(freq) [A-Z] Reactance L=L(freq) [A-Z] Input Mode Efficiency at nominal Operation Consider Transient Parameter Stator Resistance Rs(f) Inductance L''(f) Ratio Ip/In Max. Time Cold Hot Consider Current Displacement (Squirrel Cage Rotor) Order of R-L Approximation Slip dependent part of RrA at nominal slip Slip dependent part of XrA at nominal slip Slip dependent part of RrA at slip=1 Slip dependent part of XrA at slip=1 Slip indep. Resistance RrA0 Slip indep. Reactance XrA0 Resistance RrA1 Reactance XrA1 Resistance RrA2 Reactance XrA2 Rotor Power Rating R/X Locked Rotor Locked Rotor Current (Ilr/In) X/R Locked Rotor Locked Rotor Reactance ANSI Type Manufacturer Additional Data Description Inertia Resistance Reactance
kVA kV
p.u. s p.u.
x>=0 x>0
0. 50. 0 0
kW rpm
400. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 x>=0 FrqDepValid FrqDepValid x=0|x=1
0 100. 0
p.u. s s s
x>0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 39 of 150
_NameValid
_ForKeyValid
MVA kV kV % kW % % % *30deg
x>0 x>0 x>0 x>=0 x>=0 x>=0&x<=100 x>=0&x<=100 x>=0&x<=100 _IsVecGrpValidB x>=0&x<=12 x>=0&x<=1 x>=0&x<=1
x>=0
100.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid
mm mm mm mm mm uOhm*cm
0. 5. 1. 1. 1. Jan 68 1. 3. 0.02
0 0 0 0
07/10/2011
DIgSILENT PowerFactory
Page 40 of 150
kV degC kA
0. 80. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid x>0&x<100 m mm mm mm mH/km x>0 x>0 x>0 x>0 x>0 x=0|x=1 uS/km Ohm/km kV kA degC kA x>=0 x>0 x>0 x>=0 x>0 x>=0 0 0.1 30. 15. 11.682 0.05 1. 0 0. 0.05 6. 1. 80. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
NameValid
ForKeyValid % % % x>=0&x<=100 x>=0&x<=100 x>=0&x<=100 0 0 0 0. 01. Jun s s x>=0 x>=0 0. 0. 0. 01. Aug
07/10/2011
DIgSILENT PowerFactory
Page 41 of 150
tqf tqu t1 pgrd qcq cnm spfilnm fdlodr fdlodl systp nlnph iintgnd manuf doc_id desc i_nln i_pure i_csrc udmax udmin Prp xt
Transient Frequency Dependence Transient Voltage Dependence Dynamic Load Time Constant QL/QC QC/Q Connection Measurement File Resistance R=R(freq) [A-Z] Reactance L=L(freq) [A-Z] System Type Phases External Star Point Manufacturer Additional Data Description Nonlinear Model Load model Current Source/Impedance Upper Voltage Limit Lower Voltage Limit Power of parallel Resistance/Total Active Power Transformer Short Circuit Reactance
s s s % %
'
0 0 0
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue.
_NameValid
_ForKeyValid x>=1&x<=3 kV kA kA *In p.u. s p.u. s 'Ohm/km 'Ohm/km Ohm/km Ohm/km degC 'uS/km 'mH/km 'uF/km 'uS/km _FrqDepValid _FrqDepValid _FrqDepValid 'Ohm/km 'Ohm/km 'mH/km 'uS/km 'uF/km x>=0 x>=0 x>=0 0. 0. 0. 0. 0. x>=0 x>=0 x>=0 x>0 x>=0 x>=0 x>=0 x>=0 x>=0 0 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 80. 0. 0. 0. 0. 0.
07/10/2011
DIgSILENT PowerFactory
Page 42 of 150
gline0 tline0 Ices miso mlei qurs bett crosect systp aohl_ InomAir Ithr rtheta theta manuf doc_id desc frnom fcharL1 fcharR1 fcharC1 fcharL0 fcharR0 fcharC0 pStoch cabdiam ncond iopt_cnd iopt_ord cmeth iopt_dir lcost nneutral rnline xnline bnline rpnline xpnline bpnline
Conductance G0 Ins. Factor Earth-Fault Current Insulation Material Conductor Material Nominal Cross Section Operating Temp. Cross Section System Type Cable / OHL Rated Current (in air) Rated Short-Time (1s) Current (Conductor) Resistance R'(theta) Temperature theta Manufacturer Additional Data Description Nominal Frequency L1'(f) R1'(f) C1'(f) L0'(f) R0'(f) C0'(f) Stochastic model Outer Diameter No. of Conductors Cable is Conductors Installation Method (IEC 364) Arrangement Line Cost No. of Neutrals Resistance Rn Reactance Xn Susceptance Bn Resistance Rpn Reactance Xpn Susceptance Bpn
'uS/km A/km
0. 0. 0.
mm*2 degC x=0|x=1 _AohlValid kA kA Ohm/km degC x>=0 x>=0 x>=0 x!=20
0. 0. 0 1. 0. 0. 0.
Hz
x>=0
50.
mm
0. 3.
0. 0 0. 0. 0. 0. 0. 0.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid
1. 1. 0.9
07/10/2011
DIgSILENT PowerFactory
Page 43 of 150
Maximum Turns-Ratio Diode-/Thyristor Converter Thyristor-Conductance (at Off) Snubber-Conductance Snubber-Capacity Built-In Transformer Nominal Firing Angle Nominal Turns-Ratio (t2/t1)
p.u. S S uF deg
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
_NameValid
_ForKeyValid MVA kV s 's 's ''s ''s p.u. 'p.u. ''p.u. p.u. 'p.u. ''p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. p.u. x>=0 x>=0 x>=0 x>0 x>=0 x>=0 x>=0 x=0|x=1 x=0|x=1 x>=0&x<=3 _FrqDepValid _FrqDepValid p.u. p.u. Mvar Mvar x=0|x=1 x=0|x=1 x=0|x=1 kA kA kA s x>=0 x>=0 x>=0 x>=0&x<=2 x>0 -1. 1. -1. 1. 0 0 0 0. 0. 0. 0 8. x>0 x>0 x>0&x<=1 x>0 x>0 x>=0 x>0 x>0 x>0 x>0 x>0 x>0 x>=0 x>0 x>=0 x>0 x>=0 1. 6. 0.8 10. 1. 1. 0.05 0.05 2. 0.3 0.2 2. 0.3 0.2 01. Feb 0.2 10000000. 0. 0. 0. 0. 0.2 0. 0.1 0. 0 0 0
07/10/2011
DIgSILENT PowerFactory
Page 44 of 150
h tds0 tqs0 tdss0 tqss0 lss i_trans fcharrstr fcharlss i_v12 xl xrl kcanay manuf doc_id desc dpu hpn
Inertia Time Constant (rated to Sgn) H Td0 Tq0 Td0 Tq0 l Consider Transient Parameter rs(f) l''(f) Model xl xrl Canay Factor Manufacturer Additional Data Description Mechanical Damping Inertia Time Constant (rated to Pgn) H
0 0.1 0. 0.
p.u. s
x>=0 x>=0
0. 5.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
than one calculation, therefore they can be found and edited in different tabs. The availability of some parameters is conditioned to the current value of the selection parameters (iopt_...); therefore not all the listed parameters would be visualized at once in a dialogue
_NameValid
TypCon TypCon m m x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=0|x=1 x=1|x=2|x=3 x=1|x=2|x=3 x=1|x=2|x=3 x=1|x=2|x=3 x=1|x=2|x=3 x=1|x=2|x=3 0 0 0 0 0 0 0 0 0 0 0 0
m m m
0. 0. 0.
07/10/2011
DIgSILENT PowerFactory
Page 45 of 150
xy_c2 xy_c3 xy_c4 xy_c5 xy_c6 R_c X_c R_c0 X_c0 R_c1 X_c1 frnom L_c L_c0 L_c1 G_c B_c G_c0 B_c0 G_c1 B_c1 C_c C_c0 C_c1 sline systp i_mode manuf doc_id desc pStoch
2 3 4 5 6 Matrix of Resistances R_ij Matrix of Reactances X_ij Matrix of 0-Sequence-Resistances R_ij_0 Matrix of 0-Sequence-Reactances X_ij_0 Matrix of 1-Sequence-Resistances R_ij_1 Matrix of 1-Sequence-Reactances X_ij_1 Nominal Frequency Matrix of Inductances L_ij Matrix of 0-Sequence-Inductances L_ij_0 Matrix of 1-Sequence-Inductances L_ij_1 Matrix of Conductances G_ij Matrix of Susceptances B_ij Matrix of 0-Sequence-Conductances G_ij_0 Matrix of 0-Sequence-Susceptances B_ij_0 Matrix of 1-Sequence-Conductances G_ij_1 Matrix of 1-Sequence-Susceptances B_ij_1 Matrix of Capacitances C_ij Matrix of 0-Sequence-Capacitances C_ij_0 Matrix of 1-Sequence-Capacitances C_ij_1 Nominal Current System Type Input Mode Manufacturer Additional Data Description Stochastic model
m m m m m Ohm/km Ohm/km Ohm/km Ohm/km Ohm/km Ohm/km Hz H/km H/km H/km uS/km uS/km uS/km uS/km uS/km uS/km uF/km uF/km uF/km kA x>=0 x=0|x=1 x=0|x=1
0. 0. 0. 0. 0.
50.
1. 0 0
_NameValid
_ForKeyValid m m
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 46 of 150
Visibility of the symbol Mirror Defines if the symbol can be mirror (right mouse button entry) Allow Moving Allows moving in graphic Show Connection Attributes Shows the square (resulting state of composite switches) at the end of connection lines Insertion Reference Defines the insertion point of an element (e.g. rectangular terminal = 4 -> top left).The following matrix describes the relation between the insertion points and the insertion numbers: 432 501 678 Additional Attributes Only used for elements whose representation shall be able to alter via specific changes of the element parameters (e.g. shunts, couplers) Connection Points Defines the position on the symbol where the connection lines start. The number of connection points is defined by the number of lines unequal (-9999,-9999). The points should be located on the grid, i.e. they should be a multiple of 4.375 (mm) Contents Containing objects of type "SetVitxt" defining the layout of the text boxes. The names must be unique. Labels beginning with "Label..." and result boxes beginning with "Res...". The name of symbol must also be part of the name of the SetVitxt.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 47 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
E.2.2 Showing self defined pictures in symbols WMF and bitmaps can be selected as "Symbol File". The definitions of the geometrical primitives are not used if a "Symbol File" is defined.The picture will be adapted to the size of symbol in the single line diagram.After selection of a WMF file in the top entry field for the Symbol File (not rotated) a button "Create all other files" appears which allows to create automatically WMF files in the same folder with a rotation of 90, 180 and 270 degrees. Additionally pictures for open devices with the same angles can be entered in the bottom lines.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
PowerFactory is able to convert both steady-state data (for load-flow and short-circuit analyses) and dynamic data files. It is good practise to first import the steady-state
data (described in this section), then to add the dynamic models (described in Section F.2.2 Import of PSS/E file (Dynamic Data) . Before starting the next steps for importing a PSS/E file, all projects should be de-activated. Then please select from the main menu File -> Import... -> PSS/E. Afterwards the window of the import command will pop-up, asking the user to specify various options. General Settings Tab Page Import Options Tab Page Import Graphical Options Tab Page
General Settings Tab Page
07/10/2011
DIgSILENT PowerFactory
Page 48 of 150
Fig. F.1: PSS/E Import - General Settings Nominal Frequency Nominal frequency of the file to be Converted/Imported. PSS/E Raw data Location on the hard disk of the PSS/E raw data file. By default the program searches for *.raw extensions. The user may consider all types of files by typing *.*. Add Graphic Files Location of the PSS/E drw files on the file system. Again by default the programs searches for files with extension *.drw. The user may consider all types of files by typing *.*.
Note After the Conversion/Importing has finished, the resulting project will contain a graphics folder where all of the PSS/E drw
converted graphics will be stored. The user must therefore relocate each one of them to the corresponding grids.
Save converted data in: Project The project name that will be assigned to the converted/imported file. in Location in the data manager tree where the imported file will be stored. Sequence Data Location of the PSS/E sequence data file. By default the program searches for *.seq extensions. The user may consider all types of files by typing *.*.
The following topics Dyn Models Data Parameter Mapping Composite Frame Path DSL - Model Path are not used for the import of steady-state data and will be explained in the dynamic import Section F.2.2.
Import Options Tab Page
Fig. F.2: PSS/E Import - Options Convert only sequence data file With this option enabled, the converter will only add the sequence data to an existing project. Convert only dynamic models file With this option enabled, the converter will only add the dynamic data file to an existing project (only for dynamic data import). Convert only graphic file With this option enabled, the converter will add only a single-line diagram to an existing project. Only convert file (no DB action) Internal option used for syntax check and error messages during conversion. Normally this box should be left unchecked.
07/10/2011
DIgSILENT PowerFactory
Page 49 of 150
Output only used dynamic models Displays a list of used dynamic models (only for dynamic data import). Unit of 'LEN' for lines in miles instead of km With this option enabled, all lengths will be interpreted in miles in the PSS/E raw files. Consider transformer phase shift With this option enabled, transformer phase shifts will be considered. This option is recommended and activated by default. Convert Induction Machines (P<0) With this option enabled, all generators in the raw data file that have negative active power will be converted to asynchronous machines. For transmission grids the option should be disabled for proper modeling of phase shift generators. Automatic 3-W. Transformer detection/conversion The older versions of PSS/E do not know 3-winding transformers. Therefore the converter will try to detect the existence of three 2-Winding Transformers connected to a busbar. If any candidates are available, PowerFactory will replace them by a 3-Winding Transformer. The detection is using the impedances and the voltage control of the transformers. Convert capacitive line shunts to line susceptance B' If a line has line shunts the converter adds automatically the line shunt capacitance to the C1' (B1') in the PowerFactory line type. Convert Common Impedance as Transformer The Common Impedance in PSS/E may be converted to a PowerFactory common impedance or to a transformer. This is selected here. Convert Series Capacitance as Common Impedance Older versions of PSS/E do not know series capacitances as a dedicated model. These elements therefore are represented by lines with negative reactances. During the conversion PowerFactory detects these branches and converts them to series capacitances (by default) or to common impedances (when this option is active). Convert off-nominal turn ratio to transformer tap Transformer ratios different from the rated ratio are automatically converted to a transformer type using taps, including the correct tap position. Busbar naming: 'PSSE_NAME' With this option enabled, the busbars are named similar to the PSS/E raw data file (without bus number). Branch naming: 'BUSNAME1_BUSNAME2_ID' With this option enabled, the branches are named as the name of the busbars + ID. Import Graphical Options Tab Page
Fig. F.3: PSS/E Import - Graphical Options Rotate with respect to busbar The converter will rotate the graphical layout in case of the majority of busbars being in vertical or horizontal position. Snap coordinates to grid The converter will snap to grid all objects in the single line graphics. Transformer Symbol according to IEC This options lets the user to choose the transformer symbol as IEEE (default) or IEC representation. Scaling factor The graphic files are scaled according to the scaling factor shown.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.2.2 Import of PSS/E file (Dynamic Data) As explained in Section F.2.1 it is good practise first to import the steady-state data and then to add the dynamic model data. Before converting dynamic data, it is recommended to copy the IEEE library folder located in the global library into the user directory. The IEEE dynamic data library folder can be found under Library\Models\IEEE . This folder has the structure as shown in Figure F.4.
07/10/2011
DIgSILENT PowerFactory
Page 50 of 150
An important condition for successful file conversion is that all DSL models used during the conversion process should be stored in the same model library folder. By default, this is the case in the global PowerFactory library. If the original library should use specific folders for the different types of controllers (AVR,PCO,PSS,..), the user should copy all of the models into the same library folder. After the conversion, the user may re-arrange the models. The procedure to start the import of dynamic network data is very similar to the import of steady-state data. Some parameter adjustments have to be made. General Settings Tab Page - Dynamic Model Import Import Options Tab Page - Dynamic Model Import
General Settings Tab Page - Dynamic Model Import
In the dialogue of General Settings in Figure F.1 the following topics have to be specified:
Dyn Models Data Location of the PSS/E Dynamic Models data file. By default the program searches for *.dyn and *dyr extensions. The user may consider all types of files by typing *.*. Parameter Mapping Location of the PowerFactory mapping file. This is an option that normally will not have to be touched by the user. By default PowerFactory will automatically set up its own internal mapping file. This file defines how to translate the PSS/E internal models into PowerFactory models, including the mapping of controller parameters. For automated conversion of user-defined PSS/E controllers the mapping file may be customized. Please contact our support if you wish to do so. Composite Frame Path Location in the PowerFactory data base where the composite frames are stored (IEEE/Frames...). DSL - Model Path Location in the PowerFactory data base where the DSL models are stored (IEEE/Models....). Import Options Tab Page - Dynamic Model Import
In the dialogue of Import Options in Figure F.1 the following options should be considered:
Convert only dynamic models file With this option enabled, the converter will only add the dynamic data file to an existing project. Output only used dynamic models Displays a list of used dynamic models.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.2.3 Exporting a project to a PSS/E file This function allows the export of the network model in PSS/E format. The export comprises both steady-state and dynamic data sets. The correct conversion of dynamic models is only possible for the standard IEEE models. Models which the user implemented in PowerFactory DSL can not automatically be translated but must be modeled as user-defined controller types separately in PSS/E. To export a project in PSS/E format select File > Export... > PSS/E from the main menu. Export General Settings Tab Page Export Options Tab Page
Export General Settings Tab Page
07/10/2011
DIgSILENT PowerFactory
Page 51 of 150
Fig. F.5: PSS/E Export - General settings RAW Conversion File Path and file name for the PSS/E RAW file, containing the symmetrical description of the model. SEQ Conversion File Path and file name for the PSS/E SEQ file, containing the additional description of the model necessary for unbalanced conditions. DYN Conversion File Path and file name for the PSS/E DYN file, containing the dynamic models of the project. Export Options Tab Page
Fig. F.6: PSS/E Export - Options Convert Motors to Generators if P<0 With this option enabled, all asynchronous machines in generator mode will be converted to synchronous machines. Base Apparent Power Base for the power values given in per-unit system. Min (Zero) Impedance Branch Minimum impedance for ideal connections. PSS/E Version Version of PSS/E target files.
The section of developers' options contains additional options used for debugging. Please use these options only when requested to do so by the PowerFactory support.
Extra Precision Activates the output of values in extended precision.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.1 About StationWare DIgSILENT StationWare provides a reliable central protection settings database and management system for the complete power system substation data, both to manage the various control parameters and to centrally store substation related information and data, based on latest .NET technology.
StationWare stores and records all settings in a central database, allows modeling of all relevant work flow sequences, provides quick access to relay manuals, interfaces with manufacturer specific relay settings software, and integrates with PowerFactory software, allowing for powerful and easy-to-use settings co-ordination studies.
Modern numerical relays have a large number of settings that are determined, stored and communicated by proprietary software solutions (these may even be suitable for only a particular manufacturer or even a series or type of relay). This results in a fragmented and distributed settings "database." DIgSILENT StationWare provides a single system that incorporates all such different device protocols, thereby providing one manageable software data storage system, based on modern IT techniques, facilitating data interfacing and exchange in a transparent and hassle free manner.
07/10/2011
DIgSILENT PowerFactory
Page 52 of 150
PowerFactory's data exchange facility allows it to access the settings stored inStationWare, such that these may be used as input for the powerful PowerFactory system simulation and protection setting tools. Settings that are calculated by using these tools may then be transferred back to StationWare.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.2 Component Architecture DIgSILENT StationWare is a so-called Client-Server Application: the functionality is distributed on at least two computers: client and server. Figure F.7 gives an overview on the components.
Usually there are several clients. One main advantage of this architecture is the fact that the data is stored in one central database on the server. One client connects to the server and fetches the data from there, modifies them, and afterward stores them back to the server. On other clients these changes are visible. DIgSILENT StationWare server provides two interfaces to access from client machines:
Visualization by means of a standard web browser. The HTML interface can be used with an usual web browser (e.g. Microsoft Internet Explorer or Mozilla Firefox) as shown in Figure F.8. The browser displays HTML pages which are created by StationWare's HTML front end. The HTML pages are transferred using the HTTP protocol on top of the TCP/IP internet protocol. HTML allows to present all kind of data e.g. plain text, tables or images. Additionally HTML provides concepts to achieve interactivity: by submitting HTML forms or pressing on hyperlinks data is sent to the server. The server interpretssuch requests and creates new HTML pages which are displayed by the browser again. The web service interface, similar to the HTML interface uses the HTTP protocol to communicate with the web service frontend, though no HTML pages are transferred but lowerlevel data (SOAP/XML encoded). The web service client application is responsible to present this data conveniently. PowerFactory is able to play the role of a web service client. It integrates parts of StationWare's data and concepts smoothly into its own world.
The functionality of the HTML interface is covered in the StationWare manual. The remainder of this chapter focuses on PowerFactory as client.
07/10/2011
DIgSILENT PowerFactory
Page 53 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.3 Fundamental Concepts Though both in StationWare and in PowerFactory the settings and data associated with protective devices, such as relays, CTs, VTs and circuit breakers are stored, the systems provide a different set of concepts how to deal with this data. In StationWare it is possible to model a location hierarchy and associate the devices to nodes in this hierarchy (e.g. substations). This has no equivalent on the PowerFactory side where the devices are stored inside the parent grid (ElmNet) object. On the other side PowerFactory allows to create a topological representation of networks which is not supported in StationWare. This section describes the concept mismatch between PowerFactory and StationWare. In order to use the StationWare interface it's important to know about the differences between both applications. Location Device Device State Life Cycle Phase
Location
In StationWare each device belongs to exactly one location. There are different location types e.g. Region, Area, Substation, or Bay. The locations are organized in a hierarchy tree as shown in Figure F.9.
07/10/2011
DIgSILENT PowerFactory
Page 54 of 150
In PowerFactory the data is organized in projects (IntPrj). A project may have one or more grids (ElmNet) which in turn contain net elements e.g. terminals, cubicles, and relays (ElmRelay). See Figure F.10 for a typical PowerFactory project.
StationWare's location concept and PowerFactory's pr oject/grid concept hardly fit together. That's the reason why the data mapping between PowerFactory and StationWare begins at the device level which is the subject of the next sections.
Device
StationWare manages a set of devices e.g. relays, CTs, VTs, or Circuit breakers. Each device is associated to a device type e.g. ABB DPU2000R or SEL421 003. Additionally each device has an unique ID: the device ID.
In PowerFactory a relay is represented by an ElmRelay object which references exactly one TypRelay object. The ElmRelay object contains several sub-components e.g. the I> component (a RelToc object), the Logic component (RelLogic), or the Ios component (RelMeasure). See Figure F.11 for an example. The device ID is used to link one StationWare device to one PowerFactory device. The PowerFactory device e.g. an ElmRelay object stores the StationWare device ID as foreign key.
07/10/2011
DIgSILENT PowerFactory
Page 55 of 150
A device's state is in StationWare called setting. A setting is a list of attributes, and describes the state of one device completely. An attribute is a tuple of
attribute name, attribute type which can be an arbitrary integer or floating point number, optionally with a range restriction, or a string, or a enumeration type., a default value, an optional unit.
A complex relay may have thousands of attributes. In StationWare the setting attributes are organized in so-called setting groups. A setting group groups the attributes together which belong somehow together. It's often defined by the device manufacturer. Each attribute belongs to exactly one setting group. Inside a group the attribute name is unique. The device type defines which attributes and groups characterize a device. Table F.1 shows an example of a possible device type. There are two setting groups G and H. Group G has the attributes a, b, and c, group H has the attributes d and e.
Group G H a b c d e Name integer in [0,10] float float in [0.03,1.65] string enum 'yes','no','maybe' Type 0 -0.32 1.0 'DEFAULT' 'yes' Default A I/s Unit
According to this attribute definition a device can have settings as shown in tables F.2 or F.3.
Group, Name G,a G,b G,c H,d H,e Table F.2: Settings Example 1 Group, Name G,a G,b G,c H,d H,e Table F.3: Settings Example 2 8 0 1.1 'abcdef' 'yes' Value 7 23.43 1.1 'abc' 'maybe' Value
On the PowerFactory side there are neither setting nor group nor attribute. There is the ElmRelay object and its sub-objects. These objects can have parameters. See table F.4 for a definition and table F.5 for an example. The TypRelay type defines components and parameters.
StationWare attributes are somehow mapped to PowerFactory parameters and vice versa. How this actually is accomplished, is described in Section F.3.7 Technical Reference . The mapping is non-trivial since only a small subset of the attributes (the calculation-relevant data) is modeled in PowerFactory and vice versa. Additionally
there is no one-to-one relationship between attributes, and parameters and a parameter could get calculated out of several attributes. .
Component i> Logic Ios Table F.4: Parameter Definition o p q r s Parameter integer string enum 'enabled','disabled' float float Type
Some relays support multiple setting groups (MSG) also called parameter sets. Such relays have the same group many times (c.f. table F.5). The groups H1, H 2, and H 3 have the same set of attributes (c and d). Some relay models in PowerFactory do not support this concept fully. Instead of modeling all MSGs, only one instance of the H groups is provided. In this case a group index parameter defines which of the MSGs actually is transferred from StationWare to PowerFactory.
Life Cycle Phase
In StationWare each setting has one life cycle phase e.g. Planning or Applied. At each point in time a device can have a set of settings e.g. three Planning settings, one Applied setting and 12 Historic settings.
Component Parameter i>:o Logic:p Logic:q Ios:r 8 'HIGH' 'enabled' 18.5 Value
07/10/2011
DIgSILENT PowerFactory
Page 56 of 150
19.5
.
Group G H1 H2 H3 a b c d c d c d Name integer in [0,10] float string float in [0.03,1.65] string float in [0.03,1.65] string float in [0.03,1.65] Type 0 -0.32 'DEFAULT' 1.0 'DEFAULT' 1.0 'DEFAULT' 1.0 Default A I/s Unit
In PowerFactory a device has exactly one state (or setting). Therefore when data is transferred between PowerFactory and StationWare, always a concrete device setting in StationWare must be specified. For PowerFactory purposes a special PowerFactory planning phase is introduced. The transfer directions are specified as follows:
Imports from StationWare into PowerFactory are restricted to Applied and PowerFactory settings. Applied denotes the current applied setting (Applied) or a previous applied (Historic) setting. Exports from PowerFactory to StationWare are restricted to the PowerFactory setting. (Applied and Historic settings are read-only and can never be changed).
(Actually PowerFactory's sophisticated variant management is similar to the phase concept, but there is no obvious way how to bring them together.)
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.4 Configuration In order to transfer data between PowerFactory and StationWare both systems must be configured. StationWare Server PowerFactory Client
StationWare Server
An arbitrary StationWare user account can be used for the StationWare interface in PowerFactory. The user must have enough access rights to perform operations e.g. for the export from PowerFactory to StationWare write-rights must be granted. The bi-directional transfer of settings is restricted to lifecycle phases with
1. 2. status PLANNING or REVIEW and with a cardinality constraint of 1 i.e. there may exist one or no such setting for one device.
Please ensure that at least one phase fullfills these requirements, and there exists a setting of this phase.
PowerFactory Client
The client operating system must allow connections to the server (network and firewall settings etc.). Nothing has to be done in the PowerFactory configuration itself. The TypRelays in the Library must of course support StationWare/PowerFactory mapping.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.5 Getting Started This section is a simple walkthrough and covers the most essential StationWare interface functionality. By using a simple PowerFactory project and simple StationWare substation, it describes
1. 2. 3. 4. how relays in StationWare and PowerFactory are created, how these relays are linked, how settings can be exported from PowerFactory to StationWare, how settings can be imported again into PowerFactory.
All (especially the more advanced) options and features are described in the reference section (see Section F.3.6 Reference ). Prepare substation in StationWare Prepare project in PowerFactory Link Relays and establish a Connection Export and Import Settings
Prepare substation in StationWare
We begin with the StationWare side. We create a substation and two relays within:
start the web browser, log on to the StationWare system, create a new substation titled Getting Started, create two relays named Getting Started Relay 1 and Getting Started Relay 2 in the Getting Started substation
In the HTML interface the station detail page should look as shown in Figure F.12.
Go to the detail page of the Getting Started Relay 1 (Figure F.13).
Since we have just created the device it has no settings, yet. Later it will contain a PowerFactory setting which reflects the relay state on the PowerFactory side.
07/10/2011
DIgSILENT PowerFactory
Page 57 of 150
07/10/2011
DIgSILENT PowerFactory
Page 58 of 150
A dialogue pops up that allows you to specify the settings of the new relay (ElmRelay).
insert Getting Started Relay 1 as Name select an appropriate Relay Type which supports StationWare import/export (see Figure F.16). press OK in the same way add a relay Getting Started Relay 2 to the second terminal.
PowerFactory's object filter mechanism gives an overview over all devices inside the current project.
07/10/2011
DIgSILENT PowerFactory
Page 59 of 150
(Edit Relevant Objects for calculation) in the toolbar and select the icon
All calculation relevant relays (actually there only the two we created above) are displayed in a table (see Figure F.18).
Link Relays and establish a Connection
Now the PowerFactory relays must get linked to the StationWare relays.
A Log on to StationWare server dialogue pops up. Since this is the first time PowerFactory connects to the StationWare server some connection settings must be entered.
07/10/2011
DIgSILENT PowerFactory
Page 60 of 150
Fig. F.17: Relay object filter enter the Server Endpoint URL of the StationWare server. The URL should have a format similar to http://192.168.1.53/psmsws/psmsws.asmx enter Username and Password of a valid StationWare user account.
07/10/2011
DIgSILENT PowerFactory
Page 61 of 150
The connection procedure may take some seconds. If the server could be accessed and the user could be authenticated a success message is printed into the output window
DIgSI/info - Established connection to StationWare server 'http://192.168.1.53/psmsws/psmsws.asmx' as user'pf00002'
Otherwise an error dialogue pops up. Correct the connection settings until the connection is successfully created. The reference section (Section 1.6.2) explains the connection options in detail. Having established a connection to the server, a browser dialogue pops up which displays the location hierarchy as known from the StationWare HTML interface. The dialogue is shown in Figure F.21.
navigate to the Getting Started substation, select the Getting Started Relay 1 device, press OK.
Having linked PowerFactory to StationWare devices, the transfer between both systems can be started.
mark the relays with the mouse and right-click to get the relay context menu as shown in Figure F.19. select the Export... item in the StationWare menu entry.
A ComStationware dialogue is shown which allows to specify the export options (c.f. Fig. 1.16). See Section Export and Import Settings in the Reference section for all export options.
07/10/2011
DIgSILENT PowerFactory
Page 62 of 150
Fig. F.22: ComStationware dialogue select PowerFactory as Life cycle Phase, press Execute.
After a few seconds the relay settings are transferred to the server, and the output window contains the message
DIgSI/info - Exported 2 of 2 device settings successfully
Fig. F.23: Device detail page navigate to the relay detail view of the Getting Started Relay 1 relay (c.f. Fig. F.23)
Observe the new created PF setting. The phase of this setting is PowerFactory.
switch to the settings detail page of the new PF setting (c.f.Fig. F.24).
07/10/2011
DIgSILENT PowerFactory
Page 63 of 150
The setting values should correspond to the relay state in PowerFactory. In the same way the Getting Started Relay 2 relay has a new PF setting. Now try the opposite direction and import a setting from StationWare into PowerFactory.
modify the PF settings in StationWare by entering some other values in PowerFactory mark the relays with the mouse and right-click to get the relay context menu as shown in Figure F.19. select the Import... item in the StationWare menu entry.
Again the ComStationware dialogue (see Figure F.22) pops up as known from the export.
leave the default settings, press Execute.
Again the result of the settings transfer is reflected in the output window:
DIgSI/info - Imported 2 of 2 device settings successfully find ElmRelay object parameters changed according to the changes on the StationWare side
All import options are described in detail in the reference section Export and Import Settings .
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.6 Reference This section describes all options and features concerning the StationWare interface. The Device Context Menu Connection The Browser Dialogue The ComStationware Object Import Options Export Options
The Device Context Menu
Almost all functionality can be accessed by the device context menu. Mark one ore more objects which supports the StationWare transfer e.g. ElmRelay
in the object filter (Figure F.19) in the data manager as shown in Figure F.25.
07/10/2011
DIgSILENT PowerFactory
Page 64 of 150
Similar to the HTML interface the StationWare interface in PowerFactory is session-oriented: when a user logs on to the system by specifying a valid StationWare account (username and password) a new session is created. Only inside such a session StationWare can be used. The account privileges restrict the application functionality e.g. an administrator account is more powerful than a usual user account.
Working with PowerFactory the first time the StationWare server is required the Logon dialogue is shown as shown in Figure F.26. The StationWare connection options are stored in the user settings (Figure F.27). After each successful logon the user settings are updated.
As mentioned in the Architecture section (Section 1.2) StationWare is a client-server application. The StationWare server component is located on a server machine in the internet. The client component is the PowerFactory application which is running on a client machine. The technology PowerFactory and StationWare use to communicate is called web services and is standardized like many other internet technologies (HTML, HTTP). The server computer (or more exactly the StationWare service application on the server computer) has a 'name' by which it can be accessed. This 'name' is called service endpoint and resembles a web page URL:
http://the.server.name/psmsws/psmsws.asmx
or
http://192.168.1.53/psmsws/psmsws.asmx
http denotes the protocol, the.server.name is the computer name (or DNS) of the server computer and psmsws/psmsws.asmx is the name of the StationWare application. The connection options are as follows:
Service Endpoint The Service Endpoint denotes the StationWare server 'name' as described above Username/Password Username and Password have to be valid user account in StationWare. A StationWare user account has nothing to do with the PowerFactory user account.
The very same StationWare account can be used by two different PowerFactory users. The privileges of the StationWare account actually restrict the functionality. For device import the user requires read-access rights. For exporting additionally write-access rights are required.
The Browser Dialogue
As mentioned in the Concept description (see Section Device ) the StationWare device ID is stored as Foreign Key in the ElmRelay object dialogue (Description page) as shown in Figure F.28.
07/10/2011
DIgSILENT PowerFactory
Page 65 of 150
A more convenient way is to use the Browser dialogue shown in Figure F.29. The dialogue allows to browse through the StationWare location hierarchy and select a device. The hierarchy data is cached to minimize network accesses. Due this caching it's possible that there may exist newly created locations or devices which are not displayed in the browser dialogue. The Refresh button empties the cache and enforces PowerFactory to re-fetch the correct data from the server.
The ComStationware Object
In PowerFactory almost everything is an object: relays are ElmRelay objects, users are IntUser objects, and grids are ElmNet objects. What may be on the first sight confusing is the fact that actions are objects as well: for a short-circuit calculation a ComShc object is created. The calculation can be performed with several options e.g. 3-Phase, single phase, or 3 Phase to Neutral.
You can even specify the fault location. All these calculation options are stored in the ComShc object. Every action object has an Execute button which starts the action. In fact there is a large number of parametrized actions like load flow calculation (ComLdf), simulation (ComSim), there is even a ComExit object that shuts down PowerFactory. All objects which can 'do' something have the Com prefix. Since the StationWare interface is actually 'doing' something (it does import data, it does export data) it is implemented as a ComStationware object. The ComStationware object is used both for the import (Section 1.6.4.1) and the export (Section 1.6.4.2). It is located in the project's study case according to PowerFactory conventions. The actual Getting Started project (Section 1.5) is shown in Figure F.30. By default the study case of a new project contains no ComStationWare object. It is automatically created when it is first needed, as well as the ComShc object is instantiated at the time when the first short-circuit calculation is performed.
Import Options
07/10/2011
DIgSILENT PowerFactory
Page 66 of 150
PowerFactory selects the current setting with PowerFactory phase as source setting.
if Applied is selected the current Applied setting is transferred. If additionally a Timestamp value is entered the setting that was applied at this time is transferred which may either be Applied or Historic.
The Timestamp format is in ISO format: e.g. 2005-02-28 22:27:16 The time part may be omitted. Then 00:00:00 AM is assumed.
All Devices If All Devices is enabled, all calculation-relevant devices are imported. Devices not supported by StationWare are ignored. Device Selection Unless All Devices is enabled, the Device Selection provides a more subtle way to specify which devices are to be transferred. The Device Selection parameter can be an ElmRelay object: this and only this relay is imported a SetSelect object: a SetSelect is a container that may hold several objects. All of them are transferred, except the ones not supported by StationWare a SetFilt object: the SetFilt is the most flexible way to specify the device selection e.g. you can select all devices in the project of type ElmRelay and whose name begin with PW.... Devices outside the activated project are ignored. The Device Selection is automatically set if the Device Context Menu mechanism (Section The Device Context Menu ) is used. All Settings Groups/Group Index This parameter specifies how multiple settings groups (MSG) are handled (c.f. Section 1.3). If the relay in StationWare has MSGs and the PowerFactory relay model supports MSGs and - All Settings Groups is enabled: then all groups are transfered. - All Settings Groups is disabled: then only the Group Index -th group is transferred. If the relay in StationWare has MSGs and the PowerFactory relay model doesn't support MSGs: then the Group Index-th group is imported.
These parameters are ignored completely if the relay has no MSGs. The import transfer is started by pressing Execute.
The export options are almost identical to the import options (Figure F.32):
Transfer Mode Select Export as Transfer Mode
07/10/2011
DIgSILENT PowerFactory
Page 67 of 150
Life cycle Phase A list of possible life cycle targets is shown. Please have in mind that a setting of the life cycle is available. Applied settings can never be changed.
Click Execute to start the data transfer. Then the PowerFactory -relevant parameters are copied upon the existing target setting.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
F.3.7 Technical Reference The purpose of this section is to describe what happens internally inside PowerFactory when device settings are exported or imported. This section also explains how new device types are integrated. PowerFactory is delivered with a library of relay models. This library cannot contain all relays of all manufacturers. A way how to enhance the library for new device types is shown in this section as well. The StationWare interface is heavily based on DPL (DIgSILENT Programming Language) which is documented in a separate DPL Manual. Overview Import Scripts Export Scripts How to create a new Device Type conversion
Overview
For each device type (TypRelay) and each transfer direction a separate DPL script is required. The import DPL script takes the StationWare attributes and a ElmRelay object as input and fills somehow the ElmRelay object's and its subobjects' parameters. The export DPL script takes a ElmRelay object as input parameter and calculates some output parameters which are the StationWare attributes.
Note: DPL's most important benefit is: you can do everything. That's exactly DPL's most important disadvantage as well. Be sure that your DPL scripts do what they should do and not more. An import script should only set the parameters in the ElmRelay object and its subcomponents. An export script shouldn't change anything at all (at least within PowerFactory).
The scripts have to be named PsmsImport.ComDpl and PsmsExport.ComDpl and must be located in the same folder as the TypRelay object. Type data like TypRelay objects should be located in a library folder e.g. in the project library. If it is referenced from several projects, it belongs into a global library. See Figure F.33 for an example database structure.
Import Scripts
The algorithm used for the import from StationWare to PowerFactory is as follows. Let d be the device whose setting is to be imported:
1. 2. 3. 4. 5. let t be d's device type let dpl be the PsmsImport.ComDpl object near t initialize dpl's input parameter with the device attributes from StationWare initialize dpl's external object parameter Relay with d execute dpl
The execution step actually sets the relay parameters. We use the StationWare device type example shown in table F.1 from the Concept section (Section 1.3) and the PowerFactory device type as shown in table F.3. The StationWare attributes are G.a, G.b, G.c, H.d, and H.e, the PowerFactory parameters are I>:o, Logic:p, Logic:q, Ios:r, and Ios:s. Only the attributes G.a, G.c, and H.d and the parameters I>:o, Logic:p, and Ios:r are mapped. The others are ignored since there is no equivalent concept on the other system. Figure F.34 shows the Basic options. The PsmsImport.ComDpl must meet the requirements as follows:
Name must be PsmsImport General Selection must be empty Input Parameters this table holds the StationWare attributes. The Name has the format [group name]__[attribute name] The Type may either be int (for integer numbers), double (for floating point numbers), or string (for string and enum values). The Value field must be empty. The attribute unit has to inserted in the Unit field if appropriate. A Description may be inserted, too. External Object this table contains exactly one entry: an object with the Name Relay. The object column must be empty.
07/10/2011
DIgSILENT PowerFactory
Page 68 of 150
The Input parameters get initialized with the StationWare attribute values and the External Object with the current relay. The second page of the ComDpl script holds the output parameters. They have the meaning as follows (Figure F.35 shows the Advanced options).
Remote Script this parameter must be unset Result Parameters the table must have one entry with Name Result of Type String. The DPL script should set this parameter to OK if the import procedure was successful. Otherwise it may hold an error message which is displayed in the output window.
Figure F.36 shows the Script page which contains the DPL code. The code must be a valid DPL program. It should set the relay parameters according to the input parameters.
07/10/2011
DIgSILENT PowerFactory
Page 69 of 150
The export direction is almost symmetric to the import process. Be d the device whose setting is to exported:
1. 2. 3. 4. 5. let t be d's device type let dpl be the PsmsExport.ComDpl object near t initialize dpl's external object parameter Relay with d execute dpl transfer dpl's output parameter to the setting in StationWare
The export DPL script must also meet some requirements: Figure F.37 shows the Basic options.
Fig. F.37: DPL export script: Basic options Name ComDpl.Name must be PsmsExport. General Selection must be empty Input Parameters this table must be empty External Object this table contains exactly one entry: an object with the Name Relay. The object column must be empty.
The second page of the ComDpl script holds the output parameters. They have the meaning as follows (Figure F.38 shows the Advanced options).
Remote Script this parameter must be unset Result Parameters the table must have the first entry with Name Result of Type String. The DPL script should set this parameter to OK if the import procedure was successful. Otherwise it may hold an error message which is displayed in the output window. Below the Result parameter are the StationWare attributes.
07/10/2011
DIgSILENT PowerFactory
Page 70 of 150
Figure F.39 shows the Script page which contains the DPL code. The code must be a valid DPL program. It should not change the database.
Fig. F.39: DPL export script: Script How to create a new Device Type conversion
This section gives some practical guidelines how to create the conversion scripts for new types. First create a test environment:
create in StationWare a new substation with one device of the desired device type. Create a default PowerFactory setting for this device. create a simple PowerFactory project which contains a device of the desired type link the PowerFactory device to the StationWare device by setting the foreign key to the device ID.
Iterate these steps until there are no error messages. Change the setting in StationWare and re-try the import. In quite the same way create and verify a PsmsExport.ComDpl script.
07/10/2011
DIgSILENT PowerFactory
Page 71 of 150
The DPL adds a new dimension to the DIgSILENT PowerFactory program by allowing the creation of new calculation functions. Such user-defined calculation commands can be used in all areas of power system analysis, such as
Network optimizing Cable-sizing Protection coordination Stability analysis Parametric sweep analysis Contingency analysis etc.
Such new calculation functions are written as program scripts which may use
Flow commands like 'if-then-else and 'do-while' PowerFactory commands (i.e. load-flow or short-circuit commands) Input and output routines Mathematical expressions
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
The DPL command object ComDpl is the central element, which is connecting different parameter, variables or objects to various functions or internal elements and then puts out results or changes parameters. As the input to the script can be predefined input parameters, single objects from the single line diagram or the database or a set of objects/elements, which are then stored inside a so called "General Selection''. These input information can then be evaluated using functions and internal variables inside the script. Also internal objects can be used and executed, like
a calculation command, i.e. ComLdf, ComSim, etc., especially defined with certain calculation options subscripts also released in DPL filter sets, which can be executed during the operation of the script
Thus the DPL script will run a series of operation and start calculation or other function inside the script. It will always communicate with the database and will store changed settings, parameters or results directly in the database objects. There is nearly no object inside the active project, which can not be accessed or altered. During or at the end of the execution of the DPL script, the results can be outputted or parameters of elements my be changed. There is the possibility to execute a predefined output command ComSh or to define own outputs with the DPL commands available.
07/10/2011
DIgSILENT PowerFactory
Page 72 of 150
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Fig. G.2: A DPL command A root command has its own script on the "script'' page of the dialogue. A referring command uses the script of the remote DPL command.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.2.1 Creating a new DPL Command A DPL Command ComDpl can be created by using the "New Object'' ( ) icon in the toolbar of the data manager and selecting DPL Command and more. Then press OK and a new DPL command is created. The dialogue is now shown and the parameters, objects and the script can now be specified. This dialogue is also opened by double-clicking a DPL script, by selecting Edit from the context sensitive menu or by selecting the script from the list when pressing the icon .
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.2.2 Defining a DPL Commands Set The DPL command holds a reference to a selection of objects (General Selection). At first this general selection is empty, but there are several ways to define a special set of object used in the DPL command. This "DPL Commands Set'' (SetSelect) can be specified through:
Select one or more elements in the single line diagram. Then right-click the selection (one of the selected elements) and choose the option Define...> DPL Commands Set... from the context sensitive menu. It is also possible to select several elements in the data manager. Right-click the selection and choose the option Define...> DPL Commands Set... from the context sensitive menu.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.2.3 Executing a DPL Command To execute a DPL command or to access the dialogue of a script, the icon library. The easiest way to start a DPL command AND define a selection for it is
To select one or more elements in the single line diagram or in the data manager and then right-click the selection. Choose the option Execute DPL Scripts from the context sensitive menu. Then select a DPL script from the list. This list will show DPL scripts from the global as well as from the local library. Select a DPL script, insert/change the variables and then press the button Execute
can be activated. This will pop up a list of available DPL scripts from the global and local
In this way the selection is combined into a DPL Commands Set and the set is automatically selected for the script chosen. Only one single DPL command set is valid at a time for all DPL scripts. This means that setting the DPL command set in one DPL command dialogue, will change the DPL command set for all DPL commands in the database.
07/10/2011
DIgSILENT PowerFactory
Page 73 of 150
Note To choose different sets for various DPL scripts you can either use different selection object SetSelect like the "General Set''. Or new DPL command sets can be created and selected inside the active study case. This is done by pressing then selecting the set type. , selecting "other'' and the element "Set (SetSelect)'' and
The interface section Input Parameters is used to define variables that are accessible from outside the DPL command itself. DPL commands that call other DPL commands as subroutines, may use and change the values of the interface variables of these DPL subroutines. The list of External Objects is used to execute the DPL command for specific objects. A DPL command that, for example, searches the set of lines for which a short-circuit causes too deep a voltage dip at a specific busbar, would access that specific busbar as an external object. Performing the same command for another busbar would then only require setting the external object to the other busbar.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.2.4 DPL Advanced Options On the Advanced Options page a Remote script can be selected, which is then used by this script instead of a local defined script on the next page Script. This is a so called "referring command''. The "root command'' as described above in the example uses the local defined script. Also there can be Result parameters defined. These parameters are results from the script and they are stored inside the result object. Hence it is possible to access them through the variable monitor and display them in a plot.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.2.5 DPL Script Page The most important part of a DPL root command is of course the actual DPL program script. That script is written on the Script page of a DPL root command dialogue, if no Remote script is selected. On this page the DPL code of a already defined script is shown and/or new command lines can be inserted for modifying this script or writing a new script. The available commands and the DPL language are described in the following sections. The edited program code also features a highlighting specially suited for handling DPL scripts.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Now a new window will be opened in PowerFactory. Here the script can be written in a very convenient way similar to the programming language C++. The highlighting will be activated automatically. There are several tools which can be used in this editor:
With this icon "Edit Object'' the edit dialogue of the script is opened and the user can Check the modified script for errors or one can Execute it. The script inside the editor and in the dialogue are synchronized each time the script is saved or edited in the dialogue. If this "Disconnect'' icon is pressed, the scripts will not be synchronized anymore. With the "search'' icon the user can activate a Find, a Replace or also a Go To function inside the editor. With the "search next'' icon find/replace/go to the next matching word. With the "search previous'' icon find/replace/go to the previous matching word. With the these icons bookmarks can be set in the editor. Also jump from one bookmark to the next or previous as well as clear all bookmarks.
When finished editing, press the icon and the script will be synchronized with the main dialogue. One can also jump to the main graphics board by selecting the option Window > Graphic... from the main menu.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
The statements in a DPL script are separated by semicolons. Statements are grouped together by braces. Example:
statement1; statement2; if (condition) { groupstatement1; groupstatement2; }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88
07/10/2011
DIgSILENT PowerFactory
Page 74 of 150
support@digsilent.de
G.4.1 Variable Definitions DPL uses the following internal parameter types
double, a 15 digits real number int, an integer number string, a string object, a reference to a PowerFactory object set, a container of objects
Vectors and Matrices are available as external objects. The syntax for defining variables is as follows:
[VARDEF] = [TYPE] varname, varname, ..., varname; [TYPE] = double | int | object | set
All parameter declarations must be given together in the top first lines of the DPL script. The semicolon is obligatory. Examples:
double int string object set Losses, Length, Pgen; NrOfBreakers, i, j; txt1, nm1, nm2; O1, O2, BestSwitchToOpen; AllSwitches, AllBars;
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.4.2 Constant parameters DPL uses constant parameters which cannot be changed. It is therefore not accepted to assign a value to these variables. Doing so will lead to an error message. The following constants variables are defined in the DPL syntax:
SEL is the general DPL selection NULL is the 'null' object this is the DPL command itself
Besides these global constants, all internal and external objects are constant too.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.4.3 Assignments and Expressions The following syntax is used to assign a value to a variable:
variable = expression variable += expression variable -= expression
The add-assignment "+='' adds the right side value to the variable and the subtract-assignment "-='' subtracts the right-side value. Examples:
double x,y;x = 0.5*pi(); ! x now y = sin(x); ! y now x += y; ! x now y -= x; ! y now equals equals equals equals 1.5708 1.0 2.5708 -1.5708
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.4.4 Standard Functions The following operators and functions are available:
Arithmetic operators: +, -, *, / Standard functions ( all trigonometric functions based on radians (RAD)): function sin(x) cos(x) tan(x) asin(x) acos(x) atan(x) sinh(x) cosh(x) tanh(x) exp(x) ln(x) log(x) sqrt(x) sqr(x) pow (x,y) abs(x) min(x,y) max(x,y) modulo(x,y) trunc(x) frac(x) round(x) ceil(x) description sine cosine tangent arcsine arccosine arctangent hyperbolic sine hyperbolic cosine hyperbolic tangent exponential value natural logarithm log10 square root power of 2 power of y absolute value smaller value larger value remainder of x/y integral part fractional part closest integer smallest larger integer example sin(1.2)=0.93203 cos(1.2)=0.36236 tan(1.2)=2.57215 asin(0.93203)=1.2 acos(0.36236)=1.2 atan(2.57215)=1.2 sinh(1.5708)=2.3013 cosh(1.5708)=2.5092 tanh(0.7616)=1.0000 exp(1.0)=2.718281 ln(2.718281)=1.0 log(100)=2 sqrt(9.5)=3.0822 sqr(3.0822)=9.5 pow(2.5, 3.4)=22.5422 abs(-2.34)=2.34 min(6.4, 1.5)=1.5 max(6.4, 1.5)=6.4 modulo(15.6,3.4)=2 trunc(-4.58823)=-4.0000 frac(-4.58823)=-0.58823 round(1.65)=2.000 ceil(1.15)=2.000
07/10/2011
DIgSILENT PowerFactory
Page 75 of 150
floor(x) Table. G.1: DPL Standard Functions Constants: pi() twopi() e() Table. G.2: DPL Internal Constants
floor(1.78)=1.000
pi 2 pi e
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.4.5 Program Flow Instructions The following flow commands are available.
if ( [boolexpr] ) [statlist] if ( [boolexpr] ) [statlist] else [statlist] do [statlist] while ( [boolexpr] ) while ( [boolexpr] ) [statlist] for ( statement ; [boolexpr] ; statement ) [statlist]
in which
[boolexpr] = expression [boolcomp] expression [boolcomp] = "<" | ">" | "=" | ">=" | ">=" | "<>" [statlist] = statement; | { statement; [statlist] }
Unary operators: ".not." Binary operators: ".and." | ".or." | ".nand." | ".nor." | ".eor." Parentheses: {logical expression}
Examples:
if (a<3) { b = a*2; } else { b = a/2; } while (sin(a)>=b*c) { a = O:dline; c = c + delta; } if ({.not.a}.and.{b<>3}) { err = Ldf.Execute(); if (err) { Ldf:iopt_lev = 1; err = Ldf.Execute(); Ldf:iopt_lev = 0; } } for (i = 0; i < 10; i = i+1){ x = x + i; } for (o=s.First(); o; o=s.Next()) { o.ShowFullName(); }
The loop statements 'do-while' and 'while-do' may contain 'break' and 'continue' commands. The 'break' and 'continue' commands may not appear outside a loop statement. The 'break' command terminates the smallest enclosing 'do-while' or 'while-do' statement. The execution of the DPL script will continue with the first command following the loop statement. The 'continue' command skips the execution of the following statements in the smallest enclosing 'do-while' or 'while-do' statement. The execution of the DPL script is continued with the evaluation of the boolean expression of the loop statement. The loop statement list will be executed again when the expression evaluates to TRUE. Otherwise the loop statement is ended and the execution will continue with the first command following the loop statement. Example:
O1 = S1.First(); while (O1) { O1.Open(); err = Ldf.Execute(); if (err) { ! skip this one O1 = S1.Next; continue; } O2 = S2.First(); AllOk = 1; DoReport(0); !reset while (O2) { err = Ldf.Execute(); if (err) { ! do not continue AllOk = 0; break; } else { DoReport(1); ! add } O2 = S2.Next(); } if (AllOk) { DoReport(2); ! report } O1 = S1.Next();}
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.4.6 Input and Output The "input'' command asks the user to enter a value.
input(var, string);
The input command will pop up a window with the string and an input line on which the user may enter a value. The value will be assigned to the variable "var''. The "output'' command writes a line of text to the output window.
output(string);
The string may contain "=''-signs, followed by a variable name. The variable name will then be replaced by the variable's value. Example:
input(diameter, 'enter diameter'); output('the entered value=diameter');
07/10/2011
DIgSILENT PowerFactory
Page 76 of 150
The output command is considered obsolete and has been replaced by the more versatile "printf'' and "sprintf'' functions. Please see the DPL reference for detailed information.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.5.1 Object Variables and Methods If a database object is known to the DPL command, then all its methods may be called, and all its variables are available. For example, if we want to change a load-flow command in order to force an asymmetrical load-flow calculation, we may alter the parameter "iopt_net''. This is done by using an assignment:
Ldf:iopt_net = 1; ! force unbalanced
In this example, the load-flow objects is known as the objects variable "Ldf''. The general syntax for a parameter of a database object is
objectname:parametername
In the same way, it is possible to get a value from a database object, for instance a result from the load-flow calculations. One of such a result is the loading of a line object, which is stored in the variable "c:loading''. The following example performs the unbalanced load-flow and reports the line loading. Example
00. 01. 02. 03. 04. 05. 06. 07. 08. 09. int error; double loading; Ldf:iopt_net = 1; ! force unbalanced error = Ldf.Execute(); ! execute load-flow if (error) { exit(); } else { loading = Line:c:loading; ! get line loading output('loading=loading'); ! report line loading }
This examples is very primitive but it shows the basic methods for accessing database objects and their parameters.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
The example DPL script may now access these objects directly, as the objects "Ldf'' and "Line''. In the following example, the object "Ldf'', which is a load-flow command, is used in line 01 to perform a load-flow.
00. 01. 02. 03. 04. 05. int error; error = Ldf.Execute(); if (error) { output('Load-flow command returns an error'); exit(); }
In line 01, a load-flow is calculated by calling the method "Execute()'' of the load-flow command. The details of the load-flow command, such as the choice between a balanced single phase or an unbalanced three phase load-flow calculation, is made by editing the object "Ldf'' in the database. Many other objects in the database have methods which can be called from a DPL script. The DPL contents are also used to include DPL scripts into other scripts and thus to create DPL "subroutines''.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 77 of 150
Accessing database objects by storing them or a reference to them in the DPL command would create a problem if many objects have to be accessed, for instance if the line with the highest loading is to be found. It would be impractical to create a reference to each and every line. A more elegant way would be to use the DPL global selection and fill it with all lines. The data manager offers several ways in which to fill this object DPL Command Set with little effort. The selection may then be used to access each line indirectly by a DPL "object'' variable. In this way, a loop is created which is performing the search for the highest loading. This is shown in the following example. Example
00. 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. int error; double max; object O, Omax; set S; error = Ldf.Execute(); if (error) exit(); ! execute a load-flow ! exit on error get all selected lines get first line initialize maximum selection'); no lines: exit get next line while more lines update maximum update max loaded line
S = SEL.AllLines(); ! Omax = S.First(); ! if (Omax) { max = Omax:c:loading; ! } else { output('No lines found in exit(); ! } O = S.Next(); ! while (O) { ! if (O:c:loading>max) { max = O:c:loading; ! Omax = O; ! } O = S.Next(); } output('max loading=max for Omax.ShowFullName();
The object SEL used in line 08 is the reserved object variable which equals the General Selection in the DPL command dialogue. The SEL object is available in all DPL scripts at all times and only one single "General Selection'' object is valid at a time for all DPL scripts. This means that setting the General Selection in the one DPL command dialogue, will change it for all other DPL commands too. The method "AllLines()'' in line 08 will return a set of all lines found in the general selection. This set is assigned to the variable "S''. The lines are now accessed one by one by using the set methods "First()'' and "Next()'' in line 09, 16 and 22. The line with the highest loading is kept in the variable "Omax''. The name and database location of this line is written to the output window at the end of the script by calling "ShowFullName()''.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Example:
sagdepth = Bar1:u;
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
The use of remote scripts, external objects and interface variables makes it possible to create generic DPL commands, which may be used with different settings in many different projects and study cases. The easiest way to develop a new DPL command is to create a new ComDpl in the currently active study case and to write the script directly in that DPL object. In such a way, a DPL "root command'' is made. If this root command needs DPL subroutines, then one or more DPL command objects may be created in its contents. Each of these subroutines will normally also be written as root functions. The newly written DPL command with its subroutines may be tested and used in the currently active study case. However, it cannot be executed when another study case is active. In order to use the DPL command in other study cases, or even in other projects, one would have to copy the DPL command and its contents. This, however, would make it impossible to alter the DPL command without having to alter all its copies. The solution is in the use of 'remote scripts'. The procedure to create and use remote scripts is described as follows. Suppose a new DPL command has been created and tested in the currently active study case. This DPL command can now be stored in a save place making it possible to use it in other study cases and projects. This is done by the following steps:
Copy the DPL command to a library folder. This will also copy the contents of the DPL command, i.e. with all it's DPL subroutines and other locally stored objects.
07/10/2011
DIgSILENT PowerFactory
Page 78 of 150
"Generalize'' the copied DPL command by resetting all project specific external objects. Set all interface variable values to their default values. To avoid deleting a part of the DPL command, make sure that if any of the DPL (sub)commands refers to a remote script, all those remote scripts are also stored in the library folder. Activate another study case. Create a new DPL command object (ComDPL) in the active study case. Set the "DPL script'' reference to the copied DPL command. Select the required external objects. Optionally change the default values of the interface variables Press the Check button to check the DPL script
The Check or Execute button will copy all parts of the remote script in the library that are needed for execution. This includes all subroutines, which will also refer to remote scripts, all command objects, and all other objects. Some classes objects are copied as reference, other classes are copied completely. The new DPL command does not contain a script, but executes the remote script. For the execution itself, this does not make a change. However, more than one DPL command may now refer to the same remote script. Changing the remote script, or any of its local objects or sub-commands, will now change the execution of all DPL commands that refer to it.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
G.9.1 Subroutines and Calling Conventions A DPL command object may be included in the contents of another DPL command. In that case, the included DPL "subroutine'' may be called in the script of the enclosing DPL command. In principle, this is not different from calling, for example, a load-flow command from a DPL script. As with most other command objects, the DPL command only has one method:
int Execute() ; executes the DPL script.
The difference is that each DPL subroutine has different interface parameters, which may be changed by the calling command. These interface parameters can also be set directly at calling time, by providing one or more calling arguments. These calling arguments are assigned to the interface parameters in order of appearance. The following example illustrates this. Suppose we have a DPL sub-command "Sub1'' with the interface section as depicted in Figure G.6.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Please see the DPL Reference for a description of these functions including implementation examples.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88
07/10/2011
DIgSILENT PowerFactory
Page 79 of 150
support@digsilent.de
exit () The exit() command terminates a DPL script immediately. If called within a subscript, only the subscript itself will be terminated. In this case, execution will continue in the calling parent script. Arguments: The exit() command has no arguments. Return value: The exit() command has no return value. Example:
int in; int sum; !sums up all entered numbers while(1){ input(in, 'Enter a number please (<0 to stop)'); if (in < 0){ !negative number entered, so calc sum and stop printf('Sum: %d', sum); exit(); !terminate script here } sum += in; }
GetTime
int GetLanguage () Returns the current program language setting. Arguments: none Return value: 0 = English, 1 = German Example: The following example displays a different message, depending on the language.
int err, lng; lng = GetLanguage(); err = Ldf.Execute(); if (err) { if (lng) { output('Load-flow command returned an error'); } else { output('Fehler im Lastfluss Kommando'); } exit(); }
GetGlobalLib
object GetGlobalLib ([string ClassName]) Returns the global library for object-types of class "ClassName''. ClassName may be omitted, in which case the complete global library folder is returned. Arguments:
string ClassName (optional) : The classname of the objects for which the library folder is sought
Return value: The library folder Example: The following example shows the contents of the global library for line types.
object Lib, O; set S; Lib = GetGlobalLib('TypLne'); S = lib.GetContents(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
double Random ([double x1 [,double x2]]) Returns a pseudo random value. If x1 and x2 are omitted, a value in the range of [0 ... 1] is returned. If only x1 is given, the possible range is [0 ... x1] and with both x1 and x2, [x1 ... x2]. Arguments:
SetRandSeed
void SetRandSeed (int N) Initializes the random number generator. One out of 10 predefined initialization seeds can be selected. Arguments:
07/10/2011
DIgSILENT PowerFactory
Page 80 of 150
double fRand (int mode | double p1 | double p2) Returns a stochastic number according to a specific probability distribution. Arguments:
Return value: void Example: The following example prints random numbers for the following distributions:
uni0 : an uniform distribution in [0..1] uni1 : an uniform distribution in [0..50] uni2 : an uniform distribution in [-8, 21]; norm : a normal distribution with mean=30 and standard variance=5 weib : a Weibull distribution with lambda=5 and beta=30 int n; double uni0,uni1,uni2,norm,weib; SetRandSeed(2); for (n=0; n<10; n+=1) { uni0 = fRand(0); uni1 = fRand(0, 50); uni2 = fRand(0, -8, 21); norm = fRand(1, 30, 5); weib = fRand(2, 5, 30); printf('%f %f %f %f %f', uni0, uni1, uni2, norm, weib);}
Results Output:
0.232422 0.877555 0.901226 0.598748 0.588662 0.474393 0.122955 0.554570 0.920789 0.609307 20.225048 31.371372 15.313008 17.908476 35.265549 44.846884 24.725714 17.020344 47.127992 11.819403 20.364702 32.294429 15.165993 11.501229 28.380458 26.404837 14.782988 23.883499 34.911052 -6.831869 28.314934 20.706127 6.403110 25.233148 16.437912 20.024787 35.297444 22.190684 -6.099016 28.535867 27.149573 13.658290 32.858903 30.625329 0.749566 28.616229 21.187893 -6.716297 37.955694 29.645523
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
void ClearOutput () Clears the output window. Arguments: none Return value: void (no return value) Example: The following command clears the output window.
ClearOutput();
printf
07/10/2011
DIgSILENT PowerFactory
Page 81 of 150
Outputs a formatted string. The printf() command uses the C++ printf() formatting syntax. Arguments:
String Format (obligatory): The format string String T (optional): string argument double X (optional): double argument int I (optional): int argument
Return value: void Example: See the format string syntax for examples and more information. The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. The 'printf' will automatically insert a line-break after printing by default. This means that the next 'printf' will start on the next line. The automatic line-break can be disabled by using the "SetLineFeed''-function. See "SetLineFeed'' for more information. Also see "sprintf'' . Also see "fprintf'' . Also see "Error'' . Also see "Warn'' . Also see "Info'' . Also see "Write'' .
Write
int Write (string Format, [object aObj | set aSet], ...) Writes out a line of formatted text, using the DIgSILENT output language. Arguments:
string Format (obligatory): The format string object aObj (optional): An object which is used to get data from set aSet (optional): A set which is used to get objects from
Return value: 0 on success, 1 on error The "Write'' command is used to quickly output a line of formatted output, using the same formatting language as is used for defining reports and result-boxes. See Section 20.2.3 for more information. Because data or parameters of more than object is often written out, the DIgSILENT output language has the special macro "ACC(x)'' to distinguish between these objects. Prior to execution, all given objects and all objects in the given sets are listed together in a single list. The "ACC(x)'' macro returns the object with the index "x'' in that list. The ACC ("acc''="access'') macro can be used more than once for the same object. Interface variables of the DPL script can also be used in the format string by the "DEF'' macro. If the DPL script has "ResX'' as an interface double, then "DEF:ResX'' will access that variable. Example: In the following example, two lines of output are written out. The first line only contains normal text. The second line writes the name and loading of two lines. In this example, "ACC(1)'' refers to the object "LineA', and "ACC(2)'' to "LineB''
Write('The following results are found'); Write('# : #.## # , # : #.## # $N, ACC(1):loc_name,ACC(1):c:loading,[ACC(1):c:loading, ACC(2):loc_name,ACC(2):c:loading,[ACC(2):c:loading', LineA, LineB);
Also see "printf'' . Also see "sprintf'' . Also see "fprintf'' . Also see "Error'' . Also see "Warn'' . Also see "Info'' .
Error
string Error (String Format,String T | double X | int I, ...) Writes a formatted string as error message to the output window. The DPL execution will continue, but a pop-up error message box will appear at the end of execution. Arguments:
String Format (obligatory): The format string String T (optional): string argument double X (optional): double argument int I (optional): int argument
Return value: The formatted string Example: The following example writes an error to the output window.
Error('Index could not be calculated.');
The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. See the format string syntax for more information. Also see "printf'' . Also see "sprintf'' . Also see "fprintf'' . Also see "Warn'' . Also see "Info'' . Also see "Write'' .
Warn
string Warn(String Format, String T | double X | int I, ...) Writes a formatted string as warning to the output window. Arguments:
String Format (obligatory): The format string String T (optional): string argument
07/10/2011
DIgSILENT PowerFactory
Page 82 of 150
The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. See the format string syntax for more information. Also see "printf'' . Also see "sprintf'' . Also see "fprintf'' . Also see "Error'' . Also see "Info'' . Also see "Write'' .
Info
string Info (String Format, String T | double X | int I, ...) Writes a formatted string as information message to the output window. Arguments:
String Format (obligatory) : The format string String T (optional) : string argument double X (optional) : double argument int I (optional) : int argument
Return value: The formatted string Example: The following example writes an info message to the output window.
Info('Trying to calculate first index...');
The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. See the format string syntax for more information. Also see "printf'' . Also see "sprintf'' . Also see "fprintf'' . Also see "Error'' . Also see "Warn'' . Also see "Write'' .
SetLineFeed
void SetLineFeed (int i) Sets or resets the automatic line feed for printf(). Arguments:
int i (obligatory) : use '0' to disable the automatic line feed, use '1' to enable it again.
Return value: void Example: The following example disables the automatic line feed prior to printing a matrix of numbers. The special character '\n' is used to force a line feed.
int i,j; SetLineFeed(0); ! disable line-feed for (i=0; i<3; i+=1) { printf('%2d', i); for (j=1; j<5; j+=1) { printf('\t%2d', i+j); } printf('\n'); ! insert a line-feed }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
void EchoOn () Re-activates the user interface. Arguments: none Return value: void Example: The following example de-activates the user-interface to speed up the calculations, after which the user-interface is re-activated again.
EchoOff(); .. do some calculation ... EchoOn();
07/10/2011
DIgSILENT PowerFactory
Page 83 of 150
void EchoOff () Freezes (de-activates) the user-interface. For each EchoOff(), an EchoOn() should be called. An EchoOn() is automatically executed at the end of a DPL execution, except for when "NoFinalUpdate()'' has been called. Arguments: none Return value: void Example: The following example de-activates the user-interface to speed up the calculations, after which the user-interface is re-activated again.
EchoOff(); .. do some calculation ... EchoOn();
void NoFinalUpdate () Prevents the automatic "EchoOn()'' at end of execution. Arguments: none Return value: void Example:
EchoOff(); .. do some calculation ... NoFinalUpdate();
int GetPageLen (int orientation) Returns the number of lines per page according to the currently selected printer and paper size. Arguments:
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
void fprintf (int iFH, string Format, string T | double X | int I, ...) Writes a formatted string to a file. The fprintf() command uses the C++ printf() formatting syntax. Arguments:
int iFH (obligatory): Number of file handler (0,1,...,9) string Format (obligatory): Defines a format of variable types (int/string/double) to which the fields are assigned string T (optional): Return of the result string double X (optional): Return of the result double int I (optional): Return of the result integer
Return value: A return value of 0 indicates that no fields were assigned. The return value is -1 for an error or if the end of the string is reached before the first conversion. Example: See the format string syntax for examples and more information. The following example outputs a defined string to a file.
double x; int i; string s; fopen('d:\tmp\test.txt','r',0); x = 123456789.987654321; i = 2468; s = 'hello dpl'; fprintf(0,'string:%s int=%d double=%f', s,i,x); fclose(0);
The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. See the format string syntax for more information. Also see "printf'' . Also see "sprintf'' . Also see "Error'' . Also see "Warn'' . Also see "Info'' . Also see "Write'' .
fWrite
The command "fWrite'' is obsolete and has been replaced by the "printf'' command. See "printf'' for more information.
fscanf
int fscanf (int iFH, string Format, string T | double X | int I, ...) Returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. Arguments:
07/10/2011
DIgSILENT PowerFactory
Page 84 of 150
int iFH (obligatory) : Number of file handler (0,1,...,9) string Format (obligatory) : Defines a format of variable types (int/string/double) to which the fields are assigned string T (optional) : Return of the result string double X (optional) : Return of the result double int I (optional) : Return of the result integer
Return value: A return value of 0 indicates that no fields were assigned. The return value is -1 for an error or if the end of the string is reached before the first conversion. Example: The following example assignes the first to fields of the text file 'test.txt' (contents: 'Name 12.333') to the string sRes and the double rVal
fopen('d:\tmp\test.txt','r',0); iRet = fscanf(0,'%s %d',sRes,rVal); printf('%s %.1f iRet = %d',sRes,rVal,iRet); fclose(0);
fscanfsep
int fscanfsep(int iFH, string Ft, string T | double X | int I, ..., string sSep, int iLine) Functionality like fscanf. Returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. This function additionally considers a special character to separate the values, instead of the standard separators like blanks and tabs. It also can be instructed to stop after the line read. Arguments:
int iFH (obligatory) : Number of file handler (0,1,...,9) string Ft (obligatory) : Defines a format of variable types (int/string/double) to which the fields are assigned string T (optional) : Return of the result string double X (optional) : Return of the result double int I (optional) : Return of the result integer string sSep : separator character int iLine (obligatory) : 1 if the interpretation of the line will be stopped after the current line. 0 for continued interpretation.
Return value: A return value of 0 indicates that no fields were assigned. The return value is -1 for an error or if the end of the string is reached before the first conversion. Example:
int iRet; string sRes; fopen('c:\test1.txt','r',0); SetLineFeed(0); while (iRet > -1){ iRet = fscanfsep(0,'%s',sRes,';',1); if (iRet = -1){ break; } printf('%s\n',sRes); } fclose(0);
fopen
int fopen (string Path, string Mode, int iFH, int iRet) Opens file with attribute Mode and assigns an ID iFH of the file handler to the open file. Arguments:
string Path (obligatory): Path of file to open. Path must exist. File could be created depending on the Mode string Mode (obligatory): The attribute for opening the file (r,w,a,r+,w+,a+,b,t) int iFH (obligatory): Number of file handler (0,1,...,9) int iRet (optional): If it is set to 0 or no value is given, the function does not return any value. If different that 0, value is returned
Return value: 0 on success, 1 on error Example: The following example opens a file and closes it again.
fopen('d:\tmp\test.txt','r',0); iRet = fscanf(0,'%s %d',sRes,rVal); printf('%s %.1f iRet = %d',sRes,rVal,iRet); fclose(0);
fclose
void fclose (int iFH) Closes file with the ID iFH of the file handler (between 0 and 9). Arguments:
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.2.4 SetDesktop Methods SetDesktop.Show SetDesktop.WriteWMF SetDesktop.GetPage SetDesktop.SetResults SetDesktop.SetXVar SetDesktop.SetScaleX SetDesktop.DoAutoScaleX SetDesktop.SetAutoScaleX SetDesktop.SetAdaptX
07/10/2011
DIgSILENT PowerFactory
Page 85 of 150
SetDesktop.Show
int SetDesktop.Show ([string name|object O]) Shows the page with the same name as 'O'' or the page with name "name'' in the Graphics Board. The object "O'' is typically a ViPage object but, as only its name is used, it may be any other type of object. Arguments:
void SetDesktop.WriteWMF (string filename) Exports the currently open graphic in the graphics board to a WMF figure. Arguments:
object SetDesktop.GetPage (string name, int create) Searches, activates and returns a graphics page in the currently open Graphics Board. If "create'' is true, then a new ViPage will be created added to the graphics board when no page with the name was found. Arguments:
string name (obligatory) : Name of the page. int create=1 (optional) : create > 0 --> create panel if not exists.
Return value: Virtual Instrument Panel (SetVipage) Example: The following example looks for the Virtual Instrument Panels named Voltage, Current and Power in the Graphics Board currently opened. The pages are created if they do not exist.
object aGrf; object aPageV; object aPageC; object aPageP; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Search or create Virtual Instrument Panels aPageV=aGrf.GetPage('Voltage',1); aPageC=aGrf.GetPage('Current',1); aPageP=aGrf.GetPage('Power',1); }
void SetDesktop.SetResults (object res) Sets default Results (ElmRes) of Graphics Board. Arguments:
void SetDesktop.SetXVar (object obj, string varname) Sets x-axis variable. If obj and varname are empty the default x-axis variable (time) is set. Arguments:
object obj (optional) : x-axis object string varname (optional) : variable of obj
Return value: none Example: The following examples look for an opened Graphics Board and set its x-axis variable. The first example sets an user defined x-axis variable. The second one sets the default x-axis (time).
object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Set user defined x-axis variable
07/10/2011
DIgSILENT PowerFactory
Page 86 of 150
aGrf.SetXVar(line,'m:U1:bus1'); } object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Set default x-axis variable (time) aGrf.SetXVar(); }
void SetDesktop.SetScaleX (double min, double max, int log) Sets scale of x-axis. Invalid arguments like neg. limits for log. scale are not set. No arguments --> automatic scaling. Arguments:
double min (optional) : Minimum of x-scale. double max (optional) : Maximum of x-scale. int log (optional) : > 0 --> x-scale is logarithmic.
Return value: none Example: The following examples look for an opened Graphics Board and set its x-axis scale. There are three different examples. 1. Example: Scale x-axis automatically 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000. Changes to a log. scale
! Scale x-axis automatically object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Scale automatically aGrf.SetScaleX(); } ! Set minimum and maximum without changing map mode object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Set minimum and maximum aGrf.SetScaleX(2,10); } ! Set minimum and maximum, change to log. scaleobject aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Set minimum and maximum aGrf.SetScaleX(1,1000,1); }
int SetDesktop.DoAutoScaleX () Scales the x-axes of all plots in the graphics board which use the x-axis scale defined in the graphics board. The same can be achieved by pressing the Scale button on the x-Axis page of the graphics board. Arguments: none Return value: none Example: The following example looks for a page named voltage and performs an automatic scaling of the x-axes.
! perform autoscale of x-scales of all plots ! using the x-scale definition of the graphics board. object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { aGrf.DoAutoScaleX(); }
void SetDesktop.SetAutoScaleX (int mode) Sets the automatic scaling mode of the x-scale. Arguments:
int mode (obligatory) : Possible values: 0 never, 1 after simulation, 2 during simulation
Return value: none Example: The following example looks for an opened Graphics Board and sets its auto scale mode to off.
! Set autoscale mode to offobject aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Turn off automatic scaling of x-scale aGrf.SetAutoScaleX(0); }
void SetDesktop.SetAdaptX (int mode, double trigger) Sets the adapt scale option of the x-scale. Arguments:
int mode (obligatory) : Possible values: 0 off, 1 on double trigger (optional) : Trigger value, unused if mode is off or empty.
Return value: none Example: The following example looks for an opened Graphics Board and sets its adapt scale option.
object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Turn on adapt scale, use a trigger value of 3 aGrf.SetAdaptX(1,3); ! Turn off adapt scale aGrf.SetAdaptX(0,3);
07/10/2011
DIgSILENT PowerFactory
Page 87 of 150
! Turn on adapt scale again, do not change the trigger value aGrf.SetAdaptX(1); }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
The string printing commands "printf'' , "sprintf'' , "fprintf'' as well as "Write'' , "Error'' , "Warn'' and "Info'' all use the same format string syntax. The format string must contain a valid place holder for every given argument. The placeholder format is
[flags] [width] [.precision] type
The optional "width'' specifies the number of characters to be printed and the optional ".precision'' specifies the number of decimals printed. Example: The following examples shows various placeholder definitions.
double x; int i; string s; x = 123456789.987654321; i = 2468; s = 'hello dpl'; printf('%f|%15.3f|%E|%.2e|%+f|', x,x,x,x,x); printf('%d|%6d|%-6d|', i,i,i); printf('%s|%-20s|%20s|',s,s,s); ! string concat is possible: s = 'this'; s = sprintf('%s %s', s, 'DPL script'); ! print and assign in one action: s = printf('%s %s "%s"', s, 'is called', this:loc_name); printf('%s (again)',s); ! print again:
In addition to placeholders, the printed string may also contain "escape''-sequences for line feeds, tabs, form feeds and color. The following escape-sequences can be used:
"\n'' inserts a line feed "\t'' inserts a horizontal tab "\f'' inserts a form feed, for printing purposes "\\'' writes a backslash, even when the next character is a n,t,f or c "%%'' writes a percent sign "\cx'' inserts a color change, where "x'' is a color, according to the following table, i.e. #"\ce'' switches to blue Table H.3: a b c d e f g h black black red green blue brown cyan magenta i j k l m n o p gray light gray bordeaux dark red dark green light green marine dark blue
Example:
printf('The \cfbrown\ca fox jumped\nover\tthe\nlazy\tcat'); printf('result written to c:\\documents\\pf\\res.txt'); printf('%% = %%%6.2f%% %%', 123.34);
sprintf
string sprintf (String Format, String T | double X | int I, ...) Returns a formatted string. The sprintf() command uses the C++ printf() formatting syntax. Arguments:
String Format (obligatory): The format string String T (optional): string argument double X (optional): double argument int I (optional): int argument
Return value: The formatted string Example: See the format string syntax for examples and more information.
07/10/2011
DIgSILENT PowerFactory
Page 88 of 150
The following example redirects the output to a file. The filename is formatted from a path and the name of the current calculation case. "Redirect'' is an ComOp and "StopRedirect'' is an ComCl object in the DPL command
Redirect:f = sprintf('%s%s.out', 'c:\\MyDocuments\\results0813\\', O:loc_name); Redirect.Execute(); Form.WriteOut(Lines); ! write a report StopRedirect.Execute(); ! stop redirection
Since version 13.1 there is an easier way of writing an string to a file by using "fprintf'' . The output format is defined by the format string. The passed arguments and the passed format string must match. An error message will be produced when, for instance, a format string for two strings is used together with three doubles. See the format string syntax for more information. Also see "printf'' . Also see "fprintf'' . Also see "Error'' . Also see "Warn'' . Also see "Info'' . Also see "Write'' .
ToStr
The command "ToStr'' is obsolete and has been replaced by the "sprintf'' command. See "sprintf'' for more information.
strstr
int strstr (string S1, string S2) Searches for a substring in a string and returns the position of the first letter of substring S2 in string S1. Arguments:
strcpy
String strcpy (string S, int start, int count) Copies a substring from a string. Arguments:
string S (obligatory) : The string int start (obligatory) : The start position in S int count (optional) : Number of characters to copy
Return value: The copied substring Example:
string S1, S2; S1 = 'The brown fox'; S2 = strcpy(S1, 4, 5); ! S2 now equals 'brown'
strcmp
int strcmp (string S1, string S2, int count) Compares two strings. Arguments:
string S1 (obligatory) : The first string string S1 (obligatory) : The second string int count (optional) : Number of characters to compare
Return value:
< 0 when S1 < S2, for up to count characters = 0 S1 = S2, for up to count characters > 0 when S1 > S2, for up to count characters Please notice that the comparison is case sensitive, therefore: i = strcmp('a','A'); ! gives as result: i = 1 i = strcmp('A','a'); ! gives as result: i = -1 i = strcmp('a','a'); ! gives as result: i = 0 strchg
int strchg(string sStr, string sFind, string sNew) Searches in the string sStr for the sub-string sFind and substitutes it by the sub-string sNew. Arguments:
string sStr (obligatory): string to be scanned and modified. string sFind (obligatory): sub-string to be found. string sNew (obligatory): sub-string to be inserted instead of sFind.
Return value:
The first position in sStr where sFind was found (index of the first letter, index begins with 0); -1 if substring was not found.
Example:
int iRet; string sStr, sFind, sNew; sStr = 'This is just a test'; sFind = 'just a'; sNew = 'a very important'; iRet = strchg(sStr,sFind,sNew); if (iRet = -1){ printf('String could not be found!'); } else{ printf('%s',sStr); }
strlen
07/10/2011
DIgSILENT PowerFactory
Page 89 of 150
string strtok (string Source, string Delimiter, int Pos, int Num) Splits the string Source into tokens separated by the characters defined in the Delimiter. The function returns the token between separator (Num-1) and (Num) as a string and the position of the token in the Source. Arguments:
string Source (obligatory) : String containing token(s) string Delimiter (obligatory) : Set of delimiter characters int Pos (obligatory) : Returns the position of token in Source (beginning with 0) int Num (optional) : Number of the token to be read (default = 1)
Return value: Token read. If nothing is read, the token is empty and Pos = -1 Example: The following example searches for different tokens in sStr
string sRes, sStr, sDel; int iPos; sStr = 'Das, ist nur, ein Test mit Nr. (555); weiter nichts'; sDel = ',;()'; sRes = strtok(sStr,sDel,iPos); printf('Token: %s iPos = %d',sRes,iPos); sRes = strtok(sStr,sDel,iPos,2); printf('Token: %s iPos = %d',sRes,iPos); sRes = strtok(sStr,sDel,iPos,4); printf('Token: %s iPos = %d',sRes,iPos);
strftime
Return value: The formatted time string Example: The following example shows the date.
str = strftime('Today is %A, day %d of %B in the year %Y.'); printf('%s', str);
Output:
Today is Wednesday, day 30 of April in the year 2003.
sscanf
int sscanf (string Source, string Format, string T | double X | int I, ...) Returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. Arguments:
string Source (obligatory) : The string string Format (obligatory) : Defines a format of variable types (int/string/double) to which the fields are assigned string T (optional) : Return of the result string double X (optional) : Return of the result double int I (optional) : Return of the result integer
Return value: A return value of 0 indicates that no fields were assigned. The return value is -1 for an error or if the end of the string is reached before the first conversion. Example: The following example assignes the first two fields of string sStr to the string sRes and the double rVal
iPos = 0; sStr = 'Test 23'; iRet = sscanf(sStr,'%s %d',sRes,iPos); printf('%s %d iRet = %d',sRes,iPos,iRet);
07/10/2011
DIgSILENT PowerFactory
Page 90 of 150
Object ActiveProject () Returns the currently active project. Arguments: none Return value: A "IntPrj'' object Example: The following example prints the name of the active project to the output window.
object Prj; Prj = ActiveProject(); Prj.ShowFullName();
GetLocalLib
object GetLocalLib ([string ClassName]) Returns the local library for object-types of class "ClassName''. ClassName may be omitted, in which case the complete local library folder is returned. Arguments:
string ClassName (optional) : The classname of the objects for which the library folder is sought
Return value: The library folder Example: The following example shows the contents of the local library for line types.
object Lib, O; set S; Lib = GetLocalLib('TypLne'); S = Lib.GetContents(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
int IntPrj.Activate () Activates the project. Deactivates other projects first. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
IntPrj.Deactivate
int IntPrj.Deactivate () De-activates the project. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Page 91 of 150
ActiveCase
Object ActiveCase () Returns the currently active Study Case. Arguments: none Return value A "IntCase'' object Example: The following example writes the name of the active study case to the output window.
object aCase; aCase = ActiveCase(); aCase.ShowFullName();
IntCase.Activate
int IntCase.Activate () Activates the study case. Deactivates other study cases first. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
IntCase.Deactivate
int IntCase.Deactivate () De-activates the study case. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
SummaryGrid
Object SummaryGrid () Returns the summary grid in the currently active Study Case. The summary grid is the combination of all active grids in the study case. Arguments: none Return value: A ElmNet object, or a 'NULL' object when no grids are active Example: The following example performs a load-flow and returns the total grid active power losses.
object SumGrid; SumGrid = SummaryGrid(); if (SumGrid) { Ldf.Execute(); output('Active Power Losses=SumGrid:c:LossP'); }
GetGraphBoard
SetDeskTop GetGraphBoard () Returns the currently active Graphics Board. Arguments: none Return value: The graphics board object Example: The following example looks for an opened Graphics Board and sets its default results to the results object named 'Results'.
object aGrf;! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Set default results object aGrf.SetResults(Results); }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.5.2 SetTime Methods SetTime Sets the time Date Sets the date at actual Time Sets the time at actual
SetTime.SetTime
07/10/2011
DIgSILENT PowerFactory
Page 92 of 150
Sets the time in the current year. There is no restriction to the values for H, M and S, except for the fact that negative values are interpreted as zero. Values higher than 24 or 60 will be processed normally by adding the hours, minutes and seconds into an absolute time, from which a new hour-of-year, hour-of-day, minutes and seconds are calculated. Arguments:
double H (obligatory) : The hours double M (optional) : The minutes double S (optional) : The seconds
Return value: none Example: The following sets the time to 1134.45 hours, 91.2 minutes and 675.3 seconds, which results in the time 08:09:27 on the 48'th day of the year.
object Time, Com; Time = GetCaseObject('SetTime'); Time.SetTime(1134.45, 91.2, 675.3);
See also Set Functions and Methods General Object Functions and Methods
SetTime.Date
void SetTime.Date () Sets the current date. Arguments: none Return value: none Example: The following example executes a load-flow for 14:30 at the current day (the computer's system date).
object Time, Com; Time = GetCaseObject('SetTime'); Com = GetCaseCommand('ComLdf'); Time.Date(); Time:hour = 14; Time:min = 30; Com.Execute();
See also Set Functions and Methods General Object Functions and Methods
SetTime.Time
void SetTime.Time () Sets the current time. Arguments: none Return value: none Example: The following example executes a load-flow for the current time and date (the computer's system time).
object Time, Com; Time = GetCaseObject('SetTime'); Com = GetCaseCommand('ComLdf'); Time.Date(); Time.Time(); Com.Execute();
See also Set Functions and Methods General Object Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
void Delete (object O | set S) Deletes an object or a set of objects from the database. The objects are not destroyed but are moved to the recycle bin. Arguments:
object O (optional): The object to delete set S (optional): The set of objects to delete
Return value: void Example: The following example removes all "Dummy" fuses from the network. The 'DummyType' variable is a local variable in the DPL script. A set of objects-to-delete is created first
07/10/2011
DIgSILENT PowerFactory
Page 93 of 150
and then that set is deleted. This has the advantage that one single entry in the recycle bin is created which contains all deleted fuses. Manually restoring ('undelete') the deleted fuses, in case of a mistake, can then be done by a single restore command.
object O; set S, Del; S = AllRelevant(); O = S.Firstmatch('RelFuse'); while (O) { if (O:typ_id=DummyType) { Del.Add(O); } O = S.Nextmatch(); } Delete(Del);
GetCaseObject
object GetCaseObject (string ClassName) Returns the first found object of class "ClassName'' from the currently active calculation case. The object is created when no object of the given name and/or class was found. Returns the default command object of class "ClassName'' from the currently active calculation case. Initializes newly created commands according to the project settings. The icons on the main menu for load-flow, short-circuit, transient simulation, etc. also open the corresponding default command from the currently active study case. Using "GetCaseCommand()" in a DPL script will return the same command. Arguments:
string ClassName (optional) : Class name of the object ("Class''), optionally preceded by an object name without wildcards and a dot ("Name.Class'').
Return value: The found or created object. Example: The following example uses the default SetTime object to change the calculation time, and then executes the load-flow command with the name 'Unbalanced'.
object time, com; time = GetCaseObject('SetTime'); time:hourofyear = 1234; com = GetCaseObject('Unbalanced.ComLdf'); com.Execute();
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.6.2 General Object Methods The object methods are specific for each type of object class. A result file object (ElmRes), for instance, has a "Write'' method, which would not make sense for a load-flow command object. The general syntax for an object method equals that of the set method:
object . [OBJMETHOD] ( arguments) ;
The following overview lists all the non-specific [OBJMETHOD] methods which are available for all classes.
CreateObject Creates a new object. ShowFullName Prints the full database path and name. GetFullName Returns the full database path and name. GetContents Returns the stored objects. GetClass Returns the class name of an object. IsClass Checks for a certain class. GetParent Returns the parent folder. GetNode Returns the node(s) connected to an object. IsNode Checks if the object is a busbar or terminal. GetCubicle Returns the object's cubicle. HasResults Returns if the object has result parameters. GetConnectedElms Returns the set of connected elements. GetConnectionCount Returns the number of electrical connections. Edit Opens the object dialogue. Move Moves an objects to this folder. AddCopy Adds a copy of an object. IsRelevant Returns if the object is used for calculations. IsOutOfService Returns if the object is out of service. IsInFeeder Returns if the object belongs to the feeder. VarExists Checks a variable name. GetNet Returns the grid in which the object is located. GetSize Get the size of a vector or matrix variable. GetVal Returns the value of a parameter. lnm Returns the long name of a variable. snm Returns the short name of a variable. unm Returns the unit of a variable. Unom Returns the nominal voltage. Inom Returns the nominal current. MarkInGraphics Marks the object in the graphic. StochEvt Returns the first or the next state of a stochastic object. See also: Delete Deletes an object. GetCaseObject Returns the found class object from current case. Object.CreateObject
object Object.CreateObject (string ClassNm [, string | int NM1, ...]) Creates a new object of class 'ClassNm' in the target object. The target object must be able to receive an object of the given class. A fatal DPL error will occur when this is not the case, causing the running DPL command to exit. "Fold.CreateObject(aClass, nm1, nm2, ...)'' will create a new object of class aClass and names it to the result of the concatenation of 'nm1', 'nm2', etc. Arguments:
string ClassNm (obligatory) : The class name of the object to create string | int NM1 (optional) : The first part of the object name string | int NM2 (optional) : The next part of the object name
... Return value: The created object, or NULL when no object was created Example: The following example creates a fuse in a set of cubicles. The new fuses will be named "Fuse Nr.0'', "Fuse Nr.1'', etc.
object target; set Cubs; int n; Cubs = SEL.GetAll('StaCubic');
07/10/2011
DIgSILENT PowerFactory
Page 94 of 150
target = Cubs.First(); n = 0; while (target) { target.CreateObject('RelFuse', 'Fuse Nr', n); target = Cubs.Next(); n+=1; }
Object.ShowFullName
void Object.ShowFullName () Writes the complete path and name to the output window. Arguments: none Return value: void Because the complete database path is written to the output window, the written names can be right-clicked in the output window to edit the objects. This procedure is therefore useful for selecting objects which should be inspected or edited after the DPL script has finished. Example: The following example will write all overloaded lines from the selection to the output window.
set S; object O; S = SEL.AllLines(); O = S.First(); while (O) { if (O:c:loading>100.0) { O.ShowFullName(); } O = S.Next(); }
Object.GetFullName
string Object.GetFullName () Returns the complete path and name as a string. Arguments: none Return value: The full name of the object Example: The following example will write all overloaded lines from the selection to the output window.
set S; object O; string objname; S = SEL.AllLines(); O = S.First(); objname = O.GetFullName(); printf('Name of object: %s',objname);
Object.GetContents
set Object.GetContents (string WildCard, int Contents) Returns the set of objects that are stored in the object and which name matches the wildcard. Returns an empty set, if the object's container is empty or if the object is not capable of storing objects. The wildcard may contain (parts of the) name and classname. Arguments:
string WildCard (optional) : class name, possibly containing '*' and '?' characters int Contents (optional) : if Contents = 1, the DPL command will additionally search all subfolders. If Contents = 0 (Default), the DPL command will only search object o.
Return value: The set of objects Example: The following example collects all lines that are stored in line objects.
set Grids, Lines; object pLne, pGrd; Grids = AllRelevant('*.ElmNet'); ! get all grids pGrd = Grids.First(); while (pGrd) { printf('Lines in Grid %s',pGrd:loc_name); ! get all objects of class ElmLne* (ElmLne, ElmLneroute) ! in all pGrd and it's subfolders of pGrd Lines = pGrd.GetContents('*.ElmLne*',1); pLne = Lines.First(); while (pLne) { pLne.ShowFullName(); pLne = Lines.Next(); } pGrd = Grids.Next(); }
Object.GetClass
string Object.GetClass () Returns the class name of the object. Arguments: none Return value: The class name of the object Example: The following example checks to see if two sets start with the same class.
object O1, O2; O1 = S1.First(); O2 = S2.First(); i = O1.IsClass(O2.GetClass()); if (i) { output('Both sets start with the same class'); }
Object.IsClass
int Object.IsClass (string ClassName) Checks to see if the object is of a certain class. Arguments:
07/10/2011
DIgSILENT PowerFactory
Page 95 of 150
while (O) { i = O.IsClass('ElmLne'); if (i) { if (O:c:loading>0.85) O.ShowFullName(); } else { i = O.IsClass('ElmTr2'); if (i) { if (O:c:loading>0.95) O.ShowFullName(); } } O = S.Next(); }
Object.GetParent
object Object.GetParent () Returns the parent folder. Arguments: none Return value: The parent folder object. Example: The following example returns the folder in which a line is stored. The function "GetBestLine()'' is an example DPL script which returns a line.
object Lne, Fold; Lne = GetBestLine(); Fold = Lne.GetParent(); ...
string Object.GetNode (int iBusNo, int iSw) Returns the node(s) connected to the object. Arguments:
int iBusNo (obligatory) : Bus number (0,1) int iSw (obligatory) : Considering configuration of switches (0,1), Default=0
Return value: Connected node object
Object.IsNode
int Object.IsNode () Returns 1 if object is a node (terminal or busbar). Arguments: none Return value: 1 if object is s node, 0 otherwise
Object.GetCubicle
object Object.GetCubicle (int N) Returns the cubicle of an object at the connection with index n, or NULL if there is no cubicle inside the object. Arguments:
void Object.HasResults () Returns 'true' when the object has calculated result parameters. Arguments: none Return value: 'true' (1) or 'false' (0)
Object.GetConnectedElms
set Object.GetConnectedElms ([int rBrk[,int rDis[,int rOut]]]) Returns the set of connected elements. Only electrically connected elements are returned when the conditions of all switches are regarded. Possible connections will also be returned when rBrk and/or rDis is zero, in case of open breakers and/or disconnectors. The default values are (0,0,0). Arguments:
int rBrk (optional) : if true, regards position of breakers int rDis (optional) : if true, regards position of disconnectors int rOut (optional) : if true, regards in-service or out-of-service status
Return value: The set of connected elements
Object.GetConnectionCount
int Object.GetConnectionCount () Returns the number of electrical connections. Arguments: none Return value: The number of connections. Example:
set aSet; int iCount,iCub; object pObj,pCub,pBus; ! list all nodes where a 3-winding transformer is connected aSet = AllRelevant('*.ElmTr3'); for (pObj=aSet.First(); pObj; pObj=aSet.Next()) { iCount = pObj.GetConnectionCount(); for (iCub=0; iCub<iCount; iCub=iCub+1) { pCub=pObj.GetCubicle(iCub); if (pCub) { pBus = pCub:cBusBar; if (pBus) { pBus.ShowFullName(); } } } }
07/10/2011
DIgSILENT PowerFactory
Page 96 of 150
Object.Edit
void Object.Edit () Opens the edit dialogue of the object. Command objects (like the ComLdf) will have their Execute button disabled. The execution of the running DPL script will be halted until the edit dialogue is closed again. Editing of DPL command objects ComDPL is not allowed. Arguments: none Return value: void Example: The following example opens a line dialogue, prior to calculating a load-flow.
MyLine.Edit(); Ldf.Execute();
Object.Move
void Object.Move (object O | set S) Moves an object or a set of objects to this folder. Arguments:
Object.AddCopy
object Object.AddCopy (set aSet | object aObj [, string | int NM1, ...]) Copies a single object or a set of objects to the target object. "Fold.AddCopy(aObj)'' copies object 'aObj' into the target object 'Fold', "Fold.AddCopy(aSet)'' copies all objects in 'aSet' to "Fold''. "Fold.AddCopy(aObj, nm1, nm2, ...)'' will copy aObj and rename it to the result of the concatenation of 'nm1', 'nm2', etc. The target object must be able to receive a copy of the objects. The function "Fold.AddCopy(aObj,...)'' returns the copy of "aObj'', "Fold.AddCopy(aSet)'' returns "Fold'', when the copy operation was successful. A "NULL'' object is returned otherwise. Copying a set of objects will respect all internal references between those objects. Copying a set of lines and their types, for example, will result in a set of copied lines and line types, where the copied lines will use the copied line types. Arguments:
object aObj (obligatory) : The object to copy string | int NM1 (optional) : The first part of the new name string | int NM2 (optional) : The next part of the new name
... Return value: Returns the copy that has been created. Example: The following example copies a fuse to a set of cubicles. The copies will be named "Fuse Nr.0'', "Fuse Nr.1'', etc.
object target, copy; set Cubs; Cubs = SEL.GetAll('StaCubic'); target = Cubs.First(); while (target) { copy = target.AddCopy(aFuse, 'Fuse Nr', n); if (copy) copy.ShowFullName(); target = Cubs.Next(); }
Object.IsRelevant
int Object.IsRelevant () Returns 1 if the object is currently used for calculations. Returns 0 otherwise. Arguments: none Return value: 0 when not used Example: The following example checks if a line is used in the calculation.
i = MyLine.IsRelevant(); if (i) { MyLine.ShowFullName(); }
Object.IsOutOfService
int Object.IsOutOfService () Returns 1 if the object is currently out of service. Returns 0 otherwise. Arguments: none Return value: 0 when not out of service Example: The following example checks if a line is out of service.
i = MyLine.IsOutOfService(); if (i) { MyLine.ShowFullName(); }
Object.IsInFeeder
void Object.IsInFeeder (object Feeder [, double OptNested=0]) Returns if the object belongs to the feeder area defined by "Feeder''. Arguments:
07/10/2011
DIgSILENT PowerFactory
Page 97 of 150
object Feeder (obligatory) : The Feeder definition object double OptNested (optional) : "Nested feeders'' option (1 or 0)
Return value: 1 if "Feeder'' is a feeder definition and the object is in the feeder area, 0 otherwise.
Object.VarExists
int Object.VarExists (string VarName) Checks to see if this object has a currently valid variable called "VarName''. Arguments:
Object.GetNet
object Object.GetNet(void) Returns the grid in which the object is located. Arguments:
none
Return value: The result object or NULL, if the current object is not stored in any grid.
Object.GetSize
int Object.GetSize (string VarName,int rows,int cols) Returns the size of the variable "VarName'' when this variable is a vector or a matrix. Arguments:
string VarName (obligatory) : The name of the variable int rows (obligatory) : The number of rows for a vector or matrix int cols (optional) : The number of columns for a matrix
Return value: 0 when "VarName'' is a valid variable name, else 1. Example: The following example prints the matrix resistances from a Tower model with 2 circuits.
int ierr; double x; int r, rows, c, cols; string s; ierr = Tower.GetSize('R_c',rows, cols); if (.not.ierr) { r=0; while (r<rows) { s = ''; c = 0; while (c<cols) { ierr = Tower.GetVal(x, 'R_c', r,c); if (.not.ierr) s = sprintf('%s %f', s, x); c+=1; } printf(s); r+=1; } }
Example Output :
0.067073 0.016869 0.016594 0.016851 0.016576 0.016372 0.016869 0.066832 0.016701 0.016576 0.016445 0.016408 0.016594 0.016701 0.066738 0.016372 0.016408 0.016516 0.016851 0.016576 0.016372 0.067073 0.016869 0.016594 0.016576 0.016445 0.016408 0.016869 0.066832 0.016701 0.016372 0.016408 0.016516 0.016594 0.016701 0.066738
int Object.GetVal (object/double X,string VarName,int rows,int cols) Returns the value of the variable "VarName'' when this variable is a vector or a matrix, for the given row and column. Arguments:
double/object X (obligatory) : The variable in which to return the result string VarName (obligatory) : The name of the variable int rows (obligatory) : The row number for a vector or matrix int cols (optional) : The column number for a matrix
Return value: 0 when "VarName'' is a valid variable name and row number and column number are in range, else 1. Example: See "GetSize''
Object.lnm
string Object.lnm (string VarName) Returns the long description of the variable. Arguments:
07/10/2011
DIgSILENT PowerFactory
Page 98 of 150
Example output:
Length of Line (Length) = 0.547 [km]
string Object.snm (string VarName) Returns the short variable name. By default, the short name equals the long variable name. In some cases, the variable also has a short name which is used to save space in reports or dialogues. Arguments:
string Object.unm (string VarName) Returns the unit of the variable. Arguments:
double Object.Unom () Returns the nominal voltage of the object. Arguments: none Return value: The nominal voltage Example: The following example collects all high voltage lines. The value VoltageLevel is an input parameter.
set S, Shv; object O; double U; S = SEL.AllLines(); O = S.First(); while (O) { U = O.Unom(); if (U>VoltageLevel) { Shv.Add(O); } O = S.Next(); }
double Object.Inom () Returns the nominal current of the object. Arguments: none Return value: The nominal current Example: The following example collects all high current lines. The value MinCurrent is an input parameter.
set S, Shv; object O; double U; S = SEL.AllLines(); O = S.First(); while (O) { U = O.Inom(); if (U>MinCurrent) { Shv.Add(O); } O = S.Next(); }
void Object.MarkInGraphics () Marks the object in the currently visible graphic by hatch crossing it. Arguments: none Return value: void When the currently visible single line graphic does not contain the object, nothing will happen. Example: The following example will try to mark a set of lines in the single line graphic.
set S; object O; S = SEL.AllLines(); O = S.First(); while (O) { O.MarkInGraphics(); O = S.Next(); }
Object.StochEvt
07/10/2011
DIgSILENT PowerFactory
Page 99 of 150
Returns the first or the next state of a stochastic object, when the object has a valid failure model. Draws a first state, using the state probabilities, when "st'' is omitted. Draws the next state, using Monte-Carlo simulation, when "st'' is given. The drawn state is returned. The duration of the drawn state is returned in "d''. Arguments:
double d (obligatory) : duration of the returned state double st (optional) : current state of the object
Return value: void Example: The following example prints the states of a line for a year. This is a small example of a chronological Monte-Carlo simulation.
SetRandSeed(1); st = Line.StochEvt(t); while (t<8760) { printf('%7.2f %d', t, st); st = Line.StochEvt(d, st); t = t + d; }
result:
1172.67 01186.05 15554.87 05560.11 17873.65 07888.94 18260.78 08274.29 1
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Set AllRelevant (string S |int i) Returns a set with calculation relevant objects, i.e. the objects which are used by the calculations. The set of calculation relevant objects is determined by the currently active study case and the currently active grids. Objects which are out-of-service are ignored when i=0, but are included when i=1 or when i is omitted. A wildcard argument can be given, and only objects whose name and class-name satisfy this wildcard will be returned. Arguments:
string S (optional) : Classname(s) with wildcards int i (optional) : flag to include out of service objects
Return value: The set of all calculation relevant objects, according to the given class-name wildcards Example 1: The following example writes the names of calculation relevant objects for various settings.
set S; object O; printf('all objects, including out-of-service:'); S = AllRelevant(); for (O=S.First(); O; O=S.Next()) { O.ShowFullName(); } printf('all objects, excluding out-of-service:'); S = AllRelevant(0); for (O=S.First(); O; O=S.Next()) { O.ShowFullName(); } printf('all busbars and terminals,'); printf('including out-of-service:'); S = AllRelevant('*.StaBar,*.ElmTerm'); for (O=S.First(); O; O=S.Next()) { O.ShowFullName(); } printf('all lines, excluding out-of-service:'); S = AllRelevant('*.ElmLne',0); for (O=S.First(); O; O=S.Next()) { O.ShowFullName(); }
Example 2: The following example writes the full name of all relevant busbars and terminals in the output window.
set S; object O; S = AllRelevant('*.StaBar,*.ElmTerm'); for (O=S.First(); O; O=S.Next()) { O.ShowFullName(); } ! includes out-of-service objects
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
H.7.2 General Set Methods Set methods are functions for the set type parameters. set . [SETMETHOD] ( arguments) ; The following [SETMETHOD] methods are available:
Add Adds an object. Remove Removes an object. Clear Removes all objects from the set. First Returns the first objects. Next Returns the next object. Firstmatch Returns the first matching object. Nextmatch Returns the next matching object. FirstFilt Returns the first matching object. NextFilt Returns the next matching object. IsIn Searches for an object in the set. Count Returns the number of stored objects. Obj Returns the object at index i. SortToVar Sorts the objects to a variable value. SortToClass Sorts the objects to their class. SortToName Sorts the objects to their names. MarkInGraphics Marks the objects in the graphic. See also: Functions related to Sets SetTime Methods Set.Add
int Set.Add ([object O | set S]) Adds an object or all objects from a set to the set. Arguments: One of the following two parameter has to be given
Set.Remove
Set.Clear
void Set.Clear() Clears the set. Arguments: none Return value: void Example: The following example clears a set
set Sbig; Sbig = SEL.AllLines(); ... Sbig.Clear();
Set.First
Object Set.First() Returns the first object in the set. Arguments: none Return value: The first object or 0 when the set is empty Example: The following example writes the full names of all line in the general selection to the output window.
set S; object O; S = SEL.AllLines(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
07/10/2011
DIgSILENT PowerFactory
Object Set.Next () Returns the next object in the set. Arguments: none Return value: The next object or 0 when the last object has been reached Example: The following example writes the full names of all line in the general selection to the output window.
set S; object O S = SEL.AllLines(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
Object Set.Firstmatch (String WildCard) Set.Firstmatch (string) is obsolete. Use Set.FirstFilt (string) instead.
Set.Nextmatch
Object Set.FirstFilt (String WildCard) Returns the first object from the set which name matches the wildcard. The wildcard may contain (parts of the) name and classname. Arguments:
String WildCard (obligatory) : class name, possibly containing '*' and '?' characters
Return value: The first matching object, or NULL when no first object exists. Example: The following example writes all two and three winding transformers whose name start with a "T'' to the output window
set S; object O; S = AllRelevant(); O = S.FirstFilt('T*.ElmTr?'); while (O) { O.ShowFullName(); O = S.NextFilt(); }
int Set.NextFilt () Returns the next object from the set which name matches the wildcard. Arguments: none Return value: The next object, or NULL when no next object exists. Example: The following example writes all two and three winding transformers to the output window
set S; object O; S = AllRelevant(); O = S.FirstFilt('T*.ElmTr?'); while (O) { O.ShowFullName(); O = S.NextFilt(); }
int Set.IsIn (object O) Checks if the set contains object 'O'. Arguments:
Set.Count
int Set.Count () Returns the number of objects in the set. Arguments: none Return value: The number of objects in the set. Example: The following example terminates the DPL script when the general selection is found to contain no lines.
set S; int n;
07/10/2011
DIgSILENT PowerFactory
Set.Obj
int Set.Obj (int Index) Returns the object at the given index in the set. Arguments:
int Set.SortToVar (int R, string V1, ..., string V5) Sorts the objects in the set to the variable names. Sorts the objects to the values for V1. Within the sorting for V1, a sub-sorting for V2, sub-sub-sorting for V3, etc., until V5 can be performed. The sorting is from higher values to lower when R==1, and reverse when R==0. Arguments:
int R (obligatory) : sorting direction string V1 (obligatory) : first variable name string V2 (optional) : , ..., string V5 (optional) : 2nd..5th variable names
Return value: 0 on success Example: The following example writes all lines to the output window, sorted to derating factor and length.
set S; object O; S = AllRelevant('*.ElmLne,*.ElmLneRoute'); S.SortToVar(0, 'fline', 'dline'); O = S.First(); while (O) { printf('%10s %f %f',O:loc_name,O:fline,O:dline); O = S.Next(); }
Set.SortToClass
int Set.SortToClass (int R) Sorts the objects in the set to their class name. The sorting is from A..Z when R=0 and reverse when R=1. Arguments:
Set.SortToName
int Set.SortToName (int R) Sorts the objects in the set to their name. Sorts the objects in the set to their name. The sorting is from A..Z when R=0 and reverse when R=1. Arguments: int R (obligatory) : sorting direction Return value: 0 on success Example: The following example writes all objects to the output window, sorted to names.
set S; object O; S = AllRelevant(); S.SortToName(0); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
Set.MarkInGraphics
void Set.MarkInGraphics () Marks all objects in the set in the currently visible graphic by hatch crossing them. Arguments: none Return value: void Example: The following example will try to mark a set of lines in the single line graphic.
set S; object O; S = SEL.AllLines(); S.MarkInGraphics();
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.7.3 SetFilt Methods Get Returns a container with the filtered objects
SetFilt.Get
07/10/2011
DIgSILENT PowerFactory
none Return value: The set of filtered objects Example: The following example shows the names of objects filtered by the FiltLongLines.SetFilt filter
set S; object O; S = FiltLongLines.Get(); O = S.First(); while (O) { O.ShowFullName(); O=S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.7.4 SetSelect Methods All Returns all objects GetAll Returns all of the given class AddRef Add references Clear Empties the selection AllElm Returns all elements AllLines Returns all lines AllBars Returns all busbars and terminals AllLoads Returns all loads AllAsm Returns all asynchronous machines AllSym Returns all synchronous machines AllTypLne Returns all line types AllBreakers Returns all breakers AllClosedBreakers returns all closed breakers AllOpenBreakers returns all open breakers
SetSelect.AddRef
void SetSelect.AddRef ([object O | set S]) Adds a reference to the objects to the existing selection. Arguments: One of the following two parameter has to be given
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.Clear
void SetSelect.Clear () Empties the selection. Arguments: none Return value: void Example: The following example creates a selection of all loads in the general DPL selection.
set S; S = SEL.AllLines(); MySelection.Clear(); MySelection.AddRef(S);
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllElm
Set SetSelect.AllElm () Returns all elements (Elm*) in the selection. Arguments: none Return value: The set of objects
07/10/2011
DIgSILENT PowerFactory
Example: The following example writes all objects in the general DPL selection to the output window.
set S; object O; S = SEL.AllElm(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllLines
Set SetSelect.AllLines () Returns all lines and line routes in the selection. Arguments: none Return value: The set of objects Example: The following example writes all lines and line routes in the general DPL selection to the output window.
set S; object O; S = SEL.AllLines(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllBars
Set SetSelect.AllBars () Returns all busbars and terminals in the selection. Arguments: none Return value: The set of objects Example: The following example writes all bars in the general DPL selection to the output window.
set S; object O; S = SEL.AllBars(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllLoads
Set SetSelect.AllLoads () Returns all loads in the selection. Arguments: none Return value: The set of objects Example: The following example writes all loads in the general DPL selection to the output window.
set S; object O; S = SEL.AllLoads(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllAsm
Set SetSelect.AllAsm () Returns all asynchronous machines in the selection. Arguments: none Return value: The set of objects Example: The following example writes all asynchronous machines in the general DPL selection to the output window.
set S; object O; S = SEL.AllAsm(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
07/10/2011
DIgSILENT PowerFactory
Set SetSelect.AllSym () Returns all synchronous machines in the selection. Arguments: none Return value: The set of objects Example: The following example writes all synchronous machines in the general DPL selection to the output window.
set S; object O; S = SEL.AllSym(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllTypLne
Set SetSelect.AllTypLne () Returns all line types in the selection. Arguments: none Return value: The set of objects Example: The following example writes all line types in the general DPL selection to the output window.
set S; object O; S = SEL.AllTypLne(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.All
Set SetSelect.All () Returns all objects in the selection. Arguments: none Return value: The set of objects Example: The following example writes objects in the general DPL selection to the output window.
set S; object O; S = SEL.All(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.GetAll
Set SetSelect.GetAll (String ClassName) Returns all objects in the selection which are of the class 'ClassName'. Arguments:
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllBreakers
07/10/2011
DIgSILENT PowerFactory
Return value: The set of objects Example: The following example writes all breakers in the general DPL selection to the output window.
set S; object O; S = SEL.AllBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllClosedBreakers
Set SetSelect.AllClosedBreakers () Returns all closed breakers in the selection. Arguments: none Return value: The set of objects Example: The following example writes all closed breakers in the general DPL selection to the output window.
set S; object O; S = SEL.AllClosedBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetSelect.AllOpenBreakers
Set SetSelect.AllOpenBreakers () Returns all open breakers in the selection. Arguments: none Return value: The set of objects Example: The following example writes all open breakers in the general DPL selection to the output window.
set S; object O; S = SEL.AllOpenBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.7.5 Feeder (SetFeeder) Methods GetAll Returns all objects in the feeder GetBuses Returns all nodes in the feeder GetBranches Returns all branches in the feeder
SetFeeder.GetAll
Set SetFeeder.GetAll () Returns all objects in the feeder. Arguments: none Return value: The set with all objects Example: The following example gets all feeder objects.
set S; S = Feeder1.GetAll();
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetFeeder.GetBuses
Set SetFeeder.GetBuses () Returns all busbars and terminals in the feeder. Arguments:
07/10/2011
DIgSILENT PowerFactory
none Return value: The set with all busbars and terminals Example: The following example gets all feeder bars.
set S; S = Feeder1.GetBuses();
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetFeeder.GetBranches
Set SetFeeder.GetBranches () Returns all branches in a feeder. Arguments: none Return value: The set with all branches Example: The following example gets all feeder branches
set S; S = Feeder1.GetBranches();
See also Functions related to Sets General Set Methods General Object Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.7.6 Path (SetPath) Methods GetAll Returns all objects in the path GetBusses Returns all nodes in the path GetBranches Returns all branches in the path AllBreakers Returns all breakers in the path AllClosedBreakers Returns all closed breakers in the path AllOpenBreakers Returns all open breakers in the path
SetPath.GetAll
Set SetPath.GetAll () Returns all objects in the path definition. Arguments: none Return value: The set of objects Example: The following example writes all objects in the path definition to the output window.
set S; object O; S = aPath.GetAll(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetPath.GetBusses
Set SetPath.GetBusses () Returns all busbars and terminals in the path definition. Arguments: none Return value: The set of objects Example: The following example writes all busbars and terminals in the path definition to the output window.
set S; object O; S = aPath.GetBusses(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetPath.GetBranches
07/10/2011
DIgSILENT PowerFactory
Arguments: none Return value: The set of objects Example: The following example writes all branches in the path definition to the output window.
set S; object O; S = aPath.GetBranches(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetPath.AllBreakers
Set SetPath.AllBreakers () Returns all breakers in the path definition. Arguments: none Return value: The set of objects Example: The following example writes all breakers in the path definition to the output window.
set S; object O; S = aPath.AllBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetPath.AllClosedBreakers
Set SetPath.AllClosedBreakers () Returns all closed breakers in the path definition. Arguments: none Return value: The set of objects Example: The following example writes all closed breakers in the path definition to the output window.
set S; object O; S = aPath.AllClosedBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
SetPath.AllOpenBreakers
Set SetPath.AllOpenBreakers () Returns all open breakers in the path definition. Arguments: none Return value: The set of objects Example: The following example writes all open breakers in the path definition to the output window.
set S; object O; S = aPath.AllOpenBreakers(); O = S.First(); while (O) { O.ShowFullName(); O = S.Next(); }
See also Functions related to Sets General Set Methods General Object Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Time-Domain Simulation Functions and Methods Result Export (ComRes) Methods Contingency Case (ComOutage) Methods Contingency Analysis (ComSimoutage) Methods Contingency Definition (ComNmink) Methods Reliability Assessment (ComRel3) Methods DPL Command (ComDpl) Methods ComEcho Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
Commands can be execute by using the Execute() method: int Com.Execute () Arguments: none Example: The following example executes a command named 'Com'
Com.Execute();
See also the specialized Execute methods for individual commands. ComLdf.Execute ComShc.Execute ComInc.Execute ComSimoutage.Execute ComSimoutage.ExecuteCntcy ComRel3.Execute ComDpl.Execute
ResetCalculation
void ResetCalculation () Resets all calculations and destroys all volatile calculation results. Arguments: none Return value: void (no return value) Results that have been written to result objects (for display in graphs) will not be destroyed. All results that are visible in the single line diagrams, however, will be destroyed. Example: The following example resets all calculations
ResetCalculation();
GetCaseCommand
object GetCaseCommand (string ClassName) This command is obsolete. Please use the more versatile "GetCaseObject'' in stead. Please refer to "GetCaseObject()'' .
Exe
void Exe (string Command) Immediately executes the command, bypassing the command pipe in the input window. The DPL command will continue after the command has been executed. The 'Exe' command is provided for compatibility and testing purposes only and should only be used by experienced users. Arguments:
void PostCommand (string Command) Adds a command to the command pipe in the input window. The posted commands will be executed after the DPL command has finished. Arguments:
07/10/2011
DIgSILENT PowerFactory
Example: The following command causes the PowerFactory program to end after the DPL script has finished.
PostCommand('exit');
ClearCommands
void ClearCommands () Clears the command pipe of the input window. Arguments: none Return value: void (no return value) Example: The following command clears the input window.
ClearCommands();
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int validLDF () Checks to see if the last load-flow results are still valid and available. Arguments: none Return value: 0 if no load-flow results are available Example: The following example checks if a load-flow is available, and performs one when not.
int valid; valid = validLDF(); if (.not.valid) { Ldf.Execute(); }
ComLdf.Execute
int ComLdf.Execute () Execute a load-flow calculation. Arguments: none Return value: 0 on success Example: The following example executes the ComLdf command name 'Ldf'
Ldf.Execute();
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int validSHC () Checks to see if the last short-circuit results are still valid and available. Arguments: none Return value: 0 if no short-circuit results are available Example: The following example checks if a short-circuit result is available, and performs one when not.
int valid; valid = validSHC(); if (.not.valid) { Shc.Execute(); }
ComShc.Execute
int ComShc.Execute () Executes a short-circuit calculation. Arguments: none Return value: 0 on success Example: The following example execute the ComShc command named 'Shc'
Shc.Execute();
07/10/2011
DIgSILENT PowerFactory
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int validRMS () Checks to see if the last RMS simulation results are still valid and available. Arguments: none Return value: 0 if no RMS simulation results are available Example: The following example checks if a RMS simulation is available, and performs one when not.
int valid; valid = validRMS(); if (.not.valid) { Rms.Execute(); }
validSIM
int validSIM () Checks to see if the last simulation results are still valid and available. Arguments: none Return value: 0 if no simulation results are available Example: The following example checks if a simulation result is available.
int valid; valid = validSIM(); if (.not.valid) { output('No simulation result available'); }
ComInc.Execute
int ComInc.Execute () Executes a calculation of initial values. Arguments: none Return value: 0 on success Example: The following example executes the ComInc command named 'Inc'
Inc.Execute();
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.8.5 Result Export (ComRes) Methods ExportFullRange Exports the whole data range FileNmResNm Sets the filename for the data export
ComRes.ExportFullRange
int ComRes.ExportFullRange () Executes the export command for the whole data range. Arguments: none Return value: 0 Example: The following example exports a range of results
object O; set S; S = SEL.GetAll('ElmRes'); O = S.First(); while (O) { Export:pResult = O; Export.ExportFullRange(); O = S.Next(); }
See also General Object Functions and Methods Set Functions and Methods
ComRes.FileNmResNm
07/10/2011
DIgSILENT PowerFactory
int ComRes.FileNmResNm () Sets the filename for the data export. Arguments: none Return value: 1 See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.8.6 Contingency Case (ComOutage) Methods SetObjs Sets the list of objects according to S GetObject Returns the object at position i RemoveEvents Removes events stored inside the comman
ComOutage.SetObjs
object ComOutage.GetObject (int line) Get the element stored in line number line in the table of ComOutage. The line index starts with 0. Arguments:
int line (obligatory):line index, if index exceeds the range NULL is returned
Return value: the element of line line in the table. Example: The following example shows how to access elements in the table of all ComOutage whose names start with "L".
object aCmd, aOutage, aElm; set Outages; int iElements, iElm; aCmd = GetCaseObject('*.ComRel3'); ! get rel. command from study case if (aCmd) { ! get all outages of which the names starts with "L" Outages = aCmd.GetContents('L*.ComOutage'); ! show the elements of all outages for (aOutage=Outages.First(); aOutage; aOutage=Outages.Next()) { aOutage.GetSize('Elms',iElements); ! get size of vector Elms for (iElm=0; iElm<iElements; iElm=iElm+1) { aElm = aOutage.GetObject(iElm); !aOutage.GetVal(aElm,'Elms',iElm); same like GetObject aElm.ShowFullName(); } } }
See also General Object Functions and Methods Set Functions and Methods Object.GetVal
ComOutage.RemoveEvents
void ComOutage.RemoveEvents (string type, int info) Removes events stored inside the command. Arguments:
Return value: none Example: The following example shows how to remove events from ComOutage
object aCmd, aOutage; set Outages; aCmd = GetCaseObject('*.ComRel3'); ! get rel. command from study case if (aCmd) { ! get all outages of which the names starts with "L" Outages = aCmd.GetContents('L*.ComOutage'); ! remove the events for (aOutage=Outages.First(); aOutage; aOutage=Outages.Next()) { aOutage.RemoveEvents(0);! delete remaining,suppress info message } }
DIgSILENT GmbH
07/10/2011
DIgSILENT PowerFactory
www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.8.7 Contingency Analysis (ComSimoutage) Methods Reset Resets the intermediate results Execute Executes a ComSimoutage after resetting the results ExecuteCntcy(object O) Executes a ComSimoutage for all outage cases stored in the object O, without resetting results AddCntcy(object O) Executes a ComOutage without resetting results, for the outage cases stored in object O SetLimits Sets the voltage limits to Umn and Umx and the loading limit to Lmx. ReportObjs Returns the objects which are normally given to the reporting command to produce the contingency reports.
ComSimoutage.Reset
int ComSimoutage.Reset () Resets the intermediate results of the outage simulation. Arguments: none Return value: O on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
ComSimoutage.Execute
int ComSimoutage.Execute () Executes an outage simulation after resetting the results. Arguments: none Return value: O on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
ComSimoutage.ExecuteCntcy
int ComSimoutage.ExecuteCntcy (object O) Executes an (additional) ComSimoutage, without resetting results. The results of the outage analyses will be added to the intermediate results. Object "O'' must be a ComSimoutage object. Outage definitions in O which have already been analyzed will be ignored. Arguments:
int ComSimoutage.AddCntcy (object O, string name) Executes an (additional) ComOutage, without resetting results. The results of the outage analysis will be added to the intermediate results. Object "O'' must be a ComOutage object. If the outage definition has already been analyzed, it will be ignored. The ComOutage will be renamed to "name'' when "name'' is given. Arguments:
object O (obligatory) : The ComOutage object string name (optional) : A name for the outage
Return value: O on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
ComSimoutage.SetLimits
int ComSimoutage.SetLimits (double vlmin, double vlmax, double ldmax) Sets the limits for the outage simulation. Arguments:
double vlmin (obligatory) : The minimum voltage double vlmax (obligatory) : The maximum voltage double ldmax (obligatory) : The maximum loading
Return value: 1 always Example: The following example analyses all selected outage definitions and adds the results to the intermediate results.
set s; object o; s = SEL.GetAll('ComOutage'); o = s.First(); while (o) { CA.AddCntcy(o); o = s.Next(); }
See also General Object Functions and Methods Set Functions and Methods
ComSimoutage.ReportObjs
07/10/2011
DIgSILENT PowerFactory
Returns the objects which are normally given to the reporting command to produce the contigency report. Arguments:
set set (obligatory) : Initial set of objects int mode (obligatory) : Report mode (1..4)
Return value: set of objects for report. See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.8.8 Contingency Definition (ComNmink) Methods AddRef Adds shortcuts Clear Empties the selection GetAll Returns all objects of class 'ClassName'
ComNmink.AddRef
void ComNmink.AddRef ([object O | set S]) Adds shortcuts to the objects to the existing selection. Arguments: One of the following two parameter has to be given
See also General Object Functions and Methods Set Functions and Methods
ComNmink.Clear
void ComNmink.Clear () Empties the selection. Arguments: none Return value: void Example: The following example creates a selection of all loads.
PrepOut.Clear(); S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { if (O:c:loading>75) { PrepOut.AddRef(O); } O = S.Nextmatch(); } PrepOut.Execute();
See also General Object Functions and Methods Set Functions and Methods
ComNmink.GetAll
Set ComNmink.GetAll (String ClassName) Returns all objects which are of the class 'ClassName'. Arguments:
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
H.8.9 Reliability Assessment (ComRel3) Methods Execute Executes the command RemoveOutages Removes contingency definitions RemoveEvents Removes events stored in contingencies AnalyseElmRes Evaluates results object created in last calculation
ComRel3.Execute
int ComRel3.Execute () Executes the Level 3 reliability assessment calculations. Arguments: none Return value: 0 on success Example: The following example executes a ComRel3 Command named 'Rel3'
Rel3.Execute();
ComRel3.RemoveOutages
void ComRel3.RemoveOutages () Removes all contingency definitions (*.ComOutage) stored inside the command. This is exactly the same like pressing the button named "Delete Contingencies" in the dialogue box of the command. Arguments:
Return value: none Example: The following example removes all ComOutage objects stored inside the ComRel command in the study case.
object aCmd; aCmd = GetCaseObject('*.ComRel3'); ! get the command from study case if (aCmd) { aCmd.RemoveOutages(0); ! suppress info message }
ComRel3.RemoveEvents
void ComRel3.RemoveEvents (string type, int info) Removes events stored inside the contingencies (*.ComOutage) inside the command. Arguments:
Return value: none Example: The following example shows how to remove events from the ComOutage commands stored inside ComRel3:
object aCmd; aCmd = GetCaseObject('*.ComRel3'); ! if (aCmd) { aCmd.RemoveOutages('Lod');! delete aCmd.RemoveOutages('Gen');! remove aCmd.RemoveOutages(0); ! delete } get the command from study case all EvtLod all EvtGen remaining, suppress info message
ComRel3.AnalyseElmRes
int ComRel3.AnalyseElmRes (int error) Evaluate the results object created by the last calculation. Performs exactly the same like pressing the button 'Perform Evaluation of Result File' in the dialogue box of the command. Arguments:
Return value: 0 on success, !=0 on error. Example: The following example shows how to call the evaluation of the results.
object aCmd, aResFile; int iError; aCmd = GetCaseObject('*.ComRel3'); ! get the command from study case if (aCmd) { iError=aCmd.AnalyseElmRes(0); ! hide error message if (iError) { ! display my own error message aResFile = aCmd:p_resenum; if (aResFile) { Error('Evaluation of results %s failed', aResFile:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
H.8.10 DPL Command (ComDpl) Methods Execute Executes an external DPL script as a subroutine
ComDpl.Execute
int ComDpl.Execute (user defined arguments) Executes an external DPL script as a subroutine. Arguments: user defined arguments Return value: 0 on success Example: The following example performs a load-flow and calls the DPL subroutine "CheckVoltages'' to check the voltage conditions.
int err; err = Ldf.Execute(); if (.not.err) err = CheckVoltages(0.94, 1.05); if (err) printf('Voltage conditions are violated');
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.8.11 ComEcho Methods On Turns on the user interface Off Turns off the user interface
ComEcho.On
int ComEcho.On () Turns on the user interface. ComEcho.On() is obsolete. Use the internal command EchoOn instead. Arguments: none Return value: 0 on success Example: The following example turns off the user interface, calls a subroutine and turns it back on again.
aEcho.Off(); PerformCalculation(); aEcho.On();
See also General Object Functions and Methods Set Functions and Methods
ComEcho.Off
int ComEcho.Off () Turns off the user interface. ComEcho.Off() is obsolete. Use the internal command EchoOff instead. Arguments: none Return value: 0 on success Example: The following example turns off the user interface, calls a subroutine and turns it back on again.
aEcho.Off(); PerformCalculation(); aEcho.On();
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.1 Grid (ElmNet) Methods Activate Adds a grid to the active study case Deactivate Removes a grid from the active study case
ElmNet.Activate
int ElmNet.Activate () Adds a grid to the active study case. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
ElmNet.Deactivate
int ElmNet.Deactivate () Removes a grid from the active study case. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.2 Induction Machine Type (TypAsm) Methods CalcElParams Calculates the electrical parameters
TypAsm.CalcElParams
int TypAsm.CalcElParams () Calculates the electrical parameters from the input data. Arguments: none See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.3 Induction Machine Type (TypAsmo) Methods CalcElParams Calculates the electrical parameters
TypAsmo.CalcElParams
int TypAsmo.CalcElParams () Calculates the electrical parameters from the input data. Arguments: none See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.4 Feeder (ElmFeeder) Methods GetAll Returns all objects in this feeder GetBuses Returns all buses in this feeder GetBranches Returns all branch elements in this feeder GetNodesBranches Returns all buses and branches in this feeder GetObjs Returns all objects of class 'ClassName'' in this feeder
07/10/2011
DIgSILENT PowerFactory
ElmFeeder.GetAll
set ElmFeeder.GetAll (int iNested) Returns a set with all objects belonging to this feeder. Arguments:
int iNested (optional) : In case of nested feeders, all elements will be returned when iNested=1, otherwise only the objects up to the next feeder will be returned.
Return value: The set of feeder objects. Example:
set aAll,aFeeders; object pPrj,pFeeder,pObj; ! output elements in the feeders pPrj = ActiveProject(); if (pPrj) { aFeeders = pPrj.GetContents('*.ElmFeeder',1); aFeeders.SortToVar(0,'loc_name'); for (pFeeder=aFeeders.First(); pFeeder; pFeeder=aFeeders.Next()){ printf('Elements in feeder %s',pFeeder:loc_name); aAll = pFeeder.GetAll(1); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmFeeder.GetBuses
set ElmFeeder.GetBuses (int iNested) Returns a set with all buses belonging to this feeder. Arguments:
int iNested (optional) : In case of nested feeders, all elements will be returned when iNested=1, otherwise only the objects up to the next feeder will be returned.
Return value: The set of bus elements in feeder. Example:
set aNodes,aFeeders; object pPrj,pFeeder,pObj; ! output elements in the feeders pPrj = ActiveProject(); if (pPrj) { aFeeders = pPrj.GetContents('*.ElmFeeder',1); aFeeders.SortToVar(0,'loc_name'); for (pFeeder=aFeeders.First(); pFeeder; pFeeder=aFeeders.Next()){ printf('Buses in feeder %s',pFeeder:loc_name); aNodes = pFeeder.Getbuses(1); for (pObj=aNodes.First(); pObj; pObj=aNodes.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmFeeder.GetBranches
set ElmFeeder.GetBranches (int iNested) Returns a set with all branch elements belonging to this feeder. Arguments:
int iNested (optional) : In case of nested feeders, all elements will be returned when iNested=1, otherwise only the objects up to the next feeder will be returned.
Return value: The set of branch elements in feeder. Example:
set aBranches,aFeeders; object pPrj,pFeeder,pObj; ! output elements in the feeders pPrj = ActiveProject(); if (pPrj) { aFeeders = pPrj.GetContents('*.ElmFeeder',1); aFeeders.SortToVar(0,'loc_name'); for (pFeeder=aFeeders.First(); pFeeder; pFeeder=aFeeders.Next()){ printf('Branches in feeder %s',pFeeder:loc_name); aBranches = pFeeder.GetBranches(1); for (pObj=aBranches.First(); pObj; pObj=aBranches.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmFeeder.GetNodesBranches
set ElmFeeder.GetNodesBranches (int iNested) Returns a set with all buses and branches belonging to this feeder. Arguments:
int iNested (optional) : In case of nested feeders, all elements will be returned when iNested=1, otherwise only the objects up to the next feeder will be returned.
Return value: The set of bus and branch elements in feeder. Example:
set aAll,aFeeders; object pPrj,pFeeder,pObj; ! output elements in the feeders pPrj = ActiveProject(); if (pPrj) { aFeeders = pPrj.GetContents('*.ElmFeeder',1); aFeeders.SortToVar(0,'loc_name'); for (pFeeder=aFeeders.First(); pFeeder; pFeeder=aFeeders.Next()){ printf('Branches and Nodes in feeder %s',pFeeder:loc_name); aAll = pFeeder.GetNodesBranches(1); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmFeeder.GetObjs
07/10/2011
DIgSILENT PowerFactory
set ElmFeeder.GetObjs (string ClassNameint iNested) Returns a set with all objects of class 'ClassName'' which belong to this feeder. Arguments:
int iNested (optional) : In case of nested feeders, all elements will be returned when iNested=1, otherwise only the objects up to the next feeder will be returned.
Return value: The set of feeder objects. Example:
set aAll,aFeeders; object pPrj,pFeeder,pObj; ! output elements in the feeders pPrj = ActiveProject(); if (pPrj) { aFeeders = pPrj.GetContents('*.ElmFeeder',1); aFeeders.SortToVar(0,'loc_name'); for (pFeeder=aFeeders.First(); pFeeder; pFeeder=aFeeders.Next()){ printf('Cubicles in feeder %s',pFeeder:loc_name); aAll = pFeeder.GetObjs('StaCubic'); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int ElmComp.Slotupd () Performs a slot update for the composite model, to automatically select available models for the slots. Arguments: none Return value: void See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.6 Breaker/Switch (ElmCoup) Methods Close Closes the buscoupler Open Opens the buscoupler IsOpen Returns 1 when the coupler is open IsClosed Returns 1 when the coupler is closed
ElmCoup.Close
int ElmCoup.Close () Closes the buscoupler. Arguments: none Return value: 0 on success Example: The following example gathers all open couplers before closing them.
int opn; set S, So; object O; S = Couplers.AllElm(); O = S.First(); while (O) { opn = O.IsOpen(); if (opn) { O.Close(); So.Add(O); }; }
See also General Object Functions and Methods Set Functions and Methods
ElmCoup.Open
int ElmCoup.Open () Opens the buscoupler. Arguments: none Return value: 0 on success Example: The following example gathers all closed couplers before opening them.
int cl; set S, Sc; object O; S = Couplers.AllElm(); O = S.First();
07/10/2011
DIgSILENT PowerFactory
See also General Object Functions and Methods Set Functions and Methods
ElmCoup.IsOpen
int ElmCoup.IsOpen () Returns 1 when the coupler is open. Arguments: none Return value: 1 when open, 0 when closed Example: See ElmCoup.Close for an example
ElmCoup.IsClosed
int ElmCoup.IsClosed () Returns 1 when the coupler is closed. Arguments: none Return value: 1 when closed, 0 when open Example: See ElmCoup.Open for an example
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.7 Line (ElmLne) Methods HasRoutes Returns if the line is subdivided into routes HasRoutesOrSec Returns if the line is subdivided into routes or sections GetType Returns the line type object IsCable Returns if this is a cable IsNetCoupling Returns if the line connects two grids SetCorr Sets the correction factor of the line CreateFeederWithRoutes Splits the line in 2 routes
ElmLne.HasRoutes
int ElmLne.HasRoutes () Returns if the line is subdivided into routes. Arguments: none Return value: 0 when the line is a single line, 1 when it is subdivided into routes. Example: The following example reports all lines with routes.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { i = O.HasRoutes(); if (i) O.ShowFullName(); O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods
ElmLne.HasRoutesOrSec
int ElmLne.HasRoutesOrSec () Returns if the line is subdivided into routes or sections. Arguments: none Return value: 0 when the line is a single line, 1 when it is subdivided into routes, 2 when into sections. Example: The following example reports all lines with sections.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { i = O.HasRoutesOrSec(); if (i=2) O.ShowFullName(); O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods
ElmLne.GetType
int ElmLne.GetType ()
07/10/2011
DIgSILENT PowerFactory
Returns the line type object. Arguments: none Return value: The TypLne object Example: The following example reports all 'untyped' lines
set S; object O, T; S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { T = O.GetType(); if (T=0) { O.ShowFullName(); } O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods
ElmLne.IsCable
int ElmLne.IsCable () Returns if this is a cable. Arguments: none Return value: 1 when the line is a cable, otherwise 0. Example: The following example reports the loading of all cables.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { i = O.IsCable(); if (i) { Write('# : #.## $N, @ACC(1):loc_name, @ACC(1):c:loading, O); } O = S.Nextmatch(); }
ElmLne.IsNetCoupling
int ElmLne.IsNetCoupling () Returns if the line connects two grids. Arguments: none Return value: 1 when the line is a coupler, otherwise 0. Example: The following example reports all the loading of all couplers
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLne'); while (O) { i = O.IsNetCoupling(); if (i) { Write('# : #.## $N, @ACC(1):loc_name, @ACC(1):c:loading, O); } O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods
ElmLne.SetCorr
int ElmLne.SetCorr () Sets the correction factor of the line, according to IEC364-5-523. Arguments: none Return value: 0 on success, 1 on error; Example: The following example sets a correction factor.
BuriedLine.SetCorr();
See also General Object Functions and Methods Set Functions and Methods
ElmLne.CreateFeederWithRoutes
int ElmLne.CreateFeederWithRoutes (double dis,double rem,object O[int sw0,int sw1]) Creates a new feeder in the line by splitting the line in 2 routes and inserting a terminal. Arguments:
double dis (obligatory) : double rem (obligatory) : object O (obligatory) : A branch object that is to be connected at the inserted terminal. int sw0 (optional) : when true, a switch is inserted on the one side int sw1 (optional) : when true, a switch is inserted on the other side
Return value: 0 on success, 1 on error; See also General Object Functions and Methods
07/10/2011
DIgSILENT PowerFactory
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.8 Line Route (ElmLneroute) Methods IsCable Returns if the route is a cable HasSections Returns if the line route is subdivided into sections Hint: ElmLneroute has been replaced by ElmBranch containing ElmLne in PowerFactory Version 14.0. Please refer to Line (ElmLne) Methods.
ElmLneroute.IsCable
int ElmLneroute.IsCable () Returns if the route is a cable. Arguments: none Return value: 1 when a cable, otherwise 0. Example: The following example reports all cable routes.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLneroute'); while (O) { i = O.IsCable(); if (i) O.ShowFullName(); O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods Hint: ElmLneroute has been replaced by ElmBranch containing ElmLne in PowerFactory Version 14.0. Please refer to Line (ElmLne) Methods.
ElmLneroute.HasSections
int ElmLneroute.HasSections () Returns if the line route is subdivided into sections. Arguments: none Return value: 1 when subdivided sections, 0 otherwise Example: The following example reports all lines routes with sections.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('ElmLneroute'); while (O) { i = O.HasSections(); if (i) O.ShowFullName(); O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods Hint: ElmLneroute has been replaced by ElmBranch containing ElmLne in PowerFactory Version 14.0. Please refer to Line (ElmLne) Methods.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.9 Line Type (TypLne) Methods IsCable Returns if the line type is a cable type SetNomCurr Sets the nominal current of the line type
TypLne.IsCable
int TypLne.IsCable () Returns if the line type is a cable type. Arguments: none Return value: 1 when the line type is a cable type, otherwise 0. Example: The following example reports all cable types.
set S; object O; int i; S = AllRelevant(); O = S.Firstmatch('TypLne'); while (O) { i = O.IsCable(); if (i) O.ShowFullName(); O = S.Nextmatch(); }
See also General Object Functions and Methods Set Functions and Methods
TypLne.SetNomCurr
int TypLne.SetNomCurr ()
07/10/2011
DIgSILENT PowerFactory
Sets the nominal current of the line type, according to IEC364-5-523. Arguments: none Return value: 0 on success, 1 on error. Example: The following example sets the correction factor.
BuriedLineType.SetNomCurr();
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.10 Result Object (ElmRes) Methods Init Initializes the result object Clear Clears the result object Write Writes the current results Draw Updates all relevant plots WriteDraw Writes results and updates all plots SetAsDefault Sets this as default results AddVars Adds to the list of monitored variables GetObj Returns objects used in the result file
ResIndex Returns column number of variable in result object. GetResData Returns a value from a certain result curve. ResNval Returns number of values stored in certain result curve. ResNvars Returns the number of variables (columns) in result file. LoadResData Loads the data of a result file in memory. ElmRes.Init
int ElmRes.Init () Initializes the result object. This is required for all result files that are not stored in the DPL command object. Arguments: none Return value: 0 on success Example: The following example initializes the result object.
Res.Init();
See also General Object Functions and Methods Set Functions and Methods
ElmRes.Clear
int ElmRes.Clear () Clears the result object. Arguments: none Return value: 0 on success Example: The following example clears the result object.
Res.Clear();
See also General Object Functions and Methods Set Functions and Methods
ElmRes.Write
int ElmRes.Write () Writes the current results to the result object. Arguments: none Return value: 0 on success Example: The following example performs load-flows for a number of load levels and writes the results to the result object
double P; double i; P = LoadMin; i = 1; while ({P<LoadMax}.and.{i}) { i = Ldf.Execute(); if (i) { Res.Write(); P += LoadStep; } }
See also General Object Functions and Methods Set Functions and Methods
ElmRes.Draw
07/10/2011
DIgSILENT PowerFactory
int ElmRes.Draw () Updates all plots that display values from the result object. Arguments: none Return value: 0 on success Example: The following example updates the graphics every 10 steps to save time and yet follow the results while calculating
double i,n; Ld:pini = LoadMin; i = 1; n = 0; while ({Ld:pini<LoadMax}.and.{i}) { i = Ldf.Execute(); if (i) { Res.Write(); n += 1; Ld:pini += LoadStep; } if (n>9) { Res.Write(); n = 0; } }
See also General Object Functions and Methods Set Functions and Methods
ElmRes.WriteDraw
int ElmRes.WriteDraw () Writes current results to the result objects and updates all plots that display values from the result object. Arguments: none Return value: 0 on success Example: The following example performs load-flows for a number of load levels and writes the results to the result object
double P; double i; P = LoadMin; i = 1; while ({P<LoadMax}.and.{i}) { i = Ldf.Execute(); if (i) { Res.WriteDraw(); P += LoadStep; } }
See also General Object Functions and Methods Set Functions and Methods
ElmRes.SetAsDefault
void ElmRes.SetAsDefault () Sets this results object as the default results object. Arguments: none Return value: none See also General Object Functions and Methods Set Functions and Methods
ElmRes.AddVars
void ElmRes.AddVars (object O, string v1 [,string v2,...]) Adds variables to the list of monitored variables for the Result object. Arguments:
object O (obligatory) : an object. string v1 (obligatory) : variable name for object O. string v2..v9 (optional) : optional further variables names for object O.
Return value: none Example:
object Res; Res = MyResults(); Res.AddVars(MyLine,'m:Ikss:busshc','m:I:busshc');
See also General Object Functions and Methods Set Functions and Methods
ElmRes.GetObj
object ElmRes.GetObj (int index) Returns the objects used in the result file. Positive index means objects for which parameters are being monitored (i.e. column objects). Negative index means objects which occur in written result rows as values. Arguments:
07/10/2011
DIgSILENT PowerFactory
Returns the column number of the variable 'vnm' of object 'O' in the result object 'res'. An error is produced when 'res' is not a ElmRes object, when 'O' is not in the result file. Arguments:
object res (obligatory) : the result file object O (obligatory) : The monitored object string vnm (obligatory) : the name of the monitored variable of object 'O'
Return value: The index of the variable. This index can be used in "GetResData'' to retrieve the value. A negative index is returned when 'vnm' is not in the result file. Example:
object obj, res; double x, x1, x2; int n, ix, i1, i2; int Nval; obj = GetCaseCommand('ComInc'); res = obj:p_resvar; LoadResData(res); Nval = ResNval(res,0); obj = res.GetObject(1); i1 = ResIndex(res, obj, 'm:I1:bus1'); i2 = ResIndex(res, obj, 'm:U1:bus1'); if (i1<0.or.i2<0) exit(); ix = 0; while (ix<Nval) { GetResData(x, res, ix); GetResData(x1, res, ix, i1); GetResData(x2, res, ix, i2); printf('%8.5f %8.5f %8.5f', x, x1, x2); ix += 1; }
int GetResData (double d, object O, int iX, int iCrv) Returns a value from a result object for row iX of curve iCrv. An error is produced when O is not a ElmRes object. Arguments:
double d (obligatory) : the returned value object O (obligatory) : The result file object int iX (obligatory) : the row index int iCrv (optional) : The curve number, which equals the variable or column number, first column value (time,index, etc.) is returned when omitted.
Return value:
0 when ok 1 when iX out of bound 2 when iCrv out of bound 3 when invalid value is returned ('INFINITY', 'DUMMY', etc.)
int ResNval (object O, int iCrv) Returns the number of values stored in result object for curve iCrv. An error is produced when O is not a ElmRes object. Arguments: object O (obligatory) : The result file object int iCrv (obligatory) : The curve number, which equals the variable or column number. Also see "LoadResData()'' .
ResNvars
int ResNvars (object O) Returns the number of variables (columns) in result file. An error is produced when O is not a ElmRes object. Arguments:
void LoadResData (object O) Loads the data of a result file (ElmRes) in memory. An error is produced when O is not a ElmRes object. Arguments:
An example (depending of the results in the result object) of the output for this script :
Nvar=3 Nval=11 -0.050000 : 0.12676 30.73286 12.91360 -0.040000 : 0.12676 30.73286 12.91360 -0.030000 : 0.12676 30.73286 12.91360 -0.020000 : 0.12676 30.73286 12.91360 -0.010000 : 0.12676 30.73286 12.91360 -0.000000 : 0.12676 30.73286 12.91360 0.010000 : 0.12676 30.73286 12.91360
07/10/2011
DIgSILENT PowerFactory
: : : :
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.11 Zone (ElmZone) Methods GetAll Returns all objects in this zone GetBuses Returns all buses in this zone GetNodes Returns all nodes in this zone GetBranches Returns all branches and buses in this zone GetObjs Returns all objects of the given class in this zone
ElmZone.GetAll
set ElmZone.GetAll () Returns all objects which belong to this zone. Arguments: none Return value: The set of objects Example:
set aAll,aZones; object pPrj,pZone,pObj; ! output elements in the zone pPrj = ActiveProject(); if (pPrj) { aZones = pPrj.GetContents('*.ElmZone',1); aZones.SortToVar(0,'loc_name'); for (pZone=aZones.First(); pZone; pZone=aZones.Next()) { printf('Elements in zone %s',pZone:loc_name); aAll = pZone.GetAll(); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmZone.GetBuses
set ElmZone.GetBuses () Returns all buses which belong to this zone. Arguments: none Return value: The set of objects See also General Object Functions and Methods Set Functions and Methods
ElmZone.GetNodes
set ElmZone.GetNodes () Returns all nodes which belong to this zone. Arguments: none Return value: The set of objects Example:
set aAll,aZones; object pPrj,pZone,pObj; ! output elements in the zone pPrj = ActiveProject(); if (pPrj) { aZones = pPrj.GetContents('*.ElmZone',1); aZones.SortToVar(0,'loc_name'); for (pZone=aZones.First(); pZone; pZone=aZones.Next()) { printf('Nodes in zone %s',pZone:loc_name); aAll = pZone.GetBuses(); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) { printf(' %s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name); } } }
See also General Object Functions and Methods Set Functions and Methods
ElmZone.GetBranches
set ElmZone.GetBranches () Returns all branches which belong to this zone. Arguments: none Return value: The set of objects Example:
set aAll,aZones; object pPrj,pZone,pObj; ! output elements in the zone pPrj = ActiveProject(); if (pPrj) { aZones = pPrj.GetContents('*.ElmZone',1); aZones.SortToVar(0,'loc_name'); for (pZone=aZones.First(); pZone; pZone=aZones.Next()) { printf('Branches in zone %s',pZone:loc_name); aAll = pZone.GetBranches(); for (pObj=aAll.First(); pObj; pObj=aAll.Next()) {
07/10/2011
DIgSILENT PowerFactory
printf(' } } }
%s\\%s',pObj:r:fold_id:loc_name,pObj:loc_name);
See also General Object Functions and Methods Set Functions and Methods
ElmZone.GetObjs
set ElmZone.GetObjs (string classname) Returns all objects of the given class which belong to this zone. Arguments:
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.9.12 Switch (StaSwitch) Methods Close Closes the switch Open Opens the switch IsOpen Returns if the switch is open IsClosed Returns if the switch is closed Hint: StaSwitch has been replaced by ElmCoup in PowerFactory Version 14.0. Please refer to Breaker/Switch (ElmCoup) Methods.
StaSwitch.Close
int StaSwitch.Close () Closes the switch. Arguments: none Return value: 0 on success Example: The following example gathers all open switches before closing them.
int opn; set S, So; object O; S = Switches.AllElm(); O = S.First(); while (O) { opn = O.IsOpen(); if (opn) { O.Close(); So.Add(O); }; }
See also General Object Functions and Methods Set Functions and Methods Hint: StaSwitch has been replaced by ElmCoup in PowerFactory Version 14.0. Please refer to Breaker/Switch (ElmCoup) Methods.
StaSwitch.Open
int StaSwitch.Open () Opens the switch. Arguments: none Return value: 0 on success Example: The following example gathers all closed switches before opening them.
int cl; set S, Sc; object O; S = Couplers.AllElm(); O = S.First(); while (O) { cl = O.IsClosed(); if (opn) { O.Open(); Sc.Add(O); }; }
See also General Object Functions and Methods Set Functions and Methods Hint: StaSwitch has been replaced by ElmCoup in PowerFactory Version 14.0. Please refer to Breaker/Switch (ElmCoup) Methods.
StaSwitch.IsOpen
int StaSwitch.IsOpen ()
07/10/2011
DIgSILENT PowerFactory
Checks if the switch is open. Arguments: none Return value: 1 when open, 0 when closed Example: See StaSwitch.Close for an example. Hint: StaSwitch has been replaced by ElmCoup in PowerFactory Version 14.0. Please refer to Breaker/Switch (ElmCoup) Methods.
StaSwitch.IsClosed
int StaSwitch.IsClosed () Checks if the switch is closed. Arguments: none Return value: 1 when closed, 0 when open Example: See StaSwitch.Open for an example. Hint: StaSwitch has been replaced by ElmCoup in PowerFactory Version 14.0. Please refer to Breaker/Switch (ElmCoup) Methods.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.10.1 SetVipage Methods GetVI SetStyle SetTile SetResults SetXVar SetScaleX SetDefScaleX DoAutoScaleX DoAutoScaleY SetAutoScaleX SetAdaptX GetScaleObjX
SetVipage.GetVI
object SetVipage.GetVI (string name, string class, int create) Searches for a virtual instruments on the Virtual Instrument Panel. Arguments:
string name (obligatory) : Name of Virtual Instrument string class='VisPlot' (optional) : classname of Virtual Instrument. int create=1 (optional) : create >0 --> create panel if not exists.
Return value: Virtual Instrument Example: The following example looks for a Plot (VisPlot) named RST on a Virtual Instrument Panel. The plot is created if it was not found.
object aGrf; object aPage; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get plot named RST. Create the plot if not exists aPlot=aPage.GetVI('RST','VisPlot',1); } }
void SetVipage.SetStyle (string name) Sets style folder of Virtual Instrument Panel. Arguments:
07/10/2011
DIgSILENT PowerFactory
The following example looks for a Virtual Instrument Panel named Voltage and sets its style to 'Paper'.
object aGrf; object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set style named Paper aPage.SetStyle('Paper'); } }
int tile=1 (optional) : tile > 0 --> tile Virtual Instruments, tile =0 --> arrange them horizontally.
Return value: none Example: The following example looks for a Virtual Instrument Panel named Voltage and rearranges the Virtual Instrument.
object aGrf;object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Arrange the VIs horizontally aPage.SetTile(0); ! Tile VIs (default input parameter is 1) aPage.SetTile(); } }
void SetVipage.SetResults (object res) Sets default Results (ElmRes) of Virtual Instrument Panel. Arguments:
void SetVipage.SetXVar (object obj, string varname) Sets x-axis variable. If obj and varname are empty the default x-axis variable (time) is set. Arguments:
object obj (optional) : x-axis object string varname (optional) : variable of obj
Return value: none Example: The following examples look for a Virtual Instrument Panel named Voltage and set the x-axis variable. The first example sets an user defined x-axis variable of the Virtual Instrument Panel. The second one sets the default x-axis (time).
object aGrf; object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set x-scale from 100 to 120 aPage.SetScaleX(100,120); ! Set x-scale variable aPage.SetXVar(line,'m:U1:bus1'); } } object aGrf; object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set x-scale from 100 to 120 aPage.SetScaleX(100,120); ! Set default x-scale variable (time) aPage.SetXVar(); } }
void SetVipage.SetScaleX (double min, double max, int log) Sets scale of x-axis. Invalid arguments like negative limits for logarithmic scale are not set. No input arguments --> automatic scaling. Arguments:
double min (optional) : Minimum of x-scale. double max (optional) : Maximum of x-scale. int log (optional) : > 0 --> x-scale is logarithmic.
Return value: none
07/10/2011
DIgSILENT PowerFactory
Example: The following examples look for a Virtual Instrument Panel named Voltage and set its x-axis scale. There are three different examples. 1. Example: Scale x-scale automatically. 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000. Changes to a log. scale
! Scale x-scale automatically. object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Automatic scaling aPage.SetScaleX(); } } ! Set minimum and maximum without changing map modeobject aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set minimum and maximum aPage.SetScaleX(0,20); } } ! Set minimum and maximum, set map mode to log. object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set minimum and maximum, change to log. scale aPage.SetScaleX(1,1000,1); } }
void SetVipage.SetDefScaleX () Sets default scale of x-axis (SetDesktop). Arguments: none Return value: none Example: The following example looks for a Virtual Instrument Panel named Voltage and resets the option 'Use local x-Axis' to 0. After that the x-scale used is the Graphics Board (SetDesktop).
! Set default x-scale object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' aPage.SetDefScaleX(); } }
int SetVipage.DoAutoScaleX () Scales the x-axes of all plots on the virtual instrument panel automatically. The same can be achieved by pressing the icon Arguments: none Return value: none Example: The following example looks for a page named voltage and performs an automatic scaling of the x-axes.
! perform autoscale of x-axis of all plots on page object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { aPage.DoAutoScaleX(); } }
int SetVipage.DoAutoScaleY () Scales the y-axes of all plots on the virtual instrument panel automatically. The same can be achieved by pressing the icon Arguments: none Return value: none Example: The following example looks for a page named voltage and performs an automatic scaling of the y-axes.
! perform autoscale of y-axis of all plots on page object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { aPage.DoAutoScaleY(); } }
07/10/2011
DIgSILENT PowerFactory
void SetVipage.SetAutoScaleX (int mode) Sets automatic scaling mode of the x-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 never, 1 after simulation, 2 during simulation
Return value: none Example: The following examples look for a Virtual Instrument Panel named Voltage and change its auto scale mode. The first example works fine, the second one generates an error message because the x-scale is unused.
! Set autoscale mode Off object aGrf; object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set limits to change x-scale of page to used scale aPage.SetScaleX(0,10); ! Turn off automatic scaling of x-scale aPage.SetAutoScaleX(0); } } ! Try to set autoscale mode to online object aGrf; object aPage; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' of Virtual Instrument Panel aPage.SetDefScaleX(); ! Try to set automatic scaling of x-scale to Online aPage.SetAutoScaleX(2); } }
void SetVipage.SetAdaptX (int mode, double trigger) Sets the adapt scale option of the x-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 off, 1 on double trigger (optional) : Trigger value, unused if mode is off or empty
Return value: none Example: The following examples look for a Virtual Instrument Panel named Voltage and sets its adapt scale option. The first example works fine, the second one generates an error message because the x-scale is unused.
! Modify adapt scale option of Virtual Instrument Panel object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set x-scale limits to set option 'Use local x-Axis' aPage.SetScaleX(0,20); ! Turn on adapt scale, use a trigger value of 3 aPage.SetAdaptX(1,3); ! Turn off adapt scale aPage.SetAdaptX(0,3); ! Turn on adapt scale again, do not change the trigger value aPage.SetAdaptX(1); } } ! Try to turn on adapt scale object aPage; object aGrf; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' of Virtual Instrument Panel aPage.SetDefScaleX(); ! Try to turn on adapt scale, use a trigger value of 3 ! Leads to error message because scale is not local aPage.SetAdaptX(1,3); } }
object SetVipage.GetScaleObjX () Returns used object defining x-scale. The returned object is either the Virtual Instrument Panel itself or the Graphics Board. Arguments: none Return value: Object defining the x-scale. Example: The following examples look for a Virtual Instrument Panel named Voltage and get the used x-scale object. GetScaleObjX of the first example gets the Graphics Board, in the second one the Virtual Instrument Panel itself is returned.
! Used scale is Graphics Board object aPage; object aGrf; object aScale; ! Look for opened graphics board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' of Virtual Instrument Panel aPage.SetDefScaleX(); ! Get object defining scale aScale=aPage.GetScaleObjX(); if (aPage=aScale) { output('The scale used is the Virtual Instrument Panel itself.'); } else if (aGrf=aScale) { output('The scale used is the Graphics Board.'); } else { output('The scale used was not found.'); } } } ! Used scale is Virtual Instrument Panel itself object aPage; object aGrf; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard();
07/10/2011
DIgSILENT PowerFactory
if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set x-scale to change it to local aPage.SetScaleX(1,100); ! Get object defining scale aScale=aPage.GetScaleObjX(); if (aPage=aScale) output('The scale used is the Virtual Instrument Panel itself.'); else if (aGrf=aScale) output('The scale used is the Graphics Board.'); else output('The scale used was not found.'); } }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.10.2 VisPlot/VisPlot2 Methods AddVars AddResVars Clear SetXVar SetScaleX SetScaleY SetDefScaleX SetDefScaleY DoAutoScaleX DoAutoScaleY DoAutoScaleY2 SetAutoScaleX SetAutoScaleY SetAdaptX SetAdaptY GetScaleObjX GetScaleObjY SetCrvDesc
VisPlot.AddVars
void VisPlot.AddVars (string V, object O1,...,O8) void VisPlot.AddVars (object O, string V1,...V8) Appends variables to the SubPlot. Variables which are already in the plot are not added. Arguments:
object O (obligatory) : Object for which variables V1..V8 are added string V1..V8 (obligatory) : One to eight variables names for object O
or
string V (obligatory) : Variable name which is added for objects O1..O8 object O1..O8 (obligatory) : One to eight objects variable V
Return value: none Using AddVars a single object with different variables or one variable with several objects can be add to the Subplot. To append a list of variables of a single object the first input parameter is an object followed by a list of maximum nine variables. To append the same variable for several objects the first input parameter is the variable name followed by a list of maximum nine objects. Example: The following examples look for a Subplot named RST on Virtual Instrument Panel named Voltage and append a list of variables. 1. Example: Append several variables for one single object. 2. Example: Append one variable for a list of objects.
! Append several variables for one single object. object aPage; object aGrf; object aPlot; object aScale; ! Note: object load is an interface parameter, ! therefore it is not defined here ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Clear variable list aPlot.Clear(); ! Append variables aPlot.AddVars(load, 'm:U1:bus1','m:U1l:bus1','m:phiu1:bus1'); } } } ! Append several objects with one single variable object aPage; object aGrf; object aPlot; object aScale; ! objects load,line and xnet are interface parameters, ! therefore they are not defined here. ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Clear variable list aPlot.Clear(); ! Append variables aPlot.AddVars('m:U1:bus1',load, line, xnet); } } }
07/10/2011
DIgSILENT PowerFactory
VisPlot.AddResVars
void VisPlot.AddResVars (object Res, string V, object O1,...,O7) void VisPlot.AddResVars (object Res, object O, string V1,...V7) Appends variables from a specific result file to the SubPlot. Combinations of result file and variables which are already in the plot are not added. Arguments:
object O (obligatory) : Object for which variables V1..V8 are added string V1..V8 (obligatory) : One to eight variables names for object O
or
string V (obligatory) : Variable name which is added for objects O1..O8 object O1..O8 (obligatory) : One to eight objects variable V
Return value: none See "AddResVars'' for more information.
VisPlot.Clear
void VisPlot.Clear() Removes all variables from SubPlot. Arguments: none Return value: none Example: The following example looks for a Subplot named RST on Virtual Instrument Panel named Voltage and removes all variables from the plot.
! Remove all variables in Subplot named RST on ! Virtual Instrument Panel named Voltage object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get Subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Remove all variables from Subplot aPlot.Clear(); } } }
void VisPlot.SetXVar (object obj, string varname) Sets x-axis variable. If obj and varname are empty the default x-axis variable (time) is set. Arguments:
object obj (optional) : x-axis object string varname (optional) : variable of obj
Return value: none Example: The following examples look for a Subplot named RST and set its x-axis variable. The first example sets an user defined x-axis variable of the plot. The second one sets the default x-axis variable (time).
! Set user defined x-axis variable object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get Subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set x-scale from 100 to 120 aPlot.SetScaleX(100,120); ! Set x-scale variable aPlot.SetXVar(line,'m:U1:bus1'); } } } ! Set default x-axis variable (time) object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get Subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set x-scale from 100 to 120 aPlot.SetScaleX(100,120); ! Set default x-scale variable (time) aPlot.SetXVar(); } } }
void VisPlot.SetScaleX (double min, double max, int log) Sets scale of x-axis. Invalid arguments like negative limits for logarithmic scale are not set. No arguments --> automatic scaling. Arguments:
double min (optional) : Minimum of x-scale. double max (optional) : Maximum of x-scale. int log (optional) : > 0 --> x-scale is logarithmic.
Return value: none
07/10/2011
DIgSILENT PowerFactory
Example: The following examples look for a Subplot named 'RST' and set its x-scale. There are three different examples. 1. Example: Perform auto scaling on x-axis. 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000. Changes to a log. scale
! Automatic scaling of x-scale object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Automatic scaling aPlot.SetScaleX(); } } } ! Set minimum and maximum without changing map mode object aPage; object aGrf;object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set minimum and maximum aPlot.SetScaleX(0,20); } } } ! Set minimum and maximum, set map mode to log. object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set minimum and maximum, change to log scale aPlot.SetScaleX(1,1000,1); } } }
void VisPlot.SetScaleX (double min, double max, int log) Sets scale of y-axis. Invalid arguments like negative limits for logarithmic scale are not set. No arguments --> automatic scaling. Arguments:
double min (optional) : Minimum of y-scale. double max (optional) : Maximum of y-scale. int log (optional) : > 0 --> y-scale is logarithmic.
Return value: none Example: The following examples look for a Subplot named 'RST' and set its y-axis scale. There are three different examples. 1. Example: Perform auto scaling on y-Axis. 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000. Changes to a log. scale
! Automatic scaling of y-scale object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Automatic scaling aPlot.SetScaleY(); } } } ! Set minimum and maximum without changing map mode object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set minimum and maximum aPlot.SetScaleY(0,20); } } } ! Set minimum and maximum, set map mode to log. object aPage; object aGrf; object aPlot; ! Look for opened graphics board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set minimum and maximum, change to log. scale aPlot.SetScaleY(1,1000,1); } } }
void VisPlot.SetDefScaleX () Sets default scale of x-axis (SetDesktop or SetVipage). Arguments: none Return value: none Example: The following example looks for a Subplot named 'RST' and sets the option 'Use local x-Axis' to 0. After that the x-scale used is the Graphics Board (SetDesktop) or the Virtual
07/10/2011
DIgSILENT PowerFactory
void VisPlot.SetDefScaleY () Sets default scale of y-axis (IntPlot). Arguments: none Return value: none Example: The following example looks for a Subplot named 'RST' and sets its option 'Use local y-Axis' to 0. After that the y-scale used is the Plot Type (IntPlot).
! Reset option 'Use local y-Axis' object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' aPlot.SetDefScaleY(); } } }
int VisPlot.DoAutoScaleX () Scales the x-axis of the plot automatically. The function works for local x-scales only. If the x-scale is not local a warning is shown in the output window and 1 is returned by the function. This command works for the plot VisPlot, VisHrm and VisPlot2. Arguments: none Return value: 0 on success, 1 on error. Example: The following example looks for a subplot named 'RST' and performs an automatic scaling.
! perform autoscale of x-axis object aPage; object aGrf; object aPlot; int iFailed; iFailed=1; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! perform automatic scaling now iFailed = aPlot.DoAutoScaleX(); if (iFailed > 0) { ! just to demonstrate the return value. printf('Could not scale x-axis'); } } } }
int VisPlot.DoAutoScaleY () Scales the y-axis of the plot automatically. The function works for local y-scales only. If the y-scale is not local a warning is shown in the output window and 1 is returned by the function. This command works for the plot VisPlot, VisHrm, VisFft and VisPlot2. Arguments: none Return value: 0 on success, 1 on error. Example: The following example looks for a subplot named 'RST' and performs an automatic scaling.
! perform autoscale of y-axis object aPage; object aGrf; object aPlot; int iFailed; iFailed=1; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! perform automatic scaling now iFailed = aPlot.DoAutoScaleY(); if (iFailed > 0) { ! just to demonstrate the return value. printf('Could not scale y-axis'); } } } }
07/10/2011
DIgSILENT PowerFactory
int VisPlot2.DoAutoScaleY2 () Scales the second y-axis of the plot automatically. The function works if the y-Axis is enabled and uses the local y-scale settings. In any other case a warning is produced and the function returns 1. Arguments: none Return value: 0 on success, 1 on error. Example: The following example looks for a subplot named 'RST' and performs an automatic scaling.
! perform autoscale of y2-axis object aPage; object aGrf; object aPlot; int iFailed; iFailed=1; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot2',1); if (aPlot) { ! perform automatic scaling now iFailed = aPlot.DoAutoScaleY2(); if (iFailed > 0) { ! just to demonstrate the return value. printf('Could not scale y2-axis'); } } } }
void VisPlot.SetAutoScaleX (int mode) Sets automatic scaling mode of the x-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 never, 1 after simulation, 2 during simulation
Return value: none Example: The following example looks for a Subplot named 'RST' and change its auto scale mode. The first example works fine, the second one generates an error message because the x-scale is unused.
! Set autoscale mode of x-scale to off object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set limits to change x-scale of page to used scale aPlot.SetScaleX(0,10); ! Turn off automatic scaling of x-scale aPlot.SetAutoScaleX(0); } } } ! Try to set autoscale mode of x-scale to online object aPage; object aGrf; object aPlot; ! Look for opened Graphics Board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local x-Axis' of Subplot aPlot.SetDefScaleX(); ! Try to set automatic scaling of x-scale to Online aPlot.SetAutoScaleX(2); } } }
void VisPlot.SetAutoScaleY (int mode) Sets automatic scaling mode of the y-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 never, 1 after simulation, 2 during simulation
Return value: none Example: The following example looks for a Subplot named 'RST' and change its auto scale mode. The first example works fine, the second one generates an error message because the y-scale is unused.
! Set autoscale mode of y-scale to off object aPage; object aGrf; object aPlot; ! Look for opened graphics board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set limits to change y-scale of page to used scale aPlot.SetScaleY(0,10); ! Turn off automatic scaling of y-scale aPlot.SetAutoScaleY(0); } } } ! Try to set autoscale mode of y-scale to online object aPage; object aGrf; object aPlot; ! Look for opened Graphics Board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1);
07/10/2011
DIgSILENT PowerFactory
if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of Subplot aPlot.SetDefScaleY(); ! Try to set automatic scaling of y-scale to Online aPlot.SetAutoScaleY(2); } } }
void VisPlot.SetAdaptX (int mode, double trigger) Sets the adapt scale option of the x-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 off, 1 on double trigger (optional) : Trigger value, unused if mode is off or empty
Return value: none Example: The following examples look for a Subplot named 'RST' and change its adapt scale option. The first example works fine, the second one generates an error message because the x-scale is unused.
! Modify adapt scale option of Subplot object aPage; object aGrf; object aPlot; ! Look for opened Graphics Board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set x-scale limits to set option 'Use local x-Axis' aPlot.SetScaleX(0,20); ! Turn on adapt scale, use a trigger value of 3 aPlot.SetAdaptX(1,3); ! Turn off adapt scale aPlot.SetAdaptX(0,3); ! Turn on adapt scale again, do not change the trigger value aPlot.SetAdaptX(1); } } } ! Try to turn on adapt scale of x-scale object aPage; object aGrf;object aPlot; ! Look for opened Graphics Board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local x-Axis' of Subplot aPlot.SetDefScaleX(); ! Try to turn on adapt scale, use a trigger value of 3 ! Leads to error message because scale is not local aPlot.SetAdaptX(1,3); } } }
void VisPlot.SetAdaptY (int mode, double offset) Sets the adapt scale option of the y-scale for local scales. Arguments:
int mode (obligatory) : Possible values: 0 off, 1 on double trigger (optional) : Offset, unused if mode is off or empty
Return value: none Example: The following examples look for a Subplot named 'RST' and change its adapt scale option of the y scale. The first example works fine, the second one generates an error message because the y-scale is unused.
! Modify adapt scale option of Subplot object aPage; object aGrf; object aPlot; ! Look for opened Graphics Board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set y-scale limits to set option 'Use local y-Axis' aPlot.SetScaleY(0,20); ! Turn on adapt scale, use a trigger value of 3 aPlot.SetAdaptY(1,3); ! Turn off adapt scale aPlot.SetAdaptY(0,3); ! Turn on adapt scale again, do not change the trigger value aPlot.SetAdaptY(1); } } } ! Try to turn on adapt scale for y-scale object aPage; object aGrf; object aPlot; ! Look for opened Graphics Board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of Subplot aPlot.SetDefScaleY(); ! Try to turn on adapt scale, use a trigger value of 3 ! Leads to error message because scale is not local aPlot.SetAdaptY(1,3); } } }
object VisPlot.GetScaleObjX () Returns used object defining x-scale. The returned object is the Subplot itself, the Virtual Instrument Panel or the Graphics Board. Arguments:
07/10/2011
DIgSILENT PowerFactory
none Return value: Object defining the x-scale. Example: The following examples look for a Subplot named 'RST' and get the used x-scale object. There are three different examples. 1. Example: Used scale is Graphics Board 2. Example: Used scale is Virtual Instrument Panel 3. Example: Used scale is Subplot itself.
! Used scale is Graphics Board object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' of Virtual Instrument Panel aPage.SetDefScaleX(); ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local x-Axis' of Subplot aPlot.SetDefScaleX(); ! Get object defining scale aScale=aPlot.GetScaleObjX(); if (aPlot=aScale) { output('The scale used is the Subplot itself.'); } else if (aPage=aScale) { output('The scale used is the Virtual Instrument Panel.'); } else if (aGrf=aScale) { output('The scale used is the Graphics Board.'); } else { output('The scale used was not found.'); } } } } ! Used Scale is Virtual Instrument Panel object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Set x-scale to change it to local aPage.SetScaleX(1,100); ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local x-Axis' of Subplot aPlot.SetDefScaleX(); ! Get object defining scale aScale=aPlot.GetScaleObjX(); if (aPlot=aScale) { output('The scale used is the Subplot itself.'); } else if (aPage=aScale) { output('The scale used is the Virtual Instrument Panel.'); } else if (aGrf=aScale) { output('The scale used is the Graphics Board.'); } else { output('The scale used was not found.'); } } } } ! Used Scale is Subplot itself object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Reset option 'Use local x-Axis' of Virtual Instrument Panel aPage.SetDefScaleX(); ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set x-scale of Subplot to change it to local aPlot.SetScaleX(1,100); ! Get object defining scale aScale=aPlot.GetScaleObjX(); if (aPlot=aScale) { output('The scale used is the Subplot itself.'); } else if (aPage=aScale) { output('The scale used is the Virtual Instrument Panel.'); } else if (aGrf=aScale) { output('The scale used is the Graphics Board.'); } else { output('The scale used was not found.'); } } } }
object VisPlot.GetScaleObjY () Returns used object defining y-scale. The returned object is either the Subplot itself or the Plot Type (IntPlot). Arguments: none Return value: Object defining the y-scale. Example: The following examples look for a Subplot named 'RST' and get the used y-scale object. There are three different examples. 1. Example: Used scale is Plot Type. 2. Example: Used scale is Subplot itself.
! Used scale is Plot Type object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of Subplot aPlot.SetDefScaleY(); ! Get object defining scale aScale=aPlot.GetScaleObjY(); if (aScale=aPlot) { output('The y-scale used is the Subplot itself.'); } else { output('The y-scale used is the Plot Type.'); } } } } ! Used scale is Subplot itself object aPage;
07/10/2011
DIgSILENT PowerFactory
object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Set x-scale of Subplot to change it to local aPlot.SetScaleY(1,100); ! Get object defining scale aScale=aPlot.GetScaleObjY(); if (aScale=aPlot) { output('The y-scale used is the Subplot itself.'); } else { output('The y-scale used is the Plot Type.'); } } } }
object VisPlot.SetCrvDesc (int index, string desc [, string desc1]...) Sets the description of curves starting at curve number 'index'. A list of descriprions can be set. Arguments:
int index (obligatory) : Row of first curve to change the description. string desc (obligatory) : Description to set for curve in row index. string desc1 (optional) : Description to set for curve in row index+1. Object defining the y-scale.
Example: The following examples look for a Subplot named 'RST' sets the description for the curves defined in row two and three. The first variable's description remains unchanged.
! Modify descriptions object aPage; object aGrf; object aPlot; object aScale; ! Note: object load is an interface parameter, ! therefore it is not defined here! Look for opened graphics board.aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Clear variable list aPlot.Clear(); ! Append variables aPlot.AddVars(load, 'm:U1:bus1','m:U1l:bus1','m:phiu1:bus1'); ! Set description of row 2 and 3 aPlot.SetCrvDesc(2,,'Line-Line Voltage','Angle'); } } }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int VisFft.DoAutoScaleX () Scales the x-axis of the fft plot automatically. After scaling the x-axis automatically the x-scale minimum is 0. The maximum is nsamples/2 or nsamples/2 x fundamental frequency. Arguments: none Return value: always 0 Example: The following example looks for a FFT-Plot named 'FFT' and performs an automatic scaling.
! perform autoscale of x-axis object aPage; object aGrf; object aPlot; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get FFT plot named 'FFT' aPlot=aPage.GetVI('RST','VisFft',1); if (aPlot) { ! perform automatic scaling now aPlot.DoAutoScaleX(); } } }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
void IntPlot.SetScaleY (double min, double max, int log) Sets scale of y-axis. Invalid arguments like negative limits for logarithmic scale are not set. No arguments --> automatic scaling. Arguments:
07/10/2011
DIgSILENT PowerFactory
double max (optional) : Maximum of y-scale. int log (optional) : > 0 --> y-scale is logarithmic; 0 --> y-scale is linear.
Return value: none Example: The following example looks for a Subplot named 'RST' and set its y-axis scale. There are three different examples. 1. Example: Perform auto scaling on y-Axis. 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000. Changes to a log. scale
! Automatic scaling of y-scale object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of subplot aPlot.SetDefScaleY(); ! Get object defining scale (now IntPlot) aScale=aPlot.GetScaleObjY(); if (aScale) { ! Perform auto scaling aScale.SetScaleY(); } } } } ! Set minimum and maximum without changing map mode object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of subplot aPlot.SetDefScaleY(); ! Get object defining scale (now IntPlot) aScale=aPlot.GetScaleObjY(); if (aScale) { ! Perform auto scaling aScale.SetScaleY(0,20); } } } } ! Set minimum and maximum, set map mode to log. object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of subplot aPlot.SetDefScaleY(); ! Get object defining scale (now IntPlot) aScale=aPlot.GetScaleObjY(); if (aScale) { ! Perform auto scaling aScale.SetScaleY(1,1000,1); } } } }
void IntPlot.SetAutoScaleY (int mode) Sets automatic scaling mode of the y-scale. Arguments:
int mode (obligatory) : Possible values: 0 never, 1 after simulation, 2 during simulation
Return value: none Example: The following example sets the auto scale mode of the Plot Type to On.
! Set autoscale option of Plot Type object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of subplot aPlot.SetDefScaleY(); ! Get object defining scale (now IntPlot) aScale=aPlot.GetScaleObjY(); if (aScale) { ! Set auto scale option to on aScale.SetAutoScaleY(1); } } } }
void IntPlot.SetAdaptY (int mode, double offset) Sets the adapt scale option of the y-scale. Arguments:
int mode (obligatory) : Possible values: 0 off, 1 on double offset (optional) : Offset, unused if mode is off or empty
Return value: none Example: The following examples look for a Subplot named 'RST', gets its Plot Type and changes the adapt scale option of the scale.
! Modify adapt scale option of Plot Type
07/10/2011
DIgSILENT PowerFactory
object aPage; object aGrf; object aPlot; object aScale; ! Look for opened graphics board. aGrf=GetGraphBoard(); if (aGrf) { ! Get Virtual Instrument Panel named Voltage aPage=aGrf.GetPage('Voltage',1); if (aPage) { ! Get subplot named 'RST' aPlot=aPage.GetVI('RST','VisPlot',1); if (aPlot) { ! Reset option 'Use local y-Axis' of subplot aPlot.SetDefScaleY(); ! Get object defining scale (now IntPlot) aScale=aPlot.GetScaleObjY(); if (aScale) { ! Set y-scale limits to set option 'Use local y-Axis' aScale.SetScaleY(0,20); ! Turn on adapt scale, use an offset of 3 aScale.SetAdaptY(1,3); ! Turn off adapt scale aScale.SetAdaptY(0,3); ! Turn on adapt scale again, do not change the offset aScale.SetAdaptY(1); } } } }
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.11.1 IntVariant Methods Activate Adds a variant to the active study case Deactivate Removes a variant from the active study case
IntVariant.Activate
int IntVariant.Activate () Adds a variant to the active study case. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
IntVariant.Deactivate
int IntVariant.Deactivate () Removes a variant from the active study case. Arguments: none Return value: 0 on success, 1 on error. See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.11.2 IntMon Methods PrintVal Prints the values of the selected variables PrintAllVal Prints a description for all variables NVars returns the number of selected variables GetVar Returns the n'th selected variable name RemoveVar De-selects a variable ClearVars Clears the selected variable names AddVar Selects a variable name
IntMon.PrintVal
void IntMon.PrintVal () Prints the values of the selected variables to the output window. Arguments: none Return value:
07/10/2011
DIgSILENT PowerFactory
none See also General Object Functions and Methods Set Functions and Methods
IntMon.PrintAllVal
void IntMon.PrintAllVal () Prints a description for all available variables to the output window. Arguments: none Return value: none See also General Object Functions and Methods Set Functions and Methods
IntMon.NVars
int IntMon.NVars () Returns the number of selected variables or, more exact, the number of lines in the variable selection text on the second page of the IntMon dialogue, which should contain one variable name per line. Arguments: none Return value: The number of selected variables. See also General Object Functions and Methods Set Functions and Methods
IntMon.GetVar
string IntMon.GetVar (int row) Returns the variable name on the given row of the variable selection text on the second page of the IntMon dialogue, which should contain one variable name per line. Arguments: none Return value: The variable name. See also General Object Functions and Methods Set Functions and Methods
IntMon.RemoveVar
int IntMon.RemoveVar (string name) Removes the variable "name'' from the list of selected variable names. Arguments: The variable name. Return value: 1 when the variable name was not found, 0 otherwise. See also General Object Functions and Methods Set Functions and Methods
IntMon.ClearVars
int IntMon.ClearVars () Clears the list of selected variable names. Arguments: none Return value: none See also General Object Functions and Methods Set Functions and Methods
IntMon.AddVar
int IntMon.AddVar (string name) Appends the variable "name'' to the list of selected variable names. Arguments: The variable name. Return value: none See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011
DIgSILENT PowerFactory
Set Set the value at position (row,col) Init Initializes the matrix Resize Resizes the matrix NRow Returns the number of rows in the matrix NCol Returns the number of columns in the matrix RowLbl Sets the label of the R'th row ColLbl Sets the label of the C'th column
IntMat.Get
double IntMat.Get (int row, int col) Returns the (row, col) value from the matrix. An run-time error will occur when 'row' or 'col' are out of range. Arguments:
int row (obligatory) : row in matrix: 1..NRow() int col (obligatory) : column in matrix: 1..NCol()
Return value: Value in matrix. Example: The following example multiplies two matrices
int r,c,z,s,s1r,s2c; double v1,v2,v; s = M1.NCol(); r = M2.NRow(); if (s<>r) {exit();} s1r = M1.NRow(); s2c = M2.NCol(); M3.Init(s1r,s2c); r=1; while (r<=s1r) { c=1; while (c<=s2c) { z=1; v=0.0; while (z<=s) { v1=M1.Get(r,z); v2=M2.Get(z,c); v+=v1*v2; z+=1; } M3.Set(r,c,v); c+=1; } r+=1; }
See also General Object Functions and Methods Set Functions and Methods
IntMat.Set
int IntMat.Set (int row, int col, double V) Set the value at position (row,col) in the matrix to V. The matrix is automatically resized if necessary. Arguments:
int row (obligatory) : row number: 1..NRows() int col (obligatory) : col number: 1..NCols() double Vj (obligatory) : value
Return value: 0 on success Example: See IntMat.Get for an example.
IntMat.Init
int IntMat.Init (int NRows, int NCols) Initializes the matrix. The size is set to (NRows, NCols), all values are set to 0. Arguments:
int NRows (obligatory) : number of rows int NCols (obligatory) : number of columns
Return value: 0 on success Example: See IntMat.Get for an example.
IntMat.Resize
int IntMat.Resize (int NRows, int NCols) Resizes the matrix. Existing values will not be changed. Added values will be set to 0. Arguments:
int NRows (obligatory) : number of rows int NCols (obligatory) : number of columns
Return value: 0 on success Example: The following example gets a value from the matrix, possibly resizing it first.
int Nc,Nr,x,y; Nr = Mat.NRows(); Nc = Mat.NCols(); x=5;y=3; if ({x>Nr}.or.{y>Nc}) { Mat.Resize(x,y); } v = Mat.Get(x,y);
See also General Object Functions and Methods Set Functions and Methods
IntMat.NRow
int IntMat.NRow () Returns the number of rows in the matrix. The function "NRow()'' replaces the obsolete function "SizeX()''. Arguments:
07/10/2011
DIgSILENT PowerFactory
none Return value: The number of rows Example: See IntMat.Get for an example.
IntMat.NCol
int IntMat.NCol () Returns the number of columns in the matrix. The function "NCol()'' replaces the obsolete function "SizeY()''. Arguments: none Return value: The number of columns Example: See IntMat.Get for an example.
IntMat.RowLbl
string IntMat.RowLbl (String S, int R) Sets or reads the label of the R'th row. Arguments:
String S (optional) : Labelstring, required to set the label int R (obligatory) : Number of the row
Return value: Assigned or read labelstring Example: The following example labels some rows.
Mat.RowLbl('overloaded',1); Mat.RowLbl('overvoltage',2); Mat.RowLbl('undervoltage',3);
The following example assigns the label of the first row to the string aLabel
string aLabel; aLabel = Mat.RowLbl(1);
See also General Object Functions and Methods Set Functions and Methods
IntMat.ColLbl
string IntMat.ColLbl (String S, int C) Sets or reads the label of the C'th column. Arguments:
The following example assigns the label of the first column to the string aLabel
string aLabel; aLabel = Mat.ColLbl(1);
See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.11.4 IntVec Methods Get Returns the value at index i Set Sets the value at index i Init Initializes the vector Resize Resizes the vector Size Returns the size of the vector
IntVec.Get
07/10/2011
DIgSILENT PowerFactory
Vec3.Set(i,v1+v2); i+=1; }
See also General Object Functions and Methods Set Functions and Methods
IntVec.Set
double IntVec.Set (int i, double V) Sets the value at index i to V. Valid indexes are in [1, IntVec.Size()]. Arguments:
int IntVec.Init (int Size) Initializes the vector. Sets the length to Size and all values to 0. Arguments:
int IntVec.Resize (int Size) Resizes the vector. Added values are set to 0.0. Arguments: none Return value: 0 on success Example: The following example adds a value to a dynamically scaled vector.
int i,s; i = 5; s = Vec.Size(); if (i>s) { Vec.Resize(i); } Vec.Set(i,V);
See also General Object Functions and Methods Set Functions and Methods
IntVec.Size
int IntVec.Size () Returns the size of the vector. Arguments: none Return value: The size of the vector Example: See IntVec.Get for an example.
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
H.11.5 IntForm Methods SetText Sets the format text WriteOut Write the report to the output window
IntForm.SetText
int IntForm.SetText (String Text) Sets the format text of a report form. Arguments:
See also IntForm.WriteOut See also General Object Functions and Methods Set Functions and Methods
07/10/2011
DIgSILENT PowerFactory
IntForm.WriteOut
int IntForm.WriteOut (set ListSet, set PoolSet, int Landscape) Write the report to the output window. The report form object will write a report to the output window, based on the format text, for the objects in the ListSet and the PoolSet. The ListSet is used in the _EXTERNAL macro. All format lines between the $LOOP,_EXTERNAL and the $END macro's will be written for each object in the Listset, which is therefore called the 'sequential set'. In the format text itself, objects from the PoolSet may be referenced directly by the "ACC(x)'' macro, which is replaced by the x'th object in the PoolSet. The PoolSet is therefore called the 'random access set'. The ListSet or PoolSet may be empty. The command object that is normally reached by the macro "DEF'' in report forms will always return the main DPL command that is running at the moment, even when the 'WriteOut' call is made in a DPL subscript. Arguments: Set ListSet (obligatory) : The sequential set of objects
Set PoolSet (optional) : The random access set of objects int Landscape (optional) : Sets the page orientation used to calculate the number of lines fitting on a printed page
0 = Portrait, 1 = Landscape; default: Landscape Return value: 0 on success Example: The following example reports the loading of a list of objects for a certain load condition. The objects for the loading are sequentially listed. The load conditions are reported for a special set of loads, which are given as a pool of objects.
set SLines,SLoads; ... fill SLines and SLoads ... OvlReport.WriteOut(SLines, SLoads);
See also IntForm.SetText See also General Object Functions and Methods Set Functions and Methods
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
int ddeOpen(string sPath, string sAppName, string sTopic) Establishes a DDE connection to a topic of an application. Arguments:
string sPath (obligatory) :Path to application to start. If empty ('') the application must be started manually by the user. If path is given, ddeOpen will start the application if it not already running. string sAppName (obligatory) : Application name. string sTopic (obligatory) : Topic; The topic of a DDE conversation can be either the name of a open document or the special topic "System". A document can be either a regular document in the application, a template, or a macro
Return value: 0 on success, != 0 on errors Example: The following example establishes a DDE connection to topic System of Excel and closes the connection if successfully established.
int ierr; ! open a DDE connection to Excel : ierr = ddeOpen(s, 'Excel', 'System'); if (.not.ierr) { ! ok, excel can be opened. ! ... ddeClose(); }
07/10/2011
DIgSILENT PowerFactory
none Return value: none Example: The following example establishes a DDE link to topic named 'System' of Excel and closes the connection if successfully established.
int ierr; ! open a DDE connection to Excel : ierr = ddeOpen(s, 'Excel', 'System'); if (.not.ierr) { ! ok, excel can be opened. ! ... ddeClose(); }
int ddeExe (string sCmd) Starts command in the currently opened topic. A command can be a visual basic command, too. Commands are usually sent to the topic named 'System'. Arguments:
ddePoke
int ddePoke (string sItem, string sData) Sends data to an item in the currently opened DDE topic. Arguments:
string sItem: the item receiving the data. Examples for an item are a cell in excel or a named bookmark in word. string sData: the data to send.
Return value: <0 if the dde connection was not established before calling ddePoke, =0 if the ddePoke was successfully executed, >0: if the ddePoke failed. Example: The following example writes data to some cells on the worksheet named 'Sheet1' in Excel. It is assumed that Excel is already running when starting the dpl command.
int ierr, i; double x,y,z; string s,s1,s2; Warn('This example assumes an English Excel'); Warn('Other languages should translate the Excel commands'); Warn('like "concatenate"'); ! open a DDE connection to Sheet1 : ierr = ddeOpen('', 'Excel', 'System'); if (.not.ierr) { ! excel can be opened. Now close and connect to a specific sheet ddeClose(); ierr = ddeOpen('', 'Excel', 'Sheet1'); if (ierr) { Info('No Sheet1 yet, creating one...'); ierr = ddeOpen('', 'Excel', 'System'); if (ierr) { printf('Cannot open DDE to Excel'); } else { ! create a new sheet ddeExe('[New(1)]'); ddeClose(); ierr = ddeOpen('', 'Excel', 'Sheet1'); } } } if (ierr) { Error('Could not open DDE connection'); exit(); } ! write some numbers x = 3; while (x<7) { y = 5; while (y<14) { z = x+y/100; s1 = sprintf('R%dC%d',x,y); s2 = sprintf('%f',z); ddePoke(s1,s2); ! poke the numbers in the sheet y+=1; } x+=1; }
int ddeRequest (string sItem, string sStringData, double dNumVal) Receives data from an item in a previously opened DDE topic Arguments:
string sItem: The item. Examples for an item are a cell in excel or a named bookmark in word string sStringData:The data received from the topic as string (return value=2) double dNumVal:The data received from the topic as a number (if sStringData is a number, return value=2)
Return value: <0 if the dde connection was not established before calling ddeRequest, =0 if the ddeRequest failed, =1 if value is a number, =2 if value is a string. Example: The following is a small code fragment where data is read from an Excel sheet. The code fragment runs fine, in case that the currently opened DDE topic is an Excel sheet.
i = ddeRequest('R12C2',s,x); ! get the contents of a cel if (i=1) printf('%f', x); ! i=1 means a number i = ddeRequest('R5C2',s,x); if (i=2) printf('%s', s); ! i=2 means a string
07/10/2011
DIgSILENT PowerFactory
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
limstate limstate (x1, min, max) DSL Special Functions Nonlinear limiter function for creating limited integrators. Example:
x1. = xe/Ti; y = limstate(x1,min,max);
delay delay (x, Tdelay) DSL Special Functions Delay function. Stores the value x(Tnow) and returns the value x(Tnow-Tdelay). Tdelay in seconds and larger than 0.0. The expression Tdelay must evaluate to a time independent constant and may therefore only consist of constants and parameter variables. The expression x(t) may contain other functions. Example:
y = delay(xe + delay(x1, 1.0), 2.0)
07/10/2011
DIgSILENT PowerFactory
select select (boolexpr, x, y) DSL Special Functions Returns x if boolexpr is true, else y. Example:
x1.=select(T1>0, xe/T1, 0.0) !to avoid division by zero
time time () DSL Special Functions Returns the current simulation time. Example:
t=time() y = sin(t) or y = sin(time())
file file (ascii-parm, expr) DSL Special Functions !OBSOLETE! Please use an ElmFile object in the composite model in stead. picdro picdro (boolexpr, Tpick, Tdrop) DSL Special Functions Logical pick-up-drop-off function useful for relays. Returns the internal logical state: 0 or 1. Return value: The internal state: changes from 0 to 1, if boolexpr=1, for a duration of at least Tpick seconds changes from 1 to 0, if boolexpr=0, after Tdrop seconds remains unaltered in other situations. flipflop flipflop (boolset, boolreset) DSL Special Functions Logical flip-flop function. Returns the internal logical state: 0 or 1. Return value: The internal state: changes from 0 to 1, if boolset=1 and boolreset=0 (SET) changes from 1 to 0, if boolset=0 and boolreset=1 (RESET) remains unaltered in other situations. (HOLD) Initial value: boolset. The initial condition boolset=boolreset=1 will cause an error message. aflipflop aflipflop (x, boolset, boolreset) DSL Special Functions 'Analog' flip-flop function. Returns the (old) value for x at SET-time if internal state=1, else returns the current value of x. Return value: The internal state: changes from 0 to 1, if boolset=1 and boolreset=0 (SET) changes from 1 to 0, if boolset=0 and boolreset=1 (RESET) remains unaltered in other situations. (HOLD) lapprox lapprox (x, array_iiii) DSL Special Functions Returns the linear approximation y=f(x), where f is defined by the array_iiii. Please consider that the array has to be sorted in ascending order. Example:
y = lapprox(1.8, array_valve)
invlapprox invlapprox (y, array_iiii) DSL Special Functions Inverse lapprox with array. lapprox2 lapprox2 (xl, xc, matrix_iiii) DSL Special Functions Returns the linear approximation y=f(xl,xc) of a two-dimensional array, where f is defined by the matrix_iiii. xl represents the line value and xc the column of the matrix. Please consider that the array has to be sorted in ascending order. Example:
y = lapprox2(2.5, 3.7, matrix_cp)
sapprox sapprox (x, array_iiii) DSL Special Functions Returns the spline approximation y=f(x), where f is defined by the array_iiii. Please consider that the array has to be sorted in ascending order. Example:
y = sapprox(1.8, array_valve)
sapprox2 sapprox2 (xl, xc, matrix_iiii) DSL Special Functions Returns the spline approximation y=f(xl,xc) of a two-dimensional array, where f is defined by the matrix_iiii . xl represents the line value and xc the column of the matrix. Example:
y = sapprox2(2.5, 3.7, matrix_cp)
event Option 1: calling a predefined event in the DSL element event( Condition, trigger, 'name=ThisEvent dtime=delay value=val variable=var') Option 2: target specification, no create parameter event( Condition, trigger, 'target=ThisSlot name=ThisEvent dtime=delay value=val variable=var') Option 3: create and target specification event( Condition, trigger, 'create=ThisEvtType target=ThisSlot name=ThisEvent dtime=delay value=val variable=var')
07/10/2011
DIgSILENT PowerFactory
DSL Special Functions This function can create or call any kind of event for the DSL model itself or elements inside the network. The event is executed, if the input signal trigger changes sign from - to + with a time delay of dtime. Mind: the event command has changed from DSL level 3 to level 4! Arguments:
The following event calls an external event called 'OpenBreaker', which is stored and defined inside the DSL element, if yo changes sign from - to +. The delay time is 0.2s.
event(1,yo,'name=OpenBreaker dtime=0.2')
The following event is a simple undervoltage load-shedding relay. The element in the slot 'Load' will be disconnected with a swicth event 'EvtSwitch', when the signal 'u-umin' becomes positive. The event in the event list will be called 'TripLoad'.
event(1,umin-u,'create=EvtSwitch name=TripLoad target=Load')
DIgSILENT GmbH www.digsilent.de Tel: +49 (0)7072 9168-50 Fax: +49 (0)7072 9168-88 support@digsilent.de
07/10/2011