0% found this document useful (0 votes)
2K views

DigSILENT DPL Function Reference

Uploaded by

A E
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)
2K views

DigSILENT DPL Function Reference

Uploaded by

A E
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/ 763

DIgSILENT

PowerFactory 2019

DPL Function Reference

I N T EG R AT E D P O W E R S Y S T EM A N A LY S I S S O F T WA R E F O R
T R A N S M I S S I O N / D I S T R I BU T I O N / I N D U S T RY / G EN E R AT I O N / I N T EG R AT I O N O F R EN E WA B L E S
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 © 2019 DIgSILENT GmbH


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

October 29, 2019


Revision 6
CONTENTS CONTENTS

Contents

1 General Description 1

2 Global Functions 2
2.1 File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 Date/Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.3 Dialogue Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.4 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.5 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.6 MS Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
2.6.1 MS Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
2.6.2 MS Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2.7 Multibyte Encoded String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
2.8 Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
2.9 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

3 Object Methods 131


3.1 General Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
3.2 Network Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
3.2.1 ElmArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
3.2.2 ElmAsm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
3.2.3 ElmAsmsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
3.2.4 ElmBbone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
3.2.5 ElmBmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
3.2.6 ElmBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.2.7 ElmBranch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
3.2.8 ElmCabsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
3.2.9 ElmComp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
3.2.10 ElmCoup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.2.11 ElmDsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
3.2.12 ElmFeeder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
3.2.13 ElmFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
3.2.14 ElmFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

2
CONTENTS CONTENTS

3.2.15 ElmGenstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195


3.2.16 ElmGndswt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
3.2.17 ElmLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
3.2.18 ElmLnesec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
3.2.19 ElmNec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
3.2.20 ElmNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
3.2.21 ElmPvsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
3.2.22 ElmRelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
3.2.23 ElmRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
3.2.24 ElmShnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
3.2.25 ElmStactrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
3.2.26 ElmSubstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
3.2.27 ElmSvs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
3.2.28 ElmSym . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
3.2.29 ElmTerm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
3.2.30 ElmTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
3.2.31 ElmTr3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
3.2.32 ElmTr4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
3.2.33 ElmTrfstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
3.2.34 ElmVac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
3.2.35 ElmVoltreg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
3.2.36 ElmXnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
3.2.37 ElmZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
3.3 Station Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
3.3.1 StaCt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
3.3.2 StaCubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
3.3.3 StaExtbrkmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
3.3.4 StaExtcmdmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
3.3.5 StaExtdatmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
3.3.6 StaExtfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
3.3.7 StaExtfuelmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
3.3.8 StaExtimea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
3.3.9 StaExtpfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
3.3.10 StaExtpmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
3.3.11 StaExtqmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
3.3.12 StaExtsmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
3.3.13 StaExttapmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
3.3.14 StaExtv3mea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
3.3.15 StaExtvmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
3.3.16 StaSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

3
CONTENTS CONTENTS

3.4 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362


3.4.1 ComAddlabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
3.4.2 ComAddon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
3.4.3 ComAmpacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
3.4.4 ComAuditlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
3.4.5 ComCapo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
3.4.6 ComCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
3.4.7 ComCimdbexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
3.4.8 ComCimdbimp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
3.4.9 ComCimvalidate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
3.4.10 ComConreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
3.4.11 ComContingency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
3.4.12 ComDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
3.4.13 ComDllmanager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
3.4.14 ComDpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
3.4.15 ComFlickermeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
3.4.16 ComGenrelinc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
3.4.17 ComGridtocim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
3.4.18 ComHostcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
3.4.19 ComImport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
3.4.20 ComInc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
3.4.21 ComLdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
3.4.22 ComLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
3.4.23 ComMerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
3.4.24 ComMot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
3.4.25 ComNmink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
3.4.26 ComOmr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
3.4.27 ComOpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
3.4.28 ComOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
3.4.29 ComProtgraphic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
3.4.30 ComPvcurves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
3.4.31 ComPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
3.4.32 ComRed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
3.4.33 ComRel3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
3.4.34 ComRelpost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
3.4.35 ComRelreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
3.4.36 ComRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
3.4.37 ComShc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
3.4.38 ComShctrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
3.4.39 ComSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440

4
CONTENTS CONTENTS

3.4.40 ComSimoutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442


3.4.41 ComSvgexport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
3.4.42 ComSvgimport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
3.4.43 ComTablereport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
3.4.44 ComTasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
3.4.45 ComTececo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
3.4.46 ComTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
3.4.47 ComUcte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
3.4.48 ComUcteexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
3.5 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
3.5.1 SetCluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
3.5.2 SetColscheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
3.5.3 SetDesktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
3.5.4 SetDistrstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
3.5.5 SetFilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
3.5.6 SetLevelvis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
3.5.7 SetParalman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
3.5.8 SetPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
3.5.9 SetSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
3.5.10 SetTboxconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
3.5.11 SetTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
3.5.12 SetUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
3.5.13 SetVipage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
3.6 Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
3.6.1 BlkDef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
3.6.2 BlkSig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
3.6.3 ChaVecfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
3.6.4 CimArchive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
3.6.5 CimModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
3.6.6 CimObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
3.6.7 IntCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
3.6.8 IntComtrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
3.6.9 IntComtradeset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
3.6.10 IntDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
3.6.11 IntDplmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
3.6.12 IntDplvec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
3.6.13 IntEvt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
3.6.14 IntExtaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
3.6.15 IntGate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
3.6.16 IntGrf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580

5
CONTENTS CONTENTS

3.6.17 IntGrfgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581


3.6.18 IntGrflayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
3.6.19 IntGrfnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
3.6.20 IntIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
3.6.21 IntMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
3.6.22 IntMon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
3.6.23 IntOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
3.6.24 IntPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
3.6.25 IntPrj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
3.6.26 IntPrjfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
3.6.27 IntQlim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
3.6.28 IntRas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
3.6.29 IntRunarrange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
3.6.30 IntScenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
3.6.31 IntScensched . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
3.6.32 IntScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
3.6.33 IntSscheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
3.6.34 IntSstage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
3.6.35 IntSubset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
3.6.36 IntThrating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
3.6.37 IntUrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
3.6.38 IntUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
3.6.39 IntUserman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
3.6.40 IntVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
3.6.41 IntVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
3.6.42 IntViewbookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
3.6.43 RelZpol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
3.6.44 ScnFreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
3.6.45 ScnFrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
3.6.46 ScnSpeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
3.6.47 ScnSync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
3.6.48 ScnVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
3.6.49 ScnVolt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
3.6.50 StoMaint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
3.6.51 TypAsmo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
3.6.52 TypLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
3.6.53 TypQdsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
3.6.54 TypTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
3.6.55 VisBdia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
3.6.56 VisDraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658

6
CONTENTS CONTENTS

3.6.57 VisHrm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660


3.6.58 VisMagndiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
3.6.59 VisOcplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
3.6.60 VisPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
3.6.61 VisPcompdiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
3.6.62 VisPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
3.6.63 VisPlot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
3.6.64 VisPlottz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
3.6.65 VisVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
3.6.66 VisVecres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
3.6.67 VisXyplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702

4 Set Routines 706

Index 714

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

All functions which are also available in QDSL are marked with an asterisk (*). More information
about QDSL and its usage can be found in the PowerFactory User Manual.

1
CHAPTER 2. GLOBAL FUNCTIONS

2 Global Functions

Overview

ActivateProject
ClearCommands*
ClearRecycleBin
CommitTransaction*
CreateFaultCase
CreateProject
Delete
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*
GetProjectFolder*
GetRecordingStage*
GetResData
GetResDesc

2
CHAPTER 2. GLOBAL FUNCTIONS

GetResObj
GetResUnit
GetResVar
GetSettings*
GetSummaryGrid*
GetUserManager*
HttpGet
ImportDz
ImportSnapshot
IsLdfValid*
IsRmsValid*
IsScenarioAttribute*
IsShcValid*
IsSimValid*
LoadProfile
LoadResData
MarkInGraphics
OutputFlexibleData*
PostCommand
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*

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.

3
CHAPTER 2. GLOBAL FUNCTIONS

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

CreateFaultCase
Create fault cases from the given elements.
int 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 elemnts 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.

4
CHAPTER 2. GLOBAL FUNCTIONS

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. A new grid will always be created. Returns the newly created project.
object CreateProject(string projectName,
string gridName,
[object parent])

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. Leave empty to open up the
ElmNet dialog and let the user enter a name.
parent The parent for the new project. Can be omitted to use the currently logged on user
as default.

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) {

5
CHAPTER 2. GLOBAL FUNCTIONS

if (obj:typ_id=DummyType) {
toDelete.Add(obj);
}
obj = fuses.NextFilt();
}
Delete(toDelete);

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');

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);

6
CHAPTER 2. GLOBAL FUNCTIONS

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 Contingenciy 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
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

7
CHAPTER 2. GLOBAL FUNCTIONS

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);

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);

8
CHAPTER 2. GLOBAL FUNCTIONS

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])

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()) {
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

9
CHAPTER 2. GLOBAL FUNCTIONS

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([forceReload = 0])

list GetAllUsers([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


• 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).
set GetBrowserSelection()

10
CHAPTER 2. GLOBAL FUNCTIONS

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).
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;

11
CHAPTER 2. GLOBAL FUNCTIONS

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.
set GetCurrentSelection()

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

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);

12
CHAPTER 2. GLOBAL FUNCTIONS

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, '%');
}

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

A RGUMENTS
classname
Classname of the elements:
ElmBmu
ElmArea
ElmZone
ElmRoute
ElmOwner

13
CHAPTER 2. GLOBAL FUNCTIONS

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.
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])

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).

14
CHAPTER 2. GLOBAL FUNCTIONS

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.
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”

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”).

15
CHAPTER 2. GLOBAL FUNCTIONS

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

16
CHAPTER 2. GLOBAL FUNCTIONS

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 Symplified chinese
tr Turkish

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

A RGUMENTS
class (optional)
command class

R ETURNS
The last executed command.

17
CHAPTER 2. GLOBAL FUNCTIONS

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. Returns the current Working Set size or the delta since
the last call in bytes.
int GetMem(int calculateDelta)

A RGUMENTS
calculateDelta
Measure abolute memory consumption if 0, measure the delta since the last time
it was called if 1

R ETURNS
The measured amount of memory in bytes.

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

18
CHAPTER 2. GLOBAL FUNCTIONS

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. 16.0.1

E XAMPLE
!string strVersion;
dVersion=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)

A RGUMENTS
type Type of the corresponding project folder. See IntPrjfolder.GetProjectFolderType()
for a list of possible values.

R ETURNS
An IntPrjFolder object. If no project is currently active or project folder of this type does not
exist, 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()

19
CHAPTER 2. GLOBAL FUNCTIONS

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])

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)

20
CHAPTER 2. GLOBAL FUNCTIONS

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);

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()

21
CHAPTER 2. GLOBAL FUNCTIONS

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);
}

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

R ETURNS
The user manager object

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.

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

22
CHAPTER 2. GLOBAL FUNCTIONS

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.
void 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
Collection of top-level objects imported.

R ETURNS
0 = success
-1 = wrong file extension
nonzero = import failed

ImportSnapshot
Imports a Snapshot DZS file.

23
CHAPTER 2. GLOBAL FUNCTIONS

void ImportSnapshot(string dzsFilePath,


set importedObjects)

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

R ETURNS
0 = success
-1 = wrong file extension
-2 = import aborted due to active project
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();
}

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.

24
CHAPTER 2. GLOBAL FUNCTIONS

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');
}

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

25
CHAPTER 2. GLOBAL FUNCTIONS

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');
}

LoadProfile
Activates a profile for current user. This corresponds to the select profile action via main menue
“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.

26
CHAPTER 2. GLOBAL FUNCTIONS

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');
}

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);

27
CHAPTER 2. GLOBAL FUNCTIONS

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 = ''])

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 to the command pipe of the “input window”. The posted commands will be
executed after the currently running script has finished.
void PostCommand(string command)

A RGUMENTS
command
The command string.

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

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

28
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])

29
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])

30
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)

31
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);

32
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

33
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()

34
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;

35
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)

36
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+,b,t).
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.

37
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);

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,]
[...])

38
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

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.

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

S EE ALSO

fscanfsep(), fprintf()

39
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

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.
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).

40
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

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.
int vecSize;
int i;
string fileName;

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

41
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);
}

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);
vecSize = vec.Size();

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


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

42
2.1. FILE SYSTEM CHAPTER 2. GLOBAL FUNCTIONS

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

S EE ALSO

GetTemporaryDirectory(), GetInstallationDirectory()

43
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

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 decimal number (01..31)
%H Hour in 24-hour format (00..23)
%m Month as decimal number (01..12)
%M Minute as decimal number (00..59)
%S Second as decimal number (00..59)
%Y Year with century, as decimal number
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

44
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 decimal number (01..31)
%H Hour in 24-hour format (00..23)
%I Hour in 12-hour format (01..12)
%j Day of year as decimal number (001..366)
%m Month as decimal number (01..12)
%M Minute as decimal number (00..59)
%p Current locale’s A.M./P.M. indicator for 12-hour clock
%S Second as decimal number (00..59)
%U Week of year as decimal number, Sunday as first day of week (00..53)
%w Weekday as decimal number (0..6; Sunday is 0)
%W Week of year as decimal number, 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 decimal number (00..99)
%Y Year with century, as decimal number
%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();

45
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);

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.

46
2.2. DATE/TIME CHAPTER 2. GLOBAL FUNCTIONS

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 decimal number (01..31)
%H Hour in 24-hour format (00..23)
%m Month as decimal number (01..12)
%M Minute as decimal number (00..59)
%S Second as decimal number (00..59)
%Y Year with century, as decimal number
date Formatted date string (local time)

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

47
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 decimal number (01..31)
%H Hour in 24-hour format (00..23)
%m Month as decimal number (01..12)
%M Minute as decimal number (00..59)
%S Second as decimal number (00..59)
%Y Year with century, as decimal number
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

48
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 decimal number (01..31)
%H Hour in 24-hour format (00..23)
%I Hour in 12-hour format (01..12)
%j Day of year as decimal number (001..366)
%m Month as decimal number (01..12)
%M Minute as decimal number (00..59)
%p Current locale’s A.M./P.M. indicator for 12-hour clock
%S Second as decimal number (00..59)
%U Week of year as decimal number, Sunday as first day of week (00..53)
%w Weekday as decimal number (0..6; Sunday is 0)
%W Week of year as decimal number, 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 decimal number (00..99)
%Y Year with century, as decimal number
%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.

49
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

2.3 Dialogue Boxes


Overview

CloseTableReports
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()

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])
void input(double inputDbl,
string msg,
[int& length])

A RGUMENTS
inputStr — inputDbl
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.
length (optional, out)
If given, the input is limited to 'length' characters. In addition, this determines the
dialog's size (default: 18).

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:

50
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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

R ETURNS
Returns an integer for the pressed button.

51
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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 occured:\nOr not?',1,1,3);

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)

52
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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.

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

53
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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,
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.

54
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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.

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.

55
2.3. DIALOGUE BOXES CHAPTER 2. GLOBAL FUNCTIONS

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()

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 = ''])

56
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

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
GetDiffMode
IsAutomaticCalculationResetEnabled*
IsFinalEchoOnEnabled
NoFinalUpdate
SetAutomaticCalculationResetEnabled*
SetConsistencyCheck*
SetDiffMode
SetFinalEchoOnEnabled
SetGraphicUpdate*
SetGuiUpdateEnabled*
SetUserBreakEnabled

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()

57
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

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()

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()

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.

58
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

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()

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

59
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

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;

!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();

60
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

!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)

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);

61
2.4. ENVIRONMENT CHAPTER 2. GLOBAL FUNCTIONS

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

SetGraphicUpdate()

E XAMPLE
The following example disables and enables the GUI updates
int oldState;
! disable gui updates
oldState = SetGuiUpdateEnabled(0);
!do some calculations
!...
!restore gui updates old state
SetGuiUpdateEnabled(oldState);

SetUserBreakEnabled
Enables or disables the “Break” button in main tool bar. After script execution it is disabled
automatically.
void SetUserBreakEnabled(int enabled)

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

62
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

D EPRECATED N AMES
EnableUserBreak, SetEnableUserBreak

2.5 Mathematics
Overview

abs*
acos*
asin*
atan*
atan2*
BinaryAnd*
BinaryOr*
CalcWeibullPar*
ceil*
cos*
cosh*
exp*
floor*
frac*
GetRandomNumber*
GetRandomNumberEx*
InvertMatrix*
ln*
log*
max*
min*
modulo*
pi*
pow*
RndExp*
RndGetMethod*
RndGetSeed*
RndNormal*
RndSetup*
RndUnifInt*
RndUnifReal*
RndWeibull*
round*
SetRandomSeed*
sin*
sinh*
sqr*
sqrt*
tan*
tanh*
time*
trunc*
twopi*

63
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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].

R ETURNS
Arc sine of 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.

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

64
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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

R ETURNS
Retruns atan(y/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);

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

65
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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)

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 unkown key(s)

66
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.

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.

67
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.

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 intervall [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])

68
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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

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

69
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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).

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.

70
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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 successfull. 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);
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);

71
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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);
}

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).

72
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.

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.

73
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable 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])

74
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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 accessable 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 accessable 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])

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 accessable via this number.

R ETURNS
double Random number

75
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.
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 accessable via this number.

E XAMPLE
int i;
int numOfDraws;
int usedSeed;

int rngType; ! Type of the random number generator.


int seedAutomatic; ! automatic seeding true ore false
int seed; ! seed for the random number generator

76
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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$
! 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);

77
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

! 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 accessable 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.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable 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])

78
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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 accessable 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

D EPRECATED N AMES
SetRandSeed

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

A RGUMENTS
x A value in radians.

79
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.

R ETURNS
The square root.

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

A RGUMENTS
x A value in radians.

80
2.5. MATHEMATICS CHAPTER 2. GLOBAL FUNCTIONS

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.

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

R ETURNS
The mathematical constant 2π.

81
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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

82
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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

83
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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
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().

84
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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])

85
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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();
}

!// 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);

86
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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


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);

87
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

}
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


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);

88
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

}
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();

!// 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);

89
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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

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

90
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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.

91
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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)

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;
}

92
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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

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

93
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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()

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().

94
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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()

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

95
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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:
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)

96
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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');

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.

97
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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,
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

98
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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.

99
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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

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.

100
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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)

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)

101
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).
fontsize Size, e.g. 12.0.

R ETURNS
0 On success.
1 On error.

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

102
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

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

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)

103
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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.

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)

104
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).
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

105
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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

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)

106
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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

sep Used separator.

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

107
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

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

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
xlSetVisbile(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()

108
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

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;
}

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.
int xlStart()

109
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

R ETURNS
0 On success.
1 On error.

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

110
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

!// export data


row = 2;
objs = AllRelevant(class);
for(obj = objs.First(); obj; obj = objs.Next()) {
col = 1;
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();

111
2.6. MS OFFICE CHAPTER 2. GLOBAL FUNCTIONS

active = xlGetActiveWorksheetIndex();
printf('The workbook contains the following sheets:');
for(i = 1; i<=count; i+= 1) {
str = xlGetWorksheetName(i);
if (i = active) {
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

112
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()

113
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()

114
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 occured.

S EE ALSO

tombcharcodepoint(), tochar()

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

115
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.
tombsupper(string str)

S EE ALSO

tombslower(), toupper()

2.8 Output Window


Overview

ClearOutputWindow*
Error*
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.

116
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.');

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()

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,]
[...])

117
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

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);
! 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);

118
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

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.

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');

119
2.8. OUTPUT WINDOW CHAPTER 2. GLOBAL FUNCTIONS

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.');

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.

120
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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);

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.

121
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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:

- 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:

122
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

\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);

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.

123
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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 formated source string.
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.

124
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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 token are not skipped.
1 Empty token are skipped (default).

R ETURNS
Number (≥ 0) of values successfully parsed and stored.

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)

125
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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);
}

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()

126
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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()

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()

127
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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

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 token are not skipped.


1 Empty token 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.

128
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

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.

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 occured.

S EE ALSO

tocharcodepoint(), tombchar()

129
2.9. STRING CHAPTER 2. GLOBAL FUNCTIONS

tolower*
Creates a copy of a string, where all characters are converted to lowercase.
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.
toupper(string str)

R ETURNS
Copy of original string, but with all characters in uppercase.

S EE ALSO

tolower(), tombsupper()

E XAMPLE
string src, scp;
src = 'This is just a test';
scp = toupper(src);
printf('%s', scp);

130
CHAPTER 3. OBJECT METHODS

3 Object Methods

3.1 General Methods


Overview

AddCopy
ContainsNonAsciiCharacters
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*
HasResults*
IsCalcRelevant*
IsClass*
IsDeleted*
IsEarthed*
IsEnergized*
IsHidden*

131
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

IsInFeeder*
IsNetworkDataFolder*
IsNode*
IsObjectActive*
IsObjectModifiedByVariation*
Isolate
IsOutOfService*
IsReducible*
IsShortCircuited*
lnm*
MarkInGraphics
Move
PasteCopy
PurgeUnusedObjects
ReplaceNonAsciiCharacters
ReportNonAsciiCharacters
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.

132
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
Returns the copy that has been created on success or NULL, when copying a single object.

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);
}

ContainsNonAsciiCharacters
Checks whether an object contains texts attributes with non-ASCII characters.
int object.ContainsNonAsciiCharacters()

R ETURNS
Returns 1 if the object contains at least one non-ASCII characters. Otherwise 0.

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;

133
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

ret = target.CopyData(source);
if (ret=1) { ! error
exit();
}

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])

134
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.

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.

135
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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');
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])

136
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

D EPRECATED N AMES
GetConnectedElms

GetConnectionCount*
Returns the number of electrical connections.
int object.GetConnectionCount()

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])

137
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

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.

138
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
Controlled node, NULL if no controlled terminal exists (or not voltage controlled if check=1)

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
Same format as used in object.ShowFullName() and also clickable when
printed to the output window.
> 0 (but less or equal to 190)
Formatted exactly to this length and also clickable when printed to the output
window.

139
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

R ETURNS
The fullname (complete database path including the name and class name) of the object.

S EE ALSO

object.ShowFullName()

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.

140
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

S EE ALSO

object.GetZeroImpedance()

GetInom*
Returns the nominal current of the object at given bus index.
double object.GetInom([int busIndex = 0])

A RGUMENTS
busIndex (optional)
Bus index, default value is 0.

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.

141
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()

142
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

143
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();
}
}

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).

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])

144
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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

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.

145
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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()

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

146
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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();
}

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])

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).

147
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
0 Value successfully obtained.
1 On error e.g. variable does not exists 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.

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.

148
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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()

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');

149
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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()

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.

150
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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');
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

151
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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);
}
}

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);
}

152
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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’

IsInFeeder*
Indicates if the object belongs to the feeder area defined by “Feeder”.
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 in the feeder area.
0 Otherwise

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

153
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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()

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.

154
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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

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)

155
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

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;

156
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

}
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()

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);
}

157
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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])

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)

158
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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);

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 canceled with an error.
1 Missing references are automatically reset.

R ETURNS
0 Object(s) successfully copied.
1 Error.

159
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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()

S EE ALSO

object.ReportUnusedObjects()

ReplaceNonAsciiCharacters
Replaces all non-ASCII characters in all text attributes by similar ASCII characters. Emits a
warning if a charcter can not replaced, because no replacement character was defined.
int object.ReplaceNonAsciiCharacters(object map,
string defaultReplacementCharacter)

A RGUMENTS
map IntMat object with two columns: the first column contains the codes of the non-
ASCII character, the second column contains the code of the ASCII character.
defaultReplacementCharacter
String containing one ASCII character. If map does not contain a replacement for
a non-ASCII character, it is replaced by defaultReplacementCharacter.

