REKLAMA

VBA.pdf

WinCC: Problemy ze skryptami w C i pytanie o VBA oraz polecane publikacje

Visual Basic for Application używa się od wersji 6.0. Co do kursu to polecam książki do nauki języka VB oraz excela ponieważ w excelu jest wykorzystywany VBA. W załączniku dorzucam to co dostałem od siemensa.


Pobierz plik - link do postu

11.05

Contents

Contents
1

Introduction: Using VBA in WinCC .................................................... 1
1.1
1.2
1.3
1.4

2

Differentiation: Deployment of VBA........................................................... 2
Organizing VBA Code in a WinCC Project................................................ 3
How to export and import VBA code ......................................................... 6
Executing VBA macros in the Graphics Designer..................................... 7

VBA in the Graphics Designer............................................................ 9
2.1
2.2
2.2.1
2.2.1.1
2.2.1.2
2.2.1.3
2.2.1.4
2.2.1.5
2.2.1.6
2.2.1.7
2.2.1.8
2.2.2
2.2.2.1
2.2.2.2
2.3
2.3.1
2.3.2
2.3.3
2.4
2.4.1
2.4.1.1
2.4.1.2
2.4.2
2.4.3
2.4.3.1
2.4.3.2
2.4.4
2.4.4.1
2.5
2.5.1
2.5.1.1
2.5.1.2
2.5.1.3
2.5.1.4
2.5.2
2.5.2.1
2.5.2.2
2.5.2.3
2.5.3
2.5.4
2.6
2.7

Printout of the Online Help
Automated Configuring

Adapting Graphics Designer with VBA.................................................... 10
Language-dependent configuring with VBA............................................ 11
Creating your own menus and toolbars................................................... 13
How to Create a New Application-Specific Menu.................................... 15
How to Add a New Menu Item to Menu................................................... 17
How to Create Menus in Multiple Languages ......................................... 20
How to Create a New Application-Specific Toolbar ................................ 23
How to Add a New Tool Icon to Toolbar.................................................. 25
How to Assign Help Texts to Menus and Toolbars ................................. 28
How to Assign VBA Macros to Menus and Toolbars .............................. 31
Configuring menus and toolbars ............................................................. 35
Access to the component library with VBA.............................................. 36
How to Edit the Component Library with VBA......................................... 39
How to Insert an Object from the Component Library into a
Picture with VBA...................................................................................... 42
Editing Pictures with VBA........................................................................ 44
How to Create Picture-Specific Menus and Toolbars ............................. 45
Editing layers with VBA ........................................................................... 47
Editing a copy of a picture with VBA ....................................................... 49
Editing objects with VBA ......................................................................... 51
Standard, Smart and Windows objects ................................................... 53
How to Edit Standard, Smart and Windows Objects............................... 55
OLE objects ............................................................................................. 59
ActiveX controls....................................................................................... 61
Group objects .......................................................................................... 63
How to Edit Group Objects with VBA ...................................................... 65
How to Edit Objects in a Group Object with VBA.................................... 69
Customized objects ................................................................................. 72
How to Edit a Customized Object with VBA ............................................ 74
Creating Dynamics with VBA .................................................................. 77
Adding dynamics to properties of pictures and objects........................... 79
How to Dynamize a Property with Tag Connection................................. 81
How to Dynamize a Property with Dynamic Dialog................................. 83
How to Dynamize a Property with a C Script .......................................... 85
How to Dynamize a Property with a VB Script ........................................ 87
Configuring event-controlled actions with VBA ....................................... 89
How to Configure a Direct Connection with VBA .................................... 91
How to Configure an Event-Oriented C Action with VBA ........................ 93
How to Configure an Event-Oriented VB action with VBA ...................... 95
Editing triggers......................................................................................... 97
Examples of editing triggers with VBA .................................................... 98
Event handling....................................................................................... 101
Access to external applications with VBA ............................................. 104

i

Contents

11.05

2.7.1

3

Addins .............................................................................................. 113
3.1
3.1.1
3.2
3.2.1

4

VBA in Tag Management ...................................................................... 127
CloseTag Function ................................................................................ 130
CommitTag Function ............................................................................. 132
CreateTag Function............................................................................... 134
DeleteTag Function ............................................................................... 136
GetTag Function.................................................................................... 137
ListTag function ..................................................................................... 138
VBA in Tag Logging............................................................................... 140
CloseTlgArchive .................................................................................... 146
CloseTlgTag .......................................................................................... 148
CommitTlgArchive ................................................................................. 150
CommitTlgTag ....................................................................................... 152
CreateTlgArchive Function.................................................................... 154
CreateTlgTag Function.......................................................................... 157
DeleteTlgArchive ................................................................................... 163
DeleteTlgTag Function .......................................................................... 164
GetTlgArchive........................................................................................ 165
GetTlgTag.............................................................................................. 166
ListTlgArchive Function ......................................................................... 168
ListTlgTag Function ............................................................................... 170
VBA in the Text Library ......................................................................... 172
CreateTextLanguage Function.............................................................. 173
CreateText Function .............................................................................. 174
DeleteText Function .............................................................................. 176
DeleteTextLanguage Function .............................................................. 178
GetText Function ................................................................................... 179
GetTextID Function ............................................................................... 180
ModifyText Function .............................................................................. 182
ListText Function ................................................................................... 184
VBA in Alarm Logging ........................................................................... 186
CloseSingleAlarm .................................................................................. 190
CommitSingleAlarm............................................................................... 192
CreateSingleAlarm Function ................................................................. 194
DeleteSingleAlarm Function.................................................................. 198
GetSingleAlarm Function ...................................................................... 199
ListSingleAlarm Function....................................................................... 200

VBA Reference................................................................................. 203
5.1
5.2
5.3
5.4
5.4.1
5.4.1.1
5.4.1.2

ii

Linking Addins ....................................................................................... 114
Loading an Addin in the Graphics Designer.......................................... 115
Example: Creating Addins..................................................................... 117
Example: Creating an Add In with Visual Basic 6.0 .............................. 118

VBA in Other WinCC Editors .......................................................... 125
4.1
4.1.1
4.1.2
4.1.3
4.1.4
4.1.5
4.1.6
4.2
4.2.1
4.2.2
4.2.3
4.2.4
4.2.5
4.2.6
4.2.7
4.2.8
4.2.9
4.2.10
4.2.11
4.2.12
4.3
4.3.1
4.3.2
4.3.3
4.3.4
4.3.5
4.3.6
4.3.7
4.3.8
4.4
4.4.1
4.4.2
4.4.3
4.4.4
4.4.5
4.4.6

5

Example: access to MS Excel with VBA ............................................... 105

VBA Reference: HMIObjects................................................................. 204
VBA Reference: ActionDynamic............................................................ 205
VBA Reference: Languages.................................................................. 206
Events.................................................................................................... 207
VBA Events: A-D ................................................................................... 207
Activated Event...................................................................................... 207
BeforeClose Event................................................................................. 208

Printout of the Online Help
Automated Configuring

11.05

Contents

5.4.1.3
5.4.1.4
5.4.1.5
5.4.1.6
5.4.1.7
5.4.1.8
5.4.1.9
5.4.1.10
5.4.1.11
5.4.1.12
5.4.1.13
5.4.1.14
5.4.1.15
5.4.1.16
5.4.1.17
5.4.1.18
5.4.2
5.4.2.1
5.4.2.2
5.4.2.3
5.4.2.4
5.4.2.5
5.4.2.6
5.4.2.7
5.4.2.8
5.4.2.9
5.4.2.10
5.4.2.11
5.4.2.12
5.4.2.13
5.4.2.14
5.4.2.15
5.4.2.16
5.4.2.17
5.5
5.5.1
5.5.1.1
5.5.1.2
5.5.1.3
5.5.1.4
5.5.1.5
5.5.1.6
5.5.1.7
5.5.1.8
5.5.1.9
5.5.1.10
5.5.1.11
5.5.1.12
5.5.1.13
5.5.1.14
5.5.1.15
5.5.1.16
5.5.1.17
5.5.1.18
5.5.1.19

Printout of the Online Help
Automated Configuring

BeforeDocumentClose Event ................................................................ 209
BeforeDocumentSave Event ................................................................. 210
BeforeHMIObjectDelete Event .............................................................. 211
BeforeLibraryFolderDelete Event .......................................................... 212
BeforeLibraryObjectDelete Event.......................................................... 213
BeforeQuit Event ................................................................................... 214
BeforeSave Event.................................................................................. 215
BeforeVisibleFalse Event ...................................................................... 216
ConnectionEvent Event ......................................................................... 217
DataLanguageChanged Event .............................................................. 218
DesktopLanguageChanged Event ........................................................ 219
DocumentActivated Event ..................................................................... 220
DocumentCreated Event ....................................................................... 221
DocumentOpened Event ....................................................................... 222
DocumentSaved Event.......................................................................... 223
DocumentPropertyChanged Event........................................................ 224
VBA Events: F-Z.................................................................................... 225
HMIObjectAdded Event......................................................................... 225
HMIObjectMoved Event ........................................................................ 226
HMIObjectPropertyChanged Event ....................................................... 227
HMIObjectResized Event ...................................................................... 228
LibraryFolderRenamed Event ............................................................... 229
LibraryObjectRenamed Event ............................................................... 230
LibraryObjectAdded Event .................................................................... 231
MenuItemClicked Event ........................................................................ 232
NewLibraryFolder Event ........................................................................ 234
NewLibraryObject Event........................................................................ 235
Opened Event........................................................................................ 236
Saved Event .......................................................................................... 237
SelectionChanged Event....................................................................... 238
Started Event......................................................................................... 239
ToolbarItemClicked Event ..................................................................... 240
ViewCreated Event................................................................................ 242
WindowStateChange Event .................................................................. 244
Methods................................................................................................. 245
VBA Methods: A-C ................................................................................ 245
Activate Method..................................................................................... 245
Add Method ........................................................................................... 246
Add Method (AnalogResultInfos Listing) ............................................... 247
Add Method (Documents Listing) .......................................................... 249
Add Method (GroupedObjects Listing) .................................................. 250
Add Method (CustomToolbars Listing).................................................. 252
Add Method (VariableTriggers Listing).................................................. 254
Add Method (Views Listing)................................................................... 255
AddAction Method ................................................................................. 256
AddActiveXControl Method ................................................................... 257
AddFolder Method ................................................................................. 260
AddFromClipboard Method ................................................................... 261
AddHMIObject Method .......................................................................... 263
AddItem Method .................................................................................... 264
AddOLEObject Method ......................................................................... 265
AlignBottom Method .............................................................................. 268
AlignLeft Method.................................................................................... 269
AlignRight Method ................................................................................. 270
AlignTop Method ................................................................................... 271

iii

Contents

11.05

5.5.1.20
5.5.1.21
5.5.1.22
5.5.1.23
5.5.1.24
5.5.1.25
5.5.1.26
5.5.1.27
5.5.1.28
5.5.1.29
5.5.1.30
5.5.1.31
5.5.1.32
5.5.2
5.5.2.1
5.5.2.2
5.5.2.3
5.5.2.4
5.5.2.5
5.5.2.6
5.5.2.7
5.5.2.8
5.5.2.9
5.5.2.10
5.5.2.11
5.5.2.12
5.5.2.13
5.5.2.14
5.5.2.15
5.5.2.16
5.5.2.17
5.5.2.18
5.5.2.19
5.5.2.20
5.5.2.21
5.5.2.22
5.5.2.23
5.5.2.24
5.5.2.25
5.5.2.26
5.5.2.27
5.5.2.28
5.5.3
5.5.3.1
5.5.3.2
5.5.3.3
5.5.3.4
5.5.3.5
5.5.3.6
5.5.3.7
5.5.3.8
5.5.3.9
5.5.3.10
5.5.3.11
5.5.3.12

iv

ArrangeMinimizedWindows Method...................................................... 272
CascadeWindows Method..................................................................... 273
CenterHorizontally Method.................................................................... 274
CenterVertically Method ........................................................................ 275
CheckSyntax Method ............................................................................ 276
Close Method ........................................................................................ 277
CloseAll Method .................................................................................... 278
ConvertToScript Method ....................................................................... 279
CopySelection Method .......................................................................... 281
CopyToClipboard Method ..................................................................... 283
CreateCustomizedObject Method ......................................................... 284
CreateDynamic Method......................................................................... 286
CreateGroup Method............................................................................. 288
VBA Methods: D-M................................................................................ 290
Delete Method ....................................................................................... 290
DeleteAll Method ................................................................................... 291
DeleteDynamic Method ......................................................................... 292
DeselectAll Method................................................................................ 293
Destroy Method ..................................................................................... 294
DuplicateSelection Method.................................................................... 295
EvenlySpaceHorizontally Method.......................................................... 297
EvenlySpaceVertically Method.............................................................. 299
Export Method ....................................................................................... 301
Find Method........................................................................................... 302
FindByDisplayName Method................................................................. 304
FlipHorizontally Method ......................................................................... 305
FlipVertically Method ............................................................................. 307
GetItemByPath Method ......................................................................... 309
InsertFromMenuItem Method ................................................................ 310
InsertMenu Method................................................................................ 312
InsertMenuItem Method ........................................................................ 314
InsertSeparator Method......................................................................... 316
InsertSubmenu Method ......................................................................... 317
InsertToolbarItem Method ..................................................................... 319
IsCSLayerVisible Method ...................................................................... 321
IsRTLayerVisible Method ...................................................................... 322
Item Method........................................................................................... 323
ItemByLcid Method................................................................................ 324
LoadDefaultConfig Method.................................................................... 326
MoveOneLayerDowncMethod............................................................... 327
MoveOneLayerUp Method .................................................................... 328
MoveSelection Method .......................................................................... 329
VBA Methods: O-Z ................................................................................ 331
BackwardOneLevel Method .................................................................. 331
ForwardOneLevel Method..................................................................... 333
Open Method......................................................................................... 334
PasteClipboard Method ......................................................................... 335
PrintDocument Method.......................................................................... 336
PrintProjectDocumentation Method....................................................... 337
Remove Method .................................................................................... 338
Rotate Method ....................................................................................... 340
SameHeight Method.............................................................................. 342
SameWidth Method ............................................................................... 344
SameWidthAndHeight Method .............................................................. 346
Save Method ......................................................................................... 348

Printout of the Online Help
Automated Configuring

11.05

Contents

5.5.3.13
5.5.3.14
5.5.3.15
5.5.3.16
5.5.3.17
5.5.3.18
5.5.3.19
5.5.3.20
5.5.3.21
5.5.3.22
5.5.3.23
5.5.3.24
5.5.3.25
5.5.3.26
5.5.3.27
5.6
5.6.1
5.6.1.1
5.6.1.2
5.6.1.3
5.6.1.4
5.6.1.5
5.6.1.6
5.6.1.7
5.6.1.8
5.6.1.9
5.6.1.10
5.6.1.11
5.6.1.12
5.6.1.13
5.6.1.14
5.6.1.15
5.6.1.16
5.6.2
5.6.2.1
5.6.2.2
5.6.2.3
5.6.2.4
5.6.2.5
5.6.2.6
5.6.2.7
5.6.2.8
5.6.2.9
5.6.2.10
5.6.2.11
5.6.2.12
5.6.2.13
5.6.2.14
5.6.2.15
5.6.2.16
5.6.2.17
5.6.2.18
5.6.2.19
5.6.2.20
5.6.2.21

Printout of the Online Help
Automated Configuring

SaveAll Method ..................................................................................... 349
SaveAs Method ..................................................................................... 350
SaveDefaultConfig Method ................................................................... 351
SelectAll Method.................................................................................... 352
SetCSLayerVisible Method ................................................................... 354
SetDeclutterObjectSize Method ............................................................ 355
SetRTLayerVisible Method.................................................................... 356
ShowPropertiesDialog Method.............................................................. 357
ShowSymbolLibraryDialog Method ....................................................... 358
ShowTagDialog Method ........................................................................ 359
TileWindowsHorizontally Method .......................................................... 360
TileWindowsVertically Method .............................................................. 361
SendToBack Method ............................................................................. 362
BringToFront Method............................................................................. 364
Ungroup Method.................................................................................... 366
Objects and Listings .............................................................................. 368
VBA Objects and Listings: 0-9 and A-C ................................................ 368
3DBarGraph Object ............................................................................... 368
Actions Object (Listing) ......................................................................... 371
ActiveXControl Object ........................................................................... 373
AnalogResultInfo Object........................................................................ 375
AnalogResultInfos Object (Listing) ........................................................ 376
Application Object.................................................................................. 378
ApplicationWindow Object..................................................................... 380
BarGraph Object.................................................................................... 382
BinaryResultInfo Object......................................................................... 386
BitResultInfo Object............................................................................... 387
Button Object......................................................................................... 388
CheckBox Object................................................................................... 391
Circle Object .......................................................................................... 393
CircularArc Object ................................................................................. 395
ConnectionPoints Object (Listing) ......................................................... 397
CustomizedObject Object...................................................................... 399
VBA Objects and Listings: D-I ............................................................... 401
DataLanguage Object ........................................................................... 401
DataLanguages Object (Listing)............................................................ 402
DestLink Object ..................................................................................... 404
DirectConnection Object ....................................................................... 406
Document Object................................................................................... 408
Documents Object (Listing) ................................................................... 410
DynamicDialog Object ........................................................................... 412
Ellipse Object......................................................................................... 414
EllipseArc Object ................................................................................... 416
EllipseSegment Object .......................................................................... 417
Event Object .......................................................................................... 420
Events Object (Listing) .......................................................................... 420
FolderItem Object .................................................................................. 424
FolderItems Object (Listing) .................................................................. 426
GraphicObject Object ............................................................................ 428
Group Object ......................................................................................... 430
GroupDisplay Object ............................................................................. 432
GroupedObjects Object (Listing) ........................................................... 435
HMIDefaultObjects Object (Listing) ....................................................... 437
HMIObject Object .................................................................................. 440
HMIObjects Object (Listing) .................................................................. 442

v

Contents

11.05

5.6.2.22
5.6.3
5.6.3.1
5.6.3.2
5.6.3.3
5.6.3.4
5.6.3.5
5.6.3.6
5.6.3.7
5.6.3.8
5.6.3.9
5.6.3.10
5.6.3.11
5.6.3.12
5.6.3.13
5.6.3.14
5.6.3.15
5.6.3.16
5.6.3.17
5.6.3.18
5.6.3.19
5.6.3.20
5.6.3.21
5.6.3.22
5.6.4
5.6.4.1
5.6.4.2
5.6.4.3
5.6.4.4
5.6.4.5
5.6.4.6
5.6.4.7
5.6.4.8
5.6.4.9
5.6.4.10
5.6.4.11
5.6.4.12
5.6.4.13
5.6.4.14
5.6.4.15
5.6.4.16
5.6.4.17
5.6.4.18
5.6.4.19
5.6.4.20
5.6.4.21
5.6.4.22
5.6.4.23
5.7
5.7.1
5.7.1.1
5.7.1.2
5.7.1.3
5.7.1.4
5.7.1.5

vi

IOField Object........................................................................................ 444
VBA Objects and Listings: L-P .............................................................. 447
LanguageFont Object............................................................................ 447
LanguageFonts Object (Listing) ............................................................ 447
LanguageText Object ............................................................................ 450
LanguageTexts Object (Listing) ............................................................ 450
Layer Object .......................................................................................... 453
Layers Object (Listing)........................................................................... 455
Line Object ............................................................................................ 457
Menu Object .......................................................................................... 459
Menus Object (Listing)........................................................................... 461
MenuItem Object ................................................................................... 463
MenuItems Object (Listing) ................................................................... 465
ObjConnection Object ........................................................................... 467
OLEObject Object.................................................................................. 470
OptionGroup Object............................................................................... 472
PictureWindow Object ........................................................................... 475
PieSegment Object................................................................................ 476
Polygon Object ...................................................................................... 479
PolyLine Object ..................................................................................... 481
Property Object...................................................................................... 482
Properties Object (Listing)..................................................................... 485
QualityCodeStateValue Object.............................................................. 487
QualityCodeStateValues Object (Listing) .............................................. 488
VBA Objects and Listings: R-Z.............................................................. 491
Rectangle Object ................................................................................... 491
RoundButton Object .............................................................................. 493
RoundRectangle Object ........................................................................ 496
ScriptInfo Object .................................................................................... 498
Selection Object (Listing) ...................................................................... 500
Slider Object .......................................................................................... 502
SourceLink Object ................................................................................. 505
StaticText Object ................................................................................... 507
StatusDisplay Object ............................................................................. 510
SymbolLibrary Object ............................................................................ 512
SymbolLibraries Object (Listing) ........................................................... 513
TextList Object....................................................................................... 513
Toolbar Object ....................................................................................... 517
Toolbars Object (Listing) ....................................................................... 519
ToolbarItem Object ................................................................................ 520
ToolbarItems Object (Listing) ................................................................ 523
Trigger Object........................................................................................ 525
VariableStateValue Object .................................................................... 527
VariableStateValues Object (Listing)..................................................... 528
VariableTrigger Object........................................................................... 530
VariableTriggers Object (Listing)........................................................... 532
View Object ........................................................................................... 534
Views Object (Listing)............................................................................ 536
Characteristics....................................................................................... 536
VBA Properties: A.................................................................................. 537
Actions Property .................................................................................... 537
ActiveDocument Property...................................................................... 539
ActiveLayer Property ............................................................................. 540
ActualPointLeft Property........................................................................ 541
ActualPointTop Property ....................................................................... 542

Printout of the Online Help
Automated Configuring

11.05

Contents

5.7.1.6
5.7.1.7
5.7.1.8
5.7.1.9
5.7.1.10
5.7.1.11
5.7.1.12
5.7.1.13
5.7.1.14
5.7.1.15
5.7.1.16
5.7.1.17
5.7.1.18
5.7.1.19
5.7.1.20
5.7.1.21
5.7.1.22
5.7.1.23
5.7.1.24
5.7.1.25
5.7.1.26
5.7.2
5.7.2.1
5.7.2.2
5.7.2.3
5.7.2.4
5.7.2.5
5.7.2.6
5.7.2.7
5.7.2.8
5.7.2.9
5.7.2.10
5.7.2.11
5.7.2.12
5.7.2.13
5.7.2.14
5.7.2.15
5.7.2.16
5.7.2.17
5.7.2.18
5.7.2.19
5.7.2.20
5.7.2.21
5.7.2.22
5.7.2.23
5.7.2.24
5.7.2.25
5.7.2.26
5.7.2.27
5.7.2.28
5.7.2.29
5.7.2.30
5.7.2.31
5.7.2.32
5.7.2.33

Printout of the Online Help
Automated Configuring

AdaptBorder Property............................................................................ 543
AdaptPicture Property ........................................................................... 544
AdaptSize Property................................................................................ 545
AlarmHigh Property ............................................................................... 546
AlarmLow Property ................................................................................ 547
Alignment Property ................................................................................ 548
AlignmentLeft Property .......................................................................... 549
AlignmentTop Property.......................................................................... 550
AnalogResultInfos Property................................................................... 551
AngleAlpha Property.............................................................................. 552
AngleBeta Property ............................................................................... 553
Application Property .............................................................................. 554
ApplicationDataPath Property ............................................................... 555
Assignments Property ........................................................................... 556
AssumeOnExit Property ........................................................................ 557
AssumeOnFull Property ........................................................................ 558
AutomationName Property .................................................................... 559
AvailableDataLanguages Property........................................................ 562
Average Property................................................................................... 563
Axe Property.......................................................................................... 564
AxisSection Property ............................................................................. 565
VBA Properties: B.................................................................................. 566
BackBorderWidth Property.................................................................... 566
BackColor Property ............................................................................... 567
BackColor2 Property ............................................................................. 568
BackColor3 Property ............................................................................. 569
BackColorBottom Property.................................................................... 570
BackColorTop Property ......................................................................... 571
BackFlashColorOff Property.................................................................. 572
BackFlashColorOn Property.................................................................. 573
Background Property............................................................................. 574
BarDepth Property................................................................................. 575
BarHeight Property ................................................................................ 576
BarWidth Property ................................................................................. 577
BasePicReferenced Property ................................................................ 578
BasePicTransColor Property................................................................. 579
BasePicture Property............................................................................. 580
BasePicUseTransColor Property .......................................................... 581
BaseX Property ..................................................................................... 582
BaseY Property ..................................................................................... 583
BinaryResultInfo Property ..................................................................... 584
BitNotSetValue Property ....................................................................... 585
BitNumber Property ............................................................................... 586
BitResultInfo Property............................................................................ 587
BitSetValue Property ............................................................................. 588
Bold Property......................................................................................... 589
BorderBackColor Property .................................................................... 590
BorderColor Property............................................................................. 591
BorderColorBottom Property ................................................................. 592
BorderColorTop Property ...................................................................... 593
BorderEndStyle Property....................................................................... 594
BorderFlashColorOff Property............................................................... 596
BorderFlashColorOn Property............................................................... 597
BorderStyle Property ............................................................................. 598
BorderWidth Property ............................................................................ 599

vii

Contents

11.05

5.7.2.34
5.7.2.35
5.7.2.36
5.7.2.37
5.7.2.38
5.7.2.39
5.7.2.40
5.7.2.41
5.7.2.42
5.7.2.43
5.7.3
5.7.3.1
5.7.3.2
5.7.3.3
5.7.3.4
5.7.3.5
5.7.3.6
5.7.3.7
5.7.3.8
5.7.3.9
5.7.3.10
5.7.3.11
5.7.3.12
5.7.3.13
5.7.3.14
5.7.3.15
5.7.3.16
5.7.3.17
5.7.3.18
5.7.3.19
5.7.3.20
5.7.3.21
5.7.3.22
5.7.3.23
5.7.3.24
5.7.3.25
5.7.3.26
5.7.3.27
5.7.3.28
5.7.3.29
5.7.3.30
5.7.3.31
5.7.3.32
5.7.3.33
5.7.3.34
5.7.3.35
5.7.3.36
5.7.3.37
5.7.3.38
5.7.3.39
5.7.3.40
5.7.3.41
5.7.3.42
5.7.3.43
5.7.3.44

viii

BottomConnectedObjectName Property ............................................... 600
BottomConnectedConnectionPointIndex Property................................ 601
BoxAlignment Property.......................................................................... 602
BoxCount Property ................................................................................ 603
BoxType Property.................................................................................. 604
Button1Width Property .......................................................................... 605
Button2Width Property .......................................................................... 606
Button3Width Property .......................................................................... 607
Button4Width Property .......................................................................... 608
ButtonColor Property ............................................................................. 609
VBA Properties: C ................................................................................. 610
Caption Property.................................................................................... 610
CaptionText Property............................................................................. 611
CheckAlarmHigh Property..................................................................... 612
CheckAlarmLow Property...................................................................... 613
Checked Property.................................................................................. 614
CheckLimitHigh4 Property..................................................................... 615
CheckLimitHigh5 Property..................................................................... 616
CheckLimitLow4 Property ..................................................................... 617
CheckLimitLow5 Property ..................................................................... 618
CheckToleranceHigh Property .............................................................. 619
CheckToleranceLow Property ............................................................... 620
CheckWarningHigh Property................................................................. 621
CheckWarningLow Property.................................................................. 622
ClearOnError Property........................................................................... 623
ClearOnNew Property ........................................................................... 624
CloseButton Property ............................................................................ 625
CollectValue Property............................................................................ 626
ColorAlarmHigh Property ...................................................................... 627
ColorAlarmLow Property ....................................................................... 628
ColorBottom Property ............................................................................ 629
ColorChangeType Property................................................................... 630
ColorLimitHigh4 Property ...................................................................... 631
ColorLimitHigh5 Property ...................................................................... 632
ColorLimitLow4 Property ....................................................................... 633
ColorLimitLow5 Property ....................................................................... 634
ColorToleranceHigh Property................................................................ 635
ColorToleranceLow Property................................................................. 636
ColorTop Property ................................................................................. 637
ColorWarningHigh Property .................................................................. 638
ColorWarningLow Property ................................................................... 639
CommonVBSCode Property ................................................................. 640
CommandLine Property ........................................................................ 641
Compiled Property................................................................................. 642
ConfigurationFileName Property ........................................................... 644
Count Property ...................................................................................... 645
CurrentDataLanguage Property ............................................................ 646
CurrentDesktopLanguage Property....................................................... 647
CursorControl Property.......................................................................... 648
CursorMode Property ............................................................................ 649
CustomMenus Property......................................................................... 650
CustomToolbars Property ..................................................................... 651
CycleName Property ............................................................................. 652
CycleTime Property ............................................................................... 652
CycleType Property ............................................................................... 653

Printout of the Online Help
Automated Configuring

11.05

Contents

5.7.4
5.7.4.1
5.7.4.2
5.7.4.3
5.7.4.4
5.7.4.5
5.7.4.6
5.7.4.7
5.7.4.8
5.7.4.9
5.7.4.10
5.7.5
5.7.5.1
5.7.5.2
5.7.5.3
5.7.5.4
5.7.5.5
5.7.5.6
5.7.5.7
5.7.5.8
5.7.5.9
5.7.6
5.7.6.1
5.7.6.2
5.7.6.3
5.7.6.4
5.7.6.5
5.7.6.6
5.7.6.7
5.7.6.8
5.7.6.9
5.7.6.10
5.7.6.11
5.7.6.12
5.7.6.13
5.7.6.14
5.7.6.15
5.7.6.16
5.7.6.17
5.7.6.18
5.7.6.19
5.7.6.20
5.7.6.21
5.7.6.22
5.7.6.23
5.7.6.24
5.7.6.25
5.7.6.26
5.7.6.27
5.7.6.28
5.7.6.29
5.7.7
5.7.7.1
5.7.7.2
5.7.7.3

Printout of the Online Help
Automated Configuring

VBA Properties: D ................................................................................. 654
DataFormat Property ............................................................................. 654
DefaultHMIObjects Property.................................................................. 655
DestinationLink Property ....................................................................... 656
Direction Property.................................................................................. 658
DisableVBAEvents Property.................................................................. 659
DisplayName Property........................................................................... 660
DisplayOptions Property........................................................................ 661
DisplayText Property ............................................................................. 662
Documents Property.............................................................................. 663
Dynamic Property .................................................................................. 664
VBA Properties: E.................................................................................. 665
EditAtOnce Property.............................................................................. 665
ElseCase Property................................................................................. 666
Enabled Property................................................................................... 667
EndAngle Property ................................................................................ 668
Events Property ..................................................................................... 669
EventType Property............................................................................... 671
Exponent Property................................................................................. 673
ExtendedOperation Property................................................................. 674
ExtendedZoomingEnable Property ....................................................... 675
VBA Properties: F.................................................................................. 676
Family Property ..................................................................................... 676
FillColor Property................................................................................... 678
Filling Property....................................................................................... 679
FillingIndex Property.............................................................................. 680
FillStyle Property ................................................................................... 681
FillStyle2 Property ................................................................................. 683
FlashBackColor Property ...................................................................... 685
FlashBorderColor Property.................................................................... 686
FlashFlashPicture Property ................................................................... 687
FlashForeColor Property ....................................................................... 688
FlashPicReferenced Property ............................................................... 689
FlashPicTransColor Property ................................................................ 690
FlashPicture Property ............................................................................ 691
FlashPicUseTransColor Property.......................................................... 692
FlashRate Property................................................................................ 693
FlashRateBackColor Property............................................................... 694
FlashRateBorderColor Property ............................................................ 695
FlashRateFlashPic Property.................................................................. 696
FlashRateForeColor Property ............................................................... 697
Folder Property...................................................................................... 698
FolderItems Property ............................................................................. 700
FontBold Property.................................................................................. 702
FontItalic Property ................................................................................. 703
FontName Property ............................................................................... 704
FontSize Property.................................................................................. 705
FontUnderline Property ......................................................................... 706
ForeColor Property ................................................................................ 707
ForeFlashColorOff Property .................................................................. 708
ForeFlashColorOn Property .................................................................. 709
VBA Properties: G-K.............................................................................. 710
Grid Property ......................................................................................... 710
GridColor Property................................................................................. 711
GridHeight Property............................................................................... 712

ix

Contents

11.05

5.7.7.4
5.7.7.5
5.7.7.6
5.7.7.7
5.7.7.8
5.7.7.9
5.7.7.10
5.7.7.11
5.7.7.12
5.7.7.13
5.7.7.14
5.7.7.15
5.7.7.16
5.7.7.17
5.7.7.18
5.7.7.19
5.7.7.20
5.7.7.21
5.7.7.22
5.7.7.23
5.7.7.24
5.7.7.25
5.7.7.26
5.7.8
5.7.8.1
5.7.8.2
5.7.8.3
5.7.8.4
5.7.8.5
5.7.8.6
5.7.8.7
5.7.8.8
5.7.8.9
5.7.8.10
5.7.8.11
5.7.8.12
5.7.8.13
5.7.8.14
5.7.8.15
5.7.8.16
5.7.8.17
5.7.8.18
5.7.8.19
5.7.8.20
5.7.8.21
5.7.8.22
5.7.8.23
5.7.8.24
5.7.8.25
5.7.8.26
5.7.8.27
5.7.8.28
5.7.8.29
5.7.8.30
5.7.8.31

x

GridWidth Property ................................................................................ 713
GroupParent Property ........................................................................... 714
GroupedHMIObjects Property ............................................................... 715
Height Property...................................................................................... 716
Hide Property......................................................................................... 717
HiddenInput Property............................................................................. 718
HMIObjects Property ............................................................................. 719
Hotkey Property..................................................................................... 720
Hysteresis Property ............................................................................... 721
HysteresisRange Property .................................................................... 722
Icon Property ......................................................................................... 723
Index Property ....................................................................................... 724
InternalName Property .......................................................................... 727
IsActive Property ................................................................................... 728
IsConnectedToProject Property ............................................................ 729
IsDynamicable Property ........................................................................ 730
Italic Property......................................................................................... 731
Item Property ......................................................................................... 732
ItemBorderBackColor Property ............................................................. 733
ItemBorderColor Property ..................................................................... 734
ItemBorderStyle Property ...................................................................... 735
ItemBorderWidth Property..................................................................... 736
Key Property.......................................................................................... 737
VBA Properties: L .................................................................................. 739
Label Property ....................................................................................... 739
LanguageID Property ............................................................................ 740
LanguageName Property ...................................................................... 741
LanguageSwitch Property ..................................................................... 742
LastChange Property............................................................................. 743
Layer Property ....................................................................................... 744
Layer00Checked Property..................................................................... 745
Layer00Color Property .......................................................................... 746
Layer00Value Property.......................................................................... 747
Layer01Checked Property..................................................................... 748
Layer01Color Property .......................................................................... 749
Layer01Value Property.......................................................................... 750
Layer02Checked Property..................................................................... 751
Layer02Color Property .......................................................................... 752
Layer02Value Property.......................................................................... 753
Layer03Checked Property..................................................................... 754
Layer03Color Property .......................................................................... 755
Layer03Value Property.......................................................................... 756
Layer04Checked Property..................................................................... 757
Layer04Color Property .......................................................................... 758
Layer04Value Property.......................................................................... 759
Layer05Checked Property..................................................................... 760
Layer05Color Property .......................................................................... 761
Layer05Value Property.......................................................................... 762
Layer06Checked Property..................................................................... 763
Layer06Color Property .......................................................................... 764
Layer06Value Property.......................................................................... 765
Layer07Checked Property..................................................................... 766
Layer07Color Property .......................................................................... 767
Layer07Value Property.......................................................................... 768
Layer08Checked Property..................................................................... 769

Printout of the Online Help
Automated Configuring

11.05

Contents

5.7.8.32
5.7.8.33
5.7.8.34
5.7.8.35
5.7.8.36
5.7.8.37
5.7.8.38
5.7.8.39
5.7.8.40
5.7.8.41
5.7.8.42
5.7.8.43
5.7.8.44
5.7.8.45
5.7.8.46
5.7.8.47
5.7.8.48
5.7.8.49
5.7.8.50
5.7.8.51
5.7.8.52
5.7.8.53
5.7.8.54
5.7.8.55
5.7.8.56
5.7.8.57
5.7.8.58
5.7.8.59
5.7.8.60
5.7.8.61
5.7.8.62
5.7.8.63
5.7.8.64
5.7.8.65
5.7.8.66
5.7.9
5.7.9.1
5.7.9.2
5.7.9.3
5.7.9.4
5.7.9.5
5.7.9.6
5.7.9.7
5.7.9.8
5.7.9.9
5.7.9.10
5.7.9.11
5.7.9.12
5.7.9.13
5.7.9.14
5.7.9.15
5.7.9.16
5.7.9.17
5.7.9.18
5.7.9.19

Printout of the Online Help
Automated Configuring

Layer08Color Property .......................................................................... 770
Layer08Value Property.......................................................................... 771
Layer09Checked Property..................................................................... 772
Layer09Color Property .......................................................................... 773
Layer09Value Property.......................................................................... 774
Layer10Checked Property..................................................................... 775
Layer10Color Property .......................................................................... 776
Layer10Value Property.......................................................................... 777
LayerDecluttering Property.................................................................... 778
Layers Property ..................................................................................... 779
LDFonts Property .................................................................................. 780
LDLabelTexts Property.......................................................................... 781
LDNames Property ................................................................................ 783
LDStatusTexts Property ........................................................................ 784
LDTexts Property................................................................................... 786
LDTooltipTexts Property........................................................................ 787
Left Property .......................................................................................... 789
LeftComma Property ............................................................................. 790
LightEffect Property ............................................................................... 791
LimitHigh4 Property ............................................................................... 792
LimitHigh5 Property ............................................................................... 793
LimitLow4 Property................................................................................ 794
LimitLow5 Property................................................................................ 795
LimitMax Property.................................................................................. 796
LimitMin Property................................................................................... 797
ListType Property .................................................................................. 798
LockBackColor Property........................................................................ 799
LockStatus Property .............................................................................. 800
LockText Property ................................................................................. 801
LockTextColor Property......................................................................... 802
LockedByCreatorID Property ................................................................ 803
LongStrokesBold Property .................................................................... 805
LongStrokesOnly Property .................................................................... 806
LongStrokesSize Property..................................................................... 807
LongStrokesTextEach Property ............................................................ 808
VBA Properties: M ................................................................................. 809
Macro Property ...................................................................................... 809
Marker Property..................................................................................... 810
Max Property ......................................................................................... 811
MaximizeButton Property ...................................................................... 812
MaxZoom Property ................................................................................ 813
MCGUBackColorOff Property ............................................................... 814
MCGUBackColorOn Property ............................................................... 815
MCGUBackFlash Property .................................................................... 816
MCGUTextColorOff Property ................................................................ 817
MCGUTextColorOn Property ................................................................ 818
MCGUTextFlash Property ..................................................................... 819
MCKOBackColorOff Property................................................................ 820
MCKOBackColorOn Property................................................................ 821
MCKOBackFlash Property .................................................................... 822
MCKOTextColorOff Property................................................................. 823
MCKOTextColorOn Property................................................................. 824
MCKOTextFlash Property ..................................................................... 825
MCKQBackColorOff Property................................................................ 826
MCKQBackColorOn Property................................................................ 827

xi

Contents

11.05

5.7.9.20
5.7.9.21
5.7.9.22
5.7.9.23
5.7.9.24
5.7.9.25
5.7.9.26
5.7.9.27
5.7.9.28
5.7.9.29
5.7.9.30
5.7.9.31
5.7.10
5.7.10.1
5.7.10.2
5.7.10.3
5.7.10.4
5.7.10.5
5.7.10.6
5.7.10.7
5.7.10.8
5.7.10.9
5.7.10.10
5.7.10.11
5.7.10.12
5.7.10.13
5.7.10.14
5.7.10.15
5.7.11
5.7.11.1
5.7.11.2
5.7.11.3
5.7.11.4
5.7.11.5
5.7.11.6
5.7.11.7
5.7.11.8
5.7.11.9
5.7.11.10
5.7.11.11
5.7.11.12
5.7.11.13
5.7.11.14
5.7.11.15
5.7.11.16
5.7.11.17
5.7.11.18
5.7.11.19
5.7.11.20
5.7.11.21
5.7.11.22
5.7.11.23
5.7.11.24
5.7.11.25
5.7.11.26

xii

MCKQBackFlash Property .................................................................... 828
MCKQTextColorOff Property................................................................. 829
MCKQTextColorOn Property................................................................. 830
MCKQTextFlash Property ..................................................................... 831
MCText Property ................................................................................... 832
MenuItems Property .............................................................................. 833
MenuItemType Property........................................................................ 834
MessageClass Property ........................................................................ 835
Min Property .......................................................................................... 836
MinZoom Property ................................................................................. 837
Modified Property .................................................................................. 838
Moveable Property ................................................................................ 839
VBA Properties: N-O ............................................................................. 840
Name Property ...................................................................................... 840
NegativeValue Property ........................................................................ 841
Number Property ................................................................................... 842
NumberLines Property........................................................................... 843
ObjectName Property ............................................................................ 844
ObjectSizeDecluttering Property ........................................................... 847
OffsetLeft Property ................................................................................ 848
OffsetTop Property ................................................................................ 849
OnTop Property ..................................................................................... 850
Operation Property ................................................................................ 851
OperationMessage Property ................................................................. 852
OperationReport Property ..................................................................... 853
Orientation Property .............................................................................. 854
OutputFormat Property.......................................................................... 855
OutputValue Property ............................................................................ 856
VBA Properties: P-Q.............................................................................. 857
Parent Property ..................................................................................... 857
PasswordLevel Property ....................................................................... 858
Path Property......................................................................................... 859
Pathname Property................................................................................ 860
PicDeactReferenced Property............................................................... 861
PicDeactTransparent Property .............................................................. 862
PicDeactUseTransColor Property ......................................................... 863
PicDownReferenced Property ............................................................... 864
PicDownTransparent Property .............................................................. 865
PicDownUseTransColor Property ......................................................... 866
PicReferenced Property ........................................................................ 867
PicTransColor Property ......................................................................... 868
PictureDeactivated Property.................................................................. 869
PictureDown Property............................................................................ 870
PictureName Property ........................................................................... 871
PictureUp Property ................................................................................ 872
PicUpReferenced Property.................................................................... 873
PicUpTransparent Property................................................................... 874
PicUpUseTransColor Property .............................................................. 875
PicUseTransColor Property................................................................... 876
PointCount Property .............................................................................. 877
Position Property ................................................................................... 878
PositiveValue Property .......................................................................... 879
PredefinedAngels Property ................................................................... 880
Pressed Property................................................................................... 881
Process Property ................................................................................... 882

Printout of the Online Help
Automated Configuring

11.05

Contents

5.7.11.27
5.7.11.28
5.7.11.29
5.7.11.30
5.7.11.31
5.7.11.32
5.7.11.33
5.7.11.34
5.7.12
5.7.12.1
5.7.12.2
5.7.12.3
5.7.12.4
5.7.12.5
5.7.12.6
5.7.12.7
5.7.12.8
5.7.12.9
5.7.12.10
5.7.12.11
5.7.12.12
5.7.12.13
5.7.12.14
5.7.12.15
5.7.12.16
5.7.12.17
5.7.12.18
5.7.12.19
5.7.12.20
5.7.12.21
5.7.12.22
5.7.12.23
5.7.12.24
5.7.12.25
5.7.12.26
5.7.12.27
5.7.12.28
5.7.12.29
5.7.12.30
5.7.12.31
5.7.12.32
5.7.12.33
5.7.12.34
5.7.12.35
5.7.12.36
5.7.12.37
5.7.12.38
5.7.12.39
5.7.12.40
5.7.12.41
5.7.13
5.7.13.1
5.7.13.2
5.7.13.3
5.7.13.4

Printout of the Online Help
Automated Configuring

ProfileName Property ............................................................................ 883
ProgID Property..................................................................................... 884
ProjectName Property ........................................................................... 885
ProjectType Property............................................................................. 886
Properties Property................................................................................ 887
Prototype Property................................................................................. 888
QualityCodeStateChecked Properties................................................... 888
QualityCodeStateValues Property......................................................... 891
VBA Properties: R-S.............................................................................. 893
Radius Property..................................................................................... 893
RadiusHeight Property .......................................................................... 894
RadiusWidth Property............................................................................ 895
RangeTo Property ................................................................................. 896
ReferenceRotationLeft Property............................................................ 897
ReferenceRotationTop Property............................................................ 898
Relevant Property.................................................................................. 899
ResultType Property.............................................................................. 900
RightComma Property ........................................................................... 901
RotationAngle Property ......................................................................... 902
RoundCornerHeight Property................................................................ 903
RoundCornerWidth Property ................................................................. 904
SameSize Property................................................................................ 905
ScaleColor Property .............................................................................. 906
ScaleTicks Property............................................................................... 907
Scaling Property .................................................................................... 908
ScalingType Property ............................................................................ 909
ScriptType Property............................................................................... 910
ScrollBars Property................................................................................ 912
ScrollPosX ............................................................................................. 913
ScrollPosY Property .............................................................................. 914
ScrollPositionX Property........................................................................ 915
ScrollPositionY Property........................................................................ 916
SelBGColor Property ............................................................................. 917
Selected Property .................................................................................. 918
Selection Property ................................................................................. 919
SelTextColor Property ........................................................................... 920
ServerName Property............................................................................ 921
ServerPrefix Property ............................................................................ 922
ShortCut Property.................................................................................. 923
SignificantMask Property....................................................................... 925
Size Property ......................................................................................... 926
Sizeable Property .................................................................................. 927
SmallChange Property .......................................................................... 928
SnapToGrid Property............................................................................. 929
SourceLink Property .............................................................................. 930
SourceCode Property ............................................................................ 932
StartAngle Property ............................................................................... 934
StatusText Property............................................................................... 935
SubMenu Property................................................................................. 937
SymbolLibraries Property ...................................................................... 938
VBA Properties: T.................................................................................. 939
TabOrderSwitch Property...................................................................... 939
TabOrderAllHMIObjects Property.......................................................... 940
TabOrderAlpha Property ....................................................................... 941
TabOrderKeyboard Property ................................................................. 942

xiii

Contents

11.05

5.7.13.5
5.7.13.6
5.7.13.7
5.7.13.8
5.7.13.9
5.7.13.10
5.7.13.11
5.7.13.12
5.7.13.13
5.7.13.14
5.7.13.15
5.7.13.16
5.7.13.17
5.7.13.18
5.7.13.19
5.7.13.20
5.7.13.21
5.7.13.22
5.7.13.23
5.7.13.24
5.7.13.25
5.7.13.26
5.7.13.27
5.7.13.28
5.7.13.29
5.7.13.30
5.7.13.31
5.7.14
5.7.14.1
5.7.14.2
5.7.14.3
5.7.14.4
5.7.14.5
5.7.14.6
5.7.14.7
5.7.14.8
5.7.14.9
5.7.14.10
5.7.14.11
5.7.14.12
5.7.14.13
5.7.14.14
5.7.14.15
5.7.14.16
5.7.14.17
5.7.14.18
5.7.14.19
5.7.14.20
5.7.14.21
5.7.14.22
5.7.14.23
5.7.14.24
5.7.14.25
5.7.14.26
5.7.14.27

xiv

TabOrderMouse Property...................................................................... 943
TabOrderOtherAction Property ............................................................. 944
Tag Property.......................................................................................... 945
TagPrefix Property................................................................................. 947
Text Property ......................................................................................... 949
Toggle Property ..................................................................................... 950
ToleranceHigh Property ........................................................................ 951
ToleranceLow Property ......................................................................... 952
ToolbarItems Property ........................................................................... 953
TooltipText Property .............................................................................. 954
Top Property.......................................................................................... 955
TopConnectedObjectName Property .................................................... 956
TopConnectedConnectionPointIndex Property..................................... 957
Trend Property....................................................................................... 958
TrendColor Property .............................................................................. 959
Trigger Property..................................................................................... 960
Type Property ........................................................................................ 961
TypeAlarmHigh Property ....................................................................... 962
TypeAlarmLow Property........................................................................ 963
TypeLimitHigh4 Property....................................................................... 964
TypeLimitHigh5 Property....................................................................... 965
TypeLimitLow4 Property........................................................................ 966
TypeLimitLow5 Property........................................................................ 967
TypeToleranceHigh Property ................................................................ 968
TypeToleranceLow Property ................................................................. 969
TypeWarningHigh Property ................................................................... 970
TypeWarningLow Property.................................................................... 971
VBA Properties: U-Z .............................................................................. 972
Underlined Property............................................................................... 972
UnselBGColor Property ......................................................................... 973
UnselTextColor Property ....................................................................... 974
UpdateCycle Property ........................................................................... 975
UserValue1 Property ............................................................................. 976
UserValue2 Property ............................................................................. 977
UserValue3 Property ............................................................................. 978
UserValue4 Property ............................................................................. 979
Value Property....................................................................................... 980
VALUE_ACCESS_FAULT Property...................................................... 981
VALUE_ADDRESS_ERROR Property.................................................. 983
VALUE_BAD_COMMLUV Property ...................................................... 985
VALUE_BAD_COMMNUV Property...................................................... 987
VALUE_BAD_CONFERROR Property ................................................. 989
VALUE_BAD_DEVICE Property ........................................................... 991
VALUE_BAD_MISCSTATES Property.................................................. 993
VALUE_BAD_NONSPECIFIC Property ................................................ 995
VALUE_BAD_NOTCONNECTED Property .......................................... 997
VALUE_BAD_OUTOFSERV Property .................................................. 999
VALUE_BAD_PROCRELNOM Property............................................. 1001
VALUE_BAD_PROCRELSUB Property.............................................. 1003
VALUE_CONVERSION_ERROR Property......................................... 1005
VALUE_HANDSHAKE_ERROR Property........................................... 1007
VALUE_HARDWARE_ERROR Property ............................................ 1009
VALUE_HIGHLIMITED Property......................................................... 1011
VALUE_INVALID_KEY Property......................................................... 1013
VALUE_LOWLIMITED Property.......................................................... 1015

Printout of the Online Help
Automated Configuring

11.05

Contents

5.7.14.28
5.7.14.29
5.7.14.30
5.7.14.31
5.7.14.32
5.7.14.33
5.7.14.34
5.7.14.35
5.7.14.36
5.7.14.37
5.7.14.38
5.7.14.39
5.7.14.40
5.7.14.41
5.7.14.42
5.7.14.43
5.7.14.44
5.7.14.45
5.7.14.46
5.7.14.47
5.7.14.48
5.7.14.49
5.7.14.50
5.7.14.51
5.7.14.52
5.7.14.53
5.7.14.54
5.7.14.55
5.7.14.56
5.7.14.57
5.7.14.58
5.7.14.59
5.7.14.60
5.7.14.61
5.7.14.62
5.7.14.63
5.7.14.64
5.7.14.65

Printout of the Online Help
Automated Configuring

VALUE_MAX_LIMIT Property ............................................................. 1017
VALUE_MAX_RANGE Property ......................................................... 1019
VALUE_MIN_LIMIT Property .............................................................. 1021
VALUE_MIN_RANGE Property........................................................... 1023
VALUE_NOT_ESTABLISHED Property.............................................. 1025
VALUE_SERVERDOWN Property...................................................... 1027
VALUE_STARTUP_VALUE Property ................................................. 1029
VALUE_TIMEOUT Property................................................................ 1031
VALUE_UNCERT_ENGVHIGHLIM Property...................................... 1033
VALUE_UNCERT_ENGVLOWLIM Property ...................................... 1035
VALUE_UNCERT_ENGVONLIM Property ......................................... 1037
VALUE_UNCERT_INITVAL Property ................................................. 1039
VALUE_UNCERT_LUV Property ........................................................ 1041
VALUE_UNCERT_MAINTDEM Property............................................ 1043
VALUE_UNCERT_MISCSTATES Property ........................................ 1045
VALUE_UNCERT_NONSPECIFIC Property ...................................... 1047
VALUE_UNCERT_PROCRELNOM Property ..................................... 1049
VALUE_UNCERT_SIMVAL Property.................................................. 1051
VariablesExist Property ....................................................................... 1053
VALUE_UNCERT_SUBSTSET Property ............................................ 1054
VariableStateChecked Property .......................................................... 1056
VariableStateType Property ................................................................ 1058
VariableStateValues Property ............................................................. 1059
VariableTriggers Property ................................................................... 1061
VarName Property............................................................................... 1062
VBAVersion Property........................................................................... 1063
VBE Property....................................................................................... 1064
Version Property.................................................................................. 1064
Views Property .................................................................................... 1065
Visible Property ................................................................................... 1066
WarningHigh Property ......................................................................... 1067
WarningLow Property .......................................................................... 1068
Width Property..................................................................................... 1069
WindowBorder Property ...................................................................... 1071
WindowState Property......................................................................... 1072
ZeroPoint Property .............................................................................. 1073
ZeroPointValue Property ..................................................................... 1074
Zoom Property..................................................................................... 1075

xv

Contents

xvi

11.05

Printout of the Online Help
Automated Configuring

11.05

1

Introduction: Using VBA in WinCC

Introduction: Using VBA in WinCC

Introduction
You have a VBA editor available in Graphics Designer which allows you to
configure pictures automatically. The VBA editor is identical to the one from the
products in the Microsoft Office family. You can make direct use of your VBA
programming experience.

Principle
With VBA you extend the functionality of the Graphics Designer and automate
configuring. You may use VBA in Graphics Designer as follows, including:


Creating user-defined menus and toolbars



Creating and editing Standard, Smart and Windows objects



Dynamizing properties of pictures and objects



Configuring actions in pictures and objects



Accessing products that support VBA (e.g. products in the MS Office family)

A description of the VBA object model for the Graphics Designer is provided in this
documentation in the section under " VBA Reference " .

Printout of the Online Help
Automated Configuring

1

Introduction: Using VBA in WinCC

1.1

11.05

Differentiation: Deployment of VBA

Introduction
You can use VBA exclusively for configuration and functional enhancement in the
Graphics Designer. The following indicates where there are better options available
for efficient configuration or where VBA cannot be used.

VB and C Scripts
VB and C scripts are active only at runtime and are used to dynamize picture and
object properties as well as in action configuration.

Dynamic Wizards
The dynamic wizards are not replaced by VBA. However, VBA allows you to
enhance the functionality of the dynamic wizards with ease.

ODK
ODK comprises function calls that enable access to all the functionality of WinCC
both in the configuration system and in runtime. In contrast to ODK, VBA offers
simple object-oriented access to the objects of the Graphics Designer.

2

Printout of the Online Help
Automated Configuring

11.05

1.2

Introduction: Using VBA in WinCC

Organizing VBA Code in a WinCC Project

Introduction
You organize the VBA code for your WinCC project in the VBA editor. This is
where you specify whether the VBA code is to be available in only one picture, in
the entire project or in all projects. Depending on where you place the VBA code,
the term used to refer to the code is:


global VBA code,



project-specific VBA code or



picture-specific VBA code.

Note
A picture in the Graphics Designer is known as a " document " in the VBA object
model.
The VBA editor
To start the VBA editor in the Graphics Designer, press & lt; ALT + F11 & gt; or choose
" Tools " & gt; " Macros " & gt; " Visual Basic Editor " . If you have not yet opened a picture in
the Graphics Designer, you can only edit the global or project-specific VBA code.
The global and project-specific data and all open pictures are displayed in the VBA
editor's Project Explorer:

Printout of the Online Help
Automated Configuring

3

Introduction: Using VBA in WinCC

11.05

Global VBA code (1)
Refers to VBA code that you write to the " GlobalTemplateDocument " in the VBA
editor. This VBA code is saved in the " @GLOBAL.PDT " file, which is located in the
WinCC installation directory.
The VBA code that you put in the " GlobalTemplateDocument " is the code that you
want to be made available in all WinCC projects on your computer. If you need the
VBA code on a different computer, use the export and import functions in the VBA
editor.
A WinCC computer uses only the @GLOBAL.PDT stored locally in the WinCC
installation directory.
Project-specific VBA code (2)
Refers to VBA code that you write to the " ProjectTemplateDocument " in the VBA
editor. This VBA code is saved in the @ " PROJECT.PDT " file, which is located in
the root directory of each WinCC project.
The " @PROJECT.PDT " file has a reference to the " @GLOBAL.PDT " file.
Functions and procedures which you have saved in the " @GLOBAL.PDT " file can
be called up directly in the " ProjectTemplateDocument " .
The " ProjectTemplateDocument " is where you put VBA code that you want to use
in all pictures in the open project. If you need the VBA code on a different
computer, use the export and import functions in the VBA editor.
You can open and edit the " @PROJECT.PDT " file in the same way as a PDL file.
This will allow you to use the " @PROJECT.PDT " file as a template: For example,
you may create there the basic picture of your system which will then be
automatically transferred into each new PDL file of the project. Picture properties
such as layers or zoom are not copied to the PDL file, nor is the VBA code.
Picture-specific VBA code (3)
Refers to VBA code that you write to the document " This Document " relating to the
corresponding picture in the VBA editor. This VBA code is saved as a PDL file
together with the picture.
The PDL file has a reference to the " @PROJECT.PDT " file. Functions and
procedures which you have saved in the " @PROJECT.PDT " file can be called up
directly from the PDL file. However, you do not have access to functions or
procedures that are stored in the " @GLOBAL.PDT " file.
Note
You can create modules, class modules and user forms in each document.
Note
You can protect the VBA code of a module against unauthorized access by setting
a password. To do this, select the " Tools " & gt; " VBAObject Properties " menu item in
the VBA editor.

4

Printout of the Online Help
Automated Configuring

11.05

Introduction: Using VBA in WinCC

Special features during the execution of VBA macros
For the execution of VBA macros, the following applies: Initially picture-specific
VBA code is executed, followed by project-specific VBA code. If therefore you call
a VBA macro that is contained for example both in the picture and in the projectspecific VBA code, only the VBA macro from the picture is executed. This has the
effect of preventing VBA macros and functions from being executed twice, which
otherwise can lead to errors.
In connection with event handling the forwarding of events is activated by default.
You can prevent events from being forwarded if you want to respond to an event in
the picture-specific VBA code only.
Additional information on this topic is given under " Event Handling " .

Testing with the Debugger
You can test your VB scripts at runtime with the VBA editor's debugger. You may
find additional information in the help system of the VBA editor.

Printout of the Online Help
Automated Configuring

5

Introduction: Using VBA in WinCC

1.3

11.05

How to export and import VBA code

Principle
In the VBA editor you can import and export VBA code, enabling you to transfer it
to another computer. During an export process it is always the entire VBA code in
a project that is exported. References to procedures and functions which you call
within the project are therefore retained.
Note:
When you import VBA code you must enter references to external libraries
manually after the import process, on the target computer.
Procedure
Exporting VBA code
Procedure
1

In the VBA editor's Project Explorer, select the module whose VBA code
you want to export.

2

Choose the " File " & gt; " Export File " menu command.

3

Select the path and enter the file name.

4

Click on " Save " .

The VBA code is exported to a file. The file type depends on the module from
which the VBA code was exported.
Importing VBA code
Procedure
1
2

Choose the menu option " File " & gt; " Import File " .

3

Select the file and click on " Open " in order to import the VBA code as
" ThisDocument " into the " Class Modules " folder.

4

6

In the VBA editor's Project Explorer, select the document into which you
want to import the VBA code.

In the " Class Modules " folder, open the document " ThisDocument " and
copy the VBA code into the document in the required project.

Printout of the Online Help
Automated Configuring

11.05

1.4

Introduction: Using VBA in WinCC

Executing VBA macros in the Graphics Designer

Introduction
Three possibilities are available to you for executing VBA macros in the Graphics
Designer:


Event handling



User-defined menu or toolbar



VBA editor

Event handling
Predefined events (such as the opening of a picture) can occur in the Graphics
Designer, the active picture or the component library, to which you can respond
with VBA event handlers. These events occur only during configuring in the
Graphics Designer and have nothing to do with the events of action configuring.
In this example, a brief message is to be issued when a picture is opened. The
" Opened event is used for this " :
Private Sub Document_Opened(CancelForwarding As Boolean)
MsgBox ( " Bild wurde geöffnet! " )
End Sub
Further information on the subject of event handling is provided under " Event
handling " and " Events " .

User-defined menu or toolbar
VBA allows you to create user-defined menus and toolbars in the Graphics
Designer. You can assign a VBA macro to each user-defined menu entry or tool
icon; this macro is then executed when you click on the menu entry or tool icon. In
this way you can extend the functionality of the Graphics Designer to suit your
requirements.
Further information on the creation of user-defined menus and toolbars is provided
under " Creating your own menus and toolbars " .

VBA editor
You can start a VBA macro in the VBA editor by pressing & lt; F5 & gt; . & lt; & gt; If you press F8,
you can execute a VBA macro step by step.

Printout of the Online Help
Automated Configuring

7

Introduction: Using VBA in WinCC

8

11.05

Printout of the Online Help
Automated Configuring

11.05

2

VBA in the Graphics Designer

VBA in the Graphics Designer

Introduction
You use VBA in the Graphics Designer in order to automate frequently recurring
steps during configuring. You can create user-defined menus and toolbars in order
to make it easier to execute the VBA macros that you have created.
Basically, in the Graphics Designer you can replace all configuring work that you
would otherwise perform with the mouse with VBA macros. This applies in
particular to the GUI (layers and zoom) and the editing of objects in pictures
including dynamics.
Adapting Graphics Designer with VBA
The Graphics Designer is represented by the Application object in VBA. With VBA
you can carry out configuring in the Graphics Designer in several languages,
create user-defined menus and toolbars and access the component library.

Editing pictures with VBA
A picture in the Graphics Designer is represented by the Document object.
With VBA you can access the properties of the picture and edit settings for layers
and the zoom factors. As well as this you can create picture-specific menus and
toolbars. These are only visible, however, for as long as the picture is active.

Editing objects with VBA
An object in the picture is represented by the HMIObject object. With VBA you can
create and delete objects and access the object properties. For example, with VBA
you can very quickly create a large number of objects with identical properties for
your plant display.
Creating Dynamics with VBA
VBA enables you to add dynamics to properties and events of pictures and objects.

Event handling
With VBA you can respond to events that occur in the Graphics Designer or in a
picture (e.g. when you insert a new object into a picture). You use event handling
in order to execute VBA macros in certain program situations.

Access to external applications
You can use VBA to access programs which support VBA (e.g. products in the
Microsoft Office family). This enables you, for example, to read out values from an
Excel worksheet and then assign these to object properties.

Printout of the Online Help
Automated Configuring

9

VBA in the Graphics Designer

2.1

11.05

Adapting Graphics Designer with VBA

Introduction
In VBA the Application object represents the Graphics Designer:

Access to the component library
VBA gives you full access to the component library. You can extend the
component library with VBA by for example creating and deleting folders or
copying objects and inserting them into a picture.

User-defined menus and toolbars
You can create user-defined menus and toolbars in order to execute VBA macros
in the Graphics Designer. In this way you can extend the functionality of the
Graphics Designer to suit your particular requirements.

Language-dependent configuring
With VBA you can carry out configuring in the Graphics Designer in more than one
language. You therefore have access to the language-dependent object properties
and you can create the user-defined menus and toolbars in different languages.

10

Printout of the Online Help
Automated Configuring

11.05

2.2

VBA in the Graphics Designer

Language-dependent configuring with VBA

Introduction
With VBA you can carry out configuring in the Graphics Designer for several
different languages. This gives you access to the language-dependent properties
of objects in the Graphics Designer, while you can also make the user-defined
menus and toolbars available in different languages. In VBA, foreign-language
texts are stored in a list of the " LanguageTexts " type. The settings for languagedependent fonts are stored in a list of the " LanguageFonts " type.
Further information about language-dependent configuring is also provided in the
WinCC documentation " Setting up multilingual projects " .

Desktop language
You can only switch to a different desktop language in WinCC, not with VBA. When
you switch desktop language in WinCC, the " DesktopLanguageChanged " event is
triggered. You can adapt the user-defined menus and toolbars to suit the user by
replacing language-dependent tool icons, for example.
The following objects and the associated language-dependent properties respond
to a change to the desktop language:


FolderItem object



Menu object and MenuItem object



ToolbarItem object



Further information about the desktop language is provided in the WinCC
documentation " Setting up multilingual projects " under " Language terms in
WinCC " .

Configuring language
You can change the configuring language with VBA using the
" CurrentDataLanguage " property.
In this example the configuring language is changed to " English " :
Sub ChangeCurrentDataLanguage()
'VBA1
Application.CurrentDataLanguage = 1033
MsgBox " The data language has been changed to English "
Application.CurrentDataLanguage = 1031
MsgBox " The data language has been changed to German "
End Sub
All language-dependent properties such as ToolTipText are affected by the
change.

Printout of the Online Help
Automated Configuring

11

VBA in the Graphics Designer

11.05

Configuring for more than one language in VBA
There are two possible ways for you to carry out configuring for several languages
with VBA.


Language changeover: text properties of objects.



Language Texts listing: text properties of user-defined menus and toolbars,
and objects.

Language changeover
You can change the language-dependent properties (e.g. " Text " ) of objects with
VBA. To do this, assign the text to the corresponding property and then change the
configuring language in order to assign the text in the other language.
LanguageTexts listing
You can save the multilingual texts for the respective object directly in the
associated listing of the " LanguageTexts " type. To do this, enter the language ID
for the language and the associated text.
You can find a list of the language identifiers in the WinCC documentation ( & gt; Index
Language Identifier)
In this example a German label and an English label are assigned to the button
" myButton " :
Sub AddLanguagesToButton()
'VBA2
Dim objLabelText As HMILanguageText
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
'
'Set defaultlabel:
objButton.Text = " Default-Text "
'
'Add english label:
Set objLabelText = objButton.LDTexts.Add(1033, " English
Text " )
'Add german label:
Set objLabelText = objButton.LDTexts.Add(1031, " German Text " )
End Sub

12

Printout of the Online Help
Automated Configuring

11.05

2.2.1

VBA in the Graphics Designer

Creating your own menus and toolbars

User-defined menus and toolbars in the Graphics Designer
You can use user-defined menus and toolbars in the Graphics Designer in order to
execute VBA macros. A distinction is drawn here between application-specific and
picture-specific menus and toolbars, which have the following properties:


Application-specific menu/toolbar: always visible when the Graphics Designer
is opened. You should use application-specific menus and toolbars when the
VBA macros that are to be executed from them have to be accessible at all
times.



Picture-specific menu/toolbar: this is linked to a specific picture and remains
visible for as long as the picture is active. You should use picture-specific
menus and toolbars when the VBA macros are relevant only for that particular
picture.

Positioning of user-defined menus and toolbars
In the case of user-defined menus the " Position " parameter determines the final
positioning in the menu bar. However:


application-specific menus are always positioned to the right of the " Window "
menu in the Graphics Designer, whereas

picture-specific menus are always positioned to the left of the " ? " menu in the
Graphics Designer.
Application-specific toolbars on the other hand are not given any " preferential
treatment " In this case, the positioning is decided by the order in which you insert
the toolbars. Toolbars are positioned beneath the Graphics Designer toolbar:

Figure: User-defined menus and toolbars. (1) Application-specific, (2) picturespecific
In the illustration above, first the picture-specific menus and toolbars are inserted,
then the application-specific ones.

Printout of the Online Help
Automated Configuring

13

VBA in the Graphics Designer

11.05

Properties of user-defined menus and toolbars
In the case of user-defined menus and toolbars you can use hyphens to divide
entries (e.g. according to certain categories). As well as this you can also create
submenus in a user-defined menu.
The following configuration options are available to you for user-defined menus
and toolbars (and their entries):


Visible (yes/no): displays or hides the item (Visible property).



Active (yes/no): activates the item or dims it (Enabled property).



Marked with check mark (yes/no) - only available for menu item (Checked
property).



Shortcut: key combination for calling a menu item (ShortCut property).



Status text: text that is displayed in the status bar (StatusText property).



Tool tip text - only available for a tool icon (ToolTipText property).

You can hide a menu item, for example, if the macro cannot be executed at a
certain time. This way you can prevent an inadvertent wrong operation.
You can create all texts and labels of user-defined menus and toolbars in multiple
languages so that the user-defined menus and toolbars can also react to a
language change.

14

Printout of the Online Help
Automated Configuring

11.05

2.2.1.1

VBA in the Graphics Designer

How to Create a New Application-Specific Menu

Introduction
Application-specific menus remain visible even when all pictures in Graphics
Designer are closed. You can use the Started event, for example, in order to insert
an application-specific menu at an early stage.
Position the VBA code either


in the " GlobalTemplateDocument " if you want the menu to be available in all
projects, or



in the " ProjectTemplateDocument " if you want the menu to be available in the
current project.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

15

VBA in the Graphics Designer

11.05

Procedure
3

To create a user-defined menu in the Graphics Designer, you can for
example insert a " CreateApplicationMenus() " procedure in the document. In
this example, two user-defined menus are created:
Sub CreateApplicationMenus()
'VBA3
'Declaration of menus...:
Dim objMenu1 As HMIMenu
Dim objMenu2 As HMIMenu
'
'Add menus. Parameters are " Position " , " Key " und
" DefaultLabel " :
Set objMenu1 =
Application.CustomMenus.InsertMenu(1, " AppMenu1 " ,
" App_Menu_1 " )
Set objMenu2 =
Application.CustomMenus.InsertMenu(2, " AppMenu2 " ,
" App_Menu_2 " )
End Sub

4

Start the procedure with & lt; F5 & gt; .

Results
The two menus " App_Menu_1 " and " App_Menu_2 " are inserted to the right of the
" Window " menu:

16

Printout of the Online Help
Automated Configuring

11.05

2.2.1.2

VBA in the Graphics Designer

How to Add a New Menu Item to Menu

Prerequisite
You must have created the user-defined menu first.

Introduction
You can insert three different types of menu items in the user-defined menu:


Menu item: To call VBA macros.



Separator line: For clearer design of user-defined menu.



Submenu: Same as user-defined menu (e.g. command structuring).

The " Position " parameter determines the order of the menu items within the userdefined menu.
The " Key " parameter is a unique identification of the menu item. This parameter is
used if you use the " MenuItemClicked " event for calling VBA macros.

Procedure
Procedure
1

Open the VBA editor in the Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

Printout of the Online Help
Automated Configuring

17

VBA in the Graphics Designer

11.05

Procedure
3

To create menu items in a previously created user-defined menu, you can
for example insert an " InsertMenuItems() " procedure in the document. In
this example a number of menu items are created in the user-defined menu
" App_Menu_1 " :
Sub InsertMenuItems()
'VBA4
Dim objMenu1 As HMIMenu
Dim objMenu2 As HMIMenu
Dim objMenuItem1 As HMIMenuItem
Dim objSubMenu1 As HMIMenuItem
'Create Menu:
Set objMenu1 =
Application.CustomMenus.InsertMenu(1, " AppMenu1 " ,
" App_Menu_1 " )
'Next lines add menu-items to userdefined menu.
'Parameters are " Position " , " Key " and DefaultLabel:
Set objMenuItem1 =
objMenu1.MenuItems.InsertMenuItem(1, " mItem1_1 " ,
" App_MenuItem_1 " )
Set objMenuItem1 =
objMenu1.MenuItems.InsertMenuItem(2, " mItem1_2 " ,
" App_MenuItem_2 " )
'
'Adds seperator to menu ( " Position " , " Key " )
Set objMenuItem1 =
objMenu1.MenuItems.InsertSeparator(3, " mItem1_3 " )
'
'Adds a submenu into a userdefined menu
Set objSubMenu1 =
objMenu1.MenuItems.InsertSubMenu(4, " mItem1_4 " ,
" App_SubMenu_1 " )
'
'Adds a menu-item into a submenu
Set objMenuItem1 =
objSubMenu1.SubMenu.InsertMenuItem(5, " mItem1_5 " ,
" App_SubMenuItem_1 " )
Set objMenuItem1 =
objSubMenu1.SubMenu.InsertMenuItem(6, " mItem1_6 " ,
" App_SubMenuItem_2 " )
End Sub

4

Start the procedure with & lt; F5 & gt; .

Results
The " InsertMenuItems() " procedure inserts the menu " App_Menu_1 " with these
menu items:

18

Printout of the Online Help
Automated Configuring

11.05

Printout of the Online Help
Automated Configuring

VBA in the Graphics Designer

19

VBA in the Graphics Designer

2.2.1.3

11.05

How to Create Menus in Multiple Languages

Introduction
You can create a user-defined menu that responds to a change of language. To do
this you need to define the necessary number of labels in other languages for the
menu and for each menu item.
The foreign-language label comprises the language ID (LCID) and the foreignlanguage text (DisplayName).
You can find a list of the language identifiers in the WinCC documentation ( & gt; Index
Language Identifier)

Procedure
Procedure
1

Open the VBA editor in the Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

3

To define multilingual labels for a user-defined menu, you can for example
insert a " MultipleLanguagesForAppMenu1() " procedure in the document. In
this example English labels are defined for the " App_Menu_1 " menu:
Sub InsertMenuItems()
'VBA5
'Execute this procedure first
Dim objMenu1 As HMIMenu
Dim objMenu2 As HMIMenu
Dim objMenuItem1 As HMIMenuItem
Dim objSubMenu1 As HMIMenuItem
'Insert Menu:
Set objMenu1 =

20

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
Application.CustomMenus.InsertMenu(1, " AppMenu1 " ,
" App_Menu_1 " )
'Next lines inserts menu-items to userdefined menu.
'parameters are " Position " , " Key " and DefaultLabel:
Set objMenuItem1 =
objMenu1.MenuItems.InsertMenuItem(1, " mItem1_1 " ,
" App_MenuItem_1 " )
Set objMenuItem1 =
objMenu1.MenuItems.InsertMenuItem(2, " mItem1_2 " ,
" App_MenuItem_2 " )
'
'Inserts seperator into menu ( " Position " , " Key " )
Set objMenuItem1 =
objMenu1.MenuItems.InsertSeparator(3, " mItem1_3 " )
'
'Inserts a submenu into a userdefined menu
Set objSubMenu1 =
objMenu1.MenuItems.InsertSubMenu(4, " mItem1_4 " ,
" App_SubMenu_1 " )
'
'Inserts a menu-item into a submenu
Set objMenuItem1 =
objSubMenu1.SubMenu.InsertMenuItem(5, " mItem1_5 " ,
" App_SubMenuItem_1 " )
Set objMenuItem1 =
objSubMenu1.SubMenu.InsertMenuItem(6, " mItem1_6 " ,
" App_SubMenuItem_2 " )
End Sub
Sub MultipleLanguagesForAppMenu1()
'
execute this procedure after
" InsertMenuItems() " was run
'Object " objLanguageTextMenu1 " contains the
'foreign-language labels for the menu
Dim objLanguageTextMenu1 As HMILanguageText
'
'Object " objLanguageTextMenu1Item " contains the
'foreign-language labels for the menu-items
Dim objLanguageTextMenuItem1 As HMILanguageText
Dim objMenu As HMIMenu
Dim objSubMenu1 As HMIMenuItem
Set objMenu1 = Application.CustomMenus( " AppMenu1 " )
Set objSubMenu1 =
Application.CustomMenus( " AppMenu1 " ).MenuItems( " mIte
m1_4 " )

Printout of the Online Help
Automated Configuring

21

VBA in the Graphics Designer

11.05

Procedure
'
'Inserts foreign-language label into a menu:
'( " Add(LCID, DisplayName) " -Methode:
Set objLanguageTextMenu1 =
objMenu1.LDLabelTexts.Add(1033,
" English_App_Menu_1 " )
'
'Inserts foreign-language label into a menuitem:
Set objLanguageTextMenuItem1 =
objMenu1.MenuItems( " mItem1_1 " ).LDLabelTexts.Add(103
3, " My first menu item " )
'
'Adds a foreign-language label into a submenu:
Set objLanguageTextMenuItem1 =
objSubMenu1.SubMenu.Item( " mItem1_5 " ).LDLabelTexts.A
dd(1033, " My first submenu item " )
End Sub
4

Start the procedure with & lt; F5 & gt; .

Results
If you now switch the configuring language to English, certain items in the userdefined menu are shown in English.

22

Printout of the Online Help
Automated Configuring

11.05

2.2.1.4

VBA in the Graphics Designer

How to Create a New Application-Specific Toolbar

Introduction
Application-specific toolbars remain visible even when all pictures in the Graphics
Designer are closed.
Position the VBA code either


in the " GlobalTemplateDocument " if you want the toolbar to be available in all
projects, or



in the " ProjectTemplateDocument " if you want the toolbar to be available in the
current project.

Procedure
Procedure
1

Open the VBA editor in the Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

Printout of the Online Help
Automated Configuring

23

VBA in the Graphics Designer

11.05

Procedure
3

To create a user-defined toolbar in the Graphics Designer, you can for
example insert a " CreateApplicationToolbars() " procedure in the document.
In this example two user-defined toolbars are created:
Sub CreateApplicationToolbars()
'VBA6
'Declare toolbar-objects...:
Dim objToolbar1 As HMIToolbar
Dim objToolbar2 As HMIToolbar
'
'Add the toolbars with parameter " Key "
Set objToolbar1 =
Application.CustomToolbars.Add( " AppToolbar1 " )
Set objToolbar2 =
Application.CustomToolbars.Add( " AppToolbar2 " )
End Sub

4

Start the procedure with & lt; F5 & gt; .

Results
The two toolbars are inserted beneath the Graphics Designer toolbars.

24

Printout of the Online Help
Automated Configuring

11.05

2.2.1.5

VBA in the Graphics Designer

How to Add a New Tool Icon to Toolbar

Prerequisite
You must have created the user-defined toolbar first.

Introduction
You can insert two different types of objects in the user-defined toolbar:


Symbol icon: To call VBA macros.



Separator line: For clearer design of user-defined toolbars.

The " Position " parameter determines the order of the tool icons within the userdefined toolbar.
The " Key " parameter is a unique identification of the tool icon. This parameter is
used if you use the " ToolbarItemClicked " event for calling VBA macros.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

25

VBA in the Graphics Designer

11.05

Procedure
3

To create tool icons in a previously created user-defined toolbar, you can
for example insert an " InsertToolbarItems() " procedure in the document. In
this example, two tool icons separated by a separator line are created in the
user-defined toolbar " AppToolbar1 " :
Sub InsertToolbarItems()
'VBA7
Dim objToolbar1 As HMIToolbar
Dim objToolbarItem1 As HMIToolbarItem
'
'Add a new toolbar:
Set objToolbar1 =
Application.CustomToolbars.Add( " AppToolbar1 " )
'Adds two toolbar-items to the toolbar
'( " InsertToolbarItem(Position, Key,
DefaultToolTipText) " -Methode):
Set objToolbarItem1 =
objToolbar1.ToolbarItems.InsertToolbarItem(1,
" tItem1_1 " , " First Symbol-Icon " )
Set objToolbarItem1 =
objToolbar1.ToolbarItems.InsertToolbarItem(3,
" tItem1_2 " , " Second Symbol-Icon " )
'
'Adds a seperator between the two toolbar-items
'( " InsertSeparator(Position, Key) " -Methode):
Set objToolbarItem1 =
objToolbar1.ToolbarItems.InsertSeparator(2,
" tSeparator1_3 " )
End Sub

4

Start the procedure with & lt; F5 & gt; .

Results
The " InsertToolbarItems() " procedure adds a toolbar with two tool icons, separated
by a dividing line, to the Graphics Designer toolbars:

Note

26

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Use the icon property in order to specify a graphic (*.ICO format) for a tool icon.

Printout of the Online Help
Automated Configuring

27

VBA in the Graphics Designer

2.2.1.6

11.05

How to Assign Help Texts to Menus and Toolbars

Prerequisite
You must have created the user-defined menu or the user-defined toolbar first.

Introduction
When the configuring engineer moves the mouse over a user-defined menu item or
a user-defined tool icon, you can make additional help text available which explains
how it works:


You can define a help text for user-defined menu items and tool icons; the help
text is displayed in the status bar.



For user-defined tool icons, the default option is to create the help text as a
tooltip.

You can also define status texts and tooltip texts for other languages.

Procedure
Procedure
1
2

28

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )
In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
3

To assign a status text to a user-defined menu item, you can for example
insert an " AddStatusTextsToAppMenu1() " procedure in the document. In
this example one status text in German and one in English is assigned to
the first menu item in the previously created " AppMenu1 " menu:
Sub AddStatusTextsToAppMenu1()
'VBA8
Dim objMenu1 As HMIMenu
'
'Object " objStatusTextMenuItem1 " contains foreignlanguage texts
Dim objStatusTextMenuItem1 As HMILanguageText
Set objMenu1 = Application.CustomMenus( " AppMenu1 " )
'
'Assign a statustext to a menuitem:
objMenu1.MenuItems( " mItem1_1 " ).StatusText =
" Statustext the first menuitem "
'
'Assign a foreign statustext to a menuitem:
Set objStatusTextMenuItem1 =
objMenu1.MenuItems( " mItem1_1 " ).LDStatusTexts.Add(10
33, " This is my first status text in English " )
End Sub

Printout of the Online Help
Automated Configuring

29

VBA in the Graphics Designer

11.05

Procedure
4

To assign status and foreign-language Tooltip text to a user-defined button
on the toolbar, insert a " AddStatusAndTooltipTextsToAppToolbar1() "
procedure in the document, for example. In this example, the first button on
the toolbar created is assigned a status text (German/English) and an
English Tooltip text:
Sub AddStatusAndTooltipTextsToAppToolbar1()
'VBA9
Dim objToolbar1 As HMIToolbar
'
'Variable " StatusTextToolbarItem1 " for foreign
statustexts
Dim objStatusTextToolbarItem1 As HMILanguageText
'
'Variable " TooltipTextToolbarItem1 for foreign
tooltiptexts
Dim objTooltipTextToolbarItem1 As HMILanguageText
Set objToolbar1 =
Application.CustomToolbars( " AppToolbar1 " )
'
'Assign a statustext to a toolbaritem:
objToolbar1.ToolbarItems( " tItem1_1 " ).StatusText =
" Statustext für das erste Symbol-Icon "
'
'Assign a foreign statustext to a toolbaritem:
Set objStatusTextToolbarItem1 =
objToolbar1.ToolbarItems( " tItem1_1 " ).LDStatusTexts.
Add(1033, " This is my first status text in
English " )
'
'Assign a foreign tooltiptext to a toolbaritem:
Set objTooltipTextToolbarItem1 =
objToolbar1.ToolbarItems( " tItem1_1 " ).LDTooltipTexts
.Add(1033, " This is my first tooltip text in
English " )
End Sub

5

Start the procedures with & lt; F5 in each case & gt; .

Results
The status text is displayed when you move the mouse pointer over the userdefined menu item or the tool icon.

30

Printout of the Online Help
Automated Configuring

11.05

2.2.1.7

VBA in the Graphics Designer

How to Assign VBA Macros to Menus and Toolbars

Introduction
There are two possible ways for you to assign VBA macros to user-defined menus
and toolbars:


You can use either the VBA event handlers " MenuItemClicked " and
" ToolbarItemClicked " or



" Macro " property.

Note
You will find the VBA code for creating the required user-defined menus and
toolbars in this documentation under " Adding a New Menu Item to a Menu " and
" Adding a New Tool Icon to a Toolbar " .
Procedure
Assigning a VBA macro with a VBA event handler
Note
You will find further information on VBA event handlers in this documentation
under " Event Handling " .

Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

3

To start a VBA macro via the VBA event handlers, use the
" MenuItemClicked " or " ToolbarItemClicked " event:

Printout of the Online Help
Automated Configuring

31

VBA in the Graphics Designer

11.05

Procedure
Option Explicit
'VBA10
'The next declaration has to be placed in the modul
section
Dim WithEvents theApp As grafexe.Application
Private Sub SetApplication()
'This procedure has to be executed (with " F5 " )
first
Set theApp = grafexe.Application
End Sub
Private Sub theApp_MenuItemClicked(ByVal MenuItem As
IHMIMenuItem)
Dim objClicked As HMIMenuItem
Dim varMenuItemKey As Variant
Set objClicked = MenuItem
'
' " varMenuItemKey " contains the value of parameter
" Key "
'from clicked menu-item
varMenuItemKey = objClicked.Key
Select Case varMenuItemKey
Case " mItem1_1 "
MsgBox " The first menuitem was clicked! "
End Select
End Sub
Private Sub theApp_ToolbarItemClicked(ByVal ToolbarItem
As IHMIToolbarItem)
Dim objClicked As HMIToolbarItem
Dim varToolbarItemKey As Variant
Set objClicked = ToolbarItem
'
' " varToolbarItemKey " contains the value of
parameter " Key "
'from clicked toolbar-item
varToolbarItemKey = objClicked.Key
Select Case varToolbarItemKey
Case " tItem1_1 "
MsgBox " The first symbol-icon was clicked! "

32

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
End Select
End Sub
4

Start the procedures with & lt; F5 in each case & gt; .

Assigning a VBA Macro by Means of the " Macro " Property
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

Printout of the Online Help
Automated Configuring

33

VBA in the Graphics Designer

11.05

Procedure
3

To start a VBA macro via the Macro property, assign the VBA macro to
each menu item or tool icon. In the following example, a user-defined menu
is created with two menu items, which call two different VBA macros:
Sub CreateDocumentMenusUsingMacroProperty()
'VBA11
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1,
" DocMenu1 " , " Doc_Menu_1 " )
Set objMenuItem =
objDocMenu.MenuItems.InsertMenuItem(1, " dmItem1 1 " ,
" First Menuitem " )
Set objMenuItem =
objDocMenu.MenuItems.InsertMenuItem(2, " dmItem1 2 " ,
" Second Menuitem " )
'
'Assign a VBA-macro to every menu item
With ActiveDocument.CustomMenus( " DocMenu1 " )
.MenuItems( " dmItem1_1 " ).Macro = " TestMacro1 "
.MenuItems( " dmItem1_2 " ).Macro = " TestMacro2 "
End With
End Sub
You can call the following two procedures via the menu items in the userdefined menu " DocMenu1 " :
Sub TestMacro1()
'VBA12
MsgBox " TestMacro1 is execute "
End Sub
Sub TestMacro2()
MsgBox " TestMacro2 is execute "
End Sub

4

34

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.2.1.8

VBA in the Graphics Designer

Configuring menus and toolbars

Introduction
You can " liven up " user-defined menus and toolbars so that they respond to certain
program situations in the Graphics Designer. For example, if a tool icon is not
available because no object is selected, you can dim the icon. A check mark before
a menu item can indicate, for example, whether a selection is activated.
The following illustration shows you the configuration possibilities, using the
example of a user-defined menu:

Active (yes/no) (1)
Activates the entry or dims it. You can use the " Enabled " property for user-defined
menus, menu items and tool icons:
'VBA13
Application.ActiveDocument.CustomMenus(1).MenuItems(1).
Enabled = False
Marked with check mark (yes/no) (2)
Marks the menu item with a check mark. You can only use the " Checked " property
for user-defined menu items:
'VBA14
Application.ActiveDocument.CustomMenus(1).MenuItems(2).
Checked = True
Shortcut (3)
Defines a key combination for a menu item or tool icon. You can only use the
" Shortcut " property for user-defined menu items and tool icons:
'VBA15
Application.ActiveDocument.CustomMenus(1).MenuItems(3).
Shortcut = " Strg+G "
Visible (yes/no) (4)
Displays or hides the item. You can use the " Visible " property for user-defined
menus, menu items and toolbars and for their tool icons:
'VBA16
Application.ActiveDocument.CustomMenus(1).MenuItems(4).
Visible = False

Printout of the Online Help
Automated Configuring

35

VBA in the Graphics Designer

2.2.2

11.05

Access to the component library with VBA

Introduction
The component library contains a large selection of ready-made objects which you
can use to design your screens efficiently. The component library consists of a
global library and a project-related library:


The " Global Library " contains prepared objects that are supplied with WinCC.
The objects are filed in folders, sorted according to subjects, such as valves,
motors, cables and many others.



The " Project Library " contains neither objects nor folders when you have
created a new project. You can create objects which you need only in this
particular project in the " Project Library " .

With VBA you can access the component library without restriction. You can create
and delete folders, and store objects in the component library or insert them into a
picture.

Access to the component library with VBA

The component library is represented in VBA by the " SymbolLibraries " listing. The
listing contains two elements, which represent the " Global Library " and the " Project
Library " . The " FolderItems " listing contains elements representing both folders and
objects.
Note:
To address an object in the " SymbolLibraries " listing you use either the index
number or the internal name.
You can find out the internal name by clicking the right mouse button on the
relevant object in the component library and then choosing the " Copy path "
command in the pop-up menu.
The path to the object within the component library is then copied to the clipboard.

36

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Global Library (1)
The " Global Library " is the first element in the SymbolLibraries listing. You address
using index number " 1 " . You address the " Project Library " using index number " 2 " .
Access to the " Global Library " with VBA:
'VBA17
Application.SymbolLibraries(1)
Folder (2)
A folder in the component library contains either other folders or the objects of a
particular subject area. In VBA a folder corresponds to the " FolderItem " object and
its type is " Folder " . The folders are contained in the " FolderItems " listing. With VBA
you can create a new folder or delete an existing one, and add an object to the
folder via the clipboard.
Access to the " Plant Components " folder with VBA:
'VBA18
Application.SymbolLibraries(1).FolderItems( " Folder2 " )
Object (3)
In VBA an object corresponds to the " FolderItem " object and its type is " Item " . The
objects are contained in the " Folder " listing. With VBA you can delete an object or
copy it to the clipboard.
Access to the " PC " object with VBA:
'VBA19
Application.SymbolLibraries(1).FolderItems( " Folder2 " ).Folder(
" Folder2 " ).Folder.Item( " Object1 " ).DisplayName

Printout of the Online Help
Automated Configuring

37

VBA in the Graphics Designer

11.05

Creating or deleting folders in the component library
Use the following methods to create or delete folders:


" AddFolder(DefaultName) " method: creates a new folder in the component
library. A newly created folder is given the internal name of " FolderX " , where
" X " is a consecutive number.



" Delete() " method: deletes an existing folder (including all folders and objects
that it contains) from the component library.

Inserting or deleting an object in the component library
You can copy objects within the component library (for example from the " Global
Library " to the " Project Library " ), insert an object from a picture into the component
library or delete an object from the component library:


" CopyToClipboard() " and " AddFromClipboard() " methods: Copy an object via
the clipboard within the component library.



" AddItem(DefaultName, pHMIObject) " method: Copies an existing object in the
picture into a folder in the component library.



" Delete() " method: deletes an object.

Finding an object or folder in the component library
Use the " FindByDisplayName( " DisplayName " ) method to search for an object or
folder. The specified display name is dependent on which language is currently set.
The search ends with the first occurrence of the object or folder that you are
looking for.

Inserting an object into a picture from the component library
Use the " CopyToClipboard() " and " PasteClipboard() " methods to insert an object
from the component library into the current picture.

38

Printout of the Online Help
Automated Configuring

11.05

2.2.2.1

VBA in the Graphics Designer

How to Edit the Component Library with VBA

Introduction
Here you will find the following instructions for editing the component library with
VBA:


Creating a new folder



Copying an object within the component library



Copying an object from the active picture into the component library



Deleting an object from the component library

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

Printout of the Online Help
Automated Configuring

39

VBA in the Graphics Designer

11.05

Procedure
3

To create a new folder in the component library, you can for example insert
an " AddNewFolderToProjectLibrary() " procedure in the document. In this
example the folder " My folder " is created:
Sub AddNewFolderToProjectLibrary()
'VBA20
Dim objProjectLib As HMISymbolLibrary
Set objProjectLib = Application.SymbolLibraries(2)
'
'( " AddFolder(DefaultName) " -Methode):
objProjectLib.FolderItems.AddFolder ( " Custom
Folder " )
End Sub

4

In order to copy an object from the " global library " to the " library project " ,
insert a " CopyObjectFromGlobalLibraryToProjectLibrary() " procedure in the
document, for example. In this example, the object " Object1 " is copied:
Sub CopyObjectFromGlobalLibraryToProjectLibrary()
'VBA21
Dim objGlobalLib As HMISymbolLibrary
Dim objProjectLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
Set objProjectLib = Application.SymbolLibraries(2)
'
'Copies object " PC " from the " Global Library " into
the clipboard
objGlobalLib.FolderItems( " Folder2 " ).Folder( " Folder2
" ).Folder.Item( " Object1 " ).CopyToClipboard
'
The folder " Custom Folder " has to be available
objProjectLib.FolderItems( " Folder1 " ).Folder.AddFrom
ClipBoard ( " Copy of PC/PLC " )
End Sub

40

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
5

In order to copy an object from the active picture to the " library project " ,
insert an " AddObjectFromPictureToProjectLibrary() " procedure in the
document, for example. In this example, the object " Circle1 " is created in
the active picture and then copied to the folder " Folder1 " :
Sub AddObjectFromPictureToProjectLibrary()
'VBA22
Dim objProjectLib As HMISymbolLibrary
Dim objCircle As HMICircle
Set objProjectLib = Application.SymbolLibraries(2)
'
'Insert new object " Circle1 "
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
'
'The folder " Custom Folder " has to be available
'( " AddItem(DefaultName, pHMIObject) " -Methode):
objProjectLib.FolderItems( " Folder1 " ).Folder.AddItem
" ProjectLib Circle " ,
ActiveDocument.HMIObjects( " Circle1 " )
End Sub

6

To delete an object from the component library, insert a
" DeleteObjectFromProjectLibrary() " procedure in the document, for
example. In this example the previously created folder " Folder1 " is deleted:
Sub DeleteObjectFromProjectLibrary()
'VBA23
Dim objProjectLib As HMISymbolLibrary
Set objProjectLib = Application.SymbolLibraries(2)
'
'The folder " Custom Folder " has to be available
'( " Delete " -Methode):
objProjectLib.FolderItems( " Folder1 " ).Delete
End Sub

7

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

41

VBA in the Graphics Designer

2.2.2.2

11.05

How to Insert an Object from the Component Library into a Picture with
VBA

Procedure
Procedure
1
2

42

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )
In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
3

To insert an object from the " Global Library " into the active picture, you can
for example insert a " CopyObjectFromGlobalLibraryToActiveDocument() "
procedure in the document. In this example the object " Object1 " is inserted
into the active picture:
Sub CopyObjectFromGlobalLibraryToActiveDocument()
'VBA24
Dim objGlobalLib As HMISymbolLibrary
Dim objHMIObject As HMIObject
Dim iLastObject As Integer
Set objGlobalLib = Application.SymbolLibraries(1)
'
'Copy object " PC " from " Global Library " to
clipboard
objGlobalLib.FolderItems( " Folder2 " ).Folder( " Folder2
" ).Folder.Item( " Object1 " ).CopyToClipboard
'
'Get object from clipboard and add it to active
document
ActiveDocument.PasteClipboard
'
'Get last inserted object
iLastObject = ActiveDocument.HMIObjects.Count
Set objHMIObject =
ActiveDocument.HMIObjects(iLastObject)
'
'Set position of the object:
With objHMIObject
.Left = 40
.Top = 40
End With
End Sub

4

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

43

VBA in the Graphics Designer

2.3

11.05

Editing Pictures with VBA

Introduction
Pictures visualize the process to be executed and observed. They show important
process steps or parts of the plant and are a schematic representation of the
production sequence. In VBA the picture is represented by the Document object.

Picture-specific menus and toolbars
In contrast with the application-specific menus and toolbars, the picture-specific
menus and toolbars are coupled to a specific picture. The picture-specific menus
and toolbars remain visible for as long as the picture is active.
You should use picture-specific menus and toolbars when the called VBA macros
are only used in that picture.

Layers
You can access the layers in the Graphics Designer with VBA. Each layer is
represented by the Layer object. By changing the properties of the Layer object
you can specify among other things the layer names and the zoom settings.
You control the visibility of the RT layers via the Document object. You control the
visibility of the CS layers via the View object.

Copies of the picture
You can create copies of a picture with VBA in order to display different views of a
picture. The copy of a picture is represented in VBA by the View object.
In the properties of the View object you can among other things set the zoom factor
and specify which picture section is to be displayed.

44

Printout of the Online Help
Automated Configuring

11.05

2.3.1

VBA in the Graphics Designer

How to Create Picture-Specific Menus and Toolbars

Introduction
Picture-specific menus and toolbars are linked to a specific picture and remain
visible for as long as the picture is active. You should use picture-specific menus
and toolbars when the VBA macros used there are relevant only for that particular
picture.

Procedure
Procedure
1

Open the VBA editor in the Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

Open the document " ThisDocument " in the Project Explorer:

3

To create a picture-specific menu, you can for example insert a
" CreateDocumentMenus() " procedure in the document " ThisDocument " :
Sub CreateDocumentMenus()
'VBA25
'Declare menuobjects:
Dim objMenu1 As HMIMenu
Dim objMenu2 As HMIMenu
'Insert Menus ( " InsertMenu " -Methode) with
'Parameters - " Position " , " Key " , " DefaultLabel " :
Set objMenu1 =
ActiveDocument.CustomMenus.InsertMenu(1,
" DocMenu1 " , " Doc_Menu_1 " )
Set objMenu2 =
ActiveDocument.CustomMenus.InsertMenu(2,
" DocMenu2 " , " Doc_Menu_2 " )
End Sub

Printout of the Online Help
Automated Configuring

45

VBA in the Graphics Designer

11.05

Procedure
4

To create a picture-specific toolbar, you can for example insert a
" CreateDocumentToolbars() " procedure in the document " ThisDocument " :
Sub CreateDocumentToolbars()
'VBA26
'Declare required number of toolbarobjects:
Dim objToolbar1 As HMIToolbar
Dim objToolbar2 As HMIToolbar
'
'Insert toolbars ( " Add " -Methode) with
'Parameter - " Key " :
Set objToolbar1 =
ActiveDocument.CustomToolbars.Add( " DocToolbar1 " )
Set objToolbar2 =
ActiveDocument.CustomToolbars.Add( " DocToolbar2 " )
End Sub

5

46

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.3.2

VBA in the Graphics Designer

Editing layers with VBA

Introduction
You can arrange objects in 32 layers in the Graphics Designer. The layers are
differentiated according to CS layers and RT layers so that the visibility of the
layers in the picture (CS) and in runtime (RT) can be controlled separately. In VBA
a layer is represented by the Layer object:

In the Graphics Designer the lowest layer is " Layer 0 " . To give back the lowest
layer with VBA, use the index " 1 " :
ActiveDocument.Layers(1)

Using the Layer object
You use the Layer object in order to specify the minimum and maximum zoom for a
layer and to assign a name. In the following example the settings of the lowest
layer are configured in the active picture:
Sub ConfigureSettingsOfLayer
'VBA27
Dim objLayer As HMILayer
Set objLayer = ActiveDocument.Layers(1)
With objLayer
'Configure " Layer 0 "
.MinZoom = 10
.MaxZoom = 100
.Name = " Configured with VBA "
End With
End Sub

Printout of the Online Help
Automated Configuring

47

VBA in the Graphics Designer

11.05

Controlling the visibility of CS and RT layers
You control the visibility of the CS layers via the View object. Use the Document
object in order to determine which layers are to be displayed or hidden in runtime.
You can control the visibility of the CS and RT layers with the following methods:


" IsCSLayerVisible(Index) " method: checks whether the specified CS layer is
displayed.



" SetCSLayerVisible(Index, Val) " method: displays or hides the specified CS
layer.

Use the IsRTLayerVisible and SetRTLayerVisible methods for the RT layers in the
same way.

48

Printout of the Online Help
Automated Configuring

11.05

2.3.3

VBA in the Graphics Designer

Editing a copy of a picture with VBA

Introduction
You can create copies of a picture with VBA in order to display different views of a
picture. Each view is shown in a separate window. The copy of a picture is
represented in VBA by the View object:

In the properties of the View object you can among other things set the zoom factor
and specify which picture section is to be displayed.

Creating a copy of a picture
Use the Add method to create a copy of the specified picture. In this example a
copy of the active picture is created and activated:
Sub CreateAndActivateView()
'VBA28
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

Printout of the Online Help
Automated Configuring

49

VBA in the Graphics Designer

11.05

Editing a copy of a picture
You can edit each copy of a picture as follows:


Set the zoom factor: use the Zoom property.



Specify the picture section: use the " ScrollPosX " and " ScrollPosY " properties to
specify the picture section using the scroll bars.



Show or hide CS layers: you can use the SetCSLayerVisible(Index) method,
for example, to show or hide the specified layer. You can select the layer on
which you want to edit the objects with the ActiveLayer property.

In the following example a copy of the active picture is created and activated. The
zoom factor is set to 150% and the position of the scrollbars is changed:
Sub SetZoomAndScrollPositionInActiveView()
'VBA29
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
With objView
.Activate
.ScrollPosX = 40
.ScrollPosY = 10
.Zoom = 150
End With
End Sub

50

Printout of the Online Help
Automated Configuring

11.05

2.4

VBA in the Graphics Designer

Editing objects with VBA

Access to objects in the Graphics Designer

In VBA all object types of the current picture are contained in the " HMIObjects "
listing. They are not divided according to object type (Standard, Smart, Windows
and Controls objects) as in the Graphics Designer. With VBA you can therefore run
through all objects in one or more pictures with a loop.
When you have selected objects in the picture, these objects are contained in the
" Selection " listing. Use the " HMIDefaultObjects " listing if you want to change the
default settings of the properties of an object.
To address an object in a picture with VBA, use either the object name, e.g.
" ActiveDocument.HMIObjects( " Circle1 " ), or the index number.
" ActiveDocument.HMIObjects(1) " references, for example, the first object in the
active picture.

Editing objects with VBA
You have the following possibilities for editing objects with VBA:


Create a new object in a picture



Delete an existing object



Copy an existing object



Group existing objects or cancel the grouping



Search for objects



Display or change object properties

When you insert a new object into a picture with VBA, the object behaves in the
same way as if you double-clicked it in the Graphics Designer object palette. The
object is given the predefined property values and is inserted in the top left-hand
corner of the picture.

Printout of the Online Help
Automated Configuring

51

VBA in the Graphics Designer

11.05

Access to the object properties is dependent on how you created the object. Two
examples illustrate this:
Example 1:
In this example a circle of the type " HMIObject " is inserted into the current picture.
You can use a VBA object of the " HMIObject " type or all objects in the Graphics
Designer. However, you have to address individual properties of the respective
object explicitly via the " Properties(Index) " property:
Sub AddObject()
'VBA30
Dim objObject As HMIObject
Set objObject =
ActiveDocument.HMIObjects.AddHMIObject( " CircleAsHMIObjec
t " , " HMICircle " )
'
'standard-properties (e.g. the position) are available
every time:
objObject.Top = 40
objObject.Left = 40
'
'non-standard properties can be accessed using the
Properties-collection:
objObject.Properties( " FlashBackColor " ) = True
End Sub
Example 2:
In this example a circle of the type " HMICircle " is inserted into the current picture.
In contrast with Example 1 you can only use the " objCircle " object for objects of the
" HMICircle " type, however:
Sub AddCircle()
'VBA31
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " CircleAsHMICircl
e " , " HMICircle " )
'
'The same as in example 1, but here you can set/get
direct the
'specific properties of the circle:
objCircle.Top = 80
objCircle.Left = 80
objCircle.FlashBackColor = True
End Sub

52

Printout of the Online Help
Automated Configuring

11.05

2.4.1

VBA in the Graphics Designer

Standard, Smart and Windows objects

Introduction
You use the Standard, Smart and Windows objects to design your pictures. In the
Graphics Designer you will find these objects on the object palette on the
" Standard " tab:

VBA enables you to access these objects in all pictures in your project. If, for
example, you want to change the background color of all circles in a project with
several pictures, you can do this with a VBA macro.

Paste Object in Picture
Use the " AddHMIObject(ObjectName, ProgID) " method to insert a new object in a
picture: " ObjectName " stands for the name of the object (e.g. " my Circle " ), and
" ProgID " for the VBA object designation (e.g. " HMICircle " ):
Sub AddCircle()
'VBA32
'Creates object of type " HMICircle "
Dim objCircle As HMICircle
'
'Add object in active document
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " My Circle " ,
" HMICircle " )
End Sub

Printout of the Online Help
Automated Configuring

53

VBA in the Graphics Designer

11.05

The object is inserted in the top left-hand corner of the picture and is entered as
the last element in the " HMIObjects " listing.
Edit Object
VBA gives you access to all object properties that you can edit via the object's
properties dialog. You can change and output object properties, and select objects
in the picture. If you have not selected an object, you can use the following
methods:


" Find() " method: searches for an object in the " HMIObjects " listing



" Delete() " method: deletes an HMIObject object

If you have selected objects, you can edit them via the " Selection " listing with the
following methods:



" CreateGroup() " , " CreateCustomizedObject() " : these methods create a group
object or customized object.



54

" AlignLeft() " , " AlignRight() " , " AlignTop() " , " AlignBottom() " : these methods align
objects.

" DeselectAll() " method: cancels the selection of all objects.

Printout of the Online Help
Automated Configuring

11.05

2.4.1.1

VBA in the Graphics Designer

How to Edit Standard, Smart and Windows Objects

Introduction
Here you will find the following instructions for editing Standard, Smart and
Windows objects:


Define properties of a specific object



Define properties of a nonspecific object



Select an object in the active picture



Find objects in the active picture



Delete object

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

Open the document " ThisDocument " in the Project Explorer:

3

To define the properties of a specific object type (e.g. " HMICircle " ), you can
for example insert an " EditDefinedObjectType() " procedure in the document
" ThisDocument " . In this example a circle is inserted in the active picture and
its line weight and color are modified:
Sub EditDefinedObjectType()
'VBA33
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " myCircleAsC
ircle " , " HMICircle " )
With objCircle
'direct calling of objectproperties available
.BorderWidth = 4
.BorderColor = RGB(255, 0, 255)
End With
End Sub

4

To change the properties of a nonspecific object type ( " HMIObject " ), insert a

Printout of the Online Help
Automated Configuring

55

VBA in the Graphics Designer

11.05

Procedure
" EditHMIObject() " procedure in the document " ThisDocument " , for example.
In this example a circle is inserted in the active picture and its line weight
and color are modified:
Sub EditHMIObject()
'VBA34
Dim objObject As HMIObject
Set objObject =
ActiveDocument.HMIObjects.AddHMIObject( " myCircleAsO
bject " , " HMICircle " )
With objObject
'Access to objectproperties only with property
" Properties " :
.Properties( " BorderWidth " ) = 4
.Properties( " BorderColor " ) = RGB(255, 0, 0)
End With
End Sub
5

To select an object in the current picture, insert a " SelectObject() "
procedure in the document " ThisDocument " , for example. In this example, a
circle will be inserted in the active picture and selected:
Sub SelectObject()
'VBA35
Dim objObject As HMIObject
Set objObject =
ActiveDocument.HMIObjects.AddHMIObject( " mySelectedC
ircle " , " HMICircle " )
ActiveDocument.HMIObjects( " mySelectedCircle " ).Selec
ted = True
End Sub

6

To search for an object in the current picture, insert a
" FindObjectsByName() " , " FindObjectsByType(), " or
" FindObjectsByProperty() " procedure in the document " ThisDocument " , for
example. In this example, objects containing the string " Circle " in their name
are searched for:
Sub FindObjectsByName()
'VBA36
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
'
'Wildcards (?, *) are allowed
Set colSearchResults =
ActiveDocument.HMIObjects.Find(ObjectName:= " *Circle
* " )

56

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
For Each objMember In colSearchResults
iResult = colSearchResults.Count
strName = objMember.ObjectName
MsgBox " Found: " & CStr(iResult) & vbCrLf &
" Objectname: " & strName
Next objMember
End Sub
In this example a search is run in the active picture for objects of the type
" HMICircle " :
Sub FindObjectsByType()
'VBA37
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
Set colSearchResults =
ActiveDocument.HMIObjects.Find(ObjectType:= " HMICirc
le " )
For Each objMember In colSearchResults
iResult = colSearchResults.Count
strName = objMember.ObjectName
MsgBox " Found: " & CStr(iResult) & vbCrLf &
" Objektname: " & strName
Next objMember
End Sub
In this example a search is run in the active picture for objects with the
property " BackColor " :
Sub FindObjectsByProperty()
'VBA38
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
Set colSearchResults =
ActiveDocument.HMIObjects.Find(PropertyName:= " BackC
olor " )
For Each objMember In colSearchResults
iResult = colSearchResults.Count
strName = objMember.ObjectName
MsgBox " Found: " & CStr(iResult) & vbCrLf &
" Objectname: " & strName

Printout of the Online Help
Automated Configuring

57

VBA in the Graphics Designer

11.05

Procedure
Next objMember
End Sub
7

To delete an object, you can for example insert a " DeleteObject() "
procedure in the document " ThisDocument " . In this example the first object
in the active picture will be deleted.
Sub DeleteObject()
'VBA39
'Delete first object in active document:
ActiveDocument.HMIObjects(1).Delete
End Sub

8

58

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.4.1.2

VBA in the Graphics Designer

OLE objects

Introduction
You can use VBA to insert OLE objects into a picture. The OLE object belongs to
the Smart objects. In the Graphics Designer you will find it on the object palette on
the " Standard " tab:

Printout of the Online Help
Automated Configuring

59

VBA in the Graphics Designer

11.05

Paste OLE Object in Picture
Use the " AddOLEControl(ObjectName, ServerName, [CreationType], [UseSymbol])
method to insert an OLE object into a picture. " ObjectName " stands for the object
name, and " ServerName " for the application that is to be contained in the OLE
object. The " ServerName " parameter corresponds to the object type in the " object
insertion " dialog. The last two parameters are optional and represent the possible
settings " in the dialog displayed:

You will find further information on the parameters in this documentation under
" AddOLEObject method " .
In the following example an OLE object containing a Wordpad document will be
inserted into the active picture:
Sub AddOLEObjectToActiveDocument()
'VBA40
Dim objOLEObject As HMIOLEObject
Set objOLEObject =
ActiveDocument.HMIObjects.AddOLEObject( " MS Wordpad
Document1 " , " Wordpad.Document.1 " )
End Sub
The OLEObject object is added to the " HMIObjects " listing as the last element and
inherits the properties of the HMIObject object.

60

Printout of the Online Help
Automated Configuring

11.05

2.4.2

VBA in the Graphics Designer

ActiveX controls

Introduction
You can use VBA to insert ActiveX controls into a picture. In the Graphics Designer
you will find the ActiveX controls supplied with WinCC on the object palette on the
Controls tab:

Further information is provided under " AddActiveXControl method " in this
documentation and under " Object Palette " in the WinCC documentation.

Integrating standard ActiveX controls
As well as the ActiveX controls supplied with WinCC, you can insert all standard
ActiveX controls registered in the operating system into a picture. This means that
you also have the option of using ActiveX controls that you have programmed
yourself in your pictures. A list of the standard ActiveX controls tested with WinCC
is given in the WinCC documentation.

Printout of the Online Help
Automated Configuring

61

VBA in the Graphics Designer

11.05

Inserting an ActiveX control into a picture
Use the " AddActiveXControl(ObjectName, ProgID) " method to insert a new ActiveX
control into a picture. " ObjectName " stands for the name of the ActiveX control
(e.g. " WinCC Gauge " ), and " ProgID " for the VBA object designation (e.g.
" XGauge.XGauge.1 " ):
Sub AddActiveXControl()
'VBA41
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
" , " XGAUGE.XGaugeCtrl.1 " )
End Sub
The ActiveXControl object is added to the " HMIObjects " listing as the last element
and inherits the properties of the HMIObject object.

Access to the properties of the ActiveX control
You must address the object-specific properties of the ActiveX control via the
" Properties(Index) " property. You can find out which properties an ActiveX control
possesses from the " Object Properties " dialog in the Graphics Designer or from the
Properties listing:
Sub AddActiveXControl()
'VBA42
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
2 " , " XGAUGE.XGaugeCtrl.1 " )
'
'move ActiveX-control:
objActiveXControl.Top = 40
objActiveXControl.Left = 60
'
'Change individual property:
objActiveXControl.Properties( " BackColor " ).value =
RGB(255, 0, 0)
End Sub

62

Printout of the Online Help
Automated Configuring

11.05

2.4.3

VBA in the Graphics Designer

Group objects

Introduction
With VBA you can create a group object from selected objects in the Graphics
Designer. You can add objects to the group object, or remove objects, without
having to ungroup the group object itself. You have unrestricted access to the
object properties of the individual objects in the group object. You can also
ungroup a group object again, or delete it entirely.
The following object types cannot be part of a group object:


CustomizedObject (Customized object)



ActiveXControl



OLEObject

Further information regarding group objects can be found in the WinCC
documentation under " Group Object " .

Creating a group object
To create a group object, select the objects that you want to be part of the group
object in the Graphics Designer. The selected objects are then contained in the
" Selection " listing. You create the group with the " CreateGroup() " method:
Sub CreateGroup()
'VBA43
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "

Printout of the Online Help
Automated Configuring

63

VBA in the Graphics Designer

11.05

Set objGroup = ActiveDocument.Selection.CreateGroup
objGroup.ObjectName = " myGroup "
End Sub
The group object is inserted at the end of the " HMIObjects " listing. The objects that
are contained in the group object retain their index numbers and continue to be
available in the " HMIObjects " listing.
The objects in the group object are also included in the " GroupedHMIObjects "
listing, although the index numbers are reassigned.
Give the group object a name (objGroup.Name = " My Group " ) so that you can
uniquely identify it. If you do not assign a name, the group object is given the
default designation for the group object (e.g. " Group1 " ).
The group object has the same properties as the objects of the " Object " type.

Editing a group object
You can edit a group object as follows:


Method " Add(Index) " : Adds a new object to the group object.



Method " Remove(Index) " : Removes a new object from the group object.



" UnGroup() " method: Ungroups the group object (cancels grouping).



" Delete() " method: Deletes the group object and the objects that it contains.

Editing objects in a group object
Use the " GroupedHMIObjects " listing in order to select an object in the group
object. In order to access its object property you must access the name of the
object property via the " Properties " property:
Sub ModifyPropertyOfObjectInGroup()
'VBA44
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " myGroup " )
objGroup.GroupedHMIObjects(1).Properties( " BorderColor " )
= RGB(255, 0, 0)
End Sub

64

Printout of the Online Help
Automated Configuring

11.05

2.4.3.1

VBA in the Graphics Designer

How to Edit Group Objects with VBA

Prerequisite
You must have created at least two graphic objects in the Graphics Designer and
you must have selected them.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

Open the document " ThisDocument " in the Project Explorer:

Printout of the Online Help
Automated Configuring

65

VBA in the Graphics Designer

11.05

Procedure
3

To create a group object from selected objects, you can for example insert
a " CreateGroup() " procedure in the document " ThisDocument " . In this
example the group object " My Group " is created from a number of objects.
Sub CreateGroup()
'VBA45
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle "
, " HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
'The name identifies the group-object
objGroup.ObjectName = " My Group "
End Sub

66

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
4

To add an object to the " My Group " group object, insert a
" AddObjectToGroup() " procedure in the document " ThisDocument " , for
example. In this example, an ellipse is added to the " My Group " group
object:
Sub AddObjectToGroup()
'VBA46
Dim objGroup As HMIGroup
Dim objEllipseSegment As HMIEllipseSegment
'Adds new object to active document
Set objEllipseSegment =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseSegm
ent " , " HMIEllipseSegment " )
Set objGroup = ActiveDocument.HMIObjects( " My
Group " )
'Adds the object to the group
objGroup.GroupedHMIObjects.Add ( " EllipseSegment " )
End Sub

5

To remove an object from the " My Group " group object, insert a
" RemoveObjectFromGroup() " procedure in the document " ThisDocument " ,
for example. In this example the first object will be removed from the " My
Group " group object:
Sub RemoveObjectFromGroup()
'VBA47
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " My
Group " )
'delete first object of the group-object
objGroup.GroupedHMIObjects.Remove (1)
End Sub

6

To ungroup the " My Group " group object again, insert an " UnGroup() "
procedure in the document " ThisDocument " . In this example, the " My
Group " group object is ungrouped:
Sub UnGroup()
'VBA48
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " My
Group " )
objGroup.UnGroup
End Sub

Printout of the Online Help
Automated Configuring

67

VBA in the Graphics Designer

11.05

Procedure
7

To delete the " My Group " group object, insert a Delete " Group() " procedure
in the document " ThisDocument " . In this example, the " My Group " group
object is deleted, together with the objects it contains:
Sub DeleteGroup()
'VBA49
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " My
Group " )
objGroup.Delete
End Sub

8

68

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.4.3.2

VBA in the Graphics Designer

How to Edit Objects in a Group Object with VBA

Introduction
Here you will find the following instructions for editing objects in a group object with
VBA:


Editing a property of an object in the group object



Editing a property of all objects in the group object

Prerequisite
You must have created at least two graphic objects in the Graphics Designer and
you must have grouped them.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

Open the document " ThisDocument " in the Project Explorer:

3

To edit a property of an object within the group object, you can for example
insert a " ChangePropertiesOfGroupMembers() " procedure into the
document " ThisDocument " . In this example the properties of three different
objects are modified in the group object " My Group " :
Sub ChangePropertiesOfGroupMembers()
'VBA50
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =

Printout of the Online Help
Automated Configuring

69

VBA in the Graphics Designer

11.05

Procedure
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle "
, " HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
With objEllipse
.Top = 120
.Left = 120
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
objGroup.ObjectName = " My Group "
'Set bordercolor of 1. object = " red " :
objGroup.GroupedHMIObjects(1).Properties( " BorderCol
or " ) = RGB(255, 0, 0)
'set x-coordinate of 2. object = " 120 " :
objGroup.GroupedHMIObjects(2).Properties( " Left " ) =
120
'set y-coordinate of 3. object = " 90 " :
objGroup.GroupedHMIObjects(3).Properties( " Top " ) =
90
End Sub

70

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
4

To change the properties of all the objects in the group object, insert a
" ChangePropertiesOfAllGroupMembers() " procedure in the document
" ThisDocument " , for example. In this example, the " BorderColor " property of
each object in the " My Group " group object is changed. This example will
not work unless you have created the " My Group " group object:
Sub ChangePropertiesOfAllGroupMembers()
'VBA51
Dim objGroup As HMIGroup
Dim iMaxMembers As Integer
Dim iIndex As Integer
Set objGroup = ActiveDocument.HMIObjects( " My
Group " )
iIndex = 1
'
'Get number of objects in group-object:
iMaxMembers = objGroup.GroupedHMIObjects.Count
'
'set linecolor of all objects = " yellow " :
For iIndex = 1 To iMaxMembers
objGroup.GroupedHMIObjects(iIndex).Properties( " Bord
erColor " ) = RGB(255, 255, 0)
Next iIndex
End Sub

5

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

71

VBA in the Graphics Designer

2.4.4

11.05

Customized objects

Introduction
You can use VBA to create a customized object from selected objects in the
Graphics Designer. In contrast to the group object, in the case of a customized
object only those object properties are available which you have selected in the
" Configuration Dialog " for the customized object. It is not possible to configure a
customized object with VBA.
Further information regarding customized objects can be found in the WinCC
documentation under " Customized Object " .

Creating a customized object with VBA
Use the " CreateCustomizedObject() " method to create a customized object from
selected objects:
Sub CreateCustomizedObject()
'VBA52
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject =
ActiveDocument.Selection.CreateCustomizedObject
objCustomizedObject.ObjectName = " My Customized Object "
End Sub
When you apply the " CreateCustomizedObject() " method, the " Configuration
Dialog " appears in which you select the object properties. The customized object
that you have created is added to the " HMIObjects " listing. Give the customized
object an appropriate name (objCustomizedObject.Name = " My Customized
Object " ) so that you can uniquely identify it.

Editing a customized object
You can edit a customized object as follows:



72

" Destroy " method: destroys the customized object.
" Delete " method: deletes the customized object and the objects that it contains.

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Editing objects in a customized object
Use the " Properties " property to access the selected object properties of the
objects contained in the customized object:
Sub EditCustomizedObjectProperty()
'VBA53
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject = ActiveDocument.HMIObjects(1)
objCustomizedObject.Properties( " BackColor " ) = RGB(255,
0, 0)
End Sub
If you have selected more than one identical property (for example the background
color of a circle and of a rectangle), these properties will be numbered ( " BackColor "
and " BackColor1 " ).

Printout of the Online Help
Automated Configuring

73

VBA in the Graphics Designer

2.4.4.1

11.05

How to Edit a Customized Object with VBA

Introduction
Here you will find the following instructions for editing a customized object with
VBA:


Creating a customized object from selected objects



Ungrouping a customized object



Deleting a customized object

Note:
It is not possible to configure a customized object with VBA.
Procedure
Procedure
1
2

74

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )
Open the document " ThisDocument " in the Project Explorer:

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Procedure
3

To create a customized object from selected objects, you can for example
insert a " CreateCustomizedObject() " procedure in the document
" ThisDocument " . In this example the customized object " My Customized
Object " is created from selected objects:
Sub CreateCustomizedObject()
'VBA54
Dim objCustomizedObject As HMICustomizedObject
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle "
, " HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
Set objCustomizedObject =
ActiveDocument.Selection.CreateCustomizedObject
'
'*** The " Configurationdialog " started. ***
'*** Configure the costumize-object with the
" configurationdialog " ***
'
objCustomizedObject.ObjectName = " My Customized
Object "
End Sub

Printout of the Online Help
Automated Configuring

75

VBA in the Graphics Designer

11.05

Procedure
4

To delete an object, you can for example insert a " DeleteObject() "
procedure in the document " ThisDocument " . In this example the
customized object " My Customized Object " created beforehand is deleted
again:
Sub DestroyCustomizedObject()
'VBA55
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject =
ActiveDocument.HMIObjects( " My Customized Object " )
objCustomizedObject.Destroy
End Sub

5

To delete a customized object, you can for example insert a
" DeleteCustomizedObject() " procedure in the document " ThisDocument " . In
this example the customized object " My Customized Object " created
beforehand is deleted:
Sub DeleteCustomizedObject()
'VBA56
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject =
ActiveDocument.HMIObjects( " My Customized Object " )
objCustomizedObject.Delete
End Sub

6

76

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5

VBA in the Graphics Designer

Creating Dynamics with VBA

Introduction
VBA allows you to add dynamics to properties of pictures and objects and to
configure event-controlled actions. VBA provides you with the ActionDynamic
object for this purpose:

The ActionDynamic object represents an interface that is dependent on the object
type:


When you configure a dynamic for a property (Property object), the
ActionDynamic object inherits the properties of the ScriptInfo, Trigger and
DynamicDialog objects.



When you configure an event-controlled action (Event object), the
ActionDynamic object inherits the properties of the ScriptInfo and
DirectConnection objects.

Printout of the Online Help
Automated Configuring

77

VBA in the Graphics Designer

11.05

Adding dynamics to properties of pictures and objects
VBA enables you to add dynamics to properties of pictures and objects. You can
use variables, scripts or the Dynamic dialog to add dynamics. Using dynamics
enables you, for example, to configure a color change for an object in runtime
when the value of a variable changes.

Configuring event-controlled actions
You can configure event-controlled actions with VBA. An action (script or direct
connection) is triggered then the defined event occurs in runtime. An event may be
a change to an object property, for example, or the clicking of a button.

Editing triggers
You can edit triggers with VBA. Triggers are required when you use dynamics.
They determine when a dynamic value is updated in runtime. This may occur at
regular intervals, for example, or in the event of a picture change.
When you configure event-controlled actions, the event is the trigger.

78

Printout of the Online Help
Automated Configuring

11.05

2.5.1

VBA in the Graphics Designer

Adding dynamics to properties of pictures and objects

Introduction
VBA enables you to add dynamics to properties of pictures and objects. Dynamic
object properties can be changed as a function of a variable value in runtime. The
following methods of adding dynamics are possible:


Variable connection



Dynamic dialog



Scripts

Principle
The following example illustrates the principle of the procedure for adding
dynamics to an object property:
Sub CreateDynamicOnProperty()
'VBA57
Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
'
'Create dynamic with type " direct Variableconnection " at
the
'property " Radius " :
Set objVariableTrigger =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVar
iableDirect, " 'NewDynamic1' " )
'
'To complete dynamic, e.g. define cycle:
With objVariableTrigger
.CycleType = hmiVariableCycleType_2s
End With
End Sub
Note:
Note that a variable is not created simply by specifying the variable name. Use the
variable selection dialog to create the variable.

Printout of the Online Help
Automated Configuring

79

VBA in the Graphics Designer

11.05

Variable connection
Use the VariableTrigger object to add a dynamic to a property with a direct or
indirect variable connection. The dynamic property then responds in runtime to a
change in value to the specified variable. To allow this in VBA, you need to specify
the variable name (VarName property) and the cycle (CycleTime property).

Dynamic dialog
Use the DynamicDialog object to add dynamics to a property with the aid of the
Dynamic dialog. The property with the dynamics responds in runtime to a variable's
value ranges. The following objects are available for specifying the value range:


AnalogResultInfos object: use this object to assign a fixed value to value
ranges of a variable or a script. The fixed value is assigned to the dynamic
property when the variable value or return value of the script is within the
specified value range.



BinaryResultInfo object: use this object to assign a fixed value to binary value
ranges (zero and non-zero) of a variable or a script. The fixed value is
assigned to the dynamic property when the variable value or return value of the
script returns one of the two values.



VariableStateValue object: use this object to assign a fixed value to the state
(e.g. " High limit exceeded " ) of a specified variable. The fixed value is then
allocated to the dynamic property when the state occurs.

Scripts
Use the ScriptInfo object to add a dynamic to a property with a C or VB script. The
property with the dynamic responds to a script in runtime and is controlled via a
trigger. Use the Trigger object for configuring the trigger.

80

Printout of the Online Help
Automated Configuring

11.05

2.5.1.1

VBA in the Graphics Designer

How to Dynamize a Property with Tag Connection

Introduction
Here you will find the following instructions for dynamizing a property with tag
connection:


Dynamizing a property with direct tag connection



Dynamizing a property with indirect tag connection

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

81

VBA in the Graphics Designer

11.05

Procedure
3

To dynamize an object property with a direct tag connection, you can for
example insert an " AddDynamicAsVariableDirectToProperty() " procedure in
the document. In this example a circle property " Top " will be made dynamic
with the aid of the tag " Otto " :
Sub AddDynamicAsVariableDirectToProperty()
'VBA58
Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
'Create dynamic at property " Top "
Set objVariableTrigger =
objCircle.Top.CreateDynamic(hmiDynamicCreationTypeV
ariableDirect, " Otto " )
'
'define cycle-time
With objVariableTrigger
.CycleType = hmiVariableCycleType_2s
End With
End Sub

4

To dynamize an object property with an indirect tag connection, you can for
example insert an " AddDynamicAsVariableInDirectToProperty " () procedure
in the document. " In this example a circle property Left " will be made
dynamic with the aid of the tag " Anton " :
Sub AddDynamicAsVariableIndirectToProperty()
'VBA59
Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle2 " ,
" HMICircle " )
'Create dynamic on property " Left " :
Set objVariableTrigger =
objCircle.Left.CreateDynamic(hmiDynamicCreationType
VariableIndirect, " Anton " )
'
'Define cycle-time
With objVariableTrigger
.CycleType = hmiVariableCycleType_2s
End With
End Sub

5

82

Start the procedures with & lt; F5 in each case & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.1.2

VBA in the Graphics Designer

How to Dynamize a Property with Dynamic Dialog

Introduction
You can use the Dynamic dialog to dynamize properties of pictures and objects
depending on certain value ranges or variable states. The following value ranges
are available for selection:


Analog



Binary



Bit



Direct

With VBA you specify the type of value range with the ResultType property. These
instructions illustrate the addition of dynamics to an object property with analog
value ranges. Additional information dynamization with the dynamic dialog is
provided under " DynamicDialog object " in the VBA reference in this documentation.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

83

VBA in the Graphics Designer

11.05

Procedure
3

To dynamize an object property with the Dynamic dialog, you can for
example insert an " AddDynamicDialogToCircleRadiusTypeAnalog() "
procedure in the document. In the following example the radius of a circle
with the Dynamic dialog is dynamized, a tag name is assigned and three
analog value ranges are created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA60
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
'
'Create dynamic
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTy
peDynamicDialog, " 'NewDynamic1' " )
'
'Configure dynamic. " ResultType " defines the type
of valuerange:
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.Add 50, 40
.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
End With
End Sub

4

84

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.1.3

VBA in the Graphics Designer

How to Dynamize a Property with a C Script

Introduction
When you dynamize a property with a C script, you can assign the C code to the
" SourceCode " property. The C script is compiled in the background. The
" Compiled " property returns " True " when the C code has been successfully
compiled.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

85

VBA in the Graphics Designer

11.05

Procedure
3

To add dynamics to an object property with a C script, you can for example
insert an " AddDynamicAsCScriptToProperty() " procedure in the document.
In this example the height of a circle is increased by 5 pixels every two
seconds in runtime:
Sub AddDynamicAsCSkriptToProperty()
'VBA61
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
Dim strCode As String
strCode = " long lHeight; " & vbCrLf & " int check; " &
vbCrLf
strCode = strCode & " GetHeight( " " " & " events.PDL " " "
& " , " " " & " myCircle " " " & " ); " & vbCrLf
strCode = strCode & " lHeight = lHeight+5; " & vbCrLf
strCode = strCode & " check =
SetHeight( " " " events.PDL " " " ,
" " " myCircle " " " ,lHeight); "
strCode = strCode & vbCrLf & " //Return-Type: BOOL "
& vbCrLf
strCode = strCode & " return check; "
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " myCircle " ,
" HMICircle " )
'Create dynamic for Property " Height " :
Set objCScript =
objCircle.Height.CreateDynamic(hmiDynamicCreationTy
peCScript)
'
'set Sourcecode and cycletime:
With objCScript
.SourceCode = strCode
.Trigger.Type = hmiTriggerTypeStandardCycle
.Trigger.CycleType = hmiCycleType_2s
.Trigger.Name = " Trigger1 "
End With
End Sub

4

86

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.1.4

VBA in the Graphics Designer

How to Dynamize a Property with a VB Script

Introduction
When you dynamize a property with a VB script, you can assign the VB code to the
" SourceCode " property. The VB script is compiled in the background. The
" Compiled " property returns " True " if the VB code is syntactically correct.

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

Printout of the Online Help
Automated Configuring

87

VBA in the Graphics Designer

11.05

Procedure
3

To add dynamics to an object property with a VB script, you can for
example insert an " AddDynamicAsVBScriptToProperty() " procedure in the
document. In this example the radius of a circle is increased by 5 pixels
every two seconds in runtime:
Sub AddDynamicAsCSkriptToProperty()
'VBA62
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Dim strCode As String
strCode = " Dim myCircle " & vbCrLf & " Set myCircle =
"
strCode = strCode &
" HMIRuntime.ActiveScreen.ScreenItems( " " myCircle " " ) "
strCode = strCode & vbCrLf & " Set myCircle.Radius =
myCircle.Radius + 5 "
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " myCircle " ,
" HMICircle " )
'
'Create dynamic of property " Radius " :
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTy
peVBScript)
'
'Set SourceCode and cycletime:
With objVBScript
.SourceCode = strCode
.Trigger.Type = hmiTriggerTypeStandardCycle
.Trigger.CycleType = hmiCycleType_2s
.Trigger.Name = " Trigger1 "
End With
End Sub

4

88

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.2

VBA in the Graphics Designer

Configuring event-controlled actions with VBA

Introduction
With VBA you can configure actions for pictures and objects which are triggered
when predefined events occur. For example, when the mouse is clicked on an
object in runtime a C script is called whose return value is used for the dynamics of
an object property. The following methods of adding dynamics are possible:


Direct connection



Scripts

The events that are used for configuring event-controlled actions occur only in
runtime and have nothing to do with the VBA event handlers.

Principle
You use the Events property for configuring event-controlled actions with VBA. The
way this property is used depends on whether you are configuring an action on an
object or picture or a property.
Configuring an action on an object or picture
An action that you configure on a picture or object is triggered when a predefined
event occurs, for example when the object is clicked on with the mouse. You
configure an action on an object with VBA by using the " Events(Index) " property,
where " Index " stands for the triggering event:
Sub AddActionToObjectTypeCScript()
'VBA63
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
'Create circle. Click on object executes an C-action
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
Set objEvent = objCircle.Events(1)
Set objCScript =
objEvent.Actions.AddAction(hmiActionCreationTypeCScript)
'
'Assign a corresponding custom-function to the property
" SourceCode " :
objCScript.SourceCode = " "
End Sub

Printout of the Online Help
Automated Configuring

89

VBA in the Graphics Designer

11.05

Configuring an action on a property
An action that you configure on a property of a picture or object is triggered when
the property value changes. You configure an action on a property with VBA by
using the " Events(1) " property, where the index " 1 " stands for the event " Upon
change " :
Sub AddActionToPropertyTypeCScript()
'VBA64
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
'Create circle. Changing of the Property
' " Radius " should be activate C-Aktion:
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
Set objEvent = objCircle.Radius.Events(1)
Set objCScript =
objEvent.Actions.AddAction(hmiActionCreationTypeCScript)
'
'Assign a corresponding custom-function to the property
" SourceCode " :
objCScript.SourceCode = " "
End Sub
Direct connection
Use the DirectConnection object to configure a direct connection.

Scripts
Use the ScriptInfo object if you want an event to trigger a C or VB action.

90

Printout of the Online Help
Automated Configuring

11.05

2.5.2.1

VBA in the Graphics Designer

How to Configure a Direct Connection with VBA

Introduction
These instructions show you how to configure a direct connection on the basis of
two object properties. Further information on the configuring of direct connections
with VBA is given in the VBA reference in this documentation under
" AutomationName property " and " ObjectName property "

Procedure
Procedure
1

Open the VBA editor in the Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In the Project Explorer open the document in which you want to write the
VBA code:

3

To configure a direct connection to an object property, you can for example
insert an " AddDirectConnectionToObject() " procedure in the document. In
the following example the X position of " Rectangle_A " is copied to the Y
position of " Rectangle_B " in runtime by clicking on the button:
Sub DirectConnection()
'VBA65
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDConnection As HMIDirectConnection
'
'Create objects:
Set objRectangleA =

Printout of the Online Help
Automated Configuring

91

VBA in the Graphics Designer

11.05

Procedure
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A
" , " HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B
" , " HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Text = " SetPosition "
End With
'
'Directconnection is initiated by mouseclick:
Set objDConnection =
objButton.Events(1).Actions.AddAction(hmiActionCrea
tionTypeDirectConnection)
With objDConnection
'Sourceobject: Property " Top " of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Destinationobject: Property " Left " of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub
4

92

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.2.2

VBA in the Graphics Designer

How to Configure an Event-Oriented C Action with VBA

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

3

To configure a C action on an event with VBA, you can for example insert a
" CreateCActionToClickedEvent() " procedure in the document. In this
example a button and a circle are inserted into the active picture. In runtime
the radius of the circle is enlarged with every click of the button:
Sub CreateCActionToClickedEvent()
'VBA66
Dim objButton As HMIButton
Dim objCircle As HMICircle
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim strCode As String
strCode = " long lHeight; " & vbCrLf & " int check; " &
vbCrLf
strCode = strCode & " lHeight = GetHeight
( " " events.PDL " " , " " myCircle " " ); "
strCode = strCode & vbCrLf & " lHeight = lHeight+5; "
& vbCrLf & " check = "
strCode = strCode & " SetHeight( " " events.PDL " " ,
" " myCircle " " ,lHeight); "
strCode = strCode & vbCrLf & " //Return-Type: Void "
Set objCircle =

Printout of the Online Help
Automated Configuring

93

VBA in the Graphics Designer

11.05

Procedure
ActiveDocument.HMIObjects.AddHMIObject( " myCircle " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircle
.Top = 100
.Left = 100
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Text = " Increase Radius "
End With
'Configure directconnection:
Set objCScript =
objButton.Events(1).Actions.AddAction(hmiActionCrea
tionTypeCScript)
With objCScript
'
'Note: Replace " events.PDL " with your picturename
.SourceCode = strCode
End With
End Sub
4

94

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.2.3

VBA in the Graphics Designer

How to Configure an Event-Oriented VB action with VBA

Procedure
Procedure
1

Open the VBA editor in Graphics Designer ( & lt; ALT + F11 & gt; or " Tools " & gt;
" Macros " & gt; " Visual Basic Editor " )

2

In Project Explorer, open the document in which you want to write the VBA
code:

3

To configure an event-oriented VB action with VBA, you can for example
insert a " CreateVBActionToClickedEvent() " procedure in the document. In
this example a button and a circle are inserted into the active picture. In
runtime the radius of the circle is enlarged with every click of the button:
Sub CreateVBActionToClickedEvent()
'VBA67
Dim objButton As HMIButton
Dim objCircle As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Dim strCode As String
strCode = " Dim myCircle " & vbCrLf & " Set myCircle =
"
strCode = strCode &
" HMIRuntime.ActiveScreen.ScreenItems( " " Circle_VB " " )
"
strCode = strCode & vbCrLf & " myCircle.Radius =
myCircle.Radius + 5 "
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle VB " ,
" HMICircle " )
Set objButton =

Printout of the Online Help
Automated Configuring

95

VBA in the Graphics Designer

11.05

Procedure
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircle
.Top = 100
.Left = 100
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 120
.Text = " Increase Radius "
End With
'Define event and assign sourcecode:
Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCrea
tionTypeVBScript)
With objVBScript
.SourceCode = strCode
End With
End Sub
4

96

Start the procedure with & lt; F5 & gt; .

Printout of the Online Help
Automated Configuring

11.05

2.5.3

VBA in the Graphics Designer

Editing triggers

Introduction
You use triggers in connection with dynamics for graphics objects and for triggering
actions on object properties. Examples of triggers include:


Variables: when the value of a variable is changed or its limit is exceeded at
either extreme



Standard cycle: cyclic execution of the action. The length of the cycles is
selectable between 250 ms and 1 h. In addition, you can also use customized
cycles that you define yourself.



Picture cycle: a cyclic trigger is used as the trigger. This cycle applies the
option of centrally defining the cycles for all actions, tag connections and
dynamic dialog boxes configured in a picture.



Window cycle: a cyclic trigger is used as the trigger. This value applies to all
actions, tag connections and dynamic dialog boxes used in the picture window
which are configured with the trigger type " Window Cycle " .

When you configure an action that responds to an event on a graphics object, the
triggering event is the trigger.

Configuring triggers with VBA
Use the Trigger object to configure a trigger with VBA. If you intend to use a
variable as the trigger, use the VariableTrigger object:

You determine the type of trigger with the Type property. Use the VariableTriggers
property when you configure a variable as the trigger.

Printout of the Online Help
Automated Configuring

97

VBA in the Graphics Designer

2.5.4

11.05

Examples of editing triggers with VBA

Introduction
The four examples below illustrate how you can create the following triggers with
VBA:


Standard cycle



Variable



Picture cycle



Window cycle

In all of these examples a circle is inserted into the active picture, with the radius of
the circle being dynamized with a VB action.
The procedure for adding dynamics to a property with variable connection is
explained under " Adding dynamics to a property with a variable connection " in this
documentation.

Example 1: standard cycle
Sub DynamicWithStandardCycle()
'VBA68
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_Standard "
, " HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
.Trigger.Type = hmiTriggerTypeStandardCycle
' " CycleType " -specification is necessary:
.Trigger.CycleType = hmiCycleType_10s
.Trigger.Name = " VBA_StandardCycle "
.SourceCode = " "
End With
End Sub

98

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Example 2: variable
Sub DynamicWithVariableTriggerCycle()
'VBA69
Dim objVBScript As HMIScriptInfo
Dim objVarTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VariableT
rigger " , " HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
Set objVarTrigger =
.Trigger.VariableTriggers.Add( " VarTrigger " ,
hmiVariableCycleType_10s)
.SourceCode = " "
End With
End Sub

Example 3: picture cycle
Sub DynamicWithPictureCycle()
'VBA70
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_Picture " ,
" HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
.Trigger.Type = hmiTriggerTypePictureCycle
.Trigger.Name = " VBA_PictureCycle "
.SourceCode = " "
End With
End Sub

Printout of the Online Help
Automated Configuring

99

VBA in the Graphics Designer

11.05

Example 4: window cycle
Sub DynamicWithWindowCycle()
'VBA71
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_Window " ,
" HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
.Trigger.Type = hmiTriggerTypeWindowCycle
.Trigger.Name = " VBA_WindowCycle "
.SourceCode = " "
End With
End Sub

100

Printout of the Online Help
Automated Configuring

11.05

2.6

VBA in the Graphics Designer

Event handling

Introduction
In the Graphics Designer, events occur when certain actions are taken (for
example when a picture is opened). You can respond to an event with a predefined
VBA event handler in order to execute instructions.
The events occur only during configuring in the Graphics Designer and are not
available in runtime. These events must not be confused with the events (e.g.
mouse click, property change) occurring on graphic objects and pictures.
Attention
When the Graphics Designer is open, events are also triggered by other editors.
This applies, for example, to the modification of picture properties in
WinCCExplorer. Close the Graphics Designer when you are making changes to
pictures in other editors. This prevents events from being executed when you do
not want them to be.
Principle
In event handling there are events with and without forwarding. You can recognize
an event with forwarding by the presence of the " CancelForwarding " parameter. An
event without forwarding does not have this parameter. When an event occurs, it is
sent to the active picture and then forwarded to the " Global Template " .

An event with forwarding is therefore forwarded by default via the " Project
Template " document to the " Global Template " document.

Printout of the Online Help
Automated Configuring

101

VBA in the Graphics Designer

11.05

Preventing forwarding
You can prevent the forwarding of an event by setting the " CancelForwarding "
parameter to " True " in the VBA event handler:
Sub Document_HMIObjectPropertyChanged(ByVal Property As
IHMIProperty, CancelForwarding As Boolean)
'VBA72
CancelForwarding = True
MsgBox " Object's property has been changed! "
End Sub

Picture-specific and application-specific events
Quite apart from the information given above about events with and without
forwarding, the Graphics Designer differentiates between picture-specific and
application-specific events:
Picture-specific events
Picture-specific events always respond to actions that occur in the active picture in
the Graphics Designer. Such actions include, for example, the changing of object
properties or saving the active picture. You can obtain a list of available picturespecific events by choosing " Document " in the VBA editor:

Application-specific events
Application-specific events respond to actions that occur in the " Graphics
Designer " application. Such actions include, for example, starting the Graphics
Designer or creating an object in the component library.
To make the application-specific events available, write the following statement in
the VBA editor at the start of the document (preferably the " Project Template " or
" Global Template " ):
Dim WithEvents & lt; Name & gt; As grafexe.Application
The effect of this statement is that it will now also be possible to select the
application-specific events from the list in the Graphics Designer:

102

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Example 1: occurrence of an event with forwarding
The following illustration shows the sequence from the occurrence of an event with
forwarding:

Note:
There are events which are both picture-specific and application-specific (for
example BeforeDocumentSave). When such an event occurs, the program checks
whether the corresponding application-specific event handler has been defined.
The sequence shown above does not begin until after that.
Example 2: occurrence of an event without forwarding
The following illustration shows the sequence from the occurrence of an event
without forwarding:

Disabling event handling
You can disable event handling by setting the " DisableVBAEvents " property for the
Application object to " True " .

Printout of the Online Help
Automated Configuring

103

VBA in the Graphics Designer

2.7

11.05

Access to external applications with VBA

Introduction
You can use VBA to access programs which support VBA, for example products in
the Microsoft Office family. This enables you, for example, to read out values from
an MS Excel worksheet and then assign these to object properties.

Registering an external application
You have to integrate an external application in the VBA editor in order to make its
object library available. To do this, select the " References " option in the " Tools "
menu in the VBA editor. In the " References " dialog you can then select the
required object library:

Note:
You must attach the external application to all projects which you want to be able
to access the external application; do this in the VBA editor Project Explorer.

104

Printout of the Online Help
Automated Configuring

11.05

2.7.1

VBA in the Graphics Designer

Example: access to MS Excel with VBA

Introduction
The following three examples illustrate how to access MS Excel. For these
examples to work, the MS Excel object library must be integrated via a reference.

Example 1
In this example the default object list of the Graphics Designer is exported in an
Excel worksheet. The object properties are taken into account, as is the question of
whether dynamics can be used with these properties. The VBA data type is also
displayed.
Sub ExportDefObjListToXLS()
'VBA73
Dim objGDApplication As grafexe.Application
Dim objHMIObject As grafexe.HMIObject
Dim objProperty As grafexe.HMIProperty
Dim objXLS As Excel.Application
Dim objWSheet As Excel.Worksheet
Dim objWBook As Excel.Workbook
Dim rngSelection As Excel.Range
Dim lRow As Long
Dim lRowGroupStart As Long
'define local errorhandler
On Local Error GoTo LocErrTrap
'Set references to the applications Excel and
GraphicsDesigner
Set objGDApplication = Application
Set objXLS = New Excel.Application
'Create workbook
Set objWBook = objXLS.Workbooks.Add()
objWBook.SaveAs objGDApplication.ApplicationDataPath &
" DefaultObjekte.xls "
'Adds new worksheet to the new workbook
Set objWSheet = objWBook.Worksheets.Add
objWSheet.Name = " DefaultObjekte "
lRow = 1

Printout of the Online Help
Automated Configuring

105

VBA in the Graphics Designer

11.05

'Every object of the DefaultHMIObjects-collection will
be written
'to the worksheet with their objectproperties.
'For better overview the objects will be grouped.
For Each objHMIObject In
objGDApplication.DefaultHMIObjects
DoEvents
objWSheet.Cells(lRow, 1).value =
objHMIObject.ObjectName
objWSheet.Cells(lRow, 2).value = objHMIObject.Type
lRow = lRow + 1
lRowGroupStart = lRow
For Each objProperty In objHMIObject.Properties
'Write displayed name and automationname of property
'into the worksheet
objWSheet.Cells(lRow, 2).value = objProperty.DisplayName
objWSheet.Cells(lRow, 3).value = objProperty.Name
'Write the value of property, datatype and if their
dynamicable
'into the worksheet
If Not IsEmpty(objProperty.value) Then _
objWSheet.Cells(lRow, 4).value = objProperty.value
objWSheet.Cells(lRow, 5).value = objProperty.IsDynamicable
objWSheet.Cells(lRow, 6).value = TypeName(objProperty.value)
objWSheet.Cells(lRow, 7).value = VarType(objProperty.value)
lRow = lRow + 1
Next objProperty
'Select and groups the range of object-properties
in the worksheet
Set rngSelection =
objWSheet.Range(objWSheet.Rows(lRowGroupStart), _
objWSheet.Rows(lRow - 1))
rngSelection.Select
rngSelection.Group
Set rngSelection = Nothing
'Insert empty row
lRow = lRow + 1
Next objHMIObject
objWSheet.Columns.AutoFit
Set objWSheet = Nothing
objWBook.Save

106

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

objWBook.Close
Set objWBook = Nothing
objXLS.Quit
Set objXLS = Nothing
Set objGDApplication = Nothing
Exit Sub
LocErrTrap:
MsgBox Err.Description, , Err.Source
Resume Next
End Sub

Example 2
In this example all objects of the active picture are exported to an Excel worksheet.
The properties taken into account are Position X, Position Y, Width, Height and
Layer:
Sub ExportObjectListToXLS()
'VBA74
Dim objGDApplicationApplication As grafexe.Application
Dim objDoc As grafexe.Document
Dim objHMIObject As grafexe.HMIObject
Dim objProperty As grafexe.HMIProperty
Dim objXLS As Excel.Application
Dim objWSheet As Excel.Worksheet
Dim objWBook As Excel.Workbook
Dim lRow As Long
'Define local errorhandler
On Local Error GoTo LocErrTrap
'Set references on the applications Excel and
GraphicsDesigner
Set objGDApplication = Application
Set objDoc = objGDApplication.ActiveDocument
Set objXLS = New Excel.Application
'Create workbook
Set objWBook = objXLS.Workbooks.Add()
objWBook.SaveAs objGDApplication.ApplicationDataPath &
" Export.xls "
'Create worksheet in the new workbook and write headline

Printout of the Online Help
Automated Configuring

107

VBA in the Graphics Designer

11.05

'The name of the worksheet is equivalent to the
documents name
Set objWSheet = objWBook.Worksheets.Add
objWSheet.Name = objDoc.Name
objWSheet.Cells(1, 1) = " Objektname "
objWSheet.Cells(1, 2) = " Objekttyp "
objWSheet.Cells(1, 3) = " ProgID "
objWSheet.Cells(1, 4) = " Position X "
objWSheet.Cells(1, 5) = " Position Y "
objWSheet.Cells(1, 6) = " Breite "
objWSheet.Cells(1, 7) = " Höhe "
objWSheet.Cells(1, 8) = " Ebene "
lRow = 3
'Every objects will be written with their
objectproperties width,
'height, pos x, pos y and layer to Excel. If the object
is an
'ActiveX-Control the ProgID will be also exported.
For Each objHMIObject In objDoc.HMIObjects
DoEvents
objWSheet.Cells(lRow, 1).value =
objHMIObject.ObjectName
objWSheet.Cells(lRow, 2).value = objHMIObject.Type
If UCase(objHMIObject.Type) = " HMIACTIVEXCONTROL "
Then
objWSheet.Cells(lRow, 3).value = objHMIObject.ProgID
End If
objWSheet.Cells(lRow, 4).value = objHMIObject.Left
objWSheet.Cells(lRow, 5).value = objHMIObject.Top
objWSheet.Cells(lRow, 6).value = objHMIObject.Width
objWSheet.Cells(lRow, 7).value =
objHMIObject.Height
objWSheet.Cells(lRow, 8).value = objHMIObject.Layer
lRow = lRow + 1
Next objHMIObject
objWSheet.Columns.AutoFit
Set objWSheet = Nothing
objWBook.Save
objWBook.Close
Set objWBook = Nothing
objXLS.Quit

108

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

Set objXLS = Nothing
Set objDoc = Nothing
Set objGDApplication = Nothing
Exit Sub
LocErrTrap:
MsgBox Err.Description, , Err.Source
Resume Next
End Sub
Example 3
In this example objects are imported from the Excel worksheet created in example
2. The properties taken into account are Position X, Position Y, Width, Height and
Layer:
Sub ImportObjectListFromXLS()
'VBA75
Dim objGDApplication As grafexe.Application
Dim objDoc As grafexe.Document
Dim objHMIObject As grafexe.HMIObject
Dim objXLS As Excel.Application
Dim objWSheet As Excel.Worksheet
Dim objWBook As Excel.Workbook
Dim lRow As Long
Dim strWorkbookName As String
Dim strWorksheetName As String
Dim strSheets As String
'define local errorhandler
On Local Error GoTo LocErrTrap
'Set references on the applications Excel and
GraphicsDesigner
Set objGDApplication = Application
Set objDoc = objGDApplication.ActiveDocument
Set objXLS = New Excel.Application
'Open workbook. The workbook have to be in datapath of
GraphicsDesigner
strWorkbookName = InputBox( " Name of workbook: " , " Import
of objects " )
Set objWBook =
objXLS.Workbooks.Open(objGDApplication.ApplicationDataPa
th & strWorkbookName)
If objWBook Is Nothing Then
MsgBox " Open workbook fails! " & vbCrLf & " This function
is cancled! " , vbCritical, " Import od objects "
Set objDoc = Nothing

Printout of the Online Help
Automated Configuring

109

VBA in the Graphics Designer

11.05

Set objGDApplication = Nothing
Set objXLS = Nothing
Exit Sub
End If
'Read out the names of all worksheets contained in the
workbook
For Each objWSheet In objWBook.Sheets
strSheets = strSheets & objWSheet.Name & vbCrLf
Next objWSheet
strWorksheetName = InputBox( " Name of table to import: " &
vbCrLf & strSheets, " Import of objects " )
Set objWSheet = objWBook.Sheets(strWorksheetName)
lRow = 3
'Import the worksheet as long as in actual row the first
column is empty.
'Add with the outreaded data new objects to the active
document and
'assign the values to the objectproperties
With objWSheet
While (.Cells(lRow, 1).value & lt; & gt; vbNullString) And (Not
IsEmpty(.Cells(lRow, 1).value))
'Add the objects to the document as its objecttype,
'do nothing by groups, their have to create before.
If (UCase(.Cells(lRow, 2).value) = " HMIGROUP " ) Then
Else
If (UCase(.Cells(lRow, 2).value) = " HMIACTIVEXCONTROL " )
Then
Set objHMIObject =
objDoc.HMIObjects.AddActiveXControl(.Cells(lRow,
1).value, .Cells(lRow, 3).value)
Else
Set objHMIObject =
objDoc.HMIObjects.AddHMIObject(.Cells(lRow, 1).value,
.Cells(lRow, 2).value)
End If
objHMIObject.Left = .Cells(lRow, 4).value
objHMIObject.Top = .Cells(lRow, 5).value
objHMIObject.Width = .Cells(lRow, 6).value
objHMIObject.Height = .Cells(lRow, 7).value
objHMIObject.Layer = .Cells(lRow, 8).value
End If
Set objHMIObject = Nothing
lRow = lRow + 1
Wend

110

Printout of the Online Help
Automated Configuring

11.05

VBA in the Graphics Designer

End With
objWBook.Close
Set objWBook = Nothing
objXLS.Quit
Set objXLS = Nothing
Set objDoc = Nothing
Set objGDApplication = Nothing
Exit Sub
LocErrTrap:
MsgBox Err.Description, , Err.Source
Resume Next
End Sub

Printout of the Online Help
Automated Configuring

111

VBA in the Graphics Designer

112

11.05

Printout of the Online Help
Automated Configuring

11.05

3

Addins

Addins

Introduction
An addin is a code which cannot be viewed and is stored as a DLL. Addins can
make new functions available by registering the DLL concerned in the operating
system and loading it in the Graphics Designer.
To you as a user, the advantage of addins is that they provide functions which are
tailor made for the associated application. For example, if you are working on
different computers during configuration and frequently use VBA macros, you can
combine these VBA macros in one or more addins. When you change to a different
computer you need only copy the addin and you can then access the customary
functions on the new workstation.
As a developer, you can use the Graphics Designer program library in a
development environment to create MS Visual Studio 6.0 addins, for example, and
protect your code from intrusion.

Addins in the Graphics Designer
In the Graphics Designer you can use all the addins that have been developed for
the Graphics Designer and registered in the operating system of the computer you
are using for configuration.
You can automatically load an addin when you start the Graphics Designer if you
frequently need the functions the addins contain.
When you no longer need the functions of an addin, you can unload it again at any
time.

Printout of the Online Help
Automated Configuring

113

Addins

3.1

11.05

Linking Addins

Prerequisite
An addin must be registered in the operating system. To register a new addin,
double click on the appropriate DLL file.
Note:
For registration by double clicking to work, the DLL files must be linked to the
application RegSvr32.exe.
Introduction
In the Graphics Designer use the Addin Manager to define the way addins can be
used.
To start the Addin Manager, go to the Graphics Designer and select the command
" Macros " & gt; " AddIn Manager " :

114

Printout of the Online Help
Automated Configuring

11.05

Addins

Automatically Loading an Addin
If the addin contains new functions that you always need in the Graphics Designer,
you can load the addin automatically when you open the Graphics Designer.
To do this go to the Addin Manager, select the addin and enable the " Load on
Startup " checkbox.
Note:
Depending how the addin is programmed, the function contained in the addin can
also be entered in the menu " Tools " & gt; " Macros " & gt; " AddIns " . You can then start the
function just by clicking on it.

Manually Loading or Unloading an Addin
You can also load an addin manually if you need its functions for particular
purposes only (such as test routines).
To load or unload an addin manually, go to the Addin Manager, select the addin
and enable the " Loaded/Unloaded " checkbox.

3.1.1

Loading an Addin in the Graphics Designer

Prerequisite
An addin must be registered in the operating system. To register a new addin,
double click on the appropriate DLL file.
Note:
For registration by double clicking to work, the DLL files must be linked to the
application RegSvr32.exe.

Printout of the Online Help
Automated Configuring

115

Addins

11.05

Procedure
Procedure
1

Start the Graphics Designer and open the project to which you want to link
the addin.

2

To call the Addin Manager, select the menu command " Tools " & gt; " AddIn
Manager " .
The Addin Manager opens. The " Available Add-Ins " list shows all the
addins that are available, together with their current load status:

3

For each addin, define whether it is to be loaded and if so when. To do this
select the addin concerned and enable the appropriate checkbox under
" Load Behavior " .

4

To unload an addin, select the addin concerned and disable the
" Load/Unload " checkbox under " Load Behavior " .

5

Click OK.

Results
Depending how the addin is programmed, the function contained in the addin is
either listed in the " Tools " & gt; " AddIns " menu or reacts to an event handler in the
Graphics Designer.
If the addin is started by means of an event handler (e.g. Started Event), the " On
Startup " checkbox should be enabled for the addin.

116

Printout of the Online Help
Automated Configuring

11.05

3.2

Addins

Example: Creating Addins

Introduction
This documentation contains an example of creating addins in Visual Basic 6.0,
showing how to create an executable addin for use in the Graphics Designer.

Requirements
MS Visual Studio 6.0 must be installed on the computer being used for
configuration.
You should have programming experience if you wish to use the sample code as a
basis for developing addins of your own.

Example: Program Template for Visual Basic 6.0
Use the event handler " AddInInstance_OnConnection " to generate an instance of
the Graphics Designer. In order for the addin to be able to access the Graphics
Designer, it is mandatory to declare the application.

Printout of the Online Help
Automated Configuring

117

Addins

3.2.1

11.05

Example: Creating an Add In with Visual Basic 6.0

Introduction
The program code in this example produces a file called " MyAddIn.DLL " . So that
the addin will work in Graphics Designer, you must enable the " Load on Startup "
checkbox for this addin in the Addin Manager of Graphics Designer. For this
purpose you can also use the " LoadOnStartup " function in the addin.
When you open Graphics Designer the addin generates a user-defined menu. You
can also use the " Tools " & gt; " AddIns " menu to call the function contained in the
addin.

Prerequisite
So that you can create an executable addin from the sample code, " MS Visual
Studio 6.0 " must be installed on your computer. You must also have referenced
" WinCC Graphics Designer 1.0 Type Library " in " MS Visual Studio 6.0 " :

118

Printout of the Online Help
Automated Configuring

11.05

Addins

Procedure
Procedure
1

Open " MS Visual Studio 6.0 " and create a new project. To create a project,
go to the " New Project " dialog, select the " AddIn " entry and click on OK.

2

In Project Explorer, open the " Designer " folder and double click the entry
called " Connect " . The " Connect (AddIn Designer) " dialog opens.

3

Under " Application " , select the entry for " Graphics Designer " and select the
" Initial Behavior on Loading " for the addin. Close the " Connect (AddIn
Designer) " dialog.

3

In Project Explorer, open the " Designer " folder and use the pop-up menu to
select the command " Display Code " for the " Connect " entry.

4

Replace the entire program code with the following program code:
Option Explicit
'----------------------------------------------------'Member Variables
'----------------------------------------------------'Reference to the AddIn Connection
Dim WithEvents ThisAddIn As grafexe.AddinHook
'Reference to the Grafics Designer Application
Dim WithEvents GrafApp As grafexe.Application
'----------------------------------------------------'WithEvents AddInInstance IDTExtensibility2 (automatic)
'----------------------------------------------------'----------------------------------------------------------------'This method connects the AddIn To the Graphic Designer
Application
'----------------------------------------------------------------Private Sub AddinInstance_OnConnection(ByVal Application
As Object, _
ByVal ConnectMode
As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst
As Object, custom() As Variant)
On Error GoTo AddinInstance_OnConnection_Error
'-----------------------------------------------------------------------' Hook up to the Graphics Designer
application.IAddInHookEvents interface.
' It is necessary referencing the application this
AddIn hooks up to

Printout of the Online Help
Automated Configuring

119

Addins

11.05

Procedure
'-----------------------------------------------------------------------Dim GDApplication As grafexe.Application
Set GDApplication = Application
If (Not GDApplication Is Nothing) Then
'-----------------------------------------------------------------------' Explanation on filters ( first parameter to
AddIns.Attach() )
'
' sbAddInFilterExecute : AddIn is not shown in
the AddIn-Menu
'
NOT called)
' sbAddInFilterNone
AddIn-Menu and by

(ThisAddIn Execute() is
: AddIn is shown in the

'
menu entry ThisAddIn_Execute()

clicking on the AddIn's

'
figure below)

is called (see the

'-----------------------------------------------------------------------Set ThisAddIn =
GDApplication.Addins.Attach(sbAddinFilterNone, " Create
Rectangle " )
Set GrafApp = GDApplication
RegisterApplicationMenus
End If
Exit Sub
AddinInstance_OnConnection_Error:
MsgBox Err.Description
End Sub
'----------------------------------------------------------'This method removes the Add-In from VB by event
disconnect
'----------------------------------------------------------Private Sub AddinInstance_OnDisconnection(ByVal
RemoveMode As AddInDesignerObjects.ext_DisconnectMode, _
custom() As

120

Printout of the Online Help
Automated Configuring

11.05

Addins

Procedure
Variant)
On Error GoTo AddinInstance_OnDisconnection_Error
If (RemoveMode = ext_dm_UserClosed) Then
RemoveApplicationMenus
End If
' ---------------------------------------------------------' Release reference to IAddInHookEvents interface Important
' ---------------------------------------------------------Set ThisAddIn = Nothing
Set GrafApp = Nothing
Exit Sub
AddinInstance_OnDisconnection_Error:
MsgBox Err.Description
End Sub
'----------------------------------------------------------------------------------------'This method describes the 2nd way to make AddIn
functions available in Graphics Designer
'
'By adding an application menu in Graphics Designer the
menu click events can be catched by
'the MenuItemClicked event from the application object
'----------------------------------------------------------------------------------------Private Sub RegisterApplicationMenus()
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Set objDocMenu = GrafApp.CustomMenus.InsertMenu(1,
" DocMenu1 " , " Doc_Menu_1 " )
Set objMenuItem =
objDocMenu.MenuItems.InsertMenuItem(1, " dmItem1_1 " , " My
first menu entry " )
Set objMenuItem =
objDocMenu.MenuItems.InsertMenuItem(2, " dmItem1_2 " , " My
second menu entry " )
Set objMenuItem = Nothing

Printout of the Online Help
Automated Configuring

121

Addins

11.05

Procedure
Set objDocMenu = Nothing
End Sub
'----------------------------------------------------------------------------------------'This method removes the AddIn menus available in
Graphics Designer
'----------------------------------------------------------------------------------------Private Sub RemoveApplicationMenus()
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
For Each objMenuItem In
GrafApp.CustomMenus( " DocMenu1 " ).MenuItems
Set objMenuItem = Nothing
Next objMenuItem
GrafApp.CustomMenus( " DocMenu1 " ).Delete
Set objMenuItem = Nothing
Set objDocMenu = Nothing
End Sub
Private Sub AddinInstance_Terminate()
' ---------------------------------------------------------' Release reference to IAddInHookEvents interface Important
' ---------------------------------------------------------Set ThisAddIn = Nothing
Set GrafApp = Nothing
End Sub
Private Sub GrafApp_MenuItemClicked(ByVal MenuItem As
grafexe.IHMIMenuItem)
Select Case MenuItem.Key
Case " dmItem1_1 "
TestCall1
Case " dmItem1_2 "
TestCall2
Case Else

122

Printout of the Online Help
Automated Configuring

11.05

Addins

Procedure
Debug.Assert False
End Select
End Sub
'----------------------------------------------------------------------------------------'You can call both of the following procedures by
clicking the menu item in the " DocMenu1 "
'----------------------------------------------------------------------------------------Sub TestCall1()
Call MsgBox( " AddIn Menu: dmItem1_1 Clicked " ,
vbInformation, " GrafApp_MenuItemClicked " )
End Sub
Sub TestCall2()
Call MsgBox( " AddIn Menu: dmItem1_2 Clicked " ,
vbInformation, " GrafApp_MenuItemClicked " )
End Sub
'--------------------------------------------------------------------'Registering an AddInHook creates an object which event
'can be executed by clicking
" Extras\Macros\AddIns\ & lt; Registered Name & gt; "
'--------------------------------------------------------------------Private Sub ThisAddIn_Execute()
MsgBox ( " AddIn : Execute! Will create a new
Rectangle now " )
Dim NewShape As HMIObject
Set NewShape =
GrafApp.ActiveDocument.HMIObjects.AddHMIObject( " Rectangl
e1 " , " HMIRectangle " )
With NewShape
.Top = 40
.Left = 40
.BackColor = 255
End With
MsgBox (NewShape.ObjectName)
End Sub

5

Create the addin, and load it in the Graphics Designer.

Printout of the Online Help
Automated Configuring

123

Addins

11.05

Results
The next time you open it, Graphics Designer will contain a user-defined menu
called " DocMenu1 " . The menu " Tools " & gt; " AddIns " contains an entry called " Create
Rectangle " , which pastes a rectangle into the active picture:

124

Printout of the Online Help
Automated Configuring

11.05

4

VBA in Other WinCC Editors

VBA in Other WinCC Editors

Introduction
VBA allows you to access other WinCC editors such as Tag Logging. The following
editors can be automated with VBA in addition to Graphics Designer:


Tag Management



Tag Logging



Text Library



Alarm Logging

The functions for accessing the editors are contained in the HMIGO class.

Requirement
The " HMIGenObjects.dll " file is referenced. This happens automatically during
WinCC installation.

Principle
To enable you to have access to the HMIGO class with VBA, you must reference
the " HMI GeneralObjects 1.0 Type Library " in the VBA editor ( " Project " & gt;
" References " ). You must create a new instance of this class in the program code,
e.g.:
Dim HMIGOObject As New HMIGO
Create several different objects of this class if access several objects at the same
time. Two instances of the HMIGO class are required, for example, in Tag Logging:
The first instance is required for access to the archive tags, the second instance for
access to the process value archive.

Usage
The functions provided by the HMIGO class provided you with access to Tag
Management, Tag Logging, the Text Library, and Alarm Logging. To enable you to
use the functions in VBA, you must have opened a project in WinCC. In addition,
you can also access the properties of the class directly.
In this way, directly from the program code you can, for example, created several
tags and change their values, edit text entries in the Text Library, or customize
messages.

Printout of the Online Help
Automated Configuring

125

VBA in Other WinCC Editors

11.05

Querying Object State
The HMIGO class has the enumeration HMIGO_OBJECT_STATE which returns
the state of the specified object. The enumeration can return the following values:


OBJECT_EMPTY (2): Connection to the object is not available.



OBJECT_OPENED (3): Connection to objects exists. You can change and
read its parameters.



OBJECT_MODIFIED (4): An object's parameters have been changed. If the
corresponding Commit function is not called, the changes are not saved.



WINCC_CONNECTED (1): The object is connected to the WinCC project. By
default this connection is established when a function is called the first time. To
release the connection, use e.g. the instruction HMIGO = nothing.

Error Handling
Errors can occur when you use the HMIGO class. Use the OnError statement to
respond to these error messages. The OnError statement must come before the
call of a function from the HMIGeneralObjects class:
Sub CreateTag()
'HMIGO_000
Dim hmiGOTag as New HMIGO
On Error GoTo ErrorHandlerHMIGO
hmiGOTag.CreateTag " NewTag " , TAG_BINARY_TAG,
" ExistingConnection " , " NewOrExistingGroupName "
...
Exit Sub
ErrorHandlerHMIGO:
MsgBox ( " Error: " & Err.Number _ & " " & Err.Description _
" " & Err.Source)

&

Resume Next
End Sub
As a result, an error text returned by the interface is output.

126

Printout of the Online Help
Automated Configuring

11.05

4.1

VBA in Other WinCC Editors

VBA in Tag Management

Introduction
VBA allows you to create tags directly from the program code, modify and delete
them, and read out and change their properties, types, and values.

Principle
When you have created the instance of the HMIGO class, the following functions
are available to you to access the tag management facility:


CloseTag



CommitTag



CreateTag



DeleteTag



GetTag



ListTag

The enumerations " HMIGO_TAG_TYPE " and " HMIGO_TAG_LIST_TYPE " are
available for the parameter assignment of these functions.
Note:
When editing with VBA the tag must not be open or opened in Tag Management.
To change the data type of a tag you must first delete the tag and then recreate it.
The parameters have to be saved beforehand so that you can transfer them after
creating the tag.

Printout of the Online Help
Automated Configuring

127

VBA in Other WinCC Editors

11.05

Access to the Object Properties
You can also access the parameters of the above-mentioned functions directly in
VBA by means of the following object properties:
Object Property

Description

Read/Write

ObjectStateTag

Returns the object state via the enumeration
HMIGO_OBJECT_STATE. Further
information on this enumeration can be
found in this documentation under " VBA in
other WinCC Editors " .

Yes/no

TagName

Name of the tag

Yes/no

TagGroupName

Name of a group in which the tag is inserted. Yes/no
If the group does not yet exist, it is created. If
no group name is specified, the tag is
created outside all groups.

TagConnection

Name of a connection in which the tag
and/or group is to be created. The
connection must already be in existence,
otherwise a tag cannot be created. If the
name is omitted, an internal tag is created.

Yes/no

TagMaximum

Sets the new value of the upper limit

Yes/yes

TagMinimum

Sets the new value of the lower limit

Yes/yes

TagStart

Sets the new start value

Yes/yes

TagS5S7Address

Address of the S7 or S5 PLC to which the
tag is connected. If no address is specified,
a blank entry is passed.

Yes/yes

TagType
(Enum)

Data type of the tag. The possible types are: Yes/yes
TAG_BINARY_TAG (1)
TAG_SIGNED_8BIT_VALUE (2)
TAG_UNSIGNED_8BIT_VALUE (3)
TAG_SIGNED_16BIT_VALUE (4)
TAG_UNSIGNED_16BIT_VALUE (5)
TAG_SIGNED_32BIT_VALUE (6)
TAG_UNSIGNED_32BIT_VALUE (7)
TAG_FLOATINGPOINT_NUMBER_32BIT_I
EEE_754 (8)
TAG_FLOATINGPOINT_NUMBER_64BIT_I
EEE_754 (9)
TAG_TEXT_TAG_8BIT_CHARACTER_SET
(10)
TAG_TEXT_TAG_16BIT_CHARACTER_SE
T (11)
TAG_RAW_DATA_TYPE (12)
TAG_STRUCT (14)
TAG_TEXT_REFERENCE (18)

128

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Object Property

Description

Read/Write

TagUpdate
(Enum)

Defines whether the tag is updated on the
local computer or for the entire project. (For
internal tag only.)

Yes/yes

TAG_COMPUTER_LOCAL (1)
TAG_PROJECT_WIDE (2)
LengthText

Length of a text tag (0...255)

Yes/yes
(Only for
external text
type tags.)

You will find a description of the properties under the parameter descriptions of the
corresponding functions.

Printout of the Online Help
Automated Configuring

129

VBA in Other WinCC Editors

4.1.1

11.05

CloseTag Function

Description
Closes the tag which is open.
Note:
Modified parameters are not saved.
Syntax
Expression.CloseTag()
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CloseTag()
' HMIGO_001
' procedure to close a variable
' tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strVariableName As String
Set objHMIGO = New HMIGO
strVariableName = " NewVariable "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'open a tag
objHMIGO.GetTag strVariableName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'close a tag
objHMIGO.CloseTag
'current status is " EMPTY "

130

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

131

VBA in Other WinCC Editors

4.1.2

11.05

CommitTag Function

Description
Writes the changed parameters of the open tag to WinCC.
Note:
If further parameters are changed after a CommitTag call, write the changes to
WinCC by calling this function again.
Syntax
Expression.CommitTag()
Expression
Required. An expression that returns an object of the type " HMIGO " .

Parameter
--

Example
Sub CommitTag()
' HMIGO_002
' procedure to change a property of a variable
' tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strVariableName As String
Set objHMIGO = New HMIGO
strVariableName = " NewVariable "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'open a tag
objHMIGO.GetTag strVariableName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'change a property
objHMIGO.tagtype = TAG_SIGNED_16BIT_VALUE
'current status is " MODIFIED "

132

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'commit a tag
objHMIGO.CommitTag
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

133

VBA in Other WinCC Editors

4.1.3

11.05

CreateTag Function

Description
Creates a new tag.

Syntax
Expression.CreateTag(TagName,TagType,[Connection],[S7S5Addres
s],[GroupName])
Expression
Necessary. An expression which returns a " HMIGO " type object.
Parameter
Parameter (Data Type)

Description

TagName (string)

Name of the tag to be created.

TagType (HMIGO_TAG_TYPE)

Data type of the tag. The possible types are:
TAG_BINARY_TAG
TAG_SIGNED_8BIT_VALUE
TAG_UNSIGNED_8BIT_VALUE
TAG_SIGNED_16BIT_VALUE
TAG_UNSIGNED_16BIT_VALUE
TAG_SIGNED_32BIT_VALUE
TAG_UNSIGNED_32BIT_VALUE
TAG_FLOATINGPOINT_NUMBER_32BIT_IEE
E_754
TAG_FLOATINGPOINT_NUMBER_64BIT_IEE
E_754
TAG_TEXT_TAG_8BIT_CHARACTER_SET
TAG_TEXT_TAG_16BIT_CHARACTER_SET
TAG_RAW_DATA_TYPE
TAG_TEXT_REFERENCE

Connection (string, optional)

S7S5Address (string, optional)

134

Name of a connection in which the tag and/or
group is to be created. The connection must
already be in existence, otherwise a tag cannot
be created.
If the name is omitted, an internal tag and/or
group is/are created.
Address of the S7 or S5 PLC to which the tag is
connected. If no address is specified, a blank
entry is passed.
For configuration of quality codes, the
" S7S5Address " parameter must be expanded
by the string " ,QC " , e.g.: " DB1,DD0,QC " .
If the quality code of the tag is no longer to be
monitored, the string " ,QC " must be deleted.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Parameter (Data Type)

Description

GroupName (string, optional)

Name of a group in which the tag is inserted. If
the group does not yet exist, it is created.
If no group name is specified, the tag is
created outside all groups.

Example
Sub CreateTag()
' HMIGO_003
' procedure to create a variable
' tag must not be created before
' declarations
Dim objHMIGO As HMIGO
Dim strVariableName As String
Set objHMIGO = New HMIGO
strVariableName = " NewVariable "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'create a tag
objHMIGO.CreateTag strVariableName,
TAG_SIGNED_32BIT_VALUE
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

135

VBA in Other WinCC Editors

4.1.4

11.05

DeleteTag Function

Description
Deletes the specified tag.

Syntax
Expression.DeleteTag(TagName)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

TagName (string)

Name of the tag to be deleted.

Example
Sub DeleteTag()
' HMIGO_004
' procedure to delete a variable
' tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strVariableName As String
Set objHMIGO = New HMIGO
strVariableName = " NewVariable "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'delete a tag
objHMIGO.DeleteTag strVariableName
Set objHMIGO = Nothing
End Sub

136

Printout of the Online Help
Automated Configuring

11.05

4.1.5

VBA in Other WinCC Editors

GetTag Function

Description
Reads in the parameters of the specified tag.
You can change or read the parameters by means of the object properties. You will
find a list of the available object properties in this documentation under " VBA in
Tag Management " .
Syntax
Expression.GetTag(TagName)
Expression
Required. An expression that returns an object of the type " HMIGO " .
Parameter
Parameter (data type)

Description

TagName (string)

Name of the tag whose values
are to be read in.

Example
Sub GetTag()
' HMIGO_005
' procedure to open a variable
' tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strVariableName As String
Set objHMIGO = New HMIGO
strVariableName = " NewVariable "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
'open/ get a tag
objHMIGO.GetTag strVariableName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTag, vbOKOnly, " Status
Variable "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

137

VBA in Other WinCC Editors

4.1.6

11.05

ListTag function

Description
Alternatively, the ListTag function returns the following contents of the Tag
Management as a list:


All the channel units created



All the channels created



All the connections created



All the tag groups created



All the tags created

Syntax
Expression.ListTag(ListType,pListArray,[Filter])
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

ListType (HMIGO_TAG_LIST_TYPE)

Defines which content should be returned
as a list. Possibilities are:
TAG_CHANNEL_UNITS (0) all channel
units created
TAG_CHANNELS (2) all channels created
TAG_CONNECTIONS (3) all connections
created
TAG_GROUPS (4) all tag groups created
TAG_NAMES (5) all tags created

pListArray (Variant)
Filter (String)

138

List with the requested content.
Filters can be set optionally. Wildcards " * "
and " ? " are also possible.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Example
In the following example, a check is made whether the list with the connections
created is empty because no connections have been set up:
Sub ReadTagByConnection()
'HMIGO_027
'read content in data manager by connections
no conections are implemented
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
'read all connections
objHMIGO.ListTag TAG_CONNECTIONS, arrContent
'check result
If (UBound(arrContent) - LBound(arrContent) + 1) & lt; = 0 Then
MsgBox " no entries because no connections are
implemented "
End If
End Sub

Printout of the Online Help
Automated Configuring

139

VBA in Other WinCC Editors

4.2

11.05

VBA in Tag Logging

Introduction
VBA allows you to create process value archives and archive tags directly from the
program code, modify them, and delete them.

Principle
When you have created the instance of the HMIGO class, the following functions
are available to you to access Tag Logging:


CloseTlgArchive



CloseTlgTag



CommitTlgArchive



CommitTlgTag



CreateTlgArchive



CreateTlgTag



DeleteTlgArchive



DeleteTlgTag



GetTlgArchive



GetTlgTag



ListTlgArchive



ListTlgTag

Note:
When editing with VBA the Tag Logging must not be open or opened.
Bevor using the Tag Logging triggers in VBA for a newly created WinCC project,
you must first start the " Tag Logging " editor, create an archive and then close the
editor again.The triggers are created by the editor.

140

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Direct Access to the Object Properties
You can also access the parameters of the above-mentioned functions directly in
VBA by means of the following object properties:
Object Property

Description

Read/Write

ObjectStateTlgArchive

Returns the object state via the
Yes/no
enumeration
HMIGO_OBJECT_STATE. Further
information on this enumeration
can be found in this documentation
under " VBA in other WinCC
Editors " .

TlgArchiveName

Name of the process value archive Yes/no
or compressed archive.

TlgArchiveType

Specifies whether the archive is a
process value archive or a
compressed archive.

Yes/no

TlgArchiveAccessLevelRead

The authorization level for reading

Yes/no

TlgArchiveAccessLevelWrite

The authorization level for writing

Yes/no

TlgArchiveArchiveState

Specifies whether archiving is
disabled or enabled at system
startup. Possible values of Enum
HMIGO_TLG_ARCHIVE_STATE:

Yes/yes

TLG_ARCHIVE_STATE_LOCKED
(1)
TLG_ARCHIVE_STATE_ACTIVAT
ED (0)
TlgArchiveBufferSize

Specifies the number of records for Yes/yes
a short-term archive.

TlgArchiveBufferType

Specifies the tag storage location. Yes/yes
The possible types of Enum
HMIGO_TLG_ARCHIVE_BUFFER
_TYPE:
TLG_ARCHIVE_BUFFER_TYPE_
DISK (2)
TLG_ARCHIVE_BUFFER_TYPE_
RAM (1)

TlgArchiveCompressRange

Printout of the Online Help
Automated Configuring

Specifies the compression time
Yes/yes
period. Name of the timer, greater
than or equal to 1, defined under
" Times " in the Tag Logging editor.
Since the format is a string, it is
language dependent. Can also be
determined using the function
ListTlgArchive(TLG_ARCHIVE_TR
IGGER_NAMES, arrTrigger)

141

VBA in Other WinCC Editors

11.05

Object Property

Description

Read/Write

TlgArchiveCompressType

Specifies the algorithm for
compressing the values. The
possible types of Enum
HMIGO_TLG_ARCHIVE_COMPR
ESS_TYPE:

Yes/yes

TLG_COMPRESS_TYPE_CALC
(1)
TLG_COMPRESS_TYPE_CALC_
COPY (2)
TLG_COMPRESS_TYPE_CALC_
DEL (3)
TLG_COMPRESS_TYPE_CALC_
COPY_DEL (4)
ObjectStateTlgTag

Returns the object state via the
Yes/no
enumeration
HMIGO_OBJECT_STATE. Further
information on this enumeration
can be found in this documentation
under " VBA in other WinCC
Editors " .

TlgTagArchiveName

Name of the archive tag

Yes/no

TlgTagName

Name of the archive.

Yes/no

TlgTagType

Specifies the tag type. The
possible types are in Enum
HMIGO_TLG_TAG_TYPE.

Yes/yes

TLG_TAG_TYP_ANALOG (65537)
TLG_TAG_TYP_BINARY (65538)
TLG_TAG_TYP_PROCESS
(65544)
TLG_TAG_TYP_COMPRESS
(65540)
TlgTagArchiving

Specifies the acquisition type.
Possible values of Enum
HMIGO_TLG_TAG_ARCHIVING:

Yes/yes

TLG_TAG_ACYCLIC (8388609)
TLG_TAG_CYCLIC_CONTINUOU
S (8388610)
TLG_TAG_CYCLIC_SELECTIVE
(8388612)
TLG_TAG_ON_EVERY_CHANGE
(8388616)

142

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Object Property

Description

Read/Write

TlgTagArchivingState

Specifies whether archiving is
enabled or disabled at system
startup. Possible values of Enum
HMIGO_TLG_TAG_ARCHIVING_
STATE:

Yes/yes

TLG_TAG_LOCKED (1)
TLG_TAG_ACTIVATED (0)
TlgTagOnError

Specifies whether, in the event of a Yes/yes
problem, the most recently
acquired value or the substitute
value is saved. Possible values of
Enum
HMIGO_TLG_TAG_ON_ERROR:
TLG_TAG_LAST_VALUE (1)
TLG_TAG_SUBSTITUTE (2)

TlgTagTriggerType

Specifies how archiving is carried
Yes/yes
out at a signal change. Possible
values of Enum
HMIGO_TLG_TAG_TRIGGER_TY
PE:
TLG_TAG_FROM_0_TO_1 (2)
TLG_TAG_FROM_1_TO_0 (3)
TLG_TAG_ALWAYS (4)
TLG_TAG_EVERY_CHANGE (1)

TlgTagOnChange

Specifies whether archiving is to
Yes/yes
be carried out in the event of a
change. Possible values of Enum
HMIGO_TLG_TAG_ON_CHANGE
:
TLG_TAG_EVERY_VALUE (0)
TLG_TAG_RELATIVE_HYSTERE
SE (1)
TLG_TAG_ABSOLUTE_HYSTER
ESE (2)

TlgTagMethodType

Specifies the method by which the
value is edited before archiving.
Possible values of Enum
HMIGO_TLG_TAG_METHOD_TY
PE:

Yes/yes

TLG_TAG_ACTUAL (1)
TLG_TAG_SUM (3)
TLG_TAG_MaxValue (5)
TLG_TAG_MinValue (4)
TLG_TAG_AVERAGE (2)

Printout of the Online Help
Automated Configuring

143

VBA in Other WinCC Editors

11.05

Object Property

Read/Write

TlgTagTriggerScan

Name of the timer for the
acquisition cycle

Yes/yes

TlgTagTriggerArchiving

Name of the timer for the archiving Yes/yes
cycle

TlgTagStartTriggerFunction

Specifies the name of a script
function by means of which a
check is carried out for a start
event for the start of archiving.

Yes/yes

TlgTagStartTriggerModule

Specifies the name of a DLL from
which the script function is called
for the checking of a start event.

Yes/yes

TlgTagStopTriggerFunction

Specifies the name of a script
function by means of which a
check is carried out for a stop
event for the start of archiving.

Yes/yes

TlgTagTriggerFunction

Specifies the name of a script
function for the dynamic switching
of the acquisition and archiving
cycles.

Yes/yes

TlgTagNameCompressArchive In the case of compressed
archives, contains the name of the
source archive.

Yes/yes

TlgTagNameCompressTag

In the case of compressed
archives, contains the name of the
source tag.

Yes/yes

TlgTagNameRawValue

In the cast of process-controlled
archives, contains the name of the
raw-data tag.

Yes/yes

TlgTagConvertModule

Name of the conversion DLL used
for data conversion

Yes/yes

TlgTagNameProcTag

Name of the process tag from
which the value to be acquired is
taken

Yes/yes

TlgTagAliasName

The alternative name by means of
which the tag can be addressed
(alias)

Yes/yes

TlgTagStartEvent

Name of the tag by means of
which the start of archiving is
checked

Yes/yes

TlgTagStopEvent

Name of the tag by means of
which the stopping of archiving is
checked

Yes/yes

TlgTagTriggerFactor

Contains the factor for the display
cycle as a multiple of the archiving
cycle.

Yes/yes

TlgTagUpperLimit

144

Description

Value for the scaling of the tag's
upper limit

Yes/yes

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Object Property

Description

Read/Write

TlgTagLowerLimit

Value for the scaling of the tag's
lower limit

Yes/yes

TlgTagHysterese

Value for the hysteresis by means
of which a check is carried out to
establish whether a value has
changed

Yes/yes

Printout of the Online Help
Automated Configuring

145

VBA in Other WinCC Editors

4.2.1

11.05

CloseTlgArchive

Description
Closes the process value or compressed archive which is open.
Note:
Modified parameters are not saved.
Syntax
Expression.CloseTlgArchive()
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CloseTlgArchive()
' HMIGO_006
' procedure to close an archive
' the archive need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'open archive
objHMIGO.GetTlgArchive strArchiveName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'close archive
objHMIGO.CloseTlgArchive
'current status is " EMPTY "

146

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

147

VBA in Other WinCC Editors

4.2.2

11.05

CloseTlgTag

Description
Closes the archive tag which is open.
Note:
Modified parameters are not saved.
Syntax
Expression.CloseTlgTag()
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CloseTlgTag()
' HMIGO_007
' procedure to close a tag logging tag
' the archive need to be created before
' the tag logging tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Dim strTlgTagName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
strTlgTagName = " NewTag "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Tag "
'open/ get tag logging tag
objHMIGO.GetTlgTag strArchiveName, strTlgTagName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "

148

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

'close tag logging tag
objHMIGO.CloseTlgTag
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

149

VBA in Other WinCC Editors

4.2.3

11.05

CommitTlgArchive

Description
Writes the changed parameters of the specified archive to WinCC.
Note:
If further parameters are changed after a CommitTlgArchive call, write the
changes to WinCC by calling this function again.
Syntax
Expression.CommitTlgArchive()
Expression
Required. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CommitTlgArchive()
' HMIGO_008
' procedure to change a property of an archive
' the archive need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'open archive
objHMIGO.GetTlgArchive strArchiveName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'change a property
objHMIGO.TlgArchiveArchiveState = TLG_STATE_LOCKED
'current status is " MODIFIED "

150

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'commit archive
objHMIGO.CommitTlgArchive
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

151

VBA in Other WinCC Editors

4.2.4

11.05

CommitTlgTag

Description
Writes the changed parameters of the specified archive tag to WinCC.
Note:
If further parameters are changed after a CommitTlgTag call, write the changes to
WinCC by calling this function again.
Syntax
Expression.CommitTlgTag()
Expression
Required. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CommitTlgTag()
' HMIGO_009
' procedure to change a property of a tag logging tag
' the archive need to be created before
' the tag logging tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Dim strTlgTagName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
strTlgTagName = " NewTag "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Tag "
'open/ get tag logging tag
objHMIGO.GetTlgTag strArchiveName, strTlgTagName
'current status is " OPENED "

152

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
'change a property
objHMIGO.TlgTagArchiving = TLG_TAG_ON_EVERY_CHANGE
'current status is " MODIFIED "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
'commit tag logging tag
objHMIGO.CommitTlgTag
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

153

VBA in Other WinCC Editors

4.2.5

11.05

CreateTlgArchive Function

Description
Creates a process value archive or compressed archive.

Syntax
Expression.CreateTlgArchive(ArchiveName,ArchiveType)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

ArchiveName (string)

Name of the archive to be
created

ArchiveType (HMIGO_TLG_ARCHIVE_TYPE)

Type of the archive. The
possible types are:
TLG_PROCESSARCHIVE
(131073) for a process value
archive
TLG_COMPRESSARCHIVE
(131074) for a compressed
archive

Default Values when Creating a New Tag Archive
The following table indicates the default values that are entered when a new
process value archive or compressed archive is created. These values can be
modified later and written using the CommitTlgArchive function.
Property

Comment

TlgArchiveAccessLevelRead

0

Without authorization
level

TlgArchiveAccessLevelWrite

0

Without authorization
level

TlgArchiveArchiveState

TLG_ARCHIVE_STATE_A Archiving is started at
CTIVATED (0)
start of runtime.

TlgArchiveBufferSize

1000

Number of data
records

TlgArchiveBufferType

154

Default Value (Enum = & gt;
Name Value)

TLG_ARCHIVE_BUFFER
_TYPE_DISK (2)

The values are stored
on hard disk in the
database.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Property

Default Value (Enum = & gt;
Name Value)

Comment

TlgArchiveCompressRange

" 1 Tag " . This string must
be created individually for
each language (e.g.
English: " 1 Day " )

Corresponds to
exactly one day. Only
relevant in the case of
compressed tags.
Special feature: the
user is responsible for
values & gt; = 1 minute

TlgArchiveCompressType

TLG_COMPRESS_TYPE_ Only calculate
compression values.
CALC (1)
Only relevant in the
case of compressed
tags.

Enum HMIGO_TLG_ARCHIVE_STATE
Parameter

Description

TLG_ARCHIVE_STATE_LOCKED (1)

Archiving is disabled at system
startup.

TLG_ARCHIVE_STATE_ACTIVATED (0)

Archiving is started at start of
runtime.

Enum HMIGO_TLG_ARCHIVE_BUFFER_TYPE
Parameter

Description

TLG_ARCHIVE_BUFFER_TYPE_DISK (2)

The values are archived on hard
disk.

TLG_ARCHIVE_BUFFER_TYPE_RAM (1)

The values are only archived in
working memory.

Printout of the Online Help
Automated Configuring

155

VBA in Other WinCC Editors

11.05

Enum HMIGO_TLG_ARCHIVE_COMPRESS_TYPE
Parameter

Description

TLG_COMPRESS_TYPE_CALC (1)

Only the compression values are
calculated.

TLG_COMPRESS_TYPE_CALC_COPY (2)

The compression values are
calculated and the original values
copied.

TLG_COMPRESS_TYPE_CALC_DEL (3)

The compression values are
calculated and the original values
then deleted.

TLG_COMPRESS_TYPE_CALC_COPY_DE The compression values are
calculated and the original values
L (4)
copied and then deleted.

Example
Sub CreateTlgArchive()
' HMIGO_010
' procedure to create an archive
' the archive must not be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'create tag logging archive
objHMIGO.CreateTlgArchive strArchiveName,
TLG_PROCESSARCHIVE
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
Set objHMIGO = Nothing
End Sub

156

Printout of the Online Help
Automated Configuring

11.05

4.2.6

VBA in Other WinCC Editors

CreateTlgTag Function

Description
Creates a new archive tag.

Syntax
Expression.CreateTlgTag(ArchiveName,TagName,[TagType])
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

ArchiveName (string)

Name of an existing archive in
which the tag is to be entered

TagName (string)

Name of the tag to be created

TagType (HMIGO_TLG_TAG_TYPE, optional) Specifies the type of the tag. If no
type is specified, the default
value TLG_VAR_TYP_ANALOG
is entered. The possible types
are:
TLG_VAR_TYP_ANALOG
(65537) for an analog tag.
TLG_VAT_TYP_BINARY
(65538) for a binary tag.
TLG_VAR_TYP_PROCESS
(65544) for a process tag.
TLG_VAT_TYP_COMPRESS
(65540) for a compression tag.

Printout of the Online Help
Automated Configuring

157

VBA in Other WinCC Editors

11.05

Default Values When a New Archive Tag Is Created
The following table indicates the default values that are entered when a new
archive tag is created. These values can be modified later and written using the
CommitTlgTag function.
Property

Comment

TlgTagType

TLG_VAR_TYP_ANALOG
(65537)

Acquired by
means of an
analog data
manager tag

TlgTagArchiving

TLG_TAG_CYCLIC_CONTINU Cyclic,
continuous
OUS (8388610)
acquisition

TlgTagArchivingState

TLG_TAG_ACTIVATED (0)

Archiving is
started at start
of runtime.

TlgTagTriggerScan

1 second

--

TlgTagTriggerArchiving

1 second

--

TlgTagTriggerFactor

1

The display
cycle and
archiving cycle
are identical.

TlgTagOnError

TLG_TAG_LAST_VALUE (1)

The last valid
value is taken
as the
substitute value.

TlgTagTriggerType

TLG_TAG_ALWAYS (4)

Every value is
archived.

TlgTagMethodType

TLG_TAG_ACTUAL (1)

No editing. The
value is
accepted
immediately.

TlgTagStartTriggerFunction

No function specified

--

TlgTagStopTriggerFunction

No function specified

--

TlgTagTriggerFunction

No function specified

--

TlgTagUpperLimit

No value specified

--

TlgTagLowerLimit

No value specified

--

TlgTagNameCompressArchive

No archive name specified

--

TlgTagNameCompressTag

No tag name specified

--

TlgTagNameRawValue

No raw-data tag specified

--

TlgTagStartTriggerModule

No DLL name specified

--

TlgTagNameProcTag

158

Default Value (Enum Name
= & gt; Value)

Corresponds to " TagName "

--

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Property

Default Value (Enum Name
= & gt; Value)

Comment

TlgTagOnChange

TLG_TAG_EVERY_VALUE (0) Every value is
archived.

TlgTagHysterese

0

No check is
carried out by
means of
hysteresis.

TlgTagAliasName

No value specified

--

TlgTagStartEvent

No tag specified

--

TlgTagStopEvent

No tag specified

--

List of the enumerators for Tag Logging
Enum types

Description

TLG_TAG_TYPE

The passed parameter specifies the type of
the tag. The possible types are in the table
Enum HMIGO_TLG_TAG_TYPE.

TLG_TAG_ARCHIVING

The passed parameter specifies the
acquisition type. The possible values are in the
table Enum HMIGO_TLG_TAG_ARCHIVING.

TLG_TAG_ARCHIVING_STATE

The passed parameter specifies whether
archiving is disabled or enabled at system
startup. The possible values are in the table
Enum
HMIGO_TLG_TAG_ARCHIVING_STATE.

TLG_TAG_ON_ERROR

The passed parameter specifies which value is
stored in the event of a problem: the most
recently acquired value or the substitute value.
The possible values are in the table Enum
HMIGO_TLG_TAG_ON_ERROR.

TLG_TAG_TRIGGER_TYPE

The passed parameter specifies how archiving
is carried out at a signal change. The possible
values are in the table Enum
HMIGO_TLG_TAG_TRIGGER_TYPE.

TLG_TAG_METHOD_TYPE

The passed parameter specifies the method
by which the value is edited before archiving.
The possible values are in the table Enum
HMIGO_TLG_TAG_METHOD_TYPE.

TLG_TAG_ON_CHANGE

The passed parameter specifies whether
archiving is to be carried out in the event of a
change. The possible values are in the table
Enum HMIGO_TLG_TAG_ON_CHANGE.

Printout of the Online Help
Automated Configuring

159

VBA in Other WinCC Editors

11.05

Enum HMIGO_TLG_TAG_TYPE
Values

Description

TLG_TAG_TYP_ANALOG (65537)

Analog tag

TLG_TAG_TYP_BINARY (65538)

Binary tag

TLG_TAG_TYP_PROCESS (65544)

Process tag

TLG_TAG_TYP_COMPRESS (65540)

Compressed archive tag

Enum HMIGO_TLG_TAG_ARCHIVING
Values

Description

TLG_TAG_ACYCLIC (8388609)

Acyclic acquisition

TLG_TAG_CYCLIC_CONTINUOUS (8388610)

Cyclic-continuous acquisition

TLG_TAG_CYCLIC_SELECTIVE (8388612)

Cyclic-selective acquisition

TLG_TAG_ON_EVERY_CHANGE (8388616)

Acquisition only in the event of
a change

Enum HMIGO_TLG_TAG_ARCHIVING_STATE
Values

Description

TLG_TAG_LOCKED (1)

Acquisition disabled at system
startup

TLG_TAG_ACTIVATED (0)

Acquisition enabled at system
startup

Enum HMIGO_TLG_TAG_ON_ERROR
Values
TLG_TAG_LAST_VALUE (1)

The most recently acquired
value is used.

TLG_TAG_SUBSTITUTE (2)

160

Description

A substitute value is entered.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Enum HMIGO_TLG_TAG_TRIGGER_TYPE
Values

Description

TLG_TAG_FROM_0_TO_1 (2)

Signal change from the value 0
to 1

TLG_TAG_FROM_1_TO_0 (3)

Signal change from the value 1
to 0

TLG_TAG_ALWAYS (4)

Always archive.

TLG_TAG_EVERY_CHANGE (1)

Archive at every signal change.

Enum HMIGO_TLG_TAG_METHOD_TYPE
Values

Description

TLG_TAG_ACTUAL (1)

The current value is accepted.

TLG_TAG_SUM (3)

The sum is formed.

TLG_TAG_MaxValue (5)

The greatest value is saved.

TLG_TAG_MinValue (4)

The smallest value is saved.

TLG_TAG_AVERAGE (2)

The average value is saved.

Enum HMIGO_TLG_TAG_ON_CHANGE
Values

Description

TLG_TAG_EVERY_VALUE (0)

The current value is accepted.

TLG_TAG_RELATIVE_HYSTERESE (1)

A hysteresis specified as a
percentage is used for the
calculation as to whether the
value is to be archived.

TLG_TAG_ABSOLUTE_HYSTERESE (2)

A hysteresis specified as an
absolute value is used for the
calculation as to whether the
value is to be archived.

Printout of the Online Help
Automated Configuring

161

VBA in Other WinCC Editors

11.05

Example
Sub CreateTlgTag()
' HMIGO_011
' procedure to create a tag logging tag
' the archive need to be created before
' the tag logging tag must not be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Dim strTlgTagName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
strTlgTagName = " NewTag "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Tag "
'create tag logging tag
objHMIGO.CreateTlgTag strArchiveName, strTlgTagName,
TLG_TAG_TYPE_ANALOG
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
Set objHMIGO = Nothing
End Sub

162

Printout of the Online Help
Automated Configuring

11.05

4.2.7

VBA in Other WinCC Editors

DeleteTlgArchive

Description
Deletes the specified archive.

Syntax
Expression.DeleteTlgArchive(ArchiveName)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

ArchiveName (string)

Name of the archive to be deleted.
Archive tags contained in the archive
are also deleted.

Example
Sub DeleteTlgArchive()
' HMIGO_012
' procedure to delete an archive
' the archive need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'delete tag logging archive
objHMIGO.DeleteTlgArchive strArchiveName
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

163

VBA in Other WinCC Editors

4.2.8

11.05

DeleteTlgTag Function

Description
Deletes the specified archive tag.
Syntax
Expression.DeleteTlgTag(ArchiveName,TagName)
Expression
Required. An expression which returns a " HMIGO " type object.
Parameter
Parameter (Data Type)

Description

ArchiveName (string)

Name of the archive containing the archive tag to be
deleted

TagName (string)

Name of the archive tag to be deleted

Example
Sub DeleteTlgTag()
' HMIGO_013
' procedure to delete a tag logging tag
' the archive need to be created before
' the tag logging tag need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Dim strTlgTagName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
strTlgTagName = " NewTag "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Tag "
'delete tag logging tag
objHMIGO.DeleteTlgTag strArchiveName, strTlgTagName
Set objHMIGO = Nothing
End Sub

164

Printout of the Online Help
Automated Configuring

11.05

4.2.9

VBA in Other WinCC Editors

GetTlgArchive

Description
Reads in the parameters of the specified archive.
You can change or read the parameters by means of the object properties. You will
find a list of the available object properties in this documentation under " VBA in
Tag Logging " .

Syntax
Expression.GetTlgArchive(ArchiveName)
Expression
Necessary. An expression that returns an object of the type " HMIGO " .

Parameter
Parameter (data type)

Description

ArchiveName (string)

Name of the archive whose values are to be read in.

Example
Sub GetTlgArchive()
' HMIGO_014
' procedure to open an archive
' the archive need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
'open/ get tag logging archive
objHMIGO.GetTlgArchive strArchiveName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly,
" Status Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

165

VBA in Other WinCC Editors

11.05

4.2.10 GetTlgTag

Description
Reads in the parameters of the specified archive tag.
You can change or read the parameters by means of the object properties. You will
find a list of the available object properties in this documentation under " VBA in
Tag Logging " .

Syntax
Expression.GetTlgTag(ArchiveName,TagName)
Expression
Necessary. An expression that returns an object of the type " HMIGO " .

Parameter
Parameter (data type)

Description

ArchiveName (string)

Name of the archive containing the archive tag.

TagName

Name of the archive tag whose parameters are
to be read in.

Example
Sub GetTlgTag()
' HMIGO_015
' procedure to open a tag logging tag
' the archive need to be created before
' the tag logging need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim strArchiveName As String
Dim strTlgTagName As String
Set objHMIGO = New HMIGO
strArchiveName = " NewArchive "
strTlgTagName = " NewTag "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Tag "
'open/ get tag logging tag
objHMIGO.GetTlgTag strArchiveName, strTlgTagName

166

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

'current status is " OPENED "
MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, " Status
Tlg Archive "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

167

VBA in Other WinCC Editors

11.05

4.2.11 ListTlgArchive Function

Description
Alternatively, the ListTlgArchive function returns the following Tag Logging values
in a list:


All existing Tag Logging archives



All existing cycles / timers

Syntax
Expression.ListTlgArchive(ListType,pListArray,[Filter])
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

ListType (HMIGO_TLG_ARCHIVE_LIST_TYPE) Defines which content should
be returned in a list.
Possibilities are:
TLG_ARCHIVE_NAMES (1) All
created Tag Logging archives
TLG_ARCHIVE_TRIGGER_NA
MES (2) All created cycles /
timers
pListArray (Variant)

List with the requested content.

Filter (String)

Filters can be set optionally.
You may use the respective
trigger name as a filter.
Wildcards " * " and " ? " are also
possible.

168

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Example
In the following example, a check is made whether archives are configured:
Sub ReadTlgArchives()
'HMIGO_028
'read content in tag logging
no archives are implemented
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
'read all tlg archives
objHMIGO.ListTlgArchive TLG_ARCHIVE_NAMES, arrContent
'check result
If (UBound(arrContent) - LBound(arrContent) + 1) & lt; = 0 Then
MsgBox " no entries because no tag logging archives are
implemented "
End If
End Sub

Printout of the Online Help
Automated Configuring

169

VBA in Other WinCC Editors

11.05

4.2.12 ListTlgTag Function

Description
The ListTlgTag function returns all the tags created in a Tag Logging archive in a
list.

Syntax
Expression.ListTlgTag(ListType,ListArray,[ArchiveName],[Filte
r])
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

ListType (HMIGO_TLG_TAG_LIST_TYPE)

Defines which content should
be returned in a list.
Possibilities are:
TLG_TG_NAMES (1) All tags
created in a Tag Logging
archive

ListArray (Variant)
ArchiveName (string)

Name of the archive in Tag
Logging (optional). If the name
of the archive is not specified,
all,archive tags are returned.

Filter (String)

170

List with the requested content.

Filters can be set optionally.
Wildcards " * " and " ? " are also
possible.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Example
In the following example, a check is made whether the archive tags are configured
in the " Process Archive " :
Sub ReadTlgTag()
'HMIGO_029
'read content in tag logging
no tags within archives are implemented
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
Dim strArchive as String
'set tlg archive name
strArchive = processarchive
'read all tlg tags in specified archive
objHMIGO.ListTlgTag TLG_TAG_NAMES, arrContent, strArchive
'check result
If (UBound(arrContent) - LBound(arrContent) + 1) & lt; = 0 Then
MsgBox " no entries because no tag logging tags in
specified archive are implemented "
End If
End Sub

Printout of the Online Help
Automated Configuring

171

VBA in Other WinCC Editors

4.3

11.05

VBA in the Text Library
VBA allows you to generate Text Library texts directly from the program code,
modify and delete them, and display text IDs and texts.

Principle
When you have created the instance of the HMIGO class, the following functions
are available to you to access the Text Library:


CreateTextLanguage



CreateText



DeleteText



DeleteTextLanguage



GetText



GetTextID



ListText



ModifyText

The enumerations " HMIGO_TEXT_CREATE_MODE " and
" HMIGO_TEXT_LIST_TYPE " are available for the parameter assignment of these
functions.
Note:
The Text Library must not be open or be opened when editing using VBA.

172

Printout of the Online Help
Automated Configuring

11.05

4.3.1

VBA in Other WinCC Editors

CreateTextLanguage Function

Description
Creates a language in the Text Library.
Syntax
Expression.CreateTextLanguage(LanguageID)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

LanguageID (long)

ID for the language to be created (e.g. 1031 for
German, 1033 for English, etc.)
You will find a table of all the language codes in the
WinCC online help system under the keyword
" language IDs " .

Example
Sub CreateTextLanguage()
' GHMIGO_016
' procedure to create a language in text library
' language must not be created before
' LanguageID german = 1031
' LanguageID english(US) = 1033
' LanguageID spanish = 1034
' LanguageID french = 1040
' LanguageID farsi= 1065
' declarations
Dim objHMIGO As HMIGO
Dim lngLangugeNumber As Long
Set objHMIGO = New HMIGO
lngLangugeNumber = 1065

'farsi

'create new language
objHMIGO.CreateTextLanguage lngLangugeNumber
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

173

VBA in Other WinCC Editors

4.3.2

11.05

CreateText Function

Description
Creates a new text for the language specified. Text input for other languages can
be added using ModifyText.

Syntax
Expression.CreateText(LanguageID,Text,CreateMode,TextID)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

LanguageID (Long)

ID of the language for which
the text will be created.

Text (String)

Text to be created.

CreateMode (HMIGO_TEXT_CREATE_MODE)

Mode of text creation:
TEXT_ADD_REFCOUNT (0)
only increases the reference
counter when an identical text
already exists.
TEXT_CREATE_ALWAYS (1)
always sets up a new text line
and inserts the text in it.

TextID (Long)

174

Returns the TextID assigned to
the new text or the TextID
whose reference counter is
increased. This ID is required
for processing the text in other
functions.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Example
Sub CreateText()
' HMIGO_017
' procedure to create a new text
' declarations
Dim objHMIGO As HMIGO
Dim lngLanguageID As Long
Dim lngTextCreateMode As Long
Dim lngTextID As Long
" .CreateText "

'return value of

Dim strText As String
Set objHMIGO = New HMIGO
strText = " new text "
'LanguageID = english
lngLanguageID = 1033
' " TEXT_ADD_REFCOUNT " check if text exists, if not
create new text
lngTextCreateMode = 0
' " TEXT_CREATE_ALWAYS " create always a new text (for
messages)
'

lngTextCreateMode = 1

'create new text
objHMIGO.CreateText lngLanguageID, strText,
lngTextCreateMode, lngTextID
'show TextID of created text
MsgBox " TextID: " & lngTextID, vbOKOnly, " Result
CreateText "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

175

VBA in Other WinCC Editors

4.3.3

11.05

DeleteText Function

Description
Deletes a line of text. All the languages for the corresponding line of text and the
line of text itself are deleted.

Syntax
Expression.DeleteText(TextID)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

TextID (long)

ID of the line of text to be deleted

Example
Sub DeleteText()
' HMIGO_018
' procedure to delete a text
' text will be searched and deleted
' declarations
Dim objHMIGO As HMIGO
Dim lngLanguageID As Long
Dim lngTextID As Long
GetTextID

'return value of

Dim strText As String
On Error GoTo ErrorHandler
Set objHMIGO = New HMIGO
strText = " new text "
lngLanguageID = 1033
'first: find text in text library and return TextID
objHMIGO.GetTextID 1033, strText, lngTextID
'if searched text exists: delete this text
If Not lngTextID = -1 Then

176

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

objHMIGO.DeleteText lngTextID
MsgBox " Text : " " " & strText & " " " found in TextID:
" & lngTextID & vbNewLine & _
" TextID is deleted! " , vbOKOnly, " Result
DeleteText "
Else
MsgBox " Text : " " " & strText & " " " not found. " &
vbNewLine & _
" No Text deleted! " , vbOKOnly, " Result
DeleteText "
End If
Set objHMIGO = Nothing
Exit Sub
ErrorHandler:
'if lngText = (-1),searched text does not exit
If lngTextID = -1 Then
'reset errorhandler
Err.Clear
Resume Next
End If
MsgBox " ErrNr. : " & Err.Number & vbNewLine & _
" ErrDes.: " & Err.Description, vbOKOnly, " Error
ocurred "
'reset errorhandler
Err.Clear
End Sub

Printout of the Online Help
Automated Configuring

177

VBA in Other WinCC Editors

4.3.4

11.05

DeleteTextLanguage Function

Description
Enables a language to be deleted from the TextLibrary. In this case, all the texts in
this language are also deleted.
Syntax
Expression.DeleteTextLanguage(LanguageID)
Expression
Necessary. An expression which returns a " HMIGO " type object.
Parameter
Parameter (data type)

Description

LanguageID (Long)

ID of the language to be deleted

Example
In the following example, a check is made whether the language '1036' exists. If it
does, it will be deleted.
Sub DeleteLanguage()
'HMIGO_030
' delete an existing languages in TextLibrary
' language '1036'/spanish has to exist
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
Dim intLanguage As Long
Dim lngPointer As Long
' get all existing languages
objHMIGO.ListText TEXT_LANGUAGE_IDS, arrContent
' check requested list for language '1036'/ spanish and
delete
For lngPointer = LBound(arrContent) To UBound(arrContent)
intLanguage = arrContent(lngPointer) + Val( " & H400 " )
If intLanguage = 1036 Then
'delete language
objHMIGO.DeleteTextLanguage intLanguage
End If
Next lngPointer
End Sub

178

Printout of the Online Help
Automated Configuring

11.05

4.3.5

VBA in Other WinCC Editors

GetText Function

Description
Returns the text for the selected text ID in the selected language.
Syntax
Expression.GetText(LanguageID,TextID,Text)
Expression
Necessary. An expression that returns an object of the type " HMIGeneralObjects " .
Parameter
Parameter (Data Type)

Description

LanguageID (long)

ID of the language of the text to be read

TextID (long)

ID of the line of text from which text is to be read

Text (string)

Returns the text of the selected line of text and language.

Example
Sub GetText()
' HMIGO_019
' procedure to get a text
' text with TextID = '69' need to be created
' declarations
Dim objHMIGO As HMIGO
Dim lngLanguageID As Long
Dim lngTextID As Long
Dim strText As String

'return value of GetText

Set objHMIGO = New HMIGO
lngTextID = 69
lngLanguageID = 1033
'find text text library
objHMIGO.GetText lngLanguageID, lngTextID, strText
'show found text
MsgBox " Read Text in TextID : " & lngTextID & " is " " "
& strText & " " " ! " , _
vbOKOnly, " Result
GetText "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

179

VBA in Other WinCC Editors

4.3.6

11.05

GetTextID Function

Description
Returns the ID of the text searched for in the selected language.
If there are several texts with the same contents, only the line of text with the
lowest ID is returned. Whether there are several lines of text with the same
contents depends on the CreateMode of the CreateText function.

Syntax
Expression.GetTextID(LanguageID,Text,TextID)
Expression
Necessary. An expression that returns an object of the type " HMIGO " .

Parameter
Parameter (data type)

Description

LanguageID (long)

ID of the language of the text searched for

Text (string)

The text searched for

TextID (long)

ID of the line of text in which the text searched for was
found

Example
Sub GetTextID()
' HMIGO_020
' procedure to search a TextID
' text will be searched and a TextID will be returned
' declarations
Dim objHMIGO As HMIGO
Dim lngLanguageID As Long
Dim lngTextID As Long
GetTextID

'return value of

Dim strText As String
On Error GoTo ErrorHandler
Set objHMIGO = New HMIGO
strText = " old text "
lngLanguageID = 1033
'first: find text in text library and return TextID

180

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

objHMIGO.GetTextID 1033, strText, lngTextID
'if searched text exists: delete this text
If Not lngTextID = -1 Then
MsgBox " Text : " " " & strText & " " " found in TextID:
" & lngTextID, _
vbOKOnly, " Result GetTextID "
Else
MsgBox " Text : " " " & strText & " " " not found! " ,
vbOKOnly, " Result GetTextID "
End If
Set objHMIGO = Nothing
Exit Sub
ErrorHandler:
'if lngText = (-1),searched text does not exit
If lngTextID = -1 Then
'reset errorhandler
Err.Clear
Resume Next
End If
MsgBox " ErrNr. : " & Err.Number & vbNewLine & _
" ErrDes.: " & Err.Description, vbOKOnly, " Error
ocurred "
'reset errorhandler
Err.Clear
End Sub

Printout of the Online Help
Automated Configuring

181

VBA in Other WinCC Editors

4.3.7

11.05

ModifyText Function

Description
Modifies the text for the selected language with the ID specified.

Syntax
Expression.ModifyText(LanguageID,TextID,Text)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

LanguageID (long)

ID of the language of the text to be changed

TextID (long)

ID of the language of the text to be changed

Text (string)

New text to be inserted

Example
Sub ModifyText()
' HMIGO_021
' procedure to modify a text
' text will be searched and replaced
' declarations
Dim objHMIGO As HMIGO
Dim lngLanguageID As Long
Dim lngTextID As Long
GetTextID

'return value of

Dim strOldText As String
Dim strNewText As String
On Error GoTo ErrorHandler
Set objHMIGO = New HMIGO
strOldText = " old text "
strNewText = " new text "
lngLanguageID = 1033
'first: find text in text library and return TextID
objHMIGO.GetTextID 1033, strOldText, lngTextID

182

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

'if searched text exists: replace this text
If Not lngTextID = -1 Then
objHMIGO.ModifyText lngLanguageID, lngTextID,
strNewText
MsgBox " Text : " " " & strOldText & " " " found in
TextID: " & lngTextID & vbNewLine & _
" Text replaced with : " " " & strNewText & " " "
! " , vbOKOnly, " Result DeleteText "
Else
MsgBox " Text : " " " & strOldText & " " " not found. " &
vbNewLine & _
" No Replacements done! " , vbOKOnly, " Result
DeleteText "
End If
Set objHMIGO = Nothing
Exit Sub
ErrorHandler:
'if lngText = (-1),searched text does not exit
If lngTextID = -1 Then
'reset errorhandler
Err.Clear
Resume Next
End If
MsgBox " ErrNr. : " & Err.Number & vbNewLine & _
" ErrDes.: " & Err.Description, vbOKOnly, " Error
ocurred "
'reset errorhandler
Err.Clear
End Sub

Printout of the Online Help
Automated Configuring

183

VBA in Other WinCC Editors

4.3.8

11.05

ListText Function

Description
Alternatively, the ListText function returns the following contents of the TextLibrary
as a list:


All languages created



All text IDs



All texts in a specific language

Syntax
Expression.ListText(ListType,pListArray,[LanguageID],[Filter]
)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (data type)

Description

ListType (HMIGO_TEXT_LIST_TYPE) Defines which content should be returned
as a list. Possibilities are:
TEXT_LANGUAGE_IDS (1) All the
created languages. The result still has to
be converted by adding 400hex.
TEXT_IDS (2) All text IDs.
TEXT_TEXTS (3) All texts in a language.
pListArray (Variant)
LanguageID (Long)

The language ID whose text is to be
returned.

Filter (String)

184

List with the requested content.

Filters can be set optionally. Wildcards
" * " and " ? " are also possible.

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Example
In the following example, a check is made whether the list with the text of a
language is empty because the language does not exist:
Sub ReadTextsByLanguage()
'HMIGO_031
'read content in textLibrary by language
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
Dim intLanguage As Integer
'set invalid language ID
intLanguage = 1051 'language does not exist
'read all texts
objHMIGO.ListText TEXT_TEXTS, arrContent, intLanguage
'check result
If (UBound(arrContent) - LBound(arrContent) + 1) & lt; = 0 Then
MsgBox " no entries because wrong language selection "
End If
End Sub

Printout of the Online Help
Automated Configuring

185

VBA in Other WinCC Editors

4.4

11.05

VBA in Alarm Logging

Introduction
VBA allows you to create messages directly from the program code, modify them,
and delete them.

Principle
When you have created the instance of the HMIGO class, the following functions
are available to you to access Alarm Logging:


CloseSingleAlarm



CommitSingleAlarm



CreateSingleAlarm



DeleteSingleAlarm



GetSingleAlarm



ListSingleAlarm

Enumeration " HMIGO_SINGLE_ALARM_CLASS_IDS " and
" HMIGO_SINGLE_ALARM_LIST_TYPE " is available for parameter assignment of
this function.
Note
You should not have or should not open the Alarm Logging when editing with
VBA.

186

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Access to the Object Properties
You can also access the parameters of the above-mentioned functions directly in
VBA by means of the following object properties:
Object Property

Description

Read/
Write

ObjectStateSingleAlarm

Returns the object state via the
enumeration
HMIGO_OBJECT_STATE. Further
information on this enumeration can
be found in this documentation under
" VBA in other WinCC Editors " .

Yes/no

SingleAlarmMessageNumber

Number of the message

Yes/no

SingleAlarmAGNumber

PLC number

Yes/yes

SingleAlarmCPUNumber

CPU number of the PLC

Yes/yes

SingleAlarmClassID

Message class of the message.
Possible values of the Enum
SINGLE_ALARM_CLASS_IDS:

Yes/yes

SINGLE_ALARM_ERROR (1)
SINGLE_ALARM_CLASS_2 (2)
SINGLE_ALARM_CLASS_3 (3)
SINGLE_ALARM_CLASS_4 (4)
SINGLE_ALARM_CLASS_5 (5)
SINGLE_ALARM_CLASS_6 (6)
SINGLE_ALARM_CLASS_7 (7)
SINGLE_ALARM_CLASS_8 (8)
SINGLE_ALARM_CLASS_9 (9)
SINGLE_ALARM_CLASS_10 (10)
SINGLE_ALARM_CLASS_11 (11)
SINGLE_ALARM_CLASS_12 (12)
SINGLE_ALARM_CLASS_13 (13)
SINGLE_ALARM_CLASS_14 (14)
SINGLE_ALARM_CLASS_15 (15)
SINGLE_ALARM_CLASS_16 (16)
SINGLE_ALARM_CLASS_SYSTEM_
REQUIRE_ACKNOWLEDGEMENT
(17)
SINGLE_ALARM_CLASS_SYSTEM_
WITHOUT_ACKNOWLEDGEMENT
(18)

Printout of the Online Help
Automated Configuring

187

VBA in Other WinCC Editors

11.05

Object Property

Description

Read/
Write

SingleAlarmMessageTypeID

Type ID of the message. The
permissible values depend on the
message class:

Yes/yes

Class 1: Values from 1 to 16
Class 2: Values from 17 to 32
Class 3: Values from 33 to 48
...
Class 18: Values from 263 to 288
SingleAlarmTextXXID
XX = 1...10
SingleAlarmTagNameProcess
ValueXX
XX = 1...10

For process values to be archived,
Yes/yes
properties exist for
SingleAlarmTagNameProcessValue1
though 10
If you wish to delete a configured
process value, this parameter must be
described with a tag of type " Long "
with a value of " 0 " .1)

SingleAlarmTagName

Tag name for event

Yes/yes

SingleAlarmMessageBit

Bits for bit reporting procedure

Yes/yes

SingleAlarmQuitTag

Tag name for acknowledgment status

Yes/yes

SingleAlarmQuitBits

Bit for bit reporting procedure

Yes/yes

SingleAlarmStateTag

Tag for status query

Yes/yes

SingleAlarmStateBits

Bit for status tag

Yes/yes

SingleAlarmNormDLL

Name of the conversion DLL

Yes/yes

SingleAlarmQuitSingle

Acknowledgment of the messages,
TRUE or FALSE possible

Yes/yes

SingleAlarmHornActivate

Activation of the horn, TRUE or
FALSE possible

Yes/yes

SingleAlarmArchiving

Archiving of the message, TRUE or
FALSE possible

Yes/yes

SingleAlarmProtocol

Logging of the message, TRUE or
FALSE possible

Yes/yes

SingleAlarmFlankInvert

Triggering of message at falling edge, Yes/yes
TRUE or FALSE possible

SingleAlarmLockedOnStart

Message is disabled at system
startup, TRUE or FALSE possible

Yes/yes

SingleAlarmGlobalAPFunction

Forward message to global AP
function, TRUE or FALSE possible

Yes/yes

SingleAlarmActionName

Name of the action

Yes/yes

SingleAlarmActionParams

188

The properties SingleAlarmText1ID to Yes/yes
SingleAlarmText10ID exist for the
user texts 1 to 10.

Parameters of the action

Yes/yes

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Object Property

Description

Read/
Write

SingleAlarmInfoText

Information text for message

Yes/yes

SingleAlarmGroup

Name of the user-defined group
message assigned to a message.

Yes/yes

1)

Sub DeleteSingleAlarmTagNameProcessValue1()
'VBA807
Dim objGO as HMIGO
Dim var as Long
var = 0
Set objGO = new HMIGO
'message 1 will be modified
objGO.GetSingleAlarm 1
objGO.SingleAlarmTagNameProcessValue1 = var
objGO.CommitSingleAlarm
Set objGO = nothing
End Sub

Printout of the Online Help
Automated Configuring

189

VBA in Other WinCC Editors

4.4.1

11.05

CloseSingleAlarm

Description
Closes the message which is open.
Note:
Modified parameters are not saved. If the current value should be saved, execute
the CommitSingleAlarm() function again.
Syntax
Expression.CloseSingleAlarm()
Expression
Required. An expression that returns an object of the type " HMIGO " .

Parameter
--

Example
Sub CloseSingleAlarm()
' HMIGO_22
' procedure to close a singlealarm
' message #100 need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim lngMsgNumber As Long
Set objHMIGO = New HMIGO
lngMsgNumber = 100
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'open a singlealarm
objHMIGO.GetTag strVariableName
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'close a singlealarm
objHMIGO.CloseTag
'current status is " EMPTY "

190

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

191

VBA in Other WinCC Editors

4.4.2

11.05

CommitSingleAlarm

Description
Writes the changed parameters of the open message to WinCC.
Note:
To change further parameters after a CommitSingleAlarm call, write these
changes to WinCC by calling the function again.
Syntax
Expression.CommitSingleAlarm()
Expression
Required. An expression which returns a " HMIGO " type object.

Parameter
--

Example
Sub CommitSingleAlarm()
' HMIGO_023
' procedure to change a property of a singlealarm
' message #100 need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim lngMsgNumber As Long
Dim lngMsgBitNumber As Long
Set objHMIGO = New HMIGO
lngMsgNumber = 100
lngMsgBitNumber = 10
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'open a singlealarm
objHMIGO.GetSingleAlarm lngMsgNumber
'current status is " OPENED " for changes
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'change a property

192

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

objHMIGO.SingleAlarmMessageBit = lngMsgBitNumber
'current status is " MODIFIED " for changes
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'commit a single alarm
objHMIGO.CommitSingleAlarm
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

193

VBA in Other WinCC Editors

4.4.3

11.05

CreateSingleAlarm Function

Description
Creates a new message.

Syntax
Expression.CreateSingleAlarm(MessageNumber,ClassID,MessageTyp
eID,Text1ID,MessageTagName,MessageBit)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

MessageNumber (long)

Number of the message
If an unused message number is
specified here, it is accepted.
If the value " 0 " is entered, the
message number is freely assigned
by the system. In this case, the
message number is given back here.

ClassID
(HMIGO_SINGLE_ALARM_CLASS_IDS)

Message class. The possible values
are in the table Enum
HMIGO_SINGLE_ALARM_CLASS_ID
S.

MessageTypeID (integer)

The permissible values depend on the
message class:
Class 1: Values from 1 to 16
Class 2: Values from 17 to 32
Class 3: Values from 33 to 48
...
Class 18: Values from 263 to 288

Text1ID (long)

MessageTagName (string)

Tag name for the event

MessageBit (integer)

194

ID for the first user text. The
ModifySingleAlarm function can be
used to define nine further user texts
(1-10).
Bit in bit reporting process (0...31)

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Default Values When a New Message Is Created
The following table indicates the default values that are entered when a new
message is created. These properties can be modified. The modifications are
saved using the ModifySingleAlarm function.
Parameter

Default Value (Enum Name
= & gt; Value)

Comment

SingleAlarmAGNumber

0

--

SingleAlarmCPUNumber

0

--

SingleAlarmTextXXID

No text entered

--

SingleAlarmTagNameProcess
ValueXX

No tag entered

--

SingleAlarmQuitTag

No tag entered

--

SingleAlarmQuitBits

0

No bits set.

SingleAlarmStateTag

No tag entered

Corresponds to
exactly one day.
Only relevant in
the case of
compressed tags.

SingleAlarmStateBits

0

No bits set.

SingleAlarmNormDLL

No name entered

--

SingleAlarmQuitSingle

FALSE

Single
acknowledgment,
no group
acknowledgment

SingleAlarmHornActivate

FALSE

Horn not
activated.

SingleAlarmArchiving

TRUE

Message is
archived.

SingleAlarmProtocol

TRUE

Message is
logged.

SingleAlarmFlankInvert

FALSE

Not activated.

SingleAlarmLockedOnStart

FALSE

Message is not
disabled.

SingleAlarmGlobalAPIFunction FALSE

Message is not
forwarded.

SingleAlarmActionName

No name entered

--

SingleAlarmActionParams

No parameters entered for
the action

--

SingleAlarmInfoText

No text entered

--

SingleAlarmGroup

No text entered

--

Printout of the Online Help
Automated Configuring

195

VBA in Other WinCC Editors

11.05

Enum HMIGO_SINGLE_ALARM_CLASS_IDS
The following message classes are available for selection:
Values

Description

SINGLE_ALARM_ERROR (1)

--

SINGLE_ALARM_CLASS_2 (2)

--

SINGLE_ALARM_CLASS_3 (3)

--

SINGLE_ALARM_CLASS_4 (4)

--

SINGLE_ALARM_CLASS_5 (5)

--

SINGLE_ALARM_CLASS_6 (6)

--

SINGLE_ALARM_CLASS_7 (7)

--

SINGLE_ALARM_CLASS_8 (8)

--

SINGLE_ALARM_CLASS_9 (9)

--

SINGLE_ALARM_CLASS_10 (10)

--

SINGLE_ALARM_CLASS_11 (11)

--

SINGLE_ALARM_CLASS_12 (12)

--

SINGLE_ALARM_CLASS_13 (13)

--

SINGLE_ALARM_CLASS_14 (14)

--

SINGLE_ALARM_CLASS_15 (15)

--

SINGLE_ALARM_CLASS_16 (16)

--

SINGLE_ALARM_CLASS_SYSTEM_REQUIRE
_ACKNOWLEDGEMENT (17)

--

SINGLE_ALARM_CLASS_SYSTEM_WITHOUT -_ACKNOWLEDGEMENT (18)

Example
Sub CreateSingleAlarm()
' HMIGO_024
' procedure to create a SingleAlarm
' message must not be created before
' message Text ID need to be created before in text
library
' declarations
Dim objHMIGO As HMIGO
Dim strMsgText As String

'message text

Dim strMsgTagName As String

'message variable

Dim lngMsgNumber As Long

'message number

Dim lngMsgBitNumber As Long
message variable
Dim lngMsgTypeID As Long

196

'bit number within the
'message type

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Dim lngMsgClassID
Dim lngMsgTextID As Long
textlibrary

'SINGLE_ALARM_ERROR
'message text ID from

Set objHMIGO = New HMIGO
strMsgText = " NewText "
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'preset reqiured parameter
lngMsgNumber = 50
lngMsgClassID = 1
lngMsgTypeID = 2
lngMsgTextID = 69
strMsgText = " new text message "
strMsgTagName = " NewVariable "
lngMsgBitNumber = 5
'create a tag
objHMIGO.CreateSingleAlarm
lngMsgNumber,SINGLE_ALARM_ERROR,
lngMsgTypeID,lngMsgTextID, strMsgTagName,
lngMsgBitNumber
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

197

VBA in Other WinCC Editors

4.4.4

11.05

DeleteSingleAlarm Function

Description
Deletes the specified message.

Syntax
Expression.DeleteSingleAlarm(MessageNumber)
Expression
Necessary. An expression which returns a " HMIGO " type object.

Parameter
Parameter (Data Type)

Description

MessageNumber (long)

Number of the message to be deleted

Example
Sub DeleteSingleAlarm()
' HMIGO_025
' procedure to delete a singlealarm
' message #100 need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim lngMsgNumber As Long
Set objHMIGO = New HMIGO
lngMsgNumber = 100
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'delete a singlealarm
objHMIGO.DeleteSingleAlarm lngMsgNumber
Set objHMIGO = Nothing
End Sub

198

Printout of the Online Help
Automated Configuring

11.05

4.4.5

VBA in Other WinCC Editors

GetSingleAlarm Function

Description
Reads in the parameters of the message entered.
You can change or read the parameters by means of the object properties. You will
find a list of the available object properties in this documentation under " VBA in
Alarm Logging " .
Syntax
Expression.GetSingleAlarm(MessageNumber)
Expression
Necessary. An expression that returns an object of the type " HMIGO " .
Parameter
Parameter (data type)

Description

MessageNumber (long)

The message number of the message to be read in.

Example
Sub GetSingleAlarm()
' HMIGO_026
' procedure to open a singlealarm
' message #100 need to be created before
' declarations
Dim objHMIGO As HMIGO
Dim lngMsgNumber As Long
Set objHMIGO = New HMIGO
lngMsgNumber = 100
'current status is " EMPTY "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
'open/ get a tag
objHMIGO.GetSingleAlarm lngMsgNumber
'current status is " OPENED "
MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly,
" Status SingleAlarm "
Set objHMIGO = Nothing
End Sub

Printout of the Online Help
Automated Configuring

199

VBA in Other WinCC Editors

4.4.6

11.05

ListSingleAlarm Function

Description
The ListSingleAlarm function returns the content of Alarm Logging in a list:


All actions created which are linked to messages



All message class IDs created



All info texts created



All message numbers created



All message type IDs created



All message classes created



All group messages created

Syntax
Expression.ListSingleAlarm(ListType,pListArray,[Filter])
Expression
Necessary. An expression which returns a " HMIGO " type object.

200

Printout of the Online Help
Automated Configuring

11.05

VBA in Other WinCC Editors

Parameter
Parameter (data type)

Description

ListType
Defines which content should be returned in a
(HMIGO_SINGLE_ALARM_LIST_ list. Possibilities are:
TYPE)
SINGLE_ALARM_ACTION_NAMES (1) All
actions created for loop-in-alarms when the
parameter is set in the configuration as a
string
SINGLE_ALARM_CLASS_IDS (2) All
message class IDs created
SINGLE_ALARM_INFO_TEXTS (3) All info
texts created
SINGLE_ALARM_MESSAGE_NUMBERS (4)
All message numbers created
SINGLE_ALARM_MESSAGE_TYPE_IDS (5)
All message type IDs created
SINGLE_ALARM_GROUP_MESSAGE_CLA
SSES (6) All message classes created
SINGLE_ALARM_GROUP_MESSAGE_USE
R_DEFINED (7) All group messages created
pListArray (Variant)

List with the requested content.

Filter (String)

Filters can be set optionally. Wildcards " * " and
" ? " are also possible.

Example
In the following example, a check is made whether info texts have been configured:
Sub ReadSingleAlarm()
'HMIGO_032
'read content in alarm logging
no info texts are implemented
Dim objHMIGO As New HMIGO
Dim arrContent As Variant
'read all info texts
objHMIGO.ListSingleAlarm SINGLE_ALARM_INFO_TEXTS,
arrContent
'check result
If (UBound(arrContent) - LBound(arrContent) + 1) & lt; = 0 Then
MsgBox " no entries because no info texts are implemented "
End If
End Sub

Printout of the Online Help
Automated Configuring

201

VBA in Other WinCC Editors

202

11.05

Printout of the Online Help
Automated Configuring

11.05

5

ActualPointTopIndex

VBA Reference

VBA Object Model
When you click on an object name, you are shown a detailed description.
Note:
The prefix " HMI " will be omitted from the following descriptions. Note that in the
code you must prefix objects with " HMI " , e.g. " HMISymbolLibrary " .

Printout of the Online Help
Automated Configuring

203

ActualPointTopIndex

5.1

11.05

VBA Reference: HMIObjects

VBA Object Model: HMIObjects
When you click on an object name, you are shown a detailed description.

204

Printout of the Online Help
Automated Configuring

11.05

5.2

ActualPointTopIndex

VBA Reference: ActionDynamic

VBA Object Model: ActionDynamic
" ActionDynamic " represents the interface port for dynamics and actions such as
scripts, the Dynamic dialog, direct connection and the triggers.
When you click on an object name, you are shown a detailed description.

Printout of the Online Help
Automated Configuring

205

ActualPointTopIndex

5.3

11.05

VBA Reference: Languages

VBA Object Model: Languages
When you click on an object name, you are shown a detailed description.

206

Printout of the Online Help
Automated Configuring

11.05

5.4

ActualPointTopIndex

Events

5.4.1

VBA Events: A-D

5.4.1.1

Activated Event

Description
Occurs when a picture is activated in the Graphics Designer. This happens when
you switch between two pictures, for example.

Syntax
Document_Activated(CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. Default setting is " False " .

Example
In the following example a message is output when the picture is activated:
Private Sub Document_Activated(CancelForwarding As Boolean)
'VBA76
MsgBox " The document got the focus. " & vbCrLf & _
" This event (Document_Activated) is raised by the
document itself "
End Sub

Printout of the Online Help
Automated Configuring

207

ActualPointTopIndex

5.4.1.2

11.05

BeforeClose Event

Description
Occurs immediately before a picture is closed.

Syntax
Document_BeforeClose(Cancel As Boolean, CancelForwarding As
Boolean)

Parameter
Parameter (Data Type)

Description

Cancel (Boolean)

TRUE if command processing is to be
canceled.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output before the picture is closed:
Private Sub Document_BeforeClose(Cancel As Boolean,
CancelForwarding As Boolean)
'VBA77
MsgBox " Event Document_BeforeClose is raised "
End Sub

208

Printout of the Online Help
Automated Configuring

11.05

5.4.1.3

ActualPointTopIndex

BeforeDocumentClose Event

Description
Occurs immediately before the picture is closed.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
In the following example, the name " objGDApplication " is substituted for & lt; Name & gt; .
objGDApplication_BeforeDocumentClose(Document As HMIDocument,
Cancel As Boolean)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that is going to be closed.

Cancel (Boolean)

TRUE if command processing is to be
canceled.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output before the picture is closed:
Private Sub objGDApplication_BeforeDocumentClose(ByVal
Document As IHMIDocument, Cancel As Boolean)
'VBA78
MsgBox " The document " & Document.Name & " will be
closed after press ok "
End Sub

Printout of the Online Help
Automated Configuring

209

ActualPointTopIndex

5.4.1.4

11.05

BeforeDocumentSave Event

Description
Occurs immediately before the picture is saved.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_BeforeDocumentSave(Document As HMIDocument,
Cancel As Boolean)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that is going to be closed.

Cancel (Boolean)

TRUE if command processing is to be
canceled.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output before the picture is closed:
Private Sub objGDApplication_BeforeDocumentSave(ByVal
Document As IHMIDocument, Cancel As Boolean)
'VBA79
MsgBox Document.Name & " -saving will start after press
ok. "
End Sub

210

Printout of the Online Help
Automated Configuring

11.05

5.4.1.5

ActualPointTopIndex

BeforeHMIObjectDelete Event

Description
Occurs immediately before an object in a picture is deleted.

Syntax
BeforeHMIObjectDelete(ByVal HMIObject As IHMIObject, Cancel
As Boolean, CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

HMIObject (IHMIObject)

Identifies the object to be deleted.

Cancel (Boolean)

TRUE if command processing is to be
canceled.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output identifying the object to be deleted:
Private Sub Document_BeforeHMIObjectDelete(ByVal HMIObject As
IHMIObject, Cancel As Boolean, CancelForwarding As Boolean)
'VBA80
Dim strObjName As String
Dim strAnswer As String
'
' " strObjName " contains the name of the deleted object
strObjName = HMIObject.ObjectName
strAnswer = MsgBox( " Are you sure to delete " &
strObjName & " ? " , vbYesNo)
If strAnswer = vbNo Then
'if pressed " No " - & gt; set Cancel to true for prevent
delete
Cancel = True
End If
End Sub

Printout of the Online Help
Automated Configuring

211

ActualPointTopIndex

5.4.1.6

11.05

BeforeLibraryFolderDelete Event

Description
Occurs immediately before a folder in the components library is deleted.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_BeforeLibraryFolderDelete(LibObject As
HMIFolderItem, Cancel As Boolean)

Parameter (Optional)
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The folder that is going to be deleted.

Cancel (Boolean)

TRUE if command processing is to be canceled.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output before a folder in the components
library is deleted:
Private Sub objGDApplication_BeforeLibraryFolderDelete(ByVal
LibObject As HMIFolderItem, Cancel As Boolean)
'VBA81
MsgBox " The library-folder " & LibObject.Name & " will
be delete... "
End Sub

212

Printout of the Online Help
Automated Configuring

11.05

5.4.1.7

ActualPointTopIndex

BeforeLibraryObjectDelete Event

Description
Occurs immediately before an object in the components library is deleted.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_BeforeLibraryObjectDelete(LibObject As
HMIFolderItem, Cancel As Boolean)

Parameter (Optional)
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The object that is going to be deleted.

Cancel (Boolean)

TRUE if command processing is to be canceled.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output before a folder in the components
library is deleted:
Private Sub objGDApplication_BeforeLibraryObjectDelete(ByVal
LibObject As HMIFolderItem, Cancel As Boolean)
'VBA82
MsgBox " The object " & LibObject.Name & " will be
delete... "
End Sub

Printout of the Online Help
Automated Configuring

213

ActualPointTopIndex

5.4.1.8

11.05

BeforeQuit Event

Description
Occurs immediately before the Graphics Designer is closed.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_BeforeQuit(Cancel As Boolean)

Parameter
Parameter (Data Type)

Description

Cancel (Boolean)

TRUE, if the processing of the command is to be
aborted.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In this example a message is output shortly before the Graphics Designer is
closed.
Private Sub objGDApplication_BeforeQuit(Cancel As Boolean)
'VBA83
MsgBox " The Graphics Designer will be shut down "
End Sub

214

Printout of the Online Help
Automated Configuring

11.05

5.4.1.9

ActualPointTopIndex

BeforeSave Event

Description
Occurs immediately before a picture is saved.

Syntax
Document_BeforeSave(Cancel As Boolean, CancelForwarding As
Boolean)

Parameter
Parameter (Data Type)

Description

Cancel (Boolean)

TRUE if command processing is to be canceled.

CancelForwarding (Boolean)

TRUE if the event is not intended to be forwarded.
" Default setting is " False.

Example
In the following example a message is output before the picture is saved:
Private Sub Document_BeforeSave(Cancel As Boolean,
CancelForwarding As Boolean)
'VBA84
MsgBox " The document will be saved... "
End Sub

Printout of the Online Help
Automated Configuring

215

ActualPointTopIndex

11.05

5.4.1.10 BeforeVisibleFalse Event

Description
Occurs immediately before the Graphics Designer application is set from Visible to
Invisible.

Syntax
Document_BeforeVisibleFalse(Cancel As Boolean,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

Cancel (Boolean)

TRUE if command processing is to be canceled.

CancelForwarding (Boolean)

TRUE if the event is not intended to be forwarded.
" Default setting is " False.

Example
--

216

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.1.11 ConnectionEvent Event

Description
Occurs when two objects are connected via the connector.

Syntax
ConnectionEvent(eConnEventType, HMIConnector,
HMIConnectedObject, CancelProcess, CancelForwarding)

Parameter (Optional)
Parameter (Data Type)

Description

eConnEventType (HMIConnectionEventType)

--

HMIConnector (HMIObject)

--

HMIConnectedObject (HMIObject)

--

CancelProcess (Boolean)

TRUE if command processing is
to be canceled.

CancelForwarding (Boolean)

TRUE if the event is not intended
to be forwarded. " Default setting
is " False.

Example
--

Printout of the Online Help
Automated Configuring

217

ActualPointTopIndex

11.05

5.4.1.12 DataLanguageChanged Event

Description
Occurs when the project language has been changed.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DataLanguageChanged(lCID As Long)

Parameter
Parameter (Data Type)

Description

lCID (Long)

The project language identifier

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the newly set project language is output:
Private Sub objGDApplication_DataLanguageChanged(ByVal lCID
As Long)
'VBA87
MsgBox " The datalanguage is changed to " &
Application.CurrentDataLanguage & " . "
End Sub

218

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.1.13 DesktopLanguageChanged Event

Description
Occurs when the user interface language has been changed.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DesktopLanguageChanged(lCID As Long)

Parameter
Parameter (Data Type)

Description

lCID (Long)

The user interface language identifier

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the newly set desktop language is output:
Private Sub objGDApplication_DesktopLanguageChanged(ByVal
lCID As Long)
'VBA88
MsgBox " The desktop-language is changed to " &
Application.CurrentDesktopLanguage & " . "
End Sub

Printout of the Online Help
Automated Configuring

219

ActualPointTopIndex

11.05

5.4.1.14 DocumentActivated Event

Description
Occurs when a picture is activated in the Graphics Designer. This happens when
you switch between two pictures, for example.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DocumentActivated(Document As HMIDocument)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that is to be activated.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output identifying the picture that has been
activated:
Private Sub objGDApplication_DocumentActivated(ByVal Document
As IHMIDocument)
'VBA89
MsgBox " The document " & Document.Name & " got the
focus. " & vbCrLf & _
" This event is raised by the application. "
End Sub

220

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.1.15 DocumentCreated Event

Description
Occurs when a new picture has been created in the Graphics Designer.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DocumentCreated(Document As HMIDocument)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that has been created.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the name of the newly created picture is output:
Private Sub objGDApplication_DocumentCreated(ByVal Document
As IHMIDocument)
'VBA90
MsgBox Document.Name & " will be created. "
End Sub

Printout of the Online Help
Automated Configuring

221

ActualPointTopIndex

11.05

5.4.1.16 DocumentOpened Event

Description
Occurs when a picture has been opened.

Syntax

Note:
In order for the application-specific event to be available in the project, the
Graphics Designer application must be declared. The is done by means of the
following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DocumentOpened(Document As HMIDocument)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that has been opened.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output identifying the picture that has been
opened:
Private Sub objGDApplication_DocumentOpened(ByVal Document As
IHMIDocument)
'VBA91
MsgBox Document.Name & " is opened. "
End Sub

222

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.1.17 DocumentSaved Event

Description
Occurs when a picture has been saved in the Graphics Designer.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_DocumentSaved(Document As HMIDocument)

Parameter
Parameter (Data Type)

Description

Document (HMIDocument)

The picture that has been saved.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output identifying the picture that has been
saved:
Private Sub objGDApplication_DocumentSaved(ByVal Document As
IHMIDocument)
'VBA92
MsgBox Document.Name & " is saved. "
End Sub

Printout of the Online Help
Automated Configuring

223

ActualPointTopIndex

11.05

5.4.1.18 DocumentPropertyChanged Event

Description
Occurs when a picture property is changed.

Syntax
Document_DocumentPropertyChanged(ByVal Property As
IHMIProperty, CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

Property (IHMIProperty)

Identifies the changed property.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output identifying the picture property being
changed:
Private Sub Document_DocumentPropertyChanged(ByVal Property
As IHMIProperty, CancelForwarding As Boolean)
'VBA93
Dim strPropName As String
' " strPropName " contains the name of the modified
property
strPropName = Property.Name
MsgBox " The picture-property " & strPropName & " is
modified... "
End Sub

224

Printout of the Online Help
Automated Configuring

11.05

5.4.2

ActualPointTopIndex

VBA Events: F-Z

5.4.2.1

HMIObjectAdded Event

Description
Occurs when an object is added.

Syntax
Document_HMIObjectAdded(ByVal HMIObject As IHMIObject,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

HMIObject (IHMIObject)

Identifies the object being added.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output identifying the object that has been
added:
Private Sub Document_HMIObjectAdded(ByVal HMIObject As
IHMIObject, CancelForwarding As Boolean)
'VBA94
Dim strObjName As String
'
' " strObjName " contains the name of the added object
strObjName = HMIObject.ObjectName
MsgBox " Object " & strObjName & " is added... "
End Sub

Printout of the Online Help
Automated Configuring

225

ActualPointTopIndex

5.4.2.2

11.05

HMIObjectMoved Event

Description
Occurs when an object is moved.

Syntax
Document_HMIObjectMoved(ByVal HMIObject As IHMIObject,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

HMIObject (IHMIObject)

Identifies the object being moved.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output identifying the object that has been
moved:
Private Sub Document_HMIObjectMoved(ByVal HMIObject As
IHMIObject, CancelForwarding As Boolean)
'VBA95
Dim strObjName As String
'
' " strObjName " contains the name of the moved object
strObjName = HMIObject.ObjectName
MsgBox " Object " & strObjName & " was moved... "
End Sub

226

Printout of the Online Help
Automated Configuring

11.05

5.4.2.3

ActualPointTopIndex

HMIObjectPropertyChanged Event

Description
Occurs when an object property is changed.

Syntax
Document_HMIObjectPropertyChanged(ByVal Property As
IHMIProperty, CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

Property (IHMIProperty)

Identifies the changed property.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output identifying the object property that
has been changed:
Private Sub Document_HMIObjectPropertyChanged(ByVal Property
As IHMIProperty, CancelForwarding As Boolean)
'VBA96
Dim strObjProp As String
Dim strObjName As String
Dim varPropValue As Variant
'
' " strObjProp " contains the name of the modified property
' " varPropValue " contains the new value
strObjProp = Property.Name
varPropValue = Property.value
'
' " strObjName " contains the name of the selected object,
'which property is modified
strObjName =
Property.Application.ActiveDocument.Selection(1).ObjectN
ame
MsgBox " The property " & strObjProp & " of object " &
strObjName & " is modified... " & vbCrLf & " The new
value is: " & varPropValue
End Sub

Printout of the Online Help
Automated Configuring

227

ActualPointTopIndex

5.4.2.4

11.05

HMIObjectResized Event

Description
Occurs when the size of an object is changed.

Syntax
Document_HMIObjectResized(ByVal HMIObject As IHMIObject,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

HMIObject (IHMIObject)

Identifies the object that is being resized.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output when an object has been resized:
Private Sub Document_HMIObjectResized(ByVal HMIObject As
IHMIObject, CancelForwarding As Boolean)
'VBA97
Dim strObjName As String
'
' " strObjName " contains the name of the modified object
strObjName = HMIObject.ObjectName
MsgBox " The size of " & strObjName & " was modified... "
End Sub

228

Printout of the Online Help
Automated Configuring

11.05

5.4.2.5

ActualPointTopIndex

LibraryFolderRenamed Event

Description
Occurs when a folder in the components library has been renamed.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_LibraryFolderRenamed(LibObject As
HMIFolderItem, OldName As String)

Parameter
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The renamed folder.

OldName (String)

The original name of the renamed folder.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the old and new folder names are output:
Private Sub objGDApplication_LibraryFolderRenamed(ByVal
LibObject As HMIFolderItem, ByVal OldName As String)
'VBA98
MsgBox " The Library-folder " & OldName & " is renamed
in: " & LibObject.DisplayName
End Sub

Printout of the Online Help
Automated Configuring

229

ActualPointTopIndex

5.4.2.6

11.05

LibraryObjectRenamed Event

Description
Occurs when an object in the components library has been renamed.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_LibraryObjectRenamed(LibObject As
HMIFolderItem, OldName As String)

Parameter
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The renamed object.

OldName (String)

The original name of the renamed object.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the old and new object names are output:
Private Sub objGDApplication_LibraryObjectRenamed(ByVal
LibObject As IHMIFolderItem, ByVal OldName As String)
'VBA99
MsgBox " The object " & OldName & " is renamed in: " &
LibObject.DisplayName
End Sub

230

Printout of the Online Help
Automated Configuring

11.05

5.4.2.7

ActualPointTopIndex

LibraryObjectAdded Event

Description
Occurs when an object has been added to the components library.

Syntax
HMIObjectPropertyChanged(ByVal Property As IHMIProperty,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

LibObject (IHMIFolderItem)

Identifies the library object.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output when an object has been added to
the components library:
Private Sub Document_LibraryObjectAdded(ByVal LibObject As
IHMIFolderItem, CancelForwarding As Boolean)
'VBA100
Dim strObjName As String
'
' " strObjName " contains the name of the added object
strObjName = LibObject.DisplayName
MsgBox " Object " & strObjName & " was added to the
picture. "
End Sub

Printout of the Online Help
Automated Configuring

231

ActualPointTopIndex

5.4.2.8

11.05

MenuItemClicked Event

Description
Occurs when an entry in a user-defined menu is clicked.
Note:
This event is both application-specific and document-specific.
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
Syntax
Document_MenuItemClicked(ByVal MenuItem As IHMIMenuItem)

Parameter
Parameter (Data Type)

Description

MenuItem (IHMIMenuItem)

Identifies the user-defined menu.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub

232

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

In the following example a message is output when the first entry in a user-defined
menu is clicked:
Private Sub Document_MenuItemClicked(ByVal MenuItem As
IHMIMenuItem)
'VBA101
Dim objMenuItem As HMIMenuItem
Dim varMenuItemKey As Variant
Set objMenuItem = MenuItem
'
' " objMenuItem " contains the clicked menu-item
' " varMenuItemKey " contains the value of parameter " Key "
'from the clicked userdefined menu-item
varMenuItemKey = objMenuItem.Key
Select Case MenuItemKey
Case " mItem1_1 "
MsgBox " The first menu-item was clicked! "
End Select
End Sub

Printout of the Online Help
Automated Configuring

233

ActualPointTopIndex

5.4.2.9

11.05

NewLibraryFolder Event

Description
Occurs when a folder has been created in the components library.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_NewLibraryFolder(LibObject As HMIFolderItem)

Parameter
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The newly created folder.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the new folder name is output:
Private Sub objGDApplication_NewLibraryFolder(ByVal LibObject
As IHMIFolderItem)
'VBA102
MsgBox " The library-folder " & LibObject.DisplayName & "
was added. "
End Sub

234

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.2.10 NewLibraryObject Event

Description
Occurs when an object has been created in the components library.

Syntax

Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
objGDApplication_NewLibraryObject(LibObject As HMIFolderItem)

Parameter
Parameter (Data Type)

Description

LibObject (HMIFolderItem)

The newly created object.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example the new object name is output:
Private Sub objGDApplication_NewLibraryObject(ByVal LibObject
As IHMIFolderItem)
'VBA103
MsgBox " The object " & LibObject.DisplayName & " was
added. "
End Sub

Printout of the Online Help
Automated Configuring

235

ActualPointTopIndex

11.05

5.4.2.11 Opened Event

Description
Occurs when a picture is opened.

Syntax
Document_Opened(CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output when the picture is opened:
Private Sub Document_Opened(CancelForwarding As Boolean)
'VBA104
MsgBox " The Document is open now... "
End Sub

236

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.2.12 Saved Event

Description
Occurs after a picture has been saved.

Syntax
Document_Saved(CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output when the picture has been saved:
Private Sub Document_Saved(CancelForwarding As Boolean)
'VBA105
MsgBox " The document is saved... "
End Sub

Printout of the Online Help
Automated Configuring

237

ActualPointTopIndex

11.05

5.4.2.13 SelectionChanged Event

Description
Occurs when the selection has been changed.

Syntax
Document_SelectionChanged(CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
In the following example a message is output when a new object has been
selected:
Private Sub Document_SelectionChanged(CancelForwarding As
Boolean)
'VBA106
MsgBox " The selection is changed... "
End Sub

238

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.4.2.14 Started Event

Description
Occurs when the Graphics Designer has been started.

Syntax
objGDApplication_Started()
Note:
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
& lt; & gt; In the following example, the name " objGDApplication " is substituted for Name.
Parameter
--

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output when the Graphics Designer has
been started:
Private Sub objGDApplication_Started()
'VBA107
'This event is raised before objGDApplication_Started()
MsgBox " The Graphics Designer is started! "
End Sub

Printout of the Online Help
Automated Configuring

239

ActualPointTopIndex

11.05

5.4.2.15 ToolbarItemClicked Event

Description
Occurs when an icon in a user-defined toolbar has been clicked
Note:
This event is both application-specific and document-specific.
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
Syntax
Document_ToolbarItemClicked(ByVal ToolbarItem As
IHMIToolbarItem)

Parameter
Parameter (Data Type)

Description

ToolbarItem (IHMIToolbarItem)

Identifies the icon.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub
In the following example a message is output when the first user-defined icon is
clicked:
Private Sub Document_ToolbarItemClicked(ByVal ToolbarItem As
IHMIToolbarItem)
'VBA108
Dim objToolbarItem As HMIToolbarItem
Dim varToolbarItemKey As Variant
Set objToolbarItem = ToolbarItem
'
' " varToolbarItemKey " contains the value of parameter
" Key "
'from the clicked userdefined toolbar-item

240

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

varToolbarItemKey = objToolbarItem.Key
'
Select Case varToolbarItemKey
Case " tItem1_1 "
MsgBox " The first Toolbar-Icon was clicked! "
End Select
End Sub

Printout of the Online Help
Automated Configuring

241

ActualPointTopIndex

11.05

5.4.2.16 ViewCreated Event

Description
Occurs when a copy of a picture has been created.
Note:
This event is both application-specific and document-specific.
To ensure that the application-specific event is available in the project, the
application must be made known to Graphics Designer. This is done by means of
the following statement:
Dim WithEvents & lt; Name & gt; As grafexe.Application
Syntax
Document_ViewCreated(ByVal pView As IHMIView,
CancelForwarding As Boolean)

Parameter
Parameter (Data Type)

Description

pView (IHMIView)

Identifies the copy of the picture.

CancelForwarding (Boolean)

TRUE if the event is not intended to be
forwarded. " Default setting is " False.

Example
Carry out the following procedure so that the example shown below will work:
Private Sub SetApplication()
'This procedure have to execute with " F5 " first
Set objGDApplication = grafexe.Application
End Sub

242

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

In the following example the number of copy pictures is output when a new copy of
the picture has been created.
Private Sub Document_ViewCreated(ByVal pView As IHMIView,
CancelForwarding As Boolean)
'VBA109
Dim iViewCount As Integer
'
'To read out the number of views
iViewCount =
pView.Application.ActiveDocument.Views.Count
MsgBox " A new copy of the picture (number " & iViewCount
& " ) was created. "
End Sub

Printout of the Online Help
Automated Configuring

243

ActualPointTopIndex

11.05

5.4.2.17 WindowStateChange Event

Description
Occurs when the window size is changed (e.g. from " Minimized " to " Maximized " ).

Syntax
objGDApplication_WindowStateChanged()

Parameter (Optional)
--

Example
In the following example a message is output when the window size is changed:
Private Sub objGDApplication_WindowStateChanged()
'VBA110
MsgBox " The state of the application-window is changed! "
End Sub

244

Printout of the Online Help
Automated Configuring

11.05

5.5

ActualPointTopIndex

Methods

5.5.1

VBA Methods: A-C

5.5.1.1

Activate Method

Description
Activates the specified object.

Syntax
Expression.Activate()
Expression
Required. An expression or element which returns an object of the " Application " or
" View " type.

Parameter
--

Example
In the following example a copy of the active picture is created and then activated:
Sub CreateAndActivateView()
'VBA111
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

Printout of the Online Help
Automated Configuring

245

ActualPointTopIndex

5.5.1.2

11.05

Add Method

Description
Adds another element to a listing.
The following table shows you the listings to which the Add method can be applied.
The parameters and syntax for the respective Add methods can be found under
" Methods " .
Listing
AnalogResultInfos Listing

Adds a new, analog value range in the
Dynamic dialog.

Documents Listing

Creates a new picture in the Graphics
Designer

GroupedObjects Listing

Adds a new object to a group object.

Toolbars Listing

Creates a new, user-defined toolbar.

VariableTriggers Listing

Creates a new tag trigger.

Views Listing

246

Application for the Add Method

Creates a copy of the specified picture.

Printout of the Online Help
Automated Configuring

11.05

5.5.1.3

ActualPointTopIndex

Add Method (AnalogResultInfos Listing)

Description
Adds a new, analog value range in the Dynamic dialog.

Syntax
Expression.Add(RangeTo, ResultValue)
Expression
Required. An expression or element which returns an object of the
" AnalogResultInfos " type.

Parameter
Parameter (Data Type)

Description

RangeTo (Variant)

The value range to which the change of property
gives rise.

ResultValue (Variant)

The value to which the object property is
assigned when the value range is reached.

Printout of the Online Help
Automated Configuring

247

ActualPointTopIndex

11.05

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. In the following example a tag name is assigned and three analog
value ranges are created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA112
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.Add 50, 40
.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
End With
End Sub
The diagram shows the Dynamic dialog after the procedure has been carried out:

248

Printout of the Online Help
Automated Configuring

11.05

5.5.1.4

ActualPointTopIndex

Add Method (Documents Listing)

Description
Creates a new picture in the Graphics Designer

Syntax
Expression.Add [HMIOpenDocumentType]
Expression
Required. An expression or element which returns an object of the " Documents "
type.

Parameter
Parameter (Data Type)

Description

HMIOpenDocumentType
(HMIDocumentType)

Defines how the picture will be opened:
HMIDocumentTypeVisible: Opens the picture for
direct processing. This is the default setting if you do
not specify the parameter.
HMIDocumentTypeInvisible: Opens the picture in
invisible mode, i.e. it is not displayed in the Graphics
Designer. You can only address the picture via the
Documents listing, and make it visible again by means
of the Hide property.

Example
In the following example a new picture is created in the Graphics Designer:
Sub AddNewDocument()
'VBA113
Application.Documents.Add hmiDocumentTypeVisible
End Sub

Printout of the Online Help
Automated Configuring

249

ActualPointTopIndex

5.5.1.5

11.05

Add Method (GroupedObjects Listing)

Description
Adds an existing object to the specified group object.

Syntax
Expression.Add(Index)
Expression
Required. An expression or element which returns an object of the
" GroupedObjects " type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

The object that is intended to be added. You can
use either the index number or the object name.

Example
In this example the group object " My Group " is created from a number of objects.
An ellipse segment is then added to the group object:
Sub CreateGroup()
'VBA114
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipseSegment As HMIEllipseSegment
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle

250

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
'Set name for new group-object
'The name identifies the group-object
objGroup.ObjectName = " My Group "
'Add new object to active document...
Set objEllipseSegment =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseSegment " ,
" HMIEllipseSegment " )
Set objGroup = ActiveDocument.HMIObjects( " My Group " )
'...and add it to the group:
objGroup.GroupedHMIObjects.Add ( " EllipseSegment " )
End Sub

Printout of the Online Help
Automated Configuring

251

ActualPointTopIndex

5.5.1.6

11.05

Add Method (CustomToolbars Listing)

Description
Creates a new, user-defined toolbar. There is a difference between applicationspecific and picture-specific user-defined toolbars:


Application-specific toolbar: This is linked to the Graphics Designer and is also
only visible when all the pictures in the Graphics Designer are closed. Place
the VBA code in the document called " GlobalTemplateDocument " or
" ProjectTemplateDocument " and use the " Application " property.



Picture-specific toolbar: This is linked to a particular picture and remains visible
all the time the picture is active. Place the VBA code in the document called
" ThisDocument " for the desired picture and use the " ActiveDocument "
property.

Syntax
Expression.Add(Key)
Expression
Required. An expression or element which returns an object of the
" CustomToolbars " type.

Parameter
Parameter (Data Type)

Description

Key (Variant)

Identifies the user-defined toolbar. Use unique
names for " Key " (e.g. " DocToolbar1 " )

Example
In the following example a user-defined toolbar with two icons is created in the
active picture. These icons are separated by a dividing line:
Sub AddDocumentSpecificCustomToolbar()
'VBA115
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " DocToolbar " )
'Add toolbar-items to the userdefined toolbar

252

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " tItem1_1 " ,
" Mein erstes Symbol-Icon " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(3, " tItem1_3 " ,
" Mein zweites Symbol-Icon " )
'
'Insert seperatorline between the two tollbaritems
Set objToolbarItem =
objToolbar.ToolbarItems.InsertSeparator(2,
" tSeparator1_2 " )
End Sub

Printout of the Online Help
Automated Configuring

253

ActualPointTopIndex

5.5.1.7

11.05

Add Method (VariableTriggers Listing)

Description
Creates a new tag trigger.
Syntax
Expression.Add(VarName, Type)
Expression
Required. An expression or element which returns an object of the
" VariableTriggers " type.
Parameter
Parameter (Data Type)

Description

VarName (String)

The name of the tag that is intended to be used as a
trigger. Please note that you have to create the tag in
the Tag Selection dialog.

Type (CycleType)

This is the cycle type. Select the cycle type from a list
in the VBA Editor when you use this method.

Example
In the following example the radius of a circle is made dynamic using a trigger tag:
Sub DynamicWithVariableTriggerCycle()
'VBA69
Dim objVBScript As HMIScriptInfo
Dim objVarTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VariableT
rigger " , " HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
Set objVarTrigger =
.Trigger.VariableTriggers.Add( " VarTrigger " ,
hmiVariableCycleType_10s)
.SourceCode = " "
End With
End Sub

254

Printout of the Online Help
Automated Configuring

11.05

5.5.1.8

ActualPointTopIndex

Add Method (Views Listing)

Description
Creates a copy of the specified picture.

Syntax
Expression.Add()
Expression
Required. An expression or element which returns an object of the " Views " type.

Parameter
--

Example
In the following example a copy of the active picture is created and then activated:
Sub CreateViewAndActivateView()
'VBA117
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

Printout of the Online Help
Automated Configuring

255

ActualPointTopIndex

5.5.1.9

11.05

AddAction Method

Description
Configures an action on an object or property. This action is triggered when a
defined event occurs.
Syntax
Expression.Methode(HMIActionCreationType)
Expression
Required. An expression or element which returns an object of the " Actions " type.

Parameter
Parameter (Data Type)

Description

HMIActionCreationType
(Variant)

Defines the action:
hmiActionCreationTypeCScript: Configures a C
action
hmiActionCreationTypeCScript: Configures a VBS
action
hmiActionCreationTypeDirectConnection:
Configures a direct connection

Example
In the following example a VBS action for changing the radius of a circle is
configured:
Sub AddActionToPropertyTypeVBScript()
'VBA118
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
'Create circle in picture. By changing of property
" Radius "
'a VBS-action will be started:
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
Set objEvent = objCircle.Radius.Events(1)
Set objVBScript =
objEvent.Actions.AddAction(hmiActionCreationTypeVBScript
)
End Sub

256

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.10 AddActiveXControl Method

Description
Adds a new ActiveXControl object to the " HMIObjects " listing. The object is
inserted in the upper left corner of the specified picture.

Syntax
Expression.AddActiveXControl( " ObjectName " , " ProgID " )
Expression
Required. An expression or element which returns an object of the " HMIObjects "
type.

Parameter
Parameter (Data Type)

Description

ObjectName (String)

The name of the object. You can address the object
by its name in a listing.

ProgID (String)

The ActiveX Control that is to be inserted.

Printout of the Online Help
Automated Configuring

257

ActualPointTopIndex

11.05

Determining the ProgID
To determine the ProgID for an ActiveX Control supplied by WinCC, go to the
" Object Palette " in the Graphics Designer, right click on the desired ActiveX Control
on the Controls tab, and select the command " Add/Remove " from the pop-up
menu:

258

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

To determine the ProgID for a standard ActiveX Control, go to the " Object Palette "
in the Graphics Designer and insert the control object in your picture on the Default
tab under " Smart Objects " . The " Insert a Control " dialog displays the path and
ProgID for a selected ActiveX Control:

Example
In the following example the ActiveX Control " WinCC Gauge Control " is inserted in
the active picture.
Sub AddActiveXControl()
'VBA119
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
" , " XGAUGE.XGaugeCtrl.1 " )
With ActiveDocument
.HMIObjects( " WinCC_Gauge " ).Top = 40
.HMIObjects( " WinCC_Gauge " ).Left = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

259

ActualPointTopIndex

11.05

5.5.1.11 AddFolder Method

Description
Creates a new folder in the components library. The FolderItem object of the
" Folder " type is added to the FolderItems listing.
The new folder created in this way receives the internal name " FolderX " , where " X "
stands for a consecutive number, starting with 1. Use the internal name to address
the folder in the FolderItems list.

Syntax
Expression.AddFolder(DefaultName)
Expression
Required. An expression or element which returns an object of the " FolderItems "
type.

Parameter
Parameter (Data Type)

Description

DefaultName (String)

The name of the folder that is to be created.

Example
In the following example the folder " My Folder " will be created in the " Project
Library " :
Sub AddNewFolderToProjectLibrary()
'VBA120
Dim objProjectLib As HMISymbolLibrary
Set objProjectLib = Application.SymbolLibraries(2)
objProjectLib.FolderItems.AddFolder ( " My Folder " )
End Sub

260

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.12 AddFromClipboard Method

Description
Copies an object from the clipboard into a folder in the Components Library. The
FolderItem object of the " Item " type is added to the FolderItems listing.
Note:
The clipboard must contain objects from the Graphics Designer. Other contents
(such as ASCII text) will not be pasted.
Syntax
Expression.AddFromClipboard(DefaultName)
Expression
Required. An expression or element which returns an object of the " FolderItems "
type.

Parameter
Parameter (Data Type)

Description

DefaultName (String)

The name to be given to the object pasted into
the components library.

Example
In the following example the object " PC " from the " Global Library " will be copied
into the folder " My Folder " in the " Project Library " :
Sub CopyObjectFromGlobalLibraryToProjectLibrary()
'VBA121
Dim objGlobalLib As HMISymbolLibrary
Dim objProjectLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
Set objProjectLib = Application.SymbolLibraries(2)
objProjectLib.FolderItems.AddFolder ( " My Folder3 " )
'
'copy object from " Global Library " to clipboard
With objGlobalLib
.FolderItems(2).Folder.Item(2).Folder.Item(1).CopyT
oClipboard
End With
'

Printout of the Online Help
Automated Configuring

261

ActualPointTopIndex

11.05

'paste object from clipboard into " Project Library "
objProjectLib.FolderItems(objProjectLib.FindByDisplayNam
e( " My Folder3 " ).Name).Folder.AddFromClipBoard ( " Copy of
PC/PLC " )
End Sub

262

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.13 AddHMIObject Method

Description
Adds a new standard, smart or Windows object to the " HMIObjects " listing. The
object is inserted in the upper left corner of the specified picture.
Note:
Use the AddActiveXControl method to insert an ActiveXControl.
Use the AddOLEObject method to insert an OLE object.
Syntax
Expression.AddHMIObject( " ObjectName " , " ProgID " )
Expression
Required. An expression or element which returns an object of the " HMIObjects "
type.

Parameter
Parameter (Data Type)

Description

ObjectName (String)

The name of the object. You can address the object
by its name in a listing.

ProgID (String)

The object type that is to be inserted. Obtain the
" ProgID " by prefixing the VBA object name with " HMI "
(e.g. " HMICircle " or " HMIRectangle " )

Example
In the following example a circle will be inserted into the active picture and its
background color set to " Red " :
Sub AddCircleToActiveDocument()
'VBA122
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " VBA_Circle " ,
" HMICircle " )
objCircle.BackColor = RGB(255, 0, 0)
End Sub

Printout of the Online Help
Automated Configuring

263

ActualPointTopIndex

11.05

5.5.1.14 AddItem Method

Description
Copies an object from the specified picture into a folder in the Components Library.
" The FolderItem object of the " Item type is added to the FolderItems listing.

Syntax
Expression.AddFolder(DefaultName, pHMIObject)
Expression
Required. An expression or element which returns an object of the " FolderItems "
type.

Parameter
Parameter (Data Type)

Description

DefaultName (String)

The name to be given to the object pasted into the
components library.

pHMIObject (HMIObject)

The object that is to be inserted into the
Components Library from the specified picture.

Example
In the following example a circle will be copied into the " Project Library " . For this
purpose the circle will be pasted into the active picture and the folder " My Folder 2 "
will be created in the " Project Library " :
Sub AddObjectFromPictureToProjectLibrary()
'VBA123
Dim objProjectLib As HMISymbolLibrary
Dim objCircle As HMICircle
Set objProjectLib = Application.SymbolLibraries(2)
objProjectLib.FolderItems.AddFolder ( " My Folder2 " )
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle " ,
" HMICircle " )
'
'Add object " Circle " to " Project Library " :
objProjectLib.FolderItems(objProjectLib.FindByDisplayNam
e( " My Folder2 " )).Folder.AddItem " ProjectLib Circle " ,
ActiveDocument.HMIObjects( " Circle " )
End Sub

264

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.15 AddOLEObject Method

Description
Adds a new OLE object to the " HMIObjects " listing. The object is inserted in the
upper left corner of the specified picture.

Syntax
Expression.AddOLEObject(ObjectName, ServerName,
[CreationType], [UseSymbol])
Expression
Required. An expression or element which returns an object of the " HMIObjects "
type.

Parameter
Parameter (data type)

Description

ObjectName (String)

The name of the object. You can address the
object by its name in a listing.

ServerName (String)

The name of the application which is to contain
the OLE object, or the file name complete with
path. The value for " ServerName " corresponds to
the " Object Type " in the " Insert Object " dialog:

CreationType
Defines whether the OLE object will be newly
(HMIOLEObjectCreationType-) created or an existing file will be used:
HMIOLEObjectCreationTypeDirect: Corresponds
to setting " Create New " . This setting is used if
you do not specify the parameter.
HMIOLEObjectCreationTypeByLink:
Corresponds to setting " Create from File " . This
creates a copy of the file. Any changes made to
the OLE object have no effect on the original file.
Assign a name to the file via the " ServerName "
parameter.
HMIOLEObjectCreationTypeByLinkWithReferenc
e: Same as above, except that changes in OLE
object affect the original file. Assign a name to
the file via the " ServerName " parameter.

Printout of the Online Help
Automated Configuring

265

ActualPointTopIndex

11.05

Parameter (data type)

Description

UseSymbol (Boolean)

TRUE if the standard icon for the file type is to be
used. Double clicking on the icon then opens the
associated application. The default setting for this
parameter is FALSE.

Example
In the following example, an OLE object containing a Wordpad document will be
inserted into the active picture:
Sub AddOLEObjectToActiveDocument()
'VBA124
Dim objOLEObject As HMIOLEObject
Set objOLEObject =
ActiveDocument.HMIObjects.AddOLEObject( " MS Wordpad
Document " , " Wordpad.Document.1 " )
End Sub
In the following example, the AddOLEObject method will be used and the
" HMIOLEObjectCreationTypeByLink " parameter will be specified:
Sub AddOLEObjectByLink()
'VBA805
Dim objOLEObject As HMIOLEObject
Dim strFilename As String
'
'Add OLEObject by filename. In this case, the filename
has to
'contain filename and path.
'Replace the definition of strFilename with a filename
with path
'existing on your system
strFilename = Application.ApplicationDataPath &
" Test.bmp "
Set objOLEObject =
ActiveDocument.HMIObjects.AddOLEObject( " OLEObject1 " ,
strFilename, hmiOLEObjectCreationTypeByLink, False)
End Sub
In the following example, the AddOLEObject method will be used and the
" HMIOLEObjectCreationTypeByLinkWithReference " parameter will be specified:
Sub AddOLEObjectByLinkWithReference()
'VBA806
Dim objOLEObject As HMIOLEObject
Dim strFilename As String
'

266

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Add OLEObject by filename. In this case, the filename
has to
'contain filename and path.
'Replace the definition of strFilename with a filename
with path
'existing on your system
strFilename = Application.ApplicationDataPath &
" Test.bmp "
Set objOLEObject =
ActiveDocument.HMIObjects.AddOLEObject( " OLEObject1 " ,
strFilename,
hmiOLEObjectCreationTypeByLinkWithReference, True)
End Sub

Printout of the Online Help
Automated Configuring

267

ActualPointTopIndex

11.05

5.5.1.16 AlignBottom Method

Description
Aligns the objects selected in the specified picture with the bottom. In so doing the
alignment is oriented on the first object that you select.
Syntax
Expression.AlignBottom()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
--

Example
In the following example two objects are inserted at different positions in the
current picture and then aligned with the bottom:
Sub AlignSelectedObjectsBottom()
'VBA125
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.AlignBottom
End Sub

268

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.17 AlignLeft Method

Description
Left-justifies the objects selected in the specified picture. In so doing the alignment
is oriented on the first object that you select.
Syntax
Expression.AlignLeft()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
--

Example
In the following example two objects are inserted at different positions in the
current picture and then aligned to the left:
Sub AlignSelectedObjectsLeft()
'VBA126
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.AlignLeft
End Sub

Printout of the Online Help
Automated Configuring

269

ActualPointTopIndex

11.05

5.5.1.18 AlignRight Method

Description
Right-justifies the objects selected in the specified picture. In so doing the
alignment is oriented on the first object that you select.
Syntax
Expression.AlignRight()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
--

Example
In the following example two objects are inserted at different positions in the
current picture and then aligned to the right:
Sub AlignSelectedObjectsRight()
'VBA127
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.AlignRight
End Sub

270

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.19 AlignTop Method

Description
Aligns the objects selected in the specified picture with the top. In so doing the
alignment is oriented on the first object that you select.
Syntax
Expression.AlignTop()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and then aligned with the top:
Sub AlignSelectedObjectsTop()
'VBA128
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.AlignTop
End Sub

Printout of the Online Help
Automated Configuring

271

ActualPointTopIndex

11.05

5.5.1.20 ArrangeMinimizedWindows Method

Description
Arranges all minimized pictures on the lower margin of the Graphics Designer.

Syntax
Expression.ArrangeMinimizedWindows()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example all minimized pictures are arranged on the lower margin of
the Graphics Designer. For this example to work, you must have minimized a
number of pictures in the Graphics Designer:
Sub ArrangeMinimizedWindows()
'VBA129
Application.ArrangeMinimizedWindows
End Sub

272

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.21 CascadeWindows Method

Description
Arranges all open pictures in the Graphics Designer in a cascade (i.e. overlapping).

Syntax
Expression.Methode(Parameter)
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example all open pictures in the Graphics Designer are arranged in
a cascade. For this example to work, you must have opened a number of pictures
in the Graphics Designer:
Sub CascadeWindows()
'VBA130
Application.CascadeWindows
End Sub

Printout of the Online Help
Automated Configuring

273

ActualPointTopIndex

11.05

5.5.1.22 CenterHorizontally Method

Description
Using this method, the objects selected in the specified picture are centered
horizontally.
Syntax
Expression.CenterHorizontally()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and then centered horizontally:
Sub CenterSelectedObjectsHorizontally()
'VBA131
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.CenterHorizontally
End Sub

274

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.23 CenterVertically Method

Description
Using this method, the objects selected in the specified picture are centered
vertically.
Syntax
Expression.CenterVertically()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and then centered vertically:
Sub CenterSelectedObjectsVertically()
'VBA132
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.CenterVertically
End Sub

Printout of the Online Help
Automated Configuring

275

ActualPointTopIndex

11.05

5.5.1.24 CheckSyntax Method

Description
Checks whether the syntax of the specified C script is correct.
Use the CheckSyntax method in conjunction with the Compiled Property.

Syntax
Expression.CheckSyntax(CheckOK, Error)
Expression
Required. An expression or element which returns an object of the
" DynamicDialog " type.

Parameter
Parameter (Data Type)

Description

CheckOK (Boolean)

TRUE if the syntax of the specified C script is
correct.

Error (String)

The message text that is output if the C script is
incorrect.

Example
--

276

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.25 Close Method

Description
Closes the specified picture and removes it from the document listing.
Note:
Changes that have not been saved will be lost.
Syntax 1
Expression.Close(FileName)
Expression
Required. An expression or element which returns an object of the " Documents "
type.

Syntax 2
Expression.Close()
Expression
Required. An expression or element which returns an object of the " Document "
type.
Parameter
Parameter (Data Type)

Description

FileName (String)

The name of the PDL file to be closed.

Example
In the following example the picture " Test.PDL " will be closed. For this example to
work, you must have opened the picture " Test.PDL " :
Sub CloseDocumentUsingTheFileName()
'VBA134
Dim strFile As String
strFile = Application.ApplicationDataPath & " test.pdl "
Application.Documents.Close (strFile)
End Sub
In the following example the active picture in the Graphics Designer will be closed:
Sub CloseDocumentUsingActiveDocument()
'VBA135
ActiveDocument.Close
End Sub

Printout of the Online Help
Automated Configuring

277

ActualPointTopIndex

11.05

5.5.1.26 CloseAll Method

Description
Closes all the pictures opened in the Graphics Designer and removes them from
the documents listing.
Note:
Changes that have not been saved will be lost.
Syntax
Expression.CloseAll()
Expression
Required. An expression or element which returns an object of the " Documents "
type.

Parameter
--

Example
In the following example all open pictures in the Graphics Designer are closed:
Sub CloseAllDocuments()
'VBA136
Application.Documents.CloseAll
End Sub

278

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.27 ConvertToScript Method

Description
Converts the specified Dynamic dialog into a C script.
On conversion the associated DynamicDialog object is deleted.
Note:
You cannot undo the conversion.
Syntax
Expression.ConvertToScript()
Expression
Required. An expression or element which returns an object of the
" DynamicDialog " type.

Parameter
--

Example
In the following example a circle will be inserted into the active picture and its
radius will be dynamically configured using the Dynamic dialog. The Dynamic
dialog will then be converted into a C script.
Sub ConvertDynamicDialogToScript()
'VBA137
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
'
'Create dynamic
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
'
'configure dynamic. " ResultType " defines the valuerangetype:
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.Add 50, 40

Printout of the Online Help
Automated Configuring

279

ActualPointTopIndex

11.05

.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
MsgBox " The dynamic-dialog will be changed into a Cscript. "
.ConvertToScript
End With
End Sub

280

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.28 CopySelection Method

Description
Using this method, the objects selected in the picture are copied to the clipboard.

Syntax
Expression.CopySelection()
Expression
Required. An expression or element which returns an object of the " Document " or
" Selection " type.

Parameter
--

Example
In the following example two of the objects inserted in the active picture are
selected. The selection is copied and pasted to a new picture:
Sub CopySelectionToNewDocument()
'VBA138
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim iNewDoc As Integer
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "

Printout of the Online Help
Automated Configuring

281

ActualPointTopIndex

11.05

'Instead of " ActiveDocument.CopySelection " you can also
write:
' " ActiveDocument.Selection.CopySelection " .
ActiveDocument.CopySelection
Application.Documents.Add hmiDocumentTypeVisible
iNewDoc = Application.Documents.Count
Application.Documents(iNewDoc).PasteClipboard
End Sub

282

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.1.29 CopyToClipboard Method

Description
Copies an object from a folder in the Components Library to the clipboard.

Syntax
Expression.CopyToClipboard()
Expression
Required. An expression or element which returns a FolderItem object of the " Item "
type.

Parameter
--

Example
In the following example the object " PC " from the " Global Library " will be copied
into the folder " My Folder3 " in the " Project Library " :
Sub CopyObjectFromGlobalLibraryToProjectLibrary()
'VBA139
Dim objGlobalLib As HMISymbolLibrary
Dim objProjectLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
Set objProjectLib = Application.SymbolLibraries(2)
objProjectLib.FolderItems.AddFolder ( " My Folder3 " )
'
'copy object from " Global Library " to clipboard
With objGlobalLib
.FolderItems(2).Folder.Item(2).Folder.Item(1).CopyT
oClipboard
End With
'
'paste object from clipboard into " Project Library "
objProjectLib.FolderItems(objProjectLib.FindByDisplayNam
e( " My Folder3 " )).Folder.AddFromClipBoard ( " Copy of
PC/PLC " )
End Sub

Printout of the Online Help
Automated Configuring

283

ActualPointTopIndex

11.05

5.5.1.30 CreateCustomizedObject Method

Description
Creates a customized object from the objects selected in the specified picture. You
then have to configure the customized object in the " Configuration Dialog " .
For further information on this topic please refer to " Customized Objects " in this
documentation and " Customized Object " in the WinCC documentation.

Syntax
Expression.CreateCustomizedObject()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects are inserted at different positions in the
current picture and a customized object is then created:
Sub CreateCustomizedObject()
'VBA140
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objCustObject As HMICustomizedObject
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True

284

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End With
MsgBox " Objects selected! "
Set objCustObject =
ActiveDocument.Selection.CreateCustomizedObject
objCustObject.ObjectName = " myCustomizedObject "
End Sub

Printout of the Online Help
Automated Configuring

285

ActualPointTopIndex

11.05

5.5.1.31 CreateDynamic Method

Description
Makes the specified property dynamic.

Syntax
Expression.CreateDynamic(DynamicType, [SourceCode])
Expression
Required. An expression or element which returns an object of the " Property " type.

Parameter
You only need use the " SourceCode " parameter if you want to make the specified
property dynamic with the aid of the Dynamic dialog.
In all other types of dynamics you can omit the parameter.
Parameter (Data Type)

Description

DynamicType (HMIDynamicCreationType) Defines the type of dynamics:
hmiDynamicCreationTypeVariableDire
ct: Dynamics with the aid of a tag.
hmiDynamicCreationTypeVariableIndi
rect: Dynamics with the aid of a tag. In
this type of dynamics you specify only
the name of the tag whose value will
be used for dynamic purposes.
hmiDynamicCreationTypeScript:
Dynamics with the aid of a script (C,
VB).
hmiDynamicCreationTypeDynamicDia
log: Dynamics with the aid of the
Dynamic dialog.
SourceCode (String)

Defines the function or tag that will be
used for dynamic purposes.
Also specify the tag name in single
quote marks: " 'Tag Name' "

286

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
In this example a circle property " Top " will be made dynamic with the aid of the tag
" NewDynamic " :
Sub AddDynamicAsVariableDirectToProperty()
'VBA141
Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " MyCircle " ,
" HMICircle " )
'Make property " Top " dynamic:
Set objVariableTrigger =
objCircle.Top.CreateDynamic(hmiDynamicCreationTypeVariab
leDirect, " NewDynamic " )
'
'Define cycle-time
With objVariableTrigger
.CycleType = hmiCycleType_2s
End With
End Sub

Printout of the Online Help
Automated Configuring

287

ActualPointTopIndex

11.05

5.5.1.32 CreateGroup Method

Description
Creates a group object from the objects selected in the specified picture.
For further information on this topic please refer to " Group Objects " in this
documentation and " Group Object " in the WinCC documentation.

Syntax
Expression.CreateGroup()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects are inserted at different positions in the
current picture and a group object is then created:
Sub CreateGroup()
'VBA142
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With

288

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
objGroup.ObjectName = " myGroup "
End Sub

Printout of the Online Help
Automated Configuring

289

ActualPointTopIndex

5.5.2

11.05

VBA Methods: D-M

5.5.2.1

Delete Method

Description
Deletes the specified object and removes it from the listing.

Syntax
Expression.Delete()
Expression
Required. An expression or element which returns objects of the following types.


Assignment



FolderItem



LanguageText



Menu



MenuItem



Object



Toolbar



ToolbarItem



VariableTrigger



View

Parameter
--

Example
In the following example the first object in the active picture will be deleted. For this
example to work, you must have created at least one object in the active picture:
Sub ObjectDelete()
'VBA143
ActiveDocument.HMIObjects(1).Delete
End Sub

290

Printout of the Online Help
Automated Configuring

11.05

5.5.2.2

ActualPointTopIndex

DeleteAll Method

Description
Deletes all selected objects in the specified picture and removes them from the
" Selection " and " HMIObjects " listings.
Syntax
Expression.DeleteAll()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and then selected and deleted:
Sub DeleteAllSelectedObjects()
'VBA145
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.DeleteAll
End Sub

Printout of the Online Help
Automated Configuring

291

ActualPointTopIndex

5.5.2.3

11.05

DeleteDynamic Method

Description
Removes the dynamic characteristic from the specified property.

Syntax
Expression.DeleteDynamic
Expression
Required. An expression or element which returns an object of the " Property " type.

Parameter
--

Example
In the following example the dynamic characteristic created with the aid of the
CreateDynamic Method will be deleted:
Sub DeleteDynamicFromObjectMeinKreis()
'VBA146
Dim objCircle As HMICircle
Set objCircle = ActiveDocument.HMIObjects( " MyCircle " )
objCircle.Top.DeleteDynamic
End Sub

292

Printout of the Online Help
Automated Configuring

11.05

5.5.2.4

ActualPointTopIndex

DeselectAll Method

Description
Deselects all selected objects in the specified picture and removes them from the
Selection listing.
Syntax
Expression.DeselectAll()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and selected. All selected objects are then deselected:
Sub SelectObjectsAndDeselectThemAgain()
'VBA147
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects created and selected! "
ActiveDocument.Selection.DeselectAll
MsgBox " Objects deselected! "
End Sub

Printout of the Online Help
Automated Configuring

293

ActualPointTopIndex

5.5.2.5

11.05

Destroy Method

Description
Destroys the specified customized object. Objects remain intact.

Syntax
Expression.Destroy()
Expression
An expression or element which returns objects of the " CustomizedObject " types.

Parameter
--

Example
An example showing how to use the Destroy Method can be found in this
documentation under the heading " Editing a Customized Object with VBA " .

294

Printout of the Online Help
Automated Configuring

11.05

5.5.2.6

ActualPointTopIndex

DuplicateSelection Method

Description
Duplicates the objects selected in the specified picture. The objects created in this
way are added to the HMIObjects listing. The names of new objects are numbered
consecutively with each duplication.
For instance if you duplicate an object called " Circle " , the duplicate object is called
" Circle1 " . If you duplicate the object called " Circle " once more, the resulting object
is called " Circle2 " and so on.

Syntax
Expression.DuplicateSelection()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
-Example
In the following example two objects are inserted at different positions in the
current picture and selected. They are then duplicated:
Sub DuplicateSelectedObjects()
'VBA149
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With

Printout of the Online Help
Automated Configuring

295

ActualPointTopIndex

11.05

MsgBox " Objects created and selected! "
ActiveDocument.Selection.DuplicateSelection
End Sub

296

Printout of the Online Help
Automated Configuring

11.05

5.5.2.7

ActualPointTopIndex

EvenlySpaceHorizontally Method

Description
Using this method, the objects selected in the specified picture are spaced
horizontally at an even distance from one another.

Syntax
Expression.EvenlySpaceHorizontally()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects are inserted at different positions in the
current picture and selected. They are then positioned horizontally at an even
distance from one another:
Sub EvenlySpaceObjectsHorizontally()
'VBA150
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 42

Printout of the Online Help
Automated Configuring

297

ActualPointTopIndex

11.05

.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects created and selected! "
ActiveDocument.Selection.EvenlySpaceHorizontally
End Sub

298

Printout of the Online Help
Automated Configuring

11.05

5.5.2.8

ActualPointTopIndex

EvenlySpaceVertically Method

Description
Using this method, the objects selected in the specified picture are spaced
vertically at an even distance from one another.

Syntax
Expression.EvenlySpaceVertically()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects are inserted at different positions in the
current picture and selected. They are then positioned vertically at an even
distance from one another:
Sub EvenlySpaceObjectsVertically()
'VBA151
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 42

Printout of the Online Help
Automated Configuring

299

ActualPointTopIndex

11.05

.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects created and selected "
ActiveDocument.Selection.EvenlySpaceVertically
End Sub

300

Printout of the Online Help
Automated Configuring

11.05

5.5.2.9

ActualPointTopIndex

Export Method

Description
Saves the specified picture as an EMF or SVG file.

Syntax
Expression.Methode(Type, Path)
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
Parameter (Data Type)

Description

Type (HMIImportExportType)

Defines the format in which the exported picture
will be saved.

Path (String)

The path in which the picture is going to be
exported. The path must exist.

Example
--

Printout of the Online Help
Automated Configuring

301

ActualPointTopIndex

11.05

5.5.2.10 Find Method

Description
Searches for objects in the specified picture and returns the search result as a
collection object. You can search for the following object properties:


Type



Name



Property

Syntax
Expression.Find([ObjectType], [ObjectName], [PropertyName])
Expression
Required. An expression or element which returns an object of the " HMIObjects "
type.

Parameter
You must specify at least one of the three parameters.
Parameter (Data Type)
ObjectType (String)

The object type that is to be searched for. Specify the
" ProgID " of the object concerned. Obtain the " ProgID "
by prefixing the VBA object name with " HMI " (e.g.
" HMICircle " or " HMIRectangle " )

ObjectName (String)

The name of the object that is to be searched for. You
can use wildcards (?, *) in the object name in order to
find objects with similar names.

PropertyName (String)

302

Description

The name of the object property that is to be searched
for. Specify the VBA property name concerned (e.g.
" BackColor " in place of " Background Color " ).

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
In the following example objects of the " HMICircle " type will be searched for in the
active picture and the search result will be output:
Sub FindObjectsByType()
'VBA153
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
Set colSearchResults =
ActiveDocument.HMIObjects.Find(ObjectType:= " HMICircle " )
For Each objMember In colSearchResults
iResult = colSearchResults.Count
strName = objMember.ObjectName
MsgBox " Found: " & CStr(iResult) & vbCrLf &
" objectname: " & strName)
Next objMember
End Sub
Note:
Further information on using the Find Method can be found in this documentation
under the heading " Editing Standard Objects, Smart Objects and Windows
Objects " .

Printout of the Online Help
Automated Configuring

303

ActualPointTopIndex

11.05

5.5.2.11 FindByDisplayName Method

Description
Searches the entire Components Library for the specified object. A FolderItem
object is returned as the search result.
Note:
The display name of the object is language-dependent. Only the language
currently set will be taken into account when searching. The search ends with the
first object found.
Syntax
Expression.FindByDisplayName(DisplayName)
Expression
Required. An expression or element which returns an object of the " SymbolLibrary "
type or the " FolderItems " listing.

Parameter
Parameter (Data Type)

Description

DisplayName (String)

The display name of the object that is to be
searched for in the Components Library.

Example
In the following example the entire library will be searched for the object " PC " and
its display name will be output:
Sub FindObjectInSymbolLibrary()
'VBA154
Dim objGlobalLib As HMISymbolLibrary
Dim objFItem As HMIFolderItem
Set objGlobalLib = Application.SymbolLibraries(1)
Set objFItem = objGlobalLib.FindByDisplayName( " PC " )
MsgBox objFItem.DisplayName
End Sub

304

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.12 FlipHorizontally Method

Description
Mirrors the selected objects in the specified picture along the horizontal midline.
The object type determines whether it is allowed to be mirrored (for instance an
OLE object cannot be mirrored). The properties are appropriately modified when
mirroring is performed. For example, if you mirror an object of the " StaticText " type
along the horizontal midline, the value of the " AlignmentTop " property changes
from " 0 " to " 2 " .

Syntax
Expression.FlipHorizontally()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example a StaticText object will be inserted into the active picture
and mirrored along the horizontal midline:
Sub FlipObjectHorizontally()
'VBA155
Dim objStaticText As HMIStaticText
Dim strPropertyName As String
Dim iPropertyValue As Integer
Set objStaticText =
ActiveDocument.HMIObjects.AddHMIObject( " Textfield " ,
" HMIStaticText " )
strPropertyName = objStaticText.Properties( " Text " ).Name
With objStaticText
.Width = 120
.Text = " Sample Text "
.Selected = True
iPropertyValue = .AlignmentTop
MsgBox " Value of ' " & strPropertyName & " ' before
flip: " & iPropertyValue
ActiveDocument.Selection.FlipHorizontally
iPropertyValue = objStaticText.AlignmentTop

Printout of the Online Help
Automated Configuring

305

ActualPointTopIndex

11.05

MsgBox " Value of ' " & strPropertyName & " ' after
flip: " & iPropertyValue
End With
End Sub

306

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.13 FlipVertically Method

Description
Mirrors the selected objects in the specified picture along the vertical midline.
The object type determines whether it is allowed to be mirrored (for instance an
OLE object cannot be mirrored). The properties are appropriately modified when
mirroring is performed. For example if you mirror an object of the " StaticText " type
along the vertical midline, the value of the " AlignmentLeft " property changes from
" 0 " to " 2 " .

Syntax
Expression.FlipVertically()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example a StaticText object will be inserted into the active picture
and mirrored along the vertical midline:
Sub FlipObjectVertically()
'VBA156
Dim objStaticText As HMIStaticText
Dim strPropertyName As String
Dim iPropertyValue As Integer
Set objStaticText =
ActiveDocument.HMIObjects.AddHMIObject( " Textfield " ,
" HMIStaticText " )
strPropertyName = objStaticText.Properties( " Text " ).Name
With objStaticText
.Width = 120
.Text = " Sample Text "
.Selected = True
.AlignmentLeft = 0
iPropertyValue = .AlignmentLeft
MsgBox " Value of ' " & strPropertyName & " ' before
flip: " & iPropertyValue
ActiveDocument.Selection.FlipVertically

Printout of the Online Help
Automated Configuring

307

ActualPointTopIndex

11.05

iPropertyValue = objStaticText.AlignmentLeft
MsgBox " Value of ' " & strPropertyName & " ' after
flip: " & iPropertyValue
End With
End Sub

308

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.14 GetItemByPath Method

Description
Returns a FolderItem object (folder or object) located on the specified internal
access path in the Components Library.
Note:
To obtain the internal access path, select the " Copy Path " command from the popup menu in the Components Library. The internal access path to the folder or
object will then be copied to the clipboard.
Syntax
Expression.GetItemByPath(PathName)
Expression
Required. An expression or element which returns an object of the " SymbolLibrary "
type.

Parameter
Parameter (Data Type)

Description

PathName (String)

The internal access path on which the object is
located in the Components Library.

Example
In this example one object from the entire library will be returned and its display
name will be output:
Sub ShowDisplayName()
'VBA157
Dim objGlobalLib As HMISymbolLibrary
Dim objFItem As HMIFolderItem
Set objGlobalLib = Application.SymbolLibraries(1)
Set objFItem =
objGlobalLib.GetItemByPath( " \Folder1\Folder2\Object1 " )
MsgBox objFItem.DisplayName
End Sub

Printout of the Online Help
Automated Configuring

309

ActualPointTopIndex

11.05

5.5.2.15 InsertFromMenuItem Method

Description
Inserts into an existing, user-defined toolbar a new icon that references an existing
menu entry in a user-defined menu.
Use this method if you wish to set up a toolbar so that it contains the same
commands as an existing user-defined menu.

Syntax
Expression.InsertFromMenuItem(Position, Key, pMenuItem,
DefaultToolTipText)
Expression
Required. An expression or element which returns an object of the " ToolbarItems "
type.

Parameter
Parameter (Data Type)
Position (Long)

Defines the position of the icon within the userdefined toolbar.

Key (Variant)

Identifies the icon. Use unique names for " Key "
(e.g. " tItem1_1 " ).

pMenuItem (HMIMenuItem)

The MenuItem object that is intended to be
referenced.

DefaultToolTipText (String)

310

Description

Defines for the icon concerned the Tooltip text
that will be displayed when you move the mouse
over the icon.

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
In this example a user-defined menu and a user-defined toolbar will be inserted in
the active picture. The icon calls up the menu entry " Hello World " from the userdefined menu:
Sub ToolbarItem_InsertFromMenuItem()
'VBA158
Dim objMenu As HMIMenu
Dim objToolbarItem As HMIToolbarItem
Dim objToolbar As HMIToolbar
Dim objMenuItem As HMIMenuItem
Set objMenu = Application.CustomMenus.InsertMenu(1,
" Menu1 " , " TestMenu " )
'
'*************************************************
'* Note:
'* The object-reference has to be unique.
'*************************************************
'
Set objMenuItem =
Application.CustomMenus(1).MenuItems.InsertMenuItem(1,
" MenuItem1 " , " Hello World " )
Application.CustomMenus(1).MenuItems(1).Macro =
" HelloWorld "
Set objToolbar =
Application.CustomToolbars.Add( " Toolbar1 " )
Set objToolbarItem =
Application.CustomToolbars(1).ToolbarItems.InsertFromMen
uItem(1, " ToolbarItem1 " , objMenuItem, " Call's Hello
World of TestMenu " )
End Sub
Sub HelloWorld()
MsgBox " Procedure 'HelloWorld()' is execute. "
End Sub

Printout of the Online Help
Automated Configuring

311

ActualPointTopIndex

11.05

5.5.2.16 InsertMenu Method

Description
Creates a new, user-defined menu. There is a difference between applicationspecific and picture-specific user-defined menus:


Application-specific menu: This is linked to the Graphics Designer and is also
only visible when all the pictures in the Graphics Designer are closed. Place
the VBA code in the document called " GlobalTemplateDocument " or
" ProjectTemplateDocument " and use the " Application " property.



Picture-specific menu: This is linked to a particular picture and remains visible
all the time the picture is active. Place the VBA code in the document called
" ThisDocument " for the desired picture and use the " ActiveDocument "
property.

Syntax
Expression.InsertMenu(Position, Key, DefaultLabel)
Expression
Required. An expression or element which returns an object of the " CustomMenus "
type.

Parameter
Parameter (Data Type)
Position (Long)

Defines the position of the user-defined menu
within the menu bar. However, picture-specific
menus are always positioned to the right of
application-specific menus.

Key (Variant)

Identifies the user-defined menu. Use unique
names for " Key " (e.g. " DocMenu1 " )

DefaultLabel (String)

312

Description

The name of the user-defined menu.

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line:
Sub CreateDocumentMenus()
'VBA159
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " First MenuItem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " Second MenuItem " )
'
'Insert a dividing rule into custumized menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " First SubMenu " )
'
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " First item in sub-menu " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " Second item in sub-menu " )
End Sub
The diagram shows the generated menu structure.

Printout of the Online Help
Automated Configuring

313

ActualPointTopIndex

11.05

5.5.2.17 InsertMenuItem Method

Description
Inserts a new entry in a user-defined menu.

Syntax
Expression.InsertMenuItem(Position, Key, DefaultLabel)
Expression
Required. An expression or element which returns an object of the " MenuItems "
type.

Parameter
Parameter (Data Type)

Description

Position (Long)

Defines the position of the submenu within the userdefined menu.

Key (Variant)

Identifies the submenu. Use unique names for " Key "
(e.g. " dSubMenu1_4 " ).

DefaultLabel (String)

Defines the name of the submenu.

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line:
Sub CreateDocumentMenus()
'VBA160
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " First MenuItem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " Second MenuItem " )
'

314

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Insert a dividing rule into customized menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " First SubMenu " )
'
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " First item in sub-menu " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " Second item in sub-menu " )
End Sub
The diagram shows the menu structure.

Printout of the Online Help
Automated Configuring

315

ActualPointTopIndex

11.05

5.5.2.18 InsertSeparator Method

Description
Inserts a dividing line in a user-defined menu or user-defined toolbar.

Syntax
Expression.InsertSeparator(Position, Key)
Expression
Required. An expression or element which returns an object of the " MenuItems " or
" ToolbarItems " type.

Parameter
Parameter (Data Type)

Description

Position (Long)

Defines the position of the dividing line within the
user-defined menu or user-defined toolbar.

Key (Variant)

Identifies the dividing line. Use unique names for
" Key " (e.g. " tSeparator1_2 " ).

Example
In the following example a user-defined toolbar with two icons is created in the
active picture. These icons are separated by a dividing line:
Sub AddDocumentSpecificCustomToolbar()
'VBA161
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " DocToolbar " )
'Add toolbar-item to userdefined toolbar
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " tItem1_1 " ,
" First symbol-icon " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(3, " tItem1_3 " ,
" Second symbol-icon " )
'
'Insert dividing rule between first and second symbolicon
Set objToolbarItem =
objToolbar.ToolbarItems.InsertSeparator(2,
" tSeparator1_2 " )
End Sub

316

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.19 InsertSubmenu Method

Description
Inserts a submenu into an existing user-defined menu.

Syntax
Expression.InsertSubmenu(Position, Key, DefaultLabel)
Expression
Required. An expression or element which returns an object of the " MenuItem "
type

Parameter
Parameter (Data Type)

Description

Position (Long)

Defines the position of the submenu within the userdefined menu.

Key (Variant)

Identifies the submenu. Use unique names for " Key "
(e.g. " dSubMenu1_4 " ).

DefaultLabel (String)

Defines the name of the submenu.

Printout of the Online Help
Automated Configuring

317

ActualPointTopIndex

11.05

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line:
Sub CreateDocumentMenus()
'VBA162
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " First MenuItem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " Second MenuItem " )
'
'Insert a dividing rule into customized menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " First SubMenu " )
'
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " First item in sub-menu " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " Second item in sub-menu " )
End Sub
The diagram shows the menu structure.

318

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.20 InsertToolbarItem Method

Description
Inserts a new icon in an existing user-defined toolbar.

Syntax
Expression.InsertToolbarItem(Position, Key,
DefaultToolTipText)
Expression
Required. An expression or element which returns an object of the " ToolbarItems "
type.

Parameter
Parameter (Data Type)

Description

Position (Long)

Defines the position of the icon within the userdefined toolbar.

Key (Variant)

Identifies the icon. Use unique names for " Key "
(e.g. " tItem1_1 " ).

DefaultToolTipText (String)

Defines for the icon concerned the Tooltip text
that will be displayed when you move the mouse
over the icon.

Printout of the Online Help
Automated Configuring

319

ActualPointTopIndex

11.05

Example
In the following example a user-defined toolbar with two icons is created in the
active picture. These icons are separated by a dividing line:
Sub AddDocumentSpecificCustomToolbar()
'VBA163
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " DocToolbar " )
'Add toolbar-item to userdefined toolbar
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " tItem1_1 " ,
" First symbol-icon " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(3, " tItem1_3 " ,
" Second symbol-icon " )
'
'Insert dividing rule between first and second symbolicon
Set objToolbarItem =
objToolbar.ToolbarItems.InsertSeparator(2,
" tSeparator1_2 " )
End Sub

320

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.21 IsCSLayerVisible Method

Description
Returns TRUE if the specified CS layer is visible.

Syntax
Expression.IsCSLayerVisible(Index)
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

Defines the CS layer: Value range from 1 to 32.
Layer0 corresponds to the index value " 1 " .

Example
The following example determines whether CS layer 1 in the copy of the active
picture is visible and outputs the result:
Sub IsCSLayerVisible()
'VBA164
Dim objView As HMIView
Dim strLayerName As String
Dim iLayerIdx As Integer
Set objView = ActiveDocument.Views(1)
objView.Activate
iLayerIdx = 2
strLayerName = ActiveDocument.Layers(iLayerIdx).Name
If objView.IsCSLayerVisible(iLayerIdx) = True Then
MsgBox " CS " & strLayerName & " is visible "
Else
MsgBox " CS " & strLayerName & " is invisible "
End If
End Sub

Printout of the Online Help
Automated Configuring

321

ActualPointTopIndex

11.05

5.5.2.22 IsRTLayerVisible Method

Description
Returns TRUE if the specified RT layer is visible.

Syntax
Expression.IsRTLayerVisible(Index)
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

Defines the RT layer: Value range from 1 to 32.
Layer0 corresponds to the index value " 1 " .

Example
The following example determines whether RT layer 1 is visible and outputs the
result:
Sub RTLayerVisibility()
'VBA165
Dim strLayerName As String
Dim iLayerIdx As Integer
iLayerIdx = 2
strLayerName = ActiveDocument.Layers(iLayerIdx).Name
If ActiveDocument.IsRTLayerVisible(iLayerIdx) = True
Then
MsgBox " RT " & strLayerName & " is visible "
Else
MsgBox " RT " & strLayerName & " is invisible "
End If
End Sub

322

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.23 Item Method

Description
Returns an element from a listing.
Syntax
Expression.Item(Index)
Expression
Required. An expression or element which returns an object.
Parameter
Parameter
(Data Type)

Description

Index (Variant) The name or index number of an element from the listing.
You can use the Object Name as the name. As the index number
you can use a numerical expression (from 1 up to the value of the
Count property of the listing).
If the entered value fails to match any element in the listing, this
counts as an error.
Example

Note:
The Item Method is the default method for listings. Both the following examples
give the same result.
In the following example the name of the first picture in the Graphics Designer is
output:
Sub ShowDocumentNameLongVersion()
'VBA166
Dim strDocName As String
strDocName = Application.Documents.Item(3).Name
MsgBox strDocName
End Sub
Sub ShowDocumentNameShortVersion()
'VBA167
Dim strDocName As String
strDocName = Application.Documents(3).Name
MsgBox strDocName
End Sub

Printout of the Online Help
Automated Configuring

323

ActualPointTopIndex

11.05

5.5.2.24 ItemByLcid Method

Description
Selects the language for which you wish to enter the font settings. Read access.
Note:
You can only select languages in which you have already configured.
Syntax
Expression.Methode(LangID)
Expression
Required. An expression or element which returns an object of the
" LanguageFonts " type.

Parameter
Parameter (Data Type)

Description

LangID (Long)

This is the language identifier. You can find a list of
the language identifiers in the WinCC
documentation ( & gt; Index Language Identifier)

Example
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA168
Dim objLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " Hello "
Set objLangFonts = objButton.LDFonts
'
'To make fontsettings for french:
With objLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True

324

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Size = 12
End With
'
'To make fontsettings for english:
With objLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

Printout of the Online Help
Automated Configuring

325

ActualPointTopIndex

11.05

5.5.2.25 LoadDefaultConfig Method

Description
Loads the file in which the default settings for objects are saved. The PDD file is
located in the " GraCS " folder of the current project.

Syntax
Expression.LoadDefaultConfig(FileName)
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
Parameter (Data Type)

Description

FileName (String)

The name of the PDD file which it is intended to load.

Example
In the following example the file " Test.PDD " will be loaded. For this example to
work, you must have previously saved the file. You can do this with the aid of the
SaveDefaultConfig Method:
Sub LoadDefaultConfig()
'VBA169
Application.LoadDefaultConfig ( " Test.PDD " )
End Sub

326

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.26 MoveOneLayerDowncMethod

Description
Moves the selected object in the specified picture into the next lowest layer.

Syntax
Expression.MoveOneLayerDown()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example a circle in the active picture is inserted in the third layer
and then moved to the next lowest layer:
Sub MoveObjectOneLayerDown()
'VBA170
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
.Layer = 3
MsgBox " Circle is inserted into layer " &
Str(.Layer)
ActiveDocument.Selection.MoveOneLayerDown
MsgBox " Circle is moved into layer " & Str(.Layer)
End With
End Sub

Printout of the Online Help
Automated Configuring

327

ActualPointTopIndex

11.05

5.5.2.27 MoveOneLayerUp Method

Description
Moves the selected object in the specified picture into the next highest layer.

Syntax
Expression.MoveOneLayerUp()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example a circle in the active picture is inserted in the third layer
and then moved to the next highest layer:
Sub MoveObjectOneLayerUp()
'VBA171
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
.Layer = 3
MsgBox " Circle is inserted into layer " &
Str(.Layer)
ActiveDocument.Selection.MoveOneLayerUp
MsgBox " Circle is moved into layer " & Str(.Layer)
End With
End Sub

328

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.2.28 MoveSelection Method

Description
Moves one or more objects selected in the picture by the specified coordinates.
Note:
When you want to reposition one or more selected objects, use the properties
" Left " and " Top " .
Syntax
Expression.MoveSelection(PosX, PosY)
Expression
Required. " An expression or element which returns an object of the " Document " or
" Selection type.

Parameter
Parameter (Data Type)

Description

PosX (Long)

The number of pixels by which the selection is to be
moved horizontally.

PosY (Long)

The number of pixels by which the selection is to be
moved vertically.

Example
In the following example two objects are inserted at different positions in the
current picture and selected. The selection is then moved 30 pixels to the right and
40 pixels down:
Sub MoveSelectionToNewPostion()
'VBA172
Dim nPosX As Long
Dim nPosY As Long
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle

Printout of the Online Help
Automated Configuring

329

ActualPointTopIndex

11.05

.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
nPosX = 30
nPosY = 40
'Instead of next you can write
" ActiveDocument.Selection.MoveSelection " .
ActiveDocument.MoveSelection nPosX, nPosY
End Sub

330

Printout of the Online Help
Automated Configuring

11.05

5.5.3

ActualPointTopIndex

VBA Methods: O-Z

5.5.3.1

BackwardOneLevel Method

Description
Moves the selected objects one level backward within their current layer.

Syntax
Expression.BackwardOneLevel()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects are inserted in the active picture. The object
inserted last is then moved backward one level:
Sub MoveObjectOneLevelBackward()
'VBA173
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = False
End With
With objRectangle
.Top = 40
.Left = 40
.Width = 100
.Height = 50

Printout of the Online Help
Automated Configuring

331

ActualPointTopIndex

11.05

.BackColor = RGB(255, 0, 255)
.Selected = True
End With
MsgBox " Objects created and selected! "
ActiveDocument.Selection.BackwardOneLevel
End Sub

332

Printout of the Online Help
Automated Configuring

11.05

5.5.3.2

ActualPointTopIndex

ForwardOneLevel Method

Description
Moves the selected objects one level forward within their current layer.
Syntax
Expression.ForwardOneLevel()
Expression
Required. An expression or element which returns an object of the " Selection " type.
Parameter
-Example
In the following example two objects are inserted in the active picture. The object
inserted first is then moved forward one level:
Sub MoveObjectOneLevelForward()
'VBA174
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " , " HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 40
.Left = 40
.Width = 100
.Height = 50
.BackColor = RGB(255, 0, 255)
.Selected = False
End With
MsgBox " Objects created and selected! "
ActiveDocument.Selection.ForwardOneLevel
End Sub

Printout of the Online Help
Automated Configuring

333

ActualPointTopIndex

5.5.3.3

11.05

Open Method

Description
Opens an existing picture in the Graphics Designer and adds it to the documents
listing.

Syntax
Expression.Open(FileName, [HMIOpenDocumentType])
Expression
Required. An expression or element which returns an object of the " Documents "
type.

Parameter
Parameter (Data Type)

Description

FileName (String)

The name of the PDL file to be opened.
Unless you saved the PDL file in the " GraCS " folder of
the open project, you must also specify the path at the
same time.

HMIOpenDocumentType
(HMIDocumentType)

Defines how the picture will be opened:
HMIDocumentTypeVisible: Opens the picture for direct
processing. This is the default setting if you do not
specify the parameter.
HMIDocumentTypeInvisible: Opens the picture in
invisible mode, i.e. it is not displayed in the Graphics
Designer. You can only address the picture via the
Documents listing, and make it visible again by means
of the Hide property.

Example
In the following example the picture " Test " will be opened. For this example to
work, you must have previously saved a picture with the name " Test " in the
" GraCS " folder of the open project.
Sub OpenDocument()
'VBA175
Application.Documents.Open ( " Test.PDL " ,
hmiDocumentTypeVisible)
End Sub

334

Printout of the Online Help
Automated Configuring

11.05

5.5.3.4

ActualPointTopIndex

PasteClipboard Method

Description
Pastes the contents of the clipboard into the specified picture.
Note:
The clipboard must contain objects from the Graphics Designer. Other contents
(such as ASCII text) will not be pasted.
Syntax
Expression.PasteClipboard()
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
--

Example
In the following example all the objects selected in the active picture are copied to
the clipboard and then pasted into a new picture. For this example to work, you
must have selected at least one object in the active picture:
Sub CopySelectionToNewDocument()
'VBA176
Dim iNewDoc As String
ActiveDocument.CopySelection
Application.Documents.Add hmiDocumentTypeVisible
iNewDoc = Application.Documents.Count
Application.Documents(iNewDoc).PasteClipboard
End Sub

Printout of the Online Help
Automated Configuring

335

ActualPointTopIndex

5.5.3.5

11.05

PrintDocument Method

Description
Prints the specified copy of the picture using the current printer settings.

Syntax
Expression.PrintDocument()
Expression
Required. An expression or element which returns an object of the " View " type.

Parameter
--

Example
In the following example a copy of the active picture is created and then activated
and printed:
Sub CreateAndPrintView()
'VBA177
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
objView.PrintDocument
End Sub

336

Printout of the Online Help
Automated Configuring

11.05

5.5.3.6

ActualPointTopIndex

PrintProjectDocumentation Method

Description
Prints out the project documentation for the current picture complete with all the
objects it contains and their properties via the reporting system in WinCC (Report
Designer).
You must first have set the print settings (such as page range) in the " Print Job
Properties " dialog. To do this, go to the Graphics Designer and select the menu
command " File " & gt; " Project Documentation - Setup " .
Note:
The project documentation will be output on the printer that was set up in the
Report Designer. You can design the print layout to suit your needs with the aid of
the Report Designer.
Syntax
Expression.PrintProjectDocumentation()
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
--

Example
In the following example the project documentation for the active picture will be
printed:
Sub ToPrintProjectDocumentation()
'VBA178
ActiveDocument.PrintProjectDocumentation
End Sub

Printout of the Online Help
Automated Configuring

337

ActualPointTopIndex

5.5.3.7

11.05

Remove Method

Description
Removes an object from a selection of objects or from a group object.

Syntax
Expression.Remove(Index)
Expression
Required. An expression or element which returns an object of the
" GroupedObjects " or " Selection " type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

The name or index number of the object that is
intended to be removed.
You can use the Object Name as the name. As the
index number you can use a numerical expression
(from 1 up to the value of the Count property of the
listing).
If the entered value fails to match any element in the
listing, this counts as an error.

Example
In the following example three objects will first be inserted in the active picture and
selected. Then one object will be removed from the selection and the remaining
objects will be grouped. Then the first object will be removed from the group object:
Sub RemoveObjectFromGroup()
'VBA179
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )

338

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 42
.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 40
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
MsgBox " Group-object is created. "
objGroup.GroupedHMIObjects.Remove ( " sEllipse " )
MsgBox " The ellipse is removed from group-object. "
End Sub

Printout of the Online Help
Automated Configuring

339

ActualPointTopIndex

5.5.3.8

11.05

Rotate Method

Description
Rotates the object selected in the specified picture by 90° clockwise.

Syntax
Expression.Rotate()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects will be inserted in the active picture and then
grouped. The group object will then be rotated once:
Sub RotateGroupObject()
'VBA180
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objGroup As HMIGroup
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
With objRectangle
.Top = 30
.Left = 30
.Width = 80
.Height = 40
.Selected = True
End With
With objCircle
.Top = 30
.Left = 30
.BackColor = RGB(255, 255, 255)
.Selected = True

340

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
MsgBox " Group-object created. "
objGroup.Selected = True
ActiveDocument.Selection.Rotate
End Sub

Printout of the Online Help
Automated Configuring

341

ActualPointTopIndex

5.5.3.9

11.05

SameHeight Method

Description
Sets the " Height " property for all selected objects in the specified picture to the
smallest available value.

Syntax
Expression.SameHeight()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects of different sizes will be inserted in the active
picture. Then all objects will be selected and set to the same height:
Sub ApplySameHeightToSelectedObjects()
'VBA181
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Height = 15
.Selected = True
End With
With objRectangle
.Top = 80

342

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Left = 42
.Height = 40
.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 40
.Height = 120
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.SameHeight
End Sub

Printout of the Online Help
Automated Configuring

343

ActualPointTopIndex

11.05

5.5.3.10 SameWidth Method

Description
Sets the " Width " property for all selected objects in the specified picture to the
smallest available value.

Syntax
Expression.SameWidth()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects of different sizes will be inserted in the active
picture. Then all objects will be selected and set to the same width:
Sub ApplySameWidthToSelectedObjects()
'VBA182
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Width = 15
.Selected = True
End With
With objRectangle
.Top = 80

344

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Left = 42
.Width = 40
.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 120
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.SameWidth
End Sub

Printout of the Online Help
Automated Configuring

345

ActualPointTopIndex

11.05

5.5.3.11 SameWidthAndHeight Method

Description
Sets the " Height " and " Width " properties for all selected objects in the specified
picture to the smallest available value.

Syntax
Expression.SameWidthAndHeight()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects of different sizes will be inserted in the active
picture. Then all objects will be selected and set to the same height:
Sub ApplySameWidthAndHeightToSelectedObjects()
'VBA183
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Height = 15
.Selected = True
End With
With objRectangle
.Top = 80

346

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Left = 42
.Width = 25
.Height = 40
.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 40
.Height = 120
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects selected! "
ActiveDocument.Selection.SameWidthAndHeight
End Sub

Printout of the Online Help
Automated Configuring

347

ActualPointTopIndex

11.05

5.5.3.12 Save Method

Description
Saves the specified picture under its current name.

Syntax
Expression.Save()
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
--

Example
In the following example the active picture in the Graphics Designer will be saved:
Sub SaveDocument()
'VBA184
ActiveDocument.Save
End Sub

348

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.13 SaveAll Method

Description
Saves all the open pictures in the Graphics Designer under their current names.

Syntax
Expression.SaveAll()
Expression
Required. An expression or element which returns an object of the " Documents "
type.

Parameter
--

Example
In the following example all open pictures in the Graphics Designer are saved:
Sub SaveAllDocuments()
'VBA185
Application.Documents.SaveAll
End Sub

Printout of the Online Help
Automated Configuring

349

ActualPointTopIndex

11.05

5.5.3.14 SaveAs Method

Description
Saves the specified picture under a new name.
If a previously existing picture is to be overwritten, it must be ascertained prior to
the SaveAs method call that this picture is permitted to be overwritten. You must
inquire the LockedByCreatorID property of the picture to be overwritten to do so.
Otherwise an error will be triggered in VBA.

Syntax
Ausdruck.SaveAs(FileName)
Expression
Necessary. An expression or element which returns an object of the " Document "
type.

Parameter
Parameter (Data Type)

Description

FileName (String)

The file name under which the picture is to be saved.

Example
In the following example the active picture will be saved under the name
" Test2.PDL " :
Sub SaveDocumentAs()
'VBA186
ActiveDocument.SaveAs ( " Test2.PDL " )
End Sub

350

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.15 SaveDefaultConfig Method

Description
Saves the default settings for objects to a PDD file. The file is saved to the " GraCS "
folder of the current project.

Syntax
Expression.SaveDefaultConfig(FileName)
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
Parameter (Data Type)

Description

FileName (String)

The name of the PDD file.

Example
In the following example the default settings for objects are saved to the file
" Test.PDD " .
Sub SaveDefaultConfig()
'VBA187
Application.SaveDefaultConfig ( " Test.PDD " )
End Sub

Printout of the Online Help
Automated Configuring

351

ActualPointTopIndex

11.05

5.5.3.16 SelectAll Method

Description
Selects all the objects in the specified picture and adds them to the selection
listing.

Syntax
Expression.SelectAll()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example three objects will be inserted in the active picture and then
selected.
Sub SelectAllObjectsInActiveDocument()
'VBA188
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Height = 15
End With
With objRectangle
.Top = 80
.Left = 42
.Width = 25

352

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Height = 40
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 40
.Height = 120
.BackColor = RGB(255, 0, 0)
End With
ActiveDocument.Selection.SelectAll
End Sub

Printout of the Online Help
Automated Configuring

353

ActualPointTopIndex

11.05

5.5.3.17 SetCSLayerVisible Method

Description
Shows or hides the specified CS layer.

Syntax
Expression.SetCSLayerVisible(Index, Val)
Expression
Required. An expression or element which returns an object of the " View " type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

Defines the CS layer that is going to be shown or
hidden. Value range from 1 up to 32.

Val (Boolean)

TRUE if the specified CS layer is intended to be
visible.

Example
In the following example the second CS layer in the copy of the active picture is
hidden (i.e. made invisible):
Sub SetCSLayerVisible()
'VBA189
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
objView.SetCSLayerVisible 2, False
End Sub

354

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.18 SetDeclutterObjectSize Method

Description
Specifies the size area for fading in and out of objects in the specified picture. If
height and width of the object are outside the specified size area, the objects are
faded out.
The " ObjectSizeDecluttering " property must be set to TRUE.
Syntax
Ausdruck.SetDeclutterObjectSize(Min, Max)
Expression
Necessary. An expression or element which returns an object of the " Document "
type.
Parameter
Parameter (data type)

Description

Min (Long)

Lower size range in pixels.

Max (Long)

Upper size range in pixels.

Example
In the following example the settings for the lowest layer are configured in the
active picture:
Sub ConfigureSettingsOfLayer()
'VBA190
Dim objLayer As HMILayer
Set objLayer = ActiveDocument.Layers(1)
With objLayer
'Configure " Layer 0 "
.MinZoom = 10
.MaxZoom = 100
.Name = " Configured with VBA "
End With
'Define decluttering of objects:
With ActiveDocument
.LayerDecluttering = True
.ObjectSizeDecluttering = True
.SetDeclutterObjectSize 50, 100
End With
End Sub

Printout of the Online Help
Automated Configuring

355

ActualPointTopIndex

11.05

5.5.3.19 SetRTLayerVisible Method

Description
Shows or hides the specified RT layer.

Syntax
Expression.SetRTLayerVisible(Index, Val)
Expression
Required. An expression or element which returns an object of the " Document "
type.

Parameter
Parameter (Data Type)

Description

Index (Variant)

Defines the RT layer that is going to be shown or hidden.
Value range from 1 up to 32.

Val (Boolean)

TRUE if the specified RT layer is intended to be visible.

Example
In the following example the first RT layer in the active picture will be made visible:
Sub SetRTLayerVisibleWithVBA()
'VBA191
ActiveDocument.SetRTLayerVisible 1, False
End Sub

356

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.20 ShowPropertiesDialog Method

Description
Opens the " Object Properties " dialog.

Syntax
Expression.ShowPropertiesDialog()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example the " Object Properties " dialog is opened:
Sub ShowPropertiesDialog()
'VBA192
Application.ShowPropertiesDialog
End Sub

Printout of the Online Help
Automated Configuring

357

ActualPointTopIndex

11.05

5.5.3.21 ShowSymbolLibraryDialog Method

Description
Opens the Components Library.

Syntax
Expression.ShowSymbolLibraryDialog()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example the Components Library is opened:
Sub ShowSymbolLibraryDialog()
'VBA193
Application.ShowSymbolLibraryDialog
End Sub

358

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.22 ShowTagDialog Method

Description
Opens the " Tags " dialog.

Syntax
Expression.ShowTagDialog()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example the " Tags " dialog is opened:
Sub ShowTagDialog()
'VBA194
Application.ShowTagDialog
End Sub

Printout of the Online Help
Automated Configuring

359

ActualPointTopIndex

11.05

5.5.3.23 TileWindowsHorizontally Method

Description
Arranges all open pictures in the Graphics Designer so that they are tiled
horizontally.

Syntax
Expression.Methode()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example all open pictures in the Graphics Designer are tiled
horizontally. For this example to work, you must have opened a number of pictures
in the Graphics Designer:
Sub TileWindowsHorizontally()
'VBA195
Application.TileWindowsHorizontally
End Sub

360

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.5.3.24 TileWindowsVertically Method

Description
Arranges all open pictures in the Graphics Designer so that they are tiled vertically.

Syntax
Expression.Methode()
Expression
Required. An expression or element which returns an object of the " Application "
type.

Parameter
--

Example
In the following example all open pictures in the Graphics Designer are tiled
vertically. For this example to work, you must have opened a number of pictures in
the Graphics Designer:
Sub TileWindowsVertically()
'VBA196
Application.TileWindowsVertically
End Sub

Printout of the Online Help
Automated Configuring

361

ActualPointTopIndex

11.05

5.5.3.25 SendToBack Method

Description
Sends the selected objects right to the back within their current layer.

Syntax
Expression.SendToBack()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects are inserted in the active picture. The object
inserted first is then sent to the back:
Sub SendObjectToBack()
'VBA197
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = False
End With
With objRectangle
.Top = 40
.Left = 40
.Width = 100
.Height = 50
.BackColor = RGB(255, 0, 255)
.Selected = True
End With

362

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

MsgBox " The objects circle and rectangle are created " &
vbCrLf & " Only the rectangle is selected! "
ActiveDocument.Selection.SendToBack
MsgBox " The selection is moved to the back. "
End Sub

Printout of the Online Help
Automated Configuring

363

ActualPointTopIndex

11.05

5.5.3.26 BringToFront Method

Description
Brings the selected objects right to the front within their current layer.

Syntax
Expression.BringToFront()
Expression
Required. An expression or element which returns an object of the " Selection " type.

Parameter
--

Example
In the following example two objects are inserted in the active picture. The object
inserted last is then brought to the front:
Sub MoveObjectToFront()
'VBA198
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 40
.Left = 40
.Width = 100
.Height = 50
.BackColor = RGB(255, 0, 255)
.Selected = False
End With

364

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

MsgBox " The objects circle and rectangle are created " &
vbCrLf & " Only the circle is selected! "
ActiveDocument.Selection.BringToFront
MsgBox " The selection is moved to the front. "
End Sub

Printout of the Online Help
Automated Configuring

365

ActualPointTopIndex

11.05

5.5.3.27 Ungroup Method

Description
Ungroups a group object. The objects remain intact.

Syntax
Expression.Ungroup(Parameter)
Expression
Required. An expression or element which returns an object of the " Group " type.

Parameter
--

Example
In the following example three objects are created in the current picture and a
group object is then created from them: The group object is then moved and
ungrouped.
Sub DissolveGroup()
'VBA199
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 42

366

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 40
.BackColor = RGB(255, 0, 0)
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
MsgBox " Group-object is created. "
With objGroup
.Left = 120
.Top = 300
MsgBox " Group-object is moved. "
.UnGroup
MsgBox " Group is dissolved. "
End With
End Sub

Printout of the Online Help
Automated Configuring

367

ActualPointTopIndex

5.6
5.6.1
5.6.1.1

11.05

Objects and Listings
VBA Objects and Listings: 0-9 and A-C
3DBarGraph Object

Description

Represents the " 3D Bar " object. The 3DBarGraph object is an element of the
following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

VBA Object Name
HMI3DBarGraph

Usage
Use the Add method to create a new " 3D Bar " object in a picture:
Sub Add3DBarGraph()
'VBA200
Dim obj3DBarGraph As HMI3DBarGraph
Set obj3DBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar " ,
" HMI3DBarGraph " )
End Sub

368

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub Edit3DBarGraph()
'VBA201
Dim obj3DBarGraph As HMI3DBarGraph
Set obj3DBarGraph = ActiveDocument.HMIObjects( " 3DBar " )
obj3DBarGraph.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection(Index) " to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA202
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The 3D Bar object possesses the following properties:
AngleAlpha
AngleBeta
Axe
BorderColor
Background
BarDepth
BarHeight
BarWidth
BaseX
BaseY
BorderColor
BorderStyle
BorderWidth
Direction
Height
Layer00Checked
Layer00Color
Layer00Value
Layer01Checked
Layer01Color
Layer01Value
Layer02Checked
Layer02Color
Layer02Value
Layer03Checked
Layer03Color

Printout of the Online Help
Automated Configuring

369

ActualPointTopIndex

11.05

Layer03Value
Layer04Checked
Layer04Color
Layer04Value
Layer05Checked
Layer05Color
Layer05Value
Layer06Checked
Layer06Color
Layer06Value
Layer07Checked
Layer07Color
Layer07Value
Layer08Checked
Layer08Color
Layer08Value
Layer09Checked
Layer09Color
Layer09Value
Layer10Checked
Layer10Color
Layer10Value
Layer
Left
LightEffect
Max
Min
Name
Operation
PasswordLevel
PredefinedAngles
Process
ToolTipText
Top
Visible
Width
ZeroPointValue

370

Printout of the Online Help
Automated Configuring

11.05

5.6.1.2

ActualPointTopIndex

Actions Object (Listing)

Description

Displays a listing of the actions that are configured on an event.

VBA Object Name
HMIActions

Usage
Use the AddAction method to configure one or more actions on an event. In this
example a button and a circle will be inserted in the active picture. In runtime the
radius of the circle enlarges every time you click the button:
Sub CreateVBActionToClickedEvent()
'VBA203
Dim objButton As HMIButton
Dim objCircle As HMICircle
Dim objVBScript As HMIScriptInfo
Dim strVBCode As String
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VB " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircle
.Top = 100
.Left = 100
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10

Printout of the Online Help
Automated Configuring

371

ActualPointTopIndex

11.05

.Left = 10
.Text = " Increase Radius "
End With
'define event and assign sourcecode to it:
Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
strVBCode = " Dim myCircle " & vbCrLf & " Set myCircle = "
strVBCode = strVBCode &
" HMIRuntime.ActiveScreen.ScreenItems( " " Circle_VB " " ) "
strVBCode = strVBCode & vbCrLf & " myCircle.Radius =
myCircle.Radius + 5 "
With objVBScript
.SourceCode = strVBCode
End With
End Sub

Object Properties
The Actions object possesses the following properties:
Application
Count
Item
Parent

372

Printout of the Online Help
Automated Configuring

11.05

5.6.1.3

ActualPointTopIndex

ActiveXControl Object

Description

Represents the ActiveX Control object. The ActiveXControl object is an element of
the following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

VBA Object Name
HMIActiveXControl

Usage
Use the AddActiveXControl method to insert an ActiveX Control in a picture, for
instance. " In the following example the ActiveX Control " WinCC Gauge Control is
inserted in the active picture.
Sub AddActiveXControl()
'VBA204
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
" , " XGAUGE.XGaugeCtrl.1 " )
With ActiveDocument
.HMIObjects( " WinCC_Gauge " ).Top = 40
.HMIObjects( " WinCC_Gauge " ).Left = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

373

ActualPointTopIndex

11.05

Object Properties
The ActiveXControl object possesses the following properties:
ProgID
ServerName

374

Printout of the Online Help
Automated Configuring

11.05

5.6.1.4

ActualPointTopIndex

AnalogResultInfo Object

Description

Displays an analog value range and associated property value in the Dynamic
dialog. The AnalogResultInfo object is an element of the AnalogResultInfos listing:

VBA Object Name
HMIAnalogResultInfo

Usage
Use the AnalogResultInfo object to return an individual value range and property
value. For a detailed example, please refer to " AnalogResultInfos Object (Listing) "
in this documentation.

Object Properties
The AnalogResultInfo object possesses the following properties:
Application
Parent
RangeTo
Value

Printout of the Online Help
Automated Configuring

375

ActualPointTopIndex

5.6.1.5

11.05

AnalogResultInfos Object (Listing)

Description

A listing of AnalogResultInfo objects that contain all the analog value ranges and
the associated property value in the Dynamic dialog.

VBA Object Name
HMIAnalogResultInfos

Usage
Use the Add method to add a new value range in the Dynamic dialog. In the
following example the radius of a circle will be dynamically configured using the
Dynamic dialog, a tag name will be assigned and three analog value ranges will be
created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA206
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.Add 50, 40
.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
End With
End Sub
Use AnalogResultInfos to return the AnalogResultInfos listing. In this example the
value ranges created in the above example will be output:
Sub ShowAnalogResultInfosOfCircleRadius()

376

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'VBA207
Dim colAResultInfos As HMIAnalogResultInfos
Dim objAResultInfo As HMIAnalogResultInfo
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Dim iAnswer As Integer
Dim varRange As Variant
Dim varValue As Variant
Set objCircle = ActiveDocument.HMIObjects( " Circle_A " )
Set objDynDialog = objCircle.Radius.Dynamic
Set colAResultInfos = objDynDialog.AnalogResultInfos
For Each objAResultInfo In colAResultInfos
varRange = objAResultInfo.RangeTo
varValue = objAResultInfo.value
iAnswer = MsgBox( " Ranges of values from Circle_ARadius: " & vbCrLf & " Range of value to: " &
varRange & vbCrLf & " Value of property: " &
varValue, vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objAResultInfo
End Sub

Object Properties
The AnalogResultInfos object possesses the following properties:
Application
Count
ElseCase
Item
Parent

Printout of the Online Help
Automated Configuring

377

ActualPointTopIndex

5.6.1.6

11.05

Application Object

Description

Represents the Graphics Designer editor. The Application object contains
properties and methods that return objects from the top layer. For example
ActiveDocument returns a Document object.

VBA Object Name
HMIApplication

Usage
Use Application to return the Application object. In the following example the
application version is output:
Sub ShowApplicationVersion()
'VBA208
MsgBox Application.Version
End Sub

Object Properties
The Application object possesses the following properties:
ActiveDocument
Application
ApplicationDataPath
AvailableDataLanguages
ConfigurationFileName
CurrentDataLanguage
CurrentDesktopLanguage
CustomMenus
CustomToolbars
DefaultHMIObjects
Documents
IsConnectedToProject
Name
Parent
ProfileName
ProjectName

378

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

ProjectType
SymbolLibraries
VBAVersion
VBE
Version
Visible
WindowState

Printout of the Online Help
Automated Configuring

379

ActualPointTopIndex

5.6.1.7

11.05

ApplicationWindow Object

Description

Represents the " Application Window " object. The ApplicationWindow object is an
element of the following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIApplicationWindow

Usage
Use the Add method to create a new " Application Window " object in a picture:
Sub AddApplicationWindow()
'VBA209
Dim objApplicationWindow As HMIApplicationWindow
Set objApplicationWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow " ,
" HMIApplicationWindow " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditApplicationWindow()
'VBA210
Dim objApplicationWindow As HMIApplicationWindow
Set objApplicationWindow =
ActiveDocument.HMIObjects( " AppWindow " )
objApplicationWindow.Sizeable = True

380

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA211
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The ApplicationWindow object possesses the following properties:
Application
Caption
CloseButton
Height
Layer
Left
MaximizeButton
Moveable
Name
OnTop
Sizeable
Top
Visible
Width
WindowBorder

Printout of the Online Help
Automated Configuring

381

ActualPointTopIndex

5.6.1.8

11.05

BarGraph Object

Description

Represents the " Bar " object. The BarGraph object is an element of the following
listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIBarGraph

Usage
Use the Add method to create a new " Bar " object in a picture:
Sub AddBarGraph()
'VBA212
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditBarGraph()
'VBA213
Dim objBarGraph As HMIBarGraph
Set objBarGraph = ActiveDocument.HMIObjects( " Bar1 " )
objBarGraph.BorderColor = RGB(255, 0, 0)
End Sub

382

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA214
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The BarGraph object possesses the following properties:
AlarmHigh
AlarmLow
Alignment
Average
AxisSection
BackColor2
BackColor3
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
CheckAlarmHigh
CheckAlarmLow
CheckLimitHigh4
CheckLimitHigh5
CheckLimitLow4
CheckLimitLow5
CheckToleranceHigh
CheckToleranceLow
CheckWarningHigh
CheckWarningLow
ColorAlarmHigh
ColorAlarmLow
ColorChangeType
ColorLimitHigh4
ColorLimitHigh5
ColorLimitLow4
ColorLimitLow5
ColorToleranceHigh
ColorToleranceLow
ColorWarningHigh

Printout of the Online Help
Automated Configuring

383

ActualPointTopIndex

11.05

ColorWarningLow
Direction
Exponent
FillColor
FillStyle2
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
FontBold
FontName
FontSize
Height
Hysteresis
HysteresisRange
Layer
LeftComma
Left
LimitHigh4
LimitHigh5
LimitLow4
LimitLow5
LongStrokesBold
LongStrokesOnly
LongStrokesSize
LongStrokesTextEach
Marker
Max
Min
Name
Operation
PasswordLevel
Process
RightComma
ScaleColor
ScaleTicks
Scaling
ScalingType
ToleranceHigh
ToleranceLow
ToolTipText
Top
TrendColor
Trend
TypeAlarmHigh
TypeAlarmLow
TypeLimitHigh4
TypeLimitHigh5
TypeLimitLow4
TypeLimitLow5

384

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

TypeToleranceHigh
TypeToleranceLow
TypeWarningHigh
TypeWarningLow
Visible
WarningHigh
WarningLow
Width
ZeroPoint
ZeroPointValue

Printout of the Online Help
Automated Configuring

385

ActualPointTopIndex

5.6.1.9

11.05

BinaryResultInfo Object

Description

Displays both the binary (boolean) value ranges and the associated property
values in the Dynamic dialog.

VBA Object Name
HMIBinaryResultInfo
Usage
Use BinaryResultInfo to return the BinaryResultInfo object. In the following
example the radius of a circle will be dynamically configured using the Dynamic
dialog, a tag name will be assigned and the associated property values will be
assigned to both the binary value ranges:
Sub AddDynamicDialogToCircleRadiusTypeBinary()
'VBA215
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_C " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBool
.BinaryResultInfo.NegativeValue = 20
.BinaryResultInfo.PositiveValue = 40
End With
End Sub
Object Properties
The BinaryResultInfo object possesses the following properties:
Application
NegativeValue
Parent
PositiveValue

386

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.10 BitResultInfo Object

Description

Displays both the value ranges for bit set/not set and the associated property
values in the Dynamic dialog.
VBA Object Name
HMIBitResultInfo
Usage
Use BitResultInfo to return a BitResultInfo object. In the following example the
radius of a circle will be dynamically configured using the Dynamic dialog, a tag
name will be assigned, the bit to be set will be defined and the associated property
values will be assigned to the " set " / " not set " states:
Sub AddDynamicDialogToCircleRadiusTypeBit()
'VBA216
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_B " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBit
.BitResultInfo.BitNumber = 1
.BitResultInfo.BitSetValue = 40
.BitResultInfo.BitNotSetValue = 80
End With
End Sub
Object Properties
The BitResultInfo object possesses the following properties:
Application
BitNotSetValue
BitNumber
BitSetValue

Printout of the Online Help
Automated Configuring

387

ActualPointTopIndex

11.05

5.6.1.11 Button Object

Description

Represents the " Button " object. The Button object is an element of the following
listings:


HMIObjects: Contains all objects of a picture.



Selection: Contains all selected objects of a picture.



HMIDefaultObjects: Contains the default settings of property values of all
Standard, Windows and Smart objects.

VBA Object Name
HMIButton

Usage
Use the Add method to create a new " Button " object in a picture:
Sub AddButton()
'VBA217
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button " ,
" HMIButton " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditButton()
'VBA218
Dim objButton As HMIButton
Set objButton = ActiveDocument.HMIObjects( " Button " )
objButton.BorderColor = RGB(255, 0, 0)
End Sub

388

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection(Index) " to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA219
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Button object possesses the following properties:
AdaptBorder
AlignmentLeft
AlignmentTop
BackBorderWidth
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColorBottom
BorderColor
BorderColorTop
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
DisplayOptions
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashForeColor
FlashRateBackColor
FlashRateBorderColor
FlashRateForeColor
FontBold
FontItalic
FontName
FontSize
FontUnderline
ForeColor
ForeFlashColorOff
ForeFlashColorOn
Height
Hotkey

Printout of the Online Help
Automated Configuring

389

ActualPointTopIndex

11.05

Layer
Left
Name
Operation
Orientation
PasswordLevel
PictureDown
PictureUp
Text
ToolTipText
Top
Visible
Width

390

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.12 CheckBox Object

Description

Represents the " Check Box " object. The CheckBox object is an element of the
following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMICheckBox

Usage
Use the Add method to create a new " Check Box " object in a picture:
Sub AddCheckBox()
'VBA220
Dim objCheckBox As HMICheckBox
Set objCheckBox =
ActiveDocument.HMIObjects.AddHMIObject( " CheckBox " ,
" HMICheckBox " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditCheckBox()
'VBA221
Dim objCheckBox As HMICheckBox
Set objCheckBox = ActiveDocument.HMIObjects( " CheckBox " )
objCheckBox.BorderColor = RGB(255, 0, 0)
End Sub

Printout of the Online Help
Automated Configuring

391

ActualPointTopIndex

11.05

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA222
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The CheckBox object possesses the following properties:
Application
BitNotSetValue
BitNumber
BitSetValue

392

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.13 Circle Object

Description

Represents the " Circle " object. The Circle object is an element of the following
listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMICircle

Usage
Use the Add method to create a new " Circle " object in a picture:
Sub AddCircle()
'VBA223
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle " ,
" HMICircle " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditCircle()
'VBA224
Dim objCircle As HMICircle
Set objCircle = ActiveDocument.HMIObjects( " Circle " )
objCircle.BorderColor = RGB(255, 0, 0)
End Sub

Printout of the Online Help
Automated Configuring

393

ActualPointTopIndex

11.05

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA225
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Circle object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
Radius
ToolTipText
Top
Visible
Width

394

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.14 CircularArc Object

Description

Represents the " Circular Arc " object. The CircularArc object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMICircularArc

Usage
Use the Add method to create a new " Circular Arc " object in a picture:
Sub AddCiruclarArc()
'VBA226
Dim objCiruclarArc As HMICircularArc
Set objCiruclarArc =
ActiveDocument.HMIObjects.AddHMIObject( " CircularArc " ,
" HMICircularArc " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditCiruclarArc()
'VBA227
Dim objCiruclarArc As HMICircularArc
Set objCiruclarArc =
ActiveDocument.HMIObjects( " CircularArc " )
objCiruclarArc.BorderColor = RGB(255, 0, 0)
End Sub

Printout of the Online Help
Automated Configuring

395

ActualPointTopIndex

11.05

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA228
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The CircularArc object possesses the following properties:
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
EndAngle
FlashBorderColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
Radius
StartAngle
ToolTipText
Top
Visible
Width

396

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.15 ConnectionPoints Object (Listing)

Description

The listing returns the number of points to which the connector can be appended in
the specified object.

VBA Object Name
HMIConnectionPoints

Example
In order for the following example to work you must have connected two objects to
the connector in the active picture of the Graphics Designer. You can find the
Connector object in the Graphics Designer in the Object Palette under " Standard
Objects " .
In this example the number of connection points will be output:
Sub CountConnectionPoints()
'VBA229
Dim objRectangle As HMIRectangle
Dim objConnPoints As HMIConnectionPoints
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
Set objConnPoints =
ActiveDocument.HMIObjects( " Rectangle1 " ).ConnectionPoints
MsgBox " Rectangle1 has " & objConnPoints.Count & "
connectionpoints. "
End Sub

Printout of the Online Help
Automated Configuring

397

ActualPointTopIndex

11.05

Object Properties
The ConnectionPoints object possesses the following properties:
Application
Count
Item
Parent

398

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.1.16 CustomizedObject Object

Description

Represents the object called " Customized Object " . The CustomizedObject object is
an element of the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

In the case of the CustomizedObject object, the only properties that are available in
the object are those that you have selected in the " Configuration " dialog for the
customized object concerned.
Note:
You cannot configure the CustomizedObject object with VBA.
Further information regarding customized objects can be found in the WinCC
documentation under " Customized Object " .

VBA Object Name
HMICustomizedObject

Usage
Use the CreateCustomizedObject Method with the Selection listing to create a new
" Customized Object " object in a picture:
Sub CreateCustomizedObject()
'VBA230
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objCustomizedObject As HMICustomizedObject
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )

Printout of the Online Help
Automated Configuring

399

ActualPointTopIndex

11.05

With objCircle
.Left = 10
.Top = 10
.Selected = True
End With
With objRectangle
.Left = 50
.Top = 50
.Selected = True
End With
MsgBox " objects created and selected! "
Set objCustomizedObject =
ActiveDocument.Selection.CreateCustomizedObject
objCustomizedObject.ObjectName = " Customer-Object "
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditCustomizedObject()
'VBA231
Dim objCustomizedObject As HMICustomizedObject
Set objCustomizedObject =
ActiveDocument.HMIObjects( " Customer-Object " )
MsgBox objCustomizedObject.ObjectName
End Sub

400

Printout of the Online Help
Automated Configuring

11.05

5.6.2
5.6.2.1

ActualPointTopIndex

VBA Objects and Listings: D-I
DataLanguage Object

Description

Represents the installed project language, which is identified by its name and
language identifier. The DataLanguage object is an element of the DataLanguages
listing:
You can find a list of the language identifiers in the WinCC documentation ( & gt; Index
Language Identifier) The hexadecimal value specified in the list has to be
converted to its equivalent decimal value.

VBA Object Name
HMIDataLanguage

Usage
Use the DataLanguages property to return an individual DataLanguage object. In
the following example the first installed project language is output:
Sub ShowFirstObjectOfCollection()
'VBA232
Dim strName As String
strName =
ActiveDocument.Application.AvailableDataLanguages(1).Lan
guageName
MsgBox strName
End Sub

Object Properties
The DataLanguage object possesses the following properties:
Application
LanguageID
LanguageName
Parent

Printout of the Online Help
Automated Configuring

401

ActualPointTopIndex

5.6.2.2

11.05

DataLanguages Object (Listing)

Description

A listing of the DataLanguage objects that represent all the installed project
languages.

VBA Object Name
HMIDataLanguages
Usage
Use the AvailableDataLanguages property to return the DataLanguages listing. In
the following example the installed project language is output:
Sub ShowDataLanguage()
'VBA233
Dim colDataLanguages As HMIDataLanguages
Dim objDataLanguage As HMIDataLanguage
Dim strLanguages As String
Dim iCount As Integer
iCount = 0
Set colDataLanguages =
Application.AvailableDataLanguages
For Each objDataLanguage In colDataLanguages
If " " & lt; & gt; strLanguages Then strLanguages =
strLanguages & " / "
strLanguages = strLanguages &
objDataLanguage.LanguageName & " "
'Every 15 items of datalanguages output in a
messagebox
If 0 = iCount Mod 15 And 0 & lt; & gt; iCount Then
MsgBox strLanguages
strLanguages = " "
End If
iCount = iCount + 1
Next objDataLanguage
MsgBox strLanguages

402

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End Sub
Object Properties
The DataLanguages object possesses the following properties:
Application
Count
Parent

Printout of the Online Help
Automated Configuring

403

ActualPointTopIndex

5.6.2.3

11.05

DestLink Object

Description

Represents the destination for a direct connection.

VBA Object Name
HMIDestLink

Usage
Use the DestinationLink property to return the DestLink object. In the following
example the X position of " Rectangle " _ " A " is copied to the Y position of
Rectangle_B in runtime by clicking on the button:
Sub DirectConnection()
'VBA234
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB

404

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 90
.Height = 50
.Text = " SetPosition "
End With
'
'Directconnection is initiated on mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of " Rectangle_A "
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of " Rectangle_B "
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Object Properties
The DestLink object possesses the following properties:
DestinationLink
AutomationName
ObjectName
Type

Printout of the Online Help
Automated Configuring

405

ActualPointTopIndex

5.6.2.4

11.05

DirectConnection Object

Description

Represents a direct connection.

VBA Object Name
HMIDirectConnection

Usage
Use the DestinationLink and SourceLink properties to configure the source and
destination of a direct connection. In the following example the X position of
" Rectangle " _ " A " is copied to the Y position of Rectangle_B in runtime by clicking
on the button:
Sub DirectConnection()
'VBA235
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With

406

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 90
.Height = 50
.Text = " SetPosition "
End With
'
'Directconnection is initiated on mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of " Rectangle_A "
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of " Rectangle_B "
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Object Properties
The DirectConnection object possesses the following properties:
DestinationLink
SourceLink

Printout of the Online Help
Automated Configuring

407

ActualPointTopIndex

5.6.2.5

11.05

Document Object

Description

Displays a picture in Graphics Designer. The document object is an element of the
documents listing.

VBA Object Name
HMIDocument
Usage
Use Documents(Index) to return an individual document object. In the following
example the file name of the first picture is displayed:
Sub ShowFirstObjectOfCollection()
'VBA236
Dim strName As String
strName = Application.Documents(3).Name
MsgBox strName
End Sub
You may also use the object " Me " if you wish to address the current document:
Sub ShowDocumentName()
'VBA???
Dim obj As Document
set obj = Me
MsgBox obj.Name
End Sub
For example, use the SaveAs method to save the picture under a different name.
In the following example the first picture will be saved under the name
" CopyOfPicture1 " :
Sub SaveDocumentAs()
'VBA237
Application.Documents(3).SaveAs ( " CopyOfPicture1 " )
End Sub

408

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The Document object possesses the following properties:
Application
BackColor
CursorMode
CustomMenus
CustomToolbars
Events
ExtendedZoomingEnable
FillColor
FillStyle
Grid
GridColor
GridHeight
GridWidth
Height
Hide
HMIObjects
LastChange
LockedByCreatorID
Name
Operation
Parent
PasswordLevel
Path
Properties
SelectedShapes
HMIObjects
SnapToGrid
TABOrderAllShapes
TABOrderKeyboard
TABOrderMouse
TABOrderOtherAction
UpdateCycle
Views
Visible
Width
ExtendedZoomingEnable

Printout of the Online Help
Automated Configuring

409

ActualPointTopIndex

5.6.2.6

11.05

Documents Object (Listing)

Description

VBA Object Name
HMIDocuments

Usage

Note:
Use the " ActiveDocument " property if you wish to refer to the active picture.
Use the Documents property to return the Documents listing. In the following
example the names of all open pictures are output:
Sub ShowDocuments()
'VBA238
Dim colDocuments As Documents
Dim objDocument As Document
Set colDocuments = Application.Documents
For Each objDocument In colDocuments
MsgBox objDocument.Name
Next objDocument
End Sub
Use the Add method to add a new Document object to the Documents listing. In
the following example a new picture is created:
Sub AddNewDocument()
'VBA239
Dim objDocument As Document
Set objDocument = Application.Documents.Add
End Sub

410

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The Documents object possesses the following properties:
ActiveDocument
Application
Count
Parent

Printout of the Online Help
Automated Configuring

411

ActualPointTopIndex

5.6.2.7

11.05

DynamicDialog Object

Description

Represents the Dynamic dialog. You can use the dynamic dialog to make the
properties of pictures and objects respond dynamically to different value ranges.
Define the value range with the aid of the ResultType property.

VBA Object Name
HMIDynamicDialog

Usage
Use the DynamicDialog object to make an object property dynamic with the aid of
the Dynamic dialog. In the following example the radius of a circle will be
dynamically configured using the Dynamic dialog, a tag name will be assigned and
three analog value ranges will be created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA240
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.Trigger.VariableTriggers.Add " NewDynamic1 " ,
hmiCycleType_5s
.AnalogResultInfos.Add 50, 40
.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
End With

412

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End Sub

Object Properties
The DynamicDialog object has the following properties:
AnalogResultInfos
Application
BinaryResultInfo
BitResultInfo
Compiled
Parent
ResultType
ScriptType
SourceCode
Trigger
VariableStateChecked
VariableStateValues

Printout of the Online Help
Automated Configuring

413

ActualPointTopIndex

5.6.2.8

11.05

Ellipse Object

Description

Represents the " Ellipse " object. The Ellipse object is an element of the following
listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIEllipse

Usage
Use the Add method to create a new " Ellipse " object in a picture:
Sub AddEllipse()
'VBA241
Dim objEllipse As HMIEllipse
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " Ellipse " ,
" HMIEllipse " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditEllipse()
'VBA242
Dim objEllipse As HMIEllipse
Set objEllipse = ActiveDocument.HMIObjects( " Ellipse " )
objEllipse.BorderColor = RGB(255, 0, 0)
End Sub

414

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA243
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Ellipse object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
RadiusHeight
RadiusWidth
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

415

ActualPointTopIndex

5.6.2.9

11.05

EllipseArc Object

Description

Represents the " Ellipse Arc " object. The EllipseArc object is an element of the
following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIEllipseArc

Usage
Use the Add method to create a new " Ellipse Arc " object in a picture:
Sub AddEllipseArc()
'VBA244
Dim objEllipseArc As HMIEllipseArc
Set objEllipseArc =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseArc " ,
" HMIEllipseArc " )
End Sub

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditEllipseArc()
'VBA245
Dim objEllipseArc As HMIEllipseArc
Set objEllipseArc = ActiveDocument.HMIObjects( " EllipseArc " )
objEllipseArc.BorderColor = RGB(255, 0, 0)
End Sub

Use " Selection " (Index) to return an object from the Selection listing.

416

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Sub ShowNameOfFirstSelectedObject()
'VBA246
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Use " HMIDefaultObjects(Index) " to return an object from the HMIDefaultObjects
listing:
Sub EditDefaultPropertiesOfEllipseArc()
'VBA247
Dim objEllipseArc As HMIEllipseArc
Set objEllipseArc =
Application.DefaultHMIObjects( " HMIEllipseArc " )
objEllipseArc.BorderColor = RGB(255, 255, 0)
'create new " EllipseArc " -object
Set objEllipseArc =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseArc2 " ,
" HMIEllipseArc " )
End Sub

Object Properties
The EllipseArc object possesses the following properties:
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
EndAngle
FlashBorderColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
RadiusHeight
RadiusWidth
StartAngle
ToolTipText
Top
Visible
Width

5.6.2.10 EllipseSegment Object

Printout of the Online Help
Automated Configuring

417

ActualPointTopIndex

11.05

Description

Represents the " Ellipse Segment " object. The EllipseSegment object is an element
of the following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIEllipseSegment

Usage
Use the Add method to create a new " Ellipse Segment " object in a picture:
Sub AddEllipseSegment()
'VBA248
Dim objEllipseSegment As HMIEllipseSegment
Set objEllipseSegment =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseSegment " ,
" HMIEllipseSegment " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditEllipseSegment()
'VBA249
Dim objEllipseSegment As HMIEllipseSegment
Set objEllipseSegment =
ActiveDocument.HMIObjects( " EllipseSegment " )
objEllipseSegment.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA250

418

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The EllipseSegment object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
EndAngle
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
RadiusHeight
RadiusWidth
StartAngle
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

419

ActualPointTopIndex

11.05

5.6.2.11 Event Object

Description

Represents an event that triggers one or more actions in runtime (e.g. a direct
connection). An event can be configured onto an object and a property.

VBA Object Name
HMIEvent
Usage
Use the AddAction method to configure an action on an event. In this example a C
action is to be triggered in the event of a change of radius in runtime:
Sub AddActionToPropertyTypeCScript()
'VBA251
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
'Create circle in the picture. If property " Radius " is
changed,
'a C-action is added:
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
Set objEvent = objCircle.Radius.Events(1)
Set objCScript =
objEvent.Actions.AddAction(hmiActionCreationTypeCScript)
End Sub

Object Properties
The Event object possesses the following properties:
Actions
Application
EventType
Parent

5.6.2.12 Events Object (Listing)

420

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description

A listing of the Event objects that represent all the events configured onto an
object. Use the Item method to define the event that is intended to be configured:


You configure an action on a property with VBA by using the " Events(1) "
property, where the index " 1 " stands for the event " Upon change " .



To configure an action onto an object with the aid of VBA, use the
" Events(Index) " property, where " Index " stands for the trigger event (see table):

Index

EventType (depending upon the object used)

0

hmiEventTypeNotDefined

1

hmiEventTypeMouseClick

2

hmiEventTypeMouseLButtonDown

3

hmiEventTypeMouseLButtonUp

4

hmiEventTypeMouseRButtonDown

5

hmiEventTypeMouseRButtonUp

6

hmiEventTypeKeyboardDown

7

hmiEventTypeKeyboardUp

8

hmiEventTypeObjectChange

9

hmiEventTypePropertyChange

10

hmiEventTypePropertyStateChange

11

hmiEventTypePictureOpen

12

hmiEventTypePictureClose

13

hmiEventTypeObjectDefined

14

hmiEventTypeFocusEnter

15

hmiEventTypeLastTriggerType

16

hmiEventTypeObjSpecificTriggerStart

Printout of the Online Help
Automated Configuring

421

ActualPointTopIndex

11.05

VBA Object Name
HMIEvents

Usage
Use the Item method to return an individual Event object. In this example the event
names and event types of all objects in the active picture are output. In order for
this example to work, insert some objects into the active picture and configure
various events.
Sub ShowEventsOfAllObjectsInActiveDocument()
'VBA252
Dim colEvents As HMIEvents
Dim objEvent As HMIEvent
Dim iMax As Integer
Dim iIndex As Integer
Dim iAnswer As Integer
Dim strEventName As String
Dim strObjectName As String
Dim varEventType As Variant
iIndex = 1
iMax = ActiveDocument.HMIObjects.Count
For iIndex = 1 To iMax
Set colEvents =
ActiveDocument.HMIObjects(iIndex).Events
strObjectName =
ActiveDocument.HMIObjects(iIndex).ObjectName
For Each objEvent In colEvents
strEventName = objEvent.EventName
varEventType = objEvent.EventType
iAnswer = MsgBox( " Objectname: " & strObjectName & vbCrLf &
" Eventtype: " & varEventType & vbCrLf & " Eventname: " &
strEventName, vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objEvent
If vbCancel = iAnswer Then Exit For
Next iIndex
End Sub

422

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The Events object possesses the following properties:
Application
Count
Parent

Printout of the Online Help
Automated Configuring

423

ActualPointTopIndex

11.05

5.6.2.13 FolderItem Object

Description

Represents a folder or object in the Components Library. A FolderItem object of
the " Folder " type is an element of the FolderItems listing. A FolderItem object of the
" Item " type is an element of the Folder listing.
VBA Object Name
HMIFolderItem
Usage
Use the FolderItems property to return the FolderItems listing. In the following
example the names of folders in the " Global Library " will be output:
Sub ShowFolderItemsOfGlobalLibrary()
'VBA253
Dim colFolderItems As HMIFolderItems
Dim objFolderItem As HMIFolderItem
Set colFolderItems =
Application.SymbolLibraries(1).FolderItems
For Each objFolderItem In colFolderItems
MsgBox objFolderItem.Name
Next objFolderItem
End Sub
Use the CopyToClipboard method to copy a " FolderItem " object of the " Item " type
to the clipboard. In the following example the object " PC " will be copied to the
clipboard.
Sub CopyFolderItemToClipboard()
'VBA254
Dim objGlobalLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
objGlobalLib.FolderItems( " Folder2 " ).Folder( " Folder2 " ).Fo
lder.Item( " Object1 " ).CopyToClipboard
End Sub
Object Properties

424

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

The FolderItem object possesses the following properties:
Application
Folder
LDNames
Name
Parent
Type

Printout of the Online Help
Automated Configuring

425

ActualPointTopIndex

11.05

5.6.2.14 FolderItems Object (Listing)

Description

A listing of the FolderItem objects that represent all the folders and objects in the
Components Library.

VBA Object Name
HMIFolderItems

Usage
Use the FolderItems property to return the FolderItems listing. " In the following
example the names of folders in the " Global Library will be output:
Sub ShowFolderItemsOfGlobalLibrary()
'VBA255
Dim colFolderItems As HMIFolderItems
Dim objFolderItem As HMIFolderItem
Set colFolderItems =
Application.SymbolLibraries(1).FolderItems
For Each objFolderItem In colFolderItems
MsgBox objFolderItem.Name
Next objFolderItem
End Sub

426

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use the AddFolder method, for instance, to create a new folder in the Components
Library. In the following example the folder " Project Folder " will be created in the
" Project Library " :
Sub AddNewFolderToProjectLibrary()
'VBA256
Dim objProjectLib As HMISymbolLibrary
Set objProjectLib = Application.SymbolLibraries(2)
objProjectLib.FolderItems.AddFolder ( " My Folder " )
End Sub

Object Properties
The FolderItems object possesses the following properties:
Application
Count
Parent

Printout of the Online Help
Automated Configuring

427

ActualPointTopIndex

11.05

5.6.2.15 GraphicObject Object

Description

Represents the object called " Graphic Object " . The GraphicObject object is an
element of the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIGraphicObject
Usage
Use the Add method to create a new " Graphic Object " object in a picture:
Sub AddGraphicObject()
'VBA257
Dim objGraphicObject As HMIGraphicObject
Set objGraphicObject =
ActiveDocument.HMIObjects.AddHMIObject( " Graphic-Object " ,
" HMIGraphicObject " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditGraphicObject()
'VBA258
Dim objGraphicObject As HMIGraphicObject
Set objGraphicObject =
ActiveDocument.HMIObjects( " Graphic-Object " )
objGraphicObject.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

428

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Sub ShowNameOfFirstSelectedObject()
'VBA259
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub
The GraphicObject object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
PicReferenced
PicTransColor
PictureName
PicUseTransColor
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

429

ActualPointTopIndex

11.05

5.6.2.16 Group Object

Description

Represents the object called " Group Object " . The Group Object is an element of
the following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

A group object is created from the objects selected in a picture. The objects in the
Group Object are also saved in the " GroupedHMIObjects " listing and index
numbers are newly allocated.
You have unrestricted access to the properties of all objects in the Group Object.
Further information regarding group objects can be found in the WinCC
documentation under " Group Object " .

VBA Object Name
HMIGroup

Usage
Use the CreateGroup Method with the Selection listing to create a new " Group
Object " object in a picture:
Sub DoCreateGroup()
'VBA260
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.Selection.CreateGroup
objGroup.ObjectName = " Group-Object "
End Sub

430

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use the following methods to edit an existing Group Object:


Method " Add " (Index): Adds a new object to the group object.



Method " Remove " (Index): Removes a new object from the group object.



" UnGroup " () method: ungroups the group object (cancels grouping).



" Delete " () method: deletes the group object and the objects that it contains.

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditGroup()
'VBA261
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " Group-Object " )
MsgBox objGroup.ObjectName
End Sub

Printout of the Online Help
Automated Configuring

431

ActualPointTopIndex

11.05

5.6.2.17 GroupDisplay Object

Description

Represents the " Group Display " object. The GroupDisplay object is an element of
the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

VBA Object Name
HMIGroupDisplay

Usage
Use the Add method to create a new " Group Display " object in a picture:
Sub AddGroupDisplay()
'VBA262
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " Groupdisplay " ,
" HMIGroupDisplay " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditGroupDisplay()
'VBA263
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects( " Groupdisplay " )
objGroupDisplay.BackColor = RGB(255, 0, 0)
End Sub

432

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA264
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The GroupDisplay object possesses the following properties:
AlignmentLeft
AlignmentTop
BackBorderWidth
BackColor
Button1Width
Button2Width
Button3Width
Button4Width
CollectValue
FlashRate
FontBold
FontItalic
FontName
FontSize
FontUnderline
Height
Layer
Left
LockBackColor
LockStatus
LockTextColor
LockText
MCGUBackColorOff
MCGUBackColorOn
MCGUBackFlash
MCGUTextColorOff
MCGUTextColorOn
MCGUTextFlash
MCKOBackColorOff
MCKOBackColorOn
MCKOBackFlash
MCKOTextColorOff
MCKOTextColorOn
MCKOTextFlash
MCKQBackColorOff
MCKQBackColorOn

Printout of the Online Help
Automated Configuring

433

ActualPointTopIndex

11.05

MCKQBackFlash
MCKQTextColorOff
MCKQTextColorOn
MCKQTextFlash
MCText
MessageClass
Name
Operation
PasswordLevel
Relevant
SameSize
SignificantMask
ToolTipText
Top
UserValue1
UserValue2
UserValue3
UserValue4
Visible
Width

434

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.2.18 GroupedObjects Object (Listing)

Description

A listing of the HMIObject objects that represent all the objects in the group object.

VBA Object Name
HMIGroupedObjects

Usage
Use the GroupedHMIObjects property to return the GroupedObjects listing. In the
following example all the objects in the first group object are output in the active
picture. The group object called " Group1 " must first have been created:
Sub ShowGroupedObjectsOfFirstGroup()
'VBA265
Dim colGroupedObjects As HMIGroupedObjects
Dim objObject As HMIObject
Set colGroupedObjects =
ActiveDocument.HMIObjects( " Group1 " ).GroupedHMIObjects
For Each objObject In colGroupedObjects
MsgBox objObject.ObjectName
Next objObject
End Sub
Use the Remove method, for instance, to remove an object from the group object.
In the following example the first object will be removed from the group object
called " Group1 " :
Sub RemoveObjectFromGroup()
'VBA266
Dim objGroup As HMIGroup
Set objGroup = ActiveDocument.HMIObjects( " Group1 " )
objGroup.GroupedHMIObjects.Remove (1)
End Sub
Object Properties

Printout of the Online Help
Automated Configuring

435

ActualPointTopIndex

11.05

The GroupedObjects object possesses the following properties:
Application
Count
GroupedHMIObjects
Parent

436

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.2.19 HMIDefaultObjects Object (Listing)

Description

A listing of the following HMIObject objects:
Position
in the
Listing

Object

VBA Object Name

1

Line

HMILine

2

Polygon

HMIPolygon

3

Polyline

HMIPolyLine

4

Ellipse

HMIEllipse

5

Circle

HMICircle

6

Ellipse Segment

HMIEllipseSegment

7

Pie Segment

HMIPieSegment

8

Ellipse Arc

HMIEllipseArc

9

Circular Arc

HMICircularArc

10

Rectangle

HMIRectangle

11

Rounded Rectangle

HMIRoundRectangle

12

Application Window

HMIApplicationWindow

13

Picture Window

HMIPictureWindow

14

Static Text

HMIStaticText

15

I/O-Field

HMIIOField

16

Button

HMIButton

17

Check Box

HMICheckBox

18

Option Group

HMIOptionGroup

19

Round Button

HMIRoundButton

20

Bar Graph

HMIBarGraph

21

Slider Object

HMISlider

22

Status Display

HMIStatusDisplay

23

Text List

HMITextList

Printout of the Online Help
Automated Configuring

437

ActualPointTopIndex

11.05

VBA Object Name
HMIDefaultObjects
Usage
Use the DefaultHMIObjects property to change the default settings for the property
values of the objects contained in the listing. In this example all the objects
contained in the listing will be output:
Sub ShowDefaultObjects()
'VBA267
Dim strType As String
Dim strName As String
Dim strMessage As String
Dim iMax As Integer
Dim iIndex As Integer
iMax = Application.DefaultHMIObjects.Count
iIndex = 1
For iIndex = 1 To iMax
With Application.DefaultHMIObjects(iIndex)
strType = .Type
strName = .ObjectName
strMessage = strMessage & " Element: " & iIndex & " /
Objecttype: " & strType & " / Objectname: " & strName
End With
If 0 = iIndex Mod 10 Then
MsgBox strMessage
strMessage = " "
Else
strMessage = strMessage & vbCrLf & vbCrLf
End If
Next iIndex
MsgBox " Element: " & iIndex & vbCrLf & " Objecttype: " &
strType & vbCrLf & " Objectname: " & strName
End Sub
Object Properties
The HMIDefaultObjects object possesses the following properties:
Application
DefaultHMIObjects
Count
Parent
Properties
Item
ApplicationWindow

438

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

BarGraph
Button
CheckBox
Circle
CircularArc
Ellipse
EllipseArc
EllipseSegment
IOField
Line
OptionGroup
PictureWindow
PieSegment
Polygon
PolyLine
Rectangle
RoundButton
RoundRectangle
Slider
StaticText
StatusDisplay
TextList

Printout of the Online Help
Automated Configuring

439

ActualPointTopIndex

11.05

5.6.2.20 HMIObject Object

Description

Represents an object from the Object Palette of the Graphics Designer. The
HMIObject object is an element of the following listings:


HMIObjects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

This object contains the object properties that apply to all standard, smart and
Windows objects (incl. Width, Height, Top and Left).

VBA Object Name
HMIObject
Usage
Use HMIObjects(Index), for instance, to return an individual HMIObject object. For
" Index " you can use either the index number or the name of the object. In the
following example the name of the first object in the active picture is output:
Sub ShowFirstObjectOfCollection()
'VBA268
Dim strName As String
strName = ActiveDocument.HMIObjects(1).ObjectName
MsgBox strName
End Sub
Use the Delete method to remove an object from the HMIObjects listing. In the
following example the first object in the active picture will be removed:
Sub DeleteObject()
'VBA269
ActiveDocument.HMIObjects(1).Delete
End Sub

440

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The HMIObject object possesses the following properties:
Application
Events
GroupParent
Height
Layer
LDTooltipTexts
Left
Name
Operation
Parent
PasswordLevel
Properties
Selected
TabOrderSwitch
TabOrderAlpha
ToolTipText
Top
Type
Visible
Width

Printout of the Online Help
Automated Configuring

441

ActualPointTopIndex

11.05

5.6.2.21 HMIObjects Object (Listing)

Description

A listing of the HMIObject objects that represent all the objects in the picture.

VBA Object Name
HMIObjects

Usage
Use the HMIObjects property to return the HMIObjects listing. In the following
example all the object names in the active picture are output:
Sub ShowObjectsOfDocument()
'VBA270
Dim colObjects As HMIObjects
Dim objObject As HMIObject
Set colObjects = ActiveDocument.HMIObjects
For Each objObject In colObjects
MsgBox objObject.ObjectName
Next objObject
End Sub
Use the AddHMIObject method to create a new object in the picture. In the
following example a circle will be inserted into the active picture:
Sub AddCircle()
'VBA271
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_1 " ,
" HMICircle " )
End Sub

442

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use the Find method to search for one or more objects in the picture. In the
following example, objects of the " HMICircle " type will be searched for in the active
picture:
Sub FindObjectsByType()
'VBA272
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
Set colSearchResults =
ActiveDocument.HMIObjects.Find(ObjectType:= " HMICircle " )
For Each objMember In colSearchResults
iResult = colSearchResults.Count
strName = objMember.ObjectName
MsgBox " Found: " & CStr(iResult) & vbCrLf &
" Objectname: " & strName
Next objMember
End Sub

Object Properties
The HMIObjects object possesses the following properties:
Application
Count
Parent

Printout of the Online Help
Automated Configuring

443

ActualPointTopIndex

11.05

5.6.2.22 IOField Object

Description

Represents the " I/O Field " object. The IOField object is an element of the following
listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default settings for the property values of all
standard objects, Windows objects and smart objects.

VBA Object Name
HMIIOField
Usage
Use the Add method to create a new " I/O Field " object in a picture:
Sub AddIOField()
'VBA273
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IO-Field " ,
" HMIIOField " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditIOField()
'VBA274
Dim objIOField As HMIIOField
Set objIOField = ActiveDocument.HMIObjects( " IO-Field " )
objIOField.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

444

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Sub ShowNameOfFirstSelectedObject()
'VBA275
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub
Use " HMIDefaultObjects " (Index) to return an object from the HMIDefaultObjects
listing:
Sub EditDefaultPropertiesOfIOField()
'VBA276
Dim objIOField As HMIIOField
Set objIOField =
Application.DefaultHMIObjects( " HMIIOField " )
objIOField.BorderColor = RGB(255, 255, 0)
End Sub

Object Properties
The IOField object possesses the following properties:
AdaptBorder
AlignmentLeft
AlignmentTop
AssumeOnExit
AssumeOnFull
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
BoxType
ClearOnError
ClearOnNew
CursorControl
DataFormat
EditAtOnce
FillColor
FillStyle
FlashBackColor
FlashBorderColor
FlashForeColor
FlashRateBackColor

Printout of the Online Help
Automated Configuring

445

ActualPointTopIndex

11.05

FlashRateBorderColor
FlashRateForeColor
FontBold
FontItalic
FontName
FontSize
FontUnderline
ForeColor
ForeFlashColorOff
ForeFlashColorOn
Height
HiddenInput
Layer
Left
LimitMax
LimitMin
Name
Operation
OperationMessage
OperationReport
Orientation
OutputFormat
OutputValue
PasswordLevel
ToolTipText
Top
Visible
Width

446

Printout of the Online Help
Automated Configuring

11.05

5.6.3
5.6.3.1

ActualPointTopIndex

VBA Objects and Listings: L-P
LanguageFont Object

Description

Contains the font settings for the project language. The LanguageFont object is an
element of the LanguageFonts listing.
VBA Object Name
HMILanguageFont
Usage
Use LDFonts(Index) to return an individual LanguageFont object. In the following
example a Button object will be created and the name of the first configured font
will be output:
Sub ShowFirstObjectOfCollection()
'VBA277
Dim strName As String
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button " ,
" HMIButton " )
strName = objButton.LDFonts(1).Family
MsgBox strName
End Sub
Object Properties
The LanguageFont object possesses the following properties:
Application
Bold
Family
Italic
LanguageID
Parent
Size
Underlined

5.6.3.2

LanguageFonts Object (Listing)

Printout of the Online Help
Automated Configuring

447

ActualPointTopIndex

11.05

Description

A listing of the LanguageFont objects that represent all the language-dependent
fonts in an object.
VBA Object Name
HMILanguageFonts
Usage
Use the LDFonts property to return the LanguageFonts listing. In the following
example the language identifiers of the configured fonts will be output:
Sub ShowLanguageFont()
'VBA278
Dim colLanguageFonts As HMILanguageFonts
Dim objLanguageFont As HMILanguageFont
Dim objButton As HMIButton
Dim iMax As Integer
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
Set colLanguageFonts = objButton.LDFonts
iMax = colLanguageFonts.Count
For Each objLanguageFont In colLanguageFonts
MsgBox " Planned fonts: " & iMax & vbCrLf &
" Language-ID: " & objLanguageFont.LanguageID
Next objLanguageFont
End Sub
Use the ItemByLcid method to define the language for which it is intended to enter
font settings. The following example sets the font attributes of a button for French
and English.
Note:
For this example to work, you must already have configured in the languages
concerned.

448

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Sub ExampleForLanguageFonts()
'VBA279
Dim colLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " DefText "
Set colLangFonts = objButton.LDFonts
'Adjust fontsettings for french:
With colLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'Adjust fontsettings for english:
With colLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

Object Properties
The LanguageFonts object possesses the following properties:
Application
Count
Parent

Printout of the Online Help
Automated Configuring

449

ActualPointTopIndex

5.6.3.3

11.05

LanguageText Object

Description

Contains the multilingual labels for an object. The LanguageText object is an
element of the LanguageTexts listing.
VBA Object Name
HMILanguageText
Usage
In the following example a German label and an English label will be assigned to
the button called " myButton " :
Sub AddLanguagesToButton()
'VBA280
Dim objLabelText As HMILanguageText
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
'
'Add text in actual datalanguage:
objButton.Text = " Actual-Language Text "
'
'Add english text:
Set objLabelText =
ActiveDocument.HMIObjects( " myButton " ).LDTexts.Add(1033,
" English Text " )
End Sub

Object Properties
The LanguageText object possesses the following properties:
Application
DisplayText
LanguageID
Parent

5.6.3.4

450

LanguageTexts Object (Listing)

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description

A listing of the LanguageText objects that represent all the multilingual texts in an
object.

VBA Object Name
HMILanguageTexts

Usage
Use one of the following properties to return the LanguageTexts listing.


LDLabelTexts Property



LDNames Property



LDStatusTexts Property



LDTexts Property



LDTooltipTexts Property

An example showing how to use the LanguageTexts listing can be found in this
documentation under the heading " LDStatusTexts Property " .
Use the Add method to add multilingual texts to an object. In the following example
a German label and an English label will be assigned to the button called
" myButton " :
Sub AddLanguagesToButton()
'VBA281
Dim objLabelText As HMILanguageText
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
'
'Add text in actual datalanguage:
objButton.Text = " Actual-Language Text "
'
'Add english text:

Printout of the Online Help
Automated Configuring

451

ActualPointTopIndex

11.05

Set objLabelText =
ActiveDocument.HMIObjects( " myButton " ).LDTexts.Add(1033,
" English Text " )
End Sub
Object Properties
The LanguageTexts object possesses the following properties:
Application
Count
LDLabelTexts
LDNames
LDStatusTexts
LDTexts
LDTooltipTexts
Parent

452

Printout of the Online Help
Automated Configuring

11.05

5.6.3.5

ActualPointTopIndex

Layer Object

Description

Represents one of the 32 layers that are available in the picture.

VBA Object Name
HMILayer

Usage
Use the Layer object to define a name and the minimum and maximum zoom for a
layer. You define the visibility of layers separately by CS and RT layers:


Document object: Controls the visibility of the RT layers.



View object: Controls the visibility of the CS layers.

Use the Layers listing to return a Layer object. In the following example the settings
for the lowest layer are configured in the active picture:
Sub ConfigureSettingsOfLayer()
'VBA282
Dim objLayer As HMILayer
Set objLayer = ActiveDocument.Layers(1)
With objLayer
'configure " Layer 0 "
.MinZoom = 10
.MaxZoom = 100
.Name = " Configured with VBA "
End With
End Sub

Printout of the Online Help
Automated Configuring

453

ActualPointTopIndex

11.05

Object Properties
The Layer object possesses the following properties:
ActiveLayer
Layers
LDNames
MaxZoom
MinZoom
Name
Number
Visible

454

Printout of the Online Help
Automated Configuring

11.05

5.6.3.6

ActualPointTopIndex

Layers Object (Listing)

Description

A listing of the Layer objects that represent the 32 layers in the picture.
VBA Object Name
HMILayer
Usage
Use the LayersCS or LayersRT property to return the Layers listing. In the
following example the layer names in the copy of the active picture will be output:
Sub ShowLayer()
'VBA283
Dim colLayers As HMILayers
Dim objLayer As HMILayer
Dim strLayerList As String
Dim iCounter As Integer
iCounter = 1
Set colLayers = ActiveDocument.Layers
For Each objLayer In colLayers
If 1 = iCounter Mod 2 And 32 & gt; iCounter Then
strLayerList = strLayerList & vbCrLf
ElseIf 11 & gt; iCounter Then
strLayerList = strLayerList & "

"

Else
strLayerList = strLayerList & "

"

End If
strLayerList = strLayerList & objLayer.Name
iCounter = iCounter + 1
Next objLayer
MsgBox strLayerList
End Sub

Object Properties

Printout of the Online Help
Automated Configuring

455

ActualPointTopIndex

11.05

The Layers object possesses the following properties:
Application
Count
Parent

456

Printout of the Online Help
Automated Configuring

11.05

5.6.3.7

ActualPointTopIndex

Line Object

Description

Represents the " Line " object. The Line object is an element of the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMILine
Usage
Use the Add method to create a new " Line " object in a picture:
Sub AddLine()
'VBA285
Dim objLine As HMILine
Set objLine =
ActiveDocument.HMIObjects.AddHMIObject( " Line1 " ,
" HMILine " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditLine()
'VBA286
Dim objLine As HMILine
Set objLine = ActiveDocument.HMIObjects( " Line1 " )
objLine.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

Printout of the Online Help
Automated Configuring

457

ActualPointTopIndex

11.05

Sub ShowNameOfFirstSelectedObject()
'VBA287
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Line object possesses the following properties:
ActualPointLeft
ActualPointTop
BorderBackColor
BorderColor
BorderEndStyle
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FlashBorderColor
FlashRateBorderColor
Height
Index
Layer
Left
Name
Operation
PasswordLevel
ReferenceRotationLeft
ReferenceRotationTop
RotationAngle
ToolTipText
Top
Visible
Width

458

Printout of the Online Help
Automated Configuring

11.05

5.6.3.8

ActualPointTopIndex

Menu Object

Description

Represents the " User Defined Menu " object. The Menu object is an element of the
CustomMenus listing.
VBA Object Name
HMIMenu
Usage
Use CustomMenus(Index) to return an individual Menu object. For " Index " you can
use either the index number or the name of the object. In order for the following
example to work, create a user defined menu. For an example of this, please refer
to " Creating a New Application-Specific Menu " in this documentation. In the
following example the name of the first user-defined menu in the active picture will
be output:
Sub ShowFirstMenuOfMenucollection()
'VBA288
Dim strName As String
strName = ActiveDocument.CustomMenus(1).Label
MsgBox strName
End Sub
Use the Delete method to remove a " Menu " object from the " CustomMenus " listing.
In the following example the first user-defined menu in the active picture will be
removed:
Sub DeleteMenu()
'VBA289
Dim objMenu As HMIMenu
Set objMenu = ActiveDocument.CustomMenus(1)
objMenu.Delete
End Sub
Object Properties

Printout of the Online Help
Automated Configuring

459

ActualPointTopIndex

11.05

The Menu object possesses the following properties:
Application
Enabled
Key
Label
LDLabelTexts
LDStatusTexts
MenuItems
Parent
Position
StatusText
Visible

460

Printout of the Online Help
Automated Configuring

11.05

5.6.3.9

ActualPointTopIndex

Menus Object (Listing)

Description

A listing of the Menu objects that represent all the user-defined menus in the
Graphics Designer.

VBA Object Name
HMIMenus

Usage
Use the CustomMenus property to return the Menus listing. In the following
example all the user-defined menus in the active picture will be output.
Note:
The Menus listing does not distinguish between application-specific and picturespecific menus in the output.
Sub ShowCustomMenusOfDocument()
'VBA290
Dim colMenus As HMIMenus
Dim objMenu As HMIMenu
Dim strMenuList As String
Set colMenus = ActiveDocument.CustomMenus
For Each objMenu In colMenus
strMenuList = strMenuList & objMenu.Label & vbCrLf
Next objMenu
MsgBox strMenuList
End Sub

Printout of the Online Help
Automated Configuring

461

ActualPointTopIndex

11.05

Use the Application property and the InsertMenu method if you want to create an
application-specific menu. Create the VBA code in either the " Project Template "
document or the " Global Template " document. In the following example a userdefined menu called " myApplicationMenu " will be created:
Sub InsertApplicationSpecificMenu()
'VBA291
Dim objMenu As HMIMenu
Set objMenu = Application.CustomMenus.InsertMenu(1,
" a_Menu1 " , " myApplicationMenu " )
End Sub
Use the ActiveDocument property and the InsertMenu method if you want to create
a picture-specific menu. Create the VBA code in the document called
" ThisDocument " : In the following example a picture-specific menu called
" myDocumentMenu " will be created:;
Sub InsertDocumentSpecificMenu()
'VBA292
Dim objMenu As HMIMenu
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" d_Menu1 " , " myDocumentMenu " )
End Sub

Object Properties
The Menus object possesses the following properties:
Application
Count
Parent

462

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.10 MenuItem Object

Description

Represents a menu entry for a user-defined menu in the Graphics Designer. The
MenuItem object is an element of the MenuItems listing.

VBA Object Name
HMIMenuItem
Usage

Note:
In order for the examples to work, first create a user-defined menu. For an
example of this, please refer to " Adding a New Entry to the Menu " in this
documentation.
Use MenuItems(Index) to return an individual MenuItem object. For " Index " you
can use either the index number or the name of the object. In the following
example the first entry in the first user-defined menu in the active picture will be
output:
Sub ShowFirstObjectOfCollection()
'VBA293
Dim strName As String
strName =
ActiveDocument.CustomMenus(1).MenuItems(1).Label
MsgBox strName
End Sub

Printout of the Online Help
Automated Configuring

463

ActualPointTopIndex

11.05

Use the Delete method to remove an object from the " MenuItems " listing. In the
following example the first entry in the first user-defined menu in the active picture
will be deleted:
Sub DeleteMenuItem()
'VBA294
ActiveDocument.CustomMenus(1).MenuItems(1).Delete
End Sub
Object Properties
The MenuItem object possesses the following properties:
Application
Checked
Enabled
Icon
Key
Label
LDLabelTexts
LDStatusTexts
Macro
MenuItemType
Parent
Position
ShortCut
StatusText
SubMenu
Tag
Visible

464

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.11 MenuItems Object (Listing)

Description

A listing of the MenuItem objects that represent all the entries in a user-defined
menu.

Usage

Note:
In order for the examples to work, first create a user-defined menu. " For an
example of this, please refer to " Adding a New Entry to the Menu in this
documentation.
Use the MenuItems property to return the MenuItems listing. In the following
example all the entries in the first user-defined menu in the active picture will be
output:
Note:
The MenuItems listing does not distinguish between an application-specific and a
picture-specific menu in the output.

Printout of the Online Help
Automated Configuring

465

ActualPointTopIndex

11.05

Sub ShowMenuItems()
'VBA295
Dim colMenuItems As HMIMenuItems
Dim objMenuItem As HMIMenuItem
Dim strItemList As String
Set colMenuItems =
ActiveDocument.CustomMenus(1).MenuItems
For Each objMenuItem In colMenuItems
strItemList = strItemList & objMenuItem.Label &
vbCrLf
Next objMenuItem
MsgBox strItemList
End Sub
Use the InsertMenuItem method, for instance, to insert an entry into an existing
user-defined menu. In the following example the picture-specific menu " DocMenu2 "
will be created in the active picture and the menu entry " MenuItem 1 " will be
inserted:
Sub InsertMenuItem()
'VBA296
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(2,
" d_Menu2 " , " DocMenu2 " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" m_Item2_1 " , " MenuItem 1 " )
End Sub

Object Properties
The MenuItems object possesses the following properties:
Application
Count
Parent

466

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.12 ObjConnection Object

Description
Represents the " Connector " object. The ObjConnection object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

Note:
You have read-only access to the properties of the ObjConnection object.
VBA Object Name
HMIobjConnection

Usage
From the properties of the ObjConnection object you can find out which objects are
connected.

Example
In order for the following example to work you must have connected two objects to
the connector in the active picture of the Graphics Designer. You can find the
Connector object in the Graphics Designer in the Object Palette under " Standard
Objects " . For this example to work, give the connector the name " Connector1 " .
In the user-defined menu " Connector Info " you can click on the " Connector Info "
entry and display the objects connected via the connector:
Sub ShowConnectorInfo_Menu()
'VBA297
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim strDocName As String
strDocName = Application.ApplicationDataPath &
ActiveDocument.Name
Set objMenu =
Documents(strDocName).CustomMenus.InsertMenu(1,
" ConnectorMenu " , " Connector_Info " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" ShowConnectInfo " , " Info Connector " )
End Sub

Printout of the Online Help
Automated Configuring

467

ActualPointTopIndex

11.05

Sub ShowConnectorInfo()
Dim objConnector As HMIObjConnection
Dim iStart As Integer
Dim iEnd As Integer
Dim strStart As String
Dim strEnd As String
Dim strObjStart As String
Dim strObjEnd As String
Set objConnector =
ActiveDocument.HMIObjects( " Connector1 " )
iStart =
objConnector.BottomConnectedConnectionPointIndex
iEnd = objConnector.TopConnectedConnectionPointIndex
strObjStart = objConnector.BottomConnectedObjectName
strObjEnd = objConnector.TopConnectedObjectName
Select Case iStart
Case 0
strStart = " top "
Case 1
strStart = " right "
Case 2
strStart = " bottom "
Case 3
strStart = " left "
End Select
Select Case iEnd
Case 0
strEnd = " top "
Case 1
strEnd = " right "
Case 2
strEnd = " bottom "
Case 3
strEnd = " left "
End Select
MsgBox " The selected connector links the objects " &
vbCrLf & " ' " & strObjStart & " ' and ' " & strObjEnd & " ' "
& vbCrLf & " Connected points: " & vbCrLf & strObjStart &
" : " & strStart & vbCrLf & strObjEnd & " : " & strEnd
End Sub

468

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Private Sub Document_MenuItemClicked(ByVal MenuItem As
IHMIMenuItem)
Select Case MenuItem.Key
Case " ShowConnectInfo "
Call ShowConnectorInfo
End Select
End Sub

Printout of the Online Help
Automated Configuring

469

ActualPointTopIndex

11.05

5.6.3.13 OLEObject Object

Description

Represents the object called " OLE Object " . The OLEObject object is an element of
the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.

VBA Object Name
HMIOLEObject

Usage
Use the AddOLEObject method to create a new " OLE Object " object in a picture: In
the following example an OLE object containing a Wordpad document will be
inserted into the active picture:
Sub AddOLEObjectToActiveDocument()
'VBA298
Dim objOleObject As HMIOLEObject
Set objOleObject =
ActiveDocument.HMIObjects.AddOLEObject( " Wordpad
Document " , " Wordpad.Document.1 " )
End Sub

470

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name: In this example the X coordinate
of the OLE object " Wordpad Document " is set to 140:
Sub EditOLEObject()
'VBA299
Dim objOleObject As HMIOLEObject
Set objOleObject = ActiveDocument.HMIObjects( " Wordpad
Document " )
objOleObject.Left = 140
End Sub
Use " Selection(Index) " to return an object from the Selection listing. For " Index "
you can use either the index number or the name of the object. In this example the
name of the first selected object will be output:
Sub ShowNameOfFirstSelectedObject()
'VBA300
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The OLEObject object possesses the following properties:
Application

Printout of the Online Help
Automated Configuring

471

ActualPointTopIndex

11.05

5.6.3.14 OptionGroup Object

Description

Represents the " Option Group " object. The OptionGroup object is an element of
the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIOptionGroup

Usage
Use the Add method to create a new " Option Group " object in a picture:
Sub AddOptionGroup()
'VBA301
Dim objOptionGroup As HMIOptionGroup
Set objOptionGroup =
ActiveDocument.HMIObjects.AddHMIObject( " Radio-Box " ,
" HMIOptionGroup " )
End Sub

472

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditOptionGroup()
'VBA302
Dim objOptionGroup As HMIOptionGroup
Set objOptionGroup = ActiveDocument.HMIObjects( " RadioBox " )
objOptionGroup.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA303
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The OptionGroup object possesses the following properties:
AdaptBorder
AlignmentLeft
AlignmentTop
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
BoxAlignment
BoxCount
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashForeColor
FlashRateBackColor
FlashRateBorderColor
FlashRateForeColor
FontBold

Printout of the Online Help
Automated Configuring

473

ActualPointTopIndex

11.05

FontItalic
FontName
FontSize
FontUnderline
ForeColor
ForeFlashColorOff
ForeFlashColorOn
Height
Index
Layer
Left
Name
Operation
OperationMessage
Orientation
PasswordLevel
Process
Text
ToolTipText
Top
Visible
Width

474

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.15 PictureWindow Object

Description

Represents the " Picture Window " object. The PictureWindow object is an element
of the following listings:


Objects: Contains all objects of a picture.



Selection: Contains all selected objects of a picture.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIPictureWindow

Usage
Use the Add method to create a new " Picture Window " object in a picture:
Sub AddPictureWindow()
'VBA304
Dim objPictureWindow As HMIPictureWindow
Set objPictureWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PictureWindow1 " ,
" HMIPictureWindow " )
End Sub

Printout of the Online Help
Automated Configuring

475

ActualPointTopIndex

11.05

Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditPictureWindow()
'VBA305
Dim objPictureWindow As HMIPictureWindow
Set objPictureWindow =
ActiveDocument.HMIObjects( " PictureWindow1 " )
objPictureWindow.Sizeable = True
End Sub

Use " Selection(Index) " to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA306
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The PictureWindow object possesses the following properties:
AdaptPicture
AdaptSize
Caption
CaptionText
CloseButton
Height
Layer
Left
MaximizeButton
Moveable
Name
OffsetLeft
OffsetTop
OnTop
PictureName
ScrollBars
ScrollPositionX
ScrollPositionY
ServerPrefix
Sizeable
TagPrefix
Top
UpdateCycle
Visible
Width
WindowBorder
Zoom

5.6.3.16 PieSegment Object

476

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description

Represents the " Pie Segment " object. The PieSegment object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIPieSegment

Usage
Use the Add method to create a new " Pie Segment " object in a picture:
Sub AddPieSegment()
'VBA307
Dim objPieSegment As HMIPieSegment
Set objPieSegment =
ActiveDocument.HMIObjects.AddHMIObject( " PieSegment1 " ,
" HMIPieSegment " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditPieSegment()
'VBA308
Dim objPieSegment As HMIPieSegment
Set objPieSegment =
ActiveDocument.HMIObjects( " PieSegment1 " )
objPieSegment.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

Printout of the Online Help
Automated Configuring

477

ActualPointTopIndex

11.05

Sub ShowNameOfFirstSelectedObject()
'VBA309
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The PieSegment object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
EndAngle
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
Radius
StartAngle
ToolTipText
Top
Visible
Width

478

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.17 Polygon Object

Description

Represents the " Polygon " object. The Polygon object is an element of the following
listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIPolygon
Usage
Use the Add method to create a new " Polygon " object in a picture:
Sub AddPolygon()
'VBA310
Dim objPolygon As HMIPolygon
Set objPolygon =
ActiveDocument.HMIObjects.AddHMIObject( " Polygon " ,
" HMIPolygon " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditPolygon()
'VBA311
Dim objPolygon As HMIPolygon
Set objPolygon = ActiveDocument.HMIObjects( " Polygon " )
objPolygon.BorderColor = RGB (255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

Printout of the Online Help
Automated Configuring

479

ActualPointTopIndex

11.05

Sub ShowNameOfFirstSelectedObject()
'VBA312
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Polygon object possesses the following properties:
ActualPointLeft
ActualPointTop
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Index
Layer
Left
Name
Operation
PasswordLevel
PointCount
ReferenceRotationLeft
ReferenceRotationTop
RotationAngle
ToolTipText
Top
Visible
Width

480

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.18 PolyLine Object

Description

Represents the " Polyline " object. The PolyLine object is an element of the following
listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIPolyLine
Usage
Use the Add method to create a new " Polyline " object in a picture:
Sub AddPolyLine()
'VBA313
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
ActiveDocument.HMIObjects.AddHMIObject( " PolyLine1 " ,
" HMIPolyLine " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditPolyLine()
'VBA314
Dim objPolyLine As HMIPolyLine
Set objPolyLine = ActiveDocument.HMIObjects( " PolyLine1 " )
objPolyLine.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

Printout of the Online Help
Automated Configuring

481

ActualPointTopIndex

11.05

Sub ShowNameOfFirstSelectedObject()
'VBA315
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Use " HMIDefaultObjects " (Index) to return an object from the HMIDefaultObjects
listing:
Sub EditDefaultPropertiesOfPolyLine()
'VBA316
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
Application.DefaultHMIObjects( " HMIPolyLine " )
objPolyLine.BorderColor = RGB(255, 255, 0)
End Sub

Object Properties
The PolyLine object possesses the following properties:
ActualPointLeft
ActualPointTop
BorderBackColor
BorderColor
BorderEndStyle
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FlashBorderColor
FlashRateBorderColor
Height
Index
Layer
Left
Name
Operation
PasswordLevel
PointCount
ReferenceRotationLeft
ReferenceRotationTop
RotationAngle
ToolTipText
Top
Visible
Width

5.6.3.19 Property Object

482

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description

Represents the property of an object. In the case of the Property object the use of
the Value property is set as the default. For this reason you can use the following
notation in order for example to assign a new value to an object property:
& lt; Object & gt; . & lt; Property & gt; = & lt; Value & gt;
You can use the " Dynamic " property in order to make an object property dynamic
with the aid of VBA. Use the " Events " listing in order to configure actions with VBA.
The Property object is an element of the Properties listing.

VBA Object Name
HMIProperty

Usage
Use Properties(Index) to return an individual Property object. For " Index " you can
use either the index number or the name of the object property. In the following
example the name of the first property of the Circle object will be output:
Sub ShowFirstObjectOfCollection()
'VBA317
Dim objCircle As HMICircle
Dim strName As String
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle " ,
" HMICircle " )
strName = objCircle.Properties(1).Name
MsgBox strName
End Sub
Use the CreateDynamic method to make an object property dynamic. In the
following example the " Radius " property of a circle object will be made dynamic
with the aid of the tag " NewDynamic1 " , which is updated every two seconds:
Sub DynamicToRadiusOfNewCircle()
'VBA318

Printout of the Online Help
Automated Configuring

483

ActualPointTopIndex

11.05

Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle = ActiveDocument.HMIObjects( " Circle " )
Set objVariableTrigger =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVar
iableDirect, " NewDynamic1 " )
objVariableTrigger.CycleType = hmiCycleType_2s
End Sub

Object Properties
The Property object possesses the following properties:
Application
DisplayName
Dynamic
Events
IsDynamicable
Name
Parent
Type
Value

484

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.20 Properties Object (Listing)

Description

A listing of the Property objects that represent all the properties of an object.
VBA Object Name
HMIProperties
Usage
Use the Properties(Index) property in order to return a Property object if you cannot
access an object property directly. For " Index " you can use either the index number
or the VBA property name of the object. In the following example the Properties
property has to be used to access the individual properties of a circle. The circle
will be inserted into the picture as an HMIObject object:
Sub AddObject()
'VBA319
Dim objObject As HMIObject
Set objObject =
ActiveDocument.HMIObjects.AddHMIObject( " CircleAsHMIObjec
t " , " HMICircle " )
'
'Standard properties (e.g. " Position " ) are available
every time:
objObject.Top = 40
objObject.Left = 40
'
'Individual properties have to be called using
'property " Properties " :
objObject.Properties( " FlashBackColor " ) = True
End Sub
Object Properties

Printout of the Online Help
Automated Configuring

485

ActualPointTopIndex

11.05

The Properties object possesses the following properties:
Application
Count
Parent

486

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.3.21 QualityCodeStateValue Object

Description

Represents the quality code of a tag which is assigned in the dynamic dialog and
used for dynamization.

VBA Object Name
HMIQualityCodeStateValue

Object Properties
The object QualityCodeStateValue has the following properties:
Application
Parent
VALUE_BAD_COMMLUV
VALUE_BAD_COMMNUV
VALUE_BAD_CONFERROR
VALUE_BAD_DEVICE
VALUE_BAD_MISCSTATES
VALUE_BAD_NONSPECIFIC
VALUE_BAD_NOTCONNECTED
VALUE_BAD_OUTOFSERV
VALUE_BAD_PROCRELNOM
VALUE_BAD_PROCRELSUB
VALUE_HIGHLIMITED
VALUE_LOWLIMITED
VALUE_UNCERT_ENGVHIGHLIM
VALUE_UNCERT_ENGVLOWLIM
VALUE_UNCERT_ENGVONLIM
VALUE_UNCERT_INITVAL
VALUE_UNCERT_LUV
VALUE_UNCERT_MAINTDEM
VALUE_UNCERT_MISCSTATES
VALUE_UNCERT_NONSPECIFIC
VALUE_UNCERT_PROCRELNOM
VALUE_UNCERT_SIMVAL
VALUE_UNCERT_SUBSTSET
Varname

Printout of the Online Help
Automated Configuring

487

ActualPointTopIndex

11.05

5.6.3.22 QualityCodeStateValues Object (Listing)

Description

A listing of QualityCodeStateValue objects which contain all quality codes in
Dynamic dialog and are used for dynamization.

VBA Object Name
HMIQualityCodeStateValues

Usage
For example, use the Item property to define values in Dynamic dialog which will
be used for dynamization when the specified tag returns the configured quality
code. In the following example the radius of a circle is given dynamics with the aid
of the Dynamic dialog. Dynamization uses the analysis of the quality code of a tag.
If the tag fails to return a quality code, a substitute value (ElseCase property) is
defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA???
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'Activate qualitycode-statecheck
.QualityCodeStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'define a value for every state:

488

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100
.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

Object Properties
The object QualityCodeStateValues has the following properties:
Application
Count
Item
Parent
VALUE_BAD_COMMLUV
VALUE_BAD_COMMNUV
VALUE_BAD_CONFERROR
VALUE_BAD_DEVICE
VALUE_BAD_MISCSTATES
VALUE_BAD_NONSPECIFIC
VALUE_BAD_NOTCONNECTED
VALUE_BAD_OUTOFSERV
VALUE_BAD_PROCRELNOM
VALUE_BAD_PROCRELSUB
VALUE_HIGHLIMITED
VALUE_LOWLIMITED

Printout of the Online Help
Automated Configuring

489

ActualPointTopIndex

11.05

VALUE_UNCERT_ENGVHIGHLIM
VALUE_UNCERT_ENGVLOWLIM
VALUE_UNCERT_ENGVONLIM
VALUE_UNCERT_INITVAL
VALUE_UNCERT_LUV
VALUE_UNCERT_MAINTDEM
VALUE_UNCERT_MISCSTATES
VALUE_UNCERT_NONSPECIFIC
VALUE_UNCERT_PROCRELNOM
VALUE_UNCERT_SIMVAL
VALUE_UNCERT_SUBSTSET
Varname

490

Printout of the Online Help
Automated Configuring

11.05

5.6.4
5.6.4.1

ActualPointTopIndex

VBA Objects and Listings: R-Z
Rectangle Object

Description

Represents the " Rectangle " object. The Rectangle object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIRectangle

Usage
Use the Add method to create a new " Rectangle " object in a picture:
Sub AddRectangle()
'VBA320
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditRectangle()
'VBA321
Dim objRectangle As HMIRectangle

Printout of the Online Help
Automated Configuring

491

ActualPointTopIndex

11.05

Set objRectangle =
ActiveDocument.HMIObjects( " Rectangle1 " )
objRectangle.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA322
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Rectangle object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
ToolTipText
Top
Visible
Width

492

Printout of the Online Help
Automated Configuring

11.05

5.6.4.2

ActualPointTopIndex

RoundButton Object

Description

Represents the " Round Button " object. The RoundButton object is an element of
the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIRoundButton

Usage
Use the Add method to create a new " Round Button " object in a picture:
Sub AddRoundButton()
'VBA323
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " Roundbutton1 " ,
" HMIRoundButton " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditRoundButton()
'VBA324
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects( " Roundbutton1 " )
objRoundButton.BorderColor = RGB(255, 0, 0)

Printout of the Online Help
Automated Configuring

493

ActualPointTopIndex

11.05

End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA325
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name from the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The RoundButton object possesses the following properties:
BackBorderWidth
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColorBottom
BorderColor
BorderColorTop
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
PicDeactReferenced
PicDeactTransparent
PicDeactUseTransColor
PicDownReferenced
PicDownTransparent
PicDownUseTransColor
PictureDeactivated
PictureDown
PictureUp

494

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

PicUpReferenced
PicUpTransparent
PicUpUseTransColor
Pressed
Radius
Toggle
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

495

ActualPointTopIndex

5.6.4.3

11.05

RoundRectangle Object

Description

Represents the " Rounded Rectangle " object. The RoundRectangle object is an
element of the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIRoundRectangle

Usage
Use the Add method to create a new " Rounded Rectangle " object in a picture:
Sub AddRoundRectangle()
'VBA326
Dim objRoundRectangle As HMIRoundRectangle
Set objRoundRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Roundrectangle1 "
, " HMIRoundRectangle " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditRoundRectangle()
'VBA327
Dim objRoundRectangle As HMIRoundRectangle
Set objRoundRectangle =
ActiveDocument.HMIObjects( " Roundrectangle1 " )
objRoundRectangle.BorderColor = RGB(255, 0, 0)
End Sub

496

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA328
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The RoundRectangle object possesses the following properties:
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Name
Operation
PasswordLevel
RoundCornerHeight
RoundCornerWidth
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

497

ActualPointTopIndex

5.6.4.4

11.05

ScriptInfo Object

Description

Represents a script (C, VB) that is configured for adding dynamics to a property or
action to an event.

VBA Object Name
HMIScriptInfo

Usage
Use the CreateDynamic method to make a property dynamic with the aid of a
script. In the following example...
Sub AddDynamicAsCSkriptToProperty()
'VBA329
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
Set objCScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeCSc
ript)
'
'Define triggertype and cycletime:
With objCScript
.SourceCode = " "
.Trigger.Type = hmiTriggerTypeStandardCycle
.Trigger.CycleType = hmiCycleType_2s
.Trigger.Name = " Trigger1 "
End With
End Sub

498

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use the AddAction method to configure an action on an event. In the following
example...
Sub AddActionToPropertyTypeCScript()
'VBA330
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
'Add circle to picture. By changing of property " Radius "
'a C-Aktion is initiated:
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
Set objEvent = objCircle.Radius.Events(1)
Set objCScript =
objEvent.Actions.AddAction(hmiActionCreationTypeCScript)
End Sub

Object Properties
The ScriptInfo object possesses the following properties:
Application
Compiled
Parent
ProtoType
ScriptType
SourceCode
Trigger

Printout of the Online Help
Automated Configuring

499

ActualPointTopIndex

5.6.4.5

11.05

Selection Object (Listing)

Description

A listing of the HMIObject objects that represent all the selected objects in a
picture.

VBA Object Name
HMISelection

Usage
Use the Selection property to return the Selection listing. In the following example
the names of all the selected objects in the active picture will be output:
Sub ShowSelectionOfDocument()
'VBA331
Dim colSelection As HMISelectedObjects
Dim objObject As HMIObject
Dim strObjectList As String
Set colSelection = ActiveDocument.Selection
If colSelection.Count & lt; & gt; 0 Then
strObjectList = " List of selected objects: "
For Each objObject In colSelection
strObjectList = strObjectList & vbCrLf &
objObject.ObjectName
Next objObject
Else
strObjectList = " No objects selected "
End If
MsgBox strObjectList
End Sub

500

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use the SelectAll method, for example, to select all the objects in the picture. In the
following example all the objects in the active picture are selected:
Sub SelectAllObjects()
'VBA332
ActiveDocument.Selection.SelectAll
End Sub

Object Properties
The Selection object possesses the following properties:
Application
Count
Parent
Properties
AlignBottom
AlignLeft
AlignRight
AlignTop
CenterHorizontally
CenterVertically
CopySelection
CreateCustomizedObject
CreateGroup
DeleteAll
DeselectAll
DuplicateSelection
EvenlySpaceHorizontally
EvenlySpaceVertically
FlipHorizontally
FlipVertically
Item
MoveSelection
BackwardOneLevel
ForwardOneLevel
Remove
Rotate
SameHeight
SameWidth
SameWidthAndHeight
SelectAll
SendToBack
BringToFront
HMIObjects (Listing)
HMIDefaultObjects (Listing)

Printout of the Online Help
Automated Configuring

501

ActualPointTopIndex

5.6.4.6

11.05

Slider Object

Description

Represents the object called " Slider Object " . The Slider object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMISlider
Usage
Use the Add method to create a new " Slider Object " object in a picture:
Sub AddSlider()
'VBA333
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " Slider1 " ,
" HMISlider " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditSlider()
'VBA334
Dim objSlider As HMISlider
Set objSlider = ActiveDocument.HMIObjects( " Slider1 " )
objSlider.ButtonColor = RGB(255, 0, 0)
End Sub

502

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA335
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The Slider object possesses the following properties:
BackBorderWidth
BackColorBottom
BackColor
BackColorTop
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
ButtonColor
ColorBottom
ColorTop
Direction
ExtendedOperation
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashRateBackColor
FlashRateBorderColor
Height
Layer
Left
Max
Min
Name
Operation
OperationMessage
OperationReport
PasswordLevel
Process

Printout of the Online Help
Automated Configuring

503

ActualPointTopIndex

11.05

SmallChange
ToolTipText
Top
Visible
Width

504

Printout of the Online Help
Automated Configuring

11.05

5.6.4.7

ActualPointTopIndex

SourceLink Object

Description

Represents the source for a direct connection.

VBA Object Name
HMISourceLink

Usage
Use the SourceLink property to return the SourceLink object. In the following
example the X position of " Rectangle " _ " A " is copied to the Y position of
Rectangle_B in runtime by clicking on the button:
Sub DirectConnection()
'VBA336
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
'
'Add objects to active document:
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100

Printout of the Online Help
Automated Configuring

505

ActualPointTopIndex

11.05

End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Text = " SetPosition "
End With
'
'Initiation of directconnection by mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobjekt: Top-property of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobjekt: Left-property of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Object Properties
The SourceLink object possesses the following properties:
AutomationName
ObjectName
SourceLink
Type

506

Printout of the Online Help
Automated Configuring

11.05

5.6.4.8

ActualPointTopIndex

StaticText Object

Description

Represents the " Static Text " object. The StaticText object is an element of the
following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIStaticText
Usage
Use the Add method to create a new " Static Text " object in a picture:
Sub AddStaticText()
'VBA337
Dim objStaticText As HMIStaticText
Set objStaticText =
ActiveDocument.HMIObjects.AddHMIObject( " Static_Text1 " ,
" HMIStaticText " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditStaticText()
'VBA338
Dim objStaticText As HMIStaticText
Set objStaticText =
ActiveDocument.HMIObjects( " Static_Text1 " )
objStaticText.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.

Printout of the Online Help
Automated Configuring

507

ActualPointTopIndex

11.05

Sub ShowNameOfFirstSelectedObject()
'VBA339
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub
Object Properties
The StaticText object possesses the following properties:
AdaptBorder
AlignmentLeft
AlignmentTop
BackColor
BackFlashColorOff
BackFlashColorOn
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FillColor
Filling
FillingIndex
FillStyle
FlashBackColor
FlashBorderColor
FlashForeColor
FlashRateBackColor
FlashRateBorderColor
FlashRateForeColor
FontBold
FontItalic
FontName
FontSize
FontUnderline
ForeColor
ForeFlashColorOff
ForeFlashColorOn
Height
Layer
Left
Name
Operation
Orientation
PasswordLevel
Text
ToolTipText

508

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Top
Visible
Width

Printout of the Online Help
Automated Configuring

509

ActualPointTopIndex

5.6.4.9

11.05

StatusDisplay Object

Description

Represents the " Status Display " object. The " StatusDisplay " object is an element of
the following listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMIStatusDisplay

Usage
Use the Add method to create a new " Status Display " object in a picture:
Sub AddStatusDisplay()
'VBA340
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " Statusdisplay1 " ,
" HMIStatusDisplay " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditStatusDisplay()
'VBA341
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects( " Statusdisplay1 " )
objStatusDisplay.BorderColor = RGB(255, 0, 0)

510

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA342
'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The StatusDisplay object possesses the following properties:
BasePicReferenced
BasePicTransColor
BasePicture
BasePicUseTransColor
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
FlashBorderColor
FlashFlashPicture
FlashPicReferenced
FlashPicTransColor
FlashPicture
FlashPicUseTransColor
FlashRateBorderColor
FlashRateFlashPic
Height
Index
Layer
Left
Name
Operation
PasswordLevel
ToolTipText
Top
Visible
Width

Printout of the Online Help
Automated Configuring

511

ActualPointTopIndex

11.05

5.6.4.10 SymbolLibrary Object

Description

Represents the " Global Library " or " Project Library " . The SymbolLibrary object is
an element of the SymbolLibraries listing.

VBA Object Name
HMISymbolLibrary

Usage
Use SymbolLibraries(Index) to return an individual SymbolLibrary object. For
" Index " you can use either the index number or the name of the object. In the
following example the name of the " Global Library " will be output:
Sub ShowFirstObjectOfCollection()
'VBA343
Dim strName As String
strName = Application.SymbolLibraries(1).Name
MsgBox strName
End Sub

Object Properties
The SymbolLibrary object possesses the following properties:
Application
FolderItems
Name
Parent

512

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.11 SymbolLibraries Object (Listing)

Description

A listing of the SymbolLibrary objects that represent the Components Library. The
listing contains two objects: The first object is the " Global Library " and the second
object is the " Project Library " .
VBA Object Name
HMISymbolLibraries
Usage
Use the SymbolLibraries property to return the SymbolLibraries listing. In the
following example the names of the libraries will be output:
Sub ShowSymbolLibraries()
'VBA344
Dim colSymbolLibraries As HMISymbolLibraries
Dim objSymbolLibrary As HMISymbolLibrary
Dim strLibraryList As String
Set colSymbolLibraries = Application.SymbolLibraries
For Each objSymbolLibrary In colSymbolLibraries
strLibraryList = strLibraryList &
objSymbolLibrary.Name & vbCrLf
Next objSymbolLibrary
MsgBox strLibraryList
End Sub
Object Properties
The SymbolLibraries object possesses the following properties:
Application
Count
Parent

5.6.4.12 TextList Object

Printout of the Online Help
Automated Configuring

513

ActualPointTopIndex

11.05

Description

Represents the " Text List " object. The TextList object is an element of the following
listings:


Objects: Contains all the objects in a picture.



Selection: Contains all the objects in a picture that have been selected.



HMIDefaultObjects: Contains the default property values of all standard,
Windows, and smart objects.

VBA Object Name
HMITextList
Usage
Use the Add method to create a new " Text List " object in a picture:
Sub AddTextList()
'VBA345
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " Textlist1 " ,
" HMITextList " )
End Sub
Use " HMIObjects(Index) " to return an object from the HMIObjects listing, where
" Index " in this case identifies the object by name:
Sub EditTextList()
'VBA346
Dim objTextList As HMITextList
Set objTextList = ActiveDocument.HMIObjects( " Textlist1 " )
objTextList.BorderColor = RGB(255, 0, 0)
End Sub
Use " Selection " (Index) to return an object from the Selection listing.
Sub ShowNameOfFirstSelectedObject()
'VBA347

514

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Select all objects in the picture:
ActiveDocument.Selection.SelectAll
'Get the name of the first object of the selection:
MsgBox ActiveDocument.Selection(1).ObjectName
End Sub

Object Properties
The TextList object possesses the following properties:
AdaptBorder
AlignmentLeft
AlignmentTop
Assignments
AssumeOnExit
BackColor
BackFlashColorOff
BackFlashColorOn
BitNumber
BorderBackColor
BorderColor
BorderFlashColorOff
BorderFlashColorOn
BorderStyle
BorderWidth
BoxType
CursorControl
EditAtOnce
FillColor
FillStyle
FlashBackColor
FlashBorderColor
FlashForeColor
FlashRateBackColor
FlashRateBorderColor
FlashRateForeColor
FontBold
FontItalic
FontName
FontSize
FontUnderline
ForeColor
ForeFlashColorOff
ForeFlashColorOn
Height
ItemBorderBackColor
ItemBorderColor
ItemBorderStyle
ItemBorderWidth
LanguageSwitch

Printout of the Online Help
Automated Configuring

515

ActualPointTopIndex

11.05

Layer
Left
ListType
Name
NumberLines
Operation
OperationMessage
OperationReport
Orientation
OutputValue
PasswordLevel
SelBGColor
SelTextColor
ToolTipText
Top
UnselBGColor
UnselTextColor
Visible
Width

516

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.13 Toolbar Object

Description

Represents the " User Defined Toolbar " object. The Toolbar object is an element of
the CustomToolbars listing.
VBA Object Name
HMIToolbar
Usage
Use CustomToolbars(Index) to return an individual Toolbar object. For " Index " you
can use either the index number or the name of the object. In the following
example the " Key " parameter of the first user-defined toolbar in the active picture
will be output:
Sub ShowFirstObjectOfCollection()
'VBA348
Dim strName As String
strName = ActiveDocument.CustomToolbars(1).Key
MsgBox strName
End Sub
Use the Delete method to remove a " Toolbar " object from the " CustomToolbars "
listing. In the following example the first user-defined toolbar in the active picture
will be removed:
Sub DeleteToolbar()
'VBA349
Dim objToolbar As HMIToolbar
Set objToolbar = ActiveDocument.CustomToolbars(1)
objToolbar.Delete
End Sub
Object Properties

Printout of the Online Help
Automated Configuring

517

ActualPointTopIndex

11.05

The Toolbar object possesses the following properties:
Application
Key
Parent
ToolbarItems
Visible

518

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.14 Toolbars Object (Listing)

Description

A listing of the Toolbar objects that represent all the user-defined toolbars in the
Graphics Designer.

VBA Object Name
HMICustomToolbars
Usage

Note:
In order for the examples to work, first create a user-defined toolbar. For an
example of this, please refer to " Creating a New Application-Specific Toolbar " in
this documentation.
Use the CustomToolbars property to return the Toolbars listing. In the following
example, values for the " Key " property of all user-defined toolbars in the active
picture will be output:
Note:
The Toolbars listing does not distinguish between application-specific and picturespecific toolbars in the output.

Printout of the Online Help
Automated Configuring

519

ActualPointTopIndex

11.05

Sub ShowCustomToolbarsOfDocument()
'VBA350
Dim colToolbars As HMIToolbars
Dim objToolbar As HMIToolbar
Dim strToolbarList As String
Set colToolbars = ActiveDocument.CustomToolbars
If 0 & lt; & gt; colToolbars.Count Then
For Each objToolbar In colToolbars
strToolbarList = strToolbarList & objToolbar.Key & vbCrLf
Next objToolbar
Else
strToolbarList = " No toolbars existing "
End If
MsgBox strToolbarList
End Sub
Use the Application property and the Add method if you want to create an
application-specific toolbar. Create the VBA code in either the " Project Template "
document or the " Global Template " document.
Sub InsertApplicationSpecificToolbar()
'VBA351
Dim objToolbar As HMIToolbar
Set objToolbar =
Application.CustomToolbars.Add( " a_Toolbar1 " )
End Sub
Use the ActiveDocument property and the Add method if you want to create a
picture-specific toolbar. Create the VBA code in the document called
" ThisDocument " :
Sub InsertDocumentSpecificToolbar()
'VBA352
Dim objToolbar As HMIToolbar
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " d_Toolbar1 " )
End Sub

Object Properties
The Toolbars object possesses the following properties:
Application
Count
Parent

5.6.4.15 ToolbarItem Object

520

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description

Represents an object (icon or dividing line) in a user-defined toolbar in the
GraphicsDesigner. The ToolbarItem object is an element of the ToolbarItems
listing.

VBA Object Name
HMIToolbarItem

Usage

Note:
In order for the examples to work, first create a user-defined toolbar. " For an
example of this, please refer to " Creating a New Application-Specific Toolbar in
this documentation.
Use ToolbarItems(Index) to return an individual ToolbarItem object. For " Index " you
can use either the index number or the name of the object. In the following
example the type of the first object in the first user-defined toolbar in the active
picture will be output:
Sub ShowFirstObjectOfCollection()
'VBA353
Dim strType As String
strType =
ActiveDocument.CustomToolbars(1).ToolbarItems(1).Toolbar
ItemType
MsgBox strType
End Sub

Printout of the Online Help
Automated Configuring

521

ActualPointTopIndex

11.05

Use the Delete method to remove an object from the " ToolbarItems " listing. In the
following example the first object will be deleted from the first user-defined toolbar
in the active picture:
Sub DeleteToolbarItem()
'VBA354
ActiveDocument.CustomToolbars(1).ToolbarItems(1).Delete
End Sub

Object Properties
The ToolbarItem object possesses the following properties:
Application
Enabled
Icon
Key
LDStatusTexts
LDTooltipTexts
Macro
Parent
Position
ShortCut
StatusText
Tag
ToolTipText
Type
Visible

522

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.16 ToolbarItems Object (Listing)

Description

A listing of the ToolbarItem objects that represent all the objects in a user-defined
toolbar.

VBA Object Name
HMIToolbarItems

Usage
Use the ToolbarItems property to return the ToolbarItems listing. In the following
example all object types in the first user-defined toolbar in the active picture will be
output:
Note:
The ToolbarItems listing does not distinguish between application-specific and
picture-specific toolbars in the output.
Sub ShowToolbarItems()
'VBA355
Dim colToolbarItems As HMIToolbarItems
Dim objToolbarItem As HMIToolbarItem
Dim strTypeList As String
Set colToolbarItems =
ActiveDocument.CustomToolbars(1).ToolbarItems
If 0 & lt; & gt; colToolbarItems.Count Then
For Each objToolbarItem In colToolbarItems
strTypeList = strTypeList & objToolbarItem.ToolbarItemType &
vbCrLf

Printout of the Online Help
Automated Configuring

523

ActualPointTopIndex

11.05

Next objToolbarItem
Else
strTypeList = " No Toolbaritems existing "
End If
MsgBox strTypeList
End Sub
Use the InsertToolbarItem method, for instance, to insert an icon into an existing
user-defined toolbar. In the following example a picture-specific toolbar will be
created in the active picture and an icon will be added:
Sub InsertToolbarItem()
'VBA356
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " d_Toolbar2 " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1,
" t_Item2_1 " , " ToolbarItem 1 " )
End Sub

Object Properties
The ToolbarItems object possesses the following properties:
Application
Count
Parent

524

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.17 Trigger Object

Description

Represents the trigger (e.g. Picture Cycle) that is necessary for adding dynamics to
properties with the aid of scripts. A trigger can possess multiple tag triggers.

VBA Object Name
HMITrigger

Usage
Use the Trigger property to return the Trigger object. In this example the " Radius "
property of a circle will be made dynamic with the aid of a VB script (the output
value sets the radius):
Sub AddDynamicAsVBSkriptToProperty()
'VBA357
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
'
'Define cycletime and sourcecode
With objVBScript
.SourceCode = " "
.Trigger.Type = hmiTriggerTypeStandardCycle
.Trigger.CycleType = hmiCycleType_2s
.Trigger.Name = " Trigger1 "
End With
End Sub

Printout of the Online Help
Automated Configuring

525

ActualPointTopIndex

11.05

Object Properties
The Trigger object possesses the following properties:
Application
CycleType
Name
Parent
Trigger
Type
VariableTriggers

526

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.6.4.18 VariableStateValue Object

Description

Represents the state of a tag, the value of which is assigned in the Dynamic dialog
and used for the purpose of creating dynamics.

VBA Object Name
HMIVariableStateValue

Object Properties
The VariableStateValue object has the following properties:
Application
Parent
VALUE_ACCESS_FAULT
VALUE_ADDRESS_ERROR
VALUE_CONVERSION_ERROR
VALUE_DEFAULT_VALUE
VALUE_HANDSHAKE_ERROR
VALUE_HARDWARE_ERROR
VALUE_INVALID_KEY
VALUE_MAX_LIMIT
VALUE_MAX_RANGE
VALUE_MIN_LIMIT
VALUE_MIN_RANGE
VALUE_NOT_ESTABLISHED
VALUE_SERVERDOWN
VALUE_STARTUP_VALUE
VALUE_TIMEOUT
Varname

Printout of the Online Help
Automated Configuring

527

ActualPointTopIndex

11.05

5.6.4.19 VariableStateValues Object (Listing)

Description

A listing of VariableStateValue objects containing all tag statuses in Dynamic
dialog to be used for dynamization.

VBA Object Name
HMIVariableStateValues

Usage
Use the Item property in the Dynamic dialog to define values that will be used for
creating dynamics when the specified tag returns the configured state. In the
following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA358
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'Activate variable-statecheck
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'define a value for every state:

528

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100
.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

Object Properties
The VariableStateValues object possesses the following properties:
Application
Item
Parent
VALUE_ACCESS_FAULT
VALUE_ADDRESS_ERROR
VALUE_CONVERSION_ERROR
VALUE_DEFAULT_VALUE
VALUE_HANDSHAKE_ERROR
VALUE_HARDWARE_ERROR
VALUE_INVALID_KEY
VALUE_MAX_LIMIT
VALUE_MAX_RANGE
VALUE_MIN_LIMIT
VALUE_MIN_RANGE
VALUE_NOT_ESTABLISHED
VALUE_SERVERDOWN
VALUE_STARTUP_VALUE
VALUE_TIMEOUT
Varname

Printout of the Online Help
Automated Configuring

529

ActualPointTopIndex

11.05

5.6.4.20 VariableTrigger Object

Description

Represents a tag trigger.

VBA Object Name
HMIVariableTrigger

Usage
Use the VariableTrigger object in order to edit or delete an existing tag trigger. In
this example a circle property " Top " will be made dynamic with the aid of the tag
" NewDynamic1 " :
Sub AddDynamicAsVariableDirectToProperty()
'VBA359
Dim objVariableTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
Set objVariableTrigger =
objCircle.Top.CreateDynamic(hmiDynamicCreationTypeVariab
leDirect, " 'NewDynamic1' " )
'
'Define cycletime
With objVariableTrigger
.CycleType = hmiCycleType_2s
End With
End Sub

530

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The VariableTrigger object possesses the following properties:
Application
CycleType
Name
Parent
Type
VariableTriggers

Printout of the Online Help
Automated Configuring

531

ActualPointTopIndex

11.05

5.6.4.21 VariableTriggers Object (Listing)

Description

A listing of the VariableTrigger objects that represent all the tag triggers in use.

VBA Object Name
HMIVariableTriggers

Usage
Use the Add method to create a new tag trigger. In the following example the
radius of a circle is made dynamic with the aid of a VB script. A tag trigger is used
as the trigger:
Sub DynamicWithVariableTriggerCycle()
'VBA360
Dim objVBScript As HMIScriptInfo
Dim objVarTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VariableT
rigger " , " HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
'Definition of triggername and cycletime is to do
with the Add-methode
Set objVarTrigger =
.Trigger.VariableTriggers.Add( " VarTrigger " ,
hmiVariableCycleType_10s)
.SourceCode = " "
End With
End Sub

532

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The VariableTriggers object possesses the following properties:
Application
Count
Item
Parent

Printout of the Online Help
Automated Configuring

533

ActualPointTopIndex

11.05

5.6.4.22 View Object

Description

Represents a copy of a picture. The View object is an element of the Views listing.
You can use the properties of the View object among other things to control the
visibility of the CS layers and to define the zoom.

VBA Object Name
HMIView

Usage
Use Views(Index) to return an individual View object. In the following example the
number of copies of the active picture will be output:
Sub ShowNumberOfExistingViews()
'VBA361
Dim iMaxViews As Integer
iMaxViews = ActiveDocument.Views.Count
MsgBox " Number of copies from active document: " &
iMaxViews
End Sub
Use the Add method to add a new View object to the " Views " listing. In the
following example a copy of the active picture is created and then activated:
Sub AddView()
'VBA362
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

534

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Object Properties
The View object possesses the following properties:
ActiveLayer
Application
Height
IsActive
Left
Parent
ScrollPosX
ScrollPosY
Top
Width
WindowState
Zoom
ExtendedZoomingEnable

Printout of the Online Help
Automated Configuring

535

ActualPointTopIndex

11.05

5.6.4.23 Views Object (Listing)

Description

A listing of the View objects that represent a copy of a picture.
VBA Object Name
HMIViews
Usage
Use the Views listing to return a View object. In the following example the number
of existing copies of the active picture will be output:
Sub ShowNumberOfExistingViews()
'VBA363
Dim iMaxViews As Integer
iMaxViews = ActiveDocument.Views.Count
MsgBox " Number of copies from active document: " &
iMaxViews
End Sub
Use the Add method to create a copy of a picture. In the following example a copy
of the active picture is created and then activated:
Sub AddViewToActiveDocument()
'VBA364
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

Object Properties
The Views object possesses the following properties:
Application
Count
Parent

5.7

536

Characteristics

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

The following section contains all the properties of VBA objects in the Graphics
Designer.

5.7.1
5.7.1.1

VBA Properties: A
Actions Property

Description
Returns the Actions listing. Use the Actions property to configure an event-driven
action.

Example
In this example a button and a circle will be inserted in the active picture. In runtime
the radius of the circle enlarges every time you click the button:
Sub CreateVBActionToClickedEvent()
'VBA365
Dim objButton As HMIButton
Dim objCircle As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VB " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircle
.Top = 100
.Left = 100
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 120
.Text = " Increase Radius "
End With
'Define event and assign sourcecode:

Printout of the Online Help
Automated Configuring

537

ActualPointTopIndex

11.05

Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
With objVBScript
.SourceCode = " Dim myCircle " & vbCrLf & _
" Set myCircle =
HMIRuntime.ActiveScreen.ScreenItems( " " Circle_VB " " ) "
& _
vbCrLf & " myCircle.Radius =
myCircle.Radius + 5 "
End With
End Sub

538

Printout of the Online Help
Automated Configuring

11.05

5.7.1.2

ActualPointTopIndex

ActiveDocument Property

Description
Returns an object of the " Document " type which represents the active picture in the
Graphics Designer. If there is no open or active picture in the Graphics Designer,
you receive an error message.
Note:
The " ActiveDocument " property refers to the window that possesses the input
focus. If other editors (e.g. CrossReference) access a picture, the input focus can
change. To prevent this situation leading to errors, reference the picture
unambiguously via the Documents listing.
Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ).
Sub CreateMenuItem()
'VBA366
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
'
'Create new menu " Delete Objects " :
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete Objects " )
'
'Add two menuitems to the menu " Delete Objects
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete Rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete Circles " )
End Sub

Printout of the Online Help
Automated Configuring

539

ActualPointTopIndex

5.7.1.3

11.05

ActiveLayer Property

Description
Defines or returns the active layer for the View object. The value range is from 0 to
31, where " 0 " represents the uppermost layer and " 31 " the lowest layer.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example a new View object is
created and layer 1 is set to " Active " :
Sub ActiveDocumentConfiguration()
'VBA367
Application.ActiveDocument.Views.Add
Application.ActiveDocument.Views(1).ActiveLayer = 2
End Sub

540

Printout of the Online Help
Automated Configuring

11.05

5.7.1.4

ActualPointTopIndex

ActualPointLeft Property

Description
Defines or returns the X coordinate of the current corner point by reference to the
picture origin (top left) for the objects " Polygon " and " Polyline " . Every corner point
is identified by an index derived from the number ( " PointCount " ) of corner points
available.
Changing the value can have an effect on the properties " Width " (object width) and
" Left " (X coordinate of the object position).

Example
The " PolygonCoordinatesOutput() " procedure outputs the coordinates of all the
corner points in the first polyline in the current picture:
Sub PolygonCoordinatesOutput()
'VBA368
Dim objPolyline As HMIPolyLine
Dim iPosX As Integer
Dim iPosY As Integer
Dim iCounter As Integer
Dim strResult As String
iCounter = 1
Set objPolyline =
ActiveDocument.HMIObjects.AddHMIObject( " Polyline1 " ,
" HMIPolyLine " )
For iCounter = 1 To objPolyline.PointCount
With objPolyline
.index = iCounter
iPosX = .ActualPointLeft
iPosY = .ActualPointTop
End With
strResult = strResult & vbCrLf & " Corner " &
iCounter & " : x= " & iPosX & " y= " & iPosY
Next iCounter
MsgBox strResult
End Sub

Printout of the Online Help
Automated Configuring

541

ActualPointTopIndex

5.7.1.5

11.05

ActualPointTop Property

Description
Defines or returns the Y coordinate of the current corner point by reference to the
picture origin (top left) for the objects " Polygon " and " Polyline " . Every corner point
is identified by an index derived from the number ( " PointCount " ) of corner points
available.
Changing the value can have an effect on the properties " Height " (object height)
and " Top " (Y coordinate of the position).

Example
The " Polygon() " procedure outputs the coordinates of all the corner points in the
first polyline in the current picture:
Sub PolygonCoordinatesOutput()
'VBA369
Dim objPolyline As HMIPolyLine
Dim iPosX As Integer
Dim iPosY As Integer
Dim iCounter As Integer
Dim strResult As String
iCounter = 1
Set objPolyline =
ActiveDocument.HMIObjects.AddHMIObject( " Polyline1 " ,
" HMIPolyLine " )
For iCounter = 1 To objPolyline.PointCount
With objPolyline
.index = iCounter
iPosX = .ActualPointLeft
iPosY = .ActualPointTop
End With
strResult = strResult & vbCrLf & " Corner " &
iCounter & " : x= " & iPosX & " y= " & iPosY
Next iCounter
MsgBox strResult
End Sub

542

Printout of the Online Help
Automated Configuring

11.05

5.7.1.6

ActualPointTopIndex

AdaptBorder Property

Description
TRUE if the field border is intended to adapt dynamically to the size of the text.
BOOLEAN read-write access.
Note:
Changing the contents of a field dynamically can cause pumping in the field.
Performance is improved in runtime by using " AdaptBorder = False " .
Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the text size is dynamically adapted to the field size.
Sub IOFieldConfiguration()
'VBA372
Dim objIOField As HMIIOField
'
'Add new IO-Feld to active document:
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.AdaptBorder = True
End With
End Sub

Printout of the Online Help
Automated Configuring

543

ActualPointTopIndex

5.7.1.7

11.05

AdaptPicture Property

Description
TRUE if the picture size is to be adapted to the picture window size. BOOLEAN
read-write access.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA373
Dim objPicWindow As HMIPictureWindow
'
'Add new picturewindow into active document:
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

544

Printout of the Online Help
Automated Configuring

11.05

5.7.1.8

ActualPointTopIndex

AdaptSize Property

Description
TRUE if the picture window size is to be adapted to the picture size. BOOLEAN
read-write access.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA374
Dim objPicWindow As HMIPictureWindow
'
'Add new picturewindow into active document:
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

545

ActualPointTopIndex

5.7.1.9

11.05

AlarmHigh Property

Description
Defines or returns the high limit value at which the alarm is triggered.
Define the type of evaluation (in percent or absolute) with the aid of the
" TypeAlarmHigh " property.
The " CheckAlarmHigh " property defines whether monitoring of this limit value is
active.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 50 " .
Sub BarGraphLimitConfiguration()
'VBA375
Dim objBarGraph As HMIBarGraph
'
'Add new BarGraph to active document:
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolut
.TypeAlarmHigh = False
'Activate monitoring
.CheckAlarmHigh = True
'Set barcolor to " yellow "
.ColorAlarmHigh = RGB(255, 255, 0)
'set upper limit to " 50 "
.AlarmHigh = 50
End With
End Sub

546

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.10 AlarmLow Property

Description
Defines or returns the low limit value at which the alarm is triggered.
Define the type of evaluation (in percent or absolute) with the aid of the
" TypeAlarmLow " property.
The " CheckAlarmLow " property defines whether monitoring of this limit value is
active.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 10 " .
Sub BarGraphLimitConfiguration()
'VBA376
Dim objBarGraph As HMIBarGraph
'
'Add new BarGraph to active document:
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolut
.TypeAlarmLow = False
'Activate monitoring
.CheckAlarmLow = True
'Set Barcolor to " yellow "
.ColorAlarmLow = RGB(255, 255, 0)
'set lower limit to " 10 "
.AlarmLow = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

547

ActualPointTopIndex

11.05

5.7.1.11 Alignment Property

Description
Defines or returns the scale display (left/right or top/bottom) depending on the
position of the BarGraph object. The Scaling property must be set to TRUE for the
scale to be displayed.
Display

Assigned Value

Right or bottom

TRUE

Left or top

FALSE

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the scale is to be located to the right of the bar:
Sub BarGraphConfiguration()
'VBA377
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Alignment = True
.Scaling = True
End With
End Sub

548

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.12 AlignmentLeft Property

Description
Defines or returns the horizontal alignment of the text. Value range from 0 to 2.
Horizontal Alignment

Assigned Value

Left

0

Centered

1

Right

2

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the text in the I/O field will be centered horizontally:
Sub IOFieldConfiguration()
'VBA378
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.AlignmentLeft = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

549

ActualPointTopIndex

11.05

5.7.1.13 AlignmentTop Property

Description
Defines or returns the vertical alignment of the text. Value range from 0 to 2.
Horizontal Alignment

Assigned Value

Up

0

Centered

1

Down

2

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the text in the I/O field will be centered in the middle:
Sub IOFieldConfiguration()
'VBA379
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.AlignmentLeft = 1
.AlignmentTop = 1
End With
End Sub

550

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.14 AnalogResultInfos Property

Description
Returns the AnalogResultInfos listing. Use the AnalogResultInfos property to
define value ranges and property values in the Dynamic dialog.

Example
An example showing how to use the AnalogResultInfos property can be found in
this documentation under the heading " AnalogResultInfos Object (Listing) " .

Printout of the Online Help
Automated Configuring

551

ActualPointTopIndex

11.05

5.7.1.15 AngleAlpha Property

Description
Defines or returns depth angle A for the 3D effect in the " 3DBarGraph " object.
Value range in degrees from 0 to 90.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example depth angles A and B will be assigned the
values " 15 " and " 45 " :
Sub HMI3DBarGraphConfiguration()
'VBA380
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
'Depth-angle a = 15 degrees
.AngleAlpha = 15
'Depth-angle b = 45 degrees
.AngleBeta = 45
End With
End Sub

552

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.16 AngleBeta Property

Description
Defines or returns depth angle B for the 3D effect in the " 3DBarGraph " object.
Value range in degrees from 0 to 90.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example depth angles A and B will be assigned the
values " 15 " and " 45 " :
Sub HMI3DBarGraphConfiguration()
'VBA381
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
'Depth-angle a = 15 degrees
.AngleAlpha = 15
'Depth-angle b = 45 degrees
.AngleBeta = 45
End With
End Sub

Printout of the Online Help
Automated Configuring

553

ActualPointTopIndex

11.05

5.7.1.17 Application Property

Description
Returns the Graphics Designer application if the Application property is used
without object identifiers. If the Application property is used with object identifiers, it
returns an Application object representing the Application with which the defined
object was created. Read access.

Example
In this example an Excel object is created and the application name is output:
Sub CreateExcelApplication()
'VBA382
'
'Open Excel invisible
Dim objExcelApp As New Excel.Application
MsgBox objExcelApp
'Delete the reference to Excel and close it
Set objExcelApp = Nothing
End Sub

554

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.18 ApplicationDataPath Property

Description
Returns the complete path of the active picture in the Graphics Designer. Readonly access.

Example
The " ShowApplicationDataPath() " procedure outputs the path of the current
picture:
Sub ShowApplicationDataPath()
'VBA383
MsgBox Application.ApplicationDataPath
End Sub

" ApplicationDataPath " property: The *.PDL file for the open picture is held in the
" ..\GraCS\ " folder.

Printout of the Online Help
Automated Configuring

555

ActualPointTopIndex

11.05

5.7.1.19 Assignments Property

Description
A listing which contains the assignments between the output value and the text that
actually has to be output.
The assignments are dependent upon the list type defined. Define the list type
using the ListType property.
The number of entries depends on the total length of the string passed to the
" Assignments " property. This string cannot be longer than 500,000 bytes. This may
be checked prior to dropping access to the " Assignments " property by using the
function LenB().

Example
--

556

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.20 AssumeOnExit Property

Description
TRUE, if the entered text is assumed after exiting the input field (by using the
& lt; Tab & gt; key or mouse click, for example). BOOLEAN read-write access.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the text that has been entered will be taken over as input on exit from
the input field.
Sub IOFieldConfiguration()
'VBA385
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.AssumeOnExit = True
End With
End Sub

Printout of the Online Help
Automated Configuring

557

ActualPointTopIndex

11.05

5.7.1.21 AssumeOnFull Property

Description
TRUE if there is an automatic exit from the input field and the input is taken over,
or assumed, when input is complete (i.e. the specified number of characters has
been entered). BOOLEAN read-write access.

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the text that has been entered will be taken over as input on exit from
the input field.
Sub IOFieldConfiguration()
'VBA386
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.AssumeOnFull = True
End With
End Sub

558

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.22 AutomationName Property

Description
Depending on the source and destination object types for the direct connection,
either defines or returns the name of a property.
The two tables show you when you must use the AutomationName property. A " -- "
means that the property is assigned an empty string ( " " ) by default when the
DirectConnection object is created.
Source object type (SourceLink Property)
Type Property

AutomationName
Property

ObjectName Property

hmiSourceTypeConstant

--

Name of the constant
(e.g. the picture name)

hmiSourceTypeProperty

Property of the
source object (e.g.
" Top " )

Name of the source
object (e.g.
" Rectangle_A " )

hmiSourceTypePropertyOfThis
Object

--

--

hmiSourceTypeVariableDirect

--

Tag name

hmiSourceTypeVariableIndirect --

Tag name

Destination object type (DestinationLink Property)
Type Property

AutomationName
Property

ObjectName Property

hmiDestTypeProperty

Property of the
destination object
(e.g. " Left " )

Name of the destination
object (e.g.
" Rectangle_A " )

hmiDestTypePropertyOfThisOb -ject

--

hmiDestTypePropertyOfActual
Window

Property of the
destination object
(e.g. " Left " )

--

hmiDestTypeVariableDirect

--

Tag name

hmiDestTypeVariableIndirect

--

Tag name

hmiDestTypeDirectMessage

--

Tag name

hmiDestTypeIndirectMessage

--

Tag name

Printout of the Online Help
Automated Configuring

559

ActualPointTopIndex

11.05

Example
In the following example the X position of " Rectangle " _ " A " is copied to the Y
position of Rectangle_B in runtime by clicking on the button:
Sub DirectConnection()
'VBA387
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDynConnection As HMIDirectConnection
'
'Add objects to active document:
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
'
'to position and configure objects:
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Text = " SetPosition "
End With
'
'Directconnection is initiate by mouseclick:
Set objDynConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDynConnection

560

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Sourceobject: Top-Property of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Left-Property of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Printout of the Online Help
Automated Configuring

561

ActualPointTopIndex

11.05

5.7.1.23 AvailableDataLanguages Property

Description
Returns a listing of the available project languages.

Example
The " AusgabetDataLanguages() " procedure outputs all the existing project
languages together with their language identifiers (as a decimal value):
Sub OutputDataLanguages()
'VBA388
Dim colDataLang As HMIDataLanguages
Dim objDataLang As HMIDataLanguage
Dim strLangList As String
Dim iCounter As Integer
'
'Save collection of datalanguages
'into variable " colDataLang "
Set colDataLang = Application.AvailableDataLanguages
iCounter = 1
'
'Get every languagename and the assigned ID
For Each objDataLang In colDataLang
With objDataLang
If 0 = iCounter Mod 3 Or 1 = iCounter Then
strLangList = strLangList & vbCrLf & .LanguageID & " " &
.LanguageName
Else
strLangList = strLangList & " / " & .LanguageID & " " &
.LanguageName
End If
End With
iCounter = iCounter + 1
Next objDataLang
MsgBox strLangList
End Sub

562

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.24 Average Property

Description
TRUE if an average value for the last 15 values is to be taken. BOOLEAN readwrite access.

Example
The " BarGraphConfiguration " () procedure configures the properties of the
BarGraph object. In this example, value averaging will be activated:
Sub BarGraphConfiguration()
'VBA389
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Average = True
End With
End Sub

Printout of the Online Help
Automated Configuring

563

ActualPointTopIndex

11.05

5.7.1.25 Axe Property

Description
Defines or returns the axis for displaying the measured value. Value range from 0
to 2.
Axis

Assigned Value

X

0

Y

1

Z

2

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the Y axis for displaying the measured value
will be defined:
Sub HMI3DBarGraphConfiguration()
'VBA390
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Axe = 1
End With
End Sub

564

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.1.26 AxisSection Property

Description
Defines or returns the distance between two long axis sections. The distance is
expressed in scale units and is dependent on the configured minimum and
maximum values.

BarGraph object (minimum/maximum value: -5/5; AxisSection = 2)
Example
The " BarGraphConfiguration() " procedure accesses the properties of the BarGraph
object. In this example the axis section will be set to " 2 " .
Sub BarGraphConfiguration()
'VBA391
Dim objBar As HMIBarGraph
Set objBar =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBar
.AxisSection = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

565

ActualPointTopIndex

5.7.2
5.7.2.1

11.05

VBA Properties: B
BackBorderWidth Property

Description
Defines or returns the width of the 3D border in pixels. The value for the width
depends on the size of the object.
Slider
Defines or returns the width of the border in pixels. BackBorderWidth = 0 prevents
the border being displayed on the Slider object.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the width of the 3D border will be set to " 2 " .
Sub ButtonConfiguration()
'VBA392
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.BackBorderWidth = 2
End With
End Sub

566

Printout of the Online Help
Automated Configuring

11.05

5.7.2.2

ActualPointTopIndex

BackColor Property

Description
Defines or returns the background color of the object. LONG read-write access.
The background color is not displayed if the fill pattern is set as " Transparent " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example the background color will be set to " Yellow " :
Sub RectangleConfiguration()
'VBA393
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BackColor = RGB(255, 255, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

567

ActualPointTopIndex

5.7.2.3

11.05

BackColor2 Property

Description
Defines or returns the bar color for displaying the current value. LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphConfiguration " () procedure configures the properties of the
BarGraph object. In this example the bar color for displaying the current value will
be set to " Yellow " :
Sub BarGraphConfiguration()
'VBA394
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.BackColor2 = RGB(255, 255, 0)
End With
End Sub

568

Printout of the Online Help
Automated Configuring

11.05

5.7.2.4

ActualPointTopIndex

BackColor3 Property

Description
Defines or returns the color of the bar background. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphConfiguration " () procedure configures the properties of the
BarGraph object. In this example the color of the bar background will be set to
" Blue " :
Sub BarGraphConfiguration()
'VBA395
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.BackColor3 = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

569

ActualPointTopIndex

5.7.2.5

11.05

BackColorBottom Property

Description
Defines or returns the color for the bottom/right part of the slider. LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " SliderConfiguration() " procedure accesses the properties of the slider. In this
example the color of the bottom part of the slider will be set to " Blue " :
Sub SliderConfiguration()
'VBA396
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.BackColorBottom = RGB(0, 0, 255)
End With
End Sub

570

Printout of the Online Help
Automated Configuring

11.05

5.7.2.6

ActualPointTopIndex

BackColorTop Property

Description
Defines or returns the color for the top/left part of the slider. LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " SliderConfiguration " () procedure accesses the properties of the slider. In this
example the color of the top part of the slider will be set to " Yellow " :
Sub SliderConfiguration()
'VBA397
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.BackColorTop = RGB(255, 255, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

571

ActualPointTopIndex

5.7.2.7

11.05

BackFlashColorOff Property

Description
Defines or returns the color of the object background when the flash status is " Off " .
LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the color when the flash status is " Off " will be set to
" Yellow " :
Sub RectangleConfiguration()
'VBA398
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BackFlashColorOff = RGB(255, 255, 0)
End With
End Sub

572

Printout of the Online Help
Automated Configuring

11.05

5.7.2.8

ActualPointTopIndex

BackFlashColorOn Property

Description
Defines or returns the color of the object background when the flash status is " On " .
LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the color when the flash status is " On " will be set to
" Blue " :
Sub RectangleConfiguration()
'VBA399
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BackFlashColorOn = RGB(0, 0, 255)
End With
End Suba

Printout of the Online Help
Automated Configuring

573

ActualPointTopIndex

5.7.2.9

11.05

Background Property

Description
TRUE if the background to the 3DBarGraph object is to be visible. BOOLEAN
read-write access.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the background will be set to " Transparent " :
Sub HMI3DBarGraphConfiguration()
'VBA400
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Background = False
End With
End Sub

574

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.10 BarDepth Property

Description
Defines or returns the bar depth in pixels.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the bar depth will be set to " 40 " :
Sub HMI3DBarGraphConfiguration()
'VBA401
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.BarDepth = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

575

ActualPointTopIndex

11.05

5.7.2.11 BarHeight Property

Description
Defines or returns the bar height in pixels.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the bar height will be set to " 60 " :
Sub HMI3DBarGraphConfiguration()
'VBA402
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.BarHeight = 60
End With
End Sub

576

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.12 BarWidth Property

Description
Defines or returns the bar width in pixels.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the bar width will be set to " 80 " :
Sub HMI3DBarGraphConfiguration()
'VBA403
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.BarWidth = 80
End With
End Sub

Printout of the Online Help
Automated Configuring

577

ActualPointTopIndex

11.05

5.7.2.13 BasePicReferenced Property

Description
TRUE if the picture assigned in the Status Display object is to be saved. Otherwise
only the associated object reference is saved. BOOLEAN read-write access.

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example the picture assigned in the Status Display object is
to be saved.
Sub StatusDisplayConfiguration()
'VBA404
Dim objStatDisp As HMIStatusDisplay
Set objStatDisp =
ActiveDocument.HMIObjects.AddHMIObject( " Statusdisplay1 " ,
" HMIStatusDisplay " )
With objStatDisp
.BasePicReferenced = True
End With
End Sub

578

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.14 BasePicTransColor Property

Description
Defines or returns the color which is going to be set to " Transparent " in the
assigned Bitmap object (.bmp, .dib). LONG read-write access.
The color is only set to " Transparent " if the value of the " BasePicUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " StatusDisplayConfiguration " () procedure accesses the properties of the
Status Display. In this example the color " Yellow " will be set to " Transparent " :
Sub StatusDisplayConfiguration()
'VBA405
Dim objStatDisp As HMIStatusDisplay
Set objStatDisp =
ActiveDocument.HMIObjects.AddHMIObject( " Statusdisplay1 " ,
" HMIStatusDisplay " )
With objStatDisp
.BasePicTransColor = RGB(255, 255, 0)
.BasePicUseTransColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

579

ActualPointTopIndex

11.05

5.7.2.15 BasePicture Property

Description
Defines or returns the basic picture for the Status Display object.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.
The " BasePicReferenced " property defines in this case whether the basic picture
will be saved with the Status Display object or referenced.

Example
The " StatusDisplayConfiguration " () procedure accesses the properties of the
Status Display. In this example the picture " Testpicture.BMP " will be used as the
basic picture:
Sub StatusDisplayConfiguration()
'VBA406
Dim objStatDisp As HMIStatusDisplay
Set objStatDisp =
ActiveDocument.HMIObjects.AddHMIObject( " Statusdisplay1 " ,
" HMIStatusDisplay " )
With objStatDisp
'
'To use this example copy a Bitmap-Graphic
'to the " GraCS " -Folder of the actual project.
'Replace the picturename " Testpicture.BMP " with the
name of
'the picture you copied
.BasePicture = " Testpicture.BMP "
End With
End Sub

580

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.16 BasePicUseTransColor Property

Description
TRUE if the configured color ( " BasePicTransColor " property) of the Bitmap object
is going to be set to " Transparent " . BOOLEAN read-write access.

Example
The " StatusDisplayConfiguration " () procedure accesses the properties of the
Status Display. " In this example the color " Yellow " will be set to " Transparent.
Sub StatusDisplayConfiguration()
'VBA407
Dim objStatDisp As HMIStatusDisplay
Set objStatDisp =
ActiveDocument.HMIObjects.AddHMIObject( " Statusdisplay1 " ,
" HMIStatusDisplay " )
With objStatDisp
.BasePicTransColor = RGB(255, 255, 0)
.BasePicUseTransColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

581

ActualPointTopIndex

11.05

5.7.2.17 BaseX Property

Description
Defines or returns for the 3DBarGraph object the horizontal distance in pixels
between the right-hand border of the bar and the left-hand border of the object
field.

Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the horizontal distance will be set to " 80 " .
Sub HMI3DBarGraphConfiguration()
'VBA408
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.BaseX = 80
End With
End Sub

582

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.18 BaseY Property

Description
Defines or returns for the 3DBarGraph object the vertical distance in pixels
between the lower border of the bar and the upper border of the object field.
Example
The " HMI3DBarGraphConfiguration " () procedure accesses the properties of the
3DBarGraph object. In this example the vertical distance will be set to " 100 " .
Sub HMI3DBarGraphConfiguration()
'VBA409
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.BaseY = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

583

ActualPointTopIndex

11.05

5.7.2.19 BinaryResultInfo Property

Description
Returns the BinaryResultInfo object.
Example
An example showing how to use the BinaryResultInfo property can be found in this
documentation under the heading " BinaryResultInfo Object " .

584

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.20 BitNotSetValue Property

Description
Defines or returns the value for the dynamic property if the specified bit of a
configured tag is not set.
To define which bit must be set in order to trigger a change of value, use the
BitNumber property.
Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned, the bit to be set will be defined
and the associated property values will be assigned to the " set " / " not set " states:
Sub AddDynamicDialogToCircleRadiusTypeBit()
'VBA410
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_B " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBit
.Trigger.VariableTriggers(1).CycleType =
hmiVariableCycleType_5s
.BitResultInfo.BitNumber = 1
.BitResultInfo.BitSetValue = 40
.BitResultInfo.BitNotSetValue = 80
End With
End Sub

Printout of the Online Help
Automated Configuring

585

ActualPointTopIndex

11.05

5.7.2.21 BitNumber Property

Description
Defines or returns the bit which must change its state in order to trigger a change
of value. The tag used must be of the BYTE, WORD or DWORD type.

Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned, the bit to be set will be defined
and the associated property values will be assigned to the " set " / " not set " states:
Sub AddDynamicDialogToCircleRadiusTypeBit()
'VBA411
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_B " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBit
.BitResultInfo.BitNumber = 1
.BitResultInfo.BitSetValue = 40
.BitResultInfo.BitNotSetValue = 80
End With
End Sub

586

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.22 BitResultInfo Property

Description
Returns the BitResultInfo object.

Example
An example showing how to use the BitResultInfo property can be found in this
documentation under the heading " BitResultInfo Object " .

Printout of the Online Help
Automated Configuring

587

ActualPointTopIndex

11.05

5.7.2.23 BitSetValue Property

Description
Defines or returns the value for the dynamic property if the specified bit of a
configured tag is set.
To define which bit must be set in order to trigger a change of value, use the
BitNumber property.

Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned, the bit to be set will be defined
and the associated property values will be assigned to the " set " / " not set " states:
Sub AddDynamicDialogToCircleRadiusTypeBit()
'VBA412
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_B " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBit
.BitResultInfo.BitNumber = 1
.BitResultInfo.BitSetValue = 40
.BitResultInfo.BitNotSetValue = 80
End With
End Sub

588

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.24 Bold Property

Description
TRUE if the font attribute " Bold " is set for the language-dependent text in the
object. BOOLEAN read-write access.
Example

Note:
For this example to work, you must already have configured in the languages
concerned.
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA413
Dim colLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " Displaytext "
Set colLangFonts = objButton.LDFonts
'Set french fontproperties:
With colLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'Set english fontproperties:
With colLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

Printout of the Online Help
Automated Configuring

589

ActualPointTopIndex

11.05

5.7.2.25 BorderBackColor Property

Description
Defines or returns the background color for the line in the object. LONG read-write
access.
The background color is only visible if the BorderStyle property is set & gt; 0.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the background color for the line will be set to " Yellow " :
Sub RectangleConfiguration()
'VBA415
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BorderBackColor = RGB(255, 255, 0)
End With
End Sub

590

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.26 BorderColor Property

Description
Defines or returns the line color for the object. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the line color will be set to " Blue " :
Sub RectangleConfiguration()
'VBA416
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BorderColor = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

591

ActualPointTopIndex

11.05

5.7.2.27 BorderColorBottom Property

Description
Defines or returns the color for the bottom right-hand part of the 3D-border. LONG
read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ButtonConfiguration " () procedure accesses the properties of the button. In
this example the 3D-border color will be defined:
Sub ButtonConfiguration()
'VBA417
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.BorderColorBottom = RGB(255, 0, 0)
.BorderColorTop = RGB(0, 0, 255)
End With
End Sub

592

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.28 BorderColorTop Property

Description
Defines or returns the color for the top left-hand part of the 3D-border. LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ButtonConfiguration " () procedure accesses the properties of the button. In
this example the 3D-border color will be defined:
Sub ButtonConfiguration()
'VBA418
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.BorderColorBottom = RGB(255, 0, 0)
.BorderColorTop = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

593

ActualPointTopIndex

11.05

5.7.2.29 BorderEndStyle Property

Description
Defines or returns the type of line ends for the object. LONG read-write access.
Determination of Line End Style
Determine the line end type with the aid of a five-character hexadecimal value
which you then convert into its equivalent decimal value.

To determine the line ends for the object, go to the " Line Ends " window and
proceed as follows:


Left-hand column: Configures the start of the line. Value range (from the top
down) 0 to 6. The start of the line corresponds to the first character in the
hexadecimal value. In the configuration shown, the value of the first character
is " 3 " .



Right-hand column: Configures the line end. Value range (from the top down) 0
to 6. The line end corresponds to the fifth character in the hexadecimal value.
In the configuration shown, the value of the fifth character is " 6 " .

This gives a hexadecimal value of " 60003 " . This corresponds to a decimal value of
" 393219 " , which you then assign to the BorderEndStyle property.

594

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
The " LineConfiguration() " procedure accesses the properties of the line. In this
example the type of line end will be set to the configuration illustrated above:
Sub LineConfiguration()
'VBA419
Dim objLine As HMILine
Set objLine =
ActiveDocument.HMIObjects.AddHMIObject( " Line1 " ,
" HMILine " )
With objLine
.BorderEndStyle = 393219
End With
End Sub

Printout of the Online Help
Automated Configuring

595

ActualPointTopIndex

11.05

5.7.2.30 BorderFlashColorOff Property

Description
Defines or returns the line color of the object when the flash status is " Off " . LONG
read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the color when the flash status is " Off " will be set to
" Black " :
Sub RectangleConfiguration()
'VBA420
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BorderFlashColorOff = RGB(0, 0, 0)
End With
End Sub

596

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.31 BorderFlashColorOn Property

Description
Defines or returns the line color of the object when the flash status is " On " . LONG
read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the color when the flash status is " On " will be set to
" Red " :
Sub RectangleConfiguration()
'VBA421
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BorderFlashColorOn = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

597

ActualPointTopIndex

11.05

5.7.2.32 BorderStyle Property

Description
Defines or returns the line style for the object. Value range 0 to 4.
Line Style

Assigned Value
0
1
2
3
4

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the line style will be set to " 1 " :
Sub RectangleConfiguration()
'VBA422
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.BorderStyle = 1
End With
End Sub

598

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.33 BorderWidth Property

Description
Defines or returns the line weight (in pixels) for the object.

Example
in the following example the line weight of a newly added circle will be set to " 2 " .
Sub CircleConfiguration()
'VBA423
Dim objCircle As IHMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle1 " ,
" HMICircle " )
With objCircle
.BorderWidth = 2
End With
End Sub

Printout of the Online Help
Automated Configuring

599

ActualPointTopIndex

11.05

5.7.2.34 BottomConnectedObjectName Property

Description
Returns the name of the starting object to which the connector is connected. Read
access.

Example:
An example showing how to use the BottomConnectedObjectName property can
be found in this documentation under the heading " ObjConnection Object " .

600

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.35 BottomConnectedConnectionPointIndex Property

Description
Returns the connection point on the object to which the connector is connected.
Connection Point

Assigned Value

Up

0

Right

1

Down

2

Left

3

Example
An example showing how to use the BottomConnectedObjectName property can
be found in this documentation under the heading " ObjConnection Object " .

Printout of the Online Help
Automated Configuring

601

ActualPointTopIndex

11.05

5.7.2.36 BoxAlignment Property

Description
TRUE if the fields are aligned to the right. BOOLEAN read-write access.

Example
The " CreateOptionGroup() " procedure creates the OptionGroup object with four
option buttons. Each option button is assigned the default name
" myCustomText & lt; Number & gt; " :
Sub CreateOptionGroup()
'VBA424
Dim objRadioBox As HMIOptionGroup
Dim iCounter As Integer
Set objRadioBox =
ActiveDocument.HMIObjects.AddHMIObject( " RadioBox_1 " ,
" HMIOptionGroup " )
iCounter = 1
With objRadioBox
.Height = 100
.Width = 180
.BoxCount = 4
.BoxAlignment = False
For iCounter = 1 To .BoxCount
.index = iCounter
.Text = " CustomText " & .index
Next iCounter
End With
End Sub

602

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.37 BoxCount Property

Description
Defines or returns the number of fields. Value range from 1 up to 32.

Example
The " CreateOptionGroup " () procedure creates the OptionGroup object with four
option buttons. Each option button is assigned the default name
" myCustomText & lt; Number & gt; " :
Sub CreateOptionGroup()
'VBA425
Dim objRadioBox As HMIOptionGroup
Dim iCounter As Integer
Set objRadioBox =
ActiveDocument.HMIObjects.AddHMIObject( " RadioBox_1 " ,
" HMIOptionGroup " )
iCounter = 1
With objRadioBox
.Height = 100
.Width = 180
.BoxCount = 4
.BoxAlignment = True
For iCounter = 1 To .BoxCount
.index = iCounter
.Text = " CustomText " & .index
Next iCounter
End With
End Sub

Printout of the Online Help
Automated Configuring

603

ActualPointTopIndex

11.05

5.7.2.38 BoxType Property

Description
Defines or returns the field type. Value range from 0 to 2.
Field Type

Assigned Value

Output

0

Input

1

I/O Field

2

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the field type is configured as " Input " :
Sub IOFieldConfiguration()
'VBA426
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.BoxType = 1
End With
End Sub

604

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.39 Button1Width Property

Description
Defines or returns for the Group Display object the width of button 1 in pixels.
If the SameSize property is set to TRUE, all the buttons are given the same width.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the width of button 1 will be set to " 50 " .
Sub GroupDisplayConfiguration()
'VBA427
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.Button1Width = 50
End With
End Sub

Printout of the Online Help
Automated Configuring

605

ActualPointTopIndex

11.05

5.7.2.40 Button2Width Property

Description
Defines or returns for the Group Display object the width of button 2 in pixels.
If the SameSize property is set to TRUE, all the buttons are given the same width.
Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the width of button 2 will be set to " 50 " .
Sub GroupDisplayConfiguration()
'VBA428
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.Button2Width = 50
End With
End Sub

606

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.41 Button3Width Property

Description
Defines or returns for the Group Display object the width of button 3 in pixels.
If the SameSize property is set to TRUE, all the buttons are given the same width.
Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the width of button 3 will be set to " 50 " .
Sub GroupDisplayConfiguration()
'VBA429
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.Button3Width = 50
End With
End Sub

Printout of the Online Help
Automated Configuring

607

ActualPointTopIndex

11.05

5.7.2.42 Button4Width Property

Description
Defines or returns for the Group Display object the width of button 4 in pixels.
If the SameSize property is set to TRUE, all the buttons are given the same width.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the width of button 4 will be set to " 50 " .
Sub GroupDisplayConfiguration()
'VBA430
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.Button4Width = 50
End With
End Sub

608

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.2.43 ButtonColor Property

Description
Defines or returns the color of the slider for the Slider object. LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " SliderConfiguration " () procedure accesses the properties of the slider. In this
example the color of the slider will be set to " Yellow " .
Sub SliderConfiguration()
'VBA431
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.ButtonColor = RGB(255, 255, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

609

ActualPointTopIndex

5.7.3
5.7.3.1

11.05

VBA Properties: C
Caption Property

Description
TRUE if the application window or picture window has a title bar in runtime.
BOOLEAN read-write access.
The Caption property must be set to " True " if the intention is that the application
window or picture window shall have Maximize and Close buttons.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example the application window will be configured:
Sub ApplicationWindowConfig()
'VBA432
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow " ,
" HMIApplicationWindow " )
With objAppWindow
.Caption = True
.CloseButton = False
.Height = 200
.Left = 10
.MaximizeButton = True
.Moveable = False
.OnTop = True
.Sizeable = True
.Top = 20
.Visible = True
.Width = 250
.WindowBorder = True
End With
End Sub

610

Printout of the Online Help
Automated Configuring

11.05

5.7.3.2

ActualPointTopIndex

CaptionText Property

Description
Defines or returns the window title that will be displayed for the PictureWindow
object in runtime.
The Caption property must be set to " TRUE " .

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA433
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

611

ActualPointTopIndex

5.7.3.3

11.05

CheckAlarmHigh Property

Description
TRUE if the " Alarm High " limit value is being monitored for the BarGraph object.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties AlarmHigh, ColorAlarmHigh and TypeAlarmHigh.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 50 " .
Sub BarGraphLimitConfiguration()
'VBA434
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeAlarmHigh = False
'Activate monitoring
.CheckAlarmHigh = True
'Set barcolor to " yellow "
.ColorAlarmHigh = RGB(255, 255, 0)
'Set upper limit to " 50 "
.AlarmHigh = 50
End With
End Sub

612

Printout of the Online Help
Automated Configuring

11.05

5.7.3.4

ActualPointTopIndex

CheckAlarmLow Property

Description
TRUE if the " Alarm Low " limit value is being monitored for the BarGraph object.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties AlarmLow, ColorAlarmLow and TypeAlarmLow.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 10 " .
Sub BarGraphLimitConfiguration()
'VBA435
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeAlarmLow = False
'Activate monitoring
.CheckAlarmLow = True
'Set barcolor to " yellow "
.ColorAlarmLow = RGB (255, 255, 0)
'Set lower limit to " 10 "
.AlarmLow = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

613

ActualPointTopIndex

5.7.3.5

11.05

Checked Property

Description
TRUE if a check mark is to appear in front of the user-defined menu entry.
BOOLEAN read-write access.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ): The first menu entry
is also provided with a check mark:
Sub CreateMenuItem()
'VBA436
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
'
'Add new menu " Delete objects " to menubar:
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Add two menuitems to the new menu
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete Rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete Circles " )
With objMenu.MenuItems
.Item( " DeleteAllRectangles " ).Checked = True
End With
End Sub

614

Printout of the Online Help
Automated Configuring

11.05

5.7.3.6

ActualPointTopIndex

CheckLimitHigh4 Property

Description
TRUE if the " Reserve 4 " high limit value of the BarGraph object is to be monitored.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties LimitHigh4, ColorLimitHigh4 and TypeLimitHigh4.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 70 " .
Sub BarGraphLimitConfiguration()
'VBA437
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh4 = False
'Activate monitoring
.CheckLimitHigh4 = True
'set barcolor to " red "
.ColorLimitHigh4 = RGB(255, 0, 0)
'Set upper limit to " 70 "
.LimitHigh4 = 70
End With
End Sub

Printout of the Online Help
Automated Configuring

615

ActualPointTopIndex

5.7.3.7

11.05

CheckLimitHigh5 Property

Description
TRUE if the " Reserve 5 " high limit value of the BarGraph object is to be monitored.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties LimitHigh5, ColorLimitHigh5 and TypeLimitHigh5.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 80 " .
Sub BarGraphLimitConfiguration()
'VBA438
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh5 = False
'Activate monitoring
.CheckLimitHigh5 = True
'set barcolor to " black "
.ColorLimitHigh5 = RGB(0, 0, 0)
'Set upper limit to " 80 "
.LimitHigh5 = 80
End With
End Sub

616

Printout of the Online Help
Automated Configuring

11.05

5.7.3.8

ActualPointTopIndex

CheckLimitLow4 Property

Description
TRUE if the " Reserve 4 " low limit value of the BarGraph object is to be monitored.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties LimitLow4, ColorLimitLow4 and TypeLimitLow4.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 5 " .
Sub BarGraphLimitConfiguration()
'VBA439
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow4 = False
'Activate monitoring
.CheckLimitLow4 = True
'Set barcolor to " green "
.ColorLimitLow4 = RGB(0, 255, 0)
'set lower limit to " 5 "
.LimitLow4 = 5
End With
End Sub

Printout of the Online Help
Automated Configuring

617

ActualPointTopIndex

5.7.3.9

11.05

CheckLimitLow5 Property

Description
TRUE if the " Reserve 5 " low limit value of the BarGraph object is to be monitored.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties LimitLow5, ColorLimitLow5 and TypeLimitLow5.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 0 " .
Sub BarGraphLimitConfiguration()
'VBA440
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow5 = False
'Activate monitoring
.CheckLimitLow5 = True
'Set barcolor to " white "
.ColorLimitLow5 = RGB(255, 255, 255)
'set lower limit to " 0 "
.LimitLow5 = 0
End With
End Sub

618

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.10 CheckToleranceHigh Property

Description
TRUE if the " Tolerance High " limit value is being monitored for the BarGraph
object. BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties ToleranceHigh, ColorToleranceHigh and
TypeToleranceHigh.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 45 " .
Sub BarGraphLimitConfiguration()
'VBA441
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeToleranceHigh = False
'Activate monitoring
.CheckToleranceHigh = True
'Set barcolor to " yellow "
.ColorToleranceHigh = RGB(255, 255, 0)
'Set upper limit to " 45 "
.ToleranceHigh = 45
End With
End Sub

Printout of the Online Help
Automated Configuring

619

ActualPointTopIndex

11.05

5.7.3.11 CheckToleranceLow Property

Description
TRUE if the " Tolerance Low " limit value is being monitored for the BarGraph object.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties ToleranceLow, ColorToleranceLow and
TypeToleranceLow.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 15 " .
Sub BarGraphLimitConfiguration()
'VBA442
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeToleranceLow = False
'Activate monitoring
.CheckToleranceLow = True
'Set barcolor to " yellow "
.ColorToleranceLow = RGB(255, 255, 0)
'Set lower limit to " 15 "
.ToleranceLow = 15
End With
End Sub

620

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.12 CheckWarningHigh Property

Description
TRUE if the " Warning High " limit value is being monitored for the BarGraph object.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties WarningHigh, ColorWarningHigh and
TypeWarningHigh.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 75 " .
Sub BarGraphLimitConfiguration()
'VBA443
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeWarningHigh = False
'Activate monitoring
.CheckWarningHigh = True
'Set barcolor to " red "
.ColorWarningHigh = RGB(255, 0, 0)
'Set upper limit to " 75 "
.WarningHigh = 75
End With
End Sub

Printout of the Online Help
Automated Configuring

621

ActualPointTopIndex

11.05

5.7.3.13 CheckWarningLow Property

Description
TRUE if the " Warning Low " limit value is being monitored for the BarGraph object.
BOOLEAN read-write access.
The limit value, the display on reaching the limit value and the type of evaluation
are defined via the properties WarningLow, ColorWarningLow and
TypeWarningLow.

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 12 " .
Sub BarGraphLimitConfiguration()
'VBA444
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeWarningLow = False
'Activate monitoring
.CheckWarningLow = True
'Set barcolor to " magenta "
.ColorWarningLow = RGB(255, 0, 255)
'Set lower limit to " 12 "
.WarningLow = 12
End With
End Sub

622

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.14 ClearOnError Property

Description
TRUE if the entry in the I/O field is automatically deleted when the input is
incorrect. BOOLEAN read-write access.

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the I/O field is to be cleared when the input is incorrect:
Sub IOFieldConfiguration()
'VBA445
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.ClearOnError = True
End With
End Sub

Printout of the Online Help
Automated Configuring

623

ActualPointTopIndex

11.05

5.7.3.15 ClearOnNew Property

Description
TRUE if the entry in the I/O field is deleted as soon as the I/O field gets the focus.
BOOLEAN read-write access.
Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the entry in the I/O field is deleted as soon as the field gets the focus:
Sub IOFieldConfiguration()
'VBA446
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.ClearOnNew = True
End With
End Sub

624

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.16 CloseButton Property

Description
TRUE if the ApplicationWindow and PictureWindow objects possess a " Close "
button in runtime. BOOLEAN read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example the application window will have a " Close "
button in runtime:
Sub ApplicationWindowConfig()
'VBA447
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow1 " ,
" HMIApplicationWindow " )
With objAppWindow
.CloseButton = True
End With
End Sub

Printout of the Online Help
Automated Configuring

625

ActualPointTopIndex

11.05

5.7.3.17 CollectValue Property

Description
Contains the current status of the active message classes as its input value in
runtime. LONG read-write access.
By creating dynamics with the aid of a tag, for example, the value can be
determined from the group displays of subordinate pictures.

Example
--

626

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.18 ColorAlarmHigh Property

Description
Defines or returns the bar color for the " Alarm High " limit value. LONG read-write
access.
The value of the " CheckAlarmHigh " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 50 " and the bar color will
change to " Red " .
Sub BarGraphLimitConfiguration()
'VBA449
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeAlarmHigh = False
'Activate monitoring
.CheckAlarmHigh = True
'Set barcolor to " red "
.ColorAlarmHigh = RGB(255, 0, 0)
'Set upper limit to " 50 "
.AlarmHigh = 50
End With
End Sub

Printout of the Online Help
Automated Configuring

627

ActualPointTopIndex

11.05

5.7.3.19 ColorAlarmLow Property

Description
Defines or returns the bar color for the " Alarm Low " limit value. LONG read-write
access.
The value of the " CheckAlarmLow " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 10 " and the bar color will
change to " Red " .
Sub BarGraphLimitConfiguration()
'VBA450
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeAlarmLow = False
'Activate monitoring
.CheckAlarmLow = True
'Set barcolor to " red "
.ColorAlarmLow = RGB(255, 0, 0)
'Set lower limit to " 10 "
.AlarmLow = 10
End With
End Sub

628

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.20 ColorBottom Property

Description
Defines or returns the color for the lower/right view of the Slider object. LONG
read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " SliderConfiguration " () procedure accesses the properties of the slider. In this
example the color for the lower/right view will be set to " Red " :
Sub SliderConfiguration()
'VBA451
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.ColorBottom = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

629

ActualPointTopIndex

11.05

5.7.3.21 ColorChangeType Property

Description
TRUE if a color change in the BarGraph object (for instance when a limit value is
reached) is to take place segment by segment. FALSE will apply the color change
to the entire bar. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the
BarGraph object. In this example the color change will apply to the whole bar:
Sub BarGraphLimitConfiguration()
'VBA452
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.ColorChangeType = False
End With
End Sub

630

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.22 ColorLimitHigh4 Property

Description
Defines or returns the color for the " Reserve 4 " high limit value. LONG read-write
access.
The value of the " CheckLimitHigh4 " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 70 " and the bar color will
change to " Red " .
Sub BarGraphLimitConfiguration()
'VBA453
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh4 = False
'Activate monitoring
.CheckLimitHigh4 = True
'Set barcolor to " red "
.ColorLimitHigh4 = RGB(255, 0, 0)
'Set upper limit to " 70 "
.LimitHigh4 = 70
End With
End Sub

Printout of the Online Help
Automated Configuring

631

ActualPointTopIndex

11.05

5.7.3.23 ColorLimitHigh5 Property

Description
Defines or returns the color for the " Reserve 5 " high limit value. LONG read-write
access.
The value of the " CheckLimitHigh5 " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 80 " and the bar color will
change to " Black " .
Sub BarGraphLimitConfiguration()
'VBA454
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh5 = False
'Activate monitoring
.CheckLimitHigh5 = True
'Set barcolor to " black "
.ColorLimitHigh5 = RGB(0, 0, 0)
'Set upper limit to " 80 "
.LimitHigh5 = 80
End With
End Sub

632

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.24 ColorLimitLow4 Property

Description
Defines or returns the color for the " Reserve 4 " low limit value. LONG read-write
access.
The value of the " CheckLimitLow4 " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 5 " and the bar color will
change to " Green " .
Sub BarGraphLimitConfiguration()
'VBA455
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow4 = False
'Activate monitoring
.CheckLimitLow4 = True
'Set barcolor to " green "
.ColorLimitLow4 = RGB(0, 255, 0)
'Set lower limit to " 5 "
.LimitLow4 = 5
End With
End Sub

Printout of the Online Help
Automated Configuring

633

ActualPointTopIndex

11.05

5.7.3.25 ColorLimitLow5 Property

Description
Defines or returns the color for the " Reserve 5 " low limit value. LONG read-write
access.
The value of the " CheckLimitLow5 " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 0 " and the bar color will
change to " White " .
Sub BarGraphLimitConfiguration()
'VBA456
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow5 = False
'Activate monitoring
.CheckLimitLow5 = True
'Set barcolor to " white "
.ColorLimitLow5 = RGB(255, 255, 255)
'Set lower limit to " 0 "
.LimitLow5 = 0
End With
End Sub

634

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.26 ColorToleranceHigh Property

Description
Defines or returns the color for the " Tolerance High " high limit value. LONG readwrite access.
The value of the " CheckToleranceHigh " property must be TRUE if the bar color is
to change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 45 " and the bar color will
change to " Yellow " .
Sub BarGraphLimitConfiguration()
'VBA457
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeToleranceHigh = False
'Activate monitoring
.CheckToleranceHigh = True
'Set barcolor to " yellow "
.ColorToleranceHigh = RGB(255, 255, 0)
'Set upper limit to " 45 "
.ToleranceHigh = 45
End With
End Sub

Printout of the Online Help
Automated Configuring

635

ActualPointTopIndex

11.05

5.7.3.27 ColorToleranceLow Property

Description
Defines or returns the color for the " Tolerance Low " low limit value. LONG readwrite access.
The value of the " CheckToleranceLow " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 12 " and the bar color will
change to " Yellow " .
Sub BarGraphLimitConfiguration()
'VBA458
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeToleranceLow = False
'Activate monitoring
.CheckToleranceLow = True
'Set barcolor to " yellow "
.ColorToleranceLow = RGB(255, 255, 0)
'Set lower limit to " 15 "
.ToleranceLow = 15
End With
End Sub

636

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.28 ColorTop Property

Description
Defines or returns the color for the upper/left view of the Slider object. LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " SliderConfiguration " () procedure accesses the properties of the slider. In this
example the color for the upper/left view will be set to " Orange " :
Sub SliderConfiguration()
'VBA459
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.ColorTop = RGB(255, 128, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

637

ActualPointTopIndex

11.05

5.7.3.29 ColorWarningHigh Property

Description
Defines or returns the color for the " Warning High " high limit value. LONG readwrite access.
The value of the " CheckWarningHigh " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 75 " and the bar color will
change to " Red " .
Sub BarGraphLimitConfiguration()
'VBA460
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeWarningHigh = False
'Activate monitoring
.CheckWarningHigh = True
'Set barcolor to " red "
.ColorWarningHigh = RGB(255, 0, 0)
'Set upper limit to " 75 "
.WarningHigh = 75
End With
End Sub

638

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.30 ColorWarningLow Property

Description
Defines or returns the color for the " Warning Low " low limit value. LONG read-write
access.
The value of the " CheckWarningLow " property must be TRUE if the bar color is to
change on reaching the limit value.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphLimitConfiguration " () procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 12 " and the bar color will
change to " Magenta " .
Sub BarGraphLimitConfiguration()
'VBA461
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeWarningLow = False
'Activate monitoring
.CheckWarningLow = True
'Set barcolor to " magenta "
.ColorWarningLow = RGB(255, 0, 255)
'Set lower limit to " 12 "
.WarningLow = 12
End With
End Sub

Printout of the Online Help
Automated Configuring

639

ActualPointTopIndex

11.05

5.7.3.31 CommonVBSCode Property

Description
Defines general VBS code for the active picture and returns it.
Using the Dim instruction, you can declare tags as well as functions and
procedures in this code. In Runtime each VBS action can access the tags,
functions and procedures if the picture is active.

Example
In the following example, a tag is defined in the active picture and then output:
Sub DefineTagInActiveDocument
ActiveDocument.CommonVBSCode = " Dim GlobalTag "
MsgBox ActiveDocument.CommonVBSCode
End Sub

640

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.32 CommandLine Property

Description
Returns the start parameter as a string if the application is to be opened via
Start & gt; Run " Grafexe.exe Start Parameter " . Read access.

Example
In this example a message containing the start parameter is output on opening the
document.
Sub Document_Opened(CancelForwarding As Boolean)
'VBA462
MsgBox Application.Commandline
End Sub

Printout of the Online Help
Automated Configuring

641

ActualPointTopIndex

11.05

5.7.3.33 Compiled Property

Description
TRUE if the source code of a C script or VB script was successfully compiled.
BOOLEAN read access.

Example
In the following example a button and a circle will be inserted in the active picture.
In runtime the radius of the circle will enlarge every time you click the button. A VB
script will be used for this purpose:
Sub IncreaseCircleRadiusWithVBScript()
'VBA463
Dim objButton As HMIButton
Dim objCircleA As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Dim strCode As String
strCode = " Dim objCircle " & vbCrLf & " Set objCircle = "
strCode = strCode &
" hmiRuntime.ActiveScreen.ScreenItems( " " CircleVB " " ) "
strCode = strCode & vbCrLf & " objCircle.Radius =
objCircle.Radius + 5 "
Set objCircleA =
ActiveDocument.HMIObjects.AddHMIObject( " CircleVB " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircleA
.Top = 100
.Left = 100
End With
With objButton
.Top = 10
.Left = 10
.Width = 200
.Text = " Increase Radius "
End With
'On every mouseclick the radius will be increased:
Set objEvent = objButton.Events(1)

642

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
objVBScript.SourceCode = strCode
Select Case objVBScript.Compiled
Case True
MsgBox " Compilation OK! "
Case False
MsgBox " Errors by compilation! "
End Select
End Sub

Printout of the Online Help
Automated Configuring

643

ActualPointTopIndex

11.05

5.7.3.34 ConfigurationFileName Property

Description
Returns the file name and full path of the configuration file for the open project.
STRING read access.

Example
The " ShowConfigurationFileName() procedure outputs the configuration file path
for the current picture:
Sub ShowConfigurationFileName()
'VBA464
MsgBox ActiveDocument.Application.ConfigurationFileName
End Sub

" ConfigurationFileName " property: Outputs the path and name of the configuration
file " Default.pdd "

644

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.35 Count Property

Description
Returns the number of elements in the specified listing. LONG read access

Example
In the following example a new picture will be created and a pair of objects will be
inserted. The number of inserted objects will be output at the end:
Sub ObjectsInActiveDocument()
'VBA465
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objDocument As Document
Set objDocument = Application.Documents.Add
hmiDocumentTypeVisible
Dim iIndex As Integer
iIndex = 1
For iIndex = 1 To 5
Set objCircle =
objDocument.HMIObjects.AddHMIObject( " Circle " &
iIndex, " HMICircle " )
Set objRectangle =
objDocument.HMIObjects.AddHMIObject( " Rectangle " &
iIndex, " HMIRectangle " )
With objCircle
.Top = (10 * iIndex)
.Left = (10 * iIndex)
End With
With objRectangle
.Top = ((10 * iIndex) + 50)
.Left = (10 * iIndex)
End With
Next iIndex
MsgBox " There are " & objDocument.HMIObjects.Count & "
objects in the document "
End Sub

Printout of the Online Help
Automated Configuring

645

ActualPointTopIndex

11.05

5.7.3.36 CurrentDataLanguage Property

Description
Defines the project language or returns the language identifier as a decimal value.
LONG read-write access.

Example
The " ShowDataLanguage() " procedure outputs the currently set project language:
Sub ShowDataLanguage()
'VBA466
MsgBox Application.CurrentDataLanguage
End Sub

646

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.37 CurrentDesktopLanguage Property

Description
Returns the language identifier of the currently set user interface language as a
decimal value. LONG read access.

Example
The " ShowDesktopLanguage() " procedure outputs the currently set user interface
language:
Sub ShowDesktopLanguage()
'VBA467
MsgBox Application.CurrentDesktopLanguage
End Sub

Printout of the Online Help
Automated Configuring

647

ActualPointTopIndex

11.05

5.7.3.38 CursorControl Property

Description
TRUE if the TAB sequence skips to the next field upon exiting the current field
when the alpha cursor mode is active. BOOLEAN read-write access.
The CursorMode property must be set to TRUE.

Example
The " IOFieldConfiguration " () procedure accesses the properties of the I/O field. In
this example the cursor will skip to the next field upon exiting the current field. For
this to work, the CursorMode property must first be set to TRUE.
Sub IOFieldConfiguration()
'VBA468
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
Application.ActiveDocument.CursorMode = True
With objIOField
.CursorControl = True
End With
End Sub

648

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.39 CursorMode Property

Description
TRUE if the " Alpha Cursor " mode is to be activated. FALSE if the " Tab Order
Cursor " mode is to be activated. BOOLEAN read-write access.

Example
The " ActiveDocumentConfiguration " () procedure accesses the properties of the
current picture in the Graphics Designer. In this example the " Alpha Cursor " mode
will be activated:
Sub ActiveDocumentConfiguration()
'VBA469
Application.ActiveDocument.CursorMode = True
End Sub

Printout of the Online Help
Automated Configuring

649

ActualPointTopIndex

11.05

5.7.3.40 CustomMenus Property

Description
Returns a listing of the available user-defined menus.

Example
The " ShowCustomMenuInformation() " procedure outputs the Key and Label of all
user-defined menus in the current picture:
Sub ShowCustomMenuInformation()
'VBA470
Dim strKey As String
Dim strLabel As String
Dim strOutput As String
Dim iIndex As Integer
For iIndex = 1 To ActiveDocument.CustomMenus.Count
strKey = ActiveDocument.CustomMenus(iIndex).Key
strLabel = ActiveDocument.CustomMenus(iIndex).Label
strOutput = strOutput & vbCrLf & " Key: " & strKey &
" Label: " & strLabel
Next iIndex
If 0 = ActiveDocument.CustomMenus.Count Then
strOutput = " There are no custommenus for the
document created. "
End If
MsgBox strOutput
End Sub

650

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.41 CustomToolbars Property

Description
Returns a listing of the available user-defined toolbars.

Example
The " ShowCustomToolbarInformation() " procedure outputs the Key values of all
user-defined toolbars in the current picture:
Sub ShowCustomToolbarInformation()
'VBA471
Dim strKey As String
Dim strOutput As String
Dim iIndex As Integer
For iIndex = 1 To ActiveDocument.CustomToolbars.Count
strKey = ActiveDocument.CustomToolbars(iIndex).Key
strOutput = strOutput & vbCrLf & " Key: " & strKey
Next iIndex
If 0 = ActiveDocument.CustomToolbars.Count Then
strOutput = " There are no toolbars created for this
document. "
End If
MsgBox strOutput
End Sub

Printout of the Online Help
Automated Configuring

651

ActualPointTopIndex

11.05

5.7.3.42 CycleName Property

Description
Returns the name of the specified tag trigger. Read access.

Example
--

5.7.3.43 CycleTime Property

Description
Returns the cycle time of the specified tag trigger. Read access.

Example
--

652

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.3.44 CycleType Property

Description
Defines or returns the cycle type.

Example
The " DynamicToRadiusOfNewCircle(hmiCircle As IHMICircle) " procedure creates
a dynamic for the radius of a circle. In this example the radius of the circle will be
set every two seconds:
Sub DynamicToRadiusOfNewCircle()
'VBA474
Dim objCircle As hmiCircle
Dim VariableTrigger As HMIVariableTrigger
Set objCircle =
Application.ActiveDocument.HMIObjects.AddHMIObject( " Circ
le1 " , " HMICircle " )
Set VariableTrigger =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVar
iableDirect, " NewDynamic1 " )
VariableTrigger.CycleType = hmiVariableCycleType_2s
End Sub

Printout of the Online Help
Automated Configuring

653

ActualPointTopIndex

5.7.4
5.7.4.1

11.05

VBA Properties: D
DataFormat Property

Description
Defines or returns the data type of the IOField object. Value range 0 to 3.
Data Type

Assigned Value

Binary

0

Decimal

1

String

2

Hexadecimal

3

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example, data type " Decimal " will be set for the I/O field:
Sub IOFieldConfiguration()
'VBA475
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.DataFormat = 1
End With
End Sub

654

Printout of the Online Help
Automated Configuring

11.05

5.7.4.2

ActualPointTopIndex

DefaultHMIObjects Property

Description
Returns the HMIDefaultObjects listing.

Example
The " ShowDefaultObjectNames() " procedure outputs all the object names
contained in the HMIDefaultObjects listing:
Sub ShowDefaultObjectNames()
'VBA476
Dim strOutput As String
Dim iIndex As Integer
For iIndex = 1 To Application.DefaultHMIObjects.Count
strOutput = strOutput & vbCrLf &
Application.DefaultHMIObjects(iIndex).ObjectName
Next iIndex
MsgBox strOutput
End Sub

Printout of the Online Help
Automated Configuring

655

ActualPointTopIndex

5.7.4.3

11.05

DestinationLink Property

Description
Returns the Destination object. Use the DestinationLink property to configure the
destination object in the case of a direct connection.

Example
Use the DestinationLink property to return the DestLink object. In the following
example the X position of " Rectangle_A " is copied to the Y position of
" Rectangle_B " in runtime by clicking on the button:
Sub DirectConnection()
'VBA477
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 100

656

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Text = " SetPosition "
End With
'
'Directconnection is initiated by mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Printout of the Online Help
Automated Configuring

657

ActualPointTopIndex

5.7.4.4

11.05

Direction Property

Description
Defines or returns the bar graph alignment. BOOLEAN read-write access.
Slider
Defines or returns the position of the Slider object. BOOLEAN read-write access.
Position/Bar Axis

Assigned Value

Vertical/Negative

TRUE

Horizontal/Positive

FALSE

Example
The " SliderConfiguration() " procedure accesses the properties of the slider. In this
example the position of the Slider object will be set to " Vertical " :
Sub SliderConfiguration()
'VBA478
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.Direction = True
End With
End Sub

658

Printout of the Online Help
Automated Configuring

11.05

5.7.4.5

ActualPointTopIndex

DisableVBAEvents Property

Description
TRUE if Event Handling is disabled. BOOLEAN read-write access.

Example
The " DisableVBAEvents() " procedure disables Event Handling:
Sub DisableVBAEvents()
'VBA479
Application.DisableVBAEvents = False
End Sub

Printout of the Online Help
Automated Configuring

659

ActualPointTopIndex

5.7.4.6

11.05

DisplayName Property

Description
Returns the name of the property attribute. STRING read access.
Thus the expression " MsgBox
ActiveDocument.HMIObjects( " Circle_1 " ).Properties( " Height " ).DisplayName " would
output the result " Height " .

Example
The " ShowAllObjectDisplayNames() " procedure outputs all the property attribute
names of standard objects contained in the message box:
Sub ShowAllObjectDisplayNames()
'VBA480
Dim strOutput As String
Dim iIndex1 As Integer
iIndex1 = 1
strOutput = " List of all properties-displaynames from
object " " " & Application.DefaultHMIObjects(1).ObjectName
& " " " " & vbCrLf & vbCrLf
For iIndex1 = 1 To
Application.DefaultHMIObjects(1).Properties.Count
strOutput = strOutput &
Application.DefaultHMIObjects(1).Properties(iIndex1
).DisplayName & " / "
Next iIndex1
MsgBox strOutput
End Sub

660

Printout of the Online Help
Automated Configuring

11.05

5.7.4.7

ActualPointTopIndex

DisplayOptions Property

Description
Specifies the assignment of the " Button " object or returns its value. Value range 0
to 3.
Assignment

Assigned Value

Picture or text

0

Picture and text

1

Text only

2

Picture only

3

Example
The " ButtonConfiguration() " procedure accesses the properties of the button.
In this example the button is assigned " Picture and text " :
Sub ButtonConfiguration()
'VBA???
Dim objbutton As HMIButton
Set objbutton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objbutton
.DisplayOptions = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

661

ActualPointTopIndex

5.7.4.8

11.05

DisplayText Property

Description
Returns the value for the " Label " or " TooltipText " property of the following objects
(STRING read access):


Menu Object



MenuItem Object



ToolbarItem Object

Example
The " ShowLabelTexts() " procedure outputs all the labels of the first user-defined
menu in the current picture:
Sub ShowLabelTexts()
'VBA481
Dim objLangText As HMILanguageText
Dim iIndex As Integer
For iIndex = 1 To
ActiveDocument.CustomMenus(1).LDLabelTexts.Count
Set objLangText =
ActiveDocument.CustomMenus(1).LDLabelTexts(iIndex)
MsgBox objLangText.DisplayName
Next iIndex
End Sub

662

Printout of the Online Help
Automated Configuring

11.05

5.7.4.9

ActualPointTopIndex

Documents Property

Description
Returns the Documents listing containing all open pictures. The open pictures are
in chronological order.

Example
In the following example the names of all open pictures are output:
Sub ShowDocuments()
'VBA482
Dim colDocuments As Documents
Dim objDocument As Document
Dim strOutput As String
Set colDocuments = Application.Documents
strOutput = " List of all opened documents: " & vbCrLf
For Each objDocument In colDocuments
strOutput = strOutput & vbCrLf & objDocument.Name
Next objDocument
MsgBox strOutput
End Sub

Printout of the Online Help
Automated Configuring

663

ActualPointTopIndex

11.05

5.7.4.10 Dynamic Property

Description
Returns the dynamics of a property.

Example
Use the Dynamic property if you wish to return, say, an existing dynamic. In the
following example all possibly available object property dynamics are output in the
active picture:
Sub ShowPropertiesDynamicsofAllObjects()
'VBA483
Dim objObject As HMIObject
Dim colObjects As HMIObjects
Dim colProperties As HMIProperties
Dim objProperty As HMIProperty
Dim strOutput As String
Set colObjects = Application.ActiveDocument.HMIObjects
For Each objObject In colObjects
Set colProperties = objObject.Properties
For Each objProperty In colProperties
If 0 & lt; & gt; objProperty.DynamicStateType Then
strOutput = strOutput & vbCrLf & objObject.ObjectName & "
- " & objProperty.DisplayName & " : Statetype " &
objProperty.Dynamic.DynamicStateType
End If
Next objProperty
Next objObject
MsgBox strOutput
End Sub

664

Printout of the Online Help
Automated Configuring

11.05

5.7.5
5.7.5.1

ActualPointTopIndex

VBA Properties: E
EditAtOnce Property

Description
TRUE, if accessing the field with the & lt; Tab & gt; key permits input immediately and
without further action. BOOLEAN read-write access.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example it shall be possible to enter input on skipping into the I/O field:
Sub IOFieldConfiguration()
'VBA484
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.EditAtOnce = True
End With
End Sub

Printout of the Online Help
Automated Configuring

665

ActualPointTopIndex

5.7.5.2

11.05

ElseCase Property

Description
Defines or returns the value for the dynamic property outside of the configured
value range.

Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned and three analog value ranges
will be created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA485
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.Add 50, 40
.AnalogResultInfos.Add 100, 80
.AnalogResultInfos.ElseCase = 100
End With
End Sub

666

Printout of the Online Help
Automated Configuring

11.05

5.7.5.3

ActualPointTopIndex

Enabled Property

Description
TRUE if the menu, the menu entry or the icon is activated and can be selected.
Applies only to user-defined menus and toolbars. BOOLEAN read-write access.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ): In this example the
second menu point in user-defined menu " Delete Objects " is grayed out and
cannot be selected in the Graphics Designer:
Sub DisableMenuItem()
'VBA486
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
'
'Add a new menu " Delete objects "
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Add two menuitems to the new menu
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete circles " )
'
'Disable menuitem " Delete circles "
With
ActiveDocument.CustomMenus( " DeleteObjects " ).MenuItems( " D
eleteAllCircles " )
.Enabled = False
End With
End Sub

Printout of the Online Help
Automated Configuring

667

ActualPointTopIndex

5.7.5.4

11.05

EndAngle Property

Description
Defines or returns the end of the object for the CircularArc, EllipseArc,
EllipseSegment and PieSegment objects. The specification is expressed in
degrees clockwise starting at 12:00 hrs.

Example
The " PieSegmentConfiguration() " procedure accesses the properties of the Pie
Segment. In this example the pie segment begins at 40° and ends at 180°:
Sub PieSegmentConfiguration()
'VBA487
Dim objPieSegment As HMIPieSegment
Set objPieSegment =
ActiveDocument.HMIObjects.AddHMIObject( " PieSegment1 " ,
" HMIPieSegment " )
With objPieSegment
.StartAngle = 40
.EndAngle = 180
End With
End Sub

668

Printout of the Online Help
Automated Configuring

11.05

5.7.5.5

ActualPointTopIndex

Events Property

Description
Returns the Events listing. Use the Events property to define the event that will
trigger an action. Use the index number to define the event that is intended to be
configured:


You configure an action on a property with VBA by using the " Events(1) "
property, where the index " 1 " stands for the event " Upon change " :



To configure an action onto an object with the aid of VBA, use the
" Events(Index) " property, where " Index " stands for the trigger event (see table):

Index

EventType (depending upon the object used)

0

hmiEventTypeNotDefined

1

hmiEventTypeMouseClick

2

hmiEventTypeMouseLButtonDown

3

hmiEventTypeMouseLButtonUp

4

hmiEventTypeMouseRButtonDown

5

hmiEventTypeMouseRButtonUp

6

hmiEventTypeKeyboardDown

7

hmiEventTypeKeyboardUp

8

hmiEventTypeObjectChange

9

hmiEventTypePropertyChange

10

hmiEventTypePropertyStateChange

11

hmiEventTypePictureOpen

12

hmiEventTypePictureClose

13

hmiEventTypeObjectDefined

14

hmiEventTypeFocusEnter

15

hmiEventTypeLastTriggerType

16

hmiEventTypeObjSpecificTriggerStart

Example
In the following example the X position of " Rectangle_A " is copied to the Y
position of " Rectangle_B " in runtime by clicking on the button:
Sub DirectConnection()
'VBA488
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent

Printout of the Online Help
Automated Configuring

669

ActualPointTopIndex

11.05

Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 100
.Text = " SetPosition "
End With
'
'Directconnection is initiated by mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

670

Printout of the Online Help
Automated Configuring

11.05

5.7.5.6

ActualPointTopIndex

EventType Property

Description
Returns the event type that is configured on the specified object.
Index

EventType (depending upon the object used)

0

hmiEventTypeNotDefined

1

hmiEventTypeMouseClick

2

hmiEventTypeMouseLButtonDown

3

hmiEventTypeMouseLButtonUp

4

hmiEventTypeMouseRButtonDown

5

hmiEventTypeMouseRButtonUp

6

hmiEventTypeKeyboardDown

7

hmiEventTypeKeyboardUp

8

hmiEventTypeObjectChange

9

hmiEventTypePropertyChange

10

hmiEventTypePropertyStateChange

11

hmiEventTypePictureOpen

12

hmiEventTypePictureClose

13

hmiEventTypeObjectDefined

14

hmiEventTypeFocusEnter

15

hmiEventTypeLastTriggerType

16

hmiEventTypeObjSpecificTriggerStart

Example
Use the EventType property to edit a previously configured event. In the following
example the event " Mouse Action " will be configured, but then changed to
" Pressed " :
Sub AddActionToObjectTypeCScript()
'VBA489
Dim objEvent As HMIEvent
Dim objCScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_AB " ,
" HMICircle " )
'
'C-action is initiated by click on object circle
Set objEvent = objCircle.Events(1)

Printout of the Online Help
Automated Configuring

671

ActualPointTopIndex

11.05

Set objCScript =
objEvent.Actions.AddAction(hmiActionCreationTypeCScript)
MsgBox " the type of the projected event is " &
objEvent.EventType
End Sub

672

Printout of the Online Help
Automated Configuring

11.05

5.7.5.7

ActualPointTopIndex

Exponent Property

Description
TRUE if numbers are to be displayed on the BarGraph object using exponents
(e.g. " 1.00e+000 " ). BOOLEAN read-write access.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example numbers are to be displayed on the bar using
exponents:
Sub BarGraphConfiguration()
'VBA490
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Exponent = True
End With
End Sub

Printout of the Online Help
Automated Configuring

673

ActualPointTopIndex

5.7.5.8

11.05

ExtendedOperation Property

Description
TRUE if the slider on the Slider object is set to the associated end value (minimum
value/maximum value). This is done by clicking on the area outside of the current
slider setting. BOOLEAN read-write access.

Example
The " SliderConfiguration() " procedure accesses the properties of the slider. In this
example the ExtendedOperation property will be set to TRUE:
Sub SliderConfiguration()
'VBA491
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.ExtendedOperation = True
End With
End Sub

674

Printout of the Online Help
Automated Configuring

11.05

5.7.5.9

ActualPointTopIndex

ExtendedZoomingEnable Property

Description
TRUE, if the selected process picture in Runtime may be zoomed in or out using
the mouse wheel. This happens by pushing the & lt; Ctrl & gt; key while the mouse wheel
is turned. If the mouse wheel is turned away from the palm of the hand, the zoom
factor increases.
BOOLEAN read-write access.
Requirements for using the zoom function:


Mouse driver by Logitech or Microsoft Intellimouse



Mouse wheel must be set to " Autoscroll " .



In the computer properties, the " Graphics Runtime " tab control must have the
" Extended zooming " function enabled for all process pictures.

Example
The procedure " DocConfiguration() " accesses picture properties.
In this example, the property ExtendedZoomingEnable is set to TRUE:
Sub DocConfiguration()
'VBA???
Dim objDoc As Document
Set objDoc = ActiveDocument
With objDoc
.ExtendedZoomingEnable = True
End With
End Sub

Printout of the Online Help
Automated Configuring

675

ActualPointTopIndex

5.7.6
5.7.6.1

11.05

VBA Properties: F
Family Property

Description
Defines or returns the language-dependent font.

Example
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA492
Dim colLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Dim iStartLangID As Integer
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
iStartLangID = Application.CurrentDataLanguage
With objButton
.Text = " Command "
.Width = 100
End With
Set colLangFonts = objButton.LDFonts
'
'To do typesettings for french:
With colLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'
'To do typesettings for english:
With colLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True

676

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Underlined = False
.Size = 14
End With
With objButton
Application.CurrentDataLanguage = 1036
.Text = " Command "
MsgBox " Datalanguage is changed in french "
Application.CurrentDataLanguage = 1033
.Text = " Command "
MsgBox " Datalanguage is changed in english "
Application.CurrentDataLanguage = iStartLangID
MsgBox " Datalanguage is changed back to
startlanguage. "
End With
End Sub

Printout of the Online Help
Automated Configuring

677

ActualPointTopIndex

5.7.6.2

11.05

FillColor Property

Description
Defines or returns the fill pattern for the object. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example the background color will be set to " Yellow " .
Sub RectangleConfiguration()
'VBA493
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.FillColor = RGB(255, 255, 0)
End With
End Sub

678

Printout of the Online Help
Automated Configuring

11.05

5.7.6.3

ActualPointTopIndex

Filling Property

Description
TRUE if an object with closed frame lines (such as a Circle or Rectangle) can be
filled (as in the fill level of a tank, for example). BOOLEAN read-write access.
To set the fill level of the object, use the FillingIndex property.

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example a rectangle can be used to display the fill level:
Sub RectangleConfiguration()
'VBA494
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.Filling = True
End With
End Sub

Printout of the Online Help
Automated Configuring

679

ActualPointTopIndex

5.7.6.4

11.05

FillingIndex Property

Description
Defines the percentage value (relative to the height of the object) to which to fill an
object with closed frame lines (such as a Circle or Rectangle).
The fill level is indicated in the current background color. The unfilled background
is transparent.

Example
The " RectangleConfiguration " () procedure accesses the properties of the
rectangle. In this example the rectangle will be filled to 50%:
Sub RectangleConfiguration()
'VBA495
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.Filling = True
.FillingIndex = 50
End With
End Sub

680

Printout of the Online Help
Automated Configuring

11.05

5.7.6.5

ActualPointTopIndex

FillStyle Property

Description
Defines or returns the fill pattern for the object.
Fill Pattern

Value

Fill Pattern

Value

65536

196623

0

196624

131075

196625

131076

196626

131077

196627

131074

196628

131072

196629

131073

196630

196608

196631

196609

196632

196610

196633

196611

196634

196612

196635

196613

196636

196614

196637

196615

196638

196616

196639

196617

196640

196618

196641

196619

196642

196620

196643

196621

196644

196622

Printout of the Online Help
Automated Configuring

--

--

681

ActualPointTopIndex

11.05

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example the fill pattern will be set to the value " 196643 " :
Sub RectangleConfiguration()
'VBA496
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.FillStyle = 196643
End With
End Sub

682

Printout of the Online Help
Automated Configuring

11.05

5.7.6.6

ActualPointTopIndex

FillStyle2 Property

Description
Defines or returns the fill pattern of the bar for the BarGraph object.
Fill Pattern

Value

Fill Pattern

Value

65536

196623

0

196624

131075

196625

131076

196626

131077

196627

131074

196628

131072

196629

131073

196630

196608

196631

196609

196632

196610

196633

196611

196634

196612

196635

196613

196636

196614

196637

196615

196638

196616

196639

196617

196640

196618

196641

196619

196642

196620

196643

196621

196644

196622

Printout of the Online Help
Automated Configuring

--

--

683

ActualPointTopIndex

11.05

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the bar pattern will be set to " 196643 " :
Sub BarGraphConfiguration()
'VBA497
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.FillStyle2 = 196643
End With
End Sub

684

Printout of the Online Help
Automated Configuring

11.05

5.7.6.7

ActualPointTopIndex

FlashBackColor Property

Description
TRUE if flashing of the object background is activated. BOOLEAN read-write
access.
Note:
A change to the attribute does not automatically deactivate the " Windows Style "
attribute.
Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example, background flashing is activated:
Sub RectangleConfiguration()
'VBA498
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.FlashBackColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

685

ActualPointTopIndex

5.7.6.8

11.05

FlashBorderColor Property

Description
TRUE if flashing of the object border is activated. BOOLEAN read-write access.

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example, flashing of the border is activated:
Sub RectangleConfiguration()
'VBA499
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.FlashBorderColor = True
End With
End Sub

686

Printout of the Online Help
Automated Configuring

11.05

5.7.6.9

ActualPointTopIndex

FlashFlashPicture Property

Description
TRUE if flashing of a Flash Picture is activated. BOOLEAN read-write access.

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example, flashing of the Flash Picture is activated:
Sub StatusDisplayConfiguration()
'VBA500
Dim objsDisplay As HMIStatusDisplay
Set objsDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objsDisplay
.FlashFlashPicture = True
End With
End Sub

Printout of the Online Help
Automated Configuring

687

ActualPointTopIndex

11.05

5.7.6.10 FlashForeColor Property

Description
TRUE if flashing of the text is activated. BOOLEAN read-write access.
Note:
A change to the attribute does not automatically deactivate the " Windows Style "
attribute.
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example, text flashing is activated:
Sub ButtonConfiguration()
'VBA501
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FlashForeColor = True
End With
End Sub

688

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.11 FlashPicReferenced Property

Description
TRUE if the Flash Picture assigned in the Status Display object is to be saved.
Otherwise only the associated object reference is saved. BOOLEAN read-write
access.

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example the picture assigned in the Status Display object is
to be saved.
Sub StatusDisplayConfiguration()
'VBA502
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objStatusDisplay
.FlashPicReferenced = True
End With
End Sub

Printout of the Online Help
Automated Configuring

689

ActualPointTopIndex

11.05

5.7.6.12 FlashPicTransColor Property

Description
Defines or returns the color which is going to be set to " Transparent " in the Bitmap
object (.bmp, .dib) assigned to the Flash Picture. LONG read-write access.
The color is only set to " Transparent " if the value of the " FlashPicUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example the color " Yellow " will be set to " Transparent " .
Sub StatusDisplayConfiguration()
'VBA503
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objStatusDisplay
.FlashPicTransColor = RGB(255, 255, 0)
.FlashPicUseTransColor = True
End With
End Sub

690

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.13 FlashPicture Property

Description
Defines or returns the Flash Picture for the Status Display object.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.
The " FlashPicReferenced " property defines in this case whether the flash picture
will be saved with the Status Display object or referenced.

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example the picture " Testpicture.BMP " will be used as the
flash picture:
Sub StatusDisplayConfiguration()
'VBA504
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objStatusDisplay
'
'To use this example copy a Bitmap-Graphic
'to the " GraCS " -Folder of the actual project.
'Replace the picturename " Testpicture.BMP " with the
name of
'the picture you copied
.FlashPicture = " Testpicture.BMP "
End With
End Sub

Printout of the Online Help
Automated Configuring

691

ActualPointTopIndex

11.05

5.7.6.14 FlashPicUseTransColor Property

Description
TRUE if the configured color ( " FlashPicTransColor " property) of the Bitmap object
assigned to the flash picture is going to be set to " Transparent " . BOOLEAN readwrite access.

Example
The " StatusDisplayConfiguration() " procedure accesses the properties of the
Status Display. In this example the color " Yellow " will be set to " Transparent " .
Sub StatusDisplayConfiguration()
'VBA505
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objStatusDisplay
.FlashPicTransColor = RGB(255, 255, 0)
.FlashPicUseTransColor = True
End With
End Sub

692

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.15 FlashRate Property

Description
Defines or returns the flash frequency of the GroupDisplay object. Value range
from 0 to 2.
Flash Frequency

Assigned Value

Slow (approx. 0.5 Hz)

0

Medium (approx. 2 Hz)

1

Fast (approx. 8 Hz)

2

Note:
Since the flashing is performed by means of software engineering, the precise
frequency is both system-dependent and hardware-bound (number of objects,
processor speed, RAM size, update cycle etc.).
Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the flash frequency will be set to " Medium " :
Sub GroupDisplayConfiguration()
'VBA506
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.FlashRate = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

693

ActualPointTopIndex

11.05

5.7.6.16 FlashRateBackColor Property

Description
Defines or returns the flash frequency for the object background. Value range from
0 to 2.
Flash Frequency

Assigned Value

Slow (approx. 0.5 Hz)

0

Medium (approx. 2 Hz)

1

Fast (approx. 8 Hz)

2

Note:
Since the flashing is performed by means of software engineering, the precise
frequency is both system-dependent and hardware-bound (number of objects,
processor speed, RAM size, update cycle etc.).
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the flash frequency for the background will be set to " Medium " :
Sub ButtonConfiguration()
'VBA507
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FlashRateBackColor = 1
End With
End Sub

694

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.17 FlashRateBorderColor Property

Description
Defines or returns the flash frequency for the border of the object. Value range
from 0 to 2.
Flash Frequency

Assigned Value

Slow (approx. 0.5 Hz)

0

Medium (approx. 2 Hz)

1

Fast (approx. 8 Hz)

2

Note:
Since the flashing is performed by means of software engineering, the precise
frequency is both system-dependent and hardware-bound (number of objects,
processor speed, RAM size, update cycle etc.).
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the flash frequency for the border will be set to " Medium " :
Sub ButtonConfiguration()
'VBA508
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FlashRateBorderColor = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

695

ActualPointTopIndex

11.05

5.7.6.18 FlashRateFlashPic Property

Description
Defines or returns the flash frequency for the status display. Value range from 0 to
2.
Flash Frequency

Assigned Value

Slow (approx. 0.5 Hz)

0

Medium (approx. 2 Hz)

1

Fast (approx. 8 Hz)

2

Note:
Since the flashing is performed by means of software engineering, the precise
frequency is both system-dependent and hardware-bound (number of objects,
processor speed, RAM size, update cycle etc.).
Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the status
display. In this example the flash frequency for the flash picture will be set to
" Medium " :
Sub StatusDisplayConfiguration()
'VBA509
Dim objStatusDisplay As HMIStatusDisplay
Set objStatusDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " StatusDisplay1 " ,
" HMIStatusDisplay " )
With objStatusDisplay
.FlashRateFlashPic = 1
End With
End Sub

696

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.19 FlashRateForeColor Property

Description
Defines or returns the flash frequency for the object label. Value range from 0 to 2.
Flash Frequency

Assigned Value

Slow (approx. 0.5 Hz)

0

Medium (approx. 2 Hz)

1

Fast (approx. 8 Hz)

2

Note:
Since the flashing is performed by means of software engineering, the precise
frequency is both system-dependent and hardware-bound (number of objects,
processor speed, RAM size, update cycle etc.).
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the flash frequency for the label will be set to " Medium " :
SSub ButtonConfiguration()
'VBA510
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FlashRateForeColor = 1
End With
End Sub

Printout of the Online Help
Automated Configuring

697

ActualPointTopIndex

11.05

5.7.6.20 Folder Property

Description
Returns a folder from the components library.

Example
The " ShowFolderItems() " procedure accesses the symbol libraries. In this example
all the folder names in the global symbol library and project symbol library will be
output:
Sub ShowFolderItems()
'VBA511
Dim colFolderItems As HMIFolderItems
Dim objFolderItem As HMIFolderItem
Dim iAnswer As Integer
Dim iMaxFolder As Integer
Dim iMaxSymbolLib As Integer
Dim iSymbolLibIndex As Integer
Dim iSubFolderIndex As Integer
Dim strSubFolderName As String
Dim strFolderItemName As String
'To determine the number of symbollibraries:
iMaxSymbolLib = Application.SymbolLibraries.Count
iSymbolLibIndex = 1
For iSymbolLibIndex = 1 To iMaxSymbolLib
With Application.SymbolLibraries(iSymbolLibIndex)
Set colFolderItems = .FolderItems
'
'To determine the number of folders in actual symbollibrary:
iMaxFolder = .FolderItems.Count
MsgBox " Number of FolderItems in " & .Name & " : " &
iMaxFolder
'
'Output of all subfoldernames from actual folder:
For Each objFolderItem In colFolderItems
iSubFolderIndex = 1
For iSubFolderIndex = 1 To iMaxFolder
strFolderItemName = objFolderItem.DisplayName
If 0 & lt; & gt; objFolderItem.Folder.Count Then

698

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

strSubFolderName =
objFolderItem.Folder(iSubFolderIndex).DisplayName
iAnswer = MsgBox( " SymbolLibrary: " & .Name & vbCrLf &
" act. Folder: " & strFolderItemName & vbCrLf & " act.
Subfolder: " & strSubFolderName, vbOKCancel)
'
'If " Cancel " is clicked, continued with next
FolderItem
If vbCancel = iAnswer Then
Exit For
End If
Else
MsgBox " There are no subfolders in " &
objFolderItem.DisplayName
Exit For
End If
Next iSubFolderIndex
Next objFolderItem
End With
Next iSymbolLibIndex
End Sub

Printout of the Online Help
Automated Configuring

699

ActualPointTopIndex

11.05

5.7.6.21 FolderItems Property

Description
Returns a listing containing all the folders in the symbol library.

Example
The " ShowFolderItems() " procedure accesses the symbol libraries. In this example
all the folder names in the global symbol library and project symbol library will be
output:
Sub ShowFolderItems()
'VBA512
Dim colFolderItems As HMIFolderItems
Dim objFolderItem As HMIFolderItem
Dim iAnswer As Integer
Dim iMaxFolder As Integer
Dim iMaxSymbolLib As Integer
Dim iSymbolLibIndex As Integer
Dim iSubFolderIndex As Integer
Dim strSubFolderName As String
Dim strFolderItemName As String
'To determine the number of symbollibraries:
iMaxSymbolLib = Application.SymbolLibraries.Count
iSymbolLibIndex = 1
For iSymbolLibIndex = 1 To iMaxSymbolLib
With Application.SymbolLibraries(iSymbolLibIndex)
Set colFolderItems = .FolderItems
'
'To determine the number of folders in actual symbollibrary:
iMaxFolder = .FolderItems.Count
MsgBox " Number of FolderItems in " & .Name & " : " &
iMaxFolder
'
'Output of all subfoldernames from actual folder:
For Each objFolderItem In colFolderItems
iSubFolderIndex = 1
For iSubFolderIndex = 1 To iMaxFolder
strFolderItemName = objFolderItem.DisplayName
If 0 & lt; & gt; objFolderItem.Folder.Count Then

700

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

strSubFolderName =
objFolderItem.Folder(iSubFolderIndex).DisplayName
iAnswer = MsgBox( " SymbolLibrary: " & .Name & vbCrLf &
" act. Folder: " & strFolderItemName & vbCrLf & " act.
Subfolder: " & strSubFolderName, vbOKCancel)
'
'If " Cancel " is clicked, continued with next
FolderItem
If vbCancel = iAnswer Then
Exit For
End If
Else
MsgBox " There are no subfolders in " &
objFolderItem.DisplayName
Exit For
End If
Next iSubFolderIndex
Next objFolderItem
End With
Next iSymbolLibIndex
End Sub

Printout of the Online Help
Automated Configuring

701

ActualPointTopIndex

11.05

5.7.6.22 FontBold Property

Description
TRUE if the text in the object has the " Bold " attribute. BOOLEAN read-write
access.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font attribute will be set to " Bold " :
Sub ButtonConfiguration()
'VBA513
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FontBold = True
End With
End Sub

702

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.23 FontItalic Property

Description
TRUE if the text in the object has the " Italic " attribute. BOOLEAN read-write
access.
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font attribute will be set to " Italic " :
Sub ButtonConfiguration()
'VBA514
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FontItalic = True
End With
End Sub

Printout of the Online Help
Automated Configuring

703

ActualPointTopIndex

11.05

5.7.6.24 FontName Property

Description
Defines or returns the font for the text in the object.
For this purpose you can make use of any of the fonts installed in Windows.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font is set to Arial:
Sub ButtonConfiguration()
'VBA515
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FontName = " Arial "
End With
End Sub

704

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.25 FontSize Property

Description
Defines or returns the font size in points for the text in the object.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font size will be set to 10 points:
Sub ButtonConfiguration()
'VBA516
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FONTSIZE = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

705

ActualPointTopIndex

11.05

5.7.6.26 FontUnderline Property

Description
TRUE if the text in the object has the " Underline " attribute. BOOLEAN read-write
access.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font attribute will be set to " Underline " :
Sub ButtonConfiguration()
'VBA517
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.FontUnderline = True
End With
End Sub

706

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.27 ForeColor Property

Description
Defines or returns the color of the text in the object. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font color will be set to " Red " :
Sub ButtonConfiguration()
'VBA518
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.ForeColor = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

707

ActualPointTopIndex

11.05

5.7.6.28 ForeFlashColorOff Property

Description
Defines or returns the color of the text when the flash status is " Off " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font color when the flash status is " Off " will be set to " Red " :
Sub ButtonConfiguration()
'VBA519
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.ForeFlashColorOff = RGB(255, 0, 0)
End With
End Sub

708

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.6.29 ForeFlashColorOn Property

Description
Defines or returns the color of the text when the flash status is " On " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the font color when the flash status is " On " will be set to " White " :
Sub ButtonConfiguration()
'VBA520
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.ForeFlashColorOn = RGB(255, 255, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

709

ActualPointTopIndex

5.7.7
5.7.7.1

11.05

VBA Properties: G-K
Grid Property

Description
TRUE if the grid is enabled for the active picture. BOOLEAN read-write access.
The grid is only visible during the configuration phase.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the grid for the active
picture will be enabled:
Sub ActiveDocumentConfiguration()
'VBA521
Application.ActiveDocument.Grid = True
End Sub

710

Printout of the Online Help
Automated Configuring

11.05

5.7.7.2

ActualPointTopIndex

GridColor Property

Description
Defines or returns the color of the grid during the configuration phase. The Grid
property must be set to TRUE for the grid to be displayed. LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the grid color for the
active picture will be set to " Blue " :
Sub ActiveDocumentConfiguration()
'VBA522
Application.ActiveDocument.Grid = True
Application.ActiveDocument.GridColor = RGB(0, 0, 255)
End Sub

Printout of the Online Help
Automated Configuring

711

ActualPointTopIndex

5.7.7.3

11.05

GridHeight Property

Description
Defines or returns the height (in pixels) of the grid in the current picture during the
configuration phase. The Grid property must be set to TRUE for the grid to be
displayed.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the grid height for the
active picture will be set to " 8 " :
Sub ActiveDocumentConfiguration()
'VBA523
Application.ActiveDocument.Grid = True
Application.ActiveDocument.GridHeight = 8
End Sub

712

Printout of the Online Help
Automated Configuring

11.05

5.7.7.4

ActualPointTopIndex

GridWidth Property

Description
Defines or returns the width (in pixels) of the grid in the current picture during the
configuration phase. The Grid property must be set to TRUE for the grid to be
displayed.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the grid width for the
active picture will be set to " 8 " :
Sub ActiveDocumentConfiguration()
'VBA524
Application.ActiveDocument.Grid = True
Application.ActiveDocument.GridWidth = 8
End Sub

Printout of the Online Help
Automated Configuring

713

ActualPointTopIndex

5.7.7.5

11.05

GroupParent Property

Description
Returns the higher-ranking object in the specified group object. Read-only access.

Example
--

714

Printout of the Online Help
Automated Configuring

11.05

5.7.7.6

ActualPointTopIndex

GroupedHMIObjects Property

Description
Returns a listing containing all the objects in the current group.
Example
In this example the group object " Group1 " is created from a number of objects. An
ellipse segment is then added to the group object:
Sub CreateGroup()
'VBA526
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipseSegment As HMIEllipseSegment
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
Set objGroup = ActiveDocument.Selection.CreateGroup
objGroup.ObjectName = " Group1 "
Set objEllipseSegment =
ActiveDocument.HMIObjects.AddHMIObject( " EllipseSegment " ,
" HMIEllipseSegment " )
'

'Add one object to the existing group
objGroup.GroupedHMIObjects.Add ( " EllipseSegment " )
End Sub

Printout of the Online Help
Automated Configuring

715

ActualPointTopIndex

5.7.7.7

11.05

Height Property

Description
Defines or returns the height of the object (Document, View, Object) in pixels.
Note concerning the Document and View objects:
The default value corresponds to the vertical screen resolution set by the operating
system. The specified value can be higher than the current screen resolution. The
picture can then be moved with the aid of scroll bars.
The maximum picture height that can be set is 10000 pixels.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the height of the current
picture will be set to " 1600 " :
Sub ActiveDocumentConfiguration()
'VBA527
Application.ActiveDocument.Height = 1600
End Sub

716

Printout of the Online Help
Automated Configuring

11.05

5.7.7.8

ActualPointTopIndex

Hide Property

Description
TRUE if the specified picture is opened as " Visible " . BOOLEAN read-write access.
Use the Hide property in order to test, for example, whether a picture is to be
visible or invisible when opened. Other WinCC editors (such as CrossReference)
open pictures so that they are invisible, i.e. they are not displayed in the Graphics
Designer. If you use the DocumentOpened event, for example, you can use the
Hide property to prevent the code in the event from being executed by testing that
the Hide property is FALSE.
Use the Add and Open methods to define whether a picture is to be visible or
invisible when opened.
Note:
If you set a picture to " Invisible " (Hide = FALSE), you can then only address it via
the Documents listing. The picture is no longer available in the Graphics Designer.
Example
In the following example, when a picture opens an output indicates whether the
picture was opened as visible or invisible:
Private Sub Document_Opened(CancelForwarding As Boolean)
'VBA802
MsgBox ActiveDocument.Hide
End Sub

Printout of the Online Help
Automated Configuring

717

ActualPointTopIndex

5.7.7.9

11.05

HiddenInput Property

Description
TRUE if the input value is not displayed during input. An asterisk ( * ) is displayed
for each character. BOOLEAN read-write access.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the input will be hidden:
Sub IOFieldConfiguration()
'VBA528
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.HiddenInput = True
End With
End Sub

718

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.10 HMIObjects Property

Description
Returns a listing containing all the objects in the specified picture.
To return an element from the HMIObjects listing you can use either the index
number or the object name.

Example
Use the " AddHMIObject(ObjectName, ProgID) " method to insert a new object in a
picture: :
Sub AddCircle()
'VBA529
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " my Circle " ,
" HMICircle " )
End Sub

Printout of the Online Help
Automated Configuring

719

ActualPointTopIndex

11.05

5.7.7.11 Hotkey Property

Description
Defines or returns the function key for a mouse action in the case of the Button
object.
Function Key

Assigned Value

F1

112

F2

113

F3

114

F4

115

F5

116

F6

117

F7

118

F8

119

F9

120

F10

121

F11

122

F12

123

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example it is intended that the button can also be launched with function key
" F5 " :
Sub ButtonConfiguration()
'VBA530
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.Hotkey = 116
End With
End Sub

720

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.12 Hysteresis Property

Description
TRUE if the display must include hysteresis (deadband) in the case of the
BarGraph object. BOOLEAN read-write access.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the display shall include hysteresis:
Sub BarGraphConfiguration()
'VBA531
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Hysteresis = True
End With
End Sub

Printout of the Online Help
Automated Configuring

721

ActualPointTopIndex

11.05

5.7.7.13 HysteresisRange Property

Description
Defines or returns the hysteresis (deadband) as a percentage of the display value.
The value of the Hysteresis property must be TRUE in order for the hysteresis to
be calculated.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the hysteresis will be set to " 4% " :
Sub BarGraphConfiguration()
'VBA532
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Hysteresis = True
.HysteresisRange = 4
End With
End Sub

722

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.14 Icon Property

Description
Defines the icon (*.ICO, full path and file name) or returns the path and file name
for a button on a user-defined toolbar.
Path specifications
The following path specification formats are possible:


Absolute: For example " C:\Siemens\WinCC\Icons\myIcon.ICO.



Relative: The starting folder for relative path specification is the " GraCS " folder
of the current project.



& lt; & gt; Global: Refers to the installation path for WinCC. The path specification
" & lt; global & gt; \Icons\myIcon " is the same as the path specification under
" Absolute " .



& lt; & gt; Project: Refers to the current project directory (see example).

Example
The " CreateToolbar() " procedure creates a user-defined toolbar with two icons.
Sub CreateToolbar()
'VBA533
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Dim strFileWithPath
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " Tool1_1 " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " ti1_1 " ,
" myFirstToolbaritem " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(2, " ti1_2 " ,
" mySecondToolbaritem " )
'
'To use this example copy a *.ICO-Graphic
'to the " GraCS " -Folder of the actual project.
'Replace the filename " EZSTART.ICO " in the next commandline
'with the name of the ICO-Graphic you copied
strFileWithPath = Application.ApplicationDataPath &
" EZSTART.ICO "
'
'To assign the symbol-icon to the first toolbaritem
objToolbar.ToolbarItems(1).Icon = strFileWithPath
End Sub

Printout of the Online Help
Automated Configuring

723

ActualPointTopIndex

11.05

5.7.7.15 Index Property

Description
Status Display
Defines or returns the status (0 to 255). You can specify a basic picture and a flash
picture for each status value.
Line Object
Defines the starting and finishing point for a line, which also defines the direction.
Use the ActualPointLeft and ActualPointTop properties to define the coordinates
for each starting and finishing point.
Polygon and Polyline objects
Defines or returns the number of the finishing point whose position you wish to
change or display.
CheckBox and OptionGroup objects
Defines or returns the number (1 to 32) of the field whose text you wish to define.

Example 1: Line
In the following example a line will be inserted into the active picture and the
starting and finishing points will be defined:
Sub LineAdd()
'VBA682
Dim objLine As HMILine
Dim objEvent As HMIEvent
Set objLine =
ActiveDocument.HMIObjects.AddHMIObject( " myLine " ,
" HMILine " )
With objLine
.BorderColor = RGB(255, 0, 0)
.index = hmiLineIndexTypeStartPoint
.ActualPointLeft = 12
.ActualPointTop = 34
.index = hmiLineIndexTypeEndPoint
.ActualPointLeft = 74
.ActualPointTop = 64
End With
End Sub

724

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example 2: Polyline
For this example to work, insert a polyline called " Polyline1 " into the active picture:
The " PolyLineCoordsOutput " procedure then outputs the coordinates of all the
corner points in the polyline:
Sub PolyLineCoordsOutput()
'VBA534
Dim iPcIndex As Integer
Dim iPosX As Integer
Dim iPosY As Integer
Dim iIndex As Integer
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
Application.ActiveDocument.HMIObjects.AddHMIObject( " Poly
Line1 " , " HMIPolyLine " )
'
'Determine number of corners from " PolyLine1 " :
iPcIndex = objPolyLine.PointCount
'
'Output of x/y-coordinates from every corner:
For iIndex = 1 To iPcIndex
With objPolyLine
.index = iIndex
iPosX = .ActualPointLeft
iPosY = .ActualPointTop
MsgBox iIndex & " . corner: " & vbCrLf & " x-coordinate: " &
iPosX & vbCrLf & " y-coordinate: " & iPosY
End With
Next iIndex
End Sub

Printout of the Online Help
Automated Configuring

725

ActualPointTopIndex

11.05

Example 3: Check Box
The " CreateOptionGroup() " procedure creates the OptionGroup object with four
option buttons. Each option button is assigned the default name
" myCustomText & lt; Number & gt; " :
Sub CreateOptionGroup()
'VBA535
Dim objRadioBox As HMIOptionGroup
Dim iIndex As Integer
Set objRadioBox =
ActiveDocument.HMIObjects.AddHMIObject( " RadioBox_1 " ,
" HMIOptionGroup " )
With objRadioBox
.Height = 100
.Width = 180
.BoxCount = 4
For iIndex = 1 To .BoxCount
.index = iIndex
.Text = " myCustomText " & .index
Next iIndex
End With
End Sub

726

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.16 InternalName Property

Description
Returns the internal name of the specified object of the " FolderItem " type. Read
access.

Example
In this example the internal name is output for the " PC " object contained in the
Global Components Library:
Sub ShowInternalNameOfFolderItem()
'VBA536
Dim objGlobalLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
MsgBox
objGlobalLib.FolderItems(2).Folder(2).Folder.Item(1).Nam
e
End Sub

Printout of the Online Help
Automated Configuring

727

ActualPointTopIndex

11.05

5.7.7.17 IsActive Property

Description
Returns TRUE if a copy of the current picture is active. BOOLEAN read access.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example a copy of the current
picture will be created and an output will indicate whether the copy is active.
Sub ActiveDocumentConfiguration()
'VBA537
Application.ActiveDocument.Views.Add
'If you comment out the following line
'and recall the procedure, the output of
'the messagebox is different
Application.ActiveDocument.Views(1).Activate
'
'Output state of copy:
MsgBox Application.ActiveDocument.Views(1).IsActive
End Sub

728

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.18 IsConnectedToProject Property

Description
Returns TRUE if the project connection is available. BOOLEAN read access.

Example
The " ConnectCheck() " procedure checks whether a project connection exists and
outputs the result:
Sub ConnectCheck()
'VBA538
Dim bCheck As Boolean
Dim strStatus As String
bCheck = Application.IsConnectedToProject
If bCheck = True Then
strStatus = " yes "
Else
strStatus = " no "
End If
MsgBox " Connection to project available: " & strStatus
End Sub

Printout of the Online Help
Automated Configuring

729

ActualPointTopIndex

11.05

5.7.7.19 IsDynamicable Property

Description
TRUE if a property can be made dynamic. BOOLEAN read access.

Example
The HMIObjectPropertyChanged event always occurs when you change an object
property in the Graphics Designer. In this example the property name and value
will be output. A check will also be made on whether the property can be made
dynamic:
Sub Document_HMIObjectPropertyChanged(ByVal Property As
IHMIProperty, CancelForwarding As Boolean)
'VBA539
Dim objProp As HMIProperty
Dim strStatus As String
Set objProp = Property
'
'Checks whether property is dynamicable
If objProp.IsDynamicable = True Then
strStatus = " yes "
Else
strStatus = " no "
End If
MsgBox " Property: " & objProp.Name & vbCrLf & " Value: "
& objProp.value & vbCrLf & " Dynamicable: " & strStatus
End Sub

730

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.20 Italic Property

Description
TRUE if the font attribute " Italic " is set for the language-dependent text in the
object. BOOLEAN read-write access.

Example
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA540
Dim objLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " Hello "
Set objLangFonts = objButton.LDFonts
'
'To make fontsettings for french:
With objLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'
'To make fontsettings for english:
With objLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

Printout of the Online Help
Automated Configuring

731

ActualPointTopIndex

11.05

5.7.7.21 Item Property

Description
Returns an element from a listing. Depending on the specified object, you can use
either the index number or the name to return a particular element.

Example
This example shows both kinds of indexing. In order for the example to work,
create a group object ( " Group1 " ) with two objects. The example outputs the height
of the second object in a group:
Sub GetHeight()
'VBA541
Dim objGroup As HMIGroup
'Next line uses the property " Item " to get a group by
name
Set objGroup = ActiveDocument.HMIObjects.Item( " Group1 " )
'Otherwise next line uses index to identify a
groupobject
MsgBox " The height of object 2 is: " &
objGroup.GroupedHMIObjects.Item(2).Height
End Sub

732

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.22 ItemBorderBackColor Property

Description
Defines or returns the background color of the separation lines in the selection list
for the TextList object. LONG read-write access.
The background color is only visible if the ItemBorderStyle property is set & gt; 0.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the background color for the separation lines will be set to
" Red " :
Sub TextListConfiguration()
'VBA542
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.ItemBorderStyle = 1
.ItemBorderBackColor = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

733

ActualPointTopIndex

11.05

5.7.7.23 ItemBorderColor Property

Description
Defines or returns the color of the separation lines in the selection list for the
TextList object. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the color for the separation lines will be set to " White " :
Sub TextListConfiguration()
'VBA543
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.ItemBorderStyle = 1
.ItemBorderColor = RGB(255, 255, 255)
End With
End Sub

734

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.24 ItemBorderStyle Property

Description
Defines or returns the dividing line style in the selection list for the TextList object.
Value range 0 to 4.
Line Style

Assigned Value
0
1
2
3
4

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the dividing line style will be set to " 1 " :
Sub TextListConfiguration()
'VBA544
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.ItemBorderStyle = 1
.ItemBorderBackColor = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

735

ActualPointTopIndex

11.05

5.7.7.25 ItemBorderWidth Property

Description
Defines or returns the weight in pixels of the dividing lines in the selection list for
the TextList object.

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the dividing line width will be set to " 4 " :
Sub TextListConfiguration()
Sub TextListConfiguration()
'VBA545
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.ItemBorderWidth = 4
End With
End Sub

736

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.7.26 Key Property

Description
Returns the name that identifies the entry (menu point or icon) in the user-defined
menu or user-defined toolbar. Read access.
Use the Key property to determine which entry was clicked. For this purpose you
can use, say, the events " MenuItemClicked " and " ToolBarItemClicked " .

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ):
Sub CreateMenuItem()
'VBA546
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
'
'Add new menu " Delete objects " to menubar:
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Adds two menuitems to menu " Delete objects "
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete Rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete Circles " )
End Sub
In connection with the " MenuItemClicked " event, you can connect the menu entries
with procedure calls, for instance. In this example the names of the menu entries
will be output:
Sub Document_MenuItemClicked(ByVal MenuItem As IHMIMenuItem)
'VBA547
Dim strClicked As String
Dim objMenuItem As HMIMenuItem
Set objMenuItem = MenuItem
'
' " strClicked can get two values:
'(1) " DeleteAllRectangles " and
'(2) " DeleteAllCircles "
strClicked = objMenuItem.Key
'

Printout of the Online Help
Automated Configuring

737

ActualPointTopIndex

11.05

'To analyse " strClicked " with " Select Case "
Select Case strClicked
Case " DeleteAllRectangles "
'
'Instead of " MsgBox " a procedurecall (e.g. " Call
& lt; Prozedurname & gt; " ) can stay here
MsgBox " 'Delete rectangle' was clicked "
Case " DeleteAllCircles "
MsgBox " 'Delete Circles' was clicked "
End Select
End Sub

738

Printout of the Online Help
Automated Configuring

11.05

5.7.8
5.7.8.1

ActualPointTopIndex

VBA Properties: L
Label Property

Description
Returns the label of the user-defined menu or menu entry in the currently set
language. Read access.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ): In this example the
labels will then be output:
Sub CreateMenuItem()
'VBA548
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim iIndex As Integer
iIndex = 1
'
'Add new menu " Delete objects " to menubar
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Adds two menuitems to menu " Delete objects "
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete circles " )
MsgBox ActiveDocument.CustomMenus(1).Label
For iIndex = 1 To objMenu.MenuItems.Count
MsgBox objMenu.MenuItems(iIndex).Label
Next iIndex
End Sub

Printout of the Online Help
Automated Configuring

739

ActualPointTopIndex

5.7.8.2

11.05

LanguageID Property

Description
Returns the language identifier of the project language as a decimal value. LONG
read access

Example
The " DataLanguages() " procedure outputs the project languages together with their
language identifiers:
Sub DataLanguages()
'VBA549
Dim colDataLang As HMIDataLanguages
Dim objDataLang As HMIDataLanguage
Dim nLangID As Long
Dim strLangName As String
Dim iAnswer As Integer
Set colDataLang = Application.AvailableDataLanguages
For Each objDataLang In colDataLang
nLangID = objDataLang.LanguageID
strLangName = objDataLang.LanguageName
iAnswer = MsgBox(nLangID & " " & strLangName,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objDataLang
End Sub

740

Printout of the Online Help
Automated Configuring

11.05

5.7.8.3

ActualPointTopIndex

LanguageName Property

Description
Returns the project language. STRING read access.

Example
The " DataLanguages() " procedure outputs the project languages together with their
language identifiers:
Sub DataLanguages()
'VBA550
Dim colDataLang As HMIDataLanguages
Dim objDataLang As HMIDataLanguage
Dim nLangID As Long
Dim strLangName As String
Dim iAnswer As Integer
Set colDataLang = Application.AvailableDataLanguages
For Each objDataLang In colDataLang
nLangID = objDataLang.LanguageID
strLangName = objDataLang.LanguageName
iAnswer = MsgBox(nLangID & " " & strLangName,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objDataLang
End Sub

Printout of the Online Help
Automated Configuring

741

ActualPointTopIndex

5.7.8.4

11.05

LanguageSwitch Property

Description
Defines where the language-dependent assignment texts are stored or returns the
value. BOOLEAN read-write access.
TRUE if the texts are managed in the Text Library. Translations into other
languages are then carried out in the Text Library.
FALSE if the texts are managed in the object itself. Translations into other
languages can then be carried out with the aid of EasyLanguage.

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the texts will be managed in the Text Library:
Sub TextListConfiguration()
'VBA551
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.LanguageSwitch = True
End With
End Sub

742

Printout of the Online Help
Automated Configuring

11.05

5.7.8.5

ActualPointTopIndex

LastChange Property

Description
Returns the date on which the current picture was last changed. Read access.

Example
The " ActiveDocumentConfiguration() " procedure accesses the properties of the
current picture in the Graphics Designer. In this example the date of the last
change to the current picture will be output:
Sub ActiveDocumentConfiguration()
'VBA552
Dim varLastDocChange As Variant
varLastDocChange = Application.ActiveDocument.LastChange
MsgBox " Last changing: " & varLastDocChange
End Sub

Printout of the Online Help
Automated Configuring

743

ActualPointTopIndex

5.7.8.6

11.05

Layer Property

Description
Defines which layer of the picture an object is located in, or returns that
information. There are 32 layers available in total, where " 0 " is the lowest layer and
" 31 " is the uppermost layer.
In any given layer the objects configured first are in the background.
Note:
In VBA the numbering starts at " 1 " . An entry of " objRectangle.Layer = 1 " is
therefore located in the lowest layer.
Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example the Rectangle object will be inserted in layer " 4 " :
Sub RectangleConfiguration()
'VBA553
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.Layer = 4
End With
End Sub

744

Printout of the Online Help
Automated Configuring

11.05

5.7.8.7

ActualPointTopIndex

Layer00Checked Property

Description
TRUE if limit 0 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer00Value and
Layer00Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 0 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA554
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer00Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

745

ActualPointTopIndex

5.7.8.8

11.05

Layer00Color Property

Description
Defines or returns the color for limit 0 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer00Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 0 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA555
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer00Checked = True
.Layer00Color = RGB(255, 0, 255)
End With
End Sub

746

Printout of the Online Help
Automated Configuring

11.05

5.7.8.9

ActualPointTopIndex

Layer00Value Property

Description
Defines or returns the value for " limit 0 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer00Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 0 will be defined as " 0 " :
Sub HMI3DBarGraphConfiguration()
'VBA556
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer00Checked = True
.Layer00Value = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

747

ActualPointTopIndex

11.05

5.7.8.10 Layer01Checked Property

Description
TRUE if limit 1 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer01Value and
Layer01Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 1 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA557
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer01Checked = True
End With
End Sub

748

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.11 Layer01Color Property

Description
Defines or returns the color for limit 1 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer01Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 1 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA558
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer01Checked = True
.Layer01Color = RGB(255, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

749

ActualPointTopIndex

11.05

5.7.8.12 Layer01Value Property

Description
Defines or returns the value for " limit 1 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer01Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 1 will be defined as " 10 " :
Sub HMI3DBarGraphConfiguration()
'VBA559
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer01Checked = True
.Layer01Value = 10
End With
End Sub

750

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.13 Layer02Checked Property

Description
TRUE if limit 2 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer02Value and
Layer02Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 2 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA560
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer02Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

751

ActualPointTopIndex

11.05

5.7.8.14 Layer02Color Property

Description
Defines or returns the color for limit 2 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer02Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 2 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA561
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer02Checked = True
.Layer02Color = RGB(255, 0, 255)
End With
End Sub

752

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.15 Layer02Value Property

Description
Defines or returns the value for " limit 2 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer02Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 2 will be defined as " 20 " :
Sub HMI3DBarGraphConfiguration()
'VBA562
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer02Checked = True
.Layer02Value = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

753

ActualPointTopIndex

11.05

5.7.8.16 Layer03Checked Property

Description
TRUE if limit 3 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer03Value and
Layer03Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 3 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA563
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer03Checked = True
End With
End Sub

754

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.17 Layer03Color Property

Description
Defines or returns the color for limit 3 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer03Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 3 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA564
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer03Checked = True
.Layer03Color = RGB(255, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

755

ActualPointTopIndex

11.05

5.7.8.18 Layer03Value Property

Description
Defines or returns the value for " limit 3 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer03Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 3 will be defined as " 30 " :
Sub HMI3DBarGraphConfiguration()
'VBA565
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer03Checked = True
.Layer03Value = 30
End With
End Sub

756

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.19 Layer04Checked Property

Description
TRUE if limit 4 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer04Value and
Layer04Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 4 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA566
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer04Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

757

ActualPointTopIndex

11.05

5.7.8.20 Layer04Color Property

Description
Defines or returns the color for limit 4 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer04Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 4 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA567
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer04Checked = True
.Layer04Color = RGB(255, 0, 255)
End With
End Sub

758

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.21 Layer04Value Property

Description
Defines or returns the value for " limit 4 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer04Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 4 will be defined as " 40 " :
Sub HMI3DBarGraphConfiguration()
'VBA568
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer04Checked = True
.Layer04Value = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

759

ActualPointTopIndex

11.05

5.7.8.22 Layer05Checked Property

Description
TRUE if limit 5 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer05Value and
Layer05Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 5 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA569
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer05Checked = True
End With
End Sub

760

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.23 Layer05Color Property

Description
Defines or returns the color for limit 5 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer05Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 5 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA570
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer05Checked = True
.Layer05Color = RGB(255, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

761

ActualPointTopIndex

11.05

5.7.8.24 Layer05Value Property

Description
Defines or returns the value for " limit 5 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer05Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 5 will be defined as " 50 " :
Sub HMI3DBarGraphConfiguration()
'VBA571
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer05Checked = True
.Layer05Value = 50
End With
End Sub

762

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.25 Layer06Checked Property

Description
TRUE if limit 6 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer06Value and
Layer06Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 6 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA572
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer06Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

763

ActualPointTopIndex

11.05

5.7.8.26 Layer06Color Property

Description
Defines or returns the color for limit 6 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer06Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 6 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA573
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer06Checked = True
.Layer06Color = RGB(255, 0, 255)
End With
End Sub

764

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.27 Layer06Value Property

Description
Defines or returns the value for " limit 6 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer06Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 6 will be defined as " 60 " :
Sub HMI3DBarGraphConfiguration()
'VBA574
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer06Checked = True
.Layer06Value = 60
End With
End Sub

Printout of the Online Help
Automated Configuring

765

ActualPointTopIndex

11.05

5.7.8.28 Layer07Checked Property

Description
TRUE if limit 7 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer07Value and
Layer07Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 7 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA575
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer07Checked = True
End With
End Sub

766

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.29 Layer07Color Property

Description
Defines or returns the color for limit 7 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer07Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 7 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA576
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer07Checked = True
.Layer07Color = RGB(255, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

767

ActualPointTopIndex

11.05

5.7.8.30 Layer07Value Property

Description
Defines or returns the value for " limit 7 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer07Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 7 will be defined as " 70 " :
Sub HMI3DBarGraphConfiguration()
'VBA577
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer07Checked = True
.Layer07Value = 70
End With
End Sub

768

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.31 Layer08Checked Property

Description
TRUE if limit 8 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer08Value and
Layer08Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 8 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA578
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer08Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

769

ActualPointTopIndex

11.05

5.7.8.32 Layer08Color Property

Description
Defines or returns the color for limit 8 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer08Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 8 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA579
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer08Checked = True
.Layer08Color = RGB(255, 0, 255)
End With
End Sub

770

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.33 Layer08Value Property

Description
Defines or returns the value for " limit 8 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer08Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 8 will be defined as " 80 " :
Sub HMI3DBarGraphConfiguration()
'VBA580
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer08Checked = True
.Layer08Value = 80
End With
End Sub

Printout of the Online Help
Automated Configuring

771

ActualPointTopIndex

11.05

5.7.8.34 Layer09Checked Property

Description
TRUE if limit 9 is to be monitored in the case of the 3DBarGraph object. BOOLEAN
read-write access.
The limit value and display are defined with the aid of the Layer09Value and
Layer09Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 9 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA581
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer09Checked = True
End With
End Sub

772

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.35 Layer09Color Property

Description
Defines or returns the color for limit 9 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer09Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 9 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA582
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer09Checked = True
.Layer09Color = RGB(255, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

773

ActualPointTopIndex

11.05

5.7.8.36 Layer09Value Property

Description
Defines or returns the value for " limit 9 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer09Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 9 will be defined as " 90 " :
Sub HMI3DBarGraphConfiguration()
'VBA583
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer09Checked = True
.Layer09Value = 90
End With
End Sub

774

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.37 Layer10Checked Property

Description
TRUE if limit 10 is to be monitored in the case of the 3DBarGraph object.
BOOLEAN read-write access.
The limit value and display are defined with the aid of the Layer10Value and
Layer10Color properties.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example, limit value 10 will be monitored:
Sub HMI3DBarGraphConfiguration()
'VBA584
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer10Checked = True
End With
End Sub

Printout of the Online Help
Automated Configuring

775

ActualPointTopIndex

11.05

5.7.8.38 Layer10Color Property

Description
Defines or returns the color for limit 10 of the 3DBarGraph object. LONG read-write
access.
If limit value monitoring is active (Layer10Checked property), the bar takes on the
color of this attribute when the limit value is reached.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the color for limit 10 will be defined as
" Magenta " :
Sub HMI3DBarGraphConfiguration()
'VBA585
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer10Checked = True
.Layer10Color = RGB(255, 0, 255)
End With
End Sub

776

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.39 Layer10Value Property

Description
Defines or returns the value for " limit 10 " in the case of the 3DBarGraph object.
Monitoring only takes effect if the value of the Layer10Checked property is TRUE.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the value for limit 10 will be defined as " 100 " :
Sub HMI3DBarGraphConfiguration()
'VBA586
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.Layer10Checked = True
.Layer10Value = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

777

ActualPointTopIndex

11.05

5.7.8.40 LayerDecluttering Property

Description
TRUE if showing and hiding objects dependent upon the minimum and maximum
zoom set for a layer has been enabled. BOOLEAN read-write access.

Example
In the following example the settings for the lowest layer are configured in the
active picture:
Sub ConfigureSettingsOfLayer()
'VBA587
Dim objLayer As HMILayer
Set objLayer = ActiveDocument.Layers(1)
With objLayer
'configure " Layer 0 "
.MinZoom = 10
.MaxZoom = 100
.Name = " Configured with VBA "
End With
'define fade-in and fade-out of objects:
With ActiveDocument
.LayerDecluttering = True
.ObjectSizeDecluttering = True
.SetDeclutterObjectSize 50, 100
End With
End Sub

778

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.41 Layers Property

Description
Returns a listing containing the properties of the layers in the current picture.

Example
The " LayerInfo() " procedure outputs the name and zoom configuration for each
layer of the current picture:
Sub LayerInfo()
'VBA588
Dim colLayers As HMILayers
Dim objLayer As HMILayer
Dim iAnswer As Integer
Set colLayers = ActiveDocument.Layers
For Each objLayer In colLayers
With objLayer
iAnswer = MsgBox( " Layername: " & .Name & vbCrLf & " max.
zoom: " & .MaxZoom & vbCrLf & " min. zoom: " & .MinZoom,
vbOKCancel)
End With
If vbCancel = iAnswer Then Exit For
Next objLayer
End Sub

Printout of the Online Help
Automated Configuring

779

ActualPointTopIndex

11.05

5.7.8.42 LDFonts Property

Description
Returns a listing containing the language identifiers for the configured fonts.

Example
Use the LDFonts property to return the LanguageFonts listing. In the following
example the language identifiers of the configured fonts will be output:
Sub ShowLanguageFont()
'VBA589
Dim colLanguageFonts As HMILanguageFonts
Dim objLanguageFont As HMILanguageFont
Dim objButton As HMIButton
Dim iMax As Integer
Dim iAnswer As Integer
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
Set colLanguageFonts = objButton.LDFonts
iMax = colLanguageFonts.Count
For Each objLanguageFont In colLanguageFonts
iAnswer = MsgBox( " Projected fonts: " & iMax &
vbCrLf & " Language-ID: " &
objLanguageFont.LanguageID, vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objLanguageFont
End Sub

780

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.43 LDLabelTexts Property

Description
Returns a listing containing the multilingual labels of the user-defined menu or
menu entry.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ): In this example,
multilingual menu labels will be created:
Sub CreateMenuItem()
'VBA590
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objLangText As HMILanguageText
'
'Add new menu " Delete objects " to menubar:
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Add two menuitems to the new menu
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete circles " )
'
'Define foreign-language labels for menu " Delete
objects " :
Set objLangText = objMenu.LDLabelTexts.Add(1033,
" English_Delete objects " )
Set objLangText = objMenu.LDLabelTexts.Add(1032,
" Greek_Delete objects " )
Set objLangText = objMenu.LDLabelTexts.Add(1034,
" Spanish_Delete objects " )
Set objLangText = objMenu.LDLabelTexts.Add(1036,
" French_Delete objects " )
End Sub

Printout of the Online Help
Automated Configuring

781

ActualPointTopIndex

11.05

The " LDLabelInfo() " procedure outputs the labels configured for the " Delete
Objects " menu:
Sub LDLabelInfo()
'VBA591
Dim colLangTexts As HMILanguageTexts
Dim objLangText As HMILanguageText
Dim iAnswer As Integer
'
'Save all labels of menu into collection " colLangTexts " :
Set colLangTexts =
ActiveDocument.CustomMenus( " DeleteObjects " ).LDLabelTexts
For Each objLangText In colLangTexts
iAnswer = MsgBox(objLangText.DisplayName,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objLangText
End Sub

782

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.44 LDNames Property

Description
Returns a listing containing the multilingual names of a folder in the Components
Library or of a layer.

Example
Use the LDNames property to return the LanguageTexts listing. In the following
example all multilingual layer names will be output:
Explanation: What the example shows
Sub LDLabelInfo()
'VBA592
Dim colLayerLngTexts As HMILanguageTexts
Dim objLayerLngText As HMILanguageText
Dim iIndex As Integer
Dim iAnswer As Integer
Dim strResult As String
iIndex = 1
For iIndex = 1 To ActiveDocument.Layers.Count
'
'Save all labels of layers into collection of
" colLayerLngTexts " :
Set colLayerLngTexts =
ActiveDocument.Layers(iIndex).LDNames
For Each objLayerLngText In colLayerLngTexts
strResult = strResult & vbCrLf & objLayerLngText.LanguageID
& " - " & objLayerLngText.DisplayName
Next objLayerLngText
iAnswer = MsgBox(strResult, vbOKCancel)
strResult = " "
If vbCancel = iAnswer Then Exit For
Next iIndex
End Sub

Printout of the Online Help
Automated Configuring

783

ActualPointTopIndex

11.05

5.7.8.45 LDStatusTexts Property

Description
Returns a listing containing the multilingual status line texts of a user-defined icon
or menu entry.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ). In this example,
multilingual status line texts will be created:
Sub CreateMenuItem()
'VBA593
Dim objMenu As HMIMenu
Dim objMenuItem1 As HMIMenuItem
Dim objMenuItem2 As HMIMenuItem
Dim objLangStateText As HMILanguageText
'
'Add new menu " Delete objects " to menubar:
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Add two menuitems to the new menu
Set objMenuItem1 = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete rectangles " )
Set objMenuItem2 = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete circles " )
'
'Define foreign-language labels for menuitem " Delete
rectangles " :
Set objLangStateText =
objMenuItem1.LDStatusTexts.Add(1033, " English_Delete
rectangles " )
Set objLangStateText =
objMenuItem1.LDStatusTexts.Add(1032, " Greek_Delete
rectangles " )
Set objLangStateText =
objMenuItem1.LDStatusTexts.Add(1034, " Spanish_Delete
rectangles " )
Set objLangStateText =
objMenuItem1.LDStatusTexts.Add(1036, " French_Delete
rectangles " )
End Sub

784

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

The " LDStatusTextInfo() " procedure outputs the status line texts configured for the
" Delete Objects " menu:
Sub LDStatusTextInfo()
'VBA594
Dim colMenuItems As HMIMenuItems
Dim objMenuItem As HMIMenuItem
Dim colStatusLngTexts As HMILanguageTexts
Dim objStatusLngText As HMILanguageText
Dim strResult As String
Dim iAnswer As Integer
Set colMenuItems =
ActiveDocument.CustomMenus( " DeleteObjects " ).MenuItems
For Each objMenuItem In colMenuItems
strResult = " Statustexts of menuitem " " " &
objMenuItem.Label & " " " "
Set colStatusLngTexts = objMenuItem.LDStatusTexts
For Each objStatusLngText In colStatusLngTexts
strResult = strResult & vbCrLf &
objStatusLngText.DisplayName
Next objStatusLngText
iAnswer = MsgBox(strResult, vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objMenuItem
End Sub

Printout of the Online Help
Automated Configuring

785

ActualPointTopIndex

11.05

5.7.8.46 LDTexts Property

Description
Returns a listing containing the multilingual labels of an object.

Example
The " LDTextInfo() " procedure outputs the labels configured for the Button object.
For this example to work, create the object " myButton " in the Graphics Designer
and configure a number of multilingual labels:
Sub LDTextInfo()
'VBA595
Dim colLDLngTexts As HMILanguageTexts
Dim objLDLngText As HMILanguageText
Dim objButton As HMIButton
Dim iAnswer As Integer
Set objButton = ActiveDocument.HMIObjects( " myButton " )
Set colLDLngTexts = objButton.LDTexts
For Each objLDLngText In colLDLngTexts
iAnswer = MsgBox(objLDLngText.DisplayName,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objLDLngText
End Sub

786

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.47 LDTooltipTexts Property

Description
Returns a listing containing the multilingual Tooltip texts for a user-defined icon or
for an object.

Example
The " CreateToolbar() " procedure creates a user-defined toolbar with two icons.
Two multilingual Tooltip texts are assigned to the first icon:
Sub CreateToolbar()
'VBA596
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Dim objLangText As HMILanguageText
Dim strFileWithPath
'
'Create toolbar with two toolbar-items:
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " Tool1_1 " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " ti1_1 " ,
" myFirstToolbaritem " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(2, " ti1_2 " ,
" mySecondToolbaritem " )
'
'In order that the example runs correct copy a *.ICOGraphic
'into the " GraCS " -Folder of the actual project.
'Replace the filename " EZSTART.ICO " in the next
commandline
'with the name of the ICO-Graphic you copied
strFileWithPath = Application.ApplicationDataPath &
" EZSTART.ICO "
'
'
'To assign the symbol-icon to the first toolbaritem
objToolbar.ToolbarItems(1).Icon = strFileWithPath
'
'Define foreign-language tooltiptexts

Printout of the Online Help
Automated Configuring

787

ActualPointTopIndex

11.05

Set objLangText =
objToolbar.ToolbarItems(1).LDTooltipTexts.Add(1036,
" French_Tooltiptext " )
Set objLangText =
objToolbar.ToolbarItems(1).LDTooltipTexts.Add(1034,
" Spanish_Tooltiptext " )
End Sub
The " LDTooltipInfo() " procedure outputs all the Tooltip texts configured for the first
icon in the first user-defined toolbar:
Sub LDTooltipInfo()
'VBA597
Dim colLangTexts As HMILanguageTexts
Dim objLangText As HMILanguageText
Dim iAnswer As Integer
Set colLangTexts =
ActiveDocument.CustomToolbars(1).ToolbarItems(1).LDToolt
ipTexts
For Each objLangText In colLangTexts
iAnswer = MsgBox(objLangText.DisplayName,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next objLangText
End Sub

788

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.48 Left Property

Description
Defines or returns the X coordinate of the object (measured from the top left-hand
edge of the picture) in pixels. The X coordinate refers to the top left corner of the
rectangle surrounding the object.
View Object
Defines or returns the X coordinate of the window (measured from the top left-hand
edge of the Graphics Designer working area) in pixels.

Example
The " RectangleConfiguration() " procedure accesses the properties of the
rectangle. In this example the rectangle will be moved 40 pixels to the right:
Sub RectangleConfiguration()
'VBA598
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.Left = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

789

ActualPointTopIndex

11.05

5.7.8.49 LeftComma Property

Description
Defines or returns the number of digits to the left of the decimal point (0 to 20) for
the BarGraph object.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the number of digits to the left of the decimal
point will be set to " 4 " .
Sub BarGraphConfiguration()
'VBA599
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.LeftComma = 4
End With
End Sub

790

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.50 LightEffect Property
Description
TRUE if the light effect of the 3DBarGraph object is activated. BOOLEAN readwrite access.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the light effect will be activated:
Sub HMI3DBarGraphConfiguration()
'VBA600
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
.LightEffect = True
End With
End Sub

Printout of the Online Help
Automated Configuring

791

ActualPointTopIndex

11.05

5.7.8.51 LimitHigh4 Property

Description
Defines or returns the high limit value for " Reserve 4 " in the case of the BarGraph
object.
The CheckLimitHigh4 property must be set to TRUE in order for the " Reserve 4 "
limit value to be monitored.
Define the type of evaluation (in percent or absolute) with the aid of the
TypeLimitHigh4 property.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 70 " .
Sub BarGraphLimitConfiguration()
'VBA601
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh4 = False
'Activate monitoring
.CheckLimitHigh4 = True
'Set barcolor to " red "
.ColorLimitHigh4 = RGB(255, 0, 0)
'Set upper limit to " 70 "
.LimitHigh4 = 70
End With
End Sub

792

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.52 LimitHigh5 Property

Description
Defines or returns the high limit value for " Reserve 5 " in the case of the BarGraph
object.
The CheckLimitHigh5 property must be set to TRUE in order for the " Reserve 5 "
limit value to be monitored.
Define the type of evaluation (in percent or absolute) with the aid of the
TypeLimitHigh5 property.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 80 " .
Sub BarGraphLimitConfiguration()
'VBA602
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitHigh5 = False
'Activate monitoring
.CheckLimitHigh5 = True
'Set barcolor to " black "
.ColorLimitHigh5 = RGB(0, 0, 0)
'Set upper limit to " 80 "
.LimitHigh4 = 80
End With
End Sub

Printout of the Online Help
Automated Configuring

793

ActualPointTopIndex

11.05

5.7.8.53 LimitLow4 Property

Description
Defines or returns the low limit value for " Reserve 4 " in the case of the BarGraph
object.
The CheckLimitLow4 property must be set to TRUE in order for the " Reserve 4 "
limit value to be monitored.
Define the type of evaluation (in percent or absolute) with the aid of the
TypeLimitLow4 property.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 5 " .
Sub BarGraphLimitConfiguration()
'VBA603
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow4 = False
'Activate monitoring
.CheckLimitLow4 = True
'Set barcolor to " green "
.ColorLimitLow4 = RGB(0, 255, 0)
'Set lower limit to " 5 "
.LimitLow4 = 5
End With
End Sub

794

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.54 LimitLow5 Property

Description
Defines or returns the low limit value for " Reserve 5 " in the case of the BarGraph
object.
The CheckLimitLow5 property must be set to TRUE in order for the " Reserve 5 "
limit value to be monitored.
Define the type of evaluation (in percent or absolute) with the aid of the
TypeLimitLow5 property.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 0 " .
Sub BarGraphLimitConfiguration()
'VBA604
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis to absolute
.TypeLimitLow5 = False
'Activate monitoring
.CheckLimitLow5 = True
'Set barcolor to " white "
.ColorLimitLow5 = RGB(255, 255, 255)
'Set lower limit to " 0 "
.LimitLow5 = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

795

ActualPointTopIndex

11.05

5.7.8.55 LimitMax Property

Description
Defines or returns the high limit value as an absolute value dependent on the data
format in the case of the IOField object.
If the value to be displayed exceeds the high limit value, a string of *** indicates
that it cannot be displayed.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the high limit for a decimal value will be set to " 100 " :
Sub IOFieldConfiguration()
'VBA605
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.DataFormat = 1
.LimitMax = 100
End With
End Sub

796

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.56 LimitMin Property

Description
Defines or returns the low limit value as an absolute value dependent on the data
format in the case of the IOField object.
If the value to be displayed exceeds the high limit value, a string of *** indicates
that it cannot be displayed.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the high limit for a decimal value will be set to " 0 " :
Sub IOFieldConfiguration()
'VBA606
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.DataFormat = 1
.LimitMin = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

797

ActualPointTopIndex

11.05

5.7.8.57 ListType Property

Description
Defines or returns the list type in the case of the TextList object. Value range from
0 to 2.
List Type

Assigned Value

Decimal

0

Binary

1

Bit

2

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the list type will be set to " Decimal " :
Sub TextListConfiguration()
'VBA607
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.ListType = 0
End With
End Sub

798

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.58 LockBackColor Property

Description
Defines or returns the background color of the button for a locked measuring point
in the case of the GroupDisplay object. LONG read-write access.
The value of the LockStatus property must be TRUE in order for the background
color to be displayed.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color for a locked measuring point will be
set to " Red " :
Sub GroupDisplayConfiguration()
'VBA608
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.LockStatus = True
.LockBackColor = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

799

ActualPointTopIndex

11.05

5.7.8.59 LockStatus Property

Description
TRUE if a locked measuring point is to be displayed in the case of the
GroupDisplay object. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color for a locked measuring point will be
set to " Red " :
Sub GroupDisplayConfiguration()
'VBA609
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.LockStatus = True
.LockBackColor = RGB(255, 0, 0)
End With
End Sub

800

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.60 LockText Property

Description
Defines the button labels for a locked measuring point in the case of the
GroupDisplay object.
The value of the LockStatus property must be TRUE in order for a label to be
displayed.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the label for a locked measuring point will be set to
" Locked " :
Sub GroupDisplayConfiguration()
'VBA610
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.LockStatus = True
.LockText = " gesperrt "
End With
End Sub

Printout of the Online Help
Automated Configuring

801

ActualPointTopIndex

11.05

5.7.8.61 LockTextColor Property

Description
Defines or returns the color of the button label for a locked measuring point in the
case of the GroupDisplay object. LONG read-write access.
The value of the LockStatus property must be TRUE in order for the background
color to be displayed.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the button label for a locked measuring point will be set to
" Yellow " :
Sub GroupDisplayConfiguration()
'VBA611
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.LockStatus = True
.LockTextColor = RGB(0, 255, 255)
End With
End Sub

802

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.62 LockedByCreatorID Property

Description
TRUE, if a picture was created and/or referenced by SIMATIC Manager.
BOOLEAN read access.
If a picture was created in SIMATIC Manager, you may process and subsequently
save it in WinCC. You may, however, not delete this picture in WinCC. SIMATIC
Manager administers a code for each picture, the so-called CreatorID, which
cannot be changed in WinCC.
You may process the picture in WinCC, however, overwriting the picture with a
WinCC picture (LockedByCreatorID = FALSE) will be prevented. This may be
checked by examining the LockedByCreatorID property of an existing file prior to
writing during the SaveAs method. If such a picture is saved into a new (not yet
existing) or an existing WinCC picture using the SaveAs method, the CreatorID will
not be passed on.

Example 1
Inn the following example, a picture created with SIMATIC Manager
(LockedByCreatorID = TRUE) is opened, processed, and saved. The value of the
LockedByCreatorID property is not changed.
Sub SaveDocAs_1()
'VBA810
'open an existing file, change it and save it
Dim docOld As Document
Const strFile As String = " Simatic_001.Pdl "
'
Set docOld =
Application.Documents.Open(Application.ApplicationDataPa
th & strFile, hmiOpenDocumentTypeInvisible)
docOld.Width = docOld.Width + 1
docOld.Save
'
MsgBox " LockedByCreatorID = " &
docOld.LOckedByCreatorID, vbOKOnly, " Result "
'
docOld.Close
Set docOld = Nothing
'
End Sub
Example 2

Printout of the Online Help
Automated Configuring

803

ActualPointTopIndex

11.05

In this example, a new picture is saved as a new file using the SaveAs method. To
check if the picture is permitted to be saved, the LockedByCreatorID property is
checked. In the new file the LockedByCreator property is reset.
Sub SaveDocAs_2()
'VBA811
'create a new file and overwrite it to an existing file,
'if it is not 'locked by CreatorID'
Dim docNew As Document
Dim docOld As Document
Const strFile As String = " Simatic_001.Pdl "
'
Set docNew =
Application.Documents.Add(hmiOpenDocumentTypeInvisible)
Set docOld =
Application.Documents.Open(Application.ApplicationDataPa
th & strFile, hmiOpenDocumentTypeInvisible)
'
If docOld.LockedByCreatorID = False Then
docOld.Close
docNew.SaveAs(Application.ApplicationDataPath &
strFile)
Else
MsgBox " File cannot be stored (LockedByCreatorID).
" , vbOKOnly, " Result "
End If
'
docOld.Close
docNew.Close
Set docOld = Nothing
Set docNew = Nothing
'
End Sub

804

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.63 LongStrokesBold Property

Description
TRUE if the long strokes on the scale of the BarGraph object are to be displayed in
bold. BOOLEAN read-write access.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the long strokes will not be displayed in bold:
Sub BarGraphConfiguration()
'VBA612
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.LongStrokesBold = False
End With
End Sub

Printout of the Online Help
Automated Configuring

805

ActualPointTopIndex

11.05

5.7.8.64 LongStrokesOnly Property

Description
TRUE if just the long strokes on the scale of the BarGraph object are to be
displayed. BOOLEAN read-write access.
Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example, only the long strokes will be displayed:
Sub BarGraphConfiguration()
'VBA613
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.LongStrokesOnly = True
End With
End Sub

806

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.8.65 LongStrokesSize Property

Description
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object.

Example
In this example the length of the axis section strokes will be set to " 10 " .
Sub BarGraphConfiguration()
'VBA614
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.LongStrokesSize = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

807

ActualPointTopIndex

11.05

5.7.8.66 LongStrokesTextEach Property

Description
Defines or returns which strokes will be labeled when displaying the scale on the
BarGraph object (1 = every stroke, 2 = every second stroke, etc.).

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example every third stroke will be labeled:
Sub BarGraphConfiguration()
'VBA615
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.LongStrokesTextEach = 3
End With
End Sub

808

Printout of the Online Help
Automated Configuring

11.05

5.7.9
5.7.9.1

ActualPointTopIndex

VBA Properties: M
Macro Property

Description
For a user-defined menu entry or icon, defines the VBA macro that will be
executed upon selection.
Example
In the following example a user-defined menu with two menu entries that call two
different VBA macros will be created:
Sub CreateDocumentMenusUsingMacroProperty()
'VBA616
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " My first menuitem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " My second menuitem " )
'
'To assign a macro to every menuitem:
With ActiveDocument.CustomMenus( " DocMenu1 " )
.MenuItems( " dmItem1_1 " ).Macro = " TestMacro1 "
.MenuItems( " dmItem1_2 " ).Macro = " TestMacro2 "
End With
End Sub
You can call the following two procedures via the menu items in the user-defined
menu " DocMenu1 " :
Sub TestMacro1()
MsgBox " TestMacro1 is executed "
End Sub
Sub TestMacro2()
MsgBox " TestMacro2 is executed "
End Sub

Printout of the Online Help
Automated Configuring

809

ActualPointTopIndex

5.7.9.2

11.05

Marker Property

Description
TRUE if the limit values are to be displayed as a scale value in the case of the
BarGraph object. BOOLEAN read-write access.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example, the limit values will be displayed as scale values:
Sub BarGraphConfiguration()
'VBA617
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Marker = True
End With
End Sub

810

Printout of the Online Help
Automated Configuring

11.05

5.7.9.3

ActualPointTopIndex

Max Property

Description
Defines or returns the absolute value in the case of a full value display.
If the scale display is active, this value will be displayed.
Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the absolute value will be set to " 10 " .
Sub BarGraphConfiguration()
'VBA618
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Max = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

811

ActualPointTopIndex

5.7.9.4

11.05

MaximizeButton Property

Description
TRUE if the ApplicationWindow object can be maximized in runtime. BOOLEAN
read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example the application window will receive a Maximize
button in runtime:
Sub ApplicationWindowConfig()
'VBA619
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow1 " ,
" HMIApplicationWindow " )
With objAppWindow
.MaximizeButton = True
End With
End Sub

812

Printout of the Online Help
Automated Configuring

11.05

5.7.9.5

ActualPointTopIndex

MaxZoom Property

Description
Defines or returns the maximum zoom level for the layer.

Example
The " LayerInfo() " procedure outputs the name and zoom configuration for each
layer of the current picture:
Sub LayerInfo()
'VBA620
Dim colLayers As HMILayers
Dim objSingleLayer As HMILayer
Dim iAnswer As Integer
Set colLayers = ActiveDocument.Layers
For Each objSingleLayer In colLayers
With objSingleLayer
iAnswer = MsgBox( " Layername: " & .Name & vbCrLf & " Min.
zoom: " & .MinZoom & vbCrLf & " Max. zoom: " & .MaxZoom,
vbOKCancel)
End With
If vbCancel = iAnswer Then Exit For
Next objSingleLayer
End Sub

Printout of the Online Help
Automated Configuring

813

ActualPointTopIndex

5.7.9.6

11.05

MCGUBackColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Went Out Unacknowledged " status when the flash status is " Off " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " Off " will be
set to " Red " :
Sub GroupDisplayConfiguration()
'VBA621
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUBackColorOff = RGB(255, 0, 0)
End With
End Sub

814

Printout of the Online Help
Automated Configuring

11.05

5.7.9.7

ActualPointTopIndex

MCGUBackColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Went Out Unacknowledged " status when the flash status is " On " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " On " will be
set to " White " :
Sub GroupDisplayConfiguration()
'VBA622
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUBackColorOn = RGB(255, 255, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

815

ActualPointTopIndex

5.7.9.8

11.05

MCGUBackFlash Property

Description
TRUE if the background to the GroupDisplay object is to flash when a message
goes out unacknowledged. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA623
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUBackFlash = True
End With
End Sub

816

Printout of the Online Help
Automated Configuring

11.05

5.7.9.9

ActualPointTopIndex

MCGUTextColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the text color for the
" Went Out Unacknowledged " status when the flash status is " Off " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" Off " will be set to " Blue " :
Sub GroupDisplayConfiguration()
'VBA624
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUTextColorOff = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

817

ActualPointTopIndex

11.05

5.7.9.10 MCGUTextColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color to
the text for the " Went Out Unacknowledged " status when the flash status is " On " .
LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" On " will be set to " Black " :
Sub GroupDisplayConfiguration()
'VBA625
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUTextColorOn = RGB(0, 0, 0)
End With
End Sub

818

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.11 MCGUTextFlash Property

Description
TRUE if the font for the GroupDisplay object is to flash when a message goes out
unacknowledged. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the font is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA626
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCGUTextFlash = True
End With
End Sub

Printout of the Online Help
Automated Configuring

819

ActualPointTopIndex

11.05

5.7.9.12 MCKOBackColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Came In " status when the flash status is " Off " . LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " Off " will be
set to " Red " :
Sub GroupDisplayConfiguration()
'VBA627
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOBackColorOff = RGB(255, 0, 0)
End With
End Sub

820

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.13 MCKOBackColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Came In " status when the flash status is " On " . LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " On " will be
set to " White " :
Sub GroupDisplayConfiguration()
'VBA628
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOBackColorOn = RGB(255, 255, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

821

ActualPointTopIndex

11.05

5.7.9.14 MCKOBackFlash Property

Description
TRUE if the background to the GroupDisplay object is to flash when a message
comes in. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA629
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOBackFlash = True
End With
End Sub

822

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.15 MCKOTextColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the text color for the
" Came In " status when the flash status is " Off " . LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" Off " will be set to " Blue " :
Sub GroupDisplayConfiguration()
'VBA630
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOTextColorOff = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

823

ActualPointTopIndex

11.05

5.7.9.16 MCKOTextColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color to
the text for the " Came In " status when the flash status is " On " . LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" On " will be set to " Black " :
Sub GroupDisplayConfiguration()
'VBA631
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOTextColorOn = RGB(0, 0, 0)
End With
End Sub

824

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.17 MCKOTextFlash Property

Description
TRUE if the font for the GroupDisplay object is to flash when a message comes in.
BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the font is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA632
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKOTextFlash = True
End With
End Sub

Printout of the Online Help
Automated Configuring

825

ActualPointTopIndex

11.05

5.7.9.18 MCKQBackColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Went Out Acknowledged " status when the flash status is " Off " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " Off " will be
set to " Red " :
Sub GroupDisplayConfiguration()
'VBA633
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQBackColorOff = RGB(255, 0, 0)
End With
End Sub

826

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.19 MCKQBackColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color for
the " Went Out Acknowledged " status when the flash status is " On " . LONG readwrite access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color when the flash status is " On " will be
set to " White " :
Sub GroupDisplayConfiguration()
'VBA634
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQBackColorOn = RGB(255, 255, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

827

ActualPointTopIndex

11.05

5.7.9.20 MCKQBackFlash Property

Description
TRUE if the background to the GroupDisplay object is to flash when a message
goes out acknowledged. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA635
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQBackFlash = True
End With
End Sub

828

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.21 MCKQTextColorOff Property

Description
In the case of the GroupDisplay object, defines or returns the text color for the
" Went Out Acknowledged " status when the flash status is " Off " . LONG read-write
access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" Off " will be set to " Blue " :
Sub GroupDisplayConfiguration()
'VBA636
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQTextColorOff = RGB(0, 0, 255)
End With
End Sub

Printout of the Online Help
Automated Configuring

829

ActualPointTopIndex

11.05

5.7.9.22 MCKQTextColorOn Property

Description
In the case of the GroupDisplay object, defines or returns the background color to
the text for the " Went Out Acknowledged " status when the flash status is " On " .
LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color to the text when the flash status is
" On " will be set to " Black " :
Sub GroupDisplayConfiguration()
'VBA637
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQTextColorOn = RGB(0, 0, 0)
End With
End Sub

830

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.23 MCKQTextFlash Property

Description
TRUE if the font for the GroupDisplay object is to flash when a message goes out
acknowledged. BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration " () procedure accesses the properties of the Group
Display. In this example the font is to flash when a message goes out
unacknowledged:
Sub GroupDisplayConfiguration()
'VBA638
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MCKQTextFlash = True
End With
End Sub

Printout of the Online Help
Automated Configuring

831

ActualPointTopIndex

11.05

5.7.9.24 MCText Property

Description
Defines or returns the label for the appropriate message class in the case of the
GroupDisplay object.

Example
The " GroupDisplayConfiguration " () procedure accesses the properties of the Group
Display. In this example the label for the " Alarm High " message class will be set to
" Alarm High " :
Sub GroupDisplayConfiguration()
'VBA639
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MessageClass = 0
.MCText = " Alarm High "
End With
End Sub

832

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.25 MenuItems Property

Description
Returns a listing containing all the menu entries in the user-defined menu.

Example
The " CreateMenuItem() " procedure creates the " Delete Objects " menu and adds
two menu entries ( " Delete Rectangles " and " Delete Circles " ). In this example the
labels will then be output:
Sub CreateMenuItem()
'VBA640
Dim objMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim iIndex As Integer
iIndex = 1
'
'Add new menu " Delete objects " to the menubar:
Set objMenu = ActiveDocument.CustomMenus.InsertMenu(1,
" DeleteObjects " , " Delete objects " )
'
'Add two menuitems to menu " Delete objects "
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(1,
" DeleteAllRectangles " , " Delete rectangles " )
Set objMenuItem = objMenu.MenuItems.InsertMenuItem(2,
" DeleteAllCircles " , " Delete circles " )
'
'Output label of menu:
MsgBox ActiveDocument.CustomMenus(1).Label
'
'Output labels of all menuitems:
For iIndex = 1 To objMenu.MenuItems.Count
MsgBox objMenu.MenuItems(iIndex).Label
Next iIndex
End Sub

Printout of the Online Help
Automated Configuring

833

ActualPointTopIndex

11.05

5.7.9.26 MenuItemType Property

Description
Returns the type for a user-defined menu entry. Read access.
Returned Value

Type of Menu Entry

0

Separator (Separator)

1

Submenu (SubMenu)

2

Menu Entry (MenuItem)

Example
The " ShowMenuTypes() " procedure outputs the types for the menu entries in the
first user-defined menu:
Sub ShowMenuTypes()
'VBA641
Dim iMaxMenuItems As Integer
Dim iMenuItemType As Integer
Dim strMenuItemType As String
Dim iIndex As Integer
iMaxMenuItems =
ActiveDocument.CustomMenus(1).MenuItems.Count
For iIndex = 1 To iMaxMenuItems
iMenuItemType =
ActiveDocument.CustomMenus(1).MenuItems(iIndex).Men
uItemType
Select Case iMenuItemType
Case 0
strMenuItemType = " Trennstrich (Separator) "
Case 1
strMenuItemType = " Untermenü (SubMenu) "
Case 2
strMenuItemType = " Menüeintrag (MenuItem) "
End Select
MsgBox iIndex & " . Menuitemtype: " &
strMenuItemType
Next iIndex
End Sub

834

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.27 MessageClass Property

Description
For the GroupDisplay object, defines the appropriate message type (Alarm High,
Alarm Low, Warning High, Warning Low, etc.) for which the attribute settings
" Display Text " , " Came In " , Came In Acknowledged " and " Went Out
Unacknowledged " are configured.
Message Class

Assigned Value

AlarmHigh

0

AlarmLow

1

WarningHigh

2

WarningLow

3

Tolerance High

4

Tolerance Low

5

AS Control System Fault

6

AS Process Control Error

7

OS Process Control Error

8

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the background color for the " AlarmHigh " message type
when the flash status is " Off " will be set to " Red " :
Sub GroupDisplayConfiguration()
'VBA642
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.MessageClass = 0
.MCGUBackColorOff = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

835

ActualPointTopIndex

11.05

5.7.9.28 Min Property

Description
Defines or returns the absolute value in the case of the smallest value display.
If the scale display is active, this value will be displayed.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the absolute value will be set to " 1 " .
Sub BarGraphConfiguration()
'VBA643
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Min = 1
End With
End Sub

836

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.29 MinZoom Property

Description
Defines or returns the minimum zoom level for the layer.

Example
The " LayerInfo() " procedure outputs the name and zoom configuration for each
layer of the current picture:
Sub LayerInfo()
'VBA644
Dim colLayers As HMILayers
Dim objLayer As HMILayer
Dim strMaxZoom As String
Dim strMinZoom As String
Dim strLayerName As String
Dim iAnswer As Integer
Set colLayers = ActiveDocument.Layers
For Each objLayer In colLayers
With objLayer
strMinZoom = .MinZoom
strMaxZoom = .MaxZoom
strLayerName = .Name
iAnswer = MsgBox( " Layername: " & strLayerName & vbCrLf &
" Min. zoom: " & strMinZoom & vbCrLf & " Max. zoom: " &
strMaxZoom, vbOKCancel)
End With
If vbCancel = iAnswer Then Exit For
Next objLayer
End Sub

Printout of the Online Help
Automated Configuring

837

ActualPointTopIndex

11.05

5.7.9.30 Modified Property

Description
TRUE if the source code for a script or picture has been changed. BOOLEAN read
access.

Example
In the following example a check will be made on whether the active picture has
been changed:
Sub CheckModificationOfActiveDocument()
'VBA645
Dim strCheck As String
Dim bModified As Boolean
bModified = ActiveDocument.Modified
Select Case bModified
Case True
strCheck = " Active document is modified "
Case False
strCheck = " Active document is not modified "
End Select
MsgBox strCheck
End Sub

838

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.9.31 Moveable Property

Description
TRUE if the ApplicationWindow and PictureWindow objects can be moved in
runtime. BOOLEAN read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example it shall be possible to move the application
window in runtime:
Sub ApplicationWindowConfig()
'VBA646
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow1 " ,
" HMIApplicationWindow " )
With objAppWindow
.Moveable = True
End With
End Sub

Printout of the Online Help
Automated Configuring

839

ActualPointTopIndex

11.05

5.7.10 VBA Properties: N-O
5.7.10.1 Name Property

Description
Returns the name of the object. STRING read access.

Example
The " LayerInfo() " procedure outputs the name and zoom configuration for each
layer of the current picture:
Sub LayerInfo()
'VBA647
Dim colLayers As HMILayers
Dim objLayer As HMILayer
Dim strMaxZoom As String
Dim strMinZoom As String
Dim strLayerName As String
Dim iAnswer As Integer
Set colLayers = ActiveDocument.Layers
For Each objLayer In colLayers
With objLayer
strMinZoom = .MinZoom
strMaxZoom = .MaxZoom
strLayerName = .Name
iAnswer = MsgBox( " Layername: " & strLayerName & vbCrLf &
" Min. zoom: " & strMinZoom & vbCrLf & " Max. zoom: " &
strMaxZoom, vbOKCancel)
End With
If vbCancel = iAnswer Then Exit For
Next objLayer
End Sub

840

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.2 NegativeValue Property

Description
Use the BinaryResultInfo property to return the BinaryResultInfo object.

Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned and the associated property
values will be assigned to both the binary value ranges:
Sub AddDynamicDialogToCircleRadiusTypeBinary()
'VBA648
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_C " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBool
.BinaryResultInfo.NegativeValue = 20
.BinaryResultInfo.PositiveValue = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

841

ActualPointTopIndex

11.05

5.7.10.3 Number Property

Description
Returns the layer number of a " Layer " type object. Counting begins at 1. The first
layer, " Layer0 " , returns the value " 0 " . Read access.

Example
This example outputs the name, number and index of a layer:
Sub ShowLayerWithNumbers()
'VBA803
Dim colLayers As HMILayers
Dim objLayer As HMILayer
Dim iAnswer As Integer
Dim iIndex As Integer
iIndex = 1
Set colLayers = ActiveDocument.Layers
For Each objLayer In colLayers
iAnswer = MsgBox( " Layername: " & objLayer & vbCrLf
& " Layernumber: " & objLayer.Number & vbCrLf &
" Layersindex: " & iIndex, vbOKCancel)
iIndex = iIndex + 1
If vbCancel = iAnswer Then Exit For
Next objLayer
End Sub

842

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.4 NumberLines Property

Description
For the TextList object, defines how many lines the selection list shall contain, or
returns the value. If the amount of configured text is larger than this value, the
selection list receives a vertical scroll bar in runtime.

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example a selection list is created and the number of visible lines is
set to three:
Sub TextListConfiguration()
'VBA649
Dim objTextList As HMITextList
'
'Neue TextListe ins aktuelle Bild einfügen:
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.NumberLines=3
End With
End Sub

Printout of the Online Help
Automated Configuring

843

ActualPointTopIndex

11.05

5.7.10.5 ObjectName Property

Description
Depending on the source and destination object types for the direct connection,
either defines or returns the name of the constant, object or tag.
The two tables show you when you must use the ObjectName property. A " -- "
means that the property is assigned an empty string ( " " ) by default when the
DirectConnection object is created.
Source object type (SourceLink Property)
Type Property

AutomationName
Property

ObjectName Property

hmiSourceTypeConstant

--

Name of the constant
(e.g. the picture name)

hmiSourceTypeProperty

Property of the source
object (e.g. " Top " )

Name of the source
object (e.g.
" Rectangle_A " )

hmiSourceTypePropertyOfThis
Object

--

--

hmiSourceTypeVariableDirect

--

Tag name

hmiSourceTypeVariableIndirect --

Tag name

Destination object type (DestinationLink Property)
Type Property

AutomationName
Property

ObjectName Property

hmiDestTypeProperty

Property of the
destination object (e.g.
" Left " )

Name of the destination
object (e.g.
" Rectangle_A " )

hmiDestTypePropertyOfThisOb -ject
hmiDestTypePropertyOfActual
Window

Property of the
destination object (e.g.
" Left " )

--

hmiDestTypeVariableDirect

--

Tag name

hmiDestTypeVariableIndirect

--

Tag name

hmiDestTypeDirectMessage

--

Tag name

hmiDestTypeIndirectMessage

844

--

--

Tag name

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Example
In the following example the X position of " Rectangle_A " is copied to the Y position
of " Rectangle_B " in runtime by clicking on the button:
Sub DirectConnection()
'VBA650
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 100
.Text = " SetPosition "
End With
'
'Directconnection is initiated by mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "

Printout of the Online Help
Automated Configuring

845

ActualPointTopIndex

11.05

.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

846

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.6 ObjectSizeDecluttering Property

Description
TRUE, if objects of the specified picture outside of two configured sizes are to be
faded out. BOOLEAN read-write access.
Define the size range with the aid of the SetDeclutterObjectSize method.

Example
In the following example the settings for the lowest layer are configured in the
active picture:
Sub ConfigureSettingsOfLayer()
'VBA651
Dim objLayer As HMILayer
Set objLayer = ActiveDocument.Layers(1)
With objLayer
'Configure " Layer 0 "
.MinZoom = 10
.MaxZoom = 100
.Name = " Configured with VBA "
End With
'Define fade-in and fade-out of objects:
With ActiveDocument
.LayerDecluttering = True
.ObjectSizeDecluttering = True
.SetDeclutterObjectSize 50, 100
End With
End Sub

Printout of the Online Help
Automated Configuring

847

ActualPointTopIndex

11.05

5.7.10.7 OffsetLeft Property

Description
Defines or returns the distance of the picture from the left-hand border of the
picture window.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA652
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

848

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.8 OffsetTop Property

Description
Defines or returns the distance of the picture from the top border of the picture
window.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA653
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

849

ActualPointTopIndex

11.05

5.7.10.9 OnTop Property

Description
TRUE if the ApplicationWindow object is always in the foreground in runtime.
BOOLEAN read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example the application window will always be in the
foreground in runtime:
Sub ApplicationWindowConfig()
'VBA654
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow1 " ,
" HMIApplicationWindow " )
With objAppWindow
.OnTop = True
End With
End Sub

850

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.10 Operation Property

Description
TRUE if the object can be used or operated in runtime. BOOLEAN read-write
access.
Example
In this example the status of the operator-control enables will be output for all
objects in the active picture:
Sub ShowOperationStatusOfAllObjects()
'VBA655
Dim objObject As HMIObject
Dim bStatus As Boolean
Dim strStatus As String
Dim strName As String
Dim iMax As Integer
Dim iIndex As Integer
Dim iAnswer As Integer
iMax = ActiveDocument.HMIObjects.Count
iIndex = 1
For iIndex = 1 To iMax
strName =
ActiveDocument.HMIObjects(iIndex).ObjectName
bStatus =
ActiveDocument.HMIObjects(iIndex).Operation
Select Case bStatus
Case True
strStatus = " yes "
Case False
strStatus = " no "
End Select
iAnswer = MsgBox( " Object: " & strName & vbCrLf &
" Operator-Control enable: " & strStatus,
vbOKCancel)
If vbCancel = iAnswer Then Exit For
Next iIndex
If 0 = iMax Then MsgBox " No objects in the active
document. "
End Sub

Printout of the Online Help
Automated Configuring

851

ActualPointTopIndex

11.05

5.7.10.11 OperationMessage Property

Description
TRUE if a message has to be output when an operation is carried out. The reason
for the operation can only be input if the " OperationReport " property is set to
" True " . BOOLEAN read-write access.
The operation is sent to the message system, and is archived. Using the message
system, a message may be output in a message line.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example, an operation is supposed to be sent to the message system:
Sub IOFieldConfiguration()
'VBA656
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.OperationReport = True
.OperationMessage = True
End With
End Sub

852

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.12 OperationReport Property

Description
TRUE if the reason for an operation has to be entered in a log. BOOLEAN readwrite access.
When the object is used or operated in runtime, a dialog opens in which the
operator can input the reason for the operation in the form of text. The operation is
sent to the message system, and is archived.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example, an operation is supposed to be sent to the message system:
Sub IOFieldConfiguration()
'VBA657
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.OperationReport = True
.OperationMessage = True
End With
End Sub

Printout of the Online Help
Automated Configuring

853

ActualPointTopIndex

11.05

5.7.10.13 Orientation Property

Description
TRUE if the text in the object is displayed horizontally. BOOLEAN read-write
access.
Note:
It is only the text that is displayed either horizontally or vertically. The position of
the object remains unchanged.
Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the text will be displayed vertically:
Sub ButtonConfiguration()
'VBA658
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.Width = 150
.Height = 150
.Text = " Text is displayed vertical "
.Orientation = False
End With
End Sub

854

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.10.14 OutputFormat Property

Description
Defines how the output value shall be displayed, or returns the set value. The
display is dependent on the data format.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example, data type " Decimal " will be set for the I/O field: The output value will
be displayed with two digits to the left of the decimal point and three digits to the
right of the decimal point:
Sub IOFieldConfiguration()
'VBA659
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.DataFormat = 1
.OutputFormat = " 99,999 "
End With
End Sub

Printout of the Online Help
Automated Configuring

855

ActualPointTopIndex

11.05

5.7.10.15 OutputValue Property

Description
Defines or returns the default setting for the value to be displayed.
This value will be used in runtime if the associated tag is either not connected or
not updated when the picture is started.

Example
The " IOFieldConfiguration() " procedure accesses the properties of the I/O field. In
this example the output value will be set to " 00 " :
Sub IOFieldConfiguration()
'VBA660
Dim objIOField As HMIIOField
Set objIOField =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
With objIOField
.OutputValue = " 00 "
End With
End Sub

856

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11 VBA Properties: P-Q
5.7.11.1 Parent Property

Description
Returns the higher-ranking object in the specified object. Read access.

Example
In the following example a copy of the active picture is created and the name of the
picture is then output with the aid of the Parent property:
Sub ExampleForParent()
'VBA661
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
MsgBox objView.Parent.Name
End Sub

Printout of the Online Help
Automated Configuring

857

ActualPointTopIndex

11.05

5.7.11.2 PasswordLevel Property

Description
Defines the authorization for the operation (such as no input or no action trigger)
for the object.
Password Level

Assigned Value

NO access protection & lt; & gt;

0

User administration

1

Value input

2

Process controlling

3

Picture editing

4

Change picture

5

Window selection

6

Hard copy

7

Confirm alarms

8

Lock alarms

9

Free alarms

10

Message editing

11

Start archive

12

Stop archive

13

Edit archive values

14

Archive editing

15

Action editing

16

Project Manager

17

Activate remote

1000

Configure remote

1001

Just monitor

1002

You must first define the operator authorizations in the User Administrator.

Example
--

858

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.3 Path Property

Description
Returns the full path of the folder in which the specified picture is stored. Read
access.

Example
In this example the path to the folder of the active picture will be output:
Sub ShowDocumentPath()
'VBA663
MsgBox ActiveDocument.Path
End Sub

Printout of the Online Help
Automated Configuring

859

ActualPointTopIndex

11.05

5.7.11.4 Pathname Property

Description
Returns the internal access path to the Components Library for the specified object
of the " FolderItem " type. Read access.

Example
In this example the internal access path is output for the " PC " object contained in
the Global Components Library:
Sub ShowInternalNameOfFolderItem()
'VBA664
Dim objGlobalLib As HMISymbolLibrary
Set objGlobalLib = Application.SymbolLibraries(1)
MsgBox
objGlobalLib.FolderItems(2).Folder(2).Folder.Item(1).Pat
hName
End Sub

860

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.5 PicDeactReferenced Property

Description
TRUE if the picture assigned to the " Deactivated " status is to be saved in the
RoundButton object. Otherwise only the associated object reference is saved.
BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the picture assigned to the " Deactivated " status will
be referenced:
Sub RoundButtonConfiguration()
'VBA665
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDeactReferenced = False
End With
End Sub

Printout of the Online Help
Automated Configuring

861

ActualPointTopIndex

11.05

5.7.11.6 PicDeactTransparent Property

Description
Defines or returns the color which is going to be set to " Transparent " in the Bitmap
object (.bmp, .dib) assigned to the " Deactivated " status. LONG read-write access.
The color is only set to " Transparent " if the value of the " PicDeactUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Red " assigned in the Bitmap object is to
be displayed as transparent in the " Deactivated " status:
Sub RoundButtonConfiguration()
'VBA666
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDeactTransparent = RGB(255, 0, 0)
.PicDeactUseTransColor = True
End With
End Sub

862

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.7 PicDeactUseTransColor Property

Description
TRUE if the transparent color defined with the " PicDeactTransparent " property is to
be used for the " Deactivated " status. BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Red " assigned in the Bitmap object is to
be displayed as transparent in the " Deactivated " status:
Sub RoundButtonConfiguration()
'VBA667
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDeactTransparent = RGB(255, 0, 0)
.PicDeactUseTransColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

863

ActualPointTopIndex

11.05

5.7.11.8 PicDownReferenced Property

Description
TRUE if the picture assigned to the " On " status is to be saved in the RoundButton
object. Otherwise only the associated object reference is saved. BOOLEAN readwrite access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the picture assigned to the " On " status will be
referenced:
Sub RoundButtonConfiguration()
'VBA668
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDownReferenced = False
End With
End Sub

864

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.9 PicDownTransparent Property

Description
Defines or returns the color which is going to be set to " Transparent " in the Bitmap
object (.bmp, .dib) assigned to the " On " status. LONG read-write access.
The color is only set to " Transparent " if the value of the " PicDownUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Yellow " assigned in the Bitmap object is to
be displayed as transparent in the " On " status:
Sub RoundButtonConfiguration()
'VBA669
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDownTransparent = RGB(255, 255, 0)
.PicDownUseTransColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

865

ActualPointTopIndex

11.05

5.7.11.10 PicDownUseTransColor Property

Description
TRUE if the transparent color defined with the " PicDownTransparent " property is to
be used for the " On " status. BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Yellow " assigned in the Bitmap object is to
be displayed as transparent in the " On " status:
Sub RoundButtonConfiguration()
'VBA670
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicDownTransparent = RGB(255, 255, 0)
.PicDownUseTransColor = True
End With
End Sub

866

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.11 PicReferenced Property

Description
TRUE if the picture assigned to the GraphicObject object is to be referenced and
not saved in the object. BOOLEAN read-write access.

Example
The " GraphicObjectConfiguration() " procedure accesses the properties of the
graphic object. In this example the assigned picture will be referenced:
Sub GraphicObjectConfiguration()
'VBA671
Dim objGraphicObject As HMIGraphicObject
Set objGraphicObject =
ActiveDocument.HMIObjects.AddHMIObject( " GraphicObject1 " ,
" HMIGraphicObject " )
With objGraphicObject
.PicReferenced = True
End With
End Sub

Printout of the Online Help
Automated Configuring

867

ActualPointTopIndex

11.05

5.7.11.12 PicTransColor Property

Description
Defines or returns the color which is going to be set to " Transparent " in the
assigned Bitmap object (.bmp, .dib). LONG read-write access.
The color is only set to " Transparent " if the value of the " PicUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " GraphicObjectConfiguration() " procedure accesses the properties of the
graphic object. In this example the color " Blue " assigned in the Bitmap object is to
be displayed as transparent:
Sub GraphicObjectConfiguration()
'VBA672
Dim objGraphicObject As HMIGraphicObject
Set objGraphicObject =
ActiveDocument.HMIObjects.AddHMIObject( " GraphicObject1 " ,
" HMIGraphicObject " )
With objGraphicObject
.PicTransColor = 16711680
.PicUseTransColor = True
End With
End Sub

868

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.13 PictureDeactivated Property

Description
Defines the picture that will be displayed in the " Deactivated " status, or returns the
name of the picture.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.

Example
The " ButtonConfiguration() " procedure accesses the properties of the round button.
In this example the pictures for the " On " and " Off " states will be defined:
Sub ButtonConfiguration()
'VBA673
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
'
'Toi use this example copy a Bitmap-Graphic
'to the " GraCS " -Folder of the actual project.
'Replace the picturename " TestPicture1.BMP " with
the name of
'the picture you copied
.PictureDeactivated = " TestPicture1.BMP "
End With
End Sub

Printout of the Online Help
Automated Configuring

869

ActualPointTopIndex

11.05

5.7.11.14 PictureDown Property

Description
Defines the picture that will be displayed in the " On " status, or returns the name of
the picture.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.

Example
The " ButtonConfiguration() " procedure accesses the properties of the round button.
In this example the pictures for the " On " and " Off " states will be defined:
Sub ButtonConfiguration()
'VBA674
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
'
'To use this example copy two Bitmap-Graphics
'to the " GraCS " -Folder of the actual project.
'Replace the picturenames " TestPicture1.BMP " and
" TestPicture2.BMP "
'with the names of the pictures you copied
.PictureDown = " TestPicture1.BMP "
.PictureUp = " TestPicture2.BMP "
End With
End Sub

870

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.15 PictureName Property

Description
Defines the picture that will be displayed in the picture window in runtime, or
returns the name of the picture.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA675
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

871

ActualPointTopIndex

11.05

5.7.11.16 PictureUp Property

Description
Defines the picture that will be displayed in the " Off " status, or returns the name of
the picture.
The picture ( *.BMP or *.DIB) must be located in the " GraCS " folder of the current
project so that it can be linked.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the pictures for the " On " and " Off " states will be defined:
Sub ButtonConfiguration()
'VBA676
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
'
'To use this example copy two Bitmap-Graphics
'to the " GraCS " -Folder of the actual project.
'Replace the picturenames " TestPicture1.BMP " and
" TestPicture2.BMP "
'with the names of the pictures you copied
.PictureDown = " TestPicture1.BMP "
.PictureUp = " TestPicture2.BMP "
End With
End Sub

872

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.17 PicUpReferenced Property

Description
TRUE if the picture assigned to the " Off " status is to be saved in the RoundButton
object. Otherwise only the associated object reference is saved. BOOLEAN readwrite access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the picture assigned to the " Off " status will be
referenced:
Sub RoundButtonConfiguration()
'VBA677
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicUpReferenced = False
End With
End Sub

Printout of the Online Help
Automated Configuring

873

ActualPointTopIndex

11.05

5.7.11.18 PicUpTransparent Property

Description
Defines or returns the color which is going to be set to " Transparent " in the Bitmap
object (.bmp, .dib) assigned to the " Off " status. LONG read-write access.
The color is only set to " Transparent " if the value of the " PicUpUseTransColor "
property is " True " .
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Blue " assigned in the Bitmap object is to
be displayed as transparent in the " Off " status:
Sub RoundButtonConfiguration()
'VBA678
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicUpTransparent = RGB(0, 0, 255)
.PicUpUseTransColor = True
End With
End Sub

874

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.19 PicUpUseTransColor Property

Description
TRUE if the transparent color defined with the " PicUpTransparent " property is to be
used for the " Off " status. BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the color " Blue " assigned in the Bitmap object is to
be displayed as transparent in the " Off " status:
Sub RoundButtonConfiguration()
'VBA679
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.PicUpTransparent = RGB(0, 0, 255)
.PicUpUseTransColor = True
End With
End Sub

Printout of the Online Help
Automated Configuring

875

ActualPointTopIndex

11.05

5.7.11.20 PicUseTransColor Property

Description
TRUE if the transparent color defined with the " PicTransColor " property is to be
used for the " Deactivated " status. BOOLEAN read-write access.

Example
The " GraphicObjectConfiguration() " procedure accesses the properties of the
graphic object. In this example the color " Blue " assigned in the Bitmap object is to
be displayed as transparent:
Sub GraphicObjectConfiguration()
'VBA680
Dim objGraphicObject As HMIGraphicObject
Set objGraphicObject =
ActiveDocument.HMIObjects.AddHMIObject( " GraphicObject1 " ,
" HMIGraphicObject " )
With objGraphicObject
.PicTransColor = RGB(0, 0, 255)
.PicUseTransColor = True
End With
End Sub

876

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.21 PointCount Property

Description
Defines or returns the number of corner points in the case of the Polygon and
Polyline objects. Each corner point has position coordinates and is identified by an
index.

Example
For this example to work, insert a polyline called " Polyline1 " into the active picture:
The " PolyLineCoordsOutput " procedure then outputs the coordinates of all the
corner points in the polyline:
Sub PolyLineCoordsOutput()
'VBA681
Dim iPcIndex As Integer
Dim iPosX As Integer
Dim iPosY As Integer
Dim iIndex As Integer
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
Application.ActiveDocument.HMIObjects.AddHMIObject( " Poly
Line1 " , " HMIPolyLine " )
'
'Determine number of corners from " PolyLine1 " :
iPcIndex = objPolyLine.PointCount
'
'Output of x/y-coordinates from every corner:
For iIndex = 1 To iPcIndex
With objPolyLine
.index = iIndex
iPosX = .ActualPointLeft
iPosY = .ActualPointTop
MsgBox iIndex & " . corner: " & vbCrLf & " x-coordinate: " &
iPosX & vbCrLf & " y-coordinate: " & iPosY
End With
Next iIndex
End Sub

Printout of the Online Help
Automated Configuring

877

ActualPointTopIndex

11.05

5.7.11.22 Position Property

Description
The value for position determines the sequence of menu entries and icons in userdefined menus and toolbars or of user-defined menus in the menu bar. Read-write
access.
A value of " 1 " means position 1 (start).

Example
In the following example the position of all menu entries in the first user-defined
menu in the active picture will be output: So that this example will work, first carry
out the example shown under the heading " InsertSubMenu " .
Sub ShowPositionOfCustomMenuItems()
'VBA683
Dim objMenu As HMIMenu
Dim iMaxMenuItems As Integer
Dim iPosition As Integer
Dim iIndex As Integer
Set objMenu = ActiveDocument.CustomMenus(1)
iMaxMenuItems = objMenu.MenuItems.Count
For iIndex = 1 To iMaxMenuItems
iPosition = objMenu.MenuItems(iIndex).Position
MsgBox " Position of the " & iIndex & " . menuitem: "
& iPosition
Next iIndex
End Sub

878

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.23 PositiveValue Property

Description
Defines the value for the dynamic property if the configured tag returns a non-zero
value, or returns the value.

Usage
Use the BinaryResultInfo property to return the BinaryResultInfo object. In the
following example the radius of a circle will be dynamically configured using the
Dynamic dialog, a tag name will be assigned and the associated property values
will be assigned to both the binary value ranges:
Sub AddDynamicDialogToCircleRadiusTypeBool()
'VBA684
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_C " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBool
.BinaryResultInfo.NegativeValue = 20
.BinaryResultInfo.PositiveValue = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

879

ActualPointTopIndex

11.05

5.7.11.24 PredefinedAngels Property

Description
Defines or returns the depth display in the case of the 3DBarGraph object. Value
range 0 to 3.
Display

Assigned Value

Cavalier

0

Isometric

1

Axonometric

2

Freely Defined

3

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the depth display will be set to " Isometric " :
Sub HMI3DBarGraphConfiguration()
'VBA685
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
'Depth-angle a = 15 degrees
.AngleAlpha = 15
.PredefinedAngles = 1
'Depth-angle b = 45 degrees
.AngleBeta = 45
End With
End Sub

880

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.25 Pressed Property

Description
TRUE if the RoundButton object is pressed. BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the RoundButton object will be set to " Pressed " :
Sub RoundButtonConfiguration()
'VBA686
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.Pressed = True
End With
End Sub

Printout of the Online Help
Automated Configuring

881

ActualPointTopIndex

11.05

5.7.11.26 Process Property

Description
Defines or returns the default setting for the value to be displayed.
This value will be used in runtime if the associated tag is either not connected or
not updated when the picture is started.

Example
The " HMI3DBarGraphConfiguration() " procedure accesses the properties of the
3DBarGraph object. In this example the default value will be set to " 100 " :
Sub HMI3DBarGraphConfiguration()
'VBA687
Dim obj3DBar As HMI3DBarGraph
Set obj3DBar =
ActiveDocument.HMIObjects.AddHMIObject( " 3DBar1 " ,
" HMI3DBarGraph " )
With obj3DBar
'Depth-angle a = 15 degrees
.AngleAlpha = 15
'Depth-angle b = 45 degrees
.AngleBeta = 45
.Process = 100
End With
End Sub

882

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.27 ProfileName Property

Description
Returns the name of the specified application. Read access.

Example
In this example the name of the " Graphics Designer " application will be output:
Sub ShowProfileName()
'VBA688
MsgBox Application.ProfileName
End Sub

Printout of the Online Help
Automated Configuring

883

ActualPointTopIndex

11.05

5.7.11.28 ProgID Property

Description
Returns the ProgID of an ActiveX Control. STRING read access.

Example
In the following example the ActiveX Control " WinCC Gauge Control " is inserted in
the active picture. The ProgID is then output:
Sub AddActiveXControl()
'VBA689
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
" , " XGAUGE.XGaugeCtrl.1 " )
With ActiveDocument
.HMIObjects( " WinCC_Gauge " ).Top = 40
.HMIObjects( " WinCC_Gauge " ).Left = 40
MsgBox " ProgID of ActiveX-control: " &
.HMIObjects( " WinCC_Gauge " ).ProgID
End With
End Sub

884

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.29 ProjectName Property

Description
Returns the project name. Read access.

Example
In this example the name and type of the loaded project will be output.
Sub ShowProjectInfo()
'VBA690
Dim iProjectType As Integer
Dim strProjectName As String
Dim strProjectType As String
iProjectType = Application.ProjectType
strProjectName = Application.ProjectName
Select Case iProjectType
Case 0
strProjectType = " Single-User System "
Case 1
strProjectType = " Multi-User System "
Case 2
strProjectType = " Client System "
End Select
MsgBox " Projecttype: " & strProjectType & vbCrLf &
" Projectname: " & strProjectName
End Sub

Printout of the Online Help
Automated Configuring

885

ActualPointTopIndex

11.05

5.7.11.30 ProjectType Property

Description
Returns the project type. Value range from 0 to 2. Read access.
Project Type

Assigned Value

Single-user project

0

Multi-user project

1

Client project

2

Example
In this example the name and type of the loaded project will be output.
Sub ShowProjectInfo()
'VBA691
Dim iProjectType As Integer
Dim strProjectName As String
Dim strProjectType As String
iProjectType = Application.ProjectType
strProjectName = Application.ProjectName
Select Case iProjectType
Case 0
strProjectType = " Single-User System "
Case 1
strProjectType = " Multi-User System "
Case 2
strProjectType = " Client System "
End Select
MsgBox " Projecttype: " & strProjectType & vbCrLf &
" Projectname: " & strProjectName
End Sub

886

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.31 Properties Property

Description
Returns a Properties listing containing all the properties of the specified object.
Read access.
To return an element from the Properties listing you can use either the index
number or the name of the VBA property.
You must use the Properties property if, for example, you wish to access the
properties of objects located in a group object.

Example
Examples showing how to use the Properties property can be found in this
documentation under the following headings:


" Editing Objects with VBA "



" Group objects "



" Customized Objects "

Printout of the Online Help
Automated Configuring

887

ActualPointTopIndex

11.05

5.7.11.32 Prototype Property

Description
Returns the function heading of a script. The function heading is assigned by
default if no source code is configured.

Example
In the following example a button and a circle will be inserted in the active picture.
In runtime the radius of the circle will enlarge every time you click the button. In this
case only the prototype of the VB script is output:
Sub ExampleForPrototype()
'VBA692
Dim objButton As HMIButton
Dim objCircleA As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Set objCircleA =
ActiveDocument.HMIObjects.AddHMIObject( " CircleA " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircleA
.Top = 100
.Left = 100
End With
With objButton
.Top = 10
.Left = 10
.Width = 200
.Text = " Increase Radius "
End With
'On every mouseclick the radius have to increase:
Set objEvent = objButton.Events(1)
Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
MsgBox objVBScript.Prototype
End Sub

5.7.11.33 QualityCodeStateChecked Properties

888

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Description
TRUE, if the quality code of the specified tag is used in Dynamic dialog for
dynamization. BOOLEAN read-write access.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA???
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityCodeStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100
.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140

Printout of the Online Help
Automated Configuring

889

ActualPointTopIndex

11.05

.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

890

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.11.34 QualityCodeStateValues Property

Description
Returns the QualityCodeStateValues listing. Use the QualityCodeStateValues
property with the Item property to assign a value to the quality code status to be
used for dynamization.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA???
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityCodeStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100
.VALUE_BAD_PROCRELNOM = 110

Printout of the Online Help
Automated Configuring

891

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

892

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12 VBA Properties: R-S
5.7.12.1 Radius Property

Description
Defines or returns the radius in the case of the following objects:


Circle: Radius in pixels (0 to 999)



CircularArc: Radius in degrees (0 to 360)



PieSegment: Radius in degrees (0 to 360)



RoundButton: Radius in degrees (0 to 360)

Example
The " PieSegmentConfiguration() " procedure accesses the properties of the Pie
Segment. In this example the radius will be set to " 80 " :
Sub PieSegmentConfiguration()
'VBA693
Dim objPieSegment As HMIPieSegment
Set objPieSegment =
ActiveDocument.HMIObjects.AddHMIObject( " PieSegment1 " ,
" HMIPieSegment " )
With objPieSegment
.StartAngle = 40
.EndAngle = 180
.Radius = 80
End With
End Sub

Printout of the Online Help
Automated Configuring

893

ActualPointTopIndex

11.05

5.7.12.2 RadiusHeight Property

Description
Defines or returns the vertical radius in pixels (0 to 5000) in the case of elliptical
objects (Ellipse, EllipseArc, EllipseSegment).

Example
The " EllipseConfiguration() " procedure accesses the properties of the ellipse
object. In this example the vertical radius will be set to " 60 " :
Sub EllipseConfiguration()
'VBA694
Dim objEllipse As HMIEllipse
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " Ellipse1 " ,
" HMIEllipse " )
With objEllipse
.RadiusHeight = 60
.RadiusWidth = 40
End With
End Sub

894

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.3 RadiusWidth Property

Description
Defines or returns the horizontal radius in pixels (0 to 5000) in the case of elliptical
objects (Ellipse, EllipseArc, EllipseSegment).

Example
The " EllipseConfiguration() " procedure accesses the properties of the ellipse
object. In this example the horizontal radius will be set to " 40 " :
Sub EllipseConfiguration()
'VBA695
Dim objEllipse As HMIEllipse
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " Ellipse1 " ,
" HMIEllipse " )
With objEllipse
.RadiusHeight = 60
.RadiusWidth = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

895

ActualPointTopIndex

11.05

5.7.12.4 RangeTo Property

Description
Defines or returns the analog value range.

Example
An example showing how to use the RangeTo property can be found in this
documentation under the heading " AnalogResultInfos Object (Listing) " .

896

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.5 ReferenceRotationLeft Property

Description
Defines or returns the X coordinate of the reference point about which the object is
to be rotated in runtime.
The value of the X coordinate is relative to the width of the object. Specify the
value as a percentage starting from the left-hand edge of the rectangle surrounding
the object.

Example
The " PolyLineConfiguration() " procedure accesses the properties of the PolyLine
object. In this example the coordinates of the reference point will be set to 50% of
the object width.
Sub PolyLineConfiguration()
'VBA696
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
ActiveDocument.HMIObjects.AddHMIObject( " PolyLine1 " ,
" HMIPolyLine " )
With objPolyLine
.ReferenceRotationLeft = 50
.ReferenceRotationTop = 50
End With
End Sub

Printout of the Online Help
Automated Configuring

897

ActualPointTopIndex

11.05

5.7.12.6 ReferenceRotationTop Property

Description
Defines or returns the Y coordinate of the reference point about which the object is
to be rotated in runtime.
The value of the Y coordinate is relative to the width of the object. Specify the
value as a percentage starting from the top edge of the rectangle surrounding the
object.

Example
The " PolyLineConfiguration() " procedure accesses the properties of the PolyLine
object. In this example the coordinates of the reference point will be set to 50% of
the object width.
Sub PolyLineConfiguration()
'VBA697
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
ActiveDocument.HMIObjects.AddHMIObject( " PolyLine1 " ,
" HMIPolyLine " )
With objPolyLine
.ReferenceRotationLeft = 50
.ReferenceRotationTop = 50
End With
End Sub

898

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.7 Relevant Property

Description
TRUE if the object for forming the group display will be taken into account.
BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example the object for forming the group display will be taken into
account:
Sub GroupDisplayConfiguration()
'VBA698
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.Relevant = True
End With
End Sub

Printout of the Online Help
Automated Configuring

899

ActualPointTopIndex

11.05

5.7.12.8 ResultType Property

Description
Defines or returns the value range evaluation type in the Dynamic dialog.

Example
In the following example the radius of a circle will be dynamically configured using
the Dynamic dialog, a tag name will be assigned and the associated property
values will be assigned to both the binary value ranges:
Sub AddDynamicDialogToCircleRadiusTypeBinary()
'VBA699
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_C " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeBool
.BinaryResultInfo.NegativeValue = 20
.BinaryResultInfo.PositiveValue = 40
End With
End Sub

900

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.9 RightComma Property

Description
Defines or returns the number of digits to the right of the decimal point (0 to 20) for
the BarGraph object.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the number of digits to the right of the decimal
point will be limited to 4.
Sub BarGraphConfiguration()
'VBA700
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.RightComma = 4
End With
End Sub

Printout of the Online Help
Automated Configuring

901

ActualPointTopIndex

11.05

5.7.12.10 RotationAngle Property

Description
Defines or returns the rotation angle of the Line, Polygon and Polyline objects in
degrees.
In runtime the object will be rotated clockwise about the reference point by the
value entered (starting from the configured starting position).

Example
The " PolyLineConfiguration() " procedure accesses the properties of the PolyLine
object. In this example the object will be rotated by 45° in runtime:
Sub PolyLineConfiguration()
'VBA701
Dim objPolyLine As HMIPolyLine
Set objPolyLine =
ActiveDocument.HMIObjects.AddHMIObject( " PolyLine1 " ,
" HMIPolyLine " )
With objPolyLine
.ReferenceRotationLeft = 50
.ReferenceRotationTop = 50
.RotationAngle = 45
End With
End Sub

902

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.11 RoundCornerHeight Property

Description
Defines or returns the corner radius of the RoundRectangle object.
Enter the value as a percentage of half the height of the object.

Example
The " RoundRectangleConfiguration() " procedure accesses the properties of the
RoundRectangle object. In this example the corner radius will be set to 25%
(height) and 50% (width).
Sub RoundRectangleConfiguration()
'VBA702
Dim objRoundRectangle As HMIRoundRectangle
Set objRoundRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " RoundRectangle1 "
, " HMIRoundRectangle " )
With objRoundRectangle
.RoundCornerHeight = 25
.RoundCornerWidth = 50
End With
End Sub

Printout of the Online Help
Automated Configuring

903

ActualPointTopIndex

11.05

5.7.12.12 RoundCornerWidth Property

Description
Defines or returns the corner radius of the RoundRectangle object.
Enter the value as a percentage of half the width of the object.

Example
The " RoundRectangleConfiguration() " procedure accesses the properties of the
RoundRectangle object. In this example the corner radius will be set to 25%
(height) and 50% (width).
Sub RoundRectangleConfiguration()
'VBA703
Dim objRoundRectangle As HMIRoundRectangle
Set objRoundRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " RoundRectangle1 "
, " HMIRoundRectangle " )
With objRoundRectangle
.RoundCornerHeight = 25
.RoundCornerWidth = 50
End With
End Sub

904

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.13 SameSize Property

Description
TRUE if all four buttons on the GroupDisplay object have the same size.
BOOLEAN read-write access.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example all four buttons will have the same size.
Sub GroupDisplayConfiguration()
'VBA704
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.SameSize = True
End With
End Sub

Printout of the Online Help
Automated Configuring

905

ActualPointTopIndex

11.05

5.7.12.14 ScaleColor Property

Description
Defines or returns the color of the scale. LONG read-write access.
The " Scaling " property must be set to " True " for the color to be displayed.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the scale will be displayed and the scale color will
be set to " Red " :
Sub BarGraphConfiguration()
'VBA705
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Scaling = True
.ScaleColor = RGB(255, 0, 0)
End With
End Sub

906

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.15 ScaleTicks Property

Description
Defines or returns the number of scale sections for the BarGraph object.
A scale section is a part of the scale bounded by two long scale strokes or division
ticks. If you assign a value of " 0 " to the property, the appropriate scale marks will
be calculated automatically.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the number of scale sections will be set to " 10 " .
Sub BarGraphConfiguration()
'VBA706
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Scaling = True
.ScaleTicks = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

907

ActualPointTopIndex

11.05

5.7.12.16 Scaling Property

Description
TRUE if a scale is also used to display the values in the case of the BarGraph
object. BOOLEAN read-write access.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the scale will be displayed and the scale color will
be set to " Red " :
Sub BarGraphConfiguration()
'VBA707
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Scaling = True
.ScaleColor = RGB(255, 0, 0)
End With
End Sub

908

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.17 ScalingType Property

Description
Defines or returns the type of bar scaling. Value range from 0 to 2.
The " Scaling " property must be set to " True " for the color to be displayed.
Bar Scaling

Assigned Value

Linear

0

Logarithmic

1

Automatic

2

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the bar scaling will be set to " Linear " :
Sub BarGraphConfiguration()
'VBA708
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.ScalingType = 0
.Scaling = True
End With
End Sub

Printout of the Online Help
Automated Configuring

909

ActualPointTopIndex

11.05

5.7.12.18 ScriptType Property

Description
Returns the script type (C or VBS) which was used to make a property or event
dynamic. Read access.

Example
In the following example a button and a circle will be inserted in the active picture.
In runtime the radius of the circle will enlarge every time you click the button. In this
case the script type will be output:
Sub ExampleForPrototype()
'VBA709
Dim objButton As HMIButton
Dim objCircleA As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Dim strScriptType As String
Set objCircleA =
ActiveDocument.HMIObjects.AddHMIObject( " CircleA " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircleA
.Top = 100
.Left = 100
End With
With objButton
.Top = 10
.Left = 10
.Width = 200
.Text = " Increase Radius "
End With
'On every mouseclick the radius have to increase:
Set objEvent = objButton.Events(1)
Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
Select Case objVBScript.ScriptType
Case 0
strScriptType = " VB-Skript is used "

910

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

Case 1
strScriptType = " C-Skript is used "
End Select
MsgBox strScriptType
End Sub

Printout of the Online Help
Automated Configuring

911

ActualPointTopIndex

11.05

5.7.12.19 ScrollBars Property

Description
TRUE if the picture window has scroll bars in runtime. BOOLEAN read-write
access.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA710
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

912

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.20 ScrollPosX
Defines or returns the X position of the scroll bars for the View object.

Example
In the following example a copy of the active picture is created and then activated.
The position of the scroll bars will be set to 40 (X) and 10 (Y):
Sub CreateViewAndActivateView()
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
objView.ScrollPosX = 40
objView.ScrollPosY = 10
End Sub

Printout of the Online Help
Automated Configuring

913

ActualPointTopIndex

11.05

5.7.12.21 ScrollPosY Property

Description
Defines or returns the Y position of the scroll bars for the View object.

Example
In the following example a copy of the active picture is created and then activated.
The position of the scroll bars will be set to 40 (X) and 10 (Y):
Sub CreateViewAndActivateView()
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
objView.ScrollPosX = 40
objView.ScrollPosY = 10
End Sub

914

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.22 ScrollPositionX Property

Description
Specifies the horizontal positioning of the scroll bar in a picture window with slider,
or returns its value.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA808
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ScrollPositionX = 50
.ScrollPositionY = 50
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

Printout of the Online Help
Automated Configuring

915

ActualPointTopIndex

11.05

5.7.12.23 ScrollPositionY Property

Description
Specifies the vertical positioning of the scroll bar in a picture window with slider, or
returns its value.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA809
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ScrollPositionX = 50
.ScrollPositionY = 50
.ServerPrefix = " "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

916

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.24 SelBGColor Property

Description
Defines or returns the background color for the selected entry in the case of the
TextList object. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the appropriate
decimal value for each of the three RGB values (in the range 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the background color for the selected entry will be set to
" Red " :
Sub TextListConfiguration()
Dim objTextList As HMITextList
'
'Neue TextListe ins aktuelle Bild einfügen:
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.SelBGColor = RGB (255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

917

ActualPointTopIndex

11.05

5.7.12.25 Selected Property

Description
TRUE if an object is selected in the picture. BOOLEAN read-write access.

Example
In the following example two new objects will be inserted in the active picture and
then selected:
Sub SelectObjects()
'VBA714
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objGroup As HMIGroup
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
With objCircle
.Top = 40
.Left = 40
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 80
.Selected = True
End With
MsgBox " Objects selected! "
End Sub

918

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.26 Selection Property

Description
Returns a listing containing all the objects selected in the specified picture.
To return an element from the Selection listing you can use either the index
number or the object name.
You can use the Selection property, for example, to select all the objects in the
picture.

Example
In the following example all the objects in the active picture are selected:
Sub SelectAllObjectsInActiveDocument()
'VBA715
ActiveDocument.Selection.SelectAll
End Sub

Printout of the Online Help
Automated Configuring

919

ActualPointTopIndex

11.05

5.7.12.27 SelTextColor Property

Description
Defines or returns the text color for the selected entry in the TextList object. LONG
read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the text color for the selected entry will be set to " Yellow " :
Sub TextListConfiguration()
'VBA716
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.SelTextColor = RGB(255, 255, 0)
End With
End Sub

920

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.28 ServerName Property

Description
Returns the name of the specified ActiveX Control. Read access.

Example
In the following example the ActiveX Control " WinCC Gauge Control " will be
inserted in the active picture and the name of the ActiveX Control will be output:
Sub AddActiveXControl()
'VBA717
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
" , " XGAUGE.XGaugeCtrl.1 " )
With objActiveXControl
.Top = 40
.Left = 60
MsgBox .Properties( " ServerName " ).value
End With
End Sub

Printout of the Online Help
Automated Configuring

921

ActualPointTopIndex

11.05

5.7.12.29 ServerPrefix Property

Description
Defines the server which will hold the picture that is displayed in the picture window
in runtime, or returns the name of the server.
Specify the server name followed by two colons: " & lt; Server_name & gt; :: " . No check is
made on whether the server actually exists.

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA718
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5
.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " my_Server:: "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

922

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.30 ShortCut Property

Description
Defines or returns a shortcut key sequence for a user-defined menu entry or userdefined icon.
The following keys are permitted in combination with & lt; CTRL & gt; , & lt; ALT & gt; and
& lt; SHIFT & gt; :


The function keys & lt; F1 & gt; to & lt; F12 & gt;



The letter keys & lt; A & gt; to & lt; Z & gt; and the number keys & lt; 0 & gt; to & lt; 9 & gt;

The following are not supported: the keys on the alphanumeric keypad, the cursor
keys (e.g. & lt; Page Up & gt; ) and the remaining function keys such as & lt; RETURN & gt; and
& lt; ESC & gt; . No distinction is made between upper and lower case. Shortcut key
sequences with two or more letters or numbers auch as " CTRL+A+B " are not
permitted. However, it is allowed to combine two supplementary keys, e.g.
" CTRL+ALT+A " .

Notes on using the ShortCut property
The key sequences used must be unique within the user-defined menus and
toolbars in a picture. Key sequences that you configure with VBA have priority over
any key sequences that may be present in the Graphics Designer. Within the userdefined menus and toolbars, picture-specific key sequences have priority over
application-specific key sequences.
Note
Shortcut key sequences are only executed if the menu entry or the icon is visible
and active.
Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line. The first menu entry receives the shortcut
key sequence Ctrl & lt; +Shift+ & gt; M:
Sub CreateDocumentMenus()
'VBA719
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
'Add menu to menubar:
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )

Printout of the Online Help
Automated Configuring

923

ActualPointTopIndex

11.05

'
'Add menuitems to the new menu:
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " & My first Menuitem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " My second Menuitem " )
'
'Add seperator to menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
'Add submenu to the menu:
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " My first submenu " )
'
'Add menuitems to the submenu:
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " My first submenuitem " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " My second submenuitem " )
'
ActiveDocument.CustomMenus( " DocMenu1 " ).MenuItems(1).Shor
tCut = " STRG+SHIFT+M "
End Sub

924

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.31 SignificantMask Property

Description
Needed in runtime for displaying the active message class with the highest priority
in the GroupDisplay object.
The value assigned to the SignificantMask property represents an output value
which is internal to the system and requires no specific configuration on the part of
the user. Updating takes place in runtime by clicking on the object.

Example
--

Printout of the Online Help
Automated Configuring

925

ActualPointTopIndex

11.05

5.7.12.32 Size Property

Description
Defines or returns the font size in points for a language-dependent font.

Example
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA721
Dim colLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " DefText "
Set colLangFonts = objButton.LDFonts
'
'Set font-properties for french:
With colLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'
'Set font-properties for english:
With colLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

926

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.33 Sizeable Property

Description
TRUE if the size of the ApplicationWindow and PictureWindow objects can be
changed in runtime. BOOLEAN read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example it is intended that the application window can
be resized in runtime:
Sub ApplicationWindowConfig()
'VBA722
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow1 " ,
" HMIApplicationWindow " )
With objAppWindow
.Sizeable = True
End With
End Sub

Printout of the Online Help
Automated Configuring

927

ActualPointTopIndex

11.05

5.7.12.34 SmallChange Property

Description
Defines by how many steps the slider can be moved with a single mouse click, or
returns this value.

Example
The " SliderConfiguration() " procedure accesses the properties of the slider. In this
example the number of steps will be set to " 4 " :
Sub SliderConfiguration()
'VBA723
Dim objSlider As HMISlider
Set objSlider =
ActiveDocument.HMIObjects.AddHMIObject( " SliderObject1 " ,
" HMISlider " )
With objSlider
.SmallChange = 4
End With
End Sub

928

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.35 SnapToGrid Property

Description
TRUE if objects in the picture are aligned on the grid (which is invisible).
BOOLEAN read-write access.

Example
In the following example, the alignment of objects in the active picture on the grid is
activated:
Sub ActivateSnapToGrid()
'VBA724
ActiveDocument.SnapToGrid = True
End Sub

Printout of the Online Help
Automated Configuring

929

ActualPointTopIndex

11.05

5.7.12.36 SourceLink Property

Description
Returns the Source object. Use the SourceLink property to configure the source
object in the case of a direct connection.

Example
In the following example the X position of " Rectangle_A " is copied to the Y position
of " Rectangle_B " in runtime by clicking on the button:
Sub DirectConnection()
'VBA725
Dim objButton As HMIButton
Dim objRectangleA As HMIRectangle
Dim objRectangleB As HMIRectangle
Dim objEvent As HMIEvent
Dim objDirConnection As HMIDirectConnection
Set objRectangleA =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_A " ,
" HMIRectangle " )
Set objRectangleB =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle_B " ,
" HMIRectangle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objRectangleA
.Top = 100
.Left = 100
End With
With objRectangleB
.Top = 250
.Left = 400
.BackColor = RGB(255, 0, 0)
End With
With objButton
.Top = 10
.Left = 10
.Width = 100
.Text = " SetPosition "
End With
'

930

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

'Directconnection is initiated by mouseclick:
Set objDirConnection =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeDirectConnection)
With objDirConnection
'Sourceobject: Property " Top " of Rectangle_A
.SourceLink.Type = hmiSourceTypeProperty
.SourceLink.ObjectName = " Rectangle_A "
.SourceLink.AutomationName = " Top "
'
'Targetobject: Property " Left " of Rectangle_B
.DestinationLink.Type = hmiDestTypeProperty
.DestinationLink.ObjectName = " Rectangle_B "
.DestinationLink.AutomationName = " Left "
End With
End Sub

Printout of the Online Help
Automated Configuring

931

ActualPointTopIndex

11.05

5.7.12.37 SourceCode Property

Description
Defines or returns the source code of a C script or VB script.
If you assign a C script to the SourceCode property, you must enter only the
program code located between the braces ( " {} " ).
If you assign a VB script to the SourceCode property, you must enter only the
program code located between the Sub and EndSub keywords.
Note:
If you use single quote marks (') or double quote marks ( " ) in the program code,
you must enter an additional quote mark in front of every single or double quote
mark so that the program code can be correctly interpreted in the VBA editor.
The Compiled property returns TRUE if the source code was successfully
compiled.

Example
In the following example a button and a circle will be inserted in the active picture.
In runtime the radius of the circle will enlarge every time you click the button. A VB
script will be used for this purpose:
Sub IncreaseCircleRadiusWithVBScript()
'VBA726
Dim objButton As HMIButton
Dim objCircleA As HMICircle
Dim objEvent As HMIEvent
Dim objVBScript As HMIScriptInfo
Dim strCode As String
strCode = " Dim objCircle " & vbCrLf & " Set objCircle = "
strCode = strCode &
" hmiRuntime.ActiveScreen.ScreenItems( " " CircleVB " " ) "
strCode = strCode & vbCrLf & " objCircle.Radius =
objCircle.Radius + 5 "
Set objCircleA =
ActiveDocument.HMIObjects.AddHMIObject( " CircleVB " ,
" HMICircle " )
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
With objCircleA

932

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.Top = 100
.Left = 100
End With
With objButton
.Top = 10
.Left = 10
.Width = 200
.Text = " Increase Radius "
End With
'
'On every mouseclick the radius have to increase:
Set objEvent = objButton.Events(1)
Set objVBScript =
objButton.Events(1).Actions.AddAction(hmiActionCreationT
ypeVBScript)
objVBScript.SourceCode = strCode
Select Case objVBScript.Compiled
Case True
MsgBox " Compilation ok! "
Case False
MsgBox " Error on compilation! "
End Select
End Sub

Printout of the Online Help
Automated Configuring

933

ActualPointTopIndex

11.05

5.7.12.38 StartAngle Property

Description
Defines or returns the start of the object for the CircularArc, EllipseArc,
EllipseSegment and PieSegment objects. The specification is expressed in
degrees clockwise starting at 12:00 hrs.

Example
The " PieSegmentConfiguration() " procedure accesses the properties of the Pie
Segment. In this example the pie segment begins at 40° and ends at 180°:
Sub PieSegmentConfiguration()
'VBA727
Dim PieSegment As HMIPieSegment
Set PieSegment =
ActiveDocument.HMIObjects.AddHMIObject( " PieSegment1 " ,
" HMIPieSegment " )
With PieSegment
.StartAngle = 40
.EndAngle = 180
End With
End Sub

934

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.39 StatusText Property

Description
Defines or returns the text that will be displayed in the status bar when you point
with the mouse to a user-defined menu entry or user-defined icon.

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line. A status bar entry will be defined for each
menu entry:
Sub CreateDocumentMenus()
'VBA728
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
'Add menu:
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
'Add menuitems to custom-menu:
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " My first menuitem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " My second menuitem " )
'
'Add seperator to custom-menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
'Add submenu to custom-menu:
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " My first submenu " )
'
'Add menuitems to submenu:
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " My first submenuitem " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " My second submenuitem " )
'

Printout of the Online Help
Automated Configuring

935

ActualPointTopIndex

11.05

'Assign statustexts to every menuitem
With objDocMenu
.MenuItems(1).StatusText = " My first menuitem "
.MenuItems(2).StatusText = " My second menuitem "
.MenuItems(4).SubMenu.Item(1).StatusText = " My
first submenuitem "
.MenuItems(4).SubMenu.Item(2).StatusText = " My
second submenuitem "
End With
End Sub

936

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.12.40 SubMenu Property

Description
Returns a MenuItems listing if the specified object is the " SubMenu " type.
Use the SubMenu listing if you wish to create a submenu in a user-defined menu.

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line:
Sub CreateDocumentMenus()
'VBA730
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
'Add menu:
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
'Add menuitems to custom-menu:
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " My first menuitem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " My second menuitem " )
'
'Add seperator to custom-menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
'Add submenu to custom-menu:
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " My first submenu " )
'
'Add menuitems to submenu:
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " My first submenuitem " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " My second submenuitem " )
End Sub

Printout of the Online Help
Automated Configuring

937

ActualPointTopIndex

11.05

5.7.12.41 SymbolLibraries Property

Description
Returns a SymbolLibraries listing containing objects of the " SymbolLibrary " type.
Use SymbolLibraries(1) to return the " Global Library " . Use SymbolLibraries(2) to
return the " Project Library " .

Example
In the following example the names of the libraries will be output:
Sub ShowSymbolLibraries()
'VBA731
Dim colSymbolLibraries As HMISymbolLibraries
Dim objSymbolLibrary As HMISymbolLibrary
Set colSymbolLibraries = Application.SymbolLibraries
For Each objSymbolLibrary In colSymbolLibraries
MsgBox objSymbolLibrary.Name
Next objSymbolLibrary
End Sub

938

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13 VBA Properties: T
5.7.13.1 TabOrderSwitch Property

Description
Defines or returns the position of the object in the TAB sequence.

Example
In this example two I/O fields will be inserted in the active picture and the TAB
sequence will then be defined:
Sub IOFieldConfig()
'VBA732
Dim objIOField1 As HMIIOField
Dim objIOField2 As HMIIOField
Set objIOField1 =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
Set objIOField2 =
ActiveDocument.HMIObjects.AddHMIObject( " IOField2 " ,
" HMIIOField " )
With objIOField1
.Top = 10
.Left = 10
.TabOrderSwitch = 1
End With
With objIOField2
.Top = 100
.Left = 10
.TabOrderSwitch = 2
End With
End Sub

Printout of the Online Help
Automated Configuring

939

ActualPointTopIndex

11.05

5.7.13.2 TabOrderAllHMIObjects Property

Description
TRUE if all the objects in a picture are to be included in the configured TAB
sequence. BOOLEAN read-write access.

Example
The " ConfigureTabOrder() " procedure defines which objects in the active picture
are to be included in the configured TAB sequence. In this example all the objects
will be included in the TAB sequence:
Sub ConfigureTabOrder()
'VBA733
With ActiveDocument
.TABOrderAllHMIObjects = True
.TABOrderKeyboard = False
.TABOrderMouse = False
.TABOrderOtherAction = False
End With
End Sub

940

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.3 TabOrderAlpha Property

Description
Defines or returns the position of the object in the TAB sequence for the alpha tab
order cursor.

Example
In this example two I/O fields will be inserted in the active picture and the TAB
sequence will then be defined:
Sub IOFieldConfig()
'VBA734
Dim objIOField1 As HMIIOField
Dim objIOField2 As HMIIOField
Set objIOField1 =
ActiveDocument.HMIObjects.AddHMIObject( " IOField1 " ,
" HMIIOField " )
Set objIOField2 =
ActiveDocument.HMIObjects.AddHMIObject( " IOField2 " ,
" HMIIOField " )
With objIOField1
.Top = 10
.Left = 10
.TabOrderAlpha = 1
End With
With objIOField2
.Top = 100
.Left = 10
.TabOrderAlpha = 2
End With
End Sub

Printout of the Online Help
Automated Configuring

941

ActualPointTopIndex

11.05

5.7.13.4 TabOrderKeyboard Property

Description
TRUE if objects with a keyboard operation event configured to them are to be
included in the configured TAB sequence. BOOLEAN read-write access.

Example
The " ConfigureTabOrder() " procedure defines which objects in the active picture
are to be included in the configured TAB sequence. In this example objects with a
keyboard operation will be included in the TAB sequence:
Sub ConfigureTabOrder()
'VBA735
With ActiveDocument
.TABOrderAllHMIObjects = True
.TABOrderKeyboard = False
.TABOrderMouse = False
.TABOrderOtherAction = False
End With
End Sub

942

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.5 TabOrderMouse Property

Description
TRUE if objects with a mouse operation event configured to them are to be
included in the configured TAB sequence. BOOLEAN read-write access.

Example
The " ConfigureTabOrder() " procedure defines which objects in the active picture
are to be included in the configured TAB sequence. In this example objects with a
mouse operation event will be included in the TAB sequence:
Sub ConfigureTabOrder()
'VBA736
With ActiveDocument
.TABOrderAllHMIObjects = True
.TABOrderKeyboard = False
.TABOrderMouse = False
.TABOrderOtherAction = False
End With
End Sub

Printout of the Online Help
Automated Configuring

943

ActualPointTopIndex

11.05

5.7.13.6 TabOrderOtherAction Property

Description
TRUE if objects with an event other than a mouse or keyboard operation event
configured to them are to be included in the configured TAB sequence. BOOLEAN
read-write access.

Example
The " ConfigureTabOrder() " procedure defines which objects in the active picture
are to be included in the configured TAB sequence. In this example objects with
events other than a mouse or keyboard operation will be included in the TAB
sequence:
Sub ConfigureTabOrder()
'VBA737
With ActiveDocument
.TABOrderAllHMIObjects = True
.TABOrderKeyboard = False
.TABOrderMouse = False
.TABOrderOtherAction = False
End With
End Sub

944

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.7 Tag Property

Description
Defines or returns information text for a user-defined menu entry or user-defined
icon. You can use the Tag property for example to briefly describe what the menu
entry does.

Example
In the following example a user-defined menu with two menu entries and a
submenu with two entries will be created in the active picture. The submenu will be
visually distinguished by a dividing line:
Sub CreateDocumentMenus()
'VBA738
Dim objDocMenu As HMIMenu
Dim objMenuItem As HMIMenuItem
Dim objSubMenu As HMIMenuItem
'
'Add menu:
Set objDocMenu =
ActiveDocument.CustomMenus.InsertMenu(1, " DocMenu1 " ,
" Doc_Menu_1 " )
'
'Add menuitems to custom-menu:
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(1,
" dmItem1_1 " , " My first menuitem " )
Set objMenuItem = objDocMenu.MenuItems.InsertMenuItem(2,
" dmItem1_2 " , " My second menuitem " )
'
'Add seperator to custom-menu:
Set objMenuItem =
objDocMenu.MenuItems.InsertSeparator(3, " dSeparator1_3 " )
'
'Add submenu to custom-menu:
Set objSubMenu = objDocMenu.MenuItems.InsertSubMenu(4,
" dSubMenu1_4 " , " My first submenu " )
'
'Add menuitems to submenu:
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(5,
" dmItem1_5 " , " My first submenuitem " )
Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6,
" dmItem1_6 " , " My second submenuitem " )
'

Printout of the Online Help
Automated Configuring

945

ActualPointTopIndex

11.05

'To place an additional information:
With objDocMenu
.MenuItems(1).Tag = " This is the first menuitem "
End With
End Sub

946

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.8 TagPrefix Property

Description
Defines or returns the tag prefix for all the tags contained in the Picture Window
object.
Example:
The picture " InputOutput " is to be displayed in the picture window. The picture
" InputOutput " contains three I/O fields which are linked to a structure tag. The
structure tag consists of the elements IO1, IO2, IO3; one element for each I/O field.
Three such structure tags have been define in the project, with structure names
Struct1, Struct2 and Struct3.
The tag prefix is in this case the structure name followed by a point. Specify the tag
prefix as, say, Struct2. (the point is necessary in order to address the elements of
the structure tag as structure elements in a syntactically correct way). The I/O
fields in the picture " InputOutput " are then linked to the elements in structure tag
Struct2:
Tag prefix: " Struct2. "


Output value (first I/O field): IO1



Output value (second I/O field): IO2



Output value (third I/O field): IO3

The current tag connection in the picture window is then


Output value (first I/O field): Struct2.IO1



Output value (second I/O field): Struct2.IO2



Output value (third I/O field): Struct2.IO3

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be configured:
Sub PictureWindowConfig()
'VBA739
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.AdaptPicture = False
.AdaptSize = False
.Caption = True
.CaptionText = " Picturewindow in runtime "
.OffsetLeft = 5

Printout of the Online Help
Automated Configuring

947

ActualPointTopIndex

11.05

.OffsetTop = 10
'Replace the picturename " Test.PDL " with the name
of
'an existing document from your " GraCS " -Folder of
your active project
.PictureName = " Test.PDL "
.ScrollBars = True
.ServerPrefix = " my_Server:: "
.TagPrefix = " Struct. "
.UpdateCycle = 5
.Zoom = 100
End With
End Sub

948

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.9 Text Property

Description
Defines or returns the label for an object.

Example
The " ButtonConfiguration() " procedure accesses the properties of the button. In
this example the label will be defined:
Sub ButtonConfiguration()
'VBA740
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " Button1 " ,
" HMIButton " )
With objButton
.Text = " Button1 "
End With
End Sub

Printout of the Online Help
Automated Configuring

949

ActualPointTopIndex

11.05

5.7.13.10 Toggle Property

Description
TRUE if the round button is intended to latch down when activated in runtime.
BOOLEAN read-write access.

Example
The " RoundButtonConfiguration() " procedure accesses the properties of the
RoundButton. In this example the round button is intended to latch down when
pressed in runtime:
Sub RoundButtonConfiguration()
'VBA741
Dim objRoundButton As HMIRoundButton
Set objRoundButton =
ActiveDocument.HMIObjects.AddHMIObject( " RButton1 " ,
" HMIRoundButton " )
With objRoundButton
.Toggle = True
End With
End Sub

950

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.11 ToleranceHigh Property

Description
Defines or returns the limit value for " Tolerance High " .
Define the type of evaluation (in percent or absolute) with the aid of the
TypeToleranceHigh property.
Limit value monitoring only takes effect if the CheckToleranceHigh property is set
to " True " .

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of limit
values. In this example the limit value for " Tolerance High " will be configured:
Sub BarGraphLimitConfiguration()
'VBA742
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeToleranceHigh = False
'Activate monitoring
.CheckToleranceHigh = True
'Set barcolor = " yellow "
.ColorToleranceHigh = RGB(255, 255, 0)
'Set upper limit to " 40 "
.ToleranceHigh = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

951

ActualPointTopIndex

11.05

5.7.13.12 ToleranceLow Property

Description
Defines or returns the limit value for " Tolerance Low " .
Define the type of evaluation (in percent or absolute) with the aid of the
TypeToleranceLow property.
Limit value monitoring only takes effect if the CheckToleranceLow property is set to
" True " .

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of limit
values. In this example the limit value for " Tolerance Low " will be configured:
Sub BarGraphLimitConfiguration()
'VBA743
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeToleranceLow = False
'Activate monitoring
.CheckToleranceLow = True
'Set barcolor = " red "
.ColorToleranceLow = RGB(255, 0, 0)
'Set lower limit to " 40 "
.ToleranceLow = 40
End With
End Sub

952

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.13 ToolbarItems Property

Description
Returns a listing containing all the elements (icons and separation lines) of a userdefined toolbar.

Example
In the following example a user-defined toolbar with two icons is created in the
active picture. These icons are separated by a dividing line:
Sub AddDocumentSpecificCustomToolbar()
'VBA744
Dim objToolbar As HMIToolbar
Dim objToolbarItem As HMIToolbarItem
Set objToolbar =
ActiveDocument.CustomToolbars.Add( " DocToolbar " )
'
'Add symbol-icon to userdefined toolbar
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(1, " tItem1_1 " ,
" My first symbol-icon " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertToolbarItem(3, " tItem1_3 " ,
" My second symbol-icon " )
Set objToolbarItem =
objToolbar.ToolbarItems.InsertSeparator(2,
" tSeparator1_2 " )
End Sub

Printout of the Online Help
Automated Configuring

953

ActualPointTopIndex

11.05

5.7.13.14 TooltipText Property

Description
Defines or returns the text that will be displayed as a Tooltip when you run the
mouse over an object (HMIObject, icon).

Example
The " RectangleConfiguration() " procedure accesses the properties of the
Rectangle object. In this example a Tooltip text will be assigned to the rectangle:
Sub RectangleConfiguration()
'VBA745
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.ToolTipText = " This is a rectangle "
End With
End Sub

954

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.15 Top Property

Description
Defines or returns the Y coordinate of an object (measured from the top left-hand
edge of the picture) in pixels. The Y coordinate refers to the top left corner of the
rectangle surrounding the object.

Example
The " RectangleConfiguration() " procedure accesses the properties of the
Rectangle object. In this example the rectangle will be set to position 10/40:
Sub RectangleConfiguration()
'VBA746
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
.Left = 10
.Top = 40
End With
End Sub

Printout of the Online Help
Automated Configuring

955

ActualPointTopIndex

11.05

5.7.13.16 TopConnectedObjectName Property

Description
Returns the name of the end object to which the connector is connected. Read
access.

Example:
An example showing how to use the BottomConnectedObjectName property can
be found in this documentation under the heading " ObjConnection Object " .

956

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.17 TopConnectedConnectionPointIndex Property

Description
Returns the connection point on the object to which the connector is connected.
Connection Point

Assigned Value

Up

0

Right

1

Down

2

Left

3

Example
An example showing how to use the BottomConnectedObjectName property can
be found in this documentation under the heading " ObjConnection Object " .

Printout of the Online Help
Automated Configuring

957

ActualPointTopIndex

11.05

5.7.13.18 Trend Property

Description
TRUE if the trend or tendency of the measured value being monitored (rising or
falling) is to be indicated by a little arrow. BOOLEAN read-write access.
Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the trend of the measured value will be indicated:
Sub BarGraphConfiguration()
'VBA747
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.trend = True
End With
End Sub

958

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.19 TrendColor Property

Description
Defines or returns the color of the trend display.
The trend display indicates the tendency of the measured value being monitored
(rising or falling) by means of a little arrow. The Trend property must be set to
" True " in order for the trend display to be activated. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the trend in the measured value will be indicated.
The trend display will be set to " Red " :
Sub BarGraphConfiguration()
'VBA748
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.trend = True
.TrendColor = RGB(255, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

959

ActualPointTopIndex

11.05

5.7.13.20 Trigger Property

Description
Returns a Trigger object. Use the Trigger property when making a property
dynamic with the aid of a script.

Example
In this example the " Radius " property of a circle will be made dynamic with the aid
of a C script (the output value sets the radius):
Sub AddDynamicAsCSkriptToProperty()
'VBA749
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " myCircle " ,
" HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
.Trigger.Type = hmiTriggerTypeStandardCycle
.Trigger.CycleType = hmiCycleType_2s
.Trigger.Name = " Trigger1 "
End With
End Sub

960

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.21 Type Property

Description
Returns or defines the type of an object.
The object type is returned as either a string or and integer.

Example
The " RectangleConfiguration() " procedure accesses the properties of the
Rectangle object. In this example the object type will be output:
Sub RectangleConfiguration()
'VBA750
Dim objRectangle As HMIRectangle
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " Rectangle1 " ,
" HMIRectangle " )
With objRectangle
MsgBox " Objecttype: " & .Type
End With
End Sub

Printout of the Online Help
Automated Configuring

961

ActualPointTopIndex

11.05

5.7.13.22 TypeAlarmHigh Property

Description
TRUE if the high limit value at which the alarm is triggered will be evaluated in
percentage terms. FALSE if the evaluation will be in absolute terms. BOOLEAN
read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 50 " .
Sub BarGraphLimitConfiguration()
'VBA751
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeAlarmHigh = False
'Activate monitoring
.CheckAlarmHigh = True
'Set barcolor = " yellow "
.ColorAlarmHigh = RGB(255, 255, 0)
'Set upper limit = " 50 "
.AlarmHigh = 50
End With
End Sub

962

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.23 TypeAlarmLow Property

Description
TRUE if the low limit value at which the alarm is triggered will be evaluated in
percentage terms. FALSE if the evaluation will be in absolute terms. BOOLEAN
read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 10 " .
Sub BarGraphLimitConfiguration()
'VBA752
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeAlarmLow = False
'Activate monitoring
.CheckAlarmLow = True
'Set barcolor = " yellow "
.ColorAlarmLow = RGB(255, 255, 0)
'Set lower limit = " 10 "
.AlarmLow = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

963

ActualPointTopIndex

11.05

5.7.13.24 TypeLimitHigh4 Property

Description
TRUE if the high limit value " Reserve 4 " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 70 " .
Sub BarGraphLimitConfiguration()
'VBA753
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeLimitHigh4 = False
'Activate monitoring
.CheckLimitHigh4 = True
'Set barcolor = " red "
.ColorLimitHigh4 = RGB(255, 0, 0)
'Set upper limit = " 70 "
.LimitHigh4 = 70
End With
End Sub

964

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.25 TypeLimitHigh5 Property

Description
TRUE if the high limit value " Reserve 5 " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 80 " .
Sub BarGraphLimitConfiguration()
'VBA754
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeLimitHigh5 = False
'Activate monitoring
.CheckLimitHigh5 = True
'Set barcolor = " black "
.ColorLimitHigh5 = RGB(0, 0, 0)
'Set upper limit = " 70 "
.LimitHigh5 = 70
End With
End Sub

Printout of the Online Help
Automated Configuring

965

ActualPointTopIndex

11.05

5.7.13.26 TypeLimitLow4 Property

Description
TRUE if the low limit value " Reserve 4 " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 5 " .
Sub BarGraphLimitConfiguration()
'VBA755
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeLimitLow4 = False
'Activate monitoring
.CheckLimitLow4 = True
'Set barcolor = " green "
.ColorLimitLow4 = RGB(0, 255, 0)
'Set lower limit = " 5 "
.LimitLow4 = 5
End With
End Sub

966

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.27 TypeLimitLow5 Property

Description
TRUE if the low limit value " Reserve 5 " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 0 " .
Sub BarGraphLimitConfiguration()
'VBA756
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeLimitLow5 = False
'Activate monitoring
.CheckLimitLow5 = True
'Set barcolor = " white "
.ColorLimitLow5 = RGB(255, 255, 255)
'Set lower limit = " 0 "
.LimitLow5 = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

967

ActualPointTopIndex

11.05

5.7.13.28 TypeToleranceHigh Property

Description
TRUE if the low limit value " Tolerance High " is to be evaluated in percentage
terms. FALSE if the evaluation will be in absolute terms. BOOLEAN read-write
access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of limit
values. In this example the limit value for " Tolerance High " will be configured:
Sub BarGraphLimitConfiguration()
'VBA757
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeToleranceHigh = False
'Activate monitoring
.CheckToleranceHigh = True
'Set barcolor = " yellow "
.ColorToleranceHigh = RGB(255, 255, 0)
'Set upper limit = " 40 "
.ToleranceHigh = 40
End With
End Sub

968

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.29 TypeToleranceLow Property

Description
TRUE if the low limit value " Tolerance Low " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of limit
values. In this example the limit value for " Tolerance Low " will be configured:
Sub BarGraphLimitConfiguration()
'VBA758
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeToleranceLow = False
'Activate monitoring
.CheckToleranceLow = True
'Set barcolor = " red "
.ColorToleranceLow = RGB(255, 0, 0)
'Set lower limit = " 10 "
.ToleranceLow = 10
End With
End Sub

Printout of the Online Help
Automated Configuring

969

ActualPointTopIndex

11.05

5.7.13.30 TypeWarningHigh Property

Description
TRUE if the low limit value " Warning High " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 75 " .
Sub BarGraphLimitConfiguration()
'VBA759
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeWarningHigh = False
'Activate monitoring
.CheckWarningHigh = True
'Set barcolor = " red "
.ColorWarningHigh = RGB(255, 0, 0)
'Set upper limit = " 75 "
.WarningHigh = 75
End With
End Sub

970

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.13.31 TypeWarningLow Property

Description
TRUE if the low limit value " Warning Low " is to be evaluated in percentage terms.
FALSE if the evaluation will be in absolute terms. BOOLEAN read-write access.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 12 " .
Sub BarGraphLimitConfiguration()
'VBA760
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeWarningLow = False
'Activate monitoring
.CheckWarningLow = True
'Set barcolor = " magenta "
.ColorWarningLow = RGB(255, 0, 255)
'Set lower limit = " 12 "
.WarningLow = 12
End With
End Sub

Printout of the Online Help
Automated Configuring

971

ActualPointTopIndex

11.05

5.7.14 VBA Properties: U-Z
5.7.14.1 Underlined Property

Description
TRUE if the font attribute " Underline " is set for the language-dependent text in the
object. BOOLEAN read-write access.
Example
The following example sets the font attributes of a button for French and English:
Sub ExampleForLanguageFonts()
'VBA761
Dim colLangFonts As HMILanguageFonts
Dim objButton As HMIButton
Set objButton =
ActiveDocument.HMIObjects.AddHMIObject( " myButton " ,
" HMIButton " )
objButton.Text = " DefText "
Set colLangFonts = objButton.LDFonts
'
'Set font-properties for french:
With colLangFonts.ItemByLCID(1036)
.Family = " Courier New "
.Bold = True
.Italic = False
.Underlined = True
.Size = 12
End With
'
'Set font-properties for english:
With colLangFonts.ItemByLCID(1033)
.Family = " Times New Roman "
.Bold = False
.Italic = True
.Underlined = False
.Size = 14
End With
End Sub

972

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.2 UnselBGColor Property

Description
In the case of the TextList object, defines or returns the background color of the
selection list for entries that are not selected. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the colors will be defined for entries that are not selected in
the selection list:
Sub TextListConfiguration()
'VBA762
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.UnselBGColor = RGB(255, 0, 0)
.UnselTextColor = RGB(0, 0, 0)
End With
End Sub

Printout of the Online Help
Automated Configuring

973

ActualPointTopIndex

11.05

5.7.14.3 UnselTextColor Property

Description
In the case of the TextList object, defines or returns the color of text in the
selection list for entries that are not selected. LONG read-write access.
Determination of Color Value
The color is displayed in RGB format (red, green, blue). Specify the corresponding
decimal value for each of the three RGB values (value range from 0 to 255).
Use VBA function " RGB " to assign a color to a property. The color " red " , for
example, is represented as follows: RGB(255, 0, 0)

Example
The " TextListConfiguration() " procedure accesses the properties of the TextList
object. In this example the colors will be defined for entries that are not selected in
the selection list:
Sub TextListConfiguration()
'VBA763
Dim objTextList As HMITextList
Set objTextList =
ActiveDocument.HMIObjects.AddHMIObject( " myTextList " ,
" HMITextList " )
With objTextList
.UnselBGColor = RGB(255, 0, 0)
.UnselTextColor = RGB(0, 0, 0)
End With
End Sub

974

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.4 UpdateCycle Property

Description
Defines or returns the type and frequency of updates to the picture window in
runtime.
Update Cycle

Assigned Value

Upon change

0

250 ms

1

500 ms

2

1s

3

2s

4

5s

5

10 s

6

1 min

7

5 min

8

10 min

9

1h

10

User cycle 1

11

User cycle 2

12

User cycle 3

13

User cycle 4

14

User cycle 5

15

Picture cycle

255

Example
The " PictureWindowConfig " procedure accesses the properties of the picture
window. In this example the picture window will be updated every 5 seconds in
runtime:
Sub PictureWindowConfig()
'VBA764
Dim objPicWindow As HMIPictureWindow
Set objPicWindow =
ActiveDocument.HMIObjects.AddHMIObject( " PicWindow1 " ,
" HMIPictureWindow " )
With objPicWindow
.UpdateCycle = 5
End With
End Sub

Printout of the Online Help
Automated Configuring

975

ActualPointTopIndex

11.05

5.7.14.5 UserValue1 Property

Description
Defines or returns any value in the case of the GroupDisplay object.
You can for instance arrange for the value to be evaluated by a script. This value is
neither evaluated nor displayed in runtime.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example four different user values will be assigned:
Sub GroupDisplayConfiguration()
'VBA765
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.UserValue1 = 0
.UserValue2 = 25
.UserValue3 = 50
.UserValue4 = 75
End With
End Sub

976

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.6 UserValue2 Property

Description
Defines or returns any value in the case of the GroupDisplay object.
You can for instance arrange for the value to be evaluated by a script. This value is
neither evaluated nor displayed in runtime.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example four different user values will be assigned:
Sub GroupDisplayConfiguration()
'VBA766
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.UserValue1 = 0
.UserValue2 = 25
.UserValue3 = 50
.UserValue4 = 75
End With
End Sub

Printout of the Online Help
Automated Configuring

977

ActualPointTopIndex

11.05

5.7.14.7 UserValue3 Property

Description
Defines or returns any value in the case of the GroupDisplay object.
You can for instance arrange for the value to be evaluated by a script. This value is
neither evaluated nor displayed in runtime.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example four different user values will be assigned:
Sub GroupDisplayConfiguration()
'VBA767
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.UserValue1 = 0
.UserValue2 = 25
.UserValue3 = 50
.UserValue4 = 75
End With
End Sub

978

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.8 UserValue4 Property

Description
Defines or returns any value in the case of the GroupDisplay object.
You can for instance arrange for the value to be evaluated by a script. This value is
neither evaluated nor displayed in runtime.

Example
The " GroupDisplayConfiguration() " procedure accesses the properties of the Group
Display. In this example four different user values will be assigned:
Sub GroupDisplayConfiguration()
'VBA768
Dim objGroupDisplay As HMIGroupDisplay
Set objGroupDisplay =
ActiveDocument.HMIObjects.AddHMIObject( " GroupDisplay1 " ,
" HMIGroupDisplay " )
With objGroupDisplay
.UserValue1 = 0
.UserValue2 = 25
.UserValue3 = 50
.UserValue4 = 75
End With
End Sub

Printout of the Online Help
Automated Configuring

979

ActualPointTopIndex

11.05

5.7.14.9 Value Property

Description
Returns or defines the value of an object property.

Example
Use the Value property if you wish to return or define a value with the aid of the
Properties listing. In this example the property of an ActiveX Control will be
accessed via the Value property:
Sub AddActiveXControl()
'VBA769
Dim objActiveXControl As HMIActiveXControl
Set objActiveXControl =
ActiveDocument.HMIObjects.AddActiveXControl( " WinCC_Gauge
2 " , " XGAUGE.XGaugeCtrl.1 " )
'
'Move ActiveX-Control:
objActiveXControl.Top = 40
objActiveXControl.Left = 60
'
'Modify individual properties:
objActiveXControl.Properties( " BackColor " ).value =
RGB(255, 0, 0)
End Sub

980

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.10 VALUE_ACCESS_FAULT Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Access to tag not permitted " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

981

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

982

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.11 VALUE_ADDRESS_ERROR Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Addressing error " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA771
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

983

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

984

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.12 VALUE_BAD_COMMLUV Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, no
communication (last usable value) " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA???
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

985

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

986

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.13 VALUE_BAD_COMMNUV Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, no
communication (last usable value) " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

987

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

988

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.14 VALUE_BAD_CONFERROR Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, no
communication, value not accepted " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

989

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

990

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.15 VALUE_BAD_DEVICE Property

Description
Specifies a value assigned to a dynamized property if quality code " bad, device
failure " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

991

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

992

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.16 VALUE_BAD_MISCSTATES Property

Description
Specifies the value assigned to a dynamized property if quality code " bad
miscellaneous states " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

993

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

994

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.17 VALUE_BAD_NONSPECIFIC Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, nonspecific " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

995

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

996

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.18 VALUE_BAD_NOTCONNECTED Property

Description
Specifies a value assigned to a dynamized property if quality code " bad, not
connected " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

997

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

998

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.19 VALUE_BAD_OUTOFSERV Property

Description
Specifies a value assigned to a dynamized property if quality code " bad, out of
service " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

999

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1000

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.20 VALUE_BAD_PROCRELNOM Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, process
related, no maintenance " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1001

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1002

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.21 VALUE_BAD_PROCRELSUB Property

Description
Specifies the value assigned to a dynamized property if quality code " bad, process
related, substitute value " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1003

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1004

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.22 VALUE_CONVERSION_ERROR Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Conversion error " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA772
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1005

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1006

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.23 VALUE_HANDSHAKE_ERROR Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Handshake error " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA773
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1007

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1008

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.24 VALUE_HARDWARE_ERROR Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " No network module " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA774
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1009

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1010

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.25 VALUE_HIGHLIMITED Property

Description
Specifies the value assigned to a dynamized property if quality code " high limited "
occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1011

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1012

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.26 VALUE_INVALID_KEY Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Tag not found " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA775
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1013

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1014

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.27 VALUE_LOWLIMITED Property

Description
Specifies the value assigned to a dynamized property if quality code " low limited "
occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1015

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1016

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.28 VALUE_MAX_LIMIT Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Upper limit exceeded " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example, the radius of a circle is dynamized with the Dynamic
dialog. Creation of the dynamics requires the status of a tag to be evaluated. If the
tag fails to return a status, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA776
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1017

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1018

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.29 VALUE_MAX_RANGE Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Format upper limit exceeded " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example, the radius of a circle is dynamized with the Dynamic
dialog. Creation of the dynamics requires the status of a tag to be evaluated. If the
tag fails to return a status, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA777
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1019

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1020

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.30 VALUE_MIN_LIMIT Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Lower limit exceeded " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag does not return a status, a substitute value (ElseCase
property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA778
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1021

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1022

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.31 VALUE_MIN_RANGE Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Format lower limit exceeded " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag does not return a status, a substitute value (ElseCase
property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA779
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1023

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1024

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.32 VALUE_NOT_ESTABLISHED Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " No check-back message from the channel " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA780
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1025

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1026

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.33 VALUE_SERVERDOWN Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Server not available " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA781
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1027

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1028

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.34 VALUE_STARTUP_VALUE Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " Start value " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA782
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1029

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1030

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.35 VALUE_TIMEOUT Property

Description
Defines or returns the value that will be assigned to the dynamic property if tag
status " No connection " occurs.
The value of the VariableStateChecked property must be TRUE in order for the
status to be evaluated.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If the tag fails to return a status, a substitute value (ElseCase property)
is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA783
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100

Printout of the Online Help
Automated Configuring

1031

ActualPointTopIndex

11.05

.VALUE_MIN_LIMIT = 110
.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1032

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.36 VALUE_UNCERT_ENGVHIGHLIM Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain,
engineering unit range violation, high limit set " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1033

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1034

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.37 VALUE_UNCERT_ENGVLOWLIM Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain,
engineering unit range violation, low limit set " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1035

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1036

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.38 VALUE_UNCERT_ENGVONLIM Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain,
engineering unit range violation, on limits set " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1037

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1038

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.39 VALUE_UNCERT_INITVAL Property

Description
Specifies a value assigned to a dynamized property if quality code " uncertain, initial
value " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1039

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1040

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.40 VALUE_UNCERT_LUV Property

Description
Specifies a value assigned to a dynamized property if quality code " uncertain, last
usable value " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1041

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1042

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.41 VALUE_UNCERT_MAINTDEM Property

Description
Specifies a value assigned to a dynamized property if quality code " uncertain,
maintenance demanded " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1043

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1044

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.42 VALUE_UNCERT_MISCSTATES Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain
miscellaneous states " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1045

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1046

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.43 VALUE_UNCERT_NONSPECIFIC Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain,
non-specific " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1047

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1048

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.44 VALUE_UNCERT_PROCRELNOM Property

Description
Specifies the value assigned to a dynamized property if quality code " uncertain,
process related, no maintenance " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1049

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1050

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.45 VALUE_UNCERT_SIMVAL Property

Description
Specifies a value assigned to a dynamized property if quality code " uncertain,
simulated value " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

Printout of the Online Help
Automated Configuring

1051

ActualPointTopIndex

11.05

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

1052

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.46 VariablesExist Property

Description
TRUE when all the tags used in the source code of a DynamicDialog object are
defined. Read access.
You can use this property to check whether all the tags that you have defined in
the source code of the Dynamic dialog are created in WinCC.

Example
--

Printout of the Online Help
Automated Configuring

1053

ActualPointTopIndex

11.05

5.7.14.47 VALUE_UNCERT_SUBSTSET Property

Description
Specifies a value assigned to a dynamized property if quality code " uncertain,
substitute set " occurs, or returns its value.
In order for the quality code to be analyzed, the QualityCodeStateChecked
property must be TRUE.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Dynamization uses the analysis of the quality code of a tag. If the
tag fails to return a quality code, a substitute value (ElseCase property) is defined:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA770
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of qualitycodestate
.QualityStateChecked = True
End With
With objDynDialog.QualityCodeStateValues(1)
'
'define a value for every state:
.VALUE_BAD_COMMLUV = 20
.VALUE_BAD_COMMNUV = 30
.VALUE_BAD_CONFERROR = 40
.VALUE_BAD_DEVICE = 60
.VALUE_BAD_MISCSTATES = 70
.VALUE_BAD_NONSPECIFIC = 80
.VALUE_BAD_NOTCONNECTED = 90
.VALUE_BAD_OUTOFSERV = 100

1054

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.VALUE_BAD_PROCRELNOM = 110
.VALUE_BAD_PROCRELSUB = 120
.VALUE_HIGHLIMITED = 130
.VALUE_LOWLIMITED = 140
.VALUE_UNCERT_ENGVHIGHLIM = 150
.VALUE_UNCERT_ENGVLOWLIM = 160
.VALUE_UNCERT_INITVAL = 170
.VALUE_UNCERT_LUV = 180
.VALUE_UNCERT_MAINTDEM = 190
.VALUE_UNCERT_MISCSTATES = 200
.VALUE_UNCERT_NONSPECIFIC = 210
.VALUE_UNCERT_PROCRELNOM = 220
.VALUE_UNCERT_SIMVAL = 230
.VALUE_UNCERT_SUBSTSET = 240
End With
End Sub

Printout of the Online Help
Automated Configuring

1055

ActualPointTopIndex

11.05

5.7.14.48 VariableStateChecked Property

Description
TRUE if the status of the specified tag is used in the Dynamic dialog for the
purpose of dynamics. BOOLEAN read-write access.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If a tag does not return a status, a substitute value (ElseCase property)
is defined, a tag name is issued and three analog value ranges are created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA785
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100
.VALUE_MIN_LIMIT = 110

1056

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

Printout of the Online Help
Automated Configuring

1057

ActualPointTopIndex

11.05

5.7.14.49 VariableStateType Property

Description
Returns the type of tag monitoring used to dynamize a property or an event: No
monitoring, quality code, or tag status. Read access.
Index

VariableStateType

0

hmiNoVariableState

1

hmiVariableQCState

2

hmiVariableState

Example
The procedure " GetVariableStateType() " reads the type of monitoring from the
current document. In this example, the type of monitoring is output in a message:
Sub GetVariableStateType()
'VBA???
Dim objDyn As HMIDynamicDialog
Set objDyn =
ActiveDocument.Properties( " Width " )CreateDynamic(hmiDynam
icCreationTypeDynamicDialog, " 'TestVal' " )
MsgBox objDyn.VariableStateType
objDyn.Delete
End Sub

1058

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.50 VariableStateValues Property

Description
Returns the VariableStateValues listing. Use the VariableStateValues property with
the Item property to assign a value to the tag status to be used for dynamization.

Example
In the following example the radius of a circle is given dynamics with the aid of the
Dynamic dialog. Creation of the dynamics requires the status of a tag to be
evaluated. If a tag does not return a status, a substitute value (ElseCase property)
is defined, a tag name is issued and three analog value ranges are created:
Sub AddDynamicDialogToCircleRadiusTypeAnalog()
'VBA786
Dim objDynDialog As HMIDynamicDialog
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_A " ,
" HMICircle " )
Set objDynDialog =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDyn
amicDialog, " 'NewDynamic1' " )
With objDynDialog
.ResultType = hmiResultTypeAnalog
.AnalogResultInfos.ElseCase = 200
'
'Activate analysis of variablestate
.VariableStateChecked = True
End With
With objDynDialog.VariableStateValues(1)
'
'define a value for every state:
.VALUE_ACCESS_FAULT = 20
.VALUE_ADDRESS_ERROR = 30
.VALUE_CONVERSION_ERROR = 40
.VALUE_HANDSHAKE_ERROR = 60
.VALUE_HARDWARE_ERROR = 70
.VALUE_INVALID_KEY = 80
.VALUE_MAX_LIMIT = 90
.VALUE_MAX_RANGE = 100
.VALUE_MIN_LIMIT = 110

Printout of the Online Help
Automated Configuring

1059

ActualPointTopIndex

11.05

.VALUE_MIN_RANGE = 120
.VALUE_NOT_ESTABLISHED = 130
.VALUE_SERVERDOWN = 140
.VALUE_STARTUP_VALUE = 150
.VALUE_TIMEOUT = 160
End With
End Sub

1060

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.51 VariableTriggers Property

Description
Returns the VariableTriggers listing. Use the VariableTriggers property in order to
add a tag trigger to a VB action or C action.

Example
In the following example the radius of a circle is made dynamic with the aid of a VB
script. A tag trigger is used as the trigger:
Sub DynamicWithVariableTrigger()
'VBA787
Dim objVBScript As HMIScriptInfo
Dim objVarTrigger As HMIVariableTrigger
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " Circle_VariableT
rigger " , " HMICircle " )
Set objVBScript =
objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBS
cript)
With objVBScript
'Triggername and cycletime are defined by addmethode
Set objVarTrigger =
.Trigger.VariableTriggers.Add( " VarTrigger " ,
hmiVariableCycleType_10s)
.SourceCode = " "
End With
End Sub

Printout of the Online Help
Automated Configuring

1061

ActualPointTopIndex

11.05

5.7.14.52 VarName Property

Description
Defines the tag whose status is to be used in the Dynamic dialog for the purpose of
dynamics, or returns the name.

Example
In this example the name of the trigger tag used for creating dynamics in the radius
of a circle will be output:
Sub GetVarName()
'VBA788
Dim objVBScript As HMIScriptInfo
Dim objCircle As HMICircle
Set objCircle =
ActiveDocument.HMIObjects.Item( " Circle_VariableTrigger " )
Set objVBScript = objCircle.Radius.Dynamic
With objVBScript
'Reading out of variablename
MsgBox " The radius is dynamicabled with: " &
.Trigger.VariableTriggers.Item(1).VarName
End With
End Sub

1062

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.53 VBAVersion Property

Description
Returns the VBA version number. Read access.

Example
In the following example the current VBA version number is output:
Sub ShowVBAVersion()
'VBA789
MsgBox Application.VBAVersion
End Sub

Printout of the Online Help
Automated Configuring

1063

ActualPointTopIndex

11.05

5.7.14.54 VBE Property

Description
Returns the VB Extensibility object. Read access.

Example
--

5.7.14.55 Version Property

Description
Returns the version number of the specified application. Read access.

Example
In the following example the version number of the Graphics Designer is output:
Sub ShowVersionOfGraphicsDesigner()
'VBA791
MsgBox Application.Version
End Sub

1064

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.56 Views Property

Description
Returns the Views listing. Use the Views listing to create a new copy of a picture,
for instance.

Example
In the following example a copy of the active picture is created and then activated:
Sub AddView()
'VBA792
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Activate
End Sub

Printout of the Online Help
Automated Configuring

1065

ActualPointTopIndex

11.05

5.7.14.57 Visible Property

Description
TRUE if the specified object is intended to be visible. BOOLEAN read-write access.

Example
In the following example a circle will be inserted into the active picture. This circle
is not intended to be visible in runtime:
Sub HideCircleInRuntime()
'VBA793
Dim objCircle As HMICircle
Set objCircle = ActiveDocument.HMIObjects.AddHMIObject
( " myCircle " , " HMICircle " )
objCircle.Visible = False
End Sub

1066

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.58 WarningHigh Property

Description
Defines or returns the high limit value " Warning High " in the case of the BarGraph
object.
The " CheckWarningHigh " property must be set to " True " in order for the limit value
to be monitored.
The display on reaching the limit value and the type of evaluation are defined via
the properties ColorWarningHigh and TypeWarningHigh.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the high
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 75 " .
Sub BarGraphLimitConfiguration()
'VBA794
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeWarningHigh = False
'Activate monitoring
.CheckWarningHigh = True
'Set barcolor = " red "
.ColorWarningHigh = RGB(255, 0, 0)
'Set upper limit = " 75 "
.WarningHigh = 75
End With
End Sub

Printout of the Online Help
Automated Configuring

1067

ActualPointTopIndex

11.05

5.7.14.59 WarningLow Property

Description
Defines or returns the low limit value " Warning Low " in the case of the BarGraph
object.
The " CheckWarningLow " property must be set to " True " in order for the limit value
to be monitored.
The display on reaching the limit value and the type of evaluation are defined via
the properties ColorWarningLow and TypeWarningLow.

Example
The " BarGraphLimitConfiguration() " procedure configures the properties of the low
limit value for an alarm. In this example the type of evaluation will be set to
" Absolute " . The alarm will be triggered at a value of " 12 " .
Sub BarGraphLimitConfiguration()
'VBA795
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
'Set analysis = absolute
.TypeWarningLow = False
'Activate monitoring
.CheckWarningLow = True
'Set barcolor = " magenta "
.ColorWarningLow = RGB(255, 0, 255)
'Set lower limit = " 12 "
.WarningLow = 75
End With
End Sub

1068

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.60 Width Property

Description
Defines or returns the width of an object in pixels.

Example
In the following example three objects of different sizes will be inserted in the active
picture. Then all objects will be selected and set to the same width:
Sub ApplySameWidthToSelectedObjects()
'VBA796
Dim objCircle As HMICircle
Dim objRectangle As HMIRectangle
Dim objEllipse As HMIEllipse
Set objCircle =
ActiveDocument.HMIObjects.AddHMIObject( " sCircle " ,
" HMICircle " )
Set objRectangle =
ActiveDocument.HMIObjects.AddHMIObject( " sRectangle " ,
" HMIRectangle " )
Set objEllipse =
ActiveDocument.HMIObjects.AddHMIObject( " sEllipse " ,
" HMIEllipse " )
With objCircle
.Top = 30
.Left = 0
.Width = 15
.Selected = True
End With
With objRectangle
.Top = 80
.Left = 42
.Width = 40
.Selected = True
End With
With objEllipse
.Top = 48
.Left = 162
.Width = 120
.BackColor = RGB(255, 0, 0)
.Selected = True

Printout of the Online Help
Automated Configuring

1069

ActualPointTopIndex

11.05

End With
MsgBox " Objects selected! "
ActiveDocument.Selection.SameWidth
End Sub

1070

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.61 WindowBorder Property

Description
TRUE if it is intended that the application window or picture window shall be
displayed with a border in runtime. BOOLEAN read-write access.

Example
The " ApplicationWindowConfig " procedure accesses the properties of the
application window. In this example the application window will be configured:
Sub ApplicationWindowConfig()
'VBA797
Dim objAppWindow As HMIApplicationWindow
Set objAppWindow =
ActiveDocument.HMIObjects.AddHMIObject( " AppWindow " ,
" HMIApplicationWindow " )
With objAppWindow
.Caption = True
.CloseButton = False
.Height = 200
.Left = 10
.MaximizeButton = True
.Moveable = False
.OnTop = True
.Sizeable = True
.Top = 20
.Visible = True
.Width = 250
.WindowBorder = True
End With
End Sub

Printout of the Online Help
Automated Configuring

1071

ActualPointTopIndex

11.05

5.7.14.62 WindowState Property

Description
Returns the status of the window containing the specified application. Read
access.
Window State

Assigned Value

Maximized

0

Minimized

1

Custom sized

2

Example
In the following example the window status of the Graphics Designer is output:
Sub ShowWindowState()
'VBA798
Dim strState As String
Select Case Application.WindowState
Case 0
strState = " The application-window is maximized "
Case 1
strState = " The applicationwindow is minimized "
Case 2
strState = " The application-window has a userdefined size "
End Select
MsgBox strState
End Sub

1072

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.63 ZeroPoint Property

Description
Defines or returns the position of the zero point on the bar in the case of the
BarGraph object.
Specify the value as a percentage of the total bar height. The zero point can also
be outside of the range represented.
The " ScalingType " property must be set to " 2 " and " Scaling " must be set to " True " .

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the zero point is located halfway up the bar
height:
Sub BarGraphConfiguration()
'VBA799
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Scaling = True
.ScalingType = 2
.ZeroPoint = 50
.ZeroPointValue = 0
End With
End Sub

Printout of the Online Help
Automated Configuring

1073

ActualPointTopIndex

11.05

5.7.14.64 ZeroPointValue Property

Description
Defines or returns the absolute value for the zero point.

Example
The " BarGraphConfiguration() " procedure configures the properties of the
BarGraph object. In this example the absolute value of the zero point will be set to
" 0 " .
Sub BarGraphConfiguration()
'VBA800
Dim objBarGraph As HMIBarGraph
Set objBarGraph =
ActiveDocument.HMIObjects.AddHMIObject( " Bar1 " ,
" HMIBarGraph " )
With objBarGraph
.Scaling = True
.ScalingType = 2
.ZeroPointValue = 0
End With
End Sub

1074

Printout of the Online Help
Automated Configuring

11.05

ActualPointTopIndex

5.7.14.65 Zoom Property

Description
Defines or returns the zoom factor.

Example
In this example a copy of the active picture is created and the zoom factor is set to
50%:
Sub CreateViewFromActiveDocument()
'VBA801
Dim objView As HMIView
Set objView = ActiveDocument.Views.Add
objView.Zoom = 50
End Sub

Printout of the Online Help
Automated Configuring

1075

11.05

Index

Index

A
Action configuration
configuration with VBA
with VBA
ActiveX Control
inserting with VBA
AddIn
AddIn Manager
behavior on loading
creating (Example)
creating with VB (Example)
loading (Instructions)
loading automatically
loading manually
unloading
using in the Graphics Designer
Alarm Logging
creating a message with VBA
deleting a message with VBA
editing a message with VBA
modifying a message with VBA
Application-specific menu
adding menu item
assigning help text
assigning status text
assigning VBA macro
configuring
creating
creating in multiple languages
Application-specific toolbar
adding tool icon
assigning help text
assigning status text
assigning VBA macro
configuring
creating

90
90
90
61
61
115
116
116
119
120
117
116
116
116
115
188
188
188
188
188
13
17
28
28
31
35
15
20
13
25
28
28
31
35
23

C
C 86
C action
configuring on an event with VBA
C script
dynamizing a property with VBA
Characteristics
Class
HMIGO
Collections

Printout of the Online Help
Automated Configuring

95
95
86
542
127
127
373

overview
373
Component library
36
access with VBA
36
copying object with VBA
39
creating folder with VBA
39
deleting folder with VBA
39
editing with VBA
39
inserting object into picture with VBA 42
Configuration language
11
access with VBA
11
for several languages with VBA
11
Configuring
11, 92, 95
C action with VBA
95
direct connection
92
triggers with VBA
99
VB action with VBA
97
Customized object
72
access with VBA
72
deleting
74
destroying
74
editing with VBA
74
properties
72

D
DeleteTextLanguage
180
Direct connection
92
configuring with VBA
92
Dynamic dialog
84
dynamizing a property with VBA
84
Dynamics
84
Dynamization
79
dynamics dialog with VBA
79
of properties with VBA
79
property with Dynamic dialog
with VBA
84
property with VB script with VBA
88
scripts with VBA
79
variable connection with VBA
79
Dynamizing
81, 86
Property with C Script with VBA
86
Property with Tag Connection
81

E
Editing
copy of a picture with VBA
layer with VBA
Editing objects with VBA
Event

47
49
47
51
7, 103, 209

Index-1

Index

application-specific
forwarding
picture-specific
Event handling
activated event
disabling
forwarding of events
overview
suppressing
Events
activated
BeforeClose
BeforeDocumentClose
BeforeDocumentSave
BeforeHMIObjectDelete
BeforeLibraryFolderDelete
BeforeLibraryObjectDelete
BeforeQuit
BeforeSave
BeforeVisibleFalse
ConnectionEvent
DataLanguageChanged
DesktopLanguageChanged
DocumentActivated
DocumentCreated
DocumentOpened
DocumentPropertyChanged
DocumentSaved
HMIObjectAdded
HMIObjectMoved
HMIObjectPropertyChanged
HMIObjectResized
LibraryFolderRenamed
LibraryObjectAdded
LibraryObjectRenamed
MenuItemClicked
NewLibraryFolder
NewLibraryObject
Opened
Saved
see " Event handling "
SelectionChanged
Started
ToolbarItemClicked
VBA event handling
ViewCreated
WindowStateChange
Execution
VBA macros
External application
access to MS Excel with VBA
accessing with VBA
registering

Index-2

11.05

103
103
103
103
209
103
3
209
103
209
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
226
225
227
228
229
231
232
234
233
235
237
238
239
240
209
241
242
243
209
245
247
7
7
106
107
106
106

F
Forwarding
events
Functions
CloseSingleAlarm (VBA)
CloseTag (VBA)
CloseTlgArchive (VBA)
CloseTlgTag (VBA)
CommitSingleAlarm (VBA)
CommitTag (VBA)
CommitTlgArchive (VBA)
CommitTlgTag (VBA)
CreateSingleAlarm (VBA)
CreateTag (VBA)
CreateText (VBA)
CreateTextLanguage (VBA)
CreateTlgArchive (VBA)
CreateTlgTag (VBA)
DeleteSingleAlarm (VBA)
DeleteTag (VBA)
DeleteText (VBA)
DeleteTlgArchive (VBA)
DeleteTlgTag (VBA)
GetSingleAlarm (VBA)
GetTag (VBA)
GetText (VBA)
GetTextID (VBA)
GetTlgArchive (VBA)
GetTlgTag (VBA)
ListSingleAlarm (VBA)
ListTag (VBA)
ListText (VBA)
ListTlgArchive (VBA)
ListTlgTag (VBA)
ModifyText (VBA)

103
103
139
192
132
148
150
194
134
152
154
196
136
176
175
156
159
200
138
178
165
166
201
139
181
182
167
168
202
140
186
170
172
184

G
Graphics Designer
10
@GLOBAL.PDT
3
@PROJECT.PDT
3
access to component library
with VBA
36
access to object
51
access to symbol library with VBA
36
adapting with VBA
9, 10
adding menu item to
user-defined menu
17
adding tool icon to
user-defined toolbar
25
application-specific menu
13
application-specific toolbar
13

Printout of the Online Help
Automated Configuring

11.05

Index

assigning VBA macro to
user-defined menu
31
assigning VBA macro to
user-defined toolbar
31
configuring user-defined menu
35
configuring user-defined toolbar
35
creating an application-specific menu 15
creating menus in
multiple languages
20
creating toolbar
23
editing objects with VBA
51
executing VBA macros
7
exporting VBA code
6
importing VBA code
6
inserting object from
component library into picture
42
inserting object from symbol library
into picture
42
object editing with VBA
51
object model
205
organization of VBA code
3
picture-specific menu
13
picture-specific toolbar
13
template file
3
user-defined menu
13
user-defined toolbar
13
Group object
63
access to object properties
63
adding object with VBA
65
basics
63
creating with VBA
65
delete with VBA
65
editing contained objects
69
editing with VBA
63, 65
remove object with VBA
65
ungroup with VBA
65
Grouping
63
access to object properties
63
adding object with VBA
65
basics
63
creating with VBA
65
delete with VBA
65
editing contained objects
69
editing with VBA
63, 65
remove object with VBA
65
ungroup with VBA
65

H
HMIGO class
error handling
using
HMIObjects
see " Objects "

Printout of the Online Help
Automated Configuring

127
127
127
373
373

L
Layer
controlling visibility with VBA
CS
editing with VBA
RT
Listings
Actions
AnalogResultInfo
Application
DataLanguages
Documents
Events
FolderItems
GroupedObjects
HMIDefaultObjects
HMIObjects
LanguageFonts
LanguageTexts
Layers
MenuItems
Menus
overview
Properties
QualityCodeStateValues
Selection
SymbolLibraries
ToolbarItems
Toolbars
VariableStateValues
VariableTriggers
Views

47
47
47
47
47
373
376
381
383
407
415
426
431
440
442
447
453
456
460
470
466
373
490
493
505
518
528
524
533
537
541

M
Menu
adding menu item
application specific
assigning help text
assigning status text
assigning VBA macro
configuring
creating
creating in multiple languages
picture-specific
positioning
properties
user-defined
Methods
Activate
Add
Add (AnalogResultInfos Listing)
Add (CustomToolbars Listing)

13, 44
17
13
28
28
31
35
15
20
13, 44
13
13
13
248
248
249
250
255

Index-3

Index

Add (Documents Listing)
Add (GroupedObjects)
Add (VariableTriggers Listing)
Add (Views Listing)
AddAction
AddActiveXControl
AddFolder
AddFromClipboard
AddHMIObject
AddItem
AddOLEObject
AlignBottom
AlignLeft
AlignRight
AlignTop
ArrangeMinimizedWindows
BackwardOneLevel
BringToFront
CascadeWindows
CenterHorizontally
CenterVertically
CheckSyntax
Close
CloseAll
ConvertToScript
CopySelection
CopyToClipboard
CreateCustomizedObject
CreateDynamic
CreateGroup
Delete
DeleteAll
DeleteDynamic
Destroy
DuplicateSelection
EvenlySpaceHorizontally
EvenlySpaceVertically
Export
Find
FindByDisplayName
FlipHorizontally
FlipVertically
ForwardOneLevel
GetItemByPath
InsertFromMenuItem
InsertMenu
InsertMenuItem
InsertSeparator
InsertSubmenu
InsertToolbarItem
IsCSLayerVisible
IsRTLayerVisible
Item
ItemByLcid
LoadDefaultConfig

Index-4

11.05

252
253
257
258
259
260
263
264
266
267
269
272
273
274
275
276
336
369
277
278
279
280
281
282
283
285
287
288
290
292
294
295
296
298
299
301
303
305
306
308
309
311
338
313
314
316
318
320
322
324
326
327
328
329
331

MoveOneLayerDown
MoveOneLayerUp
MoveSelection
Open
overview
PasteClipboard
PrintDocument
PrintProjectDocumentation
Remove
Rotate
SameHeight
SameWidth
SameWidthAndHeight
Save
SaveAll
SaveAs
SaveDefaultConfig
SelectAll
SendToBack
SetCSLayerVisible
SetDeclutterObjectSize
SetRTLayerVisible
ShowPropertiesDialog
ShowTagDialog
TileWindowsHorizontally
TileWindowsVertically
Ungroup
Methods ShowSymbolLibraryDialog

332
333
334
339
248
340
341
342
343
345
347
349
351
353
354
355
356
357
367
359
360
361
362
364
365
366
371
363

O
Object
Objects
3DBarGraph
ActiveXControl
AnalogResultInfo
ApplicationWindow
BarGraph
BinaryResultInfo
BitResultInfo
Button
CheckBox
Circle
CircularArc
ConnectorPoints (Listing)
CustomizedObject
DataLanguage
DestLink
DirectConnection
Document
DynamicDialog
Ellipse
EllipseArc
EllipseSegment

205
373
373
378
380
385
387
391
392
393
396
398
400
402
404
406
409
411
413
417
419
421
423

Printout of the Online Help
Automated Configuring

11.05

Index

Event
FolderItem
GraphicObject
Group
GroupDisplay
HMIObject
IOField
LanguageFont
LanguageText
Layer
Line
Menu
MenuItem
objConnection
OLEObject
OptionGroup
overview
PictureWindow
PieSegment
Polygon
PolyLine
Property
QualityCodeStateValue
Rectangle
RoundButton
RoundRectangle
ScriptInfo
Slider
SourceLink
StaticText
StatusDisplay
SymbolLibrary
TextList
Toolbar
ToolbarItem
Trigger
VariableStateValue
VariableTrigger
View

425
429
433
435
437
445
449
452
455
458
462
464
468
472
475
477
373
480
482
484
486
488
492
496
498
501
503
507
510
512
515
517
519
522
526
530
532
535
539

P
Picture
editing a copy with VBA
Picture-specific menu
assigning help text
assigning status text
assigning VBA macro
configuring
creating
creating in multiple languages
Picture-specific toolbar
assigning status text
assigning VBA macro

Printout of the Online Help
Automated Configuring

49
49
45
28
28
31
35
45
20
45
28
31

configuring
creating
Procedure
execution
Properties
Actions
ActiveDocument
ActiveLayer
ActualPointLeft
ActualPointTop
AdaptBorder
AdaptPicture
AdaptSize
AlarmHigh
AlarmLow
Alignment
AlignmentLeft
AlignmentTop
AnalogResultInfos
AngleAlpha
AngleBeta
Application
ApplicationDataPath
Assignments
AssumeOnExit
AssumeOnFull
AutomationName
AvailableDataLanguages
Average
Axe
AxisSection
BackBorderWidth
BackColor
BackColor2
BackColor3
BackColorBottom
BackColorTop
BackFlashColorOff
BackFlashColorOn
Background
BarDepth
BarHeight
BarWidth
BasePicReferenced
BasePicTransColor
BasePicture
BasePicUseTransColor
BaseX
BaseY
BinaryResultInfo
BitNotSetValue
BitNumber
BitResultInfo
BitSetValue
Bold

35
45
7
7
542
542
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594

Index-5

Index

BorderBackColor
BorderColor
BorderColorBottom
BorderColorTop
BorderEndStyle
BorderFlashColorOn
BorderStyle
BorderWidth
BottomConnectedConnection
PointIndex
BottomConnectedObjectName
BoxAlignment
BoxCount
BoxType
Button1Width
Button2Width
Button3Width
Button4Width
ButtonColor
Caption
CaptionText
CheckAlarmHigh
CheckAlarmLow
Checked
CheckLimitHigh4
CheckLimitHigh5
CheckLimitLow4
CheckLimitLow5
CheckToleranceHigh
CheckToleranceLow
CheckWarningHigh
CheckWarningLow
ClearOnError
ClearOnNew
CloseButton
CollectValue
ColorAlarmHigh
ColorAlarmLow
ColorBottom
ColorChangeType
ColorLimitHigh4
ColorLimitHigh5
ColorLimitLow4
ColorLimitLow5
ColorToleranceHigh
ColorTop
ColorWarningHigh
ColorWarningLow
CommandLine property
CommonVBSCode
Compiled
ConfigurationFileName
Count
CurrentDataLanguage
CurrentDesktopLanguage

Index-6

11.05

595
596
597
598
599
602
603
604
606
605
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
642
643
644
646
645
647
649
650
651
652

CursorControl
CursorMode
CustomMenus
CustomToolbars
CycleName
CycleTime
CycleType
DataFormat
DefaultHMIObjects
DeselectAll Method
DestinationLink
Direction
DisableVBAEvents
DisplayName
DisplayOptions
DisplayText
Documents
Dynamic
EditAtOnce
ElseCase
Enabled
EndAngle
Events
EventType
Exponent
ExtendedOperation
ExtendedZoomingEnable
Family
FillColor
Filling
FillingIndex
FillStyle
FillStyle2
FlashBackColor
FlashBorderColor
FlashFlashPicture
FlashForeColor
FlashPicReferenced
FlashPicTransColor
FlashPicture
FlashPicUseTransColor
FlashRate
FlashRateBackColor
FlashRateBorderColor
FlashRateFlashPic
FlashRateForeColor
FolderItems
FontBold
FontColor
FontFlashColorOff
FontFlashColorOn
FontItalic
FontName
FontSize
FontUnderline

653
654
655
656
657
657
658
659
660
297
661
663
664
665
666
667
668
669
670
671
672
673
674
677
679
680
681
682
684
685
686
687
689
691
692
693
694
695
696
697
698
699
700
701
702
703
706
708
713
714
715
709
710
711
712

Printout of the Online Help
Automated Configuring

11.05

Index

ForeColor
ForeFlashColorOff
ForeFlashColorOn
Grid
GridColor
GridHeight
GridWidth
GroupedHMIObjects
GroupParent
Height
HiddenInput
Hide
Hotkey
Hysteresis
HysteresisRange
Icon
Index
IsActive
IsConnectedToProject
IsDynamicable
Italic
Item
ItemBorderBackColor
ItemBorderColor
ItemBorderStyle
ItemBorderWidth
Key
Label
LanguageID
LanguageName
LanguageSwitch
Layer
Layer00Checked
Layer00Color
Layer00Value
Layer01Checked
Layer01Color
Layer01Value
Layer02Checked
Layer02Color
Layer02Value
Layer03Checked
Layer03Color
Layer03Value
Layer04Checked
Layer04Color
Layer04Value
Layer05Checked
Layer05Color
Layer05Value
Layer06Checked
Layer06Color
Layer06Value
Layer07Checked
Layer07Color

Printout of the Online Help
Automated Configuring

713
714
715
716
717
718
719
721
720
722
724
723
726
727
728
729
730
734
735
736
737
738
739
740
741
742
743
745
746
747
748
749, 750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773

Layer07Value
Layer08Checked
Layer08Color
Layer08Value
Layer09Checked
Layer09Color
Layer09Value
Layer10Checked
Layer10Color
Layer10Value
LayerDecluttering
Layers
LDFonts
LDLabelTexts
LDNames
LDStatusTexts
LDTexts
LDTooltipTexts
Left
LeftComma
LightEffect
LimitHigh4
LimitHigh5
LimitLow4
LimitLow5
LimitMax
LimitMin
ListType
LockBackColor
LockedByCreatorID
LockStatus
LockText
LockTextColor
LongStrokesBold
LongStrokesOnly
LongStrokesSize
LongStrokesTextEach
Macro
Marker
Max
MaximizeButton
MaxZoom
MCGUBackColorOff
MCGUBackColorOn
MCGUBackFlash
MCGUTextColorOff
MCGUTextColorOn
MCGUTextFlash
MCKOBackColorOff
MCKOBackColorOn
MCKOBackFlash
MCKOTextColorOff
MCKOTextColorOn
MCKOTextFlash
MCKQBackColorOn

774
775
776
777
778
779
780
781
782
783
784
785
786
787
789
790
792
793
795
796
797
798
799
800
801
802
803
804
805
809
806
807
808
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
833

Index-7

Index

MCKQBackFlash
MCKQTextColorOff
MCKQTextColorOn
MCKQTextFlash
MCText
MenuItems
MenuItemType
MessageClass
Min
MinZoom
Modified
Moveable
Name
NegativeValue
Number
NumberLines
ObjectName
ObjectSizeDecluttering
OffsetLeft
OffsetTop
OnTop
Operation
OperationMessage
OperationReport
Orientation
OutputFormat
OutputValue
overview
Parent
PasswordLevel
Path
PicDeactReferenced
PicDeactTransparent
PicDeactUseTransColor
PicDownReferenced
PicDownTransparent
PicDownUseTransColor
PicReferenced
PicTransColor
PictureDeactivated
PictureDown
PictureName
PictureUp
PicUpReferenced
PicUpTransparent
PicUpUseTransColor
PicUseTransColor
PointCount
Position
PositiveValue
PredefinedAngels
Pressed
Process
ProfileName
ProgID

Index-8

11.05

834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
853
854
855
856
857
858
859
860
861
862
542
863
864
865
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890

ProjectName
ProjectType
Properties
Prototype
QualityCodeStateChecked
QualityCodeStateValues
Radius
RadiusHeight
RadiusWidth
RangeTo
ReferenceRotationLeft
ReferenceRotationTop
Relevant
ResultType
RightComma
RotationAngle
RoundCornerHeight
RoundCornerWidth
SameSize
ScaleColor
ScaleTicks
Scaling
ScalingType
ScriptType
ScrollBars
ScrollPositionX
ScrollPositionY
ScrollPosX
ScrollPosY
see also " Characteristics "
SelBGColor
Selected
SelTextColor
ServerName
ServerPrefix
ShortCut
SignificantMask
Size
Sizeable
SmallChange
SnapToGrid
SourceCode
SourceLink
StartAngle
StatusText
SubMenu
SymbolLibraries
TabOrderAllHMIObjects
TabOrderAlpha
TabOrderKeyboard
TabOrderMouse
TabOrderOtherAction
TabOrderSwitch
Tag
TagPrefix

891
892
893
894
895
897
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
918
921
922
919
920
542
923
924
926
927
928
929
931
932
933
934
935
938
936
940
941
943
945
947
948
949
950
951
946
952
954

Printout of the Online Help
Automated Configuring

11.05

Index

Text
Toggle
ToleranceHigh
ToleranceLow
ToolbarItems
TooltipText
Top
TopConnectedObjectName
TopConnectedPointIndex
Trend
TrendColor
Trigger
Type
TypeAlarmHigh
TypeAlarmLow
TypeLimitHigh4
TypeLimitHigh5
TypeLimitLow4
TypeLimitLow5
TypeToleranceHigh
TypeToleranceLow
TypeWarningHigh
TypeWarningLow
Underlined
UnselBGColor
UnselTextColor
UpdateCycle
UserValue1
UserValue2
UserValue3
UserValue4
Value
VALUE_ACCESS_FAULT
VALUE_ADDRESS_ERROR
VALUE_BAD_COMMLUV
VALUE_BAD_COMMNUV
VALUE_BAD_CONFERROR
VALUE_BAD_DEVICE
VALUE_BAD_MISCSTATES
VALUE_BAD_NONSPECIFIC
VALUE_BAD_NOTCONNECTED
VALUE_BAD_OUTOFSERV
VALUE_BAD_PROCRELNOM
VALUE_BAD_PROCRELSUB
VALUE_CONVERSION_ERROR
VALUE_HANDSHAKE_ERROR
VALUE_HARDWARE_ERROR
VALUE_HIGHLIMITED
VALUE_INVALID_KEY
VALUE_LOWLIMITED
VALUE_MAX_LIMIT
VALUE_MAX_RANGE
VALUE_MIN_LIMIT
VALUE_MIN_RANGE
VALUE_NOT_ESTABLISHED

Printout of the Online Help
Automated Configuring

956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
991
992
994
996
998
1000
1002
1004
1006
1008
1010
1012
1014
1016
1018
1020
1022
1024
1026
1028
1030
1032

VALUE_SERVERDOWN
1034
VALUE_STARTUP_VALUE
1036
VALUE_TIMEOUT
1047
VALUE_UNCERT_ENGVHIGHLIM 1040
VALUE_UNCERT_ENGVLOWLIM 1042
VALUE_UNCERT_ENGVONLIM 1044
VALUE_UNCERT_INITVAL
1046
VALUE_UNCERT_LUV
1048
VALUE_UNCERT_MAINTDEM
1050
VALUE_UNCERT_MISCSTATES 1052
VALUE_UNCERT_NONSPECIFIC 1054
VALUE_UNCERT_PROCRELNOM 1056
VALUE_UNCERT_SIMVAL
1058
VALUE_UNCERT_SUBSTSET
1061
VariablesExist
1060
VariableStateChecked
1063
VariableStateType
1065
VariableStateValues
1066
VariableTriggers
1068
VarName
1069
VBAVersion
1070
VBE
1071
Version
1071
Views
1072
Visible
1073
WarningHigh
1074
WarningLow
1075
Width
1076
WindowBorder
1078
WindowState
1079
ZeroPoint
1080
ZeroPointValue
1081
Zoom
1082
Properties BorderFlashColorOff
601
Properties ColorToleranceLow
641
Properties MCKQBackColorOff
832
Protecting VBA code
3

R
Reference
event handling
events
methods
object model
objects and listings
properties
VBA object model
References

205
209
209
248
205
373
542
205
3

S
Smart object

53

Index-9

Index

editing with VBA
Standard object
editing with VBA
Starting
VBA editor
VBA macros
Symbol library
access with VBA
copying object with VBA
creating folder with VBA
deleting folder with VBA
editing with VBA
inserting object into picture with VBA

11.05

55
53
55
7
3
7
36
36
39
39
39
39
42

T
Tag
129
changing limits with VBA
129
changing the type with VBA
129
creating with VBA
129
deleting with VBA
129
reading out limits with VBA
129
reading out properties with VBA
129
specifying the type with VBA
129
Tag Logging
142
creating a process value archive
with VBA
142
creating an archive tag with VBA
142
deleting a process value archive
with VBA
142
deleting an archive tag with VBA
142
editing a process value archive
with VBA
142
editing an archive tag with VBA
142
Text Library
174
changing text with VBA
174
deleting text with VBA
174
displaying a text ID with VBA
174
displaying text with VBA
174
generating a language with VBA
174
generating text with VBA
174
Toolbar
13, 44
adding tool icon
25
application-specific
13
assigning help text
28
assigning status text
28
assigning VBA macro
31
configuring
35
creating
23
picture-specific
13, 44
positioning
13
properties
13
user-defined
13
Triggers
99

Index-10

configuring with VBA
picture cycle
standard cycle
tag
window cycle

99
100
100
100
100

U
User
User interface language
access with VBA
User-defined menu
adding menu item
assigning help text
assigning status text
assigning VBA macro
configuring
creating
creating in multiple languages
positioning
properties
User-defined toolbar
adding tool icon
assigning help text
assigning status text
assigning VBA macro
configuring
creating
positioning
properties

11
11
7, 13
17
28
28
31
35
15
20
13
13
7, 13
25
28
28
31
35
23
13
13

V
VB script
88, 97
dynamizing a property with VBA
88
VBA
1, 7, 205
access to a copy of a picture
44
access to component library
36
access to external applications
106
access to group object
63
access to layers
44
access to MS Excel with VBA
107
access to objects in
Graphics Designer
51
access to other programs
106
access to symbol library
36
action configuration
90
adding menu item to
user-defined menu
17
adding tool icon to
user-defined toolbar
25
Alarm Logging
188

Printout of the Online Help
Automated Configuring

11.05

Index

assigning help text to a
user-defined menu
28
assigning help text to a
user-defined toolbar
28
assigning VBA macro to
user-defined menu
31
assigning VBA macro to
user-defined toolbar
31
C scripts (differentiation)
2
configuration for several languages 11
configuration language
11
configuring a C action on an event
95
configuring a VB action on an event 97
configuring direct connection
92
configuring event-controlled actions 90
configuring triggers
99
configuring user-defined menu
35
configuring user-defined toolbar
35
controlling visibility of layers
47
create group object
65
creating a user-defined menu
15
creating an application-specific menu 15
creating application-specific toolbar 23
creating user-defined menu in
multiple languages
20
creating user-defined toolbar
23
customized object
72
delete group object
65
deployment
2
dynamic wizards (differentiation)
2
dynamization
77
dynamization of properties
79
dynamizing a property with a
VB script
88
Dynamizing a Property with C Script 86
dynamizing a property with the
Dynamic dialog
84
edit group object
65
editing a copy of a picture
49
editing a customized object
74
editing a picture
44
editing a smart object
55
editing a standard object
55
editing a Windows object
55
editing component library
39
editing layers
47
editing objects in a group object
69
editing objects in Graphics Designer 51
editing symbol library
39
event handling
103
executing VBA macros
7
exporting code
6
global VBA code
3
group object
63
HMIGO class
127

Printout of the Online Help
Automated Configuring

importing code
in other WinCC editors
in the Graphics Designer
inserting ActiveX control in picture
inserting an object in a picture
inserting object from
component library into picture
inserting object from
symbol library into picture
language of the user interface
language-dependent configuration
object editing in Graphics Designer
ODK (differentiation)
OLE object
picture-specific VBA code
project-specific VBA code
Tag Logging
tag management
Text Library
ungroup group object
user-defined menu
user-defined toolbar
VB scripts (differentiation)
VBA action
configuring on an event with VBA
VBA code
exporting
global
importing
order of execution
organization in WinCC project
password protection
picture-specific
project-specific
protecting
references
VBA editor
starting
VBA Events
see " Event handling "
VBA event handling
VBA in the Graphics Designer
VBA macros
execution
special features on execution
VBA reference
event handling
events
methods
object model
objects and listings
properties
VBA object model

6
127
9
61
53
42
42
11
11
51
2
59
3
3
142
129
174
65
13
13
2
97
6
6
3
6
3
3
3
3
3
3
3
3
3
209
209
209
9
7
3
209
209
248
205
373
542
205

Index-11

Index

11.05

W
Windows object
editing with VBA

Index-12

53
55

Printout of the Online Help
Automated Configuring