DGS-5 Documentation v003
DGS-5 Documentation v003
DGS-5 Documentation v003
DGS Interface
DIgSILENT GmbH Heinrich-Hertz-Strasse 9 D-72810 Gomaringen Tel.: +49 7072 9168 - 0 Fax: +49 7072 9168- 88 http://www.digsilent.de e-mail: [email protected]
DGS-Interface Published by DIgSILENT GmbH, Germany Copyright 2010. All rights reserved. Unauthorized copying or publishing of this or any part of this document is prohibited. DGS-Interface, Doc. Vers. 003 PowerFactory 14.0 Date: 08.10.2010
Table of Contents
Table of Contents
1 Introduction ......................................................................................................................................... 5 2 PowerFactory Data Model ................................................................................................................... 5 2.1 Power System Elements .......................................................................................................................... 5 2.2 Graphical Representation ....................................................................................................................... 7 3 DGS Structure ...................................................................................................................................... 8 3.1 General Table........................................................................................................................................ 9 3.2 Object Table ........................................................................................................................................ 10 3.2.1 Object References ........................................................................................................................... 11 3.2.2 Object Hierarchy ............................................................................................................................. 12 3.3 Databases ........................................................................................................................................... 13 3.4 File Formats......................................................................................................................................... 14 3.4.1 ASCII ............................................................................................................................................. 14 3.4.2 XML ............................................................................................................................................... 15 3.4.3 Microsoft Excel ................................................................................................................................ 16 3.4.4 Microsoft Access .............................................................................................................................. 17 4 Import ................................................................................................................................................ 18 5 Export ................................................................................................................................................. 20 6 Advanced Topics ................................................................................................................................ 22 6.1 Deletion of Existing Objects................................................................................................................... 22 6.2 Creation of Variations ........................................................................................................................... 22 6.2.1 Delete Objects ................................................................................................................................ 23 6.2.2 Add Objects .................................................................................................................................... 24 6.2.3 Modification Objects ........................................................................................................................ 25 6.2.4 Notes ............................................................................................................................................. 25 Appendix ............................................................................................................................................... 27 6.3 Common Attributes .............................................................................................................................. 27 6.4 Example of DGS Table Headers ............................................................................................................. 27 6.4.1 Terminal Data (ElmTerm) ................................................................................................................. 27 6.4.2 Cubicle Data (StaCubic) ................................................................................................................... 28 6.4.3 Line/cable Data (element, ElmLne) ................................................................................................... 28 6.4.4 Line/cable Data (type, TypLne) ......................................................................................................... 29 6.4.5 Line section (element, ElmLnesec) .................................................................................................... 29
Table of Contents
6.4.6 Switch Data (element, ElmCoup) ...................................................................................................... 30 6.4.7 Load Data (element, ElmLod) ........................................................................................................... 30 6.4.8 Load Data (type, TypLod) ................................................................................................................ 30 6.4.9 External Grid Data (ElmXnet) ............................................................................................................ 31 6.4.10 2-winding Transformer Data (element, ElmTr2) ................................................................................ 31 6.4.11 2-winding transformer data (type, TypTr2) ...................................................................................... 32 6.4.12 Shunts (ElmShnt) .......................................................................................................................... 32 6.4.13 Single line diagrams (IntGrfnet) ...................................................................................................... 33 6.4.14 Graphical representation of power system element (IntGrf) ............................................................... 33 6.4.15 Graphical connection lines (IntGrfcon) ............................................................................................. 34 6.5 Example DGS - Figure 2: Detailed Transformer Connection ...................................................................... 35 6.6 Example DGS - Figure 3: Simplified Transformer Connection .................................................................... 37
Introduction 1 Introduction
DIgSILENT PowerFactory provides a standard interface named DGS (DIgSILENT) for data exchange with other applications. The DGS import interface allows importing of complete network models as well as updating existing models. The DGS export interface provides the possibility to export network model data and calculation results. Selective export is supported. This document describes the data model as well as the DGS data format. In Chapter 2 a short introduction to the PowerFactory data model is presented. Chapter 3 gives an introduction to the DGS data format, by describing the DGS data structure and the supported file formats. Chapters 4 and 5 present the export and import commands of PowerFactory. For experienced users, chapter 6 covers some advanced topics. And finally, the appendix contains a description of frequently used PowerFactory attributes and a sample header configuration. Furthermore, the used DGS examples are listed there.
Figure 1: Schematic representation of network topology (Example of a branch element with 2 connections, e.g. line)
Figure 2 below illustrates a transformer which is connected to busbars (terminal of usage busbar) via disconnectors and circuit breakers modelled in detail.
The data model includes 10 cubicles, 2 for each switch and transformer. The cubicles are not visible in the figure.
Examples DGS files for both figures can be found in chapter 6.5 and 6.6.
GCO_1
(connection line 1)
Symbol
(grf. Representatin of transformer)
GCO_1
(connection line 2)
diagram
3 DGS Structure
Generally, DGS defines the structure of the data and is therefore not bound to a specific file format or database schema. The PowerFactory DGS interface supports the following databases: Oracle (ODBC client 10 or newer) MS-SQL (ODBC driver 2000 or newer) ODBC System DSN
Additionally PowerFactory can deal with data in the following file formats: ASCII Text (csv like) XML Microsoft Excel (2003 or newer) Microsoft Access (2003 or newer)
The contents of the files are identical; the only difference is the format. The core principle of DGS is to organize all data in tables. Each table has a unique name (within the DGS file or database/table space) and consists of one or more table columns where generally all names are case-sensitive. There are two types of tables: the general table and the object (data) table.
Each DGS file must contain exactly one general table and an arbitrary number of object data tables. In EBNF notation: DGS file ::= general_table {, object_table}
The detailed structure of the tables is described in the following sections. Generally, for all tables, data values are stored in table rows. It is required that each table contains an identifier column. This column must be named ID (data type text) and all table rows must contain a unique value for that column (primary key in the whole DGS data source). In case of csv or Excel files the identifier column has to be the first column.
Description Unique identifier for each data row Description text Value
Currently, the following settings are supported (value for ID column can be freely chosen but must be unique). Please note that the Version entry is mandatory and must be contained in every general table. Furthermore, all settings are case-sensitive!
Descr
Description
Version
DGS Version number. This entry describes the format of the DGS structure and is mandatory. The currently used format is DGS 5.0 Example: 5.0 If given, the data source attribute (dat_src, displayed on description page) for all newly created PowerFactory objects is set to that text. Please note that the text must not be longer than 3 characters! Example: GIS Advanced feature to execute commands after DGS import: It is possible to additionally execute command strings in PowerFactory at the end of the DGS import. These command strings must be given as entries named PostCommand, followed by a number, e.g. PostCommand1, PostCommand2 After the DGS data import, these commands are executed in alphabetical order, i.e. first PostCommand1, then PostCommand2 Example: To close all graphic boards after DGS import, the following post command can be used (e.g. as PostCommand1): hide/all
Source
PostCommand#
Note: Unknown settings are ignored by PowerFactory (no warnings are displayed).
10
Table StaCubic:
ID 2
loc_name LoadCubicle
obj_id 1
b)
Foreign-key: Referencing objects that already exist in PowerFactory prior to the DGS import is realised using the value of the foreign-key attribute of that object (attribute for_name in PowerFactory). To indicate that a value represents a foreign-key reference, it must be preceded with double hashes (## without quotes). Please note, for import, only objects already existing in PowerFactory database can be referenced via foreign-key. It is not possible to create an object within a DGS file and refer to it via foreign key within the same file. Example: Same as a) but assume: that an import is executed into an existing project (update) and that the load already exists and has the foreign-key Load117 (attribute for_name of load object)
--- (none, object already exists in PowerFactory) ID 1 loc_name LoadCubicle obj_id ##Load117
11
PowerFactory
DGS
ElmNet: ID 1 loc_name Grid loc_name Substation loc_name Terminal
ElmSubstat: ID 2 ElmTerm: ID 3
fold_id 1 fold_id 2
12
3.3 Databases
PowerFactory can directly access DGS data stored on a database server. Such a server can either be an Oracle or a Microsoft SQL server or any data source accessible via ODBC system DSN. For all databases, the DGS tables are mapped 1:1 to database tables where all table and column names are casesensitive. The data type for each column is chosen according to the PowerFactory attribute type. The following types are supported: INTEGER REAL (for float and double values) VARCHAR (for text, size is set according to the length of the PowerFactory attribute)
13
3.4.1 ASCII
A DGS ASCII file is basically a CSV format (comma separated values), extended by support for multiple tables (within one file). Throughout the file, the semicolon ; denotes the separator character, double quotes are used as escape character () and all lines starting with a start (*) are considered to be comments and are ignored in automatic processing.
To identify the different tables within the file, each table must begin with a special header line. This header must give the name of the table and the definitions for the columns. It must start with two dollar characters '$$' followed by the name of the table. After that, the column definitions must follow: table_header ::= $$TableName {; ColumnDefinition} Each column definition must consist of a column name (name of PowerFactory attribute), followed by its data type in parenthesis. For data types, the following identifiers are support: i, integer r, float d, double a, string, followed by the length, e.g. a:15 for a string with a length of 15 characters p, pointer, i.e. references to other objects/records (only DGS >= 5.0)
Example: A table header for terminals (class ElmTerm) could have the following form: $$ElmTerm;ID(a:40);loc_name(a:40);fold_id(p);typ_id(p);iUsage(i);uknom(r)
After the header line, the data rows are following. The number of given values must exactly match the number of columns defined in the header line of that table. If a text value contains a separator or starts/ends with a blank it must be escaped using the double quote (CSV conform encoding). Example: see chapters 6.5 and 6.6.
14
3.4.2 XML
DGS data can also be stored in XML format. A DGS set consists of 2 parts: the DGS data and a XML schema definition. The definition is usually stored as a separated file referenced by the data file. The schema definition is obligatory as the DGS format itself is generic. Basically, the schema definition represents the table headers. For each column, a separate XML element is defined. An entry in the DGS table is represented by a XML element containing DGS columns as child elements. The data is stored as instances of those elements. Each DGS data column is stored as an element instance containing child instances for the attribute values. Example: a DGS table for ElmTerm given as
ID 1 2
iUsage 0 0
15
16
17
4 Import
DGS data can be imported into PowerFactory by using the built-in import command. The command object is of class ComImport and can be accessed via main menu: File Import DGS Format Generally, DGS data can be imported into a) a new project: This means, a new project will be created and all DGS data will be imported into this project. There will be one object created for each DGS data row. In this case, the DGS data must be complete as all objects will be created from scratch. The data should include the topological information, type information, graphical information and the network element data. Further, it is not possible to use foreign-key references. Typically, this kind of import is used for complete data transfers from other systems, e.g. a Geographic Information System (GIS). Attributes not given in the DGS data keep their PowerFactory default value. b) an existing project: In this case, the DGS data will be imported into an already existing project. This is different from the first option as the data can be very selective and must not be complete. Normally most objects are already existent and only some of them will get an update. The DGS can contain only a few attributes and foreignkey references are used to access the existing objects. A foreign-key value can either be used for an attribute pointing to an object and or for an update of an object itself. In the second case, the entry in the ID column must correspond to the foreign-key of the object (see example below). This type of import can be used to update operational data (switch states, active and reactive power consumption of loads, generator output, transformer tap changer positions) e.g. from a SCADA system.
Example 1: Changing the switch status of an existing breaker Assume that the breaker has a value Breaker223 as foreign-key (attribute for_name). The status can then be set to open via the following DGS table: Table: ElmCoup ID ##Breaker223 on_off 0
Please note that not using a foreign-key as ID in the table above would result in a newly created breaker.
18
Example 2: Creating a new breaker and referring to an existing breaker type The foreign-key mechanism is also used to reference existing objects, e.g. types. Table: ElmCoup ID 1 loc_name Breaker1 typ_id ##BrkType1
Generally in both cases, only given attributes will be changed. All attributes, not listed in the DGS table, will remain unchanged. (Newly created objects start with default values for all attributes.) The way of import can be selected in the dialog of the import command (as depicted below):
19
5 Export
PowerFactory has a built-in export command to export an activated project to a DGS file. This means, the objects are exported in their current state (e.g. resulting state depending on active scenario and variations). Furthermore, the export can be fully configured to only export the attributes that are of interest. Inactive objects of variation management are generally ignored The following data can be exported: element data, type data, graphical data and result data (e.g. load flow results) Export DGS Format
The command object is of class ComExport and can be accessed via the menu: File The configuration is done in the command edit dialog (as depicted below):
20
The following options are available: DGS Version Version of the DGS structure. It is highly recommended to use 5.0 for PowerFactory V14.0. Output format. Either file as ASCII, XML, MS Excel or MS Access file (for Excel or Access, Microsoft Office must be installed on the computer) or database as Oracle, MS SQL Server and ODBC DSN. If checked, in ASCII, XML and MS Excel a description of the columns is included (not available for Access or database server) Via this option, the attribute export is configured. It is required to select a folder that contains exactly one monitor variable object (IntMon) for each class that is to be exported. The Class Name of each monitor variable object must be set to the PowerFactory class for which it provides a definition. The attribute definition for the class is represented by the selected variables in the monitor object. Example for class ElmTerm:
Format
Figure 11: Monitor object used for export attribute definition Please note, the Options tab in the export command is currently not relevant for DGS 5.0.
21
6 Advanced Topics
Existing 6.1 Deletion of Existing Objects
DGS provides the possibility to delete already existing objects during import. Therefore, a special DGS object table is used where all objects that are to be removed are listed. The removal is executed as last step during import. As only already existing objects can be deleted, all objects in that table are referenced by foreign key. The table is called Deletion and holds no data columns except the ID one. A Deletion table might look as follows:
ID ##FKeyOfLoad1 ##FKeyOfTerminalA
Please note, the deletion table is only supported for imports executed into an existing project.
22
Creation of IntScheme and IntSstage objects is quite straightforward. The IntStage table consists basically of name and a parent column (fold_id). If the parent column is omitted, the object will be created in its default location, the Variations project folder. Example of an IntStage table:
ID 10 11 loc_name Variation A Variation B fold_id {empty} {empty}
For contained IntSstage objects, it is important to properly set the parent IntScheme object and the activation time. The activation time must be given as number of seconds since 01.01.1970 UTC. Please note that an IntScheme object can contain multiple IntSstage objects. Example of an IntSstage table:
ID 12 13 14 loc_name Expansion Stage Expansion Stage 1 Expansion Stage 2 fold_id 10 11 11 tAcTime 1286275114 1286275114 1286276328
The creation of modification objects is more complex and needs a detailed understanding of how PowerFactory deals with those objects: Each modification object (add, modify or delete) refers to a root object being the target of the modifications. On activation of an IntStage, the data of all contained add and change objects will be copied to their target objects, overwriting all attributes. For delete objects, the target object is deleted. These modifications of the target objects are done in memory only and are reverted on deactivation of the variation.
A deletion of that load within an expansion stage would require the following record (table IntSdel):
ID 200 loc_name Load A fold_id {stage} root_id 100
23
The root object is a kind of placeholder located in the network. This root object is marked hidden as long as there is no add object active (for that object). All attributes of such a hidden object stay on their default values, except the attributes name (loc_name), parent (fold_id) and foreign-key (for_name). The add object stored inside an expansion stage is responsible for making the hidden object active. It contains all the attribute data (except loc_name, fold_id and for_name). On activation of the expansion stage, all attribute data of the add object (except loc_name, fold_id and for_name) is copied to the hidden root object and the hidden object becomes active. Hidden objects and variation add objects are always instances of the same class. For creation of hidden objects, a special table in DGS is used. The creation of add objects is done via normal class tables. For add objects, it is important to always set the reference to the hidden root object (root_id) and setting the variation status flag to a value of 4 (attribute iSchemeStatus). The special hidden object table is named HiddenObject and consists of the following columns: ID loc_name DGS identifier as for any other object Name of the object. The name can only be set in the hidden root object and cannot be modified in a variation. Parent reference. Foreign-key
fold_id for_name
Example: Adding a terminal in a variation could be done as follows: The hidden object located for example in a grid (table HiddenObject):
ID 100 loc_name Terminal1 fold_id {grid} for_name FKeyTerm1
24
6.2.4 Notes
6.2.4.1 Attribute iSchemeStatus
The attribute iSchemeStatus is used for identifying add and modification objects in variations. For non-variation objects, the value 0 is used which can be omitted as it is the default value. The following values are supported:
0 1 Default; normal object Hidden object, used for additions as inactive (hidden) placeholders. This value will automatically be set for objects in the HiddenObject table. Modification object Add object
2 4
25
Please note that these attributes must only be set for graphical connection in variations (add and modification objects). Their value will be automatically detected for non-variation objects and should be left blank there.
26
Appendix
6.3 Common Attributes
The following table describes frequently used PowerFactory attributes:
Attribute
loc_name
Data Type
Text (max. 40 characters) (a:40)
Description
Name; attribute is available for all PowerFactory objects. Naming rules: In PowerFactory the name must be unique within folders. The following characters cannot be part of a name: *?=",\~|
fold_id
chr_name
Characteristic name; attribute is available for all power system elements. This attribute can be used to store a foreign database ID within a PowerFactory object, e.g. a GIS ID. This attribute has only descriptive meaning and cannot be used for object references. Reference to an object type. In PowerFactory, the type specific data is stored in a separate type object. Foreign-key. If not empty, this name must be unique for all objects within a PowerFactory project. It can be used to reference existing elements from DGS.
typ_id
for_name
27
$$ElmTerm;ID(a:40);loc_name(a:40);fold_id(p);typ_id(p);chr_name(a:20);iUsage(i);uknom(r) ******************************************************************************** * Terminal * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * typ_id: Type of the terminal (TypBar) * chr_name: Characteristic Name * iUsage: Usage: 0=Busbar: 1=Junction Node: 2=Internal Node * uknom: Nominal Voltage: Line-Line in kV ********************************************************************************
Each cubicle belongs to exactly one terminal. In PowerFactory the cubicle is stored within the terminal. In additional tables CTs and VTs can be added to cubicles.
28
* dline: * fline:
********************************************************************************
29
30
31
32
* ncapa: Controller: Act.No. of Step * ncapx: Controller: Max. No. of Steps * outserv: Out of Service * qtotn: Design Parameter (per Step): Rated Reactive Power, L-C in Mvar * shtype: Shunt Type * ushnm: Nominal Voltage in kV ********************************************************************************
Additional tables for network elements and types are available, see examples stored in the DGS subfolder of the PowerFactory installation directory.
33
34
$$ElmCoup;ID(a:40);loc_name(a:40);fold_id(p);aUsage(a:4);on_off(i) ******************************************************************************** * Breaker/Switch * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * aUsage: Switch Type, cbk=Circuit-Breaker, dct=Disconnector, sdc=Load-Break-Disconnector, swt=Load-Switch * on_off: Closed (1=closed, 0=open) ******************************************************************************** 2;110KV BRK;6;cbk;0 3;110kV DIS;6;dct;0 4;20KV BRK;6;cbk;0 5;20KV DIS;6;dct;0
$$ElmNet;ID(a:40);loc_name(a:40);fold_id(p);frnom(r) ******************************************************************************** * Grid * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * frnom: Nominal Frequency in Hz ******************************************************************************** 6;MS;;50
$$ElmTerm;ID(a:40);loc_name(a:40);fold_id(p);iUsage(i);uknom(r) ******************************************************************************** * Terminal * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * iUsage: Usage:0=Busbar:1=Junction Node:2=Internal Node * uknom: Nominal Voltage: Line-Line in kV
35
******************************************************************************** 7;110kV Busbar;6;0;110 8;20KV Busbar;6;0;20 9;Internal node 1;6;2;110 10;Internal node 2;6;2;110 11;Internal node 3;6;2;20 12;Internal node 4;6;2;20
$$ElmTr2;ID(a:40);loc_name(a:40);fold_id(p);chr_name(a:20);cgnd_h(i);cgnd_l(i);i_auto(i);nntap(i);ntrcn(i);ratfac(r) ******************************************************************************** * 2-Winding Transformer * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * chr_name: Characteristic Name * cgnd_h: Internal Grounding Impedance, HV Side: Star Point:Connected:Not connected * cgnd_l: Internal Grounding Impedance, LV Side: Star Point:Connected:Not connected * i_auto: Auto Transformer * nntap: Tap: Tap Position * ntrcn: Tap: Automatic Tap Changing * ratfac: Rating Factor ******************************************************************************** 13;NT1;6;;0;0;0;4;0;1
$$StaCubic;ID(a:40);loc_name(a:40);fold_id(p);chr_name(a:20);obj_id(p);obj_bus(i) ******************************************************************************** * Cubicle * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * chr_name: Characteristic Name * obj_id: Connected with in Elm* * obj_bus: Bus Index ******************************************************************************** 14;Cub_1;7;;3;1 15;Cub_1;8;;5;0 16;Cub_1;9;;3;0 17;Cub_2;9;;2;1 18;Cub_1;10;;2;0 19;Cub_2;10;;13;0 20;Cub_1;11;;4;1 21;Cub_2;11;;13;1 22;Cub_1;12;;5;1 23;Cub_2;12;;4;0
36
$$ElmNet;ID(a:40);loc_name(a:40);fold_id(p);frnom(r) ******************************************************************************** * Grid * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * frnom: Nominal Frequency in Hz ******************************************************************************** 2;MS;;50
$$ElmTerm;ID(a:40);loc_name(a:40);fold_id(p);iUsage(i);uknom(r) ******************************************************************************** * Terminal * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * iUsage: Usage:0=Busbar:1=Junction Node:2=Internal Node * uknom: Nominal Voltage: Line-Line in kV ******************************************************************************** 3;110kV Busbar;2;0;110 4;20kV Busbar;2;0;20
$$ElmTr2;ID(a:40);loc_name(a:40);fold_id(p);chr_name(a:20);cgnd_h(i);cgnd_l(i);i_auto(i);nntap(i);ntrcn(i);ratfac(r) ******************************************************************************** * 2-Winding Transformer * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * chr_name: Characteristic Name * cgnd_h: Internal Grounding Impedance, HV Side: Star Point:Connected:Not connected * cgnd_l: Internal Grounding Impedance, LV Side: Star Point:Connected:Not connected * i_auto: Auto Transformer
37
* nntap: Tap: Tap Position * ntrcn: Tap: Automatic Tap Changing * ratfac: Rating Factor ******************************************************************************** 5;NT1;2;;0;0;0;4;0;1
$$StaCubic;ID(a:40);loc_name(a:40);fold_id(p);chr_name(a:20);obj_id(p);obj_bus(i) ******************************************************************************** * Cubicle * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: In Folder * chr_name: Characteristic Name * obj_id: Connected with in Elm* * obj_bus: Bus Index ******************************************************************************** 6;Cub_1;3;;5;0 7;Cub_1;4;;5;1
$$StaSwitch;ID(a:40);loc_name(a:40);fold_id(p);iUse(i);on_off(i) ******************************************************************************** * Switch * * ID: Unique identifier for DGS file * loc_name: Name * fold_id: in Cubicle * iUse: Type of Usage * on_off: Closed ******************************************************************************** 8;Switch;6;;1;1 9;Switch;7;;1;1
38