R ETURNS
Returns 1 when the function was executed successfully.

ReportNonAsciiCharacters
Reports all text attributes of this objects containing non-ASCII characters in the output window.
void object.ReportNonAsciiCharacters()

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()

160
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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])

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

161
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
0 Value successfully set.
1 On error e.g. variable does not exists or row/column number is out of range.

S EE ALSO

object.GetVal()

162
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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

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()

163
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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])

A RGUMENTS
VarName The variable name
error (optional, out)
1 on error, otherwise 0.

R ETURNS
The short name.

164
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set

165
3.1. GENERAL METHODS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
1 Variable exists and is currently valid on this object.
0 Variable does not exists e.g. variable never exists or variable currently not exists
since the load flow is not calculated.

166
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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*
DefineBoundary
GetAll*
GetBranches*
GetBuses*
GetObjs*

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

167
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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);

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.

E XAMPLE
set all,areas;
object prj,area,obj;
! output elements in the area
prj = GetActiveProject();

168
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

GetObjs*
Returns all objects of the given class which belong to this area.
set ElmArea.GetObjs(string classname)

169
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

GetAvailableGenPower*
GetElecTorque*
GetGroundingImpedance*
GetMechTorque*
GetMotorStartingFlag*
GetStepupTransformer*
IsPQ*

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.

170
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

• 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 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.

171
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmAsm.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.

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

172
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetStepupTransformer*
Performs a topological search to find the step-up transformer of the asynchronous machine.
object ElmAsm.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).

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.

173
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 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.

174
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.

175
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);
}
}

176
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].

177
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].

178
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].

179
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.

Update
Updates the list of machines in the tables: 'Dispatchable Machines' and 'Non-dispatchable
(fixed) Machines'.
void ElmBmu.Update()

180
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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);
}

181
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

E XAMPLE
set cubicles;
object cubicle;
int res;
res = boundary.IsSplitting(cubicles);
if (res) {
printf('Boundary is splitting');
}

182
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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()

183
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
cable type on success
NULL on error
object ElmCabsys.GetLineCable()

E XAMPLE
object oElmSys;
set lines;
object otyp;
int indx;

indx = 1;

oElmSys = GetCalcRelevantObjects('*.ElmCabsys');
cableElement = cableElements.First();

184
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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 On success.
0 On error.

E XAMPLE
object cable;
set cableElements;
int ierr;

cableElements = GetCalcRelevantObjects('*.ElmCabsys');
cable = cableElements.First();
ierr = cable.Update();

3.2.9 ElmComp
Overview

SlotUpdate

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

185
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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()

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.

186
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

187
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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()

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:

188
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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).

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:

189
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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])

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);
}

190
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

}
}

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');
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.

191
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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])

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);
}
}
}

192
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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');
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).

193
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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.

194
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.15 ElmGenstat
Overview

Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
GetStepupTransformer*
IsConnected*
Reconnect
ResetDerating

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))

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);
}
}

195
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 ElmGenstat.GetAvailableGenPower()

R ETURNS
Available generation power

E XAMPLE
set generators;
object generator;
double totalpower, power;

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)

196
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.

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).

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

197
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 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);
}
}

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()

198
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

IsClosed*
Returns information about current switch state.
int ElmGndswt.IsClosed()

R ETURNS
1 switch is closed
0 switch is open

199
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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()

3.2.17 ElmLne
Overview

AreDistParamsPossible*
CreateFeederWithRoutes
FitParams*
GetIthr*
GetType*
GetY0m*
GetY1m*
GetZ0m*
GetZ1m*
GetZmatDist*
HasRoutes*
HasRoutesOrSec*
IsCable*
IsNetCoupling*
MeasureLength*
SetDetailed

200
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

AreDistParamsPossible*
Check if the line fulfills 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 fulfill conditions for distributed paramters
5 TypLne does not fulfill 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

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

201
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

FitParams*
Calculates distributed parameters for line elements. 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(const bool isRMSModel, const bool modify)

R ETURNS
0 Success
1 Error

E XAMPLE
object line;
set lines;
int err;

lines = GetCalcRelevantObjects('*.ElmLne');
line = lines.First();
err = line.FitParams(const bool isRMSModel, const bool modify);
if (err) {
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

202
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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();
}

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);
}

203
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

204
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 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);
}

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);
}

205
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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()

206
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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(); {
line = list.Nextmatch();
}
}

IsCable*
Checks if this line is a cable.
int ElmLne.IsCable()

R ETURNS
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()

207
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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) {
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);

208
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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


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);

209
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

}
cable = list.Nextmatch();
}

3.2.19 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.20 ElmNet
Overview

Activate
CalculateInterchangeTo*
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

210
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);
}

Deactivate
Removes a grid from the active study case.Can only be applied if there are is no currently active
calculation.
int ElmNet.Deactivate()

211
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
0 on success
1 on error

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.21 ElmPvsys
Overview

Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
IsConnected*
Reconnect
ResetDerating

212
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 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);
}
}

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.

213
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 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)

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.

214
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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);
}
}

215
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 ElmPvsys.ResetDerating()

3.2.22 ElmRelay
Overview

CheckRanges*
GetCalcRX*
GetMaxFdetectCalcI*
GetSlot*
GetUnom*
IsStarted*
SetImpedance
SetMaxI
SetMaxIearth
SetMinI
SetMinIearth
SetOutOfService
SetTime
SlotUpdate

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.

216
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.
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 occourred, 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.

217
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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 occourred.

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

218
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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()

219
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

220
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

3.2.23 ElmRes
Overview

AddVariable
Clear
FindColumn*
FindMaxInColumn
FindMaxOfVariableInRow*
FindMinInColumn
FindMinOfVariableInRow*
FinishWriting
Flush
GetDescription
GetFirstValidObject*
GetFirstValidObjectVariable*
GetFirstValidVariable*
GetNextValidObject*
GetNextValidObjectVariable*
GetNextValidVariable*
GetNumberOfColumns
GetNumberOfRows
GetObj*
GetObject*
GetRelCase*
GetSubElmRes*
GetUnit
GetValue
GetVariable
InitialiseWriting
Load
Release
SetAsDefault
SetObj
SetSubElmResKey
SortAccordingToColumn
Write
WriteDraw

221
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

AddVariable
Adds a variable to the list of monitored variables for the Result object.
void ElmRes.AddVariable(object element,
string varname
)

A RGUMENTS
element An object.
varname Variable name for object O.

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.

222
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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();
}
}

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) {

223
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

exit(1);
}
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) {

224
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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();
}

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);

225
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

printf('Maximum m:u at column %d: %f',index,voltage);


index = elmRes.FindMinOfVariableInRow('m:u',0, voltage);
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.

226
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

FinishWriting
Finishes the writing of values to a result file.
void ElmRes.FinishWriting()

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 ommited 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

227
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

}
Results.Release(); ! release the result file data from memory

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]
)
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).

228
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

229
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

230
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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
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

231
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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');

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()

232
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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;

233
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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();
}
! search the row which contains the given contingency (cnt)
SetLineFeed(0);
printf('Case Number Contingency\n');

234
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

235
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, the value is invalid in case that it was not written, bcause 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;

236
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()

237
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();

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.

238
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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;
}
}

239
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);
failed = elmRes.GetValue(value1,row,column);
failed = elmRes.GetValue(value2,row,column+1);
row = 0;
while (.not.failed) {

240
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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;

241
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

load:plini = minLoad;
ldf = GetFromStudyCase('ComLdf');
while (load:plini<maxLoad) {
failed = ldf.Execute();
if (failed) {
break;
}
load:plini+=step;
Results.WriteDraw();
}

3.2.24 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.

3.2.25 ElmStactrl
Overview

GetControlledHVNode*
GetControlledLVNode*
GetStepupTransformer*
Info*

242
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
index Index of machine (starting from 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 − . . . ).

R ETURNS
object Terminal ()
NULL not found

E XAMPLE
set objs
object controlledNode,gen;
int index,gens;

243
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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()

244
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.26 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

245
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(),

246
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) {

247
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()) {

248
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()

249
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.

250
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.27 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

251
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.28 ElmSym
Overview

Derate
Disconnect
GetAvailableGenPower*
GetGroundingImpedance*
GetMotorStartingFlag*
GetStepupTransformer*
IsConnected*
Reconnect
ResetDerating

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');

252
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

! 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 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();

253
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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
)

254
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

255
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 ElmSym.ResetDerating()

3.2.29 ElmTerm
Overview

GetBusType*
GetCalcRelevantCubicles*
GetConnectedBrkCubicles*
GetConnectedCubicles*
GetConnectedMainBuses*
GetConnectionInfo*
GetEquivalentTerminals*
GetMinDistance*
GetNextHVBus*
GetNodeName*
GetSepStationAreas*
HasCreatedCalBus*
IsElectrEquivalent*
IsEquivalent*
IsInternalNodeInStation*
UpdateSubstationTerminals

GetBusType*
Gets busbar calculation type.
int ElmTerm.GetBusType()

R ETURNS
0 No valid calculation (load flow).
1 QV busbar.

256
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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).

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).

257
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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).
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.

258
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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()

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]
)

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).

259
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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
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();
}

GetNextHVBus*
This function returns the nearest connected busbar that has a higher voltage level. To detect
this bus, a breath-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”.

260
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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])

A RGUMENTS
considerSwitches (optional)
Consider switch state (default 1).

R ETURNS
Set of all separate areas in this substation.

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();
}

261
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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)

int ElmTerm.IsElectrEquivalent(object terminal,


double maxR,
double maxX
)

A RGUMENTS
terminal Terminal to which the 'method called terminal' is connected to.
double maxR
Given threshold for the resistance of branch elements (must be given in Ohm).
double 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)),

262
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

• 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.

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 and 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
)

263
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

A RGUMENTS
volt Updates nominal voltages (<> 0)
phs Updates phase technology (<> 0)

3.2.30 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

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.

264
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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 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)

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

265
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Returns the tap phase shift angle of the transforrmer 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 transforrmer 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)

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.

266
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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) {
obj.ShowFullName();
}
}

NTap*
Gets the transformer tap position.
int ElmTr2.NTap()

R ETURNS
The tap position.

267
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

3.2.31 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.
int ElmTr3.CreateEvent([double tapAction,]
[double tapPos,]
[double busIdx]
)

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

R ETURNS
0 on success

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.

268
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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 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)

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

269
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

R ETURNS
Returns the tap phase shift angle of the transforrmer 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 transforrmer for given tap position and side

GetTapZDependentSide*
Get tap side used for the dependent impedance
void ElmTr3.GetTapZDependentSide()

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.

270
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.
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'

271
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.32 ElmTr4
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.
int ElmTr4.CreateEvent([double tapAction,]
[double tapPos,]
[double busIdx]
)

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

R ETURNS
0 on success

GetGroundingImpedance*
Returns the impedance of the internal grounding.
int ElmTr4.GetGroundingImpedance(int busIdx,
double& resistance,
double& reactance)

272
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.

GetSuppliedElements*
Returns the network components that are supplied by the transformer.
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 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)

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.

273
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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 transforrmer 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
)

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 transforrmer for given tap position and side

GetTapZDependentSide*
Get tap side used for the dependent impedance
void 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

274
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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.

275
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
busIdx 0=HV, 1=MV, 2=LV

R ETURNS
The tap position.

3.2.33 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

276
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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

277
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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-
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.)

278
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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;
}

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

279
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

-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()

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.

280
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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.34 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.
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.35 ElmVoltreg
Overview

CreateEvent*
GetGroundingImpedance*
GetZpu*
NTap*

281
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

CreateEvent*
For the corresponding voltage regulator, a Tap Event (EvtTap) is created for the simulation.
int ElmVoltreg.CreateEvent([double tapAction,]
[double 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

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.

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.

282
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).

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.36 ElmXnet
Overview

GetGroundingImpedance*
GetStepupTransformer*

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
)

283
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

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).

3.2.37 ElmZone
Overview

CalculateInterchangeTo*
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 interchage is calculated

R ETURNS
<0 calculation error (i.e. no valid load flow, empty zone...)
0 no interchage 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);

284
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

DefineBoundary
Defines boundary with this zone as interior part. Resulting cubicles of boundary are busbar-
oriented towards the zone.
object ElmZone.DefineBoundary(int shift)

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);
}
}
}

285
3.2. NETWORK ELEMENTS CHAPTER 3. OBJECT METHODS

GetBranches*
Returns all branches which belong to this zone.
set ElmZone.GetBranches()

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) {

286
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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');
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.

287
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.

288
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])

289
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).

290
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)

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

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()){
printf('%o', element);
}

291
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
nearestBusbar
Nearest busbar in relation to cubicle.

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);
}
}

}
}

292
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();
}
index = index + 1;
}

293
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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()

E XAMPLE
set cubics;
object cubic;
cubics = GetCalcRelevantObjects('*.StaCubic');
!delete StaSwitches from all cubicles
for(cubic = cubics.First(); cubic; cubic = cubics.Next()) {
cubic.RemoveBreaker();
}

294
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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.

295
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 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)

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)

296
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 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.

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

297
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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)

298
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 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

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)

299
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.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()

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()

300
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

301
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

302
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

303
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

304
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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()

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.

305
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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()

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.

306
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

307
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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)

308
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 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

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)

309
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.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()

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()

310
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

311
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

312
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

313
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

314
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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()

315
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

316
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

317
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

318
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

319
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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()

320
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

321
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

322
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

323
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

324
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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()

325
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

326
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

327
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

328
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

329
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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()

330
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

331
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

332
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

333
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

334
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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()

335
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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

336
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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

337
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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.

338
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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

339
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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.

340
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

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)

341
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.

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.

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)

342
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
status Bitfield for status flags, see above

343
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

3.3.13 StaExttapmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus

344
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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.

345
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 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)

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)

346
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 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
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.

347
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 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)

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)

348
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 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)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

349
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

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()

350
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

351
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

352
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

353
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

354
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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.

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()

355
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

356
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

357
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

358
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

359
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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

S EE ALSO

StaSwitch.IsOpen()

360
3.3. STATION ELEMENTS CHAPTER 3. OBJECT METHODS

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()

361
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 virtual instrument (classname 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 = GetGraphBoard();
page = desktop.GetPage('Voltages',0);
plot = page.GetVI('T1','VisPlot',0);
command.Execute(plot,1);

362
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

363
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,
int rows,
int columns,
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
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.
initial Default value for all entries 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.

364
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.

365
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()

DefineInteger
Creates a new integer parameter for the given type of objects.

366
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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.

367
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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

368
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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()

369
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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,
string unit,
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


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.

370
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.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,
string unit,
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


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. DefineObjectVector shall be used instead.

S EE ALSO

ComAddon.DefineObjectVector()

DefineString
Creates a new text parameter for the given type of objects.

371
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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.

372
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

S EE ALSO

ComAddon.SetActiveModule()

ModuleExists
Checks if the module for this add-on was already created using the method CreateModule.
int ComAddon.ModuleExists()

373
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
ireport (in)
Show report or not

E XAMPLE
object cmdAmpacity;
int iret, ireport;
cmdAmpacity = GetFromStudyCase('ComAmpacity');
if (cmdAmpacity) {
ireport = 0;
iret = cmdAmpacity.ExecuteAmpacityCalc(ireport);
if (iret = 0) {
// tabular report not displayed since ireport = 0
}
}

374
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.4 ComAuditlog
Overview

Check

Check
Checks integrity of Audit Log.
int ComAuditlog.Check()

R ETURNS
number of errors

3.4.5 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 succes.
1 An error occurred during load flow execution.

375
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

376
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.

377
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.6 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.

378
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.7 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

3.4.8 ComCimdbimp
Overview

Execute
ImportAndConvert

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

379
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
0 OK
1 Error: import failed
2 Error: conversion failed

3.4.9 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

380
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

0 Do not open report


1 Open report

R ETURNS
0 OK
1 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.

GetDescriptionText
Returns the description from the selected validation message.
string ComCimvalidate.GetDescriptionText(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

R ETURNS
Message description.

GetInputObject
Returns the object selected for validation.
object ComCimvalidate.GetInputObject()

R ETURNS
Pointer to CimArchive, CimModel, or SetSelect.

GetModel
Returns the CimModel object from the selected validation message.
object ComCimvalidate.GetModel(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

381
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Pointer to 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.

GetNumberOfValidationMessages
Returns the number of validation messages generated.
int ComCimvalidate.GetNumberOfValidationMessages()

R ETURNS
Number of validation messages.

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.

GetObjectId
Returns the object ID from the selected validation message.
string ComCimvalidate.GetObjectId(int messageIndex)

A RGUMENTS
messageIndex
Index of the validation message.

382
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Object ID.

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.

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.

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.

3.4.10 ComConreq
Overview

Execute

383
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.11 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)

384
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.

385
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)

386
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])

387
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

388
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

389
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.12 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()

390
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.13 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()

3.4.14 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])

391
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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 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 successfull execution.
1 An error occured.
6 User hit the break button.

S EE ALSO

ComDpl.CheckSyntax()

392
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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');
}

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.

393
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

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()

394
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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()

395
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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
)

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()

396
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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
)

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(const char* companyCode, const char* moduleCode)

A RGUMENTS
companyCode
D isplay name or numeric value of company code.
moduleCode
D isplay name or numeric value of third party module.

397
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 On success.
1 On error.

3.4.15 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.16 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();

398
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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);

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.17 ComGridtocim
Overview

ConvertAndExport
SetAuthorityUri
SetBoundaries
SetGridsToExport

399
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

SetAuthorityUri
Sets the authority uri for a specific grid.
void ComGridtocim.SetAuthorityUri(object grid,
string uri)

A RGUMENTS
grid Grid to set the URI for.
uri Model authority URI to be set.

SetBoundaries
Sets the grids as ”Boundary Grid” and clears any previous setting.
void ComGridtocim.SetBoundaries(set grids)

A RGUMENTS
grids The grids to be considered as boundaries.

SetGridsToExport
Sets the grids as ”Selected” and clears any previous setting.
void ComGridtocim.SetGridsToExport(set grids)

400
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
grids The grids to be selected.

3.4.18 ComHostcap
Overview

CalcMaxHostedPower

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& violatedElement)

A RGUMENTS
terminal Hosting site.

P (out) Max. active power.


Q (out) Max. reactive power.
violatedElement (out)
Element where the limiting violation occurs.

R ETURNS
-1 Selected object is not a terminal.
0 No violations. Calculation OK.
1 Calculation failed.
2 Thermal violation.
3 Voltage violation.
4 Protection violation.
5 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) {

401
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

printf('The most critical element: %o', violatedElm);


printf('Violation type: %d', iret);
}
}
}

3.4.19 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

402
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

printf('\nModified objects:');
modified = ImportCmd.GetModifiedObjects();
for(obj = modified.First(); obj; obj = modified.Next()) {
printf('%o', obj);
}

3.4.20 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();
}
}

403
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.21 ComLdf
Overview

CalcLdf
CalcParams
CheckControllers*
DoNotResetCalc
EstimateLoading
EstimateOutage
Execute
IsAC*
IsBalanced*
IsDC*
PrintCheckResults
SetOldDistributeLoadMode

CalcLdf
Perform a load flow analysis with new topology rebuild, but without initialisation of calculation
parameters.
int ComLdf.CalcLdf()

R ETURNS
0 On success.
1 On error.

CalcParams
Initialise calculation parameters for all models.
int ComLdf.CalcParams()

R ETURNS
Always return 1.

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)

404
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

EstimateLoading
Estimate the loading of all branch elements if the power injections of given set of terminals
are changed. The changed power for each terminal is stored in dpl1 (active power) and dpl2
(reactive power).
int ComLdf.EstimateLoading(set nodes,
int init
)

A RGUMENTS
nodes The terminals whose power injections are changed.
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.

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.

405
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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()

406
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Always return 1.

SetOldDistributeLoadMode
Set the old scaling mode in case of Distributed Slack by loads.
void ComLdf.SetOldDistributeLoadMode(int iOldMode)

A RGUMENTS
iOldMode The flag showing if the old model is used.

0 Use standard mode.


1 Use old mode.

3.4.22 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]
)

407
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

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) {

408
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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)

409
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

A RGUMENTS
enabled
0 Values are directly written to switches
1 For each value change a switch event will be created

3.4.23 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 Canceled 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()

410
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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]
)

411
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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”

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”

412
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
Set with matching objects.
Unmodified, modified and added objects are always from given “modSource”, removed ob-
jects are always from “Base” .

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.

413
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

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()

414
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 All objects in comparison are equal.
1 Modifications found in comparison.

3.4.24 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.

415
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.25 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();

416
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.

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.26 ComOmr
Overview

GetFeeders
GetOMR
GetRegionCount

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()

417
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.
int errCode,
numRegions,
isClass,
regIdx;
object comOmr,
feeder,

418
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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,
numRegions;
object comOmr,
feeder;
set feeders;

419
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.27 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 occured -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)

R ETURNS
1 if successfully received data -1 if an error occured -2 if the link is not connected

420
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.28 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.

E XAMPLE
The following example shows how to access elements in the table of all ComOutage whose
names start with “L”.

421
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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');
! 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

422
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

423
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.29 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.30 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.31 ComPython
Overview

GetExternalObject*
GetInputParameterDouble*
GetInputParameterInt*
GetInputParameterString*
SetExternalObject
SetInputParameterDouble
SetInputParameterInt
SetInputParameterString

GetExternalObject*
Gets the external object defined in the ComPython edit dialog.
int ComPython.GetExternalObject(string name,
object& value)

424
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
0 On success.
1 On error.

425
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

SetInputParameterDouble
Sets the double input parameter value defined in the ComPython edit dialog.
int ComPython.SetInputParameterDouble(string name,
double value
)

426
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

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.

R ETURNS
0 On success.
1 On error.

427
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

S EE ALSO

ComPython.GetInputParameterString(), ComPython.SetInputParameterInt(),
ComPython.SetInputParameterDouble(), ComPython.SetExternalObject()

3.4.32 ComRed
Overview

ReductionInMemory
ResetReductionInMemory

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

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

428
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.33 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)
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])

429
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

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.

430
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

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.

3.4.34 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).

431
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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();
}

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.35 ComRelreport
Overview

GetContingencies*
GetContributionOfComponent

GetContingencies*
Gets all contingencies of reliability for reporting.

432
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

set ComRelpost.GetContingencies()

R ETURNS
All contingencies of reliability for reporting.

GetContributionOfComponent
Is described in ComRelpost.GetContributionOfComponent().
double ComRelreport.GetContributionOfComponent(int componentNr,
string indice)

3.4.36 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,
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.

433
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.37 ComShc
Overview

ExecuteRXSweep
GetFaultType*
GetOverLoadedBranches
GetOverLoadedBuses

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

434
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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();
}
}

435
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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) {
printf('Overloaded bus: %o \n', oBus);
oBus = sBus.Next();
}
}

3.4.38 ComShctrace
Overview

BlockSwitch
ExecuteAllSteps
ExecuteInitialStep
ExecuteNextStep
GetBlockedSwitches
GetCurrentTimeStep
GetDeviceSwitches
GetDeviceTime
GetNonStartedDevices
GetStartedDevices
GetSwitchTime
GetTrippedDevices
NextStepAvailable

436
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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 occourred, trace is complete.
!=0 An error occurred, calculation was reset.

S EE ALSO

ComShctrce.ExecuteInitialStep()

ExecuteInitialStep
Executes the first step of the short circuit trace.
int ComShctrace.ExecuteInitialStep()

R ETURNS
0 No error occourred, 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 occourred, step was executed .
!=0 An error occurred, calculation was reset.

437
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

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()

438
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

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.

439
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

3.4.39 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.

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.

440
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

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)

441
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

R ETURNS
0 OK
1 Error

3.4.40 ComSimoutage
Overview

AddCntcy
AddContingencies
AddRas
ClearCont
CreateFaultCase
Execute
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
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();
}

442
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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]
)

