0% found this document useful (0 votes)
20 views915 pages

DplReference en

The document is the DPL Function Reference for PowerFactory 2023, published by DIgSILENT GmbH. It includes a comprehensive overview of general descriptions, global functions, object methods, and various network and station elements. The publication is intended for users of PowerFactory software and contains detailed information on its functionalities and commands.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views915 pages

DplReference en

The document is the DPL Function Reference for PowerFactory 2023, published by DIgSILENT GmbH. It includes a comprehensive overview of general descriptions, global functions, object methods, and various network and station elements. The publication is intended for users of PowerFactory software and contains detailed information on its functionalities and commands.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 915

PowerFactory 2023

DPL Function Reference


F2023

POWER SYSTEM SOLUTIONS


MADE IN GERMANY
Publisher:
DIgSILENT GmbH
Heinrich-Hertz-Straße 9
72810 Gomaringen / Germany
Tel.: +49 (0) 7072-9168-0
Fax: +49 (0) 7072-9168-88
[email protected]

Please visit our homepage at:


https://www.digsilent.de

Copyright © 2023 DIgSILENT GmbH


All rights reserved. No part of this
publication may be reproduced or
distributed in any form without written
permission of DIgSILENT GmbH.

February 28, 2023


Revision 3
CONTENTS CONTENTS

Contents

1 General Description 1

2 Global Functions 2
2.1 File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.2 Date/Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.3 Dialogue Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.4 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.5 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.6 MS Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.6.1 MS Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.6.2 MS Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
2.7 Multibyte Encoded String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
2.8 Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
2.9 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

3 Object Methods 140


3.1 General Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
3.2 Network Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
3.2.1 ElmArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
3.2.2 ElmAsm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
3.2.3 ElmAsmsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
3.2.4 ElmBbone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.2.5 ElmBmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
3.2.6 ElmBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
3.2.7 ElmBranch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
3.2.8 ElmCabsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
3.2.9 ElmComp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
3.2.10 ElmCoup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
3.2.11 ElmDsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
3.2.12 ElmFeeder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
3.2.13 ElmFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
3.2.14 ElmFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

2
CONTENTS CONTENTS

3.2.15 ElmGenstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206


3.2.16 ElmGndswt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
3.2.17 ElmLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
3.2.18 ElmLnesec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
3.2.19 ElmMdl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
3.2.20 ElmNec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
3.2.21 ElmNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
3.2.22 ElmPvsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
3.2.23 ElmRelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
3.2.24 ElmRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
3.2.25 ElmShnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
3.2.26 ElmStactrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
3.2.27 ElmSubstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
3.2.28 ElmSvs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
3.2.29 ElmSym . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
3.2.30 ElmTerm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
3.2.31 ElmTow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
3.2.32 ElmTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
3.2.33 ElmTr3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
3.2.34 ElmTr4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
3.2.35 ElmTrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
3.2.36 ElmTrb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
3.2.37 ElmTrfstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
3.2.38 ElmVac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
3.2.39 ElmVoltreg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
3.2.40 ElmXnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
3.2.41 ElmZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
3.3 Station Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
3.3.1 StaCt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
3.3.2 StaCubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
3.3.3 StaExtbrkmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
3.3.4 StaExtcmdmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
3.3.5 StaExtdatmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
3.3.6 StaExtfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
3.3.7 StaExtfuelmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
3.3.8 StaExtimea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
3.3.9 StaExtpfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
3.3.10 StaExtpmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
3.3.11 StaExtqmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
3.3.12 StaExtsmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

3
CONTENTS CONTENTS

3.3.13 StaExttapmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368


3.3.14 StaExtv3mea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
3.3.15 StaExtvmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
3.3.16 StaSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
3.4 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
3.4.1 ComAddlabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
3.4.2 ComAddon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
3.4.3 ComAmpacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
3.4.4 ComArcreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
3.4.5 ComAuditlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
3.4.6 ComBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
3.4.7 ComCapo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
3.4.8 ComCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
3.4.9 ComCimdbexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
3.4.10 ComCimdbimp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
3.4.11 ComCimvalidate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
3.4.12 ComConreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
3.4.13 ComContingency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
3.4.14 ComCoordreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
3.4.15 ComDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
3.4.16 ComDllmanager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
3.4.17 ComDpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
3.4.18 ComFlickermeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
3.4.19 ComGenrelinc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
3.4.20 ComGridtocim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
3.4.21 ComHostcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
3.4.22 ComImport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
3.4.23 ComInc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
3.4.24 ComLdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
3.4.25 ComLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
3.4.26 ComMerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
3.4.27 ComMot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
3.4.28 ComNmink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
3.4.29 ComOmr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
3.4.30 ComOpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
3.4.31 ComOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
3.4.32 ComPfdimport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
3.4.33 ComPrjconnector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
3.4.34 ComProtgraphic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
3.4.35 ComPvcurves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472

4
CONTENTS CONTENTS

3.4.36 ComPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472


3.4.37 ComRed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
3.4.38 ComRel3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
3.4.39 ComRelpost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
3.4.40 ComRelreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
3.4.41 ComReltabreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
3.4.42 ComReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
3.4.43 ComRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
3.4.44 ComShc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
3.4.45 ComShctrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
3.4.46 ComSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
3.4.47 ComSimoutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
3.4.48 ComSvgexport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
3.4.49 ComSvgimport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
3.4.50 ComTablereport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
3.4.51 ComTasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
3.4.52 ComTececo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
3.4.53 ComTececocmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
3.4.54 ComTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
3.4.55 ComUcte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
3.4.56 ComUcteexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
3.4.57 ComWktimp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
3.5 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
3.5.1 SetCluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
3.5.2 SetColscheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
3.5.3 SetDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
3.5.4 SetDataext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
3.5.5 SetDeskpage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
3.5.6 SetDesktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
3.5.7 SetDistrstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
3.5.8 SetFilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
3.5.9 SetLevelvis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
3.5.10 SetLvscale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
3.5.11 SetParalman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
3.5.12 SetPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
3.5.13 SetPrj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
3.5.14 SetScenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
3.5.15 SetSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
3.5.16 SetTboxconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
3.5.17 SetTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604

5
CONTENTS CONTENTS

3.5.18 SetUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606


3.5.19 SetVipage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
3.6 Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
3.6.1 BlkDef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
3.6.2 BlkSig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
3.6.3 ChaVecfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
3.6.4 CimArchive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
3.6.5 CimModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
3.6.6 CimObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
3.6.7 GrpPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
3.6.8 IntAddonvars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
3.6.9 IntCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
3.6.10 IntComtrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
3.6.11 IntComtradeset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
3.6.12 IntDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
3.6.13 IntDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
3.6.14 IntDplmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
3.6.15 IntDplvec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
3.6.16 IntEvt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
3.6.17 IntExtaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
3.6.18 IntGate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
3.6.19 IntGrf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
3.6.20 IntGrfgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
3.6.21 IntGrflayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
3.6.22 IntGrfnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
3.6.23 IntIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
3.6.24 IntLibrary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
3.6.25 IntMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
3.6.26 IntMon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
3.6.27 IntOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
3.6.28 IntPlannedout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
3.6.29 IntPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
3.6.30 IntPrj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
3.6.31 IntPrjfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
3.6.32 IntQlim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
3.6.33 IntRas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
3.6.34 IntReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
3.6.35 IntRunarrange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
3.6.36 IntScenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
3.6.37 IntScensched . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743

6
CONTENTS CONTENTS

3.6.38 IntScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745


3.6.39 IntSscheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
3.6.40 IntSstage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
3.6.41 IntSubset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
3.6.42 IntThrating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
3.6.43 IntUrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
3.6.44 IntUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
3.6.45 IntUserman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
3.6.46 IntVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
3.6.47 IntVecobj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
3.6.48 IntVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
3.6.49 IntViewbookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
3.6.50 PltAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
3.6.51 PltComplexdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
3.6.52 PltDataseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
3.6.53 PltLegend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
3.6.54 PltLinebarplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
3.6.55 PltTitle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
3.6.56 PltVectorplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
3.6.57 RelChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
3.6.58 RelToc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
3.6.59 RelZpol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
3.6.60 ScnFreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
3.6.61 ScnFrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
3.6.62 ScnSpeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
3.6.63 ScnSync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
3.6.64 ScnVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
3.6.65 ScnVolt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
3.6.66 StoMaint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
3.6.67 TypAsmo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
3.6.68 TypCtcore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
3.6.69 TypLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
3.6.70 TypMdl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
3.6.71 TypQdsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
3.6.72 TypTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
3.6.73 VisBdia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
3.6.74 VisDraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
3.6.75 VisHrm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
3.6.76 VisMagndiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
3.6.77 VisOcplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810

7
CONTENTS CONTENTS

3.6.78 VisPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812


3.6.79 VisPcompdiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
3.6.80 VisPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
3.6.81 VisPlot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
3.6.82 VisPlottz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
3.6.83 VisVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
3.6.84 VisVecres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
3.6.85 VisXyplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846

4 Set Routines 850

Index 858

8
CHAPTER 1. GENERAL DESCRIPTION

1 General Description

The DIgSILENT Programming Language (DPL) provides a large set of build-in functions. For
overview and understanding they can be grouped into the following categories

1. global functions,
2. general methods,
3. specialised methods,

4. set routines.

The “global functions” are a kind of static functions that can be called everywhere in the script.
The term ‘methods’ is used for functions that can be called on an object. Generally it is
distinguished between methods that are available for objects of different classes and those
available for distinct classes only. The first group is called “general methods”, the second
“specialised methods” with reference to its class.
The last group of “set routines” is formed by functions that are available for working with DPL
own data type ‘set’.

This document comes as a reference manual. The following chapters describe the syntax and
meaning of all available functions.
Please refer to the PowerFactory User Manual for general information about the DPL scripting
language and its usage.

Functions which are marked with an asterisk (*) are available in

1. Quasi-Dynamic Simulation Language (QDSL), see here,

2. Configuration scripts for initialisation of RMS/EMT simulation, see here.

1
CHAPTER 2. GLOBAL FUNCTIONS

2 Global Functions

Overview

ActivateProject
ClearCommands
ClearRecycleBin
CommitTransaction
ConvertGeometryStringToMDL
CreateFaultCase
CreateProject
DecodeColour
Delete
DeleteUntouchedObjects
EncodeColour
ExecuteCmd
exit*
GetActiveCalculationStr*
GetActiveNetworkVariations*
GetActiveProject*
GetActiveScenario*
GetActiveScenarioScheduler*
GetActiveStages*
GetActiveStudyCase*
GetAllUsers*
GetBorderCubicles*
GetBrowserSelection
GetCalcRelevantObjects*
GetClassDescription*
GetCurrentDiagram
GetCurrentSelection
GetCurrentUser*
GetCurrentZoomScaleLevel
GetDataFolder*
GetDescription*
GetDiagramSelection
GetFlowOrientation*
GetFromStudyCase*
GetGlobalLibrary*
GetGraphicsBoard*
GetLanguage*
GetLastCmd
GetLocalLibrary*
GetMem*
GetPageLen*
GetPFVersion*

2
CHAPTER 2. GLOBAL FUNCTIONS

GetProjectFolder*
GetRecordingStage*
GetResData
GetResDesc
GetResObj
GetResUnit
GetResVar
GetSettings*
GetSummaryGrid*
GetTouchedObjects
GetTouchingExpansionStages
GetTouchingStageObjects
GetTouchingVariations
GetUserManager*
GetUserSettings*
HttpGet
ImportDz
ImportSnapshot
IsLdfValid*
IsNAN*
IsRmsValid*
IsScenarioAttribute*
IsShcValid*
IsSimValid*
LicenceHasModule
LoadProfile
LoadResData
MarkInGraphics
OutputFlexibleData*
PostCommand
PrepForUntouchedDelete
Rebuild*
ReleaseResData
ReloadProfile
ResetCalculation
ResFirstValidObject
ResFirstValidObjectVar
ResFirstValidVar
ResGetMax
ResGetMin
ResIndex
ResNextValidObject
ResNextValidObjectVar
ResNextValidVar
ResNval
ResNvars
ResSortToVar
SaveAsScenario
SearchObjectByForeignKey*
SelectToolbox
SetShowAllUsers
Sleep*
SplitLine
StatFileGetXrange
StatFileResetXrange
StatFileSetXrange

3
CHAPTER 2. GLOBAL FUNCTIONS

ActivateProject
Activates a project with its name.
int ActivateProject(string name)

A RGUMENTS
name Name (”Project”), full qualified name (”Project.IntPrj”) or full qualified path (”\User\Project.IntPrj”)
of a project.

R ETURNS
0 on success and 1 if project can not be found or activated.

ClearCommands
Clears the command pipe of the input window. It does not interrupt currently running command.
void ClearCommands()

ClearRecycleBin
Clears the recylce bin of currently logged in user.
void ClearRecycleBin()

CommitTransaction
Writes pending changes to database.
While a script is running none of the changes are written to the database unless the script
terminates. PowerFactory can be forced to write all pending changes to the database using
this function.
void CommitTransaction()

D EPRECATED N AMES
CommitTx

ConvertGeometryStringToMDL
Conversion of string geometry used in PowerFactory versions ¡ 23.
string ConvertGeometryStringToMDL(string orgString,
object intGrfOrLayer)

A RGUMENTS
orgString String to be converted.

intGrfOrLayer
IntGrf or IntGrflayer which contains the text.

4
CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The converted MDL-string.

CreateFaultCase
Create fault cases from the given elements.
int CreateFaultCase(set elms,
int mode,
[int createEvt = 0],
[object folder = NULL]
)

A RGUMENTS
elms Selected elements to create fault cases.
mode How the fault cases are created:

0 Single fault case containing all elements.


1 n-1 (multiple cases).
2 n-2 (multiple cases).
3 Collecting coupling elements and create fault cases for line couplings.
createEvt (optional)
Switch event:
0 Do NOT create switch events (default).
1 Create switch events.
folder (optional)
Folder in which the fault case is stored.

R ETURNS
0 On success.
1 On error.

CreateProject
Creates a new Project inside the parent object. The default project stored in the Configura-
tion/Default folder will be copied and if it contains any Study Cases the first will be used instead
of creating a new one. If desired, a new grid can also be created. Returns the newly created
project.
object CreateProject(string projectName,
string gridName,
[object parent = NULL])

object CreateProject(string projectName,


[object parent = NULL])

5
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
projectName
Name of the new project. Leave empty to open up the IntPrj dialog and let the
user enter a name.
gridName
Name of the grid that‘s created for the new project. Use an empty string to open
up the ElmNet dialog and let the user enter a name.
Leave out this argument completely to not create a grid.
parent The parent for the new project. Can be omitted to use the currently logged on user
as default.

DecodeColour
Decodes a colour value stored in PowerFactory’s internal colour representation, and splits it into
its RGBA components.
void DecodeColour(int encodedColour,
int& red,
int& green,
int& blue,
int& alpha)

A RGUMENTS
encodedColour
Colour value given in PowerFactory’s internal colour representation, as read from
any colour attribute.
red (out) Red colour channel. Range [0,255].

green (out)
Green colour channel. Range [0,255].
blue (out) Blue colour channel. Range [0,255].
alpha (out)
Colour transparency. Range [0,255], with 0 being fully transparent and 255 being
fully opaque.

E XAMPLE
The following example reads the background colour of operation scenario parameters:
object userSettings;
int encodedColour;
int red, green, blue, alpha;
userSettings = GetUserSettings();
encodedColour = userSettings:iColOPVar;
DecodeColour(encodedColour, red, green, blue, alpha);
printf('RGBA = (%i, %i, %i, %i)', red, green, blue, alpha);

6
CHAPTER 2. GLOBAL FUNCTIONS

Delete
Deletes an object or a set of objects from the database. The objects are not destroyed but are
moved to the recycle bin.
void Delete(object object)
void Delete(set objects)

A RGUMENTS
object Object to delete.
objects Set of objects to delete.

S EE ALSO

object.CreateObject(), object.AddCopy(), object.PasteCopy(), object.Move()

E XAMPLE
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 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 using a single restore command.
object obj;
set fuses, toDelete;
fuses = GetCalcRelevantObjects();
obj = fuses.FirstFilt('*.RelFuse');
while (obj) {
if (obj:typ_id=DummyType) {
toDelete.Add(obj);
}
obj = fuses.NextFilt();
}
Delete(toDelete);

DeleteUntouchedObjects
Delete all objects stored in the grid (or stored in set) which are not modified. Requires call of
PrepForUntouchedDelete() first, see PrepForUntouchedDelete(). Hint: function should only be
used when a variation is active. For details please contact support.
int DeleteUntouchedObjects(object grid)
int DeleteUntouchedObjects(set grids)

E XAMPLE
PrepForUntouchedDelete(grid);

! do here modifications e.g. ... run UCTE import

DeleteUntouchedObjects(grid);

7
CHAPTER 2. GLOBAL FUNCTIONS

EncodeColour
Encodes an RGBA colour value into PowerFactory’s internal colour representation. The re-
turned value is meant to be assigned to a colour attribute.
int EncodeColour(int red,
int green,
int blue,
[int alpha = 255])

A RGUMENTS
red Red colour channel. Must be in the range [0,255].
green Green colour channel. Must be in the range [0,255].
blue Blue colour channel. Must be in the range [0,255].
alpha(optional)
Colour transparency. Must be in the range [0,255], with 0 being fully transparent
and 255 being fully opaque.

R ETURNS
The encoded colour value. This value can be assigned to any colour attribute.

E XAMPLE
The following example changes the background colour of operation scenario parameters to
magenta:
object userSettings;
int encodedColour;
userSettings = GetUserSettings();
encodedColour = EncodeColour(255, 0, 255);
userSettings:iColOPVar = encodedColour;

ExecuteCmd
Executes given command string as it would be executed if typed directly into the Input Window.
Current script will continue after the command has been executed.
This function is mainly intended for testing purpose and should be used by experienced users
only.
void ExecuteCmd(string command)

A RGUMENTS
command
The command string

D EPRECATED N AMES
Exe

E XAMPLE
The following script executed a load flow calculation with default options
ExecuteCmd('ldf');

8
CHAPTER 2. GLOBAL FUNCTIONS

exit*
Terminates a DPL script immediately. If called within a subscript, only the subscript itself will be
terminated and code is returned by 'subscript.Execute() ' in the main script.
void exit([int code])

A RGUMENTS
code The integer returned by ’subscript.Execute()’ in the main script, when exit() is
called within a subscript. The default value is 1.

S EE ALSO

ComDpl.Execute()

E XAMPLE
int number;
int sum;

! sums up all entered numbers


while(1) {
input(number, 'Enter a number please (0 to stop):');
if (number = 0) {
printf('Sum: %d' , sum);
exit(); ! terminate script here
}
sum += number;
}

GetActiveCalculationStr*
Gets “calculation string” of currently valid calculation.
string GetActiveCalculationStr()

R ETURNS
None basic
Load Flow ldf
AC Load Flow Sensitivities acsens
AC Contingency Analysis accont
DC Load Flow dcldf
DC Load Flow Sensitivities dcsens
DC Contingency Analysis dccont
VDE/IEC Short-Circuit shc
Complete Short-Circuit shcfull
ANSI Short-Circuit shcansi
IEC 61363 shc61363
RMS-Simulation rms
Modal Analysis modal
EMT-Simulation emt
Harmonics/Power Quality harm

9
CHAPTER 2. GLOBAL FUNCTIONS

Frequency Sweep fsweep


Optimal Power Flow opf
DC Optimal Power Flow dcopf
DC OPF with Contingencies dccontopf
State Estimation est
Reliability rel
General Adequacy genrel
Tie Open Point Opt. topo
Motor Starting Calculation motstart
Arc Flash Calculation arcflash
Optimal Capacitor Placement optcapo
Voltage Plan Optimization mvplan
Backbone Calculation backbone
Optimal RCS Placement optrcs

GetActiveNetworkVariations*
Returns all active variations for the 'Network Data' folder.
set GetActiveNetworkVariations()

R ETURNS
Returns currently active IntScheme objects. Set is empty in case of no scheme being
currently active.

E XAMPLE
The following example returns the currently active variations:
object variation;
set variations;
variations = GetActiveNetworkVariations();
for(variation = variations.First();variation;variation = variations.Next()) {
variation.ShowFullName();
}

GetActiveProject*
This function returns the currently active project.
object GetActiveProject()

D EPRECATED N AMES
ActiveProject

E XAMPLE
The following example prints the currently active project to output window:
object project;
project = GetActiveProject();
printf('Currently active project: %o', project);

10
CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Returns currently active IntPrj object or NULL in case of no project being currently active.

GetActiveScenario*
Returns the currently active scenario. NULL is returned if there is no active scenario.
object GetActiveScenario()

E XAMPLE
The following example prints the currently active scenario to output window:
object scenario;
scenario = GetActiveScenario();
printf('Active scenario: %o', scenario);

R ETURNS
Returns currently active IntScenario object or NULL in case of no scenario being currently
active.

GetActiveScenarioScheduler*
Returns currently active scenario scheduler.
object GetActiveScenarioScheduler()

R ETURNS
Returns currently active IntScensched object or NULL in case of no scheduler being currently
active.

GetActiveStages*
Returns all active stages currently active for a given folder, e.g. 'Network Data' folder.
set GetActiveStages([object variedFolder = NULL])

A RGUMENTS
variedFolder (optional)
Folder for which all active stages will be returned; by default, the project folder
'Network Data' is taken.

R ETURNS
Returns currently active IntSstage objects. Set is empty in case of no stages being currently
active.

E XAMPLE
The following example returns the currently active recording stages:
object stage;
set stages;
stages = GetActiveStages();
for(stage = stages.First(); stage; stage = stages.Next()) {

11
CHAPTER 2. GLOBAL FUNCTIONS

stage.ShowFullName();
}

GetActiveStudyCase*
Returns the active Study Case. NULL is returned if there is no active study case.
object GetActiveStudyCase()

R ETURNS
The active study case (IntCase object) or NULL.

D EPRECATED N AMES
ActiveCase

E XAMPLE
The following example writes the active study case to the output window:
object case;
case = GetActiveStudyCase();
printf('Active study case: %o', case);

R ETURNS
Returns currently active IntCase object or NULL in case of no study case being currently
active.

GetAllUsers*
Returns all known users, regardless of any Data Manager filters.
set GetAllUsers([int forceReload = 0])

list GetAllUsers([int forceReload = 0])

A RGUMENTS
forceReload
0 Default, returns the cached state if function was called before.
1 Forces the cache to be cleared, may impact performance.

R ETURNS
Returns a container with all known users.

GetBorderCubicles*
This function returns the border cubicles of the parent station of passed element topologically
reachable from that element.
A cubicle (StaCubic) is considered to be a border cubicle if it resides inside the station

• and points to an element that sits outside the station

12
CHAPTER 2. GLOBAL FUNCTIONS

• or to a branch element that is connected to a terminal outside the station.

set GetBorderCubicles(object element)

A RGUMENTS
element Element from which the search for border cubicles starts

R ETURNS
A set, containing border cubicles StaCubic. If the element does not reside in any substation
or no border cubicles exist, the set is empty.

GetBrowserSelection
Returns all objects marked in the “on top” Data Manager (Browser, right side). In comparison to
GetCurrentSelection() this is independently of how the script is executed.
set GetBrowserSelection()

R ETURNS
Objects marked in the “on top” Data Manager (Browser, right side).

S EE ALSO

GetCurrentSelection(), GetDiagramSelection()

GetCalcRelevantObjects*
Returns all currently calculation relevant objects, i.e. the objects which are used by the calcula-
tions.
The set of objects depends on active study case, active grid(s) and variation(s).
In contrast to object.IsCalcRelevant() it does not return objects of the active study case e.g.
simulation events (Evt*).
set GetCalcRelevantObjects([string nameFilter = "*.*",]
[int includeOutOfService = 1,]
[int topoElementsOnly = 0,]
[int bAcSchemes = 0])

A RGUMENTS
nameFilter (optional)
(Class) name filter. Wildcards are supported. Multiple filters to be separated by
comma ’,’. Must not contain a backslash ’\’.
If omitted, all objects are returned (corresponds to ’*.*’).
Examples for valid filter strings:
• ’ElmTerm’
• ’A*.ElmTerm’
• ’*.ElmLod,*.ElmSym’
includeOutOfService (optional)
Flag whether to include out of service objects. Default is 1 (=included).
topoElementsOnly (optional)
Flag to filter for topology relevant objects only. Default is 0 (=all objects).

13
CHAPTER 2. GLOBAL FUNCTIONS

bAcSchemes (optional)
Flag to include hidden objects in active schemes. Default is 0 (=not included).

R ETURNS
The currently calculation relevant objects, according to the given arguments. The order of
the set is undefined.

D EPRECATED N AMES
AllRelevant

S EE ALSO

object.IsCalcRelevant()

E XAMPLE
The following example prints the names of all calculation relevant loads
set loads;
object load;

loads = GetCalcRelevantObjects('*.ElmLod');
for(load = loads.First(); load; load = loads.Next()) {
load.ShowFullName();
}

GetClassDescription*
Returns a description for a PowerFactory class.
string GetClassDescription(string name)

A RGUMENTS
name Name of a PowerFactory class

R ETURNS
Returns the description of a valid PowerFactory class, otherwise an empty string.

GetCurrentDiagram
This function offers access to the current diagram object (IntGrfnet).
object GetCurrentDiagram()

GetCurrentSelection
Returns all objects marked in the “on top” Data Manager (Browser, right side) or diagram when
the script is executed via the right-click menu entry ’Execute Script’. When the script is executed
e.g via the edit dialog or via a toolbar button then it always returns an empty selection.
set GetCurrentSelection()

R ETURNS
Objects marked in the “on top” Data Manager (Browser, right side) or diagram.

14
CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

GetBrowserSelection(), GetDiagramSelection()

GetCurrentUser*
Returns the PowerFactory user of current session.
object GetCurrentUser()

E XAMPLE
The following example prints the user of current session to output window:
object user;
user = GetCurrentUser();
printf('Current user: %o', user);

R ETURNS
Returns an IntUser object, never NULL.

GetCurrentZoomScaleLevel
Returns the zoom or scale level of the currently active diagram. If the active diagram is geo-
graphic, then the scale level is returned, otherwise the zoom level is returned.
int GetCurrentZoomScale()

R ETURNS
Zoom or scale level of the active diagram as integer.

• For geographic diagrams the scale level is returned. E.g. returns 50000 if 1:50000 is in
the zoom/ratio combo box
• For all other diagrams the zoom level is returned. E.g. returns 150 if 150

A value of -1 is returned in case of no open diagram.

E XAMPLE
int level;
object diagram;

diagram = GetCurrentDiagram();
if (.not. diagram) {
Error('No diagram active!');
exit();
}

level = GetCurrentZoomScaleLevel();
if (diagram:iGPS) {
printf('Scale level of %o: 1:%d', diagram, level);
}
else {
printf('Zoom level of %o: %d%s', diagram, level, '%');
}

15
CHAPTER 2. GLOBAL FUNCTIONS

GetDataFolder*
This function returns the folder in which the network data for the given class are stored.
object GetDataFolder(string classname,
[int iCreate = 0])

A RGUMENTS
classname
Classname of the elements:
ElmBmu
ElmArea
ElmZone
ElmRoute
ElmOwner
ElmOperator
ElmFeeder
ElmCircuit
ElmBoundary
IntScales

iCreate(optional)
0 The folder is searched and returned if found. If the folder does not
exist, NULL is returned (default).
1 The folder is created if it does not exist. The found or created folder is
returned.

R ETURNS
The network data folder, which is found or created.

E XAMPLE
The following example returns the network data folder for 'ElmBoundary' elements:
object folder;
folder = GetDataFolder ('ElmBoundary');
folder.ShowFullName();

S EE ALSO

object.IsNetworkDataFolder()

GetDescription*
Returns the display text or unit of measurement for an attribute.
string GetDescription(string class,
string attribute,
[int type = 0])

16
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
class Name of the class.
attribute Name of the attribute.
type (optional)
Description type.
0 Default, long form.
1 Short form.
2 Unit.

R ETURNS
Descriptive text or unit, can be empty (e.g. in case where given attribute does not exist).

E XAMPLE
string long, short, unit;

long = GetDescription('ElmLod', 'plini', 0);


short = GetDescription('ElmLod', 'plini', 1);
unit = GetDescription('ElmLod', 'plini', 2);

printf('ElmLod:plini means "%s (%s)" and is given in unit %s.', long, short, unit);

S EE ALSO

object.lnm(), object.snm(), object.unm()

GetDiagramSelection
Returns all objects marked in the “on top” diagram. In comparison to GetCurrentSelection() this
is independently of how the script is executed.
set GetDiagramSelection()

R ETURNS
Objects marked in the “on top” diagram.

S EE ALSO

GetCurrentSelection(), GetBrowserSelection()

GetFlowOrientation*
This function returns the flow orientation setting of the active project.
int GetFlowOrientation()

R ETURNS
-1 No project is active
0 Flow orientation of active project is “MIXED MODE”
1 Flow orientation of active project is “LOAD ORIENTED”
2 Flow orientation of active project is “GENERATOR ORIENTED”

17
CHAPTER 2. GLOBAL FUNCTIONS

GetFromStudyCase*
Returns the first found object of class “className” from the currently active study case. The
object is created when no object of the given name and/or class was found.
For commands the returned instance corresponds to the one that is used if opened via the main
menue load-flow, short-circuit, transient simulation, etc.,
object GetFromStudyCase(string className)

A RGUMENTS
className
Class name of the object (“Class”), optionally preceded by an object name without
wildcards and a dot (“Name.Class”).

R ETURNS
The found or created object.

D EPRECATED N AMES
GetCaseObject, GetCaseCommand

E XAMPLE
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, ldf;
time = GetFromStudyCase('SetTime');
time:hourofyear = 1234;
ldf = GetFromStudyCase('Unbalanced.ComLdf');
ldf.Execute();

GetGlobalLibrary*
Returns the global library for object-types of class “ClassName”. ClassName may be omitted,
in which case the complete global library folder is returned.
object GetGlobalLib([string ClassName = ""])

A RGUMENTS
ClassName (optional)
The classname of the objects for which the library folder is sought

R ETURNS
The libary folder

S EE ALSO

GetLocalLibrary()

D EPRECATED N AMES
GetGlobalLib

E XAMPLE
The following example shows the contents of the global library for line types.

18
CHAPTER 2. GLOBAL FUNCTIONS

object lib, obj;


set contents;
lib = GetGlobalLibrary('TypLne');
contents = lib.GetContents();
obj = contents.First();
while (obj) {
obj.ShowFullName();
obj = contents.Next();
}

GetGraphicsBoard*
Returns the currently active Graphics Board.
object GetGraphicsBoard()

R ETURNS
The graphics board object

D EPRECATED N AMES
GetGraphBoard

E XAMPLE
The following example looks for an opened Graphics Board and sets its default results to the
results object named 'Results'.
object graphBoard;
! Look for opened graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
! Set default results object
graphBoard.SetResults(Results);
}

GetLanguage*
Returns a string for the current program language setting.
string GetLanguage()

R ETURNS
en English
de German
es Spanish
fr French
ru Russian
cn Simplified Chinese
tr Turkish

19
CHAPTER 2. GLOBAL FUNCTIONS

GetLastCmd
Returns the last executed command of the given class. If no class is given, the last executed
command is returned.
object GetLastCmd([string class])

A RGUMENTS
class (optional)
command class

R ETURNS
The last executed command.

GetLocalLibrary*
Returns the local library for object-types of class “ClassName”. ClassName may be omitted, in
which case the complete local library folder is returned.
object GetLocalLibrary([string ClassName = ""])

A RGUMENTS
ClassName (optional)
The classname of the objects for which the library folder is sought

R ETURNS
The libary folder

S EE ALSO

GetGlobalLibrary()

D EPRECATED N AMES
GetLocalLib

E XAMPLE
The following example shows the contents of the local library for line types.
object lib, obj;
set contents;
lib = GetLocalLib('TypLne');
contents = lib.GetContents();
obj = contents.First();
while (obj) {
obj.ShowFullName();
obj = contents.Next();
}

GetMem*
Allows to trace memory consumption (current working set size).
int GetMem([int calculateDelta=0],
[int inMegaByte=0]
)

20
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
calculateDelta (optional)
Measure absolute memory consumption if 0, measure the delta since the last time
it was called if 1 (default: 0).
inMegaByte (optional)
Returns consumption in byte if 0, in megabyte if 1 (default: 0).

R ETURNS
The current working set size or the delta since the last call.

GetPageLen*
Returns the number of lines per page according to the currently selected printer and paper size.
int GetPageLen([int orientation])

A RGUMENTS
orientation (optional)
0 (default) Landscape
1 Portrait

R ETURNS
The maximum number of lines that can be printed on a single sheet of paper in given
orientation.

GetPFVersion*
Returns the internal version number of currently running PowerFactory application.
string GetPFVersion()

R ETURNS
Version string of format ##.#.#.#, e.g. 20.0.3.1

E XAMPLE
string strVersion;
strVersion=GetPFVersion();
printf('%s', strVersion);

GetProjectFolder*
Returns the project folder of a given type of active project. For each type (except ‘Generic’)
there exist not more than one folder per type.
object GetProjectFolder(string type, [int create = 0])

21
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
type Type of the corresponding project folder. See IntPrjfolder.GetProjectFolderType()
for a list of possible values.
create Optional, default=0. Determines whether folder shall be created if it does not exist
(1=create, 0=don’t create).

R ETURNS
An IntPrjFolder object. If no project is currently active or project folder of this type does not
exist and ’create’ is not given as 0, NULL is returned.

E XAMPLE
The following example returns the study case project folder:
object folder;
folder = GetProjectFolder('study');
folder.ShowFullName();

GetRecordingStage*
Returns the currently active recording scheme stage.
object GetRecordingStage()

R ETURNS
An IntSstage object; NULL if there is no recording stage.

E XAMPLE
The following example returns the currently active recording stage:
object stage;
stage = GetRecordingStage();
stage.ShowFullName();

GetResData
This function is deprecated. Please use ElmRes.GetValue() or IntComtrade.GetValue() in-
stead.
int GetResData(double& d,
object resultObject,
int iX,
[int col])

GetResDesc
This function is deprecated. Please use ElmRes.GetDescription() or
IntComtrade.GetDescription() instead.
string GetResDesc(object resultObject,
int col,
[int ishort])

22
CHAPTER 2. GLOBAL FUNCTIONS

GetResObj
This function is deprecated. Please use ElmRes.GetObject() instead.
object GetResObj(object res,
int col)

GetResUnit
This function is deprecated. Please use ElmRes.GetUnit() or IntComtrade.GetUnit() instead.
string GetResUnit(object resultObject,
int col)

GetResVar
This function is deprecated. Please use ElmRes.GetVariable() or IntComtrade.GetVariable()
instead.
string GetResVar(object resultObject,
int col)

GetSettings*
Offers read-only access to some selected PowerFactory settings.
string GetSettings(string key)

A RGUMENTS
key
Key Return type Description
username string Name of logged-in user
installationdir string Fully qualified path of installation directory of PowerFac-
tory
workingdir string Fully qualified path of working directory of PowerFactory
tempdir string Fully qualified path of temporary directory used by PowerFac-
tory
sessionid integer ID of current session
db driver string Name of used database driver
logfile string Path of current log file

R ETURNS
Value of settings as string

E XAMPLE
The following example demonstrated how to access those settings:
string s;
int i;

s = GetSettings('username');
printf('Username: %s', s);

23
CHAPTER 2. GLOBAL FUNCTIONS

s = GetSettings('installationdir');
printf('InstallationDir: %s', s);

s = GetSettings('workingdir');
printf('WorkingDir: %s', s);

s = GetSettings('tempdir');
printf('TempDir: %s', s);

s = GetSettings('db_driver');
printf('DBDriver: %s', s);

i = GetSettings('sessionid');
printf('SessionID: %d', i);

s = GetSettings('logfile');
printf('Used log file: %s', s);

GetSummaryGrid*
Returns the summary grid in the currently active Study Case. The summary grid is the combi-
nation of all active grids in the study case.
object GetSummaryGrid()

R ETURNS
A ElmNet object, or a 'NULL ' object when no grids are active

D EPRECATED N AMES
SummaryGrid

E XAMPLE
The following example performs a load-flow and returns the total grid active power losses.
object sumGrid;
sumGrid = GetSummaryGrid();
if (sumGrid) {
Ldf.Execute();
printf('Active Power Losses=%f', sumGrid:c:LossP);
}

GetTouchedObjects
Gets all root objects added, modified or deleted in the given variations and expansion stages.
set GetTouchedObjects(object varOrStage)
set GetTouchedObjects(set varsAndStages)

A RGUMENTS
varOrStage
Variation or expansion stage.

24
CHAPTER 2. GLOBAL FUNCTIONS

varsAndStages
Variations and expansion stages.

R ETURNS
Matching root objects.

GetTouchingExpansionStages
Gets all expansion stages in which at least one of the given objects is added, modified or
deleted.
set GetTouchingExpansionStages(object rootObject)
set GetTouchingExpansionStages(set rootObjects)

A RGUMENTS
rootObject
Root object.
rootObjects
Root objects.

R ETURNS
Matching expansion stages.

GetTouchingStageObjects
Gets all stage objects adding, modifying or deleting one of the given objects.
set GetTouchingStageObjects(object rootObject)
set GetTouchingStageObjects(set rootObjects)

A RGUMENTS
rootObject
Root object.
rootObjects
Root objects.

R ETURNS
Matching expansion stages.

GetTouchingVariations
Gets all variations in which at least one of the given objects is added, modified or deleted.
set GetTouchingVariations(object rootObject)
set GetTouchingVariations(set rootObjects)

A RGUMENTS
rootObject
Root objects.
rootObjects
Root objects.

25
CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Matching variations.

GetUserManager*
Offers access to the user manager object (IntUserman) stored in the configuration folder.
object GetUserManager()

R ETURNS
The user manager object

GetUserSettings*
Convient routine to get the settings object (SetUser) of a user.
object GetUserSettings([object user = NULL])

A RGUMENTS
user (optional)
If current user that executes the function is Administrator, passing a user object
(IntUser) will return the corresponding setting object for that user.
Note: For normal users, the argument is ignored and always the setting object of
current user is returned.

R ETURNS
Returns the settings object (SetUser) for a user.

HttpGet
This function performs a HTTP/HTTPS request and returns the response. Access to the passed
URL must be allowed by the global security settings (IntExtaccess).
int HttpGet(string url,
string& | object& content,
[string& | object& headers,]
[string& error])

A RGUMENTS
url URL to fetch. Only HTTP and HTTPS protocols are supported. Empty or mal-
formed URLs are not allowed. Examples: https://www.digsilent.de
content (out)
Returned content (body) of the http response. The passed argument must be a
string or an instance of class IntDplVec.

headers (optional, out)


Headers of the http response. The passed argument must be a string or an
instance of class IntDplVec.
errors (optional, out)
Descriptive error text, if any and available.

26
CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Standard http code, e.g. 200=OK, 404=Not found etc.
Single exception is a value 1 that is returned in case of a general error

E XAMPLE
int i, ret, size;
string errors, s;
content.Clear(); !content and headers are intended to be IntDplvec
headers.Clear(); !objects stored inside the script

ret = HttpGet('https://www.digsilent.de', content, headers, errors);

printf('Return Code: %d', ret);


printf('Errors: %s', errors);
printf('Headers:');

size = headers.Size();
for(i=0; i<size; i+=1) {
s = headers.Get(i);
printf('%s', s);
}

printf('Content:');
size = content.Size();
for(i=0; i<size; i+=1) {
s = content.Get(i);
printf('%s', s);
}

S EE ALSO

IntUrl.View()

ImportDz
Imports a DZ file. Overwrites data if it already exists.
int ImportDz(object target,
string dzFilePath,
set& importedObjects)

A RGUMENTS
target Target object for imported data.

dzFilePath
Path to the DZ file that should be imported.
importedObjects (out)
Collection of top-level objects imported.

R ETURNS
0 Success
-1 Wrong file extension
nonzero Import failed

27
CHAPTER 2. GLOBAL FUNCTIONS

ImportSnapshot
Imports a Snapshot DZS file.
int ImportSnapshot(string dzsFilePath,
set& importedObjects)

A RGUMENTS
dzsFilePath
Path to the DZ file that should be imported.
importedObjects (out)
Collection of top-level objects imported.

R ETURNS
0 Success
-1 Wrong file extension
nonzero Import failed

IsLdfValid*
Checks to see if the last load-flow results are still valid and available.
int IsLdfValid()

R ETURNS
0 if no load-flow results are available

D EPRECATED N AMES
validLDF

E XAMPLE
The following example checks if a load-flow is available, and performs one when not.
int valid;
valid = IsLdfValid();
if (.not.valid) {
Ldf.Execute();
}

IsNAN*
Checks whether a double value is NAN (not a number).
int IsNAN(double value)

A RGUMENTS
value Double value to check.

R ETURNS
Returns 1, if value is NAN, 0 otherwise.

28
CHAPTER 2. GLOBAL FUNCTIONS

IsRmsValid*
Checks to see if the last RMS simulation results are still valid and available.
int IsRmsValid()

R ETURNS
0 if no RMS simulation results are available

D EPRECATED N AMES
validRMS

E XAMPLE
The following example checks if a RMS simulation is available, and performs one when not.
int valid;
valid = IsRmsValid();
if (.not.valid) {
Rms.Execute();
}

IsScenarioAttribute*
Checks if a given attribute of a given class is recorded in scenario. It does not check whether a
concrete instance is recorded at all. The check is just performed against the scenario configu-
ration and is independent of a concrete scenario.
int IsScenarioAttribute(string classname, string attributename)

A RGUMENTS
classname
Name of a PowerFactory class

attributename
Name of an attribute of given class

E XAMPLE
int t;

t = IsScenarioAttribute('ElmTerm', 'loc_name');
if (t=1) {
printf('Attribute loc_name of class ElmTerm can be recorded by a scenario');
}
else {
printf('Attribute loc_name of class ElmTerm cannot be recorded by a scenario');
}

t = IsScenarioAttribute('ElmTerm', 'iEarth');
if (t=1) {
printf('Attribute iEarth of class ElmTerm can be recorded by a scenario');
}
else {
printf('Attribute iEarth of class ElmTerm cannot be recorded by a scenario');
}

29
CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
1 If attribute is scenario relevant according to current scenario configuration
0 If attribute is not scenario relevant

IsShcValid*
Checks to see if the last short-circuit results are still valid and available.
int IsShcValid()

R ETURNS
0 if no short-circuit results are available

D EPRECATED N AMES
validSHC

E XAMPLE
The following example checks if a short-circuit result is available, and performs one when
not.
int valid;
valid = IsShcValid();
if (.not.valid) {
Shc.Execute();
}

IsSimValid*
Checks to see if the last simulation results are still valid and available.
int IsSimValid()

R ETURNS
0 if no simulation results are available

D EPRECATED N AMES
validSIM

E XAMPLE
The following example checks if a simulation result is available.
int valid;
valid = validSIM();
if (.not.valid) {
printf('No simulation result available');
}

30
CHAPTER 2. GLOBAL FUNCTIONS

LicenceHasModule
Checks whether the current licence contains a module.
The following licence module abbreviations can be used:

• ai - Artificial Intelligence
• anaredefas - ANAREDE/ANAFAS Export
• arcflash - Arc-Flash Analysis

• c37 - C37 Simulation Interface


• cabOpt - Cable Analysis
• cimEentso - CIM Import/Export (ENTSO-E Profile)

• cimEentsoCorp - CIM Import/Export (ENTSO-E Profile) - corp.


• cimIentso - CIM Import (ENTSO-E Profile)
• conrequest - Connection Request Assessment
• contingency - Contingency Analysis

• cosim - Co-Simulation Interface


• crypt - DPL/DSL/QDSL Encryption
• dist - Distance Protection
• distr - Distribution Network Tools

• econom - Economic Analysis Tools


• fmuexp - FMU Model Export
• harm - Power Quality and Harmonic Analysis

• integral - Integral Export


• masterstation - PFM Master Station
• motstart - Motor Starting Functions
• muld - Multi-User Database

• netred - Network Reduction


• opc - OPC Interface
• opfact - OPF (Economic Dispatch)

• opfreact - OPF (Reactive Power Optimisation)


• paramid - System Parameter Identification
• probAnalysis - Probabilistic Analysis
• prot - Time-Overcurrent Protection

• psse - PSS/E Export


• qdynsim - Quasi - Dynamic Simulation
• reli - Reliability Analysis Functions

31
CHAPTER 2. GLOBAL FUNCTIONS

• script - Scripting and Automation

• smallsig - Small Signal Stability (Eigenvalue Analysis)


• stab - Stability Analysis Functions (RMS)
• stabemt - Electromagnetic Transients (EMT)
• staest - State Estimation

• transmission - Transmission Network Tools


• unitcomm - Unit Commitment and Dispatch Optimisation

int LicenceHasModule(string module)

A RGUMENTS
module Abbreviated name of the licence module, e.g. ”prot”. See list above.

R ETURNS
1 Module is contained in the current licence. Corresponding functionality can be
used.
0 Module is not contained in the current licence.

LoadProfile
Activates a profile for current user. This corresponds to the select profile action via main menu
“TOOLS-Profiles”.
int LoadProfile(string profileName)

A RGUMENTS
profileName
Name of profile to be loaded.

R ETURNS
0 On error, e.g. profile with given name not found.
1 On success.

E XAMPLE
The following example demonstrates how to active the ’Base Package’ profile
int ret;

ret = LoadProfile('Base Package');


if (ret = 1) {
printf('New profile has successfully been activated');
}
else {
printf('Activation of new profile has failed');
}

32
CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

ReloadProfile()

LoadResData
This function is deprecated. Please use ElmRes.Load() or IntComtrade.Load() instead.
void LoadResData(object resultObject)

MarkInGraphics
This function is not supported in GUI-less mode.

Marks all objects in the diagram in which the elements are found by hatch crossing them.
void MarkInGraphics(set objects,
[int searchOpenedDiagramsOnly = 0])

A RGUMENTS
objects Objects to be marked.
searchOpenedDiagramsOnly (optional)
Search can be restricted to currently shown diagrams on the desktop, instead of
all diagrams.
0 Searching all diagrams, not only the ones which are currently shown
on the desktop. If there is more than one occurrence the user will be
prompted which diagrams shall be opened (default).
1 Only search in currently opened diagrams and open the first diagram
in which the elements were found.

E XAMPLE
The following example will mark a set of lines in the currently visible diagram or if not found
in one of the other diagrams which are currently opened .
set lines;
lines = GetCalcRelevantObjects('*.ElmLne');
MarkInGraphics(lines, 1);

OutputFlexibleData*
Outputs the Flexible Data of the given objects to the output window.
Has identical functionality to that implemented in the Object Filter dialogue, whereby the user
can right-click on a single row or multiple rows in a Flexible Data page and select Output
. . . Flexible Data. The OutputFlexibleData() function assumes that the user has already defined
a Flexible Data page for the objects in the set. Upon execution of this function, all Flexible
Data defined for the objects in the set is output to the PowerFactory output window in a tabular
format.
void OutputFlexibleData(set objects,
[string flexibleDataPage = ''])

33
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
objects Objects to output the Flexible Data for.
flexibleDataPage (optional)
Name of the Flexible Data page to be outputed. If multiple Flexible Data pages
are defined and no or an empty string is given then a dialog to select a Flexible
Data page is shown.

E XAMPLE
The following example collects all lines and terminals which are relevant to the calculation
and output their defined Flexible Data to the output window:
set elements;
elements = GetCalcRelevantObjects('*.ElmLne,*.ElmTerm');
OutputFlexibleData(elements);

PostCommand
Adds a command as string to the command pipe of the “input window”. The posted command
string will be executed after the currently running script has finished.
void PostCommand(string commandString)
void PostCommand(object command)

A RGUMENTS
commandString
A command as string e.g ’exit’ for ComExit.
command
A command. Internally the command is converted to a command string including
all its properties.

E XAMPLE
The following command causes PowerFactory to end after the DPL script has finished.
PostCommand('exit');

PrepForUntouchedDelete
Mark (as not modified) all objects stored in the grid (or stored in set). Required for function
DeleteUntouchedObjects().
void PrepForUntouchedDelete(object grid)
void PrepForUntouchedDelete(set grids)

Rebuild*
Rebuilds the currently visible single line diagram or plot.
void Rebuild([int iMode = 1])

34
CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
iMode (optional)
0 Draws graphic objects only
1 (default) Reads graphic objects (IntGrf) from database and draws
2 For single line diagrams: Reads graphic objects (IntGrf) from database,
re-calculates intersections and draws.
For plot pages: Adjust view to page format and re-create plots.

E XAMPLE
Rebuild(1); !typical usage to perform a single line diagram update

ReleaseResData
This function is deprecated. Please use ElmRes.Release() or IntComtrade.Release() instead.
void ReleaseResData(object resultObject)

ReloadProfile
Reloads currently selected user profile. (See main menue “TOOLS-Profiles”)
void ReloadProfile()

S EE ALSO

LoadProfile()

ResetCalculation
Resets all calculations and deletes all calculation results.
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.
void ResetCalculation()

S EE ALSO

IsAutomaticCalculationResetEnabled(), SetAutomaticCalculationResetEnabled()

ResFirstValidObject
This function is deprecated. Please use ElmRes.GetFirstValidObject() instead.
int ResFirstValidObject(object resultFile,
int row,
[string classNames,]
[string variableName,]
[double limit,]
[int limitOperator,]
[double limit2,]
[int limitOperator2])

35
CHAPTER 2. GLOBAL FUNCTIONS

int ResFirstValidObject([object resultFile,]


[int row,]
[set objects])

ResFirstValidObjectVar
This function is deprecated. Please use ElmRes.GetFirstValidObjectVariable() instead.
int ResFirstValidObjectVar(object resultFile,
[string variableNames])

ResFirstValidVar
This function is deprecated. Please use ElmRes.GetFirstValidVariable() instead.
int ResFirstValidVar(object resultFile,
int row,
[string variableNames])

ResGetMax
This function is deprecated. Please use ElmRes.FindMaxInColumn() or
IntComtrade.FindMaxInColumn() instead.
int ResGetMax(object resultFile,
int col,
[double& value])

ResGetMin
This function is deprecated. Please use ElmRes.FindMinInColumn() or
IntComtrade.FindMinInColumn() instead.
int ResGetMin(object resultFile,
int col,
[double& value])

ResIndex
This function is deprecated. Please use ElmRes.FindColumn() or IntComtrade.FindColumn()
instead.
int ResIndex(object resultFile,
object obj,
[string varName])
int ResIndex(object resultFile,
object obj,
[int colIndex])
int ResIndex(object resultFile,
[string varName,]
[int colIndex])

36
CHAPTER 2. GLOBAL FUNCTIONS

ResNextValidObject
This function is deprecated. Please use ElmRes.GetNextValidObject() instead.
int ResNextValidObject(object resultFile,
[string classNames,]
[string variableName,]
[double limit,]
[int limitOperator,]
[double limit2,]
[int limitOperator2])
int ResNextValidObject(object resultFile,
set objects)

ResNextValidObjectVar
This function is deprecated. Please use ElmRes.GetNextValidObjectVariable() instead.
int ResNextValidObjectVar(object resultFile,
[string variableNames])

ResNextValidVar
This function is deprecated. Please use ElmRes.GetNextValidVariable() instead.
int ResNextValidVar(object resultFile,
[string variableNames])

ResNval
This function is deprecated. Please use ElmRes.GetNumberOfRows() or
IntComtrade.GetNumberOfRows() instead.
int ResNval(object resultObject,
[int col])

ResNvars
This function is deprecated. Please use ElmRes.GetNumberOfColumns() or
IntComtrade.GetNumberOfColumns() instead.
int ResNvars(object resultObject)

ResSortToVar
This function is deprecated. Please use ElmRes.SortAccordingToColumn() or
IntComtrade.SortAccordingToColumn() instead.
int ResSortToVar(object resultObject,
int col)

37
CHAPTER 2. GLOBAL FUNCTIONS

SaveAsScenario
Saves the operational data or relevant network elements as a new scenario.
object SaveAsScenario(string pName,
int iSetActive)

A RGUMENTS
pName Name of the new scenario.
iSetActive
1 Activate the new scenario afterwards.
0 Do not activate the new scenario.

R ETURNS
Returns newly created IntScenario object. NULL is returned in case of creation of a new
scenario was not allowed (e.g. no active project).

D EPRECATED N AMES
SaveScenarioAs

E XAMPLE
The following example demonstrates how to save a scenario:
object scenario;
scenario = SaveAsScenario('NewScenario', 0); ! do not activate the new scenario
printf('The following scenario was created: %o', scenario);

SearchObjectByForeignKey*
Searches for an object by foreign key within an active project.
object SearchObjectByForeignKey(string foreignKey)

A RGUMENTS
foreignKey
Foreign key

R ETURNS
Object if found, otherwise NULL.

E XAMPLE
The following example shows how to search for an object by foreign key:
object obj;
str foreignKey;
foreignKey = '...';
obj = SearchObjectByForeignKey(foreignKey);
printf('Object found: %o', obj);

38
CHAPTER 2. GLOBAL FUNCTIONS

SelectToolbox
Sets tool box to be displayed at a switchable tool box group.
int SelectToolbox(int toolbar,
string groupName,
string toolboxName)

A RGUMENTS
toolbar 1 Main tool bar
2 Drawing tool bar (SGL)
groupName
Name of tool box group.

toolboxName
Name of tool box to be selected.

R ETURNS
0 On error, e.g. no matching tool box found.
1 On success.

SetShowAllUsers
Enables or disables the filtering of all available users in data manager. All users are only
visualised in data manager when enabled.
int SetShowAllUsers(int enabled)

A RGUMENTS
enabled
0 Disabled, only Demo, Public Area Users and current user are shown
1 Enabled, all available users are listed

R ETURNS
Returns previous setting.

1 If enabled before.
0 If disabled before.

Sleep*
Suspends the execution of the script for given duration.
void Sleep(double duration)

A RGUMENTS
duration Duration in milliseconds

39
CHAPTER 2. GLOBAL FUNCTIONS

SplitLine
Splits the passed line or ElmBranch-object at a given position
object SplitLine(object Line,
[double percent = 50,]
[int createSwitchSide0 = 0,]
[int createSwitchSide1 = 0])

A RGUMENTS
double rPercent (optional)
Position in percent from the first connection side where line shall be split.
int iCreateSwitchSide0 (optional)

0 (default) Do not create switch on first connection side.


1 Create switch on first connection side.
int iCreateSwitchSide1 (optional)

0 (default) Do not create switch on second connection side.


1 Create switch on second connection side.

R ETURNS
Inserted terminal
0 = error

StatFileGetXrange
Gets the x-range for the statistic result file.
int StatFileGetXrange(double& min,
double& max)

A RGUMENTS
min (out) First point in time considered in statistics.
max (out) Last point in time considered in statistics.

R ETURNS
0 If time range of statistic result file was found.
1 On errors (There is no statistic result file).

StatFileResetXrange
Reset the user defined x-range of the statistic result file. The complete x-range will be consid-
ered in the statistic results after calling this function.
void StatFileResetXrange()

40
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

StatFileSetXrange
Sets the user defined x-range of the statistic result file. The statistic results consider only the
given time range.
void StatFileSetXrange(double min,
double max)

A RGUMENTS
min First point in time to be considered in statistics.
max Last point in time to be considered in statistics.

2.1 File System


Overview

CheckFileExists*
CopyFile*
CreateDir*
fclose*
fflush*
fopen*
fprintf*
fscanf*
fscanfsep*
GetDirectories*
GetFileDate*
GetFiles*
GetInstallationDirectory*
GetTemporaryDirectory*
GetWorkspaceDirectory*

CheckFileExists*
Checks if a file exists.
int CheckFileExists(string filename)

A RGUMENTS
filename Name and path of a file.
The file name can contain characters such as ’*’ and ’?’. In case of wildcard
characters are used, the function searches for existence of any file that matches
the criteria.
Example e.g. ’c:\*.exe’ to search for any executable on drive C.

R ETURNS
Returns 1 if exists, 0 otherwise.

E XAMPLE
Checks for existence of Windows Help Viewer:
int exists;
string file;

41
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

file = 'C:\Windows\winhlp32.exe';

exists = CheckFileExists(file);
if (exists = 1) {
printf('File "%s" exists', file);
}
else {
printf('File "%s" does not exist', file);
}

R ETURNS
1 If file exists
0 If file does not exist

S EE ALSO

GetDirectories(), GetFiles()

CopyFile*
Creates a copy of a file.
int CopyFile(string sourceFile, string targetFile)

A RGUMENTS
sourceFile
Path and name of the file to copy

targetFile Path and name of the new file

R ETURNS
1 if successfull, 0 if not.

E XAMPLE
The following example creates a copy of a file and prints the result code of CopyFile.
string sourceFile;
string targetFile;
int success;

sourceFile = 'E:\tmp\source.txt';
targetFile = 'E:\tmp\target.txt';
success = CopyFile(sourceFile, targetFile);
printf('CopyFile returned %d', success);

CreateDir*
Creates a complete directory path with all neccessary subdirectories.
void CreateDir(string path)

42
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
path The path that should be created

fclose*
Closes a file previously opened by fopen().
Please note, calling the fclose for a currently not opened or invalid file handle will result in a
scripting error.
void fclose(int handleNumber)

A RGUMENTS
handleNumber
File handle number of an open file (see fopen()).

S EE ALSO

fopen()

fflush*
Writes all content of the associated buffer to the file.
void fflush(int handleNumber)

A RGUMENTS
handleNumber
File handle number of an open file (see fopen()).

fopen*
Opens a file for output or input. The function fclose() is to be called for closing the file and
releasing the handle.
int fopen(string filename,
string mode,
int handleNumber,
[int continueScriptOnError])

A RGUMENTS
filename Path of file to open. Path must exist. File could be created depending on the
’mode’
mode Access mode for opening the file (r,w,a,r+,w+,a+,rb,wb,ab,r+b,w+b,a+b).
Same as used for C++ fopen().
handleNumber
≥ 0, file handle number to be used for accessing the file.
continueScriptOnError (optional)
0 Default. In case of an error the script will be stopped and an error
messagebox will appear.
1 Function will return a proper execution code informing about the suc-
cess of the open action.

43
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

S EE ALSO

fclose(), fprintf(), fscanf()

E XAMPLE
The following example demonstrates a basic writing and writing process:
int i, ret;
string line;

!output some text to a file


ret = fopen('d:\test.txt', 'w', 1, 1);
if (ret > 0) {
Error('File could not be opened writing');
exit();
}
for(i=0; i<10; i+=1) {
fprintf(1, 'This is line %d', i);
}
fclose(1);

!read in the file again and print lines to output window


ret = fopen('d:\test.txt', 'r', 1, 1);
if (ret > 0) {
Error('File could not be opened reading');
exit();
}
SetLineFeed(0);!disable newline for printf
while(1) {
!read next line
ret = fscanf(1,'\l%s',line); !read complete line
if (ret < 1) {
break; !no next line
}
printf('%s', line);
}
fclose(1);

44
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

fprintf*
Prints a formatted string to a file and automatically inserts a line-break.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string. The line-break insertion can be disabled with SetLineFeed().
string fprintf(int handleNumber,
string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
handleNumber
File handle number of an open file (see fopen()).
format C++-like printf() format string. See the Format String Syntax for more information.
argument... (optional)
Arguments matching the format string.

R ETURNS
The printed string.

S EE ALSO

fopen(), fclose(), fscanf(), fscanfsep()

E XAMPLE
double x;
int i;
string s;
fopen('e:\tmp\test.txt','w',0);
x = 123456789.987654321;
i = 2468;
s = 'hello dpl';
fprintf(0,'string:%s int=%d double=%f', s,i,x);
fclose(0);

fscanf*
Parses a line of values which are separated by comma or tabulator from the file according
the given format. Each parsed value is stored into the passed arguments. Empty tokens are
skipped.
int fscanf(int handleNumber,
string format,
[int|double|string argument0,]
[...])

A RGUMENTS
handleNumber
File handle number of an open file (see fopen()).
format C++-like printf() format string. See the Format String Syntax for more information.
Only int, double and string types are supported.
argument... (optional)
Arguments matching the format string.

45
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
≥0 Number of values successfully converted and assigned.
−1 On error.

S EE ALSO

fscanfsep(), fprintf()

E XAMPLE
The file 'test.txt'
249.87 Hz
250.11 Hz

can be read by the following script


int result;
double freq;
string unit;

fopen('e:\tmp\test.txt', 'r', 0);

while (result>=0) {
result = fscanf(0, '%f %s', freq, unit);
printf('%f %s (result = %d)', freq, unit, result);
}

fclose(0);

! Output:
! 249,870000 Hz (result = 2)
! 250,110000 Hz (result = 2)
! 250,110000 Hz (result = -1)

fscanfsep*
Parses a line of values which are separated by a separation character from the file according
the given format. Each parsed value is stored into the passed arguments. Empty tokens are
skipped.
int fscanfsep(int handleNumber,
string format,
[int|double|string argument0,]
[...],
string separator,
[int stopAfterLine = 0]
)

A RGUMENTS
handleNumber
File handle number of an open file (see fopen()).
format C++-like printf() format string. See the Format String Syntax for more information.
Only int, double and string types are supported.
argument... (optional)
Arguments matching the format string.

46
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

separator Character that separates values in given input string.


stopAfterLine (optional)
1 Interpretation of the line will be stopped after the current line.
0 Continued interpretation (default).

R ETURNS
≥0 Number of values successfully parsed and stored.
−1 On error.

S EE ALSO

fscanf(), fprintf()

E XAMPLE
The file 'test.txt'
249.87;Hz;
250.11;Hz;

can be read by the following script


int result;
double freq;
string unit;

fopen('e:\tmp\test.txt','r', 0);

while (result > -1) {


result = fscanfsep(0,'%f %s', freq, unit, ';', 0);
if (result = -1) {
break;
}
else {
printf('%f %s (result = %d)', freq, unit, result);
}
}
fclose(0);

GetDirectories*
Searches a given directory with optional filter criteria for subdirectories and stores the result in
an IntDplvec. The directory must either end with a backslash or a filter, e.g. ’example*’.
void GetDirectories(string directory,
object resultVec)

A RGUMENTS
directory Path with optional filter of the search directory
resultVec IntDplvec with the found directory names

E XAMPLE
Searches a directory for all subdirectories beginning with ’example’ and prints them to the
Output Window. The script requires ’vec’ to be an IntDplvec stored below the script.

47
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

int vecSize;
int i;
string fileName;

vec.Clear();
GetDirectories('E:\\tmp\\example*', vec);
vecSize = vec.Size();

for (i = 0; i < vecSize; i+=1)


{
fileName = vec.Get(i);
printf('%s', fileName);
}

GetFileDate*
Returns the last modification date of given file.
string GetFileDate(string file)

A RGUMENTS
file File name, either absolute or relative

R ETURNS
Last modification date of given file for local timezone in format ”YYYY-MM-DD HH:MM:SS”,
e.g. ”2009-09-08 15:29:40”. An empty string is returned in case that the file does not exist or
access is denied.

S EE ALSO

CheckFileExists()

GetFiles*
Searches a given directory with optional filter criteria for files and stores the result in an IntD-
plvec. The directory must either end with a backslash or a file filter, e.g. ’*.TXT’.
void GetFiles(string directory,
object resultVec)

A RGUMENTS
directory Path with optional filter of the search directory
resultVec IntDplvec with the found file names

E XAMPLE
Searches a directory for all files ending with ’dgs’ and prints them to the Output Window. The
script requires ’vec’ to be an IntDplvec stored below the script.
int vecSize;
int i;
string fileName;

vec.Clear();
GetFiles('E:\\tmp\\*.dgs', vec);

48
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

vecSize = vec.Size();

for (i = 0; i < vecSize; i+=1)


{
fileName = vec.Get(i);
printf('%s', fileName);
}

GetInstallationDirectory*
Returns the installation directory of PowerFactory .
string GetInstallationDirectory()

R ETURNS
Full path to installation directory of current PowerFactory .

D EPRECATED N AMES
GetInstallDir

S EE ALSO

GetTemporaryDirectory(), GetWorkspaceDirectory()

GetTemporaryDirectory*
Returns the temporary directory of used by PowerFactory .
string GetTemporaryDirectory()

R ETURNS
Full path to a directory where temporary data can be stored. This directory is also used by
PowerFactory to store temporary data.

D EPRECATED N AMES
GetTempDir

S EE ALSO

GetWorkspaceDirectory(), GetInstallationDirectory()

GetWorkspaceDirectory*
Returns the workspace directory of PowerFactory .
string GetWorkspaceDirectory()

R ETURNS
Full path to the directory where currently used workspace is stored.

D EPRECATED N AMES
GetWorkingDir

49
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

GetTemporaryDirectory(), GetInstallationDirectory()

2.2 Date/Time
Overview

FormatDateLT*
FormatDateUTC*
GetStudyTimeObject*
GetSystemTime*
GetSystemTimeUTC*
GetTime*
ParseDateLT*
ParseDateUTC*
strftime*

FormatDateLT*
Creates a formatted date string. The time must be given in seconds elapsed since 01.01.1970
00:00 in UTC and is converted to a display string in local time.
string FormatDateLT(string format,
int timeInSecondsUTC)

A RGUMENTS
format
%d Day of month as integer (01..31).
%H Hour in 24-hour format (00..23).
%m Month as integer (01..12).
%M Minute as integer (00..59).
%S Second as integer (00..59).
%Y Year with century, as integer.
timeInSecondsUTC
Time in seconds since 01.01.1970 00:00 in UTC.

R ETURNS
Formatted date string in local time.

E XAMPLE
The following example gets the formatted date string in local time:
string str;
int t;

t = 1180703210;
str = FormatDateLT('%Y-%m-%d %H:%M:%S', t);

printf('%d seconds in utc -> local time string %s', t, str);

!Output: 1180703210 seconds in utc -> local time string 2007-06-01 15:06:50

50
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

FormatDateUTC*
Creates a formatted date string. The time must be given in seconds elapsed since 01.01.1970
00:00 and is considered to be in UTC time. No time zone corrections are done.
string FormatDateUTC(string format,
int timeInSecondsUTC)

A RGUMENTS
format
%a Abbreviated weekday name.
%A Full weekday name.
%b Abbreviated month name.
%B Full month name.
%c Date and time representation appropriate for locale.
%d Day of month as integer (01..31).
%H Hour in 24-hour format (00..23).
%I Hour in 12-hour format (01..12).
%j Day of year as integer (001..366).
%m Month as integer (01..12).
%M Minute as integer (00..59).
%p Current locale’s A.M./P.M. indicator for 12-hour clock.
%S Second as integer (00..59).
%U Week of year as integer, Sunday as first day of week (00..53).
%w Weekday as integer (0..6; Sunday is 0).
%W Week of year as integer, Monday as first day of week (00..53).
%x Date representation for current locale.
%X Time representation for current locale.
%y Year without century, as integer (00..99).
%Y Year with century, as integer.
%tz Time-zone as offset (+/- hh:mm), always +00:00.
%% Percent sign.
timeInSecondsUTC
Time in seconds since 01.01.1970 00:00 in UTC time.

R ETURNS
Formatted date string.

E XAMPLE
The following example gets the formatted date string:
string date;
int seconds;

date = FormatDateUTC('%Y-%m-%dT%H:%M:%S%tz', 1153840426);


printf('%s', date);

!Output: 2006-07-25T15:13:46+00:00

seconds = GetSystemTimeUTC();

51
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

date = FormatDate('%Y-%m-%dT%H:%M:%S%tz', seconds);


printf('%s', date); !current time

!Output: 'current time', e.g. 2010-06-08T06:12:15+02:00

date = FormatDate ('%Y-%m-%dT%H:%M:%S%tz', 0);


printf('%s', date);

!Output: 1970-01-01T00:00:00+00:00 seconds;

GetStudyTimeObject*
Returns the date and time object (SetTime) from the study case. This is the object being used
by the characteristics, scenarios, ...
object GetStudyTimeObject()

R ETURNS
SetTime or NULL.

E XAMPLE
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, ldf;
time = GetStudyTimeObject();
time:hourofyear = 1234;
ldf = GetFromStudyCase('Unbalanced.ComLdf');
ldf.Execute();

GetSystemTime*
Returns the current system time in seconds since 00:00 01.01.1970GMT. This time is always in
local time. For getting the time in UTC, a function GetSystemTimeUTC() is available.
int GetSystemTime()

R ETURNS
Current system time in seconds since 00:00 01.01.1970GMT

E XAMPLE
The following example gets the current system time in seconds:
int seconds;
seconds = GetSystemTime();
printf('Now in local time %d', seconds);

52
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

GetSystemTimeUTC*
Returns the current system time in seconds since 00:00 01.01.1970GMT. This time is always in
UTC. For getting the local time, a function GetSystemTime() is available.
int GetSystemTimeUTC()

R ETURNS
Current system time in seconds since 00:00 01.01.1970GMT for UTC zone.

E XAMPLE
The following example gets the current system time in UTC seconds:
int seconds;
seconds = GetSystemTimeUTC();
printf('Now in UTC seconds %d', seconds);

GetTime*
Returns current processor time.
double GetTime(int precision)

A RGUMENTS
precision Precision after decimal point

R ETURNS
Current processor time in seconds

ParseDateLT*
Parses a given date string that represents a date in local time and returns the corresponding
UTC time in seconds elapsed since 01.01.1970 00:00 UTC.
int ParseDateLT(string format,
string date)

A RGUMENTS
format
%d Day of month as integer (01..31).
%H Hour in 24-hour format (00..23).
%m Month as integer (01..12).
%M Minute as integer (00..59).
%S Second as integer (00..59).
%Y Year with century, as integer.

date Formatted date string (local time).

R ETURNS
Date in seconds since 00:00 01.01.1970 UTC.

53
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
The following example returns the date in seconds since 00:00 01.01.1970 UTC:
string date;
int t;

date = '2007-06-01 15:06:50';


t = ParseDateLT('%Y-%m-%d %H:%M:%S', date);
printf('%d', t);

!Output: 1180703210

ParseDateUTC*
Parses a given date string and returns the date in seconds elapsed since 01.01.1970 00:00
UTC. If a time zone is given and specified in format string this information is used to convert the
seconds to UTC.
int ParseDateUTC(string format,
string date)

A RGUMENTS
format
%d Day of month as integer (01..31).
%H Hour in 24-hour format (00..23).
%m Month as integer (01..12).
%M Minute as integer (00..59).
%S Second as integer (00..59).
%Y Year with century, as integer.
date Formatted date string.

R ETURNS
Date in seconds since 00:00 01.01.1970 UTC that is represented by given date string.

E XAMPLE
The following example returns the date in seconds since 00:00 01.01.1970 UTC:
int t;

t = ParseDateUTC('%Y-%m-%d %H:%M', '1970-01-01 00:00');


printf('%i', t);

!Output: 0

t = ParseDateUTC('%Y-%m-%d %H:%M%tz', '1970-01-01 00:00-01:00');


printf('%i', t);

!Output: 3600

t = ParseDateUTC('%Y-%m-%d %H:%M', '2006-07-25 11:59');


printf('%i', t);

!Output: 1153828740

54
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

strftime*
Creates a formatted time string.
string strftime(string format, int time)

A RGUMENTS
Format The format string The following formatting codes are recognized in the format
string.
%a Abbreviated weekday name.
%A Full weekday name.
%b Abbreviated month name.
%B Full month name.
%c Date and time representation appropriate for locale.
%d Day of month as integer (01..31).
%H Hour in 24-hour format (00..23).
%I Hour in 12-hour format (01..12).
%j Day of year as integer (001..366).
%m Month as integer (01..12).
%M Minute as integer (00..59).
%p Current locale’s A.M./P.M. indicator for 12-hour clock.
%S Second as integer (00..59).
%U Week of year as integer, Sunday as first day of week (00..53).
%w Weekday as integer (0..6; Sunday is 0).
%W Week of year as integer, Monday as first day of week (00..53).
%x Date representation for current locale.
%X Time representation for current locale.
%y Year without century, as integer (00..99).
%Y Year with century, as integer.
%z, %Z Time-zone name or abbreviation; no characters if zone is unknown.
%% Percent sign.

R ETURNS
The formatted time string.

D EPRECATED N AMES
FormatDate

E XAMPLE
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.

55
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

2.3 Dialogue Boxes


Overview

CloseTableReports
GetTableReports
input
MessageBox
ShowModalBrowser
ShowModalOpenFileDialog
ShowModalSaveFileDialog
ShowModalSelectBrowser
ShowModalSelectFolderDialog
ShowModelessBrowser
UpdateTableReports

CloseTableReports
This function is not supported in GUI-less mode.

Closes all open table reports.


Please note: Table reports currently running one of their scripts are not closed.
void CloseTableReports()

GetTableReports
This function is not supported in GUI-less mode.

Returns all open table reports.


set GetTableReports()

input
This function is not supported in GUI-less mode.

Provides the possibility to get user input during the execution of a DPL script. When executed,
an input box is displayed. The execution of the script pauses until the user presses the OK
button. On cancel, the running DPL script is aborted.
void input(string& inputStr,
string msg,
[int length = 18])
void input(double& inputDbl,
string msg,
[int length = 18])

A RGUMENTS
inputStr — inputDbl (out)
Output variable that will hold the user's input; depending on the type, the input is
returned as string or as double.
msg Message displayed in the input box.

56
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

length (optional)
The input is limited to 'length' characters, 18 by default. -1 leads to an unlimited
input for string input.

R ETURNS
Please note, that the execution of the script is aborted if the user cancels the input request.

E XAMPLE
The following example displays first an input box to enter a number and then to enter a text:
double number;
string text;

input(number, 'Please enter a number');


printf('Entered number: %f', number);

input(text, 'Please enter some text');


printf('Entered text: %s', text);

MessageBox
This function is not supported in GUI-less mode.

MessageBox shows a message box while pausing the execution of a DPL script, and then
returns the pressed button.
int MessageBox(string title,
string message,
[int buttons = 1,]
[int defaultButton = 1]
[int icon = 1])

A RGUMENTS
title Title of the message box
message Message displayed in the message box
buttons (optional)
Flag for the buttons of the message box (default 1)
1 Ok button (default)
2 Cancel button
4 Yes button
8 ’Yes to all’ button
16 No button
defaultButton (optional)
Default button of the message box (default 1)
icon (optional)
Icon of the message box (default 0)
0 Information icon
1 Question icon
2 Warning icon
3 Error icon

57
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Returns an integer for the pressed button.

E XAMPLE
int res;

! simple message box


MessageBox('Title','Message');

! message box with 'ok' and 'cancel' button, 'ok' is default


! and information icon
res = MessageBox('Title','Message',1+2,2,0);
if (res=1) {
printf('Ok pressed.');
}
else {
printf('Cancel pressed.');
}

! message box with 'yes' and 'no' button, 'no' is default


! and question icon
res = MessageBox('Title','Message',4+16,16,1);
if (res=4) {
printf('Yes pressed.');
}
else if (res=16) {
printf('No pressed.');
}

! message box with 'yes','yes to all' and 'no' button,


! 'no' is default and warning icon
res = MessageBox('Title','Message',4+8+16,16,2);
if (res=4) {
printf('Yes pressed.');
}
else if (res=8) {
printf('Yes to all pressed.');
}
else if (res=16) {
printf('No pressed.');
}

! simple error message box


MessageBox('Title','Error occurred:\nOr not?',1,1,3);

58
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

ShowModalBrowser
This function is not supported in GUI-less mode.

Opens a modal browser window and lists all given objects.


void ShowModalBrowser(set objects,
[int detailMode = 0,]
[string title = '',]
[string page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
detailMode (optional)
0 Show browser in normal mode (default).
1 Show browser in detail mode.
title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.
page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

ShowModalOpenFileDialog
This function is not supported in GUI-less mode.

Opens a modal Open File dialogue which prompts the user to select an existing file.
string ShowModalOpenFileDialog([string title = '',]
[string filters = '',]
[string initialPath = ''])

A RGUMENTS
title (optional)
The title of the dialogue. If this argument is not provided or an empty string, a
suitable default title is used instead.
filters (optional)
Available file extension filters. A filter is specified by giving
• a non-empty filter description which may consist of multiple words, but no
parentheses (e.g. 'Image files') and
• a semicolon-separated list of extensions (each starting with the prefix '*.') in
parentheses (e.g '(*.jpg; *.jpeg; *.png; *.bmp)').
Please note that the filter selection field in the file dialogue will show the filter
description and the corresponding extensions. Multiple filter definitions are sepa-
rated by semicolons (e.g. 'Filter one (*.txt; *.out); Filter two (*.py; *.pyc); All Files
(*.*)'). If multiple filter definitions are provided, the first filter in the list is selected
when the dialogue is shown. If this argument is not provided or an empty string,
an All files filter is used which allows the selection of any file.
initialPath (optional)
The folder to be displayed when the dialogue is shown. If this argument is not
provided or an empty string, a suitable folder is used as initial location.

59
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The path to the file selected by the user. If the user cancels the dialogue, an empty string is
returned instead.

E XAMPLE
string title, filters, initialPath, selectedFile;
int pathLength;

title = 'Please select a file to open';


filters = 'Output files (*.out;*.txt); All files (*.*)';
initialPath = 'D:\temp'; ! change, if path does not exist

selectedFile = ShowModalOpenFileDialog(title, filters, initialPath);

pathLength = strlen(selectedFile);
if (pathLength > 0) {
! a file path has been provided by the user
printf('User selected the file %s', selectedFile);
}
else {
! the user cancelled the file dialogue
printf('User cancelled the dialogue');
}

S EE ALSO

ShowModalSaveFileDialog(), ShowModalSelectFolderDialog()

ShowModalSaveFileDialog
This function is not supported in GUI-less mode.

Opens a modal Save File dialogue which prompts the user to specify a file. If the user chooses
an existing file, they are asked if they want to replace the existing file.
string ShowModalSaveFileDialog([string title = '',]
[string filters = '',]
[string initialPath = ''])

A RGUMENTS
title (optional)
The title of the dialogue. If this argument is not provided or an empty string, a
suitable default title is used instead.
filters (optional)
Available file extension filters. A filter is specified by giving
• a non-empty filter description which may consist of multiple words, but no
parentheses (e.g. 'Image files') and
• a semicolon-separated list of extensions (each starting with the prefix '*.') in
parentheses (e.g '(*.jpg; *.jpeg; *.png; *.bmp)').
Please note that the filter selection field in the file dialogue will show the filter
description and the corresponding extensions. Multiple filter definitions are sepa-
rated by semicolons (e.g. 'Filter one (*.txt; *.out); Filter two (*.py; *.pyc); All Files
(*.*)'). If multiple filter definitions are provided, the first filter in the list is selected
when the dialogue is shown. If this argument is not provided or an empty string,

60
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

an All files filter is used which allows the selection of any file. Please note that
if the user enters a file name and does not provide an extension from the active
filter, the first extension of the active filter is appended automatically.
initialPath (optional)
The folder to be displayed when the dialogue is shown. If this argument is not
provided or an empty string, a suitable folder is used as initial location.

R ETURNS
The path to the file specified by the user. If the user cancels the dialogue, an empty string is
returned instead.

E XAMPLE
string title, filters, initialPath, selectedFile;
int pathLength;

title = 'Export results to';


filters = 'Output files (*.out;*.txt); All files (*.*)';
initialPath = 'D:\temp'; ! change, if path does not exist

selectedFile = ShowModalSaveFileDialog(title, filters, initialPath);

pathLength = strlen(selectedFile);
if (pathLength > 0) {
! a file path has been provided by the user
printf('User selected the file %s', selectedFile);
}
else {
! the user cancelled the file dialogue
printf('User cancelled the dialogue');
}

S EE ALSO

ShowModalOpenFileDialog(), ShowModalSelectFolderDialog()

ShowModalSelectBrowser
This function is not supported in GUI-less mode.

Opens a modal browser window and lists all given objects. The user can make a selection from
the list.
set ShowModalSelectBrowser(set objects,
[string title,]
[string classFilter,]
[string page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.

61
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

classFilter (optional)
Class name filter. If set, only objects matching that filter will be listed in the dialog
e.g. ’Elm*’, ’ElmTr?’ or ’ElmTr2,ElmTr3’.
page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

R ETURNS
Set of selected objects. The set is empty if “cancel” is pressed.

ShowModalSelectFolderDialog
This function is not supported in GUI-less mode.

Opens a modal Select Folder dialogue which prompts the user to select a folder.
string ShowModalSelectFolderDialog([string description = '',]
[string initialPath = ''])

A RGUMENTS
description (optional)
The text shown above the folder selection field of the dialogue. If this argument is
not provided or an empty string, a suitable default description is used instead.

initialPath (optional)
The folder to select when the dialogue is shown. If this argument is not provided
or an empty string, a suitable folder is used as initial selection.

R ETURNS
The path to the folder specified by the user. If the user cancels the dialogue, an empty string
is returned instead.

E XAMPLE
string description, initialPath, selectedFolder;
int pathLength;

description = 'Please select a folder';


initialPath = 'D:\temp'; ! change, if path does not exist

selectedFolder = ShowModalSelectFolderDialog(description, initialPath);


pathLength = strlen(selectedFolder);

if (pathLength > 0) {
! a folder has been selected by the user
printf('User selected the folder %s', selectedFolder);
}
else {
! the user cancelled the folder selection dialogue
printf('User cancelled the dialogue');
}

S EE ALSO

ShowModalOpenFileDialog(), ShowModalSaveFileDialog()

62
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

ShowModelessBrowser
This function is not supported in GUI-less mode.

Opens a modeless browser window and lists all given objects.


void ShowModelessBrowser(set objects,
[int detailMode = 0,]
[str title = '',]
[str page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
detailMode (optional)
0 Show browser in normal mode (default).
1 Show browser in detail mode.
title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.

page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

UpdateTableReports
This function is not supported in GUI-less mode.

Updates all open table reports.


void UpdateTableReports()

2.4 Environment
Overview

EchoOff
EchoOn
EndTableReportGroup
GetDiffMode
IsAutomaticCalculationResetEnabled*
IsFinalEchoOnEnabled
NoFinalUpdate
SetAutomaticCalculationResetEnabled
SetConsistencyCheck
SetDiffMode
SetFinalEchoOnEnabled
SetGraphicUpdate
SetGuiUpdateEnabled
SetProgressBarUpdatesEnabled
SetUserBreakEnabled
StartNewTableReportGroup

63
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

EchoOff
Freezes (de-activates) the user-interface. For each EchoOff(), an EchoOn() should be called.
An EchoOn() is automatically executed at the end of the execution of a ComDpl or ComPython.
This could be changed with SetFinalEchoOnEnabled().
void EchoOff()

S EE ALSO

EchoOn(), IsFinalEchoOnEnabled(), SetFinalEchoOnEnabled()

E XAMPLE
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();

EchoOn
Re-activates the user interface. For more informations see EchoOff().
void EchoOn()

S EE ALSO

EchoOff(), IsFinalEchoOnEnabled(), SetFinalEchoOnEnabled()

EndTableReportGroup
Ends grouping of newly opened table reports to a special TDI group.
void EndTableReportGroup()

GetDiffMode
Returns the currently set result access mode. See SetDiffMode() for more information.
int GetDiffMode()

R ETURNS
0 Base case results access.
1 Compare case results access.

S EE ALSO

SetDiffMode(), ComDiff.Start(), ComDiff.Stop()

64
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

IsAutomaticCalculationResetEnabled*
Returns whether the automatic calculation reset while setting attributes via the ”:” notation e.g.
”load:scale0 = 0.98” is enabled. object.SetVal() is not affected. See SetAutomaticCalculation-
ResetEnabled() for more informations.
int IsAutomaticCalculationResetEnabled()

S EE ALSO

SetAutomaticCalculationResetEnabled(), ResetCalculation()

IsFinalEchoOnEnabled
Returns whether the automatic EchoOn() at the end of each ComDpl or ComPython is enabled.
int IsFinalEchoOnEnabled()

R ETURNS
1 Final EchoOn() is enabled.
0 Final EchoOn() is disabled.

S EE ALSO

SetFinalEchoOnEnabled(), EchoOn(), EchoOff()

NoFinalUpdate
This function is deprecated. Use SetFinalEchoOnEnabled() instead.
void NoFinalUpdate()

SetAutomaticCalculationResetEnabled
Enables or disables the automatic calculation reset while setting attributes via the ”:” notation
e.g. ”load:scale0 = 0.98”. object.SetVal() is not affected.
In DPL/QDSL the automatic calculation reset is by default disabled. Thus only changing the
”outserv” attribute of an network element or the ”on off” attribute of a switch device resets auto-
matically the current calculation. When the calculation is reset the load-flow will be calculated
with a flat start. Thus a disabled automatic calculation reset can be helpful e.g. when calculating
a load-flow without a flat start after changing the scaling factor of a load. On the other side it
could lead to wrong results e.g. doing short-circuit calculations after changing the short-circuit-
location of a branch without calling ResetCalculation().
If the automatic calculation reset is enabled, changing an arbitrary object attribute could lead to
a calculation reset, e.g. changing the scaling factor of a load, but do not have to, e.g. renaming
an object.
void SetAutomaticCalculationResetEnabled(int enabled)

S EE ALSO

IsAutomaticCalculationResetEnabled(), ResetCalculation()

65
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

SetConsistencyCheck
This function enables or disables the value consistency check executed whenever an attribute
is set. The consistency check is enabled by default.
Note: Disabling of consistency check might be required when dependent attributes are set
where the object is temporarily left in an invalid state until all attributes are set. In Python please
use Application.SetWriteCacheEnabled() for the same purpose.
int SetConsistencyCheck(int iEnable)

A RGUMENTS
iEnable
0 Disable attribute consistency check
1 Enable attribute consistency check

R ETURNS
1 If consistency check was enabled before.
0 If consistency check was disabled before.

SetDiffMode
This function allows switching between base and compare case result access mode when using
the comparing results functionality of PowerFactory (see User Manual Chapter: Comparisons
Between Calculations). Depending on this mode, the access to object parameters returns base
case values or is redirected to result case values. There is no need to adapt the parameter
access statements.
void SetDiffMode(int mode)

A RGUMENTS
mode
0 Base case results access.
1 Compare case results access.

S EE ALSO

GetDiffMode(), ComDiff.Start(), ComDiff.Stop()

E XAMPLE
The following example demonstrates how to access the comparing results functionality from
DPL.
object term, comldf, comdiff;
set terms;
double u1, u2;

!get load flow calculation command


comldf = GetFromStudyCase('ComLdf');
comdiff = GetFromStudyCase('ComDiff');

comdiff:imode = 1; !set compare mode to desired mode

!intially set length of a special line to 1km


lne:dline = 1.0;

66
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

!calculate load flow


comldf.Execute();

!start comparing results


comdiff.Start();

!change length of line to 1000km


lne:dline = 1000.0;

!calculate load flow again


comldf.Execute();

!report differences:
!for all relevant terminals
terms = GetCalcRelevantObjects('*.ElmTerm');
for (term = terms.First(); term; term = terms.Next()) {
SetDiffMode(0); !base case results
u1 = term:m:u;
SetDiffMode(1); !compare case results
u2 = term:m:u;
printf('%o: u1=%f p.u. u2=%f', term, u1, u2);
}
!stop comparing of results
comdiff.Stop();

!restore original settings


lne:dline = 1.0; ! 1kmLoadedElms(10);

SetFinalEchoOnEnabled
Enables or disables the automatic EchoOn() at the end of each ComDpl or ComPython.
void SetFinalEchoOnEnabled(int enabled)

A RGUMENTS
enabled
1 Enables the final EchoOn().
0 Disables the final EchoOn().

S EE ALSO

IsFinalEchoOnEnabled(), EchoOn(), EchoOff()

E XAMPLE
EchoOff();
SetFinalEchoOnEnabled(0);
... do some calculation which calls other scripts ...
SetFinalEchoOnEnabled(1);

SetGraphicUpdate
Enables or disables the updates of the single line graphics.
void SetGraphicUpdate(int enabled)

67
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
enabled
0 disabled (graphic will not be updated automatically)
1 enabled

E XAMPLE
The following example disables and enables the graphics update:
!disable graphic updates
SetGraphicUpdate(0);
!do some calculations
!...
!enable graphic updates again
SetGraphicUpdate(1);

SetGuiUpdateEnabled
Enables or disables updates of the graphical user interface (e.g. application window) while the
script is running.
This can be useful to get maximum execution performance. However, the user interface might
look frozen and becomes not responsive.
Please note that the progress bar, which is located in the status bar of the application window,
is not affected by this. Updates of the progress bar can be enabled or disabled separately by
invoking SetProgressBarUpdatesEnabled().
The updates will automatically be re-enabled after termination of the script. In case of sub-
scripts, the restore is done at termination of main script.
int SetGuiUpdateEnabled(int enabled)

A RGUMENTS
enabled
0 Disables GUI updates.
1 Enables GUI updates.

R ETURNS
Previous state before the function was called

0 GUI updates were disabled before.


1 GUI updates were enabled before.

D EPRECATED N AMES
SetRescheduleFlag

S EE ALSO

SetProgressBarUpdatesEnabled(), SetGraphicUpdate()

E XAMPLE
The following example disables and enables the GUI updates

68
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

int oldState;
! disable gui updates
oldState = SetGuiUpdateEnabled(0);
!do some calculations
!...
!restore gui updates old state
SetGuiUpdateEnabled(oldState);

SetProgressBarUpdatesEnabled
Enables or disables updates of the progress bar (located in the status bar of the application
window) while the script is running. Other components of the status bar are not affected.
If a script executes a high number of small, fast commands that report progress (noticable by
the progress bar repeatedly and quickly filling up), disabling progress bar updates can provide
an immense performance boost.
The updates will automatically be re-enabled after termination of the script. In case of sub-
scripts, the restore is done at termination of main script.
int SetProgressBarUpdatesEnabled(int enabled)

A RGUMENTS
enabled
0 Disables progress bar updates.
1 Enables progress bar updates.

R ETURNS
Previous state before the function was called

0 Progress bar updates were disabled before.


1 Progress bar updates were enabled before.

S EE ALSO

SetGuiUpdateEnabled(), SetGraphicUpdate()

E XAMPLE
The following example disables and enables the GUI updates
int oldProgressBarUpdateState;
! disable progress bar updates
oldProgressBarUpdateState = SetProgressBarUpdatesEnabled(0);
! execute a high number of small, fast commands that report progress
!...
! restore progress bar updates
SetProgressBarUpdatesEnabled(oldProgressBarUpdateState);

69
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

SetUserBreakEnabled
Enables or disables the “Break” button of the main tool bar. After script execution it is disabled
automatically.
Disabling the “Break” button before executing a lot of Python code e.g a large loop can pro-
vide an immense performance boost. Disabling the “Break” button does not lead to a further
performance improvement when the GUI updates are already disabled (see SetGuiUpdateEn-
abled()).
void SetUserBreakEnabled(int enabled)

A RGUMENTS
enabled
0 Disables “Break” button.
1 Enable “Break” button.

D EPRECATED N AMES
EnableUserBreak, SetEnableUserBreak

StartNewTableReportGroup
Starts grouping of newly opened table reports to a special TDI group.
void StartNewTableReportGroup()

2.5 Mathematics
Overview

abs*
acos*
asin*
atan2*
atan*
BinaryAnd*
BinaryOr*
CalcWeibullPar*
ceil*
cos*
cosh*
exp*
floor*
frac*
GetRandomNumber*
GetRandomNumberEx*
InvertMatrix*
ln*
log*
max*
min*
modulo*
pi*

70
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

pow*
RndExp*
RndGetMethod*
RndGetSeed*
RndNormal*
RndSetup*
RndUnifInt*
RndUnifReal*
RndWeibull*
round*
SetRandomSeed*
sin*
sinh*
sqr*
sqrt*
tan*
tanh*
time*
trunc*
twopi*

abs*
Calculates the absolute value.
double abs(double x)

A RGUMENTS
x A value.

R ETURNS
The absolute value.

acos*
Calculates the arc cosine.
double acos(double x)

A RGUMENTS
x For x ∈ [−1, 1].

R ETURNS
Arc cosine of x, in radians.

asin*
Calculates the arc sine.
double asin(double x)

A RGUMENTS
x For x ∈ [−1, 1].

71
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Arc sine of x, in radians.

atan2*
Calculates atan(y/x).
double atan(double y, double x)

A RGUMENTS
y For a value y.
x For a value x.

R ETURNS
Returns atan(y/x), in radians.

atan*
Calculates the arc tangent.
double atan(double x)

A RGUMENTS
x For a value x.

R ETURNS
Arc tangent of x, in radians.

BinaryAnd*
Performs a binary 'AND' operation on the two input arguments.
int BinaryAnd(int a, int b)

A RGUMENTS
a First value, either 0 or 1
b Second value, either 0 or 1

R ETURNS
0 If one of the arguments is 0
1 If all of the arguments are 1

E XAMPLE
int r;
r = BinaryAnd(0, 0);
printf('0 and 0 = %d', r);
r = BinaryAnd(1, 0);
printf('1 and 0 = %d', r);
r = BinaryAnd(0, 1);
printf('0 and 1 = %d', r);
r = BinaryAnd(1, 1);
printf('1 and 1 = %d', r);

72
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

BinaryOr*
Performs a binary 'OR' operation on the two input arguments.
int BinaryOr(int a, int b)

A RGUMENTS
a First value, either 0 or 1
b Second value, either 0 or 1

R ETURNS
0 If all of the arguments are 0
1 If one of the arguments is 1

E XAMPLE
int r;
r = BinaryOr(0, 0);
printf('0 or 0 = %d', r);
r = BinaryOr(1, 0);
printf('1 or 0 = %d', r);
r = BinaryOr(0, 1);
printf('0 or 1 = %d', r);
r = BinaryOr(1, 1);
printf('1 or 1 = %d', r);

CalcWeibullPar*
Performs a conversion between the weibull parameters listed below:

mean Mean value ’m’


lambda Scale Factor ’l’
variance Variance ’v’

beta Shape Factor ’b’

The output parameter is calculated from the two input parameters (e.g.: lambda = f(mean,
beta))
int CalcWeibullPar(double& parameter,
double in1,
double in2,
string keyout,
string keyin1,
string keyin2)

73
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
parameter (out)
Calculated weibull parameter
in1 The first input parameter
in2 The second input parameter
keyout Key specifying the variable of the output parameter
keyin1 Key specifying the variable of the first input parameter
keyin2 Key specifying the variable of the second input parameter

R ETURNS
0 Ok
1 Calculation failed
2 Invalid or unknown key(s)

E XAMPLE
double mean,lambda,variance,beta;
int failed;
mean = 22;
beta = 3;
! Calculate the scale factor from the mean value and the shape
failed = CalcWeibullPar(lambda,mean,beta,'l','m','b');
if (failed) {
printf('CalcWeibullPar failed');
}
else {
printf('lambda = f(mean, beta):\n%f = f(%f,%f)',lambda,mean,beta);
}

ceil*
Calculates the smallest larger integer.
double ceil(double x)

A RGUMENTS
x A value.

R ETURNS
The smallest larger integer.

cos*
Calculates the cosine.
double cos(double x)

A RGUMENTS
x A value in radians.

74
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
Cosine of x.

cosh*
Calculates the hyperbolic cosine.
double cosh(double x)

A RGUMENTS
x A value.

R ETURNS
Hyperbolic cosine of x.

exp*
Calculates ex , with the mathematical constant e (Euler’s number).
double exp([double x = 1])

A RGUMENTS
x (optional)
A value (default = 1).

R ETURNS
The value ex .

floor*
Calculates the largest smaller integer.
double floor(double x)

A RGUMENTS
x A value.

R ETURNS
The largest smaller integer.

frac*
Calculates the fractional part of x.
double frac(double x)

A RGUMENTS
x A value.

75
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The integral part of x.

GetRandomNumber*
This function is marked as deprecated since PowerFactory 2017. Please use RndUnifReal()
instead.
Draws a uniformly distributed random number. Uses the ’global random number generator’. If
x1 and x2 are omitted, the distribution will be uniform in the interval [0, 1]. If only x1 is given, the
distribution is uniform in [0, x1] and with both x1 and x2, the distribution is uniform in [x1, x2].
double GetRandomNumber([double x1,]
[double x2])

A RGUMENTS
x1 (optional)
x2 not given: maximum; x1 and x2 given: minimum
x2 (optional)
maximum

R ETURNS
A uniformly distributed random number

D EPRECATED N AMES
Random

E XAMPLE
The following example sets a load to a random active power prior to calculating a load-flow.
double P;
Load:plini = GetRandomNumber(1.2, 2.3);
Ldf.Execute();

GetRandomNumberEx*
This function is marked as deprecated since PowerFactory 2017. Please use RndUnifReal(),
RndNormal() or RndWeibull() instead.
Draws a random number according to a specific probability distribution. Uses the ’global random
number generator’.
double GetRandomNumberEx(int distribution,
[double p1,]
[double p2])

A RGUMENTS
distribution
0 uniform distribution
1 normal distribution
2 weibull distribution
else returns 0.0

76
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

p1 (optional)
distribution = 0 (uniform), argument p2 is also given: min
distribution = 0 (uniform), argument p2 is not given: max (min is as-
sumed to be 0).
distribution = 1 (normal) : mean
distribution = 2 (weibull) : scale
p2 (optional)
distribution = 0 (uniform) : max
distribution = 1 (normal) : stddev
distribution = 2 (weibull) : weibull

R ETURNS
double Newly drawn random number from the specified distribution.
0.0 On failure e.g. non-supported mode.

D EPRECATED N AMES
fRand

E XAMPLE
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 deviation=5
!weib : a Weibull distribution with scale=5 and shape=30
int n;
double uni0,uni1,uni2,norm,weib;
SetRandomSeed(2);
for (n=0; n<10; n+=1) {
uni0 = GetRandomNumberEx(0);
uni1 = GetRandomNumberEx(0, 50);
uni2 = GetRandomNumberEx(0, -8, 21);
norm = GetRandomNumberEx(1, 30, 5);
weib = GetRandomNumberEx(2, 5, 30);
printf('%f %f %f %f %f', uni0, uni1, uni2, norm, weib);
}

InvertMatrix*
This routine calculates the inverse matrix by the Gauss-Jordan method. It uses scaled partial
pivoting preceeded by column equilibration of the input matrix. The routine can be called in two
different versions:

• Real Inversion: Only one matrix, realP art, is provided as an input to the function. Then,
realP art is inverted and the result, realP art−1 , is stored into the input matrix realP art on
success.
• Complex Inversion: Two matrices, realP art and imaginaryP art, are provided as inputs
to this function. Then, a complex matrix C is formed, with entries

C(i,j) = A(i,j) + j · imaginaryP art(i,j).

77
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

The complex matrix C is inverted and, on success, the resulting real part of C −1 is written
to realP art whereas the resulting imaginary part of C −1 is written to imaginaryP art.
Please note that realP art and imaginaryP art must have the same dimensions.

int InvertMatrix(object realPart,


[object imaginaryPart])

A RGUMENTS
realPart If imaginaryPart is not set, realpart is the matrix to invert on input. In case of
success, it will be overwritten by the inverted input matrix. If imaginaryPart is set,
it holds the real part of the complex matrix to invert on input and is overwritten by
the real part of the inverted complex matrix on output.
imaginaryPart
If this is set, it should hold the imaginary part of the matrix to invert on input and
is overwritten by the imaginary part of the inverted matrix on output.

R ETURNS
1 Matrix inversion failed. The provided input matrix is singular.
0 Matrix inversion was successful. Resulting inverted matrix returned in input ma-
trix/matrices.

D EPRECATED N AMES
MatrixInvert

E XAMPLE
The following example shows the two possible applications of this method.
int errCode;
double val1,
val2,
val3,
val4;

printf('--EXAMPLE FOR REAL MATRIX INVERSION---');


printf('The matrix A is an IntMat-object in the
contents of this DPL script');
A.Resize(2, 2);
A.Set(1, 1, 0.5);
A.Set(1, 2, 0.0);
A.Set(2, 1, 0.0);
A.Set(2, 2, 0.5);

printf('The input matrix is:');


val1 = A.Get(1, 1);
val2 = A.Get(1, 2);
printf('A = [ %.1f %.1f ]', val1, val2);
val1 = A.Get(2, 1);
val2 = A.Get(2, 2);
printf(' [ %.1f %.1f ]', val1, val2);

errCode = InvertMatrix(A);
if (errCode) {
printf('Matrix A could not be inverted.');
}
else {
printf('The inverse of the input matrix is:');
val1 = A.Get(1, 1);

78
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

val2 = A.Get(1, 2);


printf('Ainv = [ %.1f %.1f ]', val1, val2);
val1 = A.Get(2, 1);
val2 = A.Get(2, 2);
printf(' [ %.1f %.1f ]', val1, val2);
}

printf('\n--EXAMPLE FOR COMPLEX MATRIX INVERSION---');


printf('The matrices realPart and imaginaryPart
are IntMat-objects in the contents of this DPL script');
realPart.Resize(2, 2);
realPart.Set(1, 1, 0.5);
realPart.Set(1, 2, 0.0);
realPart.Set(2, 1, 0.0);
realPart.Set(2, 2, 0.5);

imaginaryPart.Resize(2, 2);
imaginaryPart.Set(1, 1, 0.5);
imaginaryPart.Set(1, 2, 0.0);
imaginaryPart.Set(2, 1, 0.0);
imaginaryPart.Set(2, 2, 0.5);

printf('The complex input matrix is:');


val1 = realPart.Get(1, 1);
val2 = realPart.Get(1, 2);
val3 = imaginaryPart.Get(1, 1);
val4 = imaginaryPart.Get(1, 2);
printf('C = [ %.1f + j*(%.1f) %.1f + j*(%.1f) ]',
val1, val3, val2, val4);
val1 = realPart.Get(2, 1);
val2 = realPart.Get(2, 2);
val3 = imaginaryPart.Get(2, 1);
val4 = imaginaryPart.Get(2, 2);
printf(' [ %.1f + j*(%.1f) %.1f + j*(%.1f) ]',
val1, val3, val2, val4);

errCode = InvertMatrix(realPart, imaginaryPart);


if (errCode) {
printf('Matrix C could not be inverted.');
}
else {
printf('The inverse of the input matrix C is:');
val1 = realPart.Get(1, 1);
val2 = realPart.Get(1, 2);
val3 = imaginaryPart.Get(1, 1);
val4 = imaginaryPart.Get(1, 2);
printf('Cinv = [ %.1f + j*(%.1f) %.1f + j*(%.1f) ]',
val1, val3, val2, val4);
val1 = realPart.Get(2, 1);
val2 = realPart.Get(2, 2);
val3 = imaginaryPart.Get(2, 1);
val4 = imaginaryPart.Get(2, 2);
printf(' [ %.1f + j*(%.1f) %.1f + j*(%.1f)]',
val1, val3, val2, val4);
}

79
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

ln*
Calculates the natural logarithm of x (base e).
double ln(double x)

A RGUMENTS
x A value.

R ETURNS
The natural logarithm of x (base e).

log*
Calculates the logarithm of x with base 10.
double log(double x)

A RGUMENTS
x A value.

R ETURNS
The logarithm of x with base 10.

max*
Calculates the larger value.
double max(double x, double y)

A RGUMENTS
x A value.
y A value.

R ETURNS
The larger value.

min*
Calculates the smaller value.
double min(double x, double y)

A RGUMENTS
x A value.
y A value.

80
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The smaller value.

modulo*
Calculates the remainder after a division.
double modulo(double x, double y)

A RGUMENTS
x A value.
y A value.

R ETURNS
The remainder after a division.

pi*
Return the mathematical constant π.
double pi()

R ETURNS
The mathematical constant π.

pow*
Calculates x raised to the power y.
double pow(double x, double y)

A RGUMENTS
x A value.
y A value.

R ETURNS
The value xy .

RndExp*
Returns a random number distributed according to exponential distribution with given rate. See
the example given in the DPL description of RndSetup().
double RndExp(double rate, [int rngNum])

A RGUMENTS
rate Rate of exponetial distribution.
rngNum (optional)
Number of the random number generator.

81
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

0 (default) ’Global random number generator’.


1, 2, ... Other random number generators accessible via this number.

R ETURNS
double Random number

RndGetMethod*
Returns the used method of a random number generator. See the example given in the DPL
description of RndSetup().
string RndGetMethod([int rngNum])

A RGUMENTS
rngNum (optional)
Number of the random number generator of which the method type is returned.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

R ETURNS
string Name of the used method

RndGetSeed*
Returns the used seed of a random number generator. See the example given in the DPL
description of RndSetup().
int RndGetSeed([int rngNum])

A RGUMENTS
rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

R ETURNS
int Used seed

RndNormal*
Returns a random number distributed according to normal distribution with given mean and
standard deviation. See the example given in the DPL description of RndSetup().
double RndNormal(double mean, double stddev, [int rngNum])

82
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
mean Mean of normal distribution.
stddev Standard deviation of normal distribution.
rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

R ETURNS
double Random number

RndSetup*
Initializes a random number generator. Allows to choose:

1. Whether to seed automatically or not.


2. The seed, if not automatically seeded.
3. The type or random number generator.
4. The random number generator to use.

Supported types of random number generators:

1. Mersenne Twister,
2. Linear Congruential,
3. Additive Lagged Fibonacci.

Internally a vector of random number generators is used. These can be accessed via the
number passed as last argument. Number 0 corresponds to the ’global random number gener-
ator’, updated also in ComInc and ComGenrelinc. Numbers 1,2, . . . will access different random
number generators, which can be setup individually.
void RndSetup(int seedAutomatic, [int seed], [int rngType], [int rngNum])

A RGUMENTS
seedAutomatic
Seed the random number generator automatically
0 Do not seed automatically.
1 Seed automatically.
seed (optional)
Seed for the random number generator. (default: 0) Note, that for the Additive
Lagged Fibonacci generator, only the seeds 0,...,9 are supported.
rngType (optional)
Type of random number generator
0 Mersenne Twister (recommended) (default).
1 Linear Congruential.

83
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

2 Additive Lagged Fibonacci.

rngNum (optional)
Number of random number generator to be used
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

E XAMPLE
int i;
int numOfDraws;
int usedSeed;

int rngType; ! Type of the random number generator.


int seedAutomatic; ! automatic seeding true or false
int seed; ! seed for the random number generator
int rngNum; ! the number of the used random number generator
double draw; ! drawn random numbers

rngType = 0; ! Mersenne Twister


seedAutomatic = 0; ! User defined seed
seed = 999; ! Specific seed
rngNum = 1; ! The random number generator used
! (not the 'global random number generator',
! global rng corresponds to number 0)
numOfDraws = 50;

RndSetup(seedAutomatic, seed, rngType, rngNum);

printf('Uniformly distributed random numbers (real):');


for(i = 0; i<numOfDraws; i=i+1){
! draw random number distributed according to
! uniform distribution in the intervall $[0,1]$
! using the random number generator rngNum
draw = RndUnifReal(0,1,rngNum);
printf('%.15e',draw);
}

printf('Uniformly distributed random numbers: (integer)');


for(i = 0; i<numOfDraws; i=i+1){
! draw random number distributed according to
! uniform distribution on the set of numbers $\{0,1,\ldots, 10\}$
! using the random number generator rngNum
draw = RndUnifInt(0,10,rngNum);
printf('%.15e',draw);
}

printf('Exponentially distributed random numbers:');


for(i = 0; i<numOfDraws; i=i+1){
! draw random number distributed according to
! exponential distribution of rate $0.5$
! using the random number generator rngNum
draw = RndExp(0.5,rngNum);
printf('%.15e',draw);
}

printf('Normally distributed random numbers:');


for(i = 0; i<numOfDraws; i=i+1){
! draw random number distributed according to
! normal distribution with mean $2$ and standard deviation $4$

84
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

! using the random number generator rngNum


draw = RndNormal(2,4,rngNum);
printf('%.15e',draw);
}

printf('Weibull distributed random numbers:');


for(i = 0; i<numOfDraws; i=i+1){
! draw random number distributed according to
! Weibull distribution with shape $1$ and scale $2$
! using the random number generator rngNum
draw = RndWeibull(1,2,rngNum);
printf('%.15e',draw);
}

! Get the seed, used to initialise the random number generator rngNum.
usedSeed = RndGetSeed(rngNum);
printf('Used seed: %d', usedSeed);

! Get the method of the random number generator rngNum.


printf('Used method to generate random numbers: %s', RndGetMethod(rngNum));

RndUnifInt*
Returns a random number distributed according to uniform distribution on the set of numbers
{min, . . . , max}. See the example given in the DPL description of RndSetup().
int RndUnifInt(int min, int max, [int rngNum])

A RGUMENTS
min Smallest possible number
max Largest possible number
rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

R ETURNS
int Random number

RndUnifReal*
Returns a random number distributed according to uniform distribution on the intervall [min,max].
See the example given in the DPL description of RndSetup().
double RndUnifReal(double min, double max, [int rngNum])

A RGUMENTS
min Lower endpoint of interval [min, max]
max Upper endpoint of interval [min, max]
rngNum (optional)
Number of the random number generator.

85
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

0 (default) ’Global random number generator’.


1, 2, ... Other random number generators accessible via this number.

R ETURNS
double Random number

RndWeibull*
Returns a random number distributed according to Weibull distribution with given shape and
scale parameters. See the example given in the DPL description of RndSetup().
double RndWeibull(double shape, double scale, [int rngNum])

A RGUMENTS
shape Shape parameter of Weibull distribution.
scale Scale parameter of Weibull distribution.
rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessible via this number.

R ETURNS
double Random number

round*
Calculates the closest integer.
double round(double x)

A RGUMENTS
x A value.

R ETURNS
The closest integer.

SetRandomSeed*
This function is marked as deprecated since PowerFactory 2017. Please use RndSetup()
instead.
Initializes the ’global random number generator’ as Additive Lagged Fibonacci random number
generator. Sets the seed for the random number generator. One out of 10 predefined initializa-
tion seeds can be selected.
void SetRandomSeed(int seed)

A RGUMENTS
seed seed 0..9

86
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

D EPRECATED N AMES
SetRandSeed

sin*
Calculates the sine.
double sin(double x)

A RGUMENTS
x A value in radians.

R ETURNS
Sine of x.

sinh*
Calculates the hyperbolic sine.
double sinh(double x)

A RGUMENTS
x A value.

R ETURNS
Hyperbolic sine of x.

sqr*
Calculates the square.
double sqr(double x)

A RGUMENTS
x A value.

R ETURNS
The square x2 .

sqrt*
Calculates the square root.
double sqrt(double x)

A RGUMENTS
x A value.

87
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The square root.

tan*
Calculates the tangent.
double tan(double x)

A RGUMENTS
x A value in radians.

R ETURNS
Tangent of x.

tanh*
Calculates the hyperbolic tangent.
double tanh(double x)

A RGUMENTS
x A value.

R ETURNS
Hyperbolic tangent of x.

time*
Return the current simulation time.
double time()

R ETURNS
The current simulation time.

trunc*
Calculates the integral part of x.
double trunc(double x)

A RGUMENTS
x A value.

R ETURNS
The integral part of x.

88
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

twopi*
Return the mathematical constant 2π.
double twopi()

R ETURNS
The mathematical constant 2π.

2.6 MS Office

2.6.1 MS Access
Overview

mdbClose
mdbExecuteSqlQuery
mdbExecuteSqlStatement
mdbFetchResult
mdbGetResultColumnCount
mdbGetResultColumnName
mdbGetResultColumnType
mdbGetResultColumnValue
mdbOpen
mdbSetDebug

mdbClose
Closes currently opened MS Access file.
void mdbClose()

S EE ALSO

mdbOpen()

mdbExecuteSqlQuery
Executes a SQL query. The result of the query can be obtained by calling FetchResult().
Please note: Executing a new query will invalidate a previous one. It is not possible to have
multiple queries open in parallel.
int mdbExecuteSqlQuery(string statement)

A RGUMENTS
statement
Sql statement as text, e.g. SELECT FROM... .

R ETURNS
0 On success.
1 On error.

89
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
!// example to get contents of table 'Info'
ret = mdbExecuteSqlStatement('SELECT * from Info');
if (ret = 1) {
Error('Execution of SQL query failed');
}

mdbExecuteSqlStatement
Executes a SQL statement that does not return any values.
Executing a statement invalidates a previous query if there exists one. Special queries:

• ’SQLTables’ to enumerate over all table definitions


• ’SQLColumns \c tablename’ to enumerate over all columns of a table

int mdbExecuteSqlStatement(string statement)

A RGUMENTS
statement
Sql statement as text, e.g. CREATE TABLE... .

R ETURNS
0 On success.
1 On error.

E XAMPLE
!// example to create a new table called 'Info'
ret = mdbExecuteSqlStatement(
'CREATE TABLE [Info] ([Name] VARCHAR(20), [Version] INTEGER)'
);
if (ret = 1) {
Error('Execution of SQL statement failed');
}

mdbFetchResult
Fetches next data set returned by previous SQL query.
To get all result sets, this function must be called until 0 is returned.
int mdbFetchResult()

R ETURNS
0 On success.
1 On error.

90
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
ret = mdbExecuteSqlStatement('SELECT * from Info');
if (ret = 1) {
Error('Execution of SQL query failed');
exit();
}
ret = mdbFetchResult();
while(ret = 0) {
...
ret = mdbFetchResult();
}

mdbGetResultColumnCount
Returns the number of data columns a result set has.
All sets of a query have identical number of column counts. Therefore, it is sufficient to get this
value only once while iterating over the results. Please note, this function requires that results
values have already been fetched via mdbFetchResult().
int mdbGetResultColumnCount()

R ETURNS
Number of columns in result set (always ≥ 0).

E XAMPLE
ret = mdbExecuteSqlStatement('SELECT * from Info');
...
!// get first data set
ret = mdbFetchResult();
...
ret = mdbGetResultColumnCount();
printf('Number of columns in result: %d', ret);

mdbGetResultColumnName
Returns the field name of a result column.
All sets of a query have identical number of column counts. Therefore, it is sufficient to get this
value only once while iterating over the results. Please note, this function requires that results
values have already been fetched via mdbFetchResult().
string mdbGetResultColumnName(int column)

A RGUMENTS
column Column index, 1 ≤ index ≤ mdbGetResultColumnCount().

R ETURNS
Name of the column. String is empty if index is out of valid range.

E XAMPLE

91
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

ret = mdbExecuteSqlStatement('SELECT * from Info');


...
!// get first data set
ret = mdbFetchResult();
printf('Number of columns in result: %d', ret);

mdbGetResultColumnType
Returns the data type of the colum in result set. Please note, this function requires that results
values have already been fetched via mdbFetchResult().
int mdbGetResultColumnType(int column)

A RGUMENTS
column Column index, 1 ≤ index ≤ mdbGetResultColumnCount().

R ETURNS
Data type of values in given column:

0 string
1 integer
2 double

E XAMPLE
ret = mdbExecuteSqlStatement('SELECT * from Info');
...
ret = mdbFetchResult();
...
ret = mdbGetResultColumnType(1);
printf('Data type of column 1 is: %d', ret);

mdbGetResultColumnValue
Returns the value of a column in current data set.
int mdbGetResultColumnValue(int column
int& | double& | string& value)

A RGUMENTS
column Column index, 1 ≤ index ≤ mdbGetResultColumnCount().
value (out)
Output variable. The variable type must match the data type of the column. The
only exception is as string: It is allowed to retrieve all values as strings.

R ETURNS
0 On success.
1 On error.

92
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
ret = mdbExecuteSqlStatement('SELECT * from Info');
...
!//get first data set
ret = mdbFetchResult();
...
ret = mdbGetResultColumnValue(1, str);
printf('Value is %s', str);

mdbOpen
Opens an MS Access file.
int mdbOpen(string file,
[int createIfNotExists = 0,]
[int accessMode = 0])

A RGUMENTS
file Full file name of mdb.
createIfNotExists (optional)
0 Do not create a new file if it does not exist (default).
1 Create a new file if it does not exist.
accessMode (optional)
0 Read/write (default).
1 Read only.

R ETURNS
0 On success.
1 On error.

S EE ALSO

mdbClose()

E XAMPLE
mdbOpen('c:\database.mdb', 1);

E XAMPLE
This example demonstrates the creation of a new table and insertion of some values.
int error, i, ival;
string sql, s;
double dval;

!// open a new database (create if it does not exist)


error = mdbOpen('c:\example.mdb',1);
if (error) {
Error('Unable to open/create access file');
mdbClose();
exit();
}

93
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

!// create a new table 'MyTable'


sql = 'CREATE TABLE [MyTable] ([Name] VARCHAR(20), [Index] INTEGER,
[Value] DOUBLE)';
error = mdbExecuteSqlStatement(sql);
if (error) {
Error('Table creation failed');
mdbClose();
exit();
}

!// fill in some data


for(i = 1; i<5; i+= 1) {
dval = i/2;
s = sprintf('%f', dval);
strchg(s, ',', '.'); !// replace ',' by '.'
sql = sprintf('INSERT INTO MyTable ([Name], [Index], [Value])
VALUES ("Entry%d", %d, %s)', i, i, s);
error = mdbExecuteSqlStatement(sql);
if (error) {
Error('Insertion of data failed (%s)', sql);
mdbClose();
exit();
}
}

!// close database


mdbClose();

E XAMPLE
This example demonstrates how to access information about available tables.
int error, colcount, i, t;
string sql, s;

!// open an existing database


error = mdbOpen('c:\example.mdb',0);
if (error) {
Error('Unable to open database');
exit();
}

!// list available tables


sql = 'SQLTables';
error = mdbExecuteSqlQuery(sql);
if (.not. error) {
!// get first result set
error = mdbFetchResult();
}
if (error) {
Error('Unable to get table information');
mdbClose();
exit();
}

!// get number of columns in result set


colcount = mdbGetResultColumnCount();

!// output table information

94
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

printf('The database contains the following tables:');


SetLineFeed(0); !// disable automatic line feed
!// header information (column name and type)
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
s = mdbGetResultColumnName(i);
t = mdbGetResultColumnType(i);
printf('%s(%d)', s, t);
}
printf('\n');

!// output result data sets


while(error = 0) {
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
mdbGetResultColumnValue(i, s);
printf('%s',s);
}
printf('\n');
error = mdbFetchResult();
}
SetLineFeed(1); !// enable automatic line feed again

!// close database


mdbClose();

E XAMPLE
This example demonstrates how to get information about the columns of a specific table.
int error, colcount, i, t;
string sql, s;

!// open an existing database


error = mdbOpen('c:\example.mdb',0);
if (error) {
Error('Unable to open database');
exit();
}

!// list fiels of table 'MyTable'


sql = 'SQLColumns MyTable';
error = mdbExecuteSqlQuery(sql);
if (.not. error) {
!// get first result set
error = mdbFetchResult();
}
if (error) {
Error('Unable to get field information for table "MyTable"');
mdbClose();
exit();
}

!// get number of columns in result set


colcount = mdbGetResultColumnCount();

!// output table information

95
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

printf('The table "MyTable" contains the columns:');


SetLineFeed(0);
!// header information (column name and type)
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
s = mdbGetResultColumnName(i);
t = mdbGetResultColumnType(i);
printf('%s(%d)', s, t);
}
printf('\n');

!// output result data sets


while(error = 0) {
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
mdbGetResultColumnValue(i, s);
printf('%s',s);
}
printf('\n');
error = mdbFetchResult();
}

SetLineFeed(1);

!// close database


mdbClose();

E XAMPLE
This example demonstrates how to read data from an existing table.
int error, colcount, i, t;
string sql, s;

!// open an existing database


error = mdbOpen('c:\example.mdb',0);
if (error) {
Error('Unable to open database');
exit();
}

!// list fiels of table 'MyTable'


sql = 'SELECT * FROM [MyTable]';
error = mdbExecuteSqlQuery(sql);
if (.not. error) {
!// get first result set
error = mdbFetchResult();
}
if (error) {
Error('Unable to get data from table "MyTable"');
mdbClose();
exit();
}

!// get number of columns in result set


colcount = mdbGetResultColumnCount();

96
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

!// output table information


printf('The table "MyTable" contains the following data:');
SetLineFeed(0);
!// header information (column name and type)
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
s = mdbGetResultColumnName(i);
t = mdbGetResultColumnType(i);
printf('%s(%d)', s, t);
}
printf('\n');

!// output result data sets


while(error = 0) {
for(i =1; i<= colcount; i+=1) {
if (i>1) {
printf('; ');
}
mdbGetResultColumnValue(i, s);
printf('%s',s);
}
printf('\n');
error = mdbFetchResult();
}

SetLineFeed(1);

!// close database


mdbClose();

mdbSetDebug
Enables output of additional information of errors during communication with MS Access.
The information is printed as plain text to the PowerFactory output window.
void mdbSetDebug(int debug)

A RGUMENTS
debug
0 Disable debug mode.
1 Enable debug mode.

E XAMPLE
mdbSetDebug(1); !// enable debug info for MS Access communication

97
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

2.6.2 MS Excel
Overview

xlActivateWorksheet
xlAddWorksheet
xlCloseWorkbook
xlDeleteWorksheet
xlGetActiveWorksheetIndex
xlGetDateSeparator
xlGetDecimalSeparator
xlGetThousandsSeparator
xlGetValue
xlGetWorksheetCount
xlGetWorksheetName
xlNewWorkbook
xlOpenWorkbook
xlResetTextStyle
xlRunMacro
xlSaveWorkbook
xlSaveWorkbookAs
xlSetBorder
xlSetColumnWidth
xlSetDebug
xlSetFillColor
xlSetFontName
xlSetFontSize
xlSetHorizontalAlignment
xlSetNumberFormat
xlSetPrintTitleRows
xlSetRowHeight
xlSetTextColor
xlSetTextStyle
xlSetValue
xlSetValues
xlSetVerticalAlignment
xlSetVisible
xlSetWorksheetName
xlSetWrapText
xlStart
xlTerminate

xlActivateWorksheet
Activates sheet with given index in active workbook.
int xlActivateWorksheet(int sheetIndex)

A RGUMENTS
sheetIndex
Index of the sheet that should become active. This index is 1-based, this means
1 ≤ sheetIndex ≤ xlGetWorksheetCount().

R ETURNS
0 On success.
1 On error.

98
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

xlGetWorksheetCount()

E XAMPLE
xlActivateSheet(1); !// activates first sheet

xlAddWorksheet
Adds a new worksheet to current workbook. The new worksheet will automatically be set to be
the active one.
int xlAddWorksheet([string name])

A RGUMENTS
name (optional)
Name for new worksheet.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlAddWorksheet();

xlCloseWorkbook
Closes currently opened workbook. Any unsaved modifications will be lost.
int xlCloseWorkbook()

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlSaveWorkbookAs(), xlSaveWorkbook()

E XAMPLE
xlCloseWorkbook();

xlDeleteWorksheet
Deletes a worksheet from current workbook.
int xlDeleteWorksheet(int sheetIndex)

99
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
sheetIndex
Index of sheet to delete. 1 ≤ sheetIndex ≤ GetWorksheetCount().

R ETURNS
0 On success.
1 On error.

E XAMPLE
int count;
!// delete all worksheets (except last one = error)
count = xlGetWorksheetCount();
while(count > 0) {
error = xlDeleteWorksheet(count);
if (error = 0) {
printf('Successfully deleted sheet %d', count);
}
else {
printf('Sheet %d could not be deleted', count);
break;
}
count -= 1;
}

xlGetActiveWorksheetIndex
Returns the index of currently active sheet.
int xlGetActiveWorksheetIndex()

R ETURNS
Index of active worksheet, 1 ≤ sheetIndex ≤ xlGetWorksheetCount().

S EE ALSO

xlGetWorksheetCount()

xlGetDateSeparator
Returns currently used date separator.
string xlGetDateSeparator()

R ETURNS
Data separator, e.g. ”/”.

E XAMPLE
sep = xlGetDateSeparator();

100
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlGetDecimalSeparator
Returns currently used decimal separator.
string xlGetDecimalSeparator()

R ETURNS
Decimal separator, e.g. ”,”.

E XAMPLE
sep = xlGetDecimalSeparator();

xlGetThousandsSeparator
Returns currently used thousands separator.
string xlGetThousandsSeparator()

R ETURNS
Thousands separator, e.g. ”.”.

E XAMPLE
sep = xlGetThousandsSeparator();

xlGetValue
Returns the value of a cell.
int xlGetValue(int column,
int row,
int|double|string value)

A RGUMENTS
column Column index of cell (≥ 1).
row Row index of cell (≥ 1).
value (out)
Variable in which the output will be stored. It is always possible to get a cell value
as strings. For other data types, the type of the variable must match that of the
cell value.

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlSetValue()

101
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
string value;
xlGetValue(1, 1, value);
printf('The value of Cell A1 is %s', value);

xlGetWorksheetCount
Returns the number of worksheets in current workbook.
int xlGetWorksheetCount()

R ETURNS
Number of sheets (always ≥ 0).

E XAMPLE
count = xlGetWorksheetCount();
printf('Current Workbook contains %d sheets', count);

xlGetWorksheetName
Gets the name of a worksheet (in active workbook).
string xlGetWorksheetName(int sheetIndex)

A RGUMENTS
sheetIndex
Index of sheet for which the name shall be returned. This index is 1-based, this
means 1 ≤ sheetIndex ≤ xlGetWorksheetCount().

R ETURNS
Name of sheet or empty in case sheet does not exist.

S EE ALSO

xlGetWorksheetCount(), xlSetWorksheetName()

E XAMPLE
count = xlGetWorksheetCount();
printf('Number of sheets in current workbook: %d', count);
while(count > 0) {
name = xlGetWorksheetName(count);
printf('Worksheet[%d]: Name=%s', count, name);
count -= 1;
}

xlNewWorkbook
Creates a new Workbook.
int xlNewWorkbook()

102
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlNewWorkbook();

xlOpenWorkbook
Opens an existing workbook.
int xlOpenWorkbook(string file)

A RGUMENTS
name Name of existing MS Excel file to open.

R ETURNS
0 On success.
1 On error.

E XAMPLE
ret = xlOpenWorkbook('c:\test.xlsx'); !// opens c:\test.xlsx

xlResetTextStyle
Resets given text style for a cell or for a range of cells.
Note: If column2 and row2 are given, the text style is changed for the whole range from column1,
row1 to column2, row2.
int xlResetTextStyle(int column1,
int row1,
int style)
int xlResetTextStyle(int column1,
int row1,
int column2,
int row2,
int style)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).

row2 (optional)
2nd row index for specifying a range (≥ 1).
style Text style to be reset:

103
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

1 bold
2 italic
4 underline
8 strikethrough
16 superscript
32 subscript

Note, multiple styles can be combined by summing up the corresponding style


values, e.g. bold and italic is 3 (=1+2)

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlSetTextStyle()

E XAMPLE
xlResetTextStyle(1,1,3,2,1); !// no bold for range A1:B2
xlResetTextStyle(5,2,6); !// no italic and no underline for cell D2

xlRunMacro
Executes a macro.
int xlRunMacro(string macro)

A RGUMENTS
macro Macro name; if a macro of that name does not exist, a value of 1 is returned.
createIfNotExists (optional)
0 Do not create a new file if it does not exist (default).
1 Create a new file if it does not exist.
accessMode (optional)
0 Read/write (default).
1 Read only.

R ETURNS
0 On success.
1 On error.
This is not the return value of the macro itself but just an indicator whether macro has been
found an executed.

E XAMPLE
xlRunMacro('MyMacro');

104
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlSaveWorkbook
Saves a modified workbook. The existing file will be overwritten with current version of the
workbook. Please note, for new workbooks the SaveAs() function has to be used.
int xlSaveWorkbook()

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlSaveWorkbookAs()

E XAMPLE
xlSaveWorkbook(); !// overwrites existing file with current version
!// of workbook

xlSaveWorkbookAs
Saves current workbook as a new file.
int xlSaveWorkbookAs(string file)

A RGUMENTS
file Full file name of new MS Excel file.

R ETURNS
0 On success.
1 On error.

E XAMPLE
ret = xlSaveWorkbookAs('c:\test_new.xlsx'); !// save current workbook as
!// c:\test_new.xlsx

xlSetBorder
Sets/resets the border of a cell or a range of cells.
To reset a border, use lineStyle=none. In this case, the given w̧eight and çolor is ignored.
int xlSetBorder(int column1,
int row1,
int borders,
int lineStyle,
int weight,
int colorR,
int colorG,
int colorB)
int xlSetBorder(int column1,
int row1,
int column2,

105
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

int row2,
int borders,
int lineStyle,
int weight,
int colorR,
int colorG,
int colorB)

A RGUMENTS
column1 Column index (≥ 1).

row1 Row index (≥ 1).


column2 (optional)
2nd column index for specifying a range (≥ 1).
row2 (optional)
2nd row index for specifying a range (≥ 1).
borders Identfier of border, possible values are
1 edge bottom
2 edge right
4 edge top
8 edge left
16 inside horizontal
32 inside vertical
64 diagonal down
128 diagonal up
lineStyle Style of the line, possible values are
0 none (resets the border)
1 continuous
2 dash
3 dash dot
4 dash dot dot
5 dot
6 double
7 slant dash dot
weight Weight of the border, possible values are
1 hairline
2 medium
3 thick
4 thin
colorR Red part of RGB color, 0 ≤ colorR ≤ 255.

colorG Green part of RGB color, 0 ≤ colorR ≤ 255.


colorB Blue part of RGB color, 0 ≤ colorR ≤ 255.

106
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetBorder(2,2,15,1,2,0,0,0); !// sets a border around B2,
!// bottom+right+top+left
xlSetBorder(2,2,15,0,0,0,0,0); !// resets border for B2

xlSetColumnWidth
Sets the width of a given column in active worksheet.
int xlSetColumnWidth(int column,
double width)

A RGUMENTS
column Column index (≥ 1).
width New width. If a value < 0 is passed, the optimal width will be automatically
detected (’autofit’).

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetColumnWidth(1, 20.25); !// set width of column 1 to 20.25

xlSetDebug
Enables output of additional information of errors during communication with MS Excel.
The information is printed as plain text to the PowerFactory output window.
Note: This method must not be called before xlStart if the alternative Excel implementation is
used.
void xlSetDebug(int debug)

A RGUMENTS
debug
0 Disable debug mode.
1 Enable debug mode.

E XAMPLE
xlSetDebug(1); !// enable debug info for MS Excel communication

107
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlSetFillColor
Sets the background color for a cell or a range of cells. The color must be given in RGB parts.
Note: If column2 and row2 are given, the text style is changed for the whole range from column1,
row1 to column2, row2.
int xlSetFillColor(int column1,
int row1,
int colorR,
int colorG,
int colorB)
int xlSetFillColor(int column1,
int row1,
int column2,
int row2,
int colorR,
int colorG,
int colorB)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).

row2 (optional)
2nd row index for specifying a range (≥ 1).
colorR Red part of RGB color, 0 ≤ colorR ≤ 255.
colorG Green part of RGB color, 0 ≤ colorR ≤ 255.

colorB Blue part of RGB color, 0 ≤ colorR ≤ 255.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetFillColor(1,1,3,2,255, 255, 150); !// range A1:B2 to yellow

xlSetFontName
Sets a new text font for a cell or a range of cells.
int xlSetFontName(int column1,
int row1,
string fontname)
int xlSetFontName(int column1,
int row1,
int column2,
int row2,
string fontname)

108
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).

row2 (optional)
2nd row index for specifying a range (≥ 1).
fontname Windows font name, e.g. ”Arial”.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetFontName(1,1,'Courier'); !// text will now be visualized
!// in font 'Courier'

xlSetFontSize
Sets a new size for text font of a cell or a range of cells.
int xlSetFontSize(int column1,
int row1,
double fontsize)
int xlSetFontSize(int column1,
int row1,
int column2,
int row2,
double fontsize)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).

row2 (optional)
2nd row index for specifying a range (≥ 1).
fontsize Size, e.g. 12.0.

R ETURNS
0 On success.
1 On error.

109
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
xlSetFontSize(1,1,9.75);

xlSetHorizontalAlignment
Sets the horizontal content alignmnet for a cell or a range of cells.
Note: If column2 and row2 are given, the alignment is changed for the whole range from
column1, row1 to column2, row2.
int xlSetHorizontalAlignment(int column1,
int row1,
int alignment)
int xlSetHorizontalAlignment(int column1,
int row1,
int column2,
int row2,
int alignment)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).

column2 (optional)
2nd column index for specifying a range (≥ 1).
row2 (optional)
2nd row index for specifying a range (≥ 1).

alignment
New horizontal alignment. Possible values are:
0 left
1 center
2 right

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetHorizontalAlignment(1,1,2); !// set horizontal text alignment
!// for A1 to center

110
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlSetNumberFormat
Sets the number format for a cell or a range of cells. Please note that decimal, date separators
are localized and must be used according to current settings.
int xlSetNumberFormat(int column1,
int row1,
string format)
int xlSetNumberFormat(int column1,
int row1,
int column2,
int row2,
string format)

A RGUMENTS
column1 Column index (≥ 1).

row1 Row index (≥ 1).


column2 (optional)
2nd column index for specifying a range (≥ 1).
row2 (optional)
2nd row index for specifying a range (≥ 1).
format New number format, e.g. ”0.##”.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetValue(3.1415, 1, 1);
xlSetNumberFormat(1, 1, '0,0'); !// value will now be displayed as '3.1'

xlSetPrintTitleRows
Allows to set fixed header rows for printing. The corresponding setting in Excel is called ”rows
to repeat on top” and can be found in ’Page Setup’ on tab ’Sheet’.
Calling this function with row1=row2=-1 will reset the setting.
int xlSetPrintTitleRows(int row1,
int row2)

A RGUMENTS
row1 First row index, −1 or ≥ 1.
row2 Second row index, −1 or ≥ 1; row2 ≥ row1.

R ETURNS
0 On success.
1 On error.

111
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
xlSetPrintTitleRows(1,1); !// row1 will now be printed on
!// each page (on printout)

xlSetRowHeight
Sets the height of a given row in active worksheet.
int xlSetRowHeight(int row,
double height)

A RGUMENTS
row Row index (≥ 1).
height New height. If a value < 0 is passed, the optimal height will be automatically
detected (’autofit’).

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetRowHeight(1, 10); //set height of row 1 10

xlSetTextColor
Sets the text color for a cell or a range of cells. The color must be given in RGB parts.
Note: If column2 and row2 are given, the text style is changed for the whole range from column1,
row1 to column2, row2.
int xlSetTextColor(int column1,
int row1,
int colorR,
int colorG,
int colorB)
int xlSetTextColor(int column1,
int row1,
int column2,
int row2,
int colorR,
int colorG,
int colorB)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).

column2 (optional)
2nd column index for specifying a range (≥ 1).

112
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

row2 (optional)
2nd row index for specifying a range (≥ 1).
colorR Red part of RGB color, 0 ≤ colorR ≤ 255.
colorG Green part of RGB color, 0 ≤ colorR ≤ 255.
colorB Blue part of RGB color, 0 ≤ colorR ≤ 255.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetTextColor(1,1,3,2,255,0,0); !// range A1:B2 to red

xlSetTextStyle
Sets given text style for a cell or for a range of cells.
Note: If col2 and row2 are given, the text style is changed for the whole range from col1, row1
to col2, row2.
The formatting can be undone using function xlResetTextStyle().
int xlSetTextStyle(int column1,
int row1,
int style)
int xlSetTextStyle(int column1,
int row1,
int column2,
int row2,
int style)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).
row2 (optional)
2nd row index for specifying a range (≥ 1).
style Text style to be set:
1 bold
2 italic
4 underline
8 strikethrough
16 superscript
32 subscript
Note, multiple styles can be combined by summing up the corresponding style
values, e.g. bold and italic is 3 (=1+2)

113
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlResetTextStyle()

E XAMPLE
xlSetTextStyle(1,1,3,2,1); !// range A1:B2 to bold
xlSetTextStyle(5,2,6); !// cell D2 to italic+underline

xlSetValue
Sets a cell’s value.
int xlSetValue(int column,
int row,
int|double|string value)

A RGUMENTS
column Column index of cell (≥ 1).
row Row index of cell (≥ 1).
value New value to be set.

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlGetValue(), xlSetNumberFormat()

E XAMPLE
xlSetValue(1, 1, 'My text'); !// sets text for cell A1

xlSetValues
Sets values for a row of cells.
int xlSetValues(int column,
int row,
string values,
string sep)

A RGUMENTS
column Column index of cell (≥ 1).
row Row index of cell (≥ 1).
values New values separated by ’sep’.
sep Used separator.

114
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlSetValue()

E XAMPLE
xlSetValues(1, 1, 'Hello|World', '|'); !// sets text for cell
!// A1=Hello, A2=World

xlSetVerticalAlignment
Sets the vertical content alignmnet for a cell or a range of cells.
Note: If column2 and row2 are given, the alignment is changed for the whole range from
column1, row1 to column2, row2.
int xlSetVerticalAlignment(int column1,
int row1,
int alignment)
int xlSetVerticalAlignment(int column1,
int row1,
int column2,
int row2,
int alignment)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).

row2 (optional)
2nd row index for specifying a range (≥ 1).
alignment
New vertical alignment. Possible values are:
0 top
1 center
2 bottom

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetVerticalAlignment(1,1,2); !// set vertical text alignment
!// for A1 to center

115
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlSetVisible
Sets visibility of MS Excel application window. By default, the window is hidden.
int xlSetVisible(int visible)

A RGUMENTS
visible)
0 Makes MS Excel invisible.
1 Makes MS Excel visible.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetVisible(1); !// makes application window visible

xlSetWorksheetName
Sets the name of a worksheet (in active workbook).
int xlSetWorksheetName(int sheetIndex,
string name)

A RGUMENTS
sheetIndex
Index of sheet for which the name shall be set. This index is 1-based, this means
1 ≤ sheetIndex ≤ xlGetWorksheetCount().
name New name to be set.

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlGetWorksheetCount(), xlGetWorksheetName()

E XAMPLE
count = xlGetWorksheetCount();
printf('Number of sheets in current workbook: %d', count);
while(count > 0) {
name = sprintf('My Sheet %d', count);
xlSetWorksheetName(count, name);
count -= 1;
}

116
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

xlSetWrapText
Enables or disables text wrapping for a cell or range of cells.
int xlSetWrapText(int column1,
int row1,
int enabled)
int xlSetWrapText(int column1,
int row1,
int column2,
int row2,
int enabled)

A RGUMENTS
column1 Column index (≥ 1).
row1 Row index (≥ 1).
column2 (optional)
2nd column index for specifying a range (≥ 1).
row2 (optional)
2nd row index for specifying a range (≥ 1).
enabled
0 Wrapping disabled.
1 Wrapping enabled.

R ETURNS
0 On success.
1 On error.

E XAMPLE
xlSetWrapText(1,1,1); !// enabled text wrapping for A1
xlSetValue(1,1,'Hello\nExcel'); !// set a text that contains
!// an explicit line break

xlStart
Creates a new MS Excel instance. This function must be called once at the beginning of any
communication with MS Excel.
The interface will per default use the COM interface Microsoft Excel provides. This requires
Excel to be installed on the machine. Passing 1 for the type parameter uses an alternative
implementation which does not require Excel to be installed. However, the alternative imple-
mentation cannot handle macro-enabled Excel files (.xlsm).
int xlStart([int interface = 0])

A RGUMENTS
interface (optional)
0= Use COM, 1= Use alternative implementation

R ETURNS
0 On success.
1 On error.

117
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

xlTerminate()

E XAMPLE
xlStart(); !// starts MS Excel
...
xlTerminate();

E XAMPLE
This example demonstrates how to export data of PowerFactory elements into an Excel
sheet.
string class, attributes;
string s, desc, type, sval, sep, numberFormat;
set objs;
object obj, oval;
double dval;
int error, pos, i, t, row, col, maxRow, maxCol;

!// export definition


class = 'ElmLne';
attributes = 'loc_name,typ_id,bus1,bus2,dline';

error = xlStart(); !// start MS Excel


if (error) {
Error('Unable to start MS Excel application');
exit();
}

!// get decimal separator and build number format used here
sep = xlGetDecimalSeparator();
numberFormat = sprintf('0%s000', sep);

!// create a new workbook


xlNewWorkbook();
xlSetWorksheetName(1, class);

!// iterate over attributes and write header row


row = 1;
col = 1;
s = strtok(attributes,',',pos,col);
while(pos > -1) {
xlSetValue(col, row, s);
col+=1;
s = strtok(attributes,',',pos,col);
}
maxCol = col-1;

!// change format of header row


xlSetTextStyle(1,1,maxCol,1, 1); !// bold
xlSetFillColor(1,1,maxCol,1, 255, 255, 150); !// yellow
xlSetBorder(1,1,maxCol,1,1,1,2,0,0,0); !// border at bottom

!// export data


row = 2;
objs = AllRelevant(class);
for(obj = objs.First(); obj; obj = objs.Next()) {
col = 1;

118
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

s = strtok(attributes,',',pos,col);
while(pos > -1) {
obj.GetVarType(s, type);
t = strcmp(type, 'string');
if (t=0) {
obj.GetVal(sval, s);
xlSetValue(col, row, sval);
}
t = strcmp(type, 'object');
if (t=0) {
obj.GetVal(oval, s);
sval = oval:loc_name;
xlSetValue(col, row, sval);
}
t = strcmp(type, 'double');
if (t=0) {
obj.GetVal(dval, s);
xlSetValue(col, row, dval);
xlSetNumberFormat(col, row, numberFormat);
}

col+=1;
s = strtok(attributes,',',pos,col);
}
row += 1;
}

!// save and exit


error = xlSaveWorkbookAs('c:\export.xls');
if (error) {
Error('Workbook could not be saved');
}
xlTerminate(); !// terminate MS Excel

E XAMPLE
This example demonstrates how to open an Excel file and read values from active sheet.
int error, row, col, count, active, i, t, stop;
string str;

error = xlStart(); !// start MS Excel


if (error) {
Error('Unable to start MS Excel application');
exit();
}

error = xlOpenWorkbook('c:\test.xls'); !// opens c:\test.xls


if (error) {
Error('Unable to open Excel file.');
xlTerminate();
exit();
}

!// get number of sheets


count = xlGetWorksheetCount();
active = xlGetActiveWorksheetIndex();
printf('The workbook contains the following sheets:');
for(i = 1; i<=count; i+= 1) {
str = xlGetWorksheetName(i);
if (i = active) {

119
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

printf(' %d: %s (active)', i, str);


}
else {
printf(' %d: %s', i, str);
}
}

!// get cell values starting at A1 up to first empty cell


printf('Listing contents of current sheet:');
row = 1;
stop = 0;
while(stop = 0) {
col = 1;
while(1) {
xlGetValue(col, row, str);
t = strlen(str);
if (t = 0) { !// stop at empty cell, continue with next row
if (col = 1) {
stop = 1; !// completely stop if cell in first column is empty
}
break;
}
printf('row: %d, col: %d, value: %s', row, col, str);
col += 1;
}
row += 1;
}

xlTerminate(); !// terminate MS Excel

xlTerminate
Closes currently active MS Excel instance. This function should be called at the end of a script
if all communication with MS Excel is finished.
int xlTerminate()

R ETURNS
0 On success.
1 On error.

S EE ALSO

xlStart()

E XAMPLE
xlStart();
...
xlTerminate(); !// closes MS Excel

120
2.7. MULTIBYTE ENCODED STRING CHAPTER 2. GLOBAL FUNCTIONS

2.7 Multibyte Encoded String


Overview

mbschg*
mbscmp*
mbscpy*
mbslen*
mbsprintf*
mbsscanf*
mbsstr*
mbstok*
tombchar*
tombcharcodepoint*
tombslower*
tombsupper*

mbschg*
Searches a substring and replaces it. See strchg() for more details.
int mbschg(string& str,
string find,
string new)

S EE ALSO

strchg()

mbscmp*
Compares two strings case sensitive. See strcmp() for more details.
int mbscmp(string str1,
string str2,
[int maxCount])

S EE ALSO

strcmp()

mbscpy*
Returns a copy of a substring. See strcpy() for more details.
string mbscpy(string str,
int startIndex,
[int maxCount])

S EE ALSO

strcpy()

121
2.7. MULTIBYTE ENCODED STRING CHAPTER 2. GLOBAL FUNCTIONS

mbslen*
Returns the multibyte length of a string.
int mbslen(string str)

A RGUMENTS
str The string.

R ETURNS
Returns the number of multibyte characters of a string. For strings containing invalid multibyte
characters 0 is returned.

S EE ALSO

strlen()

mbsprintf*
Returns a formatted multibyte character string. See sprintf() for more details.
string mbsprintf(string format,
[int|double|string|object argument0,]
[...])

S EE ALSO

mbprintf(), mbsscanf()

mbsscanf*
Parses a multibyte character string of values. See sscanf() for more details.
int mbsscanf(string source,
string format,
[int|double|string argument0,]
[...])

S EE ALSO

sscanf(), mbsprintf()

mbsstr*
Searches for a substring in a string and returns its multibyte position. See strstr() for more
details.
int mbsstr(string str,
string substr)

S EE ALSO

strstr()

122
2.7. MULTIBYTE ENCODED STRING CHAPTER 2. GLOBAL FUNCTIONS

mbstok*
Splits a string into tokens. See strtok() for more details.
string mbstok(string source,
string delimiters,
int& index,
[int tokenNumber = 1],
[int skipEmptyToken = 1])

S EE ALSO

strtok()

tombchar*
Converts the given codepoint (number) to the corresponding multibyte character.
string tombchar(int codePoint)

A RGUMENTS
codePoint
Number between 0 and 65535 which represents a multibyte character in the
current Windows ANSI code page.

R ETURNS
A string of multibyte length 1 containing the multibyte character representation of the given
codepoint in the current Windows ANSI code page or an empty string if no multibyte character
representation exists.

S EE ALSO

tombcharcodepoint(), tochar()

tombcharcodepoint*
Converts a multibyte character to its code point.
int tombcharcodepoint(string str)

A RGUMENTS
str A string of multibyte length 1 containing the multibyte character.

R ETURNS
Number between 0 and 65535 which represents the given multibyte character in the current
Windows ANSI code page or 0 if an error occurred.

S EE ALSO

tombcharcodepoint(), tochar()

tombslower*
Creates a lowercased copy of a string. See tolower() for more details.
string tombslower(string str)

123
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

tombsupper(), tolower()

tombsupper*
Creates a uppercased copy of a string. See toupper() for more details.
string tombsupper(string str)

S EE ALSO

tombslower(), toupper()

2.8 Output Window


Overview

ClearOutputWindow*
Error*
FlushOutputWindow*
Info*
mbprintf*
printf*
SetLineFeed*
SetOutputWindowState
Warn*
Write*

ClearOutputWindow*
Clears the output window.
void ClearOutputWindow()

D EPRECATED N AMES
ClearOutput

Error*
Prints a formatted string as an error to the Output Window and automatically inserts a line-break.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string. The line-break can’t be disabled.
To stop a script after an error use exit().
string Error(string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
format C++-like printf() format string. See the Format String Syntax for more information.
argument... (optional)
Arguments matching the format string.

124
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
The printed string.

S EE ALSO

printf(), Info(), Warn()

E XAMPLE
The following example writes an error to the output window.
Error('Index could not be calculated.');

FlushOutputWindow*
Calling this function ensures that all previously printed and potentially buffered messages are
visible in the output window.
void FlushOutputWindow()

E XAMPLE
The following example demonstrated the usage of FlushOutputWindow().
string message;
message += 'It is not guaranteed that this message is shown immediately';
message += ' in the output window as it could be buffered.';
Info(message);
! After this call all previously printed messages
! are guaranteed to be visible in the output window.
FlushOutputWindow();

Info*
Prints a formatted string as information to the Output Window and automatically inserts a line-
break.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string. The line-break can’t be disabled.
string Info(string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
format C++-like printf() format string. See the Format String Syntax for more information.
argument... (optional)
Arguments matching the format string.

R ETURNS
The printed string.

S EE ALSO

printf(), Warn(), Error()

125
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
The following example writes an info message to the output window.
Info('Trying to calculate first index...');

mbprintf*
Prints a formatted multibyte string as plain text to the Output Window. See printf() for more
details.
To print a formatted multibyte string as information, warning or error use mbsprintf() together
with Info(), Warn() or Error().
string mbprintf(string format,
[int|double|string|object argument0,]
[...])

S EE ALSO

Info(), Warn(), Error(), mbsprintf()

printf*
Prints a formatted string as plain text to the Output Window and automatically inserts a line-
break.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string. The line-break insertion can be disabled with SetLineFeed().
string printf(string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
format C++-like printf() format string. See the Format String Syntax for more information.
argument... (optional)
Arguments matching the format string.

R ETURNS
The printed string.

D EPRECATED N AMES
fWrite

S EE ALSO

Info(), Warn(), Error(), mbprintf(), sprintf()

E XAMPLE
object load;

!load = ...; ! a load

! Print object link (clickable loc_name) without class icon


printf('%s', load);

126
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

! Print class icon and object link (clickable loc_name)


printf('%o', load);
! Limit or extend length of class icon + loc_name to 5 characters
printf('%5o', load);

! Print bitmap for object


printf('%b', load);
! Print bitmap for class name
printf('%b', 'ElmLoad');

! A table
printf('\n\n0123456789 0123456789\n');
printf('%10F %10F', -3.143458903850, 1.71);
printf('%10F %10F', 1234567890, 1234567890123);
printf('%10F %10F', 1.0, 1234.0005);

SetLineFeed*
Sets or resets the automatic line feed for printf(), mbprintf() and fprintf(). By default, the auto-
matic line feed is enabled.
void SetLineFeed(int enabled)

A RGUMENTS
enabled ‘0’ disables automatic line feed, ‘1’ enables it.

E XAMPLE
The following example demonstrates the output of two printf statements with and without
automatic line feed.
SetLineFeed(1); !can be omitted, as automatic line feed is enabled by default
printf('Hello ');
printf('PowerFactory');

SetLineFeed(0);
printf('Hello ');
printf('PowerFactory');
printf('\n'); !explicit newline

S EE ALSO

printf(), mbprintf(), fprintf()

SetOutputWindowState
Changes the display state of the output window.
void SetOutputWindowState(int newState)

A RGUMENTS
newState
0 Minimized output window.
1 Maximized output window.
-1 Restore previous state.

127
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
The following example shows how to change the display state:
!minimize output window
SetOutputWindowState(0);
printf('Window was minimized');
Sleep(1000);

!maximize output window


SetOutputWindowState(1);
printf('Window was maximized');
Sleep(1000);

!restore previous state


SetOutputWindowState(-1);
printf('Previous window state was restored');

Warn*
Prints a formatted string as warning to the Output Window and automatically inserts a line-
break.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string. The line-break can’t be disabled.
string Warn(string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
format C++-like printf() format string. See the Format String Syntax for more information.
argument... (optional)
Arguments matching the format string.

R ETURNS
The printed string.

S EE ALSO

printf(), Info(), Error()

E XAMPLE
The following example writes a warning message to the output window.
Warn('No loads attached: using approximation.');

128
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

Write*
This function is described here for compatibility reasons. In most cases the printf() is easier to
use. It writes out a line of formatted text, using the DIgSILENT output language.
void Write(string format,
[object obj,]
[...])
void Write(string format,
[set objects,]
[...])

A RGUMENTS
format The format string
obj (optional)
A object which is used to get data from.
objects (optional)
Objects which are used to get data from.

This function 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 PowerFactory User Manual).
Because data or parameters of more than one object are 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.

S EE ALSO

printf()

E XAMPLE
In the following example, two name and loading of two lines written to the Output Window.
string format;
set objects;

objects.Add(LineA); ! some ElmLne later ACC(1)


objects.Add(LineB); ! another ElmLne later ACC(2)

Write('The following results are found:');


format += '# : #.## # , # : #.## # ';
format += '$N,ACC(1):loc_name,ACC(1):c:loading,[ACC(1):c:loading,';
format += 'ACC(2):loc_name,ACC(2):c:loading,[ACC(2):c:loading';
Write(format, objects);

129
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

2.9 String
Overview

sprintf*
sscanf*
sscanfsep*
strchg*
strcmp*
strcpy*
strlen*
strstr*
strtok*
tochar*
tocharcodepoint*
tolower*
toupper*

Format String Syntax


The functions printf(), mbprintf(), sprintf(), mbsprintf(), fprintf() as well as Error(), Warn(), Info()
and Write() can all be used with 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
Where type is one of the following specifiers:

d or i For an integer.
e For a double. The printed format is [−]d.dddd e [sign]ddd where d is a single
decimal digit, dddd is one or more decimal digits, ddd is exactly three decimal
digits, and [sign] is + or −.
E Identical to type e except that the exponent is uppercase.
f For a double. The printed format is [−]dddd.dddd, where dddd is one or more
decimal digits. The number of digits before the decimal point depends on the
magnitude of the number, and the number of digits after the decimal point
depends on the requested precision.
F For a double. Prints a floating point value as a string of fixed width (width is
required). The place of the point is determined automatically so that always a
maximum precision is achieved.
g For a double. The printed type is e or f, whichever is more compact for the given
value and precision. The type e is used only when the exponent of the value is
less than −4 or greater than or equal to the precision argument. Trailing zeros
are truncated, and the decimal point appears only if one or more digits follow it.
G Identical to type g, except that the exponent E instead of e, is used (where
appropriate).
s For a string.
o For an object. Prints the class icon and loc name of a given object. The loc name
can be clicked to show the element dialog. The width of the icon and name can
be limited/extended to a fix number of characters (the icon needs 3 characters).
If the specified width is smaller than 3, the width is set to 3.
b For an object or a string. Prints the class icon of the given object or class name.

The optional flags can be of the following specifiers:

130
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

- Left align the result within the given field width.


+ Prefix the output value with a sign (+ or −).
0 Fill the left of the number with zero’s up to the given field width.

The optional width specifies the minimum number of characters to be printed.


The optional .precision specifies the number of decimals for all floating-point numbers.

E XAMPLE
double d;
int i;
string s;

d = 123456789.987654321;
i = 2468;
s = 'hello dpl';

printf('%f|%15.3f|%E|%.2e|%+f|', d, d, d, d, d);
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 \smarks{%s} ', s, 'is called', this:loc_name);
printf('%s (again)',s);

In addition to placeholders, the printed string may also contain “escape”-sequences for line
feeds, tabs, form feeds and colour. 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 colour change, where “x” is a colour, according to the following table, i.e.
\cf changes the colour to brown.

a black i gray
b black j light gray
c red k bordeaux
d green l dark red
e blue m dark green
f brown n light green
g cyan o marine
h magenta p dark blue

E XAMPLE
printf('The \cfbrown \cafox jumped \nover\tthe\nlazy\tcat.');
printf('result written to c:\\documents\\pf\\res.txt');
printf('%% = %%%6.2f%% %%', 123.34);

131
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

sprintf*
Returns a formatted string.
The DPL script stops with an appropriate error when the passed arguments don’t match the
format string.
string sprintf(string format,
[int|double|string|object argument0,]
[...])

A RGUMENTS
format C++-like printf() format string. See the Format String Syntax for more information.

argument... (optional)
Arguments matching the format string.

R ETURNS
The formated string.

D EPRECATED N AMES
ToStr

S EE ALSO

mbsprintf(), sscanf(), sscanfsep()

E XAMPLE
The following example writes a report to a file not using fprintf(). It redirects the text from the
Output Window to a file. The filename is formatted from a path and the name of the current
study case.
string lines; ! the lines of a report
object studycase;
! Redirect is an ComOp object inside this script
! StopRedirect is an ComCl object inside this script

studycase = GetActiveStudyCase();
Redirect:f = sprintf('%s%s.out', 'c:\\MyDocuments\\results1215\\',
studycase:loc_name);
Redirect.Execute();
Form.WriteOut(lines); ! write the report
StopRedirect.Execute(); ! stop redirection

sscanf*
Parses a string of values which are separated by space or tabulator according the given format.
Each parsed value is stored into the passed arguments. sscanfsep() supports other separators.
int sscanf(string source,
string format,
[int|double|string argument0,]
[...])

A RGUMENTS
source A formatted source string.

132
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

format C++-like printf() format string. See the Format String Syntax for more information.
Only int, double and string types are supported.

argument... (optional)
Arguments matching the format string.

R ETURNS
≥0 Number of values successfully parsed and stored.
−1 On error.

S EE ALSO

sscanfsep(), mbsscanf(), sprintf()

E XAMPLE
The following example assignes the first two fields of string sStr to the string sRes and the
double rVal:
int result;
double freq;
string unit;

result = sscanf('249.6 Hz', '%f %s', freq, unit);


printf('%f %s (result = %d)', freq, unit, result);

sscanfsep*
Parses a string of values which are separated by a separation character according the given
format. Each parsed value is stored into the passed arguments. Empty tokens are skipped by
default.
int sscanfsep(string input,
string format,
int|double|string argument0,
[... ,]
string separator,
[int skipEmptyToken = 1]
)

A RGUMENTS
input Input string containing separated values.
format C++-like printf() format string. See the Format String Syntax for more information.
Only int, double and string types are supported.
argument...
Arguments matching the format string.
separator Character that separates value in given input string.

skipEmptyToken (optional) 0 Empty tokens are not skipped.


1 Empty tokens are skipped (default).

R ETURNS
Number (≥ 0) of values successfully parsed and stored.

133
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

sscanf(), sprintf()

E XAMPLE
int result;
int i;
string s;

result = sscanfsep('Hello DPL;123', '%s%d', s, i, ';');

printf('result: %d', result);


printf('s: %s', s);
printf('i: %d', i);

!Output:
!result: 2
!s: Hello DPL
!i: 123

strchg*
Searches in the string ’str’ for the substring ’find’ and replaces it with the string ’new’.
int strchg(string& str,
string find,
string new)

A RGUMENTS
str (in, out)
String to be scanned and modified.
find Substring to be found.
new String to be inserted instead of ’find’.

R ETURNS
The first index (geq0) in ’str’ where ’find’ was found; -1 if substring was not found.

S EE ALSO

mbschg()

E XAMPLE
int ret;
string str, find, new;

str = 'This is just a test';


find = 'just a';
new = 'a very important';
ret = strchg(str,find,new);
if (ret = -1) { printf('String could not be found!');
}
else {
printf('%s',str);
}

134
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

strcmp*
Compares two strings case sensitive. Therefore:
int result;
result = strcmp('a' ,'A' ); ! result = 1
result = strcmp('A' ,'a' ); ! result = -1
result = strcmp('a' ,'a' ); ! result = 0

int strcmp(string str1,


string str2,
[int maxCount])

A RGUMENTS
str1 The first string.
str2 The second string.
maxCount (optional)
Maximal number of characters to compare.

S EE ALSO

mbscmp()

R ETURNS
<0 str1 is lexicographically less than str2.
=0 Strings are equal.
>0 str1 is lexicographically greater than str2.

strcpy*
Returns a copy of a substring.
string strcpy(string str,
int startIndex,
[int maxCount])

A RGUMENTS
str The string.
startIndex
The start index (≥ 0).

maxCount (optional)
Maximal number of characters to copy (> 0).

R ETURNS
The copied substring.

S EE ALSO

mbscpy()

135
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

E XAMPLE
string str1, str2;
str1 = 'The brown fox';
str2 = strcpy(str1, 4, 5); ! str2 now equals 'brown'

strlen*
Returns the length of a string.
int strlen(string str)

A RGUMENTS
str The string.

R ETURNS
Returns the number of single-byte characters of a string.

S EE ALSO

mbslen()

strstr*
Searches for a substring in a string and returns its position.
int strstr(string str,
string substr)

A RGUMENTS
str The string.
substr The substring.

R ETURNS
The index of the first character of the substring searched for or -1 when it was not found.

S EE ALSO

mbsstr()

E XAMPLE
The following example searches for string 'brown' in string str1
string str1, str2;
int i;
str1 = 'The brown fox';
i = strstr(str1, 'brown');
! i now equals 4

136
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

strtok*
Splits the string ’source’ into tokens separated by the characters defined in ’delimiters’ and
returns one of these. Empty tokens are skipped by default.
string strtok(string source,
string delimiters,
int& index,
[int tokenNumber = 1],
[int skipEmptyToken = 1])

A RGUMENTS
source Source string to be split.
delimiters String of delimiter characters used for the split.
index (out)
Outputs the index of the returned token in the source string (≥ 0).
number (optional)
Number (≥ 1) of the token to be read (default = 1).
skipEmptyToken (optional) 0 Empty tokens are not skipped.
1 Empty tokens are skipped (default).

R ETURNS
Token between separator (tokenNumber-1) and (tokenNumber) as a string. If nothing is read,
the token is empty and index is set to -1.

S EE ALSO

mbstok()

E XAMPLE
The following example searches for different tokens in str
string res, str, del;
int pos;
str = 'Das, ist nur, ein Test mit Nr. (555); weiter nichts';
del = ',;()';
res = strtok(str,del,pos);
printf('Token: %s pos = %d',res,pos);
res = strtok(str,del,pos,2);
printf('Token: %s pos = %d',res,pos);
res = strtok(str,del,pos,4);
printf('Token: %s pos = %d',res,pos);

tochar*
Converts the given codepoint (number) to the corresponding character.
string tochar(int codePoint)

A RGUMENTS
codePoint
Number between 0 and 255 which represents a sigle-byte character in the current
Windows ANSI code page.

137
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
A string of length 1 containing the character representation of the given codepoint in the cur-
rent Windows ANSI code page or an empty string if no single-byte character representation
exists.

S EE ALSO

tocharcodepoint(), tombchar()

tocharcodepoint*
Converts a character to its code point.
int tocharcodepoint(string str)

A RGUMENTS
str A string of length 1 containing the single-byte character.

R ETURNS
Number between 0 and 255 which represents the given character in the current Windows
ANSI code page or 0 if an error occurred.

S EE ALSO

tocharcodepoint(), tombchar()

tolower*
Creates a copy of a string, where all characters are converted to lowercase.
string tolower(string str)

R ETURNS
Copy of original string, but with all characters in lowercase.

S EE ALSO

toupper(), tombslower()

E XAMPLE
string src, scp;
src = 'This is just a test';
scp = tolower(src);
printf('%s', scp);

toupper*
Creates a copy of a string, where all characters are converted to uppercase.
string toupper(string str)

R ETURNS
Copy of original string, but with all characters in uppercase.

138
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

S EE ALSO

tolower(), tombsupper()

E XAMPLE
string src, scp;
src = 'This is just a test';
scp = toupper(src);
printf('%s', scp);

139
CHAPTER 3. OBJECT METHODS

3 Object Methods

3.1 General Methods


Overview

AddCopy
CopyData
CreateObject
Energize
GetChildren*
GetClassName*
GetCombinedProjectSource
GetConnectedElements*
GetConnectionCount*
GetContents*
GetControlledNode*
GetCubicle*
GetFullName*
GetImpedance*
GetInom*
GetNet
GetNode*
GetOperator*
GetOwner*
GetParent*
GetReferences*
GetRegion*
GetSize*
GetSupplyingSubstations*
GetSupplyingTransformers*
GetSupplyingTrfstations*
GetSystemGrounding*
GetUnom*
GetVal*
GetVarType*
GetZeroImpedance*
HasReferences*
HasResults*
IsCalcRelevant*
IsClass*
IsDeleted*
IsEarthed*
IsEnergized*
IsHidden*

140
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

IsInFeeder*
IsNetworkDataFolder*
IsNode*
IsObjectActive*
IsObjectModifiedByVariation*
Isolate
IsOutOfService*
IsReducible*
IsShortCircuited*
lnm*
MarkInGraphics
Move
PasteCopy
PurgeUnusedObjects
ReportUnusedObjects
SearchObject*
SetSize
SetVal
ShowEditDialog
ShowFullName*
ShowModalSelectTree
snm*
SwitchOff
SwitchOn
unm*
VarExists*

AddCopy
Adds a copy of a single object or a set of objects to this object (= target object).
When copying a single object it is possible to give the new name. The new name will be
concatenated by the given name parts. This is not possible for a project (IntPrj).
The target object must be able to receive a copy of the objects.
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.
When source object(s) and target object are inside different projects the method object.PasteCopy()
has to be used instead, since it adapts all references automatically.
object object.AddCopy(object objectToCopy,
[int|string partOfName0,]
[...])
object object.AddCopy(set objectsToCopy)

A RGUMENTS
objectToCopy
Object to copy.
objectNameParts (optional)
Parts of the name of the new copy which will be concatenated to the object name.
objectsToCopy
Set of objects to copy.

R ETURNS
Returns the copy that has been created on success or NULL, when copying a single object.

141
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

S EE ALSO

object.PasteCopy(), object.Move(), Delete()

E XAMPLE
The following example copies a given fuse to all calculation relevant cubicles:
set cubics;
object fuse, cubic, copy;
int n;

!get template fuse object


fuse = this.SearchObject('*.RelFuse');
if (.not. fuse) { !just create one, if not given
fuse = this.CreateObject('RelFuse', 'MyFuse');
}

n = 0;
cubics = GetCalcRelevantObjects('StaCubic');
for (cubic = cubics.First(); cubic; cubic = cubics.Next()) {
n += 1;
copy = cubic.AddCopy(fuse, 'Fuse Nr', n);
printf('Created new fuse %o', copy);
}

CopyData
Copies all parameters except for loc name and containers from one object to another.
void object.CopyData(object source)

A RGUMENTS
source Object from which parameters are to be copied

R ETURNS
0 ok
1 error

E XAMPLE
object source,
target;
int ret;

ret = target.CopyData(source);
if (ret=1) { ! error
exit();
}

142
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

CreateObject
Creates a new object of given class and name in the target object. The object name will be
concatenated by the given object name parts. The target object must be able to store an object
of the given class in its content otherwise the currently running script will stop with an error.
object object.CreateObject(string className,
[int|string objectNamePart0,]
[...]
)

A RGUMENTS
className
The class name of the object to create.
objectNameParts (optional)
Parts of the name of the object to create (without classname) which will be con-
catenated to the object name.

R ETURNS
object Newly created object.
NULL When no object was created.

E XAMPLE
The following example creates a fuse in a set of cubicles. The new fuses will be named
“Fuse0”, “Fuse1”, etc.
object target;
set cubs;
int n;
cubs = SEL.GetAll('StaCubic');
target = cubs.First();
n = 0;
while (target) {
target.CreateObject('RelFuse', 'Fuse', n);
target = cubs.Next();
n+=1;
}

Energize
Performs an “energize” action on the network element. This corresponds to removing earthings
from current region (if any) followed by a “switch on” action on the element.
The action is identical to that in the context menue.
int object.Energize([set& changedSwitches,]
[int resetRA])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set.
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.

143
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

1 All running arrangements that cause blocking of relevant switches are


applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail.

R ETURNS
Information about the success of the action:

0 Action was successful.


1 Action failed.

S EE ALSO

object.SwitchOn(), object.SwitchOff(), object.Isolate()

GetChildren*
This function returns the objects that are stored within the object the function was called on. In
contrast to object.GetContents() this function gives access to objects that are currently hidden
due to scheme management.
set object.GetChildren(int hiddenMode,
[string filter,]
[int subfolders])

A RGUMENTS
hiddenMode
Determines how hidden objects are handled.
0 Hidden objects are ignored. Only nonhidden objects are returned.
1 Hidden objects and nonhidden objects are returned.
2 Only hidden objects are returned. Nonhidden objects are ignored.
filter (optional)
Name filter, possibly containing '*' and '?' characters.
subfolder (optional)
Determines if children of subfolders are returned.
0 Only direct children are returned, children of subfolders are ignored
(Default).
1 Also children of subfolders are returned.

R ETURNS
Objects that are stored in the called object.

S EE ALSO

object.GetContents()

E XAMPLE
The following example lists all contained terminals for each substation:
object obj, substat;
set objs, substats;
!lists all contained terminals for each substation
substats = GetCalcRelevantObjects('*.ElmSubstat');

144
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

for (substat = substats.First(); substat; substat = substats.Next()) {


objs = substat.GetChilden(0, '*.');
printf('Terminals of substation %o', substat);
for (obj = objs.First(); obj; obj = objs.Next()) {
printf(' %o', obj);
}
}

GetClassName*
Returns the class name of the object.
string object.GetClassName()

R ETURNS
The class name of the object.

D EPRECATED N AMES
GetClass

GetCombinedProjectSource
For an object in a combined project return the intermediate folder where the object is contained,
indicating the original source project.
object object.GetCombinedProjectSource()

R ETURNS
The intermediate folder for that object or nothing when not applicable.

GetConnectedElements*
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 the case of open breakers and/or disconnectors. The default values are
(0,0,0).
set object.GetConnectedElements([int rBrk],
[int rDis],
[int rOut])

A RGUMENTS
rBrk (optional)
if 1, regards position of breakers
rDis (optional)
if 1, regards position of disconnectors
rOut (optional)
if 1, regards in-service or out-of-service status

R ETURNS
The set of connected elements.

145
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

D EPRECATED N AMES
GetConnectedElms

GetConnectionCount*
Returns the number of electrical connections.

A RGUMENTS
includeNeutral (optional)
1, also separate neutral conductor connections are taken into account.

int object.GetConnectionCount([int includeNeutral=0])

R ETURNS
The number of electrical connections.

E XAMPLE
int i, count;
object transformer,cubicle,bus;
set transformers;

! list all nodes to which a 3-winding transformer is connected


transformers = GetCalcRelevantObjects('*.ElmTr3');
for (transformer=transformers.First(); transformer; transformer=transformers.Next()) {
count = transformer.GetConnectionCount();
for (i=0; i<count; i=i+1) {
cubicle=transformer.GetCubicle(i);
if (cubicle) {
bus = cubicle:cBusBar;
if (bus) {
bus.ShowFullName();
}
}
}
}

GetContents*
Returns the objects that are stored in the object and whose name matches the argument name.
No object is returned if the object's container is empty, or if the object is not capable of storing
objects. The argument name may contain the complete name and classname, or parts of the
name with wildcard and class name.
set object.GetContents([string Name,]
[int recursive])

A RGUMENTS
Name (optional)
loc name.class name, name possibly contains wildcards: '*' and '?' characters
recursive (optional)
1 All contained objects will be added recursively.
0 (default) Only direct children of current object will be collected.

146
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
Objects that are stored in the object.

E XAMPLE
The following example collects all lines that are stored in network objects.
set grids, lines;
object line, grid;
grids = GetCalcRelevantObjects('*.ElmNet');
! get all grids
grid = grids.First();
while (grid) {
printf('Lines in Grid %o',grid);
! get all objects of class ElmLne
! in all grid and subfolders of grid
lines = grid.GetContents('*.ElmLne',1);
line = lines.First();
while (line) {
line.ShowFullName();
line = lines.Next();
}
grid = grids.Next();
}

GetControlledNode*
Returns the target terminal and the resulting target voltage for generators and other voltage
regulating units.
object object.GetControlledNode(int bus,
double& targetVoltage,
[int check])

A RGUMENTS
bus)
-1 currently controlled bus
0 HV bus
1 MV/ LV bus
2 LV bus
targetVoltage (out)
The target voltage of the voltage regulating unit in pu.
check (optional)
0 (default) Do not check if the control mode is set to voltage control.
1 Only return the controlled node if the control mode is set to voltage
control.

R ETURNS
Controlled node, NULL if no controlled terminal exists (or not voltage controlled if check=1)

147
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example writes the controlled nodes for all calculation relevant objects.
set objs;
object obj, node;
double vtarget;

objs = GetCalcRelevantObjects();

! list all regulating units

printf('V Regulating Unit: Controlled Node: Target Voltage:');


for (obj = objs.First(); obj; obj = objs.Next()) {
node = obj.GetControlledNode(-1, vtarget);
if (node) {
printf('%20s %20s %f', obj, node, vtarget);
}
}

GetCubicle*
Returns the cubicle of an object at the connection with index n, or NULL if there is no cubicle
inside the object.
object object.GetCubicle(int side)

A RGUMENTS
side The connection number.

R ETURNS
The cubicle object or NULL.

GetFullName*
Returns the full name of the object as a string.
string object.GetFullName([int type])

A RGUMENTS
type(optional)
Is used to determine the format of the returned full name:

not given
No special formatting.
=0
The full name (complete database path including the name and class name)
of the object. It becomes a clickable link if printed to the output window.
> 0 (but less or equal to 190)
Formatted exactly to this length and also clickable if printed to the output
window.

R ETURNS
The fullname (complete database path including the name and class name) of the object.

148
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

E XAMPLE
str = obj.GetFullName();
printf('%s', str);
! Output:
! \Support.IntUser\Example Hierarchy 6.IntPrj\Network Model.IntPrjfolder
! \Network Data.IntPrjfolder\Small Network.ElmNet \400 kV Drakelow\SGT3A.ElmTr3

str = obj.GetFullName(0);
printf('%s', str);
! Output:
! 'Network Model\Network Data\Small Network\400 kV Drakelow\SGT3A.ElmTr3'

str = obj.GetFullName(30);
printf('%s', str);
! Output:
! '400 kV Drakelow\SGT3A.ElmTr3'

GetImpedance*
Returns the positive sequence impedance of an element referred to a given voltage.
int object.GetImpedance(double& real,
double& imag,
double refVoltage,
[int i3Trf])

A RGUMENTS
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.
refVoltage
Reference voltage for the impedance in kV.
i3Trf (optional)
When used with an ElmTr3
0 Return the HV-MV impedance.
1 Return the HV-LV impedance.
2 Return the MV-LV impedance.

R ETURNS
1 An error occurred.
0 Otherwise.

S EE ALSO

object.GetZeroImpedance()

GetInom*
Returns the nominal current of the object at given bus index.
double object.GetInom([int busIndex = 0],
[int inclChar = 0])

149
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

A RGUMENTS
busIndex (optional)
Bus index, default value is 0.
inclChar (optional)
option to consider thermal rating objects and values modified by characteristics
on the (de-)rating factor.
0 Not considering thermal rating objects or values modified by charac-
teristics on the (de-)rating factor (default).
1 Considering thermal rating objects and values modified by character-
istics on the (de-)rating factor.
2 Considering thermal rating objects but not values modified by charac-
teristics on the (de-)rating factor.

R ETURNS
The nominal current at bus index.

D EPRECATED N AMES
Inom

S EE ALSO

object.GetUnom()

E XAMPLE
The following example shows the nominal voltages and currents on both sides of all trans-
formers.
set lines;
object obj;
double cur1, cur2;
double volt1, volt2;

lines = GetCalcRelevantObjects('*.ElmTr2');
for(obj=lines.First(); obj; obj=lines.Next()) {
volt1 = obj.GetUnom(0);
volt2 = obj.GetUnom(1);
cur1 = obj.GetInom(0);
cur2 = obj.GetInom(1);
printf('%o: Inom1 = %f, Inom2 = %f', obj, volt1, volt2);
printf('%o: Unom1 = %f, Unom2 = %f', obj, cur1, cur2);
}

GetNet
Returns the grid in which the object is located.
object object.GetNet()

R ETURNS
object The grid (ElmNet) where the object is stored in.
NULL If the current object is not stored in any grid.

150
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

GetNode*
Returns the node connected to the object at specified bus index.
object object.GetNode(int busIndex,
[int considerSwitches = 0])

A RGUMENTS
busIndex Bus index.
considerSwitches (optional)
0 Ignore the status of the switches (default).
1 Consider the status of the switches.

R ETURNS
object Connected node object at specified bus index.
NULL If no node at bus index is found.

GetOperator*
Returns the element’s operator (ElmOperator ).
object object.GetOperator()

R ETURNS
Object of class ElmOperator determined according to following rules

• If operator is set in current object instance (attribute “pOperator”) this operator object is
retured.
• Else the operator inherited from its parent is used (recursively applied).
• NULL if none if its parents have an operator set.

GetOwner*
Returns the elements’s owner (ElmOwner ).
object object.GetOwner()

R ETURNS
Object of class ElmOwner determined according to following rules

• If owner is set in current object instance (attribute “pOwner”) this owner object is retured.
• Else the owner inherited from its parent is used (recursively applied).
• NULL if none if its parents have an operator set.

GetParent*
Returns the parent folder object (same as parameter ’fold id’).
object object.GetParent()

151
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
object The parent folder object.
NULL On the root database folder e.g. parent of a user.

S EE ALSO

object.GetContents()

E XAMPLE
The following example returns the folder in which a line is stored.
set objects;
object line, folder;

objects = GetCalcRelevantObjects();
line = objects.Firstmatch('ElmLne');

folder = line.GetParent();
if (folder) {
folder.ShowFullName();
}

GetReferences*
Returns a set containing all objects with references to the object the method was called on. By
default, references from IntSubset objects or hidden objects are ignored.
set object.GetReferences([string filter = '*',]
[int includeSubsets = 0,]
[int includeHiddenObjects = 0])

A RGUMENTS
filter (optional)
Object filter to get only objects whose name matches this filter string, e.g. '*.ElmLne'.
(default: ’*’)
includeSubsets (optional)
Forces references from IntSubset objects to be evaluated. These are normally not
included for performance reasons. (default: 0)

includeHiddenObjects (optional)
Include also hidden objects. By default they are not included. In contrast hidden
objects are always included in the ’Reference List’ output of the data browser.
(default: 0)

R ETURNS
Set of objects with references to the object the method was called on.

E XAMPLE
The following example returns all relevant objects of class 'TypBar':
set objs, refs;
object obj1, obj2;

objs = GetCalcRelevantObjects('*.TypBar');!get all relevant objects of class TypBar

152
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

for (obj1 = objs.First(); obj1; obj1 = objs.Next() {


printf('Object referencing to %o', obj1);

refs = obj1.GetReferences();
for (obj2 = refs.First(); obj2; obj2 = refs.Next()) {
obj2.ShowFullName();
}
}

S EE ALSO

object.GetReferences()

GetRegion*
All network components are internally associated with an artificial region. A region consists of
topologically connected elements. This means, two elements elm1 and elm2 are topologically
connected ⇔ elm1.GetRegion() == elm2.GetRegion().
A region is simply identified by a number that can be access via this function.
int object.GetRegion()

E XAMPLE
The following example shows the region index for all calculation relevant network elements:
set elements;
object obj;
int region, t;
string clasz;

elements = GetCalcRelevantObjects();
for (obj = elements.First(); obj; obj = elements.Next()) {

clasz = obj.GetClass();
t = strcmp('Elm', clasz, 3);
if (t <> 0) {
continue; !only for network elements
}

region = obj.GetRegion();
if (region > -1) {
printf('Element %o belongs to region %d', obj, region);
}
else {
printf('Region for element %o is unknown', obj);
}
}

R ETURNS
Region index >0. A value of ‘-1’ means status is unknown for that element (normally for not
topology relevant elements).

153
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

GetSize*
Returns the size of the variable “VarName” when this variable is a vector or a matrix.
int object.GetSize(string VarName,
int& rows,
[int& cols])

A RGUMENTS
VarName The name of the variable.
rows (out)
The number of rows for a vector or matrix.
cols (optional, out)
The number of columns for a matrix.

R ETURNS
0 When “VarName” is a valid variable name.
1 Otherwise.

S EE ALSO

object.GetVal()

E XAMPLE
The following example prints the matrix resistances from a tower model with 2 circuits.
int err;
double x;
int r, rows, c, cols;
string str;
err = Tower.GetSize('R_c',rows, cols);
if (.not.err) {
r=0;
while (r<rows) {
str = '';
c = 0;
while (c<cols) {
err = Tower.GetVal(x, 'R_c', r,c);
if (.not.err) str = sprintf('%str %f', str, x); {
c+=1;
}
printf(str);
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

154
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

GetSupplyingSubstations*
Returns the closest supplying substation(s) for a network component.
“Closest” means that there is no other supplying element of same type in topological path
between network component and the supplying component(s) returned by this function.
set object.GetSupplyingSubstations()

R ETURNS
List of substations (objects of class ElmSubstat). Can be empty.

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmTr3.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(),


ElmTrfstat.GetSuppliedElements(), object.GetSupplyingTransformers(), object.GetSupplyingTrfstations()

GetSupplyingTransformers*
Returns the closest supplying transformer(s) for a network component. “Closest” means that
there is no other supplying element of same type in topological path between network compo-
nent and the supplying component(s) returned by this function.
set object.GetSupplyingTransformers()

R ETURNS
List of transformers (objects of class ElmTr2 or ElmTr3). Can be empty.

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmTr3.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(),


ElmTrfstat.GetSuppliedElements(), object.GetSupplyingSubstations(), object.GetSupplyingTrfstations()

GetSupplyingTrfstations*
Returns the closest supplying transformer station(s) for a network component.
“Closest” means that there is no other supplying element of same type in topological path
between network component and the supplying component(s) returned by this function.
set object.GetSupplyingTrfstations()

R ETURNS
List of transformer stations (objects of class ElmTrfstat). Can be empty.

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmTr3.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(),


ElmTrfstat.GetSuppliedElements(), object.GetSupplyingTransformers(), object.GetSupplyingSubstations()

GetSystemGrounding*
Returns the grounding type employed in the grounding area of the grid the object belongs to.
The grounding area is defined by network components separating the zero sequence system
(e.g. star-delta transformers).
int object.GetSystemGrounding()

155
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
-1 grounding type can not be determined
0 system is solidly grounded
1 system is compensated
2 system is isolated

D EPRECATED N AMES
GetSystemGround

GetUnom*
Returns the nominal voltage of the object.
double object.GetUnom([int busIndex = 0])

A RGUMENTS
busIndex (optional)
Bus index, default value is 0.

R ETURNS
The nominal voltage at bus index.

D EPRECATED N AMES
Unom

S EE ALSO

object.GetInom()

E XAMPLE
The following example collects all high voltage lines. The value VoltageLevel is an input
parameter. The script also needs a general selection defined.
set lines, highvoltages;
object obj;
double voltage;

highvoltages.Clear();

lines = SEL.AllLines();
obj = lines.First();
while (obj) {
voltage = obj.GetUnom();
if (voltage>VoltageLevel) {
highvoltages.Add(obj);
}
obj = lines.Next();
}

for(obj=highvoltages.First(); obj; obj=highvoltages.Next()) {


obj.ShowFullName();
}

156
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

GetVal*
Returns the value of the given variable in the currently set unit (unit could differ from ob-
ject.SetVal()). The row or column can be given for vector or matrix variables.
int object.GetVal(int& | double& | string& | object& | set& value,
string variable,
[int row,]
[int col,]
[string key])

A RGUMENTS
value (out)
Outputs the value of the variable. The value is always in the currently set unit of
the variable (as seen in the edit dialog).
variable Name of the variable to get the value for.
row (optional)
Row number for a vector or matrix variable (≥ 0). For negative numbers 0 is used.
col (optional)
Column number for a matrix variable (≥ 0). For negative numbers 0 is used.
key (optional)
The key parameter is used to get the real, imaginary part, angle, magnitude of a
complex parameter (and complex vector, matrix), or for a double vector parameter
to get statistic values like min, max, average, sum, ...
’r’,’i’,’mag’,’phi’,’phirad’ real part, imaginary part, magnitude, angle in degree,
angle in radians
’min’,’max’,’sum’,’avg’,’std’,’varia’ minimum, maximum, sum, avarage, stan-
dard deviation, variance...

R ETURNS
0 Value successfully obtained.
1 On error e.g. variable does not exist or row/column number is out of range.

S EE ALSO

object.SetVal()

GetVarType*
Outputs the data type of an attribute of the object.
int object.GetVarType(string name,
string& type)

A RGUMENTS
name Name of the attribute to get the type for.
type (out) Outputs the data type of the attribute as string, if it exists.

R ETURNS
0 Variable exists.
1 On error.

157
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

E XAMPLE
set terminals;
object terminal;
string attribute, type;

!get one of the calc relevant terminals


terminals = GetCalcRelevantObjects('ElmTerm');
terminal = terminals.First();

attribute = 'loc_name';
terminal.GetVarType(attribute, type);
printf('Data type of attribute "%s" is "%s"', attribute, type);

attribute = 'uknom';
terminal.GetVarType(attribute, type);
printf('Data type of attribute "%s" is "%s"', attribute, type);

GetZeroImpedance*
Returns the zero sequence impedance of an element referred to a given voltage.
int object.GetZeroImpedance(double& real,
double& imag,
double refVoltage,
[int i3Trf])

A RGUMENTS
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.
refVoltage
Reference voltage for the impedance in kV.
i3Trf (optional)
When used with an ElmTr3
0 Return the HV-MV impedance.
1 Return the HV-LV impedance.
2 Return the MV-LV impedance.

R ETURNS
1 An error occurred.
0 Otherwise.

S EE ALSO

object.GetImpedance()

HasReferences*
Find out whether there are objects with references to the object the method was called on.
int object.HasReferences()

158
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 There are no such objects
1 There is one or more such objects

S EE ALSO

object.GetReferences()

HasResults*
Checks if the object has calculated result parameters.
int object.HasResults([int ibus])

A RGUMENTS
ibus (optional)
Bus index
-1(default) Checks if “c:” quantities exist
>= 0 Checks if 'm:xxxx:bus ' quantities exist for bus index=ibus
2 Hidden objects are returned

R ETURNS
0 no results available
1 results exist

E XAMPLE
The following example checks if lines have results.
set lines;
object line;
int iret;

lines = GetCalcRelevantObjects('*.ElmLne');
for(line = lines.First(); line; line = lines.Next()) {
iret = line.HasResults();
if (iret) {
printf('Line %o has results', line);
}
else {
printf('Line %o DOES NOT have results', line);
}
}

IsCalcRelevant*
Returns whether the object is relevant for calculation.
In contrast to GetCalcRelevantObjects() it also returns 1 for objects in the active study case e.g.
simulation events (Evt*).
int object.IsCalcRelevant()

159
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 When the object is not used for calculations.
1 When the object is currently used for calculations.

D EPRECATED N AMES
IsRelevant

S EE ALSO

GetCalcRelevantObjects()

E XAMPLE
The following example checks if a line is used in the calculation.
int isCalcRelevant;
isCalcRelevant = MyLine.IsCalcRelevant();
if (isCalcRelevant) {
MyLine.ShowFullName();
}

IsClass*
Returns whether the object is of a certain class.
int object.IsClass(string className)

A RGUMENTS
className
The name of the class.

R ETURNS
1 Object is of the given class.
0 Object is not of the given class.

S EE ALSO

object.GetClassName()

E XAMPLE
The following example write all overloaded lines and transformers to the output window,
where a different maximum loading is used for lines or transformers.
set objects;
object obj;
int result;
objects = GetCalcRelevantObjects();
obj = objects.First();
while (obj) {
result = obj.IsClass('ElmLne');
if (result) {
if (obj:c:loading > 0.85) {
obj.ShowFullName();
}
}
else {
result = obj.IsClass('ElmTr2');

160
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

if (result) {
if (obj:c:loading > 0.95) {
obj.ShowFullName();
}
}
}
obj = objects.Next();
}

IsDeleted*
Returns 1 if the object is deleted.
int object.IsDeleted()

R ETURNS
1 Object is already deleted.
0 Object is not deleted.

IsEarthed*
Checks if a network component is topologically connected to any earthed component. Earthing
components are terminals / busbars (ElmTerm) with attribute ‘iEarth’ = 1 and all closed ground-
ing switches (ElmGndswt). An energized component is never considered to be earthed.
int object.IsEarthed()

R ETURNS
1 Component is earthed (connected to an earthing component)
0 Component is not earthed

E XAMPLE
The following example shows the earthed elements:
set elements;
object obj;
int status, t;
string clasz;

elements = GetCalcRelevantObjects();
for (obj = elements.First(); obj; obj = elements.Next()) {
clasz = obj.GetClass();
t = strcmp('Elm', clasz, 3);
if (t <> 0) {
continue; !only for network elements
}
status = obj.IsEarthed();
if (status = 0) {
printf('Component %o is not earthed.', obj);
}
else if (status > 0) {
printf('Component %o is earthed.', obj);
}
}

161
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

IsEnergized*
Checks if a network component is energized. A component is considered to be energized, if it is
topologically connected to a generator. All other elements are considered to be deenergized.
int object.IsEnergized()

R ETURNS
1 Component is energized
0 Component is deenergized
-1 Component has no energizing status (status unknown)

E XAMPLE
The following example shows the energizing status of all elements:
set elements;
object obj;
int status, t;
string clasz;

elements = GetCalcRelevantObjects();

for (obj = elements.First(); obj; obj = elements.Next()) {


clasz = obj.GetClass();
t = strcmp('Elm', clasz, 3);
if (t <> 0) {
continue; !only for network elements
}

status = obj.IsEnergized();
if (status = 0) {
printf('Component %o is de-energized.', obj);
}
else if (status > 0) {
printf('Component %o is energized.', obj);
}
else if (status < 0) {
printf('Energizing status for %o is unknown.', obj);
}
}

IsHidden*
Checks whether an object is hidden with respect to currently activated variation. An object is
hidden if it is

• deleted in currently active variation or


• added in a variation that is currently not active

int object.IsHidden()

R ETURNS
0 not hidden, currently ’active’
1 hidden, currently ’inactive’

162
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

IsInFeeder*
Checks if the object is part of the given feeder. A network element is considered being part of a
feeder if a topological path from the feeder definition to the element exists.
This function is based on load flow calculation results. Therefore, it can only be used after such
a calculation has been successfully executed and as long as the results are available.
int object.IsInFeeder(object Feeder,
[int OptNested=0])

A RGUMENTS
Feeder The Feeder definition object ElmFeeder

OptNested (optional
0 Nested feeders are not considered.
1 Nested feeders are considered.

R ETURNS
1 If “Feeder” is a feeder definition and the object is part of that feeder.
0 Otherwise

S EE ALSO

ElmFeeder.GetAll()

IsNetworkDataFolder*
Checks whether given object is a special folder within a project that stores specific data ele-
ments. Each project can not have more than one instance per folder type.
The following folder types are distinguished (PowerFactory class names):

IntArea stores ElmArea objects


IntBbone stores ElmBbone and SetBbone objects

IntBmu stores ElmBmu objects


IntBoundary stores ElmBoundary objects
IntCircuit stores ElmCircuit objects

IntFeeder stores ElmFeeder objects


IntMeteostat stores ElmMeteostat objects
IntOperator stores ElmOperator objects
IntOwner stores ElmOwner objects

IntPath stores SetPath objects


IntRoute stores ElmRoute objects
IntScales stores Tri* objects

int object.IsNetworkDataFolder()

163
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 false, object is not a network data folder
1 true, object is a network data folder

S EE ALSO

GetDataFolder()

IsNode*
Indicates wtheter an object is a node (terminal or busbar).
int object.IsNode()

R ETURNS
1 Object is a node.
0 Otherwise.

IsObjectActive*
Check if an object is active for specific time.
int object.IsObjectActive(int time)

A RGUMENTS
time Time in seconds since 01.01.1970 00:00:00.

R ETURNS
0 Object is not active (hidden or deleted).
1 Object is active.

IsObjectModifiedByVariation*
Check if an object is active for specific time.
int object.IsObjectModifiedByVariation(int considerADD, int considerDEL, int considerDELTA)

A RGUMENTS
considerADD
checks if an ADD-object exists
0 ignore ADD-objects
1 consider ADD-objects
considerDEL
check if a DELETE-Object exists or exist for the parent objects
0 ignore DELETE-objects
1 consider DELETE-objects
considerDELTA
check if a DELTA-Object exists
0 ignore DELTA-objects
1 consider DELTA-objects

164
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Object is not modified by an active variation
1 Object is modified by an active variation

Isolate
Performs an “isolate” action on the network element. This corresponds to performing a “switch
off” action followed by an additional earthing of switched off region.
The action is identical to that in the context menue.
int object.Isolate([set& changedSwitches,]
[int resetRA,]
[int isolateCBs])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail
isolateCBs (optional)
Determines if, in addition, circuit breakers should be isolated by opening its adja-
cent disconnectors (if not given, default will be taken from project settings)
0 No additional opening of disconnectors
1 Also open disconnectors adjacent to switched circuit breakers)

R ETURNS
Information about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

object.SwitchOn(), object.SwitchOff(), object.Energize()

IsOutOfService*
Indicates whether or not the object is currently out of service.
int object.IsOutOfService()

R ETURNS
0 When the object is in service.
1 When the object is out of service.

165
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example checks if a line is out of service.
int i;
i = MyLine.IsOutOfService();
if (i) {
MyLine.ShowFullName();
}

IsReducible*
Checks if object can be reduced during network reduction.
int object.IsReducible()

R ETURNS
0 object can never be reduced.
1 object can be reduced (e.g. switch, zero-length lines)
2 in principle the object can be reduced, but not now (e.g. switch that is set to be
detailed)

E XAMPLE
The following example checks if an object is reducible:
set objs;
object obj;
int res;

objs = GetCalcRelevantObjects();
for (obj = objs.First(); obj; obj = objs.Next()) {
res = obj.IsReducible();
if (res = 0) {
printf('Object %o is not reducible.', obj);
continue;
}
if (res = 1){
printf('Object %o is reducible.', obj);
continue;
}
if (res = 2) {
printf('Object %o is currently not reducible.', obj);
continue;
}
}

IsShortCircuited*
Returns whether an element is short-circuited or not.
int object.IsShortCircuited()

166
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 No short-circuit found.
1 Element is short-circuited.

lnm*
Returns the long description of the variable.
string object.lnm(string VarName
[int& error])

A RGUMENTS
VarName The variable name.
error (optional, out)
1 on error, otherwise 0.

R ETURNS
The long variable description.

S EE ALSO

object.snm(), object.unm()

E XAMPLE
The following example prints information about the length of a line.
set lines;
object line;
string s1,s2,s3;

lines = GetCalcRelevantObjects('*.ElmLne');
for(line = lines.First(); line; line = lines.Next()) {
s1 = line.lnm('dline');
s2 = line.snm('dline');
s3 = line.unm('dline');
printf('%s (%s) = %5.3f [%s]',s1, s2, line:dline, s3);
}

Example output:
Length of Line (Length) = 0.547 [km]

MarkInGraphics
This function is not supported in GUI-less mode.

Marks the object in the diagram in which the element is found by hatch crossing it. By default
all the currently opened diagrams are searched for the element to mark beginning with the
diagram shown. The first diagram in which the element is found will be opened and the element
is marked.
Alternatively the search can be extended to all existing diagrams by passing 1 as parameter. If
the element exists in more than one diagram the user can select from a list of diagrams which
diagram shall be opened.
void object.MarkInGraphics([int searchAllDiagramsAndSelect = 0])

167
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

A RGUMENTS
searchAllDiagramsAndSelect (optional)
Search can be extended to all diagrams, not only the ones which are currently
shown on the desktop.
0 Only search in currently opened diagrams and open the first diagram
in which the element was found. (default)
1 Searching all diagrams, not only the ones which are currently shown
on the desktop. If there is more than one occurrence the user will be
prompted which diagrams shall be opened.

R ETURNS
A diagram in which the element is drawn is opened and the element is marked.

E XAMPLE
The following example will a line in the currently visible diagram or if not found in one of the
other diagrams which are currently opened .
set lines;
object line;
lines = GetCalcRelevantObjects('*.ElmLne');
line = lines.First();
if (line) {
line.MarkInGraphics();
}

Move
Moves an object or a set of objects to this folder.
int object.Move(object objectToMove)
int object.Move(set objectsToMove)

A RGUMENTS
objectToMove
Object to move.
objectToMove
Set of objects to move.

R ETURNS
0 On success.
1 On error.

S EE ALSO

object.AddCopy(), object.PasteCopy(), Delete()

E XAMPLE
object targetobj,startobj;
set allObjs;
! move startobj to targetobj
targetobj.Move(startobj);
! move all objects inside allObjs to targetobj
targetobj.Move(allObjs);

168
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

PasteCopy
Pastes a copy of a single object or a set of objects to this object (= target object) using the
merge tool if source object(s) and target object are inside different projects (equivalent to a
manual copy&paste operation).
If the argument ‘resetMissingReferences’ is not given, a dialog on assignment conflicts will pop
up, which offers to reset all missing references, to show the merge tool or to cancel the action.
int object.PasteCopy(object objectToCopy,
[object& newObject],
[int resetMissingReferences])
int object.PasteCopy(set objectsToCopy)

A RGUMENTS
objectToCopy
Object to be copied.
objectsToCopy
Set of objects to copy.
newObject (optional, out)
The new object copy of objectToCopy is assigned on success.
resetMissingReferences (optional)
If set, determines how to handle missing references.
0 No action is taken, the operation is cancelled with an error.
1 Missing references are automatically reset.

R ETURNS
0 Object(s) successfully copied.
1 Error.

S EE ALSO

object.AddCopy(), object.Move(), Delete()

PurgeUnusedObjects
The function deletes the following child objects:

1. All 'hidden' objects without corresponding ”Add” object. These objects are only deleted, if
the condition is fulfilled for all child objects (hidden without corresponding 'Add' object).

2. All internal expansion stage objects with invalid target object (target object reference is
missing).

It’s crucial that there is no study case active when executing the function.
void object.PurgeUnusedObjects()

169
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

S EE ALSO

object.ReportUnusedObjects()

ReportUnusedObjects
Prints a report in the PowerFactory output window, which object will be deleted when function
object.PurgeUnusedObjects() is called. It’s crucial that there is no study case active when
executing the function.
void ReportUnusedObjects()

S EE ALSO

object.PurgeUnusedObjects()

SearchObject*
Searches for an object with a full name, such as
'rootfolder.class\subfolder.class\...\locname.class '.
object object.SearchObject(string name)

A RGUMENTS
name string to search

R ETURNS
Returns the searched object.

E XAMPLE
The following example searches for a terminal in the Network Model folder.
object obj, folder;

folder = GetProjectFolder('netmod');
if (folder) {
obj = folder.SearchObject('Network Data.IntPrjfolder\Nine_Bus.ElmNet\Bus1.ElmTerm');
if (obj) {
obj.ShowFullName();
}
}

S EE ALSO

object.GetFullName()

SetSize
Sets the size of the variable 'VarName' for an object if this variable is a vector or matrix.
int object.SetSize(string VarName,
int rows,
[int cols])

170
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

A RGUMENTS
VarName Object variable
rows Row of the variable’s matrix or vector
cols (optional)
Column of the variable’s matrix or vector

R ETURNS
0 'VarName' is a valid variable name
1 Variable not found or variable is not a matrix or vector

S EE ALSO

object.SetVal()

E XAMPLE
The following example will set the size of the row and column to 5:
object typSym;
int res1,res2;

typSym.GetSize('satv',oldsize);
printf('Old size of vector: %d',oldsize);

res1 = typSym.SetSize('satv',5);
res2 = typSym.SetSize('satse',5);

if (res1=1.or.res2=1) {
printf('Error - parameter setse or setv no vector or matrix');
exit();
}

typSym.GetSize('satv',size);
printf('New size of vector: %d',size);

SetVal
Sets the value of the given variable in the default unit (unit could differ from object.GetVal()).
The row or column can be given for vector or matrix variables.
int object.SetVal(int|double|string|object|set value,
string variable,
[int row],
[int col])

A RGUMENTS
value (out)
Value to set to. Have to be given in the default unit and could differ from the
currently set unit.
variable Name of the variable to set the value for.
row (optional)
Row number for a vector or matrix variable (≥ 0). For negative numbers 0 is used.
col (optional)
Column number for a matrix variable (≥ 0). For negative numbers 0 is used.

171
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Value successfully set.
1 On error e.g. variable does not exist or row/column number is out of range.

S EE ALSO

object.GetVal()

E XAMPLE
The following example sets the size of the row and column to 5:
object typSym;
int row, size;
double val;

typSym.GetSize('satv',size);

val = 0;
row = 0;
while (row<size) {
typSym.SetVal(val,'satv',row);
typSym.SetVal(0,'satse',row);

val += 0.1;
row += 1;
}

ShowEditDialog
This function is not supported in GUI-less mode.

Opens the edit dialogue of the object. Command objects (such as ComLdf ) will have their
“Execute” button disabled. The execution of the running script will be halted until the edit
dialogue is closed again.
Editing of command objects (ComDPL, ComPython) is not supported.
int object.ShowEditDialog()

R ETURNS
1 Edit dialogue was cancelled by the user.
0 Otherwise.

D EPRECATED N AMES
Edit

E XAMPLE
The following example opens a line dialogue, prior to calculating a load flow.
MyLine.ShowEditDialog();
Ldf.Execute();

172
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

ShowFullName*
Prints the full name (complete database path including the name and class name) of the object
as clickable link to the output window. This is useful to inspect or edit the printed object after the
script has finished.
void object.ShowFullName()

S EE ALSO

object.GetFullName()

E XAMPLE
The following example writes all overloaded lines from the selection to the output window.
set lines;
object line;
lines = SEL.AllLines();
line = lines.First();
while (line) {
if (line:c:loading > 100.0) {
line.ShowFullName();
}
line = lines.Next();
}

ShowModalSelectTree
This function is not supported in GUI-less mode.

Shows a modal window with the database object tree of the object on which the function is
called on.
object object.ShowModalSelectTree([string title,]
[string filter])

A RGUMENTS
title (optional)
Title of the dialog. If omitted, a default title will be used.
filter (optional)
Classname filter e.g. 'ElmLne' or 'Com*'. If set, a selection is only accepted if the
classname of the selected object matches that filter.

R ETURNS
object Selected object.
NULL No object selcted e.g. 'Cancel' clicked.

snm*
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.
string object.snm(string VarName
[int& error])

173
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

A RGUMENTS
VarName The variable name
error (optional, out)
1 on error, otherwise 0.

R ETURNS
The short name.

S EE ALSO

object.lnm(), object.unm()

SwitchOff
Performs a “switch off” action on the network element. This action is identical to that in the
context menue.
int object.SwitchOff([set& changedSwitches,]
[int resetRA,]
[int simulateOnly])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail
simulateOnly (optional)
Can be used to get the switches that would be changed. No switching is performed
if set to ‘1’. (default is ’0’)

R ETURNS
Information about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

object.SwitchOn(), object.Isolate(), object.Energize()

SwitchOn
Performs a “switch on” action on the network element. This action is identical to that in the
context menue.
int object.SwitchOn([set& changedSwitches,]
[int resetRA,]
[int simulateOnly])

174
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail
simulateOnly (optional)
Can be used to get the switches that would be changed. No switching is performed
if set to ‘1’. (default is ’0’)

R ETURNS
Iinformation about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

object.SwitchOff(), object.Isolate(), object.Energize()

unm*
Returns the unit of the variable.
string object.unm(string VarName,
[int& error])

A RGUMENTS
VarName The variable name
error (optional, out)
1 on error, otherwise 0.

R ETURNS
The unit name.

S EE ALSO

object.lnm(), object.snm()

VarExists*
Checks whether the variable exists and whether it is currently valid on this object.
int object.VarExists(string name)

A RGUMENTS
name Name of the variable.

175
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
1 Variable exists and is currently valid on this object.
0 Variable does not exist e.g. variable never exists or variable currently not exists
since the load flow is not calculated.

E XAMPLE
The following example calculates the total length of cables and lines.
int exists, unitFound;
double totalLength;
string unit;
object obj;
set objects;

objects = GetCalcRelevantObjects();
obj = objects.First();

while (obj) {
exists = obj.VarExists('dline');
if (exists) {
totalLength += obj:dline;

unitFound = strlen(unit);
if (unitFound = 0) {
unit = obj.unm('dline');
}
}
obj = objects.Next();
}

printf('Total length = %f %s', totalLength, unit);

3.2 Network Elements

3.2.1 ElmArea
Overview

CalculateInterchangeTo*
CalculateVoltageLevel*
CalculateVoltInterVolt*
DefineBoundary
GetAll*
GetBranches*
GetBuses*
GetObjs*

176
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalculateInterchangeTo*
Calculates interchange power to the given area (calculated quantities are: Pinter, Qinter, Pex-
port, Qexport, Pimort, Qimport). Prior the calculation the valid load flow calculation is required.
int ElmArea.CalculateInterchangeTo(object area)

A RGUMENTS
area Area to which the interchange is calculated

R ETURNS
<0 Calculation error (i.e. no valid load flow, empty area...)
0 No interchange power to the given area
1 Interchange power calculated

E XAMPLE
object AreaA, AreaB; ! externally defined (i.e. input)
AreaA = inputA;
AreaB = inputB;
object Ldf = GetFromStudyCase('ComLdf');
Ldf.Execute();
AreaA.CalculateInterchangeTo(AreaB);
printf('Interchange Pinter from %o to %o is %f MW', AreaA, AreaB, AreaA:c:Pinter);

CalculateVoltageLevel*
Internal funciton to calculate per voltage level the corresponding summary results. The values
are stored in current area (values from the previous load flow calculation are overwritten):
int ElmArea.CalculateVoltageLevel(double U)

A RGUMENTS
U for voltage level (in kV)

R ETURNS
<0 error
=0 voltage level not exists in the area
>0 ok

CalculateVoltInterVolt*
This function calculates the power flow from voltage level to voltage level. The values are stored
in current area in the following attributes (values from the previous load flow calculation are
overwritten):

- Pinter: Active Power Flow


- Qinter: Reactive Power Flow
- ExportP: Export Active Power Flow
- ExportQ: Export Reactive Power Flow

177
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

- ImportP: Import Active Power Flow

- ImportQ: Import Reactive Power Flow

int ElmArea.CalculateVoltInterVolt(double Ufrom, double Uto)

A RGUMENTS
Ufrom from voltage level (in kV)
Uto to voltage level (in kV)

R ETURNS
<0 error
=0 voltage levels not exists in the area, no interchange exists
>0 ok

DefineBoundary
Defines boundary with this area as interior part. Resulting cubicles of boundary are busbar-
oriented towards the area.
object ElmArea.DefineBoundary(int shift)

A RGUMENTS
shift Elements outside the area that are within a distance of shift many elements to
a boundary cubicle of the area are added to the interior part of the resulting
boundary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

E XAMPLE
external object: "thisArea"
double shift;
object newBoundary;
shift = 2;
newBoundary = thisArea.DefineBoundary(shift);
if ({newBoundary <> NULL}) {
printf('Defined boundary %o by shifting %d elements!', newBoundary, shift);
}

GetAll*
Returns all objects which belong to this area.
set ElmArea.GetAll()

R ETURNS
The set of contained objects.

178
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set all,areas;
object prj,area,obj;
! output elements in the area
prj = GetActiveProject();
if (prj) {
areas = prj.GetContents('*.ElmArea',1);
areas.SortToVar(0,'loc_name');
for (area=areas.First(); area; area=areas.Next()) {
printf('Elements in area %s',area:loc_name);
all = area.GetAll();
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetBranches*
Returns all branches which belong to this area.
set ElmArea.GetBranches()

R ETURNS
The set of branch objects.

E XAMPLE
set all,areas;
object prj,area,obj;
! output elements in the area
prj = GetActiveProject();
if (prj) {
areas = prj.GetContents('*.ElmArea',1);
areas.SortToVar(0,'loc_name');
for (area=areas.First(); area; area=areas.Next()) {
printf('Branches in area %s',area:loc_name);
all = area.GetBranches();
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetBuses*
Returns all buses which belong to this area.
set ElmArea.GetBuses()

R ETURNS
The set of objects.

179
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetObjs*
Returns all objects of the given class which belong to this area.
set ElmArea.GetObjs(string classname)

A RGUMENTS
classname
Name of the class (i.e. ”ElmTr2”).

R ETURNS
The set of objects.

E XAMPLE
set all,areas;
object prj,area,obj;
! output cubicles in the area
prj = GetActiveProject();
if (prj) {
areas = prj.GetContents('*.ElmArea',1);
areas.SortToVar(0,'loc_name');
for (area=areas.First(); area; area=areas.Next()) {
printf('Cubicles in area %s',area:loc_name);
all = area.GetObjs('StaCubic');
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

3.2.2 ElmAsm
Overview

CalcEfficiency
GetAvailableGenPower*
GetElecTorque*
GetGroundingImpedance*
GetMechTorque*
GetMotorStartingFlag*
GetStepupTransformer*
IsPQ*

180
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalcEfficiency
Calculate efficiency for connected storage model at given active power value.
double ElmAsm.CalcEfficiency(double activePowerMW)

A RGUMENTS
activePowerMW
Active power value to calculate efficiency for.

R ETURNS
Returns the resulting efficiency in p.u.

E XAMPLE
set objs;
object obj;
int err;
double eff, Ptherm, Pelect;

Pelect = 30.0;
objs = GetCalcRelevantObjects('*.ElmAsm');

obj = objs.First();
if (obj) {
eff = obj.CalcEfficiency(Pelect);
Ptherm = Pelect/eff;
}

GetAvailableGenPower*
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the
average of the power values (in MW) obtained from all the specified time characteristics
for the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.

181
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

double ElmAsm.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

generators = GetCalcRelevantObjects('*.ElmAsm');

totalpower = 0; ! initialize cummulative generation

! get cummulative generation


for (generator = generators.First(); generator; generator = generators.Next()) {
power = generator.GetAvailableGenPower();
totalpower += power;
}
printf('Cummulative generation is %f', totalpower);

GetElecTorque*
Calculates the electrical torque for a given speed and voltage.
double ElmAsm.GetElecTorque(double speed,
double uReal,
[double addZReal,]
[double addZImag]
)

A RGUMENTS
speed speed value in p.u.
uReal voltage value (real part) in p.u.
addZReal (optional)
additional impedance (real part) in p.u.
addZImag (optional)
additional impedance (imaginary part) in p.u.

R ETURNS
Returns the calculated electrical torque.

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmAsm.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

182
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetMechTorque*
Calculates the electrical torque for a given speed and voltage.
double ElmAsm.GetMechTorque(double speed,
double uReal
)

A RGUMENTS
speed speed value in p.u.
uReal voltage value (real part) in p.u.

R ETURNS
Returns the calculated mechanical torque.

GetMotorStartingFlag*
Returns the starting motor condition.
int ElmAsm.GetMotorStartingFlag()

R ETURNS
Returns the motor starting condition. Possible values are:

-1 in the process of being calculated


0 not calculated
1 successful start
2 unsuccessful start

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the asynchronous machine.
object ElmAsm.GetStepupTransformer(double hvVoltage,
int ignSwtStatus
)

183
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
hvVoltage
voltage level at which the search will stop
ignSwtStatus
consideration of switch status. Possible values are:

0 consider all switch status


1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

IsPQ*
Informs whether or not it is a ”PQ” machine (constant Q control mode).
int ElmAsm.IsPQ()

R ETURNS
Returns 1 if it is a ”PQ” machine.

3.2.3 ElmAsmsc
Overview

GetAvailableGenPower*
GetGroundingImpedance*
GetStepupTransformer*

GetAvailableGenPower*
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the
average of the power values (in MW) obtained from all the specified time characteristics
for the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.

184
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


double ElmAsmsc.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

generators = GetCalcRelevantObjects('*.ElmAsmsc');

totalpower = 0; ! initialize cummulative generation

! get cummulative generation


for (generator = generators.First(); generator; generator = generators.Next()) {
power = generator.GetAvailableGenPower();
totalpower += power;
}
printf('Cummulative generation is %f', totalpower);

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmAsmsc.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

185
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the asynchronous machine.
object ElmAsmsc.GetStepupTransformer(double hvVoltage,
int ignSwtStatus
)

A RGUMENTS
hvVoltage
voltage level at which the search will stop
ignSwtStatus
consideration of switch status. Possible values are:

0 consider all switch status


1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

3.2.4 ElmBbone
Overview

CheckBbPath*
GetBbOrder*
GetCompleteBbPath*
GetFOR
GetMeanCs*
GetMinCs*
GetTieOpenPoint*
GetTotLength*
HasGnrlMod*

CheckBbPath*
Check whether the backbone object is still valid. This means:

a Terminals determining backbone path are still directly connected.


b One switch is open on the path of an inter-feeder backbone.
c Contents of backbone match specified starting-feeder (and end feeder).
d Start and end of feeder are calculation-relevant.
e Path is unique via the defined terminals (no parallel elements (only warning!)).
int ElmBbone.CheckBbPath(int outputMsg)

A RGUMENTS
outputMsg
1 Output resulting messages of check function.
0 Only check, no output of messages.

186
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Backbone is valid.
1 Backbone is invalid because of one or more of the above listed reasons.

E XAMPLE
The following example checks whether all calculated backbones are still valid.
object oBbone;
object folder;
set elementBbones;
int valid;

folder = GetDataFolder('IntBbone');
elementBbones = folder.GetContents('*.ElmBbone');

for ( oBbone = elementBbones.First(); oBbone; oBbone = elementBbones.Next() ) {


valid = oBbone.CheckBbPath(0);
if (valid=0) {
printf('Backbone %o is valid.', oBbone);
}
}

GetBbOrder*
Get order of backbone object, determined by backbone calculation according to the selected
criterion.
int ElmBbone.GetBbOrder()

R ETURNS
The order of the backbone object. The smaller the returned value, the better the backbone
according to chosen criterion. The order 1 is returned for the best backbone.

E XAMPLE
This example calculates backbones aretrieves all calculated backbones
int order;
object backboneCmd;
object backbone;
object folder;
set allBackbones;

backboneCmd = GetFromStudyCase('ComBbone');
if ( backboneCmd<>nullptr ) {
backboneCmd:e:iFeedSettng = 0; ! for all feeders
backboneCmd:e:iCalcMeth = 1; ! Criterion is cross section
backboneCmd.Execute();

folder = GetDataFolder('IntBbone');
allBackbones = folder.GetContents('*.ElmBbone');

for ( backbone=allBackbones.First(); backbone; backbone=allBackbones.Next() ) {


order = backbone.GetBbOrder();
printf('Backbone %o has order %d', backbone, order);
}
}

187
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetCompleteBbPath*
Get the complete (ordered) path containing all terminals and connecting elements of the back-
bone.
void ElmBbone.GetCompleteBbPath(set& AllElmsOnBb,
int iReverse,
[int iStopAtTieOpen = 0])

A RGUMENTS
AllElmsOnBb (out)
Ordered path containing all terminals and connecting elements of the backbone.
iReverse
0 Return ordered path from start feeder to end feeder
1 Return ordered path from end feeder to start feeder
iStopAtTieOpen
0 return complete path
1 only return part of path in start feeder (iReverse=0) / in end feeder
(iReverse=1)

E XAMPLE
This example lists all calculated backbones together with all their elements
object oBbone;
object obj;
object folder;
set ElementsOnBbone;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElementBbone');

for (oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next()) {


ElementsOnBbone.Clear();
oBbone.GetCompleteBbPath(ElementsOnBbone, 0);
for ( obj=ElementsOnBbone.First(); obj; obj=ElementsOnBbone.Next() ) {
obj.ShowFullName();
}
}

GetFOR
Get aggregated forced outage rate (FOR) of all elements on the path of the backbone.
double ElmBbone.GetFOR()

R ETURNS
The aggregated forced outage rate (FOR) of all elements on the path of the backbone [in
1/a].

188
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
object oBbone;
object folder;
double dFOR;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElmBbone');

for ( oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next() ) {


dFOR = oBbone.GetFOR();
printf('Backbone %o has a FOR of %f per year.', oBbone, dFOR);
}

GetMeanCs*
Get mean cross section value of all elements on the path of the backbone. Every cross section
value is weighted with the relative length corresponding to the total length of the backbone.
double ElmBbone.GetMeanCs()

R ETURNS
The mean cross section of the elements on the backbone path [in mm2].

E XAMPLE
object oBbone;
object folder;
double meanCs;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElmBbone');

for (oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next()) {


meanCs = oBbone.GetMeanCs();
printf('Backbone %o has a mean cross section of %f mm2.', oBbone, meanCs);
}

GetMinCs*
Get minimum cross section value of all elements on the path of the backbone. Optional: a set
with all elements on the backbone path featuring this cross section may be returned.
double ElmBbone.GetMinCs([set& ElmsMinCs])

A RGUMENTS
ElmsMinCs
Elements on the backbone path featuring minimum cross section value.

R ETURNS
The minimum cross section of all elements on the backbone path [in mm2].

189
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
object oBbone;
object obj;
object folder;
double minCs;
set ElmsMinCs;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElmBbone');

for ( oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next() ) {


minCs = oBbone.GetMinCs(ElmsMinCs);
printf('Backbone %o has a min. cs of %f mm2.\n', oBbone, minCs);
printf('Its following elements feature this cross section\n');
for (obj=ElmsMinCs.First(); obj; obj=ElmsMinCs.Next()) {
printf(' element %o\n', obj);
}
}

GetTieOpenPoint*
Search and obtain the first open switching device (ElmCoup, StaSwitch) on the backbone path
(starting from the infeeding point of the starting feeder).
object ElmBbone.GetTieOpenPoint()

R ETURNS
The switching device (ElmCoup or StaSwitch) or NULL if backbone is invalid.

E XAMPLE
object oBbone;
object folder;
object oTie;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElmBbone');

for ( oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next() ) {


oTie = oBbone.GetTieOpenPoint();
if ( oTie<>nullptr ) {
oTie.ShowFullName();
}
}

GetTotLength*
Get total lenth of all elements on the path of the backbone.
double ElmBbone.GetTotLength()

R ETURNS
The total length of the backbone path [in km].

190
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
object oBbone;
object folder;
double length;
set ElementBbones;

folder = GetDataFolder('IntBbone');
ElementBbones = folder.GetContents('*.ElmBbone');

for ( oBbone=ElementBbones.First(); oBbone; oBbone=ElementBbones.Next() ) {


length = oBbone.GetTotLength();
printf('Backbone %o has a length of %f km.', oBbone, length);
}

HasGnrlMod*
Check whether backbone object ElmBbone has a valid CalBbone where corresponding results
are stored. This is only the case after a backbone calculation by scoring method (until the
calculation is reset).
int ElmBbone.HasGnrlMod()

R ETURNS
1 ElmBbone has a calculation model,
0 no calculation model available.

3.2.5 ElmBmu
Overview

Apply
Update

Apply
Applies the power dispatch. Depending on the selected 'Distribution Mode ' this is done by a
built-in algorithm based on 'Merit Order' or by a user-defined DPL script that is stored in the
contents of the virtual power plant object.
int ElmBmu.Apply()

R ETURNS
0 on success, no error occurred
1 error during dispatch by virtual power plant. Please note, a value of 1 is also
returned in case the power plant is current set out-of-service.

191
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Update
Updates the list of machines in the tables: 'Dispatchable Machines' and 'Non-dispatchable
(fixed) Machines'.
void ElmBmu.Update()

3.2.6 ElmBoundary
Overview

AddCubicle
CalcShiftedReversedBoundary
Clear
GetInterior*
IsSplitting*
Resize
Update

AddCubicle
Adds a given cubicle with given orientation to an existing boundary. The cubicle is added only if
it is not already contained within the boundary.
int ElmBoundary.AddCubicle(object cubicle,
int orientation
)

R ETURNS
0 cubicle was successfully added
1 cubicle was not added because it is already contained (including given orienta-
tion)

CalcShiftedReversedBoundary
Defines boundary where exterior and interior part of this boundary are exchanged. Resulting
boundary cubicles are branch-oriented.
int ElmBoundary.CalcShiftedReversedBoundary(double shift,
object& boundary)

A RGUMENTS
shift Elements that are within a distance of shift many elements to a boundary cubicle
of this boundary are added to the exterior part of the resulting boundary.

boundary (out)
Defined boundary.

R ETURNS
0 Successful call, boundary defined.
1 Error during determination of boundary cubicles.

192
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
external object: "thisBoundary"
double shift;
int ret;
object newBoundary;
shift = 2;
ret = thisBoundary.CalcShiftedReversedBoundary(shift, newBoundary);
if (res = 0) {
printf('Defined boundary %o by shifting %d elements!', newBoundary, shift);
}

Clear
Removes all boundary cubicles from an existing boundary.
void ElmBoundary.Clear()

GetInterior*
Returns a set of all elements that are contained in the interior region of the boundary.
set ElmBoundary.GetInterior()

R ETURNS
Returns the set of interior elements.

E XAMPLE
external object 'newBoundary'
set interior;
object o;
interior = newBoundary.GetInterior();
o = interior.First();
while (o) {
printf('interior object: %o \n',o);
o = interior.Next();
}

IsSplitting*
Checks if the boundary splits the network into two regions. A boundary is called splitting, if and
only if, for each boundary cubicle, the adjacent terminal and the adjacent branch component
belong to different sides of the boundary.
int ElmBoundary.IsSplitting([set& notSplittingCubicles])

A RGUMENTS
notSplittingCubicles (optional, out)
All cubicles that prevent the boundary from being splitting are filled into this set.

R ETURNS
0 not splitting boundary
1 splitting boundary

193
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set cubicles;
object cubicle;
int res;
res = boundary.IsSplitting(cubicles);
if (res) {
printf('Boundary is splitting');
}
else {
printf('Boundary is not splitting because of: ');
for (cubicle = cubicles.First(); cubicle; cubicle = cubicles.Next()) {
cubicle.ShowFullName();
}
}

Resize
Resizes the boundary cubicle vector or the cubicle orientation vector. It is strongly advised that
the size of both vectors must be the same.
void ElmBoundary.Resize(double size,
string name
)

A RGUMENTS
size size of the referenced vector (number of cubicles)
name reference to the vector (’iorient’ or ’cubicles’)

R ETURNS
If the resize is unsuccessful the error message shall be issued.

Update
Updates cached information (such as topological interiour). Required when boundary definition
was changed via DPL or Python.
void ElmBoundary.Update()

3.2.7 ElmBranch
Overview

Update

194
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Update
Updates connection points and contained elements of the branch. If the branch element exter-
nally modified by the user, then the update shall refresh all connections in the correct manner.
Behaves same as the update button within the ElmBranch.
void ElmBranch.Update()

3.2.8 ElmCabsys
Overview

FitParams
GetLineCable*
Update

FitParams
Calculates distributed parameters for cable system elements. Whether this function calculates
constant parameters or frequency dependent parameters depends on the user setting of the
parameter 'i model' in the ElmCabsys dialog. The settings are as follows: i model=0: constant
parameters; i model=1: frequency dependent parameters.
int ElmCabsys.FitParams()

R ETURNS
0 on success
1 on error

E XAMPLE
object cabSys;
set cabSysElements;
int err;

cabSysElements = GetCalcRelevantObjects('*.ElmCabsys');
cabSys = cabSysElements.First();
err = cabSys.FitParams();
if (err) {
Error('Could not calculate line parameters for %s.', cabSys);
exit();
}

GetLineCable*
Gets cable type for the corresponding line, within the cable system.
object ElmCabsys.GetLineCable(int line)

A RGUMENTS
line Index of line.

R ETURNS
cable type On success.
NULL On error.

195
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
object oElmSys;
set lines;
object otyp;
int indx;

indx = 1;

oElmSys = GetCalcRelevantObjects('*.ElmCabsys');
cableElement = cableElements.First();
otyp = cableElement.GetLineCable(indx);
if (otyp = nullptr) {
Error('Could not find cable type for the index: %d', indx);
exit();
}
else {
printf('Line index %d corresponds to the cable type %o', indx, otyp);
}

Update
Updates cable system element depending on configuration of the associated cable system
type.
int ElmCabsys.Update()

R ETURNS
1 Cable system was updated.
0 Update was not required.

E XAMPLE
object cable;
set cableElements;
int ierr;

cableElements = GetCalcRelevantObjects('*.ElmCabsys');
cable = cableElements.First();
ierr = cable.Update();

3.2.9 ElmComp
Overview

SlotUpdate

196
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

SlotUpdate
Performs a slot update for the composite model, to try to reassign each model found in the
composite model contents to the corresponding slot.
void ElmComp.SlotUpdate()

D EPRECATED N AMES
Slotupd

3.2.10 ElmCoup
Overview

Close
GetRemoteBreakers*
IsBreaker*
IsClosed*
IsOpen*
Open

Close
Closes the switch by changing its status to ’close’. This action will fail if the status is currently
determined by an active running arrangement.
int ElmCoup.Close()

R ETURNS
0 On success
6= 0 On error

E XAMPLE
The following example gathers all open switches and closes them.
int open;
set switches;
object switch;
switches = GetCalcRelevantObjects('*.ElmCoup');

for(switch = switches.First(); switch; switch = switches.Next()) {


open = switch.IsOpen();
if (open = 1) {
switch.Close();
}
}

S EE ALSO

ElmCoup.Open()

197
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetRemoteBreakers*
Returns the remote circuit breakers or connected bus bars.
This information is determined by a topological search that starts at given breaker in all direc-
tions, generally stopping at

• switches of type circuit breaker


• switches that are open
• busbars (ElmTerm::iUsage == 0)

If the search reaches a busbar while only reducible components have been passed (see ob-
ject.IsReducible()) it stops and returns the connected busbar (no breaker found). In case of
non-redubicle components have been passed, the search continues until next circuit breaker is
found. Only breakers with given breaker state are returned.
set ElmCoup.GetRemoteBreakers(int desiredBreakerState,
set& foundBreakers,
[set& foundBusbars])

A RGUMENTS
desiredBreakerState
Only breakers with given status are collected.
-1 Return all remote circuit breakers
1 Return all closed remoted circuit breakers
0 Return all opened remoted circuit breakers

foundBreakers (out)
The list of the remote circuit breakers
foundBusbars (optional, out)
The list of the local bus bars

IsBreaker*
Checks if type of current switch is ’circuit-breaker’.
int ElmCoup.IsBreaker()

R ETURNS
1 Switch is a circuit-breaker.
0 Switch is not a circuit-breaker.

IsClosed*
Returns information about current switch state.
int ElmCoup.IsClosed()

R ETURNS
1 switch is closed
0 switch is open

198
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

S EE ALSO

ElmCoup.IsOpen()

IsOpen*
Returns information about current switch state.
int ElmCoup.IsOpen()

R ETURNS
1 switch is open
0 switch is closed

S EE ALSO

ElmCoup.IsClosed()

Open
Opens the switch by changing its status to ’open’. This action will fail if the status is currently
determined by an active running arrangement.
int ElmCoup.Open()

R ETURNS
0 On success
6= 0 On error

E XAMPLE
The following example gathers all closed switches and opens them.
int closed;
set switches;
object switch;
switches = GetCalcRelevantObjects('*.ElmCoup');

for(switch = switches.First(); switch; switch = switches.Next()) {


closed = switch.IsClosed();
if (closed = 1) {
switch.Open();
}
}

S EE ALSO

ElmCoup.Close()

199
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.11 ElmDsl
Overview

ExportToClipboard
ExportToFile

ExportToClipboard
Export the parameter list to clipboard.
void ElmDsl.ExportToClipboard([string colSeparator],
[int useLocalHeader]
)

A RGUMENTS
colSeparator (optional)
Separator between the columns (default: tab character).
useLocalHeader (optional)
Use the localised version of the header. Possible values are:

1 Yes (default).
0 No (use English language header).

ExportToFile
Export the parameter list to CSV file(s).
void ElmDsl.ExportToFile(string filePath,
[string colSeparator],
[int useLocalHeader]
)

A RGUMENTS
filePath Path of the CSV target file. In case of array and matrix parameters (names:
“array NAME” and “matrix NAME”), additional CSV files are created in the same
location with names obtained by appending “ array NAME” and “ matrix NAME”
to the target file name.
colSeparator (optional)
Separator between the columns (default: “;”).
useLocalHeader (optional)
Use the localised version of the header. Possible values are:
1 Yes (default).
0 No (use English language header).

200
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.12 ElmFeeder
Overview

CalcAggrVarsInRadFeed*
GetAll*
GetBranches*
GetBuses*
GetNodesBranches*
GetObjs*

CalcAggrVarsInRadFeed*
Computes all the aggregated variables in radial feeders.
int ElmFeeder.CalcAggrVarsInRadFeed([int lookForRoot,]
[int considerNested])

A RGUMENTS
lookForRoot (optional)
Calculates the variables from the deepest root. Possible values are:
0 Start from this feeder
1 (default) Find the deepest root.
considerNested (optional)
Calculates the variables also for any nested subfeeders. Possible values are:
0 Ignore any nested feeders
1 (default) Consider nested feeders.

R ETURNS
Returns whether or not the aggregated variables were calculated. Possible values are:

0 error during calculation


1 calculated correctly

E XAMPLE
set feeders;
object folder,feeder;
int ierr;
! calculates the aggregated variables of all the feeders
folder = GetDataFolder('ElmFeeder');
if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {
ierr = feeder.CalcAggrVarsInRadFeed();
printf('Calculation of aggr. variables in feeder %o: %d', feeder, ierr);
}
}

GetAll*
Returns a set with all objects belonging to this feeder.
set ElmFeeder.GetAll([int iNested])

201
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of network elements belonging to this feeder. Can be empty.

E XAMPLE
set all,feeders;
object folder,feeder,obj;
! output elements in the feeders
folder = GetDataFolder('ElmFeeder');
if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
feeders.SortToVar(0,'loc_name');
for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {
printf('Elements in feeder %s',feeder:loc_name);
all = feeder.GetAll(1);
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

S EE ALSO

object.IsInFeeder()

GetBranches*
Returns a set with all branch elements belonging to this feeder.
set ElmFeeder.GetBranches([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:

0 Only the objects of this feeder will be returned.


1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of bus and branch elements in feeder.

E XAMPLE
set aBranches,feeders;
object folder,feeder,obj;
! output elements in the feeders
folder = GetDataFolder('ElmFeeder');

202
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
feeders.SortToVar(0,'loc_name');
for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {
printf('Branches in feeder %s',feeder:loc_name);
aBranches = feeder.GetBranches(1);
for (obj=aBranches.First(); obj; obj=aBranches.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetBuses*
Returns a set with all buses belonging to this feeder.
set ElmFeeder.GetBuses([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of bus elements in feeder.

E XAMPLE
set nodes,feeders;
object folder,feeder,obj;
! output elements in the feeders
folder = GetDataFolder('ElmFeeder');
if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
feeders.SortToVar(0,'loc_name');
for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {
printf('Buses in feeder %s',feeder:loc_name);
nodes = feeder.GetBuses(1);
for (obj=nodes.First(); obj; obj=nodes.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetNodesBranches*
Returns a set with all buses and branches belonging to this feeder.
set ElmFeeder.GetNodesBranches([int iNested])

203
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of bus and branch elements in feeder.

E XAMPLE
set aAll,feeders;
object folder,feeder,obj;
! output elements in the feeders
folder = GetDataFolder('ElmFeeder');
if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
feeders.SortToVar(0,'loc_name');
for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {
printf('Branches and Nodes in feeder %s',feeder:loc_name);
aAll = feeder.GetNodesBranches(1);
for (obj=aAll.First(); obj; obj=aAll.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetObjs*
Returns a set with all objects of class 'ClassName' which belong to this feeder.
set ElmFeeder.GetObjs(string ClassName,
[int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of feeder objects.

E XAMPLE
set aAll,feeders;
object folder,feeder,obj;
! output elements in the feeders
folder = GetDataFolder('ElmFeeder');
if (folder) {
feeders = folder.GetContents('*.ElmFeeder',1);
feeders.SortToVar(0,'loc_name');

204
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

for (feeder=feeders.First(); feeder; feeder=feeders.Next()) {


printf('Cubicles in feeder %s',feeder:loc_name);
aAll = feeder.GetObjs('StaCubic');
for (obj=aAll.First(); obj; obj=aAll.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

3.2.13 ElmFile
Overview

LoadFile
SaveFile

LoadFile
(Re)Loads the file into a buffer.
int ElmFile.LoadFile([int loadComplete = 1])

A RGUMENTS
loadComplete (optional)
0 Removes all points in the future simulation time and adds all points
from the file (including the current interpolated value).
1 Clears the buffer and reloads the complete file (default).

R ETURNS
0 On success.
6= 0 On error.

SaveFile
Saves the buffer and overwrites the file.
int ElmFile.SaveFile()

R ETURNS
0 On success.
6= 0 On error.

205
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.14 ElmFilter
Overview

GetGroundingImpedance*

GetGroundingImpedance*
Returns the impedance of the internal grounding. Single phase filters connected to neutral
are considered as grounding devices themselves; i.e. instead of the dedicated grounding
parameters, the filters parameters are used.
int ElmFilter.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

3.2.15 ElmGenstat
Overview

CalcEfficiency
Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
GetStepupTransformer*
IsConnected*
Reconnect
ResetDerating

206
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalcEfficiency
Calculate efficiency for connected storage model at given active power value.
double ElmGenstat.CalcEfficiency(double activePowerMW)

A RGUMENTS
activePowerMW
Active power value to calculate efficiency for.

R ETURNS
Returns the resulting efficiency in p.u.

E XAMPLE
set objs;
object obj;
int err;
double eff, Ptherm, Pelect;

Pelect = 30.0;
objs = GetCalcRelevantObjects('*.ElmGenstat');

obj = objs.First();
if (obj) {
eff = obj.CalcEfficiency(Pelect);
Ptherm = Pelect/eff;
}

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
void ElmGenstat.Derate(double deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a static generator by opening the first circuit breaker. The topological search
performed to find such a breaker, stops at any busbar.
int ElmGenstat.Disconnect()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

207
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! disconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Disconnect();
if (err) {
printf('Error disconnecting %s', obj);
}
}

GetAvailableGenPower*
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the
average of the power values (in MW) obtained from all the specified time characteristics
for the current study time.

• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


double ElmGenstat.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

208
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

generators = GetCalcRelevantObjects('*.ElmGenstat');

totalpower = 0; ! initialize cummulative generation

! get cummulative generation


for (generator = generators.First(); generator; generator = generators.Next()) {
power = generator.GetAvailableGenPower();
totalpower += power;
}
printf('Cummulative generation is %f', totalpower);

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmGenstat.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the static generator.
object ElmGenstat.GetStepupTransformer(double voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop

swStatus consideration of switch status. Possible values are:


0 consider all switch status
1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

209
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

IsConnected*
Checks if generator is topologically connected to any busbar.
int ElmGenstat.IsConnected()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

E XAMPLE
set objs;
object obj;
int status;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! print connection status for all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.IsConnected();
if (status) {
printf('%s is connected', obj);
}
else {
printf('%s is disconnected', obj);
}
}

Reconnect
Connects a static generator by closing all switches (breakers and isolators) up to the first breaker
on the HV side of a transformer. The topological search to find all the switches, stops at any
busbar.
int ElmGenstat.Reconnect()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! reconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Reconnect();
if (err) {
printf('Error connecting %s', obj);
}
}

210
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
void ElmGenstat.ResetDerating()

3.2.16 ElmGndswt
Overview

Close
GetGroundingImpedance*
IsClosed*
IsOpen*
Open

Close
Closes the switch by changing its status to ’close’. If closed, the connected node will be
considered as being earthed.
int ElmGndswt.Close()

R ETURNS
1, always

S EE ALSO

ElmGndswt.Open()

GetGroundingImpedance*
Returns the impedance of the internal grounding. ElmGndswt is only considered to have an
internal grounding if it is single phase and connected to neutral.
int ElmGndswt.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

211
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

IsClosed*
Returns information about current switch state.
int ElmGndswt.IsClosed()

R ETURNS
1 switch is closed
0 switch is open

S EE ALSO

ElmGndswt.IsOpen()

IsOpen*
Returns information about current switch state.
int ElmGndswt.IsOpen()

R ETURNS
1 switch is open
0 switch is closed

S EE ALSO

ElmGndswt.IsClosed()

Open
Opens the switch by changing its status to ’open’.
int ElmGndswt.Open()

R ETURNS
0, always

S EE ALSO

ElmGndswt.Close()

212
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.17 ElmLne
Overview

AreDistParamsPossible*
CreateFeederWithRoutes
FitParams
GetIthr*
GetType*
GetY0m*
GetY1m*
GetZ0m*
GetZ1m*
GetZmatDist*
HasRoutes*
HasRoutesOrSec*
IsCable*
IsNetCoupling*
MeasureLength*
SetDetailed

AreDistParamsPossible*
Check if the line fulfils conditions for the calculation of distributed parameters:

ElmLne No routes, no sections


TypTow only 1 circuit x 3 phases
TypGeo only 1 circuit x 3 phases

TypLne AC system, 3 phases and 0 neutral


TypCabsys only 1 circuit x 3 phases

int ElmLne.AreDistParamsPossible()

R ETURNS
The returned value are:

0 All conditions fulfilled


1 Line contains routes
2 Line contains sections
3 Line has no type
4 TypTow/TypCabsys does not fulfil conditions for distributed paramters
5 TypLne does not fulfil conditions for distributed parameters
6 Short-circuit flag is set (EMT or RMS simulations)
7 TypLne/TypTow: B0 and B1 = 0
8 Error, no condition state could be determined

213
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CreateFeederWithRoutes
Creates a new feeder in the line by splitting the line into 2 routes and inserting a terminal.
int ElmLne.CreateFeederWithRoutes(double dis,
double rem,
object O,)
int ElmLne.CreateFeederWithRoutes(double dis,
double rem,
object O,
int sw0,
int sw1)

A RGUMENTS
dis Inserting operation occurs after this distance
rem Remaining distance, percentage of distance ’dis’
O Branch object that is to be connected at the inserted terminal
sw0 If set to (1), switch is inserted on the first side
sw1 If set to (1), switch is inserted on the second side

R ETURNS
0 Success, feeders created
1 Error

FitParams
Calculates distributed parameters of the line element. Whether this function calculates constant
parameters or frequency dependent parameters depends on the user setting of the parameter
'i model' in the ElmLne dialogue. The settings are as follows: i model=0: constant parameters;
i model=1: frequency dependent parameters.
int ElmLne.FitParams([int isRMSModel = 0,]
[int modify = 1])

A RGUMENTS
isRMSModel

modify

R ETURNS
0 Success
1 Error

E XAMPLE
object line;
set lines;
int err;

lines = GetCalcRelevantObjects('*.ElmLne');
line = lines.First();
err = line.FitParams();
if (err) {

214
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Error('Could not calculate line parameters for %s.', line);


exit();
}

GetIthr*
Returns the rated short-time current of the line element.
double ElmLne.GetIthr()

R ETURNS
Returns rated short-time current value

E XAMPLE
External Object (ElmLne) pre-defined: MyLine
double Ir;
if (MyLine) {
Ir = MyLine.GetIthr();
}
Info('Rated short-time current is %f kA',Ir);

GetType*
Returns the line type object.
object ElmLne.GetType()

R ETURNS
The TypLne object if exists or NULL

E XAMPLE
The following example reports all 'untyped' lines
set list;
object line, type;
list = GetCalcRelevantObjects();
line = list.Firstmatch('ElmLne');
while (line) {
type = line.GetType();
if (type=nullptr) {
line.ShowFullName();
}
line = list.Nextmatch();
}

215
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetY0m*
The function returns the zero-sequence mutual coupling admittance (G0m, B0m) in Ohm of the
line and input argument line (object Lne2). When Lne2 = line, the function returns the zero-
sequence self admittance.
int ElmLne.GetY0m(object Lne2,
double& G0m,
double& B0m)

A RGUMENTS
Lne2 Line element
G0m (out)
Resulting G0m value
B0m (out)
Resulting B0m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

E XAMPLE
External Object (ElmLne) pre-defined: MyLine
double fG0m, fB0m;
int iret;
if (MyLine) {
iret = MyLine.GetY0m(MyLine, fG0m, fB0m);
}
if (iret) {
Warn('No values for G0m and B0m obtained!');
}
else {
Info('The value for G0m is %f Ohm and for B0m is %f Ohm', fG0m, fB0m);
}

GetY1m*
The function returns the positive-sequence mutual coupling admittance (G1m, B1m) in Ohm
of the line and input argument line (object Lne2). When Lne2 = line, the function returns the
positive-sequence self admittance.
int ElmLne.GetY1m(object Lne2,
double& G1m,
double& B1m)

A RGUMENTS
Lne2 Line element
G1m (out)
Resulting G1m value
B1m (out)
Resulting B1m value

216
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

E XAMPLE
External Object (ElmLne) pre-defined: MyLine
double fG1m, fB1m;
int iret;
if (MyLine) {
iret = MyLine.GetY1m(MyLine, fG1m, fB1m);
}
if (iret) {
Warn('No values for G1m and B1m obtained!');
}
else {
Info('The value for G1m is %f Ohm and for B1m is %f Ohm', fG1m, fB1m);
}

GetZ0m*
Gets the zero-sequence mutual coupling impedance (R0m, X0m) in Ohm of the line and input
argument line (object otherLine). When otherLine = line, the function returns the zero-sequence
self impedance.
int ElmLne.GetZ0m(object otherLine,
double& R0m,
double& X0m)

A RGUMENTS
otherLine Line element
R0m (out)
To be obtained R0m value
X0m (out)
To be obtained X0m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

E XAMPLE
External Object (ElmLne) pre-defined: MyLine
double fR0m, fX0m;
int iret;
if (MyLine) {
iret = MyLine.GetZ0m(MyLine, fR0m, fX0m);
}
if (iret) {
Warn('No values for R0m and X0m obtained!');
}
else {
Info('The value for R0m is %f Ohm and for X0m is %f Ohm', fR0m, fX0m);
}

217
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetZ1m*
The function returns the positive-sequence mutual coupling impedance (R1m, X1m) in Ohm
of the line and input argument line (object Lne2). When Lne2 = line, the function returns the
positive-sequence self impedance.
int ElmLne.GetZ1m(object Lne2,
double& R1m,
double& X1m)

A RGUMENTS
Lne2 Line element
R1m (out)
Resulting R1m value
X1m (out)
Resulting X1m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

E XAMPLE
External Object (ElmLne) pre-defined: MyLine
double fR1m, fX1m;
int iret;
if (MyLine) {
iret = MyLine.GetZ1m(MyLine, fR1m, fX1m);
}
if (iret) {
Warn('No values for R1m and X1m obtained!');
}
else {
Info('The value for R1m is %f Ohm and for X1m is %f Ohm', fR1m, fX1m);
}

GetZmatDist*
The function gets impedance matrix in phase domain (only amplitudes), for a line with distributed
parameters, short-circuit ended.
int ElmLne.GetZmatDist(double frequency,
int exact,
object matrix)

A RGUMENTS
frequency
Frequency for which the calculation is carried out
exact 0: Approximated solution, 1: Exact solution for ‘frequency’

matrix Impedance matrix to be filled with the impedance amplitudes

218
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
The returned value reports if the impedance matrix acquired:

1 Error, no matrix acquired


0 Success, matrix acquired

HasRoutes*
Checks if the line is subdivided into routes.
int ElmLne.HasRoutes()

R ETURNS
0 When the line is a single line
1 When the line is subdivided into routes

E XAMPLE
The following example reports all lines with routes.
set list;
object line;
int i;
list = GetCalcRelevantObjects();
line = list.Firstmatch('ElmLne');
while (line) {
i = line.HasRoutes();
if (i) line.ShowFullName(); {
line = list.Nextmatch();
}
}

HasRoutesOrSec*
Checks if the line is subdivided into routes or sections.
int ElmLne.HasRoutesOrSec()

R ETURNS
0 When the line is a single line
1 When the line is subdivided into routes
2 When the line is subdivided into sections

E XAMPLE
The following example reports all lines with sections.
set list;
object line;
int i;
list = GetCalcRelevantObjects();
line = list.Firstmatch('ElmLne');
while (line) {
i = line.HasRoutesOrSec();
if (i=2) line.ShowFullName(); {

219
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

line = list.Nextmatch();
}
}

IsCable*
Checks if this line is a cable.
int ElmLne.IsCable()

R ETURNS
2 when line contains cable and overhead line sections
1 Line is a cable
0 Line is not a cable

E XAMPLE
The following example reports the loading of all cables.
set list;
object cable;
int i;
list = GetCalcRelevantObjects();
cable = list.Firstmatch('ElmLne');
while (cable) {
i = cable.IsCable();
if (i) {
Write('# : #.## $N', @ACC(1):loc_name, @ACC(1):c:loading, O);
}
cable = list.Nextmatch();
}

IsNetCoupling*
Checks if the line connects two grids.
int ElmLne.IsNetCoupling()

R ETURNS
The returned value reports if the line is a coupler:

1 The line is a coupler (connects two grids)


0 The line is not a coupler

E XAMPLE
set list;
object line;
int i;
list = GetCalcRelevantObjects();
line = list.Firstmatch('ElmLne');
while (line) {
i = line.IsNetCoupling();
if (i) {

220
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Write('# :#.## $N', @ACC(1):loc_name, @ACC(1):c:loading,line);


}
line = list.Nextmatch();
}

MeasureLength*
Measures the length of this line using the active diagram. For graphical measurement the active
diagram needs to have a scaling factor. Geographic diagrams by default have a scaling factor.
If iUseGraphic = 1, the line length is determined directly from the positions given in (latitude/lon-
gitude) considering the earth as a perfect sphere. In this case no graphic needs to be open.
double ElmLne.MeasureLength([int iUseGraphic])

A RGUMENTS
iUseGraphic (optional)
Use SGL diagram for calculation or not.
1 Use displayed diagram for calculation (default)
0 Calculate distance without diagram

R ETURNS
≥0 Returns the graphical length of this line in its current unit
<0 Error: E.g. when line is not represented in the active diagram and iUseGraphic=1

E XAMPLE
double length;
object line;
set lines;

lines = GetCalcRelevantObjects('*.ElmLne');
line = lines.First();
if (.not. line) {
Error('no line found');
exit();
}

length = line.MeasureLength();
printf('Measured length of %o: %f', line, length);

SetDetailed
The function can be used to prevent the automatically reduction of a line e.g. if the line is a line
dropper (length = 0). The function should be called when no calculation method is valid (before
first load flow). The internal flag is automatically reset after the first calculation is executed.
int ElmLne.SetDetailed()

E XAMPLE
Suggested code order:

ResetCalculation() Makes sure that all previous calculations are deleted

221
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Line.SetDetailed() Sets detailed flag for the line


Ldf.Execute() Calculation of the load flow

External Object (ElmLne) pre-defined: MyLine


object cmdLdf;
cmdLdf = GetFromStudyCase('ComLdf');
if (MyLine .and. cmdLdf) {
ResetCalculation(); ! Resets previous calculation
MyLine.SetDetailed(); ! Sets detailed flag on the line dropper
Ldf.Execute(); ! Performs load flow calculation
! The detailed flag is automatically reset after the load flow calculation
...
}

3.2.18 ElmLnesec
Overview

IsCable*

IsCable*
Checks if this line section is a cable.
int ElmLnesec.IsCable()

R ETURNS
1 Line section is a cable
0 Line section is not a cable
-1 Error

E XAMPLE
The following example reports the loading of all cables.
set list;
object cable;
int i;
list = GetCalcRelevantObjects();
cable = list.Firstmatch('ElmLnesec');
while (cable) {
i = cable.IsCable();
if (i>0) {
Write('# : #.## $N', @ACC(1):loc_name, @ACC(1):c:loading, O);
}
cable = list.Nextmatch();
}

222
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.19 ElmMdl
Overview

ExportToClipboard
ExportToFile

ExportToClipboard
Export the parameter list to clipboard.
void ElmMdl.ExportToClipboard([string colSeparator],
[int useLocalHeader]
)

A RGUMENTS
colSeparator (optional)
Separator between the columns (default: tab character).
useLocalHeader (optional)
Use the localised version of the header. Possible values are:

1 Yes (default).
0 No (use English language header).

ExportToFile
Export the parameter list to CSV file(s).
void ElmMdl.ExportToFile(string filePath,
[string colSeparator],
[int useLocalHeader]
)

A RGUMENTS
filePath Path of the CSV target file. In case of array and matrix parameters (names:
“array NAME” and “matrix NAME”), additional CSV files are created in the same
location with names obtained by appending “ array NAME” and “ matrix NAME”
to the target file name.
colSeparator (optional)
Separator between the columns (default: “;”).
useLocalHeader (optional)
Use the localised version of the header. Possible values are:
1 Yes (default).
0 No (use English language header).

223
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.20 ElmNec
Overview

GetGroundingImpedance*

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmNec.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

3.2.21 ElmNet
Overview

Activate
CalculateInterchangeTo*
CalculateVoltageLevel*
CalculateVoltInterVolt*
Deactivate
DefineBoundary

Activate
Adds a grid to the active study case. Can only be applied if there are is no currently active
calculation (i.e. running contingency analysis).
int ElmNet.Activate()

R ETURNS
0 on success
1 on error

224
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalculateInterchangeTo*
This function calculates the power flow from current grid to a connected grid. The values are
stored in current grid in the following attributes (values from the previous load flow calculation
are overwritten):

- Pinter: Active Power Flow


- Qinter: Reactive Power Flow
- ExportP: Export Active Power Flow
- ExportQ: Export Reactive Power Flow
- ImportP: Import Active Power Flow
- ImportQ: Import Reactive Power Flow

int ElmNet.CalculateInterchangeTo(object net)

A RGUMENTS
net Connected grid

R ETURNS
<0 error
=0 grids are not connected, no interchange exists
>0 ok

E XAMPLE
external grid objects: "from", "to"
ElmNet pnetA, pnetB;
object Ldf;

pnetA = from;
pnetB = to;

Ldf = GetFromStudyCase('ComLdf');
Ldf.Execute(); ! Valid load flow calculation

int res;
res = pnetA.CalculateInterchangeTo(pnetB);
if (res > 0) {
printf('Pinter: %d', pnetA:c:Pinter);
printf('Qinter: %d', pnetA:c:Qinter);
printf('ExportP: %d', pnetA:c:ExportP);
printf('ExportQ: %d', pnetA:c:ExportQ);
printf('ImportP: %d', pnetA:c:ImportP);
printf('ImportQ: %d', pnetA:c:ImportQ);
}

CalculateVoltageLevel*
Internal funciton to calculate per voltage level the corresponding summary results. The values
are stored in current grid (values from the previous load flow calculation are overwritten):
int ElmNet.CalculateVoltageLevel(double U)

225
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
U for voltage level (in kV)

R ETURNS
<0 error
=0 voltage level not exists in the grid
>0 ok

CalculateVoltInterVolt*
This function calculates the power flow from voltage level to voltage level. The values are stored
in current grid in the following attributes (values from the previous load flow calculation are
overwritten):

- Pinter: Active Power Flow


- Qinter: Reactive Power Flow
- ExportP: Export Active Power Flow

- ExportQ: Export Reactive Power Flow


- ImportP: Import Active Power Flow
- ImportQ: Import Reactive Power Flow

int ElmNet.CalculateVoltInterVolt(double Ufrom, double Uto)

A RGUMENTS
Ufrom from voltage level (in kV)
Uto to voltage level (in kV)

R ETURNS
<0 error
=0 voltage levels not exists in the grid, no interchange exists
>0 ok

Deactivate
Removes a grid from the active study case.Can only be applied if there are is no currently active
calculation.
int ElmNet.Deactivate()

R ETURNS
0 on success
1 on error

226
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

DefineBoundary
Defines boundary with this grid as interior part. Resulting cubicles of boundary are busbar-
oriented towards the grid.
object ElmNet.DefineBoundary(int shift)

A RGUMENTS
shift Elements outside the grid that are within a distance of shift many elements to
a boundary cubicle of the grid are added to the interior part of the resulting
boundary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

E XAMPLE
external object: "thisGrid"
double shift;
object newBoundary;
shift = 2;
newBoundary = thisGrid.DefineBoundary(shift);
if ({newBoundary <> NULL}) {
printf('Defined boundary %o by shifting %d elements!', newBoundary, shift);
}

3.2.22 ElmPvsys
Overview

CalcEfficiency
Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
IsConnected*
Reconnect
ResetDerating

CalcEfficiency
Calculate efficiency for connected storage model at given active power value.
double ElmPvsys.CalcEfficiency(double activePowerMW)

A RGUMENTS
activePowerMW
Active power value to calculate efficiency for.

R ETURNS
Returns the resulting efficiency in p.u.

E XAMPLE

227
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

set objs;
object obj;
int err;
double eff, Ptherm, Pelect;

Pelect = 30.0;
objs = GetCalcRelevantObjects('*.ElmPvsys');

obj = objs.First();
if (obj) {
eff = obj.CalcEfficiency(Pelect);
Ptherm = Pelect/eff;
}

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
void ElmPvsys.Derate(double deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a PV system by opening the first circuit breaker. The topological search performed
to find such a breaker, stops at any busbar.
int ElmPvsys.Disconnect()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! disconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Disconnect();
if (err) {
printf('Error disconnecting %s', obj);
}
}

228
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetAvailableGenPower*
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the
average of the power values (in MW) obtained from all the specified time characteristics
for the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


double ElmPvsys.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

generators = GetCalcRelevantObjects('*.ElmPvsys');

totalpower = 0; ! initialize cummulative generation

! get cummulative generation


for (generator = generators.First(); generator; generator = generators.Next()) {
power = generator.GetAvailableGenPower();
totalpower += power;
}
printf('Cummulative generation is %f', totalpower);

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmPvsys.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

229
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

IsConnected*
Checks if a PV system is already connected to any busbar.
int ElmPvsys.IsConnected()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

E XAMPLE
set objs;
object obj;
int status;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! print connection status for all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.IsConnected();
if (status) {
printf('%s is connected', obj);
}
else {
printf('%s is disconnected', obj);
}
}

Reconnect
Connects a PV system by closing all switches (breakers and isolators) up to the first breaker
on the HV side of a transformer. The topological search to find all the switches, stops at any
busbar.
int ElmPvsys.Reconnect()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

230
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! reconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Reconnect();
if (err) {
printf('Error connecting %s', obj);
}
}

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
void ElmPvsys.ResetDerating()

3.2.23 ElmRelay
Overview

CalculateMaxFaultCurrents
CheckRanges*
GetCalcRX*
GetMaxFdetectCalcI*
GetSlot*
GetUnom*
IsStarted*
SetImpedance
SetMaxI
SetMaxIearth
SetMinI
SetMinIearth
SetOutOfService
SetTime
SlotUpdate

CalculateMaxFaultCurrents
Calculates and stores the “Max. phase fault current” and the “Max. earth fault current”.
void ElmRelay.CalculateMaxFaultCurrents()

231
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CheckRanges*
Checks the settings of all elements in the relay for range violations.
int ElmRelay.CheckRanges()

R ETURNS
0 All settings are valid.
1 At least one setting was forced into range.
-1 An error occurred.

GetCalcRX*
Gets the calculated impedance from the polarising unit.
int ElmRelay.GetCalcRX(int inSec,
int unit,
double& real,
double& imag)

A RGUMENTS
inSec
0 Get the value in pri. Ohm.
1 Get the value in sec. Ohm.
unit
0 Get the value from Phase-Phase or Multifunctional polarizing.
1 Get the value from Phase-Earth or Multifunctional polarizing.
2 Get the value from Multifunctional polarizing
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.

R ETURNS
0 No error occurred, the output is valid.
1 An error occurred, the output is invalid.

GetMaxFdetectCalcI*
Get the current measured by the starting unit.
int ElmRelay.GetMaxFdetectCalcI(double& Iabs,
int earth,
int iunit
)

A RGUMENTS
Iabs (out) The measured current in A
earth
0 Get the phase current.

232
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

1 Get the earth current.

unit
0 Get the current in pri. A.
1 Get the current in sec. A.

R ETURNS
0 No error, output is valid.
1 An error occurred, the output is invalid.

GetSlot*
Returns the element in the slot with the given name.
object ElmRelay.GetSlot(string name,
[int iShowErr]
)

A RGUMENTS
name Exact name of the slot to search for (no wildcards).
iShowErr (optional)
0 Do not show error messages.
1 Show error messages if a slot is not found or empty.

R ETURNS
The object in the slot or NULL.

GetUnom*
Returns the nominal voltage of the local bus of the relay.
double ElmRelay.GetUnom()

R ETURNS
The nominal voltage of the local bus of the relay in kV.

IsStarted*
Checks if the starting unit detected a fault.
int ElmRelay.IsStarted()

R ETURNS
0 No fault was detected.
1 Fault was detected.
-1 An error occurred.

233
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

SetImpedance
Sets the the given impedance to the distance blocks matching the criteria.
int ElmRelay.SetImpedance(double real,
double imag,
int inSec,
int zone,
int unit
)
int ElmRelay.SetImpedance(double real,
double imag,
double lineAngle,
double Rarc,
int inSec,
int zone,
int unit
)

A RGUMENTS
real Real part of the impedance in Ohm.
imag Imaginary part of the impedance in Ohm.
inSec
0 The values are in pri. Ohm.
1 The values are in sec. Ohm.
zone Set the impedance for elments with this zone number.
unit
0 Set the impedance for Phase - Phase or Multifunctional elements.
1 Set the impedance for Phase - Earth or Multifunctional elements.
2 Set the impedance for Multifunctional elements.

A RGUMENTS
real Real part of the impedance in Ohm.

imag Imaginary part of the impedance in Ohm.


lineAngle The line angle in deg.
Rarc The arc resistance in Ohm.
inSec
0 The values are in pri. Ohm.
1 The values are in sec. Ohm.
zone Set the impedance for elments with this zone number.
unit
0 Set the impedance for Phase - Phase or Multifunctional elements.
1 Set the impedance for Phase - Earth or Multifunctional elements.
2 Set the impedance for Multifunctional elements.

234
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

SetMaxI
Sets the “Max. Phase Fault Current” of the relay to the currently measured value.
void ElmRelay.SetMaxI()

SetMaxIearth
Sets the “Max. Earth Fault Current” of the relay to the currently measured value.
void ElmRelay.SetMaxIearth()

SetMinI
Sets the “Min. Phase Fault Current” of the relay to the currently measured value.
void ElmRelay.SetMinI()

SetMinIearth
Sets the “Min. Earth Fault Current” of the relay to the currently measured value.
void ElmRelay.SetMinIearth()

SetOutOfService
Sets the “Out of Service” flag of elements contained in the relay.
int ElmRelay.SetOutOfService(int outServ,
int type,
int zone,
int unit
)

A RGUMENTS
outServ
0 Set elements in service.
1 Set Elements out of service.
type
1 Set the flag for overcurrent elements.
2 Set the flag for distance elements.
zone Set the flag for elments with this zone number (only when settings distance ele-
ments).
unit

235
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

0 Set the flag for Phase-Phase or Multifunctional elements.


1 Set the flag for Phase-Earth or Multifunctional elements.
2 Set the flag for Multifunctional elements.

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

SetTime
Sets the tripping time for elements contained in the relay.
int ElmRelay.SetTime(int time,
int type,
int zone,
int unit
)

A RGUMENTS
time Time in s.
type
1 Set the time for overcurrent elements.
2 Set the time for distance elements.

zone Set the time for elments with this zone number (only when settings distance
elements).
unit
0 Set the time for Phase-Phase or Multifunctional elements.
1 Set the time for Phase-Earth or Multifunctional elements.
2 Set the time for Multifunctional elements.

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

SlotUpdate
Triggers a slot update of the relay.
void ElmRelay.SlotUpdate()

D EPRECATED N AMES
slotupd

236
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.24 ElmRes
Overview

AddVariable
Clear
ExecuteLoadingCommand
FindColumn*
FindMaxInColumn*
FindMaxOfVariableInRow*
FindMinInColumn*
FindMinOfVariableInRow*
FinishWriting
Flush
GetColumnValues*
GetDescription*
GetFirstValidObject*
GetFirstValidObjectVariable*
GetFirstValidVariable*
GetNextValidObject*
GetNextValidObjectVariable*
GetNextValidVariable*
GetNumberOfColumns*
GetNumberOfRows*
GetObj*
GetObject*
GetObjectValue*
GetRelCase*
GetSubElmRes*
GetUnit*
GetValue*
GetVariable*
InitialiseWriting
Load*
Release*
SetAsDefault
SetObj
SetSubElmResKey
SortAccordingToColumn*
Write
WriteDraw

AddVariable
Adds a variable to the list of monitored variables for the Result object.
int ElmRes.AddVariable(object element,
string varname
)

A RGUMENTS
element An object.
varname Variable name for object element.

R ETURNS
0 On success.

237
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

1 An error occurred during adding of variables.

D EPRECATED N AMES
AddVars

E XAMPLE
The following script gets the result file named “DPL” from the active study case, defines the
variables for recording (variables from summary grid), calculates a load flow and records the
corresponding variables inside the result file.
object sumGrid,
ldfCmd, !
elmRes;

elmRes = GetFromStudyCase('DPL.ElmRes');
if (nullptr=elmRes) {
exit(1);
}
ldfCmd = GetFromStudyCase('ComLdf');
if (nullptr=ldfCmd) {
exit(1);
}
sumGrid = GetSummaryGrid();
if (nullptr=sumGrid){
exit(1);
}
elmRes.AddVariable(sumGrid,'c:GenP');
elmRes.AddVariable(sumGrid,'c:GenQ');
ldfCmd.Execute();
elmRes.InitialiseWriting();
elmRes.Write();
elmRes.Flush();

Clear
Clears all data (calculation results) written to the result file. The Variable definitions stored in
the contents of ElmRes are not modified.
int ElmRes.Clear()

R ETURNS
Always 0 and can be ignored.

E XAMPLE
The following example deletes the data of all ElmRes stored in the active study case.
object case,
elmRes;
set resObjs;
case = GetActiveStudyCase();
if (case) {
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
for (elmRes=resObjs.First(); elmRes; elmRes=resObjs.Next()) {
elmRes.Clear();
}
}

238
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

ExecuteLoadingCommand
Loads results into memory.
int ElmRes.ExecuteLoadingCommand()

R ETURNS
0 Success
1 Failure

FindColumn*
Returns the index of the first header column matching the given object and/or variable name.
int ElmRes.FindColumn(object obj,
[string varName]
)
int ElmRes.FindColumn(object obj,
[int startCol]
)
int ElmRes.FindColumn(string varName,
[int startCol]
)

A RGUMENTS
obj (optional)
Object of matching column.
varName (optional)
Variable name of matching column.
startCol (optional)
Index of first checked column; Search starts at first column if colIndex is not
given.

R ETURNS
≥0 column index
<0 no valid column found
The index can be used in the ElmRes method GetData to retrieve the value of the column.

E XAMPLE
object case,
elmRes,
terminal;
set resObjs,
relevantObjs;
int index;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('Quasi-Dynamic Simulation AC.ElmRes',0);
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}

239
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

relevantObjs = GetCalcRelevantObjects('*.ElmTerm');
terminal = relevantObjs.First();

elmRes.Load();

index = elmRes.FindColumn('m:u'); ! start at first variable


printf('First index of variable m:u %d',index);
index = elmRes.FindColumn('m:u', index+1); ! start after index already found
printf('Second index of variable m:u %d',index);

index = elmRes.FindColumn(terminal); ! start at first variable


printf('First index of object %s: %d',terminal:loc_name, index);
index = elmRes.FindColumn(terminal, index+1); ! start after index already found
printf('Second index of object %s: %d',terminal:loc_name, index);

index = elmRes.FindColumn(terminal, 'm:u');


printf('Index of variable m:u of %s: %d',terminal:loc_name, index);

elmRes.Release();

FindMaxInColumn*
Find the maximum value of the variable in the given column.
int ElmRes.FindMaxInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The maximum value found. The value is 0. in case that the maximum value was
not found.

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

E XAMPLE
object case,
elmRes;
set resObjs;
int row,
column;
double value;

column = 1;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('All calculations.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (elmRes) {
elmRes.Load();
row = elmRes.FindMaxInColumn(column,value);

240
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

if (row<0) {
Info('The maximum of column %d was not found',column);
}
else {
Info('The maximum of column %d is %f (row: %d)',column, value,row);
}
row = elmRes.FindMinInColumn(column,value);
if (row<0) {
Info('The minimum of column %d was not found',column);
}
else {
Info('The minimum of column %d is %f (row: %d)',column, value,row);
}
elmRes.Release();
}

FindMaxOfVariableInRow*
Find the maximum value for the given row and variable.
int ElmRes.FindMaxOfVariableInRow(string variable,
int row,
[double& maxValue])

A RGUMENTS
variable The variable name
variable The row
maxValue (optional)
The corresponding maximum value.

R ETURNS
<0 There is no valid value of the corresponding variable in the row.
≥0 Column index of variable.

E XAMPLE
The following example reports the maximum and minimum of variable m:u in the first row.
object case,
elmRes,
terminal;
set resObjs;
int index;
double voltage;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('Quasi-Dynamic Simulation AC.ElmRes',0);
elmRes = resObjs.First();
if (elmRes) {
elmRes.Load();
index = elmRes.FindMaxOfVariableInRow('m:u',0, voltage);
printf('Maximum m:u at column %d: %f',index,voltage);
index = elmRes.FindMinOfVariableInRow('m:u',0, voltage);

241
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

printf('Mainmum m:u at column %d: %f',index,voltage);


elmRes.Release();
}

FindMinInColumn*
Find the minimum value of the variable in the given column.
int ElmRes.FindMinInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

E XAMPLE
See example of ElmRes.FindMaxInColumn.

FindMinOfVariableInRow*
Find the minimum value for the given row and variable.
int ElmRes.FindMinOfVariableInRow(string variable,
int row,
[double& minValue])

A RGUMENTS
variable The variable name.
variable The row.
minValue (optional, out)
The corresponding minimum value.

R ETURNS
<0 There is no valid value of the corresponding variable in the row.
≥0 Column index of variable.

E XAMPLE
See example of ElmRes.FindMinOfVariableInRow.

FinishWriting
Finishes the writing of values to a result file.
void ElmRes.FinishWriting()

242
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

D EPRECATED N AMES
Close

E XAMPLE
See example of ElmRes.InitialiseWriting.

S EE ALSO

ElmRes.InitialiseWriting(), ElmRes.Write(), ElmRes.WriteDraw()

Flush
This function is required in scripts which perform both file writing and reading operations. While
writing to a results object (ElmRes), a small portion of this data is buffered in memory. This
is required for performance reasons. Therefore, all data must be written to the disk before
attempting to read the file. 'Flush' copies all data buffered in memory to the disk. After calling
'Flush'all data is available to be read from the file.
int ElmRes.Flush()

E XAMPLE
The following example writes a result object and prints the data written to the file. The DPL
command contains to variables on the advanced options page:

double x x-value
double y y-value

These variables were selected in the variable definitions inside the result object which itself
is stored in the DPL command. The DPL script code is as follows:
int xFailed,yFailed,iX,iY,row;
double xValue,yValue;
! write results to ElmRes named Results (stored in Contents)
for (x=-16; x<16; x=x+0.1) {
y= x*x;
Results.Write();
}

! read the data


Results.Flush(); ! if this line ommitted some sample might be missing in the output
Results.Load();
iX = Results.FindColumn('b:x');! get index of column x
iY = Results.FindColumn('b:y');! get index of column y
! report values in output window
row = 0;
xFailed = Results.GetValue(xValue,row,iX); ! get the x-value in the first line
yFailed = Results.GetValue(yValue,row,iY); ! get the y-value in the first line
printf('%d %d', iX,iY);
while ({xFailed=0}.and.{yFailed=0}) {
printf('%6.2f / %6.2f',xValue,yValue);! print the values to the output window
row = row+1; ! next row
xFailed = Results.GetValue(xValue,row,iX); ! get the x-value in line row
yFailed = Results.GetValue(yValue,row,iY); ! get the z-value in line row
}
Results.Release(); ! release the result file data from memory

243
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetColumnValues*
Get complete column values.
int ElmRes.GetColumnValues(object dataVector,
int column)

A RGUMENTS
dataVector
IntVec which will be filled with column values.
column The column index. -1 for default (e.g. time).

R ETURNS
=0 Column values were found.
=1 dataVector is NULL.
=2 dataVector is not of class IntVec.
=3 Column index is out of range.

GetDescription*
Get the description of a column.
string ElmRes.GetDescription([int column],
[int short]
)

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.
short (optional)
0 long desc. (default)
1 short description

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

E XAMPLE
See example of ElmRes.GetVariable.

GetFirstValidObject*
Gets the index of the column for the first valid variable in the given line. Starts at the beginning
of the given line and sets the internal iterator of the result file to the found position.
int ElmRes.GetFirstValidObject(int row,
[string classNames,]
[string variableName,]
[double limit,]
[int limitOperator,]
[double limit2,]
[int limitOperator2]

244
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

)
int ElmRes.GetFirstValidObject(int row,
set objects
)

A RGUMENTS
row Result file row
classNames (optional)
Comma separated list of class names for valid objects. The next object of one
of the given classes is searched. If not set all objects are considered as valid
(default).
variableName (optional)
Name of the limiting variable. The searched object must have this variable. If not
set variables are not considered (default).
limit (optional)
Limiting value for the variable.
limitOperator (optional)
Operator for checking the limiting value:
0 all values are valid (default)
1 valid values must be < limit
2 valid values must be ≤ limit
3 valid values must be > limit
4 valid values must be ≥ limit
limit2 (optional)
Second limiting value for the variable.
limitOperator2 (optional)
Operator for checking the second limiting value:
<0 first OR second criterion must match,
>0 first AND second criterion must match,
0 all values are valid (default)
1/-1 valid values must be < limit2
2/-2 valid values must be ≤ limit2
3/-3 valid values must be > limit2
4/-4 valid values must be ≥ limit2
objects Valid objects

R ETURNS
≥0 column index
<0 no valid column found

245
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
! Find first line or generator whose loading is $>$= 80%
iCol = ResFirstValidObject(oRes, iRow, 'ElmLne,ElmSym', 'c:loading', 80, 4);

GetFirstValidObjectVariable*
Gets the index of the first valid variable of the current object in the current line. Starts at the
internal iterator of the given result file and sets it to the position found.
int ElmRes.GetFirstValidObjectVariable([string variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of
the given variables is searched. If empty all variables of the current object are
considered as valid (default).

R ETURNS
≥0 column index
<0 no valid column found

E XAMPLE
iCol = elmRes.GetFirstValidObjectVariable('c:loading,c:loading_st');

GetFirstValidVariable*
Gets the index of the column for the first valid variable in the given line. Starts at the beginning
of the given line and sets the internal iterator of the result file to the found position.
int ElmRes.GetFirstValidVariable(int row,
[string variableNames]
)

A RGUMENTS
row Result file row.
variableNames (optional)
Comma separated list of valid variable names. The next column with one of
the given variables is searched. If not set all variables are considered as valid
(default).

R ETURNS
≥0 column index
<0 no valid column found

E XAMPLE
The following example outputs all valid indicees of m:u in the first row of the results.

246
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

object case,
elmRes,
colObj;
set resObjs;
int columnIndex;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0);
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
columnIndex = elmRes.GetFirstValidVariable(0, 'm:u');
while(columnIndex>=0) {
printf('First Index of m:u: %d',columnIndex);
columnIndex = elmRes.GetNextValidVariable('m:u');
}
elmRes.Release();

GetNextValidObject*
Gets the index of the column for the next valid variable (after current iterator) in the given line.
Sets the internal iterator of the result file to the position found.
int ElmRes.GetNextValidObject([string classNames,]
[string variableName,]
[double limit,]
[int limitOperator,]
[double limit2,]
[int limitOperator2]
)
int ElmRes.GetNextValidObject(set objects)

A RGUMENTS
row Result file row.
classNames (optional)
Comma separated list of class names for valid objects. The next object of one
of the given classes is searched. If not set all objects are considered as valid
(default).
variableName (optional)
Name of the limiting variable. The searched object must have this variable. If not
set variables are not considered (default).
limit (optional)
Limiting value for the variable.
limitOperator (optional)
Operator for checking the limiting value:
0 all values are valid (default)
1 valid values must be < limit
2 valid values must be ≤ limit

247
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3 valid values must be > limit


4 valid values must be ≥ limit

limit2 (optional)
Second limiting value for the variable.
limitOperator2 (optional)
Operator for checking the second limiting value:

<0 first OR second criterion must match,


>0 first AND second criterion must match,
0 all values are valid (default)
1/-1 valid values must be < limit2
2/-2 valid values must be ≤ limit2
3/-3 valid values must be > limit2
4/-4 valid values must be ≥ limit2
objects Valid objects

R ETURNS
≥0 column index
<0 no valid column found

E XAMPLE
! Find next line or generator whose loading is $>$= 80%
iCol = ResNextValidObject(oRes, 'ElmLne,ElmSym', 'c:loading', 80, 4);

GetNextValidObjectVariable*
Gets the index of the column for the next valid variable of the current object in the current line.
Starts at the internal iterator of the given result file and sets it to the found position.
int ElmRes.GetNextValidObjectVariable([string variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of
the given variables is searched. If not set all variables are considered as valid
(default).

R ETURNS
≥0 column index
<0 no valid column found

E XAMPLE
iCol = elmRes.GetNextValidObjectVariable('c:loading,c:loading_st');

248
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetNextValidVariable*
Gets the index of the column for the next valid variable in the given line. Starts at the internal
iterator of the given line and sets the internal iterator of the result file to the found position.
int ElmRes.GetNextValidVariable([string variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of
the given variables is searched. If not set all variables are considered as valid
(default).

R ETURNS
≥0 column index
<0 no valid column found

E XAMPLE
See example of ElmRes.GetFirstValidVariable.

GetNumberOfColumns*
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int ElmRes.GetNumberOfColumns()

R ETURNS
Number of variables (columns) in result file.

E XAMPLE
See example of ElmRes.InitialiseWriting.

GetNumberOfRows*
Returns the number of values per column (rows) stored in result object.
int ElmRes.GetNumberOfRows()

R ETURNS
Returns the number of values per column stored in result object.

E XAMPLE
See example of ElmRes.InitialiseWriting.

GetObj*
Returns an object 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.
object ElmRes.GetObj(int index)

249
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
index index of the object.

R ETURNS
The object found or NULL.

GetObject*
Get object of given column.
object ElmRes.GetObject([int column])

A RGUMENTS
col Column index. Object of default column is returned if col is not passed.

R ETURNS
The object of the variable stored in column ’column’.

E XAMPLE
The following example prints the name of the object in the default column and of the first
other column of the result file being used for simulation.
object case,
elmRes,
colObj;
set resObjs;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('All calculations.ElmRes',0);
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
colObj = elmRes.GetObject();
Info('Object in default column: \%s',colObj:loc_name);
colObj = elmRes.GetObject(0);
Info('Object in first other column: \%s',colObj:loc_name);
elmRes.Release();

GetObjectValue*
Returns a value from a result object for row iX of curve col.
int ElmRes.GetObjectValue(object& o,
int iX,
[int col])

A RGUMENTS
o (out) The object retrieved from the data.

250
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

iX The row.

col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of ElmRes.SortAccordingToColumn.

GetRelCase*
Get the contingency object for the given case number from the reliability result file.
object ElmRes.GetRelCase(int caseNumber)

A RGUMENTS
caseNumber
The reliability case number

R ETURNS
Returns the contingency of case number. NULL is returned if there is no corresponding
contingency.

E XAMPLE
The following example lists all contingencies stored in the result file named Reliability Enu-
meration stored in the active study case.
int caseVar, ! column which contains contingency variable for casenum
row, ! current row
failed; ! error handling
object currObj, ! current contingency
elmRes; ! result file
double caseIdx; ! case index read from file

elmRes = GetFromStudyCase('Reliability Enumeration.ElmRes');


if (nullptr=elmRes) {
Error('Result file Reliability Enumeration.ElmRes not found');
exit(1);
}
elmRes.Load();
! get index of case column; process error
caseVar = elmRes.FindColumn('b:casenum');
if (caseVar<0) {
Error('Result file is not a reliability result file or empty');
exit();
}

251
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

! search the row which contains the given contingency (cnt)


SetLineFeed(0);
printf('Case Number Contingency\n');
row = 0;
failed = elmRes.GetValue(caseIdx,row,caseVar);
while (.not.failed) {
currObj = elmRes.GetRelCase(caseIdx);
printf(' %06d ', caseIdx);
if (currObj) {
printf('%o\n', currObj);
}
else {
printf('------\n');
}
row+=1;
failed = elmRes.GetValue(caseIdx,row,caseVar);
}
SetLineFeed(1);
elmRes.Release();

GetSubElmRes*
Get sub-result file stored inside this.
object ElmRes.GetSubElmRes(int value)
object ElmRes.GetSubElmRes(object obj)

A RGUMENTS
value The cnttime to look for
obj The pResElm to look for

R ETURNS
NULL The sub result file with value=cnttime (obj=pResElm) was not found.
any other value The sub result file with value=cnttime (obj=pResElm).

GetUnit*
Get the unit of a column.
string ElmRes.GetUnit([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

E XAMPLE
See example of ElmRes.GetVariable.

252
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetValue*
Returns a value from a result object for row iX of curve col.
int ElmRes.GetValue(double& d,
int iX,
[int col])

A RGUMENTS
d (out) The value retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of ElmRes.SortAccordingToColumn.

GetVariable*
Get variable name of column
string ElmRes.GetVariable([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

E XAMPLE
object case,
elmRes;
string name,
unit,
short,
long;

set resObjs;
int variables,
column;

253
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
if (variables>0) {
printf('Name; unit; Short Description; Long Description');
for (column=-1; column<variables; column+=1) {
! -1 returns default column
name = elmRes.GetVariable(column);
unit = elmRes.GetUnit(column);
short= elmRes.GetDescription(column,1);
long = elmRes.GetDescription(column);
printf('%s; %s; %s; %s', name, unit, short,long);
}
}
elmRes.Release();

InitialiseWriting
Opens the result object for writing. This function must be called before writing data for result
files not stored in the script object. If arguments are passed to the function they specify the
variable name, unit... of the default variable (e.g. to be used by plots as x-axis).
int ElmRes.InitialiseWriting()
int ElmRes.InitialiseWriting(string variableName,
string unit,
string description,
[string shortDescription]
)

A RGUMENTS
variableName
The variable name for the default variable (e.g. “distance”).
unit The unit (e.g. “km”).
description
The description of the variable (e.g. “Distance from infeed”).
shortDescription
The short description (e.g. “Dist. Infeed”).

R ETURNS
Always 0 and can be ignored

D EPRECATED N AMES
Init

S EE ALSO

ElmRes.FinishWriting(), ElmRes.Write(), ElmRes.WriteDraw()

254
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the result file named DPl from the study case, the default variable
to Length, runs a load flow and writes a line to the file. Thed default variable is set to 10 km.
object sumGrid, ! summary grid
ldfCmd, ! load flow command
elmRes; ! result file

sumGrid = GetSummaryGrid();
if (nullptr=sumGrid){
exit(1);
}
elmRes = GetFromStudyCase('DPL.ElmRes');
if (elmRes) {
ldfCmd = GetFromStudyCase('ComLdf');
if (ldfCmd){
ldfCmd.Execute();
elmRes.InitialiseWriting('len', 'km', 'Length','Len');
elmRes.Write(10);
elmRes.FinishWriting();
}
}

Load*
Loads the data of a result object (ElmRes) in memory for reading.
void ElmRes.Load()

E XAMPLE
object case,
elmRes;
set resObjs;
int variables,rows;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
rows = elmRes.GetNumberOfRows();
Info('The result file %s contains %d columns and %d rows',elmRes, variables, rows);
elmRes.Release();

255
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Release*
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
void ElmRes.Release()

E XAMPLE
See example of ElmRes.Load.

SetAsDefault
Sets this results object as the default results object. Plots using the default result file will use
this file for displaying data.
void ElmRes.SetAsDefault()

SetObj
Adds an object to the objects assigned to the result file
int ElmRes.SetObj(object element)

A RGUMENTS
element Element to store in result file

R ETURNS
The index which can be used to retrieve the object from the results file. The index is < 0 if
no results are recorded for the given object (e.g. a contingency in reliability calculation). The
index is ≥ if variables are recorded for the object.

E XAMPLE
The following example disables terminal by terminal and calculates a load flow for every case.
The outaged terminal is written using SetObj
int failed,
outOfService,
index;
object ldf, bus;
set terminals;

ldf = GetFromStudyCase('ComLdf'); ! get load flow command


terminals=GetCalcRelevantObjects('ElmTerm');
for (bus = terminals.First(); bus; bus = terminals.Next()) {
outOfService = bus:outserv;
if (.not.outOfService) {
bus:outserv = 1;
failed = ldf.Execute();
if (.not.failed) {
index = Results.SetObj(bus);
Results.Write();
printf('%o: %d',bus,index);
}
bus:outserv = 0;
}
}

256
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

SetSubElmResKey
Assigns a value or an object to the according ElmRes parameter.
void ElmRes.SetSubElmResKey(int value)
void ElmRes.SetSubElmResKey(object obj)

A RGUMENTS
value Value to be assigned to parameter cnttime of ElmRes
value Object to be assigned to parameter pResElm of ElmRes

SortAccordingToColumn*
Sorts all rows in the data loaded according to the given column. The ElmRes itself remains
unchanged.
int ElmRes.SortAccordingToColumn(int column)

A RGUMENTS
col The column number.

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

E XAMPLE
The following example outputs column 1 and 2 for the first 50 rows. The output is repeated
after sorting the data according to column 1.
object case,
elmRes;
set resObjs;
int row,
rows,
column,
failed;
double value1, value2;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
column = 1;
rows = 50;
Info('Orginal data in first %d rows of column %d and %d',rows, column, column+1);

257
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;
printf('%04d %f %f', row, value1, value2); ! report row starting with 1
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
failed = elmRes.SortAccordingToColumn(column);
Info('Sorted data in first %d rows in column %d and %d',rows,column, column+1);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;
printf('%04d %f %f', row, value1, value2); ! report row starting with 1
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
elmRes.Release();

Write
Writes the current results to the result object.
int ElmRes.Write([double defaultValue])

R ETURNS
0 on success

S EE ALSO

ElmRes.WriteDraw(), ElmRes.InitialiseWriting(), ElmRes.FinishWriting()

E XAMPLE
See example of ElmRes.InitialiseWriting.

WriteDraw
Writes current results to the result objects and updates all plots that display values from the
result object.
int ElmRes.WriteDraw()

R ETURNS
0 on success

258
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example performs load-flows for a number of load levels and writes the results
to the result object
int failed;
object ldf;

load:plini = minLoad;
ldf = GetFromStudyCase('ComLdf');
while (load:plini<maxLoad) {
failed = ldf.Execute();
if (failed) {
break;
}
load:plini+=step;
Results.WriteDraw();
}

3.2.25 ElmShnt
Overview

GetGroundingImpedance*

GetGroundingImpedance*
Returns the impedance of the internal grounding. Single phase shunts connected to neutral
are considered as grounding devices themselves; i.e. instead of the dedicated grounding
parameters, the shunt parameters are used.
int ElmShnt.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

259
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.26 ElmStactrl
Overview

GetControlledHVNode*
GetControlledLVNode*
GetStepupTransformer*
Info*

GetControlledHVNode*
Returns the corresponding voltage controlled HV node for the machine at the specified index.
Switch status are always considered.
object ElmStactrl.GetControlledHVNode([int index = 0])

A RGUMENTS
index (optional)
Index of machine (starting from 0 − . . . ). Default is 0.

R ETURNS
object Busbar/Terminal ()
NULL not found

E XAMPLE
set objs
object controlledNode,gen;
int index,gens;

objs = GetCalcRelevantObjects('ElmStactrl');

for (obj = objs.First(); obj; obj = objs.Next()) {


obj.GetSize('psym',gens); ! get no. of machines
for (index=0;index<gens;index=index+1) {
oStaCtrl.GetVal(gen,'psym',index);
controlledNode = oStaCtrl.GetControlledHVNode(index);
if (controlledNode) {
printf('Generator: %o, Controlled HV-Node: %o',gen, controlledNode);
}
else {
printf('Generator: %o, Controlled HV-Node: Not found', gen);
}
}
}

GetControlledLVNode*
Returns the corresponding voltage controlled LV node for the machine at specified index. Switch
status are always considered.
object ElmStactrl.GetControlledLVNode(int index)

A RGUMENTS
index Index of machine (starting from 0 − . . . ).

260
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
object Terminal ()
NULL not found

E XAMPLE
set objs
object controlledNode,gen;
int index,gens;

objs = GetCalcRelevantObjects('ElmStactrl');

for (obj = objs.First(); obj; obj = objs.Next()) {


obj.GetSize('psym',gens); ! get no. of machines
for (index=0;index<gens;index=index+1) {
oStaCtrl.GetVal(gen,'psym',index);
controlledNode = oStaCtrl.GetControlledLVNode(index);
if (controlledNode) {
printf('Generator: %o, Controlled LV-Node: %o',gen, controlledNode);
}
else {
printf('Generator: %o, Controlled LV-Node: Not found', gen);
}
}
}

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the machine at the specified
index.
object ElmStactrl.GetStepupTransformer([int index,]
[int iBrkMode]
)

A RGUMENTS
index Index of machine (starting from 0 − . . . ).
iBrkMode (optional)
0 (default) All switch status (open,close) are considered
1 Ignore breaker status (jump over open breakers)
2 Ignore all switch status (jump over open switches)

R ETURNS
object step-up transformer
NULL step-up transformer not found

Info*
Prints the control information in the output window. It is the same information that the button
”Info” of the Station Control dialog prints.
int ElmStactrl.Info()

261
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.27 ElmSubstat
Overview

ApplyAndResetRA
GetSplit*
GetSplitCal*
GetSplitIndex*
GetSuppliedElements*
OverwriteRA
ResetRA
SaveAsRA
SetRA

ApplyAndResetRA
This function applies switch statuses of currently selected running arrangement to correspond-
ing switches and resets the running arrangement selection afterwards. Nothing happens if no
running arrangement is selected.
int ElmSubstat.ApplyAndResetRA()

R ETURNS
1 on success
0 otherwise, especially if no running arrangement is selected

GetSplit*
A split of a station is a group of topologically connected elements. Such a group is called split
if all contained components are energized and there is at least one busbar (terminal of usage
'busbar') contained or it has connections to at least two main components (= all components
except switch devices and terminals).
These splits are ordered according to the count of nodes contained and according to their
priority. So each split becomes a unique index.
The function GetSplit offers access to the elements contained in a split. By calling GetSplit with
an index from 0 to n, the elements belonging to the corresponding split are filled into given sets
and returned.
int ElmSubstat.GetSplit(int index,
set& mainNodes,
[set& connectionCubicles,]
[set& allElements]
)

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Value
must be ≥ 0.
mainNodes (out)
Terminals of same usage considered to form the most important nodes for that
group. In most cases, this is the group of contained busbars.
connectionCubicles (optional, out)
All cubicles (of terminals inside the station) that point to an element that sits out-
side the station or to an element that is connected to a terminal outside the station

262
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

are filled into the set connectionCubicles. (The connection element (branch) can
be accessed by calling GetBranch() on each of these cubicles. The terminals
of these cubicles (parents) must not necessarily be contained in any split. They
could also be separated by a disconnecting component.)
allElements(optional, out)
All elements (class Elm*) of the split that have no connection to elements outside
the station are filled into this set.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

E XAMPLE
set nodes;
set cubicles;
set elements;
int return, index;
object obj;

return = 0;
while (return <> 1) { !loop from 0 to n until there is no more split
return = station.GetSplit(index, nodes, cubicles, elements);

printf('Split %d:', index);

printf('Major Nodes:');
obj = nodes.First();
while(obj) {
obj.ShowFullName();
obj = nodes.Next();
}

printf('Connection Cubicles:');
obj = cubicles.First();
while(obj) {
obj.ShowFullName();
obj = cubicles.Next();
}

printf('All Elements:');
obj = elements.First();
while(obj) {
obj.ShowFullName();
obj = elements.Next();
}

index = index + 1;
}

S EE ALSO

ElmSubstat.GetSplitCal(), ElmSubstat.GetSplitIndex(),

263
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetSplitCal*
This function determines the elements that belong to a split. In contrast to ElmSubstat.GetSplit()
it is based on calculation instead of pure edit object topology. This means the returned nodes
correspond to the calculation nodes, the interconnecting cubicles are those connecting nodes
of different splits.
Note: As this function relies on calculation nodes it can only be executed after a calculation has
been performed (e.g. load flow calculation).
int ElmSubstat.GetSplitCal(int index,
set& nodes,
[set& connectionCubicles,]
[set& elements])

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Refers
to same split as index in ElmSubstat.GetSplit().
Value must be ≥ 0.
nodes (out)
A set that is filled with terminals. There is one terminal returned for each calcula-
tion node in the split.
connectionCubicles (optional, out)
This set is filled with all cubicles that point from a calculation node of current split
to another calculation node that does not belong to that split. The connecting
element can be accessed by calling GetBranch() on such a cubicle.
elements (optional, out)
This set is filled with network elements that are connected to a calculation node of
current split and have exactly one connection, i.e. these elements are completely
contained in the split.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

E XAMPLE
set nodes;
set cubicles;
set elements;
int return, index;
object obj;

return = 0;
while (return <> 1) { !loop from 0 to n until there is no more split
return = station.GetSplitCal(index, nodes, cubicles, elements);

if (return < 1) {
if (return = 0) {
printf('Split %d:', index);
}
else {
printf('(Pseudo)Split %d:', index);
}
printf('Major Nodes:');
obj = nodes.First();
while(obj) {

264
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

obj.ShowFullName();
obj = nodes.Next();
}

printf('Connection Cubicles:');
obj = cubicles.First();
while(obj) {
obj.ShowFullName();
obj = cubicles.Next();
}

printf('Elements:');
obj = elements.First();
while(obj) {
obj.ShowFullName();
obj = elements.Next();
}
}
index = index + 1;
}

S EE ALSO

ElmSubstat.GetSplit()

GetSplitIndex*
This function returns the index of the split that contains passed object.
int ElmSubstat.GetSplitIndex(object o)

A RGUMENTS
o Object for which the split index is to be determined.

R ETURNS
≥0 index of split in which element is contained
-1 given object does not belong to any split of that station

E XAMPLE
set stations, terms;
object substation, term;
string name;
int index;

!iterates over all substations and checks belonging


!of terminals to splits of each substation

stations = GetCalcRelevantObjects('*.ElmSubstat');

for (substation = stations.First(); substation; substation = stations.Next()) {


name = substation.GetFullName(0);
printf('\nSubstation: %s', name);

terms = substation.GetContents('*.ElmTerm');

for (term = terms.First(); term; term = terms.Next()) {

265
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

index = substation.GetSplitIndex(term);
name = term.GetFullName(0);
if (index < 0) {
printf(' %s is not contained in any split of that substation', name);
}
else {
printf(' %s belongs to split %d', name, index);
}
}
}

S EE ALSO

ElmSubstat.GetSplit()

GetSuppliedElements*
Returns the network components that are supplied by the transformer (located in the station). A
network component is considered to be supplied by a transformer if a topological path from the
transformer to the component exists. A valid topological path in this sense is a path that starts
at the transformer’s HV side in direction of transformer (not in direction of HV connected node)
and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),

• open switches,
• connections leading to a higher voltage level.

Generally, all network components of such a path are considered to be supplied by the trans-
former.
Exceptions are components that are out of calculation or in-active. Those components are never
considered to be supplied by any transformer. A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
set ElmSubstat.GetSuppliedElements([int inclNested])

A RGUMENTS
inclNested (optional)
0 Do not include components that are supplied by nested supplying sta-
tions
1 (default) Include components that are supplied by nested stations

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmTr3.GetSuppliedElements()

266
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

OverwriteRA
This function overwrites switch statuses stored in an existing running arrangement with actual
switch statuses of the substation. This is only possible if the substation has no running arrange-
ment selected and given running arrangement is valid for substation the method was called
on.
int ElmSubstat.OverwriteRA(object ra)

A RGUMENTS
ra Given running arrangement

R ETURNS
1 If given running arrangement was successfully overwritten;
0 otherwise

E XAMPLE
int res;
res = objsubstation.OverwriteRA(objra);
if (res = 1) {
printf('%o was successfully overwritten', objra);
}
else {
printf('%o was not overwritten', objra)
}

ResetRA
This function resets the running arrangement selection for the substation it was called on.
void ElmSubstat.ResetRA()

SaveAsRA
When called on a substation that has no running arrangement selected, a new running ar-
rangement is created and all switch statuses of all running arrangement relevant switches (for
that substation) are saved in it. The running arrangement is stored in project folder ”Running
Arrangement” and its name is set to given locname. The new running arrangement is not
selected automatically.
(No new running arrangement is created if this method is called on a substation that has
currently a running arrangement selected).
object ElmSubstat.SaveAsRA(string locname)

A RGUMENTS
locname Name of the new running arrangement (if name is already used, an increment
(postfix) is added to make it unique).

R ETURNS
Newly created 'IntRunarrange' object on success, otherwise NULL.

267
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
object myRA;
myRA = objsubstation.SaveAsRA('MyRA');
if (myRA) {
myRA.ShowFullName();
}
else {
printf('No RA created.');
}

SetRA
This function sets the running arrangement selection for the substation it was called on. The
switch statuses are now determined by the values stored in the running arrangement.
int ElmSubstat.SetRA(object ra)

A RGUMENTS
ra running arrangement that is valid for the substation

R ETURNS
1 If given running arrangement was successfully set;
0 otherwise (e.g. given ra is not valid for that substation)

E XAMPLE
int res;
res = objsubstation.SetRA(objra);
if (res = 1) {
printf('%o was successfully set', objra);
}
else {
printf('%o was not set', objra);
}

3.2.28 ElmSvs
Overview

GetStepupTransformer*

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the static VAR system.
object ElmSvs.GetStepupTransformer(double voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop

268
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

swStatus consideration of switch status. Possible values are:

0 consider all switch status


1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

3.2.29 ElmSym
Overview

CalcEfficiency
Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
GetMotorStartingFlag*
GetStepupTransformer*
IsConnected*
Reconnect
ResetDerating

CalcEfficiency
Calculate efficiency for connected storage model at given active power value.
double ElmSym.CalcEfficiency(double activePowerMW)

A RGUMENTS
activePowerMW
Active power value to calculate efficiency for.

R ETURNS
Returns the resulting efficiency in p.u.

E XAMPLE
set objs;
object obj;
int err;
double eff, Ptherm, Pelect;

Pelect = 30.0;
objs = GetCalcRelevantObjects('*.ElmSym');

obj = objs.First();
if (obj) {
eff = obj.CalcEfficiency(Pelect);
Ptherm = Pelect/eff;
}

269
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
void ElmSym.Derate(double deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a synchronous machine by opening the first circuit breaker. The topological search
performed to find such a breaker, stops at any busbar.
int ElmSym.Disconnect()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! disconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Disconnect();
if (err) {
printf('Error disconnecting %s', obj);
}
}

GetAvailableGenPower*
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.

270
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

• Time Series Characteristics of Active Power Contribution: The available power is the
average of the power values (in MW) obtained from all the specified time characteristics
for the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


double ElmSym.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

generators = GetCalcRelevantObjects('*.ElmSym');

totalpower = 0; ! initialize cummulative generation

! get cummulative generation


for (generator = generators.First(); generator; generator = generators.Next()) {
power = generator.GetAvailableGenPower();
totalpower += power;
}
printf('Cummulative generation is %f', totalpower);

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmSym.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

271
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetMotorStartingFlag*
Returns the starting motor condition.
int ElmSym.GetMotorStartingFlag()

R ETURNS
Returns the motor starting condition. Possible values are:

-1 in the process of being calculated


0 not calculated
1 successful start
2 unsuccessful start

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the synchronous machine.
object ElmSym.GetStepupTransformer(double voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:

0 consider all switch status


1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

IsConnected*
Checks if a synchronous machine is already connected to any busbar.
int ElmSym.IsConnected()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

E XAMPLE
set objs;
object obj;
int status;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! print connection status for all generators

272
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.IsConnected();
if (status) {
printf('%s is connected', obj);
}
else {
printf('%s is disconnected', obj);
}
}

Reconnect
Connects a synchronous machine by closing all switches (breakers and isolators) up to the first
breaker on the HV side of a transformer. The topological search to find all the switches, stops
at any busbar.
int ElmSym.Reconnect()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmSym,*.ElmGenstat,*.ElmPvsys');

! reconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Reconnect();
if (err) {
printf('Error connecting %s', obj);
}
}

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
void ElmSym.ResetDerating()

273
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.30 ElmTerm
Overview

GetBusType*
GetCalcRelevantCubicles*
GetConnectedBrkCubicles*
GetConnectedCubicles*
GetConnectedMainBuses*
GetConnectionInfo*
GetEquivalentTerminals*
GetMinDistance*
GetNextHVBus*
GetNodeName*
GetSepStationAreas*
GetShortestPath*
HasCreatedCalBus*
IsElectrEquivalent*
IsEquivalent*
IsInternalNodeInStation*
UpdateSubstationTerminals

GetBusType*
Gets busbar calculation type.
int ElmTerm.GetBusType()

R ETURNS
0 No valid calculation (load flow).
1 PQ busbar.
2 PV busbar.
3 Slack busbar.

GetCalcRelevantCubicles*
This function gets calculation relevant cubicles of this terminal.
set ElmTerm.GetCalcRelevantCubicles()

R ETURNS
Set of calculation relevant cubicles.

GetConnectedBrkCubicles*
Function gets the set of cubicles connected with the breaker and this terminal.
set ElmTerm.GetConnectedBrkCubicles([int ignoreSwitchStates])

A RGUMENTS
ignoreSwitchStates (optional)
Ignore switch status flag 1 or not 0 (=default).

274
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Set of cubicles.

GetConnectedCubicles*
Function gets the set of cubicles connected with this terminal.
set ElmTerm.GetConnectedCubicles([int ignoreSwitchStates])

A RGUMENTS
ignoreSwitchStates (optional)
Ignore switch status flag 1 or not 0 (=default).

R ETURNS
Set of cubicles.

GetConnectedMainBuses*
Function gets the set of connected main buses.
set ElmTerm.GetConnectedMainBuses([int considerSwitches])

A RGUMENTS
considerSwitches (optional)
Consider switch state (default 1).

R ETURNS
Set of main buses connected to the terminal.

GetConnectionInfo*
Gets connection information of this terminal. Requires valid load flow calculation. Input argu-
ments are filled with the value after function call.
int ElmTerm.GetConnectionInfo(double& closedSwitches,
double& allSwitches,
double& nonSwitchingDevices,
double& closedAndNonSwitchingDevices,
double& allDevices,
double& connectedNodes,
double& mainNodes)

A RGUMENTS
closedSwitches
Number of closed switch devices.
allSwitches
Number of total switch devices.
nonSwitchingDevices
Number of non-switch devices.
closedAndNonSwitchingDevices
Number of total closed and non-switch devices (closedSwitches+nonSwitchingDevices).

275
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

allDevices
Number of total switch and non-switch devices (allSwitches+nonSwitchingDevices).

connectedNodes
Number of total nodes connected via couplers.
mainNodes
Number of total main nodes.

R ETURNS
Return value is always 0 and has no meaning.

GetEquivalentTerminals*
Returns a set of all terminals that are equivalent to current one. Euqivalent means that those
terminals are topologically connected only by

• closed switching devices (ElmCoup, RelFuse) or


• lines of zero length (line droppers).

set ElmTerm.GetEquivalentTerminals()

R ETURNS
All terminals that are equivalent to current one. Current one is also included so the set is
never empty.

E XAMPLE
set terminals;
object curTerm;
int t;

printf('List of equivalent terminals:');


terminals = term.GetEquivalentTerminals();
for (curTerm = terminals.First(); curTerm; curTerm=terminals.Next()) {
printf('%o', curTerm);
}
printf('End');

!checking correctnes of function


for (curTerm = terminals.First(); curTerm; curTerm=terminals.Next()) {
t = term.IsEquivalent(curTerm);
if (t) {
printf('%o and %o are equivalent', term, curTerm);
}
else {
!will never happen
Error('%o and %o are not equivalent', term, curTerm);
}
}

S EE ALSO

ElmTerm.IsEquivalent()

276
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetMinDistance*
This function determines the shortest path between the terminal the function was called on and
the terminal that was passed as first argument. The distance is determined on network topology
regarding the length of the traversed component (i.e. only lines have an influence on distance).
double ElmTerm.GetMinDistance(object term,
[int considerSwitches,]
[set& path,]
[set limitToNodes,]
[set elementsToIgnore]
)

A RGUMENTS
term Terminal to which the shortest path is determined.
considerSwitches (optional)
0 Traverse all components, ignore switch states
1 Do not traverse open switch devices (default)
path (optional, out)
If given, all components of the found shortest path are put into this set.
limitToNodes(optional)
If given, the shortest path is searched only within this set of nodes. Please note,
when limiting search to a given set of nodes, the start and end terminals (for which
the distance is determined) must be part of this set (otherwise distance =-1).
elementsToIgnore(optional)
If given, these objects (e.g. nodes) are ignored in the search and not traversed
(=considered as not existing).

R ETURNS
<0 If there is no path between the two terminals
≥0 Distance of shortest path in km

E XAMPLE
!assume terminal1 and terminal2 are objects of class ElmTerm
double distance;
set path;
object obj;

distance = terminal1.GetMinDistance(terminal2, 0, path);

printf('Shortest distance: %f', distance);


printf('Path:');

for(obj = path.First(); obj; obj = path.Next()) {


obj.ShowFullName();
}

S EE ALSO

ElmTerm.GetShortestPath()

277
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetNextHVBus*
This function returns the nearest connected busbar that has a higher voltage level. To detect
this bus, a breadth-first search on the net topology is executed. The traversal stops on each
element that is out of service and on each opened switch device. The criterion for higher voltage
level is passing a transformer to HV side. No junction nor internal nodes shall be considered.
Two winding transfomers with equal voltage on both sides are ignored (simply passed by the
search).
object ElmTerm.GetNextHVBus()

R ETURNS
object First busbar found.
NULL If no busbar was found.

E XAMPLE
object obj, result;
set bars;

bars = SEL.AllBars(); !gets all currently selected bars


obj = bars.First(); !takes first one

result = obj.GetNextHVBus();
if (result) {
result.ShowFullName();
}

GetNodeName*
For terminals inside a station, this function returns a unique name for the split the terminal is
located in. The name is built on first five characters of the station‘s short name plus the split
index separated by an underscore. E.g. “USTAT 1”.
For terminals inside a branch (ElmBranch) the returned name is just a concatenation of the
branch name and the terminal‘s name.
For all other terminals not inside a branch or a station the node name corresponds to the
terminal‘s name.
string ElmTerm.GetNodeName()

R ETURNS
Node name as described above. Never empty.

D EPRECATED N AMES
GetEllaNodeName

GetSepStationAreas*
Function gets all separate areas within the substation linked to this terminal. In this manner,
area is any part between two nodes.
set ElmTerm.GetSepStationAreas([int considerSwitches])

278
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
considerSwitches (optional)
Consider switch state (default 1).

R ETURNS
Set of all separate areas in this substation.

GetShortestPath*
This function determines the shortest path between the terminal the function was called on and
the terminal that was passed as argument. The shortest path is determined on network topology
according to given criterion.
double ElmTerm.GetShortestPath(int criterion,
object term,
[int considerSwitches,]
[set& path,]
[set limitToNodes,]
[set elementsToIgnore]
)

A RGUMENTS
criterion
0 According to line length, same as ElmTerm.GetMinDistance()
1 According to node count
term Terminal to which the shortest path is determined.

considerSwitches (optional)
0 Traverse all components, ignore switch states
1 Do not traverse open switch devices (default)
path (optional, out)
If given, all components of the found shortest path are put into this set.
limitToNodes(optional)
If given, the shortest path is searched only within this set of nodes. Please note,
when limiting search to a given set of nodes, the start and end terminals (for which
the distance is determined) must be part of this set (otherwise distance =-1).

elementsToIgnore(optional)
If given, these objects (e.g. nodes) are ignored in the search and not traversed
(=considered as not existing).

R ETURNS
<0 If there is no path between the two terminals
≥0 Distance of shortest path according to given criterion

E XAMPLE
!assume terminal1 and terminal2 are objects of class ElmTerm
double distance;
set path;
object obj;

279
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

distance = terminal1.GetShortestPath(0, terminal2, 1, path);

printf('Shortest path from %o to %o', terminal1, terminal2);


printf('with respect to length of traversed lines:');

for(obj = path.First(); obj; obj = path.Next()) {


obj.ShowFullName();
}

S EE ALSO

ElmTerm.GetMinDistance()

HasCreatedCalBus*
This function checks if the valid calculation exists for this terminal (i.e. load flow). If it exists,
then the calculation parameters could be retrieved.
int ElmTerm.HasCreatedCalBus()

R ETURNS
1 Valid calculation exists.
0 No valid calculation.

E XAMPLE
int ival;
double dval;
object oTerm;
set allTerminals;
allTerminals = GetAll('ElmTerm');
oTerm = allTerminals.First();
while (oTerm) {
ival = oTerm.HasCreatedCalBus();
if (ival) {
dval = oTerm:m:u;
printf('Voltage of %o is %f p.u.', oTerm, dval);
}
oTerm = allTerminals.Next();
}

IsElectrEquivalent*
Function checks if two terminals are electrically equivalent. Two terminals are said to be
electrically equivalent if they are topologically connected only by

• closed switching devices (ElmCoup, RelFuse) or


• lines of zero length (line droppers) or
• branch components whose impedance is below given thresholds (R ≤ maxR and X ≤
maxX)

280
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

int ElmTerm.IsElectrEquivalent(object terminal,


double maxR,
double maxX
)

A RGUMENTS
terminal Terminal to which the 'method called terminal' is connected to.
maxR Given threshold for the resistance of branch elements (must be given in Ohm).
maxX Given threshold for the reactance of branch elements (must be given in Ohm).

R ETURNS
1 If terminal on which the method was called is electrical equivalent to terminal that
was passed as argument
0 Otherwise

E XAMPLE
int res;
res = Busbar1.IsElectrEquivalent(Busbar2, 0.05, 0.05);
if (res = 1) {
printf('%o is electrical equivalent to %o', Busbar1, Busbar2);
}
else {
printf('%o is not electrical equivalent to %o', Busbar1, Busbar2);
}

S EE ALSO

ElmTerm.IsEquivalent()

IsEquivalent*
Function checks if two terminals are topologically connected only by

• closed switching devices (ElmCoup, RelFuse) or

• lines of zero length (line droppers).

IsEquivalent defines a relation that is

• symmetric (Term1.IsEquivalent(Term2) -> Term2.IsEquivalent(Term1)),


• reflexive (Term1.IsEquivalent(Term1)) and
• transitive (Term1.IsEquivalent(Term2) and Term2.IsEquivalent(Term3) -> Term1.IsEquivalent(Term3));

int ElmTerm.IsEquivalent(object terminal)

A RGUMENTS
terminal Terminal (object of class ElmTerm) that is checked to be equivalent to the terminal
on which the function was called on. Passing NULL is not allowed and will result
in a scripting error.

281
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
1 If terminal on which the method was called is connected to terminal that was
passed as argument only by closed switching devices or by lines of zero length
0 Otherwise (terminals are not connected or connected by other components than
switching devices / lines of zero length)

E XAMPLE
int res;
! Assume Busbar1 and Busbar2 are two objects of class ElmTerm
res = Busbar1.IsEquivalent(Busbar2);
if (res = 1) {
printf('%o is equivalent to %o', Busbar1, Busbar2);
}
else {
printf('%o is not equivalent to %o', Busbar1, Busbar2);
}

S EE ALSO

ElmTerm.GetEquivalentTerminals() ElmTerm.IsElectrEquivalent()

IsInternalNodeInStation*
Function checks if the terminal is an internal node located in a station (ElmSubstat, ElmTrfstat).
int ElmTerm.IsInternalNodeInSubStation()

R ETURNS
1 Terminal is a node of usage ‘internal’ and is located in a station.
0 Not internal node or not in a station, or both.

D EPRECATED N AMES
IsInternalNodeInSubStation

UpdateSubstationTerminals
Updates all nodes within the substation to the new voltage and/or phase technology. Applicable
for all busbars and junction nodes. The highest voltage is taken as the leading one.
void ElmTerm.UpdateSubstationTerminals(int volt,
int phs
)

A RGUMENTS
volt Updates nominal voltages (<> 0)
phs Updates phase technology (<> 0)

282
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.31 ElmTow
Overview

Update

Update
Updates line couplings element depending on configuration of the associated tower types or
tower geometries.
void ElmTow.Update()

R ETURNS
1 Line couplings element was updated.
0 Update was not required.

3.2.32 ElmTr2
Overview

CreateEvent
GetGroundingImpedance*
GetSuppliedElements*
GetTapPhi*
GetTapRatio*
GetZ0pu*
GetZpu*
IsQuadBooster*
NTap*

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
int ElmTr2.CreateEvent([int tapAction,]
[int tapPos]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap.

R ETURNS
0 on success

283
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmTr2.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements*
Returns the network components that are supplied by the transformer.
A transformer is treated as supplying if it is located in a station. Transformers outside stations
are not supplying in this sense.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,

• network components that are not active (e.g. hidden or those of currently inactive grids),
• open switches,
• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
set ElmTr2.GetSuppliedElements([int inclNested])

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

284
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Elements supplied by this transformer. The set is empty if the transfomer is located outside
a station or if no element is topologically connected its HV side.

S EE ALSO

ElmTr3.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(), ElmTrfstat.GetSuppliedElements()

GetTapPhi*
Gets the tap phase shift in deg of the transformer for given tap position.
double ElmTr2.GetTapPhi(int itappos,
int inclPhaseShift
)

A RGUMENTS
itappos Tap position
inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transformer for given tap position

GetTapRatio*
Gets the voltage ratio of the transformer for given tap position.
double ElmTr2.GetTapRatio(int itappos,
int onlyTapSide,
int includeNomRatio
)

A RGUMENTS
itappos Tap position
onlyTapSide
1 = ratio only for given side., 0 = total ratio
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transformer for given tap position

GetZ0pu*
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.
void ElmTr2.GetZ0pu(int itappos,
double& r0pu,
double& x0pu,
int systembase)

285
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
itappos Tap position
r0pu (out)
Resistance in p.u.
x0pu (out)
Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu*
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
void ElmTr2.GetZpu(int itappos,
double& rpu,
double& xpu,
int systembase)

A RGUMENTS
itappos Tap position
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster*
Returns whether transformer is a quadbooster; i.e. checks phase shift angle modulus 180◦ .
int ElmTr2.IsQuadBooster()

R ETURNS
'1' if quadbooster, else '0'

E XAMPLE
set objsTr2;
object obj;
int isQuadBooster;
objsTr2 = GetCalcRelevantObjects('*.ElmTr2');

printf('This is a list of QBs in the network:');


for (obj = objsTr2.First(); obj; obj = objsTr2.Next())
{
isQuadBooster = obj.IsQuadBooster();
if(isQuadBooster=1) {

286
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

obj.ShowFullName();
}
}

NTap*
Gets the transformer tap position.
int ElmTr2.NTap()

R ETURNS
The tap position.

3.2.33 ElmTr3
Overview

CreateEvent
GetGroundingImpedance*
GetSuppliedElements*
GetTapPhi*
GetTapRatio*
GetTapZDependentSide*
GetZ0pu*
GetZpu*
IsQuadBooster*
NTap*

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
void ElmTr3.CreateEvent([int tapAction = 2,]
[int tapPos = 0,]
[int busIdx = 0]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic

tapPos (optional)
Position of tap.
busIdx (optional)
Bus index.

287
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmTr3.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements*
Returns the network components that are supplied by the transformer.
A transformer is treated as supplying if it is located in a station. Transformers outside stations
are not supplying in this sense.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,

• network components that are not active (e.g. hidden or those of currently inactive grids),
• open switches,
• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
set ElmTr3.GetSuppliedElements([int inclNested])

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

288
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Elements supplied by this transformer. The set is empty if the transfomer is located outside
a station or if no element is topologically connected its HV side.

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(), ElmTrfstat.GetSuppliedElements()

GetTapPhi*
Gets the tap phase shift in deg of the transformer for given tap position and side.
double ElmTr3.GetTapPhi(int iSide,
int itappos,
int inclPhaseShift
)

A RGUMENTS
iSide for tap at side (0=Hv, 1=Mv, 2=Lv)

itappos Tap position for corresponding side


inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transformer for given tap position and side

GetTapRatio*
Gets the voltage ratio of the transformer for given tap position and side.
double ElmTr3.GetTapRatio(int iSide,
int itappos,
int includeNomRatio
)

A RGUMENTS
iSide for tap at side (0=Hv, 1=Mv, 2=Lv)
itappos Tap position at corresponding side
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transformer for given tap position and side

GetTapZDependentSide*
Get tap side used for the dependent impedance
int ElmTr3.GetTapZDependentSide()

289
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
-1 if no tap dependent impedance is defined
0 for HV tap
1 for MV tap
2 for LV tap

GetZ0pu*
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.
void ElmTr3.GetZ0pu(int itappos,
int iSide,
double& r0pu,
double& x0pu,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-MV impedance.
1 Get the MV-LV impedance.
2 Get the LV-HV impedance.
r0pu (out)
Resistance in p.u.

x0pu (out)
Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu*
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
void ElmTr3.GetZpu(int itappos,
int iSide,
double& rpu,
double& xpu,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-MV impedance.

290
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

1 Get the MV-LV impedance.


2 Get the LV-HV impedance.

rpu (out) Resistance in p.u.


xpu (out) Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster*
Returns whether transformer is a quadbooster or not, i.e. checks phase shift angle modulus
180◦ .
int ElmTr3.IsQuadBooster()

R ETURNS
'1' if the transformer phase shift angle modulus 180◦ does not equal 0 at any of the sides LV,
MV, HV, else '0'

NTap*
Gets the transformer tap position of a given bus.
int ElmTr3.NTap(int bus)

A RGUMENTS
bus 0=HV, 1=MV, 2=LV

R ETURNS
The tap position.

3.2.34 ElmTr4
Overview

CreateEvent
GetGroundingImpedance*
GetSuppliedElements*
GetTapPhi*
GetTapRatio*
GetTapZDependentSide*
GetZ0pu*
GetZpu*
IsQuadBooster*
NTap*

291
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
void ElmTr4.CreateEvent([int tapAction = 2,]
[int tapPos = 0,]
[int busIdx = 0]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap.

busIdx (optional)
Bus index.

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmTr4.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.

resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements*
Returns the network components that are supplied by the transformer.
A transformer is treated as supplying if it is located in a station. Transformers outside stations
are not supplying in this sense.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),
• open switches,

292
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
set ElmTr4.GetSuppliedElements([int inclNested])

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

R ETURNS
Elements supplied by this transformer. The set is empty if the transfomer is located outside
a station or if no element is topologically connected its HV side.

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmSubstat.GetSuppliedElements(), ElmTrfstat.GetSuppliedElements()

GetTapPhi*
Gets the tap phase shift in deg of the transformer for given tap position and side.
double ElmTr4.GetTapPhi(int iSide,
int itappos,
int inclPhaseShift
)

A RGUMENTS
iSide for tap at side (0=HV, 1=LV1, 2=Lv2, 3=Lv3)
itappos Tap position for corresponding side
inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transformer for given tap position and side

GetTapRatio*
Gets the voltage ratio of the transformer for given tap position and side.
double ElmTr4.GetTapRatio(int iSide,
int itappos,
int includeNomRatio
)

293
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
iSide for tap at side (0=HV, 1=LV1, 2=Lv2, 3=Lv3)
itappos Tap position at corresponding side
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transformer for given tap position and side

GetTapZDependentSide*
Get tap side used for the dependent impedance
int ElmTr4.GetTapZDependentSide()

R ETURNS
-1 if no tap dependent impedance is defined
0 for HV tap
1 for LV1 tap
2 for LV2 tap
2 for LV3 tap

GetZ0pu*
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.
void ElmTr4.GetZ0pu(int itappos,
int iSide,
double& r0pu,
double& x0pu,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-LV1 impedance.
1 Get the HV-LV2 impedance.
2 Get the HV-LV3 impedance.
3 Get the LV1-LV2 impedance.
4 Get the LV1-LV3 impedance.
5 Get the LV2-LV3 impedance.
r0pu (out)
Resistance in p.u.
x0pu (out)
Reactance in p.u.

294
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu*
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
void ElmTr4.GetZpu(int itappos,
int iSide,
double& rpu,
double& xpu,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-LV1 impedance.
1 Get the HV-LV2 impedance.
2 Get the HV-LV3 impedance.
3 Get the LV1-LV2 impedance.
4 Get the LV1-LV3 impedance.
5 Get the LV2-LV3 impedance.
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster*
Returns whether transformer is a quadbooster or not, i.e. checks phase shift angle modulus
180◦ .
int ElmTr4.IsQuadBooster()

R ETURNS
'1' if the transformer phase shift angle modulus 180◦ does not equal 0 at any of the sides HV,
LV1, LV2, LV3, else '0'

NTap*
Gets the transformer tap position.
int ElmTr4.NTap(double busIdx)

295
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
busIdx 0=HV, 1=MV, 2=LV

R ETURNS
The tap position.

3.2.35 ElmTrain
Overview

SetPosition

SetPosition
Set the position (line and postion in km) of the train
int ElmTrain.SetPosition(DBObject* line, double position)

R ETURNS
1 error, train position cannot be set
0 ok

3.2.36 ElmTrb
Overview

GetGroundingImpedance*

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmTrb.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.

resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

296
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.37 ElmTrfstat
Overview

GetSplit*
GetSplitCal*
GetSplitIndex*
GetSuppliedElements*

GetSplit*
A split of a station is a group of topologically connected elements. Such a group is called split
if all contained components are energized and there is at least one busbar (terminal of usage
'busbar') contained or it has connections to at least two main components (= all components
except switch devices and terminals).
These splits are ordered according to the count of nodes contained and according to their
priority. So each split becomes a unique index.
The function GetSplit offers access to the elements contained in a split. By calling GetSplit with
an index from 0 to n, the elements belonging to the corresponding split are filled into given sets
and returned.
int ElmTrfstat.GetSplit(int index,
set& mainNodes,
[set& connectionCubicles,]
[set& allElements]
)

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Value
must be ≥ 0.
mainNodes (out)
Terminals of same usage considered to form the most important nodes for that
group. In most cases, this is the group of contained busbars.
connectionCubicles (optional, out)
All cubicles (of terminals inside the station) that point to an element that sits out-
side the station or to an element that is connected to a terminal outside the station
are filled into the set connectionCubicles. (The connection element (branch) can
be accessed by calling GetBranch() on each of these cubicles. The terminals
of these cubicles (parents) must not necessarily be contained in any split. They
could also be separated by a disconnecting component.)
allElements(optional, out)
All elements (class Elm*) of the split that have no connection to elements outside
the station are filled into this set.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

E XAMPLE
set nodes;
set cubicles;
set elements;

297
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

int return, index;


object obj;

return = 0;
while (return <> 1) { !loop from 0 to n until there is no more split
return = station.GetSplit(index, nodes, cubicles, elements);

printf('Split %d:', index);

printf('Major Nodes:');
obj = nodes.First();
while(obj) {
obj.ShowFullName();
obj = nodes.Next();
}

printf('Connection Cubicles:');
obj = cubicles.First();
while(obj) {
obj.ShowFullName();
obj = cubicles.Next();
}

printf('All Elements:');
obj = elements.First();
while(obj) {
obj.ShowFullName();
obj = elements.Next();
}

index = index + 1;
}

S EE ALSO

ElmTrfstat.GetSplitCal(), ElmTrfstat.GetSplitIndex(),

GetSplitCal*
This function determines the elements that belong to a split. In contrast to ElmTrfstat.GetSplit()
it is based on calculation instead of pure edit object topology. This means the returned nodes
correspond to the calculation nodes, the interconnecting cubicles are those connecting nodes
of different splits.
Note: As this function relies on calculation nodes it can only be executed after a calculation has
been performed (e.g. load flow calculation).
int ElmTrfstat.GetSplitCal(int index,
set& nodes,
[set& connectionCubicles,]
[set& elements])

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Refers
to same split as index in ElmTrfstat.GetSplit().
Value must be ≥ 0.
nodes (out)
A set that is filled with terminals. There is one terminal returned for each calcula-

298
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

tion node in the split.


connectionCubicles (optional, out)
This set is filled with all cubicles that point from a calculation node of current split
to another calculation node that does not belong to that split. The connecting
element can be accessed by calling GetBranch() on such a cubicle.
elements (optional, out)
This set is filled with network elements that are connected to a calculation node of
current split and have exactly one connection, i.e. these elements are completely
contained in the split.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

E XAMPLE
set nodes;
set cubicles;
set elements;
int return, index;
object obj;

return = 0;
while (return <> 1) { !loop from 0 to n until there is no more split
return = station.GetSplitCal(index, nodes, cubicles, elements);

if (return < 1) {
if (return = 0) {
printf('Split %d:', index);
}
else {
printf('(Pseudo)Split %d:', index);
}
printf('Major Nodes:');
obj = nodes.First();
while(obj) {
obj.ShowFullName();
obj = nodes.Next();
}

printf('Connection Cubicles:');
obj = cubicles.First();
while(obj) {
obj.ShowFullName();
obj = cubicles.Next();
}

printf('Elements:');
obj = elements.First();
while(obj) {
obj.ShowFullName();
obj = elements.Next();
}
}
index = index + 1;
}

299
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

S EE ALSO

ElmTrfstat.GetSplit()

GetSplitIndex*
This function returns the index of the split that contains passed object.
int ElmTrfstat.GetSplitIndex(object o)

A RGUMENTS
o Object for which the split index is to be determined.

R ETURNS
≥0 index of split in which element is contained
-1 given object does not belong to any split of that station

E XAMPLE
set stations, terms;
object substation, term;
string name;
int index;

!iterates over all substations and checks belonging


!of terminals to splits of each substation

stations = GetCalcRelevantObjects('*.ElmSubstat');

for (substation = stations.First(); substation; substation = stations.Next()) {


name = substation.GetFullName(0);
printf('\nSubstation: %s', name);

terms = substation.GetContents('*.ElmTerm');

for (term = terms.First(); term; term = terms.Next()) {


index = substation.GetSplitIndex(term);
name = term.GetFullName(0);
if (index < 0) {
printf(' %s is not contained in any split of that substation', name);
}
else {
printf(' %s belongs to split %d', name, index);
}
}
}

S EE ALSO

ElmTrfstat.GetSplit()

300
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetSuppliedElements*
Returns the network components that are supplied by the transformer (located in the station). A
network component is considered to be supplied by a transformer if a topological path from the
transformer to the component exists. A valid topological path in this sense is a path that starts
at the transformer’s HV side in direction of transformer (not in direction of HV connected node)
and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),

• open switches,
• connections leading to a higher voltage level.

Generally, all network components of such a path are considered to be supplied by the trans-
former.
Exceptions are components that are out of calculation or in-active. Those components are never
considered to be supplied by any transformer. A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
set ElmTrfstat.GetSuppliedElements([int inclNested])

A RGUMENTS
inclNested (optional)
0 Do not include components that are supplied by nested supplying sta-
tions
1 (default) Include components that are supplied by nested stations

S EE ALSO

ElmTr2.GetSuppliedElements(), ElmTr3.GetSuppliedElements()

3.2.38 ElmVac
Overview

GetGroundingImpedance*

GetGroundingImpedance*
Returns the impedance of the internal grounding. Single phase voltage source connected to
neutral are considered as grounding devices themselves; i.e. instead of the dedicated grounding
parameters, the R1,X1 parameters are used.
int ElmVac.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

301
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

3.2.39 ElmVoltreg
Overview

CreateEvent*
GetGroundingImpedance*
GetZpu*
NTap*

CreateEvent*
For the corresponding voltage regulator, a Tap Event (EvtTap) is created for the simulation.
void ElmVoltreg.CreateEvent([int tapAction = 2,]
[int tapPos = 0]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmVoltreg.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

302
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetZpu*
Gets the impedance in p.u. of the voltage regulator for the specified tap position. If the tap
position is out of the tap changer range, the respective min. or max. position will be used.
void ElmVoltreg.GetZpu(int itappos,
double& rpu,
double& xpu,
int systembase)

A RGUMENTS
itappos Tap position
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.

systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

NTap*
Gets the voltage regulator tap position.
int ElmVoltreg.NTap(int tap)

A RGUMENTS
tap 0=Tap 1, 1=Tap 2, 2=Tap 3

R ETURNS
The tap position.

3.2.40 ElmXnet
Overview

CalcEfficiency
Disconnect
GetGroundingImpedance*
GetStepupTransformer*
Reconnect

303
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalcEfficiency
Calculate efficiency for connected storage model at given active power value.
double ElmXnet.CalcEfficiency(double activePowerMW)

A RGUMENTS
activePowerMW
Active power value to calculate efficiency for.

R ETURNS
Returns the resulting efficiency in p.u.

E XAMPLE
set objs;
object obj;
int err;
double eff, Ptherm, Pelect;

Pelect = 30.0;
objs = GetCalcRelevantObjects('*.ElmXnet');

obj = objs.First();
if (obj) {
eff = obj.CalcEfficiency(Pelect);
Ptherm = Pelect/eff;
}

Disconnect
Disconnects a static generator by opening the first circuit breaker. The topological search
performed to find such a breaker, stops at any busbar.
int ElmXnet.Disconnect()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmXnet,*.ElmGenstat,*.ElmPvsys');

! disconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Disconnect();
if (err) {
printf('Error disconnecting %s', obj);
}
}

304
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmXnet.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetStepupTransformer*
Performs a topological search to find the step-up transformer of an external grid
object ElmXnet.GetStepupTransformer(double voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

Reconnect
Connects a static generator by closing all switches (breakers and isolators) up to the first breaker
on the HV side of a transformer. The topological search to find all the switches, stops at any
busbar.
int ElmXnet.Reconnect()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

305
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set objs;
object obj;
int err;

objs = GetCalcRelevantObjects('*.ElmXnet,*.ElmGenstat,*.ElmPvsys');

! reconnect all generators

for (obj = objs.First(); obj; obj = objs.Next()) {


err = obj.Reconnect();
if (err) {
printf('Error connecting %s', obj);
}
}

3.2.41 ElmZone
Overview

CalculateInterchangeTo*
CalculateVoltageLevel*
CalculateVoltInterVolt*
DefineBoundary
GetAll*
GetBranches*
GetBuses*
GetObjs*
SetLoadScaleAbsolute

CalculateInterchangeTo*
Calculates interchange power to the given zone (calculated quantities are: Pinter, Qinter, Pex-
port, Qexport, Pimort, Qimport). Prior the calculation the valid load flow calculation is required.
int ElmZone.CalculateInterchangeTo(object zone)

A RGUMENTS
zone zone to which the interchange is calculated

R ETURNS
<0 calculation error (i.e. no valid load flow, empty zone...)
0 no interchange power to the given zone
1 interchange power calculated

E XAMPLE
object ZoneA, ZoneB; ! externally defined (i.e. input)
ZoneA = inputA;
ZoneB = inputB;
object Ldf = GetFromStudyCase('ComLdf');
Ldf.Execute();
ZoneA.CalculateInterchangeTo(ZoneB);
printf('Interchange Pinter from %o to %o is %f MW', ZoneA, ZoneB, ZoneA:c:Pinter);

306
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CalculateVoltageLevel*
Internal funciton to calculate per voltage level the corresponding summary results. The values
are stored in current zone (values from the previous load flow calculation are overwritten):
int ElmZone.CalculateVoltageLevel(double U)

A RGUMENTS
U for voltage level (in kV)

R ETURNS
<0 error
=0 voltage level not exists in the zone
>0 ok

CalculateVoltInterVolt*
This function calculates the power flow from voltage level to voltage level. The values are stored
in current area in the following attributes (values from the previous load flow calculation are
overwritten):

- Pinter: Active Power Flow


- Qinter: Reactive Power Flow
- ExportP: Export Active Power Flow
- ExportQ: Export Reactive Power Flow
- ImportP: Import Active Power Flow
- ImportQ: Import Reactive Power Flow

int ElmZone.CalculateVoltInterVolt(double Ufrom, double Uto)

A RGUMENTS
Ufrom from voltage level (in kV)
Uto to voltage level (in kV)

R ETURNS
<0 error
=0 voltage levels not exists in the area, no interchange exists
>0 ok

DefineBoundary
Defines boundary with this zone as interior part. Resulting cubicles of boundary are busbar-
oriented towards the zone.
object ElmZone.DefineBoundary(int shift)

307
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
shift Elements outside the zone that are within a distance of shift many elements to
a boundary cubicle of the zone are added to the interior part of the resulting
boundary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

E XAMPLE
external object: "thisZone"
double shift;
object newBoundary;
shift = 2;
newBoundary = thisZone.DefineBoundary(shift);
if ({newBoundary <> NULL}) {
printf('Defined boundary %o by shifting %d elements!', newBoundary, shift);
}

GetAll*
Returns all objects which belong to this zone.
set ElmZone.GetAll()

R ETURNS
The set of objects.

E XAMPLE
set all,zones;
object prj,zone,obj;
! output elements in the zone
prj = GetActiveProject();
if (prj) {
zones = prj.GetContents('*.ElmZone',1);
zones.SortToVar(0,'loc_name');
for (zone=zones.First(); zone; zone=zones.Next()) {
printf('Elements in zone %s',zone:loc_name);
all = zone.GetAll();
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetBranches*
Returns all branches which belong to this zone.
set ElmZone.GetBranches()

308
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
The set of branch objects.

E XAMPLE
set all,zones;
object prj,zone,obj;
! output elements in the zone
prj = GetActiveProject();
if (prj) {
zones = prj.GetContents('*.ElmZone',1);
zones.SortToVar(0,'loc_name');
for (zone=zones.First(); zone; zone=zones.Next()) {
printf('Branches in zone %s',zone:loc_name);
all = zone.GetBranches();
for (obj=all.First(); obj; obj=all.Next()) {
printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

GetBuses*
Returns all buses which belong to this zone.
set ElmZone.GetBuses()

R ETURNS
The set of objects.

GetObjs*
Returns all objects of the given class which belong to this zone.
set ElmZone.GetObjs(string classname)

A RGUMENTS
classname
name of the class (i.e. ”ElmTr2”)

R ETURNS
The set of contained objects.

E XAMPLE
set all,zones;
object prj,zone,obj;
! output cubicles in the zone
prj = GetActiveProject();
if (prj) {
zones = prj.GetContents('*.ElmZone',1);
zones.SortToVar(0,'loc_name');
for (zone=zones.First(); zone; zone=zones.Next()) {
printf('Cubicles in zone %s',zone:loc_name);
all = zone.GetObjs('StaCubic');

309
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

for (obj=all.First(); obj; obj=all.Next()) {


printf('%s\\%s',obj:r:fold_id:loc_name,obj:loc_name);
}
}
}

SetLoadScaleAbsolute
Readjusts zonal load scaling factor to the given active power. The zonal load scaling factor is
the ratio of the given active power and the loads total actual power.
void ElmZone.SetLoadScaleAbsolute(double Pin)

A RGUMENTS
Pin active power in MW used for the load scaling factor.

3.3 Station Elements

3.3.1 StaCt
Overview

SetPrimaryTap

SetPrimaryTap
Determines the best matching primary tap for the connected branch, so that IN om,Branch ·
mltF actor ≤ IP ri. If no tap satisfies the equation, the largest tap is used.
int StaCt.SetPrimaryTap([double mltFactor])

A RGUMENTS
mltFactor (optional)
Multiplication factor (default 1.0)

R ETURNS
0 Correctly set.
1 Error.

310
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

3.3.2 StaCubic
Overview

AddBreaker
GetAll*
GetBranch*
GetConnectedMajorNodes*
GetConnections*
GetNearestBusbars*
GetPathToNearestBusbar*
GetRemoteBorderCubicles
GetSwitch
IsClosed*
IsConnected*
RemoveBreaker

AddBreaker
This function creates a new switch (StaSwitch) inside this cubicle. The switch is created only if
no switch previously existed.
A switch object created by this function is always of usage 'circuit-breaker' and its state is
'closed'.
object StaCubic.AddBreaker()

R ETURNS
• StaSwitch object in case a new switch was created
• NULL if no object was created. This means a StaSwitch object already exists.

E XAMPLE
set cubics;
object cubic, staSwitch;
cubics = GetCalcRelevantObjects('*.StaCubic');
!create StaSwitches in all cubicles that do not contain a switch yet
for(cubic = cubics.First(); cubic; cubic = cubics.Next()) {
staSwitch = cubic.AddBreaker();
if (staSwitch) {
staSwitch.ShowFullName();
}
}

GetAll*
This function returns a set of network components that are collected by a topological traversal
starting from this cubicle.
set StaCubic.GetAll([int direction = 1,]
[int ignoreOpenSwitches = 0]
)

A RGUMENTS
direction (optional)
Specifies the direction in which the network topology is traversed.

311
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

1 Traversal to the branch element (default).


0 Traversal to the terminal element.

ignoreOpenSwitches (optional)
Determines whether to pass open switches or to stop at them.
0 The traversal stops in a direction if an open switch is reached (default).
1 Ignore all switch statuses and pass every switch.

R ETURNS
A set of network components that are collected by a topological traversal starting at the
cubicle (StaCubic) where the function is called.

E XAMPLE
For a defined variable ”cubic” pointing to a cubicle in a net:
set components;
object component;

components = cubic.GetAll(); !same as cubic.GetAll(1, 0);

!Pass open switches:


!components = cubic.GetAll(1, 1);

!Walk in opposite direction:


!components = cubic.GetAll(0); !equivalent to cubic.GetAll(0, 0);

!Walk in opposite direction and ignore switch states:


!components = cubic.GetAll(0, 1);

components.MarkInGraphics();

for (component = components.First(); component; component = components.Next()) {


component.ShowFullName();
}

GetBranch*
Function gets the branch of this cubicle.
object StaCubic.GetBranch()

R ETURNS
Branch object.

GetConnectedMajorNodes*
This function returns all busbars being part of a split (inside a station) that can be reached by
starting a topology search from the cubicle in direction of the branch element.
set StaCubic.GetConnectedMajorNodes ([double swtStat])

312
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
swtStat
0 (default) First perform a search that respects switch states (stoping at open
switches). If no switches are found, an additional search with ignoring
switch states.
1 Perform one search ignoring switch states (passing open and closed
switches).
2 Search with respecting switch states. But do no additional search when
switch is found.

R ETURNS
A set of all busbars that can be reached starting a topology search from the cubicle in
direction of the branch element.

E XAMPLE
object substat, cub, obj;
set nodes, buses, cubicles, elements, allCubicles, terms;
int index, return;
string name;

!displays all connected major nodes for all connection cubicles


!of all substations

nodes = GetCalcRelevantObjects('*.ElmSubstat');

for (substat = nodes.First(); substat; substat = nodes.Next()) {


allCubicles.Clear();

index = 0;
return = 0;
while (return <> 1) {
return = substat.GetSplit(index, buses, cubicles, elements);
if (return = 0) {
allCubicles.Add(cubicles);
}
index = index +1;
}
for(cub = allCubicles.First(); cub; cub = allCubicles.Next()) {
name = cub.GetFullName(0);
printf('\nMajor Nodes cubicle %s is connected to:', name);
terms = cub.GetConnectedMajorNodes(0);
for (obj = terms.First(); obj; obj = terms.Next()) {
obj.ShowFullName();
}
}
}

GetConnections*
Function gets all elements connected with this cubicle.
set StaCubic.GetConnections(int swtStat)

A RGUMENTS
swtStat Consider switch status (1) or not (0).

313
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Set of elements.

GetNearestBusbars*
Function searches for connected and connectable nearest busbars starting at the cubicle.
Search stops at the nearest busbars and out of service elements. Internal and junction nodes,
all types of branch elements and all types of switches - i.e. circuit breakers and disconnectors -
are passed.
Connected busbars are all busbars which are topologically connected to the start cubicle without
passing open switches. Connectable busbars are all busbars which are connectable to the start
cubicle by closing switches. If the start cubicles terminal is a busbar then this busbar is not
included in the result sets.
If more than one path exists between cubicle and a nearest busbar the relevant busbar is added
only once to the result set.
void StaCubic.GetNearestBusbars(set& connectedBusbars,
set& connectableBusbars,
int searchDirection,
[int excludeZPUs])

A RGUMENTS
connectedBusbars (out)
Found connected busbars.
connectableBusbars (out)
Found connectable busbars.
searchDirection
Direction of the search relative to the cubicle. Possible values are
0 search in all directions
1 search in direction of cubicles terminal
2 search towards connected branch element
excludeZPUs (optional)
Whether ZPU (ElmZpu) should be ignored in the search. Default=0.

E XAMPLE
set switches, connected, connectable;
object switch, cubicle, element;
int direction;

!Search in all directions


direction = 0;

switches = GetCalcRelevantObjects('ElmCoup');

for(switch = switches.First(); switch; switch = switches.Next()){


cubicle = switch:bus1;

if(cubicle){
cubicle.GetNearestBusbars(connected, connectable, direction);

printf('Connected busbars to %o:', cubicle);


for(element = connected.First(); element; element = connected.Next()){

314
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

printf('%o', element);
}

printf('Connectable busbars to %o:', cubicle);


for(element = connectable.First(); element; element = connectable.Next()){
printf('%o', element);
}
}
}

GetPathToNearestBusbar*
Function determines the path from the cubicle to the given busbar. The busbar must be
connected or connectable to the start cubicle without passing additional busbars. If the given
busbar is not a nearest busbar in relation to the cubicle an empty path is returned.
If more than one closed path exists between cubicle and busbar the elements of all these paths
are combined.
set StaCubic.GetPathToNearestBusbar(object nearestBusbar, [int excludeZPUs])

A RGUMENTS
nearestBusbar
Nearest busbar in relation to cubicle.
excludeZPUs (optional)
Whether ZPU (ElmZpu) should be ignored in the search. Default=0.

R ETURNS
Net elements of the path from cubicle to busbar.

E XAMPLE
set switches, connected, connectable, path;
object switch, cubicle, busbar, element;
int direction;

!Search in all directions


direction = 0;

switches = GetCalcRelevantObjects('ElmCoup');

for(switch = switches.First(); switch; switch = switches.Next()){


cubicle = switch:bus1;

if(cubicle){
cubicle.GetNearestBusbars(connected, connectable, direction);

for(busbar = connected.First(); busbar; busbar = connected.Next()){


path = cubicle.GetPathToNearestBusbar(busbar);

printf('Path from %o to busbar %o:', cubicle, busbar);


for(element = path.First(); element; element = path.Next()){
printf('%o', element);
}
}

315
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetRemoteBorderCubicles
This function returns all border cubicles of opposing substations that can be reached when
starting a topological search on a cubicle. Search is always branch oriented.
void StaCubic.GetRemoteBorderCubicles(set& outCubicles,
set& outNodes,
int considerSwitchStates)

A RGUMENTS
outCubicles (out)

outNodes (out)

considerSwitchStates (out)

E XAMPLE
set nodes, cubicles;
set remoteCubicles, remoteNodes;
int return, index, i, count;
object obj, obj2, obj3;

return = 0;
while (1){ !loop from 0 to n until there is no more split

return = substation.GetSplit(index, nodes, cubicles, elements);


if (return = 1) {
break;
}

printf('-----------');
printf('Split %d:', index);
printf('\nMajor Nodes:');
obj = nodes.First();
while(obj){
obj.ShowFullName();
obj = nodes.Next();
}

printf('\nConnection Cubicles:');
obj = cubicles.First();
while(obj){
obj.ShowFullName();
obj.GetRemoteBorderCubicles(remoteCubicles, remoteNodes, 0);
count = remoteCubicles.Count();
printf(' Remote:');
for(i=0; i<count; i+=1) {
obj2 = remoteCubicles.Obj(i);
obj3 = remoteNodes.Obj(i);
printf(' cubicle: %component node %component', obj2, obj3);
}
obj = cubicles.Next();

316
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

}
index = index + 1;
}

GetSwitch
This function returns the switch stored in the cubicle.
object StaCubic.GetSwitch()

R ETURNS
Switch object.

IsClosed*
Function checks if this cubicle is directly connected with the busbar, considering the switch
status.
int StaCubic.IsClosed()

R ETURNS
0 Disconnected cubicle.
1 Connected cubicle.

IsConnected*
Function checks if the cubicle is connected to the passed terminal or coupler.
int StaCubic.IsConnected(object elm,
int swtStat
)

A RGUMENTS
elm Terminal or coupler to check connection with.
swtStat Consider switch status (1) or not (0).

R ETURNS
0 Not connected.
1 Connected.

RemoveBreaker
This function deletes all switches stored in the cubicle.
void StaCubic.RemoveBreaker()

317
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

E XAMPLE
set cubics;
object cubic;
cubics = GetCalcRelevantObjects('*.StaCubic');
!delete StaSwitches from all cubicles
for(cubic = cubics.First(); cubic; cubic = cubics.Next()) {
cubic.RemoveBreaker();
}

3.3.3 StaExtbrkmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtbrkmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for the switch position currently stored in the measurement object.
int StaExtbrkmea.GetMeaValue(double& value)

A RGUMENTS
value (out)
Value for switch status.

R ETURNS
Return value has no meaning. It is always 0.

318
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtbrk-
mea.SetStatus() for details on the status bits.
int StaExtbrkmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtbrkmea.SetStatus() for details on the status bits.
int StaExtbrkmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtbrkmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtbrkmea.SetStatus() for details
on the status bits.
int StaExtbrkmea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtbrk-
mea.SetStatus() for details on the status bits.
int StaExtbrkmea.IsStatusBitSetTmp(int mask)

319
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtbrkmea.SetStatus() for details on the status
bits.
void StaExtbrkmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtbrkmea.SetStatus()
for details on the status bits.
void StaExtbrkmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value for the switch position currently stored in the measurement object.
int StaExtbrkmea.SetMeaValue(int value)

A RGUMENTS
value New value for switch status.

R ETURNS
Return value has no meaning. It is always 0.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtbrkmea.SetMeaValue(double value)

A RGUMENTS
value New value.

320
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtbrkmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtbrkmea.SetStatus() for details on the status
bits.
void StaExtbrkmea.SetStatusBit(int mask, int dbSync)

321
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtbrkmea.SetStatus()
for details on the status bits.
void StaExtbrkmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtbrkmea.SetStatus() for details on
the status bits.
void StaExtbrkmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtbrkmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

322
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtbrkmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.4 StaExtcmdmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtcmdmea.CopyExtMeaStatusToStatusTmp()

323
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetMeaValue
Returns the value for command interpreted as floating point value.
int StaExtcmdmea.GetMeaValue(double& value)

A RGUMENTS
value (out)
Value obtained by parsing stored command string as floating point value.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtcmd-
mea.SetStatus() for details on the status bits.
int StaExtcmdmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtcmdmea.SetStatus() for details on the status bits.
int StaExtcmdmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtcmdmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtcmdmea.SetStatus() for details
on the status bits.
int StaExtcmdmea.IsStatusBitSet(int mask)

324
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtcmd-
mea.SetStatus() for details on the status bits.
int StaExtcmdmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtcmdmea.SetStatus() for details on the
status bits.
void StaExtcmdmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtcmdmea.SetStatus()
for details on the status bits.
void StaExtcmdmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtcmdmea.SetMeaValue(double value)

A RGUMENTS
value New value.

325
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtcmdmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtcmdmea.SetStatus() for details on the status
bits.
void StaExtcmdmea.SetStatusBit(int mask, int dbSync)

326
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtcmdmea.SetStatus()
for details on the status bits.
void StaExtcmdmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtcmdmea.SetStatus() for details on
the status bits.
void StaExtcmdmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtcmdmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

327
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtcmdmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.5 StaExtdatmea
Overview

CopyExtMeaStatusToStatusTmp
CreateEvent
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtdatmea.CopyExtMeaStatusToStatusTmp()

CreateEvent
Creates a “parameter change” event for controller object (’pCtrl’) and attribute (’varName’). The
event is stored in simulation event list and executed immediately.
void StaExtdatmea.CreateEvent()

328
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetMeaValue
Returns the value stored in the measurement object.
int StaExtdatmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value, optionally modified by configured multiplicator
unused Not used.

applyMultiplicator
If 1 (default), returned value will be modified by the multiplicator stored in the
measurement object (depending on Mode incremental/absolute). If 0, raw value
will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtdat-
mea.SetStatus() for details on the status bits.
int StaExtdatmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtdatmea.SetStatus() for details on the status bits.
int StaExtdatmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtdatmea.InitTmp()

329
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtdatmea.SetStatus() for details
on the status bits.
int StaExtdatmea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtdat-
mea.SetStatus() for details on the status bits.
int StaExtdatmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtdatmea.SetStatus() for details on the status
bits.
void StaExtdatmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtdatmea.SetStatus()
for details on the status bits.
void StaExtdatmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtdatmea.SetMeaValue(double value)

330
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data

bit1 0x00000002 Tele-Measurement


bit2 0x00000004 Disturbance
bit3 0x00000008 Protection

bit4 0x00000010 Marked suspect


bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event
bit7 0x00000080 Event Block.

bit8 0x00000100 Alarm Block.


bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.

bit29 0x20000000 Read


bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

void StaExtdatmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtdatmea.SetStatus() for details on the status
bits.
void StaExtdatmea.SetStatusBit(int mask, int dbSync)

331
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtdatmea.SetStatus()
for details on the status bits.
void StaExtdatmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtdatmea.SetStatus() for details on
the status bits.
void StaExtdatmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtdatmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

332
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtdatmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.6 StaExtfmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtfmea.CopyExtMeaStatusToStatusTmp()

333
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetMeaValue
Returns the value for frequency currently stored in the measurement object.
int StaExtfmea.GetMeaValue(double& value)

A RGUMENTS
value (out)
Value for frequency.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtfmea.SetStatus()
for details on the status bits.
int StaExtfmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtfmea.SetStatus() for details on the status bits.
int StaExtfmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtfmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtfmea.SetStatus() for details on
the status bits.
int StaExtfmea.IsStatusBitSet(int mask)

334
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtfmea.SetStatus()
for details on the status bits.
int StaExtfmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtfmea.SetStatus() for details on the status
bits.
void StaExtfmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtfmea.SetStatus()
for details on the status bits.
void StaExtfmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtfmea.SetMeaValue(double value)

A RGUMENTS
value New value.

335
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtfmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtfmea.SetStatus() for details on the status bits.
void StaExtfmea.SetStatusBit(int mask, int dbSync)

336
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtfmea.SetStatus() for
details on the status bits.
void StaExtfmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtfmea.SetStatus() for details on the
status bits.
void StaExtfmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtfmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

337
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtfmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.7 StaExtfuelmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtfuelmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for fuel currently stored in the measurement object.
int StaExtfuelmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

338
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value (out)
Value for fuel, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtfu-
elmea.SetStatus() for details on the status bits.
int StaExtfuelmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtfuelmea.SetStatus() for details on the status bits.
int StaExtfuelmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtfuelmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtfuelmea.SetStatus() for details
on the status bits.
int StaExtfuelmea.IsStatusBitSet(int mask)

339
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtfu-
elmea.SetStatus() for details on the status bits.
int StaExtfuelmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtfuelmea.SetStatus() for details on the status
bits.
void StaExtfuelmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtfuelmea.SetStatus()
for details on the status bits.
void StaExtfuelmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtfuelmea.SetMeaValue(double value)

A RGUMENTS
value New value.

340
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtfuelmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtfuelmea.SetStatus() for details on the status
bits.
void StaExtfuelmea.SetStatusBit(int mask, int dbSync)

341
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtfuelmea.SetStatus()
for details on the status bits.
void StaExtfuelmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtfuelmea.SetStatus() for details on
the status bits.
void StaExtfuelmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtfuelmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

342
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtfuelmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.8 StaExtimea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtimea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for current currently stored in the measurement object.
int StaExtimea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

343
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value (out)
Value for current, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaEx-
timea.SetStatus() for details on the status bits.
int StaExtimea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtimea.SetStatus() for details on the status bits.
int StaExtimea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtimea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtimea.SetStatus() for details on
the status bits.
int StaExtimea.IsStatusBitSet(int mask)

344
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaEx-
timea.SetStatus() for details on the status bits.
int StaExtimea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtimea.SetStatus() for details on the status
bits.
void StaExtimea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtimea.SetStatus()
for details on the status bits.
void StaExtimea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtimea.SetMeaValue(double value)

A RGUMENTS
value New value.

345
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtimea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtimea.SetStatus() for details on the status bits.
void StaExtimea.SetStatusBit(int mask, int dbSync)

346
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtimea.SetStatus() for
details on the status bits.
void StaExtimea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtimea.SetStatus() for details on the
status bits.
void StaExtimea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtimea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

347
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtimea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.9 StaExtpfmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtpfmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for power factor currently stored in the measurement object.
int StaExtpfmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

348
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value (out)
Value for current, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtpfmea.SetStatus()
for details on the status bits.
int StaExtpfmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtpfmea.SetStatus() for details on the status bits.
int StaExtpfmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtpfmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtpfmea.SetStatus() for details on
the status bits.
int StaExtpfmea.IsStatusBitSet(int mask)

349
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtpfmea.SetStatus()
for details on the status bits.
int StaExtpfmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtpfmea.SetStatus() for details on the status
bits.
void StaExtpfmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtpfmea.SetStatus()
for details on the status bits.
void StaExtpfmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtpfmea.SetMeaValue(double value)

A RGUMENTS
value New value.

350
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtpfmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtpfmea.SetStatus() for details on the status
bits.
void StaExtpfmea.SetStatusBit(int mask, int dbSync)

351
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtpfmea.SetStatus() for
details on the status bits.
void StaExtpfmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtpfmea.SetStatus() for details on
the status bits.
void StaExtpfmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtpfmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

352
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtpfmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.10 StaExtpmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtpmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for active power stored in the measurement object.
int StaExtpmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

353
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value (out)
Value for active power, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtp-
mea.SetStatus() for details on the status bits.
int StaExtpmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtpmea.SetStatus() for details on the status bits.
int StaExtpmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtpmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtpmea.SetStatus() for details on
the status bits.
int StaExtpmea.IsStatusBitSet(int mask)

354
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtp-
mea.SetStatus() for details on the status bits.
int StaExtpmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtpmea.SetStatus() for details on the status
bits.
void StaExtpmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtpmea.SetStatus()
for details on the status bits.
void StaExtpmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtpmea.SetMeaValue(double value)

A RGUMENTS
value New value.

355
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtpmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtpmea.SetStatus() for details on the status
bits.
void StaExtpmea.SetStatusBit(int mask, int dbSync)

356
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtpmea.SetStatus() for
details on the status bits.
void StaExtpmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtpmea.SetStatus() for details on
the status bits.
void StaExtpmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtpmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

357
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtpmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.11 StaExtqmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtqmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for reactive power currently stored in the measurement object.
int StaExtqmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

358
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
value (out)
Value for reactive power, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaEx-
tqmea.SetStatus() for details on the status bits.
int StaExtqmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtqmea.SetStatus() for details on the status bits.
int StaExtqmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtqmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtqmea.SetStatus() for details on
the status bits.
int StaExtqmea.IsStatusBitSet(int mask)

359
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaEx-
tqmea.SetStatus() for details on the status bits.
int StaExtqmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtqmea.SetStatus() for details on the status
bits.
void StaExtqmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtqmea.SetStatus()
for details on the status bits.
void StaExtqmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtqmea.SetMeaValue(double value)

A RGUMENTS
value New value.

360
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write

bit31 0x80000000 Neglected by SE

void StaExtqmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtqmea.SetStatus() for details on the status
bits.
void StaExtqmea.SetStatusBit(int mask, int dbSync)

361
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtqmea.SetStatus() for
details on the status bits.
void StaExtqmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtqmea.SetStatus() for details on
the status bits.
void StaExtqmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtqmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

362
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtqmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.12 StaExtsmea
Overview

CopyExtMeaStatusToStatusTmp
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtsmea.CopyExtMeaStatusToStatusTmp()

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtsmea.SetStatus()
for details on the status bits.
int StaExtsmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

363
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtsmea.SetStatus() for details on the status bits.
int StaExtsmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtsmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtsmea.SetStatus() for details on
the status bits.
int StaExtsmea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtsmea.SetStatus()
for details on the status bits.
int StaExtsmea.IsStatusBitSetTmp(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtsmea.SetStatus() for details on the status
bits.
void StaExtsmea.ResetStatusBit(int mask, int dbSync)

364
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtsmea.SetStatus()
for details on the status bits.
void StaExtsmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtsmea.SetMeaValue(double value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.

365
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

void StaExtsmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtsmea.SetStatus() for details on the status
bits.
void StaExtsmea.SetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtsmea.SetStatus() for
details on the status bits.
void StaExtsmea.SetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtsmea.SetStatus() for details on
the status bits.
void StaExtsmea.SetStatusTmp(int status)

366
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtsmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtsmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

367
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

3.3.13 StaExttapmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExttapmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for tap position and tap info currently stored in the measurement object.
int StaExttapmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value.
type type of value to return
0 tap position
1 operation mode
2 tap changer command
3 tap operation mode
4 tap operation mode command
useTranslationTable
Only supported if type=0 (tap step), if 1 (default) returned value will be translated
according to given table. If 0 is passed, the raw value will be returned.

R ETURNS
0 on success
1 on error, e.g. unsupported type
Returns 1 on erroReturn value has no meaning. It is always 0.

368
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExttap-
mea.SetStatus() for details on the status bits.
int StaExttapmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExttapmea.SetStatus() for details on the status bits.
int StaExttapmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExttapmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExttapmea.SetStatus() for details
on the status bits.
int StaExttapmea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExttap-
mea.SetStatus() for details on the status bits.
int StaExttapmea.IsStatusBitSetTmp(int mask)

369
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExttapmea.SetStatus() for details on the status
bits.
void StaExttapmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExttapmea.SetStatus()
for details on the status bits.
void StaExttapmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExttapmea.SetMeaValue(double value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

370
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.

bit29 0x20000000 Read


bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

void StaExttapmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExttapmea.SetStatus() for details on the status
bits.
void StaExttapmea.SetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExttapmea.SetStatus()
for details on the status bits.
void StaExttapmea.SetStatusBitTmp(int mask)

371
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExttapmea.SetStatus() for details on
the status bits.
void StaExttapmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExttapmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExttapmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

372
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.14 StaExtv3mea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtv3mea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for voltage currently stored in the measurement object.
int StaExtv3mea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for voltage, optionally multiplied by configured multiplicator
phase Index of desired phase. Index must be 0, 1 or 2.

applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
0 on success
1 on error, e.g. phase index does not exist

373
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtv3mea.SetStatus()
for details on the status bits.
int StaExtv3mea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtv3mea.SetStatus() for details on the status bits.
int StaExtv3mea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtv3mea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtv3mea.SetStatus() for details
on the status bits.
int StaExtv3mea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtv3mea.SetStatus()
for details on the status bits.
int StaExtv3mea.IsStatusBitSetTmp(int mask)

374
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtv3mea.SetStatus() for details on the status
bits.
void StaExtv3mea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtv3mea.SetStatus()
for details on the status bits.
void StaExtv3mea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtv3mea.SetMeaValue(double value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

375
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.

bit29 0x20000000 Read


bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

void StaExtv3mea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtv3mea.SetStatus() for details on the status
bits.
void StaExtv3mea.SetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtv3mea.SetStatus() for
details on the status bits.
void StaExtv3mea.SetStatusBitTmp(int mask)

376
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtv3mea.SetStatus() for details on
the status bits.
void StaExtv3mea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtv3mea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtv3mea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

377
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.15 StaExtvmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
void StaExtvmea.CopyExtMeaStatusToStatusTmp()

GetMeaValue
Returns the value for voltage currently stored in the measurement object.
int StaExtvmea.GetMeaValue(double& value,
int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for voltage, optionally multiplied by configured multiplicator
unused Not used.

applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

378
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtvmea.SetStatus()
for details on the status bits.
int StaExtvmea.GetStatus()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See StaExtvmea.SetStatus() for details on the status bits.
int StaExtvmea.GetStatusTmp()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
void StaExtvmea.InitTmp()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See StaExtvmea.SetStatus() for details on
the status bits.
int StaExtvmea.IsStatusBitSet(int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtvmea.SetStatus()
for details on the status bits.
int StaExtvmea.IsStatusBitSetTmp(int mask)

379
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See StaExtvmea.SetStatus() for details on the status
bits.
void StaExtvmea.ResetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See StaExtvmea.SetStatus()
for details on the status bits.
void StaExtvmea.ResetStatusBitTmp(int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int StaExtvmea.SetMeaValue(double value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement

380
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.

bit29 0x20000000 Read


bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

void StaExtvmea.SetStatus(int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See StaExtvmea.SetStatus() for details on the status
bits.
void StaExtvmea.SetStatusBit(int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See StaExtvmea.SetStatus() for
details on the status bits.
void StaExtvmea.SetStatusBitTmp(int mask)

381
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See StaExtvmea.SetStatus() for details on
the status bits.
void StaExtvmea.SetStatusTmp(int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtvmea.UpdateControl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int StaExtvmea.UpdateCtrl(int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

382
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

3.3.16 StaSwitch
Overview

Close
IsClosed*
IsOpen*
Open

Close
Closes the switch by changing its status to ’close’. This action will fail if the status is currently
determined by an active running arrangement.
int StaSwitch.Close()

R ETURNS
0 On success
6= 0 On error

E XAMPLE
The following example gathers all open switches and closes them.
int open;
set switches;
object switch;
switches = GetCalcRelevantObjects('*.StaSwitch');

for(switch = switches.First(); switch; switch = switches.Next()) {


open = switch.IsOpen();
if (open = 1) {
switch.Close();
}
}

S EE ALSO

StaSwitch.Open()

IsClosed*
Returns information about current switch state.
int StaSwitch.IsClosed()

R ETURNS
1 switch is closed
0 switch is open

383
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

S EE ALSO

StaSwitch.IsOpen()

IsOpen*
Returns information about current switch state.
int StaSwitch.IsOpen()

R ETURNS
1 switch is open
0 switch is closed

S EE ALSO

StaSwitch.IsClosed()

Open
Opens the switch by changing its status to ’open’. This action will fail if the status is currently
determined by an active running arrangement.
int StaSwitch.Open()

R ETURNS
0 On success
6= 0 On error

E XAMPLE
The following example gathers all closed switches and opens them.
int closed;
set switches;
object switch;
switches = GetCalcRelevantObjects('*.StaSwitch');

for(switch = switches.First(); switch; switch = switches.Next()) {


closed = switch.IsClosed();
if (closed = 1) {
switch.Open();
}
}

S EE ALSO

StaSwitch.Close()

384
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4 Commands
Overview

Execute

Execute
Executes the command.
int Com*.Execute()

3.4.1 ComAddlabel
Overview

Execute

Execute
This function executes the Add Statistic Labels command itself for a given plot and curve.
int ComAddlabel.Execute(object plot, int curveIndex)

A RGUMENTS
plot The plot to modify.
curveIndex
The index of the curve inside the plot’s table. The index is zero based, therefore
the index of the first curve is 0.

R ETURNS
0 The function executed without any errors.
1 The plot is visible on a single line graphic only.
2 The parameter plot is NULL.
3 The parameter plot is not a valid plot object (classname should either be PltLinebarplot
or it should start with Vis).
4 The object plot was found in any open graphic.
5 The object plot is not a diagram.
6 An internal error occured (plot is incomplete).

E XAMPLE
The following script searches for the plot named T1 on page Voltage and adds a statistic label
for the second curve.
object command,
desktop,
page,
plot;

command = GetFromStudyCase('ComAddlabel');
desktop = GetGraphicsBoard();
page = desktop.GetPage('Voltages',0);

385
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

plot = page.GetPlot('T1');
command.Execute(plot,1);

3.4.2 ComAddon
Overview

CreateModule
DefineDouble
DefineDoubleMatrix
DefineDoublePerConnection
DefineDoubleVector
DefineDoubleVectorPerConnection
DefineInteger
DefineIntegerPerConnection
DefineIntegerVector
DefineIntegerVectorPerConnection
DefineObject
DefineObjectPerConnection
DefineObjectVector
DefineObjectVectorPerConnection
DefineString
DefineStringPerConnection
DeleteModule
FinaliseModule
GetActiveModule
ModuleExists
SetActiveModule

CreateModule
Creates the calculation module of this AddOn. Volatile object parameters are created for all
variable definitions stored inside this command. They are accessible like any other built in
object parameter.
int ComAddon.CreateModule()

R ETURNS
0 Ok, module was created.
1 An error occurred.

S EE ALSO

ComAddon.FinaliseModule() ComAddon.DeleteModule()

DefineDouble
Creates a new floating-point-number parameter for the given type of objects.
int ComAddon.DefineDouble(string class,
string name,
string desc,
string unit,
double initial)

386
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineDoublePerConnection()

DefineDoubleMatrix
Creates a new floating-point-matrix parameter for the given type of objects.
int ComAddon.DefineDoubleMatrix(string class,
string name,
string desc,
string unit,
double initial,
int rows,
int columns)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter.
desc Parameter description.
unit Parameter’s unit.
initial Default value for all entries of new parameter.
rows Number of initial rows. Number of rows will be 0 if a value smaller than 0 is given.
columns Number of initial columns. Number of columns will be 0 if a value smaller than 0
is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

387
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

DefineDoublePerConnection
Creates a new floating-point-number parameter for every connection for the given type of ob-
jects.
int ComAddon.DefineDoublePerConnection(string class,
string name,
string desc,
string unit,
double initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineDouble shall be used instead.

S EE ALSO

ComAddon.DefineDouble()

DefineDoubleVector
Creates a new floating-point-number vector parameter for the given type of objects.
int ComAddon.DefineDoubleVector(string class,
string name,
string desc,
string unit,
double initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

388
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineDouble() ComAddon.DefineDoublePerConnection()

DefineDoubleVectorPerConnection
Creates a new floating-point-number vector parameter for the given type of objects for every
connection of the object.
int ComAddon.DefineDoubleVectorPerConnection(string class,
string name,
string desc,
string unit,
double initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter

desc Parameter description


unit Parameter’s unit
initial Default value of new parameter

size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineDoubleVector shall be used instead.

S EE ALSO

ComAddon.DefineDoubleVector()

389
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

DefineInteger
Creates a new integer parameter for the given type of objects.
int ComAddon.DefineInteger(string class,
string name,
string desc,
string unit,
int initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description

unit Parameter’s unit


initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineIntegerPerConnection()

DefineIntegerPerConnection
Creates a new integer parameter for every connection for the given type of objects.
int ComAddon.DefineIntegerPerConnection(string class,
string name,
string desc,
string unit,
int initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description

unit Parameter’s unit


initial Default value of new parameter

390
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineInteger shall be used instead.

S EE ALSO

ComAddon.DefineInteger()

DefineIntegerVector
Creates a new integer vector parameter for the given type of objects.
int ComAddon.DefineIntegerVector(string class,
string name,
string desc,
string unit,
int initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description

unit Parameter’s unit


initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineInteger() ComAddon.DefineIntegerPerConnection()

391
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

DefineIntegerVectorPerConnection
Creates a new integer vector parameter for the given type of objects for every connection of the
object.
int ComAddon.DefineIntegerVectorPerConnection(string class,
string name,
string desc,
string unit,
int initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description

unit Parameter’s unit


initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineIntegerVector shall be used instead.

S EE ALSO

ComAddon.DefineIntegerVector()

DefineObject
Creates a new object parameter for the given type of objects.
int ComAddon.DefineObject(string class,
string name,
string desc,
object initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter

desc Parameter description


initial Default object of new parameter

392
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineObjectPerConnection()

DefineObjectPerConnection
Creates a new object parameter for every connection for the given type of objects.
int ComAddon.DefineObjectPerConnection(string class,
string name,
string desc,
object initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.

name Name of the new parameter


desc Parameter description
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineObject shall be used instead.

S EE ALSO

ComAddon.DefineObject()

DefineObjectVector
Creates a new object vector parameter for the given type of objects.
int ComAddon.DefineObjectVector(string class,
string name,
string desc,
object initial,
int size)

393
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter.
desc Parameter description.

initial Default value of new parameter.


size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineObject() ComAddon.DefineObjectPerConnection()

DefineObjectVectorPerConnection
Creates a new object vector parameter for the given type of objects for every connection of the
object.
int ComAddon.DefineObjectVectorPerConnection(string class,
string name,
string desc,
object initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter.

desc Parameter description.


initial Default value of new parameter.
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineObjectVector shall be used instead.

394
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComAddon.DefineObjectVector()

DefineString
Creates a new text parameter for the given type of objects.
int ComAddon.DefineString(string class,
string name,
string desc,
string unit,
string initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

ComAddon.DefineStringPerConnection()

DefineStringPerConnection
Creates a new text parameter for every connection for the given type of objects.
int ComAddon.DefineStringPerConnection(string class,
string name,
string desc,
string unit,
string initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

395
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineString shall be used instead.

S EE ALSO

ComAddon.DefineString()

DeleteModule
Deletes the module of this add on.
int ComAddon.DeleteModule()

0 Success. The module is deleted completely.


1 Failure. The module does not exist and can therefore not be deleted.

S EE ALSO

ComAddon.CreateModule()

FinaliseModule
Finalises a user defined module which was created using the mthod CreateModule. All user
defined variables defined for this module are read-only after the call of finalise module. The
module is the one being used in the flexible data, single line graphic text boxes and colouring.
It can be reset like any other built-in calculation using the reset button.
int ComAddon.FinaliseModule()

R ETURNS
0 Ok, module was finalised.
1 An error occurred, this command is not the one being currently active.

S EE ALSO

ComAddon.CreateModule()

GetActiveModule
Gets the key of the module being currently active. An empty string is returned if there is no
active module.
string ComAddon.GetActiveModule()

R ETURNS
The key of the active module. an empty string is returned if there is no active module.

396
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComAddon.SetActiveModule()

ModuleExists
Checks if the module for this add-on was already created using the method CreateModule.
int ComAddon.ModuleExists()

R ETURNS
0 The module was not created yet.
1 The module was already created.

S EE ALSO

ComAddon.CreateModule() ComAddon.FinaliseModule() ComAddon.DeleteModule()

SetActiveModule
Set this module as active module. This method is required only if several modules are created
concurrently. In case that only one module is being used, there is no need to use this method,
because CreateModule sets the created module automatically as active module.
int ComAddon.SetActiveModule()

R ETURNS
0 Success. This command is set as active module.
1 Failure. This command is already the active module.

S EE ALSO

ComAddon.CreateModule() ComAddon.FinaliseModule() ComAddon.DeleteModule()

3.4.3 ComAmpacity
Overview

ExecuteAmpacityCalc

ExecuteAmpacityCalc
The function executes ampacity calculation with or without the tabular report at the end.
int ComAmpacity.ExecuteAmpacityCalc([int ireport = 1])

A RGUMENTS
ireport (optional)
Show report or not, default = 1.

E XAMPLE
object cmdAmpacity;
int iret, ireport;
cmdAmpacity = GetFromStudyCase('ComAmpacity');

397
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

if (cmdAmpacity) {
ireport = 0;
iret = cmdAmpacity.ExecuteAmpacityCalc(ireport);
if (iret = 0) {
! tabular report not displayed since ireport = 0
}
}

3.4.4 ComArcreport
Overview

GetLocationsToReport
GetUnitFor
GetValueFor
IsDguv

GetLocationsToReport
Returns the accessible locations with stored results, i.e. which can be reported.
set ComArcreport.GetLocationsToReport()

R ETURNS
Container with reportable accessible locations.

GetUnitFor
Returns the unit for the given variable. The unit corresponds the selected display unit for each
variable at the time the result file was read.
string ComArcreport.GetUnitFor(string variable)

A RGUMENTS
variable Variable for which to retrieve the unit.

R ETURNS
The unit or an empty string if no stored result exists for the given arguments.

GetValueFor
Returns the stored value for the given location and variable.
double ComArcreport.GetValueFor(object location,
string variable,
[int arc])

A RGUMENTS
location Accessible location for which to retrieve the result.
variable Variable for which to retrieve the result. In addition to the arc-flash related monitor
variables stored in the result file, the following artificial variables can be retrieved.

398
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

The availablility of the artificial variables dependes on the arc-flash standard used
to write the result file.

m:Ik Short-circuit current


m:Ikmax Max. short-circuit current
m:Ikmin Min. short-circuit current
arc (optional)
Flag which result should be retrieved:
-1 Worst case (default)
0 Full arcing current
1 Reduced arcing current

R ETURNS
The stored value or 0.0 if no stored result exists for the given arguments.

IsDguv
Returns whether or not the results were written for a DGUV 203-077 calculation.
int ComArcreport.IsDguv()

R ETURNS
1 The results were written for a DGUV 203-077 calculation.
0 The results were written for a IEEE-1584 / NFPA calculation.

3.4.5 ComAuditlog
Overview

Check

Check
Checks integrity of Audit Log.
int ComAuditlog.Check()

R ETURNS
number of errors

399
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.6 ComBoundary
Overview

GetCreatedBoundaries

GetCreatedBoundaries
Gets created boundaries after the command has been executed.
set ComBoundary.GetCreatedBoundaries()

R ETURNS
Container of created boundaries.

3.4.7 ComCapo
Overview

ConnectShuntToBus
LossCostAtBusTech
TotalLossCost

ConnectShuntToBus
Connects the equivalent shunt in the specified terminal and executes the load flow command.
The shunt is not physically added in the database, just the susceptance is added for the
calculation.
int ComCapo.ConnectShuntToBus(object terminal,
double phtech,
double Q
)

A RGUMENTS
terminal The terminal to which the shunt will be connected
phtech Phase technology. Possible values are
0 three-phase
1 ph-ph a-b
2 ph-ph b-c
3 ph-ph a-c
4 ph-e a
5 ph-e b
6 ph-e c
Note: In balanced load flow, the technology will always be three-phase.
Q Reactive power value in Mvar

R ETURNS
0 On success.
1 An error occurred during load flow execution.

400
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
! This example connects a 0.25 Mvar three-phase shunt to obus
! and excutes load flow.
! Results can been compared to a load flow study after actually
! inserting and connecting a 0.4 kV, 0.25 Mvar shunt to the
! specified bus.
! NOTES:
! 1. Open Application Example "LV Distribution Network"
! 2. Open the "Optimal Capacitor Placement" command and
! select feeder "FD_242". Close command.
! 3. Define "obus" as an external object in the "Basic Options"
! page of the DPL Command
! 4. Select terminal "ND_2406" (0.4 kV System) as "obus"
object comcapo, comldf;
int iret;

iret = 0;
comcapo = GetFromStudyCase('ComCapo');
comldf = GetFromStudyCase('ComLdf');

if ({comldf}.and.{comcapo}) {
comldf:iopt_net = 0; ! balanced load flow
! obus is an external terminal
iret = comcapo.ConnectShuntToBus(obus,0,0.25);
}

printf('Error: %d', iret);

LossCostAtBusTech
Returns the losses cost of the selected terminal and configuration calculated during the sensi-
tivity analysis or the optimization.
double ComCapo.LossCostAtBusTech(object terminal,
double phtech
)

A RGUMENTS
terminal Specified bus
phtech Phase technology. Possible values are
0 three-phase
1 ph-ph a-b
2 ph-ph b-c
3 ph-ph a-c
4 ph-e a
5 ph-e b
6 ph-e c

R ETURNS
Returns the losses cost

401
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
! This example gets the losses cost for the buses in the
! feeder with single-phase (A-B) configuration considered
! in the sensitivity analysis or in the optimization process.
! NOTES:
! 1. Open Application Example "LV Distribution Network"
! 2. Open the "Optimal Capacitor Placement" command and
! select feeder "FD_242".
! 3. In the "Available capacitors" page of the dialog,
! add one single phase, 0.05 Mvar capacitor and
! add one three-phase, 0.05 Mvar capacitor
! both with cost of 10 $/kWh.
! 4. Close command.
! 5. Define "ofeed" as an external object in the "Basic Options"
! page of the DPL Command
! 6. Select feeder "FD_242" as "ofeed"
object comcapo, pObj;
set aNodes;
int dret;

dret = 0;
comcapo = GetFromStudyCase('ComCapo');
comcapo:iopt_meth = 1; ! Sensitivity analysis
comcapo:iopt_ldf = 1; ! Unbalanced
comcapo.Execute();

if (comcapo) {
aNodes = ofeed.GetBuses(1);
aNodes.SortToName(0);
for (pObj=aNodes.First(); pObj; pObj=aNodes.Next()) {
dret = comcapo.LossCostAtBusTech(pObj,1); ! A-B configuration
if (dret >= 0.) {
printf('%o: Losses Cost: %f', pObj, dret);
}
}
}

TotalLossCost
Returns the total cost calculated after the sensitivity analysis or the optimization.
double ComCapo.TotalLossCost([int iopt])

A RGUMENTS
iopt (optional)
Type of cost. Possible values are
0 Losses in MW (default)
1 Cost of losses
2 Cost of voltage violations
3 Cost of shunts

R ETURNS
Returns losses in MW or cost value.

402
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
! This example gets the different costs calculated
! after the optimization process.
! NOTES:
! 1. Open Application Example "LV Distribution Network"
! 2. Open the "Optimal Capacitor Placement" command and
! select feeder "FD_242".
! 3. In the "Available capacitors" page of the dialog,
! add one single phase, 0.05 Mvar capacitor and
! add one three-phase, 0.05 Mvar capacitor,
! both with cost of 10 $/kWh.
! 4. Close command.
object comcapo;
int dret;

comcapo = GetFromStudyCase('ComCapo');
comcapo:iopt_meth = 0; ! Optimization
comcapo:iopt_ldf = 1; ! Unbalanced
comcapo:iopt_con = 0; ! Only do report
comcapo.Execute();

if (comcapo) {
dret = comcapo.TotalLossCost(0);
printf('Losses in MW: %f', dret);
dret = comcapo.TotalLossCost(1);
printf('Cost of Losses: %f', dret);
dret = comcapo.TotalLossCost(2);
printf('Cost of V Violations: %f', dret);
dret = comcapo.TotalLossCost(3);
printf('Cost of Shunts: %f', dret);
}

3.4.8 ComCheck
Overview

GetNextLoop

GetNextLoop
Get the next loop for any non-radial feeder.
set ComCheck.GetNextLoop()

R ETURNS
Returns the elements in of the loop.

403
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.9 ComCimdbexp
Overview

Execute

Execute
Executes the export. In case of a validation error the export is not performed.
int ComCimdbexp.Execute([int validate])

A RGUMENTS
validate (optional)
Option to execute CIM Data Validation before export. If not provided, the validation
is executed. Possible values are
0 Do not validate
1 Validate

R ETURNS
0 OK
1 Error: export failed

E XAMPLE
The following example exports CIM archive to a file using a preconfigured CIM Data Export
command from the active project.
object cimdbexp;
int error;

cimdbexp = GetFromStudyCase('ComCimdbexp');
error = cimdbexp.Execute();
if (error = 0) {
Info('OK');
} else {
Error('Error: export failed');
}

3.4.10 ComCimdbimp
Overview

Execute
ImportAndConvert

404
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

Execute
Executes the import.
int ComCimdbimp.Execute([int validate])

A RGUMENTS
validate (optional)
Option to execute CIM Data Validation after import. If not provided, the validation
is executed. Possible values are
0 Do not validate
1 Validate

R ETURNS
0 OK
1 Error: import failed

E XAMPLE
The following example creates a new CIM Data Import command, configures it and imports
the data into the active project.
object cimdbimp;
int error;

cimdbimp = GetFromStudyCase('ComCimdbimp');
cimdbimp.SetVal('testArchive', 'targetName');
cimdbimp.SetVal('E:\test\test.zip', 'fileName');
error = cimdbimp.Execute();
if (error = 0) {
Info('OK');
} else {
Error('Error: import failed');
}

ImportAndConvert
Imports CIM data from file path provided in the ’CIM Data Import’ command without storing
CIM data into database, and converts CIM to Grid using the ’CIM to Grid Conversion’ command
object provided in the function call as template. The CIM to Grid Conversion will be executed
with default settings if the command object is not provided in the function call.
int ComCimdbimp.ImportAndConvert([int validate],
[object cimToGrid])

A RGUMENTS
validate (optional)
Option to execute CIM Data Validation after import. If not provided, the validation
is executed. Possible values are
0 Do not validate
1 Validate
cimToGrid (optional)
ComCimtogrid object with preconfigured settings for converting imported CIM
data. If not provided, the default CIM to Grid Conversion settings will be used.

405
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 OK
1 Error: import failed
2 Error: conversion failed

E XAMPLE
The following example imports and converts a CimArchive from a specified ZIP file.
object cimdbimp;
int error;

cimdbimp = GetFromStudyCase('ComCimdbimp');
cimdbimp.SetVal('E:\test\test.zip', 'fileName');
error = cimdbimp.ImportAndConvert();
if (error = 0) {
Info('OK');
} else if (error = 1) {
Error('Error: import failed');
} else {
Error('Error: conversion failed');
}

3.4.11 ComCimvalidate
Overview

Execute
GetClassType
GetDescriptionText
GetInputObject
GetModel
GetModelId
GetNumberOfValidationMessages
GetObject
GetObjectId
GetProfile
GetSeverity
GetType

Execute
Executes the validation. Creates no validation report if no errors, or warnings were found.
int ComCimvalidate.Execute([int openReport])

A RGUMENTS
openReport (optional)
Option to open report after validation. If not provided, the report is opened.
Possible values are
0 Do not open report
1 Open report

406
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 OK
1 Error: validation failed

E XAMPLE
The following example executes the validation for the configured CIM Data Validation (Com-
Cimvalidate) command in the active project. In case of error the validation report is not
opened.
object cimvalidate;
int error;

cimvalidate = GetFromStudyCase('ComCimvalidate');
cimvalidate.Execute(0);
if (error = 0) {
Info('OK');
} else {
Error('Error: validation failed');
}

GetClassType
Returns the object class type from the selected validation message.
string ComCimvalidate.GetClassType(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Object class type.

E XAMPLE
The following example prints the object class type from each validation message.
object cimvalidate;
int nMessages, i;
string classType;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
classType = cimvalidate.GetClassType(i);
Info('%s', classType);
}

GetDescriptionText
Returns the description from the selected validation message.
string ComCimvalidate.GetDescriptionText(int messageIndex)

407
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Message description.

E XAMPLE
The following example prints the description text from each validation message.
object cimvalidate;
int nMessages, i;
string descriptionText;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
descriptionText = cimvalidate.GetDescriptionText(i);
Info('%s', descriptionText);
}

GetInputObject
Returns the object selected for validation.
object ComCimvalidate.GetInputObject()

R ETURNS
Pointer to CimArchive, CimModel, or SetSelect.

E XAMPLE
The following example prints the class of object and object selected for validation in the active
project.
object cimvalidate, selectedObject;
string objectClass;

cimvalidate = GetFromStudyCase('ComCimvalidate');
selectedObject = cimvalidate.GetInputObject();
objectClass = selectedObject.GetClass();
Info('%s: %o', objectClass, selectedObject);

GetModel
Returns the CimModel object from the selected validation message.
object ComCimvalidate.GetModel(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

408
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Pointer to CimModel.

E XAMPLE
The following example prints the CimModel object from each validation message.
object cimvalidate, cimModel;
int nMessages, i;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
cimModel = cimvalidate.GetModel(i);
Info('%o', cimModel);
}

GetModelId
Returns the model ID from the selected validation message.
string ComCimvalidate.GetModelId(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Model ID.

E XAMPLE
The following example prints the model ID from each validation message.
object cimvalidate;
int nMessages, i;
string modelId;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
modelId = cimvalidate.GetModelId(i);
Info('%s', modelId);
}

GetNumberOfValidationMessages
Returns the number of validation messages generated.
int ComCimvalidate.GetNumberOfValidationMessages()

R ETURNS
Number of validation messages.

409
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example prints the number of validation messages got for the last CIM data
validation.
object cimvalidate;
int nMessages;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
Info('Number of validation messages: %d', nMessages);

GetObject
Returns the CimObject object from the selected validation message.
object ComCimvalidate.GetObject(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Pointer to CimObject.

E XAMPLE
The following example prints the CimObject object from each validation message.
object cimvalidate, cimObject;
int nMessages, i;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
cimObject = cimvalidate.GetObject(i);
Info('%o', cimObject);
}

GetObjectId
Returns the object ID from the selected validation message.
string ComCimvalidate.GetObjectId(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Object ID.

410
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example prints the object ID from each validation message.
object cimvalidate;
int nMessages, i;
string objectId;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
objectId = cimvalidate.GetObjectId(i);
Info('%s', objectId);
}

GetProfile
Returns the model profile from the selected validation message.
string ComCimvalidate.GetProfile(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Model profile.

E XAMPLE
The following example prints the profile for each validation message.
object cimvalidate;
int nMessages, i;
string profile;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
profile = cimvalidate.GetProfile(i);
Info('%s', profile);
}

GetSeverity
Returns the severity of the selected validation message.
string ComCimvalidate.GetSeverity(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Message severity.

411
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example prints the severity for each validation message.
object cimvalidate;
int nMessages, i;
string severity;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
severity = cimvalidate.GetSeverity(i);
Info('%s', severity);
}

GetType
Returns the type of the selected validation message.
string ComCimvalidate.GetType(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Message type.

E XAMPLE
The following example prints the type for each validation message.
object cimvalidate;
int nMessages, i;
string type;

cimvalidate = GetFromStudyCase('ComCimvalidate');
nMessages = cimvalidate.GetNumberOfValidationMessages();
for (i = 0; i < nMessages; i = i + 1) {
type = cimvalidate.GetType(i);
Info('%s', type);
}

3.4.12 ComConreq
Overview

Execute

412
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

Execute
Performs a Connection Request Assessment according to the selected method. Results are
provided for connection request elements in the single line graphic, and are summarised in a
report in the output window.
int ComConreq.Execute()

R ETURNS
0 OK
1 Error: calculation function
2 Error: settings/initialisation/load flow

3.4.13 ComContingency
Overview

ContinueTrace
CreateRecoveryInformation
GetGeneratorEvent*
GetInterruptedPowerAndCustomersForStage
GetInterruptedPowerAndCustomersForTimeStep*
GetLoadEvent*
GetNumberOfGeneratorEventsForTimeStep*
GetNumberOfLoadEventsForTimeStep*
GetNumberOfSwitchEventsForTimeStep*
GetNumberOfTimeSteps*
GetObj*
GetSwitchEvent*
GetTimeOfStepInSeconds*
GetTotalInterruptedPower*
JumpToLastStep
RemoveEvents
StartTrace
StopTrace

ContinueTrace
Continues trace execution for this contingency.
int ComContingency.ContinueTrace()

R ETURNS
0 On success.
1 On error.

CreateRecoveryInformation
Creates recovery information for a contingency. The recovery information can later be retrieved
e.g. via ComContingency.GetInterruptedPowerAndCustomersForStage().
Can only save one contingency at the same time.
int ComContingency.CreateRecoveryInformation(object resultFileInput)

413
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
resultFileInput
Read from this result file.

R ETURNS
0 On success.
1 On error.

GetGeneratorEvent*
Gets generator event of a certain time step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
void ComContingency.GetGeneratorEvent(int currentTimeStep,
int loadEvent,
object& generator,
double& changedP,
double& changedQ )

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

switchEvent
Input: Number of generator events for a certain time step are get via ComContin-
gency.GetNumberOfSwitchEventsForTimeStep()
generator (out)
Output: Generator that dispatched

changedP (out)
Output: Changed active power
changedQ (out)
Output: Changed reactive power

GetInterruptedPowerAndCustomersForStage
Gets recovery information of a contingency.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetInterruptedPowerAndCustomersForStage(double timeOfStageInMinutes,
double& interruptedPower,
double& newInterruptedPower,
double& interruptedCustomers,
double& newInterruptedCustomers)

A RGUMENTS
timeOfStageInMinutes
Input: Get Information for this time.
interruptedPower (out)
Output: Interrupted Power at this time.

414
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

newInterruptedPower (out)
Output: New interrupted Power at this time.

interruptedCustomers (out)
Output: Interrupted Customers at this time.
newInterruptedCustomers (out)
Output: New interrupted Customers at this time.

R ETURNS
0 On success.
1 On error.

GetInterruptedPowerAndCustomersForTimeStep*
Gets recovery information of a contingency.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetInterruptedPowerAndCustomersForTimeStep(int currentTimeStep,
double& interruptedPower,
double& newInterruptedPower,
double& interruptedCustomers,
double& newInterruptedCustomers)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

interruptedPower (out)
Output: Interrupted Power at this time.
newInterruptedPower (out)
Output: New interrupted Power at this time.
interruptedCustomers (out)
Output: Interrupted Customers at this time.
newInterruptedCustomers (out)
Output: New interrupted Customers at this time.

GetLoadEvent*
Gets load event of a certain time step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
void ComContingency.GetLoadEvent(int currentTimeStep,
int loadEvent,
object& load,
double& changedP,
double& changedQ,
int& isTransfer)

415
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

switchEvent
Input: Number of load events for a certain time step are get via ComContin-
gency.GetNumberOfSwitchEventsForTimeStep()
load (out) Output: Load that is shed or transfered
changedP (out)
Output: Changed active power

changedQ (out)
Output: Changed reactive power
isTransfer (out)
Output: = 0 : is load shedding event. >0 is load transfer event.

GetNumberOfGeneratorEventsForTimeStep*
Returns the number of generator events of a certain step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetNumberOfGeneratorEventsForTimeStep([int currentTimeStep])

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

GetNumberOfLoadEventsForTimeStep*
Returns the number of load events of a certain step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetNumberOfLoadEventsForTimeStep([int currentTimeStep])

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

GetNumberOfSwitchEventsForTimeStep*
Returns the number of switch events of a certain step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetNumberOfSwitchEventsForTimeStep([int currentTimeStep])

416
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

GetNumberOfTimeSteps*
Returns the number of time steps during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetNumberOfTimeSteps()

GetObj*
Gets interrupted element by index (zero based).
object ComContingency.GetObj(int index)

A RGUMENTS
index Element order index, 0 for the first object.

R ETURNS
object Interupted element for given index.
NULL Index out of range.

GetSwitchEvent*
Gets switch event of a certain time step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
void ComContingency.GetSwitchEvent(int currentTimeStep,
int switchEvent,
object& switchToBeActuated,
int& isClosed,
int& sectionalizingStep)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

switchEvent
Input: Number of switch event for a certain time step are get via ComContin-
gency.GetNumberOfSwitchEventsForTimeStep()
switchToBeActuated (out)
Output: Switch to be actuated
isClosed (out)
Output: > 0 if switch is closed
sectionalizingStep (out)
Output: sectionalizing step when this switch is actuated

417
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetTimeOfStepInSeconds*
Returns the time of the current step during recovery.
ComContingency.CreateRecoveryInformation() has to be called beforehand to collect the data.
int ComContingency.GetTimeOfStepInSeconds(int currentTimeStep)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via ComContingency.GetNumberOfTimeSteps()

GetTotalInterruptedPower*
Gets the total interrupted power (in kW) during restoration. ComContingency.CreateRecoveryInformation()
has to be called beforehand to collect the data.
double ComContingency.GetTotalInterruptedPower()

JumpToLastStep
Gets the last trace execution for this contingency.
int ComContingency.JumpToLastStep([int timeDelay])

A RGUMENTS
timeDelay (optional)
time delay in seconds between trace steps

R ETURNS
0 On success.
1 On error.

RemoveEvents
Removes events from this contingency.
void ComContingency.RemoveEvents([double emitMessage])
void ComContingency.RemoveEvents(string whichEvents)
void ComContingency.RemoveEvents(double emitMessage,
string whichEvents
)
void ComContingency.RemoveEvents(string whichEvents,
double emitMessage
)

A RGUMENTS
emitMessage(optional)
0: no info message shall be issued after event removal
whichEvents(optional)
’lod’ removed load events, ’gen’ removes generator events, ’switch’ removes switch-
ing events

418
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

StartTrace
Starts trace execution for this contingency.
int ComContingency.StartTrace()

R ETURNS
0 On success.
1 Error, e.g. Contingency is not in trace.
2 On error.

StopTrace
Stops trace execution for this contingency.
int ComContingency.StopTrace([int emitMessage])

A RGUMENTS
emitMessage (optional)
= 0: no trace-stop info messages shall be issued

R ETURNS
0 On Success.
1 Contingency is not in Trace.

3.4.14 ComCoordreport
Overview

DevicesToReport
HasResultsForDirectionalBackup
HasResultsForFuse
HasResultsForInstantaneous
HasResultsForNonDirectionalBackup
HasResultsForOverload
HasResultsForOverreach
HasResultsForShortCircuit
HasResultsForZone
MaxZoneNumberFor
ResultForDirectionalBackupVariable
ResultForFuseVariable
ResultForInstantaneousVariable
ResultForMaxCurrent
ResultForNonDirectionalBackupVariable
ResultForOverloadVariable
ResultForOverreachVariable
ResultForShortCircuitVariable
ResultForZoneVariable
TopologyForDirectionalBackupVariable
TopologyForFuseVariable
TopologyForInstantaneousVariable
TopologyForMaxCurrent
TopologyForNonDirectionalBackupVariable

419
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

TopologyForOverloadVariable
TopologyForOverreachVariable
TopologyForShortCircuitVariable
TopologyForZoneVariable
TransferDirectionalBackupResultsTo
TransferNonDirectionalBackupResultsTo
TransferOverreachResultsTo
TransferResultsTo
TransferZoneResultsTo

DevicesToReport
Returns the devices with stored results, i.e. which can be reported.
set ComCoordreport.DevicesToReport()

R ETURNS
Container with reportable devices.

HasResultsForDirectionalBackup
Checks whether there is a stored directional backup result for the given device.
int ComCoordreport.HasResultsForDirectionalBackup(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 A directional backup result is stored for this device.
0 The device has no stored results or no result for the directional backup.

S EE ALSO

ComCoordreport.HasResultsForZone(),
ComCoordreport.HasResultsForOverreach(),
ComCoordreport.HasResultsForNonDirectionalBackup()

HasResultsForFuse
Checks whether there is a stored fuse result for the given device.
int ComCoordreport.HasResultsForFuse(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 An fuse result is stored for this device.
0 The device has no stored results or no fuse result.

420
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

HasResultsForInstantaneous
Checks whether there is a stored instantaneous stage result for the given device.
int ComCoordreport.HasResultsForInstantaneous(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 An instantaneous stage result is stored for this device.
0 The device has no stored results or no result for the instantaneous stage.

S EE ALSO

ComCoordreport.HasResultsForOverload(),
ComCoordreport.HasResultsForShortCircuit()

HasResultsForNonDirectionalBackup
Checks whether there is a stored non-directional backup result for the given device.
int ComCoordreport.HasResultsForNonDirectionalBackup(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 A non-directional backup result is stored for this device.
0 The device has no stored results or no result for the non-directional backup.

S EE ALSO

ComCoordreport.HasResultsForZone(),
ComCoordreport.HasResultsForOverreach(),
ComCoordreport.HasResultsForDirectionalBackup()

HasResultsForOverload
Checks whether there is a stored overload stage result for the given device.
int ComCoordreport.HasResultsForOverload(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 An overload stage result is stored for this device.
0 The device has no stored results or no result for the overload stage.

S EE ALSO

ComCoordreport.HasResultsForShortCircuit(),
ComCoordreport.HasResultsForInstantaneous()

421
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

HasResultsForOverreach
Checks whether there is a stored overreach zone result for the given device.
int ComCoordreport.HasResultsForOverreach(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 An overreach zone result is stored for this device.
0 The device has no stored results or no result for the overreach zone.

S EE ALSO

ComCoordreport.HasResultsForZone(),
ComCoordreport.HasResultsForDirectionalBackup(),
ComCoordreport.HasResultsForNonDirectionalBackup()

HasResultsForShortCircuit
Checks whether there is a stored short-circuit stage result for the given device.
int ComCoordreport.HasResultsForShortCircuit(object device)

A RGUMENTS
device Device for which to check.

R ETURNS
1 An short-circuit stage result is stored for this device.
0 The device has no stored results or no result for the short-circuit stage.

S EE ALSO

ComCoordreport.HasResultsForOverload(),
ComCoordreport.HasResultsForInstantaneous()

HasResultsForZone
Checks whether there is a stored result for the given device and zone number.
int ComCoordreport.HasResultsForZone(object device,
int zoneNumber)

A RGUMENTS
device Device for which to check.
zoneNumber
Zone number to check (1-4).

R ETURNS
1 A result is stored for this device and zone number.
0 The device has no stored results or no result for this zone number.

422
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComCoordreport.HasResultsForOverreach(),
ComCoordreport.HasResultsForDirectionalBackup(),
ComCoordreport.HasResultsForNonDirectionalBackup()

MaxZoneNumberFor
Returns the highest zone number in the stored results for the given device.
int ComCoordreport.MaxZoneNumberFor(object device)

A RGUMENTS
device Device for which to retrieve the zone number.

R ETURNS
Highest zone number in the stored results.

ResultForDirectionalBackupVariable
Provides access to the directional backup result for a given device and variable.
int ComCoordreport.ResultForDirectionalBackupVariable(object device,
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.

variable Variable for which to retrieve the result:


dir Tripping direction
Tp Polygonal delay
Tc Circular delay

result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
2 The corresponding topological search failed.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.

S EE ALSO

ComCoordreport.ResultForZoneVariable(),
ComCoordreport.ResultForOverreachVariable(),
ComCoordreport.ResultForNonDirectionalBackupVariable()

423
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ResultForFuseVariable
Provides access to the fuse result for a given device and variable.
int ComCoordreport.ResultForFuseVariable(object device,
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.
variable Variable for which to retrieve the result:
char Overcurrent characteristic
dir Tripping direction
Iset Overcurrent setpoint
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.
5 The calculated value exceeded the calculated maximum current.

S EE ALSO

ComCoordreport.ResultForMaxCurrent()

ResultForInstantaneousVariable
Provides access to the instantaneous result for a given device and variable.
int ComCoordreport.ResultForInstantaneousVariable(object device,
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.

variable Variable for which to retrieve the result:


char Overcurrent characteristic
dir Tripping direction
Iset Overcurrent setpoint
Tset Overcurrent delay
result (out)
Value of the stored result.

424
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.
5 The calculated value exceeded the calculated maximum current.

S EE ALSO

ComCoordreport.ResultForOverloadVariable(),
ComCoordreport.ResultForShortCircuitVariable(),
ComCoordreport.ResultForMaxCurrent()

ResultForMaxCurrent
Provides access to the maximum current result for a given device.
int ComCoordreport.ResultForMaxCurrent(object device,
double& result)

A RGUMENTS
device Device for which to retrieve the result.
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.
6 The orientation of the device is ambuous.

S EE ALSO

ComCoordreport.ResultForOverloadVariable(),
ComCoordreport.ResultForShortCircuitVariable(),
ComCoordreport.ResultForInstantaneousVariable()

ResultForNonDirectionalBackupVariable
Provides access to the non-directional backup result for a given device and variable.
int ComCoordreport.ResultForNonDirectionalBackupVariable(object device,
string variable,
double& result)

425
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
device Device for which to retrieve the result.
variable Variable for which to retrieve the result:
dir Tripping direction
Tp Polygonal delay
Tc Circular delay
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
2 The corresponding topological search failed.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.

S EE ALSO

ComCoordreport.ResultForZoneVariable(),
ComCoordreport.ResultForOverreachVariable(),
ComCoordreport.ResultForDirectionalBackupVariable()

ResultForOverloadVariable
Provides access to the overload result for a given device and variable.
int ComCoordreport.ResultForOverloadVariable(object device,
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.
variable Variable for which to retrieve the result:
char Overcurrent characteristic
dir Tripping direction
Iset Overcurrent setpoint
Tset Overcurrent delay
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.
5 The calculated value exceeded the calculated maximum current.

426
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComCoordreport.ResultForShortCircuitVariable(),
ComCoordreport.ResultForInstantaneousVariable(),
ComCoordreport.ResultForMaxCurrent()

ResultForOverreachVariable
Provides access to the overreach result for a given device and variable.
int ComCoordreport.ResultForOverreachVariable(object device,
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.
variable Variable for which to retrieve the result:
X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
dir Tripping direction
Tp Polygonal delay
Tc Circular delay
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
2 The corresponding topological search failed.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.

S EE ALSO

ComCoordreport.ResultForZoneVariable(),
ComCoordreport.ResultForDirectionalBackupVariable(),
ComCoordreport.ResultForNonDirectionalBackupVariable()

ResultForShortCircuitVariable
Provides access to the short-circuit result for a given device and variable.
int ComCoordreport.ResultForShortCircuitVariable(object device,
string variable,
double& result)

427
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
device Device for which to retrieve the result.
variable Variable for which to retrieve the result:
char Overcurrent characteristic
dir Tripping direction
Iset Overcurrent setpoint
Tset Overcurrent delay
result (out)
Value of the stored result.

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.
5 The calculated value exceeded the calculated maximum current.

S EE ALSO

ComCoordreport.ResultForOverloadVariable(),
ComCoordreport.ResultForInstantaneousVariable(),
ComCoordreport.ResultForMaxCurrent()

ResultForZoneVariable
Provides access to the result for a given device, zone number and variable.
int ComCoordreport.ResultForZoneVariable(object device,
int zoneNumber
string variable,
double& result)

A RGUMENTS
device Device for which to retrieve the result.
zoneNumber
Zone number for which to retrieve the result (1-4).
variable Variable for which to retrieve the result:
X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
dir Tripping direction
Tp Polygonal delay
Tc Circular delay
result (out)
Value of the stored result.

428
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 The result is valid.
1 The result was not calculated or not found.
2 The corresponding topological search failed.
3 The corresponding topological search ended prematurely (e.g. end of network
reached).
4 The correponding equation required a nominal current and none could be deter-
mined.

S EE ALSO

ComCoordreport.ResultForOverreachVariable(),
ComCoordreport.ResultForDirectionalBackupVariable(),
ComCoordreport.ResultForNonDirectionalBackupVariable()

TopologyForDirectionalBackupVariable
Returns the associated directional backup topology for a given device and variable.
set ComCoordreport.TopologyForDirectionalBackupVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:
Tp Polygonal delay
Tc Circular delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForZoneVariable(),
ComCoordreport.TopologyForOverreachVariable(),
ComCoordreport.TopologyForNonDirectionalBackupVariable()

TopologyForFuseVariable
Returns the associated fuse topology for a given device and variable.
set ComCoordreport.TopologyForFuseVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:
Iset Overcurrent setpoint

R ETURNS
Elements traversed by the topological search determining this variables result.

429
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComCoordreport.TopologyForMaxCurrent()

TopologyForInstantaneousVariable
Returns the associated instantaneous stage topology for a given device and variable.
set ComCoordreport.TopologyForInstantaneousVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.

variable Variable for which to retrieve the topology:


Iset Overcurrent setpoint
Tset Overcurrent delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForOverloadVariable(),
ComCoordreport.TopologyForShortCircuitVariable(),
ComCoordreport.TopologyForMaxCurrent()

TopologyForMaxCurrent
Returns the associated maximum current topology for a given device.
set ComCoordreport.TopologyForMaxCurrent(object device)

A RGUMENTS
device Device for which to retrieve the topology.

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForOverloadVariable(),
ComCoordreport.TopologyForShortCircuitVariable(),
ComCoordreport.TopologyForInstantaneousVariable()

TopologyForNonDirectionalBackupVariable
Returns the associated non-directional backup topology for a given device and variable.
set ComCoordreport.TopologyForNonDirectionalBackupVariable(object device,
string variable)

430
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:
Tp Polygonal delay
Tc Circular delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForZoneVariable(),
ComCoordreport.TopologyForOverreachVariable(),
ComCoordreport.TopologyForDirectionalBackupVariable()

TopologyForOverloadVariable
Returns the associated overload stage topology for a given device and variable.
set ComCoordreport.TopologyForOverloadVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:
Iset Overcurrent setpoint
Tset Overcurrent delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForShortCircuitVariable(),
ComCoordreport.TopologyForInstantaneousVariable(),
ComCoordreport.TopologyForMaxCurrent()

TopologyForOverreachVariable
Returns the associated overreach zone topology for a given device and variable.
set ComCoordreport.TopologyForOverreachVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:

X Polygonal reactance
R Polygonal phase-phase resistance

431
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

RE Polygonal phase-earth resistance


Z Circular impedance
phi Circular angle
Tp Polygonal delay
Tc Circular delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForZoneVariable(),
ComCoordreport.TopologyForDirectionalBackupVariable(),
ComCoordreport.TopologyForNonDirectionalBackupVariable()

TopologyForShortCircuitVariable
Returns the associated short-circuit stage topology for a given device and variable.
set ComCoordreport.TopologyForShortCircuitVariable(object device,
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
variable Variable for which to retrieve the topology:
Iset Overcurrent setpoint
Tset Overcurrent delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForOverloadVariable(),
ComCoordreport.TopologyForInstantaneousVariable(),
ComCoordreport.TopologyForMaxCurrent()

TopologyForZoneVariable
Returns the associated topology for a given device, zone number and variable.
set ComCoordreport.TopologyForZoneVariable(object device,
int zoneNumber
string variable)

A RGUMENTS
device Device for which to retrieve the topology.
zoneNumber
Zone number for which to retrieve the topology (1-4).
variable Variable for which to retrieve the topology:

432
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
Tp Polygonal delay
Tc Circular delay

R ETURNS
Elements traversed by the topological search determining this variables result.

S EE ALSO

ComCoordreport.TopologyForOverreachVariable(),
ComCoordreport.TopologyForDirectionalBackupVariable(),
ComCoordreport.TopologyForNonDirectionalBackupVariable()

TransferDirectionalBackupResultsTo
Transfers the results of the directional backup for the given variables to the device.
int ComCoordreport.TransferDirectionalBackupResultsTo(object device,
string variables)

A RGUMENTS
device Device to transfer the results to.
variable Variables to transfer as semi-colon separated string:

dir Tripping direction


Tp Polygonal delay
Tc Circular delay

R ETURNS
0 Transfer did non succeed.
1 Result transfer successful.

S EE ALSO

ComCoordreport.TransferZoneResultsTo(),
ComCoordreport.TransferOverreachResultsTo(),
ComCoordreport.TransferNonDirectionalBackupResultsTo()

TransferNonDirectionalBackupResultsTo
Transfers the results of the non-directional backup for the given variables to the device.
int ComCoordreport.TransferNonDirectionalBackupResultsTo(object device,
string variables)

433
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
device Device to transfer the results to.
variable Variables to transfer as semi-colon separated string:
dir Tripping direction
Tp Polygonal delay
Tc Circular delay

R ETURNS
0 Transfer did non succeed.
1 Result transfer successful.

S EE ALSO

ComCoordreport.TransferZoneResultsTo(),
ComCoordreport.TransferOverreachResultsTo(),
ComCoordreport.TransferDirectionalBackupResultsTo()

TransferOverreachResultsTo
Transfers the results of the overreach zone for the given variables to the device.
int ComCoordreport.TransferOverreachResultsTo(object device,
string variables)

A RGUMENTS
device Device to transfer the results to.

variable Variables to transfer as semi-colon separated string:


X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
dir Tripping direction
Tp Polygonal delay
Tc Circular delay

R ETURNS
0 Transfer did non succeed.
1 Result transfer successful.

S EE ALSO

ComCoordreport.TransferZoneResultsTo(),
ComCoordreport.TransferDirectionalBackupResultsTo(),
ComCoordreport.TransferNonDirectionalBackupResultsTo()

434
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

TransferResultsTo
Transfers the results for the given variables to one or more devices.
int ComCoordreport.TransferResultsTo(object device,
string variables)

int ComCoordreport.TransferResultsTo(set devices,


string variables)

A RGUMENTS
devices Devices to transfer the results to.
variable Variables to transfer as semi-colon separated string:
X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
dir Tripping direction
Tp Polygonal delay
Tc Circular delay
char Overcurrent characteristic
Iset Overcurrent setpoint
Tset Overcurrent delay

R ETURNS
0 At least one transfer did non succeed.
1 Result transfer successful.

TransferZoneResultsTo
Transfers the results of a particular zone for the given variables to the device.
int ComCoordreport.TransferZoneResultsTo(object device,
int zoneNumer,
string variables)

A RGUMENTS
device Device to transfer the results to.
zoneNumber
Zone number for which to to transfer the results (1-4).
variable Variables to transfer as semi-colon separated string:
X Polygonal reactance
R Polygonal phase-phase resistance
RE Polygonal phase-earth resistance
Z Circular impedance
phi Circular angle
dir Tripping direction
Tp Polygonal delay
Tc Circular delay

435
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Transfer did non succeed.
1 Result transfer successful.

S EE ALSO

ComCoordreport.TransferOverreachResultsTo(),
ComCoordreport.TransferDirectionalBackupResultsTo(),
ComCoordreport.TransferNonDirectionalBackupResultsTo()

3.4.15 ComDiff
Overview

Start
Stop

Start
Starts comparisons of calculation results. See SetDiffMode() for more information.
void ComDiff.Start()

S EE ALSO

ComDiff.Stop(), GetDiffMode(), SetDiffMode()

Stop
Stops comparisons of calculation results. See SetDiffMode() for more information.
void ComDiff.Stop()

S EE ALSO

ComDiff.Start(), GetDiffMode(), SetDiffMode()

3.4.16 ComDllmanager
Overview

Report

Report
Prints a status report of currently available external user-defined dlls (e.g. dpl, exdyn) to the
output window. (Same as pressing the ’Report’ button in the dialog.)
void ComDllmanager.Report()

436
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.17 ComDpl
Overview

CheckSyntax
Encrypt
Execute
GetExternalObject*
GetInputParameterDouble*
GetInputParameterInt*
GetInputParameterString*
IsEncrypted*
ResetThirdPartyModule
SetExternalObject
SetInputParameterDouble
SetInputParameterInt
SetInputParameterString
SetResultString
SetThirdPartyModule

CheckSyntax
Checks the syntax and input parameter of the DPL script and all its subscripts.
int ComDpl.CheckSyntax()

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.Execute()

Encrypt
Encrypts a script and all its subscripts. An encrypted script can be executed without password
but decrypted only with password. If no password is given a ’Choose Password’ dialog appears.
int ComDpl.Encrypt([string password = ''],
[int removeObjectHistory = 1],
[int masterCode = 0])

A RGUMENTS
password (optional)
Password for decryption. If no password is given a ’Choose Password’ dialog
appears.

removeObjectHistory (optional)
Handling of unencrypted object history in database, e.g. used by project versions
or by undo:
0 Do not remove.
1 Do remove (default).
2 Show dialog and ask.

437
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

masterCode (optional)
Used for re-selling scripts. 3rd party licence codes already set in the script will be
overwritten by this value (default = 0).

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.IsEncrypted()

Execute
Executes the DPL script as subscript.
int ComDpl.Execute([input parameter])

A RGUMENTS
input parameter (optional)
All input parameter from the ’Basic Options’ page of the ’Edit’ dialog can be given
as arguments. If a parameter is not given then the value from the dialog is used.
The values from the dialog itself are not modified. These can be modified via

• ComDpl.SetInputParameterInt()
• ComDpl.SetInputParameterDouble()
• ComDpl.SetInputParameterString().
The arguments are given by reference, thus a subscript can change the value of
a variable from the main script.

R ETURNS
For scripts without the use of exit() the following values are returned:

0 On a successful execution.
1 An error occurred.
6 User hit the break button.

S EE ALSO

ComDpl.CheckSyntax()

E XAMPLE
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.Execute(0.94, 1.05);
}
if (err) {
printf('Voltage conditions are violated');
}

438
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetExternalObject*
Gets the external object defined in the ComDpl edit dialog.
int ComDpl.GetExternalObject(string name,
object& value)

A RGUMENTS
name Name of the external object parameter.
value (out)
The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.SetExternalObject(), ComDpl.GetInputParameterInt(), ComDpl.GetInputParameterDouble(),


ComDpl.GetInputParameterString()

GetInputParameterDouble*
Gets the double input parameter value defined in the ComDpl edit dialog.
This method is intended to get the database value of the input parameter of another script only
and not to get the current value of an input parameter of another script executed as subscript
as it can be done via ’subscript:input’.
int ComDpl.GetInputParameterDouble(string name,
double& value)

A RGUMENTS
name Name of the double input parameter.
value (out)
Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.SetInputParameterDouble(), ComDpl.GetInputParameterInt(), ComDpl.GetInputParameterString(),


ComDpl.GetExternalObject()

GetInputParameterInt*
Gets the integer input parameter value defined in the ComDpl edit dialog.
This method is intended to get the database value of the input parameter of another script only
and not to get the current value of an input parameter of another script executed as subscript
as it can be done via ’subscript:input’.
int ComDpl.GetInputParameterInt(string name,
int& value)

439
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
name Name of the integer input parameter.
value (out)
Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.SetInputParameterInt(), ComDpl.GetInputParameterDouble(), ComDpl.GetInputParameterString(),


ComDpl.GetExternalObject()

GetInputParameterString*
Gets the string input parameter value defined in the ComDpl edit dialog.
This method is intended to get the database value of the input parameter of another script only
and not to get the current value of an input parameter of another script executed as subscript
as it can be done via ’subscript:input’.
int ComDpl.GetInputParameterString(string name,
string& value)

A RGUMENTS
name Name of the string input parameter.

value (out)
Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.SetInputParameterString(), ComDpl.GetInputParameterInt(), ComDpl.GetInputParameterDouble(),


ComDpl.GetExternalObject()

IsEncrypted*
Returns the encryption state of the script.
int ComDpl.IsEncrypted()

R ETURNS
1 Script is encrypted.
0 Script is not encrypted.

S EE ALSO

ComDpl.Encrypt()

440
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ResetThirdPartyModule
Resets the third party licence. Only possible for non-encrypted scripts. Requires masterkey
licence for third party module currently set.
int ComDpl.ResetThirdPartyModule()

R ETURNS
0 On success.
1 On error.

SetExternalObject
Sets the external object defined in the ComDpl edit dialog.
This method is intended to change the database value of the external object of another script
only and not to change the current value of an external object of another script executed as
subscript.
Changing the current value of an external object of another script executed as subscript is not
possible. This use-case can only be fulfilled with input parameters of type object.
int ComDpl.SetExternalObject(string name,
object value
)

A RGUMENTS
name Name of the external object parameter.

value The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.GetExternalObject(), ComDpl.SetInputParameterInt(), ComDpl.SetInputParameterDouble(),


ComDpl.SetInputParameterString()

SetInputParameterDouble
Sets the double input parameter value defined in the ComDpl edit dialog.
This method is intended to change the database value of the input parameter of another script
only and not to change the current value of an input parameter of another script executed as
subscript.
If you want to change the current value of an input parameter of another script executed as
subscript then you can pass the input parameter as argument to ComDpl.Execute() or set it
directly e.g. ’subscript:input = ...’.
int ComDpl.SetInputParameterDouble(string name,
double value
)

441
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
name Name of the double input parameter.
value Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.GetInputParameterDouble(), ComDpl.SetInputParameterInt(), ComDpl.SetInputParameterString(),


ComDpl.SetExternalObject()

SetInputParameterInt
Sets the integer input parameter value defined in the ComDpl edit dialog.
This method is intended to change the database value of the input parameter of another script
only and not to change the current value of an input parameter of another script executed as
subscript.
If you want to change the current value of an input parameter of another script executed as
subscript then you can pass the input parameter as argument to ComDpl.Execute() or set it
directly e.g. ’subscript:input = ...’.
int ComDpl.SetInputParameterInt(string name,
int value
)

A RGUMENTS
name Name of the integer input parameter.
value Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.GetInputParameterInt(), ComDpl.SetInputParameterDouble(), ComDpl.SetInputParameterString(),


ComDpl.SetExternalObject()

SetInputParameterString
Sets the string input parameter value defined in the ComDpl edit dialog.
This method is intended to change the database value of the input parameter of another script
only and not to change the current value of an input parameter of another script executed as
subscript.
If you want to change the current value of an input parameter of another script executed as
subscript then you can pass the input parameter as argument to ComDpl.Execute() or set it
directly e.g. ’subscript:input = ...’.
int ComDpl.SetInputParameterString(string name,
string value
)

442
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
name Name of the string input parameter.
value Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComDpl.GetInputParameterString(), ComDpl.SetInputParameterInt(), ComDpl.SetInputParameterDouble(),


ComDpl.SetExternalObject()

SetResultString
Method for setting the ’sResultStr’ calc comment parameter of a ComDpl object. This parameter
is used by dpl driven textboxes.
void ComDpl.SetResultString(string result)

A RGUMENTS
result String to set to ’sResultStr’ calc comment parameter.

SetThirdPartyModule
Sets the third party licence to a specific value. Only possible for non-encrypted scripts with no
third party licence set so far. Requires masterkey licence for third party module to be set.
int ComDpl.SetThirdPartyModule(string companyCode,
string moduleCode
)

A RGUMENTS
companyCode
D isplay name or numeric value of company code.
moduleCode
D isplay name or numeric value of third party module.

R ETURNS
0 On success.
1 On error.

443
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.18 ComFlickermeter
Overview

Execute

Execute
Calculates the short- and long-term flicker according to IEC 61000-4-15.
int ComFlickermeter.Execute()

R ETURNS
0 OK
1 Error: column not found in file; other internal errors
2 Error: empty input file
3 Error: cannot open file
4 Internal error: matrix empty

3.4.19 ComGenrelinc
Overview

GetCurrentIteration
GetMaxNumIterations

GetCurrentIteration
The command returns the current iteration number of the ’Run Generation Adequacy’ command
(ComGenrel).
int ComGenrelinc.GetCurrentIteration()

R ETURNS
Returns the current iteration number.

E XAMPLE
object cominc, comexe;
int maxiter, curriter;

cominc = GetFromStudyCase('ComGenrelinc');
comexe = GetFromStudyCase('ComGenrel');
cominc.Execute();
curriter = cominc.GetCurrentIteration();
printf('Current Iter = %d', curriter);

comexe:maxit = 5000;
comexe.Execute();
maxiter = cominc.GetMaxNumIterations();
curriter = cominc.GetCurrentIteration();
printf('Max Iter = %d, Current Iter = %d', maxiter, curriter);

comexe:addit = 1000;
comexe.Execute();

444
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

maxiter = cominc.GetMaxNumIterations();
curriter = cominc.GetCurrentIteration();
printf('Max Iter = %d, Current Iter = %d', maxiter, curriter);

GetMaxNumIterations
The command returns the maximume number of iterations specified in the ’Run Generation
Adequacy’ command (ComGenrel).
int ComGenrelinc.GetMaxNumIterations()

R ETURNS
Returns the maximum number of iterations.

E XAMPLE
object cominc, comexe;
int maxiter, curriter;

cominc = GetFromStudyCase('ComGenrelinc');
comexe = GetFromStudyCase('ComGenrel');
cominc.Execute();
curriter = cominc.GetCurrentIteration();
printf('Current Iter = %d', curriter);

comexe:maxit = 5000;
comexe.Execute();
maxiter = cominc.GetMaxNumIterations();
curriter = cominc.GetCurrentIteration();
printf('Max Iter = %d, Current Iter = %d', maxiter, curriter);

comexe:addit = 1000;
comexe.Execute();
maxiter = cominc.GetMaxNumIterations();
curriter = cominc.GetCurrentIteration();
printf('Max Iter = %d, Current Iter = %d', maxiter, curriter);

3.4.20 ComGridtocim
Overview

AssignCimRdfIds
ConvertAndExport
SetAuthorityUri
SetBoundaries
SetGridsToExport

445
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

AssignCimRdfIds
Assigns CIM RDF IDs for all PowerFactory objects in the active project.
int ComGridtocim.AssignCimRdfIds()

R ETURNS
0 OK
1 Error: The active project was not found
2 Error: Duplicate CIM RDF IDs found in the active project

E XAMPLE
The following example sets CIM RDF IDs to all PowerFactory objects in the active project.
int result;
object gridtocim;

gridtocim = GetFromStudyCase('ComGridtocim');
result = gridtocim.AssignCimRdfIds();
if (result = 0) {
Info('CIM RDF IDs are successfully assigned.');
}
else if (result = 1) {
Error('The active project was not found.');
}
else if (result = 2) {
Error('Duplicate CIM RDF IDs found in the active project.');
}

ConvertAndExport
Convert Grid to CIM and export CIM data to given file path without storing into database. If
no file path is provided, the file path from the corresponding CIM Data Export command in the
study will be used. In case of a validation error the export is not performed.
int ComGridtocim.ConvertAndExport([int validate])
int ComGridtocim.ConvertAndExport(string filePath,
[int validate])

A RGUMENTS
filePath File path for CIM data.

validate (optional)
Option to execute CIM Data Validation before export. If not provided, the validation
is executed. Possible values are
0 Do not validate
1 Validate

R ETURNS
0 OK
1 Error: conversion failed
2 Error: export failed

446
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
This example converts the configured grids in the Grid to the CIM Conversion command, and
export the results to a specified ZIP archive.
object gridtocim;
int error;

gridtocim = GetFromStudyCase('ComGridtocim');
error = gridtocim.ConvertAndExport('e:\export.zip', 1);
if (error = 0) {
Info('OK');
} else if (error = 1) {
Error('Error: conversion failed');
} else {
Error('Error: export failed');
}

SetAuthorityUri
Sets the authority uri for a specific grid.
void ComGridtocim.SetAuthorityUri(object grid,
string uri)

A RGUMENTS
grid Grid for which the URI is to be set.
uri URI of the model authority to be set.

E XAMPLE
This example sets the URI of the model authority for all grids in Grid to the CIM Conversion
command in the active study case.
set grids;
object project, grid, gridtocim;

project = GetActiveProject();
gridtocim = GetFromStudyCase('ComGridtocim');
grids = project.GetContents('*.ElmNet', 1);
for (grid = grids.First(); grid; grid = grids.Next()) {
gridtocim.SetAuthorityUri(grid, 'testUri');
}

SetBoundaries
Sets ”Fictitious border grid” parameter on the grids.
void ComGridtocim.SetBoundaries(set grids)

A RGUMENTS
grids The grids to be set as boundary.

447
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
This example sets a selected grid as a boundary grid. The grid is selected in the grid variable
in External Objects.
object gridtocim;
set boundaries;

gridtocim = GetFromStudyCase('ComGridtocim');
boundaries.Add(grid);
gridtocim.SetBoundaries(boundaries);

SetGridsToExport
Sets the grids as ”Selected” and clears any previous setting.
void ComGridtocim.SetGridsToExport(set grids)

A RGUMENTS
grids The grids to be exported.

E XAMPLE
This example sets all non-boundary grids in the active project for conversion from grid to
CIM.
set grids, gridsToExport;
object project, grid, gridtocim;
int isBoundary;

project = GetActiveProject();
grids = project.GetContents('*.ElmNet', 1);
for (grid = grids.First(); grid; grid = grids.Next()) {
grid.GetVal(isBoundary, 'fictborder');
if (isBoundary = 0) {
gridsToExport.Add(grid);
}
}
gridtocim = GetFromStudyCase('ComGridtocim');
gridtocim.SetGridsToExport(gridsToExport);

3.4.21 ComHostcap
Overview

CalcMaxHostedPower

448
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

CalcMaxHostedPower
The function executes predefined hosting capacty analysis command and returns the max.
hosted power (P, Q) at the given terminal. In addition, object where the violation has occured is
returned.
int ComHostcap.CalcMaxHostedPower(object terminal,
double& P,
double& Q,
object& limitingComponent)

A RGUMENTS
terminal Hosting site.
P (out) Max. active power.

Q (out) Max. reactive power.


limitingComponent (out)
Element where the limiting violation occurs.

R ETURNS
-1 Selected object is not a terminal.
0 Calculation OK. No violations.
1 Calculation failed.
2 Thermal violation.
3 Voltage violation.
4 Thermal and voltage violation.
5 Protection violation.
6 Power quality violation.

E XAMPLE
external object terminalA;
object cmdHCA, violatedElm;
double dP, dQ;
int absRet;
int iret;
cmdHCA = GetFromStudyCase('ComHostcap');
if (cmdHCA) {
iret = cmdHCA.CalcMaxHostedPower(terminalA, dP, dQ, violatedElm);
! If the calculation was success then the data can be obtained
absRet = abs(iret);
if (absRet <> 1) {
printf('Max. hosted power P, Q is: %.3f MW, %.3f MVAr', dP, dQ);
if (iret .and. violatedElm) {
printf('The most critical element: %o', violatedElm);
printf('Violation type: %d', iret);
}
}
}

449
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.22 ComImport
Overview

GetCreatedObjects
GetModifiedObjects

GetCreatedObjects
Returns the newly created objects after execution of a DGS import.
set ComImport.GetCreatedObjects()

R ETURNS
Collection of objects that have been created during DGS import.

E XAMPLE
The following example returns the created objects after execution of a DGS import:
set created;
object obj;

ImportCmd.Execute(); !execute dgs import

printf('Created objects:');
created = ImportCmd.GetCreatedObjects();
for(obj = created.First(); obj; obj = created.Next()) {
printf('%o', obj);
}

GetModifiedObjects
Returns the modified objects after execution of a DGS import.
set ComImport.GetModifiedObjects()

R ETURNS
Collection of objects that have been modified during DGS import.

E XAMPLE
The following example returns the modified objects after execution of a DGS import:
set modified;
object obj;

ImportCmd.Execute(); !execute dgs import

printf('\nModified objects:');
modified = ImportCmd.GetModifiedObjects();
for(obj = modified.First(); obj; obj = modified.Next()) {
printf('%o', obj);
}

450
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.23 ComInc
Overview

ZeroDerivative*

ZeroDerivative*
This function returns 1 if the state variable derivatives are less than the tolerance for the initial
conditions, provided that the Simulation method is set to RMS values and the Verify initial
conditions option is selected in the Calculation of initial conditions command. The tolerance
is defined on the Solver options page in the Maximum error for dynamic model equations field.
The function returns 0 if the aforementioned conditions are not met, or if at least one state
variable has a derivative larger than the tolerance.
int ComInc.ZeroDerivative()

R ETURNS
0 At least one state variable has a derivative larger than the tolerance, or the re-
quired command options have not been set.
1 All state variable derivatives are less than the tolerance.

E XAMPLE
The following example checks whether the initial conditions for the RMS simulation were
calculated and if the command option Verify Initial Conditions has been set.
object oInc;
int result;
oInc = GetCaseObject('ComInc');

oInc.Execute();

result = IsRmsValid();
if (result = 1) {
if (oInc:iopt_show = 1) {
printf('Zero derivative = %d \n', oInc.ZeroDerivative();
}
}

3.4.24 ComLdf
Overview

CheckControllers*
DoNotResetCalc
EstimateOutage
Execute
IsAC*
IsBalanced*
IsDC*
PrintCheckResults
SetOldDistributeLoadMode

451
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

CheckControllers*
Check the conditions of all controllers based on available load flow results. The report will be
printed out in output window.
int ComLdf.CheckControllers()

R ETURNS
Always return 1.

DoNotResetCalc
The load flow results will not be reset even the load flow calculation fails.
int ComLdf.DoNotResetCalc(int doNotReset)

A RGUMENTS
doNotReset
Specifies whether the results shall be reset or not.
0 Reset load flow results if load flow fails.
1 Load flow results will remain even load flow fails.

R ETURNS
Always return 0.

EstimateOutage
Estimate the loading of all branches with outages of given set of branch elements.
int ComLdf.EstimateOutage(set branches,
int init
)

A RGUMENTS
branches The branch elements to be in outage.
init Initialisation of sensitivities.
0 No need to calculate sensitivities; it assumes that sensitivities have
been calculated before hand.
1 Sensitivities will be newly calculated.

R ETURNS
0 On success.
1 On error.

Execute
Performs a load flow analysis on a network. Results are displayed in the single line graphic and
available in relevant elements.
int ComLdf.Execute()

452
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 OK
1 Load flow failed due to divergence of inner loops.
2 Load flow failed due to divergence of outer loops.

IsAC*
Check whether this load flow is configured as AC method or not.
int ComLdf.IsAC()

R ETURNS
0 Is a DC method.
1 Is an AC method.

IsBalanced*
Check whether this load flow command is configured as balanced or unbalanced.
int ComLdf.IsBalanced()

R ETURNS
Returns true if the load flow is balanced.

IsDC*
Check whether this load flow is configured as DC method or not.
int ComLdf.IsDC()

R ETURNS
0 Is an AC method.
1 Is a DC method.

PrintCheckResults
Shows the verification report in the output window.
int ComLdf.PrintCheckResults()

R ETURNS
Always return 1.

SetOldDistributeLoadMode
Set the old scaling mode in case of Distributed Slack by loads.
void ComLdf.SetOldDistributeLoadMode(int iOldMode)

453
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
iOldMode The flag showing if the old model is used.
0 Use standard mode.
1 Use old mode.

3.4.25 ComLink
Overview

GetMicroSCADAStatus
LoadMicroSCADAFile
ReceiveData
SendData
SentDataStatus
SetMicroSCADAStatus
SetOPCReceiveQuality
SetSwitchShcEventMode

GetMicroSCADAStatus
Returns the current status of the link when used in MicroSCADA mode.
int ComLink.GetMicroSCADAStatus()

R ETURNS
Returns one of the following values

-1 undefined
0 dispatcher ldf
1 online state estimation
2 simulation

LoadMicroSCADAFile
Reads in a MicroSCADA snapshot file.
int ComLink.LoadMicroSCADAFile(string filename,
[int populate]
)

A RGUMENTS
filename name of the file to read
populate (optional)
determines whether new values should be populated to the network elements
(0=no, 1=yes)

R ETURNS
0 On success.
1 On error.

454
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ReceiveData
Reads and processes values for all (in PowerFactory configured) items from OPC server (OPC
only).
int ComLink.ReceiveData([int force])

A RGUMENTS
force (optional)
0 (default) Processes changed values (asynchronously) received by Pow-
erFactory via callback
1 Forces (synchronous) reading and processing of all values (independet
of value changes)

R ETURNS
Number of read items

SendData
Sends values from configured measurement objects to OPC server (OPC only).
int ComLink.SendData([int force])

A RGUMENTS
force (optional)
0 (default) Send only data that have been changed and difference be-
tween old and new value is greater than configured deadband
1 Forces writing of all values (independet of previous value)

R ETURNS
Number of written items

E XAMPLE
object measure;
set measureSet;

!Set temp status for all measurement objects


measureSet = GetCalcRelevantObjects(\textquotesingle *.StaExt*\textquotesingle );
measure = measureSet.First();
while(measure) {
measure.InitTmp();
measure = measureSet.Next();
}

!initialization by forced sending all values


Link.SendData(1);

SentDataStatus
Outputs status of all items marked for sending to output window.
int ComLink.SentDataStatus()

455
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Number of items configured for sending.

SetMicroSCADAStatus
Sets the current status of the link when used in MicroSCADA mode.
void ComLink.SetMicroSCADAStatus(double status)

A RGUMENTS
status) -1 undefined
0 dispatcher ldf
1 online state estimation
2 simulation

SetOPCReceiveQuality
Allows to override the actual OPC receive quality by this value. (Can be used for testing.)
int ComLink.SetOPCReceiveQuality(int quality)

A RGUMENTS
quality new receive quality (bitmask)

R ETURNS
0 On success.
1 On error.

SetSwitchShcEventMode
Configures whether value changes for switches are directly transferred to the object itself of
whether shc switch events shall be created instead.
void ComLink.SetSwitchShcEventMode(int enabled)

A RGUMENTS
enabled
0 Values are directly written to switches
1 For each value change a switch event will be created

456
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.26 ComMerge
Overview

CheckAssignments
Compare
CompareActive
ExecuteRecording
ExecuteWithActiveProject
GetCorrespondingObject
GetModification
GetModificationResult
GetModifiedObjects
Merge
PrintComparisonReport
PrintModifications
Reset
SetAutoAssignmentForAll
SetObjectsToCompare
ShowBrowser
WereModificationsFound

CheckAssignments
Checks if all assignments are correct and merge can be done.
int ComMerge.CheckAssignments()

R ETURNS
0 On success.
1 Cancelled by user.
2 Missing assignments found.
3 Conflicts found.
4 On other errors.

Compare
Starts a comparison according to the settings in this ComMerge object. The merge browser is
not shown.
int ComMerge.Compare()

CompareActive
Starts a comparison according to the settings in this ComMerge object. The merge browser is
not shown. Can compare with the active project.
int ComMerge.CompareActive()

457
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ExecuteRecording
Starts a comparison according to the settings in this ComMerge object and shows the merge
browser. Records modifications in the active scenario and/or expansion stage of the target
project.
int ComMerge.ExecuteRecording()

ExecuteWithActiveProject
Starts a comparison according to the settings in this ComMerge object and shows the merge
browser. Can compare with the active project.
void ComMerge.ExecuteWithActiveProject()

GetCorrespondingObject
Searches corresponding object for given object.
object ComMerge.GetCorrespondingObject(object sourceObj,
[int target]
)

A RGUMENTS
sourceObj
Object for which corresponding object is searched.

target
0 Get corresponding object from “Base” (default)
1 Get corresponding object from “1st”
2 Get corresponding object from “2nd”

R ETURNS
object Corresponding object.
NULL Corresponding object not found.

GetModification
Gets kind of modification between corresponding objects of “Base” and “1st” or “2nd”.
int ComMerge.GetModification(object sourceObj,
[int taget]
)

A RGUMENTS
sourceObj
Object from any source for which modification is searched.

target
1 Get modification from “Base” to “1st” (default)
2 Get modification from “Base” to “2nd”

458
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error.
1 No modifications (equal).
2 Modified.
3 Added in “1st”/“2nd”.
4 Removed in “1st”/“2nd”.

GetModificationResult
Gets kind of modifications between compared objects in “1st” and “2nd”.
int ComMerge.GetModificationResult(object obj)

A RGUMENTS
obj Object from any source for which modification is searched.

R ETURNS
0 On error.
1 No modifications (equal).
2 Same modifications in “1st” and “2nd” (no conflict).
3 Different modifications in “1st” and “2nd” (conflict).

GetModifiedObjects
Gets all objects with a certain kind of modification.
set ComMerge.GetModifiedObjects(int modType,
[int modSource]
)

A RGUMENTS
modType
1 get unmodified objects
2 get modified objects
3 get added objects
4 get removed obejcts
modSource
1 consider modification between “Base” and “1st” (default)
2 consider modification between “Base” and “2nd”

R ETURNS
Set with matching objects.
Unmodified, modified and added objects are always from given “modSource”, removed ob-
jects are always from “Base” .

459
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

Merge
Checks assignments, merges modifications according to assignments into target and prints
merge report to output window.
void ComMerge.Merge(int printReport)

A RGUMENTS
printReport
1 print merge report (default)
0 do not print merge report
always set to 0 in paste and split mode

PrintComparisonReport
Prints the modifications of all compared objects as a report to the output window.
void ComMerge.PrintComparisonReport(int mode)

A RGUMENTS
mode
0 no report
1 only modified compare objects
2 all compare objects

PrintModifications
Prints modifications of given objects (if any) to the output window.
int ComMerge.PrintModifications(set objs)
int ComMerge.PrintModifications(object obj)

A RGUMENTS
objs Set of objects for which the modifications are printed.
obj Object for which the modifications are printed.

R ETURNS
0 On error: object(s) not found in comparison.
1 On success: modifications were printed.

Reset
Resets/clears and deletes all temp. object sets, created internally for the comparison.
void ComMerge.Reset()

SetAutoAssignmentForAll
Sets the assignment of all compared objects automatically.
void ComMerge.SetAutoAssignmentForAll(int conflictVal)

460
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
conflictVal
Assignment of compared objects with undefined automatic values (e.g. conflicts)
0 no assignment
1 assign from “Base”
2 assign from 1st
3 assign from 2nd

SetObjectsToCompare
Sets top level objects for comparison.
void ComMerge.SetObjectsToCompare(object base,
[object first,]
[object second]
)

A RGUMENTS
base Top level object to be set as “Base”

first Top level object to be set as “1st”


second Top level object to be set as “2nd”

ShowBrowser
Shows merge browser with initialized settings and all compared objects. Can only be called
after a comparison was executed.
int ComMerge.ShowBrowser()

R ETURNS
0 The browser was left with ok button.
1 The browser was left with cancel button.
2 On error.

WereModificationsFound
Checks, if modifications were found in comparison.
int ComMerge.WereModificationsFound()

R ETURNS
0 All objects in comparison are equal.
1 Modifications found in comparison.

461
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.27 ComMot
Overview

GetMotorConnections*
GetMotorSwitch*
GetMotorTerminal*

GetMotorConnections*
Finds the cables connecting the motor to the switch.
set ComMot.GetMotorConnections(object motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the set of cables connecting the motor to the switch.

GetMotorSwitch*
Finds the switch which will connect the motor to the network.
object ComMot.GetMotorSwitch(object motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the switch element.

GetMotorTerminal*
Finds the terminal to which the motor will be connected.
object ComMot.GetMotorTerminal(object motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the terminal element.

462
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.28 ComNmink
Overview

AddRef
Clear
GenerateContingenciesForAnalysis
GetAll*

AddRef
Adds shortcuts to the objects to the existing selection.
void ComNmink.AddRef(object O)
void ComNmink.AddRef(set S)

A RGUMENTS
O(optional)
an object
S(optional)
a Set of objects

E XAMPLE
The following prepares and executes an outage simulation for all high loaded lines.
PrepOut.Clear();
S = GetCalcRelevantObjects();
O = S.Firstmatch('ElmLne');
while (O) {
if (O:c:loading > 75) {
PrepOut.AddRef(O);
}
O = S.Nextmatch();
}
PrepOut.Execute();

Clear
Delete all contents, i.e. to empty the selection.
void ComNmink.Clear()

E XAMPLE
The following example creates a selection of all loads.
PrepOut.Clear();
objects = GetCalcRelevantObjects();
obj = objects.Firstmatch('ElmLne');
while (obj) {
if (obj:c:loading > 75) {
PrepOut.AddRef(obj);
}
obj = objects.Nextmatch();
}
PrepOut.Execute();

463
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GenerateContingenciesForAnalysis
Generates Contingencies for Contingency Analysis. Similar to calling ’Execute’ but does not
pop-up the contingency command.
int ComNmink.GenerateContingenciesForAnalysis()

R ETURNS
0 On success.
1 On error.

GetAll*
Returns all objects which are of the class 'ClassName'.
set ComNmink.GetAll(string className)

A RGUMENTS
className
The object class name.

R ETURNS
The set of objects

E XAMPLE
The following example writes all three winding transformers in the preparation command to
the output window.
set list;
object obj;
S = Prep.GetAll('ElmTr3');
obj = list.First();
while (obj) {
obj.ShowFullName();
obj = list.Next();
}

3.4.29 ComOmr
Overview

GetFeeders
GetOMR
GetRegionCount

464
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetFeeders
Get all feeders for which optimal manual switches have been determined. This function can be
used after execution of an Optimal Manual Restoration command only.
set ComOmr.GetFeeders()

R ETURNS
The set of all feeders used for optimisation.

E XAMPLE
The following example calculates a pre-configured Optimal Manual Restoration command
and shows the considered feeders in the output window.
int errCode;
object comOmr,
feeder;
set feeders;

comOmr = GetFromStudyCase('ComOmr');

errCode = comOmr.Execute();
if ( errCode=0 ) {
feeders = comOmr.GetFeeders();
printf('The following feeders participated in the optimisation:\n');
for ( feeder = feeders.First(); feeder ; feeder = feeders.Next() ) {
printf(' - %o\n', feeder);
}
}

GetOMR
Get terminal and connected optimal manual switches determined by the optimisation for the
given feeder and its region(pocket) of the given index. For a detailed description of a pocket,
please consult the manual. This function can be used after execution of an Optimal Manual
Restoration command only.
set ComOmr.GetOMR(object arg0,
int arg1
)

A RGUMENTS
arg0 The feeder to derive the resulting optimal terminal with its connected (optimal)
manual switches for.
arg1 The index of the region(pocket) inside the given feeder to derive the resulting
optimal terminal with its connected (optimal) manual switches for.

R ETURNS
The resulting optimal terminal with its connected (optimal) manual switches for the region in
the feeder.

E XAMPLE
The following example calculates a pre-configured Optimal Manual Restoration command
and shows the resulting optimal manual restoration points (together with its connected switches)
in the output window.

465
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

int errCode,
numRegions,
isClass,
regIdx;
object comOmr,
feeder,
obj;
set feeders,
termAndSwitches;

comOmr = GetFromStudyCase('ComOmr');

errCode = comOmr.Execute();
if ( errCode=0 ) {
feeders = comOmr.GetFeeders();
for ( feeder=feeders.First(); feeder; feeder=feeders.Next() ) {
numRegions = comOmr.GetRegionCount(feeder);
for ( regIdx=0; regIdx<numRegions; regIdx=regIdx+1 ) {
termAndSwitches = comOmr.GetOMR(feeder, regIdx);
for ( obj=termAndSwitches.First(); obj; obj=termAndSwitches.Next() ) {
isClass = obj.IsClass('ElmTerm');
if (isClass) {
printf('The optimal terminal in region %d is: %o', regIdx, obj);
}
isClass = obj.IsClass('ElmCoup');
if (isClass) {
printf('Optimal manual switches in region %d are: %o', regIdx, obj);
}
isClass = obj.IsClass('StaSwitch');
if (isClass) {
printf('Optimal manual switches in region %d are: %o', regIdx, obj);
}
}
}
}
}

GetRegionCount
Get total number of regions(pockets) separated by infeeding point, feeder ends and certain
switches for the provided feeder. For a detailed description of a pocket, please consult the
manual. This function can be used after execution of an Optimal Manual Restoration command
only.
int ComOmr.GetRegionCount(object feeder)

A RGUMENTS
feeder Feeder to derive number of regions(pockets) for.

R ETURNS
Number of regions(pockets) for the feeder.

E XAMPLE
The following example calculates a pre-configured Optimal Manual Restoration command
and shows the number of regions(pockets) for the considered feeders in the output window.
int errCode,

466
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

numRegions;
object comOmr,
feeder;
set feeders;

comOmr = GetFromStudyCase('ComOmr');

errCode = comOmr.Execute();
if ( errCode=0 ) {
feeders = comOmr.GetFeeders();
for ( feeder = feeders.First(); feeder ; feeder = feeders.Next() ) {
numRegions = comOmr.GetRegionCount(feeder);
printf(' %o: number of regions: %d\n', feeder, numRegions);
}
}

3.4.30 ComOpc
Overview

ReceiveData
SendData

ReceiveData
Reads and processes values for all (in PowerFactory configured) items from OPC server (OPC
only).
int ComOpc.ReceiveData([int force])

A RGUMENTS
force (optional)
1 Forces (synchronous) reading and processing of all values (independet
of value changes)

R ETURNS
1 if successfully received data -1 if an error occurred -2 if the link is not connected

SendData
Sends values from configured measurement objects to OPC server (OPC only).
int ComOpc.SendData([int force])

A RGUMENTS
force (optional)
0 (default) Send only data that have been changed and difference be-
tween old and new value is greater than configured deadband
1 Forces writing of all values (independet of previous value)

467
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
1 if successfully received data -1 if an error occurred -2 if the link is not connected

3.4.31 ComOutage
Overview

ContinueTrace
ExecuteTime
GetObject*
RemoveEvents
SetObjs
StartTrace
StopTrace

ContinueTrace
Continue the next step of the trace.
int ComOutage.ContinueTrace()

R ETURNS
0 On success.
6= 0 On error.

ExecuteTime
Execute contingency (with multiple time phase) for the given time.
int ComOutage.ExecuteTime(double time)

A RGUMENTS
time the given time to be executed.

R ETURNS
=0 On success.
6= 0 On error.

GetObject*
Get the element stored in line number “line” in the table of ComOutage. The line index starts
with 0.
object ComOutage.GetObject(int line)

A RGUMENTS
line line index, if index exceeds the range NULL is returned

R ETURNS
the element of line “line” in the table.

468
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example shows how to access elements in the table of all ComOutage whose
names start with “L”.
object command,
outage,
obj;
set outages;
int sizeElements,
line;

command = GetFromStudyCase('*.ComSimoutage');
! get rel. command from study case
if (command) {
! get all outages of which the names starts with "L"
outages = command.GetContents('L*.ComOutage');
! show the elements of all outages
for (outage=outages.First(); outage; outage=outages.Next()) {
outage.GetSize('Elements', sizeElements);
! get size of vector Elements
obj = outage.GetObject(line);
!outage.GetVal(obj, 'Elements', line); same like GetObject
obj.ShowFullName();
}
}

RemoveEvents
Remove all events defined in this contingency.
void ComOutage.RemoveEvents ([int info])
void ComOutage.RemoveEvents (string type)
void ComOutage.RemoveEvents (int info, string type)
void ComOutage.RemoveEvents (string type, int info)

A RGUMENTS
type
none Hidden objects are ignored and not added to the set
'Lod' remove all EvtLod
'Gen' remove all EvtGen
'Switch' remove all EvtSwitch

info(optional)
1 show info message in output window (default)
0 do not show info message

E XAMPLE
The following example shows how to remove events from ComOutage.
object command,
outage;
set outages;

command = GetFromStudyCase('*.ComSimoutage');

469
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

! get contingency analysis command from study case


if (command) {
! get all outages of which the names starts with "L"
outages = command.GetContents('L*.ComOutage');
! remove the events
for (outage=outages.First(); outage; outage=outages.Next()) {
outage.RemoveEvents(0);! delete all stored events,suppress info message
}
}

SetObjs
To fill up the ”interrupted components” with given elements.
Sets the list of objects according to S.
int ComOutage.SetObjs(set S)

A RGUMENTS
S the set of objects

R ETURNS
0 On success.
1 On error.

StartTrace
Start trace all post fault events of this contingency.
int ComOutage.StartTrace()

R ETURNS
=0 On success.
6= 0 On error.

StopTrace
To stop the trace.
int ComOutage.StopTrace([int msg])

A RGUMENTS
msg (optional)
Emit messages or not.
0 Suppress messages.
1 Emit messages.

R ETURNS
=0 On success.
6= 0 On error.

470
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.32 ComPfdimport
Overview

GetImportedObjects

GetImportedObjects
Returns the imported objects of last execution of command.
set ComPfdimport.GetImportedObjects()

R ETURNS
Returns the imported objects of the last execution of the command.

E XAMPLE
object com;
object importedObject;
set importedObjects;

com = GetFromStudyCase('ComPfdimport');

SetConsistencyCheck(0);
com:g_target = GetCurrentUser();
com:g_file = 'D:/test.pfd';
SetConsistencyCheck(1);

com.Execute();
importedObjects = com.GetImportedObjects();
printf('All imported objects:');
for (importedObject = importedObjects.First();
importedObject;
importedObject = importedObjects.Next())
{
printf('%o', importedObject);
}

3.4.33 ComPrjconnector
Overview

GetSuccesfullyConnectedItems
GetUnsuccesfullyConnectedItems

GetSuccesfullyConnectedItems
Returns a list of elements which were correctly processed in the last run of the command
set ComPrjconnector.GetSuccesfullyConnectedItems()

471
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetUnsuccesfullyConnectedItems
Returns a list of elements which were not correctly processed in the last run of the command
set ComPrjconnector.GetUnsuccesfullyConnectedItems()

3.4.34 ComProtgraphic
Overview

AddToUpdatePages
ClearUpdatePages

AddToUpdatePages
Adds pages (*.SetVipage) to the user-defined selection of plot pages to update.
void ComProtgraphic.AddToUpdatePages(set pages)

ClearUpdatePages
Clears the user-defined selection of plot pages to update.
void ComProtgraphic.ClearUpdatePages()

3.4.35 ComPvcurves
Overview

FindCriticalBus

FindCriticalBus
Returns the critical bus for a given PV-Curve result file. The critical bus is the one with the
highest gradient at the last iteration. If a bus is found, whose voltage drop is twice as high, as
the one with the highest gradient, the bus with the higher voltage drop is the critical one.
object ComPvcurves.FindCriticalBus(object resultfile)

3.4.36 ComPython
Overview

GetExternalObject*
GetInputParameterDouble*
GetInputParameterInt*
GetInputParameterString*
SetExternalObject
SetInputParameterDouble
SetInputParameterInt
SetInputParameterString

472
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetExternalObject*
Gets the external object defined in the ComPython edit dialog.
int ComPython.GetExternalObject(string name,
object& value)

A RGUMENTS
name Name of the external object parameter.
value (out)
The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.SetExternalObject(), ComPython.GetInputParameterInt(),
ComPython.GetInputParameterDouble(), ComPython.GetInputParameterString()

GetInputParameterDouble*
Gets the double input parameter value defined in the ComPython edit dialog.
int ComPython.GetInputParameterDouble(string name,
double& value)

A RGUMENTS
name Name of the double input parameter.
value (out)
Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.SetInputParameterDouble(), ComPython.GetInputParameterInt(),
ComPython.GetInputParameterString(), ComPython.GetExternalObject()

GetInputParameterInt*
Gets the integer input parameter value defined in the ComPython edit dialog.
int ComPython.GetInputParameterInt(string name,
int& value)

A RGUMENTS
name Name of the integer input parameter.
value (out)
Value of the integer input parameter.

473
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.SetInputParameterInt(), ComPython.GetInputParameterDouble(),
ComPython.GetInputParameterString(), ComPython.GetExternalObject()

GetInputParameterString*
Gets the string input parameter value defined in the ComPython edit dialog.
int ComPython.GetInputParameterString(string name,
string& value)

A RGUMENTS
name Name of the string input parameter.
value (out)
Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.SetInputParameterString(), ComPython.GetInputParameterInt(),
ComPython.GetInputParameterDouble(), ComPython.GetExternalObject()

SetExternalObject
Sets the external object defined in the ComPython edit dialog.
int ComPython.SetExternalObject(string name,
object value
)

A RGUMENTS
name Name of the external object parameter.
value The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.GetExternalObject(), ComPython.SetInputParameterInt(),
ComPython.SetInputParameterDouble(), ComPython.SetInputParameterString()

474
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SetInputParameterDouble
Sets the double input parameter value defined in the ComPython edit dialog.
int ComPython.SetInputParameterDouble(string name,
double value
)

A RGUMENTS
name Name of the double input parameter.
value Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.GetInputParameterDouble(), ComPython.SetInputParameterInt(),
ComPython.SetInputParameterString(), ComPython.SetExternalObject()

SetInputParameterInt
Sets the integer input parameter value defined in the ComPython edit dialog.
int ComPython.SetInputParameterInt(string name,
int value
)

A RGUMENTS
name Name of the integer input parameter.
value Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.GetInputParameterInt(), ComPython.SetInputParameterDouble(),
ComPython.SetInputParameterString(), ComPython.SetExternalObject()

SetInputParameterString
Sets the string input parameter value defined in the ComPython edit dialog.
int ComPython.SetInputParameterString(string name,
string value
)

A RGUMENTS
name Name of the string input parameter.
value Value of the string input parameter.

475
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

S EE ALSO

ComPython.GetInputParameterString(), ComPython.SetInputParameterInt(),
ComPython.SetInputParameterDouble(), ComPython.SetExternalObject()

3.4.37 ComRed
Overview

LdfEquivalentVerification
ReductionInMemory
ResetReductionInMemory
SimEquivalentVerification

LdfEquivalentVerification
Right after Network Reduction execution, get the verification results of the load flow equivalents.
int ComRed.LdfEquivalentVerification()

R ETURNS
-1 Calculation is not available or the varification is not enabled.
0 The reduced network is equivalent to the original network.
1 The load flow doesn’t converge after reduction.
2 The load flow converges after reduction but the results differ from original net-
work.

ReductionInMemory
Execute network reduction in memory, no change to database. Note: afterwards, the function
ResetReductionInMemory() must be called to revert the reduction.
int ComRed.ReductionInMemory()

R ETURNS
Returns 0 if successfully executed.

E XAMPLE
object redCom;

redCom = GetCaseObject('ComRed');

if (redCom = NULL) {
Error('No Network Reduction Command found in active study case!');
exit();
}

redCom.ReductionInMemory();

476
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ResetReductionInMemory
Restore the network back to original after reduction in memory.
void ComRed.ResetReductionInMemory()

E XAMPLE
object redCom;

redCom = GetCaseObject('ComRed');

if (redCom = NULL) {
Error('No Network Reduction Command found in active study case!');
exit();
}

redCom.ResetReductionInMemory();

SimEquivalentVerification
Right after Network Reduction execution, get the verification results of the dynamic simulation
equivalents.
int ComRed.SimEquivalentVerification()

R ETURNS
-1 Calculation is not available or the varification cannot be carried out.
0 The reduced network is equivalent to the original network.
1 The dynamic simulation fails after reduction.
2 The dynamic simulation works after reduction but the results differ from original
network.

3.4.38 ComRel3
Overview

AnalyseElmRes
ExeEvt
OvlAlleviate
RemoveEvents
RemoveOutages
ValidateConstraints

AnalyseElmRes
Evaluate the results object created by the last calculation. Performs exactly the same as
pressing the button 'Perform Evaluation of Result File' in the dialogue box of the command.
int ComRel3.AnalyseElmRes([int error])

A RGUMENTS
error (optional)

477
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

0 do not display an error message (default)


1 display error messages in case of errors

R ETURNS
=0 On success.
6= 0 On error.

E XAMPLE
The following example shows how to call the evaluation of the results.
object command,
resultFile;
int err;

command = GetFromStudyCase('.ComRel3');
! get the command from study case
if (command) {
err=command.AnalyseElmRes(0);
! hide error message
if (err) {
! display my own error message
resultFile = command:p_resenum;
if (resultFile) {
Error('Evaluation of results %s failed', resultFile:loc_name);
}
}
}

ExeEvt
Executes a given event.
void ComRel3.ExeEvt([object event])

A RGUMENTS
event The event that shall be executed.

OvlAlleviate
Performs an overload alleviation for given events.
int ComRel3.OvlAlleviate([set preCalcEvents])

A RGUMENTS
preCalcEvents (optional)
The events which will be executed before the calculation.

R ETURNS
0 On success.
1 Failure in load flow.
2 No overloading detected.
>2 On error.

478
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

RemoveEvents
Removes all events stored in all contingencies (*.ComContingency) inside the reliability com-
mand.
void ComRel3.RemoveEvents()

E XAMPLE
The following example shows how to remove events from all contingencies stored inside the
reliability command:
object command;

command = GetFromStudyCase('*.ComRel3');
! get reliability command from study case
if (command) {
command.RemoveEvents();
}

RemoveOutages
Removes all contingency definitions (*.ComContingencies) stored inside the reliability com-
mand.
void ComRel3.RemoveOutages([int msg])

A RGUMENTS
msg( optional)
1 Show info message in output window (default value).
0 Do not emit messages.

E XAMPLE
The following example removes all ComContingencies objects stored inside the reliability
command in the study case.
object command;

command = GetFromStudyCase('*.ComRel3');
! get the command from study case
if (command) {
command.RemoveOutages(0);
! suppress info message
}

ValidateConstraints
Checks if the restoration of a contingency violates any constraint according to the current
settings of the reliability calculation. These do not necessarily have to be the settings used
during calculation. Of course the selected calculation method of ComRel3 has to be ’Load flow
analysis’ to check for constraint violations.
int ComRel3.ValidateConstraints(object contingency)

479
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
contingency
The contingency which will be checked for constraint violations.

R ETURNS
0 No constraint violations, or all constraint violations could be solved.
1 Constraints are violated.
−1 Contingency not valid.
−2 Load flow did not converge.
−3 Network error.

3.4.39 ComRelpost
Overview

CalcContributions
GetContributionOfComponent

CalcContributions
Calculates the contributions to load interruptions of the loads that are passed to this function.
The loads can be e.g. inside a feeder or a zone as well. If nothing is passed as input all loads
will be analysed.
int ComRelpost.CalcContributions([set elements])

A RGUMENTS
elements (optional)
Elements (Loads) for which the contributions shall be calculated (default: all loads,
if no argument is passed).

R ETURNS
0 Calculation successful.
1 On error.

E XAMPLE
The following example shows how to calculate the contributions for all elements.
object command;
int err;

command = GetFromStudyCase('*.ComRelpost');
if (command) {
err=command.CalcContributions();
}

480
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetContributionOfComponent
Gets the contributions of a component to a certain reliability indice.
double ComRelpost.GetContributionOfComponent(int componentNr,
string indice)

A RGUMENTS
componentNr 1. Lines
2. Cables
3. Transformers
4. Busbars
5. Generators
6. Common Modes
7. Double Earth Faults
indice Avalaible indices are: ’SAIFI’, ’SAIDI’, ’ASIFI’, ’ASIDI’, ’ENS’, ’EIC’

R ETURNS
The contribution of this component to this reliability indice.

E XAMPLE
See ’Reliability Contributions Report’ . The link to this report can be found in the contribution
to reliability indices command.

3.4.40 ComRelreport
Overview

GetContingencies*
GetContributionOfComponent

GetContingencies*
Gets all contingencies of reliability for reporting.
set ComRelpost.GetContingencies()

R ETURNS
All contingencies of reliability for reporting.

GetContributionOfComponent
Is described in ComRelpost.GetContributionOfComponent().
double ComRelreport.GetContributionOfComponent(int componentNr,
string indice)

481
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.41 ComReltabreport
Overview

GetContingencies*
GetContributionOfComponent

GetContingencies*
Gets all contingencies of reliability for reporting.
set ComReltabreport.GetContingencies()

R ETURNS
All contingencies of reliability for reporting.

GetContributionOfComponent
Is described in ComRelpost.GetContributionOfComponent().
double ComReltabreport.GetContributionOfComponent(int componentNr,
string indice)

3.4.42 ComReport
Overview

ExecuteWithCustomSelection
SetParameter

ExecuteWithCustomSelection
Executes report generation with the given reports as well as front matter and header/footer
template.

This method allows to override the regular report selection configured for the currently active
calculation as well as the configured front matter and header/footer template, with a freely
defined selection.

Since virtually any report templates can be selected (even those that were not designed for the
currently active calculation), this method should be employed by experienced users only.
int ComReport.ExecuteWithCustomSelection(set reports,
[object frontMatter],
[object headerFooter])

A RGUMENTS
reports The reports to be selected.
frontMatter (optional)
The front matter template to be used. If not given, no front matter will be selected.
headerFooter (optional)
The header/footer template to be used. If not given, no header/footer will be

482
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

selected.

R ETURNS
The same return value as a regular ’Execute’ call.

SetParameter
Overrides the initial value of the given report’s parameter with the given value.

This method is the scripting equivalent of overriding the value of a report parameter in the Report
Generation command (ComReport) dialog and should only be employed by experienced users.
int ComReport.SetParameter(object report,
string parameterIdentifier,
int|double|string value)

A RGUMENTS
report The report that provides the desired parameter.
parameterIdentifier
The identifier (not the localised name) of the parameter.

value The new value for the parameter.

R ETURNS
An error code. Possible values are

0 No error has occurred, the parameter has been successfully set.


1 The given object is not a report template (either a null reference or not of class
IntReport).
2 There is no valid report parameter with the given identifier.
3 The data type of the given value cannot be converted to the data type of the
parameter.
4 The data type of the given value is not supported by this method.

3.4.43 ComRes
Overview

ExportFullRange*
FileNmResNm

ExportFullRange*
Executes the export command for the whole data range.
void ComRes.ExportFullRange()

E XAMPLE
The following example exports the complete range of results
object obj,

483
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

export;
set range;
export = GetFromStudyCase('*.ComRes');
range = SEL.GetAll('ElmRes');
obj = range.First();
while (obj) {
export:pResult = obj;
export.ExportFullRange();
obj = range.Next();
}

FileNmResNm
Sets the filename for the data export to the name of the result object being exported (classes:
ElmRes, IntComtrade)
void ComRes.FileNmResNm()

E XAMPLE
The following example searches the export command in the study case, assigns the first
ElmRes found and sets the filename of the export command to the name of the result file
object.
object export,
res;
export = GetFromStudyCase('*.ComRes');
if (export=nullptr) {
exit(1);
}

res = GetFromStudyCase('*.ElmRes');
if (res=nullptr) {
exit(1);
}
export:pResult = res;
export.FileNmResNm();

3.4.44 ComShc
Overview

ExecuteRXSweep
GetFaultType*
GetOverLoadedBranches
GetOverLoadedBuses

484
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ExecuteRXSweep
Calculates RX Sweep. If no impedance passed, the value from the command shall be used. If
argument passed then the impedance changes are stored to the command (Rf, Xf).
int ComShc.ExecuteRXSweep()
int ComShc.ExecuteRXSweep(double Zr,
double Zi
)

A RGUMENTS
Zr Impedance real part
Zi Impedance imaginary part

R ETURNS
=0 On success.
6= 0 On error.

GetFaultType*
Returns the short-circuit fault type.
int ComShc.GetFaultType()

R ETURNS
0 three phase fault
1 single phase to ground
2 two phase fault
3 two phase to ground fault
4 three phase unbalanced fault
5 single phase to neutral fault
6 single phase, neutral to ground fault
7 two phase to neutral fault
8 two phase, neutral to ground fault
9 three phase to neutral fault
10 three phase, neutral to ground fault
20 DC fault

GetOverLoadedBranches
Get overloaded branches after a short-circuit calculation.
int ComShc.GetOverLoadedBranches(double ip,
double ith,
[set& branches]
)

A RGUMENTS
ip Max. peak-current loading, in %
ith Max. thermal loading, in %
branches (out)
Set of branches which are checked

485
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
=0 On error or 0 branches found.
6= 0 Number of branches.

E XAMPLE
object oShcCmd, oBranch;
double dIpload, dIthload;
set sBranch;
int iret;

dIpload = 500;
dIthload = 100;
oShcCmd = GetFromStudyCase('ComShc');
iret = oShcCmd.GetOverLoadedBranches(dIpload, dIthload, sBranch); ! Shall check all branches
if (iret > 0) {
oBranch = sBranch.First();
while (oBranch) {
printf('Overloaded branch: %o \n', oBranch);
oBranch = sBranch.Next();
}
}

GetOverLoadedBuses
Get overloaded buses after a short-circuit calculation.
int ComShc.GetOverLoadedBuses(double ip,
double ith,
[set& buses])

A RGUMENTS
ip Max. peak-current loading, in %
ith Max. thermal loading, in %
buses (optional, out)
Set of buses which are checked

R ETURNS
=0 On error or 0 buses found.
6= 0 Number of buses.

E XAMPLE
object oShcCmd, oBus;
double dIpload, dIthload;
set sBus;
int iret;

dIpload = 500;
dIthload = 100;
oShcCmd = GetFromStudyCase('ComShc');
iret = oShcCmd.GetOverLoadedBuses(dIpload, dIthload, sBus); ! Shall check all buses
if (iret > 0) {
oBus = sBus.First();
while (oBus) {

486
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

printf('Overloaded bus: %o \n', oBus);


oBus = sBus.Next();
}
}

3.4.45 ComShctrace
Overview

BlockSwitch
ExecuteAllSteps
ExecuteInitialStep
ExecuteNextStep
GetBlockedSwitches
GetCurrentTimeStep
GetDeviceSwitches
GetDeviceTime
GetNonStartedDevices
GetStartedDevices
GetSwitchTime
GetTrippedDevices
NextStepAvailable

BlockSwitch
Blocks a switch from operating for the remainder of the trace.
int ComShctrace.BlockSwitch(object switchDevice)

A RGUMENTS
switchDevice
Switch device to block.

R ETURNS
0 Switch can not be blocked (e.g. because it already operated).
1 Switch is blocked.

ExecuteAllSteps
Executes all steps of the short circuit trace. This function requires the trace to be already
running
int ComShctrace.ExecuteAllSteps()

R ETURNS
0 No error occurred, trace is complete.
!=0 An error occurred, calculation was reset.

S EE ALSO

ComShctrce.ExecuteInitialStep()

487
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ExecuteInitialStep
Executes the first step of the short circuit trace.
int ComShctrace.ExecuteInitialStep()

R ETURNS
0 No error occurred, the short-circuit trace is now running.
!=0 An error occurred, calculation was reset.

ExecuteNextStep
Executes the next step of the short circuit trace. This function requires the trace to be already
running
int ComShctrace.ExecuteNextStep()

R ETURNS
0 No error occurred, step was executed .
!=0 An error occurred, calculation was reset.

S EE ALSO

ComShctrce.ExecuteInitialStep()

GetBlockedSwitches
Returns all switches which are currently blocked.
set ComShctrace.GetBlockedSwitches()

R ETURNS
All blocked switches.

GetCurrentTimeStep
Returns the current time step of the trace in seconds.
int ComShctrace.GetCurrentTimeStep()

R ETURNS
The current time step in [s].

GetDeviceSwitches
Returns all switches operated by a protection device.
set ComShctrace.GetDeviceSwitches(object device)

A RGUMENTS
device Protection device to get the switches for.

488
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
All switches devices operated by the protection device.

GetDeviceTime
Returns the time a protection device operated or will operate at.
int ComShctrace.GetDeviceTime(object device)

A RGUMENTS
device Protection device to get the time for.

R ETURNS
The tripping time of the device itself, if the device already tripped, or the prospective tripping
time.

GetNonStartedDevices
Returns all protection devices which are not started.
set ComShctrace.GetNonStartedDevices()

R ETURNS
All protection devices which are not started.

GetStartedDevices
Returns all started but not yet tripped protection devices.
set ComShctrace.GetStartedDevices()

R ETURNS
All started but not yet tripped protection devices.

GetSwitchTime
Returns the time a switch device operated or will operate at.
int ComShctrace.GetSwitchTime(object device,
object switchDevice
)

A RGUMENTS
device Reference protection device for the switch.
device Switch device to get the time for.

R ETURNS
The tripping time of the switch device, based on the tripping time of the reference protection
device. If the switch already operated, the time of operation will be returned.

489
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetTrippedDevices
Returns all protection devices already tripped.
set ComShctrace.GetTrippedDevices()

R ETURNS
All protection devices already tripped.

NextStepAvailable
Indicates whether or not a next time step can be executed.
int ComShctrace.NextStepAvailable()

R ETURNS
0 Next step is not available, the trace is completed.
1 A next step is available.

3.4.46 ComSim
Overview

GetSimulationTime
GetTotalWarnA
GetTotalWarnB
GetTotalWarnC
GetViolatedScanModules*
LoadSnapshot
SaveSnapshot

GetSimulationTime
Get the actual simulation time if the initial conditions are calculated.
int ComSim.GetSimulationTime()

R ETURNS
Returns the simulation time in seconds. If the initial conditions are not calculated, then the
function returns ’nan’.

GetTotalWarnA
Returns the total number of type-A (serious) warnings related to the time-domain simulation.
int ComSim.GetTotalWarnA()

R ETURNS
Returns the total number of type-A (serious) warnings.

490
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetTotalWarnB
Returns the total number of type-B (moderate) warnings related to the time-domain simulation.
int ComSim.GetTotalWarnB()

R ETURNS
Returns the total number of type-B (moderate) warnings.

GetTotalWarnC
Returns the total number of type-C (minor) warnings related to the time-domain simulation.
int ComSim.GetTotalWarnC()

R ETURNS
Returns the total number of type-C (minor) warnings.

GetViolatedScanModules*
Returns a set of scan modules of which each have at least one violation.
set ComSim.GetViolatedScanModules()

R ETURNS
Returns a set of scan modules of which each have at least one violation.

E XAMPLE
See example ScnFreq.GetViolationTime().

LoadSnapshot
Load the state of a dynamic simulation from a file.
int ComSim.LoadSnapshot([string snapshotFilePath], [int suppressUserMessage])

D EPRECATED N AMES
LoadSimulationState

A RGUMENTS
snapshotFilePath (optional)
The snapshot file to load. If no file is specified, the last snapshot stored in the
memory is used. (default = ”)

suppressUserMessage (optional)
The pop-up window asking for data overwrite is not displayed if this value is set to
1. (default = 0)

R ETURNS
0 Saved simulation state has been loaded.
1 Saved simulation state cannot be loaded.
2 Saved simulation state does not match actual model. Calculation will be reset.

491
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SaveSnapshot
Save the state of a dynamic simulation to memory and to a file.
int ComSim.SaveSnapshot(string snapshotFilePath, [int suppressUserMessage])

D EPRECATED N AMES
SaveSimulationState

A RGUMENTS
snapshotFilePath (optional)
The snapshot file to save. If no file is specified, the last snapshot is saved in the
non-persistent memory slot. (default = ”)

suppressUserMessage (optional)
The pop-up window asking for file overwriting is not displayed if this value is set to
1. (default = 0)

R ETURNS
0 OK
1 Error

3.4.47 ComSimoutage
Overview

AddCntcy
AddContingencies
AddRas
ClearCont
CreateFaultCase
Execute
ExecuteAndCheck
GetNTopLoadedElms*
MarkRegions
RemoveAllRas
RemoveContingencies
RemoveRas
Reset
SetLimits
Update

AddCntcy
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.
int ComSimoutage.AddCntcy(object O,
[string name]
)

A RGUMENTS
O The ComOutage object

492
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

name A name for the outage

R ETURNS
0 On success.
1 On error.

E XAMPLE
The following example analyses all selected outage definitions and adds the results to the
intermediate results.
set outages;
object limit;
outages = SEL.GetAll('ComOutage');
limit = outages.First();
while (limit) {
CA.AddCntcy(obj);
limit = outages.Next();
}

AddContingencies
Adds contingencies for fault cases/groups selected by the user to the command. Shows a modal
window with the list of available fault cases and groups. Functionality as “Add Cases/Groups”
button in dialog.
void ComSimoutage.AddContingencies()

E XAMPLE
object command;

command.AddContingencies();

AddRas
Adds a reference to a given IntRas to the ComSimoutage.
int ComSimoutage.AddRas(object ras)

A RGUMENTS
ras The IntRas object

R ETURNS
0 If the reference to the IntRas has been added.
1 If the reference to the IntRas has already been there or on error.

ClearCont
Reset existing contingency analysis results and delete existing contingency cases.
int ComSimoutage.ClearCont()

493
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

CreateFaultCase
Create fault cases from the given elements.
int ComSimoutage.CreateFaultCase(set elms,
int mode,
[int createEvt],
[object folder]
)

A RGUMENTS
elms Selected elements to create fault cases.
mode How the fault cases are created:

0 Single fault case containing all elements.


1 n-1 (multiple cases).
2 n-2 (multiple cases).
3 Collecting coupling elements and create fault cases for line couplings.

createEvt (optional)
Switch event:
0 Do NOT create switch events.
1 Create switch events.

folder (optional)
Folder in which the fault case is stored.

R ETURNS
0 On success.
1 On error.

Execute
Execute contingency analysis.
int ComSimoutage.Execute()

R ETURNS
0 On success.
1 On error.

494
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ExecuteAndCheck
Executes contingency analysis and checks the violated constraints. The constraints are defined
in models, such as maximum and minimum voltage of buses, maximum loading of lines etc.
On the first occured constraint violation, the further contingency execution will be terminated,
making the calculation faster, but with less information.
int ComSimoutage.ExecuteAndCheck([int workMode,]
[int initMode,]
[int considerOPFflags,]
[int considerVstep]
)

A RGUMENTS
workMode (optional)
the mode how the contingency analysis is executed; default is 0
0 Normal execution (doesn’t check limits, write results file)
1 Check constraints (thermal loading, bus voltage range) and terminate
execution if violates any limit, writes result file
2 Check constraints (thermal loading, bus voltage range) and terminate
execution if violates any limit, does not write result file
3 Check thermal loading only and terminate execution if violates any
limit, writes result file
4 Check thermal loading only and terminate execution if violates any
limit, does not write result file
5 Check voltage limits only and terminate execution if violates any limit,
writes result file
6 Check voltage limits only and terminate execution if violates any limit,
does not write result file
7 Neither loading nor voltage limits are checked and terminate execution
if any contingency fails, writes result file
8 Neither loading nor voltage limits are checked and terminate execution
if any contingency fails, does not write result file
initMode (optional)
the mode how the contingency analysis is initialised; default is 0
0 full initialisation, new topology rebuild, and update all contingencies
1 new topology rebuild, but skip updating all contingencies
2 no topology rebuild, and no contingency update, which is the fastest
mode
considerOPFflags (optional)
whether the voltage limit settings on OPF page will be considered or not; default
is 1
0 the settings on OPF page are not considered.
1 the voltage limits are considered only when the check boxes on OPF
page are ticked.
considerVstep (optional)
whether the voltage step limits will be considered or not; default is 1
0 the voltage step limits are not considered.
1 the voltage step limits are considered.

495
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 contingencies successfully executed without any violation
1 calculation was interrupted by the user
2 error occurred during contingency analysis
3 initialisation failed, such as base case laod flow diverged
4 for AC/DC combined method, base case is already critical and calculation stopped
5 any loading constraint violated
6 any contingency cannot be analysed, non-convergent case
7 any voltage constraint violated
8 any constraint violated already in the base case

GetNTopLoadedElms*
To get certain number of top loaded components (most close to its limit).
void ComSimoutage.GetNTopLoadedElms(int number,
set& elements)

A RGUMENTS
number The number of elements to be found.
elements (out)
The top loaded elements.

MarkRegions
To execute Region marker for certain system status (like prefault, post fault etc.), which will
indentifies energizing mode for each element.
int ComSimoutage.MarkRegions(int stage)

A RGUMENTS
stage which system stage to be analyzed, 0¡=stage¡=2

R ETURNS
0 On success.
1 On error.

RemoveAllRas
Removes all IntRas from to the ComSimoutage. Only deletes the references not the IntRas
itself.
void ComSimoutage.RemoveAllRas()

RemoveContingencies
Removes all contingencies from the command. Functionality as ”Remove All” button in dialog.
void ComSimoutage.RemoveContingencies()

496
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
object command;

command.RemoveContingencies();

RemoveRas
Removes the reference to a given IntRas from the ComSimoutage.
int ComSimoutage.RemoveRas(object ras)

A RGUMENTS
ras The IntRas object

R ETURNS
0 If the reference to the IntRas has been successfully removed.
1 If the reference to the IntRas has not been in the container or on error.

Reset
Resets the intermediate results of the outage simulation.
int ComSimoutage.Reset()

R ETURNS
0 On success.
1 On error.

SetLimits
Sets the recording limits for the Contingency Analysis.
void ComSimoutage.SetLimits(double vlmin,
double vlmax,
double ldmax)

A RGUMENTS
vlmin The minimum voltage
vlmax The maximum voltage
ldmax The maximum loading

Update
To update contingency cases via topology search. It will find interrupted elements, required
switch actions for each contingency.
int ComSimoutage.Update()

497
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

3.4.48 ComSvgexport
Overview

SetFileName
SetObject
SetObjects

SetFileName
Sets SVG file for export.
void ComSvgexport.SetFileName(string path)

A RGUMENTS
path Path of target SVG file

SetObject
Sets annotation layer or group for export.
void ComSvgexport.SetObject(object obj)

A RGUMENTS
obj Annotation layer (IntGrflayer) or group (IntGrfgroup) to be exported

SetObjects
Sets annotation layers and groups for export.
void ComSvgexport.SetObjects(set objs)

A RGUMENTS
objs Set of annotation layers (IntGrflayer) and/or groups (IntGrfgroup) to be exported

498
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.49 ComSvgimport
Overview

SetFileName
SetObject

SetFileName
Sets source SVG file for import.
void ComSvgimport.SetFileName(string path)

A RGUMENTS
path Path of SVG file to be imported

SetObject
Sets target annotation layer or group for import.
void ComSvgimport.SetObject(object obj)

A RGUMENTS
obj Target annotation layer (IntGrflayer) or group (IntGrfgroup)

3.4.50 ComTablereport
Overview

AddButton
AddCellAction
AddColumn
AddCurve
AddHeader
AddInvisibleFilter
AddListFilter
AddListFilterEntries
AddMultiListFilter
AddPlot
AddRow
AddTable
AddTabularFilter
AddTextFilter
AddXLabel
ClearAll
DisableAutomaticRowNumbering
DisableSingleFilterRefresh
DisplayButtonsCollapsible
DisplayFiltersCollapsible
DisplayFiltersIn2Columns
DisplayHeadersCollapsible
EnableAutomaticRowNumbering

499
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ExportToExcel
ExportToHTML
FindNextCell
FindNextRow
FindPreviousCell
FindPreviousRow
GetCellAccessObject
GetCellAlignment
GetCellBackgroundColor
GetCellColor
GetCellEditObjects
GetCellFontStyle
GetCellFormat
GetCellHelpText
GetCellValueType
GetCheckboxCellValue
GetColumnFilter
GetColumnHeader
GetColumnId
GetDateCellValue
GetDoubleCellValue
GetIntCellValue
GetNumberOfColumns
GetNumberOfRows
GetNumberOfSelectedCells
GetObjectCellValue
GetRowCaption
GetRowId
GetSelectedCell
GetSelectedElements
GetSelection
GetStringCellValue
GoToCell
HasCell
HasColumnAutoFilter
IsColumnScrollable
IsColumnSortable
IsRowVisible
RemoveRow
SetBarLimits
SetCellAccess
SetCellEdit
SetCellValueToBar
SetCellValueToCheckbox
SetCellValueToDate
SetCellValueToDouble
SetCellValueToInt
SetCellValueToObject
SetCellValueToString
SetColumnHeader
SetCurveValue
SetDialogSize
SetExportHtml
SetExportXls
SetListFilterSelection
SetNumberFormatForPlot

500
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SetRefresh
SetSorting
SetStatusText
SetTextAxisDistForPlot
SetTicksForPlot
SetTitle

AddButton
Adds a button to the button section of the report.
int ComTablereport.AddButton(string id,
string label,
[int width,]
[int newLine,]
[int refresh]
)

A RGUMENTS
id Identifier
label Label text
width (optional)
Button width in pixel (default: 100)

newLine (optional)
0 Place button floating (default)
1 Place button in a new line
refresh (optional)
0 Do not refresh report after button was handled (default)
1 Refresh report after button was handled

R ETURNS
0 On error: button with given id already exists.
1 Button was added to the report.

AddCellAction
Adds a cell action to a table cell. This means that an entry is added to the right mouse button
menue of the cell.
int ComTablereport.AddCellAction(string tableId,
string columnId,
string rowId,
string actionId,
string displayText,
[set actionObjects,]
[int refresh]
)

501
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
actionId Identifier for the action
displayText (optional)
Text to be displayed in the right mouse button menue for this action
actionObjects (optional)
Objects needed to handle this action (default: empty). These objects are passed
as input to the “Action” script.
refresh (optional)
0 Do not refresh report after action was handled
1 Refresh report after action was handled (default)

R ETURNS
0 On error: cell with given ids does not exist.
1 Action was added.

AddColumn
Adds a column to the table.
void ComTablereport.AddColumn(string tableId,
string columnId,
string caption,
[int columnWidth,]
[int hasAutoFilter,]
[int isSortable,]
[int isScrollable]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier for the column to be inserted
caption Text to be displayed in the column header (lines separated by '\n')
columnWidth (optional)
>0 Initial column width in pixel
-1 Determine column width automatically according to values in the col-
umn (default)
hasAutoFilter (optional)
0 No auto filter (default)
1 Display an auto filter in the column header
isSortable (optional)
0 Column is not sortable
1 Column is sortable (default)

502
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

isScrollable (optional)
0 Column is fix (all columns left of this column must also be fix)
1 Column is scrollable (default)

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.AddColumn('table', 'scenario', 'Scenario', 100, 1, 1, 0);

AddCurve
Adds a curve to a plot.
int ComTablereport.AddCurve(string plotId,
string yText,
[string yUnit,]
[int lineColor,]
[int lineWidth,]
[int lineStyle]
)

A RGUMENTS
plotId Identifier of the plot
yText Description for the curve
yUnit (optional)
Unit for the curve
lineColor (optional)
Line color for the curve (default: -1 = automatic)
lineWidth (optional)
Line width for the curve (default: -1 = automatic)
lineStyle (optional)
Line style for the curve (default: -1 = automatic)

R ETURNS
0 On error.
>0 Identifier of the inserted curve.

AddHeader
Adds a header to the report.
void ComTablereport.AddHeader(string label,
string text
)

503
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
label Label
text Text

AddInvisibleFilter
Adds an invisible filter to the report. This filter can be used for storing objects and/or strings that
can then be accessed again at the next refresh of the report.
int ComTablereport.AddInvisibleFilter(string id,
string value,
object obj
)

A RGUMENTS
id Identifier
value String value to be stored
obj Object to be stored

R ETURNS
0 On error: filter with given id already exists.
1 Filter was added to the report.

AddListFilter
Adds a list filter to the report.
int ComTablereport.AddListFilter(string id,
string label,
[string captions,]
[set filterObjects,]
[string selEntry,]
[int showObjects])
int ComTablereport.AddListFilter(string id,
string label,
int showObjects)

A RGUMENTS
id Identifier
label Label text
captions (optional)
Captions for list entries ('\n'-separated)
filterObjects (optional)
Objects for list entries (default: empty)
selEntry (optional)
Selected list entry (default: empty)
showObjects (optional)
0 Object dialogues are not accessible (default)
1 Object dialogues are accessible

504
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: filter with given id already exists.
1 Filter was added to the report.

AddListFilterEntries
Adds entries to an existing list filter of the report.
int ComTablereport.AddListFilterEntries(string id,
string captions,
[set filterObjects]
)

A RGUMENTS
id Identifier
captions Captions for list entries ('\n'-separated)
filterObjects (optional)
Objects for list entries (default: empty)

R ETURNS
0 On error: filter with given id does not exist.
1 Entries were added to the filter.

AddMultiListFilter
Adds a multi-selection list filter to the report.
int ComTablereport.AddMultiListFilter(string id,
string label,
[string captions,]
[set filterObjects,]
[string selEntries,]
[int showObjects]
)
int ComTablereport.AddMultiListFilter(string id,
string label,
int showObjects
)

A RGUMENTS
id Identifier
label Label text
captions (optional)
Captions for list entries ('\n'-separated; default: empty)
filterObjects (optional)
Objects for list enries (default: empty)
selEntries (optional)
selected list entries ('\n'-separated; default: empty)
showObjects (optional)
0 Object dialogues are not accessible (default)
1 Object dialogues are accessible

505
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: filter with given id already exists.
1 Filter was added to the report.

AddPlot
Adds a plot to the report.
void ComTablereport.AddPlot(string plotId,
string xText,
[string xUnit,]
[string header,]
[int textLabels,]
[int splitCurves,]
[int trueDots,]
[int niceTicks,]
[int legendPos]
)

A RGUMENTS
plotId Identifier for the plot
xText Description text for x-axis
xUnit (optional)
Unit for x-axis

header (optional)
Header text for plot
textLabels (optional)
0 Use values for x-axis (default)
1 Use text labels for x-axis
splitCurves (optional)
0 Interpolate missing values (default)
1 Split curve at missing values

trueDots (optional)
0 Draw only line (default)
1 Draw true dots additionally
niceTicks (optional)
0 No nice ticks (default)
1 Nice ticks on x-axis
2 Nice ticks on y-axis
3 Nice ticks on both axes
legendPos (optional)
0 No legend
1 Display legend below plot (default)
2 Display legend on right side of plot

506
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

AddRow
Adds a row to the table.
void ComTablereport.AddRow(string tableId,
string rowId,
[string caption]
)

A RGUMENTS
tableId Identifier of the table
rowId Identifier for the row to be inserted
caption (optional)
Text to be displayed in the row header (only one line, default: empty)

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.AddColumn('table', 'scenario', 'Scenario', 100, 1, 1, 0);
report.AddRow('table', 'peak', 'Peak Load');

AddTable
Adds a table to the report. A report can contain only one table or one plot.
void ComTablereport.AddTable(string id)

A RGUMENTS
id Identifier

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');

507
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

AddTabularFilter
Adds a tabular filter to the report.
int ComTablereport.AddTabularFilter(string id,
string label,
string columnLabels,
string rowLabels,
[string values]
)

A RGUMENTS
id Identifier
label Label text for tabular filter
columnLabels
Label texts for table columns (';'-separated; several lines for one column separated
by '\n')

rowLabels
Label texts for table rows (';'-separated; only one line per table row)
values (optional)
Values for text fields (';'-separated)

R ETURNS
0 On error: filter with given id already exists.
1 Filter was added to the report.

AddTextFilter
Adds a text filter to the report.
int ComTablereport.AddTextFilter(string id,
string label,
[string unit,]
[string text]
)

A RGUMENTS
id Identifier
label Label text

unit (optional)
Unit text (default: empty)
text (optional)
Text for text field (default: empty)

R ETURNS
0 On error: filter with given id already exists.
1 Filter was added to the report.

508
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

AddXLabel
Sets a label for the next x-value.
void ComTablereport.AddXLabel(string plotId,
string label
)

A RGUMENTS
plotId Identifier of the plot
label Label text

ClearAll
Clears all report data.
void ComTablereport.ClearAll()

DisableAutomaticRowNumbering
Disables automatic row numbering. Row labels are filled with user-defined row labels. Auto-
matic row numbering is enabled per default.
void ComTablereport.DisableAutomaticRowNumbering(string tableId)

A RGUMENTS
tableId Identifier of the table

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.DisableAutomaticRowNumbering('table');

DisableSingleFilterRefresh
Configures filter section to not refresh report immediatly after a filter value was changed. A
refresh button for the whole filter section is displayed instead.
void ComTablereport.DisableSingleFilterRefresh()

DisplayButtonsCollapsible
Makes button section collapsible and expandable.
void ComTablereport.DisplayButtonsCollapsible([int startExpanded])

509
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
startExpanded (optional)
0 Button section is initially collapsed
1 Button section is initially expanded (default)

DisplayFiltersCollapsible
Makes filter section collapsible and expandable.
void ComTablereport.DisplayFiltersCollapsible([int startExpanded])

A RGUMENTS
startExpanded (optional)
0 Filter section is initially collapsed.
1 Filter section is initially expanded (default).

DisplayFiltersIn2Columns
Displays filters in the filter section of the report in two columns.
int ComTablereport.DisplayFiltersIn2Columns(string id)

A RGUMENTS
id Identifier of filter to be displayed as first filter in the second column

R ETURNS
0 On error: filter with given id does not exist.
1 Filter was set.

DisplayHeadersCollapsible
Makes header section collapsible and expandable.
void ComTablereport.DisplayHeadersCollapsible([int startExpanded])

A RGUMENTS
startExpanded (optional)
0 Header section is initially collapsed
1 Header section is initially expanded (default)

EnableAutomaticRowNumbering
Enables automatic row numbering. Row labels are filled automatically with ascending numbers
(starting at 1), user-defined row labels are ignored. Automatic row numbering is enabled per
default.
void ComTablereport.EnableAutomaticRowNumbering(string tableId)

510
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table

ExportToExcel
Exports the report with its current filter settings and sorting to Excel.
void ComTablereport.ExportToExcel([string file,]
[int show]
)

A RGUMENTS
file (optional)
Path and name of file to be written (default: empty = temp. file is written)

show (optional)
0 Write only
1 Open written file in default application (default)

ExportToHTML
Exports the report with its current filter settings and sorting to HTML.
void ComTablereport.ExportToHTML([string file,]
[int show]
)

A RGUMENTS
file (optional)
Path and name of file to be written (default: empty = temp. file is written)
show (optional)
0 Write only
1 Open written file in default application (default)

FindNextCell
Searches for the next table cell with the given value and sets the selection to that cell. Searches
row-wise from the current position on until the table end and then from the top until the current
cell is reached again considering filters and sorting.
int ComTablereport.FindNextCell(string tableId,
string cellValue
)

A RGUMENTS
tableId Identifier of the table

cellValue Display text of cell to be searched

511
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: no matching cell found.
1 On success.

FindNextRow
Searches for the next row with the given values and sets the selection to that row. Searches
from the current position on until the table end and then from the top until the current row is
reached again considering filters and sorting.
int ComTablereport.FindNextRow(string tableId,
string columnId1,
string cellValue1,
[string columnId2,]
[string cellValue2,]
[string columnId3,]
[string cellValue3]
)

A RGUMENTS
tableId Identifier of the table

columnId1
Column identifier of cell for first criterion to be searched
cellValue1
Display text of cell for first criterion to be searched
columnId2
Column identifier of cell for second criterion to be searched
cellValue2
Display text of cell for second criterion to be searched
columnId3
Column identifier of cell for third criterion to be searched
cellValue3
Display text of cell for third criterion to be searched

R ETURNS
0 On error: no matching row found.
1 On success.

FindPreviousCell
Searches for previous table cell with the given value and sets the selection to that cell. Searches
row-wise from the current position on until table begin and then from the end until the current
cell is reached again considering filters and sorting.
int ComTablereport.FindPreviousCell(string tableId,
string cellValue
)

512
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table
cellValue Display text of cell to be searched

R ETURNS
0 On error: no matching cell found.
1 On success.

FindPreviousRow
Searches for the previous row with the given values and sets the selection to that row. Searches
from the current position on until the table begin and then from the end until the current row is
reached again considering filters and sorting.
int ComTablereport.FindPreviousRow(string tableId,
string columnId1,
string cellValue1,
[string columnId2,]
[string cellValue2,]
[string columnId3,]
[string cellValue3]
)

A RGUMENTS
tableId Identifier of the table
columnId1
Column identifier of cell for first criterion to be searched
cellValue1
Display text of cell for first criterion to be searched
columnId2
Column identifier of cell for second criterion to be searched
cellValue2
Display text of cell for second criterion to be searched
columnId3
Column identifier of cell for third criterion to be searched
cellValue3
Display text of cell for third criterion to be searched

R ETURNS
0 On error: no matching row found.
1 On success.

GetCellAccessObject
Gets the object accessible from a table cell.
int ComTablereport.GetCellAccessObject(string tableId,
string columnId,
string rowId,
object& obj)

513
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
obj (out) Object accessible from the cell if set, else NULL

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellAlignment
Gets the alignment of a cell.
int ComTablereport.GetCellAlignment(string tableId,
string columnId,
string rowId,
int& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Alignment of the cell

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellBackgroundColor
Gets the value type of a cell.
int ComTablereport.GetCellBackgroundColor(string tableId,
string columnId,
string rowId,
int& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Background color of the cell

514
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellColor
Gets the value type of a cell.
int ComTablereport.GetCellColor(string tableId,
string columnId,
string rowId,
int& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column

rowId Identifier of the row


value (out)
Color of the cell

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellEditObjects
Gets the objects linked to a table cell for editing the cell.
int ComTablereport.GetCellEditObjects(string tableId,
string columnId,
string rowId,
set& objs)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column

rowId Identifier of the row


objs (out) Edit objects of the cell if any, else empty

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

515
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetCellFontStyle
Gets the font style of a cell.
int ComTablereport.GetCellFontStyle(string tableId,
string columnId,
string rowId,
int& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Font style of the cell:

0 Normal (default)
1 Bold
2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellFormat
Gets the format of a cell.
int ComTablereport.GetCellFormat(string tableId,
string columnId,
string rowId,
string& value
)

A RGUMENTS
tableId Identifier of the table

columnId Identifier of the column


rowId Identifier of the row
value (out)
Format of the cell

516
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellHelpText
Gets the help text of a cell.
int ComTablereport.GetCellHelpText(string tableId,
string columnId,
string rowId,
string& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Help text of the cell

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetCellValueType
Gets the value type of a cell.
int ComTablereport.GetCellValueType(string tableId,
string columnId,
string rowId
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row

R ETURNS
0 Error: cell with given ids does not exist
1 String
2 Integer
3 Double
4 Check box
5 Bar
6 Date
7 Object

517
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetCheckboxCellValue
Gets the value of a check box cell.
int ComTablereport.GetCheckboxCellValue(string tableId,
string columnId,
string rowId,
int& value)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Value of the cell

R ETURNS
0 On error: cell with given ids does not exist or has the wrong type.
1 On success.

GetColumnFilter
Get filter text of given column in table.
int ComTablereport.GetColumnFilter(string tableId,
string columnId,
string& filter
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column to be set
filter (out) Text that represents the filter of the column

R ETURNS
0 Column was found.
1 Column not found.

GetColumnHeader
Gets caption text of existing column of the table.
int ComTablereport.GetColumnHeader(string tableId,
string columnId,
string& caption
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
caption (out)
Text that is displayed in the column header (lines separated by '\n')

518
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error: column with given ids does not exist.

E XAMPLE
object report;
string header;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.AddColumn('table', 'scenario', '', 100, 1, 1, 0);
report.SetColumnHeader('table', 'scenario', 'Scenario');
report.GetColumnHeader('table', 'scenario', header);

GetColumnId
Get the unique identifier of the n-th column.
int ComTablereport.GetColumnId(string tableId, int columnIndex, string& columnId)

A RGUMENTS
tableId Identifier of the table
columnIndex
Index of the column - 0 based
columnId (out)
Column identifier at the given index

R ETURNS
0 On success.
1 On error: No column with the given index was found.

GetDateCellValue
Gets the value of a date cell.
int ComTablereport.GetDateCellValue(string tableId,
string columnId,
string rowId,
int& value)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Value of the cell

519
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error: cell with given ids does not exist or has the wrong type.
1 On success.

GetDoubleCellValue
Gets the value of a double cell.
int ComTablereport.GetDoubleCellValue(string tableId,
string columnId,
string rowId,
double& value)

A RGUMENTS
tableId Identifier of the table

columnId Identifier of the column


rowId Identifier of the row
value (out)
Value of the cell

R ETURNS
0 On error: cell with given ids does not exist or has the wrong type.
1 On success.

GetIntCellValue
Gets the value of an integer cell.
int ComTablereport.GetIntCellValue(string tableId,
string columnId,
string rowId,
int& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column

rowId Identifier of the row


value (out)
Value of the cell

R ETURNS
0 Error: cell with given ids does not exist or has the wrong type
1 Ok

520
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetNumberOfColumns
Returns the number of columns that were added to the table report.
int ComTablereport.GetNumberOfColumns(string tableId)

A RGUMENTS
tableId Identifier of the table

R ETURNS
>=0 On success: the number of columns in the table.
-1 On error: no table with the given ID was defined.

GetNumberOfRows
Returns the number of rows that were added to the table report.
int ComTablereport.GetNumberOfRows(string tableId)

A RGUMENTS
tableId Identifier of the table

R ETURNS
>=0 On success: the number of rows in the table.
-1 On error: no table with the given ID was defined.

GetNumberOfSelectedCells
Gets the number of (visible) cells selected in the table.
int ComTablereport.GetNumberOfSelectedCells(string tableId,
[string columnId,]
[string rowId]
)

A RGUMENTS
tableId Identifier of the table
columnId (optional)
set Count only selected cells with this column id
empty Count selected cells in all columns (default)
rowId (optional)
set Count only selected cells with this row id
empty Count selected cells in all rows (default)

R ETURNS
Number of selected cells

521
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetObjectCellValue
Gets the value of an object cell.
int ComTablereport.GetObjectCellValue(string tableId,
string columnId,
string rowId,
object& value)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Value of the cell

R ETURNS
0 On error: cell with given ids does not exist or has the wrong type.
1 On success.

GetRowCaption
Gets caption text of existing row of the table.
int ComTablereport.GetRowCaption(string tableId,
string rowId,
string& caption
)

A RGUMENTS
tableId Identifier of the table
rowId Identifier of the row
caption (out)
Text that is displayed in the row caption

R ETURNS
0 On success.
1 On error: row with given ids does not exist.

GetRowId
Get the unique identifier of the n-th row.
int ComTablereport.GetRowId(string tableId, int rowIndex, string& rowId)

A RGUMENTS
tableId Identifier of the table
rowIndex Index of the row - 0 based
rowId (out)
Row identifier at the given index

522
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error: No row with the given index was found.

GetSelectedCell
Gets the identifiers for a selected cell.
int ComTablereport.GetSelectedCell(string tableId,
int index,
string& columnId,
string& rowId
)

A RGUMENTS
tableId Identifier of the table
index Index of selected cell (1-based)

columnId (in, out)


in Consider only selected cells with this column id
out Column id of selected cell
rowId (in, out)
in Consider only selected cells with this row id
out Row id of selected cell

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

GetSelectedElements
Gets objects selected for the report filtered according to filter in the report.
set ComTablereport.GetSelectedElements()

R ETURNS
Filtered selected objects

GetSelection
Gets SetSelect with selected objects for the report.
object ComTablereport.GetSelection()

R ETURNS
SetSelect or NULL.

523
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetStringCellValue
Gets the value of a string cell.
int ComTablereport.GetStringCellValue(string tableId,
string columnId,
string rowId,
string& value
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value (out)
Value of the cell

R ETURNS
0 On error: cell with given ids does not exist or has the wrong type.
1 On success.

GoToCell
Sets the selection to a table cell.
int ComTablereport.GoToCell(string tableId,
string columnId,
string rowId
)

A RGUMENTS
tableId Identifier of the table
columnId Column identifier of the cell to be selected
rowId Row identifier of the cell to be selected

R ETURNS
0 On error: cell with given ids does not exist.
1 On success.

HasCell
Checks if a table cell exists.
int ComTablereport.HasCell(string tableId,
string columnId,
string rowId
)

524
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row

R ETURNS
0 Cell with given ids does not exist.
1 Cell was found.

HasColumnAutoFilter
Checks if the column has an enabled auto filter.
int ComTablereport.HasColumnAutoFilter(string tableId, string columnId)

A RGUMENTS
tableId Identifier of the table

columnId Identifier of the column

R ETURNS
-1 The column is not defined.
0 The column has no auto filter.
1 The column has an auto filter.

IsColumnScrollable
Checks if the column is marked as scrollable.
int ComTablereport.IsColumnScrollable(string tableId, string columnId)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column

R ETURNS
-1 The column is not defined.
0 The column is not scrollable.
1 The column is scrollable.

IsColumnSortable
Checks if the column is marked as sortable.
int ComTablereport.IsColumnSortable(string tableId, string columnId)

525
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column

R ETURNS
-1 The column is not defined.
0 The column is not sortable.
1 The column is sortable.

IsRowVisible
Checks if the row with the given ID is visible for the user. The result depends on the filter settings
of the report.
int ComTablereport.IsRowVisible(string tableId, string rowId)

A RGUMENTS
tableId Identifier of the table
rowId Identifier of the row

R ETURNS
-1 The row is not defined.
0 The row is invisible.
1 The row is visible.

RemoveRow
Removes a row from the table.
int ComTablereport.RemoveRow(string tableId,
string rowId
)

A RGUMENTS
tableId Identifier of the table
rowId Identifier of the row to be removed

R ETURNS
0 Row with given id does not exist.
1 Row was removed.

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

526
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

report.AddTable('table');
report.AddColumn('table', 'scenario', 'Scenario', 100, 1, 1, 0);
report.AddRow('table', 'peak', 'Peak Load');
report.RemoveRow('table', 'peak');

SetBarLimits
Sets bar limits for all bar cells in an existing table column.
int ComTablereport.SetBarLimits(string tableId,
string columnId,
int min,
int max
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
min Minimum value for all bars in the column
max Maximum value for all bars in the column

R ETURNS
0 On error: column with given ids does not exis.
1 Limits were set.

SetCellAccess
Makes a cell accessible. Accessible means that an object dialogue is displayed on double click
and the right mouse button menu additionally provides the entries 'Edit', 'Edit and Browse' and
'Mark in Graphic'.
void ComTablereport.SetCellAccess(string tableId,
string columnId,
string rowId,
object accessObject,
[string parameterName]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
accessObject
Object to be accessible
parameterName (optional)
Set Dialog is shown at the page on that this variable is displayed
Empty Dialog is shown at stored dialog page (default)

527
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SetCellEdit
Makes a table cell editable. This means that the cell value can be modified in the report window.
void ComTablereport.SetCellEdit(string tableId,
string columnId,
string rowId,
set editObjects,
[string selectableValues])

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
editObjects
Objects to handle the modification. These objects are passed as input to the “Edit”
script.
selectableValues
'\n '-separated list of selectable values:

Set A list dialogue with the given values is displayed for selection if the cell
is edited
Empty Any text can be entered into the cell (default)

SetCellValueToBar
Fills a table cell with a bar.
void ComTablereport.SetCellValueToBar(string tableId,
string columnId,
string rowId,
string barDesc,
[string helpText,]
[int border,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row

barDesc Bar description containing limits and segment widths and colours.
If limits are given the left cell side is considered to be the lower limit value and the
right cell side is considered to be the upper limit value.
If no limits are given the limits are implicitly set to 0 and 100.
The available formats are listed below.

helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)

528
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

border (optional)
Display a thin black border around the bar:

0 No border
1 Border (default)
align (optional)
Alignment for text:

0 Automatically according to data type (default)


1 Left
2 Center
3 Right

backgroundColor (optional)
Color for background (default: 0=white)

B AR DESCRIPTION FORMATS

<width>,<colour>;<width>,<colour>;<...>
Relative widths in % (old style; e.g. “20,1;14,2;36,3;30,4”)

<lower limit>;<upper limit>#<width>,<colour>;<width>,<colour>;<...>


Relative widths in %, limits are ignored (old style; e.g. “90;140#10,1;7,2;18,3;15,4”)
0#<width>,<colour>;<width>,<colour>;<...>
Relative widths in % (e.g. “0#20,1;14,2;36,3;30,4”)
0#<lower limit>;<upper limit>#<width>,<colour>;<width>,<colour>;<...>
Relative widths within limits (e.g. “0#90;140#10,1;7,2;18,3;15,4”)
1#<value>,<colour>;<value>,<colour>;<...>
Absolute values in % (e.g. “1#20,1;34,2;70,3;100,4”)
1#<lower limit>;<upper limit>#<value>,<colour>;<value>,<colour>;<...>
Absolute values within limits(e.g. “1#90;140#100,1;107,2;125,3;140,4”)

SetCellValueToCheckbox
Fills a table cell with a check box.
void ComTablereport.SetCellValueToCheckbox(string tableId,
string columnId,
string rowId,
int value,
[string helpText,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value Integer value to be set in the checkbox:

529
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

0 Check box is unchecked


1 Check box is checked

helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right

backgroundColor (optional)
Color for background (default: 0=white)

SetCellValueToDate
Fills a table cell with a date.
void ComTablereport.SetCellValueToDate(string tableId,
string columnId,
string rowId,
int timeStamp,
[string format,]
[string helpText,]
[int color,]
[int fontStyle,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row

timeStamp
Time stamp value for date and time
format (optional)
Format for displaying date (currently ignored; default: '')
helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
color (optional)
Colour for text (default: 1=black)

fontStyle (optional)
0 Normal (default)
1 Bold

530
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic
align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right
backgroundColor (optional)
Color for background (default: 0=white)

SetCellValueToDouble
Fills a table cell with a double value.
void ComTablereport.SetCellValueToDouble(string tableId,
string columnId,
string rowId,
double value,
[string format,]
[string helpText,]
[int color,]
[int fontStyle,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value Double value to be set
format (optional)
Printf-like format for displaying the value (default: '%f')
helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
color (optional)
Color for text (default: 1=black)
fontStyle(optional)
0 Normal (default)
1 Bold

531
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic
align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right
backgroundColor (optional)
Color for background (default: 0=white)

SetCellValueToInt
Fills a table cell with an integer value.
void ComTablereport.SetCellValueToInt(string tableId,
string columnId,
string rowId,
int value,
[string format,]
[string helpText,]
[int color,]
[int fontStyle,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value Integer value to be set
format (optional)
Printf-like format for displaying the value (default: '%d')
helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
color (optional)
Color for text (default: 1=black)
fontStyle (optional)
0 Normal (default)
1 Bold

532
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic
align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right
backgroundColor (optional)
Color for background (default: 0=white)

SetCellValueToObject
Fills a table cell with an object.
void ComTablereport.SetCellValueToObject(string tableId,
string columnId,
string rowId,
object obj,
[string format,]
[string helpText,]
[int color,]
[int fontStyle,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
obj Object to be set
format (optional)
Format for displaying object (currently ignored; default: '')
helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
color (optional)
Colour for text (default: 1=black)
fontStyle(optional)
0 Normal (default)
1 Bold

533
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic
align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right
backgroundColor (optional)
Color for background (default: 0=white)

SetCellValueToString
Fills a table cell with a string value.
void ComTablereport.SetCellValueToString(string tableId,
string columnId,
string rowId,
string value,
[string format,]
[string helpText,]
[int color,]
[int fontStyle,]
[int align,]
[int backgroundColor]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column
rowId Identifier of the row
value String value to be set
format (optional)
Printf-like format for displaying the value (default: '%s')
helpText (optional)
Text shown in balloon help of the cell (multiple lines separated by '\n'; default:
empty)
color (optional)
Color for text (default: 1=black)
fontStyle (optional)
0 Normal (default)
1 Bold

534
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

2 Italic
3 Bold and italic
4 Underlined
5 Underlined and bold
6 Underlined and italic
7 Underlined, bold and italic

align (optional)
Alignment for text:
0 Automatically according to data type (default)
1 Left
2 Center
3 Right
backgroundColor (optional)
Color for background (default: 0=white)

E XAMPLE
The following example writes the name of the active scenario into a table cell:
object report, scenario;
string name;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.AddColumn('table', 'scenario', 'Scenario', 100, 1, 1, 0);
report.AddRow('table', 'active', 'Active');

scenario = GetActiveScenario();
name = scenario:loc_name;
report.SetCellValueToString('table', 'scenario', 'active', name);

SetColumnHeader
Sets caption text in existing column of the table.
void ComTablereport.SetColumnHeader(string tableId,
string columnId,
string caption
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column to be set
captionId Text to be displayed in the column header (lines separated by '\n')

535
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.AddTable('table');
report.AddColumn('table', 'scenario', '', 100, 1, 1, 0);
report.SetColumnHeader('table', 'scenario', 'Scenario');

SetCurveValue
Adds a y-value at a certain x-value to a curve.
int ComTablereport.SetCurveValue(string plotId,
int curveId,
double xValue,
double yValue
)

A RGUMENTS
plotId Identifier of the plot
curveId Identifier of the curve (0: no curve / new x-value)
xValue x-value for given y-value

yValue y-value

R ETURNS
0 On error: curve not found.
1 On success.

SetDialogSize
Sets the width and height for the report dialog.
void ComTablereport.SetDialogSize(int width,
int height
)

A RGUMENTS
width Dialogue width in pixel
height Dialogue height in pixel

E XAMPLE
object report;

report = this.GetParent();
if (!report) {

536
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

exit();
}

report.SetDialogSize(700, 860);

SetExportHtml
Shows or hides html icon
void ComTablereport.SetExportHtml(int show)

A RGUMENTS
show
0 Hide html icon
1 Show html icon

SetExportXls
Shows or hides xlsx icon
void ComTablereport.SetExportXls(int show)

A RGUMENTS
show
0 Hide xlsx icon
1 Show xlsx icon

SetListFilterSelection
Sets selected entries in existing list filter.
int ComTablereport.SetListFilterSelection(string id,
string selEntries
)

A RGUMENTS
id Identifier

selEntries (optional)
Selected list entries ('\n'-separated; default: empty)

R ETURNS
0 On error: filter with given id does not exist.
1 Entries were set as selected filter entries.

537
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SetNumberFormatForPlot
Sets the number format for the tick descriptions for an axis of a plot.
int ComTablereport.SetNumberFormatForPlot(string plotId,
string axis,
int characters,
int precision
)

A RGUMENTS
plotId Identifier of the plot
axis
X Set format for x-axis
Y Set format for y-axis
characters
Number of characters
precision Number of digits after the point

R ETURNS
0 On error: plot not found.
1 On success.

SetRefresh
Shows or hides refresh icon
void ComTablereport.SetRefresh(int show)

A RGUMENTS
show
0 Hide refresh icon
1 Show refresh icon

SetSorting
Sets initial sorting of table.
int ComTablereport.SetSorting(string tableId,
string columnId,
[int descending]
)

A RGUMENTS
tableId Identifier of the table
columnId Identifier of the column according to that is to be sorted
descending (optional)
0 Ascending order (default)
1 Descending order

538
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error.
1 Sorting set.

SetStatusText
Sets a text in the user-definable field of the report window's status bar.
void ComTablereport.SetStatusText(string tableId,
string text
)

A RGUMENTS
tableId Identifier of the table

text Text to be set

SetTextAxisDistForPlot
Sets distance between axis and tick description for an axis of a plot.
int ComTablereport.SetTextAxisDistForPlot(string plotId,
string axis,
int distance
)

A RGUMENTS
plotId Identifier of the plot
axis
X Set distance for x-axis
Y Set distance for y-axis
distance Distance between text and axis

R ETURNS
0 On error: plot not found.
1 On success.

SetTicksForPlot
Sets the number of ticks for an axis of a plot.
int ComTablereport.SetTicksForPlot(string plotId,
string axis,
int main,
int number
)

539
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
plotId Identifier of the plot
axis
X Set ticks on x-axis
Y Set ticks on y-axis

main
0 Set help ticks
1 Set main ticks
number Number of ticks

R ETURNS
0 On error: plot not found.
1 On success.

SetTitle
Sets the text in the title bar of the report window.
void ComTablereport.SetTitle(string title)

A RGUMENTS
title Title text

E XAMPLE
object report;

report = this.GetParent();
if (!report) {
exit();
}

report.SetTitle('Input Data Summary');

540
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.51 ComTasks
Overview

AppendCommand
AppendStudyCase
GetCommandsForStudyCase
GetNumberOfCommandsForStudyCase
GetNumberOfStudyCases
GetStudyCases
IsAdditionalResultsFlagSetForCommand
IsCommandIgnored
IsStudyCaseIgnored
RemoveCmdsForStudyCaseRow
RemoveCommand
RemoveStudyCase
RemoveStudyCases
SetAdditionalResultsFlagForCommand
SetIgnoreFlagForCommand
SetIgnoreFlagForStudyCase
SetResultsFolder

AppendCommand
Appends a command for calculation.
int ComTasks.AppendCommand(object command,
[int studyCaseRow]
)

R ETURNS
0 Command could not be added for calculation.
1 Command has been successfully added for calculation.

A RGUMENTS
command
Command to add for calculation.
studyCaseRow
≤0 Command is added to the list of commands for its study case.
>0 Optionally, the row in the study case table containing the study case
for which this command shall be added can be passed. This is helpful,
e.g., if a study case has been added multiple times for calculation with
different command lists.

E XAMPLE
In this example, we add the load flow command of a study case to the list of tasks to
calculate.
int isAdded;
object comLdf,
comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');

541
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
comLdf = GetFromStudyCase('ComLdf');
if ({comTasks<>nullptr}.and.{comLdf<>nullptr}) {
isAdded = comTasks.AppendCommand(comLdf);
if ( isAdded<>0 ) {
printf('Command %o has been added for calculation', comLdf);
}
else {
printf('Command %o could not be added for calculation', comLdf);
}
}
}

AppendStudyCase
Appends a study case to the list of study cases for calculation.
int ComTasks.AppendStudyCase(object studyCase)

R ETURNS
0 Study case could not be added for calculation.
1 Study case has been successfully added for calculation.

A RGUMENTS
studyCase
Study case to add for calculation.

E XAMPLE
In this example, we add the currently active study case to the list of study cases for calcula-
tion.
int isAdded;
object newCase,
comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
newCase = GetActiveStudyCase();
if ({comTasks<>nullptr}.and.{newCase<>nullptr}) {
isAdded = comTasks.AppendStudyCase(newCase);
if ( isAdded<>0 ) {
printf('Study Case %o has been added for calculation', newCase);
}
else {
printf('Study case %o could not be added for calculation.', newCase);
}
}
}

542
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetCommandsForStudyCase
Get all selected commands to be processed for a study case from the Task Automation com-
mand.
set ComTasks.GetCommandsForStudyCase(object studyCase,
[int studyCaseRow])

R ETURNS
Returns ordered set of all selected commands to be processed for a study case.

A RGUMENTS
studyCase
Study case to get all selected commands to be processed from.

studyCaseRow
≤0 Commands for the first matching study case found will be returned.
>0 Optionally, the row in the study case table containing the study case
for which commands shall be returned can be passed. This is helpful,
e.g., if a study case has been added multiple times for calculation with
different command lists.

E XAMPLE
In this example, we get all selected commands for study case of row 1 from the Task Automa-
tion command.
object comTasks,
casesFolder;
set commands,
allSelectedCommands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>NULL) {
allSelectedCommands = comTasks.GetCommandsForStudyCase(NULL, 1);
}
}

GetNumberOfCommandsForStudyCase
Get number of all selected commands to be processed for a study case from the Task Automa-
tion command.
int ComTasks.GetNumberOfCommandsForStudyCase(object studyCase,
[int studyCaseRow])

R ETURNS
Returns number of all selected commands to be processed for a study case.

A RGUMENTS
studyCase
Study case to get number of selected commands to be processed from.

543
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

studyCaseRow
≤0 Number of commands for the first matching study case found will be
returned.
>0 Optionally, the row in the study case table containing the study case
for which number of commands shall be returned can be passed. This
is helpful, e.g., if a study case has been added multiple times for
calculation with different command lists.

GetNumberOfStudyCases
Get number of selected study cases from the Task Automation command.
int ComTasks.GetNumberOfStudyCases()

R ETURNS
Returns number of selected study cases from the Task Automation command.

GetStudyCases
Get all selected study cases from the Task Automation command.
set ComTasks.GetStudyCases()

R ETURNS
Returns ordered set of all selected study cases from the Task Automation command, set is
empty on failure.

E XAMPLE
In this example, we get all selected study cases from the Task Automation command.
object comTasks,
casesFolder;
set commands,
allSelectedCases;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>NULL) {
allSelectedCases = comTasks.GetStudyCases();
}
}

IsAdditionalResultsFlagSetForCommand
Returns whether additional results flag of a command is set or not (using study case row and
task row / using a command directly).
int ComTasks.IsAdditionalResultsFlagSetForCommand(int studyCaseRow,
int taskRow)
int ComTasks.IsAdditionalResultsFlagSetForCommand(object command)

544
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
studyCaseRow ≤ 0
The row in the study cases table of the command’s study case for which the
additional results flag shall be derived.
taskRow > 0
The row in the commands table for which the additional results flag shall be
derived.
command
The command to get the additional results flag for.

R ETURNS
0 Additional results flag of command is not set.
1 Additional results flag of command is set.
-1 Additional results flag was not found for provided study case row and task row /
provided command.

IsCommandIgnored
Returns whether the processing of a command will be ignored or not (using study case row and
task row / using provided command).
int ComTasks.IsCommandIgnored(int studyCaseRow,
int taskRow)
int ComTasks.IsCommandIgnored(object command)

A RGUMENTS
studyCaseRow ≤ 0
The row in the study cases table of the command’s study case for which the ignore
flag shall be derived.
taskRow > 0
The row in the commands table for which the ignore flag shall be derived.
command
The command to get the ignore-flag for.

R ETURNS
0 Processing of command will be done.
1 Processing of command will be ignored.
-1 Command was not found (for provided study case row and task row / at all).

IsStudyCaseIgnored
Returns whether the command processing for a study case will be ignored or not.
int ComTasks.IsStudyCaseIgnored(object studyCase,
[int studyCaseRow])

R ETURNS
0 Command processing for study case will be done.
1 Command processing for study case will be ignored.
-1 study case or row was not found.

545
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
studyCase
Study case to get ignore-flag from.
studyCaseRow
≤0 Ignore flag for the first matching study case found will be returned.
>0 Optionally, the row in the study case table containing the study case
for which ignore-flag shall be returned can be passed. This is helpful,
e.g., if a study case has been added multiple times for calculation with
different command lists.

RemoveCmdsForStudyCaseRow
Removes all commands selected for calculation for a given row in the study case table.
int ComTasks.RemoveCmdsForStudyCaseRow(int studyCaseRow)

R ETURNS
0 Commands could not be removed from calculation.
1 All commands of study case row were successfully removed from calculation.

A RGUMENTS
studyCaseRow> 0
The row in the study case table containing the study case for which all commands
shall be removed.

E XAMPLE
In this example, we remove all commands of the study case in row 1 from the calculation.
int isRemoved;
object comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>nullptr) {
isRemoved = comTasks.RemoveCmdsForStudyCaseRow(1);
if ( isRemoved<>0 ) {
printf('All commands are successfully removed for row %d', 1);
}
else {
printf('Commands could not be removed');
}
}
}

546
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

RemoveCommand
Remove a command from the calculation (for study case row and task row / for all appear-
ances).
int ComTasks.RemoveCommand(int studyCaseRow,
int taskRow
)
int ComTasks.RemoveCommand(object command)

A RGUMENTS
studyCaseRow> 0
The row in the study cases table of the command’s study case for which the
command shall be removed.
taskRow> 0
The row in the commands table for which the command shall be removed.
command
Command to remove.

R ETURNS
0 Command could not be removed.
1 Command has been successfully removed.

RemoveStudyCase
Removes a study case from the study cases table.
int ComTasks.RemoveStudyCase(object studyCase,
[int studyCaseRow]
)

R ETURNS
0 Study case could not be removed.
1 Study case has been successfully removed.

A RGUMENTS
studyCase
Study case which shall be removed.
studyCaseRow
≤0 Study case is removed for all entries in the study cases table matching
the provided study case.
>0 Optionally, the row in the study case table containing the study case
which shall be removed can be passed. This is helpful, e.g., if a
study case has been added multiple times for calculation with different
command lists.

RemoveStudyCases
Removes all study cases from calculation.
void ComTasks.RemoveStudyCases()

547
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
In this example we remove all study cases from the list of study cases for calculation.
object comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>nullptr) {
comTasks.RemoveStudyCases();
}
}

SetAdditionalResultsFlagForCommand
Set the flag whether to record an additional result file for a command of the calculation (using
study case row and task row / using command).
int ComTasks.SetAdditionalResultsFlagForCommand(int studyCaseRow,
int taskRow,
int addResVal
)
int ComTasks.SetAdditionalResultsFlagForCommand(object command,
int addResVal
)

A RGUMENTS
studyCaseRow> 0
The row in the study cases table of the command’s study case for which the flag
to record additional results shall be set.

taskRow> 0
The row in the commands table for which the flag to record additional results shall
be set.
command
The command for which the flag to record additional results shall be set.
addResVal
1 Will set the command to record additional results for the calculation.
0 Will set the command to avoid recording of results for calculation.

R ETURNS
0 Flag to record (or not record) additional results could not be set.
1 Flag to record (or not record) additional results has been successfully set.

E XAMPLE
In this example, we set the command of study case row 1 and command row 1 to record
additional results for calculation.
int isSet;
object comTasks,

548
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>nullptr) {
isSet = SetAdditionalResultsFlagForCommand(1, 1, 1);
if ( isSet<>0 ) {
printf('Command in study case row 1 and command row 1 records additional results');
}
else {
printf('Flag to record additional results could not be set');
}
}
}

In this example, we add the load flow command to the calculation and set the flag to record
additional results afterwards.
int isAdded,
isRecordSet;
object comLdf,
comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
comLdf = GetFromStudyCase('ComLdf');
if ({comTasks<>nullptr}.and.{comLdf<>nullptr}) {
isAdded = comTasks.AppendCommand(comLdf);
if ( isAdded<>0 ) {
printf('Command %o has been added for calculation', comLdf);
isRecordSet = SetAdditionalResultsFlagForCommand(comLdf, 1);
if ( isRecordSet<>0 ) {
printf('Flag to record additional results set for cmd %o', comLdf);
}
else {
printf('Flag to record add. res. could not be set for %o', comLdf);
}
}
else {
printf('Command %o could not be added for calculation', comLdf);
}
}
}

SetIgnoreFlagForCommand
Set the flag whether to ignore a command for the calculation (using study case row and task
row / using command).
int ComTasks.SetIgnoreFlagForCommand(int studyCaseRow,
int taskRow,

549
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

int ignoreVal
)
int ComTasks.SetIgnoreFlagForCommand(object command,
int ignoreVal
)

A RGUMENTS
studyCaseRow> 0
The row in the study cases table of the command’s study case for which the ignore
flag shall be set.
taskRow> 0
The row in the commands table for which the ignore flag shall be set.
command
Command for which the ignore flag shall be set.
ignoreVal
1 Will set the command to be ignored for calculation.
0 Will set the command to be processed for calculation.

R ETURNS
0 Ignore flag could not be set.
1 Ignore flag has been successfully set.

E XAMPLE
In this example, we set the command of study case row 1 and command row 1 to ignored for
calculation.
int isIgnored;
object comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>nullptr) {
isIgnored = SetIgnoreFlagForCommand(1, 1, 1);
if ( isIgnored<>0 ) {
printf('Cmd in study case row 1, cmd row 1 is ignored');
}
else {
printf('Ignore status could not be set');
}
}
}

In this example, we add the load flow command to the calculation and set it to ignored
afterwards.
int isAdded,
isIgnored;
object comLdf,
comTasks,
casesFolder;
set commands;

550
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
comLdf = GetFromStudyCase('ComLdf');
if ({comTasks<>nullptr}.and.{comLdf<>nullptr}) {
isAdded = comTasks.AppendCommand(comLdf);
if ( isAdded<>0 ) {
printf('Command %o has been added for calculation', comLdf);
isIgnored = SetIgnoreFlagForCommand(comLdf, 1);
if ( isIgnored<>0 ) {
printf('Command %o will be igored for calculation', comLdf);
}
else {
printf('Ignore status for command %o could not be set', comLdf);
}
}
else {
printf('Command %o could not be added for calculation', comLdf);
}
}
}

SetIgnoreFlagForStudyCase
Set the flag whether to ignore the processing of commands of a study case for the calculation.
int ComTasks.SetIgnoreFlagForStudyCase(object studyCase,
int ignoreVal,
[int studyCaseRow]
)

R ETURNS
0 Ignore flag could not be set.
1 Ignore flag has been successfully set.

A RGUMENTS
studyCase
Study case for which the ignore flag shall be set.
ignoreVal
1 Will set the flag to ignore the processing of commands of a study case.
0 Will set the flag to process the commands of a study case.

studyCaseRow
≤0 Ignore flag is set for all entries in the study cases table matching the
provided study case.
>0 Optionally, the row in the study case table containing the study case
for which the ignore-flag shall be set can be passed. This is helpful,
e.g., if a study case has been added multiple times for calculation with
different command lists.

551
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

SetResultsFolder
Set a folder to store results for a given row in the study case table.
int ComTasks.SetResultsFolder(object folder, int studyCaseRow)

R ETURNS
0 New folder could not be set as results folder for the given row in the study case
table.
1 Folder was successfully set as resuls folder for given row in the study case table.

A RGUMENTS
folder The new folder to store results in.
studyCaseRow
The row in the study case table containing the study case for which results folder
shall be set.

E XAMPLE
In this example, we set the active study case as new results folder for the study case in row
1 from the calculation.
int isSet;
object comTasks,
casesFolder,
activeCase;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
activeCase = GetActiveStudyCase();
if ({comTasks<>nullptr}.and{activeCase<>nullptr}) {
isSet = comTasks.SetResultsFolder(activeCase, 1);
if ( isSet<>0 ) {
printf('Results folder successfully changed.');
}
else {
printf('Results folder could not be changed');
}
}
}

3.4.52 ComTececo
Overview

UpdateTablesByCalcPeriod

552
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

UpdateTablesByCalcPeriod
Update all calculation points with respect to a new start- and end year
int ComTececo.UpdateTablesByCalcPeriod(double start,
double end
)

A RGUMENTS
start Start year of the study period
end End year of the study period

R ETURNS
0 Calculation points have been successfully set.
1 Invalid input data: end year of study period must be greater or equal to start year.

E XAMPLE
The following example configures a Techno-economical calculation with a study period 1.1.2015-
31.12.2020 and executes it.
object tececoCmd;

tececoCmd = GetFromStudyCase('ComTececo');
if ( tececoCmd<>nullptr ) {
tececoCmd:e:CalcPoints = 0; ! yearly calculation points
tececoCmd.UpdateTablesByCalcPeriod(2015, 2020); ! Set the study period to 1.1.2015-31.12
tececoCmd.Execute();
}

3.4.53 ComTececocmp
Overview

AppendStudyCase
CalcDiscountedEstimatedPaybackPeriod
CalcEstimatedPaybackPeriod
CalcInternalRateOfReturn
RemoveStudyCases

AppendStudyCase
Appends a study case to the list of study cases.
int ComTececocmp.AppendStudyCase(object studyCase, [int isIgnored])

R ETURNS
0 Study case could not be added for calculation.
1 Study case has been successfully added for calculation.

A RGUMENTS
studyCase
Study case to add for calculation.
isIgnored Sets the flag to ignore the study case to add or not.

553
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

CalcDiscountedEstimatedPaybackPeriod
Calculates the discounted estimated payback period (in years) for a grid expansion w.r.t. a
base grid configuration. The grid expansion and base configurations must be given by means
of two study cases and their configured variation. Moreover, these study cases must contain
corresponding result files calculated by techno-economical calculations. The calculatory interest
rate from the result file written by the Techno-economical Calculation to evaluate will be used
for discounting.
int CalcDiscountedEstimatedPaybackPeriod(object strategyToEval,
object baseStrategy,
double& epp)

A RGUMENTS
strategyToEval
Study case defining grid expansion to evaluate.
baseStrategy
Study case defining base grid configuration.

epp (out) Resulting discounted estimated payback period (in years).

R ETURNS
Returns 0, if calculation was successfull and 1 otherwise.

CalcEstimatedPaybackPeriod
Calculates the estimated payback period (in years) for a grid expansion w.r.t. a base grid
configuration. The grid expansion and base configurations must be given by means of two study
cases and their configured variation. Moreover, these study cases must contain corresponding
result files calculated by techno-economical calculations.
int CalcEstimatedPaybackPeriod(object strategyToEval,
object baseStrategy,
double& epp)

A RGUMENTS
strategyToEval
Study case defining grid expansion to evaluate.
baseStrategy
Study case defining base grid configuration.

epp (out) Resulting estimated payback period (in years).

R ETURNS
Returns 0, if calculation was successfull and 1 otherwise.

CalcInternalRateOfReturn
Calculates the internal rate of return for a grid expansion w.r.t. a base grid configuration.
The grid expansion and base configurations must be given by means of two study cases and
their configured variation. Moreover, these study cases must contain corresponding result files
calculated by techno-economical calculations.

554
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

int CalcInternalRateOfReturn(object strategyToEval,


object baseStrategy,
double& irr)

A RGUMENTS
strategyToEval
Study case defining grid expansion to evaluate.
baseStrategy
Study case defining base grid configuration.

irr (out) Resulting internal rate of return.

R ETURNS
Returns 0, if calculation was successfull and 1 otherwise.

RemoveStudyCases
Removes all study cases from calculation.
void ComTececocmp.RemoveStudyCases()

3.4.54 ComTransfer
Overview

GetTransferCalcData
IsLastIterationFeasible

GetTransferCalcData
The function returns the calculated transfer capacity and the total number of iteration after the
transfer capacity command has been executed.
void ComTransfer.GetTransferCalcData(double& transferCapacity, int& totalIterations)

A RGUMENTS
transferCapacity (out)
Transfer capacity value at the last feasible iteration.
totalIterations (out)
Total iteration number.

E XAMPLE
object cmdTransfer;
double dTotCapacity;
int iret, maxIteration;
cmdTransfer = GetFromStudyCase('ComTransfer');
if (cmdTransfer) {
iret = cmdTransfer.Execute(); ! Performs transfer capacity calculation
! If the calculation was success then the data can be obtained
if (iret = 0) {
cmdTransfer.GetTransferCalcData(dTotCapacity, maxIteration);
printf('Transfer capacity: %f MW, Total iteration: %d',dTotCapacity,maxIteration);

555
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

}
}

IsLastIterationFeasible
The function verifies if the last transfer calculation iteration resulted in a feasible solution or not.
int ComTransfer.IsLastIterationFeasible()

R ETURNS
1 Last transfer calculation iteration resulted in a feasible solution.
0 Last transfer calculation iteration did not result in a feasible solution.

E XAMPLE
object cmdTransfer;
int iret;
cmdTransfer = GetFromStudyCase('ComTransfer');
if (cmdTransfer) {
iret = cmdTransfer.Execute(); ! Performs transfer capacity calculation
! If the calculation was success then the data can be obtained
if (iret = 0) {
iret = cmdTransfer.IsLastIterationFeasible();
if (iret) {
printf('Transfer capacity: the last iteration was feasible!');
}
else {
printf('Transfer capacity: the last iteration was NOT feasible!');
}
}
}

3.4.55 ComUcte
Overview

SetBatchMode

SetBatchMode
The batch mode allows to suppress all messages except error and warnings. This can be useful
when used in scripts where additional output might be confusing.
void ComUcte.SetBatchMode(int enabled)

A RGUMENTS
enabled
0 disables batch mode, all messages are printed to output window (de-
fault).
1 enables batch mode, only error and warning messages are printed to
output window.

556
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.56 ComUcteexp
Overview

BuildNodeNames
DeleteCompleteQuickAccess
ExportAndInitQuickAccess
GetConnectedBranches
GetFromToNodeNames
GetOrderCode
GetUcteNodeName
InitQuickAccess
QuickAccessAvailable
ResetQuickAccess
SetGridSelection

BuildNodeNames
Builds the node names as used in UCTE export and makes them accessible via :UcteNode-
Name attribute. The node names will only be available as long as topology has not been
changed. They must be re-build after any topology relevant modification.
Furthermore, the method fills the quick access cache given by the cache index for node names
and branch topologies as used in UCTE export. The quick access cache endures also topology
changes. The cache index is optional. If no cache index is given the default quick access cache
is used.
int ComUcteexp.BuildNodeNames([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

R ETURNS
0 On success.
1 0n error (e.g. load flow calculation failed).

D EPRECATED N AMES
BuildExportStructure

E XAMPLE
object command, term;
set terms;
int err,
available,
cacheIndex;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error in determination of UCTE node names');

557
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

exit();
}

!output node names


terms = GetCalcRelevantObjects('*.ElmTerm');
for(term = terms.First(); term; term = terms.Next()) {
printf('Terminal:%o UCTE Name: %s', term, term:UcteNodeName);
}

available = command.QuickAccessAvailable(cacheIndex);

printf('Quick access for cache index %d available: %d', cacheIndex, available);

DeleteCompleteQuickAccess
Deletes all quick access caches.
void ComUcteexp.DeleteCompleteQuickAccess()

E XAMPLE
object command;
int err, cacheIndex, available;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

available = command.QuickAccessAvailable(cacheIndex);
printf('Quick access for cache index %d available: %d', cacheIndex, available);

command.DeleteCompleteQuickAccess();

available = command.QuickAccessAvailable(cacheIndex);
printf('Quick access for cache index %d available: %d', cacheIndex, available);

ExportAndInitQuickAccess
Performs an UCTE export and fills the quick access cache given by the cache index.
void ComUcteexp.ExportAndInitQuickAccess(int cacheIndex)

A RGUMENTS
cacheIndex
Index of the quick access cache (must be greater than or equals to 0)

558
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

E XAMPLE
object command;
int err, cacheIndex, available;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.ExportAndInitQuickAccess(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

available = command.QuickAccessAvailable(cacheIndex);

printf('Quick access for cache index %d available: %d', cacheIndex, available);

GetConnectedBranches
Determines the connected branches for the given terminal from the quick access cache given
by the optional cache index. If no cache index is given the default quick access cache is used.
void ComUcteexp.GetConnectedBranches(object terminal,
set& connectedBranches,
[int cacheIndex])

A RGUMENTS
terminal Terminal to determine the connected branches from

connectedBranches (out)
Connected branches for the given terminal
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

E XAMPLE
object command, term, branch;
set terms, branches;
int err, cacheIndex;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache with index %d.', cacheIndex);
exit();
}

!output node names

559
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

terms = GetCalcRelevantObjects('*.ElmTerm');
for(term = terms.First(); term; term = terms.Next()) {
command.GetConnectedBranches(term, branches, cacheIndex);
printf('Terminal %o has the following connected branches:', term);

for(branch = branches.First(); branch; branch = branches.Next()) {


printf('%o', branch);
}
}

GetFromToNodeNames
Determines the UCTE node names of the branch ends from the quick access cache given by
the optional cache index. If no cache index is given the default quick access cache is used.
void ComUcteexp.GetFromToNodeNames(object branch,
string& nodeNameFrom,
string& nodeNameTo,
[int cacheIndex])

A RGUMENTS
branch Branch to find the UCTE node names from
nodeNameFrom (out)
UCTE node name of start node
nodeNameTo (out)
UCTE node name of end node
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

E XAMPLE
object command, line;
set lines;
int err, cacheIndex;
string nodeFrom, nodeTo;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

!output node names


lines = GetCalcRelevantObjects('*.ElmLne');
for(line = lines.First(); line; line = lines.Next()) {
command.GetFromToNodeNames(line, nodeFrom, nodeTo, cacheIndex);
printf('Line %o has start node %s and end node %s', line, nodeFrom, nodeTo);
}

560
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

GetOrderCode
Determines the order code of the given branch element as used for UCTE export from the quick
access cache given by the optional cache index. If no cache index is given the default quick
access cache is used.
void ComUcteexp.GetOrderCode(object branch,
string& orderCode,
[int cacheIndex])

A RGUMENTS
branch Branch element to get the UCTE order code from
orderCode (out)
Order code of the given branch element
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

E XAMPLE
object command, line;
set lines;
int err, cacheIndex;
string orderCode;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

!output node names


lines = GetCalcRelevantObjects('*.ElmLne');
for(line = lines.First(); line; line = lines.Next()) {
command.GetOrderCode(line, orderCode, cacheIndex);
printf('Line %o has UCTE order code %s.', line, orderCode);
}

GetUcteNodeName
Determines the node name of the given terminal as used for UCTE export from the quick access
cache given by the optional cache index. If no cache index is given the default quick access
cache is used.
void ComUcteexp.GetUcteNodeName(object terminal,
string& ucteNodeName,
[int cacheIndex])

A RGUMENTS
terminal Terminal to get the UCTE node name from

561
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

ucteNodeName (out)
UCTE node name of the given terminal

cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

E XAMPLE
object command, term;
set terms;
int err, cacheIndex;
string nodeName;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

!output node names


terms = GetCalcRelevantObjects('*.ElmTerm');
for(term = terms.First(); term; term = terms.Next()) {
command.GetUcteNodeName(term, nodeName, cacheIndex);
printf('Terminal %o has UCTE node name %s.', term, nodeName);
}

InitQuickAccess
Initializes the quick access cache given by the optional cache index. The quick acess cache
contains node names and branch topologies as used in UCTE export and endures topology
changes. InitQuickAccess() requires a successful executed UCTE export as pre-condition. The
cache index is optional. If no cache index is given the default quick access cache is used.
void ComUcteexp.InitQuickAccess([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

E XAMPLE
object command;
int err, cacheIndex, available;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.Execute();

562
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

command.InitQuickAccess(cacheIndex);
available = command.QuickAccessAvailable(cacheIndex);

printf('Quick access for cache index %d available: %d', cacheIndex, available);

QuickAccessAvailable
Checks if the quick access cache given by the optional cache index is available. If no cache
index is given the default quick access cache is checked for availability.
int ComUcteexp.QuickAccessAvailable([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

R ETURNS
0 on success and 1 on error.

E XAMPLE
object command;
int err, available, cacheIndex;

cacheIndex = 1;

!get ComUcteexp from active study case


command = GetFromStudyCase('ComUcteexp');

err = command.BuildNodeNames(cacheIndex);

if (err > 0) {
Error('Error during filling quick access cache for cache index %d.', cacheIndex);
exit();
}

available = command.QuickAccessAvailable(cacheIndex);
printf('Quick access cache for cache index %d available: %d', cacheIndex, available);

ResetQuickAccess
Resets the given quick access cache for node names and branch topologies as used in UCTE
export. The cache index is optional. If no cache index is given the default quick access cache
is reset.
void ComUcteexp.ResetQuickAccess([int cacheIndex])

563
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

SetGridSelection
Configures the selected grids in the UCTE export command.
void ComUcteexp.SetGridSelection(set gridsToExport)

A RGUMENTS
gridsToExport
Grids (instances of class ElmNet) to be selected for export. All not contained grids
will be de-selected.

3.4.57 ComWktimp
Overview

GetCreatedObjects
GetModifiedObjects

GetCreatedObjects
Returns the newly created objects after execution of a WKT import.
set ComWktimp.GetCreatedObjects()

R ETURNS
Collection of objects that have been created during WKT import.

E XAMPLE
The following example returns the created objects after execution of a WKT import:
set created;
object obj;

ImportCmd.Execute(); !execute wkt import

printf('Created objects:');
created = ImportCmd.GetCreatedObjects();
for(obj = created.First(); obj; obj = created.Next()) {
printf('%o', obj);
}

GetModifiedObjects
Returns the modified objects after execution of a WKT import.
set ComWktimp.GetModifiedObjects()

564
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
Collection of objects that have been modified during WKT import.

E XAMPLE
The following example returns the modified objects after execution of a WKT import:
set modified;
object obj;

ImportCmd.Execute(); !execute wkt import

printf('\nModified objects:');
modified = ImportCmd.GetModifiedObjects();
for(obj = modified.First(); obj; obj = modified.Next()) {
printf('%o', obj);
}

3.5 Settings

3.5.1 SetCluster
Overview

CalcCluster
GetNumberOfClusters

CalcCluster
Performs a load flow calculation for the cluster index passed to the function. To execute properly
this function requires that a valid load flow result is already calculated before calling it.
int SetCluster.CalcCluster(int clusterIndex,
[int messageOn]
)

A RGUMENTS
clusterIndex
The cluster index. Zero based value, the first cluster has index 0.
messageOn (optional)
Possible values:
0 Do not emit a message in the output window.
1 Emit a message in the output window in case that the function does
not execute properly.

R ETURNS
0 On success.
1 There are no clusters, the number of clusters is 0.
2 The cluster index exceeds the number of clusters.
3 There is no load flow in memory before running CalcCluster.

565
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
See example of SetCluster.GetNumberOfClusters.

GetNumberOfClusters
Get the number of clusters.
int SetCluster.GetNumberOfClusters()

R ETURNS
The number of clusters.

E XAMPLE
The following example gets the SetCluster object from the reliability and prints the active
power sum of loads for every load state to the output window.
object rel3,
clusterObj,
ldf,
sumGrd;
set temp;
int nrOfClusters,
clusterIndex,
errorCode;
rel3 = GetFromStudyCase('ComRel3');
ldf = GetFromStudyCase('ComLdf');
temp = rel3.GetContents('*.SetCluster',0);
clusterObj = temp.First();
if (clusterObj = nullptr) {
exit();
}
ldf.Execute(); ! ldf result required by CalcCluster
sumGrd = GetSummaryGrid();

nrOfClusters = clusterObj.GetNumberOfClusters();
Info('Calculating %d clusters found in %o', nrOfClusters,clusterObj);
for (clusterIndex=0; clusterIndex<nrOfClusters; clusterIndex+=1) {
errorCode = clusterObj.CalcCluster(clusterIndex,1);
if (errorCode>0) {
break;
}
printf('%f',sumGrd:m:Pload);
}

566
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.2 SetColscheme
Overview

CreateFilter
GetAlarmColouringMode
GetColouringMode
GetEnergisingColouringMode
SetColouring
SetFilter

CreateFilter
Creates filter used to determine objects to be colored.
int SetColscheme.CreateFilter([int pageNr])

A RGUMENTS
pageNr empty Create filter for currently valid calculation
set Dialog page number for which filter is created (see table below)

567
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Table 3.5.3

Dialog Page Name ”pageNr” value


Basic Data 101
Load Flow 102
AC Load Flow Sensitivities 120
AC Contingency Analysis 121
AC Quasi-dynamic Simulation 137
DC Load Flow 122
DC Load Flow Sensitivities 123
DC Contingency Analysis 124
DC Quasi-dynamic Simulation 138
VDE/IEC Short-Circuit 103
Complete Short-Circuit 111
ANSI Short-Circuit 112
IEC 61363 114
DC Short-Circuit 117
RMS-Simulation 104
Modal Analysis 128
EMT-Simulation 105
Harmonics/Power Quality 106
Frequency Sweep 127
D-A-CH-CZ Connection Request 139
BDEW/VDE Connection Request 142
Optimal Power Flow 108
DC Optimal Power Flow 130
DC OPF with Contingencies 135
State Estimation 113
Reliability 109
General Adequacy 115
Tie Open Point Opt. 116
Motor Starting Calculation 133
Arc Flash Calculation 129
Optimal Capacitor Placement 126
Voltage Profile Optimisation 125
Backbone Calculation 131
Optimal RCS Placement 132
Optimal Manual Restoration 136
Phase Balance Optimisation 141
User defined calculation 142

R ETURNS
0 On success.
1 On error.

GetAlarmColouringMode
Returns the alarm colouring number for the given or currently valid calculation.
int SetColscheme.GetAlarmColouringMode(string page)

A RGUMENTS
page

568
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

empty for currently valid calculation


set page (see dialog page name table)

R ETURNS
The colouring number of ”Alarm” colouring or negative value if not set.

GetColouringMode
Returns the alarm colouring number for the given or currently valid calculation.
int SetColscheme.GetColouringMode(string page)

A RGUMENTS
page
empty for currently valid calculation
set page (see dialog page name table)

R ETURNS
The colouring number of ”Other” colouring or negative value if not set.

GetEnergisingColouringMode
Returns the energising status colouring number for the given or currently valid calculation.
int SetColscheme.GetEnergisingColouringMode(string page)

A RGUMENTS
page
empty for currently valid calculation
set page (see dialog page name table)

R ETURNS
The colouring number of ”Energising Status” colouring or negative value if not set.

SetColouring
Sets colouring for given or currently valid calculation.
int SetColscheme.SetColouring(string page,
int energizing,
[int alarm,]
[int normal]
)

A RGUMENTS
page
empty set for currently valid calculation
set page for which modes are set (see dialog page name table)

569
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

energizing
Colouring for Energizing Status

-2 enable (set to previously selected mode),


-1 do not change
0 disable
>0 set to this mode (see table below)

alarm Colouring for Alarm


-2 enable (set to previously selected mode),
-1 do not change (default)
0 disable
>0 set to this mode (see table below)
normal Other Colouring
-2 enable (set to previously selected mode),
-1 do not change (default)
0 disable
>0 set to this mode (see table below)

570
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Table 3.5.4

Dialog Page Name ”page” value


Basic Data basic
Load Flow ldf
AC Load Flow Sensitivities acsens
AC Contingency Analysis accont
AC Quasi-dynamic Simulation acldfsweep
DC Load Flow dcldf
DC Load Flow Sensitivities dcsens
DC Contingency Analysis dccont
DC Quasi-dynamic Simulation dcldfsweep
VDE/IEC Short-Circuit shc
Complete Short-Circuit shcfull
ANSI Short-Circuit shcansi
IEC 61363 shc61363
DC Short-Circuit shcdc
RMS-Simulation rms
Modal Analysis modal
EMT-Simulation emt
Harmonics/Power Quality harm
Frequency Sweep fsweep
D-A-CH-CZ Connection Request dachcz
BDEW/VDE Connection Request bdewvde
Optimal Power Flow opf
DC Optimal Power Flow dcopf
DC OPF with Contingencies dccontopf
State Estimation est
Reliability rel
General Adequacy genrel
Tie Open Point Opt. topo
Motor Starting Calculation motstart
Arc Flash Calculation arcflash
Optimal Capacitor Placement optcapo
Voltage Profile Optimisation mvplan
Backbone Calculation backbone
Optimal RCS Placement optrcs
Optimal Manual Restoration omr
Phase Balance Optimisation balance
Hosting Capacity Analysis hostcap
User defined calculation usercalc

Table 3.5.5

Energizing State Name ”energizing” value


De-energized 33
Out of Calculation 37
De-energised, Planned Outage 61

571
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Table 3.5.6

Alarm Name ”alarm” value


Voltage Violations / Overloading 29
Outages 32
Overloading of Thermal / Peak Short Circuit Current 31
Feeder Radiality Check 38

572
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Table 3.5.7

Other Colouring Name Group ”normal” value


Voltages / Loading Results 1
Voltage Levels Topology 2
Individual Individual 4
Connected Grid Components Topology 5
According to Filter User-defined see notes below table
Grids Groupings 7
Modifications in Variations / System Stages Variations / System Stages 8
Loading of Thermal / Peak Short-Circuit Current Results 9
Paths Groupings 10
System Type AC/DC and Phases Topology 11
Relays, Current and Voltage Transformers Secondary Equipment 12
Fault Clearing Times Results 13
Feeders Topology 14
Switches, Type of Usage Secondary Equipment 15
Measurement Locations Secondary Equipment 16
Missing graphical connections Topology 17
Zones Groupings 18
State Estimation Results 19
Boundaries (Interior Region) Topology 20
Station Connectivity Topology 21
Outage Check Topology 22
Energizing Status Topology 23
Modifications in Recording Expansion Stage Variations / System Stages 24
Areas Groupings 25
Owners Groupings 26
Routes Groupings 27
Operators Groupings 28
Layers Groupings 66
Original Locations Variations / System Stages 30
Boundaries (Definition) Topology 34
Meteo Stations Groupings 35
Station Connectivity (Beach Balls only) Topology 36
Power Restoration Secondary Equipment 43
Connected Components Topology 39
Connected Components, Voltage Level Topology 40
Year of Construction Primary Equipment 41
Cross Section Primary Equipment 42
Forced Outage Rate Primary Equipment 44
Forced Outage Duration Primary Equipment 45
Loads: Yearly interruption frequency Results 46
Loads: Yearly interruption time Results 47
Loads: Average Interruption Duration Results 48
Loads: Load Point Energy Not Supplied Results 49
Supplied by Substation Topology 50
Supplied by Secondary Substation Topology 51
Incident Energy Results 52
PPE-Category Results 53
Optimal Manual Restoration Results 54
Connection Request: Approval Status Results 55
Voltage Angle Results 56
Contributions to SAIDI Results 57
Contributions to SAIFI Results 58
Contributions to ENS Results 59
Contributions to EIC 573 Results 60
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Note: User-defined filters can be set with a “normal” value of 1000 or higher. The first filter in
the list has the value 1000, the next one has 1001 and so on.

R ETURNS
0 error (at least one of the given colourings cannot be set, e.g. not available for
given page). Nothing is changed.
1 ok

SetFilter
Sets filter for given or currently valid calculation.
int SetColscheme.SetFilter(int filter,
[int page]
)
int SetColscheme.SetFilter(object obj,
[int page]
)

A RGUMENTS
filter number of filter to be set
obj user-defined filter to be set

page (optional)
Dialog page number for which filter is set (for numbers see table listed in Set-
Colscheme.CreateFilter())

R ETURNS
0 ok
1 error (filter or page not found)

S EE ALSO

SetColscheme.CreateFilter()

3.5.3 SetDatabase
Overview

EmptyCache

EmptyCache
Empties characteristics cache for this database connection.
void SetDatabase.EmptyCache()

574
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.4 SetDataext
Overview

AddConfiguration
GetConfiguration
GetConfigurations
RemoveAllConfigurations
RemoveConfiguration

AddConfiguration
Adds a new IntAddonvars configuration object for the given classFilter with the descriptiveName
as object name. For the classFilter expressions like Elm* or ElmTr? are possible. If there
already is an object matching classFilter and descriptiveName exactly, this object is returned
instead.
object SetDataext.AddConfiguration(string classFilter, string descriptiveName)

A RGUMENTS
classFilter
The class filter of the IntAddonvars object
descriptiveName
The object name of the IntAddonvars object

R ETURNS
The IntAddonvars object which exactly matches the classFilter and descriptive name or a
newly created one. Returns nothing if the object cannot be modified.

S EE ALSO

IntAddonvars.AddDouble(), IntAddonvars.AddDoubleMatrix(), IntAddonvars.AddDoubleVector(),


IntAddonvars.AddInteger(), IntAddonvars.AddIntegerVector(), IntAddonvars.AddObject(), In-
tAddonvars.AddObjectVector(), IntAddonvars.AddString(), IntAddonvars.RemoveParameter()

GetConfiguration
Returns the IntAddonvars object which exactly matches the classFilter and descriptiveName, if
the latter is specified. If there are multiple matches the first object will be returned. Otherwise
nothing is returned.
object SetDataext.GetConfiguration(string classFilter, [string descriptiveName])

A RGUMENTS
classFilter
The class filter of the IntAddonvars object
descriptiveName (optional)
The object name of the IntAddonvars object

R ETURNS
The IntAddonvars object which exactly matches the classFilter and optionally the descriptive-
Name or nothing.

575
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

S EE ALSO

IntAddonvars.AddDouble(), IntAddonvars.AddDoubleMatrix(), IntAddonvars.AddDoubleVector(),


IntAddonvars.AddInteger(), IntAddonvars.AddIntegerVector(), IntAddonvars.AddObject(), In-
tAddonvars.AddObjectVector(), IntAddonvars.AddString(), IntAddonvars.RemoveParameter()

GetConfigurations
Returns all IntAddonvars objects by a given classFilter.
set SetDataext.GetConfigurations(string classFilter)
set SetDataext.GetConfigurations()

A RGUMENTS
classFilter
The class filter for the IntAddonvars object

R ETURNS
A list of IntAddonvars objects matching the classFilter exactly. If no filter is specified all
IntAddonvars are returned.

S EE ALSO

IntAddonvars.AddDouble(), IntAddonvars.AddDoubleMatrix(), IntAddonvars.AddDoubleVector(),


IntAddonvars.AddInteger(), IntAddonvars.AddIntegerVector(), IntAddonvars.AddObject(), In-
tAddonvars.AddObjectVector(), IntAddonvars.AddString(), IntAddonvars.RemoveParameter()

RemoveAllConfigurations
Removes all IntAddonvars objects effectively removing all Data Extensions.
void SetDataext.RemoveAllConfigurations()

RemoveConfiguration
Removes the IntAddonvars object exactly matching classFilter and descriptive name.
void SetDataext.RemoveConfiguration(string classFilter, [string descriptiveName])

A RGUMENTS
classFilter
The class filter of the IntAddonvars object

descriptiveName (optional)
The object name of the IntAddonvars object

576
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.5 SetDeskpage
Overview

Close
Show

Close
Closes the graphic page, if currently shown in the graphics board.
int SetDeskpage.Close()

R ETURNS
0 On success, no error occurred.
1 Otherwise

Show
Displays the diagram page in the graphics board.
int SetDeskpage.Show()

R ETURNS
0 On success, no error occurred.
1 Otherwise

3.5.6 SetDesktop
Overview

AddPage
Close
DoAutoScaleX
Freeze
GetActivePage
GetCanvasSize
GetPage
IsFrozen
IsOpened
RemovePage
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetViewArea
SetXVar
Show
Unfreeze
WriteWMF
ZoomAll

577
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

AddPage
Adds an existing page to a graphics and activates it

• Opens the graphics board if not already open.

• Adds the page if it is not already part of the graphics board.

object SetDesktop.AddPage(object page2add)

A RGUMENTS
page2add
The page to add to the desktop.
• Page is a plot page (GrpPage or SetVipage): A copy of the page is added.
• Page is an IntGrfnet (Single line graphic, block diagram): The graphic is
added.

R ETURNS
The page displayed or NULL if the desktop was not changed.

E XAMPLE
object desktop; ! graphic board
object pagecopied; ! page created by AddPage
desktop = GetGraphicsBoard();
if (desktop) {
! add PageTemplate to desktop (it is assumed that PageTemplate is a
! virtual instrument panel stored in the "Contents" of the DPL script.
pagecopied = desktop.AddPage(PageTemplate);
pagecopied.ShowFullName();
}

Close
Closes the graphics board, if it is currently shown.
int SetDesktop.Close()

R ETURNS
0 on success
1 on error

DoAutoScaleX
Scales the x-axes of all plots in the graphics board which use the x-axis scale defined in the
graphics board.
void SetDesktop.DoAutoScaleX()

578
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example performs an automatic scaling of x.
object graphBoard;
! Look for opened graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
graphBoard.DoAutoScaleX();
}

Freeze
Enables the graphical freeze mode, preventing changes to open diagrams.
int SetDesktop.Freeze()

R ETURNS
0 on success
1 on error

GetActivePage
Returns the page object of the currently shown page.
object SetDesktop.GetActivePage()

R ETURNS
Page object of the active page, or 0 if no page is active.

GetCanvasSize
Returns the pixel dimensions of the currently active (top-most) graphic page.
int SetDesktop.GetCanvasSize(int& width,
int& height
)

A RGUMENTS
width (out)
Pixel width of the canvas. -1 if no graphics page is open.
height (out)
Pixel height of the canvas. -1 if no graphics page is open.

R ETURNS
0 on success: canvas size could be determined
1 on error: no graphics page is open

579
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

GetPage
Searches, activates and returns a graphics page in the currently open graphics board. If “create”
is true, then a new page will be created and added to the graphics board if no page with name
was found.
object SetDesktop.GetPage(string name,
[int create,]
[string class]
)

A RGUMENTS
name Name of the page.
create (optional)
Possible values:

0 do not create new plot page


1 create plot page if it does not exist already
class (optional)
Classname of the plot page object to create: either 'GrpPage' or 'SetVipage'. If
not specified, a 'GrpPage' will be created if the new plot framework is enabled in
the project settings, otherwise a 'SetVipage' will be created.

R ETURNS
Plot page (GrpPage or SetVipage), or network graphic page (SetDeskpage)

E XAMPLE
The following example looks for the plot pages named 'Voltage', 'Current' and 'Power' in the
graphics board currently open. The plot pages are created if they do not exist.
object graphBoard;
object pageVoltage;
object pageCurrent;
object pagePower;
! Look for opened graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
! Search or create plot pages
pageVoltage=graphBoard.GetPage('Voltage',1);
pageCurrent=graphBoard.GetPage('Current',1);
pagePower=graphBoard.GetPage('Power',1);
}

IsFrozen
Returns whether the graphical freeze mode is currently enabled.
int SetDesktop.IsFrozen()

R ETURNS
0 freeze mode is disabled, or the graphics board is not open
1 graphics board is open and freeze mode is enabled

580
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

IsOpened
Returns whether the graphics board is currently shown.
int SetDesktop.IsOpened()

R ETURNS
1 if graphics board is shown
0 otherwise

RemovePage
Removes a graphic page. The page to be removed can be identified either by its name or by its
page object.
int SetDesktop.RemovePage(string pageName)
int SetDesktop.RemovePage(object pageObject)

A RGUMENTS
pageName
Name of graphics page.
pageObject
A graphics page object.

R ETURNS
0 on success
1 on error

SetAdaptX
Sets the Adapt Scale option of the x-scale.
void SetDesktop.SetAdaptX(int mode,
[double trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

E XAMPLE
The following example looks for an opened graphics board and sets its adapt scale option.
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Turn on adapt scale, use a trigger value of 3
graphBoard.SetAdaptX(1,3);
! Turn off adapt scale

581
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

graphBoard.SetAdaptX(0,3);
! Turn on adapt scale again, do not change the trigger value
graphBoard.SetAdaptX(1);
}

SetAutoScaleX
Sets automatic scaling mode of the x-scale. A warning is issued if an invalid mode is passed to
the function.
void SetDesktop.SetAutoScaleX(int mode)

A RGUMENTS
mode Possible values:

0 never
1 after simulation
2 during simulation

E XAMPLE
The following example looks for an open graphics boards and sets its Auto Scale setting to
Off.
! Set Auto Scale to Off
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Turn off automatic scaling
graphBoard.SetAutoScaleX(0);
}

SetResults
Sets default results object of graphics board.
void SetDesktop.SetResults(object res)

A RGUMENTS
res Result object to set or NULL to reset. Valid result object is any of class ElmRes,
IntComtrade and IntComtradeset.

E XAMPLE
The following example looks for an open graphics board and sets its default results to the
results object named 'Results'.
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
graphBoard.SetResults(Results);
}

582
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

SetScaleX
Sets x-axis scale. A function call without arguments sets the Auto Scale setting to On without
changing the scale itself.
void SetDesktop.SetScaleX()
void SetDesktop.SetScaleX(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.

log (optional)
Possible values:
0 linear
1 logarithmic

E XAMPLE
The following examples look for an open graphics board and set its x-axis scale. There are
three different examples. 1. Example: Set 'Auto Scale' of x axis to 'On'. 2. Example: Set
minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000.
Changes to a logarithmic scale.
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
graphBoard.SetScaleX();! Automatic Scaling to On
}
! Set minimum and maximum without changing linear/log
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Set minimum and maximum
graphBoard.SetScaleX(0,20);
}
! Set minimum and maximum, change to logarithmic scale
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Set minimum and maximum
graphBoard.SetScaleX(1,1000,1);
}

583
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

SetViewArea
Adjusts the view area of the currently active (top-most) graphic page. Coordinates are expected
in millimetres for schematic diagrams or in geographic coordinates for geographic diagrams,
respectively.
void SetDesktop.SetViewArea(double left,
double right,
double bottom,
double top)

SetXVar
Sets x-axis variable. If The default x-axis variable (time) is set if no argument is passed.
void SetDesktop.SetXVar()
void SetDesktop.SetXVar(object obj,
string varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

E XAMPLE
The following examples look for an open graphics board and sets its x-axis variable. The first
example sets an user defined x-axis variable of the graphics board. The second one sets the
default x-axis (in simulation: time).
! set x-axis variable 'm:U1:bus1' of object line
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
graphBoard.SetXVar(line,'m:U1:bus1');
}

! set default x-axis variable


object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
! Set default x-axis variable (time)
graphBoard.SetXVar();
}

Show
Shows the virtual instrument panel with the same name as 'pageObject' or the page with
name 'pageName' in the graphics board. The object 'pageObject' is typically a object of class
'SetVipage' (virtual instrument panel) but, as only its name is used, it may be any other type of
object. Calling the function without an argument opens the graphics board.
int SetDesktop.Show()
int SetDesktop.Show(string pageName)
int SetDesktop.Show(object pageObject)

584
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

A RGUMENTS
pageName (optional)
Name of graphics page.
pageObject (optional)
A graphics page oject.

R ETURNS
0 on success
1 on error

E XAMPLE
The following example activates all pages in the graphics board one by one and exports them
as WMF figures.
object graphicsBoard,page;
set pages;
int n;
string FileName;
graphicsBoard = GetGraphicsBoard();
if (graphicsBoard) {
pages = graphicsBoard.GetContents();
page = pages.First();
while (page) {
graphicsBoard.Show(page);
FileName = sprintf('c:\\temp\%s%d', page:loc_name, n);
graphicsBoard.WriteWMF(FileName);
page = pages.Next();
}
}

Unfreeze
Disables the graphical freeze mode, allowing changes to open diagrams.
int SetDesktop.Unfreeze()

R ETURNS
0 on success
1 on error

WriteWMF
Writes the currently open graphic to a windows metafile file (*.wmf).
Please use the Save File command (ComWr) for writing to other formats like *.pdf, *.png, *.svg,
*.emf or *.bmp.
int SetDesktop.WriteWMF(string filename)

A RGUMENTS
filename Filename without extension.

585
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On error.
1 On success.

E XAMPLE
The following example exports the open graphic to a windows metafile.
object graphicsBoard;
graphicsBoard = GetGraphicsBoard();
if (graphicsBoard) {
graphicsBoard.WriteWMF('c:\temp\DPLExample');
}

ZoomAll
Adjusts the zoom level of the currently active (top-most) graphic page such that the entire
diagram is shown.
int SetDesktop.ZoomAll()

R ETURNS
0 on success
1 on error

3.5.7 SetDistrstate
Overview

CalcCluster

CalcCluster
Calculates a load flow with a given load distribution state applied.
int SetDistrstate.CalcCluster(int clusterIndex,
[int messageOn]
)

A RGUMENTS
clusterIndex
The cluster index. Zero based value, the first cluster has index 0.
messageOn (optional)
Possible values:
0 Do not emit a message in the output window.
1 Emit a message in the output window in case that the function does
not execute properly.

R ETURNS
0 if ok. -1 if load flow of cluster did not converge.

586
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.8 SetFilt
Overview

Get*

Get*
Returns a container with the filtered objects.
set SetFilt.Get()

R ETURNS
The set of filtered objects.

3.5.9 SetLevelvis
Overview

AdaptWidth
Align
ChangeFont
ChangeFrameAndWidth
ChangeLayer
ChangeRefPoints
ChangeWidthVisibilityAndColour
Mark
Reset

AdaptWidth
This function resizes the in the object specified group of text boxes regarding their text contents.
void SetLevelvis.AdaptWidth()

Align
This function aligns the text within a text box.
void SetLevelvis.Align(int iPos)

A RGUMENTS
iPos Alignment position
0 left
1 middle
2 right

587
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

ChangeFont
This function sets the font number for the specified group of text boxes.
void SetLevelvis.ChangeFont(int iFont)

A RGUMENTS
iFont Font number (default fonts range from 0 to 13)

ChangeFrameAndWidth
This method is not available anymore. Please use SetLevelvis.ChangeWidthVisibilityAndColour()
instead.
void SetLevelvis.ChangeFrameAndWidth([int iFrame,]
[int iWidth,]
[int iVisibility,]
[int iColour]
)

ChangeLayer
This function sets the specified group of text boxes to a given layer.
void SetLevelvis.ChangeLayer(string sLayer)

A RGUMENTS
sLayer Layer name (e.g. 'Object Names', 'Results', 'Invisible Objects',..)

ChangeRefPoints
This function sets the reference points between a text box (second parameter) and its parent
object (first parameter), e.g. if the result box of a busbar shall be shown on top of a drawn
bar instead of below the bar the values change from (6,4) to (4,6). The first number specifies
the reference number of the text box. The integer values describe the position of the reference
points within a rectangle (0=centre, 1=middle right, 2=top right,..):
432
501
678

void SetLevelvis.ChangeRefPoints(int iParRef,


int iTBRef
)

A RGUMENTS
iParRef Defines the reference point on the parent object (e.g. busbar)

iTBRef Defines the reference point on the text box

588
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

ChangeWidthVisibilityAndColour
This function sets the visibility of the frame, the width (in number of letters), the visibility and the
colour of text boxes.
void SetLevelvis.ChangeWidthVisibilityAndColour([int iWidth,]
[int iVisibility,]
[int iColour]
)

A RGUMENTS
iWidth Sets the width in number of letters
0..n width
iVisibility Sets the visibility

0 not visible
1 visible
iColour Sets the colour
0..255 colour

Mark
Marks the specified group of text boxes in the currently shown diagram.
void SetLevelvis.Mark()

Reset
This function resets the individually modified text box settings.
void SetLevelvis.Reset(int iMode)

A RGUMENTS
iMode
0 Reset to default (changed reference points are not reset)
1 Only font
2 Shift to original layer (result boxes to layer 'Results', object names to
layer 'Object Names')

3.5.10 SetLvscale
Overview

AddCalcRelevantCoincidenceDefinitions

589
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

AddCalcRelevantCoincidenceDefinitions
Adds all calculation relevant coincidence definitions.
void SetLvscale.AddCalcRelevantCoincidenceDefinitions()

3.5.11 SetParalman
Overview

GetNumSlave*
SetNumSlave
SetTransfType

GetNumSlave*
To get the number of slaves which is currently configured.
int SetParalman.GetNumSlave()

R ETURNS
the number of slaves which is currently configured.

SetNumSlave
To configue the number of slaves to be used for parallel computing.
int SetParalman.SetNumSlave(int numSlaves)

A RGUMENTS
numSlaves
Number of slaves to be used for parallel computing

−1 All cores available will be used.


>0 The number of slaves to be used.

R ETURNS
Always return 0.

SetTransfType
To change the data transfer type: via file or via socket communication.
int SetParalman.SetTransfType(int viaFile)

A RGUMENTS
viaFile
0 The data will be transferred via socket communication.
1 The data will be transferred via file.

590
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
0 the data will be transferred via socket communication.
1 the data will be transferred via file.

3.5.12 SetPath
Overview

AllBreakers*
AllClosedBreakers*
AllOpenBreakers*
AllProtectionDevices*
Create
GetAll*
GetBranches*
GetBuses*
GetPathFolder

AllBreakers*
Returns all breakers in the path definition.
set SetPath.AllBreakers()

R ETURNS
The set of breakers.

AllClosedBreakers*
Returns all closed breakers in the path definition.
set SetPath.AllClosedBreakers()

R ETURNS
The set of closed breakers.

AllOpenBreakers*
Returns all open breakers in the path definition.
set SetPath.AllOpenBreakers()

R ETURNS
The set of open breakers.

AllProtectionDevices*
Returns all protection devices in the path definition for a given direction.
set SetPath.AllProtectionDevices(int reverse)

591
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

A RGUMENTS
reverse
0 Return devices in forward direction.
1 Return devices in reverse direction.

R ETURNS
The set of protection devices.

Create
Creates or extends the path with the elements provided.
object SetPath.Create(set elements)

A RGUMENTS
elements Elements the path shall be created or extended with.

R ETURNS
object Modification was successful.
NULL Modification failed. (e.g. elements form an incomplete path)

E XAMPLE
The following emulates Path → New from the context menu, by creating a new path definition
with the contents of the general selection selection of the script.
object folder, path, return;

folder = GetDataFolder('IntPath');
path = folder.CreateObject('SetPath', 'Path');
return = path.Create(SEL.All());
if (return) {
printf('Path %o was modified', path);
}
else {
printf('An error occurred while modifing path %o', path);
}

GetAll*
Returns all objects in the path definition.
set SetPath.GetAll()

R ETURNS
The set of objects.

E XAMPLE
The following example writes all objects in the path definition to the output window, assuming
aPath is an external SetPath object.
set list;
object obj;

592
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

list = aPath.GetAll();
obj = list.First();
while (obj) {
obj.ShowFullName();
obj = list.Next();
}

GetBranches*
Returns all breanches in the path definition.
set SetPath.GetBranches([int reverse])

A RGUMENTS
reverse (optional)
0 Sort the branches in forward direction.
1 Sort the branches in reverse direction.

R ETURNS
The set of branches.

GetBuses*
Returns all busbars and terminals in the path definition.
set SetPath.GetBuses()

R ETURNS
The set of busbars and terminals.

GetPathFolder
Returns the default folder for storing path objects.
object SetPath.GetPathFolder([int create])

A RGUMENTS
create (optional)
0 Return only if the folder exists.
1 Create the folder if it does not exist.

R ETURNS
object Default folder for storing path.
NULL Default folder does not exist or could not be created.

593
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.13 SetPrj
Overview

GetFontID
SetFontFor

GetFontID
Determines the ID for given font. The font is automatically internally registered if it has not been
used before.
int SetPrj.GetFontID(const char* fontName,
int fontSize,
[int fontStyle = 0])

A RGUMENTS
fontName
Font name
fontSize Font size

fontStyle (optional)
Bitfield if bold, italic and/or underline
0 Regular (no style used
1 Bold
2 Italic
3 Bold and italic
4 Underline

R ETURNS
Returns the font ID. The value is always greater than zero.

E XAMPLE
In this example the new font ’Consolas’ with size 12 is created and becomes the default font
for all node labels on the currently visible diagram.
int fontID;
object intGrfnet, prj, setPrj;

prj = GetActiveProject();
setPrj = prj:pPrjSettings;
intGrfnet = GetCurrentDiagram();
if (intGrfnet) {
fontID = setPrj.GetFontID('Consolas', 12);
intGrfnet:fontNodLabel = fontID;
intGrfnet:allowFontsIndivTBs = 0; ! making changes visible for current diagram (overrulin
intGrfnet:usePrjFonts = 0; ! do not use project fonts for this diagram
Rebuild(1); ! once at the end of the sript
}

594
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

SetFontFor
Sets a font for a specified group of text boxes.
void SetPrj.SetFontFor(int sglOrBlock,
int labelResultOrTitle,
int nodesOrBranches,
string fontName,
int fontSize,
int fontStyle)

A RGUMENTS
sglOrBlock
Font settings for single line or block diagrams
0 Single line diagrams
1 Block diagrams
labelResultOrTitle
Type of text box to be modified.
0 Labels
1 Results
2 Title and Legends

nodesOrBranches
Type of parent object
0 Nodes
1 Branches

fontName
Font name
fontSize Font size
fontStyle Font style

1 Bold
2 Italic
3 Bold and italic
4 Underline

3.5.14 SetScenario
Overview

Check
Default
Print

595
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Check
Checks the scenario configuration. The action is identical to pressing the corresponding button
in the dialog.
NB: This function is only available if called on the configuration (SetScenario) of the currently
active project.
int IntScenario.Check()

R ETURNS
0 Ok, check did not reveal any problems
1 Not ok, check found some problems. See the output window for details.

Default
Resets the scenario configuration to the default, built-in configuration. The action is identical to
pressing the corresponding button in the dialog.
NB: This function is only available if no scenario is active and called on the configuration
(SetScenario) of the currently active project.
void IntScenario.Default()

Print
Prints the scenario configuration to the output window. The action is identical to pressing the
corresponding button in the dialog.
NB: This function is only available if called on the configuration (SetScenario) of the currently
active project.
void IntScenario.Print()

3.5.15 SetSelect
Overview

AddRef*
All*
AllAsm*
AllBars*
AllBreakers*
AllClosedBreakers*
AllElm*
AllLines*
AllLoads*
AllOpenBreakers*
AllSym*
AllTypLne*
Clear
GetAll*

596
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

AddRef*
Adds a reference to the objects to the existing selection.
void SetSelect.AddRef(object O)
void SetSelect.AddRef(set S)

A RGUMENTS
O An object.
S A set of objects.

E XAMPLE
The following example adds all loads and lines from the general DPL selection to the selection
“MySelection”.
set lines;
lines = SEL.AllLines();
MySelection.AddRef(lines);
lines = SEL.AllLoads();
MySelection.AddRef(lines);

All*
Returns all objects in the selection.
set SetSelect.All()

R ETURNS
The set of objects

E XAMPLE
The following example writes objects in the general DPL selection to the output window.
set list;
object obj;
list = SEL.All();
obj = list.First();
while (obj) {
obj.ShowFullName();
obj = list.Next();
}

AllAsm*
Returns all asynchronous machines in the selection.
set SetSelect.AllAsm()

R ETURNS
The set of objects

597
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example writes all asynchronous machines in the general DPL selection to the
output window.
set list;
object asynMachines;
list = SEL.AllAsm();
asynMachines = list.First();
while (asynMachines) {
asynMachines.ShowFullName();
asynMachines = list.Next();
}

AllBars*
Returns all busbars and terminals in the selection.
set SetSelect.AllBars()

R ETURNS
The set of objects

E XAMPLE
The following example writes all busbars in the general DPL selection to the output window.
set list;
object bar;
list = SEL.AllBars();
bar = list.First();
while (bar) {
bar.ShowFullName();
bar = list.Next();
}

AllBreakers*
Returns all breakers in the selection.
set SetSelect.AllBreakers()

R ETURNS
The set of objects

E XAMPLE
The following example writes all breakers in the general DPL selection to the output window.
set list;
object breaker;
list = SEL.AllBreakers();
breaker = list.First();
while (breaker) {
breaker.ShowFullName();
breaker = list.Next();
}

598
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

AllClosedBreakers*
Returns all closed breakers in the selection.
set SetSelect.AllClosedBreakers()

R ETURNS
The set of objects

E XAMPLE
The following example writes all closed breakers in the general DPL selection to the output
window.
set list;
object closedbreaker;
list = SEL.AllClosedBreakers();
closedbreaker = list.First();
while (closedbreaker) {
closedbreaker.ShowFullName();
closedbreaker = list.Next();
}

AllElm*
Returns all elements (Elm*) in the selection.
set SetSelect.AllElm()

R ETURNS
The set of containing objects

E XAMPLE
The following example writes all objects in the general DPL selection to the output window.
set list;
object obj;
list = SEL.AllElm();
obj = list.First();
while (obj) {
obj.ShowFullName();
obj = list.Next();
}

AllLines*
Returns all lines and line routes in the selection.
set SetSelect.AllLines()

R ETURNS
The set of objects

599
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example writes all lines and line routes in the general DPL selection to the
output window.
set list;
object line;
list = SEL.AllLines();
line = list.First();
while (line) {
line.ShowFullName();
line = list.Next();
}

AllLoads*
Returns all loads in the selection.
set SetSelect.AllLoads()

R ETURNS
The set of objects

E XAMPLE
The following example writes all loads in the general DPL selection to the output window.
set list;
object load;
list = SEL.AllLoads();
load = list.First();
while (load) {
load.ShowFullName();
load = list.Next();
}

AllOpenBreakers*
Returns all open breakers in the selection.
set SetSelect.AllOpenBreakers()

R ETURNS
The set of objects

E XAMPLE
The following example writes all open breakers in the general DPL selection to the output
window.
set list;
object openbreaker;
list = SEL.AllOpenBreakers();
openbreaker = list.First();
while (openbreaker) {
openbreaker.ShowFullName();
openbreaker = list.Next();
}

600
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

AllSym*
Returns all synchronous machines in the selection.
set SetSelect.AllSym()

R ETURNS
The set of objects

E XAMPLE
The following example writes all synchronous machines in the general DPL selection to the
output window.
set list;
object synMachines;
list = SEL.AllSym();
synMachines = list.First();
while (synMachines) {
synMachines.ShowFullName();
synMachines = list.Next();
}

AllTypLne*
Returns all line types in the selection.
set SetSelect.AllTypLne()

R ETURNS
The set of objects

E XAMPLE
The following example writes objects in the general DPL selection to the output window.
set list;
object obj;
list = SEL.All();
obj = list.First();
while (obj) {
obj.ShowFullName();
obj = list.Next();
}

Clear
Clears (deletes) the selection.
void SetSelect.Clear()

601
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example clears the set from the previous content, then adds all loads in the
general DPL selection.
set loads;
loads = SEL.AllLoads();
MySelection.Clear();
MySelection.AddRef(loads);

GetAll*
Returns all objects in the selection which are of the class 'ClassName'.
set SetSelect.GetAll(string ClassName)

A RGUMENTS
ClassName
The object class name.

R ETURNS
The set of objects

E XAMPLE
The following example writes all three winding transformers in the general DPL selection to
the output window.
set list;
object transformer;
list = SEL.GetAll('ElmTr3');
transformer = list.First();
while (transformer) {
transformer.ShowFullName();
transformer = list.Next();
}

3.5.16 SetTboxconfig
Overview

Check
GetAvailableButtons
GetDisplayedButtons
Purge
SetDisplayedButtons

602
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Check
Checks buttons to be displayed for invalid or duplicate ids and prints error messages.
int SetTboxconfig.Check()

R ETURNS
0 No errors found.
1 Errors found.

GetAvailableButtons
Gets buttons available for selected tool bar.
string SetTboxconfig.GetAvailableButtons()

R ETURNS
String ids of all buttons available for selected tool bar; ids are separated by '\n'.

GetDisplayedButtons
Gets buttons configured to be displayed in selected tool bar.
string SetTboxconfig.GetDisplayedButtons()

R ETURNS
String ids of all buttons configured to be displayed in selected tool bar; ids are separated by
'\n'.

Purge
Purges buttons to be displayed from invalid or duplicate ids.
int SetTboxconfig.Purge()

R ETURNS
0 No problems found.
1 Configuration was adapted.

SetDisplayedButtons
Sets buttons to be displayed in selected tool bar. Purges given buttons from invalid or duplicate
buttons (duplicate separators or breaks are kept).
int SetTboxconfig.SetDisplayedButtons(string buttonIds)

A RGUMENTS
buttonIds String ids of all buttons to be set as displayed buttons; ids have to be separated
by '\n'

603
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Given buttons were stored without modification.
1 Given buttons were purged from invalid or duplicate ids.

3.5.17 SetTime
Overview

Date
SetTime
SetTimeUTC
Time

Date
Sets date component to current system date.
void SetTime.Date()

E XAMPLE
The following example sets the study time of active project to current date:
object studytime;
studytime = GetFromStudyCase('SetTime');
studytime.Date();

S EE ALSO

SetTime.Time(), SetTime.SetTimeUTC()

SetTime
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.
void SetTime.SetTime(double H,
[double M,]
[double S]
)

A RGUMENTS
H The hours
M (optional)
The minutes
S (optional)
The seconds

E XAMPLE
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 48th day of the year.

604
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

object studytime;
studytime = GetFromStudyCase('SetTime');
studytime.SetTime(1134.45, 91.2, 675.3);

SetTimeUTC
Sets date and time to given time. The time must be given in UTC format as seconds since
01.01.1970 00:00 GMT.
void SetTime.SetTimeUTC(int time)

A RGUMENTS
time UTC time in seconds since 01.01.1970 00:00 GMT

E XAMPLE
Example demonstrates how to change date and time of active study case:
object studytime;
studytime = GetFromStudyCase('SetTime');
studytime.SetTimeUTC(1200478788); !Wed, 16 Jan 2008 10:19:48 GMT

S EE ALSO

SetTime.Date(), SetTime.Time()

Time
Sets time component to current system time.
void SetTime.Time()

E XAMPLE
The following example sets the study time of active project to current time:
object studytime;
studytime = GetFromStudyCase('SetTime');
studytime.Time();

S EE ALSO

SetTime.Date(), SetTime.SetTimeUTC()

605
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

3.5.18 SetUser
Overview

GetNumProcesses*

GetNumProcesses*
This function returns the actual number of processes for parallel computation.
int SetUser.GetNumProcesses()

R ETURNS
The actual number of processes for parallel computation.

E XAMPLE
The following example obtains the number of processes used by Parallel Contingency Anal-
ysis.
object oComSimoutage;
object oUserSetting;
int numProcesses;
oComSimoutage = GetCaseObject('ComSimOutage');
oUserSetting = oComSimoutage:e:parallelSetting;

if (oUserSetting = NULL) {
Error('No user setting object found.');
exit();
}
numProcesses = oUserSetting.GetNumProcesses();
Info('%d processes will be used in parallel computation.', numProcesses);

3.5.19 SetVipage
Overview

Close
DoAutoScaleX
DoAutoScaleY
GetOrInsertPlot
InsertPlot
MigratePage
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetStyle
SetTile
SetXVar
Show

606
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Close
Closes the graphic page, if currently shown, and deletes it from the database.
int SetVipage.Close()

R ETURNS
0 On success, no error occurred.
1 Otherwise

DoAutoScaleX
Scales the x-axes of all plots on the virtual instrument panel automatically.
void SetVipage.DoAutoScaleX()

E XAMPLE
The following example looks for a page named voltage and performs an automatic scaling of
the x-axes.
object page;
object graphBoard;
! Look for opened graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1);
if (page) {
page.DoAutoScaleX();
}
}

DoAutoScaleY
Scales the y-axes of all plots on the virtual instrument panel automatically.
void SetVipage.DoAutoScaleY()

E XAMPLE
The following example looks for a page named voltage and performs an automatic scaling of
the y-axes.
object page;
object graphBoard;
graphBoard=GetGraphicsBoard();
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1);
if (page) {
page.DoAutoScaleY();
}
}

607
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

GetOrInsertPlot
Get or create a virtual instrument of the virtual instrument panel.
object SetVipage.GetOrInsertPlot (string name,
[string class,]
[int create]
)

D EPRECATED N AMES
GetVI

A RGUMENTS
name Name of virtual instrument
class='VisPlot' (optional)
classname of virtual instrument.
create (optional)
Possible values:
0 do not create new virtual instrument
1 create virtual instrument if it does not exist already

R ETURNS
Virtual instrument

E XAMPLE
The following example looks for a subplot (VisPlot) named RST on a virtual instrument panel.
The plot is created if it was not found.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop
if (graphBoard) {
! Get Virtual Instrument Panel named 'Voltage'
page=graphBoard.GetPage('Voltage',1);
if (page) {
! Get plot named RST. Create the plot if not exists
plot=page.GetOrInsertPlot('RST','VisPlot',1);
}
}

InsertPlot
Creates a copy of the virtual instrument passed and displays the copy on this panel.
object SetVipage.InsertPlot(object vi)

D EPRECATED N AMES
CreateVI

A RGUMENTS
vi The virtual instrument which will be copied. Only virtual instruments are allowed
(classname 'Vis*').

608
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
Returns the created virtual instrument.

E XAMPLE
The following example creates a copy of the plot stored inside the script on page 'Page 1'.
object desktop; ! graphics board
object page; ! page
object newPlot; ! plot created by InsertPlot

desktop = GetGraphicsBoard();
page = desktop.GetPage('Page 1',1); ! get panel, create if not there
newPlot = page.InsertPlot(plot); ! copy of the plot stored inside ComDpl
newPlot.ShowFullName(); ! report full name of the created plot

MigratePage
Converts this SetVipage to the new plot framework introduced in PowerFactory 2021, creating
a GrpPage:

• The original SetVipage will remain unchanged


• The created GrpPage will initially be hidden. Use GrpPage.Show() to make it visible.

void SetVipage.MigratePage()

R ETURNS
The migrated plot page (GrpPage)

E XAMPLE
The following example looks for a SetVipage named 'Plot Generators' , migrates it, and makes
the migrated GrpPage visible.
object graphicsBoard;
object setVipage, grpPage;
graphicsBoard = GetGraphicsBoard();
if (graphicsBoard) {
setVipage = graphicsBoard.GetPage('Plot Generators', 0);
if (setVipage) {
grpPage = setVipage.MigratePage();
grpPage.Show();
}
}

SetAdaptX
Sets the Adapt Scale option of the x-scale.
void SetVipage.SetAdaptX(int mode,
[double trigger]
)

609
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mode Possible values:
0 off
1 on

trigger (optional)
Trigger value, unused if mode is off or empty

E XAMPLE
The following examples look for a virtual instrument panel named 'Voltage' and sets its adapt
scale option.
object page;
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1);! Get panel named 'Voltage'
if (page) {
! Turn on adapt scale, use a trigger value of 3
page.SetAdaptX(1,3);
! Turn off adapt scale
page.SetAdaptX(0,3);
! Turn on adapt scale again, do not change the trigger value
page.SetAdaptX(1);
}
}

SetAutoScaleX
Sets automatic scaling mode of the x-scale. A warning is issued if an invalid mode is passed to
the function.
void SetVipage.SetAutoScaleX(int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

E XAMPLE
The following examples look for a virtual instrument panel named 'Voltage' and change its
Auto Scale setting to Off.
! Set Auto Scale to Off
object page;
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
! Set new limits to change x-scale of page to used scale
page.SetScaleX(0,10);

610
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

page.SetAutoScaleX(0); ! Turn off automatic scaling


}
}

SetResults
Sets default results object of virtual instrument panel.
void SetVipage.SetResults(object res)

A RGUMENTS
res Result object to set or NULL to reset. Valid result object is any of class ElmRes,
IntComtrade and IntComtradeset.

E XAMPLE
The following example looks for a virtual instrument panel named 'Voltage' and resets its
default results.
object graphBoard;
object page;
! Look for open graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
! Get Virtual Instrument Panel named Voltage
page=graphBoard.GetPage('Voltage',1);
if (page) {
page.SetResults(nullptr);! reset default results
}
}

SetScaleX
Sets x-axis scale. A function call without arguments sets the Auto Scale setting to On without
changing the scale itself.
void SetVipage.SetScaleX()
void SetVipage.SetScaleX(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

611
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following examples look for a virtual instrument panel named 'Voltage' and sets the x-
axis variable. There are three different examples. 1. Example: Set 'Auto Scale' of x axis to
'On'. 2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and
maximum to 1000. Changes to a logarithmic scale.
object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Get Virtual Instrument Panel named Voltage
page=graphBoard.GetPage('Voltage',1);
if (page) {
page.SetScaleX();! Automatic Scaling to On
}
}

! Set minimum and maximum without changing linear/log


object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Get Virtual Instrument Panel named Voltage
page=graphBoard.GetPage('Voltage',1);
if (page) {
! Set minimum and maximum
page.SetScaleX(0,20);
}
}

! Set minimum and maximum, change to logarithmic scale


object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
! Get Virtual Instrument Panel named Voltage
page=graphBoard.GetPage('Voltage',1);
if (page) {
! Set minimum and maximum, change to log. scale
page.SetScaleX(1,1000,1);
}
}

SetStyle
Sets style of virtual instrument panel. A warning message is issued in the case that a style with
the given name does not exist.
void SetVipage.SetStyle(string name)

A RGUMENTS
name Style Name

612
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

SetTile
Rearranges the virtual instrument on the panel.
void SetVipage.SetTile([int tile])

A RGUMENTS
tile=1 (optional) tile =0 arrange virtual instruments automatically (like tiles)
tile=1 arrange them horizontally

E XAMPLE
The following example looks for a virtual instrument panel named 'Voltage' and rearranges
the Virtual Instrument.
object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
! Get Virtual Instrument Panel named 'Voltage'
page=graphBoard.GetPage('Voltage',1);
if (page) {
! Arrange vis horizontally (default input parameter is 1)
page.SetTile();
}
}

SetXVar
Sets x-axis variable. If The default x-axis variable (time) is set if no argument is passed.
void SetVipage.SetXVar()
void SetVipage.SetXVar(object obj,
string varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

E XAMPLE
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 panel. The second one
sets the default x-axis (in simulation: time).
! set x-axis variable 'm:U1:bus1' of object line
object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'
if (page) {
! Set x-scale variable
page.SetXVar(line,'m:U1:bus1');

613
3.6. OTHERS CHAPTER 3. OBJECT METHODS

}
}

! set default x-axis variable


object graphBoard;
object page;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'
if (page) {
! Set default x-scale variable (time)
page.SetXVar();
}
}

Show
Displays the plot page in the graphics board.
int SetVipage.Show()

R ETURNS
0 On success, no error occurred.
1 Otherwise

3.6 Others

3.6.1 BlkDef
Overview

Check
Compile
Encrypt
GetCheckSum
Pack
PackAsMacro
ResetThirdPartyModule
SetThirdPartyModule

Check
Verify the DSL model equations.
int BlkDef.Check()

R ETURNS
0 BlkDef is OK.
1 Error during parsing.
2 Compiled model, no check is possible.

614
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Compile
Compiles the model to a DLL. Can be called on an already compiled model. A study case of a
project has to be active.
void BlkDef.Compile([string modelPath])

A RGUMENTS
modelPath (optional)
Full path to a location where the model should be stored. Leave empty to use
default.

Encrypt
Encrypts this block definition. It has to be packed as macro before.
int BlkDef.Encrypt([int removeObjectHistory])

A RGUMENTS
removeObjectHistory (optional)
H andling of unencrypted object history in database, e.g. used by project versions
or by undo:
0 Do not remove.
1 Do remove (default).
2 Show dialog and ask.

R ETURNS
0 On success.
1 On error.

S EE ALSO

BlkDef.PackAsMacro()

GetCheckSum
string BlkDef.GetCheckSum()

D EPRECATED N AMES
CalculateCheckSum

R ETURNS
The checksum of the block definition (0000-0000-0000-0000 for frames).

Pack
Copies all used macros (i.e. referenced BlkDef) to this block.
int BlkDef.Pack()

615
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

PackAsMacro
Collects all equations, stores them to this model and deletes block diagram and all macro
references.
int BlkDef.PackAsMacro()

R ETURNS
0 On success.
1 On error.

S EE ALSO

BlkDef.Encrypt()

ResetThirdPartyModule
Resets the third party licence. Only possible for non-encrypted, non-compiled blocks. Requires
masterkey licence for third party module currently set.
int BlkDef.ResetThirdPartyModule()

R ETURNS
0 On success.
1 On error.

SetThirdPartyModule
Sets the third party licence to a specific value. Only possible for non-encrypted, non-compiled
blocks with no third party licence set so far. Requires masterkey licence for third party module
to be set.
int BlkDef.SetThirdPartyModule(string companyCode,
string moduleCode
)

A RGUMENTS
companyCode
D isplay name or numeric value of company code.
moduleCode
D isplay name or numeric value of third party module.

R ETURNS
0 On success.
1 On error.

616
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.2 BlkSig
Overview

GetFromSigName
GetToSigName

GetFromSigName
string BlkSig.GetFromSigName()

R ETURNS
The name of the output from which the signal is connected. In cases of no connection, an
empty string.

GetToSigName
string BlkSig.GetToSigName()

R ETURNS
The name of the input to which the signal is connected. In cases of no connection, an empty
string.

3.6.3 ChaVecfile
Overview

Update

Update
Reloads the file from disk. Same behaviour like button update.
int ChaVecfile.Update([int msgOn = 0])

A RGUMENTS
msgOn (optional)
Reporting of errors:
0 No error message is shown in case that the file can not be loaded
(default).
1 Emit an error message in case that the file can not be loaded.

R ETURNS
The number of samples (rows) read from the file.

617
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.4 CimArchive
Overview

ConvertToBusBranch

ConvertToBusBranch
Performs the conversion of CimModels in the selected CimArchive to Bus-Branch model repre-
sentation.
void CimArchive.ConvertToBusBranch()

E XAMPLE
This example converts a CimArchive to a Bus-Branch model. The CimArchive is selected in
the archive variable in External Objects.
archive.ConvertToBusBranch();

3.6.5 CimModel
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetModelsReferencingThis
GetParameterCount
GetParameterNamespace
GetParameterValue
HasParameter
RemoveParameter
SetAssociationValue
SetAssociationValue
SetAttributeEnumeration
SetAttributeEnumeration
SetAttributeValue
SetAttributeValue

DeleteParameterAtIndex
Removes the parameter (attribute, or association) value at the given index.
void CimModel.DeleteParameterAtIndex(string parameter, int index)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.profile”)

index Index of the parameter

E XAMPLE
This example deletes the ”Model.profile” parameter of the CimModel at index 1. The Cim-
Model is selected in the model variable in External Objects.

618
3.6. OTHERS CHAPTER 3. OBJECT METHODS

model.DeleteParameterAtIndex('Model.profile', 1);

GetAttributeEnumerationType
Returns the enumeration type of the attribute.
string CimModel.GetAttributeEnumerationType(string attribute)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”GeneratingUnit.genControlSource”)

GetModelsReferencingThis
Returns all CIM models (CimModel) that reference the calling model.
set CimModel.GetModelsReferencingThis()

R ETURNS
CIM models that reference the calling model. The order of the set is undefined.

E XAMPLE
This example prints the profile of CIM models referencing a selected CimModel. The Cim-
Model is selected in the model variable in External Objects.
set cimModels;
object cimModel;

cimModels = model.GetModelsReferencingThis();
for (cimModel = cimModels.First(); cimModel; cimModel = cimModels.Next()) {
Info(cimModel.GetParameterValue('Model.profile'));
}

GetParameterCount
Returns the number of parameters (attribute, or association) of given type.
int CimModel.GetParameterCount(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.profile”)

E XAMPLE
This example prints the ”Model.profile” attributes for all CIM models from the active project.
set cimModels;
object project, cimModel;
string profile;
int nProfiles, i;

619
3.6. OTHERS CHAPTER 3. OBJECT METHODS

project = GetActiveProject();
cimModels = project.GetContents('*.CimModel', 1);
for (cimModel = cimModels.First(); cimModel; cimModel = cimModels.Next()) {
nProfiles = cimModel.GetParameterCount('Model.profile');
Info('Model: %o has %d profiles', cimModel, nProfiles);
for (i = 0; i < nProfiles; i = i + 1) {
profile = cimModel.GetParameterValue('Model.profile', i);
Info('Profile:%d = %s', i, profile);
}
}

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
string CimModel.GetParameterNamespace(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.created”)

E XAMPLE
This example prints the namespace of the ”Model.created” parameter for the CimModel that
is selected in the model variable in External Objects.
string namespace;

namespace = model.GetParameterNamespace('Model.created');
Info(namespace);

GetParameterValue
Returns the value of the parameter (attribute, or association) at the given index if available. If the
parameter (attribute, or association) is not available, or the index is out of bounds the function
returns an empty string.
string CimModel.GetParameterValue(string parameter, [int index])

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.modelingAuthoritySet”)
index Index of the parameter:
0 Default index

E XAMPLE
This example prints the ”Model.modelingAuthoritySet” parameter for a CimModel. The Cim-
Model is selected in the model variable in External Objects.
string modelAuthoritySet;

modelAuthoritySet = model.GetParameterValue('Model.modelingAuthoritySet');
Info(modelAuthoritySet);

620
3.6. OTHERS CHAPTER 3. OBJECT METHODS

HasParameter
Checks whether the CimModel has the parameter (attribute, or association) specified.
int CimModel.HasParameter(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.modelingAuthoritySet”)

R ETURNS
1 if parameter is specified
0 if parameter is not specified

E XAMPLE
This example checks if a selected CimModel contains the ”Model.scenarioTime” parameter.
The CimModel is selected in the model variable in External Objects.
int hasParameter;

hasParameter = model.HasParameter('Model.scenarioTime');
if (hasParameter = 1) {
Info('Parameter exists');
} else {
Info('Parameter does not exist');
}

RemoveParameter
Removes all occurrences of the parameter (attribute, or association).
void CimModel.RemoveParameter(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.scenarioTime”)

E XAMPLE
This example removes the ”Model.scenarioTime” parameter from all CIM models from the
active project.
set cimModels;
object project, cimModel;

project = GetActiveProject();
cimModels = project.GetContents('*.CimModel', 1);
for (cimModel = cimModels.First(); cimModel; cimModel = cimModels.Next()) {
cimModel.RemoveParameter('Model.scenarioTime');
}

621
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAssociationValue
Adds the association if not available yet, and sets its value at the given index. If the association
is already added, the function sets a new value at the given index only.
void CimModel.SetAssociationValue(string association,
string value,
[int index])

A RGUMENTS
association
Full-name specifier of the association (e.g. ”Model.DependentOn”)
value Value of the association

index Index of the association:


0 Default index

E XAMPLE
This example sets the ”Model.DependentOn” parameter at index 1 for a selected CimModel.
The CimModel is selected in the model variable in External Objects.
string dependentOnId;

dependentOnId = '21df3d4d-3f82-4998-be21-772e3d2d573f';
model.SetAssociationValue('Model.DependentOn', dependentOnId, 1);

SetAssociationValue
Adds the association if not available yet, and sets its namespace and value. If the association
is already added, the function sets its namespace and value only.
void CimModel.SetAssociationValue(string association,
string value,
string nspace)

A RGUMENTS
attribute Full-name specifier of the association (e.g. ”Model.DependentOn”)
value Value of the association

nspace Namespace of the association (e.g. ”md”)

E XAMPLE
This example sets the ”Model.DependentOn” parameter for a selected CimModel. The Cim-
Model is selected in the model variable in External Objects.
string dependentOnId;

dependentOnId = '21df3d4d-3f82-4998-be21-772e3d2d573f';
model.SetAssociationValue('Model.DependentOn', dependentOnId, 'md');

622
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its enumeration type and value. If the attribute is
already added, the function sets its enumeration type and value only.
void CimModel.SetAttributeEnumeration(string attribute,
string enumerationType,
string value)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”GeneratingUnit.genControlSource”)
enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)

value Value of the enumeration (e.g. ”offAGC”)

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its namespace, enumeration type and value.
If the attribute is already added, the function sets its namespace, enumeration type and value
only.
void CimModel.SetAttributeEnumeration(string attribute,
string enumerationType,
string value,
string nspace)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”GeneratingUnit.genControlSource”)

enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)
value Value of the attribute (e.g. ”offAGC”)
nspace Namespace of the attribute (e.g. ”cim”)

SetAttributeValue
Adds the attribute if not available yet, and sets its value at the given index. If the attribute is
already added, the function sets a new value at the given index only.
void CimModel.SetAttributeValue(string attribute,
string value,
[int index])

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”Model.modelingAuthoritySet”)
value Value of the attribute

index Index of the attribute:


0 Default index

623
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
This example sets the ”Model.profile” parameter at index 2 for a selected CimModel. The
CimModel is selected in the equipmentModel variable in External Objects.
string equipmentShortCircuit;

equipmentShortCircuit = 'http://entsoe.eu/CIM/EquipmentShortCircuit/3/1';
equipmentModel.SetAttributeValue('Model.profile', equipmentShortCircuit, 2);

SetAttributeValue
Adds the attribute if not available yet, and sets its namespace and value. If the attribute is
already added, the function sets its namespace and value only.
void CimModel.SetAttributeValue(string attribute,
string value,
string nspace)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”Model.modelingAuthoritySet”)

value Value of the attribute


nspace Namespace of the attribute (e.g. ”md”)

E XAMPLE
This example sets the ”Model.modelingAuthoritySet” parameter for all CIM models from the
active project.
set cimModels;
object project, cimModel;

project = GetActiveProject();
cimModels = project.GetContents('*.CimModel', 1);
for (cimModel = cimModels.First(); cimModel; cimModel = cimModels.Next()) {
cimModel.SetAttributeValue('Model.modelingAuthoritySet', 'mas', 'md');
}

3.6.6 CimObject
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetObjectsReferencingThis
GetObjectsWithSameId
GetParameterCount
GetParameterNamespace
GetParameterValue
GetPfObjects
HasParameter
RemoveParameter

624
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAssociationValue
SetAssociationValue
SetAttributeEnumeration
SetAttributeEnumeration
SetAttributeValue
SetAttributeValue

DeleteParameterAtIndex
Removes the parameter (attribute, or association) value at the given index.
void CimObject.DeleteParameterAtIndex(string parameter, int index)

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”TopologicalIsland.TopologicalNodes”)
index Index of the parameter

E XAMPLE
This example removes all ”TopologicalIsland.TopologicalNodes” parameters values from all
”TopologicalIsland” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string topoNodesParameter, cimClass;
int isTopologicalIsland, nNodes, i;

project = GetActiveProject();
topoNodesParameter = 'TopologicalIsland.TopologicalNodes';
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isTopologicalIsland = strcmp(cimClass, 'TopologicalIsland');
if (isTopologicalIsland = 0) {
nNodes = cimObject.GetParameterCount(topoNodesParameter);
Info('TP-island %o has %d TP-nodes', cimObject, nNodes);
for (i = nNodes; i >= 0; i = i - 1) {
cimObject.DeleteParameterAtIndex(topoNodesParameter, i);
}
}
}

GetAttributeEnumerationType
Returns the enumeration type of the attribute.
string CimObject.GetAttributeEnumerationType(string attribute)

A RGUMENTS
attribute Full-name of the attribute (e.g. ”SynchronousMachine.shortCircuitRotorType”)

E XAMPLE
This example prints the enumeration type of the ”SynchronousMachine.shortCircuitRotorType”
attribute of a ”SynchronousMachine” CimObject. The CimObject is selected in the cimObject
variable in External Objects.

625
3.6. OTHERS CHAPTER 3. OBJECT METHODS

string attributeName, enumerationType;

attributeName = 'SynchronousMachine.shortCircuitRotorType';
enumerationType = cimObject.GetAttributeEnumerationType(attributeName);
Info(enumerationType);

GetObjectsReferencingThis
Returns all CIM objects (CimObject) that reference the calling object. The set of objects returned
is also determined by the DependentOn and Supersedes references set in parent CIM model
objects. In order for a CIM object to reference another CIM object, the parent CIM model of the
former object has to hold a reference to the parent CIM model of the later object.
set CimObject.GetObjectsReferencingThis()

R ETURNS
CIM objects that reference the calling object. The order of the set is undefined.

E XAMPLE
This example prints all CIM objects which reference the ”SynchronousMachine” CimObject.
The SynchronousMachine is selected in the machine variable in External Objects.
set cimObjects;
object cimObject;

cimObjects = machine.GetObjectsReferencingThis();
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
Info('%o', cimObject);
}

GetObjectsWithSameId
Returns all CIM objects (CimObject) that have the same Resource ID as this object.
set CimObject.GetObjectsWithSameId()

R ETURNS
CIM objects that have the same Resource ID as this object.

E XAMPLE
This example prints all CIM objects with the same CIM RDF ID as the ”SynchronousMa-
chine” CimObject. The SynchronousMachine is selected in the machine variable in External
Objects.
set cimObjects;
object cimObject;

cimObjects = machine.GetObjectsWithSameId();
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
Info('%o', cimObject);
}

626
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetParameterCount
Returns the number of parameters (attribute, or association) of given type.
int CimObject.GetParameterCount(string parameter)

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”TopologicalIsland.TopologicalNodes”)

E XAMPLE
This example prints the IDs of all ”TopologicalNode” CIM objects from all ”TopologicalIsland”
CIM objects in the active project.
set cimObjects;
object project, cimObject;
string topoNodesParameter, cimClass, nodeId;
int isTopologicalIsland, nNodes, i;

project = GetActiveProject();
topoNodesParameter = 'TopologicalIsland.TopologicalNodes';
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isTopologicalIsland = strcmp(cimClass, 'TopologicalIsland');
if (isTopologicalIsland = 0) {
nNodes = cimObject.GetParameterCount(topoNodesParameter);
Info('TP-island %o has %d TP-nodes', cimObject, nNodes);
for (i = 0; i < nNodes; i = i + 1) {
nodeId = cimObject.GetParameterValue(topoNodesParameter, i);
Info('CIM RDF ID of TP-node %d is: %s', i, nodeId);
}
}
}

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
string CimObject.GetParameterNamespace(string parameter)

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”IdentifiedObject.name”)

E XAMPLE
This example prints the namespace of the ”IdentifedObject.name” parameter of a CimObject.
The CimObject is selected in the acLineSegment variable in External Objects.
string namespace;

namespace = acLineSegment.GetParameterNamespace('IdentifiedObject.name');
Info(namespace);

627
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetParameterValue
Returns the value of the parameter (attribute, or association) at the given index if available. If the
parameter (attribute, or association) is not available, or the index is out of bounds the function
returns an empty string.
string CimObject.GetParameterValue(string parameter, [int index])

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”IdentifiedObject.name”)

index Index of the parameter:


0 Default index

E XAMPLE
This example prints the ”IdentifedObject.name” parameter of a selected CimObject. The
CimObject is selected in the cimObject variable in External Objects.
string name;

name = cimObject.GetParameterValue('IdentifiedObject.name');
Info(name);

GetPfObjects
Returns all PF objects that have the same Resource ID as this CIM object.
set CimObject.GetPfObjects()

R ETURNS
PF objects that have the same Resource ID as this CIM object.

E XAMPLE
This example prints all PowerFactory objects with the same CIM RDF ID as the ”Synchronous-
Machine” CimObject. The SynchronousMachine is selected in the machine variable in Exter-
nal Objects.
set pfObjects;
object pfObject;

pfObjects = machine.GetPfObjects();
for (pfObject = pfObjects.First(); pfObject; pfObject = pfObjects.Next()) {
Info('%o', pfObject);
}

HasParameter
Checks whether the CimObject has the parameter (attribute, or association) specified.
int CimObject.HasParameter(string parameter)

628
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”IdentifiedObject.name”)

R ETURNS
1 if parameter is specified
0 if parameter is not specified

E XAMPLE
This example checks if a CimObject contains the ”IdentifiedObject.name” parameter. The
CimObject is selected in the cimObject variable in External Objects.
int hasParameter;

hasParameter = cimObject.HasParameter('IdentifiedObject.name');
if (hasParameter = 1) {
Info('Parameter exists.');
} else {
Info('Parameter does not exist.');
}

RemoveParameter
Removes all occurrences of the parameter (attribute, or association).
void CimObject.RemoveParameter(string parameter)

A RGUMENTS
parameter
Full-name of the attribute, or association (e.g. ”SynchronousMachine.shortCircuitRotorType”)

E XAMPLE
This example removes the ”SynchronousMachine.shortCircuitRotorType” parameter from all
”SynchronousMachine” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string cimClass;
int isSynchronousMachine;

project = GetActiveProject();
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isSynchronousMachine = strcmp(cimClass, 'SynchronousMachine');
if (isSynchronousMachine = 0) {
cimObject.RemoveParameter('SynchronousMachine.shortCircuitRotorType');
}
}

629
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAssociationValue
Adds the association if not available yet, and sets its value at the given index. If the association
is already added, the function sets a new value at the given index only.
void CimObject.SetAssociationValue(string association,
string value,
[int index])

A RGUMENTS
association
Full-name of the association (e.g. ”Equipment.EquipmentContainer”)
value Value of the association

index Index of the association:


0 Default index

SetAssociationValue
Adds the association if not available yet, and sets its namespace and value. If the association
is already added, the function sets its namespace and value only.
void CimObject.SetAssociationValue(string association,
string value,
string nspace)

A RGUMENTS
attribute Full-name of the association (e.g. ”NonConformLoad.LoadGroup”)
value Value of the association
nspace Namespace of the association (e.g. ”cim”)

E XAMPLE
This example adds the missing association ”NonConformLoad.LoadGroup” on ”NonConform-
Load” CIM objects in the active project. The association is set to the object defined in the
loadGroup variable in External Objects.
set cimObjects;
object project, cimObject;
string loadGroupId, loadGroupParameter, cimClass;
int isNonConformLoad, isConcrete, hasLoadGroup;

project = GetActiveProject();
loadGroup.GetVal(loadGroupId, 'resID');
loadGroupParameter = 'NonConformLoad.LoadGroup';
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isNonConformLoad = strcmp(cimClass, 'NonConformLoad');
if (isNonConformLoad = 0) {
cimObject.GetVal(isConcrete, 'about');
if (isConcrete = 0) {
hasLoadGroup = cimObject.HasParameter(loadGroupParameter);
if (hasLoadGroup = 0) {
cimObject.SetAssociationValue(loadGroupParameter, loadGroupId, 'cim');

630
3.6. OTHERS CHAPTER 3. OBJECT METHODS

}
}
}
}

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its enumeration type and value. If the attribute is
already added, the function sets its enumeration type and value only.
void CimObject.SetAttributeEnumeration(string attribute,
string enumerationType,
string value)

A RGUMENTS
attribute Full-name of the attribute (e.g. ”SynchronousMachine.shortCircuitRotorType”)

enumerationType
Enumeration type of the attribute (e.g. ”ShortCircuitRotorKind”)
value Value of the enumeration (e.g. ”salientPole1”)

E XAMPLE
This example adds the missing attribute ”SynchronousMachine.shortCircuitRotorType” on
”SyncronousMachine” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string cimClass, parameter, type, value;
int isSyncMachine, isConcrete, hasParameter;

parameter = 'SynchronousMachine.shortCircuitRotorType';
type = 'ShortCircuitRotorKind';
value = 'salientPole1';

project = GetActiveProject();
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isSyncMachine = strcmp(cimClass, 'SynchronousMachine');
if (isSyncMachine = 0) {
cimObject.GetVal(isConcrete, 'about');
if (isConcrete = 0) {
hasParameter = cimObject.HasParameter(parameter);
if (hasParameter = 0) {
cimObject.SetAttributeEnumeration(parameter, type, value);
}
}
}
}

631
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its namespace, enumeration type and value.
If the attribute is already added, the function sets its namespace, enumeration type and value
only.
void CimObject.SetAttributeEnumeration(string attribute,
string enumerationType,
string value,
string nspace)

A RGUMENTS
attribute Full-name of the attribute (e.g. ”SynchronousMachine.shortCircuitRotorType”)
enumerationType
Enumeration type of the attribute (e.g. ”ShortCircuitRotorKind”)
value Value of the attribute (e.g. ”salientPole1”)
nspace Namespace of the attribute (e.g. ”cim”)

E XAMPLE
This example adds the missing attribute ”SynchronousMachine.shortCircuitRotorType” on
”SyncronousMachine” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string cimClass, parameter, type, value, namespace;
int isSyncMachine, isConcrete, hasParameter;

parameter = 'SynchronousMachine.shortCircuitRotorType';
type = 'ShortCircuitRotorKind';
value = 'salientPole1';
namespace = 'cim';

project = GetActiveProject();
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isSyncMachine = strcmp(cimClass, 'SynchronousMachine');
if (isSyncMachine = 0) {
cimObject.GetVal(isConcrete, 'about');
if (isConcrete = 0) {
hasParameter = cimObject.HasParameter(parameter);
if (hasParameter = 0) {
cimObject.SetAttributeEnumeration(parameter, type, value, namespace);
}
}
}
}

SetAttributeValue
Adds the attribute if not available yet, and sets its value at the given index. If the attribute is
already added, the function sets a new value at the given index only.
void CimObject.SetAttributeValue(string attribute,
string value,
[int index])

632
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
attribute Full-name of the attribute (e.g. ”IdentifiedObject.name”)
value Value of the attribute
index Index of the attribute:
0 Default index

E XAMPLE
This example adds the prefix ”Load ” to the ”IdentifiedObjet.name” attribute for all concrete
”NonConformLoad” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string cimClass, oldName, newName;
int isNonConformLoad, isConcrete;

project = GetActiveProject();
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isNonConformLoad = strcmp(cimClass, 'NonConformLoad');
if (isNonConformLoad = 0) {
cimObject.GetVal(isConcrete, 'about');
if (isConcrete = 0) {
oldName = cimObject.GetParameterValue('IdentifiedObject.name');
newName = sprintf('Load_%s', oldName);
cimObject.SetAttributeValue('IdentifiedObject.name', newName);
}
}
}

SetAttributeValue
Adds the attribute if not available yet, and sets its namespace and value. If the attribute is
already added, the function sets its namespace and value only.
void CimObject.SetAttributeValue(string attribute,
string value,
string nspace)

A RGUMENTS
attribute Full-name of the attribute (e.g. ”Equipment.aggregate”)
value Value of the attribute
nspace Namespace of the attribute (e.g. ”cim”)

E XAMPLE
This example sets the ”Equipment.aggregate” attribute to ”false” for all concrete ”NonCon-
formLoad” CIM objects in the active project.
set cimObjects;
object project, cimObject;
string cimClass;
int isNonConformLoad, isConcrete;

633
3.6. OTHERS CHAPTER 3. OBJECT METHODS

project = GetActiveProject();
cimObjects = project.GetContents('*.CimObject', 1);
for (cimObject = cimObjects.First(); cimObject; cimObject = cimObjects.Next()) {
cimObject.GetVal(cimClass, 'cimClass');
isNonConformLoad = strcmp(cimClass, 'NonConformLoad');
if (isNonConformLoad = 0) {
cimObject.GetVal(isConcrete, 'about');
if (isConcrete = 0) {
cimObject.SetAttributeValue('Equipment.aggregate', 'false', 'cim');
}
}
}

3.6.7 GrpPage
Overview

ChangeStyle
DoAutoScale
DoAutoScaleX
DoAutoScaleY
GetOrInsertCurvePlot
GetOrInsertDiscreteBarPlot
GetOrInsertModalAnalysisPlot
GetOrInsertVectorPlot
GetOrInsertXYPlot
GetPlot
RemovePage
SetAutoScaleModeX
SetAutoScaleModeY
SetLayoutMode
SetResults
SetScaleTypeX
SetScaleTypeY
SetScaleX
SetScaleY
Show

ChangeStyle
Applies the plot style identified by the given name to all plots on this page.
void GrpPage.ChangeStyle(string styleName)

A RGUMENTS
styleName
Name of the style template to apply

R ETURNS
0 on success
1 on error

634
3.6. OTHERS CHAPTER 3. OBJECT METHODS

DoAutoScale
Adapts axis ranges of all plots on the page such that they show the entire data range.
void GrpPage.DoAutoScale([int axisDimension])

A RGUMENTS
axisDimension (optional)
Limits auto-scaling to one dimension. Possible values:
0 scale only x-axes
1 scale only y-axes

E XAMPLE
The following example looks for a page named 'Voltage' and performs an automatic scaling
of both the x-axes and y-axes.
object page;
object graphicsBoard;
! Look for opened graphics board.
graphicsBoard=GetGraphicsBoard();
if (graphicsBoard) {
page=graphicsBoard.GetPage('Voltage', 0);
if (page) {
page.DoAutoScale();
}
}

DoAutoScaleX
Adapts x-axis ranges of all plots on the page such that they show the entire data range.
void GrpPage.DoAutoScaleX()

DoAutoScaleY
Adapts y-axis ranges of all plots on the page such that they show the entire data range.
void GrpPage.DoAutoScaleY()

GetOrInsertCurvePlot
Finds a curve plot by name, or creates it if not found.
object GrpPage.GetOrInsertCurvePlot(string name,
[int create]
)

A RGUMENTS
name Name of plot
create=1 (optional)
Possible values:
0 do not create new plot
1 create plot if it does not exist already

635
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
PltLinebarplot object

GetOrInsertDiscreteBarPlot
Finds a discrete bar plot by name, or creates it if not found. A discrete bar plot is a PltLinebarplot
whose x-axis mode is set to 'Discrete', i.e., it shows net elements on the x-axis.
object GrpPage.GetOrInsertDiscreteBarPlot(string name,
[int create]
)

A RGUMENTS
name Name of plot

create=1 (optional)
Possible values:
0 do not create new plot
1 create plot if it does not exist already

R ETURNS
PltLinebarplot object

GetOrInsertModalAnalysisPlot
Finds a modal analysis plot by name, or creates it if not found.
object GrpPage.GetOrInsertModalAnalysisPlot(string name,
int type,
[int create]
)

A RGUMENTS
name Name of plot
type Type of modal analysis plot to create:
0 eigenvalue plot
1 mode polar plot
2 mode bar plot
create=1 (optional)
Possible values:

0 do not create new plot


1 create plot if it does not exist already

R ETURNS
PltLinebarplot (eigenvalue plot, mode bar plot) or PltVectorplot (mode polar plot)

636
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetOrInsertVectorPlot
Finds a vector plot by name, or creates it if not found.
object GrpPage.GetOrInsertVectorPlot(string name,
[int create]
)

A RGUMENTS
name Name of plot
create=1 (optional)
Possible values:
0 do not create new plot
1 create plot if it does not exist already

R ETURNS
PltVectorplot object

GetOrInsertXYPlot
Finds a XY plot by name, or creates it if not found. A XY plot is a PltLinebarplot whose x-axis
mode is set to 'XY'.
object GrpPage.GetOrInsertXYPlot(string name,
[int create]
)

A RGUMENTS
name Name of plot
create=1 (optional)
Possible values:
0 do not create new plot
1 create plot if it does not exist already

R ETURNS
PltLinebarplot object

GetPlot
Returns the plot on this page with the given name.
object GrpPage.GetPlot(string name)

A RGUMENTS
name Name of the plot to look for

R ETURNS
Plot object if found, or NULL otherwise

637
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example looks for a plot named 'RST' on the plot page named 'Voltage'.
object graphicsBoard;
object page;
object plot;
graphicsBoard=GetGraphicsBoard(); ! Look for open desktop
if (graphicsBoard) {
page=graphicsBoard.GetPage('Voltage',1);
if (page) {
plot=page.GetPlot('RST');
}
}

RemovePage
Closes the graphic page, if currently shown, and deletes it from the database.
int GrpPage.RemovePage()

SetAutoScaleModeX
Defines whether the x-axes on the page should automatically adapt their range on data changes.

void GrpPage.SetAutoScaleModeX(int mode)

A RGUMENTS
mode Possible values:
0 off (do not react to data changes)
1 adapt scale after calculation has finished
2 adapt scale during live plotting

SetAutoScaleModeY
Defines whether the y-axes on the page should automatically adapt their range on data changes.

void GrpPage.SetAutoScaleModeY(int mode)

A RGUMENTS
mode Possible values:

0 off (do not react to data changes)


1 adapt scale after calculation has finished
2 adapt scale during live plotting

638
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetLayoutMode
Defines the automatic arrangement of plots on the page.
void GrpPage.SetLayoutMode(int mode)

A RGUMENTS
mode Possible values:
0 off (do not arrange plots automatically)
1 arrange plots vertically
2 arrange plots on grid

SetResults
Sets the default results object of page.
void GrpPage.SetResults(object res)

A RGUMENTS
res Result object to set or NULL to reset. Valid result object is any of class ElmRes,
IntComtrade and IntComtradeset.

SetScaleTypeX
Sets the scale type (linear, logarithmic) of all x-axes on the page.
void GrpPage.SetScaleTypeX(int scaleType)

A RGUMENTS
scaleType
Possible values:
0 linear
1 logarithmic

SetScaleTypeY
Set the scale type (linear, logarithmic, dB) of all y-axes on the page.
void GrpPage.SetScaleTypeY(int scaleType)

A RGUMENTS
scaleType
Possible values:
0 linear
1 logarithmic
2 dB

639
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetScaleX
Sets the scale of all x-axes on the page.
void GrpPage.SetScaleX(double min,
double max
)

A RGUMENTS
min Minimum of x-scale.
max Maximum of x-scale.

E XAMPLE
The following example looks for a page named 'Voltage' and sets its x-axis range to [1.0;2.5].
object page;
object graphicsBoard;
! Look for opened graphics board.
graphicsBoard=GetGraphicsBoard();
if (graphicsBoard) {
page=graphicsBoard.GetPage('Voltage', 0);
if (page) {
page.SetScaleX(1.0, 2.5);
}
}

SetScaleY
Sets the scale of all y-axes on the page.
void GrpPage.SetScaleY(double min,
double max
)

A RGUMENTS
min Minimum of y-scale.
max Maximum of y-scale.

Show
Displays the diagram page in the graphics board.
int GrpPage.Show()

R ETURNS
0 On success, no error occurred.
1 Otherwise

640
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.8 IntAddonvars
Overview

AddDouble
AddDoubleMatrix
AddDoubleVector
AddInteger
AddIntegerVector
AddObject
AddObjectVector
AddString
RemoveParameter
SetConstraint

AddDouble
Adds a new double parameter to the Data Extension configuration object.
int IntAddonvars.AddDouble(string parameterName,
string desc,
string unitText,
double initialValue
)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter

unitText The unit of the new parameter


initialValue
The initial value of the new parameter

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

AddDoubleMatrix
Adds a new double vector parameter to the Data Extension configuration object.
int IntAddonvars.AddDoubleMatrix(string parameterName,
string desc,
int initialRows,
int initialColumns,
string unitText,
double initialValue
)

641
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter
initialRows
The initial number of rows for the matrix
initialColumns
The initial number of columns for the matrix
unitText The unit of the new parameter

initialValue
The initial value for the elements

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

AddDoubleVector
Adds a new double vector parameter to the Data Extension configuration object.
int IntAddonvars.AddDoubleVector(string parameterName,
string desc,
int initialSize,
string unitText,
double initialValue
)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter

initialSize The initial size of the vector


unitText The unit of the new parameter
initialValue
The initial value for the elements

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

642
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddInteger
Adds a new integer parameter to the Data Extension configuration object.
int IntAddonvars.AddInteger(string parameterName,
string desc,
string unitText,
int initialValue
)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter
unitText The unit of the new parameter

initialValue
The initial value of the new parameter

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

AddIntegerVector
Adds a new integer vector parameter to the Data Extension configuration object.
int IntAddonvars.AddIntegerVector(string parameterName,
string desc,
int initialSize,
string unitText,
int initialValue)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter

initialSize The initial size of the vector


unitText The unit of the new parameter
initialValue
The initial value for the elements

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

643
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddObject
Adds a new string parameter to the Data Extension configuration object.
int IntAddonvars.AddObject(string parameterName,
string desc,
string classFilter
)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter
classFilter
The filter for the objects which are allowed for selection

R ETURNS
Zero if attribute was successfully added. One based row number if there already is a param-
eter with the same name. Returns -1 if the object cannot be modified.

AddObjectVector
Adds a new object vector parameter to the Data Extension configuration object.
int IntAddonvars.AddObjectVector(string parameterName,
string desc,
int initialSize,
string classFilter
)

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter
initialSize The initial size of the vector
classFilter
The filter for the objects which are allowed for selection

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

AddString
Adds a new string parameter to the Data Extension configuration object.
int IntAddonvars.AddString(string parameterName,
string desc,
string unitText,
string initialValue
)

644
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
parameterName
The name of the new parameter
desc The description of the new parameter
unitText The unit of the new parameter

initialValue
The initial value of the new parameter

R ETURNS
0 attribute was successfully added
-1 error (object cannot be modified)
-2 error (parameter name contains illegal characters)
row error (parameter with same name already exists in returned row)

RemoveParameter
Removes the given parameter from the Data Extension configuration.
void IntAddonvars.RemoveParameter(string parameterName)

A RGUMENTS
parameterName
The name of the parameter to be removed

SetConstraint
Adds a constraint for the parameter to the Data Extension configuration object.
The arguments passed must be convertible into the configured data type for the parameter.
Upper and lower bounds are mutually exclusive with a list of values. An empty string should be
passed when a constraint should not be used or removed.
int IntAddonvars.SetConstraint(string parameterName,
string minValue,
string maxValue,
string allowedValues
)

A RGUMENTS
parameterName
The name of the parameter to be modified
minValue The minimum value

maxValue
The maximum value
allowedValues
List of the allowed values (;-separated)

645
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 ok
-1 error (parameter does not exist)
-2 error (upper/lower bounds and list of values are mutually exclusive)
-3 error (underlying type does not support constraints)
-4 error (upper/lower bounds cannot be used for strings)
-5 error (the values passed cannot be converted into the underlying type)

3.6.9 IntCase
Overview

Activate
ApplyNetworkState
ApplyStudyTime
Consolidate
Deactivate
SetStudyTime

Activate
Activates the study case. Deactivates other study cases first.
int IntCase.Activate()

R ETURNS
0 on success
1 on error

ApplyNetworkState
For a study case in a combined project, copy the network state from another case.
Copies the active grids, scenarios and network variations configuration to the current case. The
data will be added to any already existing configuration.
int IntCase.ApplyNetworkState(object other)

A RGUMENTS
other The source Study Case to copy data from

R ETURNS
0 On success
1 Source object is not an IntCase object
2 Case where function is called on is not the active case
3 Source case is not from active project
4 Source Study Case is not from a source project in a combined project
5 Other error. Details are given in an error message

646
3.6. OTHERS CHAPTER 3. OBJECT METHODS

ApplyStudyTime
For a study case in a combined project, apply the study time from another study case.
int IntCase.ApplyStudyTime(object other)

A RGUMENTS
other The source study case to copy study time from

R ETURNS
0 On success
1 Source object is not an IntCase object
2 Study case where function is called on is not the active case
3 Source case is not from active project
4 Source case is not from a project part of a combined project

Consolidate
Changes that are recorded in a project’s active Variations are permanently applied to the Net-
work Data folder (like right mouse button Consolidate Network Variation)
Note: Modified scenarios are not saved!
Works only:

• For active study cases


• If a network variation is active

int IntCase.Consolidate()

R ETURNS
0 On success
1 If an error has occured

S EE ALSO

IntScheme.Consolidate()

Deactivate
De-activates the study case.
int IntCase.Deactivate()

R ETURNS
0 on success
1 on error

SetStudyTime
Sets the current Study Case time to seconds since 01.01.1970 00:00:00. Use IntCase:iStudyTime
for getting current Study Case time.
void IntCase.SetStudyTime(int dateTime)

647
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
dateTime Seconds since 01.01.1970 00:00:00.

3.6.10 IntComtrade
Overview

ConvertToASCIIFormat*
ConvertToBinaryFormat*
FindColumn*
FindMaxInColumn*
FindMinInColumn*
GetAnalogueDescriptions
GetColumnValues*
GetDescription*
GetDigitalDescriptions
GetNumberOfAnalogueSignalDescriptions
GetNumberOfColumns*
GetNumberOfDigitalSignalDescriptions
GetNumberOfRows*
GetObjectValue*
GetSignalHeader
GetUnit*
GetValue*
GetVariable*
Load*
Release*
SortAccordingToColumn*

ConvertToASCIIFormat*
Creates new comtrade configuration and data files in ASCII format in the file system directory of
the original files. The new configuration file is linked automatically to a new IntComtrade object
created in the same PowerFactory folder like this object. An existing IntComtrade object is
already in ASCII format when its parameter ’Binary’ is set to 0.
int IntComtrade.ConvertToASCIIFormat()

R ETURNS
0 File successfully converted.
1 Error occurred, e.g. file is already in ASCII format.

ConvertToBinaryFormat*
Creates new comtrade configuration and data files in binary format in the file system directory of
the original files. The new configuration file is linked automatically to a new IntComtrade object
created in the same PowerFactory folder like this object. An existing IntComtrade object is
already in binary format when its parameter ’Binary’ is set to 1.
int IntComtrade.ConvertToBinaryFormat()

R ETURNS
0 File successfully converted.

648
3.6. OTHERS CHAPTER 3. OBJECT METHODS

1 Error occurred, e.g. file is already in binary format.

FindColumn*
Returns the first column matching the variable name.
int IntComtrade.FindColumn(string variable,
[int startCol]
)

A RGUMENTS
variable The variable name to look for.
startCol (optional)
The index of the column at which to start the search.

R ETURNS
≥0 The column index found.
<0 The column with name variable was not found.

E XAMPLE
The following example searches a variable in the first comtrade object found in the study
case.
object intComtrade;
string variable;
int index;
intComtrade = GetFromStudyCase('IntComtrade');
if (nullptr=intComtrade){
exit();
}
variable = 'U RMS Feeder 1 (c)';
intComtrade.Load();
index = intComtrade.FindColumn(variable);
printf('Column index of %s is %d',variable,index);
! this will not find the variable again, because we are starting
! the search after the match
index = intComtrade.FindColumn(variable,index+1);
printf('Column index of %s is %d',variable,index);

intComtrade.Release();

FindMaxInColumn*
Find the maximum value of the variable in the given column.
int IntComtrade.FindMaxInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The maximum value found. The value is 0. in case that the maximum value was
not found.

649
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

E XAMPLE
object case,
elmRes;
set resObjs;
int row,
column;
double value;

column = 1;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('All calculations.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (elmRes) {
elmRes.Load();
row = elmRes.FindMaxInColumn(column,value);
if (row<0) {
Info('The maximum of column %d was not found',column);
}
else {
Info('The maximum of column %d is %f (row: %d)',column, value,row);
}
row = elmRes.FindMinInColumn(column,value);
if (row<0) {
Info('The minimum of column %d was not found',column);
}
else {
Info('The minimum of column %d is %f (row: %d)',column, value,row);
}
elmRes.Release();
}

FindMinInColumn*
Find the minimum value of the variable in the given column.
int IntComtrade.FindMinInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

650
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
See example of IntComtrade.FindMaxInColumn.

GetAnalogueDescriptions
Get the descriptions of the analogue channel Please note that the comtrade info file contains
proprietary data from PFM. Info files not written by DIgSILENT PFM are not supported.
string IntComtrade.GetAnalogueDescriptions(int index)

A RGUMENTS
index Digital channel index.

R ETURNS
Descriptions for analogue channel in the comtrade info file.

GetColumnValues*
Get complete column values.
int IntComtrade.GetColumnValues(object dataVector,
int column)

A RGUMENTS
dataVector
IntVec which will be filled with column values.
column The column index. -1 for default (e.g. time).

R ETURNS
=0 Column values were found.
=1 dataVector is NULL.
=2 dataVector is not of class IntVec.
=3 Column index is out of range.

GetDescription*
Get the description of a column.
string IntComtrade.GetDescription([int column],
[int short]
)

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.
short (optional)
0 long desc. (default)
1 short description

651
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

E XAMPLE
See example of IntComtrade.GetVariable.

GetDigitalDescriptions
Get the descriptions of the digital channel Please note that the comtrade info file contains
proprietary data from PFM. Info files not written by DIgSILENT PFM are not supported.
string IntComtrade.GetDigitalDescriptions(int index)

A RGUMENTS
index Digital channel index

R ETURNS
Descriptions for digital channel in the comtrade info file.

GetNumberOfAnalogueSignalDescriptions
Gets the number of descriptions for analogue channels in the comtrade info file. Please note that
the comtrade info file contains proprietary data from PFM. Info files not written by DIgSILENT
PFM are not supported.
int IntComtrade.GetNumberOfAnalogueSignalDescriptions()

R ETURNS
Number of descriptions for analogue channels in the comtrade info file.

GetNumberOfColumns*
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int IntComtrade.GetNumberOfColumns()

R ETURNS
Number of variables (columns) in result file.

E XAMPLE
See example of IntComtrade.InitialiseWriting.

GetNumberOfDigitalSignalDescriptions
Get the number of descriptions for digital channels in the comtrade info file. Please note that
the comtrade info file contains proprietary data from PFM. Info files not written by DIgSILENT
PFM are not supported.
int IntComtrade.GetNumberOfDigitalSignalDescriptions()

652
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Number of descriptions for digital channels in the comtrade info file.

GetNumberOfRows*
Returns the number of values per column (rows) stored in result object.
int IntComtrade.GetNumberOfRows()

R ETURNS
Returns the number of values per column stored in result object.

E XAMPLE
See example of IntComtrade.InitialiseWriting.

GetObjectValue*
Returns a value from a result object for row iX of curve col.
int IntComtrade.GetObjectValue(object& o,
int iX,
[int col])

A RGUMENTS
o (out) The object retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of IntComtrade.SortAccordingToColumn.

GetSignalHeader
Get the headline of the channel section in the comtrade info file. Please note that the comtrade
info file contains proprietary data from PFM. Info files not written by DIgSILENT PFM are not
supported.
string IntComtrade.GetSignalHeader()

653
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Headline of signal descriptions

GetUnit*
Get the unit of a column.
string IntComtrade.GetUnit([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

E XAMPLE
See example of IntComtrade.GetVariable.

GetValue*
Returns a value from a result object for row iX of curve col.
int IntComtrade.GetValue(double& d,
int iX,
[int col])

A RGUMENTS
d (out) The value retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of IntComtrade.SortAccordingToColumn.

654
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetVariable*
Get variable name of column
string IntComtrade.GetVariable([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

E XAMPLE
object case,
elmRes;
string name,
unit,
short,
long;

set resObjs;
int variables,
column;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
if (variables>0) {
printf('Name; unit; Short Description; Long Description');
for (column=-1; column<variables; column+=1) {
! -1 returns default column
name = elmRes.GetVariable(column);
unit = elmRes.GetUnit(column);
short= elmRes.GetDescription(column,1);
long = elmRes.GetDescription(column);
printf('%s; %s; %s; %s', name, unit, short,long);
}
}
elmRes.Release();

Load*
Loads the data of a result object (IntComtrade) in memory for reading.
void IntComtrade.Load()

655
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
object case,
elmRes;
set resObjs;
int variables,rows;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
rows = elmRes.GetNumberOfRows();
Info('The result file %s contains %d columns and %d rows',elmRes, variables, rows);
elmRes.Release();

Release*
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
void IntComtrade.Release()

E XAMPLE
See example of IntComtrade.Load.

SortAccordingToColumn*
Sorts all rows in the data loaded according to the given column. The IntComtrade itself remains
unchanged.
int IntComtrade.SortAccordingToColumn(int column)

A RGUMENTS
col The column number.

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

E XAMPLE
The following example outputs column 1 and 2 for the first 50 rows. The output is repeated
after sorting the data according to column 1.
object case,
elmRes;

656
3.6. OTHERS CHAPTER 3. OBJECT METHODS

set resObjs;
int row,
rows,
column,
failed;
double value1, value2;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
column = 1;
rows = 50;
Info('Orginal data in first %d rows of column %d and %d',rows, column, column+1);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;
printf('%04d %f %f', row, value1, value2); ! report row starting with 1
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
failed = elmRes.SortAccordingToColumn(column);
Info('Sorted data in first %d rows in column %d and %d',rows,column, column+1);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;
printf('%04d %f %f', row, value1, value2); ! report row starting with 1
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
elmRes.Release();

657
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.11 IntComtradeset
Overview

FindColumn*
FindMaxInColumn*
FindMinInColumn*
GetAnalogueDescriptions
GetColumnValues*
GetDescription*
GetDigitalDescriptions
GetNumberOfAnalogueSignalDescriptions
GetNumberOfColumns*
GetNumberOfDigitalSignalDescriptions
GetNumberOfRows*
GetObjectValue*
GetSignalHeader
GetUnit*
GetValue*
GetVariable*
Load*
Release*
SortAccordingToColumn*

FindColumn*
Returns the first column matching the variable name.
int IntComtradeset.FindColumn(string variable,
[int startCol]
)

A RGUMENTS
variable The variable name to look for.
startCol (optional)
The index of the column at which to start the search.

R ETURNS
≥0 The column index found.
<0 The column with name variable was not found.

E XAMPLE
The following example searches a variable in the first comtrade object found in the study
case.
object intComtradeset;
string variable;
int index;
intComtradeset = GetFromStudyCase('IntComtradeset');
if (nullptr=intComtradeset){
exit();
}
variable = 'U Step-Up T1 (c)';
intComtradeset.Load();
index = intComtradeset.FindColumn(variable);
printf('Column index of %s is %d',variable,index);

658
3.6. OTHERS CHAPTER 3. OBJECT METHODS

! this will not find the variable again, because we are starting
! the search after the match
index = intComtradeset.FindColumn(variable,index+1);
printf('Column index of %s is %d',variable,index);
intComtradeset.Release();

FindMaxInColumn*
Find the maximum value of the variable in the given column.
int IntComtradeset.FindMaxInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The maximum value found. The value is 0. in case that the maximum value was
not found.

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

E XAMPLE
object case,
elmRes;
set resObjs;
int row,
column;
double value;

column = 1;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('All calculations.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (elmRes) {
elmRes.Load();
row = elmRes.FindMaxInColumn(column,value);
if (row<0) {
Info('The maximum of column %d was not found',column);
}
else {
Info('The maximum of column %d is %f (row: %d)',column, value,row);
}
row = elmRes.FindMinInColumn(column,value);
if (row<0) {
Info('The minimum of column %d was not found',column);
}
else {
Info('The minimum of column %d is %f (row: %d)',column, value,row);
}
elmRes.Release();
}

659
3.6. OTHERS CHAPTER 3. OBJECT METHODS

FindMinInColumn*
Find the minimum value of the variable in the given column.
int IntComtradeset.FindMinInColumn(int column,
[double& value])

A RGUMENTS
column The column index.
value (optional, out)
The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

E XAMPLE
See example of IntComtradeset.FindMaxInColumn.

GetAnalogueDescriptions
Get the descriptions of the analogue channel Please note that the comtrade info file contains
proprietary data from PFM. Info files not written by DIgSILENT PFM are not supported.
string IntComtradeset.GetAnalogueDescriptions(int index)

A RGUMENTS
index Digital channel index.

R ETURNS
Descriptions for analogue channel in the comtrade info file.

GetColumnValues*
Get complete column values.
int IntComtradeset.GetColumnValues(object dataVector,
int column)

A RGUMENTS
dataVector
IntVec which will be filled with column values.
column The column index. -1 for default (e.g. time).

660
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
=0 Column values were found.
=1 dataVector is NULL.
=2 dataVector is not of class IntVec.
=3 Column index is out of range.

GetDescription*
Get the description of a column.
string IntComtradeset.GetDescription([int column],
[int short]
)

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.
short (optional)
0 long desc. (default)
1 short description

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

E XAMPLE
See example of IntComtradeset.GetVariable.

GetDigitalDescriptions
Get the descriptions of the digital channel Please note that the comtrade info file contains
proprietary data from PFM. Info files not written by DIgSILENT PFM are not supported.
string IntComtradeset.GetDigitalDescriptions(int index)

A RGUMENTS
index Digital channel index

R ETURNS
Descriptions for digital channel in the comtrade info file.

GetNumberOfAnalogueSignalDescriptions
Gets the number of descriptions for analogue channels in the comtrade info file. Please note that
the comtrade info file contains proprietary data from PFM. Info files not written by DIgSILENT
PFM are not supported.
int IntComtradeset.GetNumberOfAnalogueSignalDescriptions()

661
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Number of descriptions for analogue channels in the comtrade info file.

GetNumberOfColumns*
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int IntComtradeset.GetNumberOfColumns()

R ETURNS
Number of variables (columns) in result file.

E XAMPLE
See example of IntComtradeset.InitialiseWriting.

GetNumberOfDigitalSignalDescriptions
Get the number of descriptions for digital channels in the comtrade info file. Please note that
the comtrade info file contains proprietary data from PFM. Info files not written by DIgSILENT
PFM are not supported.
int IntComtradeset.GetNumberOfDigitalSignalDescriptions()

R ETURNS
Number of descriptions for digital channels in the comtrade info file.

GetNumberOfRows*
Returns the number of values per column (rows) stored in result object.
int IntComtradeset.GetNumberOfRows()

R ETURNS
Returns the number of values per column stored in result object.

E XAMPLE
See example of IntComtradeset.InitialiseWriting.

GetObjectValue*
Returns a value from a result object for row iX of curve col.
int IntComtradeset.GetObjectValue(object& o,
int iX,
[int col])

A RGUMENTS
o (out) The object retrieved from the data.
iX The row.

662
3.6. OTHERS CHAPTER 3. OBJECT METHODS

col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of IntComtradeset.SortAccordingToColumn.

GetSignalHeader
Get the headline of the channel section in the comtrade info file. Please note that the comtrade
info file contains proprietary data from PFM. Info files not written by DIgSILENT PFM are not
supported.
string IntComtradeset.GetSignalHeader()

R ETURNS
Headline of signal descriptions

GetUnit*
Get the unit of a column.
string IntComtradeset.GetUnit([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

E XAMPLE
See example of IntComtradeset.GetVariable.

GetValue*
Returns a value from a result object for row iX of curve col.
int IntComtradeset.GetValue(double& d,
int iX,
[int col])

663
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
d (out) The value retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g.
by the contingency analysis, the value is invalid in case that it was not written,
because it was below the recording limit. Result files created using DPL/Python
are always full and will not return invalid values.

E XAMPLE
See example of IntComtradeset.SortAccordingToColumn.

GetVariable*
Get variable name of column
string IntComtradeset.GetVariable([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

E XAMPLE
object case,
elmRes;
string name,
unit,
short,
long;

set resObjs;
int variables,
column;
case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {

664
3.6. OTHERS CHAPTER 3. OBJECT METHODS

exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
if (variables>0) {
printf('Name; unit; Short Description; Long Description');
for (column=-1; column<variables; column+=1) {
! -1 returns default column
name = elmRes.GetVariable(column);
unit = elmRes.GetUnit(column);
short= elmRes.GetDescription(column,1);
long = elmRes.GetDescription(column);
printf('%s; %s; %s; %s', name, unit, short,long);
}
}
elmRes.Release();

Load*
Loads the data of a result object (IntComtradeset) in memory for reading.
void IntComtradeset.Load()

E XAMPLE
object case,
elmRes;
set resObjs;
int variables,rows;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
variables = elmRes.GetNumberOfColumns();
rows = elmRes.GetNumberOfRows();
Info('The result file %s contains %d columns and %d rows',elmRes, variables, rows);
elmRes.Release();

Release*
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
void IntComtradeset.Release()

E XAMPLE
See example of IntComtradeset.Load.

665
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SortAccordingToColumn*
Sorts all rows in the data loaded according to the given column. The IntComtradeset itself
remains unchanged.
int IntComtradeset.SortAccordingToColumn(int column)

A RGUMENTS
col The column number.

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

E XAMPLE
The following example outputs column 1 and 2 for the first 50 rows. The output is repeated
after sorting the data according to column 1.
object case,
elmRes;
set resObjs;
int row,
rows,
column,
failed;
double value1, value2;

case = GetActiveStudyCase();
if (nullptr=case) {
exit(1); ! there is no active study case
}
resObjs = case.GetContents('*.ElmRes',0); ! get all ElmRes stored in case
elmRes = resObjs.First();
if (nullptr=elmRes) {
exit(1);
}
elmRes.Load();
column = 1;
rows = 50;
Info('Orginal data in first %d rows of column %d and %d',rows, column, column+1);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;
printf('%04d %f %f', row, value1, value2); ! report row starting with 1
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
failed = elmRes.SortAccordingToColumn(column);
Info('Sorted data in first %d rows in column %d and %d',rows,column, column+1);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {
row += 1;

666
3.6. OTHERS CHAPTER 3. OBJECT METHODS

printf('%04d %f %f', row, value1, value2); ! report row starting with 1


failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
if (row > rows) {
break;
}
}
elmRes.Release();

3.6.12 IntDataset
Overview

AddRef
All
Clear
GetAll

AddRef
Adds new reference(s) for passed object(s) as children to the dataset object. Nothing happens
if there exists already a reference for the passed object.
void IntDataset.AddRef(object obj)
void IntDataset.AddRef(set objects)

A RGUMENTS
obj/objects
Object(s) for which references should be created and added to the dataset object

All
Returns all children of the dataset object.
set IntDataset.All()

R ETURNS
All objects contained in dataset object.

Clear
Deletes all children of the dataset object.
void IntDataset.Clear()

GetAll
Returns all children of the dataset filtered according to given class name.
set IntDataset.GetAll(string className)

667
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
className
class name filter, e.g. ElmTerm

R ETURNS
All objects of given class stored in dataset object.

3.6.13 IntDocument
Overview

Export
Import
Reset
View

Export
Exports the embedded data as new file on disk. The embedded data remains unmodified. If
desired it can be removed by calling the Reset() function afterwards
int IntDocument.Export(string filename)

A RGUMENTS
filename Name of export file on disk

R ETURNS
0 On success.
1 On error.

S EE ALSO

IntDocument.Import()

Import
Imports the content of selected file into the PowerFactory object. The data is afterwards em-
bedded in the PowerFactory database.
int IntDocument.Import()

R ETURNS
0 On success.
1 On error.

S EE ALSO

IntDocument.Export()

668
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Reset
Resets embedded data and reference to an external file.
int IntDocument.Reset()

View
Views the file in external application. If the file is embedded, it’s extracted into a temporary file
that is opened afterwards. Please note, the action is only executed if access to given file (type)
is enabled in the 'External Access' configuration of PowerFactory (IntExtaccess).
int IntDocument.View()

R ETURNS
0 Success, file was opened
1 Error, file not opened (because of invalid address or security reasons)

S EE ALSO

IntUrl.View()

3.6.14 IntDplmap
Overview

Clear*
Contains*
First*
GetValue*
Insert*
Next*
Remove*
Size*
Update*

Clear*
Removes all key/value pairs from the container and resets type information.
void IntDplmap.Clear()

E XAMPLE
See example of IntDplmap.GetValue().

Contains*
Checks if a key/value pair with given key is contained in the container.
int IntDplmap.Contains(int | double | string | object | set key)

A RGUMENTS
key Key of the associated pair in the container

669
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
1 if an entry of same key is contained, otherwise 0.

E XAMPLE
See example of IntDplmap.GetValue().

First*
Outputs the first key/value pair stored in the container.
Note:

• The sequence of the returned pairs is determined by internal criteria and cannot be
changed.
• It is not allowed to modify a container while iterating over it. If doing so, the next call of the
Next command will return a value of 1.
Exception: Update() does not invalidate current position.

int IntDplmap.First (int& | double& | string& | object& | set& key,


int& | double& | string& | object& | set& value)

A RGUMENTS
key (out) Key of the associated pair in the container
value (out)
Value of the associated pair in the container

R ETURNS
1 if no next entry is available in the container (e.g. end is reached), otherwise 0.

E XAMPLE
Iteration over a map:
!'map'refers to an object of class IntDplmap that is stored inside the
!script
int t, key, m;
string value;

!insertion of some elements


map.Insert(1, 'one');
map.Insert(2, 'two');
map.Insert(3, 'three');
map.Insert(4, 'four');
map.Insert(5, 'five');

!iterate over the map and print its content


for (t = map.First(key, value); t = 0; t = map.Next(key, value)) {
printf('%d -> %s', key, value);
}

!change value of all odd keys into upper-case while iterating over map
printf('Modifying map...');
for (t = map.First(key, value); t = 0; t = map.Next(key, value)) {
m = modulo(key, 2);
if (m = 1) {
value = toupper(value);

670
3.6. OTHERS CHAPTER 3. OBJECT METHODS

map.Update(key, value);
}
}

!iterate over the map and print its content


for (t = map.First(key, value); t = 0; t = map.Next(key, value)) {
printf('%d -> %s', key, value);
}

GetValue*
Returns the associated value for given key.
int|double|string|object|set IntDplmap.GetValue(int|double|string|object|set key,
[int& error])

A RGUMENTS
key Key of the associated pair in the container to find.
error (optional, out)
1 Key was not found in container.
0 Key was found in the container.

R ETURNS
The value which is associated to the given key or an undefined value if key is not associated
with any value.

E XAMPLE
The following example shows how to use the different IntDplmap methods:
!'map'refers to an IntDplmap object stored inside the script
int count, i, tmp;
object o;
set aSet, bSet;
string s, s2;

!clear map
map.Clear();
count = map.Size();
printf('Map Size: %d', count);

!example for an int -> string map


!insert of some elements
map.Insert(1, 'one');
map.Insert(2, 'two');
!3 not inserted
map.Insert(4, 'four');
map.Insert(5, 'five');
count = map.Size();
printf('Map Size: %d', count);

!get values from map


for (i = 1; i < count + 1; i += 1) {
tmp = map.Contains(i);
if (tmp > 0){

671
3.6. OTHERS CHAPTER 3. OBJECT METHODS

s = map.GetValue(i);
printf('%d = %s', i, s);
}
else {
printf('%d not contained', i);
}
}

!replace existing elements


map.Insert(1, '1');
map.Insert(2, '2');
map.Insert(4, '4');
map.Insert(5, '5');
count = map.Size();
printf('Map Size: %d', count);

for (i = 1; i < count + 1; i += 1){


s = map.GetValue(i, tmp);
if (tmp = 0){
printf('%d = %s', i, s);
}
else {
printf('%d not contained', i);
}
}

map.Clear();
count = map.Size();
printf('Map Size: %d', count);

!example for an string -> string map


map.Insert('A', 'a');
map.Insert('B', 'b');
map.Insert('C', 'c');
map.Insert('D', 'd');
s2 = 'D';
tmp = map.Contains(s2);
if (tmp > 0){
s = map.GetValue(s2);
printf('%s = %s', s, s2);
}

s2 = 'F'; !not contained!


tmp = map.Contains(s2);
if (tmp > 0) {
s = map.GetValue(s2);
printf('%s = %s', s, s2);
}
map.Clear();

!example for an int -> object map


!Terminal1 and Terminal2 object must be accessible
map.Insert(1, Terminal1);
map.Insert(2, Terminal2);
tmp = map.Contains(1);
if (tmp > 0){
o = map.GetValue(1);
o.ShowFullName();
}

672
3.6. OTHERS CHAPTER 3. OBJECT METHODS

tmp = map.Contains(2);
if (tmp > 0){
o = map.GetValue(2);
o.ShowFullName();
}
map.Clear();

!example for an object -> object map


map.Insert(Terminal1, Terminal2);
tmp = map.Contains(Terminal1);
if (tmp > 0){
o = map.GetValue(Terminal1);
o.ShowFullName();
}
map.Clear();
printf('\n');

!example for string -> set map


aSet.Add(Terminal1);
map.Insert('set1', aSet);
tmp = map.Contains('set1');
if (tmp > 0){
bSet = map.GetValue('set1');
o = bSet.First();
while (o) {
o.ShowFullName();
o = bSet.Next();
}
}

printf('\n');

! Terminal2 added to aSet, but not reflected by set stored in map


! (sets are always inserted by value, not by reference)
aSet.Add(Terminal2);
tmp = map.Contains('set1');
if (tmp > 0){
bSet = map.GetValue('set1');
o = bSet.First();
while (o) {
o.ShowFullName();
o = bSet.Next();
}
}

printf('\n');

! insert current aSet, so Terminal2 will be contained in this set


map.Insert('set1', aSet);
tmp = map.Contains('set1');
if (tmp > 0){
bSet = map.GetValue('set1');
o = bSet.First();
while (o) {
o.ShowFullName();
o = bSet.Next();
}
}

673
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Insert*
Inserts given key and value as an associated pair into the container.
On the first insertion, the container is (automatically) typed by given data types of key and value.
From now on, only keys and values of that types are accepted. (This type information is removed
when IntDplmap.Clear() is called.)
If given key already exists in the container, its associated value will be overwritten. (Each key
can only be contained once in a map (no multi-map support).)
Note:

• Type of key and value can be different, of course.


• Sets are always inserted by value, not by reference!

void IntDplmap.Insert (int | double | string | object | set key,


int | double | string | object | set value)

A RGUMENTS
key Key of the associated pair in the container.
value Value of the associated pair in the container.

E XAMPLE
See example of IntDplmap.GetValue().

Next*
Outputs the next key/value pair relative to the last key/value pair in the container.
Note:

• The sequence of the returned pairs is determined by internal criteria and cannot be
changed.
• It is not allowed to modify a container while iterating over it. If doing so, the next call of the
Next command will return a value of 1.
Exception: Update() does not invalidate current position.

int IntDplmap.Next (int& | double& | string& | object& | set& key,


int& | double& | string& | object& | set& value)

A RGUMENTS
key (out) Key of the associated pair in the container.
value (out)
Value of the associated pair in the container.

R ETURNS
1 if no next entry is available in the container (e.g. end is reached), otherwise 0.

674
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
See example of IntDplmap.First().

Remove*
Removes the key/value pair for given key from the container. No error will occur, if the key is not
contained in the container.
void IntDplmap.Remove (int | double | string | object | set key)

A RGUMENTS
key Key of the associated pair in the container

E XAMPLE
See example of IntDplmap.GetValue().

Size*
Returns the number of key/value pairs stored in the container.
int IntDplmap.Size()

R ETURNS
Number of key-value pairs stored in the container.

E XAMPLE
See example of IntDplmap.GetValue().

Update*
Is a special insert function that can be used for updating key/value pairs in the map. It can only
be used if the key is already contained in the map.
void IntDplmap.Update(int | double | string | object | set key,
int | double | string | object | set value)

A RGUMENTS
key Key of the associated pair in the container

value Value of the associated pair in the container

E XAMPLE
See example of IntDplmap.GetValue().

675
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.15 IntDplvec
Overview

Clear*
Get*
IndexOf*
Insert*
Remove*
Size*
Sort*

Clear*
Removes all elements from the container and resets the typ information.
void IntDplvec.Clear()

E XAMPLE
See example of IntDplvec.Get().

Get*
Returns the element stored at given position in the container.
int|double|string|object|set IntDplvec.Get(int position)

A RGUMENTS
position Position in the container. It is zero-based and must always be lesser than the
container’s size.

R ETURNS
Element stored at given position in the container.

E XAMPLE
The following example shows how to use the different IntDplvec methods:
! 'vec' always refers to an IntDplvec object that is stored inside the script
int count, i, tmp;

! clear vector at the beginning


vec.Clear();

! output vector's size


count = vec.Size();
printf('Vec Size: %d', count);

! insert some integers


for (i = 0; i < 10; i += 1) {
vec.Insert(i);
}

! output all values stored in vector


count = vec.Size();
printf('Vec Size: %d', count);
for (i = 0; i < count; i += 1) {

676
3.6. OTHERS CHAPTER 3. OBJECT METHODS

tmp = vec.Get(i);
printf('Vector[%d] = %d', i, tmp);
}

! replace elements
for (i = 0; i < count; i += 1) {
tmp = vec.Get(i);
tmp = tmp * 10;
vec.Insert(i, tmp);
}

! output all values stored in vector


count = vec.Size();
printf('Vec Size: %d', count);
for (i = 0; i < count; i += 1) {
tmp = vec.Get(i);
printf('Vector[%d] = %d', i, tmp);
}

! delete every 2nd element


for (i = count - 1; i >= 0; i -= 2){
vec.Remove(i);
}

! output all values stored in vector


count = vec.Size();
printf('Vec Size: %d', count);
for (i = 0; i < count; i += 1) {
tmp = vec.Get(i);
printf('Vector[%d] = %d', i, tmp);
}

! insert some values and search their positions afterwards


vec.Insert(0, 33);
vec.Insert(2, 33);
vec.Insert(33);
tmp = vec.IndexOf(33);
while (tmp > -1) {
printf('Value 33 found at: %d', tmp);
tmp += 1;
tmp = vec.IndexOf(33, tmp);
}

! empty the vector


vec.Clear();

677
3.6. OTHERS CHAPTER 3. OBJECT METHODS

IndexOf*
Returns the position where the given element is stored in the container.
int IntDplvec.IndexOf(int|double|string|object|set element,
[int startPosition]
)

A RGUMENTS
element Element for which the position will be searched.
startPosition
Start position from which the next occurrence greater or equal to this position is
searched.

R ETURNS
Position of the the given element in the container. The returned position is zero-based. If no
occurrence was found, -1 is returned.

E XAMPLE
See example of IntDplvec.Get().

Insert*
Inserts an element at given position into the container. If no position is given then the element
is appended to the back. Inserting an element to an empty container fixes the type of elements
which can be hold by itself. Clearing the container resets this type information.
void IntDplvec.Insert(int|double|string|object|set element)
void IntDplvec.Insert(int position,
int|double|string|object|set element,
)

A RGUMENTS
element Element to be inserted.
position Position (zero-based) to insert the element at. Any old entry at that position will
be overwritten. Note: The size of the vector is automatically increased if given
position is greater than current size.

E XAMPLE
See example of IntDplvec.Get().

Remove*
Removes the element stored at given position from the container.
void IntDplvec.Remove(int position)

A RGUMENTS
position Given position (zero-based) at which the element is to be removed.

678
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
See example of IntDplvec.Get().

Size*
Returns the number of elements stored in the container.
int IntDplvec.Size()

R ETURNS
Number of elements stored in the container.

E XAMPLE
See example of IntDplvec.Get().

Sort*
Sorts the elements of the vector depending on the type of elements stored inside the vector:

string lexically

double/int
according to value
object according to full name (path + name) or given attribute

void IntDplvec.Sort([int descending,]


[string attribute]
)

A RGUMENTS
descending (optional)
1 Descending sorting order
0 Ascending sorting order (default)
attribute (optional)
For objects only: Attribute according to which the sorting is done (default is full
name)

E XAMPLE
See example of IntDplvec.Get().

3.6.16 IntEvt
Overview

CreateCBEvents
RemoveSwitchEvents

679
3.6. OTHERS CHAPTER 3. OBJECT METHODS

CreateCBEvents
Create boundary breaker events for all shc locations which occur simultaneously in this fault
case.
void IntEvt.CreateCBEvents([int iRemoveExisting])

A RGUMENTS
iRemoveExisting (optional)
-1 Query user if circuit breaker events exist.
0 Do not create circuit breaker events if circuit breaker events are already
defined events exist (default)
1 Remove existing circuit breaker events.

RemoveSwitchEvents
Remove all switch events of this fault case.
void IntEvt.RemoveSwitchEvents([int onlyContingency])

A RGUMENTS
onlyContingency (optional)
Condition to remove.
0 Remove all switch events regardless of the calculation type.
1 Remove all switch events only when this fault case is used for contin-
gency analysis.

3.6.17 IntExtaccess
Overview

CheckUrl

CheckUrl
Checks whether access to given url will be granted or not according to the security settings.
See also IntUrl.View() for accessing that url.
int IntExtaccess.CheckUrl(string url)

A RGUMENTS
url url to check

E XAMPLE
int i;
object extAccess;

!for demonstration purpose, create a local IntExtaccess object


!(normally stored in (System\)Configuration\Security folder)
extAccess = this.CreateObject('IntExtaccess', 'Test');
extAccess:sPermissions:0 = 'ˆhttp:.+'; !grant access to http-resources

680
3.6. OTHERS CHAPTER 3. OBJECT METHODS

i = extAccess.CheckUrl('http://www.digsilent.de');

if (i=0) {
printf('OK');
}
else {
printf('No access');
}

R ETURNS
0 access granted
1 access denied

3.6.18 IntGate
Overview

AddTrigger

AddTrigger
Adds either a condition or a gate to the gate.
void IntGate.AddTrigger(object newTrigger)

A RGUMENTS
newTrigger
The condition or gate that shall be added.

3.6.19 IntGrf
Overview

MoveToLayer

MoveToLayer
Moves an IntGrf object to the selected target layer, provided that the object is a valid object
for that layer. Annotation elements stored as (obsolete) IntGrf objects can be moved to any
annotation layer (IntGrflayer ) or group (IntGrfgroup).
void IntGrf.MoveToLayer(object layer)

A RGUMENTS
layer Target IntGrflayer or IntGrfgroup object.

681
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.20 IntGrfgroup
Overview

ClearData
Export
ExportToVec
Import
ImportFromVec

ClearData
Removes all annotation elements from this group.
void IntGrfgroup.ClearData()

Export
Exports all objects of a group into svg-file.
void IntGrfgroup.Export(string path,
[int OpenDialog])

A RGUMENTS
path Full export file path
OpenDialog (optional)
Prompt for export path in dialog
0 Export directly and do not show any dialog (default)
1 Show dialog with path before exporting

ExportToVec
Fills string description of annotation elements of this group into an IntDplvec. Clears IntDplvec
before filling it.
void IntGrfgroup.ExportToVec(object intDplVec)

A RGUMENTS
intDplVec IntDplvec object to be filled.

E XAMPLE
This example exports the referred group object to a DPL-vector stored inside the DPL-script
and prints all lines.
int iSize, i;
string sLine;

oGroup.ExportToVec(DPLVec); ! group from External Objects, DPLVec stored in this


iSize = DPLVec.Size();

for (i = 0; i < iSize; i+=1) {


sLine = DPLVec.Get(i);
printf('sLine = %s',sLine);
}

682
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Import
Imports svg-file into group object.
void IntGrfgroup.Import(string path)

A RGUMENTS
path Path of file to be imported.

ImportFromVec
Fills this group with the string description of annotation elements from an IntDplvec. Clears the
group before filling it.
void IntGrfgroup.ImportFromVec(object intDplVec)

A RGUMENTS
intDplVec IntDplvec containg description of annotation elements.

E XAMPLE
This example imports the lines from an internally stored DPL-vector to a group object.
oGroup.ImportFromVec(DPLVec); ! group from External Objects, DPLVec stored in this

3.6.21 IntGrflayer
Overview

AdaptWidth
Align
ChangeFont
ChangeLayer
ChangeRefPoints
ChangeWidthVisibilityAndColour
ClearData
Export
ExportToVec
Import
ImportFromVec
Mark
Reset

683
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AdaptWidth
Resizes the specified group of text boxes regarding their maximum text length.
void IntGrflayer.AdaptWidth(int objectType,
[string symbolName])

A RGUMENTS
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

Align
Aligns the text within a text box.
void IntGrflayer.Align(int alignPos,
int objectType,
[string symbolName])

A RGUMENTS
alignPos Alignment within bounding box
0 left
1 middle
2 right
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

ChangeFont
Sets the font number for the specified group of text boxes.
void IntGrflayer.ChangeFont(string fontName,
int fontSize,
int fontStyle,
int objectType,
[string symbolName])

684
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
fontName
Font name
fontSize Font size
fontStyle Font style

0 Regular
1 Bold
2 Italic
3 Bold and Italic
4 Underline
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

ChangeLayer
Sets the specified group of text boxes to a given layer.
void IntGrflayer.ChangeLayer(object newLayer,
int objectType,
[string symbolName])

A RGUMENTS
newLayer Layer object
objectType
Object type

0 Nodes and branches


1 Nodes
2 Branches
3 Symbol dependent

symbolName
Symbol name (only relevant if objectType == 3)

685
3.6. OTHERS CHAPTER 3. OBJECT METHODS

ChangeRefPoints
Sets the reference points between a text box (second parameter) and its parent object (first
parameter), e.g. if the result box of a busbar shall be shown on top of a drawn bar instead of
below the bar the values change from (6,4) to (4,6). The first number specifies the reference
number of the text box. The integer values describe the position of the reference points within a
rectangle (0=centre, 1=middle right, 2=top right,..):
432
501
678

void IntGrflayer.ChangeRefPoints(int parentRef,


int textBoxRef,
int objectType,
[string symbolName])

A RGUMENTS
parentRef
Defines the reference point on the parent object (e.g. busbar)
textBoxRef
Defines the reference point on the text box
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

ChangeWidthVisibilityAndColour
Sets the visibility of the frame, the width (in number of letters), the visibility and the colour of text
boxes.
void IntGrflayer.ChangeWidthVisibilityAndColour(int objectType,
[string symbolName],
[int columns],
[int visibility],
[int colorNumber])

A RGUMENTS
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent

686
3.6. OTHERS CHAPTER 3. OBJECT METHODS

symbolName
Symbol name (only relevant if objectType == 3)

columns Sets the width in number of letters


0..n columns
visibility Sets the visibility

0 not visible
1 visible
colorNumber
Sets the colour
0..255 colorNumber

ClearData
Removes all annotation elements on this layer (keeps contained groups and annotation ele-
ments).
void IntGrflayer.ClearData()

Export
Exports all objects of a layer into svg-file or plain text (.txt), inclusive annotation objects of
contained group objects.
void IntGrflayer.Export(string path,
[int OpenDialog])

A RGUMENTS
path Full export file path. Supported formats: .svg and .txt.

OpenDialog (optional)
Prompt for export path in dialog
0 Export directly and do not show any dialog (default)
1 Show dialog with path before exporting

ExportToVec
Fills string description of annotation elements of this layer into an IntDplvec. Clears IntDplvec
before filling it.
void IntGrflayer.ExportToVec(object intDplVec)

A RGUMENTS
intDplVec IntDplvec object to be filled.

687
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
This example exports the referred layer object to a DPL-vector stored inside the DPL-script
and prints all lines.
int iSize, i;
string sLine;

oLayer.ExportToVec(DPLVec); ! layer from External Objects, DPLVec stored in this


iSize = DPLVec.Size();

for (i = 0; i < iSize; i+=1) {


sLine = DPLVec.Get(i);
printf('sLine = %s',sLine);
}

Import
Imports svg file or plain text (.txt) into layer.
void IntGrflayer.Import(string path)

A RGUMENTS
path Path of file to be imported. Supported formats: .svg and .txt.

ImportFromVec
Fills this layer with the string description of annotation elements from an IntDplvec. Clears layer
before filling it.
void IntGrflayer.ImportFromVec(object intDplVec)

A RGUMENTS
intDplVec IntDplvec containg description of annotation elements.

E XAMPLE
This example imports the lines from an internally stored DPL-vector to a layer object.
oLayer.ImportFromVec(DPLVec); ! layer from External Objects, DPLVec stored in this

Mark
Marks the specified group of text boxes in the currently shown diagram.
void IntGrflayer.Mark(int objectType,
[string symbolName])

A RGUMENTS
objectType
Object type
0 Nodes and branches

688
3.6. OTHERS CHAPTER 3. OBJECT METHODS

1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

Reset
Resets the individually modified text box settings.
void IntGrflayer.Reset(int mode,
int objectType,
[string symbolName])

A RGUMENTS
iMode
0 Reset to default (changed reference points are not reset)
1 Only font
2 Shift to original layer (result boxes to layer 'Results', object names to
layer 'Labels')
objectType
Object type
0 Nodes and branches
1 Nodes
2 Branches
3 Symbol dependent
symbolName
Symbol name (only relevant if objectType == 3)

3.6.22 IntGrfnet
Overview

Close
SetFontFor
SetLayerVisibility
SetSymbolComponentVisibility
Show

Close
Closes the graphic page that displays this diagram.
int IntGrfnet.Close()

R ETURNS
0 On success, no error occurred.

689
3.6. OTHERS CHAPTER 3. OBJECT METHODS

1 Otherwise

SetFontFor
Sets a font for a specified group of text boxes.
void IntGrfnet.SetFontFor(int labelResultOrTitle,
int nodesOrBranches,
string fontName,
int fontSize,
int fontStyle)

A RGUMENTS
labelResultOrTitle
Type of text box to be modified.
0 Labels
1 Results
2 Title and Legends

nodesOrBranches
Type of parent object
0 Nodes
1 Branches

fontName
Font name
fontSize Font size
fontStyle Font style

1 Bold
2 Italic
3 Bold and italic
4 Underline

SetLayerVisibility
Sets a layer visible or invisible.
void IntGrfnet.SetLayerVisibility(string sLayer,
int iVis)

A RGUMENTS
sLayer Layer to be modified.
iVis Visibility
0 Make layer invisible.
1 Make layer visible.

690
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetSymbolComponentVisibility
Determines which parts of net element symbols are shown in the diagram.
void IntGrfnet.SetSymbolComponentVisibility(int componentID,
int visible)

A RGUMENTS
componentID
Component to be modified.
5 Connection points
7 Tap positions
8 Vector groups
9 Load flow arrows
11 Phases
13 Line sections and loads
14 Connection arrows
21 Connection numbers (block diagrams only)
22 Connection names (block diagrams only)
33 Remotely controlled substation markers
38 Tie open point markers
39 Open standby switch markers
40 Normally open switch markers
visible Visibility

0 Make component invisible.


1 Make component visible.

Show
Opens a diagram.
int IntGrfnet.Show()

R ETURNS
0 On success, no error occurred.
1 Otherwise

E XAMPLE
int err;
object project, grfnet, desktop, diagramsfolder;
set objs;

project = GetActiveProject();
if (.not. project) {
Error('No project found!');
exit();
}
diagramsfolder = GetProjectFolder('dia');
objs = diagramsfolder.GetContents('*.IntGrfnet',1);

691
3.6. OTHERS CHAPTER 3. OBJECT METHODS

grfnet = objs.First();
if (.not. grfnet) {
Error('No diagram found!');
exit();
}

err = grfnet.Show();
printf('%o.Show() returned %d', grfnet, err);

3.6.23 IntIcon
Overview

Export
Import

Export
Exports current icon as a bitmap file.
int IntIcon.Export(string filename)

A RGUMENTS
filename Name of export image on disk. Extension needs to be ’.bmp’

R ETURNS
0 On success.
1 On error.

S EE ALSO

IntIcon.Import()

Import
Imports icon from a bitmap file.
int IntIcon.Import(string filename)

A RGUMENTS
filename Name of bitmap file on disk. Extension and format needs to be ’.bmp’

R ETURNS
0 On success.
1 On error.

S EE ALSO

IntIcon.Export()

692
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.24 IntLibrary
Overview

Activate
Deactivate

Activate
Activates this library. If another library is already activated it will be deactivated first.
int IntLibrary.Activate()

R ETURNS
1 if successful
0 otherwise

Deactivate
Deactivates this library.
int Library.Deactivate()

R ETURNS
1 if successful
0 otherwise

3.6.25 IntMat
Overview

ColLbl*
Get*
GetColumnLabel*
GetColumnLabelIndex*
GetNumberOfColumns*
GetNumberOfRows*
GetRowLabel*
GetRowLabelIndex*
Init*
Invert*
Multiply*
Resize*
RowLbl*
Save*
Set*
SetColumnLabel*
SetRowLabel*
SortToColumn*

693
3.6. OTHERS CHAPTER 3. OBJECT METHODS

ColLbl*
Deprecated function to get or set the label of the given column. Please use IntMat.GetColumnLabel()
or IntMat.SetColumnLabel() instead.
string IntMat.ColLbl(int column)
string IntMat.ColLbl(string label,
int column
)

Get*
Returns the value at the position (row, column) of the matrix. A run-time error will occur when
'row' or 'column' is out of range.
double IntMat.Get(int row,
int column
)

A RGUMENTS
row Row in matrix: 1 ... GetNumberOfRows().
column column in matrix: 1 ... GetNumberOfColumn()

R ETURNS
Value in matrix.

S EE ALSO

IntMat.Set()

E XAMPLE
The following example multiplies two matrices
int r,c,z,s,s1r,s2c;
double v1,v2,v;
s = M1.GetNumberOfColumns();
r = M2.GetNumberOfRows();
if (s<>r) {exit()};
s1r = M1.GetNumberOfRows();
s2c = M2.GetNumberOfColumns();
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;
}

694
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetColumnLabel*
Returns the label of a column.
string IntMat.GetColumnLabel(int column)

A RGUMENTS
column Column index (first column has index 1).

R ETURNS
Column label of given column.

D EPRECATED N AMES
ColLbl

S EE ALSO

IntMat.SetColumnLabel(), IntMat.GetColumnLabelIndex(), IntMat.GetRowLabel()

E XAMPLE
The following example assigns the label of the first column to the string label
string label;
label = Mat.GetColumnLabel(1);

GetColumnLabelIndex*
Gets the index of a label in all column labels.
int IntMat.GetColumnLabelIndex(string label)

A RGUMENTS
label Label to search.

R ETURNS
≥1 The index in the column labels, if label was found.
0 Otherwise

S EE ALSO

IntMat.GetColumnLabel()

GetNumberOfColumns*
Returns the number of columns in the matrix.
int IntMat.GetNumberOfColumns()

R ETURNS
The number of columns of the matrix.

D EPRECATED N AMES
NCol, SizeY

695
3.6. OTHERS CHAPTER 3. OBJECT METHODS

S EE ALSO

IntMat.GetNumberOfRows()

E XAMPLE
See example of IntMat.Get().

GetNumberOfRows*
Returns the number of rows in the matrix.
int IntMat.GetNumberOfRows()

R ETURNS
The number of rows.

D EPRECATED N AMES
NRow, SizeX

S EE ALSO

IntMat.GetNumberOfColumns()

E XAMPLE
See example of IntMat.Get().

GetRowLabel*
Returns the label of a row.
string IntMat.GetRowLabel(int row)

A RGUMENTS
row Row index (first row has index 1).

R ETURNS
Row label of given row.

D EPRECATED N AMES
RowLbl

S EE ALSO

IntMat.SetRowLabel(), IntMat.GetRowLabelIndex(), IntMat.GetColumnLabel()

E XAMPLE
The following example assigns the label of the first row to the string label
string label;
label = Mat.GetRowLabel(1);

696
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetRowLabelIndex*
Gets the index of a label in all row labels.
int IntMat.GetRowLabelIndex(string label)

A RGUMENTS
label Label to search.

R ETURNS
≥1 The index in the row labels, if it was found.
0 Otherwise

S EE ALSO

IntMat.GetRowLabel()

Init*
Initializes the matrix with given size and values, regardless of the previous size and data.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
int IntMat.Init(int numberOfRows,
int numberOfColumns,
[double initialValue = 0.0]
)

A RGUMENTS
numberOfRows
The number of rows.
numberOfColumns
The number of columns.
initialValue (optional)
Initial values: All matrix entries are initialised with this value. Matrix is initialized
with 0 if ommitted.

R ETURNS
Always 1 and can be ignored.

E XAMPLE
See example of IntMat.Get().

S EE ALSO

IntMat.Resize()

Invert*
Inverts the matrix.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
int IntMat.Invert()

697
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Success, the matrix is replaced by its inversion.
1 Error, inversion not possible. Original matrix was not changed.

E XAMPLE
The following example inverts a matrix named Matrix stored inside the script.
int err;
err = Matrix.Invert();
if (err) {
printf('Matrix %o is not invertible', Matrix);
}
else {
printf('Matrix %o successfully inverted', Matrix);
}

Multiply*
Multiplies 2 matrixes and stores the result in this matrix.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
int IntMat.Multiply(object M1,
object M2
)

A RGUMENTS
object M1
Matrix 1 to be multiplied.
object M2
Matrix 2 to be multiplied.

R ETURNS
Always 0 and can be ignored.

Resize*
Resizes the matrix to a given size. Existing values will not be changed. Added values will be
set to the optional value, otherwise to 0.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
int IntMat.Resize(int numberOfRows,
int numberOfColumns,
[double initialValue = 0.0]
)

A RGUMENTS
numberOfRows
The number of rows.
numberOfColumns
The number of columns.

698
3.6. OTHERS CHAPTER 3. OBJECT METHODS

initialValue (optional)
Initial values: Additional matrix entries are initialised with this value. Additional
values are initialized with 0. if ommitted.

R ETURNS
Always 1 and can be ignored.

S EE ALSO

IntMat.Init()

RowLbl*
Deprecated function to get or set the label of the given row. Please use IntMat.GetRowLabel()
or IntMat.SetRowLabel() instead.
string IntMat.RowLbl(int row)
string IntMat.RowLbl(string label,
int row
)

Save*
Saves the current state of this matrix to database.
If the matrix is calculation relevant, an optional parameter allows to control whether available
calculation results shall be reset afterwards or not.
Note: In QDSL, the calculation results are never reset and the parameter ”resetCalculation” is
ignored.
void IntMat.Save()
void IntMat.Save(int resetCalculation)

A RGUMENTS
resetCalculation (optional)
1 reset calculation results (default)
0 keep calculation results

Set*
Sets a value at the position (row, column) of the matrix. The matrix is resized automatically if
the given coordinates exceed the size.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
int IntMat.Set(int row,
int column,
double value
)

A RGUMENTS
row Row index, 1 based. The first row has index 1. Invalid index (leq0) leads to
scripting error.

699
3.6. OTHERS CHAPTER 3. OBJECT METHODS

column Column index, 1 based. The first column has index 1. Invalid index (leq0) leads to
scripting error.
value Value to assign.

R ETURNS
Always 1 and can be ignored.

S EE ALSO

IntMat.Get()

E XAMPLE
See example of IntMat.Get().

SetColumnLabel*
Sets the label of a column.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
void IntMat.SetColumnLabel(int column,
string label
)

A RGUMENTS
column Column index (first column has index 1).
label Label to set.

S EE ALSO

IntMat.GetColumnLabel(), IntMat.GetColumnLabelIndex(), IntMat.SetRowLabel()

E XAMPLE
The following example labels some columns.
Mat.SetColumnLabel(1, 'transformers');
Mat.SetColumnLabel(2, 'lines');
Mat.SetColumnLabel(3, 'busbars');

SetRowLabel*
Sets the label of a row.
This operation is performed in memory only. Use IntMat.Save() to save the modified matrix to
database.
string IntMat.SetRowLabel(int row,
string label
)

A RGUMENTS
row Row index (first row has index 1).
label Label to set.

700
3.6. OTHERS CHAPTER 3. OBJECT METHODS

S EE ALSO

IntMat.GetRowLabel(), IntMat.GetRowLabelIndex(), IntMat.SetColumnLabel()

E XAMPLE
The following example labels some rows.
Mat.SetRowLabel(1, 'transformers');
Mat.SetRowLabel(2, 'lines');
Mat.SetRowLabel(3, 'busbars');

SortToColumn*
Sorts the matrix alphanumerically according to a column, which is specified by the input param-
eter. The row labels are sorted accordingly (if input parameter storeInDB is 1).
int IntMat.SortToColumn(int columnIndex,
[double epsilon = 0.0,]
[int storeInDB = 1])

D EPRECATED N AMES
SortToColum

A RGUMENTS
columnIndex
The column index, 1 based. The first column has index 1.
epsilon (optional)
Accuracy for comparing equal values. Values which differ less than epsilon are
treated as being equal. Default value is 0.
storeInDb (optional)
Possible Values:
0 Non-persistent change. Values are not stored in database.
1 Values are stored in database. (default)

R ETURNS
0 On success.
1 Error. Original matrix was not changed.

3.6.26 IntMon
Overview

AddVar
AddVars
ClearVars
GetVar*
NVars*
PrintAllVal*
PrintVal*
RemoveVar

701
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddVar
Appends the variable “name” to the list of selected variable names.
void IntMon.AddVar(string name)

A RGUMENTS
name The variable name to add.

E XAMPLE
See example of IntMon.GetVar.

AddVars
Appends the filtered variables to the list of selected variables.
void IntMon.AddVars(string varFilter)

A RGUMENTS
varFilter The filter for variables to add. For example: ’e:*’ to add all parameters of element
to variable selection.

ClearVars
Clears the list of selected variable names.
void IntMon.ClearVars()

E XAMPLE
See example of IntMon.GetVar.

GetVar*
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.
string IntMon.GetVar(int row)

A RGUMENTS
row Given row

R ETURNS
The variable name in line row.

E XAMPLE
The following example script gets the variable set object stored inside the scripting object,
removes all variables, add two new ones and outputs the variable names previously added
in the input window.
object mon;
string name;
set tmp;

702
3.6. OTHERS CHAPTER 3. OBJECT METHODS

int count,
index;

tmp = this.GetContents('monitor.IntMon',0);
mon = tmp.First();
if (mon=nullptr) {
mon = this.CreateObject('IntMon', 'monitor');
}
mon.ClearVars();
mon.AddVar('e:plini');
mon.AddVar('e:qlini');

Info('Variables stored');
count = mon.NVars();
for (index=0; index<count;index+=1) {
name = mon.GetVar(index);
printf('%d. %s',index+1,name);
}
Info('Variables stored after removing e:plini');
mon.RemoveVar('e:plini');
count = mon.NVars();
for (index=0; index<count;index+=1) {
name = mon.GetVar(index);
printf('%d. %s',index+1,name);
}

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 usually contains one variable
name per line.
int IntMon.NVars()

R ETURNS
The number of variables selected.

E XAMPLE
See example of IntMon.GetVar.

PrintAllVal*
Writes all calculation results of the object assigned in obj id to the output window. The output
includes the variable name followed by the value, its unit and the description.
It should be noted that the variable set itself is modified by this method.
void IntMon.PrintAllVal()

E XAMPLE
The following example script gets the variable set object stored inside the scripting object
and reports all variables for the current calculation. Input data is not reported.
object mon,
load,
ldf;

703
3.6. OTHERS CHAPTER 3. OBJECT METHODS

set tmp;

tmp = this.GetContents('monitor.IntMon',0);
mon = tmp.First();
if (mon=nullptr) {
mon = this.CreateObject('IntMon', 'monitor');
}
ldf = GetFromStudyCase('ComLdf');
ldf.Execute();
tmp = GetCalcRelevantObjects('ElmLod');
for (load = tmp.First(); load; load = tmp.Next()) {
mon:obj_id = load;
mon.PrintAllVal();
}

PrintVal*
Prints the values of the selected variables to the output window.
void IntMon.PrintVal()

E XAMPLE
The following example script gets the variable set object stored inside the scripting object,
adds two variables and reports the results for all loads found after calculating a load flow.
object mon,
ldf,
load;
set tmp;

tmp = this.GetContents('monitor.IntMon',0);
mon = tmp.First();
if (mon=nullptr) {
mon = this.CreateObject('IntMon', 'monitor');
}
mon.ClearVars();
mon.AddVar('e:plini');
mon.AddVar('e:qlini');

ldf = GetFromStudyCase('ComLdf');
ldf.Execute();
tmp = GetCalcRelevantObjects('ElmLod');
for (load = tmp.First(); load; load = tmp.Next()) {
mon:obj_id = load;
mon.PrintVal();
}

RemoveVar
Removes the variable “name” from the list of selected variable names.
int IntMon.RemoveVar(string name)

A RGUMENTS
name The variable name.

704
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 If variable with name was found and removed.
1 If the variable name was not found.

E XAMPLE
See example of IntMon.GetVar.

3.6.27 IntOutage
Overview

Apply
ApplyAll
Check*
CheckAll*
IsInStudyTime*
ResetAll

Apply
void IntOutage.Apply([int reportSwitches])

Applies the outage object. The functionality corresponds to pressing the ’Apply’ button in edit
dialog with the difference that the scripting function can also be used without an active scenario.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.

0 No output (default)
1 Print switches to output window

ApplyAll
void IntOutage.ApplyAll([int reportSwitches])

Applies all currently relevant (=in study time and not out-of-service) outage objects of current
project. The functionality corresponds to pressing the ’ApplyAll’ button in edit dialog with the
difference that the scripting function can also be used without an active scenario. It applies all
relevant outages independent of the one it was called on.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.
0 No output (default)
1 Print switches to output window

705
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Check*
int IntOutage.Check([int outputMessage])

This function checks if the outage is correctly reflected by the network elements.
A RGUMENTS
outputMessage (optional)
Flag to enable detailed output to the output window.
0 No output (default)
1 Detailed report of mismatch to output window

R ETURNS
0 Ok, outage is correctly reflected
1 Not ok, status of network elements does not reflect outage

CheckAll*
This function checks if all outages are correctly reflected by the network components for current
study time. It checks all outages independent of the one it was called on.
void IntOutage.CheckAll([int emitMsg,]
[object gridfilter,]
[set& notOutaged,]
[set& wronglyOutaged]
)

A RGUMENTS
int emitMsg (optional)
whether to report inconistencies to the output window

-1 No output
0 (Default) print inconsistencies but without start / end message
1 Full output, including start / end message
gridfilter (optional)
Possibility to restrict checking for accidentally outaged elements to given object
(e.g. grid) and its children (by default, all elements for all active grids are checked).

notOutaged (optional, out)(optional)


If given, all network components that should be outaged but are not are filled into
this set.

wronglyOutaged (optional, out)(optional)


If given, all network components that should be outaged but are not are filled into
this set.

706
3.6. OTHERS CHAPTER 3. OBJECT METHODS

IsInStudyTime*
int IntOutage.IsInStudyTime()

Checks if outage is relevant for current study time, i.e. the study time lies within the outage’s
validity period.
R ETURNS
0 Outage is not relevant for current study time (outside validity period)
1 Outage is relevant for current study time (inside validity period)

D EPRECATED N AMES
IsInStudytime

ResetAll
void IntOutage.ResetAll([int reportSwitches])

Resets all currently relevant (=in study time and not out-of-service) outage objects of current
project. The functionality corresponds to pressing the ’Reset’ button in all outage objects with
difference that the scripting function can also be used without an active scenario. It resets all
relevant outages independent of the one it was called on.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.
0 No output (default)
1 Print switches to output window

3.6.28 IntPlannedout
Overview

SetRecurrence

SetRecurrence
Copies the settings of a Recurrence Pattern object to the planned outage object and enables
the flag Recurrent.
int IntPlannedout.SetRecurrence(object recurrencePattern)

A RGUMENTS
recurrencePattern
Recurrence pattern object, classname IntRecurrence

R ETURNS
0 Ok, settings copied successful
1 Failed, passed object is NULL or not of class IntRecurrence

707
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.29 IntPlot
Overview

SetAdaptY
SetAutoScaleY
SetScaleY

SetAdaptY
Sets the Adapt Scale option of the x-scale.
void IntPlot.SetAdaptY(int mode,
[double offset]
)

A RGUMENTS
mode Possible values:
0 off
1 on
offset (optional)
Offset, unused if mode is off or empty

E XAMPLE
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
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! get open graphics board
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! Get subplot named 'RST'
if (plot) {
plot.SetDefScaleY(); ! reset option 'Use local y-Axis'
scale=plot.GetScaleObjY(); ! get plot type
if (scale) {
scale.SetAdaptY(1,3);! Turn on adapt scale, offset is 3
}
}
}
}

SetAutoScaleY
Sets automatic scaling mode of the y-scale. A warning is issued if an invalid mode is passed to
the function.
void IntPlot.SetAutoScaleY(int mode)

708
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

E XAMPLE
The following example sets the Auto Scale setting of the plot type to On.
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get subplot named 'RST'
if (plot) {
plot.SetDefScaleY(); ! reset option 'Use local y-Axis'
scale=plot.GetScaleObjY(); ! get plot type
if (scale) {
scale.SetAutoScaleY(1);
}
}
}
}

SetScaleY
Sets y-axis scale limits. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
void IntPlot.SetScaleY()
void IntPlot.SetScaleY(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.
max (optional)
Maximum of y-scale.

log (optional)
Possible values:
0 linear
1 logarithmic

709
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example looks for a Subplot named 'RST' and set its y-axis scale to a logarith-
mic scale in the range s[1,1000]
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! get open graphics board
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1);
if (plot) {
plot.SetDefScaleY();! Reset option 'Use local y-Axis'
scale=plot.GetScaleObjY(); ! get plot type
if (scale) {
scale.SetScaleY(1,1000,1);
}
}
}
}

3.6.30 IntPrj
Overview

Activate
AddProjectToCombined
AddProjectToRemoteDatabase
Archive
BeginDataExtensionModification
CanAddProjectToRemoteDatabase
CanSubscribeProjectReadOnly
CanSubscribeProjectReadWrite
ClearInvalidReferences
CopyDataExtensionFrom
CreateVersion
Deactivate
EndDataExtensionModification
GetDerivedProjects
GetExternalReferences
GetGeoCoordinateSystem
GetLatestVersion
GetVersions
HasExternalReferences
LoadData
MergeToBaseProject
Migrate
NormaliseCombined
PackExternalReferences
Purge
PurgeObjectKeys
RemoveProjectFromCombined
Restore

710
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetGeoCoordinateSystem
SubscribeProjectReadOnly
SubscribeProjectReadWrite
TransformGeoCoordinates
TransformToGeographicCoordinateSystem
UnsubscribeProject
UpdateStatistics
UpdateToDefaultStructure
UpdateToMostRecentBaseVersion

Activate
Activates the project. If another project is already activated it will be deactivated first.
int IntPrj.Activate()

R ETURNS
0 on success
1 on error

AddProjectToCombined
Adds a project to this using the Project Combination logic. The passed object must be an
IntVersion. The receiving project must be activated but not have a Study Case active, otherwise
this method will fail.
int IntPrj.AddProjectToCombined(object projectVersion)

A RGUMENTS
projectVersion
The verson of a project to add

R ETURNS
0 operation was successful
1 an error occurred

AddProjectToRemoteDatabase
Adds a project to the online database if possible.
Can only be used if the database driver is set to Offline Mode.
void IntPrj.AddProjectToRemoteDatabase()

Archive
Archives the project if the functionality is configured and activated. Does nothing otherwise.
int IntPrj.Archive()

711
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 project has been archived
1 project has not been archived

BeginDataExtensionModification
Signals the start of a Data Extension modification.
Must be terminated with EndDataExtensionModification, otherwise all changes will be discarded.
Data Extensions can only be modified when the project is active.
object IntPrj.BeginDataExtensionModification()

R ETURNS
The SetDataext configuration object in the settings folder for further processing.

S EE ALSO

IntPrj.EndDataExtensionModification(), SetDataext.AddConfiguration(), SetDataext.GetConfiguration(),


SetDataext.GetConfigurations(), SetDataext.RemoveAllConfigurations(), SetDataext.RemoveConfiguration()

CanAddProjectToRemoteDatabase
Checks if the project can be pushed to the remote database.
The project must be subscribable as read and write and it must be unsubscribed. Can only be
used if the database driver is set to Offline Mode.
int IntPrj.CanAddProjectToRemoteDatabase()

R ETURNS
0 project cannot be added to the remote database
1 project can be added to the remote database

CanSubscribeProjectReadOnly
Checks if a project can be subscribed read-only by the user executing the script.
int IntPrj.CanSubscribeProjectReadOnly()

R ETURNS
0 no permission to subscribe project
1 project can be subscribed

CanSubscribeProjectReadWrite
Checks if a project can be subscribed read-write by the user executing the script.
int IntPrj.CanSubscribeProjectReadWrite()

712
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 no permission to subscribe project
1 project can be subscribed

ClearInvalidReferences
Removes all references from the project which can no longer be resolved due to target objects
being deleted or projects no longer being available in the database, i.e. project stubs and non-
migrated projects.
int IntPrj.ClearInvalidReferences(int type)

A RGUMENTS
type
0 Remove references to deleted objects
1 Remove references to project stubs and non-migrated projects
2 Remove both

R ETURNS
Number of references cleared.

CopyDataExtensionFrom
Copies the Data Extension configuration from another project into this project. The configuration
is applied immediately. The target project must be active.
int IntPrj.CopyDataExtensionFrom(object other)

A RGUMENTS
other Project to copy the Data Extension configuration from.

R ETURNS
0 Copied successfully
1 Target project is not active
2 Source object is not a project
3 Error during copying, see Output Window

CreateVersion
Creates a new version of project it was called on.
Optionally allows to pass the version name, the timestamp, a bool for user notification, a bool to
enforce project approval and a description.
object IntPrj.CreateVersion([string name = '',]
[int timestamp = 0,]
[int notifyUsers = 0,]
[int approvalRequired = 0,]
[string description = '']
)
object IntPrj.CreateVersion(int notifyUsersAndApprovalRequired,

713
3.6. OTHERS CHAPTER 3. OBJECT METHODS

[string name = '',]


[int timestamp = 0,]
[string description = '']
)

A RGUMENTS
name Version name. The default version name e.g. ’Project Version’ is used on an
empty string. (default: empty string)
timestamp
Seconds since 01.01.1970 00:00:00. On zero the current date and time is used.
(default: 0)
notifyUsers
User notifications activated:
0 Create version and do not notify users (default).
1 Notify users.

approvalRequired
Project approval required:
0 Create version without approval (default).
1 Require approval.

notifyUsersAndApprovalRequired
Project approval required and user notifications activated:
0 Create version without approval and do not notify users (default).
1 Require approval and notify users.

description
Version description. (default: empty string)

R ETURNS
object Newly created IntVersion object.
NULL On failure e.g. missing permission rights.

Deactivate
De-activates the project if it is active. Does nothing otherwise.
int IntPrj.Deactivate()

R ETURNS
0 on success
1 on error

714
3.6. OTHERS CHAPTER 3. OBJECT METHODS

EndDataExtensionModification
Terminates a Data Extension modification previously initiated with BeginDataExtensionModifi-
cation.
This will deactivate the Study Case if the new Data Extension configuration can be applied. In
case of errors the project will be deactivated and rolled back. Omitting the call to EndDataEx-
tensionModification and exiting from the script will discard all changes to the Data Extension
configuration.
void IntPrj.EndDataExtensionModification()

S EE ALSO

IntPrj.BeginDataExtensionModification()

GetDerivedProjects
Return a set holding all versions created in the project.
set IntPrj.GetDerivedProjects()

R ETURNS
Set holding all versions of a project.

GetExternalReferences
Fills the given map with objects from this project mapping to its external references.
int IntPrj.GetExternalReferences(object resultMap,
[object externalReferencesSettings])

A RGUMENTS
resultMap
DPL map (IntDplmap) which will contain objects mapping to its external refer-
ences. Objects without external references are not mapped.
externalReferencesSettings (optional)
External References settings object (SetExtref). Defines the properties for objects
being external references. The External References settings object from current
user is used if ommitted.

R ETURNS
0 Getting external references succeeded.
1 Getting external references cancelled in dialogue or failed e.g project inactive or
not migrated.

S EE ALSO

IntPrj.HasExternalReferences(), IntPrj.PackExternalReferences()

GetGeoCoordinateSystem
Returns the EPSG code of the geographic coordinate system in which the geo coordinates of
the project’s net elements are stored.
int IntPrj.GetGeoCoordinateSystem()

715
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
EPSG code of the project’s geographic coordinate system, or 0 if the coordinate system is
not known.

GetLatestVersion
Returns the most recent version available in the project which has the notify users option set.
Optionally allows to consider all versions, regardless of notify users option.
object IntPrj.GetLatestVersion([int onlyregular])

A RGUMENTS
onlyregular (optional)
1 consider only regular version (default)
0 consider all versions

R ETURNS
Latest version of the project

GetVersions
Returns a set containing all versions of the project.
set IntPrj.GetVersions()

R ETURNS
Set that contains all versions of the project

HasExternalReferences
Checks if any object inside the project references external non-system objects and prints a
report to the Output Window.
int IntPrj.HasExternalReferences([int considerGlobal = 1,]
[int considerRemoteVariants = 0]
)
int IntPrj.HasExternalReferences(object externalReferencesSettings)

A RGUMENTS
considerGlobal (optional)
0 References to global (non-system) objects are not considered as ex-
ternal references.
1 References to global (non-system) objects are considered as external
references (default).
considerRemoteVariants (optional)
0 References to remote variants are not considered as external refer-
ences (default).
1 References to remote variants are considered as external references.
externalReferencesSettings (optional)
External References settings object (SetExtref). Defines the properties for objects
being external references.

716
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 No external reference was found.
1 An external reference was found.

S EE ALSO

IntPrj.PackExternalReferences(), IntPrj.GetExternalReferences()

LoadData
Loads all objects of the project from the data base. Does nothing when called on an active
project.
This function is useful to optimise searches which would traverse deep into an inactive project.
void IntPrj.LoadData()

MergeToBaseProject
Merges the modifications of a derived project to the base project.
int IntPrj.MergeToBaseProject(int conflictMode)

A RGUMENTS
conflictMode
Assignment in case of modification conflict:

0 Favour none. Diff browser is shown in case of conflicts.


1 Favour base version.
2 Favour derived project.
3 Favour base project.

R ETURNS

0 Merge finished sucessfully.


1 Merge failed (no further information).
2 Merge failed due to failing assignment check.
3 Merge failed due to invalid projects (e.g. no derived project).
4 Merge was canceled by user.
5 Merge completed with errors (see output window).

Migrate
Migrates a project from version V13 to V14. Migration is only executed if project has been
created in build 400 or earlier (and is not yet migrated).
void IntPrj.Migrate([int createCopy])

717
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
createCopy (optional)
1 Creates a copy of current project (original copy is maintained) (default)
0 Does an ”in-place” migration of the project (original is overwritten)

NormaliseCombined
Normalises a combined project so it appears to be a regular project. This will remove all
intermediate folders which were added when creating the combined project. This might lead
to naming duplications which will be resolved by the normal logic of numbering duplicates.
int IntPrj.NormaliseCombined()

R ETURNS
0 operation was successful
1 operation was cancelled because the project is active

PackExternalReferences
Packs external references of this project and prints a report to the Output Window.
int IntPrj.PackExternalReferences([object externalReferencesSettings])

A RGUMENTS
externalReferencesSettings (optional)
External References settings object (SetExtref). Defines the properties for objects
being external references. The External References settings object from current
user is used if ommitted.

R ETURNS
0 Packing external references succeeded.
1 Packing external references cancelled in dialogue or failed e.g project inactive or
not migrated.

S EE ALSO

IntPrj.HasExternalReferences(), IntPrj.GetExternalReferences()

Purge
Purges project storage and updates storage statistics.
Requires write access to the project; the functions does nothing when the project is locked by
another user.
void IntPrj.Purge()

PurgeObjectKeys
Purges project’s object key table.

718
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Number of purged records. −1 in case of errors.
int IntPrj.PurgeObjectKeys()

RemoveProjectFromCombined
Removes a project from a combined project. For the removal the mapping key must be specified.
Mapping keys are stored in the project, parameter project mapped. The project this method is
called on must be activated but not have a Study Case active, otherwise this method will fail.
int IntPrj.RemoveProjectFromCombined(string mappingKey)

A RGUMENTS
mappingKey
The mapping key for the project that should be removed

R ETURNS
0 operation was successful
1 an unknown error occurred
2 an error occurred and is documented in the output window

Restore
Restores an archived project so it can be used again. Does nothing if the project is not an
archived one.
int IntPrj.Restore()

R ETURNS
0 project has not been restored
1 project has been restored

SetGeoCoordinateSystem
Defines the the geographic coordinate system in which the geo coordinates of the project’s net
elements are stored.
void IntPrj.SetGeoCoordinateSystem(int epsgCode)

A RGUMENTS
epsgCode
EPSG code of the geographic coordinate system to be used for this project. A
value of 0 denotes an unknown coordinate system.

719
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SubscribeProjectReadOnly
Subscribes a project read only if the permission is granted.
Can only be used if the database driver is set to Offline Mode.
void IntPrj.SubscribeProjectReadOnly()

SubscribeProjectReadWrite
Subscribes a project read/write if the permission is granted.
Can only be used if the database driver is set to Offline Mode.
void IntPrj.SubscribeProjectReadWrite()

TransformGeoCoordinates
Transforms geographic coordinates from a source coordinate system to a destination coordinate
system. Geodetic coordinates (longitude/latitude) are specified in decimal degrees. Projected
coordinates are specified in meters.
int IntPrj.TransformGeoCoordinates(double xIn, double yIn,
double& xOut, double& yOut,
int sourceEpsg, int destEpsg
)

A RGUMENTS
xIn horizontal component of the input location: x position or longitude, resp.
yIn vertical component of the input location: y position or latitude, resp.
xOut (out)
horizontal component of the output location: x position or longitude, resp.
yOut (out)
vertical component of the output location: y position or latitude, resp.
sourceEpsg
EPSG code of the source coordinate system

destEpsg EPSG code of the destination coordinate system

R ETURNS
0 operation was successful
1 an error occurred

TransformToGeographicCoordinateSystem
Transforms geographic coordinates of all net elements contained by the project to a destina-
tion coordinate system, and updates the configured project coordinate system accordingly.
Please note: The project’s geographic diagram needs to be shown when this function is called.
Otherwise, annotations will not be transformed.
int IntPrj.TransformToGeographicCoordinateSystem(int destEpsg)

720
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
destEpsg EPSG code of the destination coordinate system

R ETURNS
0 operation was successful
1 an error occurred

E XAMPLE
The following example transforms the active project to Gauss-Krueger Zone 3 coordinates
(EPSG code: 31467):
object prj;
prj = GetActiveProject();
prj.TransformToGeographicCoordinateSystem(31467);

UnsubscribeProject
Unsubscribes a project.
Can only be used if the database driver is set to Offline Mode.
void IntPrj.UnsubscribeProject()

UpdateStatistics
Updates the storage statistics for a project. The statistics are displayed on the page Storage of
a project.
Note: This function requires write access to the project otherwise the update is not executed
and an error message is printed to the output window.
void IntPrj.UpdateStatistics()

UpdateToDefaultStructure
Updates folder structure of currently active project to that of the default project (used for creation
of new projects). Existing folders will be moved to a new location within the project. Folders that
have no correspondence in the default project will remain untouched.
NB: Folders might get moved or additional ones might be created, but no folder is deleted by
this routine.
int IntPrj.UpdateToDefaultStructure(int createMissingFolders, int updateForeignKeys)

A RGUMENTS
createMissingFolders (optional)
0 Missing folders will not be created. Only existing ones will be moved to
new locations, if required.
1 Missing folders will be created (default).
updateForeignKeys (optional)
0 Foreign-keys of folders will not be updated.
1 Foreign-keys of folders will be updated (default).

721
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 operation was successful
1 operation was not successful, e.g. project not active

UpdateToMostRecentBaseVersion
Updates a derived project to the most recent version of the base project. This is done by creating
a new derived project from the new version and (optionally) merging the modifications from the
existing derived project into it.
int IntPrj.UpdateToMostRecentBaseVersion(object& newDerivedProject,
int versionWithNotification,
int discardOwnModifications,
[int conflictMode = 0]
)

A RGUMENTS
newDerivedProject (out)
New derived project if no error occured.
versionWithNotification
0 Update to the most recent version independent of the ”Notify users”
setting.
1 Update to the most recent version with ”Notify users” enabled.
discardOwnModifications
0 Merge modifications of new version and derived project.
1 Discard modifications of derived project. The Compare and Merge Tool
is not used at all.

conflictMode (optional)
Assignment in case of modification conflict (only used if not discarding derived
modifications):

0 Favour none. Diff browser is shown in case of conflicts. (default)


1 Favour new base version.
2 Favour derived project.

R ETURNS
0 Merge finished sucessfully.
1 Merge failed (no further information).
2 Merge failed due to failing assignment check.
3 Merge failed due to invalid projects (e.g. no derived project).
4 Merge was canceled by user.
5 Merge completed with errors (see output window).

722
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.31 IntPrjfolder
Overview

GetProjectFolderType*
IsProjectFolderType*

GetProjectFolderType*
Returns the type of the project folder stored in attribute “iopt type”.
The following types are currently available (language independent):

• blk - User Defined Models


• cbrat - CB Ratings
• chars - Characteristics
• cstgen - Generator Cost Curves
• effgen - Generator Efficiency Curves
• rnd - Probabilistic Assessment
• cim - CIM Model
• common - Common Mode Failures
• demand - Demand Transfers
• dia - Diagrams
• equip - Equipment Type Library
• fault - Faults
• ras - Remedial Action Schemes
• gen - Generic
• lib - Library
• lvdata - Coincidence Definitions
• mvar - Mvar Limit Curves
• netdat - Network Data
• netmod - Network Model
• oplib - Operational Library
• outage - Outages
• qpc - QP-Curves
• ra - Running Arrangements
• report - Reports
• docs - Document Reports
• tables - Table Reports
• scen - Operation Scenarios

723
3.6. OTHERS CHAPTER 3. OBJECT METHODS

• scheme - Variations

• script - Scripts
• study - Study Cases
• sw - StationWare
• tariff - Tariffs

• templ - Templates
• therm - Thermal Ratings
• ucc - V-Control-Curves

string IntPrjfolder.GetProjectFolderType()

R ETURNS
The type of the project folder as string. For possible return values see list above.

S EE ALSO

GetProjectFolder()

IsProjectFolderType*
This function checks if a project folder is of given type.
int IntPrjfolder.IsProjectFolderType(string type)

A RGUMENTS
type Folder type; for possible type values see IntPrjfolder.GetProjectFolderType()

R ETURNS
1 true, is of given type
0 false, is not of given type

S EE ALSO

GetProjectFolder(), IntPrjfolder.GetProjectFolderType()

3.6.32 IntQlim
Overview

GetQlim*

GetQlim*
Returns either the current maximum or the minimum reactive power limit, given the specified
active power and voltage.
The active power must be given in the same units as the input mode definition of the capability
curve object (parameter ”inputmod” is 0 for MW/Mvar and 1 for p.u.).
double IntQlim.GetQlim(double p,
double v,

724
3.6. OTHERS CHAPTER 3. OBJECT METHODS

[double minmax]
)

A RGUMENTS
p the current value of active power in MW or p.u.
v the current value of voltage in p.u.
minmax (optional)
Returns either the maximum or minimum value. Possible values are:
-1 minimum value
1 maximum value. This is the default value

R ETURNS
Returns the minimum/maximum limit. The units might be Mvar or p.u., depending on the
input mode of the capability curve. Also, the limits are calculated for a single machine.

E XAMPLE
set generators;
object generator, qlim;
double minlim, maxlim;
int inp;

! gets the maximum and minimum values of reactive power limits


! of all synchronous generators, only if they have defined
! a capability curve
generators = GetCalcRelevantObjects('*.ElmSym');
for(generator=generators.First(); generator; generator=generators.Next())
{
qlim = generator:pQlimType;
if (qlim) {
inp = qlim:inputmod;
if (inp=0) { ! MW/MVAR
minlim = qlim.GetQlim(generator:pgini, 1, -1);
maxlim = qlim.GetQlim(generator:pgini, 1, 1);
printf('Limits for %o in %o: min = %f, max= %f', generator, qlim, minlim, maxlim);
}
else { ! PU MODE
minlim = qlim.GetQlim(generator:pgini/generator:t:sgn, 1, -1);
maxlim = qlim.GetQlim(generator:pgini/generator:t:sgn, 1, 1);
printf('Limits for %o in %o: min = %f, max= %f', generator, qlim, minlim, maxlim);
}
}
}

725
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.33 IntRas
Overview

AddEvent
AddTrigger
IsValid

AddEvent
Adds an event to the Remedial Action Scheme.
void IntRas.AddEvent(object newEvent)

A RGUMENTS
newEvent
The event that shall be added.

AddTrigger
Adds either a condition or a gate to the Remedial Action Scheme.
void IntRas.AddTrigger(object newTrigger)

A RGUMENTS
newTrigger
The condition or gate that shall be added.

IsValid
Checks if the Remedial Action Scheme is valid.
int IntRas.IsValid(int emitMessage = 0)

A RGUMENTS
emitMessage
Emit messages if not equal to zero.

R ETURNS
0 If invalid.
1 If valid.

726
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.34 IntReport
Overview

AddObject
AddObjects
CreateField
CreateTable
GetFieldCount
GetFieldDataType
GetFieldName
GetObjects
GetParameterValueAsDouble
GetParameterValueAsInteger
GetParameterValueAsString
GetRowCount
GetTableCount
GetTableName
GetValueAsDouble
GetValueAsInteger
GetValueAsObject
GetValueAsString
Reset
SetDefaultValue
SetValue

AddObject
Adds the given object to the set of objects that are considered during report creation.
Typically, objects are automatically collected based on the Variable Selections in the report.
In some cases, however, it might be necessary to manually add objects to the report creation
mechanism.
The added object will be included in the return value of IntReport.GetObjects(). Moreover, if a
Variable Selection for the class of the given object exists in the report, the corresponding table
will include a row for the given object.
If the given object is already present in the set of collected objects (regardless if it was automat-
ically collected or added with a previous call of this method or IntReport.SetObjects()), it will not
be added a second time.
void IntReport.AddObject(object objectToAdd)

A RGUMENTS
objectToAdd
The object to be added to the report generation mechanism. Null objects are
ignored.

S EE ALSO

IntReport.AddObjects(), IntReport.GetObjects()

727
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddObjects
Adds the given list of objects to the set of objects that are considered during report creation.
See IntReport.AddObject() for more details on adding objects.
void IntReport.AddObjects(set objectsToAdd)

A RGUMENTS
objectsToAdd
List of objects to be added to the report generation mechanism.

S EE ALSO

IntReport.AddObject(), IntReport.GetObjects()

CreateField
Creates a new field (i.e. a column) with the specified name and data type, appending it
to the specified table. The referenced table must have been previously created using the
IntReport.CreateTable() method.
int IntReport.CreateField(string tableName, string fieldName, int dataType)

A RGUMENTS
tableName
The name of a table (previously created using IntReport.CreateTable()).
fieldName
The name of the new field, which must satisfy all of the following conditions:
• The name is not empty.
• The name only includes characters of the English alphabet, digits and under-
scores.
• The name does not start with a digit or a capital (upper-case) character.

dataType An integer specifying the data type of the field. Possible values are
0 String
1 Integer
2 Floating point number (double)
3 Object

R ETURNS
An error code. Possible values are

0 No error has occurred, the field has been successfully created.


1 No table with the given name has been found.
2 The given field name is empty or blank.
3 Another field with the given name was already created for the specified table.
4 The given data type has no valid value (see argument description of dataType).

728
3.6. OTHERS CHAPTER 3. OBJECT METHODS

S EE ALSO

IntReport.GetFieldCount(), IntReport.GetFieldName(), IntReport.GetFieldDataType()

CreateTable
Creates a new table with the given name.
In order to be visible in the Report Designer, a table needs to have at least one field (i.e. a
column). Fields are created using the IntReport.CreateField() method.
Using the IntReport.SetValue() method, a table with fields can be filled with values, which are
stored in rows (containing one value per table field).
Please note that the name of the table will be shown with the prefix ’Scripted’ in the Report
Designer (e.g. a table created with the name ’MyTable’ will be shown as ’ScriptedMyTable’ in
the Report Designer). This mechanism helps to avoid name collisions with other, automatically
generated tables (e.g. tables based on Variable Selections) and allows to quickly identify tables
created by scripts in the Report Designer.
int IntReport.CreateTable(string name)

A RGUMENTS
name The name of the new table, which may only include characters of the English
alphabet, digits and underscores and must not be empty.

R ETURNS
An error code. Possible values are

0 No error has occurred, the table has been successfully created.


1 The given table name is empty or blank.
2 The given table name contains invalid characters (see description of argument
name).
3 Another table with the given name was already created.

GetFieldCount
Returns the number of fields in the specified table.
int IntReport.GetFieldCount(string tableName)

A RGUMENTS
tableName
The name of the table.

R ETURNS
The number of fields in the specified table or -1 if the specified table does not exist.

S EE ALSO

IntReport.CreateField(), IntReport.GetFieldName(), IntReport.GetFieldDataType()

729
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetFieldDataType
Returns the data type (encoded as integer) of the specified field in the specified table.
int IntReport.GetFieldDataType(string tableName, string fieldName)

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.

R ETURNS
An integer specifying the data type of the field or signalling an error. Possible values are

-1 Error. The specified table or the specified field does not exist.
0 String
1 Integer
2 Floating point number (double)
3 Object

S EE ALSO

IntReport.CreateField(), IntReport.GetFieldCount(), IntReport.GetFieldName()

GetFieldName
Determines the name of the field at the given field index of the specified table.
The given field index must be a non-negative number that is smaller than the field count of the
specified table, which can be determined by calling IntReport.GetFieldCount().
string IntReport.GetFieldName(string tableName, int fieldIndex, string& name)

A RGUMENTS
tableName
The name of the table.
fieldIndex The index of the field (non-negative integer that is smaller than the field count of
the specified table).

name (out)
The name of the field.

R ETURNS
An error code. Possible values are:

0 No error has occurred, the field name has been successfully determined.
1 The specified table does not exist or the field index is out of bounds.

S EE ALSO

IntReport.CreateField(), IntReport.GetFieldCount(), IntReport.GetFieldDataType()

730
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetObjects
Returns all objects that were collected by the report generation mechanism.
Besides objects that were automatically collected based the Variable Selections of a report,
this set also includes objects that were added in the AddObjects script of the report (see
IntReport.AddObject() for details).
set IntReport.GetObjects()

R ETURNS
A list of all collected objects.

S EE ALSO

IntReport.AddObject(), IntReport.AddObjects()

GetParameterValueAsDouble
Returns the current value of the report parameter with the specified identifier as double.
This method is intended to be used with report parameters of data type ’Double’ only.
int IntReport.GetParameterValueAsDouble(string identifier, double& value)

A RGUMENTS
identifier The identifier of the report parameter.
value (out)
The current value of the report parameter.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No report parameter with the given identifier has been found.
2 The data type of the specified parameter is not numeric, conversion into double is
not possible.

S EE ALSO

IntReport.GetParameterValueAsString(), IntReport.GetParameterValueAsInteger()

GetParameterValueAsInteger
Returns the current value of the report parameter with the specified identifier as integer.
This method is intended to be used with report parameters of data type ’Integer’ or ’Boolean’
only.
Please note that the values of boolean report parameters are treated as integers, with 0 repre-
senting ’false’ and 1 representing ’true’.
int IntReport.GetParameterValueAsInteger(string identifier, int& value)

A RGUMENTS
identifier The identifier of the report parameter.
value (out)
The current value of the report parameter.

731
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No report parameter with the given identifier has been found.
2 The data type of the specified parameter is not numeric, conversion into integer is
not possible.

S EE ALSO

IntReport.GetParameterValueAsString(), IntReport.GetParameterValueAsDouble()

GetParameterValueAsString
Returns the current value of the report parameter with the specified identifier as string.
This method is intended to be used with report parameters of data type ’String’ only.
int IntReport.GetParameterValueAsString(string identifier, string& value)

A RGUMENTS
identifier The identifier of the report parameter.
value (out)
The current value of the report parameter.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No report parameter with the given identifier has been found.

S EE ALSO

IntReport.GetParameterValueAsInteger(), IntReport.GetParameterValueAsDouble()

GetRowCount
Returns the number of rows of the specified table.
The row count of a table is determined by the highest position, for which any of its field was
assigned a value using the method IntReport.SetValue(). As positions start with zero (i.e. the
first table row has position zero, the second table row has position one, and so on), the row
count is always the highest position plus one. If the method IntReport.SetValue() method has
not been called on any field of the table, the row count will be zero. The value returned by this
method can thus be used to determine the position for a new table row.
int IntReport.GetRowCount(string tableName)

A RGUMENTS
tableName
The name of the table.

R ETURNS
The number of rows in the specified table or -1 if the specified table does not exist.

732
3.6. OTHERS CHAPTER 3. OBJECT METHODS

S EE ALSO

IntReport.SetValue(), IntReport.GetValue()

GetTableCount
Returns the number of tables that have been created (using IntReport.CreateTable()).
int IntReport.GetTableCount()

R ETURNS
The number of tables that have been created (using IntReport.CreateTable()).

S EE ALSO

IntReport.GetTableName()

GetTableName
Determines the name of the table with the given table index.
The given table index must be a non-negative number that is smaller than the current table
count, which can be determined by calling IntReport.GetTableCount().
string IntReport.GetTableName(int tableIndex, string& name)

A RGUMENTS
tableIndex
The index of the table (a non-negative integer that is smaller than the current table
count).
name (out)
The name of the table.

R ETURNS
An error code. Possible values are:

0 No error has occurred, the table name was successfully determined.


1 The given table index is out of bounds.

S EE ALSO

IntReport.GetTableCount()

GetValueAsDouble
Determines the double value at the given position (row) of the specified field in the specified
table.
If the value at the given position of the specified field was not previously set (see IntReport.SetValue()),
the default value of the field is returned instead (see IntReport.SetDefaultValue()).
This method is intended to be used with double fields only.
int IntReport.GetValueAsDouble(string tableName, string fieldName,
int position, double& value)

733
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.

position The position (row).


value (out)
The value at the given position (row) of the specified field in the specified table.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value argument does not match the data type of the
given field.
4 The given position is out of bounds (negative or equal or greater than the row
count of the table).

S EE ALSO

IntReport.SetValue(), IntReport.SetDefaultValue(), IntReport.GetValueAsString(), IntReport.GetValueAsInteger(),


IntReport.GetValueAsObject()

GetValueAsInteger
Determines the integer value at the given position (row) of the specified field in the specified
table.
If the value at the given position of the specified field was not previously set (see IntReport.SetValue()),
the default value of the field is returned instead (see IntReport.SetDefaultValue()).
This method is intended to be used with integer fields only.
int IntReport.GetValueAsInteger(string tableName, string fieldName,
int position, int& value)

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.
position The position (row).

value (out)
The value at the given position (row) of the specified field in the specified table.

734
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value argument does not match the data type of the
given field.
4 The given position is out of bounds (negative or equal or greater than the row
count of the table).

S EE ALSO

IntReport.SetValue(), IntReport.SetDefaultValue(), IntReport.GetValueAsString(), IntReport.GetValueAsDouble(),


IntReport.GetValueAsObject()

GetValueAsObject
Determines the object at the given position (row) of the specified field in the specified table.
If the object at the given position of the specified field was not previously set (see IntRe-
port.SetValue()), the null object is returned instead.
This method is intended to be used with object fields only.
int IntReport.GetValueAsObject(string tableName, string fieldName,
int position, object& value)

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.
position The position (row).

value (out)
The object at the given position (row) of the specified field in the specified table.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value argument does not match the data type of the
given field.
4 The given position is out of bounds (negative or equal or greater than the row
count of the table).

S EE ALSO

IntReport.SetValue(), IntReport.SetDefaultValue(), IntReport.GetValueAsString(), IntReport.GetValueAsInteger(),


IntReport.GetValueAsDouble()

735
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetValueAsString
Determines the string value at the given position (row) of the specified field in the specified table.
If the value at the given position of the specified field was not previously set (see IntReport.SetValue()),
the default value of the field is returned instead (see IntReport.SetDefaultValue()).
This method is intended to be used with string fields only.
int IntReport.GetValueAsString(string tableName, string fieldName,
int position, string& value)

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.
position The position (row).
value (out)
The value at the given position (row) of the specified field in the specified table.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully read.


1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value argument does not match the data type of the
given field.
4 The given position is out of bounds (negative or equal or greater than the row
count of the table).

S EE ALSO

IntReport.SetValue(), IntReport.SetDefaultValue(), IntReport.GetValueAsInteger(), IntReport.GetValueAsDouble()


IntReport.GetValueAsObject()

Reset
Removes all objects and tables added by the extension script.
When an extension script is executed outside of the regular Report Generation mechanism (e.g.
by pressing the ’Execute’ button of the script), all added objects and tables remain in the memory
of the corresponding Report Template (IntReport) object even after the script was executed. By
calling this method at the beginning of the extension script, i.e. before any objects or tables
are added, users can make sure that no added objects or tables from a previous, manual script
execution are left.
When running the regular Report Generation command, this method is automatically called
before the extension script is executed.
void IntReport.Reset()

736
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetDefaultValue
Stores the given value as default value for the specified field of the specified table. The specified
table and field must have been previously created using IntReport.CreateTable() and IntRe-
port.CreateField(), respectively.
If the default value of a field is not explicitly set, its default value is either an empty string (for
string fields), zero (for integer and double fields) or null (for object fields).
Please note that the default value of object fields cannot be changed.
int IntReport.SetDefaultValue(string tableName, string fieldName,
int|double|string value)

A RGUMENTS
tableName
The name of the table.
fieldName
the name of the field.
value The value that should be used as default value.

R ETURNS
An error code. Possible values are

0 No error has occurred, the default value has been successfully set.
1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value does not match the data type of the given field.
4 The data type of the given value is not supported by this method.

S EE ALSO

IntReport.SetValue(), IntReport.GetValue()

SetValue
Stores the given value at the position in the specified field of the specified table. The specified
table and field must have been previously created using IntReport.CreateTable() and IntRe-
port.CreateField(), respectively.
If the given field is a string field, numeric values are implicitly converted into strings and if
the given field is an integer field, double values are implicitly converted into integers (and vice
versa). Trying to store a string value to a numeric (i.e. integer or double) will result in an error
(see return value). Furthermore, objects can only be stored in object fields and object fields
only accept objects.
In order to use this method effectively, it is important to understand how fields work. Each
field maps positions (non-negative integers) to values of its data type, e.g. a string field maps
positions to strings. When a field is created (see IntReport.CreateField()), it does not map any
position to a value. By calling this method (for each desired field and position), users specify
what value is stored at which position. The highest position, for which at least one field in a table
has a value set, determines the row count of the table (see IntReport.GetRowCount()).
This means that users can conveniently set the value of a field at any desired position in any
order, but need to be aware that the row count of the whole table will be the highest position
they set a value for. If a valid position of a field (i.e. a non-negative integer that is smaller than
the current row count of the table) has not been assigned a value, the field will return its default

737
3.6. OTHERS CHAPTER 3. OBJECT METHODS

value whenever the value at the position is to be determined (see IntReport.GetValue()). The
default value of a field can be changed by calling the method IntReport.SetDefaultValue().
int IntReport.SetValue(string tableName,
string fieldName,
int position,
int|double|string|object value)

A RGUMENTS
tableName
The name of the table.
fieldName
The name of the field.
position The position (a non-negative integer; negative positions are treated as zero and
should not be used).

value The value that should be set in the given table, field and position.

R ETURNS
An error code. Possible values are

0 No error has occurred, the value has been successfully set.


1 No table with the given name has been found.
2 No field with the given name has been found in the given table.
3 The data type of the given value does not match the data type of the given field.
4 The data type of the given value is not supported by this method.

S EE ALSO

IntReport.SetDefaultValue(), IntReport.GetValue(), IntReport.GetRowCount()

3.6.35 IntRunarrange
Overview

GetSwitchStatus*

GetSwitchStatus*
Determines the status of the given switch in the running arrangement, without assigning or
applying the running arrangement.
int IntRunarrange.GetSwitchStatus(object switch)

A RGUMENTS
switch ElmCoup or StaSwitch from which to get the status stored in running arrange-
ment

R ETURNS
Status of the switch in the running arrangement. Possible values are

-1 Switch is not part of the running arrangement


0 Switch is open

738
3.6. OTHERS CHAPTER 3. OBJECT METHODS

1 Switch is closed

E XAMPLE
set substations, switches;
object substation, runarrange, switch;
int status;

substations = GetCalcRelevantObjects('ElmSubstat');

for(substation = substations.First(); substation; substation = substations.Next()){


runarrange = substation:pRA;

if(runarrange){
switches = substation.GetChildren(0, '*.ElmCoup');
for(switch = switches.First(); switch; switch = switches.Next()){
status = runarrange.GetSwitchStatus(switch);
printf('Status for %o in RA %o in substation %o. %d', switch, runarrange, substation,
}
}
}

3.6.36 IntScenario
Overview

Activate
Apply
ApplySelective
Deactivate
DiscardChanges
GetObjects*
GetOperationValue*
ReleaseMemory
Save
SetOperationValue

Activate
Activates a scenario. If there is currently another scenario active that one will be deactivated
automatically.
int IntScenario.Activate()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

739
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Apply
Copies the values stored in a scenario to the corresponding network elements. The value
transfer is identical to scenario activation, however, the scenario will not be activated. In case of
having an active variation or another scenario, the values will be recorded there.
int IntScenario.Apply([int requestUserConfirmation])
int IntScenario.Apply(int requestUserConfirmation,
[object parentfilter]
)

A RGUMENTS
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

parentfilter (optional)
If given, scenario data is only applied for given object and all of its children (hier-
archical filter)

R ETURNS
0 on success

ApplySelective
Similar to function Apply() but copies only the set of attributes listed in the given apply configu-
ration. An apply configuration is a folder consisting of variable selection objects (IntMon), one
per class. For each class the attributes to be copied can be selected.
int IntScenario.ApplySelective(object applyConfiguration)
int IntScenario.ApplySelective(int requestUserConfirmation,
object applyConfiguration
)

A RGUMENTS
applyConfiguration
folder containing variable selection objects

requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

R ETURNS
0 on succes

Deactivate
Deactivates the currently active scenario.
int IntScenario.Deactivate([int saveOrUndo])

740
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
saveOrUndo(optional)
Determines whether changes in active scenario will be saved or discarded before
the scenario is deactivated. If this argument is omitted, the user will be asked.
0 discard changes
1 save changes

R ETURNS
0 on success

DiscardChanges
Discards all unsaved changes made to a scenario.
int IntScenario.DiscardChanges([int resetCalculation])

A RGUMENTS
resetCalculation(optional)
Determines whether calculation results should be reset afterwards.
0 no reset, retain results
1 default, reset results

R ETURNS
0 on success
1 error, scenario was not modified or not active

GetObjects*
Returns a set of all objects for which operational data are stored in scenario.
set IntScenario.GetObjects()

R ETURNS
Set of all objects for which operational data are stored in scenario

GetOperationValue*
This function offers read access to the operation data values stored in the scenario.
int IntScenario.GetOperationValue(int&|double&|string&|object& value,
object obj,
string attribute,
[int fromObject])

A RGUMENTS
value (out)
variable that holds the value after call
obj object for which the operation to be retrieved

741
3.6. OTHERS CHAPTER 3. OBJECT METHODS

attribute name of the operation data attribute


fromObject
only if current scenario is active:
0 value is taken from scenario (as stored on db)
1 (default), value is taken from object (reflects un-saved modifications)

R ETURNS
0 on success

ReleaseMemory
Releases the memory used by a scenario. Any further access to the scenario will reload the
data from database. The function can be called on inactive scenarios only. Use this function
with care!
int IntScenario.ReleaseMemory()

R ETURNS
0 on success
1 error, scenario is active

Save
Saves the current active value of all operational attributes for all active network elements to
database.
int IntScenario.Save()

R ETURNS
0 successfully saved
1 error, scenario was not modified or not active

SetOperationValue
Offers write access to operational data stored in a scenario.
int IntScenario.SetOperationValue(int|double|string|object newvalue,
object obj,
string attribute,
[int toObject = 1]
)

A RGUMENTS
newvalue New value to store in the scenario.
obj Object for which the operation data to store.
attribute Name of the operation data attribute.
toObject Only if current scenario is active:
0 Value is only stored to scenario on db.
1 As 0 but value is also updated on object in memory. (default)

742
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success, otherwise 1.

3.6.37 IntScensched
Overview

Activate
Deactivate
DeleteRow
GetScenario*
GetStartEndTime*
SearchScenario*

Activate
Activates a scenario scheduler.
int IntScensched.Activate()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

Deactivate
Deactivates a scenario scheduler.
int IntScensched.Deactivate()

R ETURNS
0 successfully deactivated
1 error, e.g. already deactivates, no project and study case active

DeleteRow
Delete row(s) of the scenario scheduler.
void IntScensched.DeleteRow(int row, [int numberOfRows])

A RGUMENTS
row row number (begin with 0)
numberOfRows (optional)
number of rows to delete (default = 1)

GetScenario*
Get the scenario for corresponding time 'iTime'.
object IntScenario.GetScenario(int iTime)

743
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
iTime Time (UCTE) to get the corresponding scenario.

R ETURNS
NULL No scenario at time 'iTime'defined
IntScenario Scenario will be activated at time 'iTime'

GetStartEndTime*
Get start and end time of the corresponding scenario.
int IntScenario.GetStartEndTime(object scenario,
int& startTime,
int& endTime)

A RGUMENTS
scenario A scenario (IntScenario).
startTime (out)
Start time (time when the scenario is activated)).
endTime (out)
End time (time until the scenario is still activated).

R ETURNS
−1 Scenario not found (not part of scenario scheduler)
≥0 Vector index (index of scenario)

SearchScenario*
Search at which table index (row) the corresponding scenario is defined in the scheduler.
int IntScensched.SearchScenario(object scenarioObject)

A RGUMENTS
scenarioObject
scenario object

R ETURNS
−1 Scenario not found (not part of scenario scheduler).
≥0 Vector index (row, index of scenario).

744
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.38 IntScheme
Overview

Activate
Consolidate
Deactivate
GetActiveScheduler*
NewStage

Activate
Activates a variation and inserts a variation reference in a 'Variation Configuration Folder'stored
in the study case.
int IntScheme.Activate()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

Consolidate
Changes that are recorded in this variation will be permanently applied to the original location.
Note: Modified scenarios are not saved.
Works only:

• for non network variation e.g. used for Mvar Limit Curves, Thermal Ratings ...

• and the variation must be activated.

int IntScheme.Consolidate()

R ETURNS
0 On success.
1 If an error has occured.

Deactivate
Deactivates a variation and removes the variation reference in the 'Variation Configuration
Folder'stored in the study case.
int IntScheme.Deactivate()

R ETURNS
0 successfully deactivated
1 error, e.g. already deactivated, no project and study case active

745
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetActiveScheduler*
Returns the corresponding active variation scheduler or NULL if no scheduler is active for this
variation (IntScheme).
object IntScheme.GetActiveScheduler()

NewStage
Adds a new expansion stage into the variation (name = sname).
int IntScheme.NewStage(string name,
int activationTime,
int activate
)

A RGUMENTS
name Name of the new expansion stage.
activationTime
Activation time of the new expansion stage in seconds since 01.01.1970 00:00:00.
activate
1 The actual study time is changed to the parameter iUTCtime and the
varation will be activated. If the variation is a network variation, the
new created expansion stage is used as 'recording 'expansion stage.
If the variation (this) is not active, the variation will be automatically
activated.
0 Expansion stage and/or variation will not be activated.

3.6.39 IntSscheduler
Overview

Activate
Deactivate
Update

Activate
Activates a variation scheduler. An already activated scheduler for same variation will be
deactivated automatically.
int IntSscheduler.Activate()

R ETURNS
=0 On success
6= 0 If an error has occurred

746
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Deactivate
Deactivates a variation scheduler.
int IntSscheduler.Deactivate()

R ETURNS
=0 on success
6= 0 If an error has occurred especially if scheduler was not active (to be consistent
with scenario scheduler deactivate()).

Update
Update variation scheduler (updates internal reference stages).
int IntSscheduler.Update()

R ETURNS
=0 On success
6= 0 If an error has occurred

3.6.40 IntSstage
Overview

Activate
CreateStageObject
EnableDiffMode
GetVariation*
IsExcluded*
PrintModifications*
ReadValue*
WriteValue

Activate
Activates the expansion stage and sets the 'recording' expansion stage. The study time will be
automatically set to the correponsing time of the stage.
int IntSstage.Activate([int iQueryOption])

A RGUMENTS
iQueryOption
0 (default) The user must confirm the query.
1 The “Yes” button is automatically applied.
2 The “No” button is automatically applied.

R ETURNS
0 Successfully activated.
1 Error, e.g. scheme is not active.

747
3.6. OTHERS CHAPTER 3. OBJECT METHODS

CreateStageObject
Creates a stage object (delta or delete object) inside corresponding IntSstage.
object IntSstage.CreateStageObject(int type,
object rootObject
)

A RGUMENTS
type Kind of object to create
1 Delete object
2 Delta object

rootObject
(Original) object for which the stage object should be created.

R ETURNS
Stage object on success.

E XAMPLE
!for a given IntSstage 'stage' and a IntThrating 'rating'

!creates a delta object for that rating


delta = stage.CreateStageObject(2, rating);
printf('Delta object %o created.', delta);

!set new values to delta object


rating.GetSize('MyMatrix', sizex, sizey);
for(x = 0; x < sizex; x+=1){
for (y = 0; y < sizey; y+=1){
rating.GetVal(val, 'MyMatrix', x, y);

!get new value, e.g. 75% of old one


val = 0.75 * val;
!set value to delta object
delta.SetVal(val, 'MyMatrix', x, y);
}
}

EnableDiffMode
Enables the comparison mode for the variation management system. If the mode is enabled a
DELTA object is only created when the object is different.
void IntSstage.EnableDiffMode(int enable)

A RGUMENTS
enable
0 disables the difference/comparison mode
1 enables the difference/comparison mode

748
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetVariation*
Returns variation of expansion stage.
object IntSstage.GetVariation()

R ETURNS
Variation object corresponding to stage.

D EPRECATED N AMES
GetScheme

E XAMPLE
!for a given IntSstage 'oStage'
object variation;
variation = oStage.GetVariation();
if (variation) {
printf('The Variation corresponding to %o is %o.',oStage, variation);
}

IsExcluded*
Returns if expansion stage flag 'Exclude from Activation' is switched on (return value = 1) or not
(return value = 0). The function checks also if the stage is excluded regarding the restricted
validity period of the corresponding variation and considers also the settings of an variation
scheduler when defined.
double IntSstage.IsExcluded()

R ETURNS
1 if stage is excluded
0 if stage is considered

E XAMPLE
!for a given IntStage 'oStage'
int iStageStatus;
iStageStatus = oStage.IsExcluded();
if (iStageStatus=0) {
printf('The object %o is considered for activation.',oStage);
}
else {
printf('The object %o is not considered for activation.',oStage);

PrintModifications*
Reports in the the output window the modification of the corresponding expansion stage. Works
only if the expansion stage is the active 'recording 'expansion stage.
int IntSstage.PrintModifications([int onlyNetworkData,]
[string ignoredParameter]
)

749
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
onlyNetworkData (optional)
1 (default) Show only network data modifications. Graphical modifica-
tions are not report when the diagrams folder are recored.
0 Show all modifications

ignoredParameter (optional)
Comma separated list of parameters which are ignored for reporting.

R ETURNS
0 on success
1 if the actual expansion stage is not the 'recording 'expansion stage.

ReadValue*
Get the value for an attribute of an ADD or DELTA object which modifies “rootObj” (root object).
int IntSstage.ReadValue(double&|string&|object& value,
object rootObj,
string attributeName)

R ETURNS
=0 On success.
6= 0 Error e.g. wrong data type.

WriteValue
Writes a value for an attribute to an ADD or DELTA object which modifies rootObj (root object).
int IntSstage.WriteValue(double|string|object value,
object rootObj,
string attributeName)

R ETURNS
=0 On success.
6= 0 Error e.g. wrong data type.

3.6.41 IntSubset
Overview

Apply
ApplySelective
Clear
GetConfiguration*
GetObjects*

750
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Apply
Copies the values stored in a scenario to the corresponding network elements. The value
transfer is identical to scenario activation, however, the scenario will not be activated. In case of
having an active variation or another scenario, the values will be recorded there.
int IntSubset.Apply([int requestUserConfirmation])

A RGUMENTS
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

R ETURNS
0 on success

ApplySelective
Similar to function Apply() but copies only the set of attributes listed in the given apply configu-
ration. An apply configuration is a folder consisting of variable selection objects (IntMon), one
per class. For each class the attributes to be copied can be selected.
int IntSubset.ApplySelective(object applyConfiguration)
int IntSubset.ApplySelective(int requestUserConfirmation,
object applyConfiguration)

A RGUMENTS
applyConfiguration
folder containing variable selection objects
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

R ETURNS
0 on succes

Clear
Clears all values stored in the subset.
Please note that this function can only be called on subsets of currently in-active scenarios.
int IntSubset.Clear()

R ETURNS

0 On success.
1 On error, e.g. subset belongs to a currently active scenario.

751
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetConfiguration*
Returns class and attribute configuration for the subset.
string IntSubset.GetConfiguration(string subset)

A RGUMENTS
subset

R ETURNS
Returns a list of classes and attributes for which operational data are stored in subset.

GetObjects*
Returns a set of all objects for which operational data are stored in the subset.
set IntSubset.GetObjects()

R ETURNS
Set of all objects for which operational data are stored in the subset

3.6.42 IntThrating
Overview

GetCriticalTimePhase*
GetRating*
Resize

GetCriticalTimePhase*
This function returns the smallest duration (time-phase) for which the power flow is beyond the
rating.
double IntThrating.GetCriticalTimePhase(double Flow,
double Loading
)

A RGUMENTS
Flow Power from the load flow calculation, in MVA.
Loading Element loading, in %.

R ETURNS
>0 Smallest time-phase for which the flow is beyond the rating.
-1 In case that no rating is violated.

E XAMPLE
! External object with the rating characteristic: objTrf2W
double Time, Flow, Loading
object thermRating;
thermRating = objTrf2W:pRating;
if (thermRating) {

752
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Flow = 800;
Loading = 95;
Time = thermRating.GetCriticalTimePhase(Flow, Loading);
printf('The critical time-phase for which the power
%10.3f beyond the loading (%10.3f) is %10.3f', Flow, Loading, Time);
}

GetRating*
This function returns the rating in MVA according to the thermal rating table, considering element
overloading and its duration (time-phase).
double IntThrating.GetRating(double Loading,
double Duration
)

A RGUMENTS
Loading Element loading, in %.
Duration Duration or time phase for which the loading is considered, in minutes

R ETURNS
Rating in MVA or 0 if not found.

E XAMPLE
! External object with the rating characteristic: objTrf2W
double Rating, Loading, TimePhase;
object thermRating;
thermRating = objTrf2W:pRating;
if (thermRating) {
Loading = 84;
TimePhase = 10; ! for 10 Minutes
Rating = thermRating.GetRating(Loading, TimePhase);
printf('The Rating at Time-Phase %10.3f min when the loading
is %10.3f %: %10.3f MVA', TimePhase, Loading, Rating);
}

Resize
Resizes the configuration vectors like configTa,condigWind,configSolar,preload or duration
void IntThrating.Resize(int size, string name)

A RGUMENTS
size size of the referenced vector

name reference to the vector (’configTa’,’configWind’,’configSolar’, ’preload’ or ’duration’)

R ETURNS
If the resize is unsuccessful the error message shall be issued.

753
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.43 IntUrl
Overview

View

View
Requests the operating system to open given URL for viewing. The performed action depends
on the default action configured in the system. For example, by default 'http://www.google.com'
would be opened in standard browser.
Please note, the action is only executed if access to given URL is enabled in the 'External
Access' configuration of PowerFactory (IntExtaccess).
int IntUrl.View()

R ETURNS
The returned value reports the success of the operation:

0 Success, URL was opened


1 Error, URL was not opened (because of invalid address or security reasons)

3.6.44 IntUser
Overview

Purge
SetPassword
TerminateSession

Purge
Purges project storage and updates storage statistics for all projects of the user.
Requires write access to the project; the functions does nothing when the project is locked by
another user.
void IntUser.Purge()

SetPassword
Sets the password for the user the function is called on.
Note: Only the administrator user is allowed to use this function. He can (re-)set the password
for every user.
int IntUser.SetPassword(string newpassword)

A RGUMENTS
newpassword
Case sensitive user password to set

R ETURNS
Returns whether or not the password has successfully been set. Possible values are:

754
3.6. OTHERS CHAPTER 3. OBJECT METHODS

0 error
1 password set successfully

TerminateSession
Allows the Administrator to log out another user. Prints an error if the current user is not the
Administrator.
void IntUser.TerminateSession()

3.6.45 IntUserman
Overview

CreateGroup
CreateUser
GetGroups*
GetUsers*
UpdateGroups

CreateGroup
Creates a new user group of given name. If a group with given name already exists the existing
one is returned instead.
Note: Only Administrator user is allowed to call this function.
object IntUserman.CreateGroup(string name)

A RGUMENTS
name Given name of the user group

R ETURNS
Created user group (IntGroup)

CreateUser
Creates a new user with given name. If the user already exists the existing one is returned
instead.
Note: Only Administrator user is allowed to call this function.
object IntUserman.CreateUser(string name)

A RGUMENTS
name Given name of the user

R ETURNS
Created user (IntUser)

755
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetGroups*
Returns a container with all user groups.
Note: Only the administrator user is allowed to call this function.
set IntUserman.GetGroups()

R ETURNS
Set of all available users

GetUsers*
Returns a container with all users as they are currently visible in the Data Manager tree.
Note: Only the administrator user is allowed to call this function.
set IntUserman.GetUsers()

R ETURNS
Set of all available users

UpdateGroups
Updates the Everybody group so it contains all currently existing users and cleans it of removed
users.
void IntUserman.UpdateGroups()

3.6.46 IntVec
Overview

Get*
Init*
Max*
Mean*
Min*
Resize*
Save*
Set*
Size*
Sort*

756
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Get*
Get the value in row index. Index is one based, therefore the index of the first entry is 1.
double IntVec.Get(int index)

A RGUMENTS
index Index in vector, one based.

S EE ALSO

IntVec.Set()

E XAMPLE
See example of IntVec.Sort().

Init*
Initializes the vector. Resizes the vector and initializes all values to 0.
This operation is performed in memory only. Use IntVec.Save() to save the modified vector to
database.
void IntVec.Init(int size)

A RGUMENTS
size The new size of the vector.

E XAMPLE
See example of IntVec.Sort().

Max*
Gets the maximum value stored in the vector.
double IntVec.Max()

R ETURNS
The maximum value stored in the vector. Empty vectors return 0 as maximum value.

Mean*
Calculates the average value of the vector.
double IntVec.Mean()

R ETURNS
The average value of the vector. A value of 0. is returned for empty vectors.

Min*
Gets the minimum value stored in the vector.
double IntVec.Min()

757
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The minimum value stored in the vector. Empty vectors return 0 as minimum value.

Resize*
Resizes the vector. Inserted values are initialized to 0.
This operation is performed in memory only. Use IntVec.Save() to save the modified vector to
database.
void IntVec.Resize(int size)

A RGUMENTS
size The new size.

E XAMPLE
The following example resize a vector to size 4 and writes a avlue of 10 to the first entry.
object vectorObj;
int size,
row;
double value;

vectorObj = GetFromStudyCase('IntVec');
vectorObj.Resize(0);
vectorObj.Resize(4);
vectorObj.Set(1,10);
size = vectorObj.Size(); ! should be 4
for (row=1; row<=size; row+=1) {
value = vectorObj.Get(row);
printf('%d: %f',row,value);
}

Save*
Saves the current state of this vector to database.
If the matrix is calculation relevant, an optional parameter allows to control whether available
calculation results shall be reset afterwards or not.
Note: In QDSL, the calculation results are never reset and the parameter ”resetCalculation” is
ignored.
void IntVec.Save()
void IntVec.Save(int resetCalculation)

A RGUMENTS
resetCalculation (optional)
1 reset calculation results (default)
0 keep calculation results

758
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Set*
Set the value in row index. Index is one based, therefore the index of the first entry is 1.
The vector is resized automatically to size index in case that the index exceeds the current
vector size. Values inserted are automatically initialized to a value of 0.
This operation is performed in memory only. Use IntVec.Save() to save the modified vector to
database.
void IntVec.Set(int index,
double value)

A RGUMENTS
index Index in vector.
value Value to assign in row index.

S EE ALSO

IntVec.Get()

E XAMPLE
See example of IntVec.Sort().

Size*
Returns the size of the vector.
int IntVec.Size()

R ETURNS
The size of the vector.

E XAMPLE
See example of IntVec.Sort().

Sort*
Sorts the vector.
This operation is performed in memory only. Use IntVec.Save() to save the modified vector to
database.
void IntVec.Sort([int ascending = 0])

A RGUMENTS
ascending
Sort order:
0 Highest value first (descending, default).
1 Smallest value first (ascending).

E XAMPLE
The following script fills a vector and reports the initial values, the values after sorting in
increasing order and finally in decreasing order.

759
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object vectorObj;
int size,
row;
double value;

vectorObj = GetFromStudyCase('IntVec');
! resize to 4 rows, all containing 0
vectorObj.Init(4);
vectorObj.Set(1,1);
vectorObj.Set(2,3);
vectorObj.Set(3,2);
!vectorObj.Set(4,5); 4. row unchanged -> remains 0

size = vectorObj.Size();
Info('Initial Vector');
for (row=1; row<=size; row+=1) {
value = vectorObj.Get(row);
printf('%d: %f',row,value);
}
Info('Increasing');
vectorObj.Sort(1); ! sort increasing
for (row=1; row<=size; row+=1) {
value = vectorObj.Get(row);
printf('%d: %f',row,value);
}
Info('Decreasing');
vectorObj.Sort(0); ! sort decreasing
for (row=1; row<=size; row+=1) {
value = vectorObj.Get(row);
printf('%d: %f',row,value);
}

3.6.47 IntVecobj
Overview

Get*
Resize*
Save*
Search*
Set*
Size*

Get*
Get the object in row index. Index is one based, therefore the index of the first entry is 1.
object IntVecobj.Get(int index)

A RGUMENTS
index Index in vector, one based.

S EE ALSO

IntVecobj.Set()

760
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Resize*
Resizes the vector. Inserted new entries are initialized to NULL.
This operation is performed in memory only. Use IntVecobj.Save() to save the modified vector
to database.
void IntVecobj.Resize(int size)

A RGUMENTS
size The new size.

Save*
Saves the current state of this vector to database.
If the vector is calculation relevant, an optional parameter allows to control whether available
calculation results shall be reset afterwards or not.
Note: In QDSL, the calculation results are never reset and the parameter ”resetCalculation” is
ignored.
void IntVecobj.Save()
void IntVecobj.Save(int resetCalculation)

A RGUMENTS
resetCalculation (optional)
1 reset calculation results (default)
0 keep calculation results

Search*
Search if the object (obj) is part of the vecor and returns the corresponding index of the vector
(one based).
int IntVecobj.Search(object obj)

R ETURNS
1 ... size object found, located at index
0 object not part of vector

Set*
Set the object (obj) in row index. Index is one based, therefore the index of the first entry is 1.
The vector is resized automatically to size index in case that the index exceeds the current
vector size. Object inserted are automatically initialized to a value of NULL.
This operation is performed in memory only. Use IntVecobj.Save() to save the modified vector
to database.
void IntVecobj.Set(int index,
object obj)

761
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
index Index in vector.
obj Object to assign in row index.

S EE ALSO

IntVecobj.Get()

Size*
Returns the size of the vector.
int IntVecobj.Size()

R ETURNS
The size of the vector.

3.6.48 IntVersion
Overview

CreateDerivedProject
GetDerivedProjects
GetHistoricalProject
Rollback

CreateDerivedProject
Creates a derived project from the version.
object IntVersion.CreateDerivedProject(string name,
[object parent]
)

A RGUMENTS
name The name of the project which will be created.
parent(optional)
The parent of the project which will be created. Default is the current user.

R ETURNS
Returns the created project.

E XAMPLE
object project, version, derivedProject ;
project = GetActiveProject();
if (.not. project) {
Error('no active project found');
exit();
}

version = project.GetLatestVersion(0); !consider all versions


if (.not. version) {

762
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Error('no version found');


exit();
}

derivedProject = version.CreateDerivedProject('DerivedProject');

GetDerivedProjects
list of projects derived from this version
set IntVersion.GetDerivedProjects()

R ETURNS
list of derived projects

E XAMPLE
object project, version, derivedProject;
set versions, projects, derivedProjects;

project = GetActiveProject();

versions = project.GetVersions();
for (version=versions.First(); version; version=versions.Next()) {
Info('Derived projects of version %o', version);
derivedProjects = version.GetDerivedProjects();
for (derivedProject=derivedProjects.First(); derivedProject; derivedProject=derivedProject
Info(' %o', derivedProject);
}
}

GetHistoricalProject
Returns historic project within version
object IntVersion.GetHistoricalProject()

R ETURNS
Returns the historic project object

E XAMPLE
object project, version, historicProject ;
project = GetActiveProject();
version = project.GetLatestVersion(0); !consider all versions
historicProject = version.GetHistoricalProject();

Rollback
Roll backs the project to this version. No project have to be active. Furthermore no script from
the project of the version have to be running.
int IntVersion.Rollback()

763
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 otherwise

E XAMPLE
object project, version;
project = GetActiveProject();

! revert all changes since last version


version = project.GetLatestVersion(0);
project.Deactivate(); ! project must be inactive
version.Rollback();

3.6.49 IntViewbookmark
Overview

JumpTo
UpdateFromCurrentView

JumpTo
Opens the referenced diagram (if not already open) and sets the viewing area.
void IntViewbookmark.JumpTo()

UpdateFromCurrentView
Updates the bookmark’s diagram and view area from the current drawing window.
void IntViewbookmark.UpdateFromCurrentView()

3.6.50 PltAxis
Overview

DoAutoScale
SetFont

DoAutoScale
Adapts the axis range such that it includes the entire data range. Note: Only works if the plot
this axis belongs to is currently shown.
void PltAxis.DoAutoScale()

764
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetFont
Sets the font for this axis
void PltAxis.SetFont(string fontName,
int fontSize,
int fontStyle)

A RGUMENTS
fontName
Font name
fontSize Font size

fontStyle Font style


1 Bold
2 Italic
3 Bold and italic
4 Underline

3.6.51 PltComplexdata
Overview

AddVector
ChangeColourPalette
ClearVectors

AddVector
Appends a vector to the plot.
void PltComplexdata.AddVector(object element,
string complexVariable)

A RGUMENTS
element Element to display

complexVariable
Complex variable to display, e.g.: ’m:ur:bus1 + j * m:ui:bus1’

ChangeColourPalette
Colours the vectors according to the colour palette identified by the given name. Additionally,
the colour palette is set as the object’s default palette.
void PltComplexdata.ChangeColourPalette(string paletteName)

A RGUMENTS
paletteName
Name of the colour palette to apply

765
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 on error

ClearVectors
Removes all vectors from the plot.
void PltComplexdata.ClearVectors()

3.6.52 PltDataseries
Overview

AddCurve
AddXYCurve
ChangeColourPalette
ClearCurves
GetDataSource
GetIntCalcres

AddCurve
Appends a curve to the plot.
void PltDataseries.AddCurve(object element,
string varname,
[object datasource]
)

A RGUMENTS
element Element to display
varname Name of the element variable to display
datasource (optional)
Data source to assign to the curve (ElmRes or IntComtrade). If not specified, the
plot’s default result file will be used for the curve.

E XAMPLE
The following example finds a plot and adds a curve to it. The element line is assumed to
be passed to the script:
object page;
object graphicsBoard;
object plot;
object dataseries;
graphicsBoard = GetGraphicsBoard();
if (graphicsBoard) {
page = graphicsBoard.GetPage('Voltage');
if (page) {
plot = page.GetPlot('RST');
if (plot) {
dataseries = plot.GetDataSeries();
if (dataseries) {

766
3.6. OTHERS CHAPTER 3. OBJECT METHODS

dataseries.AddCurve(line, 'c:loading');
}
}
}
}

AddXYCurve
Appends a curve to a XY plot.
void PltDataseries.AddXYCurve(object elementX,
string varnameX,
object elementY,
string varnameY,
[object datasource]
)

A RGUMENTS
elementX Element to display on x-axis
varnameX
Name of the element variable to display on x-axis
elementY Element to display on y-axis
varnameY
Name of the element variable to display on y-axis
datasource (optional)
Data source to assign to the curve (ElmRes or IntComtrade). If not specified, the
plot’s default result file will be used for the curve.

ChangeColourPalette
Colours the curves according to the colour palette identified by the given name. Additionally,
the colour palette is set as the dataseries’ default palette.
void PltDataseries.ChangeColourPalette(string paletteName)

A RGUMENTS
paletteName
Name of the colour palette to apply

R ETURNS
0 on success
1 on error

ClearCurves
Removes all curves from the plot.
void PltDataseries.ClearCurves()

767
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetDataSource
Returns the data source that is used for the curve with given index.
object PltDataseries.GetDataSource(int curveIndex)

A RGUMENTS
int curveIndex
curve index in table, must be ≥ 0

R ETURNS
object Data source
NULL No data source found

GetIntCalcres
Gets all user Calculated Result objects (IntCalcres) stored inside the data series.
set PltDataseries.GetIntCalcres()

R ETURNS
All Calculated Result objects (IntCalcres) stored inside the data series.

3.6.53 PltLegend
Overview

SetFont

SetFont
Sets the font for this axis
void PltAxis.SetFont(string fontName,
int fontSize,
int fontStyle)

A RGUMENTS
fontName
Font name
fontSize Font size
fontStyle Font style

1 Bold
2 Italic
3 Bold and italic
4 Underline

768
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.54 PltLinebarplot
Overview

ChangeStyle
DoAutoScale
DoAutoScaleX
DoAutoScaleY
GetAxisX
GetAxisY
GetDataSeries
GetLegend
GetTitleObject
SetAutoScaleModeX
SetAutoScaleModeY
SetAxisSharingLevelX
SetAxisSharingLevelY
SetScaleTypeX
SetScaleTypeY
SetScaleX
SetScaleY

ChangeStyle
Applies the plot style identified by the given name to this plot.
void PltLinebarplot.ChangeStyle(string styleName)

A RGUMENTS
styleName
Name of the style template to apply

R ETURNS
0 on success
1 on error

DoAutoScale
Adapts the plot’s axes ranges such that they show the entire data range.
void PltLinebarplot.DoAutoScale([int axisDimension])

A RGUMENTS
axisDimension (optional)
Limits auto-scaling to one dimension. Possible values:
0 scale only x-axes
1 scale only y-axes

769
3.6. OTHERS CHAPTER 3. OBJECT METHODS

DoAutoScaleX
Adapts the plot’s x-axes ranges such that they show the entire data range.
void PltLinebarplot.DoAutoScaleX()

DoAutoScaleY
Adapts the plot’s y-axes ranges such that they show the entire data range.
void PltLinebarplot.DoAutoScaleY()

GetAxisX
Returns one of the plot’s x-axes.
object PltLinebarplot.GetAxisX([int axisIndex])

A RGUMENTS
axisIndex=0 (optional)
Determines which x-axis should be returned:
0 main x-axis
1 second x-axis (will be created if not yet present)

R ETURNS
PltAxis object

GetAxisY
Returns one of the plot’s y-axes.
object PltLinebarplot.GetAxisY([int axisIndex])

A RGUMENTS
axisIndex=0 (optional)
Determines which y-axis should be returned:
0 main y-axis
1 second y-axis (will be created if not yet present)

R ETURNS
PltAxis object

GetDataSeries
Returns the plot’s data series object (PltDataseries).
object PltLinebarplot.GetDataSeries()

R ETURNS
Data series object (PltDataseries)

770
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example creates a curve plot named 'RST' on the plot page named 'Voltage',
and retrieves its data series.
object graphicsBoard;
object page;
object plot;
object dataseries;
graphicsBoard = GetGraphicsBoard(); ! Look for open desktop
if (graphicsBoard) {
page = graphicsBoard.GetPage('Voltage',1);
if (page) {
plot = page.GetOrInsertCurvePlot('RST');
if (plot) {
dataseries = plot.GetDataSeries();
}
}
}

GetLegend
Returns the plot’s legend object (PltLegend).
object PltLinebarplot.GetLegend()

R ETURNS
Legend object (PltLegend)

GetTitleObject
Returns the plot’s title object (PltTitle).
object PltLinebarplot.GetTitleObject()

R ETURNS
Title object (PltTitle)

SetAutoScaleModeX
Defines whether the plot should automatically adapt its main x-axis range on data changes.
void PltLinebarplot.SetAutoScaleModeX(int mode)

A RGUMENTS
mode Possible values:
0 off (do not react to data changes)
1 adapt scale after calculation has finished
2 adapt scale during live plotting

771
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAutoScaleModeY
Defines whether the plot should automatically adapt its main y-axis range on data changes.
void PltLinebarplot.SetAutoScaleModeY(int mode)

A RGUMENTS
mode Possible values:
0 off (do not react to data changes)
1 adapt scale after calculation has finished
2 adapt scale during live plotting

SetAxisSharingLevelX
Defines whether the plot has its own x-axis or should share its x-axis across the page or the
entire graphics board.
void PltLinebarplot.SetAxisSharingLevelX(int level)

A RGUMENTS
level Possible values:
0 local (do not share x-axis)
1 use x-axis from page
2 use x-axis from graphics board

SetAxisSharingLevelY
Defines whether the plot has its own y-axis or should share its y-axis across the page or the
entire graphics board.
void PltLinebarplot.SetAxisSharingLevelY(int level)

A RGUMENTS
level Possible values:
0 local (do not share y-axis)
1 use y-axis from page
2 use y-axis from graphics board

SetScaleTypeX
Sets the scale type of the plot’s main x-axis.
void PltLinebarplot.SetScaleTypeX(int scaleType)

772
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
scaleType
Possible values:
0 linear
1 logarithmic

SetScaleTypeY
Set the scale type of the plot’s main y-axis.
void PltLinebarplot.SetScaleTypeY(int scaleType)

A RGUMENTS
scaleType
Possible values:

0 linear
1 logarithmic
2 dB

SetScaleX
Sets the scale of the plot’s main x-axis.
void PltLinebarplot.SetScaleX(double min,
double max
)

A RGUMENTS
min Minimum of x-scale.
max Maximum of x-scale.

SetScaleY
Sets the scale of the plot’s main y-axis.
void PltLinebarplot.SetScaleY(double min,
double max
)

A RGUMENTS
min Minimum of y-scale.

max Maximum of y-scale.

773
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.55 PltTitle
Overview

SetFont

SetFont
Sets the font for this axis
void PltAxis.SetFont(string fontName,
int fontSize,
int fontStyle)

A RGUMENTS
fontName
Font name
fontSize Font size
fontStyle Font style

1 Bold
2 Italic
3 Bold and italic
4 Underline

3.6.56 PltVectorplot
Overview

ChangeStyle
DoAutoScale
GetAxisX
GetAxisY
GetComplexData
GetLegend
GetTitleObject
SetAutoScaleModeX
SetAutoScaleModeY
SetScaleX
SetScaleY

774
3.6. OTHERS CHAPTER 3. OBJECT METHODS

ChangeStyle
Applies the plot style identified by the given name to this plot.
void PltVectorplot.ChangeStyle(string styleName)

A RGUMENTS
styleName
Name of the style template to apply

R ETURNS
0 on success
1 on error

DoAutoScale
Adapts the plot’s axes ranges such that they show the entire data range.
void PltVectorplot.DoAutoScale()

GetAxisX
Returns the plot’s x-axis.
object PltVectorplot.GetAxisX()

R ETURNS
PltAxis object

GetAxisY
Returns the plot’s y-aies.
object PltVectorplot.GetAxisY()

R ETURNS
PltAxis object

GetComplexData
Returns the plot’s complex data definition object (PltComplexdata).
object PltVectorplot.GetComplexData()

R ETURNS
Complex data definition object (PltComplexdata)

GetLegend
Returns the plot’s legend object (PltLegend).
object PltVectorplot.GetLegend()

775
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
Legend object (PltLegend)

GetTitleObject
Returns the plot’s title object (PltTitle).
object PltVectorplot.GetTitleObject()

R ETURNS
Title object (PltTitle)

SetAutoScaleModeX
Defines whether the plot should automatically adapt its main x-axis range on data changes.
void PltVectorplot.SetAutoScaleModeX(int mode)

A RGUMENTS
mode Possible values:
0 off (do not react to data changes)
1 adapt scale after calculation has finished

SetAutoScaleModeY
Defines whether the plot should automatically adapt its main y-axis range on data changes.
void PltVectorplot.SetAutoScaleModeY(int mode)

A RGUMENTS
mode Possible values:
0 off (do not react to data changes)
1 adapt scale after calculation has finished

SetScaleX
Sets the scale of the plot’s x-axis.
void PltVectorplot.SetScaleX(double min,
double max
)

A RGUMENTS
min Minimum of x-scale.
max Maximum of x-scale.

776
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetScaleY
Sets the scale of the plot’s y-axis.
void PltVectorplot.SetScaleY(double min,
double max
)

A RGUMENTS
min Minimum of y-scale.
max Maximum of y-scale.

3.6.57 RelChar
Overview

SetCurve

SetCurve
Assign a tripping curve by name. The curve must be defined in the associated type object.
int RelChar.SetCurve(string name)

A RGUMENTS
name Name of the curve to assign (may contain wildcards).

R ETURNS
0 The curve was found and assigned.
1 No curve with the given name is defined or multiple curves matched the name.

3.6.58 RelToc
Overview

SetCurve

SetCurve
Assign a tripping curve by name. The curve must be defined in the associated type object.
int RelToc.SetCurve(string name)

A RGUMENTS
name Name of the curve to assign (may contain wildcards).

R ETURNS
0 The curve was found and assigned.
1 No curve with the given name is defined or multiple curves matched the name.

777
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.59 RelZpol
Overview

AssumeCompensationFactor
AssumeReRl
AssumeXeXl

AssumeCompensationFactor
Triggers a calculation of the complex compensation factor and stores the result.
int RelZpol.AssumeCompensationFactor()

R ETURNS
0 The compensation factor was successfully calculated.
1 An error occurred (e.g. conencted branch was not found).

AssumeReRl
Triggers a calculation of the real part of the decoupled compensation factor and stores the
result.
int RelZpol.AssumeReRl()

R ETURNS
0 The compensation factor was successfully calculated.
1 An error occurred (e.g. conencted branch was not found).

AssumeXeXl
Triggers a calculation of the imaginary part of the decoupled compensation factor and stores
the result.
int RelZpol.AssumeXeXl()

R ETURNS
0 The compensation factor was successfully calculated.
1 An error occurred (e.g. conencted branch was not found).

3.6.60 ScnFreq
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

778
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetLimit*
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double ScnFreq.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnFreq.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double ScnFreq.GetValue(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnFreq.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

779
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnFreq.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnFreq.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
The following example gets the scan modules which have violations. For every violation of
each scan module, all relevant information is shown.
object oSim,oRef;
set sScanTrigger;
int violation, nbviolation;

oSim = GetCaseObject('ComSim');

sScanTrigger=oSim.GetViolatedScanModules();

for(oRef = sScanTrigger.First(); oRef; oRef = sScanTrigger.Next()){


printf('%s',oRef.GetFullName(0);
nbviolation=oRef.GetNumberOfViolations() ;
for(violation=1;violation <= nbviolation; violation=violation+1){
printf('%f s',oRef.GetViolationTime(violation));

780
3.6. OTHERS CHAPTER 3. OBJECT METHODS

printf('%o',oRef.GetViolatedElement(violation));
printf('%s',oRef.GetVariable(violation));
printf('%f',oRef.GetValue(violation));
printf('%f',oRef.GetLimit(violation));
}
}

3.6.61 ScnFrt
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

GetLimit*
Returns the limit value of the ith violation, given by vIdx.
double ScnFrt.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnFrt.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value, given by vIdx, which causes the violation.
double ScnFrt.GetValue(int vIdx)

781
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example of ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnFrt.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnFrt.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnFrt.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

782
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

3.6.62 ScnSpeed
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

GetLimit*
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double ScnSpeed.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnSpeed.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double ScnSpeed.GetValue(int vIdx)

783
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnSpeed.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnSpeed.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnSpeed.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

784
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

3.6.63 ScnSync
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

GetLimit*
Returns the limit value of the ith violation, given by vIdx.
double ScnSync.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnSync.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value, given by vIdx, which causes the violation.
double ScnSync.GetValue(int vIdx)

785
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnSync.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnSync.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnSync.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

786
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

3.6.64 ScnVar
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

GetLimit*
Returns the limit value of the ith violation, given by vIdx.
double ScnVar.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnVar.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value, given by vIdx, which causes the violation.
double ScnVar.GetValue(int vIdx)

787
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnVar.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnVar.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnVar.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

788
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

3.6.65 ScnVolt
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

GetLimit*
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double ScnVolt.GetLimit(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetNumberOfViolations*
Returns the number of violations.
int ScnVolt.GetNumberOfViolations()

R ETURNS
The number of violations.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetValue*
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double ScnVolt.GetValue(int vIdx)

789
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetVariable*
Returns the name of the variable of the ith violation, given by vIdx.
string ScnVolt.GetVariable(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolatedElement*
Returns the element of the ith violation, given by vIdx.
object ScnVolt.GetViolatedElement(int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The element of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns NULL.

E XAMPLE
See example ScnFreq.GetViolationTime().

GetViolationTime*
Returns the time (in seconds) of the ith violation, given by vIdx.
double ScnVolt.GetViolationTime(int vIdx)

A RGUMENTS
vIdx vIdx > 0

790
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

E XAMPLE
See example ScnFreq.GetViolationTime().

3.6.66 StoMaint
Overview

SetElms

SetElms
Sets the maintenance elements.
void StoMaint.SetElms(object singleElement)
void StoMaint.SetElms(set multipleElements)

A RGUMENTS
singleElement
single Element for Maintenance
multipleElements
multiple Elements for Maintenance

3.6.67 TypAsmo
Overview

CalcElParams

CalcElParams
Calculates the electrical parameters from the input data. Behaves as the calculate button on
the basic data page was pressed and the parameter estimation is executed. Shall be applied
only if the Input mode is set to ’Slip-Torque/Current Characteristic’ or ’Measurement curves’.
int TypAsm.CalcElParams([double acceptSqError = 1.e-03],
[int solverType = 0],
[int useLinConst = 1],
[int considerEff = 1],
[double kx = 0.5],
[double kr = 1.])

A RGUMENTS
acceptSqError (optional)
If calculated squared error is bolow this value, calculation is successfull.
solverType (optional)
Solver used in the parameter estimation. Possible values are:
0 LBFGS (default).

791
3.6. OTHERS CHAPTER 3. OBJECT METHODS

1 Particle swarm optimisation.


2 Conjugate gradient descent.
3 Newton (old, deprecated).
useLinConst (optional)
0: Xs from type is used, 1: linear constraints used.
considerEff (optional)
If = 1, efficiency is considered in the estimation.
kx (optional)
value for kx (only if linear constraints selected).
kr (optional)
value for kr (only if linear constraints selected and efficiency not considered).

R ETURNS
0 Calculation successfully (squared error less than acceptSqError).
1 Error.

3.6.68 TypCtcore
Overview

AddRatio
RemoveRatio
RemoveRatioByIndex

AddRatio
Adds the given ratio to the core. The ratio is added so that the sorting remains in ascending
order. The accuracy parameters will be copied from the previous row. If the new ratio is to be
the first ratio, the accuracy parameters will be copied from the next row instead.
int TypCtcore.AddRatio(double ratio)

A RGUMENTS
ratio New ratio to add.

R ETURNS
0 New ratio was added.
1 An error occurred.

RemoveRatio
Removes the given ratio from the core. The last remaining ratio can never be removed.
int TypCtcore.RemoveRatio(double ratio)

A RGUMENTS
ratio Ratio to remove.

792
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Ratio was removed.
1 An error occurred.

RemoveRatioByIndex
Removes the ratio with the given index from the core. The index is zero based. The last
remaining ratio can never be removed.
int TypCtcore.RemoveRatio(int index)

A RGUMENTS
index Index to remove.

R ETURNS
0 Index was removed.
1 An error occurred.

3.6.69 TypLne
Overview

IsCable*

IsCable*
Checks if the line type is a cable type.
int TypLne.IsCable()

R ETURNS
1 Type is a cable
0 Type is not a cable

E XAMPLE
The following example reports all cable types.
set cables;
object type;
int i;
cables = GetCalcRelevantObjects();
type = cables.Firstmatch('TypLne');
while (type) {
i = type.IsCable();
if (i) type.ShowFullName();
type = cables.Nextmatch();
}

793
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.70 TypMdl
Overview

Check
Compile
Pack

Check
Checks the model for errors e.g during parsing of interpreted model, during loading of compiled
model.
int TypMdl.Check()

R ETURNS
0 TypMdl is OK.
1 Error during parsing of interpreted model.
2 Error during loading of compiled model.

Compile
Compile the model.
int TypMdl.Compile([const char* modelPath], [int overrideModel])

A RGUMENTS
modelPath (optional)
Full path to a location where the model should be stored. Leave empty to use
default.
overrideModel (optional)
The model will be overrided if already present at the selected location and if the
value is set to 1. (default = 0)

R ETURNS
0 Compilation is Ok.
1 Compilation failled

Pack
Copies all used Modelica model types (i.e. referenced TypMdl) to a child folder ”Externals”.
int TypMdl.Pack()

R ETURNS
0 On success.
1 On error.

794
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.71 TypQdsl
Overview

Encrypt
IsEncrypted*
ResetThirdPartyModule
SetThirdPartyModule

Encrypt
Encrypts a type. An encrypted type can be used without password but decrypted only with
password. If no password is given a ’Choose Password’ dialog appears.
int TypQdsl.Encrypt([string password = ''],
[int removeObjectHistory = 1],
[int masterCode = 0])

A RGUMENTS
password (optional)
Password for decryption. If no password is given a ’Choose Password’ dialog
appears.
removeObjectHistory (optional)
Handling of unencrypted object history in database, e.g. used by project versions
or by undo:
0 Do not remove.
1 Do remove (default).
2 Show dialog and ask.
masterCode (optional)
Used for re-selling types. Third party licence codes already set in the type will be
overwritten by this value (default = 0).

R ETURNS
0 On success.
1 On error.

S EE ALSO

TypQdsl.IsEncrypted()

IsEncrypted*
Returns the encryption state of the type.
int TypQdsl.IsEncrypted()

R ETURNS
1 Type is encrypted.
0 Type is not encrypted.

795
3.6. OTHERS CHAPTER 3. OBJECT METHODS

S EE ALSO

TypQdsl.Encrypt()

ResetThirdPartyModule
Resets the third party licence. Only possible for non-encrypted models. Requires masterkey
licence for third party module currently set.
int TypQdsl.ResetThirdPartyModule()

R ETURNS
0 On success.
1 On error.

SetThirdPartyModule
Sets the third party licence to a specific value. Only possible for non-encrypted models with no
third party licence set so far. Requires masterkey licence for third party module to be set.
int TypQdsl.SetThirdPartyModule(string companyCode,
string moduleCode
)

A RGUMENTS
companyCode
D isplay name or numeric value of company code.
moduleCode
D isplay name or numeric value of third party module.

R ETURNS
0 On success.
1 On error.

3.6.72 TypTr2
Overview

GetZeroSequenceHVLVT*

GetZeroSequenceHVLVT*
Returns the calculated star equivalent of the zero sequence impedances.
int TypTr2.GetZeroSequenceHVLVT(double& hvReal,
double& hvImag,
double& lvReal,
double& lvImag,
double& tReal ,
double& tImag
)

796
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
hvReal (out)
Real part of the HV impedance in %.
hvImag (out)
Imaginary part of the HV impedance in %.

lvReal (out)
Real part of the LV impedance in %.
lvImag (out)
Imaginary part of the LV impedance in %.

tReal (out)
Real part of the tertiary (delta) impedance in %.
tImag (out)
Imaginary part of the tertiary (delta) impedance in %.

R ETURNS
0 No error occurred.
1 An error occurred; the values are invalid.

3.6.73 VisBdia
Overview

AddObjs
AddResObjs
Clear
SetScaleY
SetXVariable
SetYVariable

AddObjs
Adds objects to elements column in table 'Bars'.
void VisBdia.AddObjs(set elements)

A RGUMENTS
elements Elements to add in table.

E XAMPLE
The following example gets a distortion analysis diagram and adds all elements of the selec-
tion
object page;
object graphBoard;
object plot;
set elements;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot

797
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (plot) {
elements = SEL.All();
plot.AddObjs(elements);
}
}
}

AddResObjs
Adds objects to elements column in table 'Bars' (similar to AddObjs). Additionally a result file is
assigned to all rows added in the 'Result File' column.
void VisBdia.AddResObjs(object resultFileObj,
set elements
)

A RGUMENTS
resultFileObj
The result file to assign. Must be an object of class ElmRes.

elements Elements to add in table.

E XAMPLE
The following example gets a distortion analysis diagram and adds all elements of the selec-
tion with result file taken from study case.
object page;
object graphBoard;
object plot;
object resFile;
set elements;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot
if (plot) {
resFile = GetFromStudyCase('ElmRes');
elements = SEL.All();
plot.AddResObjs(elements);
}
}
}

Clear
Removes all elements from plot by erasing all rows from the table named 'Bars'.
void VisBdia.Clear()

E XAMPLE
The following example gets the distortion analysis diagram and removes all elements.

798
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot
if (plot) {
plot.Clear();
}
}
}

SetScaleY
Sets y-axis scale limits.
void VisBdia.SetScaleY(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.

max (optional)
Maximum of y-scale.
log (optional)
Possible values:

0 linear
1 logarithmic

E XAMPLE
The following example gets a distortion analysis diagram and sets the y-axis scale to a
logarithmic scale in the range of [1,1000]
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot
if (plot) {
plot.SetScaleY(1.,1000.,1);
}
}
}

799
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetXVariable
Set the x-axis Variable of the Distortion Analysis Diagram
int VisBdia.SetXVariable(string variable)

A RGUMENTS
variable x-axis variable to set.Length of variable must not exceed 37 characters.

R ETURNS
0 if ok, 1 if variable length exceeds 37 characters,

E XAMPLE
The following example gets a distortion analysis diagram and sets the x-axis variable to
’order’.
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot
if (plot) {
plot.SetXVariable('order');
}
}
}

SetYVariable
Set the y-axis variable of the Distortion Analysis Diagram
int VisBdia.SetYVariable(string variable)

A RGUMENTS
variable y-axis variable to set.Length of variable must not exceed 37 characters.

R ETURNS
0 if ok, 1 if variable length exceeds 37 characters,

E XAMPLE
The following example gets a distortion analysis diagram and sets the y-axis variable to
’m:u:bu1’.
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisBdia',1); ! get distortion analysis plot

800
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (plot) {
plot.SetYVariable('m:u:bu1');
}
}
}

3.6.74 VisDraw
Overview

AddRelay
AddRelays
CentreOrigin
Clear
DoAutoScaleOnAll
DoAutoScaleOnCharacteristics
DoAutoScaleOnImpedances
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and optionally sets the drawing style.
void VisDraw.AddRelay(object relay,
[double colour,]
[double style,]
[double width])

A RGUMENTS
relay The protection device to be added.

colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
void VisDraw.AddRelays(set relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

801
3.6. OTHERS CHAPTER 3. OBJECT METHODS

CentreOrigin
Centre the origin of the plot
void VisDraw.CentreOrigin()

Clear
Removes all protection devices from the plot.
void VisDraw.Clear()

DoAutoScaleOnAll
Scales the plot automatically under consideration of relay characteristics, simulation curves and
short circuit arrows. The function works for local scales only.
int VisDraw.DoAutoScaleOnAll()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleOnCharacteristics
Scales the plot automatically under consideration of relay characteristics. Same as button
named Characteristics. The function works for local scales only.
int VisDraw.DoAutoScaleOnCharacteristics()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleOnImpedances
Scales the plot automatically under consideration of branch impedances. Same as button
named Impedances. The function works for local scales only.
int VisDraw.DoAutoScaleOnImpedances()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

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.
int VisDraw.DoAutoScaleX()

802
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int VisDraw.DoAutoScaleY()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

3.6.75 VisHrm
Overview

Clear
DoAutoScaleX
DoAutoScaleY
GetDataSource
GetScaleObjX
GetScaleObjY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY

Clear
Removes all curves by clearing table named 'Curves'.
void VisHrm.Clear()

E XAMPLE
The following example gets the waveform plot and removes all curves.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Distortion',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.Clear();
}
}
}

803
3.6. OTHERS CHAPTER 3. OBJECT METHODS

DoAutoScaleX
Scales x-axis automatically.
int VisHrm.DoAutoScaleX()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

E XAMPLE
The following example gets the waveform plot and scales the x-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named 'Waveform'
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.DoAutoScaleX();
}
}
}

DoAutoScaleY
Scales y-axis automatically.
int VisHrm.DoAutoScaleY()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

E XAMPLE
The following example gets the waveform plot and scales the y-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.DoAutoScaleY();
}
}
}

804
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetDataSource
Get data source for curve with index
object VisHrm.GetDataSource(int curveIndex)

A RGUMENTS
int curveIndex
Possible values:
<0 invalid
≥0 curve index in table

R ETURNS
object Data source
NULL No data source found

E XAMPLE
The following example looks for a plot and gets the data source for the first curve.
object dataSource;
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisHrm',1); ! get plot
if (plot) {
dataSource = plot.GetDataSource(0);
}
}
}

GetScaleObjX
Gets the object used for scaling the x-axis.
object VisHrm.GetScaleObjX()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

E XAMPLE
The following example gets the object specifying the x-scale of the waveform plot.
object page;
object graphBoard;
object plot;
object scaleObjX;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {

805
3.6. OTHERS CHAPTER 3. OBJECT METHODS

page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion


if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
scaleObjX = plot.GetScaleObjX();
scaleObjX.ShowFullName();
}
}
}

GetScaleObjY
Gets the object used for scaling the y-axis.
object VisHrm.GetScaleObjY()

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

E XAMPLE
The following example gets the object specifying the y-scale of the waveform plot.
object page;
object graphBoard;
object plot;
object scaleObjY;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
scaleObjY = plot.GetScaleObjY();
scaleObjY.ShowFullName();
}
}
}

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the
waveform plot is using the scale of the graphics board or the virtual instrument panel.
void VisHrm.SetAutoScaleX(int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation

806
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the waveform plot and sets the Auto Scale option of the x-axis to
On.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.SetAutoScaleX(1);
}
}
}

SetAutoScaleY
Sets Auto Scale setting of the y-scale. The scale is automatic set to local, in case that the
waveform plot is using the scale of the plot type.
void VisHrm.SetAutoScaleY(int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation

E XAMPLE
The following example gets the waveform plot and sets the Auto Scale option of the y-axis to
On.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.SetAutoScaleY(1);
}
}
}

SetCrvDesc
Sets the user defined description of a curve.
void VisHrm.SetCrvDesc(int curveIndex, string curveDescription)

807
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

E XAMPLE
The following example gets the waveform plot and sets the description of the first variable to
example.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Waveform
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.SetCrvDesc(1,'example');
}
}
}

SetDefScaleX
Sets the x-scale to be used to the graphics board.
void VisHrm.SetDefScaleX()

E XAMPLE
The following example gets the waveform plot and sets the x-scale to the graphics board.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.SetDefScaleX();
}
}
}

SetDefScaleY
Sets the y-scale to be used to the plot type.
void VisHrm.SetDefScaleY()

808
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the waveform plot and sets the y-scale to the plot type.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Waveform',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisHrm',1); ! get waveform plot
if (plot) {
plot.SetDefScaleY();
}
}
}

3.6.76 VisMagndiffplt
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY
Refresh

AddRelay
Adds a relay to the plot and optionally sets the drawing style.
void VisMagndiffplt.AddRelay(object relay,
[double colour,]
[double style,]
[double width])

A RGUMENTS
relay The protection device to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
void VisMagndiffplt.AddRelays(set relays)

809
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

Clear
Removes all protection devices from the plot.
void VisMagndiffplt.Clear()

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.
int VisMagndiffplt.DoAutoScaleX()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int VisMagndiffplt.DoAutoScaleY()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

Refresh
Refreshes the plot by attempting to automatically scale both axes.
void VisMagndiffplt.Refresh()

3.6.77 VisOcplot
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY
Refresh

810
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddRelay
Adds a relay to the plot and optionally sets the drawing style.
void VisOcplot.AddRelay(object relay,
[double colour,]
[double style,]
[double width])

A RGUMENTS
relay The protection device to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
void VisOcplot.AddRelays(set relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

Clear
Removes all protection devices from the plot.
void VisOcplot.Clear()

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.
int VisOcplot.DoAutoScaleX()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int VisOcplot.DoAutoScaleY()

811
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

Refresh
Refreshes the plot by attempting to automatically scale both axes.
void VisOcplot.Refresh()

3.6.78 VisPath
Overview

Clear
DoAutoScaleX
DoAutoScaleY
SetAdaptX
SetAdaptY
SetScaleX
SetScaleY

Clear
Removes all curves by clearing table named 'Variables' on page 'Curves'.
void VisPath.Clear()

E XAMPLE
The following example gets the plot and removes all curves.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.Clear();
}
}
}

DoAutoScaleX
Scales x-axis automatically.
int VisPath.DoAutoScaleX()

R ETURNS
Always 0

812
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the plot and scales the x-axis automatically
object page;
object plot;
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.DoAutoScaleX();
}
}
}

DoAutoScaleY
Scales y-axis automatically.
int VisPath.DoAutoScaleY()

R ETURNS
Always 0

E XAMPLE
The following example gets the plot and scales the x-axis automatically
object page;
object graphBoard;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.DoAutoScaleY();
}
}
}

SetAdaptX
Sets the Adapt Scale option of the x-scale.
void VisPath.SetAdaptX(int mode)

A RGUMENTS
mode Possible values:

0 off
1 on

813
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the plot and sets Adapt Scale of the x-axis to On
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.SetAdaptX(1);
}
}
}

SetAdaptY
Sets the Adapt Scale option of the x-scale.
void VisPath.SetAdaptY(int mode)

A RGUMENTS
mode Possible values:

0 off
1 on

E XAMPLE
The following example gets the plot and sets Adapt Scale of the y-axis to On
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.SetAdaptY(1);
}
}
}

SetScaleX
Sets x-axis scale.
void VisPath.SetScaleX(double min,
double max
)

814
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
min Minimum of x-scale.
max Maximum of x-scale.

E XAMPLE
The following example sets the minimum to 1 and maximum to 10.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get plot
if (plot) {
plot.SetScaleX(1,10);
}
}
}

SetScaleY
Sets y-axis scale limits.
void VisPath.SetScaleY (double min,
double max,
[int log]
)

A RGUMENTS
min Minimum of y-scale.
max Maximum of y-scale.
log (optional)
Possible values:

0 linear
1 logarithmic

E XAMPLE
The following example gets the plot and sets the y-axis scale to a logarithmic scale in the
range of [1,1000]
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Distortion
if (page) {
plot=page.GetVI('Analysis','VisPath',1); ! get distortion analysis plot
if (plot) {

815
3.6. OTHERS CHAPTER 3. OBJECT METHODS

plot.SetScaleY(1.,1000.,1);
}
}
}

3.6.79 VisPcompdiffplt
Overview

AddRelay
AddRelays
CentreOrigin
Clear
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and optionally sets the drawing style.
void VisPcompdiffplt.AddRelay(object relay,
[double colour,]
[double style,]
[double width])

A RGUMENTS
relay The protection device to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
void VisPcompdiffplt.AddRelays(set relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

CentreOrigin
Centre the origin of the plot
void VisPcompdiffplt.CentreOrigin()

816
3.6. OTHERS CHAPTER 3. OBJECT METHODS

Clear
Removes all protection devices from the plot.
void VisPcompdiffplt.Clear()

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.
int VisPcompdiffplt.DoAutoScaleX()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int VisPcompdiffplt.DoAutoScaleY()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

3.6.80 VisPlot
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY
GetDataSource
GetIntCalcres
GetScaleObjX
GetScaleObjY
SetAdaptX
SetAdaptY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY
SetScaleX
SetScaleY
SetXVar

817
3.6. OTHERS CHAPTER 3. OBJECT METHODS

AddResVars
Appends variables to the plot. Variables which are already in the plot are not added.
void VisPlot.AddResVars(object elmRes,
object element,
string varname
)

A RGUMENTS
elmRes Result object, classname ElmRes.
elememt Element to add.
varname Variable name.

E XAMPLE
The following examples looks for a plot and adds a variable.
object graphBoard;
object page;
object plot;
object resObj;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
resObj = GetFromStudyCase('*.ElmRes');
plot.AddResVars(resObj, line,'c:loading');
}
}
}

AddVars
Appends variables to the plot. Variables which are already in the plot are not added.
void VisPlot.AddVars(object element,
string varname
)

A RGUMENTS
elememt Element to add.
varname Variable name.

E XAMPLE
The following examples looks for a plot and adds a variable.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'

818
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.AddVars(line,'c:loading');
}
}
}

Clear
Removes all curves from plot.
void VisPlot.Clear()

E XAMPLE
The following example gets the plot and removes all curves.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.Clear();
}
}
}

DoAutoScaleX
Scales x-axis automatically.
int VisPlot.DoAutoScaleX()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

E XAMPLE
The following example gets the plot and scales the x-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('U','VisPlot',1); ! get plot
if (plot) {
plot.DoAutoScaleX();

819
3.6. OTHERS CHAPTER 3. OBJECT METHODS

}
}
}

DoAutoScaleY
Scales y-axis automatically.
int VisPlot.DoAutoScaleY()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

E XAMPLE
The following example gets the plot and scales the y-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('U','VisPlot',1); ! get plot
if (plot) {
plot.DoAutoScaleY();
}
}
}

GetDataSource
Get data source for curve with index
object VisPlot.GetDataSource(int curveIndex)

A RGUMENTS
int curveIndex
Possible values:
<0 invalid
≥0 curve index in table

R ETURNS
object Data source
NULL No data source found

E XAMPLE
The following example looks for a plot and gets the data source for the first curve.

820
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object dataSource;
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
dataSource = plot.GetDataSource(0);
}
}
}

GetIntCalcres
Gets all user Calculated Result objects (IntCalcres) stored inside plot
set VisPlot.GetIntCalcres()

R ETURNS
All Calculated Result objects (IntCalcres) stored inside plot.

GetScaleObjX
Gets the object used for scaling the x-axis.
object VisPlot.GetScaleObjX()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

E XAMPLE
The following example gets the object specifying the x-scale of plot.
object page;
object graphBoard;
object plot;
object scaleObjX;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
scaleObjX = plot.GetScaleObjX();
scaleObjX.ShowFullName();
}
}
}

821
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetScaleObjY
Gets the object used for scaling the y-axis.
object VisPlot.GetScaleObjY()

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

E XAMPLE
The following example gets the object specifying the y-scale of the plot.
object page;
object graphBoard;
object plot;
object scaleObjY;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
scaleObjY = plot.GetScaleObjY();
scaleObjY.ShowFullName();
}
}
}

SetAdaptX
Sets the Adapt Scale option of the local x-scale.
void VisPlot.SetAdaptX(int mode,
[double trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

E XAMPLE
The following example looks for a plot and sets its adapt scale option.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot

822
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (plot) {
plot.SetAdaptX(1,3); ! Turn on adapt scale, use a trigger value of 3
plot.SetAdaptX(0,3); ! Turn off adapt scale
plot.SetAdaptX(1); ! Turn on adapt scale again, do not change the trigger value
}
}
}

SetAdaptY
Sets the Adapt Scale option of the local y-scale.
void VisPlot.SetAdaptY(int mode,
[double offset]
)

A RGUMENTS
mode Possible values:
0 off
1 on

offset (optional)
Offset value, unused if mode is off or empty

E XAMPLE
The following example looks for a plot and sets its adapt scale option.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetAdaptY(1,3); ! Turn on adapt scale, use an offset value of 3
plot.SetAdaptY(0,3); ! Turn off adapt scale
plot.SetAdaptY(1); ! Turn on adapt scale again, do not change the offset value
}
}
}

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the plot
is using the scale of the graphics board or the virtual instrument panel.
void VisPlot.SetAutoScaleX(int mode)

823
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

E XAMPLE
The following example gets the plot and sets the Auto Scale option of the x-axis to On.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetAutoScaleX(1);
}
}
}

SetAutoScaleY
Sets Auto Scale setting of the y-scale. The scale is automatic set to local, in case that the plot
is using the scale of the plot type.
void VisPlot.SetAutoScaleY(int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

E XAMPLE
The following example gets the plot and sets the Auto Scale option of the y-axis to On.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetAutoScaleY(1);
}
}
}

824
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetCrvDesc
Sets the user defined description of a curve.
void VisPlot.SetCrvDesc(int curveIndex,
string curveDescription
)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set.

E XAMPLE
The following example gets a plot and sets the description of the first variable to example.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('Plot','VisPlot',1); ! get plot
if (plot) {
plot.SetCrvDesc(1,'example');
}
}
}

SetDefScaleX
Sets the x-scale to be used to the graphics board.
void VisPlot.SetDefScaleX()

E XAMPLE
The following example gets the plot and sets the x-scale to the graphics board.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetDefScaleX();
}
}
}

825
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetDefScaleY
Sets the y-scale to be used to the plot type.
void VisPlot.SetDefScaleY()

E XAMPLE
The following example gets the plot and sets the y-scale to the plot type.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetDefScaleY();
}
}
}

SetScaleX
Sets the local x-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
void VisPlot.SetScaleX()
void VisPlot.SetScaleX(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

E XAMPLE
The following examples look for a Subplot named 'RST' and set its x-scale. There are three
different examples. 1. Example: Set x-axis to local and change 'Auto Scale' of x axis to 'On'.
2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and
maximum to 1000. Changes to a logarithmic scale.
! Set Auto Scale to On
object graphBoard;
object page;
object plot;

826
3.6. OTHERS CHAPTER 3. OBJECT METHODS

graphBoard=GetGraphicsBoard(); ! Look for open graphics board.


if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {
plot.SetScaleX(); ! set auto scale mode to On
}
}
}

! Set minimum and maximum without changing linear/log


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {
plot.SetScaleX(0,20); ! Set minimum and maximum
}
}
}

! Set minimum and maximum, change to logarithmic scale


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {

plot.SetScaleX(1,1000,1); ! Set minimum and maximum, change to log scale


}
}
}

SetScaleY
Sets the local y-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
void VisPlot.SetScaleY()
void VisPlot.SetScaleY(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.

827
3.6. OTHERS CHAPTER 3. OBJECT METHODS

max (optional)
Maximum of y-scale.

log (optional)
Possible values:
0 linear
1 logarithmic

E XAMPLE
The following examples look for a Subplot named 'RST' and set its y-scale. There are three
different examples. 1. Example: Set y-axis to local and change 'Auto Scale' of y axis to 'On'.
2. Example: Set minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and
maximum to 1000. Changes to a logarithmic scale.
! Set Auto Scale to On
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {
plot.SetScaleY(); ! set auto scale mode to On
}
}
}

! Set minimum and maximum without changing linear/log


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {
plot.SetScaleY(0,20); ! Set minimum and maximum
}
}
}

! Set minimum and maximum, change to logarithmic scale


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot named RST
if (plot) {

plot.SetScaleY(1,1000,1); ! Set minimum and maximum, change to log scale


}
}
}

828
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetXVar
Sets the local x-axis variable. If The default x-axis variable (time) is set if no argument is
passed.
void VisPlot.SetXVar()
void VisPlot.SetXVar(object obj,
string varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

E XAMPLE
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 x-axis variable 'm:U1:bus1' of object line
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetXVar(line,'m:U1:bus1'); ! Set x-scale variable
}
}
}
! set default x-axis variable
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetXVar(); ! Set default x-scale variable (time)
}
}
}

829
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.81 VisPlot2
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY2
DoAutoScaleY
GetDataSource
GetScaleObjX
GetScaleObjY
SetAdaptX
SetAdaptY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY
SetScaleX
SetScaleY
SetXVar
ShowY2

AddResVars
Appends variables to the plot. Variables which are already in the plot are not added.
void VisPlot2.AddResVars(object elmRes,
object element,
string varname,
[int y2 = 1]
)

A RGUMENTS
elmRes Result object, classanme ElmRes
elememt Element to add
varname Variable name
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

E XAMPLE
The following examples looks for a plot and adds a variable to the second y axis
object graphBoard;
object page;
object plot;
object resObj;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'

830
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
resObj = GetFromStudyCase('*.ElmRes');
plot.AddResVars(resObj, line,'c:loading',2);
}
}
}

AddVars
Appends variables to the plot. Variables which are already in the plot are not added.
void VisPlot2.AddVars(object element,
string varname,
[int y2 = 1]
)

A RGUMENTS
elememt Element to add
varname Variable name
y2 (optional)
Possible values:

1 y1-axis, default value


2 y2 axis

E XAMPLE
The following examples looks for a plot and adds a variable to the second y axis
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.AddVars(line,'c:loading',2);
}
}
}

Clear
Removes variables from plot
void VisPlot2.Clear([int y2])

831
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

E XAMPLE
The following example looks for a plot and removes all variables of y2 from plot
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.Clear(2);
}
}
}

DoAutoScaleX
Scales x-axis automatically.
int VisPlot2.DoAutoScaleX()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

E XAMPLE
The following example gets the plot and scales the x-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('U','VisPlot2',1); ! get plot
if (plot) {
plot.DoAutoScaleX();
}
}
}

832
3.6. OTHERS CHAPTER 3. OBJECT METHODS

DoAutoScaleY2
Scales y2-axis automatically.
int VisPlot2.DoAutoScaleY2()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

E XAMPLE
The following example gets the plot and scales the y1-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.DoAutoScaleY2();
}
}
}

DoAutoScaleY
Scales y1-axis automatically.
int VisPlot2.DoAutoScaleY()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

E XAMPLE
The following example gets the plot and scales the y1-axis automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.DoAutoScaleY();
}
}
}

833
3.6. OTHERS CHAPTER 3. OBJECT METHODS

GetDataSource
Get data source for curve with index
object VisPlot.GetDataSource(int curveIndex, int yaxis)

A RGUMENTS
int curveIndex
Possible values:
<0 invalid
≥0 curve index in table
int yaxis Possible values:
1 y1 axis
2 y2 axis

R ETURNS
object Data source
NULL No data source found

E XAMPLE
The following example looks for a plot and gets the data source for the first curve of y2 axis.
object dataSource;
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
dataSource = plot.GetDataSource(0,2);
}
}
}

GetScaleObjX
Gets the object used for scaling the x-axis.
object VisPlot2.GetScaleObjX()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

834
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the object specifying the x-scale of plot.
object page;
object graphBoard;
object plot;
object scaleObjX;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
scaleObjX = plot.GetScaleObjX();
scaleObjX.ShowFullName();
}
}
}

GetScaleObjY
Returns used object defining y-scale. The returned object is either the plot itself or the plot type
(IntPlot).
object VisPlot2.GetScaleObjY ([int y2])

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

E XAMPLE
The following examples look for a Subplot named ’RST’and get the used y2-scale object.
object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
scale=plot.GetScaleObjY(2);
scale.ShowFullName();
}
}
}

835
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAdaptX
Sets the Adapt Scale option of the local x-scale.
void VisPlot2.SetAdaptX(int mode,
[double trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

E XAMPLE
The following example looks for a plot and sets its adapt scale option.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetAdaptX(1,3); ! Turn on adapt scale, use a trigger value of 3
plot.SetAdaptX(0,3); ! Turn off adapt scale
plot.SetAdaptX(1); ! Turn on adapt scale again, do not change the trigger value
}
}
}

SetAdaptY
Sets the Adapt Scale option of the local y-scale.
void VisPlot2.SetAdaptY(int mode,
[double offset,]
[int y2]
)

A RGUMENTS
mode Possible values:
0 off
1 on
offset (optional)
Offset value, unused if mode is off or empty
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

836
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example looks for a plot and sets the adapt scale option of y2 to 1, trigger value
is 4
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetAdaptY(1,4,2);
}
}
}

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the plot
is using the scale of the graphics board or the virtual instrument panel.
void VisPlot2.SetAutoScaleX(int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

E XAMPLE
The following example gets the plot and sets the Auto Scale option of the x-axis to On.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetAutoScaleX(1);
}
}
}

837
3.6. OTHERS CHAPTER 3. OBJECT METHODS

SetAutoScaleY
Sets automatic scaling mode of the y-scale. The axis given in the second argument is automat-
ically set to local.
void VisPlot2.SetAutoScaleY (int mode,
[int y2]
)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

E XAMPLE
The following example looks for a and change its auto scale mode to Online
object graphBoard;
object page;
object plot;
! Look for opened graphics board.
graphBoard=GetGraphicsBoard();
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetAutoScaleY(2); ! Turn off automatic scaling of y-scale
}
}
}

SetCrvDesc
Sets the user defined description of a curve.
void VisPlot2.SetCrvDesc(int curveIndex, string curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

838
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets a plot and sets the description of the first variable to example.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('Plot','VisPlot2',1); ! get plot
if (plot) {
plot.SetCrvDesc(1,'example');
}
}
}

SetDefScaleX
Sets the x-scale to be used to the graphics board.
void VisPlot2.SetDefScaleX()

E XAMPLE
The following example gets the plot and sets the x-scale to the graphics board.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetDefScaleX();
}
}
}

SetDefScaleY
Sets the y-scale to be used to the plot type.
void VisPlot2.SetDefScaleY([int y2])

A RGUMENTS
y2 (optional)
Possible values:

1 y1-axis, default value


2 y2 axis

839
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example gets the plot and sets the y-scale to the plot type.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetDefScaleY(1);
}
}
}

SetScaleX
Sets the local x-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
void VisPlot.SetScaleX()
void VisPlot.SetScaleX(double min,
double max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

E XAMPLE
The following examples look for a and sets its x-scale. There are three different examples.
1. Example: Set x-axis to local and change 'Auto Scale' of x axis to 'On'. 2. Example: Set
minimum to 0 and maximum to 20. 3. Example: Set minimum to 1 and maximum to 1000.
Changes to a logarithmic scale.
! Set Auto Scale to On
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot named RST
if (plot) {

840
3.6. OTHERS CHAPTER 3. OBJECT METHODS

plot.SetScaleX(); ! set auto scale mode to On


}
}
}

! Set minimum and maximum without changing linear/log


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot named RST
if (plot) {
plot.SetScaleX(0,20); ! Set minimum and maximum
}
}
}

! Set minimum and maximum, change to logarithmic scale


object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot named RST
if (plot) {

plot.SetScaleX(1,1000,1); ! Set minimum and maximum, change to log scale


}
}
}

SetScaleY
Sets scale of y-axis. Calling the function without any argument sets the Auto Scale option for
the y axis (both share the same setting) to On.
void VisPlot2.SetScaleY()
void VisPlot2.SetScaleY(double min,
double max,
[int log,]
[int Y2]
)

A RGUMENTS
min (optional)
Minimum of y-scale.
max (optional)
Maximum of y-scale.
log (optional)
Possible values:

841
3.6. OTHERS CHAPTER 3. OBJECT METHODS

0 linear
1 logarithmic
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

E XAMPLE
The following examples looks for a plotand sets its y1 scale to [1,1000] and log.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot',1); ! get plot
if (plot) {
plot.SetScaleY(1,1000,1,1);
}
}
}

SetXVar
Sets the local x-axis variable. If The default x-axis variable (time) is set if no argument is
passed.
void VisPlot2.SetXVar()
void VisPlot2.SetXVar(object obj,
string varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

E XAMPLE
The following examples look for a plot 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 x-axis variable 'm:U1:bus1' of object line
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {

842
3.6. OTHERS CHAPTER 3. OBJECT METHODS

plot=page.GetVI('RST','VisPlot2',1); ! get plot


if (plot) {
plot.SetXVar(line,'m:U1:bus1'); ! Set x-scale variable
}
}
}
! set default x-axis variable
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.SetXVar(); ! Set default x-scale variable (time)
}
}
}

ShowY2
Enables or disables the y2 axis.
void VisPlot2.ShowY2([int show])

A RGUMENTS
show (optional)
Possible values:
0 hide y2 axis
1 show y2 axis (default)

E XAMPLE
The following example looks for a plot and hides the y2 axis.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'Voltage'
if (page) {
plot=page.GetVI('RST','VisPlot2',1); ! get plot
if (plot) {
plot.ShowY2(0);
}
}
}

843
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.82 VisPlottz
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and optionally sets the drawing style.
void VisPlottz.AddRelay(object relay,
[double colour,]
[double style,]
[double width])

A RGUMENTS
relay The protection device to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
void VisPlottz.AddRelays(set relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

Clear
Removes all protection devices from the plot.
void VisPlottz.Clear()

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.
int VisPlottz.DoAutoScaleX()

844
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int VisPlottz.DoAutoScaleY()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

3.6.83 VisVec
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
void VisVec.CentreOrigin()

3.6.84 VisVecres
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
void VisVecres.CentreOrigin()

845
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.85 VisXyplot
Overview

Clear
DoAutoScaleX
DoAutoScaleY
GetDataSource
SetCrvDescX
SetCrvDescY

Clear
Removes all curves from plot.
void VisXyplot.Clear()

E XAMPLE
The following example gets the plot and removes all curves.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Current',1); ! get panel
if (page) {
plot=page.GetVI('RST','VisXyplot',1); ! get plot
if (plot) {
plot.Clear();
}
}
}

DoAutoScaleX
Scales all used x-axes automatically.
int VisXyplot.DoAutoScaleX()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scales are not local

E XAMPLE
The following example gets the plot and scales the x-axes automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('U','VisXyplot',1); ! get plot

846
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (plot) {
plot.DoAutoScaleX();
}
}
}

DoAutoScaleY
Scales all used y-axes automatically.
int VisXyplot.DoAutoScaleY()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scales are not local

E XAMPLE
The following example gets the plot and scales the y-axes automatically
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named 'Voltage'
if (page) {
plot=page.GetVI('U','VisXyplot',1); ! get plot
if (plot) {
plot.DoAutoScaleY();
}
}
}

GetDataSource
Get data source for curve with index
object VisXyplot.GetDataSource(int curveIndex)

A RGUMENTS
int curveIndex
Possible values:
<0 invalid
≥0 curve index in table

R ETURNS
object Data source
NULL No data source found

847
3.6. OTHERS CHAPTER 3. OBJECT METHODS

E XAMPLE
The following example looks for a plot and gets the data source for the first curve.
object dataSource;
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! get panel named Voltage
if (page) {
plot=page.GetVI('RST','VisXyplot',1); ! get plot
if (plot) {
dataSource = plot.GetDataSource(0);
}
}
}

SetCrvDescX
Sets the user defined description of a curve for the x-variable.
void VisXyplot.SetCrvDescX(int curveIndex, string curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

E XAMPLE
The following example gets a plot and sets the description of the first variable to example.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Current',1); ! get panel
if (page) {
plot=page.GetVI('Plot','VisXyplot',1); ! get plot
if (plot) {
plot.SetCrvDescX(1,'xvalue');
}
}
}

SetCrvDescY
Sets the user defined description of a curve for the y-variable.
void VisXyplot.SetCrvDescY(int curveIndex, string curveDescription)

848
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

E XAMPLE
The following example gets a plot and sets the description of the first variable to example.
object page;
object graphBoard;
object plot;
graphBoard=GetGraphicsBoard(); ! Look for open graphics board.
if (graphBoard) {
page=graphBoard.GetPage('Current',1); ! get panel
if (page) {
plot=page.GetVI('Plot','VisXyplot',1); ! get plot
if (plot) {
plot.SetCrvDescY(1,'yvalue');
}
}
}

849
CHAPTER 4. SET ROUTINES

4 Set Routines

Overview

Add*
Clear*
Count*
First*
FirstFilt*
IsIn*
MarkInGraphics
Next*
NextFilt*
Obj*
OutputFlexibleData*
Remove*
ShowModalBrowser
ShowModalSelectBrowser
ShowModelessBrowser
SortToClass*
SortToName*
SortToVar*

Add*
Adds an object or all objects from a set to the set.
An object is only added if not already contained.
int set.Add(object obj)
int set.Add(set objects)

A RGUMENTS
obj Object to add.
objects Set of objects to add.

R ETURNS
0 On success.
6= 0 On error, e.g. object is already contained in the set.

S EE ALSO

set.IsIn(), set.Remove()

E XAMPLE
The following example collects all not selected lines.

850
CHAPTER 4. SET ROUTINES

set selected, relevant, notselected;


object line;
int isIn;
selected = SEL.AllLines();
relevant = GetCalcRelevantObjects();
line = relevant.FirstFilt('*.ElmLne');
while (line) {
isIn = selected.IsIn(line);
if (isIn = 0) {
notselected.Add(line);
}
line = relevant.NextFilt();
}

Clear*
Removes all objects from the set.
void set.Clear()

S EE ALSO

set.Remove()

Count*
Returns the number of objects in the set.
int set.Count()

R ETURNS
The number (≥ 0) of objects in the set.

E XAMPLE
The following example outputs the number of calculation relevant lines (in an active project).
int n;
set lines;
lines = GetCalcRelevantObjects('ElmLne');
n = lines.Count();
printf('There are %d calculation relevant line elements inside active project', n);

First*
Returns the first object in the set.
object set.First()

R ETURNS
6= NULL First object in set.
NULL Set is empty.

851
CHAPTER 4. SET ROUTINES

S EE ALSO

set.Next(), set.FirstFilt(), set.NextFilt()

E XAMPLE
The following example writes the full names of all lines in the general selection to the output
window.
set lines;
object line;
lines = SEL.AllLines();
line = lines.First();
while (line) {
line.ShowFullName();
line = lines.Next();
}

FirstFilt*
Returns the first object from the set which name matches the filter.
The filter describes an object name (case-sensitive, optionally including a class name) and can
contain the following wildcards:

? Represents exactly one arbitrary character.

* Represents zero or finitely many arbitrary characters.

Using ',' as separator combines multiple filters as logical disjunction.


Examples:

• 'S*' matches e.g. 'Switch.ElmCoup' or 'Shunt.ElmShnt'.

• 'S*.ElmCoup' resticts the previous maches to switches/breakers.


• '*.ElmTr2, *.ElmTr3' equals '*.ElmTr?' and matches all two and three winding transformers.

object set.FirstFilt(string filter)

A RGUMENTS
filter Object name filter, possibly containing wildcards.

R ETURNS
6= NULL The first object matching the filter.
NULL No object matches the filter.

S EE ALSO

set.NextFilt(), set.First(), set.Next()

E XAMPLE
The following example writes all two and three winding transformers (class name ElmTr2 and
ElmTr3) whose names start with a 'T' to the output window.

852
CHAPTER 4. SET ROUTINES

set transformers;
object transformer;
transformers = GetCalcRelevantObjects();
transformer = transformers.FirstFilt('T*.ElmTr?');
while (transformer) {
transformer.ShowFullName();
transformer = transformers.NextFilt();
}

IsIn*
Checks if the set contains given object.
int set.IsIn(object obj)

A RGUMENTS
obj Object to check.

R ETURNS
0 Object is not contained.
1 Object is contained.
For NULL, the result is always 0.

S EE ALSO

set.Add(), set.Remove()

E XAMPLE
See set.Add().

MarkInGraphics
This function is deprecated. Please use MarkInGraphics() instead.
void set.MarkInGraphics([int searchAllDiagramsAndSelect])

Next*
Returns the next object in the set.
object set.Next()

R ETURNS
6= NULL Next object in set.
NULL Last object has been reached.

S EE ALSO

set.First()

853
CHAPTER 4. SET ROUTINES

E XAMPLE
See set.First().

NextFilt*
Returns the next object from the set which name matches the filter given in set.FirstFilt().
int set.NextFilt()

R ETURNS
6= NULL Next object matching the filter.
NULL No next object matches the filter.

S EE ALSO

set.FirstFilt(), set.First(), set.Next()

E XAMPLE
See set.FirstFilt().

Obj*
Returns the object at the given index in the set.
int set.Obj(int index)

A RGUMENTS
index the index of the object.

R ETURNS
The object at the given index in the set, when 'index'is in range, NULLotherwise.

OutputFlexibleData*
This function is deprecated. Please use OutputFlexibleData() instead.
void set.OutputFlexibleData([string flexibleDataPage = ''])

Remove*
Removes an object from the set.
int set.Remove(object obj)

A RGUMENTS
obj Object to remove.

R ETURNS
0 On success.
1 On error.

854
CHAPTER 4. SET ROUTINES

S EE ALSO

set.Add(), set.IsIn()

E XAMPLE
The following example removes all lines shorter than 1km from a set.
set lines;
object line;
double length;
lines = SEL.AllLines();
line = lines.First();
while (line) {
length = line:dline;
if (line < 1) {
lines.Remove(line);
}
line = lines.Next();
}

ShowModalBrowser
This function is deprecated. Please use ShowModalBrowser() instead.
void set.ShowModalBrowser([int detailMode = 0,]
[string title = '',]
[string page = ''])

ShowModalSelectBrowser
This function is deprecated. Please use ShowModalSelectBrowser() instead.
set set.ShowModalSelectBrowser([string title,]
[string classFilter,])

ShowModelessBrowser
This function is deprecated. Please use ShowModelessBrowser() instead.
void set.ShowModelessBrowser([int detailMode = 0,]
[string title = '',]
[string page = ''])

SortToClass*
Sorts the objects in the set according their class names.
void set.SortToClass(int descending)

A RGUMENTS
descending
0 Sorts ascending A. . . Z.
1 Sorts descending Z. . . A.

855
CHAPTER 4. SET ROUTINES

E XAMPLE
The following example writes all lines and terminals to the output window, ascending sorted
according their class names.
set objects;
object obj;
objects = GetCalcRelevantObjects('*.ElmLne, *.ElmTerm');
objects.SortToClass(0);
obj = objects.First();
while (obj) {
obj.ShowFullName();
obj = objects.Next();
}

SortToName*
Sorts the objects in the set according their names ('loc name').
int set.SortToName(int descending)

A RGUMENTS
descending
0 Sorts ascending A. . . Z.
1 Sorts descending Z. . . A.

E XAMPLE
The following example writes all lines and terminals to the output window, ascending sorted
according their names.
set objects;
object obj;
objects = GetCalcRelevantObjects('*.ElmLne, *.ElmTerm');
objects.SortToName(0);
obj = objects.First();
while (obj) {
obj.ShowFullName();
obj = objects.Next();
}

SortToVar*
Sorts the objects in the set according the values of the given variable names.
The frist variable name defines the principle sorting. Each further variable name defines a
sub-sorting.
void set.SortToVar(int descending,
string variable1,
[...,]
[string variable5]
)

856
CHAPTER 4. SET ROUTINES

A RGUMENTS
descending
0 Sorts ascending.
1 Sorts descending.
variable1 Variable name of principle sorting.

variable2, ..., variable5 (optional)


2nd..5th variable names for sub-sortings.

E XAMPLE
The following example writes all lines to the output window, sorted by derating factor and
length.
set lines;
object line;
lines = GetCalcRelevantObjects('*.ElmLne');
lines.SortToVar(0, 'fline', 'dline');
line = lines.First();
while (line) {
printf('%10s %f %f', line:loc_name, line:fline, line:dline);
line = lines.Next();
}

857
Index

abs AddCurve
Mathematical Functions, 71 ComTablereport, 503
acos PltDataseries, 766
Mathematical Functions, 71 AddDouble
Activate IntAddonvars, 641
ElmNet, 224 AddDoubleMatrix
IntCase, 646 IntAddonvars, 641
IntLibrary, 693 AddDoubleVector
IntPrj, 711 IntAddonvars, 642
IntScenario, 739 AddEvent
IntScensched, 743 IntRas, 726
IntScheme, 745 AddHeader
IntSscheduler, 746 ComTablereport, 503
IntSstage, 747 AddInteger
ActivateProject IntAddonvars, 643
Global Functions, 4 AddIntegerVector
ActiveCase IntAddonvars, 643
Global Functions, 12 AddInvisibleFilter
ActiveProject ComTablereport, 504
Global Functions, 10 AddListFilter
AdaptWidth ComTablereport, 504
IntGrflayer, 684 AddListFilterEntries
SetLevelvis, 587 ComTablereport, 505
Add AddMultiListFilter
Set Routines, 850 ComTablereport, 505
AddBreaker AddObject
StaCubic, 311 IntAddonvars, 644
AddButton IntReport, 727
ComTablereport, 501 AddObjects
AddCalcRelevantCoincidenceDefinitions IntReport, 728
SetLvscale, 590 AddObjectVector
AddCellAction IntAddonvars, 644
ComTablereport, 501 AddObjs
AddCntcy VisBdia, 797
ComSimoutage, 492 AddPage
AddColumn SetDesktop, 578
ComTablereport, 502 AddPlot
AddConfiguration ComTablereport, 506
SetDataext, 575 AddProjectToCombined
AddContingencies IntPrj, 711
ComSimoutage, 493 AddProjectToRemoteDatabase
AddCopy IntPrj, 711
General Object Methods, 141 AddRas
AddCubicle ComSimoutage, 493
ElmBoundary, 192 AddRatio

858
INDEX INDEX

TypCtcore, 792 IntDataset, 667


AddRef SetSelect, 597
ComNmink, 463 AllAsm
IntDataset, 667 SetSelect, 597
SetSelect, 597 AllBars
AddRelay SetSelect, 598
VisDraw, 801 AllBreakers
VisMagndiffplt, 809 SetPath, 591
VisOcplot, 811 SetSelect, 598
VisPcompdiffplt, 816 AllClosedBreakers
VisPlottz, 844 SetPath, 591
AddRelays SetSelect, 599
VisDraw, 801 AllElm
VisMagndiffplt, 809 SetSelect, 599
VisOcplot, 811 AllLines
VisPcompdiffplt, 816 SetSelect, 599
VisPlottz, 844 AllLoads
AddResObjs SetSelect, 600
VisBdia, 798 AllOpenBreakers
AddResVars SetPath, 591
VisPlot, 818 SetSelect, 600
VisPlot2, 830 AllProtectionDevices
AddRow SetPath, 591
ComTablereport, 507 AllRelevant
AddString Global Functions, 13
IntAddonvars, 644 AllSym
AddTable SetSelect, 601
ComTablereport, 507 AllTypLne
AddTabularFilter SetSelect, 601
ComTablereport, 508 AnalyseElmRes
AddTextFilter ComRel3, 477
ComTablereport, 508 AppendCommand
AddToUpdatePages ComTasks, 541
ComProtgraphic, 472 AppendStudyCase
AddTrigger ComTasks, 542
IntGate, 681 ComTececocmp, 553
IntRas, 726 Apply
AddVar ElmBmu, 191
IntMon, 702 IntOutage, 705
AddVariable IntScenario, 740
ElmRes, 237 IntSubset, 751
AddVars ApplyAll
ElmRes, 237 IntOutage, 705
IntMon, 702 ApplyAndResetRA
VisPlot, 818 ElmSubstat, 262
VisPlot2, 831 ApplyNetworkState
AddVector IntCase, 646
PltComplexdata, 765 ApplySelective
AddXLabel IntScenario, 740
ComTablereport, 509 IntSubset, 751
AddXYCurve ApplyStudyTime
PltDataseries, 767 IntCase, 647
Align Archive
IntGrflayer, 684 IntPrj, 711
SetLevelvis, 587 AreDistParamsPossible
All ElmLne, 213

859
INDEX INDEX

asin CalcElParams
Mathematical Functions, 71 TypAsmo, 791
AssignCimRdfIds CalcEstimatedPaybackPeriod
ComGridtocim, 446 ComTececocmp, 554
AssumeCompensationFactor CalcInternalRateOfReturn
RelZpol, 778 ComTececocmp, 554
AssumeReRl CalcMaxHostedPower
RelZpol, 778 ComHostcap, 449
AssumeXeXl CalcShiftedReversedBoundary
RelZpol, 778 ElmBoundary, 192
atan2 CalculateCheckSum
Mathematical Functions, 72 BlkDef, 615
atan CalculateInterchangeTo
Mathematical Functions, 72 ElmArea, 177
ElmNet, 225
BeginDataExtensionModification ElmZone, 306
IntPrj, 712 CalculateMaxFaultCurrents
BinaryAnd ElmRelay, 231
Mathematical Functions, 72 CalculateVoltageLevel
BinaryOr ElmArea, 177
Mathematical Functions, 73 ElmNet, 225
BlkDef, 614 ElmZone, 307
CalculateCheckSum, 615 CalculateVoltInterVolt
Check, 614 ElmArea, 177
Compile, 615 ElmNet, 226
Encrypt, 615 ElmZone, 307
GetCheckSum, 615 CalcWeibullPar
Pack, 615 Mathematical Functions, 73
PackAsMacro, 616 CanAddProjectToRemoteDatabase
ResetThirdPartyModule, 616 IntPrj, 712
SetThirdPartyModule, 616 CanSubscribeProjectReadOnly
BlkSig, 617 IntPrj, 712
GetFromSigName, 617 CanSubscribeProjectReadWrite
GetToSigName, 617 IntPrj, 712
BlockSwitch ceil
ComShctrace, 487 Mathematical Functions, 74
BuildExportStructure CentreOrigin
ComUcteexp, 557 VisDraw, 802
BuildNodeNames VisPcompdiffplt, 816
ComUcteexp, 557 VisVec, 845
VisVecres, 845
CalcAggrVarsInRadFeed ChangeColourPalette
ElmFeeder, 201 PltComplexdata, 765
CalcCluster PltDataseries, 767
SetCluster, 565 ChangeFont
SetDistrstate, 586 IntGrflayer, 684
CalcContributions SetLevelvis, 588
ComRelpost, 480 ChangeFrameAndWidth
CalcDiscountedEstimatedPaybackPeriod SetLevelvis, 588
ComTececocmp, 554 ChangeLayer
CalcEfficiency IntGrflayer, 685
ElmAsm, 181 SetLevelvis, 588
ElmGenstat, 207 ChangeRefPoints
ElmPvsys, 227 IntGrflayer, 686
ElmSym, 269 SetLevelvis, 588
ElmXnet, 304 ChangeStyle

860
INDEX INDEX

GrpPage, 634 SetAssociationValue, 630


PltLinebarplot, 769 SetAttributeEnumeration, 631, 632
PltVectorplot, 775 SetAttributeValue, 632, 633
ChangeWidthVisibilityAndColour Clear
IntGrflayer, 686 ComNmink, 463
SetLevelvis, 589 ElmBoundary, 193
ChaVecfile, 617 ElmRes, 238
Update, 617 IntDataset, 667
Check IntDplmap, 669
BlkDef, 614 IntDplvec, 676
ComAuditlog, 399 IntSubset, 751
IntOutage, 706 Set Routines, 851
SetScenario, 596 SetSelect, 601
SetTboxconfig, 603 VisBdia, 798
TypMdl, 794 VisDraw, 802
CheckAll VisHrm, 803
IntOutage, 706 VisMagndiffplt, 810
CheckAssignments VisOcplot, 811
ComMerge, 457 VisPath, 812
CheckBbPath VisPcompdiffplt, 817
ElmBbone, 186 VisPlot, 819
CheckControllers VisPlot2, 831
ComLdf, 452 VisPlottz, 844
CheckFileExists VisXyplot, 846
File System Functions, 41 ClearAll
CheckRanges ComTablereport, 509
ElmRelay, 232 ClearCommands
CheckSyntax Global Functions, 4
ComDpl, 437 ClearCont
CheckUrl ComSimoutage, 493
IntExtaccess, 680 ClearCurves
CimArchive, 618 PltDataseries, 767
ConvertToBusBranch, 618 ClearData
CimModel, 618 IntGrfgroup, 682
DeleteParameterAtIndex, 618 IntGrflayer, 687
GetAttributeEnumerationType, 619 ClearInvalidReferences
GetModelsReferencingThis, 619 IntPrj, 713
GetParameterCount, 619 ClearOutput
GetParameterNamespace, 620 Output Window Functions, 124
GetParameterValue, 620 ClearOutputWindow
HasParameter, 621 Output Window Functions, 124
RemoveParameter, 621 ClearRecycleBin
SetAssociationValue, 622 Global Functions, 4
SetAttributeEnumeration, 623 ClearUpdatePages
SetAttributeValue, 623, 624 ComProtgraphic, 472
CimObject, 624 ClearVars
DeleteParameterAtIndex, 625 IntMon, 702
GetAttributeEnumerationType, 625 ClearVectors
GetObjectsReferencingThis, 626 PltComplexdata, 766
GetObjectsWithSameId, 626 Close
GetParameterCount, 627 ElmCoup, 197
GetParameterNamespace, 627 ElmGndswt, 211
GetParameterValue, 628 ElmRes, 242
GetPfObjects, 628 IntGrfnet, 689
HasParameter, 628 SetDeskpage, 577
RemoveParameter, 629 SetDesktop, 578

861
INDEX INDEX

SetVipage, 607 GetInputObject, 408


StaSwitch, 383 GetModel, 408
CloseTableReports GetModelId, 409
Dialogue Boxes Functions, 56 GetNumberOfValidationMessages, 409
ColLbl GetObject, 410
IntMat, 694, 695 GetObjectId, 410
ComAddlabel, 385 GetProfile, 411
Execute, 385 GetSeverity, 411
ComAddon, 386 GetType, 412
CreateModule, 386 ComConreq, 412
DefineDouble, 386 Execute, 413
DefineDoubleMatrix, 387 ComContingency, 413
DefineDoublePerConnection, 388 ContinueTrace, 413
DefineDoubleVector, 388 CreateRecoveryInformation, 413
DefineDoubleVectorPerConnection, 389 GetGeneratorEvent, 414
DefineInteger, 390 GetInterruptedPowerAndCustomersForStage,
DefineIntegerPerConnection, 390 414
DefineIntegerVector, 391 GetInterruptedPowerAndCustomersForTimeStep,
DefineIntegerVectorPerConnection, 392 415
DefineObject, 392 GetLoadEvent, 415
DefineObjectPerConnection, 393 GetNumberOfGeneratorEventsForTimeStep,
DefineObjectVector, 393 416
DefineObjectVectorPerConnection, 394 GetNumberOfLoadEventsForTimeStep, 416
DefineString, 395 GetNumberOfSwitchEventsForTimeStep, 416
DefineStringPerConnection, 395 GetNumberOfTimeSteps, 417
DeleteModule, 396 GetObj, 417
FinaliseModule, 396 GetSwitchEvent, 417
GetActiveModule, 396 GetTimeOfStepInSeconds, 418
ModuleExists, 397 GetTotalInterruptedPower, 418
SetActiveModule, 397 JumpToLastStep, 418
ComAmpacity, 397 RemoveEvents, 418
ExecuteAmpacityCalc, 397 StartTrace, 419
ComArcreport, 398 StopTrace, 419
GetLocationsToReport, 398 ComCoordreport, 419
GetUnitFor, 398 DevicesToReport, 420
GetValueFor, 398 HasResultsForDirectionalBackup, 420
IsDguv, 399 HasResultsForFuse, 420
ComAuditlog, 399 HasResultsForInstantaneous, 421
Check, 399 HasResultsForNonDirectionalBackup, 421
ComBoundary, 400 HasResultsForOverload, 421
GetCreatedBoundaries, 400 HasResultsForOverreach, 422
ComCapo, 400 HasResultsForShortCircuit, 422
ConnectShuntToBus, 400 HasResultsForZone, 422
LossCostAtBusTech, 401 MaxZoneNumberFor, 423
TotalLossCost, 402 ResultForDirectionalBackupVariable, 423
ComCheck, 403 ResultForFuseVariable, 424
GetNextLoop, 403 ResultForInstantaneousVariable, 424
ComCimdbexp, 404 ResultForMaxCurrent, 425
Execute, 404 ResultForNonDirectionalBackupVariable, 425
ComCimdbimp, 404 ResultForOverloadVariable, 426
Execute, 405 ResultForOverreachVariable, 427
ImportAndConvert, 405 ResultForShortCircuitVariable, 427
ComCimvalidate, 406 ResultForZoneVariable, 428
Execute, 406 TopologyForDirectionalBackupVariable, 429
GetClassType, 407 TopologyForFuseVariable, 429
GetDescriptionText, 407 TopologyForInstantaneousVariable, 430

862
INDEX INDEX

TopologyForMaxCurrent, 430 IsAC, 453


TopologyForNonDirectionalBackupVariable, IsBalanced, 453
430 IsDC, 453
TopologyForOverloadVariable, 431 PrintCheckResults, 453
TopologyForOverreachVariable, 431 SetOldDistributeLoadMode, 453
TopologyForShortCircuitVariable, 432 ComLink, 454
TopologyForZoneVariable, 432 GetMicroSCADAStatus, 454
TransferDirectionalBackupResultsTo, 433 LoadMicroSCADAFile, 454
TransferNonDirectionalBackupResultsTo, 433 ReceiveData, 455
TransferOverreachResultsTo, 434 SendData, 455
TransferResultsTo, 435 SentDataStatus, 455
TransferZoneResultsTo, 435 SetMicroSCADAStatus, 456
ComDiff, 436 SetOPCReceiveQuality, 456
Start, 436 SetSwitchShcEventMode, 456
Stop, 436 Commands Methods, 385
ComDllmanager, 436 Execute, 385
Report, 436 ComMerge, 457
ComDpl, 437 CheckAssignments, 457
CheckSyntax, 437 Compare, 457
Encrypt, 437 CompareActive, 457
Execute, 438 ExecuteRecording, 458
GetExternalObject, 439 ExecuteWithActiveProject, 458
GetInputParameterDouble, 439 GetCorrespondingObject, 458
GetInputParameterInt, 439 GetModification, 458
GetInputParameterString, 440 GetModificationResult, 459
IsEncrypted, 440 GetModifiedObjects, 459
ResetThirdPartyModule, 441 Merge, 460
SetExternalObject, 441 PrintComparisonReport, 460
SetInputParameterDouble, 441 PrintModifications, 460
SetInputParameterInt, 442 Reset, 460
SetInputParameterString, 442 SetAutoAssignmentForAll, 460
SetResultString, 443 SetObjectsToCompare, 461
SetThirdPartyModule, 443 ShowBrowser, 461
ComFlickermeter, 444 WereModificationsFound, 461
Execute, 444 CommitTransaction
ComGenrelinc, 444 Global Functions, 4
GetCurrentIteration, 444 CommitTx
GetMaxNumIterations, 445 Global Functions, 4
ComGridtocim, 445 ComMot, 462
AssignCimRdfIds, 446 GetMotorConnections, 462
ConvertAndExport, 446 GetMotorSwitch, 462
SetAuthorityUri, 447 GetMotorTerminal, 462
SetBoundaries, 447 ComNmink, 463
SetGridsToExport, 448 AddRef, 463
ComHostcap, 448 Clear, 463
CalcMaxHostedPower, 449 GenerateContingenciesForAnalysis, 464
ComImport, 450 GetAll, 464
GetCreatedObjects, 450 ComOmr, 464
GetModifiedObjects, 450 GetFeeders, 465
ComInc, 451 GetOMR, 465
ZeroDerivative, 451 GetRegionCount, 466
ComLdf, 451 ComOpc, 467
CheckControllers, 452 ReceiveData, 467
DoNotResetCalc, 452 SendData, 467
EstimateOutage, 452 ComOutage, 468
Execute, 452 ContinueTrace, 468

863
INDEX INDEX

ExecuteTime, 468 ComRes, 483


GetObject, 468 ExportFullRange, 483
RemoveEvents, 469 FileNmResNm, 484
SetObjs, 470 ComShc, 484
StartTrace, 470 ExecuteRXSweep, 485
StopTrace, 470 GetFaultType, 485
Compare GetOverLoadedBranches, 485
ComMerge, 457 GetOverLoadedBuses, 486
CompareActive ComShctrace, 487
ComMerge, 457 BlockSwitch, 487
ComPfdimport, 471 ExecuteAllSteps, 487
GetImportedObjects, 471 ExecuteInitialStep, 488
Compile ExecuteNextStep, 488
BlkDef, 615 GetBlockedSwitches, 488
TypMdl, 794 GetCurrentTimeStep, 488
ComPrjconnector, 471 GetDeviceSwitches, 488
GetSuccesfullyConnectedItems, 471 GetDeviceTime, 489
GetUnsuccesfullyConnectedItems, 472 GetNonStartedDevices, 489
ComProtgraphic, 472 GetStartedDevices, 489
AddToUpdatePages, 472 GetSwitchTime, 489
ClearUpdatePages, 472 GetTrippedDevices, 490
ComPvcurves, 472 NextStepAvailable, 490
FindCriticalBus, 472 ComSim, 490
ComPython, 472 GetSimulationTime, 490
GetExternalObject, 473 GetTotalWarnA, 490
GetInputParameterDouble, 473 GetTotalWarnB, 491
GetInputParameterInt, 473 GetTotalWarnC, 491
GetInputParameterString, 474 GetViolatedScanModules, 491
SetExternalObject, 474 LoadSimulationState, 491
SetInputParameterDouble, 475 LoadSnapshot, 491
SetInputParameterInt, 475 SaveSimulationState, 492
SetInputParameterString, 475 SaveSnapshot, 492
ComRed, 476 ComSimoutage, 492
LdfEquivalentVerification, 476 AddCntcy, 492
ReductionInMemory, 476 AddContingencies, 493
ResetReductionInMemory, 477 AddRas, 493
SimEquivalentVerification, 477 ClearCont, 493
ComRel3, 477 CreateFaultCase, 494
AnalyseElmRes, 477 Execute, 494
ExeEvt, 478 ExecuteAndCheck, 495
OvlAlleviate, 478 GetNTopLoadedElms, 496
RemoveEvents, 479 MarkRegions, 496
RemoveOutages, 479 RemoveAllRas, 496
ValidateConstraints, 479 RemoveContingencies, 496
ComRelpost, 480 RemoveRas, 497
CalcContributions, 480 Reset, 497
GetContributionOfComponent, 481 SetLimits, 497
ComRelreport, 481 Update, 497
GetContingencies, 481 ComSvgexport, 498
GetContributionOfComponent, 481 SetFileName, 498
ComReltabreport, 482 SetObject, 498
GetContingencies, 482 SetObjects, 498
GetContributionOfComponent, 482 ComSvgimport, 499
ComReport, 482 SetFileName, 499
ExecuteWithCustomSelection, 482 SetObject, 499
SetParameter, 483 ComTablereport, 499

864
INDEX INDEX

AddButton, 501 HasCell, 524


AddCellAction, 501 HasColumnAutoFilter, 525
AddColumn, 502 IsColumnScrollable, 525
AddCurve, 503 IsColumnSortable, 525
AddHeader, 503 IsRowVisible, 526
AddInvisibleFilter, 504 NCol, 521
AddListFilter, 504 NRow, 521
AddListFilterEntries, 505 RemoveRow, 526
AddMultiListFilter, 505 SetBarLimits, 527
AddPlot, 506 SetCellAccess, 527
AddRow, 507 SetCellEdit, 528
AddTable, 507 SetCellValueToBar, 528
AddTabularFilter, 508 SetCellValueToCheckbox, 529
AddTextFilter, 508 SetCellValueToDate, 530
AddXLabel, 509 SetCellValueToDouble, 531
ClearAll, 509 SetCellValueToInt, 532
DisableAutomaticRowNumbering, 509 SetCellValueToObject, 533
DisableSingleFilterRefresh, 509 SetCellValueToString, 534
DisplayButtonsCollapsible, 509 SetColumnHeader, 535
DisplayFiltersCollapsible, 510 SetCurveValue, 536
DisplayFiltersIn2Columns, 510 SetDialogSize, 536
DisplayHeadersCollapsible, 510 SetExportHtml, 537
EnableAutomaticRowNumbering, 510 SetExportXls, 537
ExportToExcel, 511 SetListFilterSelection, 537
ExportToHTML, 511 SetNumberFormatForPlot, 538
FindNextCell, 511 SetRefresh, 538
FindNextRow, 512 SetSorting, 538
FindPreviousCell, 512 SetStatusText, 539
FindPreviousRow, 513 SetTextAxisDistForPlot, 539
GetCellAccessObject, 513 SetTicksForPlot, 539
GetCellAlignment, 514 SetTitle, 540
GetCellBackgroundColor, 514 SizeX, 521
GetCellColor, 515 SizeY, 521
GetCellEditObjects, 515 ComTasks, 541
GetCellFontStyle, 516 AppendCommand, 541
GetCellFormat, 516 AppendStudyCase, 542
GetCellHelpText, 517 GetCommandsForStudyCase, 543
GetCellValueType, 517 GetNumberOfCommandsForStudyCase, 543
GetCheckboxCellValue, 518 GetNumberOfStudyCases, 544
GetColumnFilter, 518 GetStudyCases, 544
GetColumnHeader, 518 IsAdditionalResultsFlagSetForCommand, 544
GetColumnId, 519 IsCommandIgnored, 545
GetDateCellValue, 519 IsStudyCaseIgnored, 545
GetDoubleCellValue, 520 RemoveCmdsForStudyCaseRow, 546
GetIntCellValue, 520 RemoveCommand, 547
GetNumberOfColumns, 521 RemoveStudyCase, 547
GetNumberOfRows, 521 RemoveStudyCases, 547
GetNumberOfSelectedCells, 521 SetAdditionalResultsFlagForCommand, 548
GetObjectCellValue, 522 SetIgnoreFlagForCommand, 549
GetRowCaption, 522 SetIgnoreFlagForStudyCase, 551
GetRowId, 522 SetResultsFolder, 552
GetSelectedCell, 523 ComTececo, 552
GetSelectedElements, 523 UpdateTablesByCalcPeriod, 553
GetSelection, 523 ComTececocmp, 553
GetStringCellValue, 524 AppendStudyCase, 553
GoToCell, 524 CalcDiscountedEstimatedPaybackPeriod, 554

865
INDEX INDEX

CalcEstimatedPaybackPeriod, 554 StaExtpmea, 353


CalcInternalRateOfReturn, 554 StaExtqmea, 358
RemoveStudyCases, 555 StaExtsmea, 363
ComTransfer, 555 StaExttapmea, 368
GetTransferCalcData, 555 StaExtv3mea, 373
IsLastIterationFeasible, 556 StaExtvmea, 378
ComUcte, 556 CopyFile
SetBatchMode, 556 File System Functions, 42
ComUcteexp, 557 cos
BuildExportStructure, 557 Mathematical Functions, 74
BuildNodeNames, 557 cosh
DeleteCompleteQuickAccess, 558 Mathematical Functions, 75
ExportAndInitQuickAccess, 558 Count
GetConnectedBranches, 559 Set Routines, 851
GetFromToNodeNames, 560 Create
GetOrderCode, 561 SetPath, 592
GetUcteNodeName, 561 CreateCBEvents
InitQuickAccess, 562 IntEvt, 680
QuickAccessAvailable, 563 CreateDerivedProject
ResetQuickAccess, 563 IntVersion, 762
SetGridSelection, 564 CreateDir
ComWktimp, 564 File System Functions, 42
GetCreatedObjects, 564 CreateEvent
GetModifiedObjects, 564 ElmTr2, 283
ConnectShuntToBus ElmTr3, 287
ComCapo, 400 ElmTr4, 292
Consolidate ElmVoltreg, 302
IntCase, 647 StaExtdatmea, 328
IntScheme, 745 CreateFaultCase
Contains ComSimoutage, 494
IntDplmap, 669 Global Functions, 5
ContinueTrace CreateFeederWithRoutes
ComContingency, 413 ElmLne, 214
ComOutage, 468 CreateField
ConvertAndExport IntReport, 728
ComGridtocim, 446 CreateFilter
ConvertGeometryStringToMDL SetColscheme, 567
Global Functions, 4 CreateGroup
ConvertToASCIIFormat IntUserman, 755
IntComtrade, 648 CreateModule
ConvertToBinaryFormat ComAddon, 386
IntComtrade, 648 CreateObject
ConvertToBusBranch General Object Methods, 143
CimArchive, 618 CreateProject
CopyData Global Functions, 5
General Object Methods, 142 CreateRecoveryInformation
CopyDataExtensionFrom ComContingency, 413
IntPrj, 713 CreateStageObject
CopyExtMeaStatusToStatusTmp IntSstage, 748
StaExtbrkmea, 318 CreateTable
StaExtcmdmea, 323 IntReport, 729
StaExtdatmea, 328 CreateUser
StaExtfmea, 333 IntUserman, 755
StaExtfuelmea, 338 CreateVersion
StaExtimea, 343 IntPrj, 713
StaExtpfmea, 348 CreateVI

866
INDEX INDEX

SetVipage, 608 DefineObjectVectorPerConnection


ComAddon, 394
Date/Time Functions, 50 DefineString
FormatDate, 55 ComAddon, 395
FormatDateLT, 50 DefineStringPerConnection
FormatDateUTC, 51 ComAddon, 395
GetStudyTimeObject, 52 Delete
GetSystemTime, 52 Global Functions, 7
GetSystemTimeUTC, 53 DeleteCompleteQuickAccess
GetTime, 53 ComUcteexp, 558
ParseDateLT, 53 DeleteModule
ParseDateUTC, 54 ComAddon, 396
strftime, 55 DeleteParameterAtIndex
Date CimModel, 618
SetTime, 604 CimObject, 625
Deactivate DeleteRow
ElmNet, 226 IntScensched, 743
IntCase, 647 DeleteUntouchedObjects
IntLibrary, 693 Global Functions, 7
IntPrj, 714 Derate
IntScenario, 740 ElmGenstat, 207
IntScensched, 743 ElmPvsys, 228
IntScheme, 745 ElmSym, 270
IntSscheduler, 747 DevicesToReport
DecodeColour ComCoordreport, 420
Global Functions, 6 Dialogue Boxes Functions, 56
Default CloseTableReports, 56
SetScenario, 596 GetTableReports, 56
DefineBoundary input, 56
ElmArea, 178 MessageBox, 57
ElmNet, 227 ShowModalBrowser, 59
ElmZone, 307 ShowModalOpenFileDialog, 59
DefineDouble ShowModalSaveFileDialog, 60
ComAddon, 386 ShowModalSelectBrowser, 61
DefineDoubleMatrix ShowModalSelectFolderDialog, 62
ComAddon, 387 ShowModelessBrowser, 63
DefineDoublePerConnection UpdateTableReports, 63
ComAddon, 388 DisableAutomaticRowNumbering
DefineDoubleVector ComTablereport, 509
ComAddon, 388 DisableSingleFilterRefresh
DefineDoubleVectorPerConnection ComTablereport, 509
ComAddon, 389 DiscardChanges
DefineInteger IntScenario, 741
ComAddon, 390 Disconnect
DefineIntegerPerConnection ElmGenstat, 207
ComAddon, 390 ElmPvsys, 228
DefineIntegerVector ElmSym, 270
ComAddon, 391 ElmXnet, 304
DefineIntegerVectorPerConnection DisplayButtonsCollapsible
ComAddon, 392 ComTablereport, 509
DefineObject DisplayFiltersCollapsible
ComAddon, 392 ComTablereport, 510
DefineObjectPerConnection DisplayFiltersIn2Columns
ComAddon, 393 ComTablereport, 510
DefineObjectVector DisplayHeadersCollapsible
ComAddon, 393 ComTablereport, 510

867
INDEX INDEX

DoAutoScale GetAll, 178


GrpPage, 635 GetBranches, 179
PltAxis, 764 GetBuses, 179
PltLinebarplot, 769 GetObjs, 180
PltVectorplot, 775 ElmAsm, 180
DoAutoScaleOnAll CalcEfficiency, 181
VisDraw, 802 GetAvailableGenPower, 181
DoAutoScaleOnCharacteristics GetElecTorque, 182
VisDraw, 802 GetGroundingImpedance, 182
DoAutoScaleOnImpedances GetMechTorque, 183
VisDraw, 802 GetMotorStartingFlag, 183
DoAutoScaleX GetStepupTransformer, 183
GrpPage, 635 IsPQ, 184
PltLinebarplot, 770 ElmAsmsc, 184
SetDesktop, 578 GetAvailableGenPower, 184
SetVipage, 607 GetGroundingImpedance, 185
VisDraw, 802 GetStepupTransformer, 186
VisHrm, 804 ElmBbone, 186
VisMagndiffplt, 810 CheckBbPath, 186
VisOcplot, 811 GetBbOrder, 187
VisPath, 812 GetCompleteBbPath, 188
VisPcompdiffplt, 817 GetFOR, 188
VisPlot, 819 GetMeanCs, 189
VisPlot2, 832 GetMinCs, 189
VisPlottz, 844 GetTieOpenPoint, 190
VisXyplot, 846 GetTotLength, 190
DoAutoScaleY2 HasGnrlMod, 191
VisPlot2, 833 ElmBmu, 191
DoAutoScaleY Apply, 191
GrpPage, 635 Update, 192
PltLinebarplot, 770 ElmBoundary, 192
SetVipage, 607 AddCubicle, 192
VisDraw, 803 CalcShiftedReversedBoundary, 192
VisHrm, 804 Clear, 193
VisMagndiffplt, 810 GetInterior, 193
VisOcplot, 811 IsSplitting, 193
VisPath, 813 Resize, 194
VisPcompdiffplt, 817 Update, 194
VisPlot, 820 ElmBranch, 194
VisPlot2, 833 Update, 195
VisPlottz, 845 ElmCabsys, 195
VisXyplot, 847 FitParams, 195
DoNotResetCalc GetLineCable, 195
ComLdf, 452 Update, 196
ElmComp, 196
EchoOff slotupd, 197
Environment Functions, 64 SlotUpdate, 197
EchoOn ElmCoup, 197
Environment Functions, 64 Close, 197
Edit GetRemoteBreakers, 198
General Object Methods, 172 IsBreaker, 198
ElmArea, 176 IsClosed, 198
CalculateInterchangeTo, 177 IsOpen, 199
CalculateVoltageLevel, 177 Open, 199
CalculateVoltInterVolt, 177 ElmDsl, 200
DefineBoundary, 178 ExportToClipboard, 200

868
INDEX INDEX

ExportToFile, 200 CalculateVoltageLevel, 225


ElmFeeder, 201 CalculateVoltInterVolt, 226
CalcAggrVarsInRadFeed, 201 Deactivate, 226
GetAll, 201 DefineBoundary, 227
GetBranches, 202 ElmPvsys, 227
GetBuses, 203 CalcEfficiency, 227
GetNodesBranches, 203 Derate, 228
GetObjs, 204 Disconnect, 228
ElmFile, 205 GetAvailableGenPower, 229
LoadFile, 205 GetGroundingImpedance, 229
SaveFile, 205 IsConnected, 230
ElmFilter, 206 Reconnect, 230
GetGroundingImpedance, 206 ResetDerating, 231
ElmGenstat, 206 ElmRelay, 231
CalcEfficiency, 207 CalculateMaxFaultCurrents, 231
Derate, 207 CheckRanges, 232
Disconnect, 207 GetCalcRX, 232
GetAvailableGenPower, 208 GetMaxFdetectCalcI, 232
GetGroundingImpedance, 209 GetSlot, 233
GetStepupTransformer, 209 GetUnom, 233
IsConnected, 210 IsStarted, 233
Reconnect, 210 SetImpedance, 234
ResetDerating, 211 SetMaxI, 235
ElmGndswt, 211 SetMaxIearth, 235
Close, 211 SetMinI, 235
GetGroundingImpedance, 211 SetMinIearth, 235
IsClosed, 212 SetOutOfService, 235
IsOpen, 212 SetTime, 236
Open, 212 slotupd, 236
ElmLne, 213 SlotUpdate, 236
AreDistParamsPossible, 213 ElmRes, 237
CreateFeederWithRoutes, 214 AddVariable, 237
FitParams, 214 AddVars, 237
GetIthr, 215 Clear, 238
GetType, 215 Close, 242
GetY0m, 216 ExecuteLoadingCommand, 239
GetY1m, 216 FindColumn, 239
GetZ0m, 217 FindMaxInColumn, 240
GetZ1m, 218 FindMaxOfVariableInRow, 241
GetZmatDist, 218 FindMinInColumn, 242
HasRoutes, 219 FindMinOfVariableInRow, 242
HasRoutesOrSec, 219 FinishWriting, 242
IsCable, 220 Flush, 243
IsNetCoupling, 220 GetColumnValues, 244
MeasureLength, 221 GetDescription, 244
SetDetailed, 221 GetFirstValidObject, 244
ElmLnesec, 222 GetFirstValidObjectVariable, 246
IsCable, 222 GetFirstValidVariable, 246
ElmMdl, 223 GetNextValidObject, 247
ExportToClipboard, 223 GetNextValidObjectVariable, 248
ExportToFile, 223 GetNextValidVariable, 249
ElmNec, 224 GetNumberOfColumns, 249
GetGroundingImpedance, 224 GetNumberOfRows, 249
ElmNet, 224 GetObj, 249
Activate, 224 GetObject, 250
CalculateInterchangeTo, 225 GetObjectValue, 250

869
INDEX INDEX

GetRelCase, 251 GetEllaNodeName, 278


GetSubElmRes, 252 GetEquivalentTerminals, 276
GetUnit, 252 GetMinDistance, 277
GetValue, 253 GetNextHVBus, 278
GetVariable, 253 GetNodeName, 278
Init, 254 GetSepStationAreas, 278
InitialiseWriting, 254 GetShortestPath, 279
Load, 255 HasCreatedCalBus, 280
NCol, 249 IsElectrEquivalent, 280
NRow, 249 IsEquivalent, 281
Release, 256 IsInternalNodeInStation, 282
SetAsDefault, 256 IsInternalNodeInSubStation, 282
SetObj, 256 UpdateSubstationTerminals, 282
SetSubElmResKey, 257 ElmTow, 283
SizeX, 249 Update, 283
SizeY, 249 ElmTr2, 283
SortAccordingToColumn, 257 CreateEvent, 283
Write, 258 GetGroundingImpedance, 284
WriteDraw, 258 GetSuppliedElements, 284
ElmShnt, 259 GetTapPhi, 285
GetGroundingImpedance, 259 GetTapRatio, 285
ElmStactrl, 260 GetZ0pu, 285
GetControlledHVNode, 260 GetZpu, 286
GetControlledLVNode, 260 IsQuadBooster, 286
GetStepupTransformer, 261 NTap, 287
Info, 261 ElmTr3, 287
ElmSubstat, 262 CreateEvent, 287
ApplyAndResetRA, 262 GetGroundingImpedance, 288
GetSplit, 262 GetSuppliedElements, 288
GetSplitCal, 264 GetTapPhi, 289
GetSplitIndex, 265 GetTapRatio, 289
GetSuppliedElements, 266 GetTapZDependentSide, 289
OverwriteRA, 267 GetZ0pu, 290
ResetRA, 267 GetZpu, 290
SaveAsRA, 267 IsQuadBooster, 291
SetRA, 268 NTap, 291
ElmSvs, 268 ElmTr4, 291
GetStepupTransformer, 268 CreateEvent, 292
ElmSym, 269 GetGroundingImpedance, 292
CalcEfficiency, 269 GetSuppliedElements, 292
Derate, 270 GetTapPhi, 293
Disconnect, 270 GetTapRatio, 293
GetAvailableGenPower, 270 GetTapZDependentSide, 294
GetGroundingImpedance, 271 GetZ0pu, 294
GetMotorStartingFlag, 272 GetZpu, 295
GetStepupTransformer, 272 IsQuadBooster, 295
IsConnected, 272 NTap, 295
Reconnect, 273 ElmTrain, 296
ResetDerating, 273 SetPosition, 296
ElmTerm, 274 ElmTrb, 296
GetBusType, 274 GetGroundingImpedance, 296
GetCalcRelevantCubicles, 274 ElmTrfstat, 297
GetConnectedBrkCubicles, 274 GetSplit, 297
GetConnectedCubicles, 275 GetSplitCal, 298
GetConnectedMainBuses, 275 GetSplitIndex, 300
GetConnectionInfo, 275 GetSuppliedElements, 301

870
INDEX INDEX

ElmVac, 301 SetFinalEchoOnEnabled, 67


GetGroundingImpedance, 301 SetGraphicUpdate, 67
ElmVoltreg, 302 SetGuiUpdateEnabled, 68
CreateEvent, 302 SetProgressBarUpdatesEnabled, 69
GetGroundingImpedance, 302 SetRescheduleFlag, 68
GetZpu, 303 SetUserBreakEnabled, 70
NTap, 303 StartNewTableReportGroup, 70
ElmXnet, 303 Error
CalcEfficiency, 304 Output Window Functions, 124
Disconnect, 304 EstimateOutage
GetGroundingImpedance, 305 ComLdf, 452
GetStepupTransformer, 305 Exe
Reconnect, 305 Global Functions, 8
ElmZone, 306 Execute
CalculateInterchangeTo, 306 ComAddlabel, 385
CalculateVoltageLevel, 307 ComCimdbexp, 404
CalculateVoltInterVolt, 307 ComCimdbimp, 405
DefineBoundary, 307 ComCimvalidate, 406
GetAll, 308 ComConreq, 413
GetBranches, 308 ComDpl, 438
GetBuses, 309 ComFlickermeter, 444
GetObjs, 309 ComLdf, 452
SetLoadScaleAbsolute, 310 Commands Methods, 385
EmptyCache ComSimoutage, 494
SetDatabase, 574 ExecuteAllSteps
EnableAutomaticRowNumbering ComShctrace, 487
ComTablereport, 510 ExecuteAmpacityCalc
EnableDiffMode ComAmpacity, 397
IntSstage, 748 ExecuteAndCheck
EnableUserBreak ComSimoutage, 495
Environment Functions, 70 ExecuteCmd
EncodeColour Global Functions, 8
Global Functions, 8 ExecuteInitialStep
Encrypt ComShctrace, 488
BlkDef, 615 ExecuteLoadingCommand
ComDpl, 437 ElmRes, 239
TypQdsl, 795 ExecuteNextStep
EndDataExtensionModification ComShctrace, 488
IntPrj, 715 ExecuteRecording
EndTableReportGroup ComMerge, 458
Environment Functions, 64 ExecuteRXSweep
Energize ComShc, 485
General Object Methods, 143 ExecuteTime
Environment Functions, 63 ComOutage, 468
EchoOff, 64 ExecuteWithActiveProject
EchoOn, 64 ComMerge, 458
EnableUserBreak, 70 ExecuteWithCustomSelection
EndTableReportGroup, 64 ComReport, 482
GetDiffMode, 64 ExeEvt
IsAutomaticCalculationResetEnabled, 65 ComRel3, 478
IsFinalEchoOnEnabled, 65 exit
NoFinalUpdate, 65 Global Functions, 9
SetAutomaticCalculationResetEnabled, 65 exp
SetConsistencyCheck, 66 Mathematical Functions, 75
SetDiffMode, 66 Export
SetEnableUserBreak, 70 IntDocument, 668

871
INDEX INDEX

IntGrfgroup, 682 IntComtrade, 649


IntGrflayer, 687 IntComtradeset, 659
IntIcon, 692 FindMaxOfVariableInRow
ExportAndInitQuickAccess ElmRes, 241
ComUcteexp, 558 FindMinInColumn
ExportFullRange ElmRes, 242
ComRes, 483 IntComtrade, 650
ExportToClipboard IntComtradeset, 660
ElmDsl, 200 FindMinOfVariableInRow
ElmMdl, 223 ElmRes, 242
ExportToExcel FindNextCell
ComTablereport, 511 ComTablereport, 511
ExportToFile FindNextRow
ElmDsl, 200 ComTablereport, 512
ElmMdl, 223 FindPreviousCell
ExportToHTML ComTablereport, 512
ComTablereport, 511 FindPreviousRow
ExportToVec ComTablereport, 513
IntGrfgroup, 682 FinishWriting
IntGrflayer, 687 ElmRes, 242
First
fclose IntDplmap, 670
File System Functions, 43 Set Routines, 851
fflush FirstFilt
File System Functions, 43 Set Routines, 852
File System Functions, 41 FitParams
CheckFileExists, 41 ElmCabsys, 195
CopyFile, 42 ElmLne, 214
CreateDir, 42 floor
fclose, 43 Mathematical Functions, 75
fflush, 43 Flush
fopen, 43 ElmRes, 243
fprintf, 45 FlushOutputWindow
fscanf, 45 Output Window Functions, 125
fscanfsep, 46 fopen
GetDirectories, 47 File System Functions, 43
GetFileDate, 48 Format String Syntax, 130
GetFiles, 48 FormatDate
GetInstallationDirectory, 49 Date/Time Functions, 55
GetInstallDir, 49 FormatDateLT
GetTempDir, 49 Date/Time Functions, 50
GetTemporaryDirectory, 49 FormatDateUTC
GetWorkingDir, 49 Date/Time Functions, 51
GetWorkspaceDirectory, 49 fprintf
FileNmResNm File System Functions, 45
ComRes, 484 frac
FinaliseModule Mathematical Functions, 75
ComAddon, 396 fRand
FindColumn Mathematical Functions, 76
ElmRes, 239 Freeze
IntComtrade, 649 SetDesktop, 579
IntComtradeset, 658 fscanf
FindCriticalBus File System Functions, 45
ComPvcurves, 472 fscanfsep
FindMaxInColumn File System Functions, 46
ElmRes, 240 fWrite

872
INDEX INDEX

Output Window Functions, 126 lnm, 167


MarkInGraphics, 167
General Object Methods, 140 Move, 168
AddCopy, 141 PasteCopy, 169
CopyData, 142 PurgeUnusedObjects, 169
CreateObject, 143 ReportUnusedObjects, 170
Edit, 172 SearchObject, 170
Energize, 143 SetSize, 170
GetChildren, 144 SetVal, 171
GetClass, 145 ShowEditDialog, 172
GetClassName, 145 ShowFullName, 173
GetCombinedProjectSource, 145 ShowModalSelectTree, 173
GetConnectedElements, 145 snm, 173
GetConnectionCount, 146 SwitchOff, 174
GetContents, 146 SwitchOn, 174
GetControlledNode, 147 unm, 175
GetCubicle, 148 VarExists, 175
GetFullName, 148 GenerateContingenciesForAnalysis
GetImpedance, 149 ComNmink, 464
GetInom, 149 Get
GetNet, 150 IntDplvec, 676
GetNode, 151 IntMat, 694
GetOperator, 151 IntVec, 757
GetOwner, 151 IntVecobj, 760
GetParent, 151 SetFilt, 587
GetReferences, 152 GetActiveCalculationStr
GetRegion, 153 Global Functions, 9
GetSize, 154 GetActiveModule
GetSupplyingSubstations, 155 ComAddon, 396
GetSupplyingTransformers, 155 GetActiveNetworkVariations
GetSupplyingTrfstations, 155 Global Functions, 10
GetSystemGround, 155 GetActivePage
GetSystemGrounding, 155 SetDesktop, 579
GetUnom, 156 GetActiveProject
GetVal, 157 Global Functions, 10
GetVarType, 157 GetActiveScenario
GetZeroImpedance, 158 Global Functions, 11
HasReferences, 158 GetActiveScenarioScheduler
HasResults, 159 Global Functions, 11
Inom, 149 GetActiveScheduler
IsCalcRelevant, 159 IntScheme, 746
IsClass, 160 GetActiveStages
IsDeleted, 161 Global Functions, 11
IsEarthed, 161 GetActiveStudyCase
IsEnergized, 162 Global Functions, 12
IsHidden, 162 GetAlarmColouringMode
IsInFeeder, 163 SetColscheme, 568
IsNetworkDataFolder, 163 GetAll
IsNode, 164 ComNmink, 464
IsObjectActive, 164 ElmArea, 178
IsObjectModifiedByVariation, 164 ElmFeeder, 201
Isolate, 165 ElmZone, 308
IsOutOfService, 165 IntDataset, 667
IsReducible, 166 SetPath, 592
IsRelevant, 159 SetSelect, 602
IsShortCircuited, 166 StaCubic, 311

873
INDEX INDEX

GetAllUsers GetCellAccessObject
Global Functions, 12 ComTablereport, 513
GetAnalogueDescriptions GetCellAlignment
IntComtrade, 651 ComTablereport, 514
IntComtradeset, 660 GetCellBackgroundColor
GetAttributeEnumerationType ComTablereport, 514
CimModel, 619 GetCellColor
CimObject, 625 ComTablereport, 515
GetAvailableButtons GetCellEditObjects
SetTboxconfig, 603 ComTablereport, 515
GetAvailableGenPower GetCellFontStyle
ElmAsm, 181 ComTablereport, 516
ElmAsmsc, 184 GetCellFormat
ElmGenstat, 208 ComTablereport, 516
ElmPvsys, 229 GetCellHelpText
ElmSym, 270 ComTablereport, 517
GetAxisX GetCellValueType
PltLinebarplot, 770 ComTablereport, 517
PltVectorplot, 775 GetCheckboxCellValue
GetAxisY ComTablereport, 518
PltLinebarplot, 770 GetCheckSum
PltVectorplot, 775 BlkDef, 615
GetBbOrder GetChildren
ElmBbone, 187 General Object Methods, 144
GetBlockedSwitches GetClass
ComShctrace, 488 General Object Methods, 145
GetBorderCubicles GetClassDescription
Global Functions, 12 Global Functions, 14
GetBranch GetClassName
StaCubic, 312 General Object Methods, 145
GetBranches GetClassType
ElmArea, 179 ComCimvalidate, 407
ElmFeeder, 202 GetColouringMode
ElmZone, 308 SetColscheme, 569
SetPath, 593 GetColumnFilter
GetBrowserSelection ComTablereport, 518
Global Functions, 13 GetColumnHeader
GetBuses ComTablereport, 518
ElmArea, 179 GetColumnId
ElmFeeder, 203 ComTablereport, 519
ElmZone, 309 GetColumnLabel
SetPath, 593 IntMat, 695
GetBusType GetColumnLabelIndex
ElmTerm, 274 IntMat, 695
GetCalcRelevantCubicles GetColumnValues
ElmTerm, 274 ElmRes, 244
GetCalcRelevantObjects IntComtrade, 651
Global Functions, 13 IntComtradeset, 660
GetCalcRX GetCombinedProjectSource
ElmRelay, 232 General Object Methods, 145
GetCanvasSize GetCommandsForStudyCase
SetDesktop, 579 ComTasks, 543
GetCaseCommand GetCompleteBbPath
Global Functions, 18 ElmBbone, 188
GetCaseObject GetComplexData
Global Functions, 18 PltVectorplot, 775

874
INDEX INDEX

GetConfiguration ComShctrace, 488


IntSubset, 752 GetCurrentUser
SetDataext, 575 Global Functions, 15
GetConfigurations GetCurrentZoomScaleLevel
SetDataext, 576 Global Functions, 15
GetConnectedBranches GetDataFolder
ComUcteexp, 559 Global Functions, 16
GetConnectedBrkCubicles GetDataSeries
ElmTerm, 274 PltLinebarplot, 770
GetConnectedCubicles GetDataSource
ElmTerm, 275 PltDataseries, 768
GetConnectedElements VisHrm, 805
General Object Methods, 145 VisPlot, 820
GetConnectedMainBuses VisPlot2, 834
ElmTerm, 275 VisXyplot, 847
GetConnectedMajorNodes GetDateCellValue
StaCubic, 312 ComTablereport, 519
GetConnectionCount GetDerivedProjects
General Object Methods, 146 IntPrj, 715
GetConnectionInfo IntVersion, 763
ElmTerm, 275 GetDescription
GetConnections ElmRes, 244
StaCubic, 313 Global Functions, 16
GetContents IntComtrade, 651
General Object Methods, 146 IntComtradeset, 661
GetContingencies GetDescriptionText
ComRelreport, 481 ComCimvalidate, 407
ComReltabreport, 482 GetDeviceSwitches
GetContributionOfComponent ComShctrace, 488
ComRelpost, 481 GetDeviceTime
ComRelreport, 481 ComShctrace, 489
ComReltabreport, 482 GetDiagramSelection
GetControlledHVNode Global Functions, 17
ElmStactrl, 260 GetDiffMode
GetControlledLVNode Environment Functions, 64
ElmStactrl, 260 GetDigitalDescriptions
GetControlledNode IntComtrade, 652
General Object Methods, 147 IntComtradeset, 661
GetCorrespondingObject GetDirectories
ComMerge, 458 File System Functions, 47
GetCreatedBoundaries GetDisplayedButtons
ComBoundary, 400 SetTboxconfig, 603
GetCreatedObjects GetDoubleCellValue
ComImport, 450 ComTablereport, 520
ComWktimp, 564 GetElecTorque
GetCriticalTimePhase ElmAsm, 182
IntThrating, 752 GetEllaNodeName
GetCubicle ElmTerm, 278
General Object Methods, 148 GetEnergisingColouringMode
GetCurrentDiagram SetColscheme, 569
Global Functions, 14 GetEquivalentTerminals
GetCurrentIteration ElmTerm, 276
ComGenrelinc, 444 GetExternalObject
GetCurrentSelection ComDpl, 439
Global Functions, 14 ComPython, 473
GetCurrentTimeStep GetExternalReferences

875
INDEX INDEX

IntPrj, 715 ElmSym, 271


GetFaultType ElmTr2, 284
ComShc, 485 ElmTr3, 288
GetFeeders ElmTr4, 292
ComOmr, 465 ElmTrb, 296
GetFieldCount ElmVac, 301
IntReport, 729 ElmVoltreg, 302
GetFieldDataType ElmXnet, 305
IntReport, 730 GetGroups
GetFieldName IntUserman, 756
IntReport, 730 GetHistoricalProject
GetFileDate IntVersion, 763
File System Functions, 48 GetImpedance
GetFiles General Object Methods, 149
File System Functions, 48 GetImportedObjects
GetFirstValidObject ComPfdimport, 471
ElmRes, 244 GetInom
GetFirstValidObjectVariable General Object Methods, 149
ElmRes, 246 GetInputObject
GetFirstValidVariable ComCimvalidate, 408
ElmRes, 246 GetInputParameterDouble
GetFlowOrientation ComDpl, 439
Global Functions, 17 ComPython, 473
GetFontID GetInputParameterInt
SetPrj, 594 ComDpl, 439
GetFOR ComPython, 473
ElmBbone, 188 GetInputParameterString
GetFromSigName ComDpl, 440
BlkSig, 617 ComPython, 474
GetFromStudyCase GetInstallationDirectory
Global Functions, 18 File System Functions, 49
GetFromToNodeNames GetInstallDir
ComUcteexp, 560 File System Functions, 49
GetFullName GetIntCalcres
General Object Methods, 148 PltDataseries, 768
GetGeneratorEvent VisPlot, 821
ComContingency, 414 GetIntCellValue
GetGeoCoordinateSystem ComTablereport, 520
IntPrj, 715 GetInterior
GetGlobalLib ElmBoundary, 193
Global Functions, 18 GetInterruptedPowerAndCustomersForStage
GetGlobalLibrary ComContingency, 414
Global Functions, 18 GetInterruptedPowerAndCustomersForTimeStep
GetGraphBoard ComContingency, 415
Global Functions, 19 GetIthr
GetGraphicsBoard ElmLne, 215
Global Functions, 19 GetLanguage
GetGroundingImpedance Global Functions, 19
ElmAsm, 182 GetLastCmd
ElmAsmsc, 185 Global Functions, 20
ElmFilter, 206 GetLatestVersion
ElmGenstat, 209 IntPrj, 716
ElmGndswt, 211 GetLegend
ElmNec, 224 PltLinebarplot, 771
ElmPvsys, 229 PltVectorplot, 775
ElmShnt, 259 GetLimit

876
INDEX INDEX

ScnFreq, 779 ComImport, 450


ScnFrt, 781 ComMerge, 459
ScnSpeed, 783 ComWktimp, 564
ScnSync, 785 GetMotorConnections
ScnVar, 787 ComMot, 462
ScnVolt, 789 GetMotorStartingFlag
GetLineCable ElmAsm, 183
ElmCabsys, 195 ElmSym, 272
GetLoadEvent GetMotorSwitch
ComContingency, 415 ComMot, 462
GetLocalLib GetMotorTerminal
Global Functions, 20 ComMot, 462
GetLocalLibrary GetNearestBusbars
Global Functions, 20 StaCubic, 314
GetLocationsToReport GetNet
ComArcreport, 398 General Object Methods, 150
GetMaxFdetectCalcI GetNextHVBus
ElmRelay, 232 ElmTerm, 278
GetMaxNumIterations GetNextLoop
ComGenrelinc, 445 ComCheck, 403
GetMeanCs GetNextValidObject
ElmBbone, 189 ElmRes, 247
GetMeaValue GetNextValidObjectVariable
StaExtbrkmea, 318 ElmRes, 248
StaExtcmdmea, 324 GetNextValidVariable
StaExtdatmea, 329 ElmRes, 249
StaExtfmea, 334 GetNode
StaExtfuelmea, 338 General Object Methods, 151
StaExtimea, 343 GetNodeName
StaExtpfmea, 348 ElmTerm, 278
StaExtpmea, 353 GetNodesBranches
StaExtqmea, 358 ElmFeeder, 203
StaExttapmea, 368 GetNonStartedDevices
StaExtv3mea, 373 ComShctrace, 489
StaExtvmea, 378 GetNTopLoadedElms
GetMechTorque ComSimoutage, 496
ElmAsm, 183 GetNumberOfAnalogueSignalDescriptions
GetMem IntComtrade, 652
Global Functions, 20 IntComtradeset, 661
GetMicroSCADAStatus GetNumberOfClusters
ComLink, 454 SetCluster, 566
GetMinCs GetNumberOfColumns
ElmBbone, 189 ComTablereport, 521
GetMinDistance ElmRes, 249
ElmTerm, 277 IntComtrade, 652
GetModel IntComtradeset, 662
ComCimvalidate, 408 IntMat, 695
GetModelId GetNumberOfCommandsForStudyCase
ComCimvalidate, 409 ComTasks, 543
GetModelsReferencingThis GetNumberOfDigitalSignalDescriptions
CimModel, 619 IntComtrade, 652
GetModification IntComtradeset, 662
ComMerge, 458 GetNumberOfGeneratorEventsForTimeStep
GetModificationResult ComContingency, 416
ComMerge, 459 GetNumberOfLoadEventsForTimeStep
GetModifiedObjects ComContingency, 416

877
INDEX INDEX

GetNumberOfRows GetOperationValue
ComTablereport, 521 IntScenario, 741
ElmRes, 249 GetOperator
IntComtrade, 653 General Object Methods, 151
IntComtradeset, 662 GetOrderCode
IntMat, 696 ComUcteexp, 561
GetNumberOfSelectedCells GetOrInsertCurvePlot
ComTablereport, 521 GrpPage, 635
GetNumberOfStudyCases GetOrInsertDiscreteBarPlot
ComTasks, 544 GrpPage, 636
GetNumberOfSwitchEventsForTimeStep GetOrInsertModalAnalysisPlot
ComContingency, 416 GrpPage, 636
GetNumberOfTimeSteps GetOrInsertPlot
ComContingency, 417 SetVipage, 608
GetNumberOfValidationMessages GetOrInsertVectorPlot
ComCimvalidate, 409 GrpPage, 637
GetNumberOfViolations GetOrInsertXYPlot
ScnFreq, 779 GrpPage, 637
ScnFrt, 781 GetOverLoadedBranches
ScnSpeed, 783 ComShc, 485
ScnSync, 785 GetOverLoadedBuses
ScnVar, 787 ComShc, 486
ScnVolt, 789 GetOwner
GetNumProcesses General Object Methods, 151
SetUser, 606 GetPage
GetNumSlave SetDesktop, 580
SetParalman, 590 GetPageLen
GetObj Global Functions, 21
ComContingency, 417 GetParameterCount
ElmRes, 249 CimModel, 619
GetObject CimObject, 627
ComCimvalidate, 410 GetParameterNamespace
ComOutage, 468 CimModel, 620
ElmRes, 250 CimObject, 627
GetObjectCellValue GetParameterValue
ComTablereport, 522 CimModel, 620
GetObjectId CimObject, 628
ComCimvalidate, 410 GetParameterValueAsDouble
GetObjects IntReport, 731
IntReport, 731 GetParameterValueAsInteger
IntScenario, 741 IntReport, 731
IntSubset, 752 GetParameterValueAsString
GetObjectsReferencingThis IntReport, 732
CimObject, 626 GetParent
GetObjectsWithSameId General Object Methods, 151
CimObject, 626 GetPathFolder
GetObjectValue SetPath, 593
ElmRes, 250 GetPathToNearestBusbar
IntComtrade, 653 StaCubic, 315
IntComtradeset, 662 GetPfObjects
GetObjs CimObject, 628
ElmArea, 180 GetPFVersion
ElmFeeder, 204 Global Functions, 21
ElmZone, 309 GetPlot
GetOMR GrpPage, 637
ComOmr, 465 GetProfile

878
INDEX INDEX

ComCimvalidate, 411 IntScensched, 743


GetProjectFolder GetScheme
Global Functions, 21 IntSstage, 749
GetProjectFolderType GetSelectedCell
IntPrjfolder, 723 ComTablereport, 523
GetQlim GetSelectedElements
IntQlim, 724 ComTablereport, 523
GetRandomNumber GetSelection
Mathematical Functions, 76 ComTablereport, 523
GetRandomNumberEx GetSepStationAreas
Mathematical Functions, 76 ElmTerm, 278
GetRating GetSettings
IntThrating, 753 Global Functions, 23
GetRecordingStage GetSeverity
Global Functions, 22 ComCimvalidate, 411
GetReferences GetShortestPath
General Object Methods, 152 ElmTerm, 279
GetRegion GetSignalHeader
General Object Methods, 153 IntComtrade, 653
GetRegionCount IntComtradeset, 663
ComOmr, 466 GetSimulationTime
GetRelCase ComSim, 490
ElmRes, 251 GetSize
GetRemoteBorderCubicles General Object Methods, 154
StaCubic, 316 GetSlot
GetRemoteBreakers ElmRelay, 233
ElmCoup, 198 GetSplit
GetResData ElmSubstat, 262
Global Functions, 22 ElmTrfstat, 297
GetResDesc GetSplitCal
Global Functions, 22 ElmSubstat, 264
GetResObj ElmTrfstat, 298
Global Functions, 23 GetSplitIndex
GetResUnit ElmSubstat, 265
Global Functions, 23 ElmTrfstat, 300
GetResVar GetStartedDevices
Global Functions, 23 ComShctrace, 489
GetRowCaption GetStartEndTime
ComTablereport, 522 IntScensched, 744
GetRowCount GetStatus
IntReport, 732 StaExtbrkmea, 319
GetRowId StaExtcmdmea, 324
ComTablereport, 522 StaExtdatmea, 329
GetRowLabel StaExtfmea, 334
IntMat, 696 StaExtfuelmea, 339
GetRowLabelIndex StaExtimea, 344
IntMat, 697 StaExtpfmea, 349
GetScaleObjX StaExtpmea, 354
VisHrm, 805 StaExtqmea, 359
VisPlot, 821 StaExtsmea, 363
VisPlot2, 834 StaExttapmea, 369
GetScaleObjY StaExtv3mea, 374
VisHrm, 806 StaExtvmea, 379
VisPlot, 822 GetStatusTmp
VisPlot2, 835 StaExtbrkmea, 319
GetScenario StaExtcmdmea, 324

879
INDEX INDEX

StaExtdatmea, 329 Date/Time Functions, 52


StaExtfmea, 334 GetSystemTimeUTC
StaExtfuelmea, 339 Date/Time Functions, 53
StaExtimea, 344 GetTableCount
StaExtpfmea, 349 IntReport, 733
StaExtpmea, 354 GetTableName
StaExtqmea, 359 IntReport, 733
StaExtsmea, 364 GetTableReports
StaExttapmea, 369 Dialogue Boxes Functions, 56
StaExtv3mea, 374 GetTapPhi
StaExtvmea, 379 ElmTr2, 285
GetStepupTransformer ElmTr3, 289
ElmAsm, 183 ElmTr4, 293
ElmAsmsc, 186 GetTapRatio
ElmGenstat, 209 ElmTr2, 285
ElmStactrl, 261 ElmTr3, 289
ElmSvs, 268 ElmTr4, 293
ElmSym, 272 GetTapZDependentSide
ElmXnet, 305 ElmTr3, 289
GetStringCellValue ElmTr4, 294
ComTablereport, 524 GetTempDir
GetStudyCases File System Functions, 49
ComTasks, 544 GetTemporaryDirectory
GetStudyTimeObject File System Functions, 49
Date/Time Functions, 52 GetTieOpenPoint
GetSubElmRes ElmBbone, 190
ElmRes, 252 GetTime
GetSuccesfullyConnectedItems Date/Time Functions, 53
ComPrjconnector, 471 GetTimeOfStepInSeconds
GetSummaryGrid ComContingency, 418
Global Functions, 24 GetTitleObject
GetSuppliedElements PltLinebarplot, 771
ElmSubstat, 266 PltVectorplot, 776
ElmTr2, 284 GetToSigName
ElmTr3, 288 BlkSig, 617
ElmTr4, 292 GetTotalInterruptedPower
ElmTrfstat, 301 ComContingency, 418
GetSupplyingSubstations GetTotalWarnA
General Object Methods, 155 ComSim, 490
GetSupplyingTransformers GetTotalWarnB
General Object Methods, 155 ComSim, 491
GetSupplyingTrfstations GetTotalWarnC
General Object Methods, 155 ComSim, 491
GetSwitch GetTotLength
StaCubic, 317 ElmBbone, 190
GetSwitchEvent GetTouchedObjects
ComContingency, 417 Global Functions, 24
GetSwitchStatus GetTouchingExpansionStages
IntRunarrange, 738 Global Functions, 25
GetSwitchTime GetTouchingStageObjects
ComShctrace, 489 Global Functions, 25
GetSystemGround GetTouchingVariations
General Object Methods, 155 Global Functions, 25
GetSystemGrounding GetTransferCalcData
General Object Methods, 155 ComTransfer, 555
GetSystemTime GetTrippedDevices

880
INDEX INDEX

ComShctrace, 490 ScnVar, 788


GetType ScnVolt, 790
ComCimvalidate, 412 GetVariation
ElmLne, 215 IntSstage, 749
GetUcteNodeName GetVarType
ComUcteexp, 561 General Object Methods, 157
GetUnit GetVersions
ElmRes, 252 IntPrj, 716
IntComtrade, 654 GetVI
IntComtradeset, 663 SetVipage, 608
GetUnitFor GetViolatedElement
ComArcreport, 398 ScnFreq, 780
GetUnom ScnFrt, 782
ElmRelay, 233 ScnSpeed, 784
General Object Methods, 156 ScnSync, 786
GetUnsuccesfullyConnectedItems ScnVar, 788
ComPrjconnector, 472 ScnVolt, 790
GetUserManager GetViolatedScanModules
Global Functions, 26 ComSim, 491
GetUsers GetViolationTime
IntUserman, 756 ScnFreq, 780
GetUserSettings ScnFrt, 782
Global Functions, 26 ScnSpeed, 784
GetVal ScnSync, 786
General Object Methods, 157 ScnVar, 788
GetValue ScnVolt, 790
ElmRes, 253 GetWorkingDir
IntComtrade, 654 File System Functions, 49
IntComtradeset, 663 GetWorkspaceDirectory
IntDplmap, 671 File System Functions, 49
ScnFreq, 779 GetY0m
ScnFrt, 781 ElmLne, 216
ScnSpeed, 783 GetY1m
ScnSync, 785 ElmLne, 216
ScnVar, 787 GetZ0m
ScnVolt, 789 ElmLne, 217
GetValueAsDouble GetZ0pu
IntReport, 733 ElmTr2, 285
GetValueAsInteger ElmTr3, 290
IntReport, 734 ElmTr4, 294
GetValueAsObject GetZ1m
IntReport, 735 ElmLne, 218
GetValueAsString GetZeroImpedance
IntReport, 736 General Object Methods, 158
GetValueFor GetZeroSequenceHVLVT
ComArcreport, 398 TypTr2, 796
GetVar GetZmatDist
IntMon, 702 ElmLne, 218
GetVariable GetZpu
ElmRes, 253 ElmTr2, 286
IntComtrade, 655 ElmTr3, 290
IntComtradeset, 664 ElmTr4, 295
ScnFreq, 779 ElmVoltreg, 303
ScnFrt, 782 Global Functions, 2
ScnSpeed, 784 ActivateProject, 4
ScnSync, 786 ActiveCase, 12

881
INDEX INDEX

ActiveProject, 10 GetResVar, 23
AllRelevant, 13 GetSettings, 23
ClearCommands, 4 GetSummaryGrid, 24
ClearRecycleBin, 4 GetTouchedObjects, 24
CommitTransaction, 4 GetTouchingExpansionStages, 25
CommitTx , 4 GetTouchingStageObjects, 25
ConvertGeometryStringToMDL, 4 GetTouchingVariations, 25
CreateFaultCase, 5 GetUserManager, 26
CreateProject, 5 GetUserSettings, 26
DecodeColour, 6 HttpGet, 26
Delete, 7 ImportDz, 27
DeleteUntouchedObjects, 7 ImportSnapshot, 28
EncodeColour, 8 IsLdfValid, 28
Exe, 8 IsNAN, 28
ExecuteCmd, 8 IsRmsValid, 29
exit, 9 IsScenarioAttribute, 29
GetActiveCalculationStr, 9 IsShcValid, 30
GetActiveNetworkVariations, 10 IsSimValid, 30
GetActiveProject, 10 LicenceHasModule, 31
GetActiveScenario, 11 LoadProfile, 32
GetActiveScenarioScheduler, 11 LoadResData, 33
GetActiveStages, 11 MarkInGraphics, 33
GetActiveStudyCase, 12 OutputFlexibleData, 33
GetAllUsers, 12 PostCommand, 34
GetBorderCubicles, 12 PrepForUntouchedDelete, 34
GetBrowserSelection, 13 Rebuild, 34
GetCalcRelevantObjects, 13 ReleaseResData, 35
GetCaseCommand, 18 ReloadProfile, 35
GetCaseObject, 18 ResetCalculation, 35
GetClassDescription, 14 ResFirstValidObject, 35
GetCurrentDiagram, 14 ResFirstValidObjectVar, 36
GetCurrentSelection, 14 ResFirstValidVar, 36
GetCurrentUser, 15 ResGetMax, 36
GetCurrentZoomScaleLevel, 15 ResGetMin, 36
GetDataFolder, 16 ResIndex, 36
GetDescription, 16 ResNextValidObject, 37
GetDiagramSelection, 17 ResNextValidObjectVar, 37
GetFlowOrientation, 17 ResNextValidVar, 37
GetFromStudyCase, 18 ResNval, 37
GetGlobalLib, 18 ResNvars, 37
GetGlobalLibrary, 18 ResSortToVar, 37
GetGraphBoard, 19 SaveAsScenario, 38
GetGraphicsBoard, 19 SaveScenarioAs, 38
GetLanguage, 19 SearchObjectByForeignKey, 38
GetLastCmd, 20 SelectToolbox, 39
GetLocalLib, 20 SetShowAllUsers, 39
GetLocalLibrary, 20 Sleep, 39
GetMem, 20 SplitLine, 40
GetPageLen, 21 StatFileGetXrange, 40
GetPFVersion, 21 StatFileResetXrange, 40
GetProjectFolder, 21 StatFileSetXrange, 41
GetRecordingStage, 22 SummaryGrid, 24
GetResData, 22 validLDF, 28
GetResDesc, 22 validRMS, 29
GetResObj, 23 validSHC, 30
GetResUnit, 23 validSIM, 30

882
INDEX INDEX

GoToCell ComCoordreport, 422


ComTablereport, 524 HasRoutes
GrpPage, 634 ElmLne, 219
ChangeStyle, 634 HasRoutesOrSec
DoAutoScale, 635 ElmLne, 219
DoAutoScaleX, 635 HttpGet
DoAutoScaleY, 635 Global Functions, 26
GetOrInsertCurvePlot, 635
GetOrInsertDiscreteBarPlot, 636 Import
GetOrInsertModalAnalysisPlot, 636 IntDocument, 668
GetOrInsertVectorPlot, 637 IntGrfgroup, 683
GetOrInsertXYPlot, 637 IntGrflayer, 688
GetPlot, 637 IntIcon, 692
RemovePage, 638 ImportAndConvert
SetAutoScaleModeX, 638 ComCimdbimp, 405
SetAutoScaleModeY, 638 ImportDz
SetLayoutMode, 639 Global Functions, 27
SetResults, 639 ImportFromVec
SetScaleTypeX, 639 IntGrfgroup, 683
SetScaleTypeY, 639 IntGrflayer, 688
SetScaleX, 640 ImportSnapshot
SetScaleY, 640 Global Functions, 28
Show, 640 IndexOf
IntDplvec, 678
HasCell Info
ComTablereport, 524 ElmStactrl, 261
HasColumnAutoFilter Output Window Functions, 125
ComTablereport, 525 Init
HasCreatedCalBus ElmRes, 254
ElmTerm, 280 IntMat, 697
HasExternalReferences IntVec, 757
IntPrj, 716 InitialiseWriting
HasGnrlMod ElmRes, 254
ElmBbone, 191 InitQuickAccess
HasParameter ComUcteexp, 562
CimModel, 621 InitTmp
CimObject, 628 StaExtbrkmea, 319
HasReferences StaExtcmdmea, 324
General Object Methods, 158 StaExtdatmea, 329
HasResults StaExtfmea, 334
General Object Methods, 159 StaExtfuelmea, 339
HasResultsForDirectionalBackup StaExtimea, 344
ComCoordreport, 420 StaExtpfmea, 349
HasResultsForFuse StaExtpmea, 354
ComCoordreport, 420 StaExtqmea, 359
HasResultsForInstantaneous StaExtsmea, 364
ComCoordreport, 421 StaExttapmea, 369
HasResultsForNonDirectionalBackup StaExtv3mea, 374
ComCoordreport, 421 StaExtvmea, 379
HasResultsForOverload Inom
ComCoordreport, 421 General Object Methods, 149
HasResultsForOverreach input
ComCoordreport, 422 Dialogue Boxes Functions, 56
HasResultsForShortCircuit Insert
ComCoordreport, 422 IntDplmap, 674
HasResultsForZone IntDplvec, 678

883
INDEX INDEX

InsertPlot GetNumberOfAnalogueSignalDescriptions,
SetVipage, 608 661
IntAddonvars, 641 GetNumberOfColumns, 662
AddDouble, 641 GetNumberOfDigitalSignalDescriptions, 662
AddDoubleMatrix, 641 GetNumberOfRows, 662
AddDoubleVector, 642 GetObjectValue, 662
AddInteger, 643 GetSignalHeader, 663
AddIntegerVector, 643 GetUnit, 663
AddObject, 644 GetValue, 663
AddObjectVector, 644 GetVariable, 664
AddString, 644 Load, 665
RemoveParameter, 645 NCol, 662
SetConstraint, 645 NRow, 662
IntCase, 646 Release, 665
Activate, 646 SizeX, 662
ApplyNetworkState, 646 SizeY, 662
ApplyStudyTime, 647 SortAccordingToColumn, 666
Consolidate, 647 IntDataset, 667
Deactivate, 647 AddRef, 667
SetStudyTime, 647 All, 667
IntComtrade, 648 Clear, 667
ConvertToASCIIFormat, 648 GetAll, 667
ConvertToBinaryFormat, 648 IntDocument, 668
FindColumn, 649 Export, 668
FindMaxInColumn, 649 Import, 668
FindMinInColumn, 650 Reset, 669
GetAnalogueDescriptions, 651 View, 669
GetColumnValues, 651 IntDplmap, 669
GetDescription, 651 Clear, 669
GetDigitalDescriptions, 652 Contains, 669
GetNumberOfAnalogueSignalDescriptions, First, 670
652 GetValue, 671
GetNumberOfColumns, 652 Insert, 674
GetNumberOfDigitalSignalDescriptions, 652 Next, 674
GetNumberOfRows, 653 Remove, 675
GetObjectValue, 653 Size, 675
GetSignalHeader, 653 Update, 675
GetUnit, 654 IntDplvec, 676
GetValue, 654 Clear, 676
GetVariable, 655 Get, 676
Load, 655 IndexOf, 678
NCol, 652 Insert, 678
NRow, 653 Remove, 678
Release, 656 Size, 679
SizeX, 653 Sort, 679
SizeY, 652 IntEvt, 679
SortAccordingToColumn, 656 CreateCBEvents, 680
IntComtradeset, 658 RemoveSwitchEvents, 680
FindColumn, 658 IntExtaccess, 680
FindMaxInColumn, 659 CheckUrl, 680
FindMinInColumn, 660 IntGate, 681
GetAnalogueDescriptions, 660 AddTrigger, 681
GetColumnValues, 660 IntGrf, 681
GetDescription, 661 MoveToLayer, 681
GetDigitalDescriptions, 661 IntGrfgroup, 682
ClearData, 682

884
INDEX INDEX

Export, 682 AddVars, 702


ExportToVec, 682 ClearVars, 702
Import, 683 GetVar, 702
ImportFromVec, 683 NVars, 703
IntGrflayer, 683 PrintAllVal, 703
AdaptWidth, 684 PrintVal, 704
Align, 684 RemoveVar, 704
ChangeFont, 684 IntOutage, 705
ChangeLayer, 685 Apply, 705
ChangeRefPoints, 686 ApplyAll, 705
ChangeWidthVisibilityAndColour, 686 Check, 706
ClearData, 687 CheckAll, 706
Export, 687 IsInStudyTime, 707
ExportToVec, 687 IsInStudytime, 707
Import, 688 ResetAll, 707
ImportFromVec, 688 IntPlannedout, 707
Mark, 688 SetRecurrence, 707
Reset, 689 IntPlot, 708
IntGrfnet, 689 SetAdaptY, 708
Close, 689 SetAutoScaleY, 708
SetFontFor, 690 SetScaleY, 709
SetLayerVisibility, 690 IntPrj, 710
SetSymbolComponentVisibility, 691 Activate, 711
Show, 691 AddProjectToCombined, 711
IntIcon, 692 AddProjectToRemoteDatabase, 711
Export, 692 Archive, 711
Import, 692 BeginDataExtensionModification, 712
IntLibrary, 693 CanAddProjectToRemoteDatabase, 712
Activate, 693 CanSubscribeProjectReadOnly, 712
Deactivate, 693 CanSubscribeProjectReadWrite, 712
IntMat, 693 ClearInvalidReferences, 713
ColLbl, 694, 695 CopyDataExtensionFrom, 713
Get, 694 CreateVersion, 713
GetColumnLabel, 695 Deactivate, 714
GetColumnLabelIndex, 695 EndDataExtensionModification, 715
GetNumberOfColumns, 695 GetDerivedProjects, 715
GetNumberOfRows, 696 GetExternalReferences, 715
GetRowLabel, 696 GetGeoCoordinateSystem, 715
GetRowLabelIndex, 697 GetLatestVersion, 716
Init, 697 GetVersions, 716
Invert, 697 HasExternalReferences, 716
Multiply, 698 LoadData, 717
NCol, 695 MergeToBaseProject, 717
NRow, 696 Migrate, 717
Resize, 698 NormaliseCombined, 718
RowLbl, 696, 699 PackExternalReferences, 718
Save, 699 Purge, 718
Set, 699 PurgeObjectKeys, 718
SetColumnLabel, 700 RemoveProjectFromCombined, 719
SetRowLabel, 700 Restore, 719
SizeX, 696 SetGeoCoordinateSystem, 719
SizeY, 695 SubscribeProjectReadOnly, 720
SortToColum, 701 SubscribeProjectReadWrite, 720
SortToColumn, 701 TransformGeoCoordinates, 720
IntMon, 701 TransformToGeographicCoordinateSystem,
AddVar, 702 720

885
INDEX INDEX

UnsubscribeProject, 721 Activate, 745


UpdateStatistics, 721 Consolidate, 745
UpdateToDefaultStructure, 721 Deactivate, 745
UpdateToMostRecentBaseVersion, 722 GetActiveScheduler, 746
IntPrjfolder, 723 NewStage, 746
GetProjectFolderType, 723 IntSscheduler, 746
IsProjectFolderType, 724 Activate, 746
IntQlim, 724 Deactivate, 747
GetQlim, 724 Update, 747
IntRas, 726 IntSstage, 747
AddEvent, 726 Activate, 747
AddTrigger, 726 CreateStageObject, 748
IsValid, 726 EnableDiffMode, 748
IntReport, 727 GetScheme, 749
AddObject, 727 GetVariation, 749
AddObjects, 728 IsExcluded, 749
CreateField, 728 PrintModifications, 749
CreateTable, 729 ReadValue, 750
GetFieldCount, 729 WriteValue, 750
GetFieldDataType, 730 IntSubset, 750
GetFieldName, 730 Apply, 751
GetObjects, 731 ApplySelective, 751
GetParameterValueAsDouble, 731 Clear, 751
GetParameterValueAsInteger, 731 GetConfiguration, 752
GetParameterValueAsString, 732 GetObjects, 752
GetRowCount, 732 IntThrating, 752
GetTableCount, 733 GetCriticalTimePhase, 752
GetTableName, 733 GetRating, 753
GetValueAsDouble, 733 Resize, 753
GetValueAsInteger, 734 IntUrl, 754
GetValueAsObject, 735 View, 754
GetValueAsString, 736 IntUser, 754
Reset, 736 Purge, 754
SetDefaultValue, 737 SetPassword, 754
SetValue, 737 TerminateSession, 755
IntRunarrange, 738 IntUserman, 755
GetSwitchStatus, 738 CreateGroup, 755
IntScenario, 739 CreateUser, 755
Activate, 739 GetGroups, 756
Apply, 740 GetUsers, 756
ApplySelective, 740 UpdateGroups, 756
Deactivate, 740 IntVec, 756
DiscardChanges, 741 Get, 757
GetObjects, 741 Init, 757
GetOperationValue, 741 Max, 757
ReleaseMemory, 742 Mean, 757
Save, 742 Min, 757
SetOperationValue, 742 Resize, 758
IntScensched, 743 Save, 758
Activate, 743 Set, 759
Deactivate, 743 Size, 759
DeleteRow, 743 Sort, 759
GetScenario, 743 IntVecobj, 760
GetStartEndTime, 744 Get, 760
SearchScenario, 744 Resize, 761
IntScheme, 745 Save, 761

886
INDEX INDEX

Search, 761 General Object Methods, 161


Set, 761 IsElectrEquivalent
Size, 762 ElmTerm, 280
IntVersion, 762 IsEncrypted
CreateDerivedProject, 762 ComDpl, 440
GetDerivedProjects, 763 TypQdsl, 795
GetHistoricalProject, 763 IsEnergized
Rollback, 763 General Object Methods, 162
IntViewbookmark, 764 IsEquivalent
JumpTo, 764 ElmTerm, 281
UpdateFromCurrentView, 764 IsExcluded
Invert IntSstage, 749
IntMat, 697 IsFinalEchoOnEnabled
InvertMatrix Environment Functions, 65
Mathematical Functions, 77 IsFrozen
IsAC SetDesktop, 580
ComLdf, 453 IsHidden
IsAdditionalResultsFlagSetForCommand General Object Methods, 162
ComTasks, 544 IsIn
IsAutomaticCalculationResetEnabled Set Routines, 853
Environment Functions, 65 IsInFeeder
IsBalanced General Object Methods, 163
ComLdf, 453 IsInStudyTime
IsBreaker IntOutage, 707
ElmCoup, 198 IsInStudytime
IsCable IntOutage, 707
ElmLne, 220 IsInternalNodeInStation
ElmLnesec, 222 ElmTerm, 282
TypLne, 793 IsInternalNodeInSubStation
IsCalcRelevant ElmTerm, 282
General Object Methods, 159 IsLastIterationFeasible
IsClass ComTransfer, 556
General Object Methods, 160 IsLdfValid
IsClosed Global Functions, 28
ElmCoup, 198 IsNAN
ElmGndswt, 212 Global Functions, 28
StaCubic, 317 IsNetCoupling
StaSwitch, 383 ElmLne, 220
IsColumnScrollable IsNetworkDataFolder
ComTablereport, 525 General Object Methods, 163
IsColumnSortable IsNode
ComTablereport, 525 General Object Methods, 164
IsCommandIgnored IsObjectActive
ComTasks, 545 General Object Methods, 164
IsConnected IsObjectModifiedByVariation
ElmGenstat, 210 General Object Methods, 164
ElmPvsys, 230 Isolate
ElmSym, 272 General Object Methods, 165
StaCubic, 317 IsOpen
IsDC ElmCoup, 199
ComLdf, 453 ElmGndswt, 212
IsDeleted StaSwitch, 384
General Object Methods, 161 IsOpened
IsDguv SetDesktop, 581
ComArcreport, 399 IsOutOfService
IsEarthed General Object Methods, 165

887
INDEX INDEX

IsPQ IsStudyCaseIgnored
ElmAsm, 184 ComTasks, 545
IsProjectFolderType IsValid
IntPrjfolder, 724 IntRas, 726
IsQuadBooster
ElmTr2, 286 JumpTo
ElmTr3, 291 IntViewbookmark, 764
ElmTr4, 295 JumpToLastStep
IsReducible ComContingency, 418
General Object Methods, 166
LdfEquivalentVerification
IsRelevant
ComRed, 476
General Object Methods, 159
LicenceHasModule
IsRmsValid
Global Functions, 31
Global Functions, 29
ln
IsRowVisible
Mathematical Functions, 80
ComTablereport, 526
lnm
IsScenarioAttribute
General Object Methods, 167
Global Functions, 29
Load
IsShcValid
ElmRes, 255
Global Functions, 30
IntComtrade, 655
IsShortCircuited
IntComtradeset, 665
General Object Methods, 166
LoadData
IsSimValid
IntPrj, 717
Global Functions, 30
LoadFile
IsSplitting
ElmFile, 205
ElmBoundary, 193
LoadMicroSCADAFile
IsStarted
ComLink, 454
ElmRelay, 233
LoadProfile
IsStatusBitSet
Global Functions, 32
StaExtbrkmea, 319
LoadResData
StaExtcmdmea, 324
Global Functions, 33
StaExtdatmea, 330
LoadSimulationState
StaExtfmea, 334
ComSim, 491
StaExtfuelmea, 339
LoadSnapshot
StaExtimea, 344
ComSim, 491
StaExtpfmea, 349
log
StaExtpmea, 354
Mathematical Functions, 80
StaExtqmea, 359
LossCostAtBusTech
StaExtsmea, 364
ComCapo, 401
StaExttapmea, 369
StaExtv3mea, 374 Mark
StaExtvmea, 379 IntGrflayer, 688
IsStatusBitSetTmp SetLevelvis, 589
StaExtbrkmea, 319 MarkInGraphics
StaExtcmdmea, 325 General Object Methods, 167
StaExtdatmea, 330 Global Functions, 33
StaExtfmea, 335 Set Routines, 853
StaExtfuelmea, 340 MarkRegions
StaExtimea, 345 ComSimoutage, 496
StaExtpfmea, 350 Mathematical Functions, 70
StaExtpmea, 355 abs, 71
StaExtqmea, 360 acos, 71
StaExtsmea, 364 asin, 71
StaExttapmea, 369 atan, 72
StaExtv3mea, 374 atan2, 72
StaExtvmea, 379 BinaryAnd, 72

888
INDEX INDEX

BinaryOr, 73 Multibyte Encoded String Functions, 121


CalcWeibullPar, 73 mbslen
ceil, 74 Multibyte Encoded String Functions, 122
cos, 74 mbsprintf
cosh, 75 Multibyte Encoded String Functions, 122
exp, 75 mbsscanf
floor, 75 Multibyte Encoded String Functions, 122
frac, 75 mbsstr
fRand, 76 Multibyte Encoded String Functions, 122
GetRandomNumber, 76 mbstok
GetRandomNumberEx, 76 Multibyte Encoded String Functions, 123
InvertMatrix, 77 mdbClose
ln, 80 MS Access Functions, 89
log, 80 mdbExecuteSqlQuery
MatrixInvert, 77 MS Access Functions, 89
max, 80 mdbExecuteSqlStatement
min, 80 MS Access Functions, 90
modulo, 81 mdbFetchResult
pi, 81 MS Access Functions, 90
pow, 81 mdbGetResultColumnCount
Random, 76 MS Access Functions, 91
RndExp, 81 mdbGetResultColumnName
RndGetMethod, 82 MS Access Functions, 91
RndGetSeed, 82 mdbGetResultColumnType
RndNormal, 82 MS Access Functions, 92
RndSetup, 83 mdbGetResultColumnValue
RndUnifInt, 85 MS Access Functions, 92
RndUnifReal, 85 mdbOpen
RndWeibull, 86 MS Access Functions, 93
round, 86 mdbSetDebug
SetRandomSeed, 86 MS Access Functions, 97
SetRandSeed, 86 Mean
sin, 87 IntVec, 757
sinh, 87 MeasureLength
sqr, 87 ElmLne, 221
sqrt, 87 Merge
tan, 88 ComMerge, 460
tanh, 88 MergeToBaseProject
time, 88 IntPrj, 717
trunc, 88 MessageBox
twopi, 89 Dialogue Boxes Functions, 57
MatrixInvert Migrate
Mathematical Functions, 77 IntPrj, 717
Max MigratePage
IntVec, 757 SetVipage, 609
max Min
Mathematical Functions, 80 IntVec, 757
MaxZoneNumberFor min
ComCoordreport, 423 Mathematical Functions, 80
mbprintf ModuleExists
Output Window Functions, 126 ComAddon, 397
mbschg modulo
Multibyte Encoded String Functions, 121 Mathematical Functions, 81
mbscmp Move
Multibyte Encoded String Functions, 121 General Object Methods, 168
mbscpy MoveToLayer

889
INDEX INDEX

IntGrf, 681 mbsprintf, 122


MS Access Functions, 89 mbsscanf, 122
mdbClose, 89 mbsstr, 122
mdbExecuteSqlQuery, 89 mbstok, 123
mdbExecuteSqlStatement, 90 tombchar, 123
mdbFetchResult, 90 tombcharcodepoint, 123
mdbGetResultColumnCount, 91 tombslower, 123
mdbGetResultColumnName, 91 tombsupper, 124
mdbGetResultColumnType, 92 Multiply
mdbGetResultColumnValue, 92 IntMat, 698
mdbOpen, 93
mdbSetDebug, 97 NCol
MS Excel Functions, 98 ComTablereport, 521
xlActivateWorksheet, 98 ElmRes, 249
xlAddWorksheet, 99 IntComtrade, 652
xlCloseWorkbook, 99 IntComtradeset, 662
xlDeleteWorksheet, 99 IntMat, 695
xlGetActiveWorksheetIndex, 100 Network Elements Methods, 176
xlGetDateSeparator, 100 NewStage
xlGetDecimalSeparator, 101 IntScheme, 746
xlGetThousandsSeparator, 101 Next
xlGetValue, 101 IntDplmap, 674
xlGetWorksheetCount, 102 Set Routines, 853
xlGetWorksheetName, 102 NextFilt
xlNewWorkbook, 102 Set Routines, 854
xlOpenWorkbook, 103 NextStepAvailable
xlResetTextStyle, 103 ComShctrace, 490
xlRunMacro, 104 NoFinalUpdate
xlSaveWorkbook, 105 Environment Functions, 65
xlSaveWorkbookAs, 105 NormaliseCombined
xlSetBorder, 105 IntPrj, 718
xlSetColumnWidth, 107 NRow
xlSetDebug, 107 ComTablereport, 521
xlSetFillColor, 108 ElmRes, 249
xlSetFontName, 108 IntComtrade, 653
xlSetFontSize, 109 IntComtradeset, 662
xlSetHorizontalAlignment, 110 IntMat, 696
xlSetNumberFormat, 111 NTap
xlSetPrintTitleRows, 111 ElmTr2, 287
xlSetRowHeight, 112 ElmTr3, 291
xlSetTextColor, 112 ElmTr4, 295
xlSetTextStyle, 113 ElmVoltreg, 303
xlSetValue, 114 NVars
xlSetValues, 114 IntMon, 703
xlSetVerticalAlignment, 115
xlSetVisible, 116 Obj
xlSetWorksheetName, 116 Set Routines, 854
xlSetWrapText, 117 Object Methods, 140
xlStart, 117 Open
xlTerminate, 120 ElmCoup, 199
MS Office Functions, 89 ElmGndswt, 212
Multibyte Encoded String Functions, 121 StaSwitch, 384
mbschg, 121 Other Objects Methods, 614
mbscmp, 121 Output Window Functions, 124
mbscpy, 121 ClearOutput, 124
mbslen, 122 ClearOutputWindow, 124

890
INDEX INDEX

Error, 124 GetDataSeries, 770


FlushOutputWindow, 125 GetLegend, 771
fWrite, 126 GetTitleObject, 771
Info, 125 SetAutoScaleModeX, 771
mbprintf, 126 SetAutoScaleModeY, 772
printf, 126 SetAxisSharingLevelX, 772
SetLineFeed, 127 SetAxisSharingLevelY, 772
SetOutputWindowState, 127 SetScaleTypeX, 772
Warn, 128 SetScaleTypeY, 773
Write, 129 SetScaleX, 773
OutputFlexibleData SetScaleY, 773
Global Functions, 33 PltTitle, 774
Set Routines, 854 SetFont, 774
OverwriteRA PltVectorplot, 774
ElmSubstat, 267 ChangeStyle, 775
OvlAlleviate DoAutoScale, 775
ComRel3, 478 GetAxisX, 775
GetAxisY, 775
Pack GetComplexData, 775
BlkDef, 615 GetLegend, 775
TypMdl, 794 GetTitleObject, 776
PackAsMacro SetAutoScaleModeX, 776
BlkDef, 616 SetAutoScaleModeY, 776
PackExternalReferences SetScaleX, 776
IntPrj, 718 SetScaleY, 777
ParseDateLT PostCommand
Date/Time Functions, 53 Global Functions, 34
ParseDateUTC pow
Date/Time Functions, 54 Mathematical Functions, 81
PasteCopy PrepForUntouchedDelete
General Object Methods, 169 Global Functions, 34
pi Print
Mathematical Functions, 81 SetScenario, 596
PltAxis, 764 PrintAllVal
DoAutoScale, 764 IntMon, 703
SetFont, 765 PrintCheckResults
PltComplexdata, 765 ComLdf, 453
AddVector, 765 PrintComparisonReport
ChangeColourPalette, 765 ComMerge, 460
ClearVectors, 766 printf
PltDataseries, 766 Output Window Functions, 126
AddCurve, 766 PrintModifications
AddXYCurve, 767 ComMerge, 460
ChangeColourPalette, 767 IntSstage, 749
ClearCurves, 767 PrintVal
GetDataSource, 768 IntMon, 704
GetIntCalcres, 768 Purge
PltLegend, 768 IntPrj, 718
SetFont, 768 IntUser, 754
PltLinebarplot, 769 SetTboxconfig, 603
ChangeStyle, 769 PurgeObjectKeys
DoAutoScale, 769 IntPrj, 718
DoAutoScaleX, 770 PurgeUnusedObjects
DoAutoScaleY, 770 General Object Methods, 169
GetAxisX, 770
GetAxisY, 770 QuickAccessAvailable

891
INDEX INDEX

ComUcteexp, 563 ComSimoutage, 496


RemoveEvents
Random ComContingency, 418
Mathematical Functions, 76 ComOutage, 469
ReadValue ComRel3, 479
IntSstage, 750 RemoveOutages
Rebuild ComRel3, 479
Global Functions, 34 RemovePage
ReceiveData GrpPage, 638
ComLink, 455 SetDesktop, 581
ComOpc, 467 RemoveParameter
Reconnect CimModel, 621
ElmGenstat, 210 CimObject, 629
ElmPvsys, 230 IntAddonvars, 645
ElmSym, 273 RemoveProjectFromCombined
ElmXnet, 305 IntPrj, 719
ReductionInMemory RemoveRas
ComRed, 476 ComSimoutage, 497
Refresh RemoveRatio
VisMagndiffplt, 810 TypCtcore, 792
VisOcplot, 812 RemoveRatioByIndex
RelChar, 777 TypCtcore, 793
SetCurve, 777 RemoveRow
Release ComTablereport, 526
ElmRes, 256 RemoveStudyCase
IntComtrade, 656 ComTasks, 547
IntComtradeset, 665 RemoveStudyCases
ReleaseMemory ComTasks, 547
IntScenario, 742 ComTececocmp, 555
ReleaseResData RemoveSwitchEvents
Global Functions, 35 IntEvt, 680
ReloadProfile RemoveVar
Global Functions, 35 IntMon, 704
RelToc, 777 Report
SetCurve, 777 ComDllmanager, 436
RelZpol, 778 ReportUnusedObjects
AssumeCompensationFactor, 778 General Object Methods, 170
AssumeReRl, 778 Reset
AssumeXeXl, 778 ComMerge, 460
Remove ComSimoutage, 497
IntDplmap, 675 IntDocument, 669
IntDplvec, 678 IntGrflayer, 689
Set Routines, 854 IntReport, 736
RemoveAllConfigurations SetLevelvis, 589
SetDataext, 576 ResetAll
RemoveAllRas IntOutage, 707
ComSimoutage, 496 ResetCalculation
RemoveBreaker Global Functions, 35
StaCubic, 317 ResetDerating
RemoveCmdsForStudyCaseRow ElmGenstat, 211
ComTasks, 546 ElmPvsys, 231
RemoveCommand ElmSym, 273
ComTasks, 547 ResetQuickAccess
RemoveConfiguration ComUcteexp, 563
SetDataext, 576 ResetRA
RemoveContingencies ElmSubstat, 267

892
INDEX INDEX

ResetReductionInMemory ResNextValidVar
ComRed, 477 Global Functions, 37
ResetStatusBit ResNval
StaExtbrkmea, 320 Global Functions, 37
StaExtcmdmea, 325 ResNvars
StaExtdatmea, 330 Global Functions, 37
StaExtfmea, 335 ResSortToVar
StaExtfuelmea, 340 Global Functions, 37
StaExtimea, 345 Restore
StaExtpfmea, 350 IntPrj, 719
StaExtpmea, 355 ResultForDirectionalBackupVariable
StaExtqmea, 360 ComCoordreport, 423
StaExtsmea, 364 ResultForFuseVariable
StaExttapmea, 370 ComCoordreport, 424
StaExtv3mea, 375 ResultForInstantaneousVariable
StaExtvmea, 380 ComCoordreport, 424
ResetStatusBitTmp ResultForMaxCurrent
StaExtbrkmea, 320 ComCoordreport, 425
StaExtcmdmea, 325 ResultForNonDirectionalBackupVariable
StaExtdatmea, 330 ComCoordreport, 425
StaExtfmea, 335 ResultForOverloadVariable
StaExtfuelmea, 340 ComCoordreport, 426
StaExtimea, 345 ResultForOverreachVariable
StaExtpfmea, 350 ComCoordreport, 427
StaExtpmea, 355 ResultForShortCircuitVariable
StaExtqmea, 360 ComCoordreport, 427
StaExtsmea, 365 ResultForZoneVariable
StaExttapmea, 370 ComCoordreport, 428
StaExtv3mea, 375 RndExp
StaExtvmea, 380 Mathematical Functions, 81
ResetThirdPartyModule RndGetMethod
BlkDef, 616 Mathematical Functions, 82
ComDpl, 441 RndGetSeed
TypQdsl, 796 Mathematical Functions, 82
ResFirstValidObject RndNormal
Global Functions, 35 Mathematical Functions, 82
ResFirstValidObjectVar RndSetup
Global Functions, 36 Mathematical Functions, 83
ResFirstValidVar RndUnifInt
Global Functions, 36 Mathematical Functions, 85
ResGetMax RndUnifReal
Global Functions, 36 Mathematical Functions, 85
ResGetMin RndWeibull
Global Functions, 36 Mathematical Functions, 86
ResIndex Rollback
Global Functions, 36 IntVersion, 763
Resize round
ElmBoundary, 194 Mathematical Functions, 86
IntMat, 698 RowLbl
IntThrating, 753 IntMat, 696, 699
IntVec, 758
IntVecobj, 761 Save
ResNextValidObject IntMat, 699
Global Functions, 37 IntScenario, 742
ResNextValidObjectVar IntVec, 758
Global Functions, 37 IntVecobj, 761

893
INDEX INDEX

SaveAsRA SearchObject
ElmSubstat, 267 General Object Methods, 170
SaveAsScenario SearchObjectByForeignKey
Global Functions, 38 Global Functions, 38
SaveFile SearchScenario
ElmFile, 205 IntScensched, 744
SaveScenarioAs SelectToolbox
Global Functions, 38 Global Functions, 39
SaveSimulationState SendData
ComSim, 492 ComLink, 455
SaveSnapshot ComOpc, 467
ComSim, 492 SentDataStatus
ScnFreq, 778 ComLink, 455
GetLimit, 779 Set Routines, 850
GetNumberOfViolations, 779 Add, 850
GetValue, 779 Clear, 851
GetVariable, 779 Count, 851
GetViolatedElement, 780 First, 851
GetViolationTime, 780 FirstFilt, 852
ScnFrt, 781 IsIn, 853
GetLimit, 781 MarkInGraphics, 853
GetNumberOfViolations, 781 Next, 853
GetValue, 781 NextFilt, 854
GetVariable, 782 Obj, 854
GetViolatedElement, 782 OutputFlexibleData, 854
GetViolationTime, 782 Remove, 854
ScnSpeed, 783 ShowModalBrowser, 855
GetLimit, 783 ShowModalSelectBrowser, 855
GetNumberOfViolations, 783 ShowModelessBrowser, 855
GetValue, 783 SortToClass, 855
GetVariable, 784 SortToName, 856
GetViolatedElement, 784 SortToVar, 856
GetViolationTime, 784 Set
ScnSync, 785 IntMat, 699
GetLimit, 785 IntVec, 759
GetNumberOfViolations, 785 IntVecobj, 761
GetValue, 785 SetActiveModule
GetVariable, 786 ComAddon, 397
GetViolatedElement, 786 SetAdaptX
GetViolationTime, 786 SetDesktop, 581
ScnVar, 787 SetVipage, 609
GetLimit, 787 VisPath, 813
GetNumberOfViolations, 787 VisPlot, 822
GetValue, 787 VisPlot2, 836
GetVariable, 788 SetAdaptY
GetViolatedElement, 788 IntPlot, 708
GetViolationTime, 788 VisPath, 814
ScnVolt, 789 VisPlot, 823
GetLimit, 789 VisPlot2, 836
GetNumberOfViolations, 789 SetAdditionalResultsFlagForCommand
GetValue, 789 ComTasks, 548
GetVariable, 790 SetAsDefault
GetViolatedElement, 790 ElmRes, 256
GetViolationTime, 790 SetAssociationValue
Search CimModel, 622
IntVecobj, 761 CimObject, 630

894
INDEX INDEX

SetAttributeEnumeration ComTablereport, 533


CimModel, 623 SetCellValueToString
CimObject, 631, 632 ComTablereport, 534
SetAttributeValue SetCluster, 565
CimModel, 623, 624 CalcCluster, 565
CimObject, 632, 633 GetNumberOfClusters, 566
SetAuthorityUri SetColouring
ComGridtocim, 447 SetColscheme, 569
SetAutoAssignmentForAll SetColscheme, 567
ComMerge, 460 CreateFilter, 567
SetAutomaticCalculationResetEnabled GetAlarmColouringMode, 568
Environment Functions, 65 GetColouringMode, 569
SetAutoScaleModeX GetEnergisingColouringMode, 569
GrpPage, 638 SetColouring, 569
PltLinebarplot, 771 SetFilter, 574
PltVectorplot, 776 SetColumnHeader
SetAutoScaleModeY ComTablereport, 535
GrpPage, 638 SetColumnLabel
PltLinebarplot, 772 IntMat, 700
PltVectorplot, 776 SetConsistencyCheck
SetAutoScaleX Environment Functions, 66
SetDesktop, 582 SetConstraint
SetVipage, 610 IntAddonvars, 645
VisHrm, 806 SetCrvDesc
VisPlot, 823 VisHrm, 807
VisPlot2, 837 VisPlot, 825
SetAutoScaleY VisPlot2, 838
IntPlot, 708 SetCrvDescX
VisHrm, 807 VisXyplot, 848
VisPlot, 824 SetCrvDescY
VisPlot2, 838 VisXyplot, 848
SetAxisSharingLevelX SetCurve
PltLinebarplot, 772 RelChar, 777
SetAxisSharingLevelY RelToc, 777
PltLinebarplot, 772 SetCurveValue
SetBarLimits ComTablereport, 536
ComTablereport, 527 SetDatabase, 574
SetBatchMode EmptyCache, 574
ComUcte, 556 SetDataext, 575
SetBoundaries AddConfiguration, 575
ComGridtocim, 447 GetConfiguration, 575
SetCellAccess GetConfigurations, 576
ComTablereport, 527 RemoveAllConfigurations, 576
SetCellEdit RemoveConfiguration, 576
ComTablereport, 528 SetDefaultValue
SetCellValueToBar IntReport, 737
ComTablereport, 528 SetDefScaleX
SetCellValueToCheckbox VisHrm, 808
ComTablereport, 529 VisPlot, 825
SetCellValueToDate VisPlot2, 839
ComTablereport, 530 SetDefScaleY
SetCellValueToDouble VisHrm, 808
ComTablereport, 531 VisPlot, 826
SetCellValueToInt VisPlot2, 839
ComTablereport, 532 SetDeskpage, 577
SetCellValueToObject Close, 577

895
INDEX INDEX

Show, 577 SetFontFor


SetDesktop, 577 IntGrfnet, 690
AddPage, 578 SetPrj, 595
Close, 578 SetGeoCoordinateSystem
DoAutoScaleX, 578 IntPrj, 719
Freeze, 579 SetGraphicUpdate
GetActivePage, 579 Environment Functions, 67
GetCanvasSize, 579 SetGridSelection
GetPage, 580 ComUcteexp, 564
IsFrozen, 580 SetGridsToExport
IsOpened, 581 ComGridtocim, 448
RemovePage, 581 SetGuiUpdateEnabled
SetAdaptX, 581 Environment Functions, 68
SetAutoScaleX, 582 SetIgnoreFlagForCommand
SetResults, 582 ComTasks, 549
SetScaleX, 583 SetIgnoreFlagForStudyCase
SetViewArea, 584 ComTasks, 551
SetXVar, 584 SetImpedance
Show, 584 ElmRelay, 234
Unfreeze, 585 SetInputParameterDouble
WriteWMF, 585 ComDpl, 441
ZoomAll, 586 ComPython, 475
SetDetailed SetInputParameterInt
ElmLne, 221 ComDpl, 442
SetDialogSize ComPython, 475
ComTablereport, 536 SetInputParameterString
SetDiffMode ComDpl, 442
Environment Functions, 66 ComPython, 475
SetDisplayedButtons SetLayerVisibility
SetTboxconfig, 603 IntGrfnet, 690
SetDistrstate, 586 SetLayoutMode
CalcCluster, 586 GrpPage, 639
SetElms SetLevelvis, 587
StoMaint, 791 AdaptWidth, 587
SetEnableUserBreak Align, 587
Environment Functions, 70 ChangeFont, 588
SetExportHtml ChangeFrameAndWidth, 588
ComTablereport, 537 ChangeLayer, 588
SetExportXls ChangeRefPoints, 588
ComTablereport, 537 ChangeWidthVisibilityAndColour, 589
SetExternalObject Mark, 589
ComDpl, 441 Reset, 589
ComPython, 474 SetLimits
SetFileName ComSimoutage, 497
ComSvgexport, 498 SetLineFeed
ComSvgimport, 499 Output Window Functions, 127
SetFilt, 587 SetListFilterSelection
Get, 587 ComTablereport, 537
SetFilter SetLoadScaleAbsolute
SetColscheme, 574 ElmZone, 310
SetFinalEchoOnEnabled SetLvscale, 589
Environment Functions, 67 AddCalcRelevantCoincidenceDefinitions, 590
SetFont SetMaxI
PltAxis, 765 ElmRelay, 235
PltLegend, 768 SetMaxIearth
PltTitle, 774 ElmRelay, 235

896
INDEX INDEX

SetMeaValue AllOpenBreakers, 591


StaExtbrkmea, 320 AllProtectionDevices, 591
StaExtcmdmea, 325 Create, 592
StaExtdatmea, 330 GetAll, 592
StaExtfmea, 335 GetBranches, 593
StaExtfuelmea, 340 GetBuses, 593
StaExtimea, 345 GetPathFolder, 593
StaExtpfmea, 350 SetPosition
StaExtpmea, 355 ElmTrain, 296
StaExtqmea, 360 SetPrimaryTap
StaExtsmea, 365 StaCt, 310
StaExttapmea, 370 SetPrj, 594
StaExtv3mea, 375 GetFontID, 594
StaExtvmea, 380 SetFontFor, 595
SetMicroSCADAStatus SetProgressBarUpdatesEnabled
ComLink, 456 Environment Functions, 69
SetMinI SetRA
ElmRelay, 235 ElmSubstat, 268
SetMinIearth SetRandomSeed
ElmRelay, 235 Mathematical Functions, 86
SetNumberFormatForPlot SetRandSeed
ComTablereport, 538 Mathematical Functions, 86
SetNumSlave SetRecurrence
SetParalman, 590 IntPlannedout, 707
SetObj SetRefresh
ElmRes, 256 ComTablereport, 538
SetObject SetRescheduleFlag
ComSvgexport, 498 Environment Functions, 68
ComSvgimport, 499 SetResults
SetObjects GrpPage, 639
ComSvgexport, 498 SetDesktop, 582
SetObjectsToCompare SetVipage, 611
ComMerge, 461 SetResultsFolder
SetObjs ComTasks, 552
ComOutage, 470 SetResultString
SetOldDistributeLoadMode ComDpl, 443
ComLdf, 453 SetRowLabel
SetOPCReceiveQuality IntMat, 700
ComLink, 456 SetScaleTypeX
SetOperationValue GrpPage, 639
IntScenario, 742 PltLinebarplot, 772
SetOutOfService SetScaleTypeY
ElmRelay, 235 GrpPage, 639
SetOutputWindowState PltLinebarplot, 773
Output Window Functions, 127 SetScaleX
SetParalman, 590 GrpPage, 640
GetNumSlave, 590 PltLinebarplot, 773
SetNumSlave, 590 PltVectorplot, 776
SetTransfType, 590 SetDesktop, 583
SetParameter SetVipage, 611
ComReport, 483 VisPath, 814
SetPassword VisPlot, 826
IntUser, 754 VisPlot2, 840
SetPath, 591 SetScaleY
AllBreakers, 591 GrpPage, 640
AllClosedBreakers, 591 IntPlot, 709

897
INDEX INDEX

PltLinebarplot, 773 StaExttapmea, 371


PltVectorplot, 777 StaExtv3mea, 376
VisBdia, 799 StaExtvmea, 381
VisPath, 815 SetStatusBitTmp
VisPlot, 827 StaExtbrkmea, 322
VisPlot2, 841 StaExtcmdmea, 327
SetScenario, 595 StaExtdatmea, 332
Check, 596 StaExtfmea, 337
Default, 596 StaExtfuelmea, 342
Print, 596 StaExtimea, 347
SetSelect, 596 StaExtpfmea, 352
AddRef, 597 StaExtpmea, 357
All, 597 StaExtqmea, 362
AllAsm, 597 StaExtsmea, 366
AllBars, 598 StaExttapmea, 371
AllBreakers, 598 StaExtv3mea, 376
AllClosedBreakers, 599 StaExtvmea, 381
AllElm, 599 SetStatusText
AllLines, 599 ComTablereport, 539
AllLoads, 600 SetStatusTmp
AllOpenBreakers, 600 StaExtbrkmea, 322
AllSym, 601 StaExtcmdmea, 327
AllTypLne, 601 StaExtdatmea, 332
Clear, 601 StaExtfmea, 337
GetAll, 602 StaExtfuelmea, 342
SetShowAllUsers StaExtimea, 347
Global Functions, 39 StaExtpfmea, 352
SetSize StaExtpmea, 357
General Object Methods, 170 StaExtqmea, 362
SetSorting StaExtsmea, 366
ComTablereport, 538 StaExttapmea, 372
SetStatus StaExtv3mea, 377
StaExtbrkmea, 321 StaExtvmea, 382
StaExtcmdmea, 326 SetStudyTime
StaExtdatmea, 331 IntCase, 647
StaExtfmea, 336 SetStyle
StaExtfuelmea, 341 SetVipage, 612
StaExtimea, 346 SetSubElmResKey
StaExtpfmea, 351 ElmRes, 257
StaExtpmea, 356 SetSwitchShcEventMode
StaExtqmea, 361 ComLink, 456
StaExtsmea, 365 SetSymbolComponentVisibility
StaExttapmea, 370 IntGrfnet, 691
StaExtv3mea, 375 SetTboxconfig, 602
StaExtvmea, 380 Check, 603
SetStatusBit GetAvailableButtons, 603
StaExtbrkmea, 321 GetDisplayedButtons, 603
StaExtcmdmea, 326 Purge, 603
StaExtdatmea, 331 SetDisplayedButtons, 603
StaExtfmea, 336 SetTextAxisDistForPlot
StaExtfuelmea, 341 ComTablereport, 539
StaExtimea, 346 SetThirdPartyModule
StaExtpfmea, 351 BlkDef, 616
StaExtpmea, 356 ComDpl, 443
StaExtqmea, 361 TypQdsl, 796
StaExtsmea, 366 SetTicksForPlot

898
INDEX INDEX

ComTablereport, 539 SetDesktop, 584


SetTile SetVipage, 614
SetVipage, 613 ShowBrowser
SetTime, 604 ComMerge, 461
Date, 604 ShowEditDialog
ElmRelay, 236 General Object Methods, 172
SetTime, 604 ShowFullName
SetTimeUTC, 605 General Object Methods, 173
Time, 605 ShowModalBrowser
SetTimeUTC Dialogue Boxes Functions, 59
SetTime, 605 Set Routines, 855
Settings Methods, 565 ShowModalOpenFileDialog
SetTitle Dialogue Boxes Functions, 59
ComTablereport, 540 ShowModalSaveFileDialog
SetTransfType Dialogue Boxes Functions, 60
SetParalman, 590 ShowModalSelectBrowser
SetUser, 606 Dialogue Boxes Functions, 61
GetNumProcesses, 606 Set Routines, 855
SetUserBreakEnabled ShowModalSelectFolderDialog
Environment Functions, 70 Dialogue Boxes Functions, 62
SetVal ShowModalSelectTree
General Object Methods, 171 General Object Methods, 173
SetValue ShowModelessBrowser
IntReport, 737 Dialogue Boxes Functions, 63
SetViewArea Set Routines, 855
SetDesktop, 584 ShowY2
SetVipage, 606 VisPlot2, 843
Close, 607 SimEquivalentVerification
CreateVI, 608 ComRed, 477
DoAutoScaleX, 607 sin
DoAutoScaleY, 607 Mathematical Functions, 87
GetOrInsertPlot, 608 sinh
GetVI, 608 Mathematical Functions, 87
InsertPlot, 608 Size
MigratePage, 609 IntDplmap, 675
SetAdaptX, 609 IntDplvec, 679
SetAutoScaleX, 610 IntVec, 759
SetResults, 611 IntVecobj, 762
SetScaleX, 611 SizeX
SetStyle, 612 ComTablereport, 521
SetTile, 613 ElmRes, 249
SetXVar, 613 IntComtrade, 653
Show, 614 IntComtradeset, 662
SetXVar IntMat, 696
SetDesktop, 584 SizeY
SetVipage, 613 ComTablereport, 521
VisPlot, 829 ElmRes, 249
VisPlot2, 842 IntComtrade, 652
SetXVariable IntComtradeset, 662
VisBdia, 800 IntMat, 695
SetYVariable Sleep
VisBdia, 800 Global Functions, 39
Show slotupd
GrpPage, 640 ElmComp, 197
IntGrfnet, 691 ElmRelay, 236
SetDeskpage, 577 SlotUpdate

899
INDEX INDEX

ElmComp, 197 ResetStatusBit, 320


ElmRelay, 236 ResetStatusBitTmp, 320
snm SetMeaValue, 320
General Object Methods, 173 SetStatus, 321
Sort SetStatusBit, 321
IntDplvec, 679 SetStatusBitTmp, 322
IntVec, 759 SetStatusTmp, 322
SortAccordingToColumn UpdateControl, 322
ElmRes, 257 UpdateCtrl, 323
IntComtrade, 656 StaExtcmdmea, 323
IntComtradeset, 666 CopyExtMeaStatusToStatusTmp, 323
SortToClass GetMeaValue, 324
Set Routines, 855 GetStatus, 324
SortToColum GetStatusTmp, 324
IntMat, 701 InitTmp, 324
SortToColumn IsStatusBitSet, 324
IntMat, 701 IsStatusBitSetTmp, 325
SortToName ResetStatusBit, 325
Set Routines, 856 ResetStatusBitTmp, 325
SortToVar SetMeaValue, 325
Set Routines, 856 SetStatus, 326
SplitLine SetStatusBit, 326
Global Functions, 40 SetStatusBitTmp, 327
sprintf SetStatusTmp, 327
String Functions, 132 UpdateControl, 327
sqr UpdateCtrl, 328
Mathematical Functions, 87 StaExtdatmea, 328
sqrt CopyExtMeaStatusToStatusTmp, 328
Mathematical Functions, 87 CreateEvent, 328
sscanf GetMeaValue, 329
String Functions, 132 GetStatus, 329
sscanfsep GetStatusTmp, 329
String Functions, 133 InitTmp, 329
StaCt, 310 IsStatusBitSet, 330
SetPrimaryTap, 310 IsStatusBitSetTmp, 330
StaCubic, 311 ResetStatusBit, 330
AddBreaker, 311 ResetStatusBitTmp, 330
GetAll, 311 SetMeaValue, 330
GetBranch, 312 SetStatus, 331
GetConnectedMajorNodes, 312 SetStatusBit, 331
GetConnections, 313 SetStatusBitTmp, 332
GetNearestBusbars, 314 SetStatusTmp, 332
GetPathToNearestBusbar, 315 UpdateControl, 332
GetRemoteBorderCubicles, 316 UpdateCtrl, 333
GetSwitch, 317 StaExtfmea, 333
IsClosed, 317 CopyExtMeaStatusToStatusTmp, 333
IsConnected, 317 GetMeaValue, 334
RemoveBreaker, 317 GetStatus, 334
StaExtbrkmea, 318 GetStatusTmp, 334
CopyExtMeaStatusToStatusTmp, 318 InitTmp, 334
GetMeaValue, 318 IsStatusBitSet, 334
GetStatus, 319 IsStatusBitSetTmp, 335
GetStatusTmp, 319 ResetStatusBit, 335
InitTmp, 319 ResetStatusBitTmp, 335
IsStatusBitSet, 319 SetMeaValue, 335
IsStatusBitSetTmp, 319 SetStatus, 336

900
INDEX INDEX

SetStatusBit, 336 StaExtpmea, 353


SetStatusBitTmp, 337 CopyExtMeaStatusToStatusTmp, 353
SetStatusTmp, 337 GetMeaValue, 353
UpdateControl, 337 GetStatus, 354
UpdateCtrl, 338 GetStatusTmp, 354
StaExtfuelmea, 338 InitTmp, 354
CopyExtMeaStatusToStatusTmp, 338 IsStatusBitSet, 354
GetMeaValue, 338 IsStatusBitSetTmp, 355
GetStatus, 339 ResetStatusBit, 355
GetStatusTmp, 339 ResetStatusBitTmp, 355
InitTmp, 339 SetMeaValue, 355
IsStatusBitSet, 339 SetStatus, 356
IsStatusBitSetTmp, 340 SetStatusBit, 356
ResetStatusBit, 340 SetStatusBitTmp, 357
ResetStatusBitTmp, 340 SetStatusTmp, 357
SetMeaValue, 340 UpdateControl, 357
SetStatus, 341 UpdateCtrl, 358
SetStatusBit, 341 StaExtqmea, 358
SetStatusBitTmp, 342 CopyExtMeaStatusToStatusTmp, 358
SetStatusTmp, 342 GetMeaValue, 358
UpdateControl, 342 GetStatus, 359
UpdateCtrl, 343 GetStatusTmp, 359
StaExtimea, 343 InitTmp, 359
CopyExtMeaStatusToStatusTmp, 343 IsStatusBitSet, 359
GetMeaValue, 343 IsStatusBitSetTmp, 360
GetStatus, 344 ResetStatusBit, 360
GetStatusTmp, 344 ResetStatusBitTmp, 360
InitTmp, 344 SetMeaValue, 360
IsStatusBitSet, 344 SetStatus, 361
IsStatusBitSetTmp, 345 SetStatusBit, 361
ResetStatusBit, 345 SetStatusBitTmp, 362
ResetStatusBitTmp, 345 SetStatusTmp, 362
SetMeaValue, 345 UpdateControl, 362
SetStatus, 346 UpdateCtrl, 363
SetStatusBit, 346 StaExtsmea, 363
SetStatusBitTmp, 347 CopyExtMeaStatusToStatusTmp, 363
SetStatusTmp, 347 GetStatus, 363
UpdateControl, 347 GetStatusTmp, 364
UpdateCtrl, 348 InitTmp, 364
StaExtpfmea, 348 IsStatusBitSet, 364
CopyExtMeaStatusToStatusTmp, 348 IsStatusBitSetTmp, 364
GetMeaValue, 348 ResetStatusBit, 364
GetStatus, 349 ResetStatusBitTmp, 365
GetStatusTmp, 349 SetMeaValue, 365
InitTmp, 349 SetStatus, 365
IsStatusBitSet, 349 SetStatusBit, 366
IsStatusBitSetTmp, 350 SetStatusBitTmp, 366
ResetStatusBit, 350 SetStatusTmp, 366
ResetStatusBitTmp, 350 UpdateControl, 367
SetMeaValue, 350 UpdateCtrl, 367
SetStatus, 351 StaExttapmea, 368
SetStatusBit, 351 CopyExtMeaStatusToStatusTmp, 368
SetStatusBitTmp, 352 GetMeaValue, 368
SetStatusTmp, 352 GetStatus, 369
UpdateControl, 352 GetStatusTmp, 369
UpdateCtrl, 353 InitTmp, 369

901
INDEX INDEX

IsStatusBitSet, 369 Open, 384


IsStatusBitSetTmp, 369 StatFileGetXrange
ResetStatusBit, 370 Global Functions, 40
ResetStatusBitTmp, 370 StatFileResetXrange
SetMeaValue, 370 Global Functions, 40
SetStatus, 370 StatFileSetXrange
SetStatusBit, 371 Global Functions, 41
SetStatusBitTmp, 371 Station Elements Methods, 310
SetStatusTmp, 372 StoMaint, 791
UpdateControl, 372 SetElms, 791
UpdateCtrl, 372 Stop
StaExtv3mea, 373 ComDiff, 436
CopyExtMeaStatusToStatusTmp, 373 StopTrace
GetMeaValue, 373 ComContingency, 419
GetStatus, 374 ComOutage, 470
GetStatusTmp, 374 strchg
InitTmp, 374 String Functions, 134
IsStatusBitSet, 374 strcmp
IsStatusBitSetTmp, 374 String Functions, 135
ResetStatusBit, 375 strcpy
ResetStatusBitTmp, 375 String Functions, 135
SetMeaValue, 375 strftime
SetStatus, 375 Date/Time Functions, 55
SetStatusBit, 376 String Functions, 130
SetStatusBitTmp, 376 sprintf, 132
SetStatusTmp, 377 sscanf, 132
UpdateControl, 377 sscanfsep, 133
UpdateCtrl, 377 strchg, 134
StaExtvmea, 378 strcmp, 135
CopyExtMeaStatusToStatusTmp, 378 strcpy, 135
GetMeaValue, 378 strlen, 136
GetStatus, 379 strstr, 136
GetStatusTmp, 379 strtok, 137
InitTmp, 379 tochar, 137
IsStatusBitSet, 379 tocharcodepoint, 138
IsStatusBitSetTmp, 379 tolower, 138
ResetStatusBit, 380 ToStr, 132
ResetStatusBitTmp, 380 toupper, 138
SetMeaValue, 380 strlen
SetStatus, 380 String Functions, 136
SetStatusBit, 381 strstr
SetStatusBitTmp, 381 String Functions, 136
SetStatusTmp, 382 strtok
UpdateControl, 382 String Functions, 137
UpdateCtrl, 382 SubscribeProjectReadOnly
Start IntPrj, 720
ComDiff, 436 SubscribeProjectReadWrite
StartNewTableReportGroup IntPrj, 720
Environment Functions, 70 SummaryGrid
StartTrace Global Functions, 24
ComContingency, 419 SwitchOff
ComOutage, 470 General Object Methods, 174
StaSwitch, 383 SwitchOn
Close, 383 General Object Methods, 174
IsClosed, 383
IsOpen, 384 tan

902
INDEX INDEX

Mathematical Functions, 88 ComCoordreport, 435


tanh TransformGeoCoordinates
Mathematical Functions, 88 IntPrj, 720
TerminateSession TransformToGeographicCoordinateSystem
IntUser, 755 IntPrj, 720
Time trunc
SetTime, 605 Mathematical Functions, 88
time twopi
Mathematical Functions, 88 Mathematical Functions, 89
tochar TypAsmo, 791
String Functions, 137 CalcElParams, 791
tocharcodepoint TypCtcore, 792
String Functions, 138 AddRatio, 792
tolower RemoveRatio, 792
String Functions, 138 RemoveRatioByIndex, 793
tombchar TypLne, 793
Multibyte Encoded String Functions, 123 IsCable, 793
tombcharcodepoint TypMdl, 794
Multibyte Encoded String Functions, 123 Check, 794
tombslower Compile, 794
Multibyte Encoded String Functions, 123 Pack, 794
tombsupper TypQdsl, 795
Multibyte Encoded String Functions, 124 Encrypt, 795
TopologyForDirectionalBackupVariable IsEncrypted, 795
ComCoordreport, 429 ResetThirdPartyModule, 796
TopologyForFuseVariable SetThirdPartyModule, 796
ComCoordreport, 429 TypTr2, 796
TopologyForInstantaneousVariable GetZeroSequenceHVLVT, 796
ComCoordreport, 430
TopologyForMaxCurrent Unfreeze
ComCoordreport, 430 SetDesktop, 585
TopologyForNonDirectionalBackupVariable unm
ComCoordreport, 430 General Object Methods, 175
TopologyForOverloadVariable UnsubscribeProject
ComCoordreport, 431 IntPrj, 721
TopologyForOverreachVariable Update
ComCoordreport, 431 ChaVecfile, 617
TopologyForShortCircuitVariable ComSimoutage, 497
ComCoordreport, 432 ElmBmu, 192
TopologyForZoneVariable ElmBoundary, 194
ComCoordreport, 432 ElmBranch, 195
ToStr ElmCabsys, 196
String Functions, 132 ElmTow, 283
TotalLossCost IntDplmap, 675
ComCapo, 402 IntSscheduler, 747
toupper UpdateControl
String Functions, 138 StaExtbrkmea, 322
TransferDirectionalBackupResultsTo StaExtcmdmea, 327
ComCoordreport, 433 StaExtdatmea, 332
TransferNonDirectionalBackupResultsTo StaExtfmea, 337
ComCoordreport, 433 StaExtfuelmea, 342
TransferOverreachResultsTo StaExtimea, 347
ComCoordreport, 434 StaExtpfmea, 352
TransferResultsTo StaExtpmea, 357
ComCoordreport, 435 StaExtqmea, 362
TransferZoneResultsTo StaExtsmea, 367

903
INDEX INDEX

StaExttapmea, 372 VisDraw, 801


StaExtv3mea, 377 AddRelay, 801
StaExtvmea, 382 AddRelays, 801
UpdateCtrl CentreOrigin, 802
StaExtbrkmea, 323 Clear, 802
StaExtcmdmea, 328 DoAutoScaleOnAll, 802
StaExtdatmea, 333 DoAutoScaleOnCharacteristics, 802
StaExtfmea, 338 DoAutoScaleOnImpedances, 802
StaExtfuelmea, 343 DoAutoScaleX, 802
StaExtimea, 348 DoAutoScaleY, 803
StaExtpfmea, 353 VisHrm, 803
StaExtpmea, 358 Clear, 803
StaExtqmea, 363 DoAutoScaleX, 804
StaExtsmea, 367 DoAutoScaleY, 804
StaExttapmea, 372 GetDataSource, 805
StaExtv3mea, 377 GetScaleObjX, 805
StaExtvmea, 382 GetScaleObjY, 806
UpdateFromCurrentView SetAutoScaleX, 806
IntViewbookmark, 764 SetAutoScaleY, 807
UpdateGroups SetCrvDesc, 807
IntUserman, 756 SetDefScaleX, 808
UpdateStatistics SetDefScaleY, 808
IntPrj, 721 VisMagndiffplt, 809
UpdateSubstationTerminals AddRelay, 809
ElmTerm, 282 AddRelays, 809
UpdateTableReports Clear, 810
Dialogue Boxes Functions, 63 DoAutoScaleX, 810
UpdateTablesByCalcPeriod DoAutoScaleY, 810
ComTececo, 553 Refresh, 810
UpdateToDefaultStructure VisOcplot, 810
IntPrj, 721 AddRelay, 811
UpdateToMostRecentBaseVersion AddRelays, 811
IntPrj, 722 Clear, 811
DoAutoScaleX, 811
ValidateConstraints DoAutoScaleY, 811
ComRel3, 479 Refresh, 812
validLDF VisPath, 812
Global Functions, 28 Clear, 812
validRMS DoAutoScaleX, 812
Global Functions, 29 DoAutoScaleY, 813
validSHC SetAdaptX, 813
Global Functions, 30 SetAdaptY, 814
validSIM SetScaleX, 814
Global Functions, 30 SetScaleY, 815
VarExists VisPcompdiffplt, 816
General Object Methods, 175 AddRelay, 816
View AddRelays, 816
IntDocument, 669 CentreOrigin, 816
IntUrl, 754 Clear, 817
VisBdia, 797 DoAutoScaleX, 817
AddObjs, 797 DoAutoScaleY, 817
AddResObjs, 798 VisPlot2, 830
Clear, 798 AddResVars, 830
SetScaleY, 799 AddVars, 831
SetXVariable, 800 Clear, 831
SetYVariable, 800 DoAutoScaleX, 832

904
INDEX INDEX

DoAutoScaleY, 833 WereModificationsFound


DoAutoScaleY2, 833 ComMerge, 461
GetDataSource, 834 Write
GetScaleObjX, 834 ElmRes, 258
GetScaleObjY, 835 Output Window Functions, 129
SetAdaptX, 836 WriteDraw
SetAdaptY, 836 ElmRes, 258
SetAutoScaleX, 837 WriteValue
SetAutoScaleY, 838 IntSstage, 750
SetCrvDesc, 838 WriteWMF
SetDefScaleX, 839 SetDesktop, 585
SetDefScaleY, 839
SetScaleX, 840 xlActivateWorksheet
SetScaleY, 841 MS Excel Functions, 98
SetXVar, 842 xlAddWorksheet
ShowY2, 843 MS Excel Functions, 99
VisPlot, 817 xlCloseWorkbook
AddResVars, 818 MS Excel Functions, 99
AddVars, 818 xlDeleteWorksheet
Clear, 819 MS Excel Functions, 99
DoAutoScaleX, 819 xlGetActiveWorksheetIndex
DoAutoScaleY, 820 MS Excel Functions, 100
GetDataSource, 820 xlGetDateSeparator
GetIntCalcres, 821 MS Excel Functions, 100
GetScaleObjX, 821 xlGetDecimalSeparator
GetScaleObjY, 822 MS Excel Functions, 101
SetAdaptX, 822 xlGetThousandsSeparator
SetAdaptY, 823 MS Excel Functions, 101
SetAutoScaleX, 823 xlGetValue
SetAutoScaleY, 824 MS Excel Functions, 101
SetCrvDesc, 825 xlGetWorksheetCount
SetDefScaleX, 825 MS Excel Functions, 102
SetDefScaleY, 826 xlGetWorksheetName
SetScaleX, 826 MS Excel Functions, 102
SetScaleY, 827 xlNewWorkbook
SetXVar, 829 MS Excel Functions, 102
VisPlottz, 844 xlOpenWorkbook
AddRelay, 844 MS Excel Functions, 103
AddRelays, 844 xlResetTextStyle
Clear, 844 MS Excel Functions, 103
DoAutoScaleX, 844 xlRunMacro
DoAutoScaleY, 845 MS Excel Functions, 104
VisVec, 845 xlSaveWorkbook
CentreOrigin, 845 MS Excel Functions, 105
VisVecres, 845 xlSaveWorkbookAs
CentreOrigin, 845 MS Excel Functions, 105
VisXyplot, 846 xlSetBorder
Clear, 846 MS Excel Functions, 105
DoAutoScaleX, 846 xlSetColumnWidth
DoAutoScaleY, 847 MS Excel Functions, 107
GetDataSource, 847 xlSetDebug
SetCrvDescX, 848 MS Excel Functions, 107
SetCrvDescY, 848 xlSetFillColor
MS Excel Functions, 108
Warn xlSetFontName
Output Window Functions, 128 MS Excel Functions, 108

905
INDEX INDEX

xlSetFontSize
MS Excel Functions, 109
xlSetHorizontalAlignment
MS Excel Functions, 110
xlSetNumberFormat
MS Excel Functions, 111
xlSetPrintTitleRows
MS Excel Functions, 111
xlSetRowHeight
MS Excel Functions, 112
xlSetTextColor
MS Excel Functions, 112
xlSetTextStyle
MS Excel Functions, 113
xlSetValue
MS Excel Functions, 114
xlSetValues
MS Excel Functions, 114
xlSetVerticalAlignment
MS Excel Functions, 115
xlSetVisible
MS Excel Functions, 116
xlSetWorksheetName
MS Excel Functions, 116
xlSetWrapText
MS Excel Functions, 117
xlStart
MS Excel Functions, 117
xlTerminate
MS Excel Functions, 120

ZeroDerivative
ComInc, 451
ZoomAll
SetDesktop, 586

906

You might also like