443
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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 elemnts 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.

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)

444
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

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 succesfully 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.

445
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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()

R ETURNS
0 On success.
1 On error.

3.4.41 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

446
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

3.4.42 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.43 ComTablereport
Overview

AddButton
AddCellAction
AddColumn
AddCurve
AddHeader
AddInvisibleFilter
AddListFilter
AddListFilterEntries
AddMultiListFilter
AddPlot
AddRow
AddTable
AddTabularFilter

447
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

AddTextFilter
AddXLabel
ClearAll
DisableAutomaticRowNumbering
DisableSingleFilterRefresh
DisplayButtonsCollapsible
DisplayFiltersCollapsible
DisplayFiltersIn2Columns
DisplayHeadersCollapsible
EnableAutomaticRowNumbering
ExportToExcel
ExportToHTML
FindNextCell
FindNextRow
FindPreviousCell
FindPreviousRow
GetCellAccessObject
GetCellEditObjects
GetCellValueType
GetCheckboxCellValue
GetColumnFilter
GetColumnHeader
GetColumnId
GetDateCellValue
GetDoubleCellValue
GetIntCellValue
GetNumberOfColumns
GetNumberOfRows
GetNumberOfSelectedCells
GetObjectCellValue
GetRowId
GetSelectedCell
GetSelectedElements
GetSelection
GetStringCellValue
GoToCell
HasCell
IsRowVisible
RemoveRow
SetBarLimits
SetCellAccess
SetCellEdit
SetCellValueToBar
SetCellValueToCheckbox
SetCellValueToDate
SetCellValueToDouble
SetCellValueToInt
SetCellValueToObject
SetCellValueToString
SetColumnHeader
SetCurveValue
SetDialogSize
SetExportHtml
SetExportXls
SetListFilterSelection
SetNumberFormatForPlot

448
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]
)

449
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 exists.
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)

450
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
)

451
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

452
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

453
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

454
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');

AddTabularFilter
Adds a tabular filter to the report.

455
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.

456
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])

457
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 exists.
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)

458
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

459
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
)

460
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)

461
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.

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.

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

462
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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.

463
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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 to be set
captionId (out)
Text that is displayed in the column header (lines separated by '\n')

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.

464
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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
)

465
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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]
)

466
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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.

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

467
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.

468
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
)

469
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.

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
0 The row is invisible or not defined.
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();
}

report.AddTable('table');

470
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

471
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)

472
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:

473
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

474
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

475
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

476
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

477
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

478
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')

479
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) {

480
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.

481
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

482
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
)

483
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');

3.4.44 ComTasks
Overview

AppendCommand
AppendStudyCase
RemoveCmdsForStudyCaseRow
RemoveStudyCases
SetResultsFolder

AppendCommand
Appends a command for calculation.
int ComTasks.AppendCommand(object command,

484
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

[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');
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.

485
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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);
}
}
}

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
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');

486
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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');
}
}
}

RemoveStudyCases
Removes all selected study cases from calculation.
void ComTasks.RemoveStudyCases()

E XAMPLE
Int this example we remove all selected study cases from the list of study cases for calcula-
tion.
object comTasks,
casesFolder;
set commands;

casesFolder = GetProjectFolder('study');
commands = casesFolder.GetContents('*.ComTasks');
if (commands.Count()=1) {
comTasks = commands.First();
if (comTasks<>nullptr) {
comTasks.RemoveStudyCases();
}
}

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.

487
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.45 ComTececo
Overview

UpdateTablesByCalcPeriod

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;

488
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.46 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);
}
}

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 resulted in a feasible solution.

489
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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.47 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.

3.4.48 ComUcteexp
Overview

BuildNodeNames
DeleteCompleteQuickAccess
ExportAndInitQuickAccess
GetConnectedBranches
GetFromToNodeNames
GetOrderCode
GetUcteNodeName
InitQuickAccess
QuickAccessAvailable
ResetQuickAccess
SetGridSelection
490
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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');
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.

491
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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)

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);

492
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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


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])

493
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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);
}

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)

494
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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
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);

495
3.4. COMMANDS CHAPTER 3. OBJECT METHODS

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

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.
void ComUcteexp.QuickAccessAvailable([int cacheIndex])

496
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)

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])

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.

497
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.

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.

498
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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);
}

3.5.2 SetColscheme
Overview

CreateFilter
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)

499
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 Contingenciy 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.

SetColouring
Sets colouring for given or currently valid calculation.
int SetColscheme.SetColouring(string page,
int energizing,
[int alarm,]
[int normal]
)

500
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

A RGUMENTS
page
empty set for currentlx valid calculation
set page for which modes are set (see table below)
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)

501
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 Contingenciy 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

502
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Table 3.5.6

Alarm Name ”alarm” value


Voltage Violations / Overloading 29
Outages 31
Overloading of Thermal / Peak Short Circuit Current 32
Feeder Radiality Check 38

503
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
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 Results 60
504
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 SetDesktop
Overview

AddPage
DoAutoScaleX
GetCanvasSize
GetPage
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetXVar
Show
WriteWMF
ZoomAll

505
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 SetVipage (virtual instrument panel): 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 = GetGraphBoard();
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();
}

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()

E XAMPLE
The following example performs an automatic scaling of x.
object graphBoard;
! Look for opened graphics board.
graphBoard=GetGraphBoard();
if (graphBoard) {
graphBoard.DoAutoScaleX();
}

GetCanvasSize
Returns the pixel dimensions of the currently active (top-most) graphic page.

506
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

GetPage
Searches, activates and returns a graphics page in the currently open graphics board. If “create”
is true, then a new virtual instrument panel will be created and added to the graphics board if
no page with name was found.
object SetDesktop.GetPage(string name,
[int create]
)

A RGUMENTS
name Name of the page.
create (optional)
Possible values:
0 do not create new virtual instrument panel
1 create panel if it does not exist already

R ETURNS
Virtual instrument panel (SetVipage)

E XAMPLE
The following example looks for the virtual instrument panels named 'Voltage', 'Current' and
'Power' in the graphics board currently open. The virtual instrument panels are created if they
do not exist.
object graphBoard;
object pageVoltage;
object pageCurrent;
object pagePower;
! Look for opened graphics board.
graphBoard=GetGraphBoard();
if (graphBoard) {
! Search or create Virtual Instrument Panels
pageVoltage=graphBoard.GetPage('Voltage',1);
pageCurrent=graphBoard.GetPage('Current',1);
pagePower=graphBoard.GetPage('Power',1);
}

507
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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
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=GetGraphBoard(); ! Look for open graphics board.
if (graphBoard) {
! Turn off automatic scaling
graphBoard.SetAutoScaleX(0);
}

508
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! Look for open graphics board.
if (graphBoard) {
graphBoard.SetResults(Results);
}

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=GetGraphBoard(); ! Look for open graphics board.
if (graphBoard) {
graphBoard.SetScaleX();! Automatic Scaling to On
}
! Set minimum and maximum without changing linear/log

509
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

object graphBoard;
graphBoard=GetGraphBoard(); ! 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=GetGraphBoard(); ! Look for open graphics board.
if (graphBoard) {
! Set minimum and maximum
graphBoard.SetScaleX(1,1000,1);
}

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=GetGraphBoard(); ! Look for open desktop.
if (graphBoard) {
graphBoard.SetXVar(line,'m:U1:bus1');
}

! set default x-axis variable


object graphBoard;
graphBoard=GetGraphBoard(); ! 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

510
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

'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)

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 = GetGraphBoard();
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();
}
}

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.

E XAMPLE
The following example exports the open graphic to a windows metafile.
object graphicsBoard;
graphicsBoard = GetGraphBoard();
if (graphicsBoard) {

511
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.4 SetDistrstate
Overview

CalcCluster

CalcCluster
Calculates a load flow with a given load distribution state applied.
int SetDistrstate.CalcCluster(double arg0,
[double arg1]
)

A RGUMENTS
clusterIndex
The number of the load cluster - 1

emitMessage (optional)
Emit messages if not equal to zero

R ETURNS
0 if ok. -1 if load flow of cluster did not converge.

3.5.5 SetFilt
Overview

Get*

Get*
Returns a container with the filtered objects.
set SetFilt.Get()

512
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

R ETURNS
The set of filtered objects.

3.5.6 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

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.

513
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

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

514
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.7 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)

515
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.

R ETURNS
0 the data will be transferred via socket communication.
1 the data will be transferred via file.

3.5.8 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.

516
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.
list 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)

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');

517
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

518
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.

3.5.9 SetSelect
Overview

AddRef*
All*
AllAsm*
AllBars*
AllBreakers*
AllClosedBreakers*
AllElm*
AllLines*
AllLoads*
AllOpenBreakers*
AllSym*
AllTypLne*
Clear
GetAll*

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”.

519
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

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();
}

520
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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();
}

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.

521
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

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();
}

522
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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();
}

AllSym*
Returns all synchronous machines in the selection.
set SetSelect.AllSym()

R ETURNS
The set of objects

523
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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()

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);

524
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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.10 SetTboxconfig
Overview

Check
GetAvailableButtons
GetDisplayedButtons
Purge
SetDisplayedButtons

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()

525
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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'

R ETURNS
0 Given buttons were stored without modification.
1 Given buttons were purged from invalid or duplicate ids.

3.5.11 SetTime
Overview

Date
SetTime
SetTimeUTC
Time

526
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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

527
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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()

3.5.12 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) {

528
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

Error('No user setting object found.');


exit();
}
numProcesses = oUserSetting.GetNumProcesses();
Info('%d processes will be used in parallel computation.', numProcesses);

3.5.13 SetVipage
Overview

DoAutoScaleX
DoAutoScaleY
GetOrInsertPlot
InsertPlot
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetStyle
SetTile
SetXVar

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=GetGraphBoard();
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.

529
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

object page;
object graphBoard;
graphBoard=GetGraphBoard();
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1);
if (page) {
page.DoAutoScaleY();
}
}

GetOrInsertPlot
Get or create a virtual instruments 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=GetGraphBoard(); ! 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);
}
}

530
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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*').

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 = GetGraphBoard();
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

SetAdaptX
Sets the Adapt Scale option of the x-scale.
void SetVipage.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 examples look for a virtual instrument panel named 'Voltage' and sets its adapt
scale option.
object page;
object graphBoard;
graphBoard=GetGraphBoard(); ! 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

531
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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);
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.

532
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

object graphBoard;
object page;
! Look for open graphics board.
graphBoard=GetGraphBoard();
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

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=GetGraphBoard(); ! 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=GetGraphBoard(); ! Look for open graphics board.

533
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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

E XAMPLE
The following example looks for a virtual instrument panel named 'Voltage' and sets its style
to 'Paper'.
object desktop;
object page;
desktop=GetGraphBoard(); ! get SetDesktop currently being open
if (desktop) {
page=desktop.GetPage('Voltage',1);! get panel named 'Voltage'.
if (page) {
page.SetStyle('Paper');! Set style of panel to the one named 'Paper'
}
}

SetTile
Rearranges the virtual instrument on the panel.
void SetVipage.SetTile([int tile])

534
3.5. SETTINGS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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');
}
}

! set default x-axis variable


object graphBoard;
object page;

535
3.6. OTHERS CHAPTER 3. OBJECT METHODS

graphBoard=GetGraphBoard(); ! 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();
}
}

3.6 Others

3.6.1 BlkDef
Overview

Compile
Encrypt
GetCheckSum
Pack
PackAsMacro
ResetThirdPartyModule
SetThirdPartyModule

Compile
Compiles the model to a DLL. Can be called on an already compiled model.
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.

536
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

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()

537
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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(const char* companyCode, const char* 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.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.

538
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

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()

3.6.5 CimModel
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetModelsReferencingThis
GetParameterCount
GetParameterNamespace
GetParameterValue
HasParameter
RemoveParameter
SetAssociationValue
SetAssociationValue
SetAttributeEnumeration
SetAttributeEnumeration

539
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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.

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”)

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
string CimModel.GetParameterNamespace(string parameter)

540
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.profile”)

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

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

RemoveParameter
Removes all occurences 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.modelingAuthoritySet”)

541
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

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”)

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”)

542
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 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

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”)

543
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.6 CimObject
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetObjectsReferencingThis
GetObjectsWithSameId
GetParameterCount
GetParameterNamespace
GetParameterValue
GetPfObjects
HasParameter
RemoveParameter
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 specifier of the attribute, or association (e.g. ”Model.profile”)

index Index of the parameter

GetAttributeEnumerationType
Returns the enumeration type of the attribute.
string CimObject.GetAttributeEnumerationType(string attribute)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”GeneratingUnit.genControlSource”)

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()

544
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
CIM objects that reference the calling object. The order of the set is undefined.

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.

GetParameterCount
Returns the number of parameters (attribute, or association) of given type.
int CimObject.GetParameterCount(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”Model.profile”)

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
string CimObject.GetParameterNamespace(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”IdentifiedObject.name”)

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 specifier of the attribute, or association (e.g. ”IdentifiedObject.name”)

index Index of the parameter:


0 Default index

545
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

HasParameter
Checks whether the CimObject has the parameter (attribute, or association) specified.
int CimObject.HasParameter(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”IdentifiedObject.name”)

R ETURNS
1 if parameter is specified
0 if parameter is not specified

RemoveParameter
Removes all occurences of the parameter (attribute, or association).
void CimObject.RemoveParameter(string parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”IdentifiedObject.name”)

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 specifier of the association (e.g. ”Equipment.EquipmentContainer”)
value Value of the association

index Index of the association:


0 Default index

546
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 specifier of the association (e.g. ”Equipment.EquipmentContainer”)
value Value of the association

nspace Namespace of the association (e.g. ”cim”)

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 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 CimObject.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”)

547
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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])

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”IdentifiedObject.name”)
value Value of the attribute

index Index of the attribute:


0 Default index

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 specifier of the attribute (e.g. ”IdentifiedObject.name”)

value Value of the attribute


nspace Namespace of the attribute (e.g. ”cim”)

3.6.7 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

548
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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()

549
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
dateTime Seconds since 01.01.1970 00:00:00.

3.6.8 IntComtrade
Overview

ConvertToASCIIFormat*
ConvertToBinaryFormat*
FindColumn*
FindMaxInColumn
FindMinInColumn
GetAnalogueDescriptions
GetDescription
GetDigitalDescriptions
GetNumberOfAnalogueSignalDescriptions
GetNumberOfColumns
GetNumberOfDigitalSignalDescriptions
GetNumberOfRows
GetSignalHeader
GetUnit
GetValue
GetVariable
Load
Release
SortAccordingToColumn

550
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 occured, 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.
1 Error occured, 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();

551
3.6. OTHERS CHAPTER 3. OBJECT METHODS

}
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.

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) {

552
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

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.

GetDescription
Get the description of a column.
string IntComtrade.GetDescription([int column],
[int short]
)

553
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

554
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

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.

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()

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.

555
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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, the value is invalid in case that it was not written, bcause 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.

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,

556
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

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

557
3.6. OTHERS 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 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;
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;

558
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;
}
}
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();

3.6.9 IntComtradeset
Overview

FindColumn*
FindMaxInColumn
FindMinInColumn
GetAnalogueDescriptions
GetDescription
GetDigitalDescriptions
GetNumberOfAnalogueSignalDescriptions
GetNumberOfColumns
GetNumberOfDigitalSignalDescriptions
GetNumberOfRows
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.

559
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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);
! 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;

560
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 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)

561
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
index) Digital channel index

R ETURNS
Descriptions for analogue channel in the comtrade info file.

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()

562
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.

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

563
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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])

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, the value is invalid in case that it was not written, bcause 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])

564
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 (IntComtradeset) in memory for reading.
void IntComtradeset.Load()

E XAMPLE
object case,
elmRes;
set resObjs;
int variables,rows;

565
3.6. OTHERS 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();
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.

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;

566
3.6. OTHERS 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();
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();

3.6.10 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)

567
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

A RGUMENTS
className
class name filter, e.g. ElmTerm

R ETURNS
All objects of given class stored in dataset object.

3.6.11 IntDplmap
Overview

Clear*
Contains*
First*
GetValue*
Insert*
Next*
Remove*
Size*
Update*

568
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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:

569
3.6. OTHERS CHAPTER 3. OBJECT METHODS

!'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);
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;

570
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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){
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);

571
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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();
}
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');

572
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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();
}
}

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:

573
3.6. OTHERS CHAPTER 3. OBJECT METHODS

• 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.

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)

574
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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().

3.6.12 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();

575
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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) {
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();

576
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.

577
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.13 IntEvt
Overview

CreateCBEvents
RemoveSwitchEvents

578
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.14 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

579
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.15 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.16 IntGrf
Overview

MoveToLayer

MoveToLayer
Moves an annotation element stored as IntGrf object to an annotation layer (IntGrflayer ) or
group (IntGrfgroup).
void IntGrf.MoveToLayer(object layer)

A RGUMENTS
layer Target IntGrflayer or IntGrfgroup object.

580
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.17 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);
}

581
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.18 IntGrflayer
Overview

ClearData
Export
ExportToVec
Import
ImportFromVec

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, inclusive annotation objects of contained group
objects.
void IntGrflayer.Export(string path,
[int OpenDialog])

582
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 layer into an IntDplvec. Clears IntDplvec
before filling it.
void IntGrflayer.ExportToVec(object intDplVec)

A RGUMENTS
intDplVec IntDplvec object to be filled.

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 into layer.
void IntGrflayer.Import(string path)

A RGUMENTS
path Path of file to be imported.

ImportFromVec
Fills this layer with the string description of annotation elements from an IntDplvec. Clears layer
before filling it.
void IntGrflayer.ImportFromVec(object intDplVec)

583
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

3.6.19 IntGrfnet
Overview

SetLayerVisibility
SetSymbolComponentVisibility
Show

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.

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)

584
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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);

grfnet = objs.First();
if (.not. grfnet) {
Error('No diagram found!');
exit();
}

err = grfnet.Show();
printf('%o.Show() returned %d', grfnet, err);

3.6.20 IntIcon
Overview

Export
Import

585
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

3.6.21 IntMat
Overview

ColLbl*
Get*
GetColumnLabel*
GetNumberOfColumns*
GetNumberOfRows*
GetRowLabel*
Init*
Invert*
Multiply*
Resize*
RowLbl*
Save*
Set*
SetColumnLabel*
SetRowLabel*
SortToColumn*

586
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;
}

587
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.GetRowLabel()

E XAMPLE
The following example assigns the label of the first column to the string label
string label;
label = Mat.GetColumnLabel(1);

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

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

588
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.GetColumnLabel()

E XAMPLE
The following example assigns the label of the first row to the string label
string label;
label = Mat.GetRowLabel(1);

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 ommited.

589
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

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.

590
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.
initialValue (optional)
Initial values: Additional matrix entries are initialised with this value. Additional
values are initialized with 0. if ommited.

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.
void IntMat.Save()

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
)

591
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
row Row index, 1 based. The first row has index 1. Invalid index (leq0) leads to
scripting error.
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.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
)

592
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
row Row index (first row has index 1).
label Label to set.

S EE ALSO

IntMat.GetRowLabel(), 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.

593
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.22 IntMon
Overview

AddVar
ClearVars
GetVar*
NVars*
PrintAllVal*
PrintVal*
RemoveVar

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.

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;

594
3.6. OTHERS CHAPTER 3. OBJECT METHODS

set tmp;
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,

595
3.6. OTHERS CHAPTER 3. OBJECT METHODS

ldf;
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)

596
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
name The variable name.

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.23 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

597
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.

IsInStudyTime*
int IntOutage.IsInStudyTime()

598
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.24 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.

599
3.6. OTHERS CHAPTER 3. OBJECT METHODS

! Modify adapt scale option of Plot Type


object page;
object graphBoard;
object plot;
object scale;
graphBoard=GetGraphBoard(); ! 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)

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=GetGraphBoard(); ! 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);
}
}
}
}

600
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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=GetGraphBoard(); ! 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);
}
}
}
}

601
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.25 IntPrj
Overview

Activate
AddProjectToCombined
AddProjectToRemoteDatabase
Archive
CanAddProjectToRemoteDatabase
CanSubscribeProjectReadOnly
CanSubscribeProjectReadWrite
CopyDataExtensionFrom
CreateVersion
Deactivate
GetDerivedProjects
GetExternalReferences
GetGeoCoordinateSystem
GetLatestVersion
GetVersions
HasExternalReferences
LoadData
Migrate
NormaliseCombined
PackExternalReferences
Purge
RemoveProjectFromCombined
Restore
SetGeoCoordinateSystem
SubscribeProjectReadOnly
SubscribeProjectReadWrite
TransformGeoCoordinates
UnsubscribeProject
UpdateStatistics

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

602
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

R ETURNS
0 project has been archived
1 project has not been archived

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()

603
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 no permission to subscribe project
1 project can be subscribed

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 sucessfully
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,
[string name = '',]
[int timestamp = 0,]
[string description = '']
)

A RGUMENTS
name Version name. The default version name e.g. ’Priject 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:

604
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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 (in/out)
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 ommited.

605
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Getting external references succeeded.
1 Getting external references canceled 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()

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]

606
3.6. OTHERS CHAPTER 3. OBJECT METHODS

)
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.

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()

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])

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)

607
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 canceled 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 ommited.

R ETURNS
0 Packing external references succeeded.
1 Packing external references canceled 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()

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

608
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

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.

609
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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()

3.6.26 IntPrjfolder
Overview

GetProjectFolderType*
IsProjectFolderType*

610
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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
• 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
• mvar - Mvar Limit Curves
• netdat - Network Data
• netmod - Network Model
• oplib - Operational Library
• outage - Outages
• qpc - QP-Curves
• ra - Running Arrangements
• report - Table Reports
• scen - Operation Scenarios
• scheme - Variations
• script - Scripts
• study - Study Cases
• sw - StationWare
• tariff - Tariffs
• templ - Templates
• therm - Thermal Ratings

string IntPrjfolder.GetProjectFolderType()

R ETURNS
The type of the project folder as string. For possible return values see list above.

611
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.27 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,
[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:
0 minimum value. This is the default value
1 maximum 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.

612
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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);
}
}
}

3.6.28 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)

613
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

3.6.29 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 arrangment


0 Switch is open
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;

614
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.30 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

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)

615
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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])

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()

616
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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

617
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.SetOperationData(double newvalue,
object obj,
string attribute,
[int toObject]
)
int IntScenario.SetOperationData(int newvalue,
object obj,
string attribute,
[int toObject]
)
int IntScenario.SetOperationData(string newvalue,
object obj,
string attribute,
[int toObject]
)
int IntScenario.SetOperationData(object newvalue,
object obj,
string attribute,
[int toObject]
)

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 (default), as 0 but value is also updated on object in memory

R ETURNS
0 on success

618
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.31 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)

A RGUMENTS
iTime Time (UCTE) to get the corresponding scenario.

619
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
NULL No scenario at time 'iTime'defined
IntScenario Scenario will be activated at time 'iTime'

GetStartEndTime*
Gets the 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).

3.6.32 IntScheme
Overview

Activate
Consolidate
Deactivate
GetActiveScheduler*
NewStage

620
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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
)

621
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.33 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

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()

622
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
=0 On success
6= 0 If an error has occurred

3.6.34 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.

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.

623
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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) {

624
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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]
)

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.

625
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.35 IntSubset
Overview

Apply
ApplySelective
Clear

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

626
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.

3.6.36 IntThrating
Overview

GetCriticalTimePhase*
GetRating*

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 %.

627
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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) {
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);
}

628
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.37 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.38 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.
void IntUser.SetPassword(string newpassword)

R ETURNS
Returns whether or not the password has successfully been set. Possible values are:

0 error
1 password set successfully

629
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
newpassword
Case sensitive user password to set

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.39 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)

630
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.40 IntVec
Overview

Get*
Init*
Max*
Mean*
Min*
Resize*
Save*
Set*
Size*
Sort*

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.

631
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

R ETURNS
The minimum value stored in the vector. Empty vectors return 0 as minimum value.

632
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.
void IntVec.Save()

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()

633
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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 descending = 0])

A RGUMENTS
descending
Sort order:
0 Smallest value first (ascending, default).
1 Highest value first (descending).

E XAMPLE
The following script fills a vector and reports the initial values, the values after sorting in rising
order and finally in descreasing order.
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(0); ! sort increasing

634
3.6. OTHERS CHAPTER 3. OBJECT METHODS

for (row=1; row<=size; row+=1) {


value = vectorObj.Get(row);
printf('%d: %f',row,value);
}
Info('Decreasing');
vectorObj.Sort(1); ! sort descreasing
for (row=1; row<=size; row+=1) {
value = vectorObj.Get(row);
printf('%d: %f',row,value);
}

3.6.41 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) {
Error('no version found');
exit();
}

derivedProject = version.CreateDerivedProject('DerivedProject');

635
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

R ETURNS
0 on success
1 otherwise

636
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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.42 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.43 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 sucessfully calculated.
1 An error occourred (e.g. conencted branch was not found).

AssumeReRl
Triggers a calculation of the real part of the decoupled compensation factor and stores the
result.

637
3.6. OTHERS CHAPTER 3. OBJECT METHODS

int RelZpol.AssumeReRl()

R ETURNS
0 The compensation factor was sucessfully calculated.
1 An error occourred (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 sucessfully calculated.
1 An error occourred (e.g. conencted branch was not found).

3.6.44 ScnFreq
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

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()

638
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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

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.

639
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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));
printf('%o',oRef.GetViolatedElement(violation));
printf('%s',oRef.GetVariable(violation));
printf('%f',oRef.GetValue(violation));
printf('%f',oRef.GetLimit(violation));
}
}

3.6.45 ScnFrt
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

640
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

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

641
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 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

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.46 ScnSpeed
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

642
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

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

643
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 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

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.47 ScnSync
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

644
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

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

645
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 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

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.48 ScnVar
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

646
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

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

647
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 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

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.49 ScnVolt
Overview

GetLimit*
GetNumberOfViolations*
GetValue*
GetVariable*
GetViolatedElement*
GetViolationTime*

648
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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)

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

649
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 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

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.50 StoMaint
Overview

SetElms

SetElms
Sets the maintenance elements.
void StoMaint.SetElms(object singleElement)
void StoMaint.SetElms(set multipleElements)

650
3.6. OTHERS CHAPTER 3. OBJECT METHODS

A RGUMENTS
singleElement
single Element for Maintenance
multipleElements
multiple Elements for Maintenance

3.6.51 TypAsmo
Overview

CalcElParams

CalcElParams
Function calculates the electrical parameters from the input data. Behaves identically as the cal-
culate button on the basic data page was pressed. Shall be applied only if the ’Slip-Torque/Current
Characteristic’ chosen.
int TypAsm.CalcElParams()

R ETURNS
0 Calculated successfully.
1 Error.

3.6.52 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();

651
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.53 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.

652
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(const char* companyCode, const char* 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.54 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
)

653
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.55 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=GetGraphBoard(); ! 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 analyis plot

654
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=GetGraphBoard(); ! 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 analyis 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.

655
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object page;
object graphBoard;
object plot;
graphBoard=GetGraphBoard(); ! 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 analyis 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=GetGraphBoard(); ! 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 analyis plot
if (plot) {
plot.SetScaleY(1.,1000.,1);
}
}
}

656
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=GetGraphBoard(); ! 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 analyis 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=GetGraphBoard(); ! 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 analyis plot

657
3.6. OTHERS CHAPTER 3. OBJECT METHODS

if (plot) {
plot.SetYVariable('m:u:bu1');
}
}
}

3.6.56 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.

658
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()

659
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.57 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=GetGraphBoard(); ! 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();
}
}
}

660
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();
}
}
}

661
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! Look for open graphics board.
if (graphBoard) {

662
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=GetGraphBoard(); ! 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

663
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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)

664
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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()

665
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=GetGraphBoard(); ! 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.58 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)

666
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.59 VisOcplot
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY
Refresh

667
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()

668
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.60 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=GetGraphBoard(); ! 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

669
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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

670
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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
)

671
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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 analyis plot
if (plot) {

672
3.6. OTHERS CHAPTER 3. OBJECT METHODS

plot.SetScaleY(1.,1000.,1);
}
}
}

3.6.61 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()

673
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.62 VisPlot
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY
GetDataSource
GetIntCalcres
GetScaleObjX
GetScaleObjY
SetAdaptX
SetAdaptY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY
SetScaleX
SetScaleY
SetXVar

674
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, classanme 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=GetGraphBoard(); ! 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=GetGraphBoard(); ! Look for open desktop.
if (graphBoard) {
page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'

675
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();

676
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=GetGraphBoard(); ! 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.

677
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object dataSource;
object page;
object graphBoard;
object plot;
graphBoard=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();
}
}
}

678
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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

679
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=GetGraphBoard(); ! 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)

680
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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);
}
}
}

681
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();
}
}
}

682
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=GetGraphBoard(); ! 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;

683
3.6. OTHERS CHAPTER 3. OBJECT METHODS

graphBoard=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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.

684
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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


}
}
}

685
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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)
}
}
}

686
3.6. OTHERS CHAPTER 3. OBJECT METHODS

3.6.63 VisPlot2
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY
DoAutoScaleY2
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]
)
)

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=GetGraphBoard(); ! Look for open desktop.
if (graphBoard) {

687
3.6. OTHERS CHAPTER 3. OBJECT METHODS

page=graphBoard.GetPage('Voltage',1); ! Get panel named 'voltage'


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]
)
)

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=GetGraphBoard(); ! 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])

688
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();
}
}
}

689
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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();
}
}
}

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=GetGraphBoard(); ! 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();
}
}
}

690
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=GetGraphBoard(); ! 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'.

691
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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();
}
}
}

SetAdaptX
Sets the Adapt Scale option of the local x-scale.
void VisPlot2.SetAdaptX(int mode,

692
3.6. OTHERS CHAPTER 3. OBJECT METHODS

[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=GetGraphBoard(); ! 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

693
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=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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 automatic scaling mode of the y-scale. The axis given in the second argument is automat-
ically set to local.

694
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard();
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

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=GetGraphBoard(); ! Look for open graphics board.

695
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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

E XAMPLE
The following example gets the plot and sets the y-scale to the plot type.
object graphBoard;
object page;
object plot;
graphBoard=GetGraphBoard(); ! Look for open desktop.
if (graphBoard) {

696
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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(); ! set auto scale mode to On
}
}
}

! Set minimum and maximum without changing linear/log


object graphBoard;
object page;

697
3.6. OTHERS CHAPTER 3. OBJECT METHODS

object plot;
graphBoard=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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:
0 linear
1 logarithmic
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

698
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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 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 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=GetGraphBoard(); ! 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(line,'m:U1:bus1'); ! Set x-scale variable
}
}
}
! set default x-axis variable
object graphBoard;
object page;
object plot;

699
3.6. OTHERS CHAPTER 3. OBJECT METHODS

graphBoard=GetGraphBoard(); ! 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=GetGraphBoard(); ! 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);
}
}
}

3.6.64 VisPlottz
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY

700
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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()

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()

701
3.6. OTHERS CHAPTER 3. OBJECT METHODS

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

3.6.65 VisVec
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
void VisVec.CentreOrigin()

3.6.66 VisVecres
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
void VisVecres.CentreOrigin()

3.6.67 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=GetGraphBoard(); ! Look for open graphics board.

702
3.6. OTHERS CHAPTER 3. OBJECT METHODS

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=GetGraphBoard(); ! 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.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;

703
3.6. OTHERS CHAPTER 3. OBJECT METHODS

graphBoard=GetGraphBoard(); ! 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

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=GetGraphBoard(); ! 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)

704
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=GetGraphBoard(); ! 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)

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=GetGraphBoard(); ! 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');
}
}
}

705
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.

706
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.

707
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.

708
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()

709
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.

710
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.

711
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]
)

712
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();
}

713
Index

abs AddInvisibleFilter
Mathematical Functions, 64 ComTablereport, 452
acos AddListFilter
Mathematical Functions, 64 ComTablereport, 452
Activate AddListFilterEntries
ElmNet, 210 ComTablereport, 453
IntCase, 548 AddMultiListFilter
IntPrj, 602 ComTablereport, 453
IntScenario, 615 AddObjs
IntScensched, 619 VisBdia, 654
IntScheme, 621 AddPage
IntSscheduler, 622 SetDesktop, 506
IntSstage, 623 AddPlot
ActivateProject ComTablereport, 454
Global Functions, 3 AddProjectToCombined
ActiveCase IntPrj, 602
Global Functions, 9 AddProjectToRemoteDatabase
ActiveProject IntPrj, 603
Global Functions, 8 AddRas
AdaptWidth ComSimoutage, 443
SetLevelvis, 513 AddRef
Add ComNmink, 416
Set Routines, 706 IntDataset, 567
AddBreaker SetSelect, 519
StaCubic, 288 AddRelay
AddButton VisDraw, 658
ComTablereport, 449 VisMagndiffplt, 666
AddCellAction VisOcplot, 668
ComTablereport, 449 VisPcompdiffplt, 673
AddCntcy VisPlottz, 701
ComSimoutage, 442 AddRelays
AddColumn VisDraw, 658
ComTablereport, 450 VisMagndiffplt, 666
AddContingencies VisOcplot, 668
ComSimoutage, 443 VisPcompdiffplt, 673
AddCopy VisPlottz, 701
General Object Methods, 132 AddResObjs
AddCubicle VisBdia, 655
ElmBoundary, 181 AddResVars
AddCurve VisPlot, 675
ComTablereport, 451 VisPlot2, 687
AddEvent AddRow
IntRas, 613 ComTablereport, 455
AddHeader AddTable
ComTablereport, 451 ComTablereport, 455

714
INDEX INDEX

AddTabularFilter ComTasks, 485


ComTablereport, 455 Apply
AddTextFilter ElmBmu, 180
ComTablereport, 456 IntOutage, 597
AddToUpdatePages IntScenario, 615
ComProtgraphic, 424 IntSubset, 626
AddTrigger ApplyAll
IntGate, 580 IntOutage, 597
IntRas, 613 ApplyAndResetRA
AddVar ElmSubstat, 245
IntMon, 594 ApplyNetworkState
AddVariable IntCase, 549
ElmRes, 222 ApplySelective
AddVars IntScenario, 616
ElmRes, 222 IntSubset, 627
VisPlot, 675 ApplyStudyTime
VisPlot2, 688 IntCase, 549
AddXLabel Archive
ComTablereport, 457 IntPrj, 603
Align AreDistParamsPossible
SetLevelvis, 513 ElmLne, 201
All asin
IntDataset, 568 Mathematical Functions, 64
SetSelect, 520 AssumeCompensationFactor
AllAsm RelZpol, 637
SetSelect, 520 AssumeReRl
AllBars RelZpol, 637
SetSelect, 521 AssumeXeXl
AllBreakers RelZpol, 638
SetPath, 516 atan2
SetSelect, 521 Mathematical Functions, 64
AllClosedBreakers atan
SetPath, 517 Mathematical Functions, 64
SetSelect, 521
AllElm BinaryAnd
SetSelect, 522 Mathematical Functions, 65
AllLines BinaryOr
SetSelect, 522 Mathematical Functions, 65
AllLoads BlkDef, 536
SetSelect, 523 CalculateCheckSum, 537
AllOpenBreakers Compile, 536
SetPath, 517 Encrypt, 536
SetSelect, 523 GetCheckSum, 537
AllProtectionDevices Pack, 537
SetPath, 517 PackAsMacro, 537
AllRelevant ResetThirdPartyModule, 537
Global Functions, 11 SetThirdPartyModule, 538
AllSym BlkSig, 538
SetSelect, 523 GetFromSigName, 538
AllTypLne GetToSigName, 538
SetSelect, 524 BlockSwitch
AnalyseElmRes ComShctrace, 437
ComRel3, 429 BuildExportStructure
AppendCommand ComUcteexp, 491
ComTasks, 484 BuildNodeNames
AppendStudyCase ComUcteexp, 491

715
INDEX INDEX

CalcAggrVarsInRadFeed CheckAssignments
ElmFeeder, 189 ComMerge, 410
CalcCluster CheckBbPath
SetCluster, 498 ElmBbone, 175
SetDistrstate, 512 CheckControllers
CalcContributions ComLdf, 404
ComRelpost, 431 CheckFileExists
CalcElParams File System Functions, 35
TypAsmo, 651 CheckRanges
CalcLdf ElmRelay, 216
ComLdf, 404 CheckSyntax
CalcMaxHostedPower ComDpl, 391
ComHostcap, 401 CheckUrl
CalcParams IntExtaccess, 579
ComLdf, 404 CimArchive, 539
CalcShiftedReversedBoundary ConvertToBusBranch, 539
ElmBoundary, 181 CimModel, 539
CalculateCheckSum DeleteParameterAtIndex, 540
BlkDef, 537 GetAttributeEnumerationType, 540
CalculateInterchangeTo GetModelsReferencingThis, 540
ElmArea, 167 GetParameterCount, 540
ElmNet, 211 GetParameterNamespace, 540
ElmZone, 284 GetParameterValue, 541
CalcWeibullPar HasParameter, 541
Mathematical Functions, 66 RemoveParameter, 541
CanAddProjectToRemoteDatabase SetAssociationValue, 542
IntPrj, 603 SetAttributeEnumeration, 542, 543
CanSubscribeProjectReadOnly SetAttributeValue, 543
IntPrj, 603 CimObject, 544
CanSubscribeProjectReadWrite DeleteParameterAtIndex, 544
IntPrj, 603 GetAttributeEnumerationType, 544
ceil GetObjectsReferencingThis, 544
Mathematical Functions, 67 GetObjectsWithSameId, 545
CentreOrigin GetParameterCount, 545
VisDraw, 659 GetParameterNamespace, 545
VisPcompdiffplt, 673 GetParameterValue, 545
VisVec, 702 GetPfObjects, 546
VisVecres, 702 HasParameter, 546
ChangeFont RemoveParameter, 546
SetLevelvis, 513 SetAssociationValue, 546, 547
ChangeFrameAndWidth SetAttributeEnumeration, 547
SetLevelvis, 513 SetAttributeValue, 548
ChangeLayer Clear
SetLevelvis, 514 ComNmink, 416
ChangeRefPoints ElmBoundary, 182
SetLevelvis, 514 ElmRes, 222
ChangeWidthVisibilityAndColour IntDataset, 568
SetLevelvis, 514 IntDplmap, 569
ChaVecfile, 539 IntDplvec, 575
Update, 539 IntSubset, 627
Check Set Routines, 707
ComAuditlog, 375 SetSelect, 524
IntOutage, 598 VisBdia, 655
SetTboxconfig, 525 VisDraw, 659
CheckAll VisHrm, 660
IntOutage, 598 VisMagndiffplt, 667

716
INDEX INDEX

VisOcplot, 668 GetActiveModule, 373


VisPath, 669 ModuleExists, 373
VisPcompdiffplt, 674 SetActiveModule, 374
VisPlot, 676 ComAmpacity, 374
VisPlot2, 688 ExecuteAmpacityCalc, 374
VisPlottz, 701 ComAuditlog, 375
VisXyplot, 702 Check, 375
ClearAll ComCapo, 375
ComTablereport, 457 ConnectShuntToBus, 375
ClearCommands LossCostAtBusTech, 376
Global Functions, 4 TotalLossCost, 377
ClearCont ComCheck, 378
ComSimoutage, 443 GetNextLoop, 378
ClearData ComCimdbexp, 379
IntGrfgroup, 581 Execute, 379
IntGrflayer, 582 ComCimdbimp, 379
ClearOutput Execute, 379
Output Window Functions, 116 ImportAndConvert, 380
ClearOutputWindow ComCimvalidate, 380
Output Window Functions, 116 Execute, 380
ClearRecycleBin GetClassType, 381
Global Functions, 4 GetDescriptionText, 381
ClearUpdatePages GetInputObject, 381
ComProtgraphic, 424 GetModel, 381
ClearVars GetModelId, 382
IntMon, 594 GetNumberOfValidationMessages, 382
Close GetObject, 382
ElmCoup, 186 GetObjectId, 382
ElmGndswt, 199 GetProfile, 383
ElmRes, 227 GetSeverity, 383
StaSwitch, 360 GetType, 383
CloseTableReports ComConreq, 383
Dialogue Boxes Functions, 50 Execute, 384
ColLbl ComContingency, 384
IntMat, 587, 588 ContinueTrace, 384
ComAddlabel, 362 CreateRecoveryInformation, 384
Execute, 362 GetGeneratorEvent, 385
ComAddon, 363 GetInterruptedPowerAndCustomersForStage,
CreateModule, 363 385
DefineDouble, 363 GetInterruptedPowerAndCustomersForTimeStep,
DefineDoubleMatrix, 364 386
DefineDoublePerConnection, 365 GetLoadEvent, 386
DefineDoubleVector, 365 GetNumberOfGeneratorEventsForTimeStep,
DefineDoubleVectorPerConnection, 366 387
DefineInteger, 366 GetNumberOfLoadEventsForTimeStep, 387
DefineIntegerPerConnection, 367 GetNumberOfSwitchEventsForTimeStep, 387
DefineIntegerVector, 368 GetNumberOfTimeSteps, 388
DefineIntegerVectorPerConnection, 368 GetObj, 388
DefineObject, 369 GetSwitchEvent, 388
DefineObjectPerConnection, 370 GetTimeOfStepInSeconds, 389
DefineObjectVector, 370 GetTotalInterruptedPower, 389
DefineObjectVectorPerConnection, 371 JumpToLastStep, 389
DefineString, 371 RemoveEvents, 389
DefineStringPerConnection, 372 StartTrace, 390
DeleteModule, 373 StopTrace, 390
FinaliseModule, 373 ComDiff, 390

717
INDEX INDEX

Start, 390 SetMicroSCADAStatus, 409


Stop, 390 SetOPCReceiveQuality, 409
ComDllmanager, 391 SetSwitchShcEventMode, 409
Report, 391 Commands Methods, 362
ComDpl, 391 Execute, 362
CheckSyntax, 391 ComMerge, 410
Encrypt, 391 CheckAssignments, 410
Execute, 392 Compare, 410
GetExternalObject, 393 CompareActive, 411
GetInputParameterDouble, 393 ExecuteRecording, 411
GetInputParameterInt, 394 ExecuteWithActiveProject, 411
GetInputParameterString, 394 GetCorrespondingObject, 411
IsEncrypted, 395 GetModification, 411
ResetThirdPartyModule, 395 GetModificationResult, 412
SetExternalObject, 395 GetModifiedObjects, 412
SetInputParameterDouble, 396 Merge, 413
SetInputParameterInt, 396 PrintComparisonReport, 413
SetInputParameterString, 397 PrintModifications, 413
SetResultString, 397 Reset, 414
SetThirdPartyModule, 397 SetAutoAssignmentForAll, 414
ComFlickermeter, 398 SetObjectsToCompare, 414
Execute, 398 ShowBrowser, 414
ComGenrelinc, 398 WereModificationsFound, 414
GetCurrentIteration, 398 CommitTransaction
GetMaxNumIterations, 399 Global Functions, 4
ComGridtocim, 399 CommitTx
ConvertAndExport, 400 Global Functions, 4
SetAuthorityUri, 400 ComMot, 415
SetBoundaries, 400 GetMotorConnections, 415
SetGridsToExport, 400 GetMotorSwitch, 415
ComHostcap, 401 GetMotorTerminal, 415
CalcMaxHostedPower, 401 ComNmink, 416
ComImport, 402 AddRef, 416
GetCreatedObjects, 402 Clear, 416
GetModifiedObjects, 402 GenerateContingenciesForAnalysis, 417
ComInc, 403 GetAll, 417
ZeroDerivative, 403 ComOmr, 417
ComLdf, 404 GetFeeders, 417
CalcLdf, 404 GetOMR, 418
CalcParams, 404 GetRegionCount, 419
CheckControllers, 404 ComOpc, 420
DoNotResetCalc, 404 ReceiveData, 420
EstimateLoading, 405 SendData, 420
EstimateOutage, 405 ComOutage, 421
Execute, 406 ContinueTrace, 421
IsAC, 406 ExecuteTime, 421
IsBalanced, 406 GetObject, 421
IsDC, 406 RemoveEvents, 422
PrintCheckResults, 406 SetObjs, 423
SetOldDistributeLoadMode, 407 StartTrace, 423
ComLink, 407 StopTrace, 423
GetMicroSCADAStatus, 407 Compare
LoadMicroSCADAFile, 407 ComMerge, 410
ReceiveData, 408 CompareActive
SendData, 408 ComMerge, 411
SentDataStatus, 409 Compile

718
INDEX INDEX

BlkDef, 536 GetTotalWarnB, 440


ComProtgraphic, 424 GetTotalWarnC, 440
AddToUpdatePages, 424 GetViolatedScanModules, 441
ClearUpdatePages, 424 LoadSimulationState, 441
ComPvcurves, 424 LoadSnapshot, 441
FindCriticalBus, 424 SaveSimulationState, 441
ComPython, 424 SaveSnapshot, 441
GetExternalObject, 424 ComSimoutage, 442
GetInputParameterDouble, 425 AddCntcy, 442
GetInputParameterInt, 425 AddContingencies, 443
GetInputParameterString, 426 AddRas, 443
SetExternalObject, 426 ClearCont, 443
SetInputParameterDouble, 426 CreateFaultCase, 443
SetInputParameterInt, 427 Execute, 444
SetInputParameterString, 427 GetNTopLoadedElms, 444
ComRed, 428 MarkRegions, 444
ReductionInMemory, 428 RemoveAllRas, 445
ResetReductionInMemory, 428 RemoveContingencies, 445
ComRel3, 429 RemoveRas, 445
AnalyseElmRes, 429 Reset, 445
ExeEvt, 429 SetLimits, 446
OvlAlleviate, 430 Update, 446
RemoveEvents, 430 ComSvgexport, 446
RemoveOutages, 430 SetFileName, 446
ValidateConstraints, 431 SetObject, 446
ComRelpost, 431 SetObjects, 447
CalcContributions, 431 ComSvgimport, 447
GetContributionOfComponent, 432 SetFileName, 447
ComRelreport, 432 SetObject, 447
GetContingencies, 432 ComTablereport, 447
GetContributionOfComponent, 433 AddButton, 449
ComRes, 433 AddCellAction, 449
ExportFullRange, 433 AddColumn, 450
FileNmResNm, 433 AddCurve, 451
ComShc, 434 AddHeader, 451
ExecuteRXSweep, 434 AddInvisibleFilter, 452
GetFaultType, 434 AddListFilter, 452
GetOverLoadedBranches, 435 AddListFilterEntries, 453
GetOverLoadedBuses, 436 AddMultiListFilter, 453
ComShctrace, 436 AddPlot, 454
BlockSwitch, 437 AddRow, 455
ExecuteAllSteps, 437 AddTable, 455
ExecuteInitialStep, 437 AddTabularFilter, 455
ExecuteNextStep, 437 AddTextFilter, 456
GetBlockedSwitches, 438 AddXLabel, 457
GetCurrentTimeStep, 438 ClearAll, 457
GetDeviceSwitches, 438 DisableAutomaticRowNumbering, 457
GetDeviceTime, 438 DisableSingleFilterRefresh, 457
GetNonStartedDevices, 438 DisplayButtonsCollapsible, 457
GetStartedDevices, 439 DisplayFiltersCollapsible, 458
GetSwitchTime, 439 DisplayFiltersIn2Columns, 458
GetTrippedDevices, 439 DisplayHeadersCollapsible, 458
NextStepAvailable, 439 EnableAutomaticRowNumbering, 458
ComSim, 440 ExportToExcel, 459
GetSimulationTime, 440 ExportToHTML, 459
GetTotalWarnA, 440 FindNextCell, 459

719
INDEX INDEX

FindNextRow, 460 RemoveCmdsForStudyCaseRow, 486


FindPreviousCell, 460 RemoveStudyCases, 487
FindPreviousRow, 461 SetResultsFolder, 487
GetCellAccessObject, 461 ComTececo, 488
GetCellEditObjects, 462 UpdateTablesByCalcPeriod, 488
GetCellValueType, 462 ComTransfer, 489
GetCheckboxCellValue, 463 GetTransferCalcData, 489
GetColumnFilter, 463 IsLastIterationFeasible, 489
GetColumnHeader, 464 ComUcte, 490
GetColumnId, 464 SetBatchMode, 490
GetDateCellValue, 464 ComUcteexp, 490
GetDoubleCellValue, 465 BuildExportStructure, 491
GetIntCellValue, 465 BuildNodeNames, 491
GetNumberOfColumns, 466 DeleteCompleteQuickAccess, 491
GetNumberOfRows, 466 ExportAndInitQuickAccess, 492
GetNumberOfSelectedCells, 466 GetConnectedBranches, 493
GetObjectCellValue, 467 GetFromToNodeNames, 493
GetRowId, 467 GetOrderCode, 494
GetSelectedCell, 468 GetUcteNodeName, 495
GetSelectedElements, 468 InitQuickAccess, 496
GetSelection, 468 QuickAccessAvailable, 496
GetStringCellValue, 469 ResetQuickAccess, 497
GoToCell, 469 SetGridSelection, 497
HasCell, 469 ConnectShuntToBus
IsRowVisible, 470 ComCapo, 375
NCol, 466 Consolidate
NRow, 466 IntCase, 549
RemoveRow, 470 IntScheme, 621
SetBarLimits, 471 Contains
SetCellAccess, 471 IntDplmap, 569
SetCellEdit, 472 ContainsNonAsciiCharacters
SetCellValueToBar, 472 General Object Methods, 133
SetCellValueToCheckbox, 473 ContinueTrace
SetCellValueToDate, 474 ComContingency, 384
SetCellValueToDouble, 475 ComOutage, 421
SetCellValueToInt, 476 ConvertAndExport
SetCellValueToObject, 477 ComGridtocim, 400
SetCellValueToString, 478 ConvertToASCIIFormat
SetColumnHeader, 479 IntComtrade, 551
SetCurveValue, 480 ConvertToBinaryFormat
SetDialogSize, 480 IntComtrade, 551
SetExportHtml, 481 ConvertToBusBranch
SetExportXls, 481 CimArchive, 539
SetListFilterSelection, 481 CopyData
SetNumberFormatForPlot, 482 General Object Methods, 133
SetRefresh, 482 CopyDataExtensionFrom
SetSorting, 482 IntPrj, 604
SetStatusText, 483 CopyExtMeaStatusToStatusTmp
SetTextAxisDistForPlot, 483 StaExtbrkmea, 295
SetTicksForPlot, 483 StaExtcmdmea, 300
SetTitle, 484 StaExtdatmea, 305
SizeX, 466 StaExtfmea, 310
SizeY, 466 StaExtfuelmea, 315
ComTasks, 484 StaExtimea, 320
AppendCommand, 484 StaExtpfmea, 325
AppendStudyCase, 485 StaExtpmea, 330

720
INDEX INDEX

StaExtqmea, 335 FormatDateUTC, 45


StaExtsmea, 340 GetStudyTimeObject, 46
StaExttapmea, 345 GetSystemTime, 46
StaExtv3mea, 350 GetSystemTimeUTC, 46
StaExtvmea, 355 GetTime, 47
CopyFile ParseDateLT, 47
File System Functions, 36 ParseDateUTC, 48
cos strftime, 49
Mathematical Functions, 67 Date
cosh SetTime, 527
Mathematical Functions, 67 Deactivate
Count ElmNet, 211
Set Routines, 707 IntCase, 550
Create IntPrj, 605
SetPath, 517 IntScenario, 616
CreateCBEvents IntScensched, 619
IntEvt, 579 IntScheme, 621
CreateDerivedProject IntSscheduler, 622
IntVersion, 635 DefineBoundary
CreateDir ElmArea, 168
File System Functions, 36 ElmNet, 212
CreateEvent ElmZone, 285
ElmTr2, 264 DefineDouble
ElmTr3, 268 ComAddon, 363
ElmTr4, 272 DefineDoubleMatrix
ElmVoltreg, 282 ComAddon, 364
StaExtdatmea, 305 DefineDoublePerConnection
CreateFaultCase ComAddon, 365
ComSimoutage, 443 DefineDoubleVector
Global Functions, 4 ComAddon, 365
CreateFeederWithRoutes DefineDoubleVectorPerConnection
ElmLne, 201 ComAddon, 366
CreateFilter DefineInteger
SetColscheme, 499 ComAddon, 366
CreateGroup DefineIntegerPerConnection
IntUserman, 630 ComAddon, 367
CreateModule DefineIntegerVector
ComAddon, 363 ComAddon, 368
CreateObject DefineIntegerVectorPerConnection
General Object Methods, 134 ComAddon, 368
CreateProject DefineObject
Global Functions, 5 ComAddon, 369
CreateRecoveryInformation DefineObjectPerConnection
ComContingency, 384 ComAddon, 370
CreateStageObject DefineObjectVector
IntSstage, 623 ComAddon, 370
CreateUser DefineObjectVectorPerConnection
IntUserman, 630 ComAddon, 371
CreateVersion DefineString
IntPrj, 604 ComAddon, 371
CreateVI DefineStringPerConnection
SetVipage, 531 ComAddon, 372
Delete
Date/Time Functions, 44 Global Functions, 5
FormatDate, 49 DeleteCompleteQuickAccess
FormatDateLT, 44 ComUcteexp, 491

721
INDEX INDEX

DeleteModule VisPlot2, 689


ComAddon, 373 VisPlottz, 701
DeleteParameterAtIndex VisXyplot, 703
CimModel, 540 DoAutoScaleY2
CimObject, 544 VisPlot2, 690
DeleteRow DoAutoScaleY
IntScensched, 619 SetVipage, 529
Derate VisDraw, 660
ElmGenstat, 195 VisHrm, 661
ElmPvsys, 213 VisMagndiffplt, 667
ElmSym, 252 VisOcplot, 668
Dialogue Boxes Functions, 50 VisPath, 670
CloseTableReports, 50 VisPcompdiffplt, 674
input, 50 VisPlot, 677
MessageBox, 51 VisPlot2, 690
ShowModalBrowser, 52 VisPlottz, 701
ShowModalOpenFileDialog, 53 VisXyplot, 703
ShowModalSaveFileDialog, 54 DoNotResetCalc
ShowModalSelectBrowser, 55 ComLdf, 404
ShowModalSelectFolderDialog, 56
ShowModelessBrowser, 56 EchoOff
UpdateTableReports, 57 Environment Functions, 57
DisableAutomaticRowNumbering EchoOn
ComTablereport, 457 Environment Functions, 58
DisableSingleFilterRefresh Edit
ComTablereport, 457 General Object Methods, 163
DiscardChanges ElmArea, 167
IntScenario, 616 CalculateInterchangeTo, 167
Disconnect DefineBoundary, 168
ElmGenstat, 195 GetAll, 168
ElmPvsys, 213 GetBranches, 169
ElmSym, 252 GetBuses, 169
DisplayButtonsCollapsible GetObjs, 169
ComTablereport, 457 ElmAsm, 170
DisplayFiltersCollapsible GetAvailableGenPower, 170
ComTablereport, 458 GetElecTorque, 171
DisplayFiltersIn2Columns GetGroundingImpedance, 172
ComTablereport, 458 GetMechTorque, 172
DisplayHeadersCollapsible GetMotorStartingFlag, 172
ComTablereport, 458 GetStepupTransformer, 173
DoAutoScaleOnAll IsPQ, 173
VisDraw, 659 ElmAsmsc, 173
DoAutoScaleOnCharacteristics GetAvailableGenPower, 173
VisDraw, 659 GetGroundingImpedance, 174
DoAutoScaleOnImpedances GetStepupTransformer, 175
VisDraw, 659 ElmBbone, 175
DoAutoScaleX CheckBbPath, 175
SetDesktop, 506 GetBbOrder, 176
SetVipage, 529 GetCompleteBbPath, 177
VisDraw, 659 GetFOR, 177
VisHrm, 661 GetMeanCs, 178
VisMagndiffplt, 667 GetMinCs, 178
VisOcplot, 668 GetTieOpenPoint, 179
VisPath, 669 GetTotLength, 179
VisPcompdiffplt, 674 HasGnrlMod, 180
VisPlot, 676 ElmBmu, 180

722
INDEX INDEX

Apply, 180 ElmLne, 200


Update, 180 AreDistParamsPossible, 201
ElmBoundary, 181 CreateFeederWithRoutes, 201
AddCubicle, 181 FitParams, 202
CalcShiftedReversedBoundary, 181 GetIthr, 202
Clear, 182 GetType, 202
GetInterior, 182 GetY0m, 203
IsSplitting, 182 GetY1m, 204
Resize, 183 GetZ0m, 204
Update, 183 GetZ1m, 205
ElmBranch, 183 GetZmatDist, 206
Update, 183 HasRoutes, 206
ElmCabsys, 184 HasRoutesOrSec, 206
FitParams, 184 IsCable, 207
GetLineCable, 184 IsNetCoupling, 207
Update, 185 MeasureLength, 208
ElmComp, 185 SetDetailed, 209
slotupd, 185 ElmLnesec, 209
SlotUpdate, 185 IsCable, 209
ElmCoup, 186 ElmNec, 210
Close, 186 GetGroundingImpedance, 210
GetRemoteBreakers, 186 ElmNet, 210
IsBreaker, 187 Activate, 210
IsClosed, 187 CalculateInterchangeTo, 211
IsOpen, 187 Deactivate, 211
Open, 188 DefineBoundary, 212
ElmDsl, 188 ElmPvsys, 212
ExportToClipboard, 188 Derate, 213
ExportToFile, 189 Disconnect, 213
ElmFeeder, 189 GetAvailableGenPower, 213
CalcAggrVarsInRadFeed, 189 GetGroundingImpedance, 214
GetAll, 190 IsConnected, 215
GetBranches, 191 Reconnect, 215
GetBuses, 191 ResetDerating, 216
GetNodesBranches, 192 ElmRelay, 216
GetObjs, 193 CheckRanges, 216
ElmFile, 193 GetCalcRX, 216
LoadFile, 193 GetMaxFdetectCalcI, 217
SaveFile, 194 GetSlot, 217
ElmFilter, 194 GetUnom, 218
GetGroundingImpedance, 194 IsStarted, 218
ElmGenstat, 195 SetImpedance, 218
Derate, 195 SetMaxI, 219
Disconnect, 195 SetMaxIearth, 219
GetAvailableGenPower, 196 SetMinI, 219
GetGroundingImpedance, 196 SetMinIearth, 219
GetStepupTransformer, 197 SetOutOfService, 220
IsConnected, 197 SetTime, 220
Reconnect, 198 slotupd, 221
ResetDerating, 198 SlotUpdate, 221
ElmGndswt, 199 ElmRes, 221
Close, 199 AddVariable, 222
GetGroundingImpedance, 199 AddVars, 222
IsClosed, 199 Clear, 222
IsOpen, 200 Close, 227
Open, 200 FindColumn, 223

723
INDEX INDEX

FindMaxInColumn, 224 Derate, 252


FindMaxOfVariableInRow, 225 Disconnect, 252
FindMinInColumn, 226 GetAvailableGenPower, 253
FindMinOfVariableInRow, 226 GetGroundingImpedance, 254
FinishWriting, 227 GetMotorStartingFlag, 254
Flush, 227 GetStepupTransformer, 254
GetDescription, 228 IsConnected, 255
GetFirstValidObject, 228 Reconnect, 255
GetFirstValidObjectVariable, 229 ResetDerating, 256
GetFirstValidVariable, 230 ElmTerm, 256
GetNextValidObject, 230 GetBusType, 256
GetNextValidObjectVariable, 232 GetCalcRelevantCubicles, 257
GetNextValidVariable, 232 GetConnectedBrkCubicles, 257
GetNumberOfColumns, 232 GetConnectedCubicles, 257
GetNumberOfRows, 233 GetConnectedMainBuses, 257
GetObj, 233 GetConnectionInfo, 258
GetObject, 233 GetEllaNodeName, 260
GetRelCase, 234 GetEquivalentTerminals, 258
GetSubElmRes, 235 GetMinDistance, 259
GetUnit, 235 GetNextHVBus, 260
GetValue, 236 GetNodeName, 260
GetVariable, 236 GetSepStationAreas, 261
Init, 237 HasCreatedCalBus, 261
InitialiseWriting, 237 IsElectrEquivalent, 262
Load, 238 IsEquivalent, 262
NCol, 232 IsInternalNodeInStation, 263
NRow, 233 IsInternalNodeInSubStation, 263
Release, 238 UpdateSubstationTerminals, 263
SetAsDefault, 239 ElmTr2, 264
SetObj, 239 CreateEvent, 264
SetSubElmResKey, 240 GetGroundingImpedance, 264
SizeX, 233 GetSuppliedElements, 265
SizeY, 232 GetTapPhi, 265
SortAccordingToColumn, 240 GetTapRatio, 266
Write, 241 GetZ0pu, 266
WriteDraw, 241 GetZpu, 266
ElmShnt, 242 IsQuadBooster, 267
GetGroundingImpedance, 242 NTap, 267
ElmStactrl, 242 ElmTr3, 268
GetControlledHVNode, 243 CreateEvent, 268
GetControlledLVNode, 243 GetGroundingImpedance, 268
GetStepupTransformer, 244 GetSuppliedElements, 269
Info, 244 GetTapPhi, 269
ElmSubstat, 245 GetTapRatio, 270
ApplyAndResetRA, 245 GetTapZDependentSide, 270
GetSplit, 245 GetZ0pu, 270
GetSplitCal, 247 GetZpu, 271
GetSplitIndex, 248 IsQuadBooster, 271
GetSuppliedElements, 249 NTap, 272
OverwriteRA, 250 ElmTr4, 272
ResetRA, 250 CreateEvent, 272
SaveAsRA, 250 GetGroundingImpedance, 272
SetRA, 251 GetSuppliedElements, 273
ElmSvs, 251 GetTapPhi, 273
GetStepupTransformer, 251 GetTapRatio, 274
ElmSym, 252 GetTapZDependentSide, 274

724
INDEX INDEX

GetZ0pu, 275 Error


GetZpu, 275 Output Window Functions, 116
IsQuadBooster, 276 EstimateLoading
NTap, 276 ComLdf, 405
ElmTrfstat, 276 EstimateOutage
GetSplit, 276 ComLdf, 405
GetSplitCal, 278 Exe
GetSplitIndex, 279 Global Functions, 6
GetSuppliedElements, 280 Execute
ElmVac, 281 ComAddlabel, 362
GetGroundingImpedance, 281 ComCimdbexp, 379
ElmVoltreg, 281 ComCimdbimp, 379
CreateEvent, 282 ComCimvalidate, 380
GetGroundingImpedance, 282 ComConreq, 384
GetZpu, 282 ComDpl, 392
NTap, 283 ComFlickermeter, 398
ElmXnet, 283 ComLdf, 406
GetGroundingImpedance, 283 Commands Methods, 362
GetStepupTransformer, 283 ComSimoutage, 444
ElmZone, 284 ExecuteAllSteps
CalculateInterchangeTo, 284 ComShctrace, 437
DefineBoundary, 285 ExecuteAmpacityCalc
GetAll, 285 ComAmpacity, 374
GetBranches, 286 ExecuteCmd
GetBuses, 286 Global Functions, 6
GetObjs, 286 ExecuteInitialStep
SetLoadScaleAbsolute, 287 ComShctrace, 437
EnableAutomaticRowNumbering ExecuteNextStep
ComTablereport, 458 ComShctrace, 437
EnableDiffMode ExecuteRecording
IntSstage, 624 ComMerge, 411
EnableUserBreak ExecuteRXSweep
Environment Functions, 62 ComShc, 434
Encrypt ExecuteTime
BlkDef, 536 ComOutage, 421
ComDpl, 391 ExecuteWithActiveProject
TypQdsl, 652 ComMerge, 411
Energize ExeEvt
General Object Methods, 134 ComRel3, 429
Environment Functions, 57 exit
EchoOff, 57 Global Functions, 6
EchoOn, 58 exp
EnableUserBreak, 62 Mathematical Functions, 68
GetDiffMode, 58 Export
IsAutomaticCalculationResetEnabled, 58 IntGrfgroup, 581
IsFinalEchoOnEnabled, 58 IntGrflayer, 582
NoFinalUpdate, 59 IntIcon, 586
SetAutomaticCalculationResetEnabled, 59 ExportAndInitQuickAccess
SetConsistencyCheck, 59 ComUcteexp, 492
SetDiffMode, 60 ExportFullRange
SetEnableUserBreak, 62 ComRes, 433
SetFinalEchoOnEnabled, 61 ExportToClipboard
SetGraphicUpdate, 61 ElmDsl, 188
SetGuiUpdateEnabled, 62 ExportToExcel
SetRescheduleFlag, 62 ComTablereport, 459
SetUserBreakEnabled, 62 ExportToFile

725
INDEX INDEX

ElmDsl, 189 FindPreviousCell


ExportToHTML ComTablereport, 460
ComTablereport, 459 FindPreviousRow
ExportToVec ComTablereport, 461
IntGrfgroup, 581 FinishWriting
IntGrflayer, 583 ElmRes, 227
First
fclose IntDplmap, 569
File System Functions, 37 Set Routines, 707
fflush FirstFilt
File System Functions, 37 Set Routines, 708
File System Functions, 35 FitParams
CheckFileExists, 35 ElmCabsys, 184
CopyFile, 36 ElmLne, 202
CreateDir, 36 floor
fclose, 37 Mathematical Functions, 68
fflush, 37 Flush
fopen, 37 ElmRes, 227
fprintf, 38 fopen
fscanf, 39 File System Functions, 37
fscanfsep, 40 Format String Syntax, 121
GetDirectories, 41 FormatDate
GetFileDate, 42 Date/Time Functions, 49
GetFiles, 42 FormatDateLT
GetInstallationDirectory, 43 Date/Time Functions, 44
GetInstallDir, 43 FormatDateUTC
GetTempDir, 43 Date/Time Functions, 45
GetTemporaryDirectory, 43 fprintf
GetWorkingDir, 43 File System Functions, 38
GetWorkspaceDirectory, 43 frac
FileNmResNm Mathematical Functions, 68
ComRes, 433 fRand
FinaliseModule Mathematical Functions, 69
ComAddon, 373 fscanf
FindColumn File System Functions, 39
ElmRes, 223 fscanfsep
IntComtrade, 551 File System Functions, 40
IntComtradeset, 559 fWrite
FindCriticalBus Output Window Functions, 118
ComPvcurves, 424
FindMaxInColumn General Object Methods, 131
ElmRes, 224 AddCopy, 132
IntComtrade, 552 ContainsNonAsciiCharacters, 133
IntComtradeset, 560 CopyData, 133
FindMaxOfVariableInRow CreateObject, 134
ElmRes, 225 Edit, 163
FindMinInColumn Energize, 134
ElmRes, 226 GetChildren, 135
IntComtrade, 553 GetClass, 136
IntComtradeset, 561 GetClassName, 136
FindMinOfVariableInRow GetCombinedProjectSource, 136
ElmRes, 226 GetConnectedElements, 136
FindNextCell GetConnectionCount, 137
ComTablereport, 459 GetContents, 137
FindNextRow GetControlledNode, 138
ComTablereport, 460 GetCubicle, 139

726
INDEX INDEX

GetFullName, 139 VarExists, 166


GetImpedance, 140 GenerateContingenciesForAnalysis
GetInom, 141 ComNmink, 417
GetNet, 141 Get
GetNode, 142 IntDplvec, 575
GetOperator, 142 IntMat, 587
GetOwner, 142 IntVec, 631
GetParent, 142 SetFilt, 512
GetReferences, 143 GetActiveCalculationStr
GetRegion, 144 Global Functions, 7
GetSize, 144 GetActiveModule
GetSupplyingSubstations, 145 ComAddon, 373
GetSupplyingTransformers, 146 GetActiveNetworkVariations
GetSupplyingTrfstations, 146 Global Functions, 8
GetSystemGround, 146 GetActiveProject
GetSystemGrounding, 146 Global Functions, 8
GetUnom, 147 GetActiveScenario
GetVal, 147 Global Functions, 8
GetVarType, 148 GetActiveScenarioScheduler
GetZeroImpedance, 148 Global Functions, 9
HasResults, 149 GetActiveScheduler
Inom, 141 IntScheme, 621
IsCalcRelevant, 150 GetActiveStages
IsClass, 150 Global Functions, 9
IsDeleted, 151 GetActiveStudyCase
IsEarthed, 151 Global Functions, 9
IsEnergized, 152 GetAll
IsHidden, 153 ComNmink, 417
IsInFeeder, 153 ElmArea, 168
IsNetworkDataFolder, 153 ElmFeeder, 190
IsNode, 154 ElmZone, 285
IsObjectActive, 154 IntDataset, 568
IsObjectModifiedByVariation, 155 SetPath, 518
Isolate, 155 SetSelect, 525
IsOutOfService, 156 StaCubic, 288
IsReducible, 156 GetAllUsers
IsRelevant, 150 Global Functions, 10
IsShortCircuited, 157 GetAnalogueDescriptions
lnm, 157 IntComtrade, 553
MarkInGraphics, 158 IntComtradeset, 561
Move, 158 GetAttributeEnumerationType
PasteCopy, 159 CimModel, 540
PurgeUnusedObjects, 160 CimObject, 544
ReplaceNonAsciiCharacters, 160 GetAvailableButtons
ReportNonAsciiCharacters, 160 SetTboxconfig, 525
ReportUnusedObjects, 160 GetAvailableGenPower
SearchObject, 161 ElmAsm, 170
SetSize, 161 ElmAsmsc, 173
SetVal, 162 ElmGenstat, 196
ShowEditDialog, 163 ElmPvsys, 213
ShowFullName, 163 ElmSym, 253
ShowModalSelectTree, 164 GetBbOrder
snm, 164 ElmBbone, 176
SwitchOff, 165 GetBlockedSwitches
SwitchOn, 165 ComShctrace, 438
unm, 166 GetBorderCubicles

727
INDEX INDEX

Global Functions, 10 IntMat, 588


GetBranch GetCombinedProjectSource
StaCubic, 289 General Object Methods, 136
GetBranches GetCompleteBbPath
ElmArea, 169 ElmBbone, 177
ElmFeeder, 191 GetConnectedBranches
ElmZone, 286 ComUcteexp, 493
SetPath, 518 GetConnectedBrkCubicles
GetBrowserSelection ElmTerm, 257
Global Functions, 10 GetConnectedCubicles
GetBuses ElmTerm, 257
ElmArea, 169 GetConnectedElements
ElmFeeder, 191 General Object Methods, 136
ElmZone, 286 GetConnectedMainBuses
SetPath, 518 ElmTerm, 257
GetBusType GetConnectedMajorNodes
ElmTerm, 256 StaCubic, 289
GetCalcRelevantCubicles GetConnectionCount
ElmTerm, 257 General Object Methods, 137
GetCalcRelevantObjects GetConnectionInfo
Global Functions, 11 ElmTerm, 258
GetCalcRX GetConnections
ElmRelay, 216 StaCubic, 290
GetCanvasSize GetContents
SetDesktop, 506 General Object Methods, 137
GetCaseCommand GetContingencies
Global Functions, 15 ComRelreport, 432
GetCaseObject GetContributionOfComponent
Global Functions, 15 ComRelpost, 432
GetCellAccessObject ComRelreport, 433
ComTablereport, 461 GetControlledHVNode
GetCellEditObjects ElmStactrl, 243
ComTablereport, 462 GetControlledLVNode
GetCellValueType ElmStactrl, 243
ComTablereport, 462 GetControlledNode
GetCheckboxCellValue General Object Methods, 138
ComTablereport, 463 GetCorrespondingObject
GetCheckSum ComMerge, 411
BlkDef, 537 GetCreatedObjects
GetChildren ComImport, 402
General Object Methods, 135 GetCriticalTimePhase
GetClass IntThrating, 627
General Object Methods, 136 GetCubicle
GetClassDescription General Object Methods, 139
Global Functions, 12 GetCurrentDiagram
GetClassName Global Functions, 12
General Object Methods, 136 GetCurrentIteration
GetClassType ComGenrelinc, 398
ComCimvalidate, 381 GetCurrentSelection
GetColumnFilter Global Functions, 12
ComTablereport, 463 GetCurrentTimeStep
GetColumnHeader ComShctrace, 438
ComTablereport, 464 GetCurrentUser
GetColumnId Global Functions, 12
ComTablereport, 464 GetCurrentZoomScaleLevel
GetColumnLabel Global Functions, 13

728
INDEX INDEX

GetDataFolder ElmRes, 228


Global Functions, 13 GetFirstValidObjectVariable
GetDataSource ElmRes, 229
VisHrm, 662 GetFirstValidVariable
VisPlot, 677 ElmRes, 230
VisPlot2, 691 GetFlowOrientation
VisXyplot, 704 Global Functions, 15
GetDateCellValue GetFOR
ComTablereport, 464 ElmBbone, 177
GetDerivedProjects GetFromSigName
IntPrj, 605 BlkSig, 538
IntVersion, 636 GetFromStudyCase
GetDescription Global Functions, 15
ElmRes, 228 GetFromToNodeNames
Global Functions, 14 ComUcteexp, 493
IntComtrade, 553 GetFullName
IntComtradeset, 562 General Object Methods, 139
GetDescriptionText GetGeneratorEvent
ComCimvalidate, 381 ComContingency, 385
GetDeviceSwitches GetGeoCoordinateSystem
ComShctrace, 438 IntPrj, 606
GetDeviceTime GetGlobalLib
ComShctrace, 438 Global Functions, 16
GetDiagramSelection GetGlobalLibrary
Global Functions, 15 Global Functions, 16
GetDiffMode GetGraphBoard
Environment Functions, 58 Global Functions, 16
GetDigitalDescriptions GetGraphicsBoard
IntComtrade, 554 Global Functions, 16
IntComtradeset, 562 GetGroundingImpedance
GetDirectories ElmAsm, 172
File System Functions, 41 ElmAsmsc, 174
GetDisplayedButtons ElmFilter, 194
SetTboxconfig, 526 ElmGenstat, 196
GetDoubleCellValue ElmGndswt, 199
ComTablereport, 465 ElmNec, 210
GetElecTorque ElmPvsys, 214
ElmAsm, 171 ElmShnt, 242
GetEllaNodeName ElmSym, 254
ElmTerm, 260 ElmTr2, 264
GetEquivalentTerminals ElmTr3, 268
ElmTerm, 258 ElmTr4, 272
GetExternalObject ElmVac, 281
ComDpl, 393 ElmVoltreg, 282
ComPython, 424 ElmXnet, 283
GetExternalReferences GetGroups
IntPrj, 605 IntUserman, 631
GetFaultType GetHistoricalProject
ComShc, 434 IntVersion, 636
GetFeeders GetImpedance
ComOmr, 417 General Object Methods, 140
GetFileDate GetInom
File System Functions, 42 General Object Methods, 141
GetFiles GetInputObject
File System Functions, 42 ComCimvalidate, 381
GetFirstValidObject GetInputParameterDouble

729
INDEX INDEX

ComDpl, 393 StaExtfuelmea, 315


ComPython, 425 StaExtimea, 320
GetInputParameterInt StaExtpfmea, 325
ComDpl, 394 StaExtpmea, 330
ComPython, 425 StaExtqmea, 335
GetInputParameterString StaExttapmea, 345
ComDpl, 394 StaExtv3mea, 350
ComPython, 426 StaExtvmea, 355
GetInstallationDirectory GetMechTorque
File System Functions, 43 ElmAsm, 172
GetInstallDir GetMem
File System Functions, 43 Global Functions, 18
GetIntCalcres GetMicroSCADAStatus
VisPlot, 678 ComLink, 407
GetIntCellValue GetMinCs
ComTablereport, 465 ElmBbone, 178
GetInterior GetMinDistance
ElmBoundary, 182 ElmTerm, 259
GetInterruptedPowerAndCustomersForStage GetModel
ComContingency, 385 ComCimvalidate, 381
GetInterruptedPowerAndCustomersForTimeStepGetModelId
ComContingency, 386 ComCimvalidate, 382
GetIthr GetModelsReferencingThis
ElmLne, 202 CimModel, 540
GetLanguage GetModification
Global Functions, 17 ComMerge, 411
GetLastCmd GetModificationResult
Global Functions, 17 ComMerge, 412
GetLatestVersion GetModifiedObjects
IntPrj, 606 ComImport, 402
GetLimit ComMerge, 412
ScnFreq, 638 GetMotorConnections
ScnFrt, 641 ComMot, 415
ScnSpeed, 643 GetMotorStartingFlag
ScnSync, 645 ElmAsm, 172
ScnVar, 647 ElmSym, 254
ScnVolt, 649 GetMotorSwitch
GetLineCable ComMot, 415
ElmCabsys, 184 GetMotorTerminal
GetLoadEvent ComMot, 415
ComContingency, 386 GetNearestBusbars
GetLocalLib StaCubic, 291
Global Functions, 18 GetNet
GetLocalLibrary General Object Methods, 141
Global Functions, 18 GetNextHVBus
GetMaxFdetectCalcI ElmTerm, 260
ElmRelay, 217 GetNextLoop
GetMaxNumIterations ComCheck, 378
ComGenrelinc, 399 GetNextValidObject
GetMeanCs ElmRes, 230
ElmBbone, 178 GetNextValidObjectVariable
GetMeaValue ElmRes, 232
StaExtbrkmea, 295 GetNextValidVariable
StaExtcmdmea, 300 ElmRes, 232
StaExtdatmea, 305 GetNode
StaExtfmea, 310 General Object Methods, 142

730
INDEX INDEX

GetNodeName ComOutage, 421


ElmTerm, 260 ElmRes, 233
GetNodesBranches GetObjectCellValue
ElmFeeder, 192 ComTablereport, 467
GetNonStartedDevices GetObjectId
ComShctrace, 438 ComCimvalidate, 382
GetNTopLoadedElms GetObjects
ComSimoutage, 444 IntScenario, 617
GetNumberOfAnalogueSignalDescriptions GetObjectsReferencingThis
IntComtrade, 554 CimObject, 544
IntComtradeset, 562 GetObjectsWithSameId
GetNumberOfClusters CimObject, 545
SetCluster, 498 GetObjs
GetNumberOfColumns ElmArea, 169
ComTablereport, 466 ElmFeeder, 193
ElmRes, 232 ElmZone, 286
IntComtrade, 554 GetOMR
IntComtradeset, 563 ComOmr, 418
IntMat, 588 GetOperationValue
GetNumberOfDigitalSignalDescriptions IntScenario, 617
IntComtrade, 555 GetOperator
IntComtradeset, 563 General Object Methods, 142
GetNumberOfGeneratorEventsForTimeStep GetOrderCode
ComContingency, 387 ComUcteexp, 494
GetNumberOfLoadEventsForTimeStep GetOrInsertPlot
ComContingency, 387 SetVipage, 530
GetNumberOfRows GetOverLoadedBranches
ComTablereport, 466 ComShc, 435
ElmRes, 233 GetOverLoadedBuses
IntComtrade, 555 ComShc, 436
IntComtradeset, 563 GetOwner
IntMat, 588 General Object Methods, 142
GetNumberOfSelectedCells GetPage
ComTablereport, 466 SetDesktop, 507
GetNumberOfSwitchEventsForTimeStep GetPageLen
ComContingency, 387 Global Functions, 18
GetNumberOfTimeSteps GetParameterCount
ComContingency, 388 CimModel, 540
GetNumberOfValidationMessages CimObject, 545
ComCimvalidate, 382 GetParameterNamespace
GetNumberOfViolations CimModel, 540
ScnFreq, 638 CimObject, 545
ScnFrt, 641 GetParameterValue
ScnSpeed, 643 CimModel, 541
ScnSync, 645 CimObject, 545
ScnVar, 647 GetParent
ScnVolt, 649 General Object Methods, 142
GetNumProcesses GetPathFolder
SetUser, 528 SetPath, 519
GetNumSlave GetPathToNearestBusbar
SetParalman, 515 StaCubic, 292
GetObj GetPfObjects
ComContingency, 388 CimObject, 546
ElmRes, 233 GetPFVersion
GetObject Global Functions, 19
ComCimvalidate, 382 GetProfile

731
INDEX INDEX

ComCimvalidate, 383 ComTablereport, 468


GetProjectFolder GetSelection
Global Functions, 19 ComTablereport, 468
GetProjectFolderType GetSepStationAreas
IntPrjfolder, 611 ElmTerm, 261
GetQlim GetSettings
IntQlim, 612 Global Functions, 21
GetRandomNumber GetSeverity
Mathematical Functions, 68 ComCimvalidate, 383
GetRandomNumberEx GetSignalHeader
Mathematical Functions, 69 IntComtrade, 555
GetRating IntComtradeset, 563
IntThrating, 628 GetSimulationTime
GetRecordingStage ComSim, 440
Global Functions, 19 GetSize
GetReferences General Object Methods, 144
General Object Methods, 143 GetSlot
GetRegion ElmRelay, 217
General Object Methods, 144 GetSplit
GetRegionCount ElmSubstat, 245
ComOmr, 419 ElmTrfstat, 276
GetRelCase GetSplitCal
ElmRes, 234 ElmSubstat, 247
GetRemoteBorderCubicles ElmTrfstat, 278
StaCubic, 293 GetSplitIndex
GetRemoteBreakers ElmSubstat, 248
ElmCoup, 186 ElmTrfstat, 279
GetResData GetStartedDevices
Global Functions, 20 ComShctrace, 439
GetResDesc GetStartEndTime
Global Functions, 20 IntScensched, 620
GetResObj GetStatus
Global Functions, 20 StaExtbrkmea, 295
GetResUnit StaExtcmdmea, 300
Global Functions, 20 StaExtdatmea, 306
GetResVar StaExtfmea, 310
Global Functions, 20 StaExtfuelmea, 315
GetRowId StaExtimea, 320
ComTablereport, 467 StaExtpfmea, 325
GetRowLabel StaExtpmea, 330
IntMat, 589 StaExtqmea, 335
GetScaleObjX StaExtsmea, 340
VisHrm, 662 StaExttapmea, 345
VisPlot, 678 StaExtv3mea, 350
VisPlot2, 691 StaExtvmea, 355
GetScaleObjY GetStatusTmp
VisHrm, 663 StaExtbrkmea, 296
VisPlot, 679 StaExtcmdmea, 301
VisPlot2, 692 StaExtdatmea, 306
GetScenario StaExtfmea, 311
IntScensched, 619 StaExtfuelmea, 316
GetScheme StaExtimea, 321
IntSstage, 624 StaExtpfmea, 326
GetSelectedCell StaExtpmea, 331
ComTablereport, 468 StaExtqmea, 336
GetSelectedElements StaExtsmea, 340

732
INDEX INDEX

StaExttapmea, 346 ElmTr3, 270


StaExtv3mea, 351 ElmTr4, 274
StaExtvmea, 356 GetTempDir
GetStepupTransformer File System Functions, 43
ElmAsm, 173 GetTemporaryDirectory
ElmAsmsc, 175 File System Functions, 43
ElmGenstat, 197 GetTieOpenPoint
ElmStactrl, 244 ElmBbone, 179
ElmSvs, 251 GetTime
ElmSym, 254 Date/Time Functions, 47
ElmXnet, 283 GetTimeOfStepInSeconds
GetStringCellValue ComContingency, 389
ComTablereport, 469 GetToSigName
GetStudyTimeObject BlkSig, 538
Date/Time Functions, 46 GetTotalInterruptedPower
GetSubElmRes ComContingency, 389
ElmRes, 235 GetTotalWarnA
GetSummaryGrid ComSim, 440
Global Functions, 21 GetTotalWarnB
GetSuppliedElements ComSim, 440
ElmSubstat, 249 GetTotalWarnC
ElmTr2, 265 ComSim, 440
ElmTr3, 269 GetTotLength
ElmTr4, 273 ElmBbone, 179
ElmTrfstat, 280 GetTransferCalcData
GetSupplyingSubstations ComTransfer, 489
General Object Methods, 145 GetTrippedDevices
GetSupplyingTransformers ComShctrace, 439
General Object Methods, 146 GetType
GetSupplyingTrfstations ComCimvalidate, 383
General Object Methods, 146 ElmLne, 202
GetSwitch GetUcteNodeName
StaCubic, 294 ComUcteexp, 495
GetSwitchEvent GetUnit
ComContingency, 388 ElmRes, 235
GetSwitchStatus IntComtrade, 555
IntRunarrange, 614 IntComtradeset, 564
GetSwitchTime GetUnom
ComShctrace, 439 ElmRelay, 218
GetSystemGround General Object Methods, 147
General Object Methods, 146 GetUserManager
GetSystemGrounding Global Functions, 22
General Object Methods, 146 GetUsers
GetSystemTime IntUserman, 631
Date/Time Functions, 46 GetVal
GetSystemTimeUTC General Object Methods, 147
Date/Time Functions, 46 GetValue
GetTapPhi ElmRes, 236
ElmTr2, 265 IntComtrade, 556
ElmTr3, 269 IntComtradeset, 564
ElmTr4, 273 IntDplmap, 570
GetTapRatio ScnFreq, 639
ElmTr2, 266 ScnFrt, 641
ElmTr3, 270 ScnSpeed, 643
ElmTr4, 274 ScnSync, 645
GetTapZDependentSide ScnVar, 647

733
INDEX INDEX

ScnVolt, 649 TypTr2, 653


GetVar GetZmatDist
IntMon, 594 ElmLne, 206
GetVariable GetZpu
ElmRes, 236 ElmTr2, 266
IntComtrade, 556 ElmTr3, 271
IntComtradeset, 564 ElmTr4, 275
ScnFreq, 639 ElmVoltreg, 282
ScnFrt, 641 Global Functions, 2
ScnSpeed, 643 ActivateProject, 3
ScnSync, 645 ActiveCase, 9
ScnVar, 647 ActiveProject, 8
ScnVolt, 649 AllRelevant, 11
GetVariation ClearCommands, 4
IntSstage, 624 ClearRecycleBin, 4
GetVarType CommitTransaction, 4
General Object Methods, 148 CommitTx , 4
GetVersions CreateFaultCase, 4
IntPrj, 606 CreateProject, 5
GetVI Delete, 5
SetVipage, 530 Exe, 6
GetViolatedElement ExecuteCmd, 6
ScnFreq, 639 exit, 6
ScnFrt, 642 GetActiveCalculationStr, 7
ScnSpeed, 644 GetActiveNetworkVariations, 8
ScnSync, 646 GetActiveProject, 8
ScnVar, 648 GetActiveScenario, 8
ScnVolt, 650 GetActiveScenarioScheduler, 9
GetViolatedScanModules GetActiveStages, 9
ComSim, 441 GetActiveStudyCase, 9
GetViolationTime GetAllUsers, 10
ScnFreq, 640 GetBorderCubicles, 10
ScnFrt, 642 GetBrowserSelection, 10
ScnSpeed, 644 GetCalcRelevantObjects, 11
ScnSync, 646 GetCaseCommand, 15
ScnVar, 648 GetCaseObject, 15
ScnVolt, 650 GetClassDescription, 12
GetWorkingDir GetCurrentDiagram, 12
File System Functions, 43 GetCurrentSelection, 12
GetWorkspaceDirectory GetCurrentUser, 12
File System Functions, 43 GetCurrentZoomScaleLevel, 13
GetY0m GetDataFolder, 13
ElmLne, 203 GetDescription, 14
GetY1m GetDiagramSelection, 15
ElmLne, 204 GetFlowOrientation, 15
GetZ0m GetFromStudyCase, 15
ElmLne, 204 GetGlobalLib, 16
GetZ0pu GetGlobalLibrary, 16
ElmTr2, 266 GetGraphBoard, 16
ElmTr3, 270 GetGraphicsBoard, 16
ElmTr4, 275 GetLanguage, 17
GetZ1m GetLastCmd, 17
ElmLne, 205 GetLocalLib, 18
GetZeroImpedance GetLocalLibrary, 18
General Object Methods, 148 GetMem, 18
GetZeroSequenceHVLVT GetPageLen, 18

734
INDEX INDEX

GetPFVersion, 19 ComTablereport, 469


GetProjectFolder, 19
GetRecordingStage, 19 HasCell
GetResData, 20 ComTablereport, 469
GetResDesc, 20 HasCreatedCalBus
GetResObj, 20 ElmTerm, 261
GetResUnit, 20 HasExternalReferences
GetResVar, 20 IntPrj, 606
GetSettings, 21 HasGnrlMod
GetSummaryGrid, 21 ElmBbone, 180
GetUserManager, 22 HasParameter
HttpGet, 22 CimModel, 541
ImportDz, 23 CimObject, 546
ImportSnapshot, 23 HasResults
IsLdfValid, 24 General Object Methods, 149
IsRmsValid, 24 HasRoutes
IsScenarioAttribute, 25 ElmLne, 206
IsShcValid, 25 HasRoutesOrSec
IsSimValid, 26 ElmLne, 206
LoadProfile, 26 HttpGet
LoadResData, 27 Global Functions, 22
MarkInGraphics, 27
OutputFlexibleData, 28 Import
PostCommand, 28 IntGrfgroup, 582
Rebuild, 28 IntGrflayer, 583
ReleaseResData, 29 IntIcon, 586
ReloadProfile, 29 ImportAndConvert
ResetCalculation, 29 ComCimdbimp, 380
ResFirstValidObject, 29 ImportDz
ResFirstValidObjectVar, 30 Global Functions, 23
ResFirstValidVar, 30 ImportFromVec
ResGetMax, 30 IntGrfgroup, 582
ResGetMin, 30 IntGrflayer, 583
ResIndex, 30 ImportSnapshot
ResNextValidObject, 31 Global Functions, 23
ResNextValidObjectVar, 31 IndexOf
ResNextValidVar, 31 IntDplvec, 577
ResNval, 31 Info
ResNvars, 31 ElmStactrl, 244
ResSortToVar, 31 Output Window Functions, 117
SaveAsScenario, 32 Init
SaveScenarioAs, 32 ElmRes, 237
SearchObjectByForeignKey, 32 IntMat, 589
SelectToolbox, 33 IntVec, 632
SetShowAllUsers, 33 InitialiseWriting
Sleep, 33 ElmRes, 237
SplitLine, 34 InitQuickAccess
StatFileGetXrange, 34 ComUcteexp, 496
StatFileResetXrange, 34 InitTmp
StatFileSetXrange, 35 StaExtbrkmea, 296
SummaryGrid, 21 StaExtcmdmea, 301
validLDF, 24 StaExtdatmea, 306
validRMS, 24 StaExtfmea, 311
validSHC, 25 StaExtfuelmea, 316
validSIM, 26 StaExtimea, 321
GoToCell StaExtpfmea, 326

735
INDEX INDEX

StaExtpmea, 331 GetNumberOfColumns, 563


StaExtqmea, 336 GetNumberOfDigitalSignalDescriptions, 563
StaExtsmea, 340 GetNumberOfRows, 563
StaExttapmea, 346 GetSignalHeader, 563
StaExtv3mea, 351 GetUnit, 564
StaExtvmea, 356 GetValue, 564
Inom GetVariable, 564
General Object Methods, 141 Load, 565
input NCol, 563
Dialogue Boxes Functions, 50 NRow, 563
Insert Release, 566
IntDplmap, 573 SizeX, 563
IntDplvec, 577 SizeY, 563
InsertPlot SortAccordingToColumn, 566
SetVipage, 531 IntDataset, 567
IntCase, 548 AddRef, 567
Activate, 548 All, 568
ApplyNetworkState, 549 Clear, 568
ApplyStudyTime, 549 GetAll, 568
Consolidate, 549 IntDplmap, 568
Deactivate, 550 Clear, 569
SetStudyTime, 550 Contains, 569
IntComtrade, 550 First, 569
ConvertToASCIIFormat, 551 GetValue, 570
ConvertToBinaryFormat, 551 Insert, 573
FindColumn, 551 Next, 573
FindMaxInColumn, 552 Remove, 574
FindMinInColumn, 553 Size, 574
GetAnalogueDescriptions, 553 Update, 574
GetDescription, 553 IntDplvec, 575
GetDigitalDescriptions, 554 Clear, 575
GetNumberOfAnalogueSignalDescriptions, Get, 575
554 IndexOf, 577
GetNumberOfColumns, 554 Insert, 577
GetNumberOfDigitalSignalDescriptions, 555 Remove, 577
GetNumberOfRows, 555 Size, 578
GetSignalHeader, 555 Sort, 578
GetUnit, 555 IntEvt, 578
GetValue, 556 CreateCBEvents, 579
GetVariable, 556 RemoveSwitchEvents, 579
Load, 557 IntExtaccess, 579
NCol, 554 CheckUrl, 579
NRow, 555 IntGate, 580
Release, 558 AddTrigger, 580
SizeX, 555 IntGrf, 580
SizeY, 554 MoveToLayer, 580
SortAccordingToColumn, 558 IntGrfgroup, 581
IntComtradeset, 559 ClearData, 581
FindColumn, 559 Export, 581
FindMaxInColumn, 560 ExportToVec, 581
FindMinInColumn, 561 Import, 582
GetAnalogueDescriptions, 561 ImportFromVec, 582
GetDescription, 562 IntGrflayer, 582
GetDigitalDescriptions, 562 ClearData, 582
GetNumberOfAnalogueSignalDescriptions, Export, 582
562 ExportToVec, 583

736
INDEX INDEX

Import, 583 CanAddProjectToRemoteDatabase, 603


ImportFromVec, 583 CanSubscribeProjectReadOnly, 603
IntGrfnet, 584 CanSubscribeProjectReadWrite, 603
SetLayerVisibility, 584 CopyDataExtensionFrom, 604
SetSymbolComponentVisibility, 584 CreateVersion, 604
Show, 585 Deactivate, 605
IntIcon, 585 GetDerivedProjects, 605
Export, 586 GetExternalReferences, 605
Import, 586 GetGeoCoordinateSystem, 606
IntMat, 586 GetLatestVersion, 606
ColLbl, 587, 588 GetVersions, 606
Get, 587 HasExternalReferences, 606
GetColumnLabel, 588 LoadData, 607
GetNumberOfColumns, 588 Migrate, 607
GetNumberOfRows, 588 NormaliseCombined, 608
GetRowLabel, 589 PackExternalReferences, 608
Init, 589 Purge, 608
Invert, 590 RemoveProjectFromCombined, 608
Multiply, 590 Restore, 609
NCol, 588 SetGeoCoordinateSystem, 609
NRow, 588 SubscribeProjectReadOnly, 609
Resize, 591 SubscribeProjectReadWrite, 609
RowLbl, 589, 591 TransformGeoCoordinates, 609
Save, 591 UnsubscribeProject, 610
Set, 591 UpdateStatistics, 610
SetColumnLabel, 592 IntPrjfolder, 610
SetRowLabel, 592 GetProjectFolderType, 611
SizeX, 588 IsProjectFolderType, 612
SizeY, 588 IntQlim, 612
SortToColum, 593 GetQlim, 612
SortToColumn, 593 IntRas, 613
IntMon, 594 AddEvent, 613
AddVar, 594 AddTrigger, 613
ClearVars, 594 IsValid, 614
GetVar, 594 IntRunarrange, 614
NVars, 595 GetSwitchStatus, 614
PrintAllVal, 595 IntScenario, 615
PrintVal, 596 Activate, 615
RemoveVar, 596 Apply, 615
IntOutage, 597 ApplySelective, 616
Apply, 597 Deactivate, 616
ApplyAll, 597 DiscardChanges, 616
Check, 598 GetObjects, 617
CheckAll, 598 GetOperationValue, 617
IsInStudyTime, 598 ReleaseMemory, 617
IsInStudytime, 598 Save, 618
ResetAll, 599 SetOperationValue, 618
IntPlot, 599 IntScensched, 619
SetAdaptY, 599 Activate, 619
SetAutoScaleY, 600 Deactivate, 619
SetScaleY, 601 DeleteRow, 619
IntPrj, 602 GetScenario, 619
Activate, 602 GetStartEndTime, 620
AddProjectToCombined, 602 SearchScenario, 620
AddProjectToRemoteDatabase, 603 IntScheme, 620
Archive, 603 Activate, 621

737
INDEX INDEX

Consolidate, 621 Invert


Deactivate, 621 IntMat, 590
GetActiveScheduler, 621 InvertMatrix
NewStage, 621 Mathematical Functions, 70
IntSscheduler, 622 IsAC
Activate, 622 ComLdf, 406
Deactivate, 622 IsAutomaticCalculationResetEnabled
Update, 622 Environment Functions, 58
IntSstage, 623 IsBalanced
Activate, 623 ComLdf, 406
CreateStageObject, 623 IsBreaker
EnableDiffMode, 624 ElmCoup, 187
GetScheme, 624 IsCable
GetVariation, 624 ElmLne, 207
IsExcluded, 625 ElmLnesec, 209
PrintModifications, 625 TypLne, 651
ReadValue, 626 IsCalcRelevant
WriteValue, 626 General Object Methods, 150
IntSubset, 626 IsClass
Apply, 626 General Object Methods, 150
ApplySelective, 627 IsClosed
Clear, 627 ElmCoup, 187
IntThrating, 627 ElmGndswt, 199
GetCriticalTimePhase, 627 StaCubic, 294
GetRating, 628 StaSwitch, 360
IntUrl, 629 IsConnected
View, 629 ElmGenstat, 197
IntUser, 629 ElmPvsys, 215
Purge, 629 ElmSym, 255
SetPassword, 629 StaCubic, 294
TerminateSession, 630 IsDC
IntUserman, 630 ComLdf, 406
CreateGroup, 630 IsDeleted
CreateUser, 630 General Object Methods, 151
GetGroups, 631 IsEarthed
GetUsers, 631 General Object Methods, 151
UpdateGroups, 631 IsElectrEquivalent
IntVec, 631 ElmTerm, 262
Get, 631 IsEncrypted
Init, 632 ComDpl, 395
Max, 632 TypQdsl, 652
Mean, 632 IsEnergized
Min, 632 General Object Methods, 152
Resize, 633 IsEquivalent
Save, 633 ElmTerm, 262
Set, 633 IsExcluded
Size, 634 IntSstage, 625
Sort, 634 IsFinalEchoOnEnabled
IntVersion, 635 Environment Functions, 58
CreateDerivedProject, 635 IsHidden
GetDerivedProjects, 636 General Object Methods, 153
GetHistoricalProject, 636 IsIn
Rollback, 636 Set Routines, 709
IntViewbookmark, 637 IsInFeeder
JumpTo, 637 General Object Methods, 153
UpdateFromCurrentView, 637 IsInStudyTime

738
INDEX INDEX

IntOutage, 598 ElmRelay, 218


IsInStudytime IsStatusBitSet
IntOutage, 598 StaExtbrkmea, 296
IsInternalNodeInStation StaExtcmdmea, 301
ElmTerm, 263 StaExtdatmea, 306
IsInternalNodeInSubStation StaExtfmea, 311
ElmTerm, 263 StaExtfuelmea, 316
IsLastIterationFeasible StaExtimea, 321
ComTransfer, 489 StaExtpfmea, 326
IsLdfValid StaExtpmea, 331
Global Functions, 24 StaExtqmea, 336
IsNetCoupling StaExtsmea, 341
ElmLne, 207 StaExttapmea, 346
IsNetworkDataFolder StaExtv3mea, 351
General Object Methods, 153 StaExtvmea, 356
IsNode IsStatusBitSetTmp
General Object Methods, 154 StaExtbrkmea, 296
IsObjectActive StaExtcmdmea, 301
General Object Methods, 154 StaExtdatmea, 306
IsObjectModifiedByVariation StaExtfmea, 311
General Object Methods, 155 StaExtfuelmea, 316
Isolate StaExtimea, 321
General Object Methods, 155 StaExtpfmea, 326
IsOpen StaExtpmea, 331
ElmCoup, 187 StaExtqmea, 336
ElmGndswt, 200 StaExtsmea, 341
StaSwitch, 361 StaExttapmea, 346
IsOutOfService StaExtv3mea, 351
General Object Methods, 156 StaExtvmea, 356
IsPQ IsValid
ElmAsm, 173 IntRas, 614
IsProjectFolderType
IntPrjfolder, 612 JumpTo
IsQuadBooster IntViewbookmark, 637
ElmTr2, 267 JumpToLastStep
ElmTr3, 271 ComContingency, 389
ElmTr4, 276
IsReducible ln
General Object Methods, 156 Mathematical Functions, 72
IsRelevant lnm
General Object Methods, 150 General Object Methods, 157
IsRmsValid Load
Global Functions, 24 ElmRes, 238
IsRowVisible IntComtrade, 557
ComTablereport, 470 IntComtradeset, 565
IsScenarioAttribute LoadData
Global Functions, 25 IntPrj, 607
IsShcValid LoadFile
Global Functions, 25 ElmFile, 193
IsShortCircuited LoadMicroSCADAFile
General Object Methods, 157 ComLink, 407
IsSimValid LoadProfile
Global Functions, 26 Global Functions, 26
IsSplitting LoadResData
ElmBoundary, 182 Global Functions, 27
IsStarted LoadSimulationState

739
INDEX INDEX

ComSim, 441 sinh, 80


LoadSnapshot sqr, 80
ComSim, 441 sqrt, 80
log tan, 80
Mathematical Functions, 73 tanh, 81
LossCostAtBusTech time, 81
ComCapo, 376 trunc, 81
twopi, 81
Mark MatrixInvert
SetLevelvis, 515 Mathematical Functions, 70
MarkInGraphics Max
General Object Methods, 158 IntVec, 632
Global Functions, 27 max
Set Routines, 709 Mathematical Functions, 73
MarkRegions mbprintf
ComSimoutage, 444 Output Window Functions, 117
Mathematical Functions, 63 mbschg
abs, 64 Multibyte Encoded String Functions, 113
acos, 64 mbscmp
asin, 64 Multibyte Encoded String Functions, 113
atan, 64 mbscpy
atan2, 64 Multibyte Encoded String Functions, 113
BinaryAnd, 65 mbslen
BinaryOr, 65 Multibyte Encoded String Functions, 114
CalcWeibullPar, 66 mbsprintf
ceil, 67 Multibyte Encoded String Functions, 114
cos, 67 mbsscanf
cosh, 67 Multibyte Encoded String Functions, 114
exp, 68 mbsstr
floor, 68 Multibyte Encoded String Functions, 114
frac, 68 mbstok
fRand, 69 Multibyte Encoded String Functions, 115
GetRandomNumber, 68 mdbClose
GetRandomNumberEx, 69 MS Access Functions, 82
InvertMatrix, 70 mdbExecuteSqlQuery
ln, 72 MS Access Functions, 82
log, 73 mdbExecuteSqlStatement
MatrixInvert, 70 MS Access Functions, 83
max, 73 mdbFetchResult
min, 73 MS Access Functions, 83
modulo, 73 mdbGetResultColumnCount
pi, 74 MS Access Functions, 84
pow, 74 mdbGetResultColumnName
Random, 68 MS Access Functions, 84
RndExp, 74 mdbGetResultColumnType
RndGetMethod, 74 MS Access Functions, 84
RndGetSeed, 75 mdbGetResultColumnValue
RndNormal, 75 MS Access Functions, 85
RndSetup, 76 mdbOpen
RndUnifInt, 78 MS Access Functions, 85
RndUnifReal, 78 mdbSetDebug
RndWeibull, 78 MS Access Functions, 90
round, 79 Mean
SetRandomSeed, 79 IntVec, 632
SetRandSeed, 79 MeasureLength
sin, 79 ElmLne, 208

740
INDEX INDEX

Merge xlSetRowHeight, 104


ComMerge, 413 xlSetTextColor, 104
MessageBox xlSetTextStyle, 105
Dialogue Boxes Functions, 51 xlSetValue, 106
Migrate xlSetValues, 106
IntPrj, 607 xlSetVerticalAlignment, 107
Min xlSetVisible, 108
IntVec, 632 xlSetWorksheetName, 108
min xlSetWrapText, 109
Mathematical Functions, 73 xlStart, 109
ModuleExists xlTerminate, 112
ComAddon, 373 MS Office Functions, 82
modulo Multibyte Encoded String Functions, 113
Mathematical Functions, 73 mbschg, 113
Move mbscmp, 113
General Object Methods, 158 mbscpy, 113
MoveToLayer mbslen, 114
IntGrf, 580 mbsprintf, 114
MS Access Functions, 82 mbsscanf, 114
mdbClose, 82 mbsstr, 114
mdbExecuteSqlQuery, 82 mbstok, 115
mdbExecuteSqlStatement, 83 tombchar, 115
mdbFetchResult, 83 tombcharcodepoint, 115
mdbGetResultColumnCount, 84 tombslower, 115
mdbGetResultColumnName, 84 tombsupper, 116
mdbGetResultColumnType, 84 Multiply
mdbGetResultColumnValue, 85 IntMat, 590
mdbOpen, 85
mdbSetDebug, 90 NCol
MS Excel Functions, 90 ComTablereport, 466
xlActivateWorksheet, 91 ElmRes, 232
xlAddWorksheet, 91 IntComtrade, 554
xlCloseWorkbook, 92 IntComtradeset, 563
xlDeleteWorksheet, 92 IntMat, 588
xlGetActiveWorksheetIndex, 93 Network Elements Methods, 167
xlGetDateSeparator, 93 NewStage
xlGetDecimalSeparator, 93 IntScheme, 621
xlGetThousandsSeparator, 93 Next
xlGetValue, 94 IntDplmap, 573
xlGetWorksheetCount, 94 Set Routines, 709
xlGetWorksheetName, 94 NextFilt
xlNewWorkbook, 95 Set Routines, 710
xlOpenWorkbook, 95 NextStepAvailable
xlResetTextStyle, 96 ComShctrace, 439
xlRunMacro, 96 NoFinalUpdate
xlSaveWorkbook, 97 Environment Functions, 59
xlSaveWorkbookAs, 97 NormaliseCombined
xlSetBorder, 98 IntPrj, 608
xlSetColumnWidth, 99 NRow
xlSetDebug, 100 ComTablereport, 466
xlSetFillColor, 100 ElmRes, 233
xlSetFontName, 101 IntComtrade, 555
xlSetFontSize, 101 IntComtradeset, 563
xlSetHorizontalAlignment, 102 IntMat, 588
xlSetNumberFormat, 103 NTap
xlSetPrintTitleRows, 103 ElmTr2, 267

741
INDEX INDEX

ElmTr3, 272 PrintComparisonReport


ElmTr4, 276 ComMerge, 413
ElmVoltreg, 283 printf
NVars Output Window Functions, 118
IntMon, 595 PrintModifications
ComMerge, 413
Obj IntSstage, 625
Set Routines, 710 PrintVal
Object Methods, 131 IntMon, 596
Open Purge
ElmCoup, 188 IntPrj, 608
ElmGndswt, 200 IntUser, 629
StaSwitch, 361 SetTboxconfig, 526
Other Objects Methods, 536 PurgeUnusedObjects
Output Window Functions, 116 General Object Methods, 160
ClearOutput, 116
ClearOutputWindow, 116 QuickAccessAvailable
Error, 116 ComUcteexp, 496
fWrite, 118
Info, 117 Random
mbprintf, 117 Mathematical Functions, 68
printf, 118 ReadValue
SetLineFeed, 119 IntSstage, 626
SetOutputWindowState, 119 Rebuild
Warn, 120 Global Functions, 28
Write, 120 ReceiveData
OutputFlexibleData ComLink, 408
Global Functions, 28 ComOpc, 420
Set Routines, 710 Reconnect
OverwriteRA ElmGenstat, 198
ElmSubstat, 250 ElmPvsys, 215
OvlAlleviate ElmSym, 255
ComRel3, 430 ReductionInMemory
ComRed, 428
Pack Refresh
BlkDef, 537 VisMagndiffplt, 667
PackAsMacro VisOcplot, 669
BlkDef, 537 Release
PackExternalReferences ElmRes, 238
IntPrj, 608 IntComtrade, 558
ParseDateLT IntComtradeset, 566
Date/Time Functions, 47 ReleaseMemory
ParseDateUTC IntScenario, 617
Date/Time Functions, 48 ReleaseResData
PasteCopy Global Functions, 29
General Object Methods, 159 ReloadProfile
pi Global Functions, 29
Mathematical Functions, 74 RelZpol, 637
PostCommand AssumeCompensationFactor, 637
Global Functions, 28 AssumeReRl, 637
pow AssumeXeXl, 638
Mathematical Functions, 74 Remove
PrintAllVal IntDplmap, 574
IntMon, 595 IntDplvec, 577
PrintCheckResults Set Routines, 710
ComLdf, 406 RemoveAllRas

742
INDEX INDEX

ComSimoutage, 445 StaExtcmdmea, 302


RemoveBreaker StaExtdatmea, 307
StaCubic, 294 StaExtfmea, 312
RemoveCmdsForStudyCaseRow StaExtfuelmea, 317
ComTasks, 486 StaExtimea, 322
RemoveContingencies StaExtpfmea, 327
ComSimoutage, 445 StaExtpmea, 332
RemoveEvents StaExtqmea, 337
ComContingency, 389 StaExtsmea, 341
ComOutage, 422 StaExttapmea, 346
ComRel3, 430 StaExtv3mea, 352
RemoveOutages StaExtvmea, 357
ComRel3, 430 ResetStatusBitTmp
RemoveParameter StaExtbrkmea, 297
CimModel, 541 StaExtcmdmea, 302
CimObject, 546 StaExtdatmea, 307
RemoveProjectFromCombined StaExtfmea, 312
IntPrj, 608 StaExtfuelmea, 317
RemoveRas StaExtimea, 322
ComSimoutage, 445 StaExtpfmea, 327
RemoveRow StaExtpmea, 332
ComTablereport, 470 StaExtqmea, 337
RemoveStudyCases StaExtsmea, 341
ComTasks, 487 StaExttapmea, 347
RemoveSwitchEvents StaExtv3mea, 352
IntEvt, 579 StaExtvmea, 357
RemoveVar ResetThirdPartyModule
IntMon, 596 BlkDef, 537
ReplaceNonAsciiCharacters ComDpl, 395
General Object Methods, 160 TypQdsl, 653
Report ResFirstValidObject
ComDllmanager, 391 Global Functions, 29
ReportNonAsciiCharacters ResFirstValidObjectVar
General Object Methods, 160 Global Functions, 30
ReportUnusedObjects ResFirstValidVar
General Object Methods, 160 Global Functions, 30
Reset ResGetMax
ComMerge, 414 Global Functions, 30
ComSimoutage, 445 ResGetMin
SetLevelvis, 515 Global Functions, 30
ResetAll ResIndex
IntOutage, 599 Global Functions, 30
ResetCalculation Resize
Global Functions, 29 ElmBoundary, 183
ResetDerating IntMat, 591
ElmGenstat, 198 IntVec, 633
ElmPvsys, 216 ResNextValidObject
ElmSym, 256 Global Functions, 31
ResetQuickAccess ResNextValidObjectVar
ComUcteexp, 497 Global Functions, 31
ResetRA ResNextValidVar
ElmSubstat, 250 Global Functions, 31
ResetReductionInMemory ResNval
ComRed, 428 Global Functions, 31
ResetStatusBit ResNvars
StaExtbrkmea, 296 Global Functions, 31

743
INDEX INDEX

ResSortToVar GetViolationTime, 642


Global Functions, 31 ScnSpeed, 642
Restore GetLimit, 643
IntPrj, 609 GetNumberOfViolations, 643
RndExp GetValue, 643
Mathematical Functions, 74 GetVariable, 643
RndGetMethod GetViolatedElement, 644
Mathematical Functions, 74 GetViolationTime, 644
RndGetSeed ScnSync, 644
Mathematical Functions, 75 GetLimit, 645
RndNormal GetNumberOfViolations, 645
Mathematical Functions, 75 GetValue, 645
RndSetup GetVariable, 645
Mathematical Functions, 76 GetViolatedElement, 646
RndUnifInt GetViolationTime, 646
Mathematical Functions, 78 ScnVar, 646
RndUnifReal GetLimit, 647
Mathematical Functions, 78 GetNumberOfViolations, 647
RndWeibull GetValue, 647
Mathematical Functions, 78 GetVariable, 647
Rollback GetViolatedElement, 648
IntVersion, 636 GetViolationTime, 648
round ScnVolt, 648
Mathematical Functions, 79 GetLimit, 649
RowLbl GetNumberOfViolations, 649
IntMat, 589, 591 GetValue, 649
GetVariable, 649
Save GetViolatedElement, 650
IntMat, 591 GetViolationTime, 650
IntScenario, 618 SearchObject
IntVec, 633 General Object Methods, 161
SaveAsRA SearchObjectByForeignKey
ElmSubstat, 250 Global Functions, 32
SaveAsScenario SearchScenario
Global Functions, 32 IntScensched, 620
SaveFile SelectToolbox
ElmFile, 194 Global Functions, 33
SaveScenarioAs SendData
Global Functions, 32 ComLink, 408
SaveSimulationState ComOpc, 420
ComSim, 441 SentDataStatus
SaveSnapshot ComLink, 409
ComSim, 441 Set Routines, 706
ScnFreq, 638 Add, 706
GetLimit, 638 Clear, 707
GetNumberOfViolations, 638 Count, 707
GetValue, 639 First, 707
GetVariable, 639 FirstFilt, 708
GetViolatedElement, 639 IsIn, 709
GetViolationTime, 640 MarkInGraphics, 709
ScnFrt, 640 Next, 709
GetLimit, 641 NextFilt, 710
GetNumberOfViolations, 641 Obj, 710
GetValue, 641 OutputFlexibleData, 710
GetVariable, 641 Remove, 710
GetViolatedElement, 642 ShowModalBrowser, 711

744
INDEX INDEX

ShowModalSelectBrowser, 711 ComTablereport, 471


ShowModelessBrowser, 711 SetCellEdit
SortToClass, 711 ComTablereport, 472
SortToName, 712 SetCellValueToBar
SortToVar, 712 ComTablereport, 472
Set SetCellValueToCheckbox
IntMat, 591 ComTablereport, 473
IntVec, 633 SetCellValueToDate
SetActiveModule ComTablereport, 474
ComAddon, 374 SetCellValueToDouble
SetAdaptX ComTablereport, 475
SetDesktop, 508 SetCellValueToInt
SetVipage, 531 ComTablereport, 476
VisPath, 670 SetCellValueToObject
VisPlot, 679 ComTablereport, 477
VisPlot2, 692 SetCellValueToString
SetAdaptY ComTablereport, 478
IntPlot, 599 SetCluster, 498
VisPath, 671 CalcCluster, 498
VisPlot, 680 GetNumberOfClusters, 498
VisPlot2, 693 SetColouring
SetAsDefault SetColscheme, 500
ElmRes, 239 SetColscheme, 499
SetAssociationValue CreateFilter, 499
CimModel, 542 SetColouring, 500
CimObject, 546, 547 SetFilter, 505
SetAttributeEnumeration SetColumnHeader
CimModel, 542, 543 ComTablereport, 479
CimObject, 547 SetColumnLabel
SetAttributeValue IntMat, 592
CimModel, 543 SetConsistencyCheck
CimObject, 548 Environment Functions, 59
SetAuthorityUri SetCrvDesc
ComGridtocim, 400 VisHrm, 664
SetAutoAssignmentForAll VisPlot, 682
ComMerge, 414 VisPlot2, 695
SetAutomaticCalculationResetEnabled SetCrvDescX
Environment Functions, 59 VisXyplot, 704
SetAutoScaleX SetCrvDescY
SetDesktop, 508 VisXyplot, 705
SetVipage, 532 SetCurveValue
VisHrm, 663 ComTablereport, 480
VisPlot, 680 SetDefScaleX
VisPlot2, 694 VisHrm, 665
SetAutoScaleY VisPlot, 682
IntPlot, 600 VisPlot2, 696
VisHrm, 664 SetDefScaleY
VisPlot, 681 VisHrm, 665
VisPlot2, 694 VisPlot, 683
SetBarLimits VisPlot2, 696
ComTablereport, 471 SetDesktop, 505
SetBatchMode AddPage, 506
ComUcte, 490 DoAutoScaleX, 506
SetBoundaries GetCanvasSize, 506
ComGridtocim, 400 GetPage, 507
SetCellAccess SetAdaptX, 508

745
INDEX INDEX

SetAutoScaleX, 508 ComDpl, 397


SetResults, 509 ComPython, 427
SetScaleX, 509 SetLayerVisibility
SetXVar, 510 IntGrfnet, 584
Show, 510 SetLevelvis, 513
WriteWMF, 511 AdaptWidth, 513
ZoomAll, 512 Align, 513
SetDetailed ChangeFont, 513
ElmLne, 209 ChangeFrameAndWidth, 513
SetDialogSize ChangeLayer, 514
ComTablereport, 480 ChangeRefPoints, 514
SetDiffMode ChangeWidthVisibilityAndColour, 514
Environment Functions, 60 Mark, 515
SetDisplayedButtons Reset, 515
SetTboxconfig, 526 SetLimits
SetDistrstate, 512 ComSimoutage, 446
CalcCluster, 512 SetLineFeed
SetElms Output Window Functions, 119
StoMaint, 650 SetListFilterSelection
SetEnableUserBreak ComTablereport, 481
Environment Functions, 62 SetLoadScaleAbsolute
SetExportHtml ElmZone, 287
ComTablereport, 481 SetMaxI
SetExportXls ElmRelay, 219
ComTablereport, 481 SetMaxIearth
SetExternalObject ElmRelay, 219
ComDpl, 395 SetMeaValue
ComPython, 426 StaExtbrkmea, 297
SetFileName StaExtcmdmea, 302
ComSvgexport, 446 StaExtdatmea, 307
ComSvgimport, 447 StaExtfmea, 312
SetFilt, 512 StaExtfuelmea, 317
Get, 512 StaExtimea, 322
SetFilter StaExtpfmea, 327
SetColscheme, 505 StaExtpmea, 332
SetFinalEchoOnEnabled StaExtqmea, 337
Environment Functions, 61 StaExtsmea, 342
SetGeoCoordinateSystem StaExttapmea, 347
IntPrj, 609 StaExtv3mea, 352
SetGraphicUpdate StaExtvmea, 357
Environment Functions, 61 SetMicroSCADAStatus
SetGridSelection ComLink, 409
ComUcteexp, 497 SetMinI
SetGridsToExport ElmRelay, 219
ComGridtocim, 400 SetMinIearth
SetGuiUpdateEnabled ElmRelay, 219
Environment Functions, 62 SetNumberFormatForPlot
SetImpedance ComTablereport, 482
ElmRelay, 218 SetNumSlave
SetInputParameterDouble SetParalman, 515
ComDpl, 396 SetObj
ComPython, 426 ElmRes, 239
SetInputParameterInt SetObject
ComDpl, 396 ComSvgexport, 446
ComPython, 427 ComSvgimport, 447
SetInputParameterString SetObjects

746
INDEX INDEX

ComSvgexport, 447 VisPlot, 683


SetObjectsToCompare VisPlot2, 697
ComMerge, 414 SetScaleY
SetObjs IntPlot, 601
ComOutage, 423 VisBdia, 656
SetOldDistributeLoadMode VisPath, 672
ComLdf, 407 VisPlot, 684
SetOPCReceiveQuality VisPlot2, 698
ComLink, 409 SetSelect, 519
SetOperationValue AddRef, 519
IntScenario, 618 All, 520
SetOutOfService AllAsm, 520
ElmRelay, 220 AllBars, 521
SetOutputWindowState AllBreakers, 521
Output Window Functions, 119 AllClosedBreakers, 521
SetParalman, 515 AllElm, 522
GetNumSlave, 515 AllLines, 522
SetNumSlave, 515 AllLoads, 523
SetTransfType, 516 AllOpenBreakers, 523
SetPassword AllSym, 523
IntUser, 629 AllTypLne, 524
SetPath, 516 Clear, 524
AllBreakers, 516 GetAll, 525
AllClosedBreakers, 517 SetShowAllUsers
AllOpenBreakers, 517 Global Functions, 33
AllProtectionDevices, 517 SetSize
Create, 517 General Object Methods, 161
GetAll, 518 SetSorting
GetBranches, 518 ComTablereport, 482
GetBuses, 518 SetStatus
GetPathFolder, 519 StaExtbrkmea, 297
SetPrimaryTap StaExtcmdmea, 302
StaCt, 287 StaExtdatmea, 307
SetRA StaExtfmea, 312
ElmSubstat, 251 StaExtfuelmea, 317
SetRandomSeed StaExtimea, 322
Mathematical Functions, 79 StaExtpfmea, 327
SetRandSeed StaExtpmea, 332
Mathematical Functions, 79 StaExtqmea, 337
SetRefresh StaExtsmea, 342
ComTablereport, 482 StaExttapmea, 347
SetRescheduleFlag StaExtv3mea, 352
Environment Functions, 62 StaExtvmea, 357
SetResults SetStatusBit
SetDesktop, 509 StaExtbrkmea, 298
SetVipage, 532 StaExtcmdmea, 303
SetResultsFolder StaExtdatmea, 308
ComTasks, 487 StaExtfmea, 313
SetResultString StaExtfuelmea, 318
ComDpl, 397 StaExtimea, 323
SetRowLabel StaExtpfmea, 328
IntMat, 592 StaExtpmea, 333
SetScaleX StaExtqmea, 338
SetDesktop, 509 StaExtsmea, 343
SetVipage, 533 StaExttapmea, 348
VisPath, 671 StaExtv3mea, 353

747
INDEX INDEX

StaExtvmea, 358 SetVipage, 534


SetStatusBitTmp SetTime, 526
StaExtbrkmea, 298 Date, 527
StaExtcmdmea, 303 ElmRelay, 220
StaExtdatmea, 308 SetTime, 527
StaExtfmea, 313 SetTimeUTC, 527
StaExtfuelmea, 318 Time, 528
StaExtimea, 323 SetTimeUTC
StaExtpfmea, 328 SetTime, 527
StaExtpmea, 333 Settings Methods, 498
StaExtqmea, 338 SetTitle
StaExtsmea, 343 ComTablereport, 484
StaExttapmea, 348 SetTransfType
StaExtv3mea, 353 SetParalman, 516
StaExtvmea, 358 SetUser, 528
SetStatusText GetNumProcesses, 528
ComTablereport, 483 SetUserBreakEnabled
SetStatusTmp Environment Functions, 62
StaExtbrkmea, 299 SetVal
StaExtcmdmea, 304 General Object Methods, 162
StaExtdatmea, 309 SetVipage, 529
StaExtfmea, 314 CreateVI, 531
StaExtfuelmea, 319 DoAutoScaleX, 529
StaExtimea, 324 DoAutoScaleY, 529
StaExtpfmea, 329 GetOrInsertPlot, 530
StaExtpmea, 334 GetVI, 530
StaExtqmea, 339 InsertPlot, 531
StaExtsmea, 343 SetAdaptX, 531
StaExttapmea, 348 SetAutoScaleX, 532
StaExtv3mea, 354 SetResults, 532
StaExtvmea, 359 SetScaleX, 533
SetStudyTime SetStyle, 534
IntCase, 550 SetTile, 534
SetStyle SetXVar, 535
SetVipage, 534 SetXVar
SetSubElmResKey SetDesktop, 510
ElmRes, 240 SetVipage, 535
SetSwitchShcEventMode VisPlot, 686
ComLink, 409 VisPlot2, 699
SetSymbolComponentVisibility SetXVariable
IntGrfnet, 584 VisBdia, 657
SetTboxconfig, 525 SetYVariable
Check, 525 VisBdia, 657
GetAvailableButtons, 525 Show
GetDisplayedButtons, 526 IntGrfnet, 585
Purge, 526 SetDesktop, 510
SetDisplayedButtons, 526 ShowBrowser
SetTextAxisDistForPlot ComMerge, 414
ComTablereport, 483 ShowEditDialog
SetThirdPartyModule General Object Methods, 163
BlkDef, 538 ShowFullName
ComDpl, 397 General Object Methods, 163
TypQdsl, 653 ShowModalBrowser
SetTicksForPlot Dialogue Boxes Functions, 52
ComTablereport, 483 Set Routines, 711
SetTile ShowModalOpenFileDialog

748
INDEX INDEX

Dialogue Boxes Functions, 53 SortToColumn


ShowModalSaveFileDialog IntMat, 593
Dialogue Boxes Functions, 54 SortToName
ShowModalSelectBrowser Set Routines, 712
Dialogue Boxes Functions, 55 SortToVar
Set Routines, 711 Set Routines, 712
ShowModalSelectFolderDialog SplitLine
Dialogue Boxes Functions, 56 Global Functions, 34
ShowModalSelectTree sprintf
General Object Methods, 164 String Functions, 123
ShowModelessBrowser sqr
Dialogue Boxes Functions, 56 Mathematical Functions, 80
Set Routines, 711 sqrt
ShowY2 Mathematical Functions, 80
VisPlot2, 700 sscanf
sin String Functions, 124
Mathematical Functions, 79 sscanfsep
sinh String Functions, 124
Mathematical Functions, 80 StaCt, 287
Size SetPrimaryTap, 287
IntDplmap, 574 StaCubic, 288
IntDplvec, 578 AddBreaker, 288
IntVec, 634 GetAll, 288
SizeX GetBranch, 289
ComTablereport, 466 GetConnectedMajorNodes, 289
ElmRes, 233 GetConnections, 290
IntComtrade, 555 GetNearestBusbars, 291
IntComtradeset, 563 GetPathToNearestBusbar, 292
IntMat, 588 GetRemoteBorderCubicles, 293
SizeY GetSwitch, 294
ComTablereport, 466 IsClosed, 294
ElmRes, 232 IsConnected, 294
IntComtrade, 554 RemoveBreaker, 294
IntComtradeset, 563 StaExtbrkmea, 295
IntMat, 588 CopyExtMeaStatusToStatusTmp, 295
Sleep GetMeaValue, 295
Global Functions, 33 GetStatus, 295
slotupd GetStatusTmp, 296
ElmComp, 185 InitTmp, 296
ElmRelay, 221 IsStatusBitSet, 296
SlotUpdate IsStatusBitSetTmp, 296
ElmComp, 185 ResetStatusBit, 296
ElmRelay, 221 ResetStatusBitTmp, 297
snm SetMeaValue, 297
General Object Methods, 164 SetStatus, 297
Sort SetStatusBit, 298
IntDplvec, 578 SetStatusBitTmp, 298
IntVec, 634 SetStatusTmp, 299
SortAccordingToColumn UpdateControl, 299
ElmRes, 240 UpdateCtrl, 299
IntComtrade, 558 StaExtcmdmea, 300
IntComtradeset, 566 CopyExtMeaStatusToStatusTmp, 300
SortToClass GetMeaValue, 300
Set Routines, 711 GetStatus, 300
SortToColum GetStatusTmp, 301
IntMat, 593 InitTmp, 301

749
INDEX INDEX

IsStatusBitSet, 301 SetMeaValue, 317


IsStatusBitSetTmp, 301 SetStatus, 317
ResetStatusBit, 302 SetStatusBit, 318
ResetStatusBitTmp, 302 SetStatusBitTmp, 318
SetMeaValue, 302 SetStatusTmp, 319
SetStatus, 302 UpdateControl, 319
SetStatusBit, 303 UpdateCtrl, 319
SetStatusBitTmp, 303 StaExtimea, 320
SetStatusTmp, 304 CopyExtMeaStatusToStatusTmp, 320
UpdateControl, 304 GetMeaValue, 320
UpdateCtrl, 304 GetStatus, 320
StaExtdatmea, 305 GetStatusTmp, 321
CopyExtMeaStatusToStatusTmp, 305 InitTmp, 321
CreateEvent, 305 IsStatusBitSet, 321
GetMeaValue, 305 IsStatusBitSetTmp, 321
GetStatus, 306 ResetStatusBit, 322
GetStatusTmp, 306 ResetStatusBitTmp, 322
InitTmp, 306 SetMeaValue, 322
IsStatusBitSet, 306 SetStatus, 322
IsStatusBitSetTmp, 306 SetStatusBit, 323
ResetStatusBit, 307 SetStatusBitTmp, 323
ResetStatusBitTmp, 307 SetStatusTmp, 324
SetMeaValue, 307 UpdateControl, 324
SetStatus, 307 UpdateCtrl, 324
SetStatusBit, 308 StaExtpfmea, 325
SetStatusBitTmp, 308 CopyExtMeaStatusToStatusTmp, 325
SetStatusTmp, 309 GetMeaValue, 325
UpdateControl, 309 GetStatus, 325
UpdateCtrl, 309 GetStatusTmp, 326
StaExtfmea, 310 InitTmp, 326
CopyExtMeaStatusToStatusTmp, 310 IsStatusBitSet, 326
GetMeaValue, 310 IsStatusBitSetTmp, 326
GetStatus, 310 ResetStatusBit, 327
GetStatusTmp, 311 ResetStatusBitTmp, 327
InitTmp, 311 SetMeaValue, 327
IsStatusBitSet, 311 SetStatus, 327
IsStatusBitSetTmp, 311 SetStatusBit, 328
ResetStatusBit, 312 SetStatusBitTmp, 328
ResetStatusBitTmp, 312 SetStatusTmp, 329
SetMeaValue, 312 UpdateControl, 329
SetStatus, 312 UpdateCtrl, 329
SetStatusBit, 313 StaExtpmea, 330
SetStatusBitTmp, 313 CopyExtMeaStatusToStatusTmp, 330
SetStatusTmp, 314 GetMeaValue, 330
UpdateControl, 314 GetStatus, 330
UpdateCtrl, 314 GetStatusTmp, 331
StaExtfuelmea, 315 InitTmp, 331
CopyExtMeaStatusToStatusTmp, 315 IsStatusBitSet, 331
GetMeaValue, 315 IsStatusBitSetTmp, 331
GetStatus, 315 ResetStatusBit, 332
GetStatusTmp, 316 ResetStatusBitTmp, 332
InitTmp, 316 SetMeaValue, 332
IsStatusBitSet, 316 SetStatus, 332
IsStatusBitSetTmp, 316 SetStatusBit, 333
ResetStatusBit, 317 SetStatusBitTmp, 333
ResetStatusBitTmp, 317 SetStatusTmp, 334

750
INDEX INDEX

UpdateControl, 334 GetStatusTmp, 351


UpdateCtrl, 334 InitTmp, 351
StaExtqmea, 335 IsStatusBitSet, 351
CopyExtMeaStatusToStatusTmp, 335 IsStatusBitSetTmp, 351
GetMeaValue, 335 ResetStatusBit, 352
GetStatus, 335 ResetStatusBitTmp, 352
GetStatusTmp, 336 SetMeaValue, 352
InitTmp, 336 SetStatus, 352
IsStatusBitSet, 336 SetStatusBit, 353
IsStatusBitSetTmp, 336 SetStatusBitTmp, 353
ResetStatusBit, 337 SetStatusTmp, 354
ResetStatusBitTmp, 337 UpdateControl, 354
SetMeaValue, 337 UpdateCtrl, 354
SetStatus, 337 StaExtvmea, 355
SetStatusBit, 338 CopyExtMeaStatusToStatusTmp, 355
SetStatusBitTmp, 338 GetMeaValue, 355
SetStatusTmp, 339 GetStatus, 355
UpdateControl, 339 GetStatusTmp, 356
UpdateCtrl, 339 InitTmp, 356
StaExtsmea, 340 IsStatusBitSet, 356
CopyExtMeaStatusToStatusTmp, 340 IsStatusBitSetTmp, 356
GetStatus, 340 ResetStatusBit, 357
GetStatusTmp, 340 ResetStatusBitTmp, 357
InitTmp, 340 SetMeaValue, 357
IsStatusBitSet, 341 SetStatus, 357
IsStatusBitSetTmp, 341 SetStatusBit, 358
ResetStatusBit, 341 SetStatusBitTmp, 358
ResetStatusBitTmp, 341 SetStatusTmp, 359
SetMeaValue, 342 UpdateControl, 359
SetStatus, 342 UpdateCtrl, 359
SetStatusBit, 343 Start
SetStatusBitTmp, 343 ComDiff, 390
SetStatusTmp, 343 StartTrace
UpdateControl, 344 ComContingency, 390
UpdateCtrl, 344 ComOutage, 423
StaExttapmea, 344 StaSwitch, 360
CopyExtMeaStatusToStatusTmp, 345 Close, 360
GetMeaValue, 345 IsClosed, 360
GetStatus, 345 IsOpen, 361
GetStatusTmp, 346 Open, 361
InitTmp, 346 StatFileGetXrange
IsStatusBitSet, 346 Global Functions, 34
IsStatusBitSetTmp, 346 StatFileResetXrange
ResetStatusBit, 346 Global Functions, 34
ResetStatusBitTmp, 347 StatFileSetXrange
SetMeaValue, 347 Global Functions, 35
SetStatus, 347 Station Elements Methods, 287
SetStatusBit, 348 StoMaint, 650
SetStatusBitTmp, 348 SetElms, 650
SetStatusTmp, 348 Stop
UpdateControl, 349 ComDiff, 390
UpdateCtrl, 349 StopTrace
StaExtv3mea, 350 ComContingency, 390
CopyExtMeaStatusToStatusTmp, 350 ComOutage, 423
GetMeaValue, 350 strchg
GetStatus, 350 String Functions, 125

751
INDEX INDEX

strcmp tombcharcodepoint
String Functions, 126 Multibyte Encoded String Functions, 115
strcpy tombslower
String Functions, 127 Multibyte Encoded String Functions, 115
strftime tombsupper
Date/Time Functions, 49 Multibyte Encoded String Functions, 116
String Functions, 121 ToStr
sprintf, 123 String Functions, 123
sscanf, 124 TotalLossCost
sscanfsep, 124 ComCapo, 377
strchg, 125 toupper
strcmp, 126 String Functions, 130
strcpy, 127 TransformGeoCoordinates
strlen, 127 IntPrj, 609
strstr, 128 trunc
strtok, 128 Mathematical Functions, 81
tochar, 129 twopi
tocharcodepoint, 129 Mathematical Functions, 81
tolower, 130 TypAsmo, 651
ToStr, 123 CalcElParams, 651
toupper, 130 TypLne, 651
strlen IsCable, 651
String Functions, 127 TypQdsl, 652
strstr Encrypt, 652
String Functions, 128 IsEncrypted, 652
strtok ResetThirdPartyModule, 653
String Functions, 128 SetThirdPartyModule, 653
SubscribeProjectReadOnly TypTr2, 653
IntPrj, 609 GetZeroSequenceHVLVT, 653
SubscribeProjectReadWrite
IntPrj, 609 unm
SummaryGrid General Object Methods, 166
Global Functions, 21 UnsubscribeProject
SwitchOff IntPrj, 610
General Object Methods, 165 Update
SwitchOn ChaVecfile, 539
General Object Methods, 165 ComSimoutage, 446
ElmBmu, 180
tan ElmBoundary, 183
Mathematical Functions, 80 ElmBranch, 183
tanh ElmCabsys, 185
Mathematical Functions, 81 IntDplmap, 574
TerminateSession IntSscheduler, 622
IntUser, 630 UpdateControl
Time StaExtbrkmea, 299
SetTime, 528 StaExtcmdmea, 304
time StaExtdatmea, 309
Mathematical Functions, 81 StaExtfmea, 314
tochar StaExtfuelmea, 319
String Functions, 129 StaExtimea, 324
tocharcodepoint StaExtpfmea, 329
String Functions, 129 StaExtpmea, 334
tolower StaExtqmea, 339
String Functions, 130 StaExtsmea, 344
tombchar StaExttapmea, 349
Multibyte Encoded String Functions, 115 StaExtv3mea, 354

752
INDEX INDEX

StaExtvmea, 359 DoAutoScaleOnImpedances, 659


UpdateCtrl DoAutoScaleX, 659
StaExtbrkmea, 299 DoAutoScaleY, 660
StaExtcmdmea, 304 VisHrm, 660
StaExtdatmea, 309 Clear, 660
StaExtfmea, 314 DoAutoScaleX, 661
StaExtfuelmea, 319 DoAutoScaleY, 661
StaExtimea, 324 GetDataSource, 662
StaExtpfmea, 329 GetScaleObjX, 662
StaExtpmea, 334 GetScaleObjY, 663
StaExtqmea, 339 SetAutoScaleX, 663
StaExtsmea, 344 SetAutoScaleY, 664
StaExttapmea, 349 SetCrvDesc, 664
StaExtv3mea, 354 SetDefScaleX, 665
StaExtvmea, 359 SetDefScaleY, 665
UpdateFromCurrentView VisMagndiffplt, 666
IntViewbookmark, 637 AddRelay, 666
UpdateGroups AddRelays, 666
IntUserman, 631 Clear, 667
UpdateStatistics DoAutoScaleX, 667
IntPrj, 610 DoAutoScaleY, 667
UpdateSubstationTerminals Refresh, 667
ElmTerm, 263 VisOcplot, 667
UpdateTableReports AddRelay, 668
Dialogue Boxes Functions, 57 AddRelays, 668
UpdateTablesByCalcPeriod Clear, 668
ComTececo, 488 DoAutoScaleX, 668
DoAutoScaleY, 668
ValidateConstraints Refresh, 669
ComRel3, 431 VisPath, 669
validLDF Clear, 669
Global Functions, 24 DoAutoScaleX, 669
validRMS DoAutoScaleY, 670
Global Functions, 24 SetAdaptX, 670
validSHC SetAdaptY, 671
Global Functions, 25 SetScaleX, 671
validSIM SetScaleY, 672
Global Functions, 26 VisPcompdiffplt, 673
VarExists AddRelay, 673
General Object Methods, 166 AddRelays, 673
View CentreOrigin, 673
IntUrl, 629 Clear, 674
VisBdia, 654 DoAutoScaleX, 674
AddObjs, 654 DoAutoScaleY, 674
AddResObjs, 655 VisPlot2, 687
Clear, 655 AddResVars, 687
SetScaleY, 656 AddVars, 688
SetXVariable, 657 Clear, 688
SetYVariable, 657 DoAutoScaleX, 689
VisDraw, 658 DoAutoScaleY, 690
AddRelay, 658 DoAutoScaleY2, 690
AddRelays, 658 GetDataSource, 691
CentreOrigin, 659 GetScaleObjX, 691
Clear, 659 GetScaleObjY, 692
DoAutoScaleOnAll, 659 SetAdaptX, 692
DoAutoScaleOnCharacteristics, 659 SetAdaptY, 693

753
INDEX INDEX

SetAutoScaleX, 694 WriteValue


SetAutoScaleY, 694 IntSstage, 626
SetCrvDesc, 695 WriteWMF
SetDefScaleX, 696 SetDesktop, 511
SetDefScaleY, 696
SetScaleX, 697 xlActivateWorksheet
SetScaleY, 698 MS Excel Functions, 91
SetXVar, 699 xlAddWorksheet
ShowY2, 700 MS Excel Functions, 91
VisPlot, 674 xlCloseWorkbook
AddResVars, 675 MS Excel Functions, 92
AddVars, 675 xlDeleteWorksheet
Clear, 676 MS Excel Functions, 92
DoAutoScaleX, 676 xlGetActiveWorksheetIndex
DoAutoScaleY, 677 MS Excel Functions, 93
GetDataSource, 677 xlGetDateSeparator
GetIntCalcres, 678 MS Excel Functions, 93
GetScaleObjX, 678 xlGetDecimalSeparator
GetScaleObjY, 679 MS Excel Functions, 93
SetAdaptX, 679 xlGetThousandsSeparator
SetAdaptY, 680 MS Excel Functions, 93
SetAutoScaleX, 680 xlGetValue
SetAutoScaleY, 681 MS Excel Functions, 94
SetCrvDesc, 682 xlGetWorksheetCount
SetDefScaleX, 682 MS Excel Functions, 94
SetDefScaleY, 683 xlGetWorksheetName
SetScaleX, 683 MS Excel Functions, 94
SetScaleY, 684 xlNewWorkbook
SetXVar, 686 MS Excel Functions, 95
VisPlottz, 700 xlOpenWorkbook
AddRelay, 701 MS Excel Functions, 95
AddRelays, 701 xlResetTextStyle
Clear, 701 MS Excel Functions, 96
DoAutoScaleX, 701 xlRunMacro
DoAutoScaleY, 701 MS Excel Functions, 96
VisVec, 702 xlSaveWorkbook
CentreOrigin, 702 MS Excel Functions, 97
VisVecres, 702 xlSaveWorkbookAs
CentreOrigin, 702 MS Excel Functions, 97
VisXyplot, 702 xlSetBorder
Clear, 702 MS Excel Functions, 98
DoAutoScaleX, 703 xlSetColumnWidth
DoAutoScaleY, 703 MS Excel Functions, 99
GetDataSource, 704 xlSetDebug
SetCrvDescX, 704 MS Excel Functions, 100
SetCrvDescY, 705 xlSetFillColor
MS Excel Functions, 100
Warn xlSetFontName
Output Window Functions, 120 MS Excel Functions, 101
WereModificationsFound xlSetFontSize
ComMerge, 414 MS Excel Functions, 101
Write xlSetHorizontalAlignment
ElmRes, 241 MS Excel Functions, 102
Output Window Functions, 120 xlSetNumberFormat
WriteDraw MS Excel Functions, 103
ElmRes, 241 xlSetPrintTitleRows

754
INDEX INDEX

MS Excel Functions, 103


xlSetRowHeight
MS Excel Functions, 104
xlSetTextColor
MS Excel Functions, 104
xlSetTextStyle
MS Excel Functions, 105
xlSetValue
MS Excel Functions, 106
xlSetValues
MS Excel Functions, 106
xlSetVerticalAlignment
MS Excel Functions, 107
xlSetVisible
MS Excel Functions, 108
xlSetWorksheetName
MS Excel Functions, 108
xlSetWrapText
MS Excel Functions, 109
xlStart
MS Excel Functions, 109
xlTerminate
MS Excel Functions, 112

ZeroDerivative
ComInc, 403
ZoomAll
SetDesktop, 512

755

You might